[英]Asterisk/Java: How do I get the start time of a call after rebooting my Java app?
I'm using Asterisk's AMI so that my Java app can receive events from the pbx. 我正在使用Asterisk的AMI,以便我的Java应用程序可以接收来自pbx的事件。 I'm currently relying on the NewChannelEvent to get the start time of the call.
我目前依靠NewChannelEvent来获取通话的开始时间。
However, when I reboot my system, I have no way to retrieve the start time of the call. 但是,当我重新启动系统时,无法获取呼叫的开始时间。
What is the most elegant way to solve this problem? 解决此问题的最优雅方法是什么? Best case is I would like my Java app to receive an event with the call details.
最好的情况是我希望我的Java应用程序收到一个包含呼叫详细信息的事件。
You can use the logs in the asterisk's Master.csv. 您可以使用星号的Master.csv中的日志。 it's in
在里面
/var/log/asterisk/cdr-csv/Master.csv
It will give you more useful data. 它将为您提供更多有用的数据。
Asterisk have two 3 mechanism for that 星号有两个3机制
1) AMI 1)急性心肌梗死
2) CEL https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=5242932 CEL allow you see multiple events, including start of call in database. 2)CEL https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=5242932 CEL允许您查看多个事件,包括数据库中的呼叫开始。
3) CDR https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+CDR+Specification You will start of call too, but only after end of call. 3)CDR https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+CDR+Specification您也将开始通话,但仅在通话结束后。
Also you can change dialplan so it do func_odbc and mark start of call in your favorite table in dialplan. 您也可以更改Dialplan,使其执行func_odbc并在Dialplan中您喜欢的表中标记呼叫开始。
---func_cdr.conf---
[put_active]
writesql=insert into active_calls(uniqueid,calldate,start,src,did,accountcode) values('${VAL1}','${VAL2}',1,'${VAL3}','${VAL4}','${VAL5}');
dsn=mysql_general
In extensions.conf 在extensions.conf中
exten => _X.,1,Set(ODBC_put_active()=${CDR(uniqueid)},${CDR(start)},${CDR(src)},${CDR(did)},${CDR(accountcode)})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.