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
changes/97/197/1
Richard Mudgett 11 years ago
parent bd0aa4fb04
commit 0c896d8b9b

@ -20,6 +20,18 @@ AMI
res_manager_presence_state.so. If the high frequency of these events is
problematic for you, do not load these modules.
chan_dahdi
------------------
* SS7 support now requires libss7 v2.0 or later.
* 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.
------------------------------------------------------------------------------
--- Functionality changes from Asterisk 12.3.0 to Asterisk 12.4.0 ------------
------------------------------------------------------------------------------

@ -117,6 +117,9 @@ CDRs:
handler subroutine). In general, this is not the preferred default: this
causes extra CDRs to be generated for a channel in many common dialplans.
chan_dahdi:
- SS7 support now requires libss7 v2.0 or later.
chan_sip:
- Made set SIPREFERREDBYHDR as inheritable for better chan_pjsip
interoperability.

File diff suppressed because it is too large Load Diff

@ -389,19 +389,27 @@ struct dahdi_pvt {
unsigned int mwisendactive:1;
/*!
* \brief TRUE if channel is out of reset and ready
* \note Set but not used.
* \note Used by SS7. Otherwise set but not used.
*/
unsigned int inservice:1;
/*!
* \brief TRUE if the channel is locally blocked.
* \brief Bitmask for the channel being locally blocked.
* \note Applies to SS7 and MFCR2 channels.
* \note For MFCR2 only the first bit is used - TRUE if blocked
* \note For SS7 two bits are used
* \note Bit 0 - TRUE if maintenance blocked
* \note Bit 1 - TRUE if hardware blocked
*/
unsigned int locallyblocked:1;
unsigned int locallyblocked:2;
/*!
* \brief TRUE if the channel is remotely blocked.
* \brief Bitmask for the channel being remotely blocked. 1 maintenance, 2 blocked in hardware.
* \note Applies to SS7 and MFCR2 channels.
* \note For MFCR2 only the first bit is used - TRUE if blocked
* \note For SS7 two bits are used
* \note Bit 0 - TRUE if maintenance blocked
* \note Bit 1 - TRUE if hardware blocked
*/
unsigned int remotelyblocked:1;
unsigned int remotelyblocked:2;
/*!
* \brief TRUE if the channel alarms will be managed also as Span ones
* \note Applies to all channels

File diff suppressed because it is too large Load Diff

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

@ -1371,12 +1371,35 @@ pickupgroup=1
; This option is used to disable automatic sending of ACM when the call is started
; in the dialplan. If you do use this option, you will need to use the Proceeding()
; application in the dialplan to send ACM.
;ss7_explictacm=yes
; application in the dialplan to send ACM or enable ss7_autoacm below.
;ss7_explicitacm=yes
; Use this option to automatically send ACM when the call rings or is answered and
; has not seen proceeding yet. If you use this option, you should disable ss7_explicitacm.
; You may still use Proceeding() to explicitly send an ACM from the dialplan.
;ss7_autoacm=yes
; Create the linkset with all CICs in hardware remotely blocked state.
;ss7_initialhwblo=yes
; This option is whether or not to trust the remote echo control indication. This means
; that in cases where echo control is reported by the remote end, we will trust them and
; not enable echo cancellation on the call.
;ss7_use_echocontrol=yes
; This option is to set what our echo control indication is to the other end. Set to
; yes to indicate that we are using echo cancellation or no if we are not.
;ss7_default_echocontrol=yes
; All settings apply to linkset 1
;linkset = 1
; Set the Signaling Link Code (SLC) for each sigchan.
; If you manually set any you need to manually set all.
; Should be defined before sigchan.
; The default SLC starts with zero and increases for each defined sigchan.
;slc=
; Point code of the linkset. For ITU, this is the decimal number
; format of the point code. For ANSI, this can either be in decimal
; number format or in the xxx-xxx-xxx format
@ -1410,6 +1433,30 @@ pickupgroup=1
; Channels to associate with CICs on this linkset
;channel = 25-47
;
; Set this option if you wish to send an Information Request Message (INR) request
; if no calling party number is specified. This will attempt to tell the other end
; to send it anyways. Should be defined after sigchan.
;inr_if_no_calling=yes
; Set this to set whether or not the originating access is (non) ISDN in the forward and
; backward call indicators. Should be defined after sigchan
;non_isdn_access=yes
; This sets the number of binary places to shift the CIC when doing load balancing between
; sigchans on a linkset. Should be defined after sigchan. Default 0
;sls_shift = 0
; Send custom cause_location value
; Should be defined after sigchan. Default 1 (private local)
;cause_location=1
; SS7 timers (ISUP and MTP3) should be explicitly defined for each linkset to be used.
; For a full list of supported timers and their default values (applicable for both ITU
; and ANSI) see ss7.timers
; Should be defined after sigchan
;#include ss7.timers
; For more information on setting up SS7, see the README file in libss7 or
; https://wiki.asterisk.org/wiki/display/AST/Signaling+System+Number+7
; ----------------- SS7 Options ----------------------------------------

@ -0,0 +1,65 @@
;;;;; ITU-T Q.707 timers
;mtp3_timer.q707_t1 = 4000
;mtp3_timer.q707_t2 = 30000
;;;;; MTP3 timers as specified in ITU-T Q.704 or ANSI T1.111-2001
mtp3_timer.t1 = 500
mtp3_timer.t2 = 700
mtp3_timer.t3 = 500
mtp3_timer.t4 = 500
mtp3_timer.t5 = 500
mtp3_timer.t6 = 500
mtp3_timer.t7 = 1000
mtp3_timer.t10 = 60000
mtp3_timer.t12 = 800
mtp3_timer.t13 = 800
mtp3_timer.t14 = 2000
; enable for ITU only. Timers after T17 are defined differently for ANSI
;mtp3_timer.t19 = 67000
;mtp3_timer.t21 = 63000
;
;mtp3_timer.t22 = 300000
;mtp3_timer.t23 = 300000
;;;;; ISUP timers as specified in ITU-T Q.764 or ANSI T1.113-2000
isup_timer.t1 = 15000
;isup_timer.t2 = 180000 ; ITU only
;isup_timer.t5 = 300000 ; for ITU
;isup_timer.t5 = 60000 ; for ANSI
isup_timer.t6 = 30000
isup_timer.t7 = 20000
isup_timer.t8 = 10000
;isup_timer.t10 = 4000 ; ITU only
isup_timer.t12 = 15000
;isup_timer.t13 = 300000 ; for ITU
;isup_timer.t13 = 60000 ; for ANSI
isup_timer.t14 = 15000
;isup_timer.t15 = 300000 ; for ITU
;isup_timer.t15 = 60000 ; for ANSI
isup_timer.t16 = 15000
;isup_timer.t17 = 300000 ; for ITU
;isup_timer.t17 = 60000 ; for ANSI
isup_timer.t18 = 15000
;isup_timer.t19 = 300000 ; for ITU
;isup_timer.t19 = 60000 ; for ANSI
isup_timer.t20 = 15000
;isup_timer.t21 = 300000 ; for ITU
;isup_timer.t21 = 60000 ; for ANSI
isup_timer.t22 = 15000
;isup_timer.t23 = 300000 ; for ITU
;isup_timer.t23 = 60000 ; for ANSI
isup_timer.t27 = 240000
isup_timer.t33 = 12000
;isup_timer.t35 = 15000 ; ITU only

6
configure vendored

@ -1,5 +1,5 @@
#! /bin/sh
# From configure.ac Revision: 412977 .
# From configure.ac Revision: 413772 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for asterisk trunk.
#
@ -26664,7 +26664,7 @@ fi
fi
# Check for libss7 v1.0 branch compatible version.
# Check for libss7 v2.0 branch compatible version.
if test "x${PBX_SS7}" != "x1" -a "${USE_SS7}" != "no"; then
pbxlibdir=""
@ -26676,7 +26676,7 @@ if test "x${PBX_SS7}" != "x1" -a "${USE_SS7}" != "no"; then
pbxlibdir="-L${SS7_DIR}"
fi
fi
pbxfuncname="ss7_set_adjpc"
pbxfuncname="ss7_set_isup_timer"
if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
AST_SS7_FOUND=yes
else

@ -2096,8 +2096,8 @@ if test "x${PBX_SPANDSP}" = "x1" ; then
AST_EXT_LIB_CHECK([SPANDSP], [spandsp], [t38_terminal_init], [spandsp.h], [-ltiff])
fi
# Check for libss7 v1.0 branch compatible version.
AST_EXT_LIB_CHECK([SS7], [ss7], [ss7_set_adjpc], [libss7.h])
# Check for libss7 v2.0 branch compatible version.
AST_EXT_LIB_CHECK([SS7], [ss7], [ss7_set_isup_timer], [libss7.h])
AST_EXT_LIB_CHECK([OPENR2], [openr2], [openr2_chan_new], [openr2.h])

Loading…
Cancel
Save