mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-22 12:52:33 +00:00
Eliminate localtime calls, various cleanups
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@723 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -146,18 +146,18 @@ static int phone_call(struct ast_channel *ast, char *dest, int timeout)
|
||||
|
||||
PHONE_CID cid;
|
||||
time_t UtcTime;
|
||||
struct tm *t;
|
||||
struct tm tm;
|
||||
|
||||
|
||||
if (ast->callerid) {
|
||||
time(&UtcTime);
|
||||
t = localtime(&UtcTime);
|
||||
localtime_r(&UtcTime,&tm);
|
||||
|
||||
if(t != NULL) {
|
||||
sprintf(cid.month, "%02d",(t->tm_mon + 1));
|
||||
sprintf(cid.day, "%02d", t->tm_mday);
|
||||
sprintf(cid.hour, "%02d", t->tm_hour);
|
||||
sprintf(cid.min, "%02d", t->tm_min);
|
||||
if(&tm != NULL) {
|
||||
sprintf(cid.month, "%02d",(tm.tm_mon + 1));
|
||||
sprintf(cid.day, "%02d", tm.tm_mday);
|
||||
sprintf(cid.hour, "%02d", tm.tm_hour);
|
||||
sprintf(cid.min, "%02d", tm.tm_min);
|
||||
}
|
||||
strcpy(cid.name, "Unknown");
|
||||
sprintf(cid.number,"%s",ast->callerid);
|
||||
|
Reference in New Issue
Block a user