Salut Patrick
since you want to apply manipulation on the new user received from 300 response you need to use branch_route for this. thats one of his purpose.
So that is what I attempted...
if (t_check_status("(301)|(302)") or (t_branch_timeout() and !t_branch_replied())) { t_on_branch("TEST_BR"); route(IMP_ROUTE_TO_CORE); exit; }
branch_route[TEST_BR] { xlog("L_ERR", "$cfg(route): HERE WE ARE\n"); # To verify via logs this was triggered $fU = "+41441234567"; }
I still end up with +41441234567 being appended to the From User HF I have set previously for the invite towards the CPE which then replied with 302
For better understanding, this is the situation:
We want to use e164 on the 'core' as this is the format we have defined as 'normalized' format and which is also in use on IC to other TSP. Only to/from the customer CPE we translate numbers to from the mostly used national format.
Basically replacing +41 with '0' and + with '00' and the other way round.
So in this example From user is +41441234567 and location lookup is performed. Then From user is translated to 0441234567 to reflect the national notation and display the callerID in a usual format to the customer.
But when I get a 302 from that CPE and need to send the call back on an IC. I want to preserve the original From: username and translate it back to e164. But as I already have set $fU = "0441234567" when I do an additional $fU = "+41441234567" in branch_route, I and up with
From: "John Doe" 0441234567+41441234567@sip.example.com;user=phone
as setting $fU is APPENDING. No matter if I do this on a failure route or a branch route.
Or did I miss a trick? :-)
Would I need to also use branch_route to send the initial call towards the customer CPE and set the 'localized' $fU there? Is this message being dropped and the original one used again when triggering failure_route? Is this how it's supposed to work?