[Asterisk-Users] Mplayer as replacement to mgp123 in MP3Player cmd

cmisip cmisip at mchsi.com
Sun Aug 28 10:56:53 MST 2005


There is a patch to mplayer that allows it to suppress stdout messages
and instead output pcm data to stdout.  I managed to get it working with
app_mp3.c and seems like it is working fine.  All that was needed was a
change in the execl line and a slight increase in timeout value.  I have
only done limited testing.  If mplayer is able to replace mpg123 without
issues, this opens up a whole lot of media that can be piped through
Asterisk.


I want to be able to send a dtmf key to asterisk and have mplayer
forward or rewind.

I dont know much about all this stuff ( I really am not a programmer )
but I have a lot of interest in it.  I use asterisk to play podcasts on
my cell phone (podcasts on the road) and the forward rewind feature
would be nice.  

Mplayer has a -slave command that allows it to read commands from stdin
I think. It also has the -input parameter which allows it to read
commands from a fifo.  I could get the -input  to work on the command
line sending commands to the fifo with bash echo.  However, when I am
actually listening to a podcast from MP3Player in asterisk, sending a
command to the fifo would cause MP3Player to respond to the command,
continue playback for a short time and then exit with a "No More MP3"
message and a bunch of "Dropping voice to exceptionally long queue...".

Any ideas on how a forward, rewind feature can be implemented on
MP3Player cmd?

I have successfully used a bash script to interact with asterisk agi.  

My idea is to modify the app_mp3.c program to allow for a second
parameter to MP3Player to pass file position value.  Have app_mp3.c
store the value of f->subclass into res and exit with this value
whenever a key is pressed.  Bash could read this value and restart the
MP3Player application with a computed fileposition value as second
parameter.

This should achieve the result I want.  Is there a simpler way?

Any help or insight is appreciated.

Thanks.






More information about the asterisk-users mailing list