New Asterisk User: Asterisk hangs up the phone immediately

Newbie Asterisk user here, just going through the initial setup and configuration instructions as detailed in the Asterisk - The Future Of Telephony (TFOT) book.

On page 85 is an example of how to set up an incoming dialplan, as follows:

[incoming]
exten => s,1,Answer( )
exten => s,2,Background(enter-ext-of-person)
exten => 1,1,Playback(digits/1)
exten => 1,2,Goto(incoming,s,1)
exten => 2,1,Playback(digits/2)
exten => 2,2,Goto(incoming,s,1)
exten => i,1,Playback(pbx-invalid)
exten => i,2,Goto(incoming,s,1)
exten => t,1,Playback(vm-goodbye)
exten => t,2,Hangup( )

It is supposed to answer the phone, play the message “Please dial the extension of the person you are trying to reach”, and then presumably wait (until timeout) for the caller to dial something.

What it does is answer the phone, play the message, and then immediately hang up.

I checked and re-checked to make sure I had the syntax right, and even cut-and-pasted the dialplan directly from the TFOT book into my extensions.conf file, with no luck… it still just plays the message and then immediately hangs up.

What am I missing?

I think to achieve this you need to add in a WaitExten command after s,2 otherwise, as you say, it will hang up due to no further instructions.

Good help on this here: -
http://www.voip-info.org/wiki-Asterisk+cmd+Background
and here: -
http://www.voip-info.org/wiki/index.php?page=Asterisk+cmd+WaitExten

I think to achieve this you need to add in a WaitExten
command after s,2 otherwise, as you say, it will hang
up due to no further instructions.

Ah, yes, so I do. Thanks, that worked. It’s not in the book, though, at least not in that section where they describe how to set up these simple test dialplans. Bug in the book, perhaps, or perhaps I’m just looking in the wrong places (no big surprise there).

Thanks also for those links; I’ll look them over.