Re: [asterisk-users] Passing call duration to an AGI Script
Hi, What I did is first to dig a bit into the app_dial.c. I saw how the ANSWEREDTIME variable is created (end_time - answer_time). Then I added some lines to export the answer_time variable as a channel variable. I added these lines right after the answer_time decleration (line 1426 in ver 1.4.4) compiled and replaced the module. char toast2[80]; snprintf(toast2, sizeof(toast2), %ld, (long)(answer_time)); pbx_builtin_setvar_helper(chan, ANSWERTIME, toast2); This will put the call start time in unix timestamp in the channel variable ANSWERTIME. That's all. Hope it's helping. Adi. On 6/1/07, Luis Morales [EMAIL PROTECTED] wrote: Hi Adi, My be better if you send us the code about how did you do to catch and retrive the data from asterisk. Regards, Luis Morales On Fri, 2007-06-01 at 01:21 +0300, Adi Simon wrote: Hi Martin, Thanks for your reply. Maybe I wasn't clear enough. I am already running AGI periodically inside a call and it runs just fine. I'm using a patch for asterisk (can be found here) 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. 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. Thanks again, Adi. On 5/31/07, Martin Smith [EMAIL PROTECTED] wrote: Hi Adi, 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?. 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). Hope this helps -- others, please jump in if I'm way wrong :) Martin Smith, Systems Developer [EMAIL PROTECTED] Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221 __ From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] On Behalf Of Adi Simon Sent: Thursday, May 31, 2007 5:54 AM To: asterisk-users@lists.digium.com Subject: [asterisk-users] Passing call duration to an AGI Script Hi, I'm trying to find a way of passing the actual call duration (something like ANSWEREDTIME) to an AGI script that runs periodically during a call. Any ideas? Thanks, Adi. ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- .-.-.-.-.-.-.-.-.-.-.-.-.--.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. Sigma Dental Plan Jefe de Soporte y Sistemas Telf. Oficina : +58(212)2646811 Cel.: +58(416)4242091 Caracas, Venezuela .-.-.-.-.-.-.-.-.-.-.-.-.--.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Passing call duration to an AGI Script
Hi, I'm trying to find a way of passing the actual call duration (something like ANSWEREDTIME) to an AGI script that runs periodically during a call. Any ideas? Thanks, Adi. ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Passing call duration to an AGI Script
Hi Martin, Thanks for your reply. Maybe I wasn't clear enough. I am already running AGI periodically inside a call and it runs just fine. I'm using a patch for asterisk (can be found here http://asterisk-backports.org/wiki/index.php/User_talk:KNK) 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. 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. Thanks again, Adi. On 5/31/07, Martin Smith [EMAIL PROTECTED] wrote: Hi Adi, 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?. 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). Hope this helps -- others, please jump in if I'm way wrong :) Martin Smith, Systems Developer [EMAIL PROTECTED] Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221 -- *From:* [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] *On Behalf Of *Adi Simon *Sent:* Thursday, May 31, 2007 5:54 AM *To:* asterisk-users@lists.digium.com *Subject:* [asterisk-users] Passing call duration to an AGI Script Hi, I'm trying to find a way of passing the actual call duration (something like ANSWEREDTIME) to an AGI script that runs periodically during a call. Any ideas? Thanks, Adi. ___ --Bandwidth and Colocation provided by Easynews.com http://easynews.com/-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] SER with multiple asterisk deployment
Mainly I have a problem of figuring out how to use them with dispatcher or any other mean of switching between asterisks. Do you have any configuration example of such? On 9/28/06, Simone Ricci [EMAIL PROTECTED] wrote: Adi Simon ha scritto: Hi, Did anyone actually manage setting up a single SER with multiple Asterisk boxes? I particulary have a problem of keeping the session alive and by that I mean directing all the following sip messages to the same asterisk box the first signal was sent (randomally). record_route() and loose_route() should help you, AFAIK. They don't?Cheers,Simone.___--Bandwidth and Colocation provided by Easynews.com --asterisk-users mailing listTo UNSUBSCRIBE or update options visit:http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] SER with multiple asterisk deployment
Hi, Did anyone actually manage setting up a single SER with multiple Asterisk boxes? I particulary have a problem of keeping the session alive and by that I mean directing all the following sip messages to the same asterisk box the first signal was sent (randomally). Please don't direct me to Asterisk+At+Large or the asterisk_integration page at openser.org as they are quite old and useless. What I seek are examples of ser.cfg or some advice from someone who actually managed to accomplish this. Thanks, Adi. ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] SER with multiple asterisk deployment
Hi Zac, Thank you so much for your sincere answer. What you brought up is exactly what I encountered when I tried to find a solution for this, the documentation is inconsistent and ambiguous, and everywhere I look I end up with outdated examples that make little or no sense in the good case, or just don't compile due to being so old in the bad case. This is very frustrating but just by reading what you wrotewas very uplifting for me. Thanks again, Adi. On 9/27/06, Zac Amsler [EMAIL PROTECTED] wrote: Adi,It is possible to do what you are looking for. It is actually easy.There is a problem that I have found with ser/openser.. Documentation is difficult to read and some things are just not there, so you get peoplethat spend many hours trying to get these functions to work. In thesedays time is money, so the people that know how to do what you are seeking.. charge large amounts of money for a simple 50 line config file.I will tell you that everything you are looking for is documented inexamples. You will have to piece them together and make them work in harmony like the rest of us have.I suggest you look at voip user and piece the config together fromexamples there. It may also help you to read the source code of themodules that handle routing in ser. There are a few tricks that are hidden in the code.I am sorry for my vagueness. I am not able to share the configinformation due to an IP agreement with my company.(They think it is atrade secret)I wish you the best. Cheers,Zac Amsler, Network OperationsSur-Tel Communications, Inc. NetIQ Systems, LLC* US48, Canada, A-Z Wholesale Termination.* US48 Origination, Toll Free DIDs.* Toll Free Termination (FREE). Adi Simon wrote: Hi, Did anyone actually manage setting up a single SER with multiple Asterisk boxes? I particulary have a problem of keeping the session alive and by that I mean directing all the following sip messages to the same asterisk box the first signal was sent (randomally). Please don't direct me to Asterisk+At+Large http://www.voip-info.org/wiki-Asterisk+at+large or the asterisk_integration http://www.openser.org/dokuwiki/doku.php?id=asterisk_integration page at openser.org http://openser.org as they are quite old and useless. What I seek are examples of ser.cfg or some advice from someone who actually managed to accomplish this. Thanks, Adi. ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit:http://lists.digium.com/mailman/listinfo/asterisk-users ___--Bandwidth and Colocation provided by Easynews.com --asterisk-users mailing listTo UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] VoiceMail and Fax on same extension
Hi, I'm trying to accomplish having a single extension that always answers with an automated voicemail prompt and record a user message, but can recognize if the call is fax and handle it accordingly. Anyone here has any experience with this kind of configuration? Thanks, Adi. ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users