Summary:ASTERISK-14970: Shell Function is missing and very needed in all editions.
Reporter:Private Name (falves11)Labels:
Date Opened:2009-10-11 01:44:35Date Closed:2011-06-07 14:00:25
Versions:Frequency of
Description:Please look at the code below. I need to play this date, 2009-06-18 18:57, and the only way to use the function SayUnixTime is to use the Shell function before, according to Digium's support, not me.

exten => s,n,Set(ASTDATE=${SHELL(date --date="${ARG2}" +%s)})
exten => s,n,SayUnixTime(${ASTDATE},EST5EDT,ABdY \'digits/at\' IMp)

Therefore, we need the Shell function back in 1.4. It currently is only in Trunk, but it compiles perfectly in version 1.4, no changes needed. The Digium's engineer who took my case could not get the result back from a call to a linux function using any other trick.


please ask the engineer who worked on case MXU-362785 for more details. He solved my business problem.
Comments:By: Tilghman Lesher (tilghman) 2009-10-11 09:35:27

exten => 8159,1,Answer
exten => 8159,n,Set(test1=${SHELL(date --date="2009-10-11  9:21:49" +%s)})
exten => 8159,n,System(date --date="2009-10-11  9:21:49" +%s > /tmp/${UNIQUEID}.date)
exten => 8159,n,ReadFile(test2=/tmp/${UNIQUEID}.date)
exten => 8159,n,System(rm -f /tmp/${UNIQUEID}.date)
exten => 8159,n,NoOp(Compare '${test1}' to '${test2}')

   -- Executing [8159@digium:1] Answer("SIP/103-085237c8", "") in new stack
   -- Executing [8159@digium:2] Set("SIP/103-085237c8", "test1=1255270909
") in new stack
   -- Executing [8159@digium:3] System("SIP/103-085237c8", "date --date="2009-10-11  9:21:49" +%s > /tmp/1255271450.1.date") in new stack
   -- Executing [8159@digium:4] ReadFile("SIP/103-085237c8", "test2=/tmp/1255271450.1.date") in new stack
   -- Executing [8159@digium:5] System("SIP/103-085237c8", "rm -f /tmp/1255271450.1.date") in new stack
   -- Executing [8159@digium:6] NoOp("SIP/103-085237c8", "Compare '1255270909
' to '1255270909
'") in new stack