mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 00:04:53 +00:00
Consider both tags as possible matches (bug #2422)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3778 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2392,10 +2392,11 @@ static struct sip_pvt *find_call(struct sip_request *req, struct sockaddr_in *si
|
|||||||
struct sip_pvt *p;
|
struct sip_pvt *p;
|
||||||
char *callid;
|
char *callid;
|
||||||
char tmp[256] = "";
|
char tmp[256] = "";
|
||||||
|
char tmp2[256] = "";
|
||||||
char iabuf[INET_ADDRSTRLEN];
|
char iabuf[INET_ADDRSTRLEN];
|
||||||
char *cmd;
|
char *cmd;
|
||||||
char *tag = "", *c;
|
char *tag = "", *c;
|
||||||
int themisfrom;
|
char *tag2 = ""
|
||||||
callid = get_header(req, "Call-ID");
|
callid = get_header(req, "Call-ID");
|
||||||
|
|
||||||
if (pedanticsipchecking) {
|
if (pedanticsipchecking) {
|
||||||
@@ -2412,15 +2413,7 @@ static struct sip_pvt *find_call(struct sip_request *req, struct sockaddr_in *si
|
|||||||
c = strchr(tmp, ' ');
|
c = strchr(tmp, ' ');
|
||||||
if (c)
|
if (c)
|
||||||
*c = '\0';
|
*c = '\0';
|
||||||
if (!strcasecmp(cmd, "SIP/2.0")) {
|
strncpy(tmp, get_header(req, "From"), sizeof(tmp) - 1);
|
||||||
themisfrom = 0;
|
|
||||||
} else {
|
|
||||||
themisfrom = 1;
|
|
||||||
}
|
|
||||||
if (themisfrom)
|
|
||||||
strncpy(tmp, get_header(req, "From"), sizeof(tmp) - 1);
|
|
||||||
else
|
|
||||||
strncpy(tmp, get_header(req, "To"), sizeof(tmp) - 1);
|
|
||||||
tag = strstr(tmp, "tag=");
|
tag = strstr(tmp, "tag=");
|
||||||
if (tag) {
|
if (tag) {
|
||||||
tag += 4;
|
tag += 4;
|
||||||
@@ -2428,6 +2421,14 @@ static struct sip_pvt *find_call(struct sip_request *req, struct sockaddr_in *si
|
|||||||
if (c)
|
if (c)
|
||||||
*c = '\0';
|
*c = '\0';
|
||||||
}
|
}
|
||||||
|
strncpy(tmp2, get_header(req, "To"), sizeof(tmp2) - 1);
|
||||||
|
tag2 = strstr(tmp2, "tag=");
|
||||||
|
if (tag2) {
|
||||||
|
tag2 += 4;
|
||||||
|
c = strchr(tag2, ';');
|
||||||
|
if (c)
|
||||||
|
*c = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2439,7 +2440,7 @@ static struct sip_pvt *find_call(struct sip_request *req, struct sockaddr_in *si
|
|||||||
p = iflist;
|
p = iflist;
|
||||||
while(p) {
|
while(p) {
|
||||||
if (!strcmp(p->callid, callid) &&
|
if (!strcmp(p->callid, callid) &&
|
||||||
(!pedanticsipchecking || !tag || ast_strlen_zero(p->theirtag) || !strcmp(p->theirtag, tag))) {
|
(!pedanticsipchecking || !tag || !tag2 || ast_strlen_zero(p->theirtag) || !strcmp(p->theirtag, tag) || !strcmp(p->theirtag, tag2))) {
|
||||||
/* Found the call */
|
/* Found the call */
|
||||||
ast_mutex_lock(&p->lock);
|
ast_mutex_lock(&p->lock);
|
||||||
ast_mutex_unlock(&iflock);
|
ast_mutex_unlock(&iflock);
|
||||||
|
Reference in New Issue
Block a user