[asterisk-bugs] [Asterisk 0017637]: [patch] STRFTIME in globals using commas returns incorrect value
Asterisk Bug Tracker
noreply at bugs.digium.com
Wed Aug 18 07:55:39 CDT 2010
The following issue has been UPDATED.
======================================================================
https://issues.asterisk.org/view.php?id=17637
======================================================================
Reported By: wcselby
Assigned To:
======================================================================
Project: Asterisk
Issue ID: 17637
Category: Core/Configuration
Reproducibility: always
Severity: minor
Priority: normal
Status: closed
Asterisk Version: 1.4.33.1
JIRA:
Regression: No
Reviewboard Link:
SVN Branch (only for SVN checkouts, not tarball releases): N/A
SVN Revision (number only!):
Request Review:
Resolution: suspended
Fixed in Version:
======================================================================
Date Submitted: 2010-07-13 15:36 CDT
Last Modified: 2010-08-18 07:55 CDT
======================================================================
Summary: [patch] STRFTIME in globals using commas returns
incorrect value
Description:
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
======================================================================
----------------------------------------------------------------------
(0126080) pabelanger (manager) - 2010-08-18 07:55
https://issues.asterisk.org/view.php?id=17637#c126080
----------------------------------------------------------------------
Suspended due to lack of activity. Please request a bug marshal in
#asterisk-bugs on the IRC network irc.freenode.net to reopen the issue
should you have the additional information requested.
Further information can be found at
http://www.asterisk.org/developers/bug-guidelines
Issue History
Date Modified Username Field Change
======================================================================
2010-08-18 07:55 pabelanger Note Added: 0126080
2010-08-18 07:55 pabelanger Status feedback => closed
2010-08-18 07:55 pabelanger Resolution open => suspended
======================================================================
More information about the asterisk-bugs
mailing list