Hi What is the relationship between when CDR recording occurs and the hangup extension is executed. Normally CDR happens before the h extension is executed. I use the h extension to clean up for routines, but sometimes it gets called to quickly before the CDR is dumped into a DB. I would like the h extension to execute after CDR recoding. Is there a way to force or is it depend on which party hangups. I also use the g option in Dial but this does not completely solve this issue. Using CVS from Asterisk CVS-02/09/04-20:25:52. Thanks Master
Philipp von Klitzing
2004-Mar-01 17:28 UTC
[Asterisk-Users] Hangup to CDR recording timing
Hi!> What is the relationship between when CDR recording occurs and the > hangup extension is executed. Normally CDR happens before the h > extension is executed.In short: Do not rely on h for CDR purposes.> I use the h extension to clean up for routines, but sometimes it gets > called to quickly before the CDR is dumped into a DB.Not good, read this: http://www.voip-info.org/wiki-Asterisk+standard+extensions http://www.voip-info.org/wiki-Asterisk+billing> I would like the h extension to execute after CDR recoding. Is there a > way to force or is it depend on which party hangups. I also use the g > option in Dial but this does not completely solve this issue.Apart from a C solution and/or modifying the source code I see two possible approaches: - use an AGI script at the start of the call and log its existence in some external database (using the call's uniquid). This might still get you into trouble if you have to handle transferred or conferenced calls, so be careful. Then either run a cron job for clean up every minute, or do the clean-up whenever a new call comes in as part of that call's AGI. - use the manager API to monitor events and channel status in order to find out when a call has been completed. Cheers, Philipp