[OpenSIPS-Users] Can I read "$(avp(attr)[$T_branch_idx])" in "branch_route[per_branch_ops]" ??

Rodrigo Pimenta Carvalho pimenta at inatel.br
Mon Oct 31 16:51:07 CET 2016


Hi Liviu.


Thank you.


That is the point I want to discuss!


According to the example from the documentation, the lookup() is in


route[relay] {

}


However, in my code the lookup() is in


route{


}


Even with lookup() in rout{...}, does it will populate the attributes of each branch in my "attr_avp" and I will be able to access them within branch_route?


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 Liviu Chircu <liviu at opensips.org>
Enviado: segunda-feira, 31 de outubro de 2016 12:26
Para: users at lists.opensips.org
Assunto: Re: [OpenSIPS-Users] Can I read "$(avp(attr)[$T_branch_idx])" in "branch_route[per_branch_ops]" ??


Yes, lookup() will populate the attributes of each branch in your "attr_avp", and you can access them through $T_branch_idx within branch_route. [1]


[1]: http://www.opensips.org/html/docs/modules/2.3.x/registrar.html#id293909

Liviu Chircu
OpenSIPS Developer
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 31.10.2016 16:08, Rodrigo Pimenta Carvalho wrote:


Hi.


In my project with OpenSIPS, I have the following kind of code in the configuration:


modparam("registrar", "attr_avp", "$avp(attr)")

.

.

.

if register request come from machine M1 {

   $avp(attr) = "User in M1"; //this mean that the user is behind a NAT, from the point of view OpenSIPS.

}

if register request come from machine M2 {

   $avp(attr) = "User in M2";

}

...

else{

  $avp(attr) = "User in Mx"; //this mean that there is no NAT.

}




In my opensips.cfg file I need read "$(avp(attr)[$T_branch_idx])" in the "branch_route[per_branch_ops]" .


Does $(avp(attr)[$T_branch_idx]) will give me the correct value, even if the callee is always online in several machines (M1, M2...etc) ?


So, can I discover which machine is participating in the dialog?


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/20161031/a977b258/attachment.htm>


More information about the Users mailing list