Add protection for SS7 channel allocation and better glare handling.
[asterisk/asterisk.git] / channels / sig_ss7.h
index 73839b1..14a9980 100644 (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);
+
 
 /* ------------------------------------------------------------------- */