From: Mark Michelson Date: Fri, 11 Jan 2008 19:12:05 +0000 (+0000) Subject: Merged revisions 98315 via svnmerge from X-Git-Tag: 1.6.0-beta1~3^2~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e04aa9eed49ba53d7589990d14034cd8b5cbc7e0;p=thirdparty%2Fasterisk.git Merged revisions 98315 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r98315 | mmichelson | 2008-01-11 13:10:57 -0600 (Fri, 11 Jan 2008) | 5 lines Properly report the hangup cause as no answer when someone does not answer (closes issue #10574, reported by boch, patched by moy) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@98316 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/channel.c b/main/channel.c index 5314402ec7..3b7bc2178b 100644 --- a/main/channel.c +++ b/main/channel.c @@ -3028,6 +3028,7 @@ struct ast_channel *__ast_request_and_dial(const char *type, int format, void *d int cause = 0; struct ast_channel *chan; int res = 0; + int last_subclass = 0; if (outstate) *outstate = 0; @@ -3111,6 +3112,7 @@ struct ast_channel *__ast_request_and_dial(const char *type, int format, void *d default: ast_log(LOG_NOTICE, "Don't know what to do with control frame %d\n", f->subclass); } + last_subclass = f->subclass; } ast_frfree(f); } @@ -3129,6 +3131,8 @@ struct ast_channel *__ast_request_and_dial(const char *type, int format, void *d *outstate = AST_CONTROL_ANSWER; if (res <= 0) { + if ( AST_CONTROL_RINGING == last_subclass ) + chan->hangupcause = AST_CAUSE_NO_ANSWER; if (!chan->cdr && (chan->cdr = ast_cdr_alloc())) ast_cdr_init(chan->cdr, chan); if (chan->cdr) {