[asterisk-bugs] [JIRA] (ASTERISK-22985) System() doesn't handle echo -e like it should

Pierre (JIRA) noreply at issues.asterisk.org
Fri Dec 13 12:57:03 CST 2013


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

Pierre updated ASTERISK-22985:
------------------------------

    Description: 
The following dialplan snippet
{code:title=extensions.conf|borderStyle=solid}
same => n(setupCallback),System(echo -e "Channel: SIP/${paidTrunkPrefix}${trunkUser}/${routeType}${CALLERID(num)}\\nCallerID: \"Callback\" <155551234>\\nMaxRetries: 2\\nRetryTime: 10\\nWaitTime: 15\\nContext: CallbackAnswer\\nExtension: ${trunkUser}\\nPriority: 1" > /tmp/callback.call)
{code}
doesn't behave like expected. The "-e" is output to the .call file resulting in an invalid syntax for a .call file. The line return and escaped quotes are parsed as they should, the only issue is that the "-e" argument is inserted at the beginning of the .call file

If I run the exact same command in the shell, it does what is expected: line returns parsed etc without inserting the "-e" argument in the output file.

I did not have this problem using Asterisk 11.2.1. I talked about it on IRC, a user tried with the latest SVN of 11 and had the same problem.


*** WORKAROUND FOUND ***
Thanks to user newtonr on the IRC, replacing echo by /bin/echo fixes it. I'll leave it up to the devs to figure out if this is intentional or not.

  was:
The following dialplan snippet
{code:title=extensions.conf|borderStyle=solid}
same => n(setupCallback),System(echo -e "Channel: SIP/${paidTrunkPrefix}${trunkUser}/${routeType}${CALLERID(num)}\\nCallerID: \"Callback\" <15143603425>\\nMaxRetries: 2\\nRetryTime: 10\\nWaitTime: 15\\nContext: CallbackAnswer\\nExtension: ${trunkUser}\\nPriority: 1" > /tmp/callback.call)
{code}
doesn't behave like expected. The "-e" is output to the .call file resulting in an invalid syntax for a .call file. The line return and escaped quotes are parsed as they should, the only issue is that the "-e" argument is inserted at the beginning of the .call file

If I run the exact same command in the shell, it does what is expected: line returns parsed etc without inserting the "-e" argument in the output file.

I did not have this problem using Asterisk 11.2.1. I talked about it on IRC, a user tried with the latest SVN of 11 and had the same problem.


*** WORKAROUND FOUND ***
Thanks to user newtonr on the IRC, replacing echo by /bin/echo fixes it. I'll leave it up to the devs to figure out if this is intentional or not.

    
> System() doesn't handle echo -e like it should
> ----------------------------------------------
>
>                 Key: ASTERISK-22985
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-22985
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_system
>    Affects Versions: 10.8.0, 11.6.0
>         Environment: Debian 7.2 32bits
>            Reporter: Pierre
>
> The following dialplan snippet
> {code:title=extensions.conf|borderStyle=solid}
> same => n(setupCallback),System(echo -e "Channel: SIP/${paidTrunkPrefix}${trunkUser}/${routeType}${CALLERID(num)}\\nCallerID: \"Callback\" <155551234>\\nMaxRetries: 2\\nRetryTime: 10\\nWaitTime: 15\\nContext: CallbackAnswer\\nExtension: ${trunkUser}\\nPriority: 1" > /tmp/callback.call)
> {code}
> doesn't behave like expected. The "-e" is output to the .call file resulting in an invalid syntax for a .call file. The line return and escaped quotes are parsed as they should, the only issue is that the "-e" argument is inserted at the beginning of the .call file
> If I run the exact same command in the shell, it does what is expected: line returns parsed etc without inserting the "-e" argument in the output file.
> I did not have this problem using Asterisk 11.2.1. I talked about it on IRC, a user tried with the latest SVN of 11 and had the same problem.
> *** WORKAROUND FOUND ***
> Thanks to user newtonr on the IRC, replacing echo by /bin/echo fixes it. I'll leave it up to the devs to figure out if this is intentional or not.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list