Send 405 Method Not Allowed when message received outside of call (bug #3324, commited from within the plane to huntsville)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4771 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.2-netsec
Mark Spencer 21 years ago
parent b730f9435c
commit 5bb53baa0e

@ -7912,14 +7912,17 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
ast_set_flag(p, SIP_NEEDDESTROY); ast_set_flag(p, SIP_NEEDDESTROY);
transmit_response(p, "200 OK", req); transmit_response(p, "200 OK", req);
} else if (!strcasecmp(cmd, "MESSAGE")) { } else if (!strcasecmp(cmd, "MESSAGE")) {
if (!ignore) { if (p->lastinvite) {
if (debug) if (!ignore) {
ast_verbose("Receiving message!\n"); if (debug)
receive_message(p, req); ast_verbose("Receiving message!\n");
} receive_message(p, req);
transmit_response(p, "200 OK", req); }
if (!p->lastinvite) transmit_response(p, "200 OK", req);
} else {
transmit_response(p, "405 Method Not Allowed", req);
ast_set_flag(p, SIP_NEEDDESTROY); ast_set_flag(p, SIP_NEEDDESTROY);
}
} else if (!strcasecmp(cmd, "SUBSCRIBE")) { } else if (!strcasecmp(cmd, "SUBSCRIBE")) {
if (!ignore) { if (!ignore) {
/* Use this as the basis */ /* Use this as the basis */

Loading…
Cancel
Save