[Asterisk-Users] Duration for billing

Steve Edwards asterisk.org at sedwards.com
Wed Aug 2 19:37:14 MST 2006


The global and channel variables are already available to your AGI using 
the "GET VARIABLE" agi command. You do not need to pass variables "on the 
command line."

I prefer the GET VARIABLE approach because it is more obvious and robust.

Compare:

 	fputs("GET VARIABLE BILLSEC", stdout);
 	fgets(foo, stdin);
 	(whatever AGI API you are using boils down to something like this)

vs

 	strcpy(foo, argv[3]);

Which would you rather debug? What happens when the next programmer 
"fat-fingers" your dialplan and clobbers one of your "|" separators?

Also, if you enable agi debugging, Asterisk will show you the dialog as 
the variables are retrieved.

On Mon, 3 Jul 2006, Marnus van Niekerk wrote:

> Hi,
>
> I am trying to get the duration of a call passed to an agi to do the billing 
> for the the call using
>
> exten => h,1,Set(BILLSEC=${CDR(billsec)})
> exten => 
> h,2,DeadAgi(billCall.php|${CALLERIDNUM}|${DESTINATION}|${BILLSEC}|${RATE}|${DESTNAME})
>
> But I get a blank duration (${BILLSEC}) every time.
>
> Can anybody point me in the right direction please?
>
> Thank you
>
> Marnus van Niekerk
>
> -- 
>
> "Opportunity is missed by most people because it is
> dressed in overalls and looks like work."
>
> Thomas Alva Edison - Inventor of 1093 patents,
> including the light bulb, phonogram and motion pictures.
>
>

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards      sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                             Fax: +1-760-731-3000



More information about the asterisk-users mailing list