On May 30, 2024, at 9:58 PM, Pavan Kumar via sr-users sr-users@lists.kamailio.org wrote:
Hey everyone,
I have the following setup:
External User/Trunk <===> Kamailio <===> FreeSWITCH
I have configured FreeSWITCH and Kamailio to work only with phone numbers in E.164 format. Recently, I needed to integrate a new SIP trunk that sends phone numbers in an 11-digit US format.
My initial idea to solve this is to use Kamailio as a translator that converts 11-digit numbers to E.164 when sending to FreeSWITCH, and back to 11-digit when sending to the trunk.
Before writing the code, I want to know if there is already a solution to this problem in one of the modules, so that I won't reinvent the wheel.
Thanks, Pavan Kumar
You can check e164 with siputils is_e164 function (https://www.kamailio.org/docs/modules/stable/modules/siputils.html#siputils....) and then use uac_replace to adjust as needed.
I’m sure there are also other methods.
Regards,
Fred Posner p: +1 (352) 664-3733 https://fred.tel