From 5de8f4929408f50f91384e0828fde2ef4b860870 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Wed, 27 Dec 2017 20:48:40 -0600 Subject: manager.c: Update AMI Status event documentation The AMI Status event had linkedid listed twice and was missing the effective connected line name and number headers. NOTE: The linkedid and other standard channel snapshot fields in the XML documentation are part of the XML template defined in doc/appdocsxml.xslt. * Cached the effective connected line party id so it doesn't get calculated four times. Change-Id: I004c4c4f9e7b40ef55035c831702721bec82496c --- main/manager.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/main/manager.c b/main/manager.c index 890a97548..4e611a085 100644 --- a/main/manager.c +++ b/main/manager.c @@ -247,14 +247,16 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Dialed number identifier + + + + Absolute lifetime of the channel Identifier of the bridge the channel is in, may be empty if not in one - - Application currently executing on the channel @@ -4583,6 +4585,7 @@ static int action_status(struct mansession *s, const struct message *m) struct timeval now; long elapsed_seconds; struct ast_bridge *bridge; + struct ast_party_id effective_id; ast_channel_lock(chan); @@ -4611,10 +4614,12 @@ static int action_status(struct mansession *s, const struct message *m) channels++; bridge = ast_channel_get_bridge(chan); + effective_id = ast_channel_connected_effective_id(chan); astman_append(s, "Event: Status\r\n" "Privilege: Call\r\n" + /* v-- Start channel snapshot headers */ "Channel: %s\r\n" "ChannelState: %u\r\n" "ChannelStateDesc: %s\r\n" @@ -4627,13 +4632,14 @@ static int action_status(struct mansession *s, const struct message *m) "Exten: %s\r\n" "Priority: %d\r\n" "Uniqueid: %s\r\n" + "Linkedid: %s\r\n" + /* ^-- End channel snapshot headers */ "Type: %s\r\n" "DNID: %s\r\n" "EffectiveConnectedLineNum: %s\r\n" "EffectiveConnectedLineName: %s\r\n" "TimeToHangup: %ld\r\n" "BridgeID: %s\r\n" - "Linkedid: %s\r\n" "Application: %s\r\n" "Data: %s\r\n" "Nativeformats: %s\r\n" @@ -4647,6 +4653,7 @@ static int action_status(struct mansession *s, const struct message *m) "%s" "%s" "\r\n", + /* v-- Start channel snapshot headers */ ast_channel_name(chan), ast_channel_state(chan), ast_state2str(ast_channel_state(chan)), @@ -4659,13 +4666,14 @@ static int action_status(struct mansession *s, const struct message *m) ast_channel_exten(chan), ast_channel_priority(chan), ast_channel_uniqueid(chan), + ast_channel_linkedid(chan), + /* ^-- End channel snapshot headers */ ast_channel_tech(chan)->type, S_OR(ast_channel_dialed(chan)->number.str, ""), - S_COR(ast_channel_connected_effective_id(chan).number.valid, ast_channel_connected_effective_id(chan).number.str, ""), - S_COR(ast_channel_connected_effective_id(chan).name.valid, ast_channel_connected_effective_id(chan).name.str, ""), + S_COR(effective_id.number.valid, effective_id.number.str, ""), + S_COR(effective_id.name.valid, effective_id.name.str, ""), (long)ast_channel_whentohangup(chan)->tv_sec, bridge ? bridge->uniqueid : "", - ast_channel_linkedid(chan), ast_channel_appl(chan), ast_channel_data(chan), ast_format_cap_get_names(ast_channel_nativeformats(chan), &codec_buf), -- cgit v1.2.3