Dear Gang
Possibly @oej could provide more in-depth information as he has witnessed this issue.
Usually the user of the from URI is the phone number displayed at the destination. There are situations where this phone number is translated. As example. In Switzerland, the user is used to see numbers in a local format. National number starting with 0 and international numbers with 00 but on interconnection between telcos, e164 is used. So basically when a call is sent to a customer '+41' is replaced by '0' and '+' is replaced by '00'.
Let's start with an example From: header:
`From: "Maurice Moss" sip:+41991234567@example.com;user=phone`
So shortly before the call is sent out to the location of the registered CPE, this is done:
``` if ($fU =~ "^+41") { $fU = "0" + $(fU{s.substr,3,0}); } else if ($fU = ~ "^+") { $fU = "00" + $(fU{s.substr,1,0}); } ```
What is sent to the CPE now looks like this:
`From: "Maurice Moss" sip:0991234567@example.com;user=phone`
Now we hit an error like 486 BUSY and the destination has call forwarding active to a mobile phone on another TSP. So we have to send the call out back the IC and numbers need to be translated back to e164.
We handle this in a failure route, which in turn could trigger a branch route.
So we revert the number back to e164:
`$fU = "+41" + $(fU{s.substr,1,0});`
Expected outcome:
`From: "Maurice Moss" sip:+41991234567@example.com;user=phone`
Observed outcome:
`From: "Maurice Moss" sip:0991234567+41991234567@example.com;user=phone`
So setting $fU more than once is appending to the user element of the From header URI.
This behavior has not been found in any documentation.
I have been working around most of the issues by making sure I change $fU (and $tU) at the latest possible time and only once. But in the case described above, I have not been able to come up with a work-around yet.
I also can't think of any benefit of the way those PV are handled or any harm that could be done, to handle them differently and make the last 'write' overwrite and previous value, instead of appending.
Thank you for looking into this.
-Benoît-
For questions about how to use Kamailio and its configuration file, you have to send email to sr-users@lists.kamailio.org . The bug tracker is for reporting issue in the code.
Closed #3165 as completed.