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

国内有做网游评测的网站么北京seo优化排名推广

国内有做网游评测的网站么,北京seo优化排名推广,网络推广是什么,html5wap网站模板概述 freeswitch是一款简单好用的VOIP开源软交换平台。 mod_xml_curl模块支持从web服务获取xml配置,本文介绍如何动态获取acl配置。 环境 centos:CentOS release 7.0 (Final)或以上版本 freeswitch:v1.6.20 GCC:4.8.5 web…

 

概述

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

mod_xml_curl模块支持从web服务获取xml配置,本文介绍如何动态获取acl配置。

环境

centos:CentOS  release 7.0 (Final)或以上版本

freeswitch:v1.6.20

GCC:4.8.5

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 type="freeswitch/xml">

<section name="dialplan" description="dialplan-url">

    <include>

        <context name="public">

            <extension name="test-url" continue="false">

                <condition field="${acl(${network_addr} list_out)}" expression="true"/>

                <condition field="destination_number" expression="^(\d+)$">

                    <action application="answer"/>

                    <action application="playback" 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;charset=utf-8')

        self.end_headers()

        self.wfile.write(respcode.encode('utf-8'))

        return

   

    def fsConfigAcl(self):

        length = int(self.headers['content-length']) 

        datas = self.rfile.read(length)

        # print('fsConfigAcl request, data=', datas.decode())

        logging.info('/fs/config/acl request, data=%s' % urllib.parse.unquote(datas))

        respcode = '''<document type="freeswitch/xml">

<section name="configuration" description="config-acl">

<configuration name="acl.conf" description="Network Lists">

  <network-lists>

    <list name="list_out" default="deny">

      <node type="allow" cidr="10.55.55.138/32"/>

    </list>

  </network-lists>

</configuration>

</section>

</document>

'''

        self.send_response(200)

        self.send_header('Content-Type', 'application;charset=utf-8')

        self.end_headers()

        self.wfile.write(respcode.encode('utf-8'))

        return

web服务响应消息格式注意事项,必须有“section”段,xml格式不能使用压缩格式,否则会解析错误。

fsDialplan函数的响应中增加了acl的条件判断。

fsConfigAcl函数响应添加“list_out”的acl规则。

配置

检查conf/autoload_configs/modules.conf.xml文件,mod_xml_curl模块要放在配置的顶部。

    <load module="mod_console"/>

<load module="mod_logfile"/>

<load module="mod_xml_curl"/>

修改conf/autoload_configs/xml_curl.conf.xml文件。

<configuration name="xml_curl.conf" description="cURL XML Gateway">

  <bindings>

    <binding name="dialplan">

      <param name="gateway-url" value="http://10.55.55.137:8080/fs/dialplan" bindings="dialplan"/>

</binding>

<binding name="configuration">

<param name="gateway-url" value="http://10.9.0.27:8080/fs/config-acl" bindings="configuration"/>

</binding>

  </bindings>

</configuration>

测试

configuration动态配置需要刷新生效。

freeswitch@localhost.localdomain> reloadacl

+OK acl reloaded

2023-08-04 10:37:59.117939 [NOTICE] switch_utils.c:545 Adding 10.55.55.138/32 (allow) [] to list list_out

使用10011发起呼叫,日志如下。

2023-08-04 10:38:05.277908 [INFO] mod_dialplan_xml.c:637 Processing 10011 <10011>->13712345678 in context public

Dialplan: sofia/external/10011@10.55.55.138 parsing [public->test-url] continue=false

Dialplan: sofia/external/10011@10.55.55.138 Regex (PASS) [test-url] ${acl(${network_addr} list_out)}(true) =~ /true/ break=on-false

Dialplan: sofia/external/10011@10.55.55.138 Regex (PASS) [test-url] destination_number(13712345678) =~ /^(\d+)$/ break=on-false

Dialplan: sofia/external/10011@10.55.55.138 Action answer()

Dialplan: sofia/external/10011@10.55.55.138 Action playback(/usr/local/freeswitch/sounds/dialplan-test-url.wav)

呼叫结果符合预期。

总结

mod_xml_curl模块动态获取config数据,方便对批量的fs集中统一管理配置。

未解决问题。

configuration类型的配置数据动态刷新的边界在哪里,我们可以把哪些配置数据放在web服务统一管理。

如何解决web服务不可用的本地xml配置问题,本地xml配置与web动态配置不一致的问题。

空空如常

求真得真

http://www.hkea.cn/news/775590/

相关文章:

  • php建设网站实训百度搜索引擎的总结
  • 怎么在360自己做网站重庆seo排名收费
  • 外贸网站建设浩森宇特教育培训报名
  • 网站开发价目表深圳市前十的互联网推广公司
  • php做视频直播网站关键词竞价广告
  • 重庆怎么站seo深圳网络推广团队
  • 自学软件网站开发网络推广怎样做
  • 最新版的wordpress怎么添加特征图优化关键词的作用
  • 深圳做网站google推广网络营销和传统营销的区别和联系
  • 专业做网站的顺德公司网络推广怎么收费
  • php商城网站建设多少钱天津百度seo排名优化
  • 注册网站免费注册insseo关键词优化推广哪家好
  • 深圳房地产网站开发常见的网络营销工具有哪些
  • .net 网站管理系统湖南企业竞价优化首选
  • 南山区住房与建设局官方网站网络赚钱推广
  • wordpress mycred汉化seo引擎搜索入口
  • 在线教育网站用什么做百度搜索的优势
  • 甘肃省住房城乡建设厅网站首页智能建站模板
  • 智能科技网站模板下载地址百度学术论文查重
  • 网站要怎么做才能让360收录推广品牌的策划方案
  • 做网站前景营销课程培训视频
  • 青海做网站广告开户南京seo
  • wordpress写软文赚钱seo快速培训
  • 南宁网站建设接单陕西省人民政府
  • wordpress网站价格seo域名综合查询
  • 支付网站怎么做的网络自动推广软件
  • js做网站统计品牌关键词优化
  • 微信公众号管理平台官网谷歌seo建站
  • 鲜花购物网站源码企业网站营销的优缺点
  • 表白网站制作在线日照网站优化公司