Feb
11
2010
39

How to setup the Asterisk 2.0 GUI with Asterisk 1.6

Recent versions of Asterisk 1.6 are compatible with the Asterisk 2.0 GUI.  This wasn’t always the case, as the Asterisk GUI was developed for the 1.4 branch.  Although I wish Digium had gone for the LAMP model, the GUI is pretty good and getting better all the time.  However the instructions to install are difficult to find on the asterisk.org website.  That is, if they are there at all.  My guess is that Digium doesn’t want to make it to easy to get a free GUI.  I think this a very poor strategy, but that’s another article….  Today we will run through a quick install of asterisk and the 2.0 GUI.  A far superior option as compared to to Trixbox and FreePBX.

GOALS OF THIS POST:
– Install Asterisk 1.6
– Install Asterisk 2.0 GUI

(more…)

Dec
21
2009
0

How to setup auto-provisioning for Polycom SoundPoint IP phones using the Asterisk Appliance

The Digium Asterisk Appliance has built-in features for handling Polycom SIP handsets.  It’s very easy to do and will save you the trouble of individually configuring the settings of each phone.  I have a Digium AA50 configured with a standard dial plan and a Polycom Soundpoint IP 501.

Goals of this Post:

– Configure AA50 Polycom Provisioning
– Configure Polycom SoundPoint IP 501 phone

(more…)

Sep
21
2009
0

PHP array example

Hello all. It’s been a few weeks since I posted… I’ve been teaching myself PHP to create a web interface for a Asterisk based project I’m working on. My goal is to create a LAMP(Linux, Apache, MySQL, PHP) web managment tool for creating calling cards for use with Asterisk. The project is called ACCWA(pronounced aqua), the Asterisk Calling Card Web Administration tool. As I put this altogether I will keep my loyal readers updated about what I’ve learned about PHP.

Today I will cover Arrays. PHP handles arrays in manner similar to PERL. Each value can have an optional indice. In my example below, we simply have a list with no idiceses.

example:

<?php

$myarray[]=”hi” ;
$myarray[]=”how” ;
$myarray[]=”are” ;
$myarray[]=”you?” ;

// Now we will ‘echo’ each value in the array
foreach ($myarray as $i) {
echo “$i ” ; }

?>

output of myarray.php:

Above we did two simple task. First we defined a list of words in our array, then we echo’ed each one individually with the ‘foreach’ function. Very similar to BASH.  Your PHP page should display:

hi how are you?

Sep
09
2009
0

Adjust date & time (NTP) on Fedora Linux

Correct time is crucial for many Network services.  Time stamps are required for accurate logs, email, and in the case of Asterisk – voicemail.  A customer sent me a request for instructions on adjusting date & time for their Asterisk PBX.  Most Fedora based systems come with a tool just for this purpose.  From the Desktop open a console window and type:

(more…)

Jul
18
2009
1

How to use the ODBC driver to Connect to MySQL database in Fedora 10

A few weeks back I covered connecting ODBC to MS-SQL, but today we are going to do the same thing with MySQL.  The process is very similar.  One might ask, why use ODBC driver in the first place?  The reason is simple, there are many flavors of SQL and the ODBC driver allows one standard to connect them.  For that reason many software developers use ODBC for connecting their applications to SQL.

For my purposes, the Asterisk PBX platform can use ODBC to call ‘dial plan’ functions from the database, but that is another article!  This post assumes you have a working MySQL server and at least one table with data to pull from.

Goal of this Post:

– Install ODBC driver for MySQL
– configure odbc.ini
– configure odbcinst.ini
– verify connectivity with isql

(more…)

Jul
10
2009
15

BASH: A simple script to check if a process is running

Scripting is very, very useful.  Don’t make the same mistake I did and wait 5 years into you career to start learning!  In the example below, I’m using the ‘ps -aux’ command piped into grep to determine if a process is still running.  for my example I’m using Firefox, but intend to use this with a Asterisk phone system.  Every minute cron will launch my script to see if Asterisk is still running.  If it is, it will do nothing.  If it isn’t, then it will attempt to restart asterisk and notify the Administrator.  I hope this example helps someone!

——————————————————————————————–

#!/bin/bash

#set -x

#
# Variables Section
#==============================================================
# list process to monitor in the variable below.

PROGRAM1=”asterisk”

# varible checks to see if $PROGRAM1
# is running.

APPCHK=$(ps aux | grep -c $PROGRAM1)

#
#
# $Company & $SITE variables are for populating the alert email
COMPANY=”VoiceIP Solutions”
SITE=”Seattle”

# $SUPPORTSTAFF is the recipient of our alert email

SUPPORTSTAFF=”savelono@gmail.com”

#==================================================================

# The ‘if’ statement below checks to see if the process is running
# with the ‘ps’ command.  If the value is returned as a ‘0’ then
# an email will be sent and the process will be safely restarted.
#

if [ $APPCHK = ‘0’ ];

then

echo mail -s “Asterisk PBX at $COMPANY $SITE may be down” $SUPPORTSTAFF < /dev/null

else

echo “$PROGRAM1 is running $APPCHK processes” >> asterisk-check.log

fi

echo $APPCHK

exit

Written by mattb in: Linux,Scripts | Tags: , , , , ,
Jun
28
2009
1

Polycom 501 XML configuration file Example

This file is named by the MAC address of your Polycom SoundPoint IP SIP phone followed by, ‘-phone.cfg’.  In your FTP folder you would have a file for each phone – I have a single phone.  It’s MAC is ‘0004F202734B’; so my phones configuration file would be named, ‘0004f202734b-phone.cfg’.  I believe there are other conventions for naming this file as well.

The example below was used to connect my phone with a VoiceIP Solutions Asterisk PBX.  This example shows just a fraction of the many possible features in this line.  For my purposes, I defined the Asterisk server IP address, and it’s SIP credentials.  I also added the NTP server.  The ‘mwi’ tag refers to ‘message waiting information’, here I set the mailbox(s) I’m subscribing to and the extension to check voicemail.   My Asterisk voicemail menu is extension ‘299’.

0004f202734b-phone.cfg:

<?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?>
<!– Example Per-phone Configuration File –>
<!– $RCSfile: phone1.cfg,v $  $Revision: 1.104.2.2 $ –>
<phone1>
<reg
reg.1.displayName=”5555″
reg.1.address=”5555″
reg.1.auth.userId=”5555″
reg.1.auth.password=”2005″
reg.1.server.1.address=”192.168.1.254″
tcpIpApp.sntp.address=”pool.ntp.org”
tcpIpApp.sntp.gmtOffset=”-33600″
>
<mwi
msg.mwi.1.subscribe=”5555″
msg.mwi.1.callBackMode=”contact”
msg.mwi.1.callBack=”299″
>
</phone1>

Jun
07
2009
--

How to Configure Linux ODBC Connections for MS SQL

Last week at work(VoiceIP Solutions) I did some research for Asterisk PBX integration with Microsoft CRM.  The customer likes open source Asterisk because of the cost savings, but they requires screen pop-ups, and click to dial from their Customer Relationship Management software.  So while my manager worked on the TAPI middleware, I was charged with figuring out how to connect to the MS SQL database.  This article was prompted by a desire to connect an Asterisk PBX to MS SQL, but the tutorial applies to Apache, Postfix, CRM, PHP or any Linux app that needs to do a remote query.  Also, while the focus of this article is aimed at MS SQL the same steps(with a few tweaks) can be used for connecting to Postgre, Sybase, MySQL, etc…

I’m a lot more famalier with MySQL & PostgreSQL, but MS SQL I haven’t touched since I had the silly notion about 10 years ago to become a Windows 2000 MCSE.  Incidently, I never did take the exams, because I was a broke student at the time and I was becoming increasingly interested in Linux and Cisco.

The logical choice is to use the UNIX ODBC driver.  ODBC stands for Open Database Connectivity.  ODBC is a well documented set of API’s that is available on many platforms.  However, their are subtle differences in it’s implentation and the protocols that run at application layer.  In other words ODBC is encapsulated when making calls to a database over a network (in this case, the TDS protocol).

I did some googling and found a number of incomplete tutorials for connecting Linux to MS SQL.  This article is intended to clarify some common configuration errors and will present you with example files.  For my demonstration I’m running Fedora 10 with the latest updates as of this writing.  This article assumes you have a working MS SQL datebase with the proper user permissions in mixed mode.  I put this one in bold because it stumped the MCSE database guy for a while.

Again, I want to point out I’m not a Microsoft DBA and will likely not be able to help you on that side of the configuration.  Also, there are many versions of SQL out there and the syntax to pull data differs slightly from one version to the next.  So you may need to do a little research to make the proper pulls.

The Goals of this Post:

– install ODBC and TDS on Fedora 10

– verify TDS can login into MS SQL server

– configure odbcinst.ini, odbc.ini and freetds.conf configuration files

(more…)

May
07
2009
0

How to make USB and DVD ROM drives work on Fedora 10

Lately, I’ve been working on Asterisk PBX related articles, but today we’re going to tackle a common problem with Fedora 10: getting drives to mount to the Desktop.  If you are experiencing trouble, the likely cause is that your current user, does not have permissions to access that hardware.  The reason for this has a lot to do with the security model of Linux.

In the old days computers came on large mainframes.  It was not practical for engineers and scientist to have their very own main frame, so Unix was designed to be a multi-user operating system.  Everyone connected their own keyboard & monitor.  The permission structure was set so only certain individual accounts could do certain things.  Like say, reboot a system or delete a database.

By contrast Microsoft Windows(thru XP) is a single user operating system.  In Windows you can create extra accounts, but any of those accounts can execute arbitrary code from anywhere in the file system (c:\\ drive).  Which is a big reason for the many attacks on Windows systems.

Recently my friend got a virus that made XP unbootable and stole his World of Warcraft account login and password.  The hacker then used that information to login to his account, change his password, and his accounts valid email address.  The hacker then sold all his gear and used his character to scam other people in bad trades.  The account became banned for “economic extortion” before my friend could get his Windows XP machine back up and running.  Now he runs WoW on WINE/Fedora 10.

An appeal to Blizzard got his account back after several days and many emails. My friend requested that they check the IP address of the hacker and compare that to his previous logins.  What if the virus had collected his bank account credentials instead?  In a way he got lucky.

Goals of this Post:

– correct authorizations in Fedora 10 and allow access to USB and DVD – ROM devices

It seems odd that someone would be unable to access a USB thumb drive on any modern desktop computer, but Red Hat the maker of Fedora Linux is far more interested in their commercial offering, Red Hat Enterprise Linux(RHEL).  They model RHEL development on previous versions of Fedora.  So desktop integration is obviously not their top priority; stability and security is.  This neglect has allowed rival Unbuntu Linux to come in and snatch up the Linux desktop market.  Big mistake Red Hat…  however with a little work we can make Fedora 10 desktop work well without them.

So to correct the permissions issue(from Gnome) start by clicking, System –> Preferences –> System –> Authorizations.  Fedora may ask you for your ‘root’ password.

fedora10-authorizations-usb

fedora10-authorizations-usb

Set access to allow anyone to mount and unmount USB and other devices!  I hope this helps.  It’s frustrating dealing with these little things, but hey, “it’s free”!  If it doesn’t take, leave a comment below and I’ll try to help.

May
04
2009
4

Asterisk 1.4.23 and Queuemetrics 1.5.2 fully support Dynamic Agent Login

The standard method of configuring users in Asterisk 1.2 and early 1.4 was to define an agent in the agents.conf configuration file.  This agent is tied to no particular phone or SIP extension.  When the Agent log’s in he is prompted for three things by the dial plan application, ‘AgentCallBackLogin()’:

1. Agent Number
2. Agent password(defined in agents.conf
3. Dial Back Extension

AgentCallBackLogin makes a lot of sense if CSR’s(Customer Service Representatives) switch phones frequently.  For some of my customers this is the case.  However, most of the Call Centers I’ve deployed have assigned seating.

So I commonly get the question,  “Is it possible to have ‘one touch login/logout’ for my agents?”  The sad answer is no.  It’s a valid question; for agents that never leave their desk why do they need to enter three prompts to login?

(more…)