Muting soundcard via system() not working right

Hi all,
I have FreePBX (Asterisk version 11.4.0) up and running with roughly 20 SIP phones and one outside analog line. I have an extension setup as a paging extension (extension ‘8’). It works if I manually unmute/mute the soundcard in alsamixer: I can call the extension, hear the beep, and talk through the speakers. I am trying to have the sound card unmuted/muted automatically when the extension is dialed. Here is my extensions_custom.conf file:

[from-internal-custom] exten => 8,1,System(/usr/bin/amixer -c 0 sset 'Audigy Analog/Digital Output Jack' unmute) same => n,Dial(console/dsp,,gA(beep)) same => n,System(/usr/bin/amixer -c 0 sset 'Audigy Analog/Digital Output Jack' mute) same => n,Hangup
Here is the output of the log file when I dial the extension:

[date] WARNING[5361][C-0000001e]: chan_oss.c:853 ss_request: oss_request ty <console> data 0x0x7f4478001e90 <dsp> [date] NOTICE[5361][c-0000001e]: console_video.c:137 console_video_start: voice only, console video support not present
I have tried several variants on the system() call with no significant results. I have tried only muting or only unmuting the card in the extensions_custom.conf file to see if the mute/unmute happened too fast for me to catch it. I can run the same command from the asterisk cli using the ! and it will run fine. I can see it unmute/mute the card in alsamixer. Is there something glaringly obvious that I am missing? Is there a different way to make the system() call? Any help is greatly appreciated!!

I have some updated information. I am currently running this script to unmute the sound card:

unmute.sh #!/bin/bash amixer -c 0 sset 'Audigy Analog/Digital Output Jack' unmute
I can run /etc/asterisk/unmute.sh > /etc/asterisk/tmplog.txt from the bash command prompt and get the results of the command in the tmplog.txt file (i.e. the sound card Audigy channel is unmuted).
However, if I execute the script from the dial plan it fails and all I get in the tmplog.txt file is the output of amixer as if I had run it with no parameters. The parameters seem to be missing when the file is called from within the dial plan. Here is the dial plan call:

[from-internal-custom] exten => 8,1,Answer() exten => 8,2,TrySystem(/etc/asterisk/unmute.sh > /etc/asterisk/tmplog.txt) exten => 8,3,Dial(console/dsp,,gA(beep)) exten => 8,4,Hangup
I’ll post more information as I get it.

More information:
I can run this at the asterisk cli and the sound card is unmuted:

This exact same shell script when called from within the dial plan gives me this:

[code]Usage: amixer [command]

Available options:
-h,–help this help
-c,–card N select the card
-D,–device N select the device, default ‘default’
-d,–debug debug mode
-n,–nocheck do not perform range checking
-v,–version print version of this program
-q,–quiet be quiet
-i,–inactive show also inactive controls
-a,–abstract L select abstraction level (none or basic)
-s,–stdin Read and execute commands from stdin sequentially
-R,–raw-volume Use the raw value (default)
-M,–mapped-volume Use the mapped volume

Available commands:
scontrols show all mixer simple controls
scontents show contents of all mixer simple controls (default command)
sset sID P set contents for one mixer simple control
sget sID get contents for one mixer simple control
controls show all controls for given card
contents show contents of all controls for given card
cset cID P set control contents for one control
cget cID get control contents for one control
[/code]
…and this is the call

exten => 8,1,Answer() same => n,System(/etc/asterisk/unmute.sh)

It appears that somewhere the System() command does SOMETHING to the call. Otherwise, why would it fail?

Freepbx runs as asterisk user so check if asterisk user can use the device.