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
This commit is contained in:
Mark Spencer 2004-01-26 05:28:14 +00:00
parent 8face6c67c
commit 662e7238ef
1 changed files with 6 additions and 2 deletions

View File

@ -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);