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:
- Someone picks up an extension on the PBX,
- 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),
- 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,
- 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!