diff options
author | Mark Spencer <markster@digium.com> | 2003-12-01 02:47:19 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2003-12-01 02:47:19 +0000 |
commit | 4468124abd577221fb56fe014111096f6a536f4a (patch) | |
tree | 18d0b78596848a8d31b8b3e1943db521558be06e /pbx.c | |
parent | e1f471f89c8c9f7138a2a33ddec0886faa9df858 (diff) |
Add ${TIMESTAMP} (bug #607) and don't ever ast_log from within handler
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'pbx.c')
-rwxr-xr-x | pbx.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -859,6 +859,19 @@ static void pbx_substitute_variables_temp(struct ast_channel *c,const char *var, brokentime.tm_sec ); *ret = workspace; + } else if (c && !strcmp(var, "TIMESTAMP")) { + thistime=time(NULL); + localtime_r(&thistime, &brokentime); + /* 20031130-150612 */ + snprintf(workspace, workspacelen -1, "%04d%02d%02d-%02d%02d%02d", + brokentime.tm_year+1900, + brokentime.tm_mon+1, + brokentime.tm_mday, + brokentime.tm_hour, + brokentime.tm_min, + brokentime.tm_sec + ); + *ret = workspace; } else if (c && !strcmp(var, "UNIQUEID")) { snprintf(workspace, workspacelen -1, "%s", c->uniqueid); *ret = workspace; |