Has anybody experienced having uac_replace_from() concatenate the old from: value after the new domain?
for example: From: "user1" user1@domain.com
becomes From: "user2" user2@domain.comuser1
Kelvin Chua
I've seen this when calling uac_replace_from twice, which you cannot do.
On 4 April 2014 01:29:51 CEST, Kelvin Chua kelchy@gmail.com wrote:
Has anybody experienced having uac_replace_from() concatenate the old from: value after the new domain?
for example: From: "user1" user1@domain.com
becomes From: "user2" user2@domain.comuser1
Kelvin Chua
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Sent from my mobile, and thus lacking in the refinement one might expect from a fully fledged keyboard.
Alex Balashov - Principal Evariste Systems LLC 235 E Ponce de Leon Ave Suite 106 Decatur, GA 30030 United States Tel: +1-678-954-0671 Web: http://www.evaristesys.com/, http://www.alexbalashov.com
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.
what i did was to put uac_replace_from() in branch_route instead of route[RELAY]
however, i also tried it on route[RELAY] but it is still the same problem.
i placed an xlog() just before uac_replace_from() to make sure that it is not called twice while doing ngrep to inspect the outgoing packet. using this experiment, i can conclude that it is indeed just once.
I am curious on your method daniel, what do you mean by "store the changes in avps and commit the changes" ?
Kelvin Chua
On Fri, Apr 4, 2014 at 1:46 AM, Daniel Tryba daniel@pocos.nl wrote:
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@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On Friday 04 April 2014 23:23:49 Kelvin Chua wrote:
I am curious on your method daniel, what do you mean by "store the changes in avps and commit the changes" ?
Any modifications I want to make to from are set in $avp(uacfromdisplay) and/or $avp(uacfromuri), eg for an anonymous outbound call:
else if($rU=~"^131[0-9]+$") { strip(3);
append_hf("Privacy: id\r\n");
$avp(uacreplacefromdisplay)=1; $avp(uacfromdisplay)="anonymous";
$avp(uacreplacefromuri)=1; $avp(uacfromuri)="sip:anonymous@anonymous.invalid:"+$rp; }
and in route [RELAY] they are actually commited:
if($avp(uacreplacefromdisplay) && $avp(uacreplacefromuri)) { uac_replace_from("$avp(uacfromdisplay)","$avp(uacfromuri)"); $avp(uacreplacefromdisplay[*])=$null; $avp(uacreplacefromuri[*])=$null; } else { if($avp(uacreplacefromdisplay)) { uac_replace_from("$avp(uacfromdisplay)",""); $avp(uacreplacefromdisplay[*])=$null; } if($avp(uacreplacefromuri)) { uac_replace_from("$avp(uacfromuri)"); $avp(uacreplacefromuri[*])=$null; } }
This way you can make multiple "changes" during call routing logic and be sure there is only 1 call to the uac_replace_from/to functions.
i'm not sure if uac_replace_from is a proper tool for anonymizing a call. it is not enough that you anonymize initial invite. you also have to handle in-dialog requests from the caller.
-- juha
The stateful replacement functionality takes care of that.
On 7 April 2014 13:28:13 CEST, Juha Heinanen jh@tutpro.com wrote:
i'm not sure if uac_replace_from is a proper tool for anonymizing a call. it is not enough that you anonymize initial invite. you also have to handle in-dialog requests from the caller.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Sent from my mobile, and thus lacking in the refinement one might expect from a fully fledged keyboard.
Alex Balashov - Principal Evariste Systems LLC 235 E Ponce de Leon Ave Suite 106 Decatur, GA 30030 United States Tel: +1-678-954-0671 Web: http://www.evaristesys.com/, http://www.alexbalashov.com
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.