aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-12-13 05:14:27 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-12-13 05:14:27 +0000
commite4745a4ceed440048e2433351e3d05f83766adf7 (patch)
tree7b5b093dce37cb1f974182baa1e5f869fcfbb486
parentd1919e6492cb15c1cb5d6cac0bd50c5e82ac10f8 (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.c3
-rw-r--r--pbx.c2
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) {
diff --git a/pbx.c b/pbx.c
index 5a95e9a05..7f5fef1ee 100644
--- a/pbx.c
+++ b/pbx.c
@@ -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;
}