[OpenSIPS-Users] redirect server and paralel forking using registrar module

Bogdan-Andrei Iancu bogdan at opensips.org
Sun Jun 29 14:34:25 CEST 2014


Hi Carlos,

Registrar module, after successfully doing lookup() will push the 
registered contacts into RURI and branches. So you do not need to do 
anything special aside sending the 3xx reply. RURI and branches are 
already populated.

....
if (lookup("location") ) {
send_reply("300", "Redirect");
     exit;
}
.....

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 27.06.2014 20:33, Carlos Oliva wrote:
> Hello!
>
> I'm trying to implement a redirect server based in example of:
> https://github.com/OpenSIPS/opensips/blob/master/examples/redirect.cfg
> but I have one doubt:
>
> If I use usrloc and registrar module, How can I know if there are one
> or more AORs?
>
> In the example Bogdan do:
>
> # rewrite current URI, which is always part of destination ser
> rewriteuri("sip:parallel at siphub.net:9");
> # append one more URI to the destination ser
> append_branch("sip:redirect at siphub.net:9");
> # redirect now
> sl_send_reply("300", "Redirect");
>
> But if I use lookup to get the AORs, how can I know if there are only
> one AOR and I must send a 302 or many AORs and I must send a 300? and,
> how can i know how many append_branch I must do?
>
> In the registrar module documentation I read about b flag in lookup:
>
> "If there are multiple contacts for the given username in usrloc and
> this flag is not set, Request-URI will be overwritten with the
> highest-q rated contact and the rest will be appended to sip_msg
> structure and can be later used by tm for forking"
>
> but I don't know if there is any "automatic" way of doing the branches
> before sending the 300 or 302 response or I must count the AORs and
> manually do as many branches as needed.
>
> any hints?
>
> Regards,
>
> Carlos Oliva
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>




More information about the Users mailing list