summaryrefslogtreecommitdiff
path: root/channels/sig_ss7.h
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2014-06-16 18:27:51 +0000
committerRichard Mudgett <rmudgett@digium.com>2014-06-16 18:27:51 +0000
commit0c896d8b9b12e0eaacbe1b9d17060c59e6093d1d (patch)
treee00c8b6f34087a4243773a17d53e6193a069a3d4 /channels/sig_ss7.h
parentbd0aa4fb04afe0d91b5fac2fc697fafd644cc907 (diff)
chan_dahdi: Adds support for major update to libss7.
* SS7 support now requires libss7 v2.0 or later. The new libss7 is not backwards compatible. * Added SS7 support for connected line and redirecting. * Most SS7 CLI commands are reworked as well as new SS7 commands added. See online CLI help. * Added several SS7 config option parameters described in chan_dahdi.conf.sample. * ISUP timer support reworked and now requires explicit configuration. See ss7.timers.sample. Special thanks to Kaloyan Kovachev for his support and persistence in getting the original patch by adomjan updated and ready for release. SS7-27 #close Reported by: adomjan git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/sig_ss7.h')
-rw-r--r--channels/sig_ss7.h100
1 files changed, 88 insertions, 12 deletions
diff --git a/channels/sig_ss7.h b/channels/sig_ss7.h
index 56d393c81..e2bc8e436 100644
--- a/channels/sig_ss7.h
+++ b/channels/sig_ss7.h
@@ -66,6 +66,13 @@ extern "C" {
#define SS7_NAI_DYNAMIC -1
#define LINKSET_FLAG_EXPLICITACM (1 << 0)
+#define LINKSET_FLAG_INITIALHWBLO (1 << 1)
+#define LINKSET_FLAG_USEECHOCONTROL (1 << 2)
+#define LINKSET_FLAG_DEFAULTECHOCONTROL (1 << 3)
+#define LINKSET_FLAG_AUTOACM (1 << 4)
+
+#define SS7_BLOCKED_MAINTENANCE (1 << 0)
+#define SS7_BLOCKED_HARDWARE (1 << 1)
enum sig_ss7_tone {
@@ -84,6 +91,27 @@ enum sig_ss7_law {
SIG_SS7_ALAW
};
+enum sig_ss7_redirect_idication {
+ SS7_INDICATION_NO_REDIRECTION = 0,
+ SS7_INDICATION_REROUTED_PRES_ALLOWED,
+ SS7_INDICATION_REROUTED_INFO_RESTRICTED,
+ SS7_INDICATION_DIVERTED_PRES_ALLOWED,
+ SS7_INDICATION_DIVERTED_INFO_RESTRICTED,
+ SS7_INDICATION_REROUTED_PRES_RESTRICTED,
+ SS7_INDICATION_DIVERTED_PRES_RESTRICTED,
+ SS7_INDICATION_SPARE
+};
+
+enum sig_ss7_redirect_reason {
+ SS7_REDIRECTING_REASON_UNKNOWN = 0,
+ SS7_REDIRECTING_REASON_USER_BUSY,
+ SS7_REDIRECTING_REASON_NO_ANSWER,
+ SS7_REDIRECTING_REASON_UNCONDITIONAL,
+ SS7_REDIRECTING_REASON_DEFLECTION_DURING_ALERTING,
+ SS7_REDIRECTING_REASON_DEFLECTION_IMMEDIATE_RESPONSE,
+ SS7_REDIRECTING_REASON_UNAVAILABLE
+};
+
/*! Call establishment life cycle level for simple comparisons. */
enum sig_ss7_call_level {
/*! Call does not exist. */
@@ -118,8 +146,6 @@ enum sig_ss7_call_level {
* 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;
@@ -153,6 +179,8 @@ struct sig_ss7_callback {
void (* const queue_control)(void *pvt, int subclass);
void (* const open_media)(void *pvt);
+
+ struct sig_ss7_linkset *(* const find_linkset)(struct ss7 *ss7);
};
/*! Global sig_ss7 callbacks to the upper layer. */
@@ -192,10 +220,19 @@ struct sig_ss7_chan {
unsigned int use_callingpres:1;
unsigned int immediate:1; /*!< Answer before getting digits? */
- /*! \brief TRUE if the channel is locally blocked. Set by user and link. */
- unsigned int locallyblocked:1;
- /*! \brief TRUE if the channel is remotely blocked. Set by user and link. */
- unsigned int remotelyblocked:1;
+ /*!
+ * \brief Bitmask for the channel being locally blocked.
+ * \note 1 maintenance blocked, 2 blocked in hardware.
+ * \note Set by user and link.
+ */
+ unsigned int locallyblocked:2;
+
+ /*!
+ * \brief Bitmask for the channel being remotely blocked.
+ * \note 1 maintenance blocked, 2 blocked in hardware.
+ * \note Set by user and link.
+ */
+ unsigned int remotelyblocked:2;
char context[AST_MAX_CONTEXT];
char mohinterpret[MAX_MUSICCLASS];
@@ -215,7 +252,15 @@ struct sig_ss7_chan {
char gen_add_number[50];
char gen_dig_number[50];
char orig_called_num[50];
+ int orig_called_presentation;
char redirecting_num[50];
+ int redirecting_presentation;
+ unsigned char redirect_counter;
+ unsigned char redirect_info;
+ unsigned char redirect_info_ind;
+ unsigned char redirect_info_orig_reas;
+ unsigned char redirect_info_counter;
+ unsigned char redirect_info_reas;
char generic_name[50];
unsigned char gen_add_num_plan;
unsigned char gen_add_nai;
@@ -233,22 +278,41 @@ struct sig_ss7_chan {
unsigned int call_ref_ident;
unsigned int call_ref_pc;
unsigned char calling_party_cat;
+ unsigned int do_hangup; /* What we have to do to clear the call */
+ unsigned int echocontrol_ind;
/*
* Channel status bits.
*/
- /*! TRUE if channel is associated with a link that is down. */
+ /*! \brief TRUE if channel is associated with a link that is down. */
unsigned int inalarm:1;
- /*! TRUE if this channel is being used for an outgoing call. */
+ /*! \brief TRUE if channel is in service. */
+ unsigned int inservice:1;
+ /*! \brief TRUE if this channel is being used for an outgoing call. */
unsigned int outgoing:1;
+ /*! \brief TRUE if the channel has completed collecting digits. */
+ unsigned int called_complete:1;
/*! \brief TRUE if the call has seen inband-information progress through the network. */
unsigned int progress:1;
- /*! \brief TRUE if the call has already gone/hungup */
- unsigned int alreadyhungup:1;
/*! \brief XXX BOOLEAN Purpose??? */
unsigned int rlt:1;
- /*! TRUE if this channel is in loopback. */
+ /*! \brief TRUE if this channel is in loopback. */
unsigned int loopedback:1;
+
+ /*
+ * Closed User Group fields Q.735.1
+ */
+ /*! \brief Network Identify Code as per Q.763 3.15.a */
+ char cug_interlock_ni[5];
+ /*! \brief Binari Code to uniquely identify a CUG inside the network. */
+ unsigned short cug_interlock_code;
+ /*!
+ * \brief Indication of the call being a CUG call and its permissions.
+ * \note 0 or 1 - non-CUG call
+ * \note 2 - CUG call, outgoing access alowed
+ * \note 3 - CUG call, outgoing access not alowed
+ */
+ unsigned char cug_indicator;
};
struct sig_ss7_linkset {
@@ -276,6 +340,7 @@ struct sig_ss7_linkset {
char nationalprefix[10]; /*!< area access code ('0' for european dialplans) */
char subscriberprefix[20]; /*!< area access code + area code ('0'+area code for european dialplans) */
char unknownprefix[20]; /*!< for unknown dialplans */
+ char networkroutedprefix[20];
};
void sig_ss7_set_alarm(struct sig_ss7_chan *p, int in_alarm);
@@ -284,12 +349,19 @@ void *ss7_linkset(void *data);
void sig_ss7_link_alarm(struct sig_ss7_linkset *linkset, int which);
void sig_ss7_link_noalarm(struct sig_ss7_linkset *linkset, int which);
-int sig_ss7_add_sigchan(struct sig_ss7_linkset *linkset, int which, int ss7type, int transport, int inalarm, int networkindicator, int pointcode, int adjpointcode);
+int sig_ss7_add_sigchan(struct sig_ss7_linkset *linkset, int which, int ss7type, int transport, int inalarm, int networkindicator, int pointcode, int adjpointcode, int cur_slc);
+
+int sig_ss7_reset_cic(struct sig_ss7_linkset *linkset, int cic, unsigned int dpc);
+int sig_ss7_reset_group(struct sig_ss7_linkset *linkset, int cic, unsigned int dpc, int range);
+int sig_ss7_cic_blocking(struct sig_ss7_linkset *linkset, int do_block, int cic);
+int sig_ss7_group_blocking(struct sig_ss7_linkset *linkset, int do_block, int startcic, int endcic, unsigned char state[], int type);
int sig_ss7_available(struct sig_ss7_chan *p);
int sig_ss7_call(struct sig_ss7_chan *p, struct ast_channel *ast, const char *rdest);
int sig_ss7_hangup(struct sig_ss7_chan *p, struct ast_channel *ast);
int sig_ss7_answer(struct sig_ss7_chan *p, struct ast_channel *ast);
+int sig_ss7_find_cic(struct sig_ss7_linkset *linkset, int cic, unsigned int dpc);
+int sig_ss7_find_cic_range(struct sig_ss7_linkset *linkset, int startcic, int endcic, unsigned int dpc);
void sig_ss7_fixup(struct ast_channel *oldchan, struct ast_channel *newchan, struct sig_ss7_chan *pchan);
int sig_ss7_indicate(struct sig_ss7_chan *p, struct ast_channel *chan, int condition, const void *data, size_t datalen);
struct ast_channel *sig_ss7_request(struct sig_ss7_chan *p, enum sig_ss7_law law,
@@ -298,10 +370,14 @@ struct ast_channel *sig_ss7_request(struct sig_ss7_chan *p, enum sig_ss7_law law
void sig_ss7_chan_delete(struct sig_ss7_chan *doomed);
struct sig_ss7_chan *sig_ss7_chan_new(void *pvt_data, struct sig_ss7_linkset *ss7);
void sig_ss7_init_linkset(struct sig_ss7_linkset *ss7);
+void sig_ss7_free_isup_call(struct sig_ss7_linkset *linkset, int channel);
void sig_ss7_cli_show_channels_header(int fd);
void sig_ss7_cli_show_channels(int fd, struct sig_ss7_linkset *linkset);
+int sig_ss7_cb_hangup(struct ss7 *ss7, int cic, unsigned int dpc, int cause, int do_hangup);
+void sig_ss7_cb_call_null(struct ss7 *ss7, struct isup_call *c, int lock);
+void sig_ss7_cb_notinservice(struct ss7 *ss7, int cic, unsigned int dpc);
/* ------------------------------------------------------------------- */