aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-12-09 22:09:05 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-12-09 22:09:05 +0000
commit5d20155225cb149d6326defea641e47809d67fe6 (patch)
treebc34388b487e8026ca1e10c2fc2c9a64d5fd1da4
parent90f8f9cd1d88649f51e929e2b2878cf8371543c9 (diff)
Don't retransmit INVITE on 407 retransmission
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1849 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xchannels/chan_sip.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index fff501f66..09e16871d 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -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);
}
-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 *msg, *c;
@@ -4801,9 +4801,12 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
/* First we ACK */
transmit_request(p, "ACK", seqno, 0);
/* Then we AUTH */
- 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"));
- p->needdestroy = 1;
+ /* 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)) {
+ ast_log(LOG_NOTICE, "Failed to authenticate on INVITE to '%s'\n", get_header(&p->initreq, "From"));
+ p->needdestroy = 1;
+ }
}
} else if (!strcasecmp(msg, "BYE") || !strcasecmp(msg, "REFER")) {
if (!strlen(p->peername))
@@ -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) {
ast_log(LOG_WARNING, "Invalid response: '%s'\n", e);
} else {
- handle_response(p, respid, e + len, req);
+ handle_response(p, respid, e + len, req,ignore);
}
} else {
transmit_response_with_allow(p, "405 Method Not Allowed", req);