diff options
author | bbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-21 20:30:12 +0000 |
---|---|---|
committer | bbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-21 20:30:12 +0000 |
commit | a83b93bfd62160aecc5660fc41abd3cb9e1dae37 (patch) | |
tree | d68e6a7974974f11dc76603cf3c19c2303d75832 /channels | |
parent | afb5399003a94ceec0c2d107ad8c1af38ec4e0c5 (diff) |
Fix a bug in 1.4 branch with iax2 channels not being removed when a call 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).
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@132506 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_iax2.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 44e11eea3..157b5d22c 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -3406,17 +3406,15 @@ static int iax2_call(struct ast_channel *c, char *dest, int timeout) 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 @@ static int iax2_hangup(struct ast_channel *c) /* 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); |