如何从 sipML5 中的 SIP Invite 中删除不必要的数据

How to remove unnecessary data from SIP Invite in sipML5

如何从 sipML5 中的 SIP 邀请中删除不需要的数据? 现在当我将它发送到我的服务器时它太大了(只需要音频)。它将接受最多 1,500 个字节,并且必须在 UDP 上。

你能告诉我怎么做吗?如何删除一些编解码器等?我对此一无所知,只是现在学习sipML。在其他帖子中有删除编解码器之类的答案,但是没有关于如何做的答案:)

我的邀请:

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:some_client@df7jal23ls0d.invalid;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

不建议在客户端从JavaScript修改这个。您的服务器或 WebRTC 到 SIP 网关应该自动解决这个问题(通过在 TCP 上转发或删除不必要的线路,如果只能在 UDP 上转发)。