aboutsummaryrefslogtreecommitdiffstats
path: root/main/manager.c
diff options
context:
space:
mode:
authorseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-26 22:46:44 +0000
committerseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-26 22:46:44 +0000
commitbffab5ecc16bc2ee7ea19085077ca715959ed9a0 (patch)
treed12f65a949895f1969b19a13116578f195e183f9 /main/manager.c
parent01aba09089411751ebba0cb201ecc79c0ecdce8e (diff)
Merged revisions 196945 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r196945 | seanbright | 2009-05-26 18:38:05 -0400 (Tue, 26 May 2009) | 13 lines 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/branches/1.6.2@196950 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/manager.c')
-rw-r--r--main/manager.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/main/manager.c b/main/manager.c
index 1d123622e..8e90f20f0 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -2792,15 +2792,15 @@ static char mandescr_coreshowchannels[] =
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;
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';
astman_send_listack(s, m, "Channels will follow", "start");
@@ -2818,6 +2818,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"
@@ -2832,8 +2833,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);
numchans++;
@@ -2844,7 +2845,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);
return 0;
}