Skip to content
Snippets Groups Projects
Commit 64e4031f authored by Jeremy McNamara's avatar Jeremy McNamara
Browse files

stop seg when no loguniqueid is set in config file. From bkw

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1845 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent a91dc750
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment