[asterisk-users] STRFTIME function declared in globals context

Danny Nicholas danny at debsinc.com
Tue Jul 13 13:49:25 CDT 2010


 

 

  _____  

From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Warren Selby
Sent: Tuesday, July 13, 2010 1:40 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] STRFTIME function declared in globals context

 

On Tue, Jul 13, 2010 at 1:15 PM, Tilghman Lesher <tlesher at digium.com> wrote:

When you load the dialplan, do you see the global variables getting set?
That would at least tell you whether the problem lies at the point where the
values are loaded into memory, or later, at evaluation time.




  == Setting global variable 'YEAR' to 'Tue Jul 13 13:36:55 2010'
  == Setting global variable 'MONTH' to 'Tue Jul 13 13:36:55 2010'
  == Setting global variable 'DAY' to 'Tue Jul 13 13:36:55 2010'
  == Setting global variable 'TIMESTAMP' to 'Tue Jul 13 13:36:55 2010'

So apparently they're loaded into memory when the dialplan is reloaded?

-- 
Thanks,
--Warren Selby
http://www.selbytech.com

 

--

Since you never know when you'll need this, I slapped the code into my
1.4.30.  

Here is the "corrected" code that works

YEAR = ${STRFTIME(${EPOCH}||%Y)}

MONTH = ${STRFTIME(${EPOCH}||%m)}

DAY = ${STRFTIME(${EPOCH}||%d)}

TIMESTAMP = ${STRFTIME(${EPOCH}||%Y%m%d-%H%M%S)}

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100713/02ef8c0f/attachment.htm 


More information about the asterisk-users mailing list