Skip to content
Snippets Groups Projects
Commit df28954a authored by Mark Michelson's avatar Mark Michelson
Browse files

Make sure tc is unlocked before calling ast_call since calling a Local

channel could result in a deadlock.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187770 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 92b20aa0
No related branches found
No related tags found
No related merge requests found
...@@ -1916,6 +1916,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags ...@@ -1916,6 +1916,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
else else
ast_copy_string(tc->exten, chan->exten, sizeof(tc->exten)); ast_copy_string(tc->exten, chan->exten, sizeof(tc->exten));
ast_channel_unlock(tc);
res = ast_call(tc, numsubst, 0); /* Place the call, but don't wait on the answer */ res = ast_call(tc, numsubst, 0); /* Place the call, but don't wait on the answer */
/* Save the info in cdr's that we called them */ /* Save the info in cdr's that we called them */
...@@ -1931,7 +1932,6 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags ...@@ -1931,7 +1932,6 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
chan->hangupcause = tc->hangupcause; chan->hangupcause = tc->hangupcause;
} }
ast_channel_unlock(chan); ast_channel_unlock(chan);
ast_channel_unlock(tc);
ast_hangup(tc); ast_hangup(tc);
tc = NULL; tc = NULL;
ast_free(tmp); ast_free(tmp);
...@@ -1941,7 +1941,6 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags ...@@ -1941,7 +1941,6 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
senddialevent(chan, tc, numsubst); senddialevent(chan, tc, numsubst);
ast_verb(3, "Called %s\n", numsubst); ast_verb(3, "Called %s\n", numsubst);
ast_channel_unlock(chan); ast_channel_unlock(chan);
ast_channel_unlock(tc);
if (!ast_test_flag64(peerflags, OPT_ORIGINAL_CLID)) { if (!ast_test_flag64(peerflags, OPT_ORIGINAL_CLID)) {
ast_set_callerid(tc, tmpexten, get_cid_name(cidname, sizeof(cidname), chan), NULL); ast_set_callerid(tc, tmpexten, get_cid_name(cidname, sizeof(cidname), chan), NULL);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment