Mark Ackroyd
2006-Mar-20 02:38 UTC
[Asterisk-Users] Grabbing the billsec and duration after a hangup.
Hello, I am wondering if someone has got any ideas that can help solve this problem. I have a dial plan that you call into, and depending on certain conditions it calls out on a number grabbed from a database. Something like this : exten => s,n,Do something exten => s,n,Do something else exten => s,n,Dial(ZAP/g1/${OUTBOUND},${timeout}) I need to log the time the person was connected to $(OUTBOUND) , these are duration and billsec in the CDR's So at hangup I do something like this. exten => h,1,DeadAGI(cdr- outlogger.php|${CDR(start)}|${OUTBOUND}|${CDR(channel)}|${CDR(duration)}|$ {CDR(billsec)}|${CDR(disposition)}|${CDR(accountcode)}) Trouble is duration and billsec are *ALWAYS* 0 (zero), as if they have not been loaded with the values, even though the channel is hung up. Anyone got any ideas on how I can access ${CDR(duration)} and ${CDR(billsec)} in the hangup extension? Thanks, hope I explained that well enough. Mark
C F
2006-Mar-20 09:47 UTC
[Asterisk-Users] Grabbing the billsec and duration after a hangup.
The reason for it being 0 is because as long as you sit on the h extension the call is not yet done, therefore asterisk has no clue what those valuse are. If you use the h extension then you are messing up the CDR. On 3/20/06, Mark Ackroyd <mark.ackroyd@cencion.com> wrote:> Hello, > > I am wondering if someone has got any ideas that can help solve this > problem. > > I have a dial plan that you call into, and depending on certain conditions > it calls out on a number grabbed from a database. > > Something like this : > > exten => s,n,Do something > exten => s,n,Do something else > exten => s,n,Dial(ZAP/g1/${OUTBOUND},${timeout}) > > I need to log the time the person was connected to $(OUTBOUND) , these are > duration and billsec in the CDR's > > So at hangup I do something like this. > > exten => h,1,DeadAGI(cdr- > outlogger.php|${CDR(start)}|${OUTBOUND}|${CDR(channel)}|${CDR(duration)}|$ > {CDR(billsec)}|${CDR(disposition)}|${CDR(accountcode)}) > > Trouble is duration and billsec are *ALWAYS* 0 (zero), as if they have not > been loaded with the values, even though the channel is hung up. > > Anyone got any ideas on how I can access ${CDR(duration)} and > ${CDR(billsec)} in the hangup extension? > > Thanks, hope I explained that well enough. > > Mark > > _______________________________________________ > --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 >
Mark Ackroyd
2006-Mar-20 13:45 UTC
[Asterisk-Users] Grabbing the billsec and duration after a hangup.
>>The reason for it being 0 is because as long as you sit on the h >>extension the call is not yet done, therefore asterisk has no clue >>what those valuse are. If you use the h extension then you are messing >>up the CDR.So how can I tell it the call is complete and give the CDR values? Is it just not possible? Mark
Darren Wiebe
2006-Mar-20 18:35 UTC
[Asterisk-Users] Grabbing the billsec and duration after a hangup.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I have a perl app that listens for hangups and then grabs the call out of the database using the uniqueid. Maybe not the neatest way but it works well. Darren Wiebe darren@aleph-com.net Mark Ackroyd wrote:>>> The reason for it being 0 is because as long as you sit on the >>> h extension the call is not yet done, therefore asterisk has no >>> clue what those valuse are. If you use the h extension then you >>> are messing up the CDR. > > > So how can I tell it the call is complete and give the CDR values? > Is it just not possible? > > Mark > > > _______________________________________________ --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-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFEH1hU4DADnh+tnOQRAh9NAJ4t+T0dteQQouh8LrsrHy6b27GEgACfcK07 Nc/6CfM4twpq6nb+TVk+Rnc=RxIJ -----END PGP SIGNATURE-----