Skip to content
Snippets Groups Projects
Commit 9abab10b authored by Richard Mudgett's avatar Richard Mudgett
Browse files

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
parent b63c1cc5
Branches
Tags
No related merge requests found
......@@ -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);
}
......@@ -16508,6 +16510,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)
{
......@@ -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) */
......
This diff is collapsed.
......@@ -88,14 +88,38 @@ enum sig_ss7_law {
enum sig_ss7_call_level {
/*! Call does not exist. */
SIG_SS7_CALL_LEVEL_IDLE,
/*! Call is present but has no response yet. (SETUP) */
/*!
* Call is allocated to the channel.
* We have not sent or responded to IAM yet.
*/
SIG_SS7_CALL_LEVEL_ALLOCATED,
/*!
* Call is performing continuity check after receiving IAM.
* We are waiting for COT to proceed further.
*/
SIG_SS7_CALL_LEVEL_CONTINUITY,
/*!
* Call is present.
* We have not seen a response or sent further call progress to an IAM yet.
*/
SIG_SS7_CALL_LEVEL_SETUP,
/*! Call routing is happening. (PROCEEDING) */
/*!
* Call routing is happening.
* We have sent or received ACM.
*/
SIG_SS7_CALL_LEVEL_PROCEEDING,
/*! Called party is being alerted of the call. (ALERTING) */
/*!
* Called party is being alerted of the call.
* We have sent or received CPG(ALERTING)/ACM(ALERTING).
*/
SIG_SS7_CALL_LEVEL_ALERTING,
/*! Call is connected/answered. (CONNECT) */
/*!
* Call is connected/answered.
* We have sent or received CON/ANM.
*/
SIG_SS7_CALL_LEVEL_CONNECT,
/*! Call has collided with incoming call. */
SIG_SS7_CALL_LEVEL_GLARE,
};
struct sig_ss7_linkset;
......@@ -232,6 +256,7 @@ struct sig_ss7_linkset {
int linkstate[SIG_SS7_NUM_DCHANS];
int numchans;
int span; /*!< span number put into user output messages */
int debug; /*!< set to true if to dump SS7 event info */
enum {
LINKSET_STATE_DOWN = 0,
LINKSET_STATE_UP
......@@ -267,6 +292,9 @@ void sig_ss7_chan_delete(struct sig_ss7_chan *doomed);
struct sig_ss7_chan *sig_ss7_chan_new(void *pvt_data, struct sig_ss7_callback *callback, struct sig_ss7_linkset *ss7);
void sig_ss7_init_linkset(struct sig_ss7_linkset *ss7);
void sig_ss7_cli_show_channels_header(int fd);
void sig_ss7_cli_show_channels(int fd, struct sig_ss7_linkset *linkset);
/* ------------------------------------------------------------------- */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment