当前位置:网站首页>Freeswitch uses origin to dialplan
Freeswitch uses origin to dialplan
2022-06-28 06:23:00 【Be realistic】

summary
Freeswitch Is a very easy to use open source VOIP Softswitch platform .
I've been right recently fs Do some functional tests , A requirement generated during testing , How to go from fs Initiate a call and transfer the subsequent call flow to a dialplan On , This will be very convenient and easy to use when testing , It can be modified at any time dialplan Customize business processes .
Through to fs After official document search , Exclude “transfer”、“execute_extension”、“bind_meta_app”, By chance “originate” Interfaces can directly implement such functional requirements .
Environmental Science
centos:CentOS release 7.0 (Final) Or above
freeswitch:v1.8.7
GCC:4.8.5
originate
originate It's a API Interface , The interface format is as follows .
originate <call url> <exten>|&<application_name>(<app_args>) [<dialplan>] [<context>] [<cid_name>] [<cid_num>] [<timeout_sec>]
Interface instance .
originate {origination_caller_id_number=9005551212}sofia/default/[email protected] &bridge({origination_caller_id_number=8001234567}sofia/profile/[email protected])
From the interface format ,originate The interface can use “&” Pick up a APP Interface , Continue the process after the call is connected , But sometimes one APP It's not enough , So we need to be in “originate” Then transfer the call flow to dialplan Continue to deal with .
turn dialplan Interface instance of .
originate {origination_caller_id_number=9005551212}sofia/default/[email protected] 19005551212 XML default CALLER_ID_NAME CALLER_ID_NUMBER
In this case , Use originate The interface initiates a call , Then go to XML Type of dial plan “default” in .
To configure
Modify the configuration file “/usr/local/freeswitch/conf/dialplan/test.xml”.
<include>
<context name="ext_test">
<extension name="test" continue="false">
<condition field="destination_number" expression="^(\d+)$">
<action application="sched_hangup" data="+10"/>
<action application="send_dtmf" data="1234"/>
<action application="sleep" data="5000"/>
<action application="endless_playback" data="/usr/local/freeswitch/sounds/101-baidu-mp3.mp3"/>
</condition>
</extension>
</context>
</include>
test
stay freeswitch Use in command line originate Make a call , Then go to the dial plan ext_test send out DTMF.
[email protected]> originate {originator_codec=PCMA,origination_caller_id_number=0755110}sofia/external/sip:[email protected]:5080 1001 XML ext_test
fs call 138 On the server 1001, After the call is connected , send out DTMF And play the prompt voice , The log is as follows .
[email protected]> originate {originator_codec=PCMA,origination_caller_id_number=0755110}sofia/external/sip:[email protected]:5080 1001 XML ext_test
...
2022-06-13 11:37:15.601015 [DEBUG] sofia.c:7084 Channel sofia/external/[email protected]:5080 entering state [ready][200]
...
2022-06-13 11:37:15.610983 [INFO] mod_dialplan_xml.c:637 Processing <0755110>->1001 in context ext_test
Dialplan: sofia/external/[email protected]:5080 parsing [ext_test->test] continue=false
Dialplan: sofia/external/[email protected]:5080 Regex (PASS) [test] destination_number(1001) =~ /^(\d+)$/ break=on-false
Dialplan: sofia/external/[email protected]:5080 Action sched_hangup(+10)
Dialplan: sofia/external/[email protected]:5080 Action send_dtmf(1234)
Dialplan: sofia/external/[email protected]:5080 Action sleep(5000)
Dialplan: sofia/external/[email protected]:5080 Action endless_playback(/usr/local/freeswitch/sounds/101-baidu-mp3.mp3)
...
EXECUTE sofia/external/[email protected]:5080 sched_hangup(+10)
EXECUTE sofia/external/[email protected]:5080 send_dtmf(1234)
2022-06-13 11:37:15.610983 [DEBUG] switch_core_io.c:1918 sofia/external/[email protected]:5080 send dtmf digit=1 ms=250 samples=2000
...
EXECUTE sofia/external/[email protected]:5080 sleep(5000)
...
EXECUTE sofia/external/[email protected]:5080 endless_playback(/usr/local/freeswitch/sounds/101-baidu-mp3.mp3)
...
2022-06-13 11:37:25.121013 [DEBUG] switch_ivr_play_say.c:1942 done playing file /usr/local/freeswitch/sounds/101-baidu-mp3.mp3
...
2022-06-13 11:37:25.121013 [DEBUG] mod_sofia.c:440 Channel sofia/external/[email protected]:5080 hanging up, cause: ALLOTTED_TIMEOUT
summary
Use originate Interface , Call forwarding can be realized directly dialplan Business process .
Think about it , adopt bridge Transfer to a dailplan It should also have the feasibility of implementation . The specific situation has not been thoroughly understood .
Empty as usual
Be serious
边栏推荐
- D3D11_ Chili_ Tutorial (3): design a bindable/drawable system
- 报错--解决core-js/modules/es.error.cause.js报错
- Configure redis from 0
- CAD二次开发+NetTopologySuite+PGIS 引用多版本DLL问题
- The custom cube UI pop-up dialog supports multiple and multiple types of input boxes
- Freeswitch使用originate转dialplan
- 语音增强-频谱映射
- freeswitch设置最大呼叫时长
- YYGH-BUG-02
- MySQL (I) - Installation
猜你喜欢

FPGA - 7 Series FPGA selectio -07- iserdese2 of advanced logic resources

Uni app wechat applet sharing function

整型提昇和大小端字節序

链表(二)——设计链表

What are the advantages of e-mail marketing? Why do sellers of shopline independent station attach so much importance to it?

Linked list (II) - Design linked list

YOLOv5增加小目标检测层

Paper recommendation: efficientnetv2 - get smaller models and faster training speed through NAS, scaling and fused mbconv

How popular are FB and WhatsApp mass messages in 2022?

Unity packaging webgl uses IIS to solve the error
随机推荐
Deep learning 19 loss functions
lombok @EqualsAndHashCode 注解如何让对象.equals()方法只比较部分属性
Configure redis from 0
Using pytorch and tensorflow to calculate the confusion matrix of classification model
Online facing such an online world, the only limitation is our imagination
[untitled]
Deleting MySQL under Linux
ThreadLocal
图片按日期批量导入WPS表格
Caused by: com.fasterxml.jackson.databind.exc.InvalidFormatException:异常解决
创建格式化时间,格式化时区的gson对象。json解析时间格式化 ZonedDateTime
三极管驱动无刷电机
Iframe switching in Web Automation
mysql常用函数
Yygh-7-user management
ImportError: cannot import name 'ensure_ dir_ Possible solutions for exists'
JQ picture amplifier
Lombok @equalsandhashcode annotation how to make objects The equals () method compares only some attributes
CAD二次开发+NetTopologySuite+PGIS 引用多版本DLL问题
Some habits of it veterans in the workplace