mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 10:33:13 +00:00
Dialing an invalid extension causes incomplete hangup sequence.
Revision -r1489 of the libpri 1.4 branch 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 uses pri_hangup_fix_enable() to follow Q.931 Section 5.3.2 call hangup better if the version of libpri supports it. (issue #17104) Reported by: shawkris Tested by: rmudgett git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@262569 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1123,7 +1123,7 @@ static int pri_fixup_principle(struct sig_pri_pri *pri, int principle, q931_call
|
|||||||
|
|
||||||
return principle;
|
return principle;
|
||||||
}
|
}
|
||||||
ast_log(LOG_WARNING, "Call specified, but not found?\n");
|
ast_verb(3, "Call specified, but not found.\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3641,6 +3641,11 @@ static void *pri_dchannel(void *vpri)
|
|||||||
if (chanpos < 0) {
|
if (chanpos < 0) {
|
||||||
ast_log(LOG_WARNING, "Hangup requested on unconfigured channel %d/%d span %d\n",
|
ast_log(LOG_WARNING, "Hangup requested on unconfigured channel %d/%d span %d\n",
|
||||||
PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
|
PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
|
||||||
|
/*
|
||||||
|
* Continue hanging up the call even though
|
||||||
|
* it is on an unconfigured channel.
|
||||||
|
*/
|
||||||
|
pri_hangup(pri->pri, e->hangup.call, e->hangup.cause);
|
||||||
} else {
|
} else {
|
||||||
chanpos = pri_fixup_principle(pri, chanpos, e->hangup.call);
|
chanpos = pri_fixup_principle(pri, chanpos, e->hangup.call);
|
||||||
if (chanpos > -1) {
|
if (chanpos > -1) {
|
||||||
@@ -3685,10 +3690,18 @@ static void *pri_dchannel(void *vpri)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
/*
|
||||||
|
* Continue hanging up the call even though
|
||||||
|
* we do not have an owner.
|
||||||
|
*/
|
||||||
|
pri_hangup(pri->pri, pri->pvts[chanpos]->call, e->hangup.cause);
|
||||||
|
pri->pvts[chanpos]->call = NULL;
|
||||||
}
|
}
|
||||||
ast_verb(3, "Channel %d/%d, span %d got hangup, cause %d\n",
|
ast_verb(3, "Channel %d/%d, span %d got hangup, cause %d\n",
|
||||||
pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span, e->hangup.cause);
|
pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span, e->hangup.cause);
|
||||||
} else {
|
} else {
|
||||||
|
/* Continue hanging up the call. */
|
||||||
pri_hangup(pri->pri, pri->pvts[chanpos]->call, e->hangup.cause);
|
pri_hangup(pri->pri, pri->pvts[chanpos]->call, e->hangup.cause);
|
||||||
pri->pvts[chanpos]->call = NULL;
|
pri->pvts[chanpos]->call = NULL;
|
||||||
}
|
}
|
||||||
@@ -3718,8 +3731,11 @@ static void *pri_dchannel(void *vpri)
|
|||||||
|
|
||||||
sig_pri_unlock_private(pri->pvts[chanpos]);
|
sig_pri_unlock_private(pri->pvts[chanpos]);
|
||||||
} else {
|
} else {
|
||||||
ast_log(LOG_WARNING, "Hangup on bad channel %d/%d on span %d\n",
|
/*
|
||||||
PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
|
* Continue hanging up the call even though
|
||||||
|
* we do not remember it (if we ever did).
|
||||||
|
*/
|
||||||
|
pri_hangup(pri->pri, e->hangup.call, e->hangup.cause);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -3734,6 +3750,11 @@ static void *pri_dchannel(void *vpri)
|
|||||||
if (chanpos < 0) {
|
if (chanpos < 0) {
|
||||||
ast_log(LOG_WARNING, "Hangup REQ requested on unconfigured channel %d/%d span %d\n",
|
ast_log(LOG_WARNING, "Hangup REQ requested on unconfigured channel %d/%d span %d\n",
|
||||||
PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
|
PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
|
||||||
|
/*
|
||||||
|
* Continue hanging up the call even though
|
||||||
|
* it is on an unconfigured channel.
|
||||||
|
*/
|
||||||
|
pri_hangup(pri->pri, e->hangup.call, e->hangup.cause);
|
||||||
} else {
|
} else {
|
||||||
chanpos = pri_fixup_principle(pri, chanpos, e->hangup.call);
|
chanpos = pri_fixup_principle(pri, chanpos, e->hangup.call);
|
||||||
if (chanpos > -1) {
|
if (chanpos > -1) {
|
||||||
@@ -3791,6 +3812,10 @@ static void *pri_dchannel(void *vpri)
|
|||||||
ast_verb(3, "Channel %d/%d, span %d received AOC-E charging %d unit%s\n",
|
ast_verb(3, "Channel %d/%d, span %d received AOC-E charging %d unit%s\n",
|
||||||
pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span, (int)e->hangup.aoc_units, (e->hangup.aoc_units == 1) ? "" : "s");
|
pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span, (int)e->hangup.aoc_units, (e->hangup.aoc_units == 1) ? "" : "s");
|
||||||
} else {
|
} else {
|
||||||
|
/*
|
||||||
|
* Continue hanging up the call even though
|
||||||
|
* we do not have an owner.
|
||||||
|
*/
|
||||||
pri_hangup(pri->pri, pri->pvts[chanpos]->call, e->hangup.cause);
|
pri_hangup(pri->pri, pri->pvts[chanpos]->call, e->hangup.cause);
|
||||||
pri->pvts[chanpos]->call = NULL;
|
pri->pvts[chanpos]->call = NULL;
|
||||||
}
|
}
|
||||||
@@ -3817,7 +3842,11 @@ static void *pri_dchannel(void *vpri)
|
|||||||
|
|
||||||
sig_pri_unlock_private(pri->pvts[chanpos]);
|
sig_pri_unlock_private(pri->pvts[chanpos]);
|
||||||
} else {
|
} else {
|
||||||
ast_log(LOG_WARNING, "Hangup REQ on bad channel %d/%d on span %d\n", PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
|
/*
|
||||||
|
* Continue hanging up the call even though
|
||||||
|
* we do not remember it (if we ever did).
|
||||||
|
*/
|
||||||
|
pri_hangup(pri->pri, e->hangup.call, e->hangup.cause);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -3840,7 +3869,6 @@ static void *pri_dchannel(void *vpri)
|
|||||||
if (pri->pvts[chanpos]->owner) {
|
if (pri->pvts[chanpos]->owner) {
|
||||||
ast_verb(3, "Channel %d/%d, span %d got hangup ACK\n", PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
|
ast_verb(3, "Channel %d/%d, span %d got hangup ACK\n", PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SUPPORT_USERUSER
|
#ifdef SUPPORT_USERUSER
|
||||||
if (!ast_strlen_zero(e->hangup.useruserinfo)) {
|
if (!ast_strlen_zero(e->hangup.useruserinfo)) {
|
||||||
struct ast_channel *owner;
|
struct ast_channel *owner;
|
||||||
@@ -3854,7 +3882,6 @@ static void *pri_dchannel(void *vpri)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sig_pri_unlock_private(pri->pvts[chanpos]);
|
sig_pri_unlock_private(pri->pvts[chanpos]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4848,6 +4875,9 @@ int sig_pri_start_pri(struct sig_pri_pri *pri)
|
|||||||
#if defined(HAVE_PRI_CALL_REROUTING)
|
#if defined(HAVE_PRI_CALL_REROUTING)
|
||||||
pri_reroute_enable(pri->pri, 1);
|
pri_reroute_enable(pri->pri, 1);
|
||||||
#endif /* defined(HAVE_PRI_CALL_REROUTING) */
|
#endif /* defined(HAVE_PRI_CALL_REROUTING) */
|
||||||
|
#if defined(HAVE_PRI_HANGUP_FIX)
|
||||||
|
pri_hangup_fix_enable(pri->pri, 1);
|
||||||
|
#endif /* defined(HAVE_PRI_HANGUP_FIX) */
|
||||||
#if defined(HAVE_PRI_CCSS)
|
#if defined(HAVE_PRI_CCSS)
|
||||||
pri_cc_enable(pri->pri, 1);
|
pri_cc_enable(pri->pri, 1);
|
||||||
pri_cc_recall_mode(pri->pri, pri->cc_ptmp_recall_mode);
|
pri_cc_recall_mode(pri->pri, pri->cc_ptmp_recall_mode);
|
||||||
|
@@ -338,6 +338,7 @@ AST_EXT_LIB_SETUP([POPT], [popt], [popt])
|
|||||||
AST_EXT_LIB_SETUP([PORTAUDIO], [PortAudio], [portaudio])
|
AST_EXT_LIB_SETUP([PORTAUDIO], [PortAudio], [portaudio])
|
||||||
AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
|
AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
|
||||||
AST_EXT_LIB_SETUP_DEPENDENT([PRI_CCSS], [ISDN PRI call completion supplementary service], [PRI], [pri])
|
AST_EXT_LIB_SETUP_DEPENDENT([PRI_CCSS], [ISDN PRI call completion supplementary service], [PRI], [pri])
|
||||||
|
AST_EXT_LIB_SETUP_DEPENDENT([PRI_HANGUP_FIX], [ISDN PRI hangup fix], [PRI], [pri])
|
||||||
AST_EXT_LIB_SETUP_DEPENDENT([PRI_SUBADDR], [ISDN PRI subaddressing], [PRI], [pri])
|
AST_EXT_LIB_SETUP_DEPENDENT([PRI_SUBADDR], [ISDN PRI subaddressing], [PRI], [pri])
|
||||||
AST_EXT_LIB_SETUP_DEPENDENT([PRI_CALL_HOLD], [ISDN PRI call hold], [PRI], [pri])
|
AST_EXT_LIB_SETUP_DEPENDENT([PRI_CALL_HOLD], [ISDN PRI call hold], [PRI], [pri])
|
||||||
AST_EXT_LIB_SETUP_DEPENDENT([PRI_CALL_REROUTING], [ISDN PRI call rerouting and call deflection], [PRI], [pri])
|
AST_EXT_LIB_SETUP_DEPENDENT([PRI_CALL_REROUTING], [ISDN PRI call rerouting and call deflection], [PRI], [pri])
|
||||||
@@ -1556,6 +1557,7 @@ AST_EXT_LIB_CHECK([PORTAUDIO], [portaudio], [Pa_GetDeviceCount], [portaudio.h])
|
|||||||
|
|
||||||
AST_EXT_LIB_CHECK([PRI], [pri], [pri_connected_line_update], [libpri.h])
|
AST_EXT_LIB_CHECK([PRI], [pri], [pri_connected_line_update], [libpri.h])
|
||||||
AST_EXT_LIB_CHECK([PRI_CCSS], [pri], [pri_cc_enable], [libpri.h])
|
AST_EXT_LIB_CHECK([PRI_CCSS], [pri], [pri_cc_enable], [libpri.h])
|
||||||
|
AST_EXT_LIB_CHECK([PRI_HANGUP_FIX], [pri], [pri_hangup_fix_enable], [libpri.h])
|
||||||
AST_EXT_LIB_CHECK([PRI_SUBADDR], [pri], [pri_sr_set_called_subaddress], [libpri.h])
|
AST_EXT_LIB_CHECK([PRI_SUBADDR], [pri], [pri_sr_set_called_subaddress], [libpri.h])
|
||||||
AST_EXT_LIB_CHECK([PRI_CALL_HOLD], [pri], [pri_hold_enable], [libpri.h])
|
AST_EXT_LIB_CHECK([PRI_CALL_HOLD], [pri], [pri_hold_enable], [libpri.h])
|
||||||
AST_EXT_LIB_CHECK([PRI_CALL_REROUTING], [pri], [pri_reroute_enable], [libpri.h])
|
AST_EXT_LIB_CHECK([PRI_CALL_REROUTING], [pri], [pri_reroute_enable], [libpri.h])
|
||||||
|
@@ -522,6 +522,9 @@
|
|||||||
library. */
|
library. */
|
||||||
#undef HAVE_PRI_CCSS
|
#undef HAVE_PRI_CCSS
|
||||||
|
|
||||||
|
/* Define to 1 if you have the ISDN PRI hangup fix library. */
|
||||||
|
#undef HAVE_PRI_HANGUP_FIX
|
||||||
|
|
||||||
/* Define to 1 if you have the ISDN PRI set_inbanddisconnect library. */
|
/* Define to 1 if you have the ISDN PRI set_inbanddisconnect library. */
|
||||||
#undef HAVE_PRI_INBANDDISCONNECT
|
#undef HAVE_PRI_INBANDDISCONNECT
|
||||||
|
|
||||||
@@ -1023,9 +1026,6 @@
|
|||||||
/* Define to the version of this package. */
|
/* Define to the version of this package. */
|
||||||
#undef PACKAGE_VERSION
|
#undef PACKAGE_VERSION
|
||||||
|
|
||||||
/* Define to 1 if the C compiler supports function prototypes. */
|
|
||||||
#undef PROTOTYPES
|
|
||||||
|
|
||||||
/* Define to necessary symbol if this constant uses a non-standard name on
|
/* Define to necessary symbol if this constant uses a non-standard name on
|
||||||
your system. */
|
your system. */
|
||||||
#undef PTHREAD_CREATE_JOINABLE
|
#undef PTHREAD_CREATE_JOINABLE
|
||||||
@@ -1045,11 +1045,6 @@
|
|||||||
/* Define to the type of arg 5 for `select'. */
|
/* Define to the type of arg 5 for `select'. */
|
||||||
#undef SELECT_TYPE_ARG5
|
#undef SELECT_TYPE_ARG5
|
||||||
|
|
||||||
/* Define to 1 if the `setvbuf' function takes the buffering type as its
|
|
||||||
second argument and the buffer pointer as the third, as on System V before
|
|
||||||
release 3. */
|
|
||||||
#undef SETVBUF_REVERSED
|
|
||||||
|
|
||||||
/* The size of `char *', as computed by sizeof. */
|
/* The size of `char *', as computed by sizeof. */
|
||||||
#undef SIZEOF_CHAR_P
|
#undef SIZEOF_CHAR_P
|
||||||
|
|
||||||
@@ -1079,20 +1074,30 @@
|
|||||||
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
|
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
|
||||||
#undef TM_IN_SYS_TIME
|
#undef TM_IN_SYS_TIME
|
||||||
|
|
||||||
/* Define to 1 if on AIX 3.
|
/* Enable extensions on AIX 3, Interix. */
|
||||||
System headers sometimes define this.
|
|
||||||
We just want to avoid a redefinition error message. */
|
|
||||||
#ifndef _ALL_SOURCE
|
#ifndef _ALL_SOURCE
|
||||||
# undef _ALL_SOURCE
|
# undef _ALL_SOURCE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
|
||||||
#undef _FILE_OFFSET_BITS
|
|
||||||
|
|
||||||
/* Enable GNU extensions on systems that have them. */
|
/* Enable GNU extensions on systems that have them. */
|
||||||
#ifndef _GNU_SOURCE
|
#ifndef _GNU_SOURCE
|
||||||
# undef _GNU_SOURCE
|
# undef _GNU_SOURCE
|
||||||
#endif
|
#endif
|
||||||
|
/* Enable threading extensions on Solaris. */
|
||||||
|
#ifndef _POSIX_PTHREAD_SEMANTICS
|
||||||
|
# undef _POSIX_PTHREAD_SEMANTICS
|
||||||
|
#endif
|
||||||
|
/* Enable extensions on HP NonStop. */
|
||||||
|
#ifndef _TANDEM_SOURCE
|
||||||
|
# undef _TANDEM_SOURCE
|
||||||
|
#endif
|
||||||
|
/* Enable general extensions on Solaris. */
|
||||||
|
#ifndef __EXTENSIONS__
|
||||||
|
# undef __EXTENSIONS__
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||||
|
#undef _FILE_OFFSET_BITS
|
||||||
|
|
||||||
/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
|
/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
|
||||||
#undef _LARGEFILE_SOURCE
|
#undef _LARGEFILE_SOURCE
|
||||||
@@ -1110,20 +1115,6 @@
|
|||||||
/* Define to 1 if you need to in order for `stat' and other things to work. */
|
/* Define to 1 if you need to in order for `stat' and other things to work. */
|
||||||
#undef _POSIX_SOURCE
|
#undef _POSIX_SOURCE
|
||||||
|
|
||||||
/* Enable extensions on Solaris. */
|
|
||||||
#ifndef __EXTENSIONS__
|
|
||||||
# undef __EXTENSIONS__
|
|
||||||
#endif
|
|
||||||
#ifndef _POSIX_PTHREAD_SEMANTICS
|
|
||||||
# undef _POSIX_PTHREAD_SEMANTICS
|
|
||||||
#endif
|
|
||||||
#ifndef _TANDEM_SOURCE
|
|
||||||
# undef _TANDEM_SOURCE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define like PROTOTYPES; this can be used by system headers. */
|
|
||||||
#undef __PROTOTYPES
|
|
||||||
|
|
||||||
/* Define to empty if `const' does not conform to ANSI C. */
|
/* Define to empty if `const' does not conform to ANSI C. */
|
||||||
#undef const
|
#undef const
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user