freeswitch cdr odbc

1,

创建odbc 文件

/etc/odbc.ini

[freeswitch]
Driver = MySQL
SERVER = localhost
PORT = 3306
DATABASE = freeswitch
OPTION = 67108864
USER = root
PASSWORD = password

2,

创建freeswitch的数据库

创建数据库cdr表格,把uuid设为主键,其中billsec 和duration为int

CREATE TABLE cdr (
`uuid` varchar(50) DEFAULT NULL,
`caller_id_name` varchar(60) DEFAULT NULL,
`sip_contact_host` varchar(50) DEFAULT NULL,
`sip_received_ip` varchar(50) DEFAULT NULL,
`sip_received_port` varchar(10) DEFAULT NULL,
`direction` varchar(15) DEFAULT NULL,
`caller_id_number` varchar(30) DEFAULT NULL,
`destination_number` varchar(30) DEFAULT NULL,
`context` varchar(10) DEFAULT NULL,
`start_stamp` varchar(30) DEFAULT NULL,
`answer_stamp` varchar(30) DEFAULT NULL,
`end_stamp` varchar(30) DEFAULT NULL,
`duration` int(20) DEFAULT NULL,
`billsec` int(20) DEFAULT NULL,
`hangup_cause` varchar(30) DEFAULT NULL,
`bleg_uuid` varchar(50) DEFAULT NULL,
`read_codec` varchar(30) DEFAULT NULL,
`write_codec` varchar(30) DEFAULT NULL,
PRIMARY KEY (`uuid`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8;

3,

增加文件conf/autoload_configs/odbc_cdr.conf.xml

 
  
      
     
     
     
     
     
     
     
     
     
   
   
     
     
       
       
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
    


4,代码里uncomment in modules.conf,以编译这个模块

event_handlers/mod_odbc_cdr

5,在conf里面添加load mod_odbc_cdr module

conf/autoload_configs/modules.conf.xml

你可能感兴趣的:(freeswitch)