diff --git a/main/manager.c b/main/manager.c index 953116609a..6c1edc5be7 100644 --- a/main/manager.c +++ b/main/manager.c @@ -812,6 +812,49 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Send a reload event. + + + Raised in response to a CoreShowChannels command. + + + + + Identifier of the bridge the channel is in, may be empty if not in one + + + Application currently executing on the channel + + + Data given to the currently executing application + + + The amount of time the channel has existed + + + + CoreShowChannels + CoreShowChannelsComplete + + + + + + Raised at the end of the CoreShowChannel list produced by the CoreShowChannels command. + + + + Conveys the status of the command reponse list + + + The total number of list items produced + + + + CoreShowChannels + CoreShowChannel + + + List currently active channels. @@ -822,6 +865,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") List currently defined channels and some information about them. + + + + + + @@ -5509,18 +5558,37 @@ static int action_coreshowchannels(struct mansession *s, const struct message *m for (; (msg = ao2_iterator_next(&it_chans)); ao2_ref(msg, -1)) { struct ast_channel_snapshot *cs = stasis_message_data(msg); struct ast_str *built = ast_manager_build_channel_state_string_prefix(cs, ""); + char durbuf[10] = ""; if (!built) { continue; } + if (!ast_tvzero(cs->creationtime)) { + int duration, durh, durm, durs; + + duration = (int)(ast_tvdiff_ms(ast_tvnow(), cs->creationtime) / 1000); + durh = duration / 3600; + durm = (duration % 3600) / 60; + durs = duration % 60; + snprintf(durbuf, sizeof(durbuf), "%02d:%02d:%02d", durh, durm, durs); + } + astman_append(s, "Event: CoreShowChannel\r\n" "%s" "%s" + "Application: %s\r\n" + "ApplicationData: %s\r\n" + "Duration: %s\r\n" + "BridgeId: %s\r\n" "\r\n", idText, - ast_str_buffer(built)); + ast_str_buffer(built), + cs->appl, + cs->data, + durbuf, + cs->bridgeid); numchans++;