[asterisk-commits] rmudgett: branch rmudgett/call_waiting r251778 - in /team/rmudgett/call_waiti...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 10 19:18:08 CST 2010


Author: rmudgett
Date: Wed Mar 10 19:18:04 2010
New Revision: 251778

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=251778
Log:
Added allow_call_waiting_calls ISDN option to chan_dahdi for incoming calls.

Also added CHANNEL(no_media_path) to indicate if the call has a B channel
or not.

Modified:
    team/rmudgett/call_waiting/CHANGES
    team/rmudgett/call_waiting/channels/chan_dahdi.c
    team/rmudgett/call_waiting/channels/sig_pri.c
    team/rmudgett/call_waiting/channels/sig_pri.h
    team/rmudgett/call_waiting/configs/chan_dahdi.conf.sample

Modified: team/rmudgett/call_waiting/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/call_waiting/CHANGES?view=diff&rev=251778&r1=251777&r2=251778
==============================================================================
--- team/rmudgett/call_waiting/CHANGES (original)
+++ team/rmudgett/call_waiting/CHANGES Wed Mar 10 19:18:04 2010
@@ -198,6 +198,11 @@
    prefixing the name of the hash at assignment with the appropriate number of
    underscores, just like variables.
  * GROUP_MATCH_COUNT has been improved to allow regex matching on category
+ * For DAHDI/ISDN channels, the CHANNEL() dialplan function now supports the
+   "no_media_path" option.
+   Returns "0" if there is a B channel associated with the call.
+   Returns "1" if no B channel is associated with the call.  The call is either
+   on hold or is a call waiting call.
 
 Dialplan Variables
 ------------------
@@ -323,6 +328,8 @@
    dialing option.  Dial(DAHDI/g1/[extension]/K(<keypad_digits>))
    Access any received keypad digits in SETUP message by: ${CHANNEL(keypad_digits)}
    (requires latest LibPRI)
+ * Added the ability to support call waiting calls.  (The SETUP has no B channel
+   assigned.)
 
 Asterisk Manager Interface
 --------------------------

Modified: team/rmudgett/call_waiting/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/call_waiting/channels/chan_dahdi.c?view=diff&rev=251778&r1=251777&r2=251778
==============================================================================
--- team/rmudgett/call_waiting/channels/chan_dahdi.c (original)
+++ team/rmudgett/call_waiting/channels/chan_dahdi.c Wed Mar 10 19:18:04 2010
@@ -6457,6 +6457,22 @@
 		}
 		ast_mutex_unlock(&p->lock);
 #endif	/* defined(HAVE_PRI_SETUP_KEYPAD) */
+	} else if (!strcasecmp(data, "no_media_path")) {
+		ast_mutex_lock(&p->lock);
+		switch (p->sig) {
+		case SIG_PRI_LIB_HANDLE_CASES:
+			/*
+			 * TRUE if the call is on hold or is call waiting because
+			 * there is no media path available.
+			 */
+			snprintf(buf, len, "%d", ((struct sig_pri_chan *) p->sig_pvt)->no_b_channel);
+			break;
+		default:
+			*buf = '\0';
+			res = -1;
+			break;
+		}
+		ast_mutex_unlock(&p->lock);
 #endif	/* defined(HAVE_PRI) */
 	} else {
 		*buf = '\0';
@@ -11714,6 +11730,8 @@
 #if defined(HAVE_PRI_CALL_WAITING)
 						pris[span].pri.max_call_waiting_calls =
 							conf->pri.pri.max_call_waiting_calls;
+						pris[span].pri.allow_call_waiting_calls =
+							conf->pri.pri.allow_call_waiting_calls;
 #endif	/* defined(HAVE_PRI_CALL_WAITING) */
 						pris[span].pri.facilityenable = conf->pri.pri.facilityenable;
 						ast_copy_string(pris[span].pri.msn_list, conf->pri.pri.msn_list, sizeof(pris[span].pri.msn_list));
@@ -17226,6 +17244,8 @@
 					/* Negative values are not allowed. */
 					confp->pri.pri.max_call_waiting_calls = 0;
 				}
+			} else if (!strcasecmp(v->name, "allow_call_waiting_calls")) {
+				confp->pri.pri.allow_call_waiting_calls = ast_true(v->value);
 #endif	/* defined(HAVE_PRI_CALL_WAITING) */
 #endif /* HAVE_PRI */
 #ifdef HAVE_SS7

Modified: team/rmudgett/call_waiting/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/call_waiting/channels/sig_pri.c?view=diff&rev=251778&r1=251777&r2=251778
==============================================================================
--- team/rmudgett/call_waiting/channels/sig_pri.c (original)
+++ team/rmudgett/call_waiting/channels/sig_pri.c Wed Mar 10 19:18:04 2010
@@ -3104,6 +3104,14 @@
 				} else if (PRI_CHANNEL(e->ring.channel) == 0x00) {
 					/* No channel specified. */
 #if defined(HAVE_PRI_CALL_WAITING)
+					if (!pri->allow_call_waiting_calls)
+#endif	/* defined(HAVE_PRI_CALL_WAITING) */
+					{
+						/* We will not accept incoming call waiting calls. */
+						pri_hangup(pri->pri, e->ring.call, PRI_CAUSE_INCOMPATIBLE_DESTINATION);
+						break;
+					}
+#if defined(HAVE_PRI_CALL_WAITING)
 					chanpos = pri_find_empty_nobch(pri);
 					if (chanpos < 0) {
 						/* We could not find/create a call interface. */
@@ -3112,10 +3120,6 @@
 					}
 					/* Setup the call interface to use. */
 					sig_pri_init_config(pri->pvts[chanpos], pri);
-#else
-					/* We will not accept incoming call waiting calls. */
-					pri_hangup(pri->pri, e->ring.call, PRI_CAUSE_INCOMPATIBLE_DESTINATION);
-					break;
 #endif	/* defined(HAVE_PRI_CALL_WAITING) */
 				} else {
 					/* A channel is specified. */

Modified: team/rmudgett/call_waiting/channels/sig_pri.h
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/call_waiting/channels/sig_pri.h?view=diff&rev=251778&r1=251777&r2=251778
==============================================================================
--- team/rmudgett/call_waiting/channels/sig_pri.h (original)
+++ team/rmudgett/call_waiting/channels/sig_pri.h Wed Mar 10 19:18:04 2010
@@ -265,6 +265,10 @@
 	/*! \brief TRUE if held calls are transferred on disconnect. */
 	unsigned int hold_disconnect_transfer:1;
 #endif	/* defined(HAVE_PRI_CALL_HOLD) */
+#if defined(HAVE_PRI_CALL_WAITING)
+	/*! \brief TRUE if we will allow incoming ISDN call waiting calls. */
+	unsigned int allow_call_waiting_calls:1;
+#endif	/* defined(HAVE_PRI_CALL_WAITING) */
 	int dialplan;							/*!< Dialing plan */
 	int localdialplan;						/*!< Local dialing plan */
 	char internationalprefix[10];			/*!< country access code ('00' for european dialplans) */

Modified: team/rmudgett/call_waiting/configs/chan_dahdi.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/call_waiting/configs/chan_dahdi.conf.sample?view=diff&rev=251778&r1=251777&r2=251778
==============================================================================
--- team/rmudgett/call_waiting/configs/chan_dahdi.conf.sample (original)
+++ team/rmudgett/call_waiting/configs/chan_dahdi.conf.sample Wed Mar 10 19:18:04 2010
@@ -500,8 +500,13 @@
 ; Configure the number of outstanding call waiting calls for internal ISDN
 ; endpoints before bouncing the calls as busy.  This option is equivalent to
 ; the callwaiting option for analog ports.
+; A call waiting call is a SETUP message with no B channel selected.
 ; The default is zero to disable call waiting for ISDN endpoints.
 ;max_call_waiting_calls=0
+;
+; Allow incoming ISDN call waiting calls.
+; A call waiting call is a SETUP message with no B channel selected.
+;allow_call_waiting_calls=no
 ;
 ; Whether or not restrict outgoing caller ID (will be sent as ANI only, not
 ; available for the user)




More information about the asterisk-commits mailing list