diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-01-11 19:10:57 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-01-11 19:10:57 +0000 |
commit | 87ce8e0b2f626caa2295dda919d3ce87884c0ed6 (patch) | |
tree | c7a3e989445c5d1b7aaf8eeadedb120d560811b5 /main/channel.c | |
parent | 7a85e55600850b515fa8ca6d4a88d535eb1d4669 (diff) |
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: http://svn.digium.com/svn/asterisk/branches/1.4@98315 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/channel.c')
-rw-r--r-- | main/channel.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c index 0ccf18b75..999a839b8 100644 --- a/main/channel.c +++ b/main/channel.c @@ -3112,6 +3112,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; @@ -3193,6 +3194,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); } @@ -3211,6 +3213,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) { |