[SR-Users] uac_replace_from

Helena Garcia-Nieto helena.gnieto at morodo.co.uk
Tue Apr 8 16:02:11 CEST 2014


Hi!

I had similar problem and I got it finally thanks to the mailing list
support. In my case I was trying to modify TO header and when it went to the
failure route it was modified just as you told us with the FROM.

I got it by applying the modification (uac_replace_to) only once on t_branch
and in all other places updating the variable. I copy here Castern tip which
put me in the right direction. Try just the same but with from!

I hope it works for you as well as for me!

Helena

route[FROMPHONE] {
 [...]
        if(!ds_select_domain("1", "8"))
        {
                 send_reply("404", "No destination");
                 exit;
        }
        t_on_failure("FAILURE_ROUTE");
       t_on_branch("MODIFY_TO");

         subst_uri('/^sip:(.*)/sip:0199\1/i'); # add prefix to URI
        $avp(s:new_to) = "sip:0199"+$rU+"@"+"$rd";

         route(RELAY);
         exit;
}

branch_route[MODIFY_TO] {
  uac_replace_to("",  $avp(s:new_to));
}

failure_route[FAILURE_ROUTE] {
         if (t_is_canceled()) {
                exit;
        }
         if (t_check_status("500") or (t_branch_timeout() and
!t_branch_replied()))
         {
                 if(ds_next_domain())
                 {
                        t_on_failure("RTF_DISPATCH"); #in case of
                        t_on_branch("MODIFY_TO");
                        $avp(s:new_to) = "sip:"+$rU+"@"+$rd; #ru already has
the prefix
                        route(RELAY);
                        exit;
                 }
         }
}

This way, uac_replace_to() gets only called once per destination.




-----Original Message-----
From: sr-users-bounces at lists.sip-router.org
[mailto:sr-users-bounces at lists.sip-router.org] On Behalf Of Daniel Tryba
Sent: viernes, 04 de abril de 2014 10:46
To: sr-users at lists.sip-router.org
Subject: Re: [SR-Users] uac_replace_from

On Friday 04 April 2014 09:53:48 Alex Balashov wrote:
> I've seen this when calling uac_replace_from twice, which you cannot do. 

I ran into this before, and based upon recommendations here I decided to
store the changes in avps and commit the changes in route[RELAY].

That works fine until something ends up in a failure route (redirects after
a fr_inv_timeout). It appears I get double changes even though I reset the
avps after calling uac_* in RELAY so uac_* shouldn't get called for a second
time anywhere, but this is something I'll have to debug further before
making more statements.

-- 

POCOS B.V. - Croy 9c - 5653 LC Eindhoven
Telefoon: 040 293 8661 - Fax: 040 293 8658
http://www.pocos.nl/   - http://www.sipo.nl/
K.v.K. Eindhoven 17097024

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users at lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users




More information about the sr-users mailing list