I have two SIP clients ( "A" and "B" ) connected to asterisk on generic bridge mode.
"A"'s video is playing back on "B" but "B"'s video is NOT playing back on "A". I triple checked with wireshark that the media ( audio / video ) is arriving at "A"'s ip address. Audio is working well on both sides.
My best guess is that this issue is related to asterisk's internal SDP handling.
So, lets delve into the problem.
"A" sends the followind INVITE:
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.7.225:10074;branch=z9hG4bK-224696310;rport
From: "danflu-portsip"<sip:[email protected]>;tag=87652133
To: <sip:[email protected]>
Contact: <sip:[email protected]:10074;transport=udp>;
Call-ID: YTc0NDRjNDYtMWRhMS01MzE2LWVlNDEtYmV
CSeq: 1354707857 INVITE
Content-Type: application/sdp
Content-Length: 447
Max-Forwards: 70
Authorization: Digest username="danflu-portsip",realm="asterisk",nonce="5ac40c6d",uri="sip:[email protected]",response="fae8a78ba97 2f6cb0c76846d76f13786",algorithm=MD5
User-Agent: PortSIP SDK for IOS
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, REGISTER, SUBSCRIBE, INFO
P-Preferred-Identity: <sip:[email protected]>
Supported: 100rel
v=0
o=portsip 2013 678901 IN IP4 192.168.7.225
s=-
c=IN IP4 192.168.7.225
t=0 0
m=audio 20554 RTP/AVP 8 0 97 18
a=ptime:20
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:97 SPEEX/8000
a=rtpmap:18 g729/8000
a=fmtp:18 annexb=yes
a=sendrecv
a=ssrc:258325709 cname:258325709
m=video 29350 RTP/AVP 104
a=rtpmap:104 H264/90000
a=fmtp:104 profile-level-id=42801E; packetization-mode=1
a=sendrecv
a=ssrc:1956389748 cname:1956389748
and receives a "200 OK" message from Asterisk:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.7.225:10010;branch=z9hG4bK-282879312 received=192.168.7.225;
rport=10010
From: "danflu-portsip"<sip:[email protected]>;tag=539964865
To: <sip:[email protected]>;tag=as1b6086b5
Call-ID: OTE4MjM3NzUtMDIzNy1mNTM1LWM3MzYtOGZ
CSeq: 1074035624 INVITE
Server: Asterisk PBX SVN-branch-1.8-r402287M
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: <sip:[email protected]:5060>
Content-Type: application/sdp
Content-Length: 375
v=0
o=root 826339596 826339596 IN IP4 192.168.7.227
s=Asterisk PBX SVN-branch-1.8-r402287M
c=IN IP4 192.168.7.227
b=CT:384
t=0 0
m=audio 9540 RTP/AVP 8 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
m=video 7450 RTP/AVP 104
a=rtpmap:104 H264/90000
a=sendrecv
Note that the lines:
a=fmtp:104 profile-level-id=42801E; packetization-mode=1
and
a=ssrc:1956389748 cname:1956389748
simply disappeared in the response and I really think thats the reason the video is not working.
So, my question:
What API can I use to customize this behavior, so the lines above are not removed when Asterisk handles the SDP from both sides ? If there is not an official API where could I look in the code for this ? So I could maybe write a patch for my specific situation ?
I looked in chan_sip.c and there is a function:
static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action)
But I'm not sure if this SDP handling ( removing lines and the like ) is perfomed by asterisk core or by the sip channel driver.
Thanks