[svn-commits] bbryant: branch 1.4 r132506 - /branches/1.4/channels/chan_iax2.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jul 21 15:30:13 CDT 2008


Author: bbryant
Date: Mon Jul 21 15:30:12 2008
New Revision: 132506

URL: http://svn.digium.com/view/asterisk?view=rev&rev=132506
Log:
Fix a bug in 1.4 branch with iax2 channels not being removed when a registration was rejected (from the calling box, not the box that denied the 
registration). Related to revisions 132466 in trunk, and 132467 in 1.6.0. Earlier I had accidently tested 1.4 with a backport from those revisions, 
so I didn't see this problem (oops).

Modified:
    branches/1.4/channels/chan_iax2.c

Modified: branches/1.4/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_iax2.c?view=diff&rev=132506&r1=132505&r2=132506
==============================================================================
--- branches/1.4/channels/chan_iax2.c (original)
+++ branches/1.4/channels/chan_iax2.c Mon Jul 21 15:30:12 2008
@@ -3406,17 +3406,15 @@
 static int iax2_hangup(struct ast_channel *c) 
 {
 	unsigned short callno = PTR_TO_CALLNO(c->tech_pvt);
-	int alreadygone;
  	struct iax_ie_data ied;
  	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)) {
  			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]);
@@ -3426,7 +3424,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 (option_debug)
 				ast_log(LOG_DEBUG, "Really destroying %s now...\n", c->name);
 			iax2_destroy(callno);




More information about the svn-commits mailing list