[SR-Users] Remove m=video from SDP header

phillman25 phillman25 at gmail.com
Mon Aug 13 09:52:04 CEST 2012


Dear List

I am trying to remove specific lines from the following original SDP body:


Content-Type: application/sdp
Content-Length: 406

v=0
o=root 3048 3048 IN IP4 xxx.xxx.xxx.xxx
s=session
c=IN IP4 xxx.xxx.xxx.xxx
b=CT:384
t=0 0
m=audio 11904 RTP/AVP 0 8 18 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
m=video 11602 RTP/AVP 34 99
a=rtpmap:34 H263/90000
a=rtpmap:99 H264/90000
a=sendrecv




I need to remove the following lines from the above SDP body as my
International carrier does not support Video capabilities:

m=video 15042 RTP/AVP 34 99
a=rtpmap:34 H263/90000
a=rtpmap:99 H264/90000



I used the following code in Kamailio config:

if(has_body("application/sdp") && search_body("m=video")){

                   subst_body('#m=video ([0-9]+) RTP/AVP (.*)$# #');

                   subst_body('#a=rtpmap:34 (.*)$# #');

                   subst_body('#a=rtpmap:99 (.*)$# #');

                   subst_body('#a=sendrecv(.*)$# #');

        }




Content-Type: application/sdp
Content-Length: 325
P-hint: outbound
v=0
o=root 3048 3048 IN IP4 xxx.xxx.xxx.xxx
s=session
c=IN IP4 xxx.xxx.xxx.xxx
b=CT:384
t=0 0
m=audio 11904 RTP/AVP 0 8 18 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv


As you can see the m=video body has been removed, however, calls are still
failing. Is there something i have missed?

I am using Kamailio v3.2.2


Thanking you in advance!

Phillip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20120813/7b84eb23/attachment.htm>


More information about the sr-users mailing list