dect
/
asterisk
Archived
13
0
Fork 0

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

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4771 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
markster 2005-01-12 23:01:44 +00:00
parent e234ddbf1f
commit 894fe420fc
1 changed files with 10 additions and 7 deletions

View File

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