From: Russell Bryant Date: Mon, 27 Feb 2006 02:51:03 +0000 (+0000) Subject: Merged revisions 11250 via svnmerge from X-Git-Tag: 1.4.0-beta1~2523 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1323c7be914397e672d28cb61f287238dec6a4ef;p=thirdparty%2Fasterisk.git Merged revisions 11250 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r11250 | russell | 2006-02-26 21:50:09 -0500 (Sun, 26 Feb 2006) | 2 lines 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/trunk@11251 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channel.c b/channel.c index 72bf9ae8d5..14c15a0fe0 100644 --- a/channel.c +++ b/channel.c @@ -2437,7 +2437,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 */