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

Rodrigo Pimenta Carvalho pimenta at inatel.br
Tue Jun 21 14:00:38 CEST 2016


Hi Razvan Crainea.


I didn't know about this possibility.


I will try this idea now.


Thank you very much!!


Best regards.



RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979


________________________________
De: users-bounces at lists.opensips.org <users-bounces at lists.opensips.org> em nome de Razvan Crainea <razvan at opensips.org>
Enviado: terça-feira, 21 de junho de 2016 04:24
Para: users at lists.opensips.org
Assunto: Re: [OpenSIPS-Users] How to invok lookup() and get attr from the caller, without side effects?


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,

Razvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com<http://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<mailto: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/cfc3358c/attachment.htm>


More information about the Users mailing list