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.
<br><br><div><span class="gmail_quote">On 2/8/07, <b class="gmail_sendername">Alvin Austin</b> <<a href="mailto:aan@crlogic.com">aan@crlogic.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello Asteriskers, :-)<br><br>We're trying to set up an outbound notification calling for system<br>alerts with Asterisk 1.4.0. We generate a call file in<br>/var/spool/asterisk/outgoing and the outbound call is originated through
<br>Zap/1 (Sangoma A200D to a Canadian POTS line). The problem is that<br>Asterisk does not wait for the other side to answer before it starts<br>playing the message. So the person called answers the phone after the<br>
second or third ring and only hears the tail end of the message and the<br>"goodbye".<br><br>Ideally, we want to deliver the message immediately after the person<br>answers, or if an answering machine picks up, right after the "beep".
<br><br>Any suggestions?<br><br>(1) The call file generator script (works ok):<br>#!/bin/sh<br><br>TMPFILE=`mktemp /tmp/tmp.XXXXXXX` || exit 1<br>echo "TMPFILE = $TMPFILE"<br><br>cat <<EOT > $TMPFILE<br>
Channel: Zap/g1/phone_number_here<br>Callerid: SYSTEM<br>MaxRetries: 2<br>RetryTime: 60<br>WaitTime: 30<br>Context: dialout<br>Extension: s<br>Priority: 1<br>EOT<br><br>mv -v $TMPFILE /var/spool/asterisk/outgoing<br><br>(2) The dialout context in
extensions.conf (problem - starts playback<br>before call is answered)<br>[dialout]<br>exten => s,1,NoOp(Dialout)<br>exten => s,n,Set(TIMEOUT(digit)=5)<br>exten => s,n,Set(TIMEOUT(response)=8)<br>exten => s,n,Set(MACHINE=0)
<br>exten => s,n,Answer<br>exten => s,n,BackgroundDetect(silence/5,1000,50)<br>exten => s,n,NoOp(Ans Machine detected)<br>exten => s,n,Set(MACHINE=1)<br>exten => s,n,BackgroundDetect(silence/30,1000,50,30050)
<br>exten => s,n,NoOp(Ans Machine Message Too Long)<br>exten => s,n,Hangup<br><br>exten => talk,1,GotoIf($[${MACHINE}=1]?machine:human)<br>exten => talk,2(machine),Goto(dialout-machine,s,1)<br>exten => talk,3(human),Goto(dialout-human,s,1)
<br><br>[dialout-machine]<br>exten => s,1,NoOp(Dialout to Ans Machine)<br>exten => s,n,Playback(/tmp/asterisk-recording)<br>exten => s,n,Wait(1)<br>; we'd like to do something to wait for the "beep" here...
<br>exten => s,n,Playback(vm-goodbye)<br>exten => s,n,Hangup<br><br>[dialout-human]<br>exten => s,1,NoOp(Dialout to Human)<br>exten => s,n,Playback(/tmp/asterisk-recording)<br>exten => s,n,Wait(1)<br>exten => s,n,Playback(vm-goodbye)
<br>exten => s,n,Hangup<br><br><br>(3) *CLI><br> -- Attempting call on Zap/1/1234567 for s@dialout:1 (Retry 1)<br> > Channel Zap/1-1 was answered.<br> -- Executing [s@dialout:1] NoOp("Zap/1-1", "Dialout") in new stack
<br> -- Executing [s@dialout:2] Set("Zap/1-1", "TIMEOUT(digit)=5") in new<br>stack<br> -- Digit timeout set to 5<br> -- Executing [s@dialout:3] Set("Zap/1-1", "TIMEOUT(response)=8") in
<br>new stack<br> -- Response timeout set to 8<br> -- Executing [s@dialout:4] Set("Zap/1-1", "MACHINE=0") in new stack<br> -- Executing [s@dialout:5] Answer("Zap/1-1", "") in new stack
<br>(Problem: Asterisk does not wait until the call is answered on the far end!)<br> -- Executing [s@dialout:6] BackgroundDetect("Zap/1-1",<br>"silence/5|1000|50") in new stack<br> -- Playing 'silence/5' (language 'en')
<br> -- Executing [talk@dialout:1] GotoIf("Zap/1-1", "0?machine:human")<br>in new stack<br> -- Goto (dialout,talk,3)<br> -- Executing [talk@dialout:3] Goto("Zap/1-1", "dialout-human|s|1")
<br>in new stack<br> -- Goto (dialout-human,s,1)<br> -- Executing [s@dialout-human:1] NoOp("Zap/1-1", "Dialout to Human")<br>in new stack<br> -- Executing [s@dialout-human:2]<br>Playback("Zap/1-1","/tmp/asterisk-recording") in new stack
<br> -- Playing '/tmp/asterisk-recording' (language 'en')<br> -- Executing [s@dialout-human:3] Wait("Zap/1-1", "1") in new stack<br> -- Executing [s@dialout-human:4] Playback("Zap/1-1", "vm-goodbye")
<br>in new stack<br> -- Playing 'vm-goodbye' (language 'en')<br> -- Executing [s@dialout-human:5] Hangup("Zap/1-1", "") in new stack<br> == Spawn extension (dialout-human, s, 5) exited non-zero on 'Zap/1-1'
<br> -- Hungup 'Zap/1-1'<br>[Feb 8 13:29:37] NOTICE[32512]: pbx_spool.c:351 attempt_thread: Call<br>completed to Zap/1/1234567<br><br>Thanks for any ideas on this!<br><br>Alvin<br><br>_______________________________________________
<br>--Bandwidth and Colocation provided by <a href="http://Easynews.com">Easynews.com</a> --<br><br>asterisk-users mailing list<br>To UNSUBSCRIBE or update options visit:<br> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users">
http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br>