[OpenSIPS-Users] How to invok lookup() and get attr from the caller, without side effects?

Răzvan Crainea razvan at opensips.org
Tue Jun 21 09:24:00 CEST 2016


Hi, Rodrigo!


Have you tried restoring the R-URI after the caller lookup? Something like:


$var(ru) = $ru;

lookup("location", "", "$fu"); # this takes the caller from FROM uri, 
which I think is more suitable than from contact uri

$ru = $var(ru);

# continue your processing here

....

# now do the real lookup for the callee

lookup("location");


Don't do the lookups in the reversed way, because you might loose some 
contacts.


Best regards,

Răzvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com

On 06/20/2016 09:02 PM, Rodrigo Pimenta Carvalho wrote:
>
> Dear OpenSIPS-users,
>
>
> The table location has the column attr where I use to store specific 
> additional information for each registration.
>
> Whenever A calls B, I have to read this specific information from the 
> A record and from the B record. That is, I need to get and handle 
> specific information about the caller and callee.
>
>
> For the callee, I use to invoke the lookup("location") function that 
> put the needed information in the attr_avp. That is good and works 
> very well. Then, I just have to read the attr_avp to get such specific 
> information.
>
>
> For the caller, I use to invoke:
>
>
> $var(aorChamador) = $(ct.fields(uri));
>
> lookup("location","","$var(aorChamador)");
>
>
> However it causes amazing side effect in the SIP signaling. Ex: When A 
> calls B, B stays quiet and A rings. So A can answer A. Crazy!
>
> According to the documentation, lookup will overwritten the 
> Request-URI. I guess that is why the SIP signaling become incoherent.
>
>
> How could I get the caller attr specific information without side effects?
>
>
> Any hint will be very helpful!!
>
>
> Best regards.
>
>
> RODRIGO PIMENTA CARVALHO
> Inatel Competence Center
> Software
> Ph: +55 35 3471 9200 RAMAL 979
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20160621/e2a33156/attachment.htm>


More information about the Users mailing list