[libpri-commits] rmudgett: branch group/ccss r1689 - /team/group/ccss/

SVN commits to the libpri project libpri-commits at lists.digium.com
Tue May 11 17:17:08 CDT 2010


Author: rmudgett
Date: Tue May 11 17:17:04 2010
New Revision: 1689

URL: http://svnview.digium.com/svn/libpri?view=rev&rev=1689
Log:
Merged revisions 1688 via svnmerge from 
https://origsvn.digium.com/svn/libpri/branches/1.4

........
  r1688 | rmudgett | 2010-05-11 17:14:15 -0500 (Tue, 11 May 2010) | 14 lines
  
  Dialing an invalid extension causes incomplete hangup sequence.
  
  Revision -r1489 corrected a deviation from Q.931 Section 5.3.2.  However,
  this resulted in an unexpected behaviour change to the upper layer
  (Asterisk).
  
  This change restores the legacy hangup behaviour if the new API call is
  not used.  Use pri_hangup_fix_enable() to follow Q.931 Section 5.3.2 call
  hangup better.
  
  (closes issue #17104)
  Reported by: shawkris
  Tested by: rmudgett
........

Modified:
    team/group/ccss/   (props changed)
    team/group/ccss/libpri.h
    team/group/ccss/pri.c
    team/group/ccss/pri_internal.h
    team/group/ccss/q931.c

Propchange: team/group/ccss/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue May 11 17:17:04 2010
@@ -1,1 +1,1 @@
-/branches/1.4:1-1675
+/branches/1.4:1-1688

Modified: team/group/ccss/libpri.h
URL: http://svnview.digium.com/svn/libpri/team/group/ccss/libpri.h?view=diff&rev=1689&r1=1688&r2=1689
==============================================================================
--- team/group/ccss/libpri.h (original)
+++ team/group/ccss/libpri.h Tue May 11 17:17:04 2010
@@ -1073,6 +1073,17 @@
 #define PRI_HANGUP
 int pri_hangup(struct pri *pri, q931_call *call, int cause);
 
+/*!
+ * \brief Set the call hangup fix enable flag.
+ *
+ * \param ctrl D channel controller.
+ * \param enable TRUE to follow Q.931 Section 5.3.2 call hangup better.
+ * FALSE for legacy behaviour. (Default FALSE if not called.)
+ *
+ * \return Nothing
+ */
+void pri_hangup_fix_enable(struct pri *ctrl, int enable);
+
 #define PRI_DESTROYCALL
 void pri_destroycall(struct pri *pri, q931_call *call);
 

Modified: team/group/ccss/pri.c
URL: http://svnview.digium.com/svn/libpri/team/group/ccss/pri.c?view=diff&rev=1689&r1=1688&r2=1689
==============================================================================
--- team/group/ccss/pri.c (original)
+++ team/group/ccss/pri.c Tue May 11 17:17:04 2010
@@ -1059,6 +1059,14 @@
 	}
 }
 
+void pri_hangup_fix_enable(struct pri *ctrl, int enable)
+{
+	if (ctrl) {
+		ctrl = PRI_MASTER(ctrl);
+		ctrl->hangup_fix_enabled = enable ? 1 : 0;
+	}
+}
+
 int pri_hangup(struct pri *pri, q931_call *call, int cause)
 {
 	if (!pri || !call)

Modified: team/group/ccss/pri_internal.h
URL: http://svnview.digium.com/svn/libpri/team/group/ccss/pri_internal.h?view=diff&rev=1689&r1=1688&r2=1689
==============================================================================
--- team/group/ccss/pri_internal.h (original)
+++ team/group/ccss/pri_internal.h Tue May 11 17:17:04 2010
@@ -104,6 +104,7 @@
 	unsigned int service_message_support:1;/* TRUE if upper layer supports SERVICE messages */
 	unsigned int hold_support:1;/* TRUE if upper layer supports call hold. */
 	unsigned int deflection_support:1;/* TRUE if upper layer supports call deflection/rerouting. */
+	unsigned int hangup_fix_enabled:1;/* TRUE if should follow Q.931 Section 5.3.2 instead of blindly sending RELEASE_COMPLETE for certain causes */
 	unsigned int cc_support:1;/* TRUE if upper layer supports call completion. */
 
 	/* MDL variables */

Modified: team/group/ccss/q931.c
URL: http://svnview.digium.com/svn/libpri/team/group/ccss/q931.c?view=diff&rev=1689&r1=1688&r2=1689
==============================================================================
--- team/group/ccss/q931.c (original)
+++ team/group/ccss/q931.c Tue May 11 17:17:04 2010
@@ -5687,6 +5687,12 @@
 	case PRI_CAUSE_REQUESTED_CHAN_UNAVAIL:
 	case PRI_CAUSE_IDENTIFIED_CHANNEL_NOTEXIST:
 	case PRI_CAUSE_UNALLOCATED:
+		if (!PRI_MASTER(ctrl)->hangup_fix_enabled) {
+			/* Legacy: We'll send RELEASE_COMPLETE with these causes */
+			disconnect = 0;
+			release_compl = 1;
+			break;
+		}
 		/* See Q.931 Section 5.3.2 a) */
 		switch (c->ourcallstate) {
 		case Q931_CALL_STATE_NULL:




More information about the libpri-commits mailing list