zoukankan      html  css  js  c++  java
  • 在opensips中记录通话记录

    1、为acc表增加额外的字段记录主叫被叫
    进入mysql,选取opensips的数据库
    ALTER TABLE acc ADD from_uri VARCHAR(64) DEFAULT '' NOT NULL ;
    ALTER TABLE acc ADD to_uri VARCHAR(64) DEFAULT '' NOT NULL ;

    2、opensips的配置

    #### ACCounting module
    loadmodule "acc.so"
    /* account triggers (flags) */
    modparam("acc", "db_flag", 1)
    modparam("acc", "db_missed_flag", 2)
    modparam("acc", "cdr_flag", 1)
    modparam("acc", "db_url",
        "mysql://opensips:opensipsrw@localhost/opensips") # CUSTOMIZE ME
    modparam("acc", "db_extra", "from_uri=$fu; to_uri=$tu")

    ...
        if (has_totag())
        {
            # sequential request withing a dialog should
            # take the path determined by record-routing
            if (loose_route())
            {
                if (is_method("BYE"))
                {
                    setflag(1); # do accounting ...
                    setflag(3); # ... even if the transaction fails
                }
                else if (is_method("INVITE"))
                {
                    # even if in most of the cases is useless, do RR for
                    # re-INVITEs also, as some buggy clients do change route set
                    # during the dialog.
                    record_route();
                }
                if (check_route_param("nat=yes"))
                {
                    setflag(10);
                }
                # route it out to whatever destination was set by loose_route()
                # in $du (destination URI).
                route(1);
            }

    ...
        # account only INVITEs
        if (is_method("INVITE"))
        {
            # create dialog with timeout
            if ( !create_dialog("B"))
            {
                send_reply("500","Internal Server Error");
                exit;
            }
            setflag(1); # do accounting
        }

  • 相关阅读:
    【西北师大-18软工】第七次作业成绩汇总
    【西北师大-18软工】第六次作业成绩汇总
    【西北师大-18软工】第五次作业成绩汇总
    【西北师大-18软工】第四次作业成绩汇总
    使用jQuery刷新页面
    jquery怎么判断浏览器是否是ie
    JavaScript如何生成随机字母数字字符串
    js如何引入css文件
    提高网站加载速度的提示和小技巧
    JavaScript 9 个功能强大的技巧
  • 原文地址:https://www.cnblogs.com/yeye518/p/4077089.html
Copyright © 2011-2022 走看看