summaryrefslogtreecommitdiff
path: root/channels/chan_dahdi.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2011-10-11 21:06:55 +0000
committerRichard Mudgett <rmudgett@digium.com>2011-10-11 21:06:55 +0000
commit9abab10b664073c3ad759f02c5ade9d2f24c8260 (patch)
tree7f6b62286f0ea6e746ffed22032a911db1a5d497 /channels/chan_dahdi.c
parentb63c1cc5456fb9f0a28fc4d99c46075334102280 (diff)
Add protection for SS7 channel allocation and better glare handling.
* Added a CLI "ss7 show channels" command that might prove useful for future debugging. * Made the incoming SS7 channel event check and gripe message uniform. * Made sure that the DNID string for an incoming call is always initialized. (issue ASTERISK-17966) Reported by: Kenneth Van Velthoven Patches: jira_asterisk_17966_v1.8_glare.patch (license #5621) patch uploaded by rmudgett ........ Merged revisions 340365 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 340366 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@340367 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_dahdi.c')
-rw-r--r--channels/chan_dahdi.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 11a7bda8b..3cfdf0c79 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -16248,9 +16248,11 @@ static char *handle_ss7_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_a
ast_cli(a->fd, "No SS7 running on linkset %d\n", span);
} else {
if (!strcasecmp(a->argv[3], "on")) {
+ linksets[span - 1].ss7.debug = 1;
ss7_set_debug(linksets[span-1].ss7.ss7, SIG_SS7_DEBUG);
ast_cli(a->fd, "Enabled debugging on linkset %d\n", span);
} else {
+ linksets[span - 1].ss7.debug = 0;
ss7_set_debug(linksets[span-1].ss7.ss7, 0);
ast_cli(a->fd, "Disabled debugging on linkset %d\n", span);
}
@@ -16509,6 +16511,35 @@ static char *handle_ss7_show_linkset(struct ast_cli_entry *e, int cmd, struct as
#endif /* defined(HAVE_SS7) */
#if defined(HAVE_SS7)
+static char *handle_ss7_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+ int linkset;
+
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "ss7 show channels";
+ e->usage =
+ "Usage: ss7 show channels\n"
+ " Displays SS7 channel information at a glance.\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ }
+
+ if (a->argc != 3)
+ return CLI_SHOWUSAGE;
+
+ sig_ss7_cli_show_channels_header(a->fd);
+ for (linkset = 0; linkset < NUM_SPANS; ++linkset) {
+ if (linksets[linkset].ss7.ss7) {
+ sig_ss7_cli_show_channels(a->fd, &linksets[linkset].ss7);
+ }
+ }
+ return CLI_SUCCESS;
+}
+#endif /* defined(HAVE_SS7) */
+
+#if defined(HAVE_SS7)
static char *handle_ss7_version(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
switch (cmd) {
@@ -16536,6 +16567,7 @@ static struct ast_cli_entry dahdi_ss7_cli[] = {
AST_CLI_DEFINE(handle_ss7_block_linkset, "Blocks all CICs on a linkset"),
AST_CLI_DEFINE(handle_ss7_unblock_linkset, "Unblocks all CICs on a linkset"),
AST_CLI_DEFINE(handle_ss7_show_linkset, "Shows the status of a linkset"),
+ AST_CLI_DEFINE(handle_ss7_show_channels, "Displays SS7 channel information"),
AST_CLI_DEFINE(handle_ss7_version, "Displays libss7 version"),
};
#endif /* defined(HAVE_SS7) */