[Asterisk-Users] Sound Quality - Part 2 (mp3)

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Mon May 12 11:44:37 MST 2003


On Monday 12 May 2003 12:57, Edwin A. Silva wrote:
> I was getting this too, it's probably caused because there is
> no code in asterisk to shutdown mpg123 when you restart or
> shutdown asterisk.  I havn't gotten around to it, but a simple
> shell script that does a ps and greps for mpg123 and pipes it
> word count would do the job. If u have moh configured
> propperly you should only ever have 2 running proccesses of
> mpg123 if the wc is > 2 then you could kill the pids.  I
> wouldn't be too hard to do at all and I'm sure Mark could add
> very easily to the shutdown and restart scripts.

It's not the right way to do it, though.  Given that you could be
running mpg123 for more than one purpose on a machine, killing
all processes matching mpg123 is overkill (and could be
disruptive to other tasks).  The pid for each mpg123 process is
already stored in a linked-list structure in res/musiconhold, so
you would simply need to look to see if any pids are allocated
within that structure and if so, send a SIGKILL to each of them.

-Tilghman




More information about the asterisk-users mailing list