Add output of variables to AgentRingNoAnswer manager
authorMark Michelson <mmichelson@digium.com>
Mon, 25 Aug 2008 17:24:02 +0000 (17:24 +0000)
committerMark Michelson <mmichelson@digium.com>
Mon, 25 Aug 2008 17:24:02 +0000 (17:24 +0000)
event if eventwhencalled is set to "vars" in
queues.conf. Yay for consistency.

(closes issue #13369)
Reported by: srt
Patches:
      13369_agentringnoanswer_variables.diff uploaded by srt (license 378)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@139832 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_queue.c

index 8f94ef1..1e3a493 100644 (file)
@@ -2449,20 +2449,25 @@ static void record_abandoned(struct queue_ent *qe)
 static void rna(int rnatime, struct queue_ent *qe, char *interface, char *membername)
 {
        ast_verb(3, "Nobody picked up in %d ms\n", rnatime);
-       if (qe->parent->eventwhencalled)
+       if (qe->parent->eventwhencalled) {
+               char vars[2048];
+
                manager_event(EVENT_FLAG_AGENT, "AgentRingNoAnswer",
                                                "Queue: %s\r\n"
                                                "Uniqueid: %s\r\n"
                                                "Channel: %s\r\n"
                                                "Member: %s\r\n"
                                                "MemberName: %s\r\n"
-                                               "Ringtime: %d\r\n",
+                                               "Ringtime: %d\r\n"
+                                               "%s",
                                                qe->parent->name,
                                                qe->chan->uniqueid,
                                                qe->chan->name,
                                                interface,
                                                membername,
-                                               rnatime);
+                                               rnatime,
+                                               qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
+       }
        ast_queue_log(qe->parent->name, qe->chan->uniqueid, membername, "RINGNOANSWER", "%d", rnatime);
        if (qe->parent->autopause) {
                if (!set_member_paused(qe->parent->name, interface, "Auto-Pause", 1)) {