diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-12-01 02:47:19 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-12-01 02:47:19 +0000 |
commit | 221763ce1a733fe2a2a3818f5ee82ac9df643877 (patch) | |
tree | 18d0b78596848a8d31b8b3e1943db521558be06e /pbx.c | |
parent | c8c98c2ede89b4c467f30cd62b685ac9768bbf32 (diff) |
Add ${TIMESTAMP} (bug #607) and don't ever ast_log from within handler
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1805 f38db490-d61c-443f-a65b-d21fe96a405b
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; |