4 A Few Examples
So you just installed your Asterisk PBX and played with the demo, or maybe even couldn't get the demo working. Now what ? Well fear not frustrated warrior, we have a simple system that creates simple dial plans. It is easy to use, and produces the .conf files Asterisk needs to operate. It may not do everything your looking for just yet, but it does produce easy to read configuration files which you can read to learn from, modify to use, or all of the above.
4.1 Simple 2 Phone System
First we assume you have your Asterisk Manager running on your web server. If not then maybe your having problems getting AM running. AM is designed to require very little to run. Just place the files in your cgi-bin directory of your web server and you should be OK. You do not need to configure anything or split the files into HTML and script directories because the scripts generate their own HTML. Once you have your files in your cgi-bin directory just point your web browser to am-main.pl. You may have to provide a full URL, something like this ...
or maybe even a host name if you are hosting the scripts on a different machine than where you run your browser from ...
Once you do get your Asterisk Manager scripts working properly, pointing your browser to the am-main.pl script should produce a page with two options; configuration and administration. There should also be a help link located near the upper left hand corner of the screen.
4.1.1 Create a Profile
The first thing we need to do is create a profile to work with. To do this, choose the configuration option which should bring you to the main configuration menu. Here simply select 'Create Profile' and then type in a name for the new profile. I'll assume you entered 'test' as the profile name so once you have done that, press the submit button. If the next screen says something to the effect 'test created successfully' then we're done. Click the main menu link and again select configuration. This time try the first link on the page, show profile. Type in the profile name (test in our example), press submit, and you should see a sip.conf file and an extensions.conf file. If you do not see any files, but rather just see the names sip.conf and extensions.conf with nothing between them, then the system can not read and write to the /usr/tmp subdirectory. In this case go back to the main configuration menu and select the 'set working directory' option. This will present a page which asks for three directories. In our case we only care about the last entry. The one entitled 'Profile Editor Working Directory'. Here you must enter a path to a directory the web server can create files in. If you don't know what this means then you will have to get this information from your web administrator.
Assuming you have a valid working directory (as verified by creating a new profile, then showing the default conf files produced by the create profile process as described above) and have successfully created a profile, we will now create an extension for one of our SIP phones. If you want to make sure the conf files produced by the create profile script are valid at this stage before creating any SIP extensions, you can copy these files (sip.conf and extensions.conf) to your Asterisk PBX conf file directory (usually /etc/asterisk), restart the PBX, dial into the server from a SIP phone and try extension 8500. You should hear a voice mail main menu. If not then your SIP phone is not working.
4.1.2 Create a SIP Extension
To create a SIP extension choose the 'Create/Edit SIP Extension' option from the main configuration menu. Enter the profile name (in our example, 'test'), then the extension number you want the phone to be associated with, then enter the IP address of the SIP phone. If you are running a CISCO ATA type device, or are not sure of the phones IP address, enter the word 'dynamic' in the IP address field. Once you have entered these three important bits of data press the 'Create' button located near the bottom of the page. Thats all there is to it. To verify the extension was created properly, select the 'Show Profile' option from the configuration main menu and look in the sip.conf file for the extension number.
4.2 Creating Custom Prompts
<--- Previous Section   |
Next Section --->