Before we get too far into exploring the Asterisk GUI (or developing your own), it’s important to understand the flow of information between the client (the web browser) and Asterisk. Since these interfaces are Ajax applications, there are a lot of pieces that aren’t immediately obvious. The flow of control goes something like this: |
• The browser “surfs to” the URL for your management application. • Asterisk’s web server sends the browser an HTML page, libraries, and the appli- |
cation itself (which is written in JavaScript and makes heavy use of Ajax). |
• The user interacts with the browser; as needed, the JavaScript application sends |
commands back to the web server. These commands are in the form of URLs that request some action from the Asterisk server itself. |
• The web server interprets the URLs. If the user has logged in successfully, it sends |
a command (an action) to Asterisk via the Asterisk Manager Interface (AMI), de- scribed in Chapter 10. |
• Asterisk executes the action and the results (a status code and possibly data) to the |
web server. |
• The web server sends Asterisk’s response back to the JavaScript application on the |
browser. |
• The JavaScript application updates the browser’s display. |
While it may sound a little complicated at first glance, don’t be intimidated. It’s a very flexible and powerful architecture that can be used for a myriad of applications, not just an Asterisk GUI. For now, however, we’ll concentrate on enhancing the Asterisk GUI. Let’s begin by configuring the underlying pieces, and then move on to installing and modifying the Asterisk GUI. |