diff options
Diffstat (limited to 'main/manager.c')
-rw-r--r-- | main/manager.c | 51 |
1 files changed, 41 insertions, 10 deletions
diff --git a/main/manager.c b/main/manager.c index 5bc87d547..4e611a085 100644 --- a/main/manager.c +++ b/main/manager.c @@ -247,14 +247,16 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") <parameter name="DNID"> <para>Dialed number identifier</para> </parameter> + <parameter name="EffectiveConnectedLineNum"> + </parameter> + <parameter name="EffectiveConnectedLineName"> + </parameter> <parameter name="TimeToHangup"> <para>Absolute lifetime of the channel</para> </parameter> <parameter name="BridgeID"> <para>Identifier of the bridge the channel is in, may be empty if not in one</para> </parameter> - <parameter name="Linkedid"> - </parameter> <parameter name="Application"> <para>Application currently executing on the channel</para> </parameter> @@ -2344,11 +2346,12 @@ static char *handle_showmancmd(struct ast_cli_entry *e, int cmd, struct ast_cli_ AST_RWLIST_UNLOCK(&actions); return ret; } - authority = ast_str_alloca(MAX_AUTH_PERM_STRING); if (a->argc < 4) { return CLI_SHOWUSAGE; } + authority = ast_str_alloca(MAX_AUTH_PERM_STRING); + #ifdef AST_XML_DOCS /* setup the titles */ term_color(synopsis_title, "[Synopsis]\n", COLOR_MAGENTA, 0, 40); @@ -2376,6 +2379,22 @@ static char *handle_showmancmd(struct ast_cli_entry *e, int cmd, struct ast_cli_ char *seealso = ast_xmldoc_printable(S_OR(cur->seealso, "Not available"), 1); char *privilege = ast_xmldoc_printable(S_OR(auth_str, "Not available"), 1); char *responses = ast_xmldoc_printable("None", 1); + + if (!syntax || !synopsis || !description || !arguments + || !seealso || !privilege || !responses) { + ast_free(syntax); + ast_free(synopsis); + ast_free(description); + ast_free(arguments); + ast_free(seealso); + ast_free(privilege); + ast_free(responses); + ast_cli(a->fd, "Allocation failure.\n"); + AST_RWLIST_UNLOCK(&actions); + + return CLI_FAILURE; + } + ast_cli(a->fd, "%s%s\n\n%s%s\n\n%s%s\n\n%s%s\n\n%s%s\n\n%s%s\n\n%s", syntax_title, syntax, synopsis_title, synopsis, @@ -2403,6 +2422,14 @@ static char *handle_showmancmd(struct ast_cli_entry *e, int cmd, struct ast_cli_ ast_cli(a->fd, "Event: %s\n", cur->final_response->name); print_event_instance(a, cur->final_response); } + + ast_free(syntax); + ast_free(synopsis); + ast_free(description); + ast_free(arguments); + ast_free(seealso); + ast_free(privilege); + ast_free(responses); } else #endif { @@ -4558,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); @@ -4586,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" @@ -4602,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" @@ -4622,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)), @@ -4634,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, "<unknown>"), - S_COR(ast_channel_connected_effective_id(chan).name.valid, ast_channel_connected_effective_id(chan).name.str, "<unknown>"), + S_COR(effective_id.number.valid, effective_id.number.str, "<unknown>"), + S_COR(effective_id.name.valid, effective_id.name.str, "<unknown>"), (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), @@ -6684,9 +6717,7 @@ static void *session_do(void *data) } /* make sure socket is non-blocking */ - flags = fcntl(ser->fd, F_GETFL); - flags |= O_NONBLOCK; - fcntl(ser->fd, F_SETFL, flags); + ast_fd_set_flags(ser->fd, O_NONBLOCK); ao2_lock(session); /* Hook to the tail of the event queue */ |