简体   繁体   English

Asterisk / Java:重新启动Java应用程序后如何获得呼叫的开始时间?

[英]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.

相关问题 如何在Java正则表达式中取消星号? - How do I negate an asterisk in a java regex? 如何从Java应用程序拨打语音电话? 如何使该程序正常工作? - How do I make a voice call from my Java app? How do I make this program work? 如何获得Java以从Internet调用数据? 从哪里开始? - How do I get a Java to call data from the Internet? Where to even start? 如何在分析器的同时启动Java应用程序? - How do I start a Java application at the same time as a profiler? 当我的 Java 应用程序退出/崩溃时,如何摆脱 Java 子进程? - How do I get rid of Java child processes when my Java app exits/crashes? 我如何获得这个Java应用程序的PID? - How do I get the PID of this Java app? 重启设备后如何重启应用程序? - How can I restart my application after rebooting of device? 如何开始优化Java代码? -CPU为100% - How do I start optimising my Java code? - CPU is at 100% 在Java中经过一定时间后,如何结束递归? - How do I end my recursion after a certain amount of time in Java? 如何让我的 Java 应用程序像状态应用程序一样从 MacOS 桌面菜单栏运行? - How do I get my Java App to run from the MacOS desktop menu bar like a status app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM