当前位置: 首页 > 工具软件 > mod_schema > 使用案例 >

freeswitch cdr mysql_mod_cdr_sqlite

刘升
2023-12-01

About

This module logs call detail records (CDRs) directly to a SQLite database, using templates to define the field order for the SQL insert. These templates along with the default configuration are stored in the filefreeswitch/conf/autoload_configs/cdr_sqlite.conf.xml.

Click here to expand Table of Contents

Examples

The database specified by the parameter db-name is automatically created in the same directory as the FreeSWITCH core database (specified by the -db command-line switch, or /usr/local/freeswitch/dbby default). The file extension .db is automatically appended to the db-name.

The DB table name is specified by the parameterdb-table(cdrby default).

If the table does not exist, the mod_cdr_sqlite will create it automatically, using the following default table schema:

CREATE TABLE tablename (

caller_id_name VARCHAR,

caller_id_number VARCHAR,

destination_number VARCHAR,

context VARCHAR,

start_stamp DATETIME,

answer_stamp DATETIME,

end_stamp DATETIME,

duration INTEGER,

billsec INTEGER,

hangup_cause VARCHAR,

uuid VARCHAR,

bleg_uuid VARCHAR,

account_code VARCHAR

);

The template that is used for the default field order is defined by the following line (which uses "example" in the default installation).

Variables in a Template

Variables are given in the form ${varname}. For an overview of variables, check Channel Variables. You can specify any channel variable.

Template variables can be to API calls as well, like:

"${expr(${end_epoch}-${my_timestamp})}"

See more

 类似资料:

相关阅读

相关文章

相关问答