From 799247b4d5339ecda14b845dd94ababbff035a75 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Mon, 27 Feb 2006 02:50:09 +0000 Subject: [PATCH] don't hang up the channel if its state is set to UP before we return from ast_call (issue #6569) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@11250 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/channel.c b/channel.c index 5aacefd21f..011bdaef3e 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 */