diff options
author | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-05-26 22:38:05 +0000 |
---|---|---|
committer | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-05-26 22:38:05 +0000 |
commit | 69fe563ef172ef5b2766a864ca91dd093d97ee68 (patch) | |
tree | 0ee9c1a0acd4db635a3c5777fbee7a001f38a936 /main/manager.c | |
parent | d4679e5d2a244da2c996913de93d3b53ff8b594d (diff) |
Add ActionID to CoreShowChannel event.
There is inconsistency in how we handle manager responses that are lists of
items and, unfortunately, third parties have come to rely on ActionID being on
every event within those lists instead of just keeping track of the ActionID for
the current response. This change makes CoreShowChannels include the ActionID
with each CoreShowChannel event generated as a result of it being called.
(closes issue #15001)
Reported by: sum
Patches:
patchactionid2.patch uploaded by sum (license 766)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196945 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/manager.c')
-rw-r--r-- | main/manager.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/main/manager.c b/main/manager.c index 25e976a0a..874ac9e24 100644 --- a/main/manager.c +++ b/main/manager.c @@ -3408,16 +3408,16 @@ static int action_reload(struct mansession *s, const struct message *m) static int action_coreshowchannels(struct mansession *s, const struct message *m) { const char *actionid = astman_get_header(m, "ActionID"); - char actionidtext[256]; + char idText[256]; struct ast_channel *c = NULL; int numchans = 0; int duration, durh, durm, durs; struct ast_channel_iterator *iter; if (!ast_strlen_zero(actionid)) { - snprintf(actionidtext, sizeof(actionidtext), "ActionID: %s\r\n", actionid); + snprintf(idText, sizeof(idText), "ActionID: %s\r\n", actionid); } else { - actionidtext[0] = '\0'; + idText[0] = '\0'; } if (!(iter = ast_channel_iterator_all_new(0))) { @@ -3444,6 +3444,7 @@ static int action_coreshowchannels(struct mansession *s, const struct message *m astman_append(s, "Event: CoreShowChannel\r\n" + "%s" "Channel: %s\r\n" "UniqueID: %s\r\n" "Context: %s\r\n" @@ -3458,8 +3459,8 @@ static int action_coreshowchannels(struct mansession *s, const struct message *m "AccountCode: %s\r\n" "BridgedChannel: %s\r\n" "BridgedUniqueID: %s\r\n" - "\r\n", 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, ""): "", + "\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_OR(c->cid.cid_num, ""), durbuf, S_OR(c->accountcode, ""), bc ? bc->name : "", bc ? bc->uniqueid : ""); ast_channel_unlock(c); @@ -3472,7 +3473,7 @@ static int action_coreshowchannels(struct mansession *s, const struct message *m "EventList: Complete\r\n" "ListItems: %d\r\n" "%s" - "\r\n", numchans, actionidtext); + "\r\n", numchans, idText); ast_channel_iterator_destroy(iter); |