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@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Daniel Tryba Sent: viernes, 04 de abril de 2014 10:46 To: sr-users@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.