[asterisk-bugs] [Asterisk 0016052]: Shell Function is missing and very needed in all editions.

Asterisk Bug Tracker noreply at bugs.digium.com
Sun Oct 11 09:35:28 CDT 2009


The following issue has been CLOSED 
====================================================================== 
https://issues.asterisk.org/view.php?id=16052 
====================================================================== 
Reported By:                falves11
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   16052
Category:                   Functions/NewFeature
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Asterisk Version:           1.4.27-rc2 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!): 221303 
Request Review:              
Resolution:                 no change required
Fixed in Version:           
====================================================================== 
Date Submitted:             2009-10-11 01:44 CDT
Last Modified:              2009-10-11 09:35 CDT
====================================================================== 
Summary:                    Shell Function is missing and very needed in all
editions.
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. 
====================================================================== 

---------------------------------------------------------------------- 
 (0112187) tilghman (administrator) - 2009-10-11 09:35
 https://issues.asterisk.org/view.php?id=16052#c112187 
---------------------------------------------------------------------- 
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 at digium:1] Answer("SIP/103-085237c8", "") in new
stack
    -- Executing [8159 at digium:2] Set("SIP/103-085237c8",
"test1=1255270909
") in new stack
    -- Executing [8159 at digium:3] System("SIP/103-085237c8", "date
--date="2009-10-11  9:21:49" +%s > /tmp/1255271450.1.date") in new stack
    -- Executing [8159 at digium:4] ReadFile("SIP/103-085237c8",
"test2=/tmp/1255271450.1.date") in new stack
    -- Executing [8159 at digium:5] System("SIP/103-085237c8", "rm -f
/tmp/1255271450.1.date") in new stack
    -- Executing [8159 at digium:6] NoOp("SIP/103-085237c8", "Compare
'1255270909
' to '1255270909
'") in new stack
 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-10-11 09:35 tilghman       Note Added: 0112187                          
2009-10-11 09:35 tilghman       Status                   new => closed       
2009-10-11 09:35 tilghman       Resolution               open => no change
required
======================================================================




More information about the asterisk-bugs mailing list