diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-12-13 05:14:27 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-12-13 05:14:27 +0000 |
commit | e4745a4ceed440048e2433351e3d05f83766adf7 (patch) | |
tree | 7b5b093dce37cb1f974182baa1e5f869fcfbb486 | |
parent | d1919e6492cb15c1cb5d6cac0bd50c5e82ac10f8 (diff) |
ensure that hangups while incoming calls are in early state are handled properly (issue #5919)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@7451 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_sip.c | 3 | ||||
-rw-r--r-- | pbx.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 5b2e90486..5824cc054 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -2275,6 +2275,7 @@ static int hangup_sip2cause(int cause) /* Possible values taken from causes.h */ switch(cause) { + case 603: /* Declined */ case 403: /* Not found */ return AST_CAUSE_CALL_REJECTED; case 404: /* Not found */ @@ -2454,7 +2455,7 @@ static int sip_hangup(struct ast_channel *ast) if (ast->hangupcause && ((res = hangup_cause2sip(ast->hangupcause)))) { transmit_response_reliable(p, res, &p->initreq, 1); } else - transmit_response_reliable(p, "403 Forbidden", &p->initreq, 1); + transmit_response_reliable(p, "603 Declined", &p->initreq, 1); } } else { /* Call is in UP state, send BYE */ if (!p->pendinginvite) { @@ -5513,6 +5513,8 @@ static int pbx_builtin_setamaflags(struct ast_channel *chan, void *data) static int pbx_builtin_hangup(struct ast_channel *chan, void *data) { /* Just return non-zero and it will hang up */ + if (!chan->hangupcause) + chan->hangupcause = AST_CAUSE_NORMAL_CLEARING; return -1; } |