<div>Hi Martin, </div>
<div>&nbsp;</div>
<div>Thanks for your reply. Maybe I wasn&#39;t clear enough. I am already running AGI periodically</div>
<div>inside a call and it runs just fine. I&#39;m using a patch for asterisk (can be found <a href="http://asterisk-backports.org/wiki/index.php/User_talk:KNK">here</a>) to do so. In short i&#39;m using it for a prepaid system that needs to allow more than one prepaid call to run simultaneously. 
</div>
<div>&nbsp;</div>
<div>Anyway, I solved my problem by changing the code a bit. I added an AGI variable that holds the timestamp of the call answer time, thus allowing me to use it as an anchor for knowing how much time passed since the beginning of the call.
</div>
<div>&nbsp;</div>
<div>Thanks again,</div>
<div>&nbsp;</div>
<div>Adi.</div>
<div><br><br>&nbsp;</div>
<div><span class="gmail_quote">On 5/31/07, <b class="gmail_sendername">Martin Smith</b> &lt;<a href="mailto:martins@bebr.ufl.edu">martins@bebr.ufl.edu</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>
<div dir="ltr" align="left"><span><font face="Arial" size="2">Hi Adi,</font></span></div>
<div dir="ltr" align="left"><span><font face="Arial" size="2"></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font face="Arial" size="2">AGI is probably best viewed&nbsp;like any&nbsp;other dialplan application (and with DeadAGI something that happens after, but anyway) -- in my opinion. I&#39;ve seen people do some pretty wild stuff with it, but in the end,&nbsp;when I wonder if the Manager interface or AGI interface is most appropriate for a given task, I ask questions like &quot;Would I want to do this with another application? Is this even possible with another application?&quot;.
</font></span></div>
<div dir="ltr" align="left"><span><font face="Arial" size="2"></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font face="Arial" size="2">In your case, I&#39;d say you probably couldn&#39;t say... periodically execute a dialplan application that runs in the middle of a call without interrupting the call (with AGI, anyway). I&#39;d recommend using the Manager interface and polling for&nbsp;call durations&nbsp;/ listening for events&nbsp;and acting on the information you get back (I&#39;d assume the answered duration is one of those values you could poll for).
</font></span></div>
<div dir="ltr" align="left"><span><font face="Arial" size="2"></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font face="Arial" size="2">Hope this helps -- others, please jump in if I&#39;m way wrong :)</font></span></div>
<div>&nbsp;</div>
<p align="left"><font size="2">Martin Smith, Systems Developer<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:martins@bebr.ufl.edu" target="_blank">martins@bebr.ufl.edu</a><br>Bureau of Economic and Business Research
<br>University of Florida<br>(352) 392-0171 Ext. 221</font> </p>
<div>&nbsp;</div><br>
<blockquote dir="ltr" style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<div lang="en-us" dir="ltr" align="left">
<hr>
<font face="Tahoma" size="2"><b>From:</b> <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a> [mailto:
<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a>] <b>On Behalf Of </b>Adi Simon<br><b>Sent:</b> Thursday, May 31, 2007 5:54 AM
<br><b>To:</b> <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:asterisk-users@lists.digium.com" target="_blank">asterisk-users@lists.digium.com</a><br><b>Subject:</b> [asterisk-users] Passing call duration to an AGI Script
<br></font><br>&nbsp;</div>
<div><span class="e" id="q_112e3ab94fb275c0_1">
<div></div>
<div>Hi,</div>
<div>&nbsp;</div>
<div>I&#39;m trying to find a way of passing the actual call duration (something like ANSWEREDTIME) to an AGI</div>
<div>script that runs periodically during a call. Any ideas?</div>
<div>&nbsp;</div>
<div>Thanks,</div>
<div>&nbsp;</div>
<div>Adi.</div>
<div>&nbsp;</div></span></div></blockquote></div><br>_______________________________________________<br>--Bandwidth and Colocation provided by <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://easynews.com/" target="_blank">
Easynews.com</a> --<br><br>asterisk-users mailing list<br>To UNSUBSCRIBE or update options visit:<br>&nbsp; <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">
http://lists.digium.com/mailman/listinfo/asterisk-users</a><br><br></blockquote></div><br>