Asterisk

Step one:
aptitude install asterisk

The following NEW packages will be installed:
  asterisk asterisk-config{a} asterisk-sounds-main{a} binutils{a}
  build-essential{a} debhelper{a} dpkg-dev{a} g++{a} g++-4.3{a} gcc{a}
  gcc-4.3{a} gettext{a} html2text{a} intltool-debian{a} libc-client2007b{a}
  libc6-dev{a} libcompress-raw-zlib-perl{a} libcompress-zlib-perl{a}
  libdigest-hmac-perl{a} libdigest-sha1-perl{a} libfile-remove-perl{a}
  libgomp1{a} libiksemel3{a} libio-compress-base-perl{a}
  libio-compress-zlib-perl{a} libio-stringy-perl{a} libmail-box-perl{a}
  libmail-sendmail-perl{a} libmailtools-perl{a} libmime-types-perl{a}
  libobject-realize-later-perl{a} libpq5{a} libpri1.0{a}
  libradiusclient-ng2{a} libsqlite0{a} libstdc++6-4.3-dev{a}
  libsys-hostname-long-perl{a} libtimedate-perl{a} libtonezone1{a}
  libuser-identity-perl{a} libvpb0{a} linux-libc-dev{a} make{a} mlock{a}
  module-assistant{a} odbcinst1debian1{a} po-debconf{a} unixodbc{a}
  vpb-driver-source{a}
0 packages upgraded, 49 newly installed, 0 to remove and 3 not upgraded.
Need to get 28.1MB of archives. After unpacking 83.1MB will be used.

Step two:
Pray a lot. There is no "QuickStart Manual" here. The Asterisk community prides itself on being obscure, obfusicated, and difficult.

My guide at the moment is a book "Asterisk - The future of telephony 2nd Edition" by Jim Van Meggelen, Leif Madsen & Jared Smith, published by O'Reilly. The release date is August 2007, the ISBN is 978-0-596-51048-0 and the price was $44.99

As with any O'Reilly book, your first stop must be the errata page on their web site so go to http://www.oreilly.com and in the search window enter the ISBN and you get back Sorry, no results were found for 978-0-596-51048-0

Next, take out the hyphens and enter 9780596510480 and you get This page
or This page (I guess O'Reilly enjoys being difficult also)

Click on the link for the book, click View/Submit Errata and you'll get This page
which, at the time I clicked it (July 2009), contains 21 items that need to be corrected. Among them are entries like this:

Not bad for a company that has published hundreds if not thousands of computer books, probably including one on "How to use a spell checker"


I've got my book, I've got Asterisk installed, and I want to see something, anything, happen

Chapter 1 of the book discusses the Asterisk origins and the development community

Chapter 2 of the book states "By this point, you must be anxious to get your Asterisk system up and running. If you are building a hobby system, you can probably jump right to the next chapter and begin the installation.

OK, on to Chapter 3 which discusses compiling from source, which I didn't have to do because I just ran aptitude install asterisk and it went in. The last page of chapter 3 states: "Once you have completed your installation and rebooted your machine, you will be able to access the Asterisk GUI. The URL used to access the GUI is the IP address or hostname displayed after rebooting your machine. Enter this IP address in your browser URL. OK, thinks I, this will be easy. Like maybe CUPS with the http://localhost:631 address. I'm not used to having to reboot after installing a package and I don't run MS Windows, so I'm a little skeptical but reboot anyway. Just as I figured, the box simply booted like always and left me at the GDM login screen. Nothing in dmesg, nothing in /var/log/messages about asterisk.

I google for "asterisk web interface" and take the first link which is Installing The Asterisk PBX And The Asterisk Web-Based Provisioning GUI On Linux

How lucky can I be ! This is just what I want.


Scrolling down the page I find:

AJAM is a new technology available in Asterisk 1.4 which allows web browsers or other HTTP enabled applications and web pages to directly access the Asterisk Manager Interface (AMI) via HTTP. Setting up your server to process AJAM involves a few steps:

Set up the Asterisk HTTP server:

  1. ) Uncomment the line enabled=yes in /etc/asterisk/http.conf to enable Asterisk's built-in micro HTTP server.
  2. ) If you want Asterisk to actually deliver simple HTML pages, CSS, JavaScript, etc. you should uncomment enablestatic=yes
  3. ) Adjust your bindaddr and bindport settings as appropriate for your desired accessibility or leave them as default.
  4. ) Adjust your prefix if appropriate, which must be the beginning of any URI on the server to match. The default is asterisk and the rest of these instructions assume that value.

Ah! Now I have an actual file name to work with. Except that my copy of /etc/asterisk/http.conf doesn't have an entry for enablestatic=yes that I can uncomment so I just type it in. (Silly me)

I decide to leave the bindaddr (localhost), bindport (8080), and prefix (asterisk) as is. But wait!. My copy of /etc/asterisk/http.conf contains something else this page doesn't mention:

; The post_mappings section maps URLs to real paths on the filesystem.  If a
; POST is done from within an authenticated manager session to one of the
; configured POST mappings, then any files in the POST will be placed in the
; configured directory.
;
;[post_mappings]

I decide to leave that alone, save the file and continue reading the web page that google gave me.

Allow Manager Access via HTTP

  1. ) Make sure you have both enabled = yes and webenabled = yes set up in /etc/asterisk/manager.conf.
  2. ) You may also use httptimeout to set a default timeout for HTTP connections.
  3. ) Make sure you have a manager username/secret.

Once these configuration changes are complete you can reload or restart Asterisk and you should be able to point your web browser to specific URI's which will allow you to access various web functions. A complete list can be found by typing show http at the Asterisk CLI.

Now we're making some progress. We know about another file, manager.conf and we know we need a username and a password. But wait! My copy of /etc/asterisk/manager.conf doesn't have a line webenabled = yes. So I type it in. (Again...silly me)

My copy of manager.conf looks like this:

;
; Asterisk Call Management support
;

; By default asterisk will listen on localhost only.
[general]
enabled = yes
port = 5038
bindaddr = 127.0.0.1

; No access is allowed by default.
; To set a password, create a file in /etc/asterisk/manager.d
; use creative permission games to allow other serivces to create their own
; files
#include "manager.d/*.conf"

Wait! what's this port = 4038 thing?? I thought it was 8080. Well, I just left it as is. After all, Debian's package manager is an expert and I'm just a user.

Next question, I still don't know how to set a password but I have a clue. About halfway up the web page I find this:

Asterisk Manager

There also exists an Asterisk manager. To enable this, you need to edit the /etc/asterisk/manager.conf
and uncomment the four lines below by removing the ; on:

;[mark] (this is the username to use in the astman)
;secret = mysecret (this is the password to use in astman)
;read = system,call,log,verbose,command,agent,user,config
;write = system,call.log,verbose,command,agent,user,config

so it would look like :

[mark] (this is the username to use in the astman)
secret = mysecret (this is the password to use in astman)
read = system,call,log,verbose,command,agent,user,config
write = system,call.log,verbose,command,agent,user,config 

Save the file.

Well, ok, but it doesn't say anything about the parenthetical comments, but I better take them out. And I don't have the read = system,call.... or the write = system,call.... either, and


Send mail to the Webmaster

logo This site best viewed with a browser
Warning: This is a Debian centric site
Many thanks to Debra and Ian Murdock for making Debian possible
First created Apr 22, 2008 ~ Last revised October 13, 2009

Valid XHTML 1.0 Strict Valid CSS!