[asterisk-bugs] [JIRA] (ASTERISK-27240) SHELL function it's returning wrong value

Sean Bright (JIRA) noreply at issues.asterisk.org
Fri Sep 1 12:51:09 CDT 2017


     [ https://issues.asterisk.org/jira/browse/ASTERISK-27240?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Bright closed ASTERISK-27240.
----------------------------------

    Resolution: Not A Bug

Asterisk 11 is no longer supported. The {{SHELL}} function may be poorly named - it does not do what you think it does. It fires off a specified _process_, not arbitrary shell code. If you want this to work, you should instead do something like:

{noformat}
exten => 1,1,NoOp(${SHELL(bash -c '[[ "102,101" == *102* ]] && echo -n 1 || echo -n 0')})
{noformat}

> SHELL function it's returning wrong value
> -----------------------------------------
>
>                 Key: ASTERISK-27240
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27240
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Functions/func_shell
>    Affects Versions: 11.6.0
>         Environment: Distro: Debian GNU/Linux 8.5 (jessie)
> Kernel: Linux XXX 4.2.8-1-pve
> Asterisk: Asterisk certified/11.6-cert13 built by root @ XXX on a x86_64 running Linux
>            Reporter: Javier Valencia
>            Severity: Minor
>
> Using a SHELL function:
> {noformat}
> exten => 1,1,NoOp(${SHELL([[ "102,101" == *102* ]] && echo -n 1 || echo -n 0)})
> {noformat}
> SHELL function always return 0, and must be 1.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list