Merged revisions 320823 via svnmerge from
authorRichard Mudgett <rmudgett@digium.com>
Wed, 25 May 2011 17:14:11 +0000 (17:14 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 25 May 2011 17:14:11 +0000 (17:14 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r320823 | rmudgett | 2011-05-25 12:06:38 -0500 (Wed, 25 May 2011) | 18 lines

  The AMI Newstate event contains different information between v1.4 and v1.8.

  The addition of connected line support in v1.8 changes the behavior of the
  channel caller ID somewhat.  The channel caller ID value no longer time
  shares with the connected line ID on outgoing call legs.  The timing of
  some AMI events/responses output the connected line ID as caller ID.
  These party ID's are now separate.

  * The ConnectedLineNum and ConnectedLineName headers were added to many
  AMI events/responses if the CallerIDNum/CallerIDName headers were also
  present.

  (closes issue #18252)
  Reported by: gje
  Tested by: rmudgett

  Review: https://reviewboard.asterisk.org/r/1227/
........

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

CHANGES
UPGRADE-1.8.txt
apps/app_dial.c
apps/app_fax.c
apps/app_meetme.c
apps/app_queue.c
main/channel.c
main/features.c
main/manager.c

diff --git a/CHANGES b/CHANGES
index 0cd15a9..231d1b6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -567,8 +567,8 @@ Asterisk Manager Interface
  * Added a new eventfilter option per user to allow whitelisting and blacklisting
    of events.
  * Added optional parkinglot variable for park command.
- * Added ConnectedLineNum and ConnectedLineName headers to the output of Status
-   manager action.
+ * Added ConnectedLineNum and ConnectedLineName headers to AMI events/responses
+   if CallerIDNum and CallerIDName headers are also present.
 
 Channel Event Logging
 ---------------------
index 643461e..5d40e2e 100644 (file)
@@ -133,6 +133,14 @@ From 1.6.2 to 1.8:
 * The default value for the pedantic option in sip.conf has been changed
   from "no" to "yes".
 
+* The ConnectedLineNum and ConnectedLineName headers were added to many AMI
+  events/responses if the CallerIDNum/CallerIDName headers were also present.
+  The addition of connected line support changes the behavior of the channel
+  caller ID somewhat.  The channel caller ID value no longer time shares with
+  the connected line ID on outgoing call legs.  The timing of some AMI
+  events/responses output the connected line ID as caller ID.  These party ID's
+  are now separate.
+
 From 1.6.1 to 1.6.2:
 
 * SIP no longer sends the 183 progress message for early media by
index ae61472..25172c7 100644 (file)
@@ -768,12 +768,16 @@ static void senddialevent(struct ast_channel *src, struct ast_channel *dst, cons
                "Destination: %s\r\n"
                "CallerIDNum: %s\r\n"
                "CallerIDName: %s\r\n"
+               "ConnectedLineNum: %s\r\n"
+               "ConnectedLineName: %s\r\n"
                "UniqueID: %s\r\n"
                "DestUniqueID: %s\r\n"
                "Dialstring: %s\r\n",
                src->name, dst->name,
                S_COR(src->caller.id.number.valid, src->caller.id.number.str, "<unknown>"),
                S_COR(src->caller.id.name.valid, src->caller.id.name.str, "<unknown>"),
+               S_COR(src->connected.id.number.valid, src->connected.id.number.str, "<unknown>"),
+               S_COR(src->connected.id.name.valid, src->connected.id.name.str, "<unknown>"),
                src->uniqueid, dst->uniqueid,
                dialstring ? dialstring : "");
 }
index 39c6ad1..0d59dfa 100644 (file)
@@ -255,6 +255,9 @@ static void phase_e_handler(t30_state_t *f, void *user_data, int result)
                "Channel: %s\r\n"
                "Exten: %s\r\n"
                "CallerID: %s\r\n"
+               "CallerIDName: %s\r\n"
+               "ConnectedLineNum: %s\r\n"
+               "ConnectedLineName: %s\r\n"
                "RemoteStationID: %s\r\n"
                "LocalStationID: %s\r\n"
                "PagesTransferred: %d\r\n"
@@ -264,6 +267,9 @@ static void phase_e_handler(t30_state_t *f, void *user_data, int result)
                s->chan->name,
                s->chan->exten,
                S_COR(s->chan->caller.id.number.valid, s->chan->caller.id.number.str, ""),
+               S_COR(s->chan->caller.id.name.valid, s->chan->caller.id.name.str, ""),
+               S_COR(s->chan->connected.id.number.valid, s->chan->connected.id.number.str, ""),
+               S_COR(s->chan->connected.id.name.valid, s->chan->connected.id.name.str, ""),
                far_ident,
                local_ident,
                pages_transferred,
index af5c2ae..dad293b 100644 (file)
@@ -2756,11 +2756,15 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
                        "Meetme: %s\r\n"
                        "Usernum: %d\r\n"
                        "CallerIDnum: %s\r\n"
-                       "CallerIDname: %s\r\n",
+                       "CallerIDname: %s\r\n"
+                       "ConnectedLineNum: %s\r\n"
+                       "ConnectedLineName: %s\r\n",
                        chan->name, chan->uniqueid, conf->confno,
                        user->user_no,
                        S_COR(user->chan->caller.id.number.valid, user->chan->caller.id.number.str, "<unknown>"),
-                       S_COR(user->chan->caller.id.name.valid, user->chan->caller.id.name.str, "<unknown>")
+                       S_COR(user->chan->caller.id.name.valid, user->chan->caller.id.name.str, "<unknown>"),
+                       S_COR(user->chan->connected.id.number.valid, user->chan->connected.id.number.str, "<unknown>"),
+                       S_COR(user->chan->connected.id.name.valid, user->chan->connected.id.name.str, "<unknown>")
                        );
                sent_event = 1;
        }
@@ -3817,11 +3821,15 @@ bailoutandtrynormal:
                                "Usernum: %d\r\n"
                                "CallerIDNum: %s\r\n"
                                "CallerIDName: %s\r\n"
+                               "ConnectedLineNum: %s\r\n"
+                               "ConnectedLineName: %s\r\n"
                                "Duration: %ld\r\n",
                                chan->name, chan->uniqueid, conf->confno,
                                user->user_no,
                                S_COR(user->chan->caller.id.number.valid, user->chan->caller.id.number.str, "<unknown>"),
                                S_COR(user->chan->caller.id.name.valid, user->chan->caller.id.name.str, "<unknown>"),
+                               S_COR(user->chan->connected.id.number.valid, user->chan->connected.id.number.str, "<unknown>"),
+                               S_COR(user->chan->connected.id.name.valid, user->chan->connected.id.name.str, "<unknown>"),
                                (long)(now.tv_sec - user->jointime));
                }
 
@@ -4883,6 +4891,8 @@ static int action_meetmelist(struct mansession *s, const struct message *m)
                                "UserNumber: %d\r\n"
                                "CallerIDNum: %s\r\n"
                                "CallerIDName: %s\r\n"
+                               "ConnectedLineNum: %s\r\n"
+                               "ConnectedLineName: %s\r\n"
                                "Channel: %s\r\n"
                                "Admin: %s\r\n"
                                "Role: %s\r\n"
@@ -4895,6 +4905,8 @@ static int action_meetmelist(struct mansession *s, const struct message *m)
                                user->user_no,
                                S_COR(user->chan->caller.id.number.valid, user->chan->caller.id.number.str, "<unknown>"),
                                S_COR(user->chan->caller.id.name.valid, user->chan->caller.id.name.str, "<no name>"),
+                               S_COR(user->chan->connected.id.number.valid, user->chan->connected.id.number.str, "<unknown>"),
+                               S_COR(user->chan->connected.id.name.valid, user->chan->connected.id.name.str, "<no name>"),
                                user->chan->name,
                                ast_test_flag64(&user->userflags, CONFFLAG_ADMIN) ? "Yes" : "No",
                                ast_test_flag64(&user->userflags, CONFFLAG_MONITOR) ? "Listen only" : ast_test_flag64(&user->userflags, CONFFLAG_TALKER) ? "Talk only" : "Talk and listen",
index 8b1072e..dc7a0a0 100644 (file)
@@ -2515,10 +2515,20 @@ static int join_queue(char *queuename, struct queue_ent *qe, enum queue_result *
                q->count++;
                res = 0;
                ast_manager_event(qe->chan, EVENT_FLAG_CALL, "Join",
-                       "Channel: %s\r\nCallerIDNum: %s\r\nCallerIDName: %s\r\nQueue: %s\r\nPosition: %d\r\nCount: %d\r\nUniqueid: %s\r\n",
+                       "Channel: %s\r\n"
+                       "CallerIDNum: %s\r\n"
+                       "CallerIDName: %s\r\n"
+                       "ConnectedLineNum: %s\r\n"
+                       "ConnectedLineName: %s\r\n"
+                       "Queue: %s\r\n"
+                       "Position: %d\r\n"
+                       "Count: %d\r\n"
+                       "Uniqueid: %s\r\n",
                        qe->chan->name,
                        S_COR(qe->chan->caller.id.number.valid, qe->chan->caller.id.number.str, "unknown"),/* XXX somewhere else it is <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"),/* XXX somewhere else it is <unknown> */
+                       S_COR(qe->chan->connected.id.name.valid, qe->chan->connected.id.name.str, "unknown"),
                        q->name, qe->pos, q->count, qe->chan->uniqueid );
                ast_debug(1, "Queue '%s' Join, Channel '%s', Position '%d'\n", q->name, qe->chan->name, qe->pos );
        }
@@ -3152,6 +3162,8 @@ static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies
                        "DestinationChannel: %s\r\n"
                        "CallerIDNum: %s\r\n"
                        "CallerIDName: %s\r\n"
+                       "ConnectedLineNum: %s\r\n"
+                       "ConnectedLineName: %s\r\n"
                        "Context: %s\r\n"
                        "Extension: %s\r\n"
                        "Priority: %d\r\n"
@@ -3160,6 +3172,8 @@ static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies
                        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"),
                        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);
@@ -7247,12 +7261,16 @@ static int manager_queues_status(struct mansession *s, const struct message *m)
                                        "Uniqueid: %s\r\n"
                                        "CallerIDNum: %s\r\n"
                                        "CallerIDName: %s\r\n"
+                                       "ConnectedLineNum: %s\r\n"
+                                       "ConnectedLineName: %s\r\n"
                                        "Wait: %ld\r\n"
                                        "%s"
                                        "\r\n",
                                        q->name, pos++, qe->chan->name, qe->chan->uniqueid,
                                        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"),
                                        (long) (now - qe->start), idText);
                        }
                }
index 103627b..0dc9c0b 100644 (file)
@@ -2860,12 +2860,16 @@ int ast_hangup(struct ast_channel *chan)
                "Uniqueid: %s\r\n"
                "CallerIDNum: %s\r\n"
                "CallerIDName: %s\r\n"
+               "ConnectedLineNum: %s\r\n"
+               "ConnectedLineName: %s\r\n"
                "Cause: %d\r\n"
                "Cause-txt: %s\r\n",
                chan->name,
                chan->uniqueid,
                S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, "<unknown>"),
                S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, "<unknown>"),
+               S_COR(chan->connected.id.number.valid, chan->connected.id.number.str, "<unknown>"),
+               S_COR(chan->connected.id.name.valid, chan->connected.id.name.str, "<unknown>"),
                chan->hangupcause,
                ast_cause2str(chan->hangupcause)
                );
@@ -6952,10 +6956,14 @@ int ast_setstate(struct ast_channel *chan, enum ast_channel_state state)
                "ChannelStateDesc: %s\r\n"
                "CallerIDNum: %s\r\n"
                "CallerIDName: %s\r\n"
+               "ConnectedLineNum: %s\r\n"
+               "ConnectedLineName: %s\r\n"
                "Uniqueid: %s\r\n",
                chan->name, chan->_state, ast_state2str(chan->_state),
                S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, ""),
                S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, ""),
+               S_COR(chan->connected.id.number.valid, chan->connected.id.number.str, ""),
+               S_COR(chan->connected.id.name.valid, chan->connected.id.name.str, ""),
                chan->uniqueid);
 
        return 0;
index e8e9164..452c883 100644 (file)
@@ -1177,11 +1177,15 @@ static int park_call_full(struct ast_channel *chan, struct ast_channel *peer, st
                "Timeout: %ld\r\n"
                "CallerIDNum: %s\r\n"
                "CallerIDName: %s\r\n"
+               "ConnectedLineNum: %s\r\n"
+               "ConnectedLineName: %s\r\n"
                "Uniqueid: %s\r\n",
                pu->parkingexten, pu->chan->name, pu->parkinglot->name, event_from ? event_from : "",
                (long)pu->start.tv_sec + (long)(pu->parkingtime/1000) - (long)time(NULL),
                S_COR(pu->chan->caller.id.number.valid, pu->chan->caller.id.number.str, "<unknown>"),
                S_COR(pu->chan->caller.id.name.valid, pu->chan->caller.id.name.str, "<unknown>"),
+               S_COR(pu->chan->connected.id.number.valid, pu->chan->connected.id.number.str, "<unknown>"),
+               S_COR(pu->chan->connected.id.name.valid, pu->chan->connected.id.name.str, "<unknown>"),
                pu->chan->uniqueid
                );
 
@@ -4056,12 +4060,16 @@ static void post_manager_event(const char *s, struct parkeduser *pu)
                "Parkinglot: %s\r\n"
                "CallerIDNum: %s\r\n"
                "CallerIDName: %s\r\n"
+               "ConnectedLineNum: %s\r\n"
+               "ConnectedLineName: %s\r\n"
                "UniqueID: %s\r\n",
                pu->parkingexten, 
                pu->chan->name,
                pu->parkinglot->name,
                S_COR(pu->chan->caller.id.number.valid, pu->chan->caller.id.number.str, "<unknown>"),
                S_COR(pu->chan->caller.id.name.valid, pu->chan->caller.id.name.str, "<unknown>"),
+               S_COR(pu->chan->connected.id.number.valid, pu->chan->connected.id.number.str, "<unknown>"),
+               S_COR(pu->chan->connected.id.name.valid, pu->chan->connected.id.name.str, "<unknown>"),
                pu->chan->uniqueid
                );
 }
@@ -4554,10 +4562,14 @@ static int park_exec_full(struct ast_channel *chan, const char *data)
                        "Channel: %s\r\n"
                        "From: %s\r\n"
                        "CallerIDNum: %s\r\n"
-                       "CallerIDName: %s\r\n",
+                       "CallerIDName: %s\r\n"
+                       "ConnectedLineNum: %s\r\n"
+                       "ConnectedLineName: %s\r\n",
                        pu->parkingexten, pu->chan->name, chan->name,
                        S_COR(pu->chan->caller.id.number.valid, pu->chan->caller.id.number.str, "<unknown>"),
-                       S_COR(pu->chan->caller.id.name.valid, pu->chan->caller.id.name.str, "<unknown>")
+                       S_COR(pu->chan->caller.id.name.valid, pu->chan->caller.id.name.str, "<unknown>"),
+                       S_COR(pu->chan->connected.id.number.valid, pu->chan->connected.id.number.str, "<unknown>"),
+                       S_COR(pu->chan->connected.id.name.valid, pu->chan->connected.id.name.str, "<unknown>")
                        );
 
                ast_free(pu);
@@ -5635,12 +5647,16 @@ static int manager_parking_status(struct mansession *s, const struct message *m)
                                "Timeout: %ld\r\n"
                                "CallerIDNum: %s\r\n"
                                "CallerIDName: %s\r\n"
+                               "ConnectedLineNum: %s\r\n"
+                               "ConnectedLineName: %s\r\n"
                                "%s"
                                "\r\n",
                                cur->parkingnum, cur->chan->name, cur->peername,
                                (long) cur->start.tv_sec + (long) (cur->parkingtime / 1000) - (long) time(NULL),
                                S_COR(cur->chan->caller.id.number.valid, cur->chan->caller.id.number.str, ""),  /* XXX in other places it is <unknown> */
                                S_COR(cur->chan->caller.id.name.valid, cur->chan->caller.id.name.str, ""),
+                               S_COR(cur->chan->connected.id.number.valid, cur->chan->connected.id.number.str, ""),    /* XXX in other places it is <unknown> */
+                               S_COR(cur->chan->connected.id.name.valid, cur->chan->connected.id.name.str, ""),
                                idText);
                }
                AST_LIST_UNLOCK(&curlot->parkings);
index 4f4984b..ea2e2a9 100644 (file)
@@ -4337,6 +4337,9 @@ static int action_coreshowchannels(struct mansession *s, const struct message *m
                        "Application: %s\r\n"
                        "ApplicationData: %s\r\n"
                        "CallerIDnum: %s\r\n"
+                       "CallerIDname: %s\r\n"
+                       "ConnectedLineNum: %s\r\n"
+                       "ConnectedLineName: %s\r\n"
                        "Duration: %s\r\n"
                        "AccountCode: %s\r\n"
                        "BridgedChannel: %s\r\n"
@@ -4344,6 +4347,9 @@ static int action_coreshowchannels(struct mansession *s, const struct message *m
                        "\r\n", idText, c->name, c->uniqueid, c->context, c->exten, c->priority, c->_state,
                        ast_state2str(c->_state), c->appl ? c->appl : "", c->data ? S_OR(c->data, "") : "",
                        S_COR(c->caller.id.number.valid, c->caller.id.number.str, ""),
+                       S_COR(c->caller.id.name.valid, c->caller.id.name.str, ""),
+                       S_COR(c->connected.id.number.valid, c->connected.id.number.str, ""),
+                       S_COR(c->connected.id.name.valid, c->connected.id.name.str, ""),
                        durbuf, S_OR(c->accountcode, ""), bc ? bc->name : "", bc ? bc->uniqueid : "");
 
                ast_channel_unlock(c);