Categories
Asterisk Support Elastix Support Knowledge Base OpenVox

Asterisk pickup groups

The aim here is to explain the relationship between the callgroup and pickup group settings in extension conf files of an Asterisk server and named pickup in freepbx, we will use numbers but not names (see explanation below).

Call Pickup is the abilty to pickup a ringing phone from another phone.

The ability to do this is defined in the extensions conf file.

In many systems there is only on setting to do this normally “pickup group” you add extensions to this group and they can pickup calls ringing at members of the group. Obvious really.

Now Asterisk goes one better. You can define the callgroup and pickup group, This way you define who you can pickup and who can pickup you. This is very useful for operators, who for example don’t want calls picked up of them but do want to pickup calls from all other users.

So how do you define it.

In our example we will have 4 phones defined as follows

Callgroup Pickupgroup
201 2 1-2
202 1-4 1-4
203 2,4 2,4
204 1 1

And who can do what when trying t pickup is as follows

Ringing Phones attempting Pickup
Call to 201 204 PU failed 203 PU Passed
Call to 202 201 PU passed 203 PU Passed
Call to 203 201 PU passed 204 PU failed
Call to 204 201 PU passed 203 PU failed

So from this we can see that its the Pickupgroup that defines what callgroup can be picked up.

So because 201 has a callgroup of 2 Only sets who’s pickup group includes 2 can pick up the call. whereas as 201 has a pickupgroup of 1-2 it can pickup calls from callgroups 1-2.

For example you may have 6 pickup groups defined with users only allowed to pickup their own group members except an operato who wishes to be able to pick everyone up and a PA who has a college who she wants to be able to pickup

So all normal users would have their pickup and callgroup the same. The PA would have the pickupgroup defined with both the group numbers but only its own call group. And finally the operator would have a callgroup of 0 and its pickupgroup of 1-6.

Named call pickup groups

Named pickup groups are new with Asterisk 11. And are now supported in FreePBX , But be careful even though the ‘hint’ says they can be numeric or names the just use the named variable.

namedcallgroup=office,home,1
namedpickupgroup=office,home

As above we have a namedcallgroup as 1 but this is not the same as callgroup 1

A named callgroup and pickupgroup can be set to a comma separated list of case sensitive name strings. The number of named groups is unlimited. The number of named groups you can specify at once is limited by the line length supported.

SYNTAX
namedcallgroup=[name[,name[,...]]]
namedpickupgroup=[name[,name[,...]]]
  • namedcallgroup – specifies which named pickup groups that this channel is a member.
  • namedpickupgroup – specifies which named pickup groups this channel can pickup.
Configuration Example
namedcallgroup=engineering,sales,netgroup,protgroup
namedpickupgroup=sales

Configuration should be supported in several channel drivers, including:

  • chan_dahdi.conf
  • misdn.conf
  • sip.conf
  • pjsip.conf

pjsip.conf uses snake case:

named_call_group=engineering,sales,netgroup,protgroup
named_pickup_group=sales

You can use named pickup groups in parallel with numeric pickup groups. For example, the named pickup group ‘4’ is not the same as the numeric pickup group ‘4’.

Numeric call pickup groups

(obsolete use named groups)

A numeric callgroup and pickupgroup can be set to a comma separated list of ranges (e.g., 1-4) or numbers that can have a value of 0 to 63. There can be a maximum of 64 numeric groups. This is important to note as Freepbx does not sanity check what you put in there, So you can put 70 in the Gui and it will show 70 but do a sip show peer or a pjsip show endpoint and you will see its not set.

Categories
Knowledge Base Technical

Nagios plugin for reading the Asterisk Database

This is a simple plugin that is based on one by Jason Rivers We have changed it now to read the ASTDB (Asterisk internal Database and then based on ok and Critical keys it will report OK or Critical staus reports to Nagios.

This was written for reporting if an Elastix system is in Day or Night mode.

You can define the Database Family, Key, Critical value and OK value. This means you can cutomise it to what ever you need to report.

 

The Code is below, make you may need to change /usr/bin/nc for what ever you use for netcat.

any issues email us, but dont forget this is given for free not supported for free.

#!/bin/bash
#
# Program : check_asterisk_ami
# :
# Author : Original code by Jason Rivers < jason@jasonrivers.co.uk >
# : Modified by Cyber-cottage.co.uk for checking the asterisk Database
# :
# Purpose : Nagios plugin to return Information from an Asterisk host using AMI
# :
# Parameters : --help
# : --version
# :
# Returns : Standard Nagios status_* codes as defined in utils.sh
# :
# Licence : GPL
#
# Notes : See --help for details
#============:==============================================================
PROGNAME=`basename $0`
PROGPATH=`echo $0 | /bin/sed -e 's,[\/][^\/][^\/]*$,,'`
REVISION=`echo '$Revision: 1.1.0.6 $' | sed -e 's/[^0-9.]//g'`
. $PROGPATH/utils.sh
print_usage() {
echo "Usage: $PROGNAME [-H hostname] [-u username] [-p password] [-P port] [-k DBkey] [-c critical] [-o ok] [-f family]"
echo " -H Hostname"
echo " -u AMI Username"
echo " -p AMI Password"
echo " -P (optional) AMI PORT"
echo " -k Database key"
echo " -f Database family"
echo " -c Critical Key"
echo " -o OK KEY"
echo ""
echo "SupportedCommands:"
echo " Most DB familiys that toggle such as DayNight in elastix"
echo "Usage: $PROGNAME --help"
echo "Usage: $PROGNAME --version"
}
print_help() {
print_revision $PROGNAME $REVISION
echo ""
echo "Nagios Plugin to check Asterisk ASTDB using AMI"
echo ""
print_usage
echo ""
echo "Asterisk Call Status Check. orignal version by © Jason Rivers 2011 changes to do ASTDB by cyber-cottage.co.uk"
echo ""
exit 0
# support
}
# If we have arguments, process them.
#
exitstatus=$STATE_WARNING #default
while test -n "$1"; do
case "$1" in
--help)
print_help
exit $STATE_OK
;;
-h)
print_help
exit $STATE_OK
;;
--version)
print_revision $PROGNAME $REVISION
exit $STATE_OK
;;
-V)
print_revision $PROGNAME $REVISION
exit $STATE_OK
;;
-H)
REMOTEHOST=$2;
shift;
;;
-P) AMIPORT=$2;
shift;
;;
-u) AMIUSER=$2;
shift;
;;
-p) AMIPASS=$2;
shift;
;;
-c)
CRITICALNAME=$2
shift;
;;
-o)
OKNAME=$2
shift;
;;
-k)
DBKEY=$2;
shift;
;;
-f)
FAMIL=$2;
shift;
;;
*)
echo "Unknown argument: $1"
print_usage
exit $STATE_UNKNOWN
;;
esac
shift
done
if [ "${AMIPORT}" = "" ]; then
AMIPORT="5038"
fi
if [ "${FAMIL}" = "" ]; then
##WARNING
echo="CRITICAL: Unknown KEY"
print_help
exit=$STATE_CRITICAL
else
## Checking Astdb
CHANNELS=`/bin/echo -e "Action: login Username: ${AMIUSER} Secret: ${AMIPASS} Events: off Action: DBGet Family: ${FAMIL} Key: ${DBKEY} Action: Logoff " | /usr/bin/nc $REMOTEHOST ${AMIPORT} | awk '/Val/ {print $2}'|tr -d " "`
if [ "$CHANNELS" = "" ]; then
echo "UNKNOWN: Unable to get ASTDB status"
exit $STATUS_UNKNOWN
fi
if [ "$CHANNELS" = "${OKNAME}" ]; then
exitstatus=$STATU_OK
MSG="OK: ${DBKEY} Asterisk Emergency message not active"
elif [ "$CHANNELS" = "" ]; then
exitstatus=$STATU_WARNING
MSG="WARNING: Asterisk Unknown status"
elif [ "$CHANNELS" = "$CRITICALNAME" ]; then
exitstatus=$STATU_CRITICAL
MSG="CRITICAL: ${DBKEY} Asterisk Emergency message active"
fi
fi
echo $MSG
exit $exitstatus

Categories
Knowledge Base Technical

Installing Webdav on Centos with untrusted ssl certificates

Webdav (Web-based Distributed Authoring and Versioning) is a set of methods based on the Hypertext Transfer Protocol (HTTP) that facilitates collaboration between users in editing and managing documents and files stored on World Wide Web servers.This can be useful to allow backing up of data between servers. In Linux there is a command line client called cadaver that in theory allows you to script its use.

This isnt as staight forward as it could have been and we spent half a day and a lot of Googling to get to the bottom of common problems, Such as auto loging in, Untrusted ssl certificates and scripting.

So here is a simple run down on what you have to do to script with webdav and cadaver

Install cadaver

yum install cadaver

once installed you will need to install the certificate for the untrusted ssl site

for example
wget http://website/untrusted.server.com.cer
now convert this to a .pem file
openssl x509 -inform der -in untrusted.server.com.cer -out untrusted.server.com.pem

now add this to your cert.pem file.

in centos this seems to be in the  /usr/share/ssl/ directory
cat untrusted.server.com.pem >> /usr/share/ssl/cert.pem

you now need to edit the ./netrc file with the server and logon details
vi ~/.netrc

machine untrusted.server.com
login   user
password        secret

save the file.

now when you connect you wont be promted for accepting the certificate or a username and password

cadaver -et  https://untrusted.server.com
dav:/>

Ok now we want to script the actions.
This is as simple as creating a script file.

for example

vi ~/.cadavscript
ls
pwd
quit

will give the following output

cadaver -et  https://untrusted.server.com/ < ~/.cadavscript
dav:/> Listing collection `/’: succeeded.
test.txt                              35  Aug 19 15:04
dav:/> Current collection is `https://untrusted.server.com/’.
dav:/> Connection to `untrusted.server.com’ closed.

So create a script to do what you want and your done

Categories
Design Installation Services Support Technical

Gradwell Approved Professional

A Gradwell Approved Professional (GAP) has a core set of knowledge required to succeed with the Gradwell product set and systems. To become a Gradwell Approved Professional partners must pass an examination and show an in depth knowledge of Gradwell Products and Voip Support.

This means you can be confident that they can:

  • Achieve consistent roll outs of reliable business telephony services.
  • Confidently resolve end user technical issues within an acceptable time frame.

To signup to Gradwell services with us CLICK HERE

Categories
Case Studies Technical

Man In The Middle

Man In The Middle Server, What does he mean I hear you ask?

Well its the best term for it, as it describes what it is and does. Basicly we have an AsteriskServer sitting in between the incoming lines and the main  PBX. Idealy We would have liked to replace the existing PBX but in some cases this just isnt possible and we have to accept this.

So why may we need to do this, Well we have used this solution to allow customers to have follow the sun  support call centers.  Calls arrive to a dedicated DDI number that is for support in that country and depending on the time of day it is routed to the call center that is open in another part of the world over a voip network. This is done by Asterisk checking the called number of all calls and if a match is made the call is passed off to Asterisk to handle the call in its dialplan, all other unmatched calls are passed on to the main system.

We have also used this method of connection to play prompts to callers before the call is sent to the main system. Calls in this case can be identified by CallerID name or number. So for example calls from the BT operator, International payphones or even just a certain CallerID Number are played a specific message and then either forwarded on or passed on to a IVR (Interactive Voice Response menu) to be handled in a specific manner.

A another often used reason for this type of connection is when migrating from a legacy pbx to and Asterisk server. The line connections are the same and the call flow is controlled by the dialplan, Routing calls on teh Asterisk system to its dialplan and routing calls for extensions still on the old system to it.

Once all extensions are migrated to the new system the old system can be turned off and removed with no interuption to the users on the new system.

Categories
Case Studies

Asterisk install in a campus style school

In late 2005 We we approached to replace an aging Panasonic system for a British Public School.
The driving force for moving to voip was that the site was spread over a wide area and different buildings and to provide telephones to the remote buildings would prove too expensive.
The system was replaced with a central Asterisk server with nearly 80 extensions. The core LAN was upgraded to Netgear Layer 3 switches with Powerdsine POE midspans.
The remote buildings added extra complexity as one was on the other side of a public road.

To overcome this, this building was connected to the main site via a “Point to Point” Wifi link. The other building was closer and could be connected via a Fibre Link between the it and the main building.

Campus Site

The system was configured to use account codes in public areas, These handsets can only make emergency or internal calls unless a validated account code is entered.
The handsets used were a mix of Aastra 480i and 9133i because of build quality, reliability and BLF support.

The system has now been in place for over 2 and a half years now and in that time the only faults have been either ISDN failing or cable faults. This is a great demonstration of the reliabilty of Asterisk and Aastra handsets and voip in general.

UPDATE

We have since writing this post updated the system on new hardware as part of a refresh. They are now running on a newer version of Asterisk and have more buildings connected to the network.

Categories
Case Studies

Solicitors Group

We were approached to provide a Voip solution for a London Solicitors. They were moving from a Single office to two offices in different parts of the city.

At the Primary office we installed an Asterisk server that was connected to the ISDN30e link where all DDI numbers were delivered for both sites. This site also had its own VOip connection as well

At the main site the operators were based using the Asternic FlashOsPanel for displaying extension status for both sites.

A key feature of the system was to provide a flexible system for out of hours callers to contact the duty Solicitor. This was provided so that callers on calling out of hours  can leave a message for the next day or press an option to contact the Duty solicitor. The Duty solicitor can call into the system and change the contact number at will if for example they are busy with a client.

A SIP trunk connected both sites together over a 20Meg link that was used for both voice and data.

The new sites were not in the exchange area of the original phone number so this was ported to Gradwell.net so that it could be delivered via an IAX2 connection to the relevent server.

The handsets used were a mixture of Aastra 53i and 55i with an xml appliction to set DND status in the Flash ops panel and light the light on the handset.