Summary:ASTERISK-04373: [needs testing] Jukebox Music Manager AGI Script
Reporter:Justin R. Tunney (jtunney)Labels:
Date Opened:2005-06-08 08:51:12Date Closed:2006-03-06 17:40:25.000-0600
Versions:Frequency of
Environment:Attachments:( 0) jukebox.agi
( 1) jukebox-0.2.agi
( 2) README.jukebox
Description:This script, when run on a channel, will list off all the MP3 files and directories in a folder you specify.  All you have to do is point the script to your music folder.

exten => 68742,1,Answer()
exten => 68742,2,agi,jukebox.agi|/home/justin/Music|p
exten => 68742,3,Hangup()

It uses Festival's text2wave program to cache ulaw sound clips of directory/file names.  Uses the MP3Player app for playing MP3 files.

You can navigate folders easily, for example you can press '*' to go up a directory and #<number> to filter files based on their names.  For more information, read the comments in the source.
Comments:By: Clod Patry (junky) 2005-06-08 08:56:29

great, i was thinking about something like app_jukebox.c for that.

But that's excellent, i'll give some tests soon.

By: Olle Johansson (oej) 2005-06-09 00:53:07

Is this code disclaimed?

By: Clod Patry (junky) 2005-06-12 10:19:49

ive got just this:
   -- Executing AGI("SIP/10-19d9", "jukebox.agi") in new stack
   -- Launched AGI Script /var/lib/asterisk/agi-bin/jukebox.agi
   -- AGI Script Executing Application: (Playback) Options: (/tmp/jukeboxcache/jukebox_greet)
   -- Playing '/tmp/jukeboxcache/jukebox_greet' (language 'en')
   -- AGI Script jukebox.agi completed, returning 0

so i just heard a simple "welcome to the asterisk jukebox".
and ive my files created in /tmp/jukeboxcache/ , maybe any error audios could be  stream (you didnt specify a directory) or something like that.

and called like that:
   -- Executing AGI("SIP/10-07a2", "jukebox.agi|/var/lib/asterisk/mohmp3/|p") in new stack
   -- Launched AGI Script /var/lib/asterisk/agi-bin/jukebox.agi
   -- AGI Script Executing Application: (Playback) Options: (/tmp/jukeboxcache/jukebox_greet)
   -- Playing '/tmp/jukeboxcache/jukebox_greet' (language 'en')
   -- Playing '/tmp/jukeboxcache/Stereophonics_-_Pick_A_Part_That_s_New.mp3' (language 'en')
   -- Playing '/tmp/jukeboxcache/jukebox_7' (language 'en')
   -- AGI Script jukebox.agi completed, returning 0

ive got no audio, even if im pressing 1,2,3 etc.

By: Justin R. Tunney (jtunney) 2005-06-13 16:28:27

I had a mysterious problem today where playback wasn't working in Asterisk Calling Card and Jukebox (I didn't test playback from an extensions file).  I just rebooted my machine and it worked again.

Do you have mpg123 installed and working?  I haven't tested with SIP yet but I don't see any reason why it wouldn't work over a different type of channel.

By: Clod Patry (junky) 2005-06-13 16:56:43

yes, mpg123 works fine.

By: Michael Jerris (mikej) 2005-06-26 18:42:25

Suspended due to 2 weeks no response on disclaimer.

By: Justin R. Tunney (jtunney) 2005-11-04 16:36:47.000-0600

Disclaimer faxed in today

By: Russell Bryant (russell) 2005-12-26 10:47:21.000-0600

Can someone please test this and verify that it is working correctly?  I would like to see a successful test report before merging it.

By: Jason Parker (jparker) 2006-01-13 02:15:55.000-0600

Okay, I tested this tonight, and it works surprisingly well, I must admit.

A few things though...

1) You should explain how to use this, here on the bug tracker, and perhaps create a README file for it?

2) I think it would be better to use the file extension .ul instead of .ulaw - sox seems to choke on this otherwise.

3) It would be great if it said "Press 1 for the directory abc" "Press 2 to play xyz", instead of just "Press 1 for abc" "Press 2 for xyz", etc.

Besides those little things, I really don't have any complaints...great job!

By: Jason Parker (jparker) 2006-01-13 02:19:05.000-0600

In fact...forget 1) - I must've read the file wrong the first time...it's documented fairly well.

By: Matt O'Gorman (mogorman) 2006-01-13 09:44:05.000-0600

i think it needs better error output as it will not seem to play long file dir names, and does not error out and does not error out when i feed it a bad mp3, which seems like all i have on this box as they do not seem to play.

By: Justin R. Tunney (jtunney) 2006-01-26 15:27:23.000-0600

- Jukebox now caches in /var/jukeboxcache to avoid /tmp cleanups

- Jukebox will now say, "for the xxx folder" and "to play xxx"

- Now uses .ul extensions

- New README file

mogorman, you won't get any of the fancy debug messages if you're using asterisk -r

By: Tilghman Lesher (tilghman) 2006-03-06 17:40:25.000-0600

Committed to trunk