Can't figure out System application

I’m using trixbox 2.6 and want to add an extension that I can dial from an internal phone to perform a linux command. It should be simple given the System application. So I add this to my extensions_custom.conf file under the [from-internal-custom] context

exten => 333,1,Answer
exten => 333,n,Wait(3)
exten => 333,n,System(touch /usr/local/sbin/lptout)
exten => 333,n,Wait(3)
exten => 333,n,Hangup

Basically a command to time stamp a file named lptout just to see if it works. It does not. I’m not getting an error…What can be preventing the command?

This is what I get from the Asterisk CLI
– Executing [333@from-internal:1] Answer(“SIP/108-097e4a98”, “”) in new stack
– Executing [333@from-internal:2] Wait(“SIP/108-097e4a98”, “3”) in new stack
– Executing [333@from-internal:3] System(“SIP/108-097e4a98”, “touch /usr/local/sbin/lptout”) in new stack
– Executing [333@from-internal:5] Wait(“SIP/108-097e4a98”, “3”) in new stack
– Executing [333@from-internal:6] Hangup(“SIP/108-097e4a98”, “”) in new stack
== Spawn extension (from-internal, 333, 6) exited non-zero on ‘SIP/108-097e4a98’
– Executing [h@from-internal:1] Macro(“SIP/108-097e4a98”, “hangupcall”) in new stack
– Executing [s@macro-hangupcall:1] ResetCDR(“SIP/108-097e4a98”, “w”) in new stack
– Executing [s@macro-hangupcall:2] NoCDR(“SIP/108-097e4a98”, “”) in new stack
– Executing [s@macro-hangupcall:3] GotoIf(“SIP/108-097e4a98”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,6)
– Executing [s@macro-hangupcall:6] GotoIf(“SIP/108-097e4a98”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [s@macro-hangupcall:9] GotoIf(“SIP/108-097e4a98”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,11)
– Executing [s@macro-hangupcall:11] Hangup(“SIP/108-097e4a98”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘SIP/108-097e4a98’ in macro ‘hangupcall’
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/108-097e4a98

Thanks

Hi

I assume asterisk is running as the user asterisk. and you have checked that teh user asterisk has permission to write to that file and directory ?

also its good to use the full path for the command.

Ian

[quote=“ianplain”]Hi

I assume asterisk is running as the user asterisk. and you have checked that teh user asterisk has permission to write to that file and directory ?

also its good to use the full path for the command.

Ian[/quote]

Of course you are right. the user ‘asterisk’ didn’t have permission to access what I wanted it to.

I used chmod +s (filename) to allow the file to run as root and now it works.
Thank you.