[Asterisk-Users] Streaming an audio file to a Zap channel before answer

Tim Robinson timweb at txrx.org.uk
Tue Aug 31 13:22:08 MST 2004


Hi there

Background:
I want to add DDI and voicemail to users on an existing analogue pabx.. 
It does not support ISDN.

I have 10 DDI numbers via IAX which I am having sent to my Asterisk 
box.  I have 2 X100P cards connected to 2 analogue extension ports of my 
main legacy analogue pabx.  I have set up voicemail for each of my DDI 
numbers, and when a call comes in for the person at pabx extension 21, I 
do the following:

exten =>  xxxx21,1,Macro(stdexten,21,Zap/g1c/21)

The c in the Dial command for Standard Extension causes the Zap channel 
to not return answerbackto the calling party until the user presses a 
'#' key to confirm answer.  This is essential because in an 
analogue-to-analogue call the only confirmation of answer is tones.  I 
don't want to use tone detection as it is too unrelaible and the UK 
progress tones don't work well with callpogress detection anyway.

In my std-extension macro I include the Dial options  r, to allow the 
calling party to hear PSTN ringback until the channel is answered, 
wither by the called party pressing # or the call going to voicemail.

exten => s,1,Dial(${ARG2},30,tTr)                    ; Ring the 
interface, 20 seconds maximum
exten => s,2,Goto(s-${DIALSTATUS},1)

Everything works as expected, but there is one thing missing.  The 
called person picks up the phone and hears silence until they press the 
# key to answer.  This will really confuse my users.  I therefore want 
to play a helpful message _before the called person confirms answer, 
along the lines of 'you have an incoming call.  Press the hash key to 
accept or hangup.' and loop this until either the person presses the # 
key to accept the call, or the dial command times out and the call goes 
to voicemail.

I have tried to work around this by using a Perl script in AGI, but the 
AGI scripts seem to be single threaded, and "exec Background..." waits 
til the background message has finished before moving on, defeating me.

Anyone got any ideas on this?  Anyone hit a similar issue?  Any 
solutions out there?

Many thanks
Tim Robinson
Basingstoke UK



More information about the asterisk-users mailing list