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.

  • 相关阅读:
    Linq调试实时输出信息扩展方法(摘抄)
    RSA签名和验证数据
    Vue+abp微信扫码登录
    vue学习笔记4
    icon共享网站 可以获得wpf里用的Geometry
    wpf 父控件和子控件 各自触发鼠标按下事件
    C# Timespan Tostring 时分秒格式
    新公司第二天
    C# 反转单向链表
    经纬度转数字经纬度时,如果是负数
  • 原文地址:https://www.cnblogs.com/noobkey/p/3225104.html
Copyright © 2011-2022 走看看