当前位置:呼叫中心系统 > 服务支持 >

全国7*24小时业务咨询热线:028-69686996

全国7*24小时技术值班电话:18615791415

呼叫中心系统语音编码

发布时间:2013-01-12 21:12 文章作者:成都启点科技 点击:次 文章标签:呼叫中心系统

呼叫中心系统
 

 
实验环境:centos5.6 freeswitch1.07
实现内容:呼叫中心系统中的语音编码转换
        呼叫中心系统外线常常选择sip对接方式,这时会遇到外线及内线终端的语音编码。假如我们没有弄清楚语音编码原理,可能造成语音质量下降,甚至呼叫失败。
        我们通常用到的语音编码有 G711,G729,G723,GSM。G711是宽带编码,占用带宽64k,语音质量最好。后三种编码是窄带编码,带宽在5-7K间,语音质量较好。而g711和gsm属于开源编码,即使使用transcode方式也不需要支付license费用。
        内线终端和外线常常支持多种编码,本文简述了不做编码转换时,内外线选择匹配语音编码的协商机制。


Early Negotiation (default behavior)
General principle
  • When leg A calls FreeSWITCH, the offered codecs will be compared against the content of inbound-codec-prefs in the relevant SIP profile. As soon as a codec offered by A matches a codec allowed by FS, it is selected as the codec for leg A. If none of the offered codecs matches the allowed codecs, the call fails.
当A呼叫FS,将和inbound-codec-prefs比较,一旦匹配,同意,否则失败
Remark: Because of this algorithm, the codecs order in the inbound SDP has priority on the codecs order in inbound-codec-prefs. 由于算法,编码顺序将改变,sdp中更高
  • When FS calls leg B, the list of codecs in outbound-codec-prefs for the SIP profile is reorganized by pushing the codec negotiated above for leg A at the top. If B does not accept any of the codecs, the calls fails, obviously. 当FS呼叫B,outbound中的设置被重组。
So for instance: 例如
A -------- GSM/PCMA/G729 --------> FS (allowing G729/PCMA/PCMU) -------- PCMA/G729/PCMU --------> B
What is happening:
  • A proposes GSM/PCMA/G729 to FS.
  • FS checks the proposed codecs in order of priority (as listed in the SDP) against its list of allowed codecs (as configured in inbound-codec-prefs), and selects PCMA as the first authorized codec, so the codecs list becomes: PCMA/G729/PCMU.
  • FS proposes this codec list to B.
Early Negotiation parameters
disable-transcoding 早起协商参数
This is a parameter you may set in the outbound SIP profile.在出局sip中设定
This will force the codec proposed to leg B (outbound leg) to be the same as the codec negotiated on leg A (inbound leg).强迫b出局口和a进口一样
To set this, add the following line to the required SIP profile:
<param name="disable-transcoding" value="true"/>
Note: it is commonly misunderstood that this parameter disables the transcoding capability in FS. That is wrong.
This parameter just changes the outbound codec to match the one negotiated on the inbound leg so that no transcoding will be required. 该参数仅改变出局口匹配进口,所以没转换需要
The same result could be achieved by setting absolute_codec_string to the value of the inbound codec. 与下面同效果
 
展开