I need to create a PHP Twilio script that allows a user to join a conference call using a registered PIN in a database.
The script must run on a basic AWS BitNami LAMP stack (http://bitnami.com/stack/lamp#). This is already installed an running.
We only require basic HTML and the backend. No frontend is required.
PART 1, A TWIML SCRIPT TO SET UP THE CALL:
1. A caller dials a Twilio account number (use a trial account for the demo)
2. The caller is then prompted to "Please enter your 6-digit pin, followed by the hash sign"
3. A caller enters his/her 6 digit pin. They do not need to wait for the intro message to finish. They do not need to press hash even through instructed; the script moves on as soon as they have entered 6 digits.
4. This pin is checked against a database of active pins (see attached demo SQL file).
5. If the pin is not identified as active, the caller is returned with <say> "You have entered an invalid pin, please try again" and prompted to enter their pin. This continues indefinitely until the caller hangs up, or they enter an active pin.
6. If the pin is active, the user is placed into an active conference that is unique to that PIN.
7. Before being placed into conference, the user is prompted to record their name, followed by pressing the hash sign. The recording ends after 5 secs automatically (or 2 secs no sound) if the hash sign is not pressed.
8. On entering the call, the user's recorded name is announced the the call "[BEEP], [NAME] has joined the conference".
9. Any other users that phone and enter the same pin, should be entered into the same conference room (up to Twilio's maximum of 40) the same way. (One solution might involve the use of a FriendlyName "conference-[PIN]" where [PIN] is the user's pin number: this is up to you, each room needs to be unique though)
10. The conference should be unmoderated (all participants can speak and hear at the same time) and active as soon as the first person enters, and closed when the last person leaves.
11. If the conference is full (i.e. 40 participants), an error message is delivered <say> "Sorry, this conference has reached the maximum number of participants, please enter another pin", and the user is returned to the "Please enter your 6-digit PIN..." prompt.