mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 11:42:27 +00:00
Don't retransmit INVITE on 407 retransmission
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -4620,7 +4620,7 @@ static void parse_moved_contact(struct sip_pvt *p, struct sip_request *req)
|
|||||||
strncpy(p->owner->call_forward, s, sizeof(p->owner->call_forward) - 1);
|
strncpy(p->owner->call_forward, s, sizeof(p->owner->call_forward) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_request *req)
|
static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_request *req, int ignore)
|
||||||
{
|
{
|
||||||
char *to;
|
char *to;
|
||||||
char *msg, *c;
|
char *msg, *c;
|
||||||
@@ -4801,10 +4801,13 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
|
|||||||
/* First we ACK */
|
/* First we ACK */
|
||||||
transmit_request(p, "ACK", seqno, 0);
|
transmit_request(p, "ACK", seqno, 0);
|
||||||
/* Then we AUTH */
|
/* Then we AUTH */
|
||||||
|
/* But only if the packet wasn't marked as ignore in handle_request */
|
||||||
|
if(!ignore){
|
||||||
if ((p->authtries > 1) || do_proxy_auth(p, req, "Proxy-Authenticate", "Proxy-Authorization", "INVITE", 1)) {
|
if ((p->authtries > 1) || do_proxy_auth(p, req, "Proxy-Authenticate", "Proxy-Authorization", "INVITE", 1)) {
|
||||||
ast_log(LOG_NOTICE, "Failed to authenticate on INVITE to '%s'\n", get_header(&p->initreq, "From"));
|
ast_log(LOG_NOTICE, "Failed to authenticate on INVITE to '%s'\n", get_header(&p->initreq, "From"));
|
||||||
p->needdestroy = 1;
|
p->needdestroy = 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (!strcasecmp(msg, "BYE") || !strcasecmp(msg, "REFER")) {
|
} else if (!strcasecmp(msg, "BYE") || !strcasecmp(msg, "REFER")) {
|
||||||
if (!strlen(p->peername))
|
if (!strlen(p->peername))
|
||||||
ast_log(LOG_WARNING, "Asked to authenticate %s, to %s:%d but we have no matching peer!\n",
|
ast_log(LOG_WARNING, "Asked to authenticate %s, to %s:%d but we have no matching peer!\n",
|
||||||
@@ -5376,7 +5379,7 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
|
|||||||
if (sscanf(e, "%i %n", &respid, &len) != 1) {
|
if (sscanf(e, "%i %n", &respid, &len) != 1) {
|
||||||
ast_log(LOG_WARNING, "Invalid response: '%s'\n", e);
|
ast_log(LOG_WARNING, "Invalid response: '%s'\n", e);
|
||||||
} else {
|
} else {
|
||||||
handle_response(p, respid, e + len, req);
|
handle_response(p, respid, e + len, req,ignore);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
transmit_response_with_allow(p, "405 Method Not Allowed", req);
|
transmit_response_with_allow(p, "405 Method Not Allowed", req);
|
||||||
|
Reference in New Issue
Block a user