[OpenSIPS-Users] Accounting module question

Bogdan-Andrei Iancu bogdan at voice-system.ro
Sat Jun 5 13:06:32 CEST 2010


Hi Daniel,

have you configured the db_url parameter for the the acc module ?

Regards,
Bogdan

Daniel Goepp wrote:
> I must just be missing something really stupid here, but I would 
> appreciated any insight into what I'm doing wrong.  We are testing 
> some accounting methods in a lab, and am not seeing anything show up 
> in our DB.  Our config is very generic, based on the out of the box 
> template.  The module is loaded and configured:
>
> # ----- acc params -----
> modparam("acc", "early_media", 1)
> modparam("acc", "report_ack", 1)
> modparam("acc", "report_cancels", 1)
> modparam("acc", "detect_direction", 0)
> modparam("acc", "failed_transaction_flag", 3)
> modparam("acc", "log_flag", 1)
> modparam("acc", "log_missed_flag", 2)
> modparam("acc", "db_flag", 1)
> modparam("acc", "db_missed_flag", 2)
>
> Then in various parts of the script the standard places I would expect 
> to set these flags:
>
>                 if (loose_route()) {
>                         if (is_method("BYE")) {
>                                 setflag(1); # do accounting ...
>                                 setflag(3); # ... even if the 
> transaction fails
>
>         # account only INVITEs
>         if (is_method("INVITE")) {
>                 setflag(1); # do accounting
>         }
>
>         # when routing via usrloc, log the missed calls also
>         setflag(2);
>
> We are seeing in the log that it would appear the events are getting 
> trigger correctly:
>
> Jun  4 11:49:57 <our_ip> /usr/local/sbin/opensips[25631]: ACC: 
> transaction answered: 
> timestamp=1275677397;method=BYE;from_tag=6c7fc353661f7865;to_tag=3d98b53c7e064932;call_id=03cc10af6f6ee332 at 10.0.0.104 
> <mailto:03cc10af6f6ee332 at 10.0.0.104>;code=480;reason=Temporarily 
> Unavailable - Busy
> Jun  4 11:49:57 <our_ip> /usr/local/sbin/opensips[25625]: ACC: 
> transaction answered: 
> timestamp=1275677397;method=BYE;from_tag=3d98b53c7e064932;to_tag=6c7fc353661f7865;call_id=03cc10af6f6ee332 at 10.0.0.104 
> <mailto:03cc10af6f6ee332 at 10.0.0.104>;code=480;reason=Temporarily 
> Unavailable - Busy
> Jun  4 11:57:14 <our_ip> /usr/local/sbin/opensips[25614]: ACC: 
> transaction answered: 
> timestamp=1275677834;method=INVITE;from_tag=0c1f77d0c846e4ce;to_tag=SDtt28c99-3240d2c7+1+979c0001+af41d800;call_id=c0fa7dd7df1340e9 at 192.168.1.110 
> <mailto:c0fa7dd7df1340e9 at 192.168.1.110>;code=183;reason=Session Progress
> Jun  4 11:57:19 <our_ip> /usr/local/sbin/opensips[25615]: ACC: 
> transaction answered: 
> timestamp=1275677839;method=INVITE;from_tag=0c1f77d0c846e4ce;to_tag=SDtt28c99-3240d2c7+1+979c0001+af41d800;call_id=c0fa7dd7df1340e9 at 192.168.1.110 
> <mailto:c0fa7dd7df1340e9 at 192.168.1.110>;code=200;reason=OK
> Jun  4 11:57:19 <our_ip> /usr/local/sbin/opensips[25623]: ACC: request 
> acknowledged: 
> timestamp=1275677839;method=ACK;from_tag=0c1f77d0c846e4ce;to_tag=SDtt28c99-3240d2c7+1+979c0001+af41d800;call_id=c0fa7dd7df1340e9 at 192.168.1.110 
> <mailto:c0fa7dd7df1340e9 at 192.168.1.110>;code=200;reason=OK
> Jun  4 11:57:22 <our_ip> /usr/local/sbin/opensips[25623]: ACC: 
> transaction answered: 
> timestamp=1275677842;method=BYE;from_tag=SDtt28c99-3240d2c7+1+979c0001+af41d800;to_tag=0c1f77d0c846e4ce;call_id=c0fa7dd7df1340e9 at 192.168.1.110 
> <mailto:c0fa7dd7df1340e9 at 192.168.1.110>;code=200;reason=OK
> Jun  4 12:04:05 <our_ip> /usr/local/sbin/opensips[25616]: ACC: 
> transaction answered: 
> timestamp=1275678245;method=INVITE;from_tag=6456119a0df401a0;to_tag=SDkqeqf99-3240d2c7+1+6730000a+52d11233;call_id=6312464ba64113d1 at 192.168.1.110 
> <mailto:6312464ba64113d1 at 192.168.1.110>;code=183;reason=Session Progress
> Jun  4 12:04:11 <our_ip> /usr/local/sbin/opensips[25617]: ACC: 
> transaction answered: 
> timestamp=1275678251;method=INVITE;from_tag=6456119a0df401a0;to_tag=SDkqeqf99-3240d2c7+1+6730000a+52d11233;call_id=6312464ba64113d1 at 192.168.1.110 
> <mailto:6312464ba64113d1 at 192.168.1.110>;code=200;reason=OK
> Jun  4 12:04:11 <our_ip> /usr/local/sbin/opensips[25623]: ACC: request 
> acknowledged: 
> timestamp=1275678251;method=ACK;from_tag=6456119a0df401a0;to_tag=SDkqeqf99-3240d2c7+1+6730000a+52d11233;call_id=6312464ba64113d1 at 192.168.1.110 
> <mailto:6312464ba64113d1 at 192.168.1.110>;code=200;reason=OK
> Jun  4 12:04:15 <our_ip> /usr/local/sbin/opensips[25615]: ACC: 
> transaction answered: 
> timestamp=1275678255;method=BYE;from_tag=6456119a0df401a0;to_tag=SDkqeqf99-3240d2c7+1+6730000a+52d11233;call_id=6312464ba64113d1 at 192.168.1.110 
> <mailto:6312464ba64113d1 at 192.168.1.110>;code=200;reason=OK
>
> But we never see anything in the DB.  The default table exists as 
> described by:
>
> CREATE TABLE `acc` (
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `method` char(16) NOT NULL default '',
>   `from_tag` char(64) NOT NULL default '',
>   `to_tag` char(64) NOT NULL default '',
>   `callid` char(64) NOT NULL default '',
>   `sip_code` char(3) NOT NULL default '',
>   `sip_reason` char(32) NOT NULL default '',
>   `time` datetime NOT NULL,
>   PRIMARY KEY  (`id`),
>   KEY `callid_idx` (`callid`)
> ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
>
> Any thoughts on what I'm not seeing to enable this data to go into the 
> DB correctly?
>
> Thanks
>
> -dg
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   


-- 
Bogdan-Andrei Iancu
www.voice-system.ro




More information about the Users mailing list