summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-01-26 05:28:14 +0000
committerMark Spencer <markster@digium.com>2004-01-26 05:28:14 +0000
commit662e7238efd6ccf80484c470c2902438a8eb660b (patch)
treee3bd794898eb970a1cc6a07967e054029a984150 /channels
parent8face6c67c994907f899d5890de7ab0ed9d792e1 (diff)
Send 481 if call leg does not exist on CANCEL, and send 487 before 200 as per rfc3261 (bug #917)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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);