mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-01 11:32:25 +00:00
Check for 407 on both outbound and non-outbound calls
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1383 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -4225,6 +4225,17 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
|
|||||||
owner = p->owner;
|
owner = p->owner;
|
||||||
/* Acknowledge whatever it is destined for */
|
/* Acknowledge whatever it is destined for */
|
||||||
__sip_ack(p, seqno, 0);
|
__sip_ack(p, seqno, 0);
|
||||||
|
/* Get their tag if we haven't already */
|
||||||
|
to = get_header(req, "To");
|
||||||
|
to = strstr(to, "tag=");
|
||||||
|
if (to) {
|
||||||
|
to += 4;
|
||||||
|
strncpy(p->theirtag, to, sizeof(p->theirtag) - 1);
|
||||||
|
to = strchr(p->theirtag, ';');
|
||||||
|
if (to)
|
||||||
|
*to = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
if (p->peerpoke) {
|
if (p->peerpoke) {
|
||||||
/* We don't really care what the response is, just that it replied back.
|
/* We don't really care what the response is, just that it replied back.
|
||||||
Well, as long as it's not a 100 response... since we might
|
Well, as long as it's not a 100 response... since we might
|
||||||
@@ -4273,17 +4284,6 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
|
|||||||
ast_sched_del(sched, p->initid);
|
ast_sched_del(sched, p->initid);
|
||||||
p->initid = -1;
|
p->initid = -1;
|
||||||
}
|
}
|
||||||
/* Get their tag if we haven't already */
|
|
||||||
to = get_header(req, "To");
|
|
||||||
to = strstr(to, "tag=");
|
|
||||||
if (to) {
|
|
||||||
to += 4;
|
|
||||||
strncpy(p->theirtag, to, sizeof(p->theirtag) - 1);
|
|
||||||
to = strchr(p->theirtag, ';');
|
|
||||||
if (to)
|
|
||||||
*to = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
switch(resp) {
|
switch(resp) {
|
||||||
case 100:
|
case 100:
|
||||||
break;
|
break;
|
||||||
@@ -4448,6 +4448,14 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_
|
|||||||
if (!strcasecmp(msg, "INVITE") || !strcasecmp(msg, "REGISTER") )
|
if (!strcasecmp(msg, "INVITE") || !strcasecmp(msg, "REGISTER") )
|
||||||
transmit_request(p, "ACK", seqno, 0);
|
transmit_request(p, "ACK", seqno, 0);
|
||||||
break;
|
break;
|
||||||
|
case 407:
|
||||||
|
if (!strcasecmp(msg, "BYE")) {
|
||||||
|
if ((p->authtries > 1) || do_proxy_auth(p, req, "BYE")) {
|
||||||
|
ast_log(LOG_NOTICE, "Failed to authenticate on BYE to '%s'\n", get_header(&p->initreq, "From"));
|
||||||
|
p->needdestroy = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user