Review Board 1.7.16


Use stasis cache in more places

Review Request #2645 - Created June 26, 2013 and submitted

Joshua Colp
stasis_cache_usage
ASTERISK-21883
Reviewers
asterisk-dev
Asterisk
This change moves CLI/AGI/AMI commands to accessing the Stasis cache for retrieving information instead of directly accessing the data structures. I have also added an AMI action to get bridge information, and extended the "status" action to include the same information available as "core show channel".

Stuff given up:
1. Number of frames being read and written
2. First file descriptor
3. What the channel is blocked in

An additional question:
I'm not currently storing channel trace information in the snapshot and as a result it is not displayed. Is this a feature we still want to support? How widespread is it?
Executed the changed CLI commands, AMI actions, and AGI commands and ensured that the output is as expected.

Changes between revision 1 and 2

1 2 3 4
1 2 3 4

  1. /trunk/main/cli.c: Loading...
  2. /trunk/main/manager.c: Loading...
  3. /trunk/main/manager_bridging.c: Loading...
  4. /trunk/main/manager_channels.c: Loading...
/trunk/main/cli.c
Diff Revision 1 Diff Revision 2
This file contains only whitespace changes.
[20] 945 lines
[+20] [+] static char *handle_chanlist(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
946
				}
946
				}
947
			}
947
			}
948
			if (concise) {
948
			if (concise) {
949
				ast_cli(a->fd, CONCISE_FORMAT_STRING, cs->name, cs->context, cs->exten, cs->priority, ast_state2str(cs->state),
949
				ast_cli(a->fd, CONCISE_FORMAT_STRING, cs->name, cs->context, cs->exten, cs->priority, ast_state2str(cs->state),
950
					S_OR(cs->appl, "(None)"),
950
					S_OR(cs->appl, "(None)"),
951
					cs->data,	
951
					cs->data,
952
					cs->caller_number,
952
					cs->caller_number,
953
					cs->accountcode,
953
					cs->accountcode,
954
					cs->peeraccount,
954
					cs->peeraccount,
955
					cs->amaflags,
955
					cs->amaflags,
956
					durbuf,
956
					durbuf,
[+20] [20] 19 lines
[+20] static char *handle_chanlist(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
976
				ast_cli(a->fd, FORMAT_STRING, cs->name, locbuf, ast_state2str(cs->state), appdata);
976
				ast_cli(a->fd, FORMAT_STRING, cs->name, locbuf, ast_state2str(cs->state), appdata);
977
			}
977
			}
978
		}
978
		}
979
	}
979
	}
980
	ao2_iterator_destroy(&it_chans);
980
	ao2_iterator_destroy(&it_chans);
981
		
981

   
982
	if (!concise) {
982
	if (!concise) {
983
		numchans = ast_active_channels();
983
		numchans = ast_active_channels();
984
		ast_cli(a->fd, "%d active channel%s\n", numchans, ESS(numchans));
984
		ast_cli(a->fd, "%d active channel%s\n", numchans, ESS(numchans));
985
		if (option_maxcalls)
985
		if (option_maxcalls)
986
			ast_cli(a->fd, "%d of %d max active call%s (%5.2f%% of capacity)\n",
986
			ast_cli(a->fd, "%d of %d max active call%s (%5.2f%% of capacity)\n",
[+20] [20] 998 lines
[+20] [+] static char *is_prefix(const char *word, const char *token,
1985
 *     The search compares word by word taking care of regexps in e->cmda
1985
 *     The search compares word by word taking care of regexps in e->cmda
1986
 *     This function will return NULL when nothing is matched, or the ast_cli_entry that matched.
1986
 *     This function will return NULL when nothing is matched, or the ast_cli_entry that matched.
1987
 * \param cmds
1987
 * \param cmds
1988
 * \param match_type has 3 possible values:
1988
 * \param match_type has 3 possible values:
1989
 *      0       returns if the search key is equal or longer than the entry.
1989
 *      0       returns if the search key is equal or longer than the entry.
1990
 *		            note that trailing optional arguments are skipped.
1990
 *			    note that trailing optional arguments are skipped.
1991
 *      -1      true if the mismatch is on the last word XXX not true!
1991
 *      -1      true if the mismatch is on the last word XXX not true!
1992
 *      1       true only on complete, exact match.
1992
 *      1       true only on complete, exact match.
1993
 *
1993
 *
1994
 */
1994
 */
1995
static struct ast_cli_entry *find_cli(const char * const cmds[], int match_type)
1995
static struct ast_cli_entry *find_cli(const char * const cmds[], int match_type)
[+20] [20] 587 lines
/trunk/main/manager.c
Diff Revision 1 Diff Revision 2
 
/trunk/main/manager_bridging.c
Diff Revision 1 Diff Revision 2
 
/trunk/main/manager_channels.c
Diff Revision 1 Diff Revision 2
 
  1. /trunk/main/cli.c: Loading...
  2. /trunk/main/manager.c: Loading...
  3. /trunk/main/manager_bridging.c: Loading...
  4. /trunk/main/manager_channels.c: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.