Compare commits

..

5 Commits

Author SHA1 Message Date
Kevin P. Fleming
ef83b5943e Convert all release tags to Opsound music-on-hold.
For more details:
http://blogs.digium.com/2009/08/18/asterisk-music-on-hold-changes/



git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.2.25-netsec@212958 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-18 20:42:51 +00:00
Russell Bryant
5162e5d425 importing files for 1.2.25-netsec release
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.2.25-netsec@90179 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-29 21:41:32 +00:00
Russell Bryant
c247ee8720 Creating tag for the release of asterisk-1.2.25-netsec
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.2.25-netsec@90178 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-29 21:40:33 +00:00
Russell Bryant
ca81e571ae sync with 1.2 branch
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@90175 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-29 21:36:31 +00:00
Automerge script
c357e38925 automerge commit
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@82455 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-14 21:21:56 +00:00
4 changed files with 31 additions and 13 deletions

View File

@@ -1 +1 @@
1.2.24-netsec 1.2.25-netsec

View File

@@ -1,3 +1,16 @@
2007-11-29 Russell Bryant <russell@digium.com>
* Asterisk 1.2.25-netsec released
2007-11-29 21:10 +0000 [r90170] Tilghman Lesher <tlesher@digium.com>
* cdr/cdr_pgsql.c: Properly escape src and dst fields (Fixes
AST-2007-026)
2007-09-13 18:10 +0000 [r82334] Kevin P. Fleming <kpfleming@digium.com>
* LICENSE: clarify the OpenSSL and OpenH323 license exceptions
2007-08-07 Russell Bryant <russell@digium.com> 2007-08-07 Russell Bryant <russell@digium.com>
* Asterisk 1.2.24-netsec released * Asterisk 1.2.24-netsec released

View File

@@ -32,7 +32,7 @@ GPL'd products (although if you've written a module for Asterisk we
would strongly encourage you to make the same exception that we do). would strongly encourage you to make the same exception that we do).
Specific permission is also granted to link Asterisk with OpenSSL and Specific permission is also granted to link Asterisk with OpenSSL and
OpenH323. OpenH323 and distribute the resulting binary files.
In addition, Asterisk implements two management/control protocols: the In addition, Asterisk implements two management/control protocols: the
Asterisk Manager Interface (AMI) and the Asterisk Gateway Interface Asterisk Manager Interface (AMI) and the Asterisk Gateway Interface

View File

@@ -72,6 +72,7 @@ static int pgsql_log(struct ast_cdr *cdr)
struct tm tm; struct tm tm;
char sqlcmd[2048] = "", timestr[128]; char sqlcmd[2048] = "", timestr[128];
char *pgerror; char *pgerror;
int pgerr;
ast_mutex_lock(&pgsql_lock); ast_mutex_lock(&pgsql_lock);
@@ -91,28 +92,32 @@ static int pgsql_log(struct ast_cdr *cdr)
if (connected) { if (connected) {
char *clid=NULL, *dcontext=NULL, *channel=NULL, *dstchannel=NULL, *lastapp=NULL, *lastdata=NULL; char *clid=NULL, *dcontext=NULL, *channel=NULL, *dstchannel=NULL, *lastapp=NULL, *lastdata=NULL;
char *uniqueid=NULL, *userfield=NULL; char *uniqueid=NULL, *userfield=NULL, *src=NULL, *dst=NULL;
/* Maximum space needed would be if all characters needed to be escaped, plus a trailing NULL */ /* Maximum space needed would be if all characters needed to be escaped, plus a trailing NULL */
if ((clid = alloca(strlen(cdr->clid) * 2 + 1)) != NULL) if ((clid = alloca(strlen(cdr->clid) * 2 + 1)) != NULL)
PQescapeString(clid, cdr->clid, strlen(cdr->clid)); PQescapeStringConn(conn, clid, cdr->clid, strlen(cdr->clid), &pgerr);
if ((dcontext = alloca(strlen(cdr->dcontext) * 2 + 1)) != NULL) if ((dcontext = alloca(strlen(cdr->dcontext) * 2 + 1)) != NULL)
PQescapeString(dcontext, cdr->dcontext, strlen(cdr->dcontext)); PQescapeStringConn(conn, dcontext, cdr->dcontext, strlen(cdr->dcontext), &pgerr);
if ((channel = alloca(strlen(cdr->channel) * 2 + 1)) != NULL) if ((channel = alloca(strlen(cdr->channel) * 2 + 1)) != NULL)
PQescapeString(channel, cdr->channel, strlen(cdr->channel)); PQescapeStringConn(conn, channel, cdr->channel, strlen(cdr->channel), &pgerr);
if ((dstchannel = alloca(strlen(cdr->dstchannel) * 2 + 1)) != NULL) if ((dstchannel = alloca(strlen(cdr->dstchannel) * 2 + 1)) != NULL)
PQescapeString(dstchannel, cdr->dstchannel, strlen(cdr->dstchannel)); PQescapeStringConn(conn, dstchannel, cdr->dstchannel, strlen(cdr->dstchannel), &pgerr);
if ((lastapp = alloca(strlen(cdr->lastapp) * 2 + 1)) != NULL) if ((lastapp = alloca(strlen(cdr->lastapp) * 2 + 1)) != NULL)
PQescapeString(lastapp, cdr->lastapp, strlen(cdr->lastapp)); PQescapeStringConn(conn, lastapp, cdr->lastapp, strlen(cdr->lastapp), &pgerr);
if ((lastdata = alloca(strlen(cdr->lastdata) * 2 + 1)) != NULL) if ((lastdata = alloca(strlen(cdr->lastdata) * 2 + 1)) != NULL)
PQescapeString(lastdata, cdr->lastdata, strlen(cdr->lastdata)); PQescapeStringConn(conn, lastdata, cdr->lastdata, strlen(cdr->lastdata), &pgerr);
if ((uniqueid = alloca(strlen(cdr->uniqueid) * 2 + 1)) != NULL) if ((uniqueid = alloca(strlen(cdr->uniqueid) * 2 + 1)) != NULL)
PQescapeString(uniqueid, cdr->uniqueid, strlen(cdr->uniqueid)); PQescapeStringConn(conn, uniqueid, cdr->uniqueid, strlen(cdr->uniqueid), &pgerr);
if ((userfield = alloca(strlen(cdr->userfield) * 2 + 1)) != NULL) if ((userfield = alloca(strlen(cdr->userfield) * 2 + 1)) != NULL)
PQescapeString(userfield, cdr->userfield, strlen(cdr->userfield)); PQescapeStringConn(conn, userfield, cdr->userfield, strlen(cdr->userfield), &pgerr);
if ((src = alloca(strlen(cdr->src) * 2 + 1)) != NULL)
PQescapeStringConn(conn, src, cdr->src, strlen(cdr->src), &pgerr);
if ((dst = alloca(strlen(cdr->dst) * 2 + 1)) != NULL)
PQescapeStringConn(conn, dst, cdr->dst, strlen(cdr->dst), &pgerr);
/* Check for all alloca failures above at once */ /* Check for all alloca failures above at once */
if ((!clid) || (!dcontext) || (!channel) || (!dstchannel) || (!lastapp) || (!lastdata) || (!uniqueid) || (!userfield)) { if ((!clid) || (!dcontext) || (!channel) || (!dstchannel) || (!lastapp) || (!lastdata) || (!uniqueid) || (!userfield) || (!src) || (!dst)) {
ast_log(LOG_ERROR, "cdr_pgsql: Out of memory error (insert fails)\n"); ast_log(LOG_ERROR, "cdr_pgsql: Out of memory error (insert fails)\n");
ast_mutex_unlock(&pgsql_lock); ast_mutex_unlock(&pgsql_lock);
return -1; return -1;
@@ -123,7 +128,7 @@ static int pgsql_log(struct ast_cdr *cdr)
snprintf(sqlcmd,sizeof(sqlcmd),"INSERT INTO %s (calldate,clid,src,dst,dcontext,channel,dstchannel," snprintf(sqlcmd,sizeof(sqlcmd),"INSERT INTO %s (calldate,clid,src,dst,dcontext,channel,dstchannel,"
"lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid,userfield) VALUES" "lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid,userfield) VALUES"
" ('%s','%s','%s','%s','%s', '%s','%s','%s','%s',%ld,%ld,'%s',%ld,'%s','%s','%s')", " ('%s','%s','%s','%s','%s', '%s','%s','%s','%s',%ld,%ld,'%s',%ld,'%s','%s','%s')",
table,timestr,clid,cdr->src, cdr->dst, dcontext,channel, dstchannel, lastapp, lastdata, table, timestr, clid, src, dst, dcontext,channel, dstchannel, lastapp, lastdata,
cdr->duration,cdr->billsec,ast_cdr_disp2str(cdr->disposition),cdr->amaflags, cdr->accountcode, uniqueid, userfield); cdr->duration,cdr->billsec,ast_cdr_disp2str(cdr->disposition),cdr->amaflags, cdr->accountcode, uniqueid, userfield);
ast_log(LOG_DEBUG,"cdr_pgsql: SQL command executed: %s\n",sqlcmd); ast_log(LOG_DEBUG,"cdr_pgsql: SQL command executed: %s\n",sqlcmd);