zoukankan      html  css  js  c++  java
  • asterisk用 freetds记录 cdr 到mssql

            Compile, configure, and install the latest FreeTDS package:

    • [pre]           tar -zxvf freetds-0.62.4.tar.gz &&            cd freetds-0.62.4 &&            ./configure --prefix=/usr --with-tdsver=7.0            make &&            make install [/pre]

                    Compile, or recompile, asterisk so that it will now add support                for cdr_tds.

    • [pre]                   make clean && ./configure --with-tds &&                    make update &&                    make &&                    make install [/pre]

                    Only install one database connector.  Do not confuse asterisk                by using both ODBC (cdr_odbc) and FreeTDS (cdr_tds).                This command will erase the contents of cdr_odbc.conf

    • [pre]        [ -f /etc/asterisk/cdr_odbc.conf ] > /etc/asterisk/cdr_odbc.conf [/pre]

                    Setup cdr_tds configuration files.  These are working samples                from my system.  You will need to modify for your setup. Define                your usernames and passwords here, secure file as well.

    • [pre]                /etc/asterisk/cdr_tds.conf            [global]            hostname=192.168.1.25            port=1433            dbname=voipdb            user=voipdbuser            password=voipdpass            charset=BIG5 [/pre]

                    And finally, create the 'cdr' table in your mssql database.

    • [pre]        CREATE TABLE cdr (                 [accountcode]   [varchar] (20)          NULL ,                 [src]           [varchar] (80)          NULL ,                 [dst]           [varchar] (80)          NULL ,                 [dcontext]      [varchar] (80)          NULL ,                 [clid]          [varchar] (80)          NULL ,                 [channel]       [varchar] (80)          NULL ,                 [dstchannel]    [varchar] (80)          NULL ,                 [lastapp]       [varchar] (80)          NULL ,                 [lastdata]      [varchar] (80)          NULL ,                 [start]         [datetime]              NULL ,                 [answer]        [datetime]              NULL ,                 [end]           [datetime]              NULL ,                 [duration]      [int]                   NULL ,                 [billsec]       [int]                   NULL ,                 [disposition]   [varchar] (20)          NULL ,                 [amaflags]      [varchar] (16)          NULL ,                 [uniqueid]      [varchar] (150)         NULL ,                 [userfield]     [varchar] (256)         NULL         ) [/pre]

                    Start asterisk in verbose mode, you should see that asterisk                logs a connection to the database and will now record every                call to the database when it's complete.

  • 相关阅读:
    .NET中使用嵌入的资源
    C#操作注册表
    .Net中大数加减乘除运算
    CYQ.Data 轻量数据层之路 V4.5 版本发布[更好的使用体验,更优的缓存机制]
    关于性能比较的应用误区
    秋色园QBlog技术原理解析:性能优化篇:打印页面SQL,全局的SQL语句优化(十三)
    CYQ.DBImport 数据库反向工程及批量导数据库工具 V1.0 发布
    框架设计之菜鸟漫漫江湖路系列 一:菜鸟入门
    MySql折腾小记二:text/blog类型不允许设置默认值,不允许存在两个CURRENT_TIMESTAMP
    CYQ.Data.Xml XmlHelper 助你更方便快捷的操作Xml/Html
  • 原文地址:https://www.cnblogs.com/noobkey/p/3225104.html
Copyright © 2011-2022 走看看