Alvin Austin
2007-Feb-08 12:35 UTC
[asterisk-users] Asterisk outbound calling does not wait for answer before playback
Hello Asteriskers, :-) We're trying to set up an outbound notification calling for system alerts with Asterisk 1.4.0. We generate a call file in /var/spool/asterisk/outgoing and the outbound call is originated through Zap/1 (Sangoma A200D to a Canadian POTS line). The problem is that Asterisk does not wait for the other side to answer before it starts playing the message. So the person called answers the phone after the second or third ring and only hears the tail end of the message and the "goodbye". Ideally, we want to deliver the message immediately after the person answers, or if an answering machine picks up, right after the "beep". Any suggestions? (1) The call file generator script (works ok): #!/bin/sh TMPFILE=`mktemp /tmp/tmp.XXXXXXX` || exit 1 echo "TMPFILE = $TMPFILE" cat <<EOT > $TMPFILE Channel: Zap/g1/phone_number_here Callerid: SYSTEM MaxRetries: 2 RetryTime: 60 WaitTime: 30 Context: dialout Extension: s Priority: 1 EOT mv -v $TMPFILE /var/spool/asterisk/outgoing (2) The dialout context in extensions.conf (problem - starts playback before call is answered) [dialout] exten => s,1,NoOp(Dialout) exten => s,n,Set(TIMEOUT(digit)=5) exten => s,n,Set(TIMEOUT(response)=8) exten => s,n,Set(MACHINE=0) exten => s,n,Answer exten => s,n,BackgroundDetect(silence/5,1000,50) exten => s,n,NoOp(Ans Machine detected) exten => s,n,Set(MACHINE=1) exten => s,n,BackgroundDetect(silence/30,1000,50,30050) exten => s,n,NoOp(Ans Machine Message Too Long) exten => s,n,Hangup exten => talk,1,GotoIf($[${MACHINE}=1]?machine:human) exten => talk,2(machine),Goto(dialout-machine,s,1) exten => talk,3(human),Goto(dialout-human,s,1) [dialout-machine] exten => s,1,NoOp(Dialout to Ans Machine) exten => s,n,Playback(/tmp/asterisk-recording) exten => s,n,Wait(1) ; we'd like to do something to wait for the "beep" here... exten => s,n,Playback(vm-goodbye) exten => s,n,Hangup [dialout-human] exten => s,1,NoOp(Dialout to Human) exten => s,n,Playback(/tmp/asterisk-recording) exten => s,n,Wait(1) exten => s,n,Playback(vm-goodbye) exten => s,n,Hangup (3) *CLI> -- Attempting call on Zap/1/1234567 for s@dialout:1 (Retry 1) > Channel Zap/1-1 was answered. -- Executing [s@dialout:1] NoOp("Zap/1-1", "Dialout") in new stack -- Executing [s@dialout:2] Set("Zap/1-1", "TIMEOUT(digit)=5") in new stack -- Digit timeout set to 5 -- Executing [s@dialout:3] Set("Zap/1-1", "TIMEOUT(response)=8") in new stack -- Response timeout set to 8 -- Executing [s@dialout:4] Set("Zap/1-1", "MACHINE=0") in new stack -- Executing [s@dialout:5] Answer("Zap/1-1", "") in new stack (Problem: Asterisk does not wait until the call is answered on the far end!) -- Executing [s@dialout:6] BackgroundDetect("Zap/1-1", "silence/5|1000|50") in new stack -- Playing 'silence/5' (language 'en') -- Executing [talk@dialout:1] GotoIf("Zap/1-1", "0?machine:human") in new stack -- Goto (dialout,talk,3) -- Executing [talk@dialout:3] Goto("Zap/1-1", "dialout-human|s|1") in new stack -- Goto (dialout-human,s,1) -- Executing [s@dialout-human:1] NoOp("Zap/1-1", "Dialout to Human") in new stack -- Executing [s@dialout-human:2] Playback("Zap/1-1","/tmp/asterisk-recording") in new stack -- Playing '/tmp/asterisk-recording' (language 'en') -- Executing [s@dialout-human:3] Wait("Zap/1-1", "1") in new stack -- Executing [s@dialout-human:4] Playback("Zap/1-1", "vm-goodbye") in new stack -- Playing 'vm-goodbye' (language 'en') -- Executing [s@dialout-human:5] Hangup("Zap/1-1", "") in new stack == Spawn extension (dialout-human, s, 5) exited non-zero on 'Zap/1-1' -- Hungup 'Zap/1-1' [Feb 8 13:29:37] NOTICE[32512]: pbx_spool.c:351 attempt_thread: Call completed to Zap/1/1234567 Thanks for any ideas on this! Alvin
Alyed Tzompa
2007-Feb-08 14:21 UTC
[asterisk-users] Asterisk outbound calling does not wait for answer before playback
Had the same issue time ago, but Eric shed good light on it, have a look at: http://lists.digium.com/pipermail/asterisk-users/2006-November/172079.html Summary: sorry, no nice work around. Alyed ---------------------------------------- Return-Path: <asterisk-users-bounces@lists.digium.com> Received: from digium-69-16-138-164.phx1.puregig.net [69.16.138.164] by maila11.webcontrolcenter.com with SMTP; Thu, 8 Feb 2007 13:54:53 -0700 Received: from digium-69-16-138-164.phx1.puregig.net (localhost [127.0.0.1]) by lists.digium.com (Postfix) with ESMTP id 2F6122FC4DD; Thu, 8 Feb 2007 12:35:23 -0700 (MST) Hello Asteriskers, :-) We're trying to set up an outbound notification calling for system alerts with Asterisk 1.4.0. We generate a call file in /var/spool/asterisk/outgoing and the outbound call is originated through Zap/1 (Sangoma A200D to a Canadian POTS line). The problem is that Asterisk does not wait for the other side to answer before it starts playing the message. So the person called answers the phone after the second or third ring and only hears the tail end of the message and the "goodbye". Ideally, we want to deliver the message immediately after the person answers, or if an answering machine picks up, right after the "beep". Any suggestions? (1) The call file generator script (works ok): #!/bin/sh TMPFILE=`mktemp /tmp/tmp.XXXXXXX` || exit 1 echo "TMPFILE = $TMPFILE" cat < $TMPFILE Channel: Zap/g1/phone_number_here Callerid: SYSTEM MaxRetries: 2 RetryTime: 60 WaitTime: 30 Context: dialout Extension: s Priority: 1 EOT mv -v $TMPFILE /var/spool/asterisk/outgoing (2) The dialout context in extensions.conf (problem - starts playback before call is answered) [dialout] exten => s,1,NoOp(Dialout) exten => s,n,Set(TIMEOUT(digit)=5) exten => s,n,Set(TIMEOUT(response)=8) exten => s,n,Set(MACHINE=0) exten => s,n,Answer exten => s,n,BackgroundDetect(silence/5,1000,50) exten => s,n,NoOp(Ans Machine detected) exten => s,n,Set(MACHINE=1) exten => s,n,BackgroundDetect(silence/30,1000,50,30050) exten => s,n,NoOp(Ans Machine Message Too Long) exten => s,n,Hangup exten => talk,1,GotoIf($[${MACHINE}=1]?machine:human) exten => talk,2(machine),Goto(dialout-machine,s,1) exten => talk,3(human),Goto(dialout-human,s,1) [dialout-machine] exten => s,1,NoOp(Dialout to Ans Machine) exten => s,n,Playback(/tmp/asterisk-recording) exten => s,n,Wait(1) ; we'd like to do something to wait for the "beep" here... exten => s,n,Playback(vm-goodbye) exten => s,n,Hangup [dialout-human] exten => s,1,NoOp(Dialout to Human) exten => s,n,Playback(/tmp/asterisk-recording) exten => s,n,Wait(1) exten => s,n,Playback(vm-goodbye) exten => s,n,Hangup (3) *CLI> -- Attempting call on Zap/1/1234567 for s@dialout:1 (Retry 1) > Channel Zap/1-1 was answered. -- Executing [s@dialout:1] NoOp("Zap/1-1", "Dialout") in new stack -- Executing [s@dialout:2] Set("Zap/1-1", "TIMEOUT(digit)=5") in new stack -- Digit timeout set to 5 -- Executing [s@dialout:3] Set("Zap/1-1", "TIMEOUT(response)=8") in new stack -- Response timeout set to 8 -- Executing [s@dialout:4] Set("Zap/1-1", "MACHINE=0") in new stack -- Executing [s@dialout:5] Answer("Zap/1-1", "") in new stack (Problem: Asterisk does not wait until the call is answered on the far end!) -- Executing [s@dialout:6] BackgroundDetect("Zap/1-1", "silence/5|1000|50") in new stack -- Playing 'silence/5' (language 'en') -- Executing [talk@dialout:1] GotoIf("Zap/1-1", "0?machine:human") in new stack -- Goto (dialout,talk,3) -- Executing [talk@dialout:3] Goto("Zap/1-1", "dialout-human|s|1") in new stack -- Goto (dialout-human,s,1) -- Executing [s@dialout-human:1] NoOp("Zap/1-1", "Dialout to Human") in new stack -- Executing [s@dialout-human:2] Playback("Zap/1-1","/tmp/asterisk-recording") in new stack -- Playing '/tmp/asterisk-recording' (language 'en') -- Executing [s@dialout-human:3] Wait("Zap/1-1", "1") in new stack -- Executing [s@dialout-human:4] Playback("Zap/1-1", "vm-goodbye") in new stack -- Playing 'vm-goodbye' (language 'en') -- Executing [s@dialout-human:5] Hangup("Zap/1-1", "") in new stack == Spawn extension (dialout-human, s, 5) exited non-zero on 'Zap/1-1' -- Hungup 'Zap/1-1' [Feb 8 13:29:37] NOTICE[32512]: pbx_spool.c:351 attempt_thread: Call completed to Zap/1/1234567 Thanks for any ideas on this! Alvin _______________________________________________ --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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070208/d3ffb867/attachment.htm
Robert DeVries
2007-Feb-08 17:21 UTC
[asterisk-users] Asterisk outbound calling does not wait for answer before playback
Although probably not what you want to hear, I don't think there is any way that Asterisk will detect answering supervision on an analog POTS line (I believe that there used to be an option with some Telcos to get a polarity reversal upon answering, but I don't think that is possible any more.) If you were willing to make the calls using a VOIP provider like Voipjet you would not have this problem, but that might not meet your needs for other reasons. On 2/8/07, Alvin Austin <aan@crlogic.com> wrote:> > Hello Asteriskers, :-) > > We're trying to set up an outbound notification calling for system > alerts with Asterisk 1.4.0. We generate a call file in > /var/spool/asterisk/outgoing and the outbound call is originated through > Zap/1 (Sangoma A200D to a Canadian POTS line). The problem is that > Asterisk does not wait for the other side to answer before it starts > playing the message. So the person called answers the phone after the > second or third ring and only hears the tail end of the message and the > "goodbye". > > Ideally, we want to deliver the message immediately after the person > answers, or if an answering machine picks up, right after the "beep". > > Any suggestions? > > (1) The call file generator script (works ok): > #!/bin/sh > > TMPFILE=`mktemp /tmp/tmp.XXXXXXX` || exit 1 > echo "TMPFILE = $TMPFILE" > > cat <<EOT > $TMPFILE > Channel: Zap/g1/phone_number_here > Callerid: SYSTEM > MaxRetries: 2 > RetryTime: 60 > WaitTime: 30 > Context: dialout > Extension: s > Priority: 1 > EOT > > mv -v $TMPFILE /var/spool/asterisk/outgoing > > (2) The dialout context in extensions.conf (problem - starts playback > before call is answered) > [dialout] > exten => s,1,NoOp(Dialout) > exten => s,n,Set(TIMEOUT(digit)=5) > exten => s,n,Set(TIMEOUT(response)=8) > exten => s,n,Set(MACHINE=0) > exten => s,n,Answer > exten => s,n,BackgroundDetect(silence/5,1000,50) > exten => s,n,NoOp(Ans Machine detected) > exten => s,n,Set(MACHINE=1) > exten => s,n,BackgroundDetect(silence/30,1000,50,30050) > exten => s,n,NoOp(Ans Machine Message Too Long) > exten => s,n,Hangup > > exten => talk,1,GotoIf($[${MACHINE}=1]?machine:human) > exten => talk,2(machine),Goto(dialout-machine,s,1) > exten => talk,3(human),Goto(dialout-human,s,1) > > [dialout-machine] > exten => s,1,NoOp(Dialout to Ans Machine) > exten => s,n,Playback(/tmp/asterisk-recording) > exten => s,n,Wait(1) > ; we'd like to do something to wait for the "beep" here... > exten => s,n,Playback(vm-goodbye) > exten => s,n,Hangup > > [dialout-human] > exten => s,1,NoOp(Dialout to Human) > exten => s,n,Playback(/tmp/asterisk-recording) > exten => s,n,Wait(1) > exten => s,n,Playback(vm-goodbye) > exten => s,n,Hangup > > > (3) *CLI> > -- Attempting call on Zap/1/1234567 for s@dialout:1 (Retry 1) > > Channel Zap/1-1 was answered. > -- Executing [s@dialout:1] NoOp("Zap/1-1", "Dialout") in new stack > -- Executing [s@dialout:2] Set("Zap/1-1", "TIMEOUT(digit)=5") in new > stack > -- Digit timeout set to 5 > -- Executing [s@dialout:3] Set("Zap/1-1", "TIMEOUT(response)=8") in > new stack > -- Response timeout set to 8 > -- Executing [s@dialout:4] Set("Zap/1-1", "MACHINE=0") in new stack > -- Executing [s@dialout:5] Answer("Zap/1-1", "") in new stack > (Problem: Asterisk does not wait until the call is answered on the far > end!) > -- Executing [s@dialout:6] BackgroundDetect("Zap/1-1", > "silence/5|1000|50") in new stack > -- Playing 'silence/5' (language 'en') > -- Executing [talk@dialout:1] GotoIf("Zap/1-1", "0?machine:human") > in new stack > -- Goto (dialout,talk,3) > -- Executing [talk@dialout:3] Goto("Zap/1-1", "dialout-human|s|1") > in new stack > -- Goto (dialout-human,s,1) > -- Executing [s@dialout-human:1] NoOp("Zap/1-1", "Dialout to Human") > in new stack > -- Executing [s@dialout-human:2] > Playback("Zap/1-1","/tmp/asterisk-recording") in new stack > -- Playing '/tmp/asterisk-recording' (language 'en') > -- Executing [s@dialout-human:3] Wait("Zap/1-1", "1") in new stack > -- Executing [s@dialout-human:4] Playback("Zap/1-1", "vm-goodbye") > in new stack > -- Playing 'vm-goodbye' (language 'en') > -- Executing [s@dialout-human:5] Hangup("Zap/1-1", "") in new stack > == Spawn extension (dialout-human, s, 5) exited non-zero on 'Zap/1-1' > -- Hungup 'Zap/1-1' > [Feb 8 13:29:37] NOTICE[32512]: pbx_spool.c:351 attempt_thread: Call > completed to Zap/1/1234567 > > Thanks for any ideas on this! > > Alvin > > _______________________________________________ > --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 >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070208/f4f1754a/attachment-0001.htm