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

2016-06-16 Thread Rodrigo Pimenta Carvalho
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-boun...@lists.opensips.org  em nome 
de Razvan Crainea 
Enviado: quinta-feira, 16 de junho de 2016 05:58
Para: users@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@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


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

2016-06-16 Thread Răzvan Crainea

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,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

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@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


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

2016-06-15 Thread Rodrigo Pimenta Carvalho

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@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users