Asterisk 1.8 creating IVR

Hi,

I am using asterisk 1.8 and want to create ivr system. System receive call and wait for extension no. to dial if user input correct extension no. then it will dial that extension. if user fail to dial correct extension then call land on extension no. 9.

Thanks
Rajeev.

You should look at the dial plan application ReadExten. It should be able to do what you want, with some custom error handling you can build in.

Hi,

I have create below dial plan and its working fine except when user dial extension no. which is not registered it will not go to invalid extension part and excute next line.

In this dial plan i have create when user dial 3 digit extension no. system dial 3 digit extension for 30 sec. if no response than it will dial extension no. 9. in this condition if user dial invalid extension than it will not execute invalid extension.

exten => s,1,Set(TIMEOUT(digit)=3);
exten => s,n,Set(TIMEOUT(response)=10);
exten => s,n,Background(welcome);
exten => s,n,Background(valid-extension);
exten => s,n,WaitExten();
exten => _XXX,1,Dial(SIP/${EXTEN},30,Tt);
exten => _XXX,2,Dial(SIP/9,20,Tt)
exten => _XXX,3,Hangup();
exten => i,1,NOOP(wrong-input-received);
exten => i,n,Playback(invalid);
exten => i,n,Goto(ivr-menu,s,1);
exten => t,1,NOOP(no-input-received);
exten => t,n,Playback(pls-select-option);
exten => t,n,Goto(ivr-menu,s,1);

Please help
Rajeev.

Whilst noting that Asterisk 1.8 ceased to be supported six years ago last month, in your dialplan, all 3 digit extensions are valid, so it is impossible to dial an invalid extension.

I think you are using extension to refer to a device. Although FreePBX uses it that way,

With chan_sip, I believe you can have a virtual priority 1 line generated in the dialplan, when a device is registered. If so, you could create a real extension for each device. Remember that you can still use wild card patterns on subsequent priorities.

If this is a new installation, or you have done significant work on it, you should move to a supported version and chan_pjsip.

It would also be possible to keep the _XXX pattern, and make a check on the state of the device, with the DEVICE_STATE() function. (My manual is for Asterisk 11, so it is possible it’s not in 1.8, but it seems like such a basic function that I can’t imagine it’s not.)

DEVICE_STATE function is present in asterisk v1.8
core show function DEVICE_STATE