summaryrefslogtreecommitdiff
path: root/pbx.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2003-12-01 02:47:19 +0000
committerMark Spencer <markster@digium.com>2003-12-01 02:47:19 +0000
commit4468124abd577221fb56fe014111096f6a536f4a (patch)
tree18d0b78596848a8d31b8b3e1943db521558be06e /pbx.c
parente1f471f89c8c9f7138a2a33ddec0886faa9df858 (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-xpbx.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/pbx.c b/pbx.c
index ccc42c94f..8c4d1ca44 100755
--- a/pbx.c
+++ b/pbx.c
@@ -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;