<div>Hi,</div>
<div> </div>
<div>What I did is first to dig a bit into the app_dial.c. I saw how the ANSWEREDTIME variable</div>
<div>is created (end_time - answer_time). Then I added some lines to export the answer_time variable</div>
<div>as a channel variable. I added these lines right after the answer_time decleration (line 1426 in ver 1.4.4)</div>
<div>compiled and replaced the module.</div>
<div> </div>
<div> char toast2[80];<br> snprintf(toast2, sizeof(toast2), "%ld", (long)(answer_time));<br> pbx_builtin_setvar_helper(chan, "ANSWERTIME", toast2);<br> </div>
<div>This will put the call start time in unix timestamp in the channel variable ANSWERTIME. That's</div>
<div>all. Hope it's helping.</div>
<div> </div>
<div>Adi.</div>
<div><br> </div>
<div><span class="gmail_quote">On 6/1/07, <b class="gmail_sendername">Luis Morales</b> <<a href="mailto:lmorales@sigmadental.net">lmorales@sigmadental.net</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Adi,<br><br>My be better if you send us the code about how did you do to catch and<br>retrive the data from asterisk.
<br><br>Regards,<br><br>Luis Morales<br><br>On Fri, 2007-06-01 at 01:21 +0300, Adi Simon wrote:<br>> Hi Martin,<br>><br>> Thanks for your reply. Maybe I wasn't clear enough. I am already<br>> running AGI periodically
<br>> inside a call and it runs just fine. I'm using a patch for asterisk<br>> (can be found here) to do so. In short i'm using it for a prepaid<br>> system that needs to allow more than one prepaid call to run
<br>> simultaneously.<br>><br>> Anyway, I solved my problem by changing the code a bit. I added an AGI<br>> variable that holds the timestamp of the call answer time, thus<br>> allowing me to use it as an anchor for knowing how much time passed
<br>> since the beginning of the call.<br>><br>> Thanks again,<br>><br>> Adi.<br>><br>><br>><br>> On 5/31/07, Martin Smith <<a href="mailto:martins@bebr.ufl.edu">martins@bebr.ufl.edu</a>> wrote:
<br>> Hi Adi,<br>><br>> AGI is probably best viewed like any other dialplan<br>> application (and with DeadAGI something that happens after,<br>> but anyway) -- in my opinion. I've seen people do some pretty
<br>> wild stuff with it, but in the end, when I wonder if the<br>> Manager interface or AGI interface is most appropriate for a<br>> given task, I ask questions like "Would I want to do this with
<br>> another application? Is this even possible with another<br>> application?".<br>><br>> In your case, I'd say you probably couldn't say...<br>> periodically execute a dialplan application that runs in the
<br>> middle of a call without interrupting the call (with AGI,<br>> anyway). I'd recommend using the Manager interface and polling<br>> for call durations / listening for events and acting on the
<br>> information you get back (I'd assume the answered duration is<br>> one of those values you could poll for).<br>><br>> Hope this helps -- others, please jump in if I'm way wrong :)
<br>><br>> Martin Smith, Systems Developer<br>> <a href="mailto:martins@bebr.ufl.edu">martins@bebr.ufl.edu</a><br>> Bureau of Economic and Business Research<br>> University of Florida
<br>> (352) 392-0171 Ext. 221<br>><br>><br>><br>><br>> ______________________________________________________<br>> From: <a href="mailto:asterisk-users-bounces@lists.digium.com">
asterisk-users-bounces@lists.digium.com</a> [mailto:<br>> <a href="mailto:asterisk-users-bounces@lists.digium.com">asterisk-users-bounces@lists.digium.com</a>] On Behalf Of<br>> Adi Simon
<br>> Sent: Thursday, May 31, 2007 5:54 AM<br>> To: <a href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</a><br>> Subject: [asterisk-users] Passing call duration to an
<br>> AGI Script<br>><br>><br>><br>> Hi,<br>><br>> I'm trying to find a way of passing the actual call<br>> duration (something like ANSWEREDTIME) to an AGI
<br>> script that runs periodically during a call. Any<br>> ideas?<br>><br>> Thanks,<br>><br>> Adi.<br>><br>><br>> _______________________________________________
<br>> --Bandwidth and Colocation provided by <a href="http://Easynews.com">Easynews.com</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">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>><br>><br>> _______________________________________________<br>> --Bandwidth and Colocation provided by
<a href="http://Easynews.com">Easynews.com</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">http://lists.digium.com/mailman/listinfo/asterisk-users
</a><br>--<br>.-.-.-.-.-.-.-.-.-.-.-.-.--.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.<br>Sigma Dental Plan<br>Jefe de Soporte y Sistemas<br>Telf. Oficina : +58(212)2646811<br>Cel. : +58(416)4242091<br>Caracas, Venezuela
<br>.-.-.-.-.-.-.-.-.-.-.-.-.--.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.<br><br>_______________________________________________<br>--Bandwidth and Colocation provided by <a href="http://Easynews.com">Easynews.com</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">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br>