<div>For an example here is what I setup to call out, we have a job that runs on our mainframe, when the job completes it ftps flag1.txt to our asterisk server, the .bash program is run from the crontab at a certain time and notifiy staff if the job is not complete at that time. It will keep calling (using phoneme[1-3].call until someone acknowleges the alert by pressing "1".
</div>
<div> </div>
<div> </div>
<div>There might be a better way of doing this using AGI (or another way), but this is what I came up with. </div>
<div>
<p>--- extensions.conf --- </p>
<p>[phonehome]</p>
<p>exten => t,1,Playback(connection-timed-out)<br>exten => t,2,Playback(goodbye)<br>exten => t,3,Hangup()</p>
<p>exten => 9999,1,Playback(something-terribly-wrong)<br>exten => 9999,2,Playback(to-confirm-wakeup)<br>exten => 9999,3,Playback(press)<br>exten => 9999,4,SayDigits(1)<br>exten => 9999,5,Read(ACCEPTCALL|1-yes-2-no|1) ; (repeatoptions)
<br>exten => 9999,6,GotoIf($["${ACCEPTCALL}" = ""] ?9999,9)<br>exten => 9999,7,GotoIf($[${ACCEPTCALL} = 2] ?9999,9)<br>exten => 9999,8,GotoIf($[${ACCEPTCALL} = 1] ?9999,96:9999,1)<br>exten => 9999,9,Playback(auth-thankyou)
<br>exten => 9999,10,Playback(goodbye)<br>exten => 9999,11,Hangup()</p>
<p>exten => 9999,96,System(/bin/touch /phonehome/ack.flag)<br>exten => 9999,97,Playback(auth-thankyou)<br>exten => 9999,98,Playback(goodbye)<br>exten => 9999,99,Hangup()</p>
<p> </p>
<p>--- phoneme1.call ---</p>
<p>Channel: Zap/g2/5551212<br>MaxRetries: 0<br>RetryTime: 60<br>WaitTime: 30<br>Context: phonehome<br>Extension: 9999<br>Priority: 1</p>
<p><br>--- phonehome.bash ---</p>
<p>if [ -e /home/mainframe/flag1.txt ]<br> then echo "job completed"<br> exit;<br>fi<br>rm -f /phonehome/ack.flag<br>while true<br>do<br> cp -f /phonehome/phoneme1.call /var/spool/asterisk/outgoing<br> while [ -e /var/spool/asterisk/outgoing/phoneme1.call ]
<br> do<br> sleep 5<br> done<br> if [ -e /phonehome/ack.flag ]<br> then echo "ack!!"<br> exit;<br> else echo "no ack"<br> fi</p>
<p> cp -f /phonehome/phoneme2.call /var/spool/asterisk/outgoing<br> while [ -e /var/spool/asterisk/outgoing/phoneme2.call ]<br> do<br> sleep 5<br> done<br> if [ -e /phonehome/ack.flag ]<br> then echo "ack!!"
<br> exit;<br> else echo "no ack"<br> fi</p>
<p> cp -f /phonehome/phoneme3.call /var/spool/asterisk/outgoing<br> while [ -e /var/spool/asterisk/outgoing/phoneme3.call ]<br> do<br> sleep 5<br> done<br> if [ -e /phonehome/ack.flag ]<br> then echo "ack!!"
<br> exit;<br> else echo "no ack"<br> fi<br>done<br></p></div>
<div> </div>
<div><br><br> </div>
<div><span class="gmail_quote">On 11/25/05, <b class="gmail_sendername">Tom Rymes</b> <<a href="mailto:trymes@cascadelinksystems.com">trymes@cascadelinksystems.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">On Nov 25, 2005, at 7:33 AM, Tony Spencer wrote:<br>> Hi<br>><br>> I'm pretty new to using Asterisk and have searched to find an
<br>> answer to my question but have failed to.<br>><br>> I was wondering if you can use Asterisk from the command line to<br>> make it make an outgoing call and issue other commands whilst it's<br>> in the call?
<br>><br>> Sort of like when you use Minicom with a modem connected to a<br>> serial port and send it AT commands.<br>><br>> Thanks<br>><br>> Tony<br><br>Tony,<br><br>If you have a sound card installed and properly configured in your
<br>Asterisk server, then you can plug in a microphone and headset and<br>make calls from the CLI using the dial command.<br><br>If you want to automate having the system make phone calls, google<br>and search <a href="http://voip-info.org">
voip-info.org</a> for info on .call files. Basically, you<br>create a file that specifies to asterisk where to call, using which<br>channel, and what to do once the call is connnected. You then copy<br>the file to /var/spool/asterisk/outgoing and the call is executed as
<br>defined.<br><br>Tom<br><br>--------------------<br>Tom Rymes<br>Cascade Link Systems<br><a href="http://www.cascadelinksystems.com">www.cascadelinksystems.com</a><br>(603) 375-1414<br><br>"Intelligent technology solutions for small businesses."
<br><br><br>_______________________________________________<br>--Bandwidth and Colocation sponsored by <a href="http://Easynews.com">Easynews.com</a> --<br><br>Asterisk-Users mailing list<br><a href="mailto:Asterisk-Users@lists.digium.com">
Asterisk-Users@lists.digium.com</a><br><a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a><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>