Hello,
We used tcpdump to capture packets on our Asterisk server (with videosupport=yes in sip.conf) while making an audio call between peer A (peera) and peer B (peerb). Both peers are on the same WIFI network behind NAT. Asterisk is on a public IP. Both peers are Android PJSIP clients with video support. As captured and shown in the wireshark logs below, peer A (who wants to make an audio-only call) is sending an m=audio line in the INVITE SDP and no m=video line. For some unknown reason, Asterisk is adding an m=video line to the INVITE SDP it resends to peer B. Why is this happening?
Peer A wants to make an audio-only call and sends an INVITE message with no m=video line in SDP. Asterisk replies to peer A with a Trying
message before sending an INVITE message containing an m=video line to peer B, causing peer B to open a blank video view! Why did Asterisk add the m=video line?
Here’s the logs from tcpdump as exported from wireshark:
PEER A -> ASTERISK:
INVITE sip:peerb@XX.XX.XX.97:5060 SIP/2.0
v: SIP/2.0/UDP XX.XX.XX.130:49615;rport;branch=z9hG4bKPj3dbfb3cb-d350-4952-bee0-21ee6c7ac873
Max-Forwards: 70
f: sip:peera@XX.XX.XX.97;tag=5f59f8f7-52b6-451b-b780-90e5fa894533
t: sip:peerb@XX.XX.XX.97
m: <sip:peera@XX.XX.XX.130:49615;ob>;+sip.ice
i: 3eb4058e-4b52-47d3-9ed2-293b5331fee9
CSeq: 5422 INVITE
k: replaces, 100rel, timer, norefersub
x: 1800
Min-SE: 90
User-Agent: Pjsua2 Android 2.6
Authorization: Digest username="peera", realm="asterisk", nonce="3d698d99", uri="sip:peerb@XX.XX.XX.97:5060", response="d251a412f8d583a62d515f20fb6f1cd6", algorithm=MD5
c: application/sdp
l: 483
v=0
o=- 3709617507 3709617507 IN IP4 XX.XX.XX.30
s=pjmedia
b=AS:84
t=0 0
a=X-nat:0
m=audio 33072 RTP/AVP 98 97 99 104 18 3 0 8 9 96
c=IN IP4 XX.XX.XX.30
b=TIAS:64000
b=RS:0
b=RR:0
a=sendrecv
a=rtpmap:98 speex/16000
a=rtpmap:97 speex/8000
a=rtpmap:99 speex/32000
a=rtpmap:104 iLBC/8000
a=fmtp:104 mode=30
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-16
a=ice-ufrag:2437b648
a=ice-pwd:23d8c8bc
a=candidate:Hac100e1e 1 UDP 2130706431 XX.XX.XX.30 33072 typ host
ASTERISK -> PEER A: 100 Trying
Then, ASTERISK -> PEER B:
INVITE sip:peerb@XX.XX.XX.130:35594;ob SIP/2.0
Via: SIP/2.0/UDP XX.XX.XX.97:5060;branch=z9hG4bK1f5541ee;rport
Max-Forwards: 70
From: "peera" <sip:peera@XX.XX.XX.97>;tag=as1de3d919
To: <sip:peerb@XX.XX.XX.130:35594;ob>
Contact: <sip:peera@XX.XX.XX.97:5060>
Call-ID: 0b40165376da4a05423e108942e73ef7@XX.XX.XX.97:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 13.1.0~dfsg-1.1ubuntu4.1
Date: Fri, 21 Jul 2017 09:18:25 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 446
v=0
o=root 1195287468 1195287468 IN IP4 XX.XX.XX.97
s=Asterisk PBX 13.1.0~dfsg-1.1ubuntu4.1
c=IN IP4 XX.XX.XX.97
b=CT:384
t=0 0
m=audio 11766 RTP/AVP 110 97 9 18 101
a=rtpmap:110 speex/8000
a=rtpmap:97 iLBC/8000
a=fmtp:97 mode=0
a=rtpmap:9 G722/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:30
a=sendrecv
m=video 17896 RTP/AVP 99
a=rtpmap:99 H264/90000
a=sendrecv
Can anyone please explain why this is happening and how we may prevent the m=video line from being added to the second INVITE sent from Asterisk to peer B?
Thanks
Patrick