I'm using Kamailio 4.4. I need to overwrite call information: From header domain. sip.twilio.com to pstn.mycompany.io. Example:
From: "+16501112222" <sip:[email protected]>
to
From: "+16501112222" <sip:[email protected]>
Call flow:
Twilio (SP1) --> MyCompany --> SP2
Twilio SIP -> Calls: sip:[email protected] -> Kamailio -> Kamailio look up table and convert sip:[email protected] to sip:[email protected] using dbaliases to send call to SP2.
Client in SP2 sees the call coming from Twilio. In order to redirect SIP Call to SP2, Kamailio performs a DNS lookup. I tried the following luck, although I see this code being executed. Using Kamailio default call script.
branch_route[MANAGE_BRANCH] {
if($fd=~"sip\.twilio\.com") {
xlog("L_INFO","|Masking Twilio call from: $fu");
$fd = "pstn.mycompany.io";
}
xdbg("new branch [$T_branch_idx] to: $ru from: $fu\n");
route(NATMANAGE);
}