I am trying to create a small web application to interact with the Asterisk telephony platform. There is a lot of similiar stuff out there but I want the learning experience of making my own.
Here is what I have now: A simple python script that allows someone to interact with the manager interface via the command line. Basically how the script works is: 1) Connects to the Asterisk Manager Interface. 2) Gets two phone numbers from the user on the CLI. 3) Originates the two calls 4) Brings the originated calls into a common meetme conference. 5) A 'while' loop waits for input from the user. Only characters a-z are allowed. 6) "a-z" correspond to .WAV files that are played or "injected" into the conference by the use of originating another local extension.
To me it is kinda neat and now I want to do the same exact thing from a web app but I don't know where to start. What languages would I need to use? I know basic html and have played with javascript. What techniques would be required to pass form input variables to the python script on the server (web server and asterisk server are the same machine)? CGI? What about using PHP? I will probably need to learn that at somepoint... If I use PHP can I still "call" the python script and pass values to it? I was hoping to use javascript eventually to allow the user to play a sound that corresponds to a button (just like a character in the command line version) without hitting submit but plan on just getting it to work for now. I guess this question is also turning into "Should I just learn PHP and drop the python?" I feel that I could really add to my current telephony skill-set (and have fun... this Asterisk stuff is a blast) by being able to build web based tools that interact with Asterisk (maybe Freeswitch too).
Any hints or guidance would be greatly appreciated.
I'd recommend just wrapping the code you have in a wsgi interface, which is python standard for web services (something like cgi but with functions instead of programs, so it has simpler interface and can be precompiled in the web server).
The WSGI web contains links to many python web application frameworks too, so look at them and pick one. Django, Pylons or TurboGears seem to be the more popular ones and Bottle is great for quickly putting together smaller web applications. You might eventually want to also have a look at Google App Engine, which provides somewhat restricted python environment very fast hosting.
Generally python has great web frameworks, is usually faster than PHP and you can use the same skills on and off the web, while PHP is mostly useless outside of web. Also with python, you won't learn to mix HTML with code (as in PHP), which you'd have to unlearn if you ever get to work together with a designer.