[Asterisk-Users] Grabbing the billsec and duration after a hangup.

C F shmaltz at gmail.com
Mon Mar 20 09:47:46 MST 2006


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 at 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
>



More information about the asterisk-users mailing list