1. <var id="fe6gj"></var>

    <rp id="fe6gj"><nav id="fe6gj"></nav></rp>

    <noframes id="fe6gj"><cite id="fe6gj"></cite>

    <ins id="fe6gj"><button id="fe6gj"><p id="fe6gj"></p></button></ins>
    1. <tt id="fe6gj"><i id="fe6gj"><sub id="fe6gj"></sub></i></tt>
        始創于2000年 股票代碼:831685
        咨詢熱線:0371-60135900 注冊有禮 登錄
        • 掛牌上市企業
        • 60秒人工響應
        • 99.99%連通率
        • 7*24h人工
        • 故障100倍補償
        您的位置: 網站首頁 > 幫助中心>文章內容

        freeswitch dialplan 筆記

        發布時間:  2012/9/15 21:07:05

        ????我建了一個 Freeswitch 內核研究 交流群, 45211986, 歡迎加入, 另外,提供基于SIP的通信服務器及客戶端解決方案。


        Freeswitch包含xml 格式dialplan,asterisk likedialplan以及外部語言接口的dialplan,

        Dialplan放在conf/dialplan目錄,由三個主要文件組成:

        default.xml—The primary FreeSWITCHDialplan configuration

        public.xml—Handles calls coming in toFreeSWITCH from another location

        features.xml—A special context for handlingspecific dialing features

        default/—Files in this directory getincluded in the default context

        public/—Filesin this directory get included in the public context

        Xml格式dialplan從高到低分group ,Context,extenstion,級別.Group是Context的集合,

        每個Context一個或者多個extenstion的組合,是一個邏輯上的概念,extension  實際上也是一個邏輯上的概念,他并不是傳統pbx上分機的概念,一個extension 代表一個小的,根據被叫號碼指定的一個功能集合,一個extension被其name唯一標示,freeswitch默認配置包含三個Context, 名字分別為default,public和features,default為主dialplan,注冊到freeswitch的分機會被路由到此context,大部分都在這里實現,public是從外部(未注冊)或者那些未認證的客戶端呼叫到freeswitch時采用的Context,features context是一些呼叫特性的實現,每個extension是根據條件執行的一系列application,一般是根據被叫號碼指定的一系列規則,這些application 構成了可編程pbx的基礎,context, extension,application(action)關系如下:

         

         

         

         

        每個進入freeswitch的呼叫都在freeswitch里預先定義了其 context,DialPlan,及extenstion,這些規則指定了如何路由這個呼叫,系統默認xml dialplan的context為default.

        /usr/local/freeswitch/conf/dialplan/default.xml

        為freeswitch內部分機(驗證)的默認dialplan,Context name 為default,里面包含許多例子,

        此文件同時包括/usr/local/freeswitch/conf/dialplan/default/*.xml目錄下的所有文件,

        所以如果想在default context下添加自己的dialplan,令寫一個xml放在 default目錄即可。

        另外,如果想添加自己的context,可以在/usr/local/freeswitch/conf/dialplan/ 添加一個xml文件,

        與default.xml類似,/usr/local/freeswitch/conf/dialplan/public.xml為非注冊到freeswitch的終端呼入的dialplan,Context 名為 public,/usr/local/freeswitch/conf/dialplan/public/目錄可以添加context為public的extension.

        在xml配置文件里包含其他目錄下文件的方法為用宏X-PRE-PROCESS,如下例子包含default目錄下的所有xml文件到此xml文件。

        <X-PRE-PROCESS cmd="include"data="default/*.xml"/>

         

         

        Freeswitch默認提供了大量測試demo,根據被叫號碼對應不同功能,列表如下:

        Extension:

        Function:

        1000—1019

        Local Extensions

        ** + Extension Number

        Intercept a ringing phone (that is, "call pickup")

        2000

        Sample call group: Sales

        2001

        Sample call group: Support

        2002

        Sample call group: Billing

        3000-3399

        Sample conference rooms

        4000 or *98

        Retrieve voicemail

        5000

        Demo IVR

        5900

        FIFO queue park

        5901

        FIFO queue retrieve

        6000

        Valet park retrieval, manual

        6001-6099

        Valet park/retrieval, automatic

        9178

        Example fax receive

        9179

        Example fax transmit

        9180

        Ring test, far end generates ring tone

        9181

        Ring test, send U.K. ring tone

         

        9182

        Ring test, send music as ring tone

        9183

        Answer, then send U.K. ring tone

        9184

        Answer, then send music as ring tone

        9191

        ClueCon registration

        9192

        Information dump

        9195

        Delayed echo test

        9196

        Echo test

        9197

        Milliwatt tone (test signal quality)

        9198

        Tetris

        9664

        Music on hold

         

        這些功能的實現默認都在default.xml中。

        Xml dialplan大量使用兼容perl的正則表達式,大多用在${destination_number}的比較上,

        常用的如

        ^789  --------------------------匹配與789開頭的

        789$ ---------------------------匹配以789結尾的

         \d-------------------------------匹配 0-9任意數字

        ^\d$----------------------------以任意數字開頭的

        ^\d{3}$ ---------------------匹配以三個數字開頭的

        ^(\d{5})$--------------------匹配以五個數字開頭的,并把變量保存到$1中

        ^(9\d{10}|123)$ 匹配以123開頭或者以9,加上10個數字開頭

         等等。

        另外,freeswitch提供控制臺命令regex,可以測試指定字符串是否與某個模式匹配,

        格式為regex 字符串|模式,如:

        freeswitch@internal> regex1234|^\d{4}

        返回true.

        億恩-天使(QQ:530997) 電話 037160135991 服務器租用,托管歡迎咨詢。


        本文出自:億恩科技【www.endtimedelusion.com】

        服務器租用/服務器托管中國五強!虛擬主機域名注冊頂級提供商!15年品質保障!--億恩科技[ENKJ.COM]

      1. 您可能在找
      2. 億恩北京公司:
      3. 經營性ICP/ISP證:京B2-20150015
      4. 億恩鄭州公司:
      5. 經營性ICP/ISP/IDC證:豫B1.B2-20060070
      6. 億恩南昌公司:
      7. 經營性ICP/ISP證:贛B2-20080012
      8. 服務器/云主機 24小時售后服務電話:0371-60135900
      9. 虛擬主機/智能建站 24小時售后服務電話:0371-60135900
      10. 專注服務器托管17年
        掃掃關注-微信公眾號
        0371-60135900
        Copyright© 1999-2019 ENKJ All Rights Reserved 億恩科技 版權所有  地址:鄭州市高新區翠竹街1號總部企業基地億恩大廈  法律顧問:河南亞太人律師事務所郝建鋒、杜慧月律師   京公網安備41019702002023號
          1
         
         
         
         

        0371-60135900
        7*24小時客服服務熱線

         
         
        av不卡不卡在线观看_最近2018年中文字幕_亚洲欧美一区二区三区_一级A爱做片免费观看国产_日韩在线中文天天更新_伊人中文无码在线