[OpenSIPS-Users] use branches with uac_replace_from?

Edwin Haselhoff eahaselhoff at gmail.com
Mon Jan 27 13:05:12 CET 2014


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'?



More information about the Users mailing list