[PROJECT] Trying to set up a jukebox + dialout system

Tags: #<Tag:0x00007f7036c20260> #<Tag:0x00007f7036c20058>

(Prehensile) #1

Hey all. I’m new to FreePBX & Asterisk, but I’m a pretty competent programmer.

I’m currently working with a sound artists collective, and we’re trying to set up a system with the following user flow:

  1. Someone picks up an extension on the PBX,
  2. The extension is routed to one of a number of audio sources, at random (this is implemented as per this thread, using an AGI script and MP3Player),
  3. if someone starts to press numbers on the extension, this is interpreted as their starting to dial a number:
    3a) the first pressed number interrupts playback, and is used as the first digit of the dialled number,
    3b) subsequent number presses are interpreted as continuing to dial the number,
  4. after the user has finished dialling (e.g no more keypresses after a short timeout), the number is connected:
    4a) numbers beginning 0, 9 or 1 are interpreted as outgoing calls, and routed to a suitable trunk,
    4b) other numbers are interpreted as calls to other extensions on the PBX, and routed as such.

As you can see, I’ve got 2) working, but I’m at a bit of a loss as to how to implement the rest. I can probably work out 1), but the flow through 3 and 4 has been hard to work out.

Could anyone make suggestions, or point me in the direction of useful docs / tutorials? I’m not asking anyone to solve the whole thing for me, but I’m finding it quite hard to reason about Asterisk and I’d appreciate nudges in the right direction. Thanks!

(Adolfo) #2

Probably not it’s intended purpose, but instead of using trunks you could use conference bridges.
You can setup a conf bridge to play MoH when configured such that there is only one participant or leader wait.
So you could setup multiple conf bridges with different MoH, and whenever an extension calls each of those conf bridges it will play MoH indefinitely.