<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&nbsp;asterisk server, the .bash program is run from the crontab&nbsp;at a certain time and notifiy staff if the job is not complete at that time.&nbsp; It will keep calling (using phoneme[1-3].call until someone acknowleges the alert by pressing &quot;1&quot;. 
</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>There might be&nbsp;a better&nbsp;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 =&gt; t,1,Playback(connection-timed-out)<br>exten =&gt; t,2,Playback(goodbye)<br>exten =&gt; t,3,Hangup()</p>
<p>exten =&gt; 9999,1,Playback(something-terribly-wrong)<br>exten =&gt; 9999,2,Playback(to-confirm-wakeup)<br>exten =&gt; 9999,3,Playback(press)<br>exten =&gt; 9999,4,SayDigits(1)<br>exten =&gt; 9999,5,Read(ACCEPTCALL|1-yes-2-no|1) ; (repeatoptions)
<br>exten =&gt; 9999,6,GotoIf($[&quot;${ACCEPTCALL}&quot; = &quot;&quot;] ?9999,9)<br>exten =&gt; 9999,7,GotoIf($[${ACCEPTCALL} = 2] ?9999,9)<br>exten =&gt; 9999,8,GotoIf($[${ACCEPTCALL} = 1] ?9999,96:9999,1)<br>exten =&gt; 9999,9,Playback(auth-thankyou)
<br>exten =&gt; 9999,10,Playback(goodbye)<br>exten =&gt; 9999,11,Hangup()</p>
<p>exten =&gt; 9999,96,System(/bin/touch /phonehome/ack.flag)<br>exten =&gt; 9999,97,Playback(auth-thankyou)<br>exten =&gt; 9999,98,Playback(goodbye)<br>exten =&gt; 9999,99,Hangup()</p>
<p>&nbsp;</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>&nbsp; then echo &quot;job completed&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>fi<br>rm -f /phonehome/ack.flag<br>while true<br>do<br>&nbsp; cp -f /phonehome/phoneme1.call /var/spool/asterisk/outgoing<br>&nbsp; while [ -e /var/spool/asterisk/outgoing/phoneme1.call&nbsp; ]
<br>&nbsp; do<br>&nbsp;&nbsp;&nbsp; sleep 5<br>&nbsp; done<br>&nbsp; if [ -e /phonehome/ack.flag ]<br>&nbsp;&nbsp;&nbsp; then&nbsp;&nbsp; echo &quot;ack!!&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp; else&nbsp;&nbsp; echo &quot;no ack&quot;<br>&nbsp; fi</p>
<p>&nbsp; cp -f /phonehome/phoneme2.call /var/spool/asterisk/outgoing<br>&nbsp; while [ -e /var/spool/asterisk/outgoing/phoneme2.call&nbsp; ]<br>&nbsp; do<br>&nbsp;&nbsp;&nbsp; sleep 5<br>&nbsp; done<br>&nbsp; if [ -e /phonehome/ack.flag ]<br>&nbsp;&nbsp;&nbsp; then&nbsp;&nbsp; echo &quot;ack!!&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp; else&nbsp;&nbsp; echo &quot;no ack&quot;<br>&nbsp; fi</p>
<p>&nbsp; cp -f /phonehome/phoneme3.call /var/spool/asterisk/outgoing<br>&nbsp; while [ -e /var/spool/asterisk/outgoing/phoneme3.call&nbsp; ]<br>&nbsp; do<br>&nbsp;&nbsp;&nbsp; sleep 5<br>&nbsp; done<br>&nbsp; if [ -e /phonehome/ack.flag ]<br>&nbsp;&nbsp;&nbsp; then&nbsp;&nbsp; echo &quot;ack!!&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp; else&nbsp;&nbsp; echo &quot;no ack&quot;<br>&nbsp; fi<br>done<br></p></div>
<div>&nbsp;</div>
<div><br><br>&nbsp;</div>
<div><span class="gmail_quote">On 11/25/05, <b class="gmail_sendername">Tom Rymes</b> &lt;<a href="mailto:trymes@cascadelinksystems.com">trymes@cascadelinksystems.com</a>&gt; 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>&gt; Hi<br>&gt;<br>&gt; I'm pretty new to using Asterisk and have searched to find an
<br>&gt; answer to my question but have failed to.<br>&gt;<br>&gt; I was wondering if you can use Asterisk from the command line to<br>&gt; make it make an outgoing call and issue other commands whilst it's<br>&gt; in the call?
<br>&gt;<br>&gt; Sort of like when you use Minicom with a modem connected to a<br>&gt; serial port and send it AT commands.<br>&gt;<br>&gt;&nbsp;&nbsp;Thanks<br>&gt;<br>&gt; 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>&quot;Intelligent technology solutions for small businesses.&quot;
<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>&nbsp;&nbsp;<a href="http://lists.digium.com/mailman/listinfo/asterisk-users">
http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br>