[asterisk-commits] rmudgett: trunk r358997 - in /trunk: channels/ configs/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Mar 13 16:18:42 CDT 2012
Author: rmudgett
Date: Tue Mar 13 16:18:31 2012
New Revision: 358997
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=358997
Log:
Add ability for chan_dahdi ISDN to block connected line updates per span.
Added new chan_dahdi.conf colp_send option parameter to block connected
line updates per span.
(issue ASTERISK-17025)
Reported by: Michael Smith
Modified:
trunk/channels/chan_dahdi.c
trunk/channels/sig_pri.c
trunk/channels/sig_pri.h
trunk/configs/chan_dahdi.conf.sample
Modified: trunk/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=358997&r1=358996&r2=358997
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Tue Mar 13 16:18:31 2012
@@ -1407,6 +1407,7 @@
.localprefix = "",
.privateprefix = "",
.unknownprefix = "",
+ .colp_send = SIG_PRI_COLP_UPDATE,
.resetinterval = -1,
},
#endif
@@ -12691,6 +12692,7 @@
#if defined(HAVE_PRI_L2_PERSISTENCE)
pris[span].pri.l2_persistence = conf->pri.pri.l2_persistence;
#endif /* defined(HAVE_PRI_L2_PERSISTENCE) */
+ pris[span].pri.colp_send = conf->pri.pri.colp_send;
#if defined(HAVE_PRI_AOC_EVENTS)
pris[span].pri.aoc_passthrough_flag = conf->pri.pri.aoc_passthrough_flag;
pris[span].pri.aoce_delayhangup = conf->pri.pri.aoce_delayhangup;
@@ -17975,6 +17977,16 @@
confp->pri.pri.l2_persistence = PRI_L2_PERSISTENCE_DEFAULT;
}
#endif /* defined(HAVE_PRI_L2_PERSISTENCE) */
+ } else if (!strcasecmp(v->name, "colp_send")) {
+ if (!strcasecmp(v->value, "block")) {
+ confp->pri.pri.colp_send = SIG_PRI_COLP_BLOCK;
+ } else if (!strcasecmp(v->value, "connect")) {
+ confp->pri.pri.colp_send = SIG_PRI_COLP_CONNECT;
+ } else if (!strcasecmp(v->value, "update")) {
+ confp->pri.pri.colp_send = SIG_PRI_COLP_UPDATE;
+ } else {
+ confp->pri.pri.colp_send = SIG_PRI_COLP_UPDATE;
+ }
#endif /* HAVE_PRI */
#if defined(HAVE_SS7)
} else if (!strcasecmp(v->name, "ss7type")) {
Modified: trunk/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/sig_pri.c?view=diff&rev=358997&r1=358996&r2=358997
==============================================================================
--- trunk/channels/sig_pri.c (original)
+++ trunk/channels/sig_pri.c Tue Mar 13 16:18:31 2012
@@ -8019,8 +8019,34 @@
struct pri_party_connected_line connected;
int dialplan;
int prefix_strip;
+ int colp_allowed = 0;
pri_grab(p, p->pri);
+
+ /* Check if a connected line update is allowed at this time. */
+ switch (p->pri->colp_send) {
+ case SIG_PRI_COLP_BLOCK:
+ break;
+ case SIG_PRI_COLP_CONNECT:
+ /*
+ * Outgoing calls receive CONNECT and act like an update before
+ * the call is connected.
+ */
+ if (p->call_level <= SIG_PRI_CALL_LEVEL_ALERTING && !p->outgoing) {
+ colp_allowed = 1;
+ }
+ break;
+ case SIG_PRI_COLP_UPDATE:
+ colp_allowed = 1;
+ break;
+ }
+ if (!colp_allowed) {
+ pri_rel(p->pri);
+ ast_debug(1, "Blocked AST_CONTROL_CONNECTED_LINE on %s\n",
+ ast_channel_name(chan));
+ break;
+ }
+
memset(&connected, 0, sizeof(connected));
sig_pri_party_id_from_ast(&connected.id, &ast_channel_connected(chan)->id);
Modified: trunk/channels/sig_pri.h
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/sig_pri.h?view=diff&rev=358997&r1=358996&r2=358997
==============================================================================
--- trunk/channels/sig_pri.h (original)
+++ trunk/channels/sig_pri.h Tue Mar 13 16:18:31 2012
@@ -391,6 +391,15 @@
};
#endif /* defined(HAVE_PRI_MWI) */
+enum sig_pri_colp_signaling {
+ /*! Block all connected line updates. */
+ SIG_PRI_COLP_BLOCK,
+ /*! Only send connected line information with the CONNECT message. */
+ SIG_PRI_COLP_CONNECT,
+ /*! Allow all connected line updates. */
+ SIG_PRI_COLP_UPDATE,
+};
+
struct sig_pri_span {
/* Should be set by user */
struct ast_cc_config_params *cc_params; /*!< CC config parameters for each new call. */
@@ -452,6 +461,8 @@
char privateprefix[20]; /*!< for private dialplans */
char unknownprefix[20]; /*!< for unknown dialplans */
enum sig_pri_moh_signaling moh_signaling;
+ /*! Send connected line signaling to peer option. */
+ enum sig_pri_colp_signaling colp_send;
long resetinterval; /*!< Interval (in seconds) for resetting unused channels */
#if defined(HAVE_PRI_DISPLAY_TEXT)
unsigned long display_flags_send; /*!< PRI_DISPLAY_OPTION_xxx flags for display text sending */
Modified: trunk/configs/chan_dahdi.conf.sample
URL: http://svnview.digium.com/svn/asterisk/trunk/configs/chan_dahdi.conf.sample?view=diff&rev=358997&r1=358996&r2=358997
==============================================================================
--- trunk/configs/chan_dahdi.conf.sample (original)
+++ trunk/configs/chan_dahdi.conf.sample Tue Mar 13 16:18:31 2012
@@ -248,6 +248,15 @@
; date/time IE send policy.
;
;datetime_send=
+
+; Send ISDN conected line information.
+;
+; block: Do not send any connected line information.
+; connect: Send connected line information on initial connect.
+; update: Same as connect but also send any updates during a call.
+; Updates happen if the call is transferred. (Default)
+;
+;colp_send=update
; Allow inband audio (progress) when a call is DISCONNECTed by the far end of a PRI
;
More information about the asterisk-commits
mailing list