aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-01-26 05:28:14 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-01-26 05:28:14 +0000
commit7bc3b62b57af599f9f3cabeb2bba50e67c062316 (patch)
treee3bd794898eb970a1cc6a07967e054029a984150 /channels
parent32bdbf49c2c0309c5bcfa342f7b8b585dc232ac3 (diff)
Send 481 if call leg does not exist on CANCEL, and send 487 before 200 as per rfc3261 (bug #917)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2071 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_sip.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index a42b0f563..a1a277b4b 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -5425,8 +5425,12 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
ast_queue_hangup(p->owner, 0);
else
p->needdestroy = 1;
- transmit_response(p, "200 OK", req);
- transmit_response_reliable(p, "487 Request Terminated", &p->initreq);
+ if (p->initreq.len > 0) {
+ transmit_response_reliable(p, "487 Request Terminated", &p->initreq);
+ transmit_response(p, "200 OK", req);
+ } else {
+ transmit_response_reliable(p, "481 Call Leg Does Not Exist", req);
+ }
} else if (!strcasecmp(cmd, "BYE")) {
copy_request(&p->initreq, req);
check_via(p, req);