asterisk dialplan 转换成 freeswitch

我建了一个 Freeswitch 内核研究 交流群,45211986, 欢迎加入。


The Asterisk Dialplan
[IVR-2617559]
include => queue-inject
exten => s,1,Background(IVR/00200003/brand)
exten => s,n,Background(IVR/00200003/greeting)
exten => s,n,WaitExten(5)
exten => s,n,Goto(3,1)

exten => 2,1,Playback(IVR/00200003/ivr2)
exten => 2,n,Set(IVROPT=DSL Issue)
exten => 2,n,Playback(IVR/callmonitoring)
exten => 2,n,Queue(L2-00200003)
exten => 2,n,Hangup()

exten => 3,1,Playback(IVR/00200003/ivr3)
exten => 3,n,Set(IVROPT=Dial-up Support)
exten => 3,n,Playback(IVR/callmonitoring)
exten => 3,n,Queue(L1-00200003)
exten => 3,n,Hangup()

exten => i,1,Goto(s,2)

So, this is a relatively simple IVR, but it does pretty much everything you'd
expect to see in something like this, it plays some sounds to the caller,
waits for DTMF input and based on that input does some different behaviour.

More specifically, it asks the caller to press 2 if they're a DSL customer
and 3 or nothing if they're anything else (dialup, effectively). Then,
depending on that selection, it plays an additional message, stores what they
picked and puts them in queue.

Now, here's how I converted it to FreeSWITCH?

The FreeSWITCH? Version
<include>
<extension name="IVR Conversion">
<condition field="destination_number" expression="^2617559$"/>
<condition field="${ivrlevel}" expression="^$" break="never">
<action application="set" data="domain_name=$${domain}"/>
<action application="playback" data="IVR/00200003/brand.wav"/>
<action application="play_and_get_digits" data="0 1 1 5000 # IVR/
00200003/greeting.wav /invalid.wav ivrsel (2|3)"/>
<action application="set" data="ivrlevel=2"/>
<action application="transfer" data="${destination_number}"/>
</condition>
<condition field="${ivrlevel}-${ivrsel}" expression="^2-2$" break="never">
<action application="playback" data="IVR/00200003/ivr2.wav"/>
<action application="set" data="ivropt=DSL Issue"/>
<action application="playback" data="IVR/callmonitoring.wav"/>
<action application="fifo" data="L2-00200003 in /tmp/exit-message.wav /
tmp/music-on-hold.wav"/>
</condition>
<condition field="${ivrlevel}-${ivrsel}" expression="^2-(3|)$">
<action application="playback" data="IVR/00200003/ivr3.wav"/>
<action application="set" data="ivropt=Dial-up Support"/>
<action application="playback" data="IVR/callmonitoring.wav"/>
<action application="fifo" data="L1-00200003 in /tmp/exit-message.wav /
tmp/music-on-hold.wav"/>
</condition>
</extension>
</include>

This is looks a little different than the original but the behaviour is the
same:

Condition checks destination number - this must match to continue.
Condition check is if we've traversed the IVR before (via the ivrlevel
variable), if not, the following occurs:
Play the first sound
Play the second sound and wait 5 seconds for 1 digit of either 2 or 3 (stored
in the ivrsel variable)
Set the ivrlevel variable to 2 to indicate we're going to the second level of
the IVR
Transfer back to the destination number we originally matched on (the
extension is evaluated again, go back to the start)
Condition check to see if the ivrlevel is 2 and the ivr selection is 2:
Play message
Store choice in channel variable
Play a message about calls being monitored for QA
Insert into a FIFO queue
Condition check to see if the ivrlevel is 2 and the ivr selection is 3 or
blank (invalid input)
Same as previous condition
If you wanted to re-prompt on invalid input, you could do so by checking for
when ivrlevel is 2 and ivrsel is blank and then do another
play_and_get_digits and transfer back to destination_number.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值