[asterisk-bugs] [Asterisk 0013645]: chan_iax2 isn't using HANGUP anymore?
Asterisk Bug Tracker
noreply at bugs.digium.com
Thu Oct 30 07:54:20 CDT 2008
A NOTE has been added to this issue.
======================================================================
http://bugs.digium.com/view.php?id=13645
======================================================================
Reported By: dzajro
Assigned To:
======================================================================
Project: Asterisk
Issue ID: 13645
Category: Channels/chan_iax2
Reproducibility: always
Severity: major
Priority: normal
Status: acknowledged
Asterisk Version: 1.4.22
SVN Branch (only for SVN checkouts, not tarball releases): N/A
SVN Revision (number only!):
Disclaimer on File?: N/A
Request Review:
======================================================================
Date Submitted: 2008-10-07 17:27 CDT
Last Modified: 2008-10-30 07:54 CDT
======================================================================
Summary: chan_iax2 isn't using HANGUP anymore?
Description:
After upgrading to 1.4.22 problem with call disconnection appeared.
Scenario:
IP_PHONE <---sip---> ASTERISK_1 <----iax2----> ASTERISK_2 <---zap--->
PSTN
Call from IP_PHONE to PSTN to non_existing number (unassigned/unallocated
number, release cause 1) is no longer cleared immediately, but only after
approx. 10s.
iax2 debug shows, that there is no HANGUP message sent by ASTERISK_2.
Side effect - there is impossible to discover HANGUPCAUSE on ASTERISK_1,
cause HANGUPCAUSE is transmitted in HANGUP message :-(.
In fact, it looks, that there is HANGUP missing in case call was answered,
too.
I'm pretty sure, in 1.4.21.2 it worked. But I have no chance to rolback to
1.4.21.2 right now :(
======================================================================
----------------------------------------------------------------------
(0094409) vazir (reporter) - 2008-10-30 07:54
http://bugs.digium.com/view.php?id=13645#c94409
----------------------------------------------------------------------
Ok, I've found a buggy place, and patch is below. Actually just a few
checks are reverted back, which allowes to send a causecode again...
--- chan_iax2.c 2008-10-30 21:05:15.000000000 +0500
+++ chan_iax2.c-orig 2008-09-02 23:14:57.000000000 +0500
@@ -3417,17 +3417,14 @@
{
unsigned short callno = PTR_TO_CALLNO(c->tech_pvt);
struct iax_ie_data ied;
- int alreadygone;
memset(&ied, 0, sizeof(ied));
ast_mutex_lock(&iaxsl[callno]);
if (callno && iaxs[callno]) {
if (option_debug)
ast_log(LOG_DEBUG, "We're hanging up %s now...\n",
c->name);
- alreadygone = ast_test_flag(iaxs[callno],
IAX_ALREADYGONE);
/* Send the hangup unless we have had a transmission error
or are already gone */
iax_ie_append_byte(&ied, IAX_IE_CAUSECODE, (unsigned
char)c->hangupcause);
- if (!iaxs[callno]->error && !alreadygone) {
-// if (!iaxs[callno]->error && !ast_test_flag(iaxs[callno],
IAX_ALREADYGONE)) {
+ if (!iaxs[callno]->error && !ast_test_flag(iaxs[callno],
IAX_ALREADYGONE)) {
send_command_final(iaxs[callno], AST_FRAME_IAX,
IAX_COMMAND_HANGUP, 0, ied.buf, ied.pos, -1);
if (!iaxs[callno]) {
ast_mutex_unlock(&iaxsl[callno]);
@@ -3437,8 +3434,7 @@
/* Explicitly predestroy it */
iax2_predestroy(callno);
/* If we were already gone to begin with, destroy us now
*/
- if (alreadygone && iaxs[callno]) {
-// if (iaxs[callno]) {
+ if (iaxs[callno]) {
if (option_debug)
ast_log(LOG_DEBUG, "Really destroying %s
now...\n", c->name);
iax2_destroy(callno);
Issue History
Date Modified Username Field Change
======================================================================
2008-10-30 07:54 vazir Note Added: 0094409
======================================================================
More information about the asterisk-bugs
mailing list