[OpenSIPS-Users] Script to get attr_avp from caller. How to do?

Rodrigo Pimenta Carvalho pimenta at inatel.br
Thu Jun 16 14:10:15 CEST 2016


Hi. Razvan Crainea.


Thank you very much!

I will try it.

As I can see, I should start by understanding the function lookup and is capabilities very well.


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: quinta-feira, 16 de junho de 2016 05:58
Para: users at lists.opensips.org
Assunto: Re: [OpenSIPS-Users] Script to get attr_avp from caller. How to do?

Hi, Rodrigo!

You can do something like this:

lookup("location","","$fu"); # note that this might fail, so you'll have
to treat this separately
$avp(caller_attr) = $avp(attr); # note that the caller might have
multiple contacts/attributes, so you'll have to handle this

Then continue with your logic, call lookup("location") and will load the
attributes of the callee, per branch, as in your snippet.

Regards,

Razvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com
[http://www.opensips-solutions.com/imgs/slideshow/slide1.jpg]<http://www.opensips-solutions.com/>

Home - OpenSIPS Solutions<http://www.opensips-solutions.com/>
www.opensips-solutions.com
OpenSIPS is a mature Open Source implementation of a SIP server. OpenSIPS is more than a SIP proxy/router as it includes application-level functionalities.



On 06/15/2016 09:36 PM, Rodrigo Pimenta Carvalho wrote:
>
> Hi.
>
>
> In my script I use to use AVP to store specific additional information
> for each registration.
>
> When I have to get  the attr_avp (Module Registrar) from the callee,
> during a call, I use to codify:
>
>
> branch_route[per_branch_ops] {
>
>                      myVariable = $(avp(attr)[$T_branch_idx]
>
> }
>
>
> What about the caller? I also need to get the attr_avp from caller, but
> I can't find a similar code in OpenSIPS documentation. How to do?
>
>
> P.S.: I'm using the configuration:  modparam("usrloc", "db_mode", 0)
>
>
> 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
>

_______________________________________________
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/20160616/2251756d/attachment.htm>


More information about the Users mailing list