Re: Accounting Oddity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Try to update call bandwidth in StopQuery, not StartQuery.
FileAcct and SqlAcct will insert the same values for a stop event.

----- Original Message ----- 
From: "Mike Ockenga" <Mike.Ockenga@xxxxxxxxx>
Sent: Thursday, July 19, 2007 10:50 PM


> I've got an accounting problem that's got me stumped.  
> 
> For calls /from/ endpoints registered to a neighbor Cisco MCM GK to
> endpoints registered to my GnuGK 2.2.6 test box, a single accounting
> parameter is recording different values via [SQLAuth] and [FileAuth],
> and I can't figure out why.  
> 
> No matter what the actual call bandwidth is, the SQLAuth start query is
> executed with "1280" (ergo a 64Kbps call) as the requested bandwidth.
> However, the correct value is written to the flat file for every call. 
> 
> For calls between any locally registered endpoints, everything works
> perfectly and the accounting records are completely correct.
> 
> Here's the background info:
> 
> I'm using the following straightforward patch to gkacct.cxx:
> 
> diff -Naur gkacct.cxx gkacctx.cxx
> --- gkacct.cxx  2006-04-14 08:56:19.000000000 -0500
> +++ gkacctx.cxx 2007-05-30 10:56:46.000000000 -0500
> @@ -270,6 +270,7 @@
>        }
> 
>        params["src-info"] = call->GetSrcInfo();
> +       params["bandwidth"] = call->GetBandwidth();
>        params["Calling-Station-Id"] = GetCallingStationId(call);
> 
>        addr = (DWORD)0;
> 
> 
> 
> ****
> In my .ini is the following.  The last parameter of the StartQuery
> INSERT is %{bandwidth}.
> 
> 
> [SQLAcct]
> ...
> StartQuery=INSERT INTO cdr
> (gatekeeper,calling_zone,called_zone,call_number,call_duration,disconnec
> t_cause,acct_session_id,h323_id,gkip,CallId,ConfID,setup_time,connect_ti
> me,disconnect_time,calling_ip,calling_port,called_ip,called_port,src_inf
> o,dest_info,Calling_Station_Id,Called_Station_Id,Dialed_Number,calling_e
> pid,called_epid,call_bw) VALUES ('%g',(select zone from users where
> h323_id='%{%Calling-Station-Id}'),(select zone from users where
> aliases='%{Called-Station-Id}'),'%n','%d','%c','%s','%u','%{gkip}','%{Ca
> llId}','%{ConfId}','%{setup-time}','%{connect-time}','%{disconnect-time}
> ','%{caller-ip}','%{caller-port}','%{callee-ip}','%{callee-port}','%{src
> -info}','%{dest-info}','%{Calling-Station-Id}','%{Called-Station-Id}','%
> {Dialed-Number}','%{caller-epid}','%{callee-epid}','%{bandwidth}');
> UpdateQuery=UPDATE cdr SET...
> StopQuery=UPDATE cdr SET ...
> 
> [FileAcct]
> DetailFile=/tmp/cdr.log
> StandardCDRFormat=0
> CDRString=%s|%g|%u|%{bandwidth}
> 
> 
> ****
> Here's what goes into the MySQL cdr table for a 384K test call:
> 
> mysql> select acct_session_id,gatekeeper,h323_id,call_bw
>    -> from cdr where acct_session_id='469f728d00000016';
> +------------------+------------+-----------+---------+
> | acct_session_id  | gatekeeper | h323_id   | call_bw |
> +------------------+------------+-----------+---------+
> | 469f728d00000016 | GK1        | Nocc.vid1 |   01280 | 
> +------------------+------------+-----------+---------+
> 
> 
> Here's the CDR file entry for the exact same call:
> 469f728d00000016|GK1|Nocc.vid1|7680
> 
> 
> 
> ****
> Version:
> Gatekeeper(GNU) Version(2.2.6)
> Ext(pthreads=1,radius=1,mysql=1,pgsql=0,firebird=0,large_fdset=4096,cryp
> to/ssl=1) Build(Jul 17 2007, 17:39:57) Sys(Linux i686 2.6.19-gentoo-r5)
> GkStatus: Version(2.0) Ext()
> Toolkit: Version(1.0) Ext(basic)
> Startup: Thu, 19 Jul 2007 09:17:49 -0500   Running: 0 days 05:35:02
> 
> 
> 
> ****
> Thanks for your help.
> 
> --
> Mike 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________________

Posting: mailto:Openh323gk-users@xxxxxxxxxxxxxxxxxxxxx
Archive: http://sourceforge.net/mailarchive/forum.php?forum_name=openh323gk-users
Unsubscribe: http://lists.sourceforge.net/lists/listinfo/openh323gk-users
Homepage: http://www.gnugk.org/

[Index of Archives]     [SIP]     [Open H.323]     [Gnu Gatekeeper]     [Asterisk PBX]     [ISDN Cause Codes]     [Yosemite News]

  Powered by Linux