mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-14 08:31:02 +00:00
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:
@@ -343,6 +343,7 @@ static int retrans_pkt(void *data)
|
|||||||
struct sip_pkt *pkt=data;
|
struct sip_pkt *pkt=data;
|
||||||
int res = 0;
|
int res = 0;
|
||||||
ast_pthread_mutex_lock(&pkt->owner->lock);
|
ast_pthread_mutex_lock(&pkt->owner->lock);
|
||||||
|
if (!pkt->owner->needdestroy) {
|
||||||
if (pkt->retrans < MAX_RETRANS) {
|
if (pkt->retrans < MAX_RETRANS) {
|
||||||
pkt->retrans++;
|
pkt->retrans++;
|
||||||
if (sipdebug) {
|
if (sipdebug) {
|
||||||
@@ -364,6 +365,10 @@ static int retrans_pkt(void *data)
|
|||||||
sip_destroy(pkt->owner);
|
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);
|
ast_pthread_mutex_unlock(&pkt->owner->lock);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -3204,7 +3209,7 @@ static void parse_moved_contact(struct sip_pvt *p, struct sip_request *req)
|
|||||||
char tmp[256] = "";
|
char tmp[256] = "";
|
||||||
char *s, *e;
|
char *s, *e;
|
||||||
strncpy(tmp, get_header(req, "Contact"), sizeof(tmp) - 1);
|
strncpy(tmp, get_header(req, "Contact"), sizeof(tmp) - 1);
|
||||||
s = tmp;
|
s = ditch_braces(tmp);
|
||||||
e = strchr(tmp, '@');
|
e = strchr(tmp, '@');
|
||||||
if (e)
|
if (e)
|
||||||
*e = '\0';
|
*e = '\0';
|
||||||
@@ -3377,7 +3382,7 @@ retrylock:
|
|||||||
*/
|
*/
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if ((resp >= 400) && (resp < 700)) {
|
if ((resp >= 300) && (resp < 700)) {
|
||||||
if (option_verbose > 2)
|
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));
|
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;
|
p->alreadygone = 1;
|
||||||
|
Reference in New Issue
Block a user