[default]
 
exten => 1,1,Playback(YouPressedOne)
exten => 1,2,Playback(BecauseYouPressed1IWillCallCarol)
exten => 1,3,Goto(first-ivr,s,1)
 
exten => 2,1,Playback(YouPressedTwo)
exten => 2,2,Playback(BecauseYouPressed1IWillCallCarol)
exten => 2,3,Goto(second-ivr,s,1)
 
exten => 3,1,Playback(YouPressedTwo)
exten => 3,2,Playback(BecauseYouPressed3IWillSendYouToVoicemail)
exten => 3,3,Goto(third-ivr,s,1)
 
[first-ivr]
 
exten => s,1,Dial(InsertDialStatementHere)
exten => s,2,Playback(Goodbye)
exten => s,3,Hangup
 
[second-ivr]
 
exten => s,1,Dial(InsertDialStatementHere)
exten => s,2,Playback(Goodbye)
exten => s,3,Hangup
 
[third-ivr]
 
exten => s,1,VoiceMailMain(default)
exten => s,2,Playback(Goodbye)
exten => s,3,Hangup
 
Get it? In a context (which is the name specified in brackets) , the first number in a statement indicates the extension, which Asterisk interprets through a DTMF tone (you press buttons to dial something) or a DID number for inbound calls (in the case of a PRI) and executes statements according to the priority, which is the next number.
 
The first number 'exten => 1' allows you to group related statements together and bind them to an extension number ( which could be internal / outbound, could be external / inbound) and the second number 'exten => 1,1' specifies the order in which the statements are executed. After a statement is executed, and it could be executed incorrectly or correctly, or it could have executed successfully or unsucessfully, it will then process the next line in the context until it runs out of stuff to do.
 
When you dial out, Asterisk determines the context in which your phone is to be run in, and tries to match what you dialled to an extension specified in the context for your phone. If there is no match, it tries the s extension. If the s extension does not exist or is invalid, Asterisk returns a busy tone and "404 not found" on your phone.
 
When someone dials in, Asterisk tries to match the DID number against an extension in the inbound calls context. If there is no match, it tries the s extension in the inbound calls context. If the s extension does not exist or is invalid, Asterisk rejects the call.
 
The s extension is a special kind of extension. It means, "Execute these statements regardless of the extension specified in the context unless told otherwise, or if there is no match for the extension requested".  In the example above, pressing 1 or 2 will do something, but if you press any other digit, Asterisk will hang up the call. Why? Because in the [default] context, I specified something for Asterisk to do if I press 1 or 2, but I didn't specify it for any other number and I didn't specify an 's' extension which would have handled a keypress other than 1 or 2.
-----Original Message-----
From: John Crowhurst [mailto:[EMAIL PROTECTED]
Sent: Monday, September 19, 2005 1:23 PM
To: [email protected]
Subject: Re: [Asterisk-Users] IAX dialplan problem?



On 9/19/05, Thameem Ansari <[EMAIL PROTECTED]> wrote:

You are doing correct. But you have to explain what you want to do? As per your second configuration, if you dial 1 then it will ring....Post exactly what you are trying to accomplish?

I don't actually have dialplan created, as I'm trying to see if I can get it to work.

What I would like to do is present me with a menu when I first press the connect button on the phone, give me a set of options like 'press 1 to call Carol', 'press 2 to call Jenny', 'press * for voicemail', etc.

--
John

-Thameem

On 9/19/05, John Crowhurst < [EMAIL PROTECTED]> wrote:
Hello, I'm a newbie to the asterisk system.

I'm trying to configure a dialplan so that when I use my IAXy it will prompt me with an IVR and then send me off to different things like dial and voicemail from that.

I've tried various combinations but I can't seem to get it to work properly. Here is an example:

[default]
exten => s,1,Answer
exten => s,2,Ringing

It gives me a dialtone and waits for an input, but if I do:

[default]
exten => 1,1,Answer
exten => 1,2,Ringing

And then dial 1 it rings...

Am I doing something wrong? Any suggestions or pointers gratefully received.

Thanks in advance,

John




_______________________________________________
--Bandwidth and Colocation sponsored by Easynews.com --

Asterisk-Users mailing list
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users



_______________________________________________
--Bandwidth and Colocation sponsored by Easynews.com --

Asterisk-Users mailing list
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to