Search code examples
webrtcsipsipml

How to remove unnecessary data from SIP Invite in sipML5


How can I remove unnecessary data from SIP invite in sipML5? Now it's too big when i sending it to my server (need only audio). It will accept maximum of 1,500 bytes and it must be on UDP.

Could you tell me how to do it ? how to remove some codecs, etc ? I don't know anything about it, just learning now sipML. In other posts there are answers like remove codecs, but there is no answers how to do it :)

My invite:

SEND: INVITE sip:some_client@some_address SIP/2.0
Via: SIP/2.0/WS df7jal23ls0d.invalid;branch=z9hG4bKRyhpzJOIUVBDwgMLxDIq1CAmXFZo2HkD;rport
From: <sip:some_client@some_address>;tag=hpGTFTQ0Kpt6JFgsn8Bc
To: <sip:some_number_to_call@some_address>
Contact: "undefined"<sip:[email protected];rtcweb-breaker=no;click2call=no;transport=ws>
Call-ID: 558d80b1-b383-344e-dea1-b95ddbe9dc3f
CSeq: 30366 INVITE
Content-Type: application/sdp
Content-Length: 2247
Max-Forwards: 70

v=0
o=- 3717615351353762000 2 IN IP4 127.0.0.1
s=Doubango Telecom - chrome
t=0 0
a=group:BUNDLE audio
a=msid-semantic: WMS HMFRvujnzsUIWdP6940nngmFOxrtVbMeG8nr
m=audio 52548 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 126
c=IN IP4 91.241.5.1
a=rtcp:11803 IN IP4 91.241.5.1
a=candidate:2002913928 1 udp 2122260223 192.168.81.65 52691 typ host generation 0
a=candidate:2002913928 2 udp 2122260222 192.168.81.65 58663 typ host generation 0
a=candidate:4129950780 1 udp 1686052607 91.241.5.1 52548 typ srflx raddr 192.168.81.65 rport 52691 generation 0
a=candidate:4129950780 2 udp 1686052606 91.241.5.1 11803 typ srflx raddr 192.168.81.65 rport 58663 generation 0
a=candidate:971110008 1 tcp 1518280447 192.168.81.65 9 typ host tcptype active generation 0
a=candidate:971110008 2 tcp 1518280446 192.168.81.65 9 typ host tcptype active generation 0
a=candidate:4129950780 1 udp 1686052607 91.241.5.1 44693 typ srflx raddr 192.168.81.65 rport 52691 generation 0
a=candidate:4129950780 2 udp 1686052606 91.241.5.1 47874 typ srflx raddr 192.168.81.65 rport 58663 generation 0
a=candidate:4129950780 1 udp 1686052607 91.241.5.1 22880 typ srflx raddr 192.168.81.65 rport 52691 generation 0
a=candidate:4129950780 2 udp 1686052606 91.241.5.1 19665 typ srflx raddr 192.168.81.65 rport 58663 generation 0
a=ice-ufrag:FOoiTf25RFgO/bOx
a=ice-pwd:ANc8oBQwW5zwBMd9lK2slJNN
a=fingerprint:sha-256 78:A2:A4:13:11:A2:74:25:6E:B8:D4:9E:F3:1B:71:7E:A5:10:38:39:01:CC:93:C1:74:B3:96:25:71:C8:D2:5D
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=sendrecv
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=fmtp:111 minptime=10; useinbandfec=1
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:106 CN/32000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:126 telephone-event/8000
a=maxptime:60
a=ssrc:1519941870 cname:s8rO7shwZbHh0wyw
a=ssrc:1519941870 msid:HMFRvujnzsUIWdP6940nngmFOxrtVbMeG8nr 38192f79-8fcc-45c9-b812-55e01c26364e
a=ssrc:1519941870 mslabel:HMFRvujnzsUIWdP6940nngmFOxrtVbMeG8nr
a=ssrc:1519941870 label:38192f79-8fcc-45c9-b812-55e01c26364e

Solution

  • It is not recommended to modify this on the client side from JavaScript. Your server or WebRTC to SIP gateway should solve this automatically (by forwarding on TCP or removing unnecessary lines if can be forwarded on UDP only).