Asterisk dialplan context and label clarifications

asterisksipvoip

I have been learning Asterisk dial plan for the past week.I have written down a simple IVR system with two levels of menu and an exit option.I have used concepts from different tutorials on the web.Can someone confirm if the IVR below is correct? Correct in the sense that if the below is used will it work.I know the IVR does not do much yet.But I am just trying to clarify my understanding.

[incoming]
exten => 123,1,Answer()
 same => n(menuprompt),Background(main-menu)

exten => 1,1,Playback(digits/1)
 same => n,Goto(incoming,menuprompt,123)

exten => 2,1,Playback(digits/2)
 same => n,Goto(incoming,menuprompt,123)

exten => 9,1,Hangup()

[main-menu]
exten => n(menuprompt),Background(main-menu)

exten => 3,1,Playback(digits/3)
 same => n,Goto(main-menu,menuprompt,n)

exten => 4,1,Playback(digits/4)
 same => n,Goto(main-menu,menuprompt,n)

exten => 9,1,Hangup()

Best Answer

goto have following format

goto(context,extension,priority)

label is same as priority. so you need correct your dialplan to do something like

n,Goto(incoming,123,menuprompt)

Related Topic