Fix 302 Redirects on SIP

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@721 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2003-03-30 20:46:30 +00:00
parent 0e170f8f81
commit a987ef1163

View File

@@ -343,6 +343,7 @@ static int retrans_pkt(void *data)
struct sip_pkt *pkt=data;
int res = 0;
ast_pthread_mutex_lock(&pkt->owner->lock);
if (!pkt->owner->needdestroy) {
if (pkt->retrans < MAX_RETRANS) {
pkt->retrans++;
if (sipdebug) {
@@ -364,6 +365,10 @@ static int retrans_pkt(void *data)
sip_destroy(pkt->owner);
}
}
} else {
/* Don't bother retransmitting. It's about to be killed anyway */
pkt->retransid = -1;
}
ast_pthread_mutex_unlock(&pkt->owner->lock);
return res;
}
@@ -3204,7 +3209,7 @@ static void parse_moved_contact(struct sip_pvt *p, struct sip_request *req)
char tmp[256] = "";
char *s, *e;
strncpy(tmp, get_header(req, "Contact"), sizeof(tmp) - 1);
s = tmp;
s = ditch_braces(tmp);
e = strchr(tmp, '@');
if (e)
*e = '\0';
@@ -3377,7 +3382,7 @@ retrylock:
*/
break;
default:
if ((resp >= 400) && (resp < 700)) {
if ((resp >= 300) && (resp < 700)) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Got SIP response %d \"%s\" back from %s\n", resp, rest, inet_ntoa(p->sa.sin_addr));
p->alreadygone = 1;