Accounting problem: can't log start event

Karoly Albert Szabo <[email protected]> Wed, 23 Nov 2016 15:32:21 +0100
Newsgroups gmane.comp.telephony.openh323gk.user
Message-ID <CAOdvogE3MqYRcY9YGL2C0Sxs8=D=LpxpoRyQoKph0fYmu6F7aA@mail.gmail.com>
--===============3382632496604365201==
Content-Type: multipart/alternative; boundary=94eb2c1a17b2c387960541f8c1a1

--94eb2c1a17b2c387960541f8c1a1
Content-Type: text/plain; charset=UTF-8

Hi all,

I'm currently trying to store and manage CDR informations, but I can't log
the start (or other events except for the stop event) event neither in
the StatusAcct, nor in the SQLAcct section.
I tried to fall back to the example found in the manual, but it seems that
only the close event is logged.

My Gateway at the moment is a VidyoGateway, and the testing call is made
through a Polycom and a Vidyo Room with some other partecipants.

This is the current configuration:
[Gatekeeper::Main]
TraceLevel=5
Name=GnuGk

[LogFile]
Filename=/var/log/gnugk/trace.log
Rotate=weekly
RotateDay=Sun
RotateTime=4:00

[GkStatus::Auth]
rule=allow

[Gatekeeper::Acct]
StatusAcct=optional;start,stop,update,alert,connect,register,unregister
SQLAcct=required;start,stop,update
FileAcct=sufficient;stop
default=accept

[StatusAcct]
TimestampFormat=ISO8601

[FileAcct]
DetailFile=/var/log/gnugk/cdr.log
StandardCDRFormat=0
TimestampFormat=ISO8601
CDRString=CDR|%n|%{CallId}|%d|%{connect-time}|%{disconnect-time}|%{caller-ip}:%{caller-port}|%{caller-epid}|%{callee-ip}:%{callee-port}|%{callee-epid}|%{dest-info}|%{src-info}|%g;
Rotate=daily
RotateTime=23:59

[SQLAcct]
Driver=PostgreSQL
Host=localhost:5432
Database=gnugk
Username=gnugk
Password=gnugk

MinPoolSize=5
TimestampFormat=ISO8601
StartQuery=insert into cdr (gatekeeper_name, call_number, call_duration,
disconnect_cause, acct_session_id, h323_id, gkip, call_id, conf_id,
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) values ('%g', '%n', %d, %c, '%s', '%u',
'%{gkip}', '%{CallId}', '%{ConfId}', '%{setup-time}', '%{connect-time}',
null, '%{caller-ip}', '%{caller-port}', '%{callee-ip}', '%{callee-port}',
'%{src-info}', '%{dest-info}', '%{Calling-Station-Id}',
'%{Called-Station-Id}', '%{Dialed-Number}')
UpdateQuery=update cdr set call_duration=%d where gatekeeper_name='%g' and
acct_session_id='%s'
StopQuery=update cdr set call_duration=%d, disconnect_cause=%c,
disconnect_time='%{disconnect-time}' where gatekeeper_name='%g' and
acct_session_id='%s'
StopQueryAlt=insert into cdr (gatekeeper_name, call_number, call_duration,
disconnect_cause, acct_session_id, h323_id, gkip, call_id, conf_id,
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) values ('%g STOP', '%n', %d, %c, '%s',
'%u', '%{gkip}', '%{CallId}', '%{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}')


And this is the SQL schema (only the StopQueryAlt seems to be executed
succesfully. In the logs, I found that the update too try to run but of
course, without the inital row it can't update)
CREATE TABLE cdr
(
    gatekeeper_name VARCHAR(255) DEFAULT NULL::character varying,
    call_number INTEGER,
    call_duration INTEGER,
    disconnect_cause SMALLINT,
    acct_session_id VARCHAR(255) DEFAULT NULL::character varying,
    h323_id VARCHAR(255) DEFAULT NULL::character varying,
    gkip VARCHAR(15) DEFAULT NULL::character varying,
    call_id VARCHAR(255),
    conf_id VARCHAR(255) DEFAULT NULL::character varying,
    setup_time VARCHAR(255) DEFAULT NULL::character varying,
    connect_time VARCHAR(255) DEFAULT NULL::character varying,
    disconnect_time VARCHAR(255) DEFAULT NULL::character varying,
    caller_ip VARCHAR(15) DEFAULT NULL::character varying,
    caller_port SMALLINT,
    callee_ip VARCHAR(15) DEFAULT NULL::character varying,
    callee_port SMALLINT,
    src_info VARCHAR(255) DEFAULT NULL::character varying,
    dest_info VARCHAR(255) DEFAULT NULL::character varying,
    calling_station_id VARCHAR(255) DEFAULT NULL::character varying,
    called_station_id VARCHAR(255) DEFAULT NULL::character varying,
    dialed_number VARCHAR(255) DEFAULT NULL::character varying
);


I try to be as complete as possible, from the status channel I get the
following:
RCF|192.168.5.168:1720
|3650:dialedDigits=polycomlab:h323_ID|terminal|3693921710_endp
;
UCF|192.168.5.168|3693921710_endp;
RCF|192.168.5.168:1720
|3650:dialedDigits=polycomlab:h323_ID|terminal|3693921710_endp
;
ACF|192.168.13.56:1720
|347342409_endp|6357|polycomlab:h323_ID|101103:h323_ID|false|38-d1-e6-8f-f6-af-e6-11-9a-45-00-50-56-9d-6a-8d|ToBeDecided;
ACF|192.168.5.168:1720|3693921710_endp|22222|polycomlab:h323_ID||true|38-d1-e6-8f-f6-af-e6-11-9a-45-00-50-56-9d-6a-8d|
;
CDR|17|38 d1 e6 8f f6 af e6 11 9a 45 00 50 56 9d 6a 8d|31|Wed, 23 Nov 2016
15:26:56 +01:00|Wed, 23 Nov 2016 15:27:27 +01:00|192.168.13.56:1720
|347342409_endp|192.168.5.168:1720
|3693921710_endp|polycomlab:h323_ID|101103:h323_ID|GnuGk;
CALL|Stop|192.168.13.56:1720|192.168.5.168:1720
|38-d1-e6-8f-f6-af-e6-11-9a-45-00-50-56-9d-6a-8d
DCF|192.168.13.56|347342409_endp|6357|normalDrop|38-d1-e6-8f-f6-af-e6-11-9a-45-00-50-56-9d-6a-8d;
DCF|192.168.5.168|3693921710_endp|22222|normalDrop|38-d1-e6-8f-f6-af-e6-11-9a-45-00-50-56-9d-6a-8d;


Any help will be really appreciated,

Best regards,
Karoly

--94eb2c1a17b2c387960541f8c1a1
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi all,<div><br></div><div>I&#39;m currently trying to sto=
re and manage CDR informations, but I can&#39;t log the start (or other eve=
nts except for the stop event) event neither in the=C2=A0StatusAcct, nor in=
 the=C2=A0SQLAcct section.=C2=A0</div><div>I tried to fall back to the exam=
ple found in the manual, but it seems that only the close event is logged.<=
/div><div><br></div><div>My Gateway at the moment is a VidyoGateway, and th=
e testing call is made through a Polycom and a Vidyo Room with some other p=
artecipants.</div><div><br></div><div>This is the current configuration:</d=
iv><div><div>[Gatekeeper::Main]</div><div>TraceLevel=3D5</div><div>Name=3DG=
nuGk</div><div><br></div><div>[LogFile]</div><div>Filename=3D/var/log/gnugk=
/trace.log</div><div>Rotate=3Dweekly</div><div>RotateDay=3DSun</div><div>Ro=
tateTime=3D4:00</div><div><br></div><div>[GkStatus::Auth]</div><div>rule=3D=
allow</div><div><br></div><div>[Gatekeeper::Acct]</div><div>StatusAcct=3Dop=
tional;start,stop,update,alert,connect,register,unregister</div><div>SQLAcc=
t=3Drequired;start,stop,update</div><div>FileAcct=3Dsufficient;stop</div><d=
iv>default=3Daccept</div><div><br></div><div>[StatusAcct]</div><div>Timesta=
mpFormat=3DISO8601</div><div><br></div><div>[FileAcct]</div><div>DetailFile=
=3D/var/log/gnugk/cdr.log</div><div>StandardCDRFormat=3D0</div><div>Timesta=
mpFormat=3DISO8601</div><div>CDRString=3DCDR|%n|%{CallId}|%d|%{connect-time=
}|%{disconnect-time}|%{caller-ip}:%{caller-port}|%{caller-epid}|%{callee-ip=
}:%{callee-port}|%{callee-epid}|%{dest-info}|%{src-info}|%g;</div><div>Rota=
te=3Ddaily</div><div>RotateTime=3D23:59</div><div><br></div><div>[SQLAcct]<=
/div><div>Driver=3DPostgreSQL</div><div>Host=3Dlocalhost:5432</div><div>Dat=
abase=3Dgnugk</div><div>Username=3Dgnugk</div><div>Password=3Dgnugk</div><d=
iv><br></div><div>MinPoolSize=3D5</div><div>TimestampFormat=3DISO8601</div>=
<div>StartQuery=3Dinsert into cdr (gatekeeper_name, call_number, call_durat=
ion, disconnect_cause, acct_session_id, h323_id, gkip, call_id, conf_id, se=
tup_time, connect_time, disconnect_time, caller_ip, caller_port, callee_ip,=
 callee_port, src_info, dest_info, calling_station_id, called_station_id, d=
ialed_number) values (&#39;%g&#39;, &#39;%n&#39;, %d, %c, &#39;%s&#39;, &#3=
9;%u&#39;, &#39;%{gkip}&#39;, &#39;%{CallId}&#39;, &#39;%{ConfId}&#39;, &#3=
9;%{setup-time}&#39;, &#39;%{connect-time}&#39;, null, &#39;%{caller-ip}&#3=
9;, &#39;%{caller-port}&#39;, &#39;%{callee-ip}&#39;, &#39;%{callee-port}&#=
39;, &#39;%{src-info}&#39;, &#39;%{dest-info}&#39;, &#39;%{Calling-Station-=
Id}&#39;, &#39;%{Called-Station-Id}&#39;, &#39;%{Dialed-Number}&#39;)</div>=
<div>UpdateQuery=3Dupdate cdr set call_duration=3D%d where gatekeeper_name=
=3D&#39;%g&#39; and acct_session_id=3D&#39;%s&#39;</div><div>StopQuery=3Dup=
date cdr set call_duration=3D%d, disconnect_cause=3D%c, disconnect_time=3D&=
#39;%{disconnect-time}&#39; where gatekeeper_name=3D&#39;%g&#39; and acct_s=
ession_id=3D&#39;%s&#39;</div><div>StopQueryAlt=3Dinsert into cdr (gatekeep=
er_name, call_number, call_duration, disconnect_cause, acct_session_id, h32=
3_id, gkip, call_id, conf_id, setup_time, connect_time, disconnect_time, ca=
ller_ip, caller_port, callee_ip, callee_port, src_info, dest_info, calling_=
station_id, called_station_id, dialed_number) values (&#39;%g STOP&#39;, &#=
39;%n&#39;, %d, %c, &#39;%s&#39;, &#39;%u&#39;, &#39;%{gkip}&#39;, &#39;%{C=
allId}&#39;, &#39;%{ConfId}&#39;, &#39;%{setup-time}&#39;, &#39;%{connect-t=
ime}&#39;, &#39;%{disconnect-time}&#39;, &#39;%{caller-ip}&#39;, &#39;%{cal=
ler-port}&#39;, &#39;%{callee-ip}&#39;, &#39;%{callee-port}&#39;, &#39;%{sr=
c-info}&#39;, &#39;%{dest-info}&#39;, &#39;%{Calling-Station-Id}&#39;, &#39=
;%{Called-Station-Id}&#39;, &#39;%{Dialed-Number}&#39;)</div><div><br></div=
><div><br></div><div>And this is the SQL schema (only the StopQueryAlt seem=
s to be executed succesfully. In the logs, I found that the update too try =
to run but of course, without the inital row it can&#39;t update)</div><div=
><div>CREATE TABLE cdr</div><div>(</div><div>=C2=A0 =C2=A0 gatekeeper_name =
VARCHAR(255) DEFAULT NULL::character varying,</div><div>=C2=A0 =C2=A0 call_=
number INTEGER,</div><div>=C2=A0 =C2=A0 call_duration INTEGER,</div><div>=
=C2=A0 =C2=A0 disconnect_cause SMALLINT,</div><div>=C2=A0 =C2=A0 acct_sessi=
on_id VARCHAR(255) DEFAULT NULL::character varying,</div><div>=C2=A0 =C2=A0=
 h323_id VARCHAR(255) DEFAULT NULL::character varying,</div><div>=C2=A0 =C2=
=A0 gkip VARCHAR(15) DEFAULT NULL::character varying,</div><div>=C2=A0 =C2=
=A0 call_id VARCHAR(255),</div><div>=C2=A0 =C2=A0 conf_id VARCHAR(255) DEFA=
ULT NULL::character varying,</div><div>=C2=A0 =C2=A0 setup_time VARCHAR(255=
) DEFAULT NULL::character varying,</div><div>=C2=A0 =C2=A0 connect_time VAR=
CHAR(255) DEFAULT NULL::character varying,</div><div>=C2=A0 =C2=A0 disconne=
ct_time VARCHAR(255) DEFAULT NULL::character varying,</div><div>=C2=A0 =C2=
=A0 caller_ip VARCHAR(15) DEFAULT NULL::character varying,</div><div>=C2=A0=
 =C2=A0 caller_port SMALLINT,</div><div>=C2=A0 =C2=A0 callee_ip VARCHAR(15)=
 DEFAULT NULL::character varying,</div><div>=C2=A0 =C2=A0 callee_port SMALL=
INT,</div><div>=C2=A0 =C2=A0 src_info VARCHAR(255) DEFAULT NULL::character =
varying,</div><div>=C2=A0 =C2=A0 dest_info VARCHAR(255) DEFAULT NULL::chara=
cter varying,</div><div>=C2=A0 =C2=A0 calling_station_id VARCHAR(255) DEFAU=
LT NULL::character varying,</div><div>=C2=A0 =C2=A0 called_station_id VARCH=
AR(255) DEFAULT NULL::character varying,</div><div>=C2=A0 =C2=A0 dialed_num=
ber VARCHAR(255) DEFAULT NULL::character varying</div><div>);</div></div><d=
iv><br></div><div><br></div><div>I try to be as complete as possible, from =
the status channel I get the following:</div><div><div>RCF|192.168.5.168:17=
20|3650:dialedDigits=3Dpolycomlab:h323_ID|terminal|3693921710_endp</div><di=
v>;</div><div>UCF|192.168.5.168|3693921710_endp;</div><div>RCF|192.168.5.16=
8:1720|3650:dialedDigits=3Dpolycomlab:h323_ID|terminal|3693921710_endp</div=
><div>;</div><div>ACF|192.168.13.56:1720|347342409_endp|6357|polycomlab:h32=
3_ID|101103:h323_ID|false|38-d1-e6-8f-f6-af-e6-11-9a-45-00-50-56-9d-6a-8d|T=
oBeDecided;</div><div>ACF|192.168.5.168:1720|3693921710_endp|22222|polycoml=
ab:h323_ID||true|38-d1-e6-8f-f6-af-e6-11-9a-45-00-50-56-9d-6a-8d| ;</div><d=
iv>CDR|17|38 d1 e6 8f f6 af e6 11 9a 45 00 50 56 9d 6a 8d|31|Wed, 23 Nov 20=
16 15:26:56 +01:00|Wed, 23 Nov 2016 15:27:27 +01:00|192.168.13.56:1720|3473=
42409_endp|192.168.5.168:1720|3693921710_endp|polycomlab:h323_ID|101103:h32=
3_ID|GnuGk;</div><div>CALL|Stop|192.168.13.56:1720|192.168.5.168:1720|38-d1=
-e6-8f-f6-af-e6-11-9a-45-00-50-56-9d-6a-8d</div><div>DCF|192.168.13.56|3473=
42409_endp|6357|normalDrop|38-d1-e6-8f-f6-af-e6-11-9a-45-00-50-56-9d-6a-8d;=
</div><div>DCF|192.168.5.168|3693921710_endp|22222|normalDrop|38-d1-e6-8f-f=
6-af-e6-11-9a-45-00-50-56-9d-6a-8d;</div></div><div><br></div><div><br></di=
v><div>Any help will be really appreciated,</div><div><br></div><div>Best r=
egards,</div><div>Karoly</div>
</div></div>

--94eb2c1a17b2c387960541f8c1a1--


--===============3382632496604365201==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------

--===============3382632496604365201==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________________

Posting: mailto:[email protected]
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/
--===============3382632496604365201==--