<div>Hi Martin, </div>
<div> </div>
<div>Thanks for your reply. Maybe I wasn't clear enough. I am already running AGI periodically</div>
<div>inside a call and it runs just fine. I'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'm using it for a prepaid system that needs to allow more than one prepaid call to run simultaneously.
</div>
<div> </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> </div>
<div>Thanks again,</div>
<div> </div>
<div>Adi.</div>
<div><br><br> </div>
<div><span class="gmail_quote">On 5/31/07, <b class="gmail_sendername">Martin Smith</b> <<a href="mailto:martins@bebr.ufl.edu">martins@bebr.ufl.edu</a>> 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> </div>
<div dir="ltr" align="left"><span><font face="Arial" size="2">AGI is probably best viewed like any other dialplan application (and with DeadAGI something that happens after, but anyway) -- in my opinion. I've seen people do some pretty wild stuff with it, but in the end, when I wonder if the Manager interface or AGI interface is most appropriate for a given task, I ask questions like "Would I want to do this with another application? Is this even possible with another application?".
</font></span></div>
<div dir="ltr" align="left"><span><font face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font face="Arial" size="2">In your case, I'd say you probably couldn't say... periodically execute a dialplan application that runs in the middle of a call without interrupting the call (with AGI, anyway). I'd recommend using the Manager interface and polling for call durations / listening for events and acting on the information you get back (I'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> </div>
<div dir="ltr" align="left"><span><font face="Arial" size="2">Hope this helps -- others, please jump in if I'm way wrong :)</font></span></div>
<div> </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> </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> </div>
<div><span class="e" id="q_112e3ab94fb275c0_1">
<div></div>
<div>Hi,</div>
<div> </div>
<div>I'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> </div>
<div>Thanks,</div>
<div> </div>
<div>Adi.</div>
<div> </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> <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>