Trunk headers manipulation

Hello,
I’m on FreePBX 14.0.11
My sip provider restricts the “From:” header in the INVITE to exactly match the “From:” header in the REGISTER message.
In my case, the “From:” headers look like this:
REGISTER:
From: <sip: myusername @ myprov. com>;tag = blablabla
INVITE:
From: <sip: myusername @ myprov. com:5160>;tag = as0e796078>; tag = anotherblablabla

As we see here, the asterisk adds “: 5160” to the INVITE.
And my provider declares that this behavior (then “From:” is different in “INVITE” and “REGISTER”) is not an RFC valid and rejects my “INVITES”.
If I switch chan_sip from the default port 5160 to port 5060 (and disable pjsip), then everything works.
But I can’t change the default port for chan_sip, because I already have tons of sip clients configured on port 5160.
I killed a few hours for:

  1. tried to remove the postfix “:5160” from the header, manipulating the sip parameters for the trunk. Unsuccessful.
  2. tried to add the postfix “:5160” in the header, manipulating the sip registration string. No luck.
  3. In the Dial application, there is an option that allows to change the header, but I do not know how I can change it in FreePBX for a particular trunk.
  4. tried to use pjsip for this provider, but failed. My provider expects a username in the form [email protected], but pjsip does not like it and complains:
    Unable to create outbound OPTIONS request to endpoint myprovname as URI ‘sip:[email protected]@[email protected]:5060’ is not valid
  5. Google, no answers.

I do not want to make changes directly to the asterisk configuration files, as this does not seem to be the right way.
As a workaround, I will create a gateway with a clean asterisk between freepbx and the provider, but I don’t like this solution too.

Can someone provide an easy way to change the header either in the invite or register messages for my case?
Any other help is appreciated.

Thank you!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.