PJSIP syntax error exception when parsing 'Via' header

I have some fairly frequent occurrences where I pick up an incoming call and the call drops right away. It doesn’t even show up in the CDR reports in FreePBX. But the log shows the following:

[2021-03-30 09:32:06] ERROR[2366] pjproject: sip_transport.c Error processing 805 bytes packet from UDP 192.168.1.1:5060 : PJSIP syntax error exception when parsing 'Via' header on line 2 col 110:
SIP/2.0 200 OK

From: "PHOENIX, AZ" <sip:[email protected]>;tag=c8bcb451-598b-46c8-9816-f26268ed0f40
To: <sip:[email protected]>;tag=bce76a55b9555c0
Call-ID: f0fe049b-a256-4f17-a815-2fb01fe152b9
CSeq: 15560 INVITE
Contact: <sip:[email protected]:5060;transport=UDP>
User-Agent: Sangoma S705 V3.0.4.79
Allow: INVITE, ACK, UPDATE, INFO, CANCEL, BYE, OPTIONS, REFER, SUBSCRIBE, NOTIFY, MESSAGE, PRACK
Content-Type: application/sdp
Content-Length: 212

v=0
o=- 6666 46 IN IP4 192.168.1.137
s=SIP Call
c=IN IP4 192.168.1.137
t=0 0
m=audio 12178 RTP/AVP 0 101
a=sendrecv
a=rtpmap:0 PCMU/8000
a=ptime:20
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-11,16

-- end of packet.

Any idea how to fix this?

It’s a malformed SIP packet. There should not be a blank line after SIP/2.0 200 OK; it should be a Via: header as PJSIP is saying. Who’s giving this 200 reply?

If ext. 9008 is on the same LAN as the PBX, I’m guessing that it’s registering to the public IP and the router/firewall is hairpinning incorrectly.

Or, if the phone is remote and connecting via VPN on the router/firewall (rather than VPN server on the PBX), there is likely a buggy SIP ALG.

Please explain the networking setup. It would also be useful to post the INVITE sent to the extension, to which the bad 200 was a reply.

This might be my problem. Ext. 9008 is on the same LAN as the PBX server but was using a template that was using the external address for the SIP destination address and Provisoning address. I’ve corrected this, hopefully that fixes it.
Thanks!

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