<br><br><div class="gmail_quote">2011/6/28 Ezequiel Lovelle <span dir="ltr">&lt;<a href="mailto:elovelle@dialdata.com.ar">elovelle@dialdata.com.ar</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<u></u>
<div>
<p style="margin-bottom:0cm"><span>I need to make an IVR as follows: </span></p>
<p style="margin-bottom:0cm"><span>1 an incoming call and run an AGI script to alert the database, everything perfect here.<br>2 Play a music on hold and executes a loop while searching the database for a change in a field when the field change, cut the music on hold and keep doing things. I can do this?<br>
I solved it by doing the following:</span></p>
<p style="margin-bottom:0cm"> </p>
<p style="margin-bottom:0cm">exten =&gt; 4321,n,Answer()</p>
<p style="margin-bottom:0cm">exten =&gt; 4321,n,AGI(script.agi,${UNIQUEID},WAITING)</p>
<p style="margin-bottom:0cm"><a name="130d7bf5cd0a2983_result_box1"></a>;<span>Plays music with duration of 5 seconds</span></p>
<p style="margin-bottom:0cm">exten =&gt; 4321,n,Playback(waiting-bucle-audio)</p>
<p style="margin-bottom:0cm">exten =&gt; 4321,n,AGI(script-test.agi,${UNIQUEID})</p>
<p style="margin-bottom:0cm">;If script return variable ${state} with text “TRANSFERING” goto “call”</p>
<p style="margin-bottom:0cm">exten =&gt; 4321,n,GotoIf($[&quot;${state}&quot; = &quot;TRANSFERING&quot;]?call)</p>
<p style="margin-bottom:0cm">exten =&gt; 4321,n,Goto(context,4321,3)</p>
<p style="margin-bottom:0cm">exten =&gt; 4321,n(call),Dial(SIP/${sip},,20)</p>
<p style="margin-bottom:0cm">exten =&gt; 4321,n,Hangup()</p>
<p style="margin-bottom:0cm"> </p>
<p style="margin-bottom:0cm"><a name="130d7bf5cd0a2983_result_box2"></a><span>anyone have any idea how I can run a script in a loop until I return what I want and cut the music on hold?</span></p>
<p style="margin-bottom:0cm"><span>any help is welcome</span></p>
<p> </p>
</div>
<br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
               <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</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" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br><br>I would use Ringing<br><p style="margin-bottom:0cm">
exten =&gt; 4321,n,Answer()</p>
<p style="margin-bottom: 0cm;">exten =&gt; 4321,n,Ringing()</p><p style="margin-bottom:0cm">exten =&gt; 4321,n,AGI(script.agi,${UNIQUEID},WAITING)</p>
<p style="margin-bottom:0cm"><a name="130d7bf5cd0a2983_result_box1"></a>;<span>It is still Ringing<br></span></p><p style="margin-bottom:0cm">exten =&gt; 4321,n,AGI(script-test.agi,${UNIQUEID})</p>
<p style="margin-bottom:0cm">;If script return variable ${state} with text “TRANSFERING” goto “call”</p>
<p style="margin-bottom:0cm">exten =&gt; 4321,n,GotoIf($[&quot;${state}&quot; = &quot;TRANSFERING&quot;]?call)</p>
<br><br clear="all"><br>-- <br>Jose Flores Galicia<br>Tels: 238 1370314<br>Cel: 238 1057136<br>Skype: flojose.briefcode<br>MSN: <a href="mailto:flojose@gmail.com">flojose@gmail.com</a><br>&lt;&lt;<a href="mailto:FloJoSe@gmail.com">FloJoSe@gmail.com</a>&gt;&gt;<br>
BriefCode &amp;&amp; Code Based Training<br>