Showing posts with label Asterisk-GUI. Show all posts
Showing posts with label Asterisk-GUI. Show all posts

Monday, January 23, 2012

Quick Start on Asterisk-GUI (Analog Trunk)

Provisioning an analog trunk on Asterisk GUI 2.0.4 requires bit more work compared to provisioning SIP client (and some manual setting in my case) so I'll cover the settings before moving onto the provisioning steps. 


Some Background
I am using Asterisk version 1.4.26.2 (it is quite old). Just prior to this release, the Zaptel driver has been renamed to DAHDI (See this link for more information). 


Interesting enough, the module is named “chan_dahdi.so” but the “zapata.conf” file (instead of the chan_dahdi.conf file) is read by asterisk:
home-unix6*CLI> module reload chan_dahdi.so
    -- Reloading module 'chan_dahdi.so' (DAHDI Telephony w/PRI)
  == Parsing '/usr/local/etc/asterisk/zapata.conf': Found
P.S. the purpose of zapata.conf is to configure all TDM interface parameters. The configuration was covered in this post.

Check out the change logs [r122314] and confirmed chan_zap.c was indeed removed in one of the earlier releases (1.4.22). 

Some manual settings
1. Asterisk GUI cannot detect analog hardware - I added one line in ztscan.conf (in etc/asterisk directory), restarted the asterisk process and the FXO port can be detected: 

[1]
active=yes
alarms=OK
description=Wildcard TDM400P REV E/F Board 1
name=WCTDM/0
manufacturer=Digium
devicetype=Wildcard TDM400P REV E/F
location=PCI Bus 05 Slot 09
basechan=1
totchans=4
irq=10
port=1,FXO



2. Asterisk GUI provision the analog trunk as Zap channel (in extensions.conf file), but Asterisk doesn’t understand Zap - unless the “dahdichanname” parameter in asterisk.conf is set to "no"

home-unix6# cat asterisk.conf | grep dahdi
dahdichanname = no yes; Channels created by chan_dahdi will be called 'DAHDI', otherwise 'Zap'



3. After Asterisk process restarts, "chan_dahdi.so" module is not loaded. 
At the moment, I have to manually run "module load chan_module.so" in Asterisk console, because adding "load => chan_dahdi.so" in modules.conf does not help... 




Provisioning
1. If the analog port is detected, it will be displayed on the "Configure Hardware" page:


2. On "Trunk" page, select "New Analog Trunk". Tick "Channel" and assign a name to it: 
3. On "Outgoing Calling Rules" page, set "New Calling Rule" and use the trunk previously defined in step two (local-line):

4. On "Dial plans" page, edit the existing dialplan (if none exist, just create a new one). Tick to include the outgoing calling rule previously defined (localline):




5. Apply the changes ("Apply Change" button is on the top right corner of web browser). This requires a system restart but I restarted the Asterisk process. 


6. The analog trunk has been provisioned and can make or receive phone calls. 




Notes:
Remember Some Manual Settings 3. After Asterisk process restarts, "chan_dahdi.so" module is not loaded. So manual loading/ reload is required. 







Sunday, January 22, 2012

Quick Start on Asterisk-GUI (SIP Client)

As a continuation of previous blog on Asterisk GUI, this post is a quick start guide to a simple provisioning example - adding a new SIP client which can call other users in the default context.


Note: please read the "Browser Notes" added in the Asterisk GUI, as I have only managed to have IE 9 browser working with Asterisk-GUI so far. 


1. The Asterisk-GUI is accessible via the URL and can be login via a non-admin user (defined in manager.conf):
http://:8088/asterisk/static/config/index.html


Upon successful login, the first page is the "System Status" page:

2. Click on the "Dialplan" tab on the left sidebar and create a new Dial plan (ignoring the warning of "No Calling Rules Defined"):
Note: I have ticked "default" context to link to this dialplan. i.e. this dialplan can call/ receive calls from previously provisioned users. 


3. Click on the "User" tab and create a new user. 
4. After this, the SIP client (x-lite) can successfully register as user "6000" and call other users. 




Some thoughts:
The good thing about Asterisk GUI is it is ported under FreeBSD (/usr/ports/www/asterisk-gui/) which makes the installation much easier (than compiling source and working through dependencies). 
That being said, some features such as adding an analog line seems quite complex - I spent a couple of hours and have not worked this out. 


At a later day, I may consider trying out FreePBX for provisioning but would prefer to run it on a Linux server. 







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…