From: Kevin P. Fleming Date: Mon, 22 Aug 2005 19:47:00 +0000 (+0000) Subject: handle BYE instead of CANCEL from callers (issue #4994) X-Git-Tag: 1.2.0-beta1~73 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=97b45d5d6de3fa5ae881cfc820a4cd79c045d497;p=thirdparty%2Fasterisk.git handle BYE instead of CANCEL from callers (issue #4994) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6354 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 83c882eb1b..451a4a2be3 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -9339,12 +9339,15 @@ static int handle_request_cancel(struct sip_pvt *p, struct sip_request *req, int } /*--- handle_request_bye: Handle incoming BYE request ---*/ -static int handle_request_bye(struct sip_pvt *p, struct sip_request *req, int debug) +static int handle_request_bye(struct sip_pvt *p, struct sip_request *req, int debug, int ignore) { struct ast_channel *c=NULL; int res; struct ast_channel *bridged_to; char iabuf[INET_ADDRSTRLEN]; + + if (p->pendinginvite && !ast_test_flag(p, SIP_OUTGOING) && !ignore) + transmit_response_reliable(p, "487 Request Terminated", &p->initreq, 1); copy_request(&p->initreq, req); check_via(p, req); @@ -9668,7 +9671,7 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc res = handle_request_cancel(p, req, debug, ignore); break; case SIP_BYE: - res = handle_request_bye(p, req, debug); + res = handle_request_bye(p, req, debug, ignore); break; case SIP_MESSAGE: res = handle_request_message(p, req, debug, ignore);