Alvin Austin
2006-Dec-15 12:08 UTC
[asterisk-users] What's up with DATETIME and TIMESTAMP in Asterisk 1.4beta3 ?
Hello,
In Asterisk 1.4 beta 3, the UPGRADE.txt file says:
Variables:
* The builtin variables ${CALLERID}, ${CALLERIDNAME}, ${CALLERIDNUM},
${CALLERANI}, ${DNID}, ${RDNIS}, ${DATETIME}, ${TIMESTAMP},
${ACCOUNTCODE},
and ${LANGUAGE} have all been deprecated in favor of their related
dialplan
functions. You are encouraged to move towards the associated dialplan
function, as these variables will be removed in a future release.
However, neither the function or application for either of TIMESTAMP or
DATETIME seems to work in 1.4beta3...
exten => *333,1,NoOp(DATETIME() : ${DATETIME()})
exten => *333,n,NoOp(DATETIME : ${DATETIME})
exten => *333,n,NoOp(TIMESTAMP() : ${TIMESTAMP()})
exten => *333,n,NoOp(TIMESTAMP : ${TIMESTAMP})
Asterisk 1.2.9.1:
-----------------
Dec 15 12:56:26 ERROR[26373]: pbx.c:1383 ast_func_read: Function
DATETIME not registered
-- Executing NoOp("<channel>", "DATETIME() : 0")
in new stack
-- Executing NoOp("<channel>", "DATETIME :
20061215-12:56:26") in
new stack
Dec 15 12:56:26 ERROR[26373]: pbx.c:1383 ast_func_read: Function
TIMESTAMP not registered
-- Executing NoOp("<channel>", "TIMESTAMP() : 0")
in new stack
-- Executing NoOp("<channel>", "TIMESTAMP :
20061215-125626") in new
stack
Asterisk 1.4.0-beta3:
---------------------
[Dec 15 13:59:52] ERROR[28236]: pbx.c:1497 ast_func_read: Function
DATETIME not registered
-- Executing [*333@<context>:1] NoOp("<channel>",
"DATETIME() : ")
in new stack
-- Executing [*333@<context>:2] NoOp("<channel>",
"DATETIME : ") in
new stack
[Dec 15 13:59:52] ERROR[28236]: pbx.c:1497 ast_func_read: Function
TIMESTAMP not registered
-- Executing [*333@<context>:3] NoOp("<channel>",
"TIMESTAMP() : ")
in new stack
-- Executing [*333@<context>:4] NoOp("<channel>",
"TIMESTAMP : ") in
new stack
Any ideas?
Thanks,
Alvin
Anselm Martin Hoffmeister
2006-Dec-15 12:32 UTC
[asterisk-users] What's up with DATETIME and TIMESTAMP in Asterisk 1.4beta3 ?
Am Freitag, den 15.12.2006, 13:08 -0600 schrieb Alvin Austin:> Hello, > > In Asterisk 1.4 beta 3, the UPGRADE.txt file says: > > Variables: > * The builtin variables ${CALLERID}, ${CALLERIDNAME}, ${CALLERIDNUM}, > ${CALLERANI}, ${DNID}, ${RDNIS}, ${DATETIME}, ${TIMESTAMP}, > ${ACCOUNTCODE}, > and ${LANGUAGE} have all been deprecated in favor of their related > dialplan > functions. You are encouraged to move towards the associated dialplan > function, as these variables will be removed in a future release. > > However, neither the function or application for either of TIMESTAMP or > DATETIME seems to work in 1.4beta3... > > exten => *333,1,NoOp(DATETIME() : ${DATETIME()}) > exten => *333,n,NoOp(DATETIME : ${DATETIME}) > exten => *333,n,NoOp(TIMESTAMP() : ${TIMESTAMP()}) > exten => *333,n,NoOp(TIMESTAMP : ${TIMESTAMP})http://www.voip-info.org/wiki/index.php?page=Asterisk+func+strftime will probably contain the information you want. To sum up, DATETIME and TIMESTAMP are gone, use the ${EPOCH} for the seconds since 1970-01-01,00:00:00 and the STRFTIME to format that data. STRPTIME can be used to calculate the epoch value of any date-time-string. HTH Anselm