简体   繁体   English

使用asterisk queue_log表或AMI检索/制作星号队列统计信息

[英]Retrieving/making statistics of asterisk queues using asterisk queue_log table or AMI

Using PHP asterisk manager interface I am able to query asterisk for current queue status by issuing a QueueStatusAction. 使用PHP星号管理器界面,我可以通过发出QueueStatusAction来查询星号以获得当前队列状态。 This provides me with useful statistics like: 这为我提供了有用的统计信息,例如:

  1. Hold time 保持时间
  2. Calls abandoned 放弃通话
  3. Calls completed 通话已完成
  4. Average talk time. 平均通话时间。

As far as I understand, these statistics are calculated only for the lifetime of asterisk process on the server and are lost once the process stops. 据我了解,这些统计信息仅针对服务器上星号进程的生命周期进行计算,一旦进程停止,这些统计信息将丢失。

In my application, I would like to display the mentioned statistics about queues for the last {day|week|month|year}. 在我的应用程序中,我想显示有关最近{day | week | month | year}个队列的统计信息。 Is there a way to retrieve the historic statics via asterisk manager interface or some abstraction on top of it, or is it up to me to program a method for making those statistics from the data in asterisk queue_log table? 有没有一种方法可以通过星号管理器接口或在它之上的某种抽象来检索历史静态数据,还是由我来编程一种从星号queue_log表中的数据进行统计的方法?

If anybody has done this or has some idea of how to go about tackling this problem, please share. 如果有人这样做或对解决此问题有一些想法,请分享。

You are gooing wrong way. 您正在走错路。

Asterisk is PBX software. 星号是PBX软件。 It not responsible for save/record/manage info about queue. 它不负责有关队列的保存/记录/管理信息。 It not designed to store info about queue inside asterisk, instead it providing following ways: 它并非旨在将有关队列的信息存储在星号内,而是提供了以下方式:

  1. Events like agent login/logoff/call etc via manager API 通过经理API的事件,如座席登录/注销/呼叫等
  2. Events log in /var/log/asterisk/queue_log 事件登录/ var / log / asterisk / queue_log
  3. Same as 2, but queue_log in database(recommended way). 与2相同,但在数据库中使用queue_log(推荐方式)。 See this: 看到这个:

After data placed you can use SQL query language to create report you need. 放置数据后,您可以使用SQL查询语言创建所需的报告。 Actualy it is simple SQL for anyone with sql skill. 实际上,对于任何具有sql技能的人来说,这都是简单的SQL。

For example to got hold time, you need select all events with your queue number and event CONNECT,it provide waittime. 例如,要获得保持时间,您需要选择所有事件以及您的队列号和事件CONNECT,以提供等待时间。 For call time you need check CONNECT and check next event COMPLETECALLER/COMPLETEAGENT with same uniqueid. 对于通话时间,您需要检查CONNECT并检查具有相同唯一标识的下一个事件COMPLETECALLER / COMPLETEAGENT。

If for some reason you are not so nice with sql, you can check some opensource project like Asternic Call Center Stats or other(google by queue managment/report) and check SQLs it use or hire someone to do your sql part. 如果由于某种原因您对sql不太满意,则可以检查一些开源项目,例如Asternic Call Center Stats或其他项目(google,通过队列管理/报告),并检查它使用的SQL或雇用某人来做您的sql部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM