Problem with System()

This is defined in extensions.conf

exten => 500,1,NoOp(Starting Cisco RTP Paging Test)
same => n,Answer()
same => n,System(/usr/local/bin/rtptransmit -f /home/test/test.wav -u test -p test 172.16.160.94)
same => n,Hangup()

rtptransmit sends the test.wav perfectly to the phone at .94, the phone goes off hook, plays the file, then goes back on hook.

The command /usr/local/bin/rtptransmit -f /home/test/test.wav -u test -p test 172.16.160.94

runs perfectly at the command line under the root user. rtptransmit is a python script.

under asterisk a call to 500 runs the command, the phone goes off hook - then the command fails nothing is played and the phone goes back on hook.

The docs here:

System - Asterisk Documentation

don’t say much. Any suggestions? I’m thinking this is a permissions thing…

Any output in the logs?

What user is asterisk running as?

Can you run other things with the System() app?

The System dialplan app runs the argument in a shell so try this from the command line and see what happens…

/bin/sh -c /usr/local/bin/rtptransmit -f /home/test/test.wav -u test -p test 172.16.160.94

Executing your command in a shell using sudo –user=<the-user-executing-the-asterisk-daemon> <your-command>may yield clues.

Using env –ignore-environment <your-command> may also yield clues.