aboutsummaryrefslogtreecommitdiffstats
path: root/channel.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-27 02:50:09 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-27 02:50:09 +0000
commit577a7d0901663fea3fb1eb20b46658df5ba6c224 (patch)
treeaac8c907fc9e3aa419cc967997be5435ac8c8def /channel.c
parent9cc9fab87ab18b3ab52b2f7cd8898a5e8c899aae (diff)
don't hang up the channel if its state is set to UP before we return from ast_call (issue #6569)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@11250 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rw-r--r--channel.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/channel.c b/channel.c
index 5aacefd21..011bdaef3 100644
--- a/channel.c
+++ b/channel.c
@@ -2392,7 +2392,8 @@ struct ast_channel *__ast_request_and_dial(const char *type, int format, void *d
ast_set_callerid(chan, cid_num, cid_name, cid_num);
if (!ast_call(chan, data, 0)) {
- while(timeout && (chan->_state != AST_STATE_UP)) {
+ res = 1; /* in case chan->_state is already AST_STATE_UP */
+ while (timeout && (chan->_state != AST_STATE_UP)) {
res = ast_waitfor(chan, timeout);
if (res < 0) {
/* Something not cool, or timed out */