Make AMI event AgentCalled get CallerID/ConnectedLine info from the incoming channel.
authorRichard Mudgett <rmudgett@digium.com>
Thu, 10 Nov 2011 22:38:29 +0000 (22:38 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 10 Nov 2011 22:38:29 +0000 (22:38 +0000)
It was strange that the AgentCalled AMI event would get most of its
information from the incoming channel but then get the CallerID
information from the outgoing channel.  Before connected line support was
added, this information was always the same at this point.

(closes issue ASTERISK-18152)
Reported by: Thomas Farnham
Tested by: rmudgett
........

Merged revisions 344536 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 344537 from http://svn.asterisk.org/svn/asterisk/branches/10

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

apps/app_queue.c

index 6f66f3a..2b35f28 100644 (file)
@@ -3255,10 +3255,10 @@ static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies
                        "Uniqueid: %s\r\n"
                        "%s",
                        qe->parent->name, tmp->interface, tmp->member->membername, qe->chan->name, tmp->chan->name,
-                       S_COR(tmp->chan->caller.id.number.valid, tmp->chan->caller.id.number.str, "unknown"),
-                       S_COR(tmp->chan->caller.id.name.valid, tmp->chan->caller.id.name.str, "unknown"),
-                       S_COR(tmp->chan->connected.id.number.valid, tmp->chan->connected.id.number.str, "unknown"),
-                       S_COR(tmp->chan->connected.id.name.valid, tmp->chan->connected.id.name.str, "unknown"),
+                       S_COR(qe->chan->caller.id.number.valid, qe->chan->caller.id.number.str, "unknown"),
+                       S_COR(qe->chan->caller.id.name.valid, qe->chan->caller.id.name.str, "unknown"),
+                       S_COR(qe->chan->connected.id.number.valid, qe->chan->connected.id.number.str, "unknown"),
+                       S_COR(qe->chan->connected.id.name.valid, qe->chan->connected.id.name.str, "unknown"),
                        qe->chan->context, qe->chan->exten, qe->chan->priority, qe->chan->uniqueid,
                        qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : "");
                ast_verb(3, "Called %s\n", tmp->interface);