当前位置: 首页 > wzjs >正文

为何网站建设公司报价不同网站建设包括哪些方面选择题

为何网站建设公司报价不同,网站建设包括哪些方面选择题,山东鸿泰建设集团有限公司网站,赣州做网站推广概述 freeswitch是一款简单好用的VOIP开源软交换平台。 之前的文章中介绍过通过dialplan拨号计划配置的方法,实现2833到inband的转换,但是实际生产环境中的场景会更复杂,无法预先在dialplan中设置好相关参数和函数。 环境 CentOS 7.9 fr…

概述

freeswitch是一款简单好用的VOIP开源软交换平台。

之前的文章中介绍过通过dialplan拨号计划配置的方法,实现2833到inband的转换,但是实际生产环境中的场景会更复杂,无法预先在dialplan中设置好相关参数和函数。

环境

CentOS 7.9

freeswitch 1.10.7

问题描述

在与运营商的对接过程中,因为对传统PSTN线路的兼容,被叫侧并不是所有的号码都支持2833,B路响应的SDP中会没有rfc2833的媒体描述,也可能183SDP中支持2833,但是200SDP中不支持2833。

fs对于该场景并没有简单的配置方案,默认的处理逻辑会使用INFO消息来转发DTMF,但是运营商并不支持该方式。

所以,我们需要一种简单的配置即可实现的rfc2833到inband的DTMF转发模式。

默认流程

从SDP媒体协商的日志中看到,协商过程都是在“switch_core_media_negotiate_sdp”函数实现的。

fs默认的dtmf匹配流程如下,略过了正常的rfc2833过程。

1,检查B路响应SDP中的“telephone-event”并根据rate匹配一个最佳te。switch_core_media.c:5964。

2,如果没有匹配到最佳te,检查vars.xml中的“rtp_liberal_dtmf”配置为true,则直接使用本地te作为最佳te。switch_core_media.c:6003。

3,如果仍然没有最佳te,检查通道变量“rtp_info_when_no_2833”不是false,则使用INFO模式转发DTMF,否则设置B路的“dtmf_type”为none。

修改方案

修改后的dtmf匹配流程。

1,检查B路响应SDP中的“telephone-event”并根据rate匹配一个最佳te。switch_core_media.c:5964。

2,如果没有匹配到最佳te,检查vars.xml中的“rtp_liberal_dtmf”配置为true,则直接使用本地te作为最佳te。switch_core_media.c:6003。

3,如果有最佳te,走第4步,没有最佳te,走第5步。

4,在设置协商好的te payload之后,增加逻辑,如果在183的协商中已经设置了inband模式,后续的update协商中需要取消inband模式的函数设置。

5,检查通道变量“rtp_info_when_no_2833”不是false,则使用INFO模式转发DTMF。通道变量“rtp_info_when_no_2833”不是false,设置B路的“dtmf_type”为inband,设置B路通道变量“spandsp_dtmf_rx_filter_dialtone”为true,设置B路在answer后调用app函数“deduplicate_dtmf”和“spandsp_start_dtmf”,设置A路在answer后调用app函数“start_dtmf_generate”。

代码如下,switch_core_media.c:6009行开始,红色部分为修改代码。

if (best_te) {smh->mparams->te_rate = best_te_rate;if (smh->mparams->dtmf_type == DTMF_AUTO || smh->mparams->dtmf_type == DTMF_2833 ||switch_channel_test_flag(session->channel, CF_LIBERAL_DTMF)) {if (sdp_type == SDP_TYPE_REQUEST) {smh->mparams->te = smh->mparams->recv_te = (switch_payload_t) best_te;switch_channel_set_variable(session->channel, "dtmf_type", "rfc2833");smh->mparams->dtmf_type = DTMF_2833;} else {smh->mparams->te = (switch_payload_t) best_te;switch_channel_set_variable(session->channel, "dtmf_type", "rfc2833");smh->mparams->dtmf_type = DTMF_2833;}}if (a_engine->rtp_session) {switch_rtp_set_telephony_event(a_engine->rtp_session, smh->mparams->te);switch_channel_set_variable_printf(session->channel, "rtp_2833_send_payload", "%d", smh->mparams->te);switch_rtp_set_telephony_recv_event(a_engine->rtp_session, smh->mparams->recv_te);switch_channel_set_variable_printf(session->channel, "rtp_2833_recv_payload", "%d", smh->mparams->recv_te);}switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Set 2833 dtmf send payload to %u recv payload to %u\n",switch_channel_get_name(session->channel), smh->mparams->te, smh->mparams->recv_te);//add by zr 20241018, for 2833 to inband, update method//如果在183的协商中已经设置了inband模式,后续的update协商中需要取消inband模式的函数设置if (switch_true(switch_channel_get_variable(session->channel, "inband_flag"))) {switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "reset inband_flag and channel variables.\n");//B路switch_channel_set_variable(session->channel, "inband_flag", NULL);switch_channel_set_variable(session->channel, "spandsp_dtmf_rx_filter_dialtone", NULL);switch_channel_set_variable(session->channel, "execute_on_answer_101", NULL);switch_channel_set_variable(session->channel, "execute_on_answer_102", NULL);//A路,2833 to inbandif( switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS ){switch_channel_set_variable(other_session->channel, "execute_on_answer_101", NULL);switch_core_session_rwunlock(other_session);}}
} else {/* by default, use SIP INFO if 2833 is not in the SDP */if (!switch_false(switch_channel_get_variable(channel, "rtp_info_when_no_2833"))) {switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "No 2833 in SDP.  Disable 2833 dtmf and switch to INFO\n");switch_channel_set_variable(session->channel, "dtmf_type", "info");smh->mparams->dtmf_type = DTMF_INFO;smh->mparams->recv_te = smh->mparams->te = 0;} else {// switch_channel_set_variable(session->channel, "dtmf_type", "none");// smh->mparams->dtmf_type = DTMF_NONE;// smh->mparams->recv_te = smh->mparams->te = 0;//add by zr 20241018, for 2833 to inband, update methodswitch_channel_set_variable(session->channel, "dtmf_type", "inband");smh->mparams->dtmf_type = DTMF_AUTO;smh->mparams->recv_te = smh->mparams->te = 0;switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "set inband_flag, No 2833 in SDP. Disable 2833 dtmf and switch to INBAND.\n");//TODO: add inband dtmf//A路,2833 to inbandif( switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS ){switch_channel_set_variable(other_session->channel, "execute_on_answer_101", "start_dtmf_generate");switch_core_session_rwunlock(other_session);}//B路,inband to 2833switch_channel_set_variable(session->channel, "inband_flag", "true");switch_channel_set_variable(session->channel, "spandsp_dtmf_rx_filter_dialtone", "true");switch_channel_set_variable(session->channel, "execute_on_answer_101", "deduplicate_dtmf");switch_channel_set_variable(session->channel, "execute_on_answer_102", "spandsp_start_dtmf");}
}

代码编译安装后,修改fs配置,B路使用inband模式。

vars.xml

<X-PRE-PROCESS cmd="set" data="rtp_liberal_dtmf=false"/>

dialplan

<action application="export" data="rtp_info_when_no_2833=false" />

上面的配置可以适配各种情况,当A路支持rfc2833,B路不支持2833的时候。

B路如果仍然希望使用2833则设置“rtp_liberal_dtmf”为true。

B路如果希望使用INFO模式则设置“rtp_liberal_dtmf”为fase,“rtp_info_when_no_2833”为true。

B路如果希望使用inband模式则设置“rtp_liberal_dtmf”为fase,“rtp_info_when_no_2833”为false。

测试

sip媒体的协商过程比较复杂,场景较多,下面列出了各种协商过程和预期结果。

1,200sdp带2833。2833双向正常

2,200sdp不带2833。2833 to inband双向正常

3,183sdp带2833,200不带sdp。2833双向正常

4,183sdp不带2833,200不带sdp。2833 to inband双向正常

5,183sdp不带2833,200sdp不带2833。2833 to inband双向正常

6,183sdp带2833,200sdp不带2833。2833双向正常

7,183sdp不带2833,200sdp带2833。2833 to inband双向正常

8,183sdp带2833,200sdp带2833。2833双向正常

9,183sdp带2833,update sdp带2833,200sdp带2833。2833双向正常

10,183sdp不带2833,update sdp带2833,200sdp带2833。2833双向正常

11,183sdp带2833,update sdp不带2833,200sdp带2833。2833 to inband双向正常

12,183sdp带2833,update sdp带2833,200sdp不带2833。2833双向正常

13,183sdp不带2833,update sdp不带2833,200sdp带2833。2833 to inband双向正常

14,183sdp不带2833,update sdp带2833,200sdp不带2833。2833双向正常

15,183sdp带2833,update sdp不带2833,200sdp不带2833。2833 to inband双向正常

16,183sdp不带2833,update sdp不带2833,200sdp不带2833。2833 to inband双向正常

17,183sdp带2833,update sdp带2833,200不带sdp。2833双向正常

18,183sdp不带2833,update sdp带2833,200不带sdp。2833双向正常

19,183sdp带2833,update sdp不带2833,200不带sdp。2833 to inband双向正常

20,183sdp不带2833,update sdp不带2833,200不带sdp。2833 to inband双向正常

21,A路不带2833的以上20种场景。

经过测试,上诉各场景的预期结果基本满足。从媒体抓包中,可以分别对A路的rtpevent和B路的inband媒体流一一对应起来。

总结

根据sip协议的规范,在媒体协商的过程中,如果已经有183SDP或update的SDP了,则200SDP会被忽略。

上述流程中,对于AB路的其中一路固定为rfc2833的媒体协商是满足的,但是对于AB两路的DTMF模式都不固定的场景仍然有遗留问题,因为场景限制关系,暂不讨论。

上述流程中,对于B路的inband使用了“spandsp_start_dtmf”转换为rfc2833,但是该函数有一定缺陷,转换后的A路媒体流中既有rfc2833,又有少量遗留的inband(擦除不完全,遗留40ms,仍然可以被检测出DTMF),该缺陷会在后续的文章中解决。

空空如常

求真得真


文章转载自:

http://Kw6CfhMa.zpmmn.cn
http://febt8TwP.zpmmn.cn
http://aZh8PcWd.zpmmn.cn
http://I3ZTTBL1.zpmmn.cn
http://4S82VpUD.zpmmn.cn
http://p0s97dyY.zpmmn.cn
http://hBAEQFUd.zpmmn.cn
http://xQNJmiJb.zpmmn.cn
http://elVJ1yfk.zpmmn.cn
http://AyvKQTQ9.zpmmn.cn
http://tg156gR9.zpmmn.cn
http://rrp29cYK.zpmmn.cn
http://ck1vl69e.zpmmn.cn
http://Yi9u93zR.zpmmn.cn
http://ev5hpXau.zpmmn.cn
http://f73pyY2i.zpmmn.cn
http://BcI57ToA.zpmmn.cn
http://MIEREFIF.zpmmn.cn
http://5wMjnieM.zpmmn.cn
http://WTsMU8e5.zpmmn.cn
http://0u3wZorn.zpmmn.cn
http://VmsawM76.zpmmn.cn
http://l3skKOtr.zpmmn.cn
http://SNP4100o.zpmmn.cn
http://NQko0JoH.zpmmn.cn
http://3eSRou1v.zpmmn.cn
http://6xOtss4I.zpmmn.cn
http://AeQ5x0Gc.zpmmn.cn
http://rUvzQMRK.zpmmn.cn
http://DfNPTXrG.zpmmn.cn
http://www.dtcms.com/wzjs/696578.html

相关文章:

  • 合肥企业网站排名优化镇江网站关键字优化公司
  • 行业资讯网站源码关于吃喝玩乐的网站建设策划
  • 红星美凯龙建设事业中心网站中铁建设集团有限公司华南分公司
  • 个体户做网站是怎么备案企业网页制作公司青岛
  • 有趣的网络营销案例惠州百度seo找谁
  • 网站开发税收分类网站建设喀什
  • 提供郑州网站建设在线安卓软件开发
  • 假链接制作网站做兽药网站用什么图片好
  • 苏州设计网站公司wordpress 页面文件
  • 铜仁网站网站建设大连百度关键词排名
  • 网站开发专业培训代做底单的网站
  • 整站seoseo优化wordpress docker好处
  • 如何给企业做网站wordpress加入购物
  • 多软件网站下载安装网站发布和推广
  • 什么求职网站可以做几份简历直播开放平台抖音
  • 网站具体流程音乐网站的制作
  • 怎么做网站推广实际效果好如何用python 做网站
  • 网上怎样做电缆网站防伪码查询网站怎么做的
  • wordpress查看爆破着ip商品标题关键词优化
  • 描述建设网站的步骤方太产品站网站建设
  • 上海市各区建设局网站雄安建设工程信息网
  • 自动跳转导航入口在seo优化中
  • 柳州网站建设多少钱湘潭做网站广告的公司
  • 建一个网站需要购买域名 虚拟主机wordpress 积分 文章
  • 汽车租赁网站开发网站建设全程揭秘光盘文件
  • 免费行情网站app大全下载网件路由器密码
  • 做外贸需掌握的网站展览会网站建设
  • 网站app怎么制作教程河北省建设工程招标网
  • html5 移动网站河南省汝州市文明建设门户网站
  • 去哪儿网站上做民宿需要材料微信小程序如何推广