aboutsummaryrefslogtreecommitdiffstats
path: root/cdr
diff options
context:
space:
mode:
authorjeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b>2003-12-09 19:17:41 +0000
committerjeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b>2003-12-09 19:17:41 +0000
commit18910db630d682cf38c82584ec1752c5d7288d33 (patch)
treed0ff49900c078b576dee1494b88cd903e3daf86e /cdr
parenta0f138dbe15b83b6367d5d79b3d286b15de0b93f (diff)
stop seg when no loguniqueid is set in config file. From bkw
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1845 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'cdr')
-rwxr-xr-xcdr/cdr_odbc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cdr/cdr_odbc.c b/cdr/cdr_odbc.c
index 89dc34f2a..a3135b025 100755
--- a/cdr/cdr_odbc.c
+++ b/cdr/cdr_odbc.c
@@ -92,7 +92,7 @@ static int odbc_log(struct ast_cdr *cdr)
return -1;
}
- if((strcmp(loguniqueid, "1") == 0) || (strcmp(loguniqueid, "yes") == 0))
+ if((loguniqueid != NULL) && ((strcmp(loguniqueid, "1") == 0) || (strcmp(loguniqueid, "yes") == 0)))
{
sprintf(sqlcmd,"INSERT INTO cdr (calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s',%i,%i,%i,%i,'%s','%s')", timestr, clid, cdr->src, cdr->dst, dcontext, channel, dstchannel, lastapp, lastdata, cdr->duration, cdr->billsec, cdr->disposition, cdr->amaflags, cdr->accountcode, uniqueid);
}
@@ -299,6 +299,7 @@ static int odbc_load_module(void)
else
{
ast_log(LOG_ERROR,"cdr_odbc: Not logging uniqueid\n");
+ loguniqueid = NULL;
}
}
else