Mute Sound Card Line in on Console Call

I am using a server with a built in sound card to facilitate overhead paging. Using alsamixer I have configured the sound card to route sound form the line in on the sound card to the line out. The line out is then plugged into our overhead paging amp.
I have then configured extensions_custom.conf to allow me to page to the console by dialing *51. This is all working fine. However, when I dial *51, and music is being streamed in, the music continues to play, of course. So I attempted to use the system() command to run a script that will mute the line in and change the capture source before allowing the user to page, and then changes it back after they hang up. However, when I dial *51, the lines are not muted and you continue to hear the music both on the paging system and on the handset while you page.

Here are the config files as I have them right now:

Extension_custom.conf:

[from-internal-custom] exten => *51,1,TrySystem(/etc/asterisk/ringoff.txt) exten => *51,2,TrySystem(/etc/asterisk/lmute) exten => *51,3,Dial(console/dsp,20,A(beep)) exten => *51,4,TrySystem(/etc/asterisk/lunmute) exten => *51,5,Hangup()

Here is /etc/asterisk/lmute:

amixer -c 0 sset Line,0 mute amixer -c 0 sset CD,0 mute cap

Here is /etc/asterisk/lunmute:

[code]#bin/sh

amixer -c 0 sset Line,0 unmute cap
[/code]

And finally, here is the output of /var/log/asterisk/full when I execute *51:

[2010-09-07 06:51:26] VERBOSE[644] logger.c: -- Executing [*51@from-internal:1] TrySystem("SIP/9000-08e93f08", "/etc/asterisk/ringoff.txt") in new stack [2010-09-07 06:51:26] VERBOSE[563] logger.c: -- Remote UNIX connection [2010-09-07 06:51:26] VERBOSE[648] logger.c: -- Remote UNIX connection disconnected [2010-09-07 06:51:26] VERBOSE[644] logger.c: -- Executing [*51@from-internal:2] TrySystem("SIP/9000-08e93f08", "/etc/asterisk/lmute") in new stack [2010-09-07 06:51:26] VERBOSE[644] logger.c: -- Executing [*51@from-internal:3] Dial("SIP/9000-08e93f08", "console/dsp|20|A(beep)") in new stack [2010-09-07 06:51:26] WARNING[644] chan_oss.c: oss_request ty <console> data 0x0xb7717bf0 <dsp> [2010-09-07 06:51:26] VERBOSE[644] logger.c: == Console is full duplex [2010-09-07 06:51:26] VERBOSE[644] logger.c: << Call to device 'dsp' dnid '(null)' rdnis '(null)' on console from 'device' <9000> >> [2010-09-07 06:51:26] VERBOSE[644] logger.c: << Auto-answered >> [2010-09-07 06:51:26] VERBOSE[644] logger.c: -- Called dsp [2010-09-07 06:51:26] VERBOSE[644] logger.c: -- Console/dsp answered SIP/9000-08e93f08 [2010-09-07 06:51:26] VERBOSE[644] logger.c: -- <Console/dsp> Playing 'beep' (language 'en') [2010-09-07 06:51:29] VERBOSE[644] logger.c: << Hangup on console >> [2010-09-07 06:51:29] VERBOSE[644] logger.c: == Spawn extension (from-internal, *51, 3) exited non-zero on 'SIP/9000-08e93f08' [2010-09-07 06:51:29] VERBOSE[644] logger.c: -- Executing [h@from-internal:1] Macro("SIP/9000-08e93f08", "hangupcall") in new stack [2010-09-07 06:51:29] VERBOSE[644] logger.c: -- Executing [s@macro-hangupcall:1] GotoIf("SIP/9000-08e93f08", "1?skiprg") in new stack [2010-09-07 06:51:29] VERBOSE[644] logger.c: -- Goto (macro-hangupcall,s,4) [2010-09-07 06:51:29] DEBUG[644] app_macro.c: Executed application: GotoIf [2010-09-07 06:51:29] VERBOSE[644] logger.c: -- Executing [s@macro-hangupcall:4] GotoIf("SIP/9000-08e93f08", "1?skipblkvm") in new stack [2010-09-07 06:51:29] VERBOSE[644] logger.c: -- Goto (macro-hangupcall,s,7) [2010-09-07 06:51:29] DEBUG[644] app_macro.c: Executed application: GotoIf [2010-09-07 06:51:29] VERBOSE[644] logger.c: -- Executing [s@macro-hangupcall:7] GotoIf("SIP/9000-08e93f08", "1?theend") in new stack [2010-09-07 06:51:29] VERBOSE[644] logger.c: -- Goto (macro-hangupcall,s,9) [2010-09-07 06:51:29] DEBUG[644] app_macro.c: Executed application: GotoIf [2010-09-07 06:51:29] VERBOSE[644] logger.c: -- Executing [s@macro-hangupcall:9] Hangup("SIP/9000-08e93f08", "") in new stack [2010-09-07 06:51:29] VERBOSE[644] logger.c: == Spawn extension (macro-hangupcall, s, 9) exited non-zero on 'SIP/9000-08e93f08' in macro 'hangupcall' [2010-09-07 06:51:29] VERBOSE[644] logger.c: == Spawn extension (macro-hangupcall, s, 9) exited non-zero on 'SIP/9000-08e93f08'

Oh, yes, and I checked the permissions on lmute and lunmute:

root@pbx:/etc/asterisk $ ls -la l* -rwxrwxrwx 1 asterisk asterisk 60 Sep 3 15:07 lmute -rw-rw-r-- 1 asterisk asterisk 418 Sep 3 15:38 localprefixes.conf -rw-rw-r-- 1 asterisk asterisk 897 Oct 12 2008 logger.conf -rwxrwxrwx 1 asterisk asterisk 44 Sep 3 14:49 lunmute root@pbx:/etc/asterisk $

So I am stumped. Any ideas? Thank you.