[svn-commits] russell: branch 1.6.0 r106317 - in /branches/1.6.0: ./ channels/chan_iax2.c
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Wed Mar 5 18:21:24 CST 2008
Author: russell
Date: Wed Mar 5 18:21:24 2008
New Revision: 106317
URL: http://svn.digium.com/view/asterisk?view=rev&rev=106317
Log:
Merged revisions 106238 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r106238 | russell | 2008-03-05 16:40:58 -0600 (Wed, 05 Mar 2008) | 11 lines
Merged revisions 106237 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r106237 | russell | 2008-03-05 16:37:09 -0600 (Wed, 05 Mar 2008) | 3 lines
Fix a potential deadlock and a few different potential crashes.
(closes issue #12145, reported by thiagarcia, patched by me)
........
................
Modified:
branches/1.6.0/ (props changed)
branches/1.6.0/channels/chan_iax2.c
Propchange: branches/1.6.0/
------------------------------------------------------------------------------
--- trunk-merged (original)
+++ trunk-merged Wed Mar 5 18:21:24 2008
@@ -1,1 +1,1 @@
-/trunk:1-105595,105675,105677,105733-105734,105773,105785,105804,105840-105841,105864,105899,105933,106036,106040,106139,106186
+/trunk:1-105595,105675,105677,105733-105734,105773,105785,105804,105840-105841,105864,105899,105933,106036,106040,106139,106186,106238
Modified: branches/1.6.0/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/chan_iax2.c?view=diff&rev=106317&r1=106316&r2=106317
==============================================================================
--- branches/1.6.0/channels/chan_iax2.c (original)
+++ branches/1.6.0/channels/chan_iax2.c Wed Mar 5 18:21:24 2008
@@ -7073,7 +7073,10 @@
/* Once we have this lock, we're sure nobody else is using it or could use it once we release it,
because by the time they could get tpeerlock, we've already grabbed it */
ast_debug(1, "Dropping unused iax2 trunk peer '%s:%d'\n", ast_inet_ntoa(drop->addr.sin_addr), ntohs(drop->addr.sin_port));
- ast_free(drop->trunkdata);
+ if (drop->trunkdata) {
+ ast_free(drop->trunkdata);
+ drop->trunkdata = NULL;
+ }
ast_mutex_unlock(&drop->lock);
ast_mutex_destroy(&drop->lock);
ast_free(drop);
@@ -8415,29 +8418,42 @@
iax2_destroy(fr->callno);
break;
case IAX_COMMAND_TRANSFER:
- if (iaxs[fr->callno]->owner && ast_bridged_channel(iaxs[fr->callno]->owner) && ies.called_number) {
+ {
+ struct ast_channel *bridged_chan;
+
+ if (iaxs[fr->callno]->owner && (bridged_chan = ast_bridged_channel(iaxs[fr->callno]->owner)) && ies.called_number) {
/* Set BLINDTRANSFER channel variables */
- pbx_builtin_setvar_helper(iaxs[fr->callno]->owner, "BLINDTRANSFER", ast_bridged_channel(iaxs[fr->callno]->owner)->name);
- pbx_builtin_setvar_helper(ast_bridged_channel(iaxs[fr->callno]->owner), "BLINDTRANSFER", iaxs[fr->callno]->owner->name);
+
+ ast_mutex_unlock(&iaxsl[fr->callno]);
+ pbx_builtin_setvar_helper(iaxs[fr->callno]->owner, "BLINDTRANSFER", bridged_chan->name);
+ ast_mutex_lock(&iaxsl[fr->callno]);
+ if (!iaxs[fr->callno]) {
+ ast_mutex_unlock(&iaxsl[fr->callno]);
+ return 1;
+ }
+
+ pbx_builtin_setvar_helper(bridged_chan, "BLINDTRANSFER", iaxs[fr->callno]->owner->name);
if (!strcmp(ies.called_number, ast_parking_ext())) {
- if (iax_park(ast_bridged_channel(iaxs[fr->callno]->owner), iaxs[fr->callno]->owner)) {
- ast_log(LOG_WARNING, "Failed to park call on '%s'\n", ast_bridged_channel(iaxs[fr->callno]->owner)->name);
- } else if (ast_bridged_channel(iaxs[fr->callno]->owner)) {
+ if (iax_park(bridged_chan, iaxs[fr->callno]->owner)) {
+ ast_log(LOG_WARNING, "Failed to park call on '%s'\n", bridged_chan->name);
+ } else {
ast_debug(1, "Parked call on '%s'\n", ast_bridged_channel(iaxs[fr->callno]->owner)->name);
}
} else {
- if (ast_async_goto(ast_bridged_channel(iaxs[fr->callno]->owner), iaxs[fr->callno]->context, ies.called_number, 1))
- ast_log(LOG_WARNING, "Async goto of '%s' to '%s@%s' failed\n", ast_bridged_channel(iaxs[fr->callno]->owner)->name,
+ if (ast_async_goto(bridged_chan, iaxs[fr->callno]->context, ies.called_number, 1))
+ ast_log(LOG_WARNING, "Async goto of '%s' to '%s@%s' failed\n", bridged_chan->name,
ies.called_number, iaxs[fr->callno]->context);
else {
- ast_debug(1, "Async goto of '%s' to '%s@%s' started\n", ast_bridged_channel(iaxs[fr->callno]->owner)->name,
+ ast_debug(1, "Async goto of '%s' to '%s@%s' started\n", bridged_chan->name,
ies.called_number, iaxs[fr->callno]->context);
}
}
} else {
ast_debug(1, "Async goto not applicable on call %d\n", fr->callno);
}
+
break;
+ }
case IAX_COMMAND_ACCEPT:
/* Ignore if call is already up or needs authentication or is a TBD */
if (ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED | IAX_STATE_TBD | IAX_STATE_AUTHENTICATED))
More information about the svn-commits
mailing list