K
K
karibskii_koks2016-12-11 19:23:21
Asterisk
karibskii_koks, 2016-12-11 19:23:21

Asterisk, how to make a multi-level IVR?

Hello, I created the simplest scheme in Asterisk, IVR is used as a voice greeting.
I want to implement this:
"Hello, you called the Cafechantan, if you want to connect to the Cafeteria press 1, if you want to connect to the Bakery press 2, if you want to connect to the Restaurant press 3."
If the caller presses 1, then he gets to the following voice menu
"If you want to connect with the administrator, press 1, if you want to connect with the seller, press 2, if you want to listen to information about hours of operation, press 3"
If I understand correctly, then for such an implementation will additional context be needed for each new IVR branch?
How is pressing the number keys implemented in the dialplan?
Dialplan config:
[globals]
[general]
autofallthrough=yes
[zadarma-out]
exten => _XXX,1,Dial(SIP/${EXTEN})
exten => _XXX.,1,Dial(SIP/${EXTEN}@468174)
[ ivr-main]
exten => s,1,Answer()
exten => s,2,Background(/etc/asterisk/ivr/8)
exten => s,3,Queue(ringing)
[zadarma-in]
exten = > 468174,1,Goto(ivr-main,s,1)
; Queue(ringing)
[office]
include => zadarma-out
exten => 5212,1,Answer
exten => 5212,n,Playback(demo-echotest)
exten => 5212,n,Echo
exten => 5212,n,Playback (demo-echodone)
exten => 666.1, Dial(SIP/666.40)
exten => 666.2, Hangup
exten => 667.1, Dial(SIP/667.40)
exten => 667.2, Hangup
exten => 668.1, Dial(SIP/668.40)
exten => 668.2, Hangup

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2016-12-11
@karibskii_koks

You make out each IVR highlight with a separate context, then in each context something like this:

[ivr-main]
exten => s,1,Answer()
same => n,Background(ivr-menu-main)
same => n,WaitExten(5)

exten => i,1,Playback(key-invalid)
same => n,Goto(somewhere)

exten => t,1,Playback(go-to-operator)
same => n,Goto(somewhere)

exten => 1,1,Goto(ivr-menu-1,s,1)
...

The second option is through Read, then everything is possible in one context
[ivr]
exten => s,1,Answer()
same => n,Read(KEY,ivr-menu-main,1,,1,3)
same => n,GotoIf($["${KEY}"=""]?error,1:ivr${KEY},1)

exten => ivr1,1,Read(KEY,ivr-menu-1,1,,1,3)
...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question