Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accounting mysql scheme / opensips 1.11.5 #592

Closed
Rico29 opened this issue Aug 7, 2015 · 1 comment
Closed

accounting mysql scheme / opensips 1.11.5 #592

Rico29 opened this issue Aug 7, 2015 · 1 comment

Comments

@Rico29
Copy link

Rico29 commented Aug 7, 2015

Using opensips 1.11, /usr/local/src/opensips-1.11.5-tls/scripts/mysql/acc-create.sql says :
INSERT INTO version (table_name, table_version) values ('acc','6');
CREATE TABLE acc (
id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
method CHAR(16) DEFAULT '' NOT NULL,
from_tag CHAR(64) DEFAULT '' NOT NULL,
to_tag CHAR(64) DEFAULT '' NOT NULL,
callid CHAR(64) DEFAULT '' NOT NULL,
sip_code CHAR(3) DEFAULT '' NOT NULL,
sip_reason CHAR(32) DEFAULT '' NOT NULL,
time DATETIME NOT NULL,
duration INT(11) UNSIGNED DEFAULT 0 NOT NULL,
setuptime INT(11) UNSIGNED DEFAULT 0 NOT NULL,
created DATETIME DEFAULT NULL
) ENGINE=MyISAM;

When running opensips in debug mode, I have :
Aug 7 16:31:45 opensips-preprod /sbin/opensips[31788]: DBG:db_mysql:db_mysql_do_prepared_query: new query=|insert into acc (method,from_tag,to_tag,callid,sip_code,sip_reason,time,gwid,from_user,to_user,duration,setuptime,created ) values (?,?,?,?,?,?,?,?,?,?,?,?,?)|
Aug 7 16:31:45 opensips-preprod /sbin/opensips[31788]: DBG:db_mysql:re_init_statement: query is <insert into acc (method,from_tag,to_tag,callid,sip_code,sip_reason,time,gwid,from_user,to_user,duration,setuptime,created ) values (?,?,?,?,?,?,?,?,?,?,?,?,?)>, ptr=(nil)
Aug 7 16:31:45 opensips-preprod /sbin/opensips[31788]: CRITICAL:db_mysql:wrapper_single_mysql_stmt_prepare: driver error (1054): Unknown column 'gwid' in 'field list'
Aug 7 16:31:45 opensips-preprod /sbin/opensips[31788]: ERROR:db_mysql:db_mysql_do_prepared_query: failed to create new context
Aug 7 16:31:45 opensips-preprod /sbin/opensips[31788]: ERROR:acc:acc_db_cdrs: failed to insert into database
Aug 7 16:31:45 opensips-preprod /sbin/opensips[31788]: ERROR:acc:acc_dlg_callback: Cannot insert into database

I guess fields are missing in sql scheme.
Regards,
Cédric

@Rico29 Rico29 changed the title accounting mysql scheme accounting mysql scheme / opensips 1.11.5 Aug 7, 2015
@Rico29
Copy link
Author

Rico29 commented Aug 7, 2015

OOps, forgot I added the line
#modparam("acc", "db_extra","gwid=$avp(dr_gw_id);from_user=$fU;to_user=$tU")
in oipensips.cfg.

Sorry for that.
Regards,
Cédric

@Rico29 Rico29 closed this as completed Aug 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant