[svn-commits] rmudgett: branch 1.4 r1688 - /branches/1.4/
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Tue May 11 17:14:19 CDT 2010
Author: rmudgett
Date: Tue May 11 17:14:15 2010
New Revision: 1688
URL: http://svnview.digium.com/svn/libpri?view=rev&rev=1688
Log:
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:
branches/1.4/libpri.h
branches/1.4/pri.c
branches/1.4/pri_internal.h
branches/1.4/q931.c
Modified: branches/1.4/libpri.h
URL: http://svnview.digium.com/svn/libpri/branches/1.4/libpri.h?view=diff&rev=1688&r1=1687&r2=1688
==============================================================================
--- branches/1.4/libpri.h (original)
+++ branches/1.4/libpri.h Tue May 11 17:14:15 2010
@@ -915,6 +915,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: branches/1.4/pri.c
URL: http://svnview.digium.com/svn/libpri/branches/1.4/pri.c?view=diff&rev=1688&r1=1687&r2=1688
==============================================================================
--- branches/1.4/pri.c (original)
+++ branches/1.4/pri.c Tue May 11 17:14:15 2010
@@ -965,6 +965,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: branches/1.4/pri_internal.h
URL: http://svnview.digium.com/svn/libpri/branches/1.4/pri_internal.h?view=diff&rev=1688&r1=1687&r2=1688
==============================================================================
--- branches/1.4/pri_internal.h (original)
+++ branches/1.4/pri_internal.h Tue May 11 17:14:15 2010
@@ -92,6 +92,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 */
/* MDL variables */
int mdl_error;
Modified: branches/1.4/q931.c
URL: http://svnview.digium.com/svn/libpri/branches/1.4/q931.c?view=diff&rev=1688&r1=1687&r2=1688
==============================================================================
--- branches/1.4/q931.c (original)
+++ branches/1.4/q931.c Tue May 11 17:14:15 2010
@@ -5397,6 +5397,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 svn-commits
mailing list