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
This commit is contained in:
Richard Mudgett
2011-10-11 21:06:55 +00:00
parent b63c1cc545
commit 9abab10b66
3 changed files with 339 additions and 109 deletions

View File

@@ -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);
/* ------------------------------------------------------------------- */