Update mp3 copyright header, fix pedantic + register in SIP (bug #2422)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3786 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2004-09-15 19:27:23 +00:00
parent ce68497243
commit a1442538b5
2 changed files with 15 additions and 16 deletions

View File

@@ -3,9 +3,9 @@
* *
* Silly application to play an MP3 file -- uses mpg123 * Silly application to play an MP3 file -- uses mpg123
* *
* Copyright (C) 1999, Mark Spencer * Copyright (C) 1999-2004, Digium, Inc.
* *
* Mark Spencer <markster@linux-support.net> * Mark Spencer <markster@digium.com>
* *
* This program is free software, distributed under the terms of * This program is free software, distributed under the terms of
* the GNU General Public License * the GNU General Public License

View File

@@ -2393,11 +2393,9 @@ 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;
char *tag2 = "";
callid = get_header(req, "Call-ID"); callid = get_header(req, "Call-ID");
@@ -2415,7 +2413,10 @@ 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';
strncpy(tmp, get_header(req, "From"), sizeof(tmp) - 1); if (!strcasecmp(cmd, "SIP/2.0"))
strncpy(tmp, get_header(req, "To"), sizeof(tmp) - 1);
else
strncpy(tmp, get_header(req, "From"), sizeof(tmp) - 1);
tag = strstr(tmp, "tag="); tag = strstr(tmp, "tag=");
if (tag) { if (tag) {
tag += 4; tag += 4;
@@ -2423,14 +2424,6 @@ 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';
}
} }
@@ -2442,7 +2435,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 || !tag2 || ast_strlen_zero(p->theirtag) || !strcmp(p->theirtag, tag) || !strcmp(p->theirtag, tag2))) { (!pedanticsipchecking || !tag || ast_strlen_zero(p->theirtag) || !strcmp(p->theirtag, tag))) {
/* Found the call */ /* Found the call */
ast_mutex_lock(&p->lock); ast_mutex_lock(&p->lock);
ast_mutex_unlock(&iflock); ast_mutex_unlock(&iflock);
@@ -4116,10 +4109,16 @@ static int transmit_register(struct sip_registry *r, char *cmd, char *auth, char
if (strchr(r->username, '@')) { if (strchr(r->username, '@')) {
snprintf(from, sizeof(from), "<sip:%s>;tag=as%08x", r->username, p->tag); snprintf(from, sizeof(from), "<sip:%s>;tag=as%08x", r->username, p->tag);
snprintf(to, sizeof(to), "<sip:%s>", r->username); if (!ast_strlen_zero(p->theirtag))
snprintf(to, sizeof(to), "<sip:%s>;tag=%s", r->username, p->theirtag);
else
snprintf(to, sizeof(to), "<sip:%s>", r->username);
} else { } else {
snprintf(from, sizeof(from), "<sip:%s@%s>;tag=as%08x", r->username, p->tohost, p->tag); snprintf(from, sizeof(from), "<sip:%s@%s>;tag=as%08x", r->username, p->tohost, p->tag);
snprintf(to, sizeof(to), "<sip:%s@%s>", r->username, p->tohost); if (!ast_strlen_zero(p->theirtag))
snprintf(to, sizeof(to), "<sip:%s@%s>;tag=%s", r->username, p->tohost, p->theirtag);
else
snprintf(to, sizeof(to), "<sip:%s@%s>", r->username, p->tohost);
} }
snprintf(addr, sizeof(addr), "sip:%s", r->hostname); snprintf(addr, sizeof(addr), "sip:%s", r->hostname);