FreeSWITCH中文网,电话机器人开发网 ,微信订阅号:

FreeSWITCH及VOIP,Openser,电话机器人等产品中文技术资讯、交流、沟通、培训、咨询、服务一体化网络。QQ群:293697898

FreeSwitch1.6转码配置


tags:FreeSwitch 转码 创建时间:2017-05-12 07:21:13

原文:

https://freeswitch.org/confluence/display/FREESWITCH/Codec+Negotiation

1.6以后新加了一个参数,原文如:

Mixing Media/Codecs on different legs (transcoding)
If you want FreeSWITCH to be able to match two legs with different codecs (where it transcodes) there are several variables you will need to set to make it possible.   First you must set media_mix_inbound_outbound_codecs=true either globally (ie vars.xml)  or on the b leg explicitly on the bridge (ie <action application="bridge" data="{media_mix_inbound_outbound_codecs=true}sofia/gateway/...."> ).
This new variable is required with 1.6 and later due to webrtc support and the ever growing SDP when SIP over UDP is involved.SDPs have now reached the point where it is becoming harder and harder to translate from WebRTC -> SIP and keep the original SDP due to the shear size of the SDP. With SIP over UDP, when packet fragmentation happens, it destroys the SIP packet as UDP does not auto-reassemble the fragments… this happens once your sip packets exceed MTU… the only fix is small packets. That means compact headers, eliminating extra headers, or  just don’t use such a big SDP by eliminating CODECs you don’t need.The affect with FS is if you don’t have media_mix_inbound_outbound_codecs set to true, only codecs offered to FS on the A leg are passed to the B leg, this reduces the size of the SDP and has the side effect of greatly reducing the amount of transcoding.
Second you will want to turn off inbound-late-negotiation and inbound-zrtp-passthru (the second forces the first to true), or you will want to pre-answer the A leg prior to the bridge.
Finally you should make sure you have variables like disable-transcoding,inherit_codec,bypass_media,proxy_media all set to false (as these are all tangential to what we want to accomplish).

也可以在vars.xml中配为全局的:

<X-PRE-PROCESS cmd="set" data="media_mix_inbound_outbound_codecs=true"></X>


上海老李,QQ:1354608370,FreeSWITCH QQ群: