mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-22 20:56:39 +00:00
Allow optional event whenever an agent is called from a queue (bug #2066)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -217,6 +217,7 @@ struct ast_call_queue {
|
|||||||
int rrpos; /* Round Robin - position */
|
int rrpos; /* Round Robin - position */
|
||||||
int wrapped; /* Round Robin - wrapped around? */
|
int wrapped; /* Round Robin - wrapped around? */
|
||||||
int joinempty; /* Do we care if the queue has no members? */
|
int joinempty; /* Do we care if the queue has no members? */
|
||||||
|
int eventwhencalled; /* Generate an event when the agent is called (before pickup) */
|
||||||
|
|
||||||
struct member *members; /* Member channels to be tried */
|
struct member *members; /* Member channels to be tried */
|
||||||
struct queue_ent *head; /* Start of the actual queue */
|
struct queue_ent *head; /* Start of the actual queue */
|
||||||
@@ -585,9 +586,22 @@ static int ring_entry(struct queue_ent *qe, struct localuser *tmp)
|
|||||||
tmp->chan = NULL;
|
tmp->chan = NULL;
|
||||||
tmp->stillgoing = 0;
|
tmp->stillgoing = 0;
|
||||||
return 0;
|
return 0;
|
||||||
} else
|
} else {
|
||||||
|
if (qe->parent->eventwhencalled) {
|
||||||
|
manager_event(EVENT_FLAG_AGENT, "AgentCalled",
|
||||||
|
"AgentCalled: %s/%s\r\n"
|
||||||
|
"ChannelCalling: %s\r\n"
|
||||||
|
"CallerID: %s\r\n"
|
||||||
|
"Context: %s\r\n"
|
||||||
|
"Extension: %s\r\n"
|
||||||
|
"Priority: %d\r\n",
|
||||||
|
tmp->tech, tmp->numsubst, qe->chan->name,
|
||||||
|
tmp->chan->callerid ? tmp->chan->callerid : "unknown <>",
|
||||||
|
qe->chan->context, qe->chan->exten, qe->chan->priority);
|
||||||
|
}
|
||||||
if (option_verbose > 2)
|
if (option_verbose > 2)
|
||||||
ast_verbose(VERBOSE_PREFIX_3 "Called %s\n", tmp->numsubst);
|
ast_verbose(VERBOSE_PREFIX_3 "Called %s/%s\n", tmp->tech, tmp->numsubst);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1833,6 +1847,8 @@ static void reload_queues(void)
|
|||||||
}
|
}
|
||||||
} else if (!strcasecmp(var->name, "joinempty")) {
|
} else if (!strcasecmp(var->name, "joinempty")) {
|
||||||
q->joinempty = ast_true(var->value);
|
q->joinempty = ast_true(var->value);
|
||||||
|
} else if (!strcasecmp(var->name, "eventwhencalled")) {
|
||||||
|
q->eventwhencalled = ast_true(var->value);
|
||||||
} else {
|
} else {
|
||||||
ast_log(LOG_WARNING, "Unknown keyword in queue '%s': %s at line %d of queue.conf\n", cat, var->name, var->lineno);
|
ast_log(LOG_WARNING, "Unknown keyword in queue '%s': %s at line %d of queue.conf\n", cat, var->name, var->lineno);
|
||||||
}
|
}
|
||||||
|
@@ -111,6 +111,11 @@
|
|||||||
;
|
;
|
||||||
; joinempty = yes
|
; joinempty = yes
|
||||||
;
|
;
|
||||||
|
; Asterisk can generate AgentCalled events when an agent is rung, if this is turned on
|
||||||
|
; (may generate a LOT of extra manager events)
|
||||||
|
;
|
||||||
|
; eventwhencalled = yes
|
||||||
|
;
|
||||||
; Each member of this call queue is listed on a separate line in
|
; Each member of this call queue is listed on a separate line in
|
||||||
; the form technology/dialstring. "member" means a normal member of a
|
; the form technology/dialstring. "member" means a normal member of a
|
||||||
; queue. An optional penalty may be specified after a comma, such that
|
; queue. An optional penalty may be specified after a comma, such that
|
||||||
|
Reference in New Issue
Block a user