Sunday, January 15, 2012

Asterisk GUI Installation

For easier administration, Asterisk comes with a built-in mini web server. 


The FreeBSD port is called Asterisk-GUI (/usr/ports/www/asterisk-gui)


In the ports directory, run "make; make install" following by "make checkconfig" to check the configurations in (/etc/asterisk) http.conf and manager.conf:


make; make install
make checkconfig           # Verifies the http.conf and manager.conf (/etc/asterisk)

home-unix6# make checkconfig
 --- Checking Asterisk configuration to see if it will support the GUI ---
* Checking for http.conf: OK
* Checking for manager.conf: OK
* Checking if HTTP is enabled: OK
* Checking if HTTP static support is enabled: OK
* Checking if manager is enabled: OK
* Checking if manager over HTTP is enabled: OK
 --- Everything looks good ---
 * GUI should be available at http://home-unix6.mooo.com:8088/asterisk/static/config/cfgbasic.html

 * Note: If you have bindaddr=127.0.0.1 in /usr/local/etc/asterisk/http.conf
   you will only be able to visit it from the local machine.

   Example: http://localhost:8088/asterisk/static/config/cfgbasic.html

 * The login and password should be an entry from /usr/local/etc/asterisk/manager.conf
   which has 'config' permission in read and write.  For example:

    [admin]
    secret = mysecret1873
    read = system,call,log,verbose,command,agent,config
    write = system,call,log,verbose,command,agent,config

 --- Good luck! ---

  

home-unix6# vi /usr/local/etc/asterisk/http.conf
;
; Asterisk Builtin mini-HTTP server
;
;
[general]
;
; Whether HTTP interface is enabled or not.  Default is no.
;
enabled=yes
;
; Whether Asterisk should serve static content from http-static
; Default is no.
;
enablestatic=yes

;
; Address to bind to.  Default is 0.0.0.0
;
;bindaddr=127.0.0.1
bindaddr=0.0.0.0
;
; Port to bind to (default is 8088)
;
bindport=8088


manager.conf - admin and jlam users are defined, along with their privileges
;
; AMI - The Asterisk Manager Interface
;
; Third party application call management support and PBX event supervision
;
; This configuration file is read every time someone logs in
;
; Use the "manager list commands" at the CLI to list available manager commands
; and their authorization levels.
;
; "manager show command " will show a help text.
;
; ---------------------------- SECURITY NOTE -------------------------------
; Note that you should not enable the AMI on a public IP address. If needed,
; block this TCP port with iptables (or another FW software) and reach it
; with IPsec, SSH, or SSL vpn tunnel.  You can also make the manager
; interface available over http if Asterisk's http server is enabled in
; http.conf and if both "enabled" and "webenabled" are set to yes in
; this file.  Both default to no.  httptimeout provides the maximum
; timeout in seconds before a web based session is discarded.  The
; default is 60 seconds.
;
[general]
displaysystemname = yes
enabled = yes
webenabled = yes
port = 5038

;httptimeout = 60
; a) httptimeout sets the Max-Age of the http cookie
; b) httptimeout is the amount of time the webserver waits
;    on a action=waitevent request (actually its httptimeout-10)
; c) httptimeout is also the amount of time the webserver keeps
;    a http session alive after completing a successful action

bindaddr = 0.0.0.0


[admin]
secret =          ; don't use password "password", as it is the default value. Otherwise, the GUI will keep prompting you to change it
read = system,call,log,verbose,command,agent,user,config,originate
write = system,call,log,verbose,command,agent,user,config,originate


[jlam]
secret =        ; Only non-admin user with the correct privileges can provision voice trunks.
read = system,call,log,verbose,command,agent,user,config,originate
write = system,call,log,verbose,command,agent,user,config,originate


Asterisk-GUI Dial Plans tab


Additional notes as of 22nd Jan 2012:



Browser Notes:
I have tried accessing the Asterisk-GUI using both web-browsers Google Chrome 16.0.912.75 and Firefox 9.0.1. 
Both browsers don't allow me to "Save" settings (Asterisk GUI no response after clicking "Save"). In another words, I cannot do provisioning using them. 

The only web browser which works with Asterisk-GUI (as I have discovered so far) is Internet Explorer 9. "Save" button works, hence allow provisioning.


In some occasions, after apply settings, browser returns to Login screen (indicating login successful) but sidebar disappears.
The only work around so far is to logout and then login again…

No comments:

Post a Comment