[OpenSIPS-Users] use branches with uac_replace_from?

Bogdan-Andrei Iancu bogdan at opensips.org
Fri Feb 7 13:01:55 CET 2014


Hello,

If you plan to change the FROM in different ways for each branch, you 
need to do the change in a branch_route and not in the request route - 
whatever changes you do in request route will be propagate in all 
branches. The changes you do in branch route will be vizible only in 
that branch. See:
http://www.opensips.org/Documentation/Script-Routes-1-10#toc2

So, in your script store the new FROM into an AVP variable and arm the 
branch route -> in that branch, if AVP is set, use it as input for 
uac_replace_from().

Regards,

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

On 27.01.2014 14:05, Edwin Haselhoff wrote:
> Hello Everyone,
>
> I want to use 'uac_replace_from' multiple times in my script (to use 
> for a failover situation). This is a simple example of what I want to do:
>
> route[1]
> {
>     if (method=="INVITE")
>     {
>         record_route();
>
>  uac_replace_from("","sip:anonymous at anonymous.invalid");
>         append_hf("Remote-Party-ID: 
> <sip:anonymous at anonymous.invalid>;party=calling;screen=yes;privacy=full\r\n");
>         append_hf("P-Asserted-Identity: 
> <sip:anonymous at anonymous.invalid>\r\n");
>         append_hf("Privacy: id\r\n");
>
>         t_on_failure("1");
>         t_relay();
>     }
> }
>
> route[2]
> {
>     if (method=="INVITE")
>     {
>         record_route();
>
>         uac_replace_from("","sip:A at xx.xxx.xx");
>         append_hf("Remote-Party-ID: 
> <sip:A at xx.xxx.xx>;party=calling;screen=no;privacy=off\r\n");
>         append_hf("P-Asserted-Identity: <sip:A at xx.xxx.xx>\r\n");
>
>         t_on_failure("1");
>         t_relay();
>
>         exit;
>     }
> }
>
> failure_route[1]
> {
>     route(2);
> }
>
> Reading the docs and forums I tried to use branches but I think I 
> don't understand the explanation / examples of the branches well 
> enough :)
>
> Can anyone explain / give me a hint how to change my script so I can 
> drop the first 'uac_replace_from' and 'append_hf'?
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>




More information about the Users mailing list