[asterisk-users] STRFTIME function declared in globals context
Warren Selby
wcselby at selbytech.com
Tue Jul 13 11:30:44 CDT 2010
I'm trying to declare a few date-related global variables to ease my
dialplan. When I declare the following in the [globals] context of
extensions.conf, I get unexpected results:
YEAR = ${STRFTIME(${EPOCH},,%Y)}
MONTH = ${STRFTIME(${EPOCH},,%m)}
DAY = ${STRFTIME(${EPOCH},,%d)}
TIMESTAMP = ${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}
If I evaluate these variables in the dialplan later, using
exten => 7777,n,Verbose(${TIMESTAMP} - ${YEAR} - ${MONTH} - ${DAY})
My output is as follows:
-- Executing [7777 at phones:3] Verbose("SIP/2625-0000d5f0", "Tue Jul 13
11:08:42 2010 - Tue Jul 13 11:08:42 2010 - Tue Jul 13 11:08:42 2010 - Tue
Jul 13 11:08:42 2010") in new stack
Tue Jul 13 11:08:42 2010 - Tue Jul 13 11:08:42 2010 - Tue Jul 13 11:08:42
2010 - Tue Jul 13 11:08:42 2010
However, the following line:
exten => 7777,n,Verbose(${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)} -
${STRFTIME(${EPOCH},,%Y)} - ${STRFTIME(${EPOCH},,%m)} -
${STRFTIME(${EPOCH},,%d)})
evaluates with what I expect:
-- Executing [7777 at phones:4] Verbose("SIP/2625-0000d5f0",
"20100713-110853 - 2010 - 07 - 13") in new stack
20100713-110853 - 2010 - 07 - 13
Is what I'm trying to do possible? It seems like it's at least recognizing
that I'm trying to grab a date, but it's not taking the date format
parameters that I want.
--
Thanks,
--Warren Selby
http://www.selbytech.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100713/68f58207/attachment.htm
More information about the asterisk-users
mailing list