WaitExten() not working


#1

For building a call center, when customer calls, first play a menu: 1 for sales, 2 for customer service.
Seen from CLI, WaitExten() was called, but when I pressed 1 or 2 from the calling SIP phone, nothing happened.
It always timed out, saying good bye and hangup. I also tried 1 or 2 followed by # sign.

exten => 2000,1,Answer
exten => 2000,n,SetMusicOnHold(default)
exten => 2000,n(main-menu),Background(main-menu)
exten => 2000,n,WaitExten()

exten => 1,1,Queue(Sales)
exten => 1,n,Hangup

exten => 2,1,Queue(CustomerService)
exten => 2,n,Hangup

exten => i,1,Playback(pbx-invalid)
exten => i,n,Goto(main-menu)

exten => t,1,Playback(vm-goodbye)
exten => t,n,Hangup

----CLI logging—

-- Executing [2000@users:1] Answer("SIP/Phone801-00000031", "") in new stack
-- Executing [2000@users:2] SetMusicOnHold("SIP/Phone801-00000031", "default") in new stack
-- Executing [2000@users:3] BackGround("SIP/Phone801-00000031", "default") in new stack

[Oct 16 01:10:33] WARNING[2729]: file.c:653 ast_openstream_full: File default does not exist in any format
[Oct 16 01:10:33] WARNING[2729]: file.c:959 ast_streamfile: Unable to open default (format 0x80004 (ulaw|h263)): No such file or directory
[Oct 16 01:10:33] WARNING[2729]: pbx.c:9579 pbx_builtin_background: ast_streamfile failed on SIP/Phone801-00000031 for default
– Executing [2000@users:4] WaitExten(“SIP/Phone801-00000031”, “”) in new stack
– Timeout on SIP/Phone801-00000031, going to ‘t’
– Executing [t@users:1] Playback(“SIP/Phone801-00000031”, “vm-goodbye”) in new stack
– <SIP/Phone801-00000031> Playing ‘vm-goodbye.gsm’ (language ‘en’)
– Executing [t@users:2] Hangup(“SIP/Phone801-00000031”, “”) in new stack
== Spawn extension (users, t, 2) exited non-zero on ‘SIP/Phone801-00000031’

I noticed: the file default missing, but it should not be the cause.

Is the WaitExten() the right way to wait for caller to input? Thanks for help.
Dave


#2

Forgot to mention: I am using lastest stable asterisk 1.8.7, and 3CX Phone.


#3

It doesn’t look like your dialplan code matches your debug output.

In your dialplan, you show the backGround application calling for the main-menu audio file, but the cli output shows it attempting to locate the ‘default’ audio file. There is no audio file named ‘default’. (The Music On Hold is different and should not be confused with the filename being passed to BackGround). BTW: There should be a ‘default-attendant’ audio file.

The WaitExten app will wait for a period of time, if you do not specify a time to wait as an argument to WaitExten(), it will wait TIMEOUT(response) seconds for the user to enter an extension.

I would suggest a few things:

  1. Call BackGround() with a valid audio file name
  2. Call WaitExten() with a timeout, perhaps WaitExten(5)
  3. Use the CLI help system…
    core show application WaitExten
    core show application BackGround
    core show function TIMEOUT

#4

Are you sure that the correct setting for DTMF is set on Asterisk and on IP Phone (settings must match)?

I see that you also have a problem with playing a file with Background() application. Turn some attention to that also.


#5

Thanks all for help.
After using the correct Background sound (dir-usingkeypad), it worked.
When the music is playing, I entered 1#, the call is queued.

Answer
WaitExten

Will not work without Background(…).

After pressing 1, If I do not press # sign, I have to wait for about 3 seconds before asterisk react. Is there a way to make it react immediately after pressing 1 ?

Thanks.
Dave


#6

I suspect that you have other extension in the same context that start with the digit 1 (like you have extension 2 and extension 2000). I would suggest that you move the auto attendant to it’s own context.

[… your existing context…]
exten => 2000,1,Answer
exten => 2000,n, Goto(AutoAttendant,aamenu,1)

[AutoAttendant]
exten => aamenu,1,NoOp(Auto Attendant)
exten => aamenu,n,SetMusicOnHold(default)
exten => aamenu,n(main-menu),Background(dir-usingkeypad)
exten => aamenu,n,WaitExten()

exten => 1,1,Queue(Sales)
exten => 1,n,Hangup

exten => 2,1,Queue(CustomerService)
exten => 2,n,Hangup

exten => i,1,Playback(pbx-invalid)
exten => i,n,Goto(main-menu)

exten => t,1,Playback(vm-goodbye)
exten => t,n,Hangup

(This code has not be tested in any way shape or form)