Index: apps/app_mp3.c =================================================================== --- apps/app_mp3.c (revision 232226) +++ apps/app_mp3.c (working copy) @@ -104,6 +104,9 @@ for (x=STDERR_FILENO + 1;x<256;x++) { close(x); } + + setpgid(0, getpid()); + /* Execute mpg123, but buffer if it's a net connection */ if (!strncasecmp(filename, "http://", 7)) { /* Most commonly installed in /usr/local/bin */ @@ -121,7 +124,7 @@ /* As a last-ditch effort, try to use PATH */ execlp("mpg123", "mpg123", "-q", "-s", "-f", "8192", "--mono", "-r", "8000", filename, (char *)NULL); } - ast_log(LOG_WARNING, "Execute of mpg123 failed\n"); + fprintf(stderr, "Execute of mpg123 failed\n"); _exit(0); } @@ -244,8 +247,12 @@ close(fds[0]); close(fds[1]); - if (pid > -1) - kill(pid, SIGKILL); + if (pid > 0) { + killpg(pid, SIGTERM); + usleep(100000); + killpg(pid, SIGKILL); + waitpid(pid, NULL, 0); + } if (!res && owriteformat) ast_set_write_format(chan, owriteformat);