TCP with PJSIP - Contact Header in Outbound Invite Message


I am facing an issue where using TCP with an endpoint causes to have random port in the Contact header when it send out an invite to the endpoint. It should be what is it listening on (5060):

Contact: sip:XXXXX@XXX.XXX.XXX.XXX:48106;transport=TCP

It should be:

Contact: sip:XXXXX@XXX.XXX.XXX.XXX:5060;transport=TCP

Is there a workaround this issue?


You need to mark your SIP samples as being preformatted text, otherwise angle bracketed items get treated as markup.


Here is what I am getting in the contact header on an outbound Invite:


And What I actually Want:


The port 46918 is a randomly chosen port.

This is an issue[1] that was found at SIPit this week. A change to fix it is currently up for review[2].