SIP Header Manipulation

I know the question has been asked, but I can’t get a straightforward, clear answer on this topic. Setting up with a new ISP for our phones, and need to do a bunch of testing etc first. Main problem is the headers that are sent out from PBX are not accepted. Here’s the reply from ISP,

Here’s what you’re sending

INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP xxx.xxx.xxx.xxx:5060;branch=z9hG4bK65d3116f;rport
Max-Forwards: 70
From: “BELL_TEST” sip:[email protected];tag=as35cd392a
To: sip:[email protected]
Contact: sip:[email protected]:5060

If you send the calls in either these two methods you should get the 401 challenge.

TGRP Method:

INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP xxx.xxx.xxx.xxx:5060;branch=z9hG4bK65d3116f;rport
Max-Forwards: 70
From: “BELL_TEST” sip:[email protected];tag=as35cd392a
To: sip:[email protected]
Contact: sip:1234567890;tgrp=CUST5_1234567890_01A;[email protected]:5060

OTG Method:

INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP xxx.xxx.xxx.xxx:5060;branch=z9hG4bK65d3116f;rport
Max-Forwards: 70
From: “BELL_TEST” sip:[email protected];otg=CUST5_1234567890_01A;tag=as35cd392a
To: sip:[email protected]
Contact: sip:[email protected]:5060

So, for TGRP, the “From” and “Contact” parts need to be modified to include the correct header, and OTG needs to only have the “From” header modified.

So is there an easy way to do this through freepbx, or is the end answer going to be the need for a SBC to handle all of this?

i wouldnt call doing it in freepbx easy. any sbc would make it almost trivial, gui or even non-gui
header manipulation in freepbx is a dark art

that said, im going to watch as well, and maybe learn something.

This may be much easier than you think, since the only requirement is modifying the From header. The forum ate your < and > symbols but I think the tag belongs within, so:

PJSIP trunk - PJSIP settings - Advanced -

Note the \ before the ;

I tested this and Asterisk added the ;otg=… tag in both the From and Contact headers, which may not work for you, but try it and see.

2 Likes

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