通话记录报告怎么存mysql_在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:[email protected]/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    }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值