[Asterisk-Users] Background() and Read()

Peter Fern pete at keypoint.com.au
Thu Apr 20 19:00:18 MST 2006


You should use the 'filename' parameter of Read to play the audio so 
that it captures the input.  Currently what's happening is that digits 
entered whilst background is running are passed into the dialplan 
context, since there's no match in the dialplan and you don't have an 
'i' extension it will time out and hang up on you if you wait.  To test 
this, add an exten => i,1,Playback(invalid) and you'll see that this is 
the case.

Douglas Garstang wrote:

>I'm having some issues with Background() and Read() commands.
>See the example below. This is when I wait for Background to finish playing the sound file, before entering '12345#'. 
>All works fine.
>
>hestia*CLI> 
>    -- Executing Answer("SIP/2944093-3366", "") in new stack
>    -- Executing Wait("SIP/2944093-3366", "1") in new stack
>    -- Executing BackGround("SIP/2944093-3366", "if-u-know-ext-dial") in new stack
>    -- Playing 'if-u-know-ext-dial' (language 'en')
>    -- Executing Read("SIP/2944093-3366", "number||||||") in new stack
>    -- User entered '12345'
>    -- Executing NoOp("SIP/2944093-3366", "12345") in new stack
>  == Auto fallthrough, channel 'SIP/2944093-3366' status is 'UNKNOWN'
>
>However, if I start to enter digits before Background() is finished, background stops playing the file, and nothing happens after this point. I keep hitting # and still no reply. It didn't even execute the Read().
>
>hestia*CLI> 
>    -- Executing Answer("SIP/2944093-6437", "") in new stack
>    -- Executing Wait("SIP/2944093-6437", "1") in new stack
>    -- Executing BackGround("SIP/2944093-6437", "if-u-know-ext-dial") in new stack
>    -- Playing 'if-u-know-ext-dial' (language 'en')
>
>Here's extensions.conf:
>exten => 1000,1,Answer
>exten => 1000,2,Wait,1
>exten => 1000,3,Background(if-u-know-ext-dial)
>exten => 1000,4,Read(number||||||)
>exten => 1000,5,NoOp(${number})
>
>Anyone got any ideas?
>
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>--Bandwidth and Colocation provided by Easynews.com --
>
>Asterisk-Users mailing list
>To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>  
>



More information about the asterisk-users mailing list