Hi All, Asterisk 1.4.12 CentOS 5 My ISP account includes nearly 500 minutes of VOIP calls per month but the service is expensive for unbundled minutes. So I'm trying to find a way to keep an accumulated total of calls made through that trunk so that I can automatically switch to a lower-cost provider when my bundled minutes are used. The plan is to store the accumulated time in AstDB and reset this with a cron job at the beginning of each period. I understand that the Dial() application sets two variables - DIALEDTIME and ANSWEREDTIME - to the total time the Dial() application ran and the time since the call was answered respectively. However, I can't find a way to access these. I've tried the following: exten => s,1,Dial(${rgMain}/${EXTEN},${RINGTIME},t) exten => s,n,Log(NOTICE, Call to ${EXTEN} lasted ${DIALEDTIME}) However the expected notice does not appear in /var/log/asterisk/messages, which is where other notices generated with the Log() application do. Can someone point the way? TIA, -- Geoff
use the h exten. when someone hangup dial go to exten h. or put the option in the dial command to go to the next priority on hangup but there is a problem if during the call they transfer it to other exten you dont have the next priority. David 2009/2/18 Geoff Lane <geoff at gjctech.co.uk>> Hi All, > > Asterisk 1.4.12 CentOS 5 > > My ISP account includes nearly 500 minutes of VOIP calls per month but > the service is expensive for unbundled minutes. So I'm trying to find > a way to keep an accumulated total of calls made through that trunk so > that I can automatically switch to a lower-cost provider when my > bundled minutes are used. The plan is to store the accumulated time in > AstDB and reset this with a cron job at the beginning of each period. > > I understand that the Dial() application sets two variables - > DIALEDTIME and ANSWEREDTIME - to the total time the Dial() application > ran and the time since the call was answered respectively. However, I > can't find a way to access these. I've tried the following: > > exten => s,1,Dial(${rgMain}/${EXTEN},${RINGTIME},t) > exten => s,n,Log(NOTICE, Call to ${EXTEN} lasted ${DIALEDTIME}) > > However the expected notice does not appear in > /var/log/asterisk/messages, which is where other notices generated > with the Log() application do. > > Can someone point the way? > > TIA, > > -- > Geoff > > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-- (\__/) (='.'=)This is Bunny. Copy and paste bunny into your (")_(")signature to help him gain world domination. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090218/8d22a0a1/attachment.htm