aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_phone.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_phone.c')
-rwxr-xr-xchannels/chan_phone.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/channels/chan_phone.c b/channels/chan_phone.c
index b8ce778f9..b0a54443a 100755
--- a/channels/chan_phone.c
+++ b/channels/chan_phone.c
@@ -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);