B.70. MP3Player()

Plays an MP3 file or stream.
Uses mpg123[67], to play back an MP3 to the caller. The filename may also be a URL. The caller may interrupt playback by pressing any key.
Asterisk is sensitive to the version of mpg123 used. At the time of this writing the most stable version was 0.59r; using other versions may produce unexpected results.


The popular alternative to mpg123, mpg321, does not work reliably with Asterisk.
Returns -1 if the channel is hung up, otherwise returns 0.
; play a local MP3 file:
exten => 123,1,Answer()
exten => 123,n,MP3Player(test.mp3)

; play an MP3 stream:
exten => 123,1,Answer()
exten => 123,n,MP3Player(http://server.tld/test.mp3)


Internal help for this application in Asterisk 1.4:
  -= Info about application 'MP3Player' =- 

Play an MP3 file or stream

  MP3Player(location) Executes mpg123 to play the given location,
which typically would be a filename or a URL. User can exit by pressing
any key on the dialpad, or by hanging up.
diff output to internal help in Asterisk 1.2:
- none -