PJSIP syntax error exception when parsing 'Request Line' header

I have changed default port 5060 and allowed rtp range both tcp/udp. Looking at request from client it is UDP, length 50 and 719 after , but server side only receives 46 bytes or less. This problem occurs on Zoiper. Linphone registers and calls without issue, also physical phone request doesn’t appear on screen

ERROR[1201555]: pjproject: <?>: sip_transport.c Error processing 46 bytes packet from UDP XX.XXX.XX.XX:XXXXX : PJSIP syntax error exception when parsing ‘Request Line’ header on line 1 col 1:
> 9�
– end of packet.

[transport]
type=transport
protocol=udp
bind=XX.XXX.XXX.XXX:XXXXX
external_media_address=XX.XXX.XXX.XXX
external_signaling_address=XX.XXX.XXX.XXX

[0000]
type=endpoint
transport=transport
context=dom
disallow=all
allow=ulaw
auth=dom
aors=0000
direct_media=no
rtp_symmetric=yes
force_rport=yes
rewrite_contact=yes

[dom]
type=auth
username=0000
password=0000
auth_type=userpass

[0000]
type=aor
max_contacts=10

So what does the packet actually look like?

Client sends it.

13:36:38.797140 IP Vivo.45727 > XX.XXX.XXX.xxx.XXXXX: UDP, length 50
E..N..@.@..4…e{d..#..:…@…0000…<6.$.Z 5.6.11 v2.10.20.11-mod
13:36:38.967136 IP Vivo.48293 > XX.XXX.XXX.xxx.XXXXX: Flags [S], seq 236394268, win 64240, options [mss 1460,sackOK,TS val 605233275 ecr 0,nop,wscale 7], length 0
E..<~@.@.p…e{d..#…}…
$. {…
13:36:39.037614 IP Vivo.45727 >
XX.XXX.XXX.xxx.XXXXX: UDP, length 50
E..N.R@.@…e{d..#..:;..@…0000…<6.$.Z 5.6.11 v2.10.20.11-mod
13:36:39.043928 IP
XX.XXX.XXX.xxx.XXXXX > Vivo.48293: Flags [S.], seq 2474300536, ack 236394269, win 65160, options [mss 1460,sackOK,TS val 1226038334 ecr 605233275,nop,wscale 7], length 0
E..<..@.3..B.e{d…#…z.x…
I..>$. {…
13:36:39.043970 IP Vivo.48293 >
XX.XXX.XXX.xxx.XXXXX: Flags [.], ack 1, win 502, options [nop,nop,TS val 605233352 ecr 1226038334], length 0
E..4
.@.@.p…e{d..#…z.y…2…
$. .I..>
13:36:39.044025 IP Vivo.48293 > XX.XXX.XXX.xxx.XXXXX: Flags [P.], seq 1:720, ack 1, win 502, options [nop,nop,TS val 605233352 ecr 1226038334], length 719
E…_.@.@.m…e{d..#…z.y…x…
$. .I..>REGISTER sip:XX.XXX.XXX.xxx.XXXXX;transport=TCP SIP/2.0
Via: SIP/2.0/TCP 192.168.0.8:51450;branch=z9hG4bK-524287-1—07d13907a9623112;rport
Max-Forwards: 70
Contact: <sip:0000@192.168.0.8:51450;rinstance=020f3eff40b43b9b;transport=tcp>
To: <sip:0000@>(Destination IP)<;transport=TCP>
From: <sip:0000@>(Destination IP)<;transport=TCP>;tag=5fc45b5d
Call-ID: CcAdn_1lxmEJSpM6sK8dqw..
CSeq: 1 REGISTER
Expires: 70
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Supported: replaces, norefersub, extended-refer, timer, sec-agree, outbound, path, X-cisco-serviceuri
User-Agent: Z 5.6.11 v2.10.20.11-mod
Allow-Events: presence, kpml, talk, as-feature-event
Content-Length: 0

Server receives:
13:42:48.149581 IP 91-57-219-89-pppoe-dynamic-ip.ultel-dot-net.45727 > ubuntu-s-2vcpu-4gb-fra1-01.9137: UDP, length 50
13:42:48.383997 IP 91-57-219-89-pppoe-dynamic-ip.ultel-dot-net.47135 > ubuntu-s-2vcpu-4gb-fra1-01.9137: Flags [S], seq 581526270, win 64240, options [mss 1460,sackOK,TS val 605602631 ecr 0,nop,wscale 7], length 0
13:42:48.384089 IP ubuntu-s-2vcpu-4gb-fra1-01.9137 > 91-57-219-89-pppoe-dynamic-ip.ultel-dot-net.47135: Flags [S.], seq 2371128623, ack 581526271, win 65160, options [mss 1460,sackOK,TS val 1226407685 ecr 605602631,nop,wscale 7], length 0
13:42:48.388663 IP 91-57-219-89-pppoe-dynamic-ip.ultel-dot-net.45727 > ubuntu-s-2vcpu-4gb-fra1-01.9137: UDP, length 50
13:42:48.469284 IP 91-57-219-89-pppoe-dynamic-ip.ultel-dot-net.47135 > ubuntu-s-2vcpu-4gb-fra1-01.9137: Flags [.], ack 1, win 502, options [nop,nop,TS val 605602717 ecr 1226407685], length 0
13:42:48.548831 IP 91-57-219-89-pppoe-dynamic-ip.ultel-dot-net.45727 > ubuntu-s-2vcpu-4gb-fra1-01.9137: UDP, length 50
13:42:48.950368 IP 91-57-219-89-pppoe-dynamic-ip.ultel-dot-net.45727 > ubuntu-s-2vcpu-4gb-fra1-01.9137: UDP, length 50
13:42:49.752495 IP 91-57-219-89-pppoe-dynamic-ip.ultel-dot-net.45727 > ubuntu-s-2vcpu-4gb-fra1-01.9137: UDP, length 50
13:42:51.355597 IP 91-57-219-89-pppoe-dynamic-ip.ultel-dot-net.45727 > ubuntu-s-2vcpu-4gb-fra1-01.9137: UDP, length 50
13:42:54.565023 IP 91-57-219-89-pppoe-dynamic-ip.ultel-dot-net.45727 > ubuntu-s-2vcpu-4gb-fra1-01.9137: UDP, length 50

The UDP packets do not contain SIP. There is a TCP packet which appears to.

changed udp to tcp at transport section in pjsip.conf . Now * server doesn’t output anything at registration but tcpdump shows packets incoming.

5060 DENY Anywhere
XXXXX ALLOW Anywhere
XXXXX/udp ALLOW Anywhere
XXXXX/tcp ALLOW Anywhere
10000:20000/udp ALLOW Anywhere
10000:20000/tcp ALLOW Anywhere

After reading that How to Change SIP Port 5060 UDP to TCP - #3 by satish4asterisk
added tcpenable=yes and tcpbindaddr to general but still no response. For correction, that tcpdump of client also contains udp packets later, it is sending from Zoiper.

I have searched a little bit. So is it possible that SIP ALG corrupts whole packet? Even thought i didn’t look at router settings yesterday that alg is enabled or not. If yes is stun servers may help to problem. One more thing is after changing port back to default, sip arrived once. Later become corrupted again

It’s certainly possible though I wouldn’t expect such a trashed packet - usually it just breaks the SIP in other ways. STUN wouldn’t do anything, as that is used for IP address/port discovery.

1 Like

I don’t know exactly how, but maybe iptables allow , made packets arrive fully.

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