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

朔州网站建设价格低快猫

朔州网站建设价格低,快猫,wordpress推介,有关建设旅游网站的公司概述 freeswitch是一款简单好用的VOIP开源软交换平台。 mod_xml_curl模块支持从web服务获取xml配置#xff0c;本文介绍如何动态获取dialplan配置。 环境 centos#xff1a;CentOS release 7.0 (Final)或以上版本 freeswitch#xff1a;v1.6.20 GCC#xff1a;4.8.5… 概述 freeswitch是一款简单好用的VOIP开源软交换平台。 mod_xml_curl模块支持从web服务获取xml配置本文介绍如何动态获取dialplan配置。 环境 centosCentOS  release 7.0 (Final)或以上版本 freeswitchv1.6.20 GCC4.8.5 dialplan查找流程 我们在“switch_xml_parse_file”函数中设置一个断点并打印堆栈。 Breakpoint 1, switch_xml_parse_file (filefileentry0x7fdda1a015f0 /tmp/34096cac-311f-11ee-b31e-672fb2a27310.tmp.xml) at src/switch_xml.c:1625 1625                           if ((xml switch_xml_parse_fd(fd))) { (gdb) bt #0  switch_xml_parse_file (filefileentry0x7fdda1a015f0 /tmp/34096cac-311f-11ee-b31e-672fb2a27310.tmp.xml) at src/switch_xml.c:1625 #1  0x00007fddee4d5258 in xml_url_fetch (sectionoptimized out, tag_nameoptimized out, key_nameoptimized out, key_valueoptimized out, params0x7fdd68004d10, user_data0x1ad1ae8) at mod_xml_curl.c:311 #2  0x00007fddf71e0ec0 in switch_xml_locate (sectionsectionentry0x7fddae9fc7e8 dialplan, tag_nametag_nameentry0x0, key_namekey_nameentry0x0, key_valuekey_valueentry0x0, rootrootentry0x7fdda1a01b00, nodenodeentry0x7fdda1a01af8, params0x7fdd68004d10, clonecloneentrySWITCH_FALSE) at src/switch_xml.c:1675 #3  0x00007fddae9fc214 in dialplan_xml_locate (node0x7fdda1a01af8, root0x7fdda1a01b00, caller_profile0x7fddd004d690, session0x7fddd0030328) at mod_dialplan_xml.c:613 #4  dialplan_hunt (session0x7fddd0030328, argoptimized out, caller_profile0x7fddd004d690) at mod_dialplan_xml.c:658 #5  0x00007fddf71342ef in switch_core_standard_on_routing (session0x7fddd0030328) at src/switch_core_state_machine.c:281 #6  switch_core_session_run (session0x7fddd0030328) at src/switch_core_state_machine.c:643 #7  0x00007fddf712c9fe in switch_core_session_thread (threadoptimized out, obj0x7fddd0030328) at src/switch_core_session.c:1648 #8  0x00007fddf71286f3 in switch_core_session_thread_pool_worker (thread0x7fddd004f5e0, objoptimized out) at src/switch_core_session.c:1711 #9  0x00007fddf7213e10 in dummy_worker (opaque0x7fddd004f5e0) at threadproc/unix/thread.c:151 #10 0x00007fddf4a11ea5 in start_thread () from /lib64/libpthread.so.0 #11 0x00007fddf4065b0d in clone () from /lib64/libc.so.6 (gdb) 从堆栈中可以看出一通呼叫查找动态dialplan的流程如下。 switch_core_session_thread switch_core_session_run switch_core_standard_on_routing dialplan_hunt dialplan_xml_locate switch_xml_locate xml_url_fetch switch_xml_parse_file web服务 mod_xml_curl模块依赖于web服务需要自己创建一个web接口并动态的返回xml配置。 下面是python3.10实现的一个简单的web服务接口函数从基类“BaseHTTPRequestHandler”继承并实现简单的返回逻辑。 def fsDialplan(self): length int(self.headers[content-length])  datas self.rfile.read(length) logging.info(/fs/dialplan request, data%s % urllib.parse.unquote(datas)) respcode document typefreeswitch/xml section namedialplan descriptiondialplan-url include context namepublic extension nametest-url continuefalse condition fielddestination_number expression^(\d)$ action applicationanswer/ action applicationplayback data/usr/local/freeswitch/sounds/dialplan-test-url.wav/ /condition /extension /context /include /section /document self.send_response(200) self.send_header(Content-Type, application;charsetutf-8) self.end_headers() self.wfile.write(respcode.encode(utf-8)) return web服务响应消息格式注意事项必须有“section”段xml格式不能使用压缩格式否则会解析错误。 配置 检查conf/autoload_configs/modules.conf.xml文件mod_xml_curl模块要放在配置的顶部。 load modulemod_console/ load modulemod_logfile/ load modulemod_xml_curl/ 修改conf/autoload_configs/xml_curl.conf.xml文件。 configuration namexml_curl.conf descriptioncURL XML Gateway bindings binding namedialplan param namegateway-url valuehttp://10.55.55.137:8080/fs/dialplan bindingsdialplan/ /binding /bindings /configuration 测试 使用10011发起呼叫日志如下。 2023-08-03 11:08:27.438976 [INFO] mod_dialplan_xml.c:637 Processing 10011 10011-13712345678 in context public 2023-08-03 11:08:27.478976 [CONSOLE] mod_xml_curl.c:323 XML response is in /tmp/042fcd1e-31ab-11ee-b34d-672fb2a27310.tmp.xml Dialplan: sofia/external/1001110.55.55.138 parsing [public-test-url] continuefalse Dialplan: sofia/external/1001110.55.55.138 Regex (PASS) [test-url] destination_number(13712345678) ~ /^(\d)$/ breakon-false Dialplan: sofia/external/1001110.55.55.138 Action answer() Dialplan: sofia/external/1001110.55.55.138 Action playback(/usr/local/freeswitch/sounds/dialplan-test-url.wav) 呼叫结果符合预期。 问题 网友的问题当使用 dialplan时这个动态获取的dialplan优先级最高每通电话都会执行到这个dialplan。 而有些电话我不想走xml动态获取的就想走本地配置的这个问题怎解决呢 方案1mod_xml_curl模块内部已实现的逻辑当web服务返回“NOT FOUND”时自动走本地配置。缺点是对web服务依赖每通呼叫都会到web服务查询。 方案2修改“switch_xml_locate”函数增加条件控制比如caller是“123456”时直接使用本地配置。缺点是不够灵活配置条件修改较困难。 方案3修改mod_xml_curl模块的“xml_url_fetch”函数对web响应的xml结果进行缓存设置过期时间减少了对web服务的依赖又有动态配置的优点。缺点是web配置的生效会增加缓存的延迟弱一致性。 以上方案仅仅从测试结果推导并未真正实现实现细节有不确定性。 总结 mod_xml_curl模块动态获取dialplan数据控制呼叫流程。 未解决问题。 如何更灵活的控制从web服务和本地xml文件获取配置。 如何缓存web服务的xml配置。 如何解决web服务不可用的时候呼叫流程问题。 空空如常 求真得真
http://www.pierceye.com/news/400740/

相关文章:

  • 优秀的网站有哪些内容wordpress重新安装删除哪个文件
  • 网站建设与发布需要什么手机端开发app
  • 无锡做网站无锡网站设计2345网址导航手机上网导航下载
  • html中文美食网站营销型网站维护费用
  • 电商网站建设课设用什么软件制作网站
  • 杭州手机网站wordpress随机调用页面
  • html5网站编写长网页网站
  • 订餐网站系统建设方案建一个网上商城需要多少钱
  • 手机网站asp付费抽奖网站怎么做
  • 国际网站哪里做vs2010 c 建设网站
  • 企业网站更新什么内容永城做网站
  • wordpress 众筹网站模板html5风格网站特色
  • 服装设计参考网站重庆景点排名
  • 网至普的营销型网站建设扬州网站商城建设价格表
  • 成品网站价格表简答网站内容建设的时候内链重要性
  • 视频链接生成器某网站搜索引擎优化
  • flash网站案例vi设计是设计什么
  • ip查询网站备案查询企业网络营销推广平台
  • 多城市网站建设免费制作小程序的平台
  • 郑州网站建设出名吗?wordpress获取登录密码
  • 网站建设论文的开题报告重庆市工程建设信息
  • 商务网站设计方案门户网站的优点
  • 河津网站制作wampserver做的网站
  • 洛阳专业网站设计开发制作建站公司零陵区住房和城乡建设局网站
  • 在哪里可以学做网站游戏开发大亨下载
  • 找人做ps的网站无锡 做公司网站
  • 云速建站可以建个人网站吗wordpress仿站难吗
  • 如何取外贸网站域名凡科h5制作教程
  • 蜘蛛不抓取网站的原因中山h5网站建设
  • 百度免费推广网站建网站用的免费软件