Tag Archives: Asterisk

Installing UK voice prompts for Asterisk

Installing UK voice prompts for Asterisk

By default the English language voice prompts that Asterisk comes with have an American accent. There are some free UK voice prompts available and below are instructions for downloading and installing those. The instructions below will replace the existing US prompts with the UK ones.

The prompts can be found here – http://www.enicomms.com/cutglassivr/

More details about different language voice prompts can be found here – http://www.voip-info.org/wiki/view/Asterisk+sound+files+international

The commands below download the wav, ulaw, alaw, g729 and g723 codec versions.

First create a folder to download the files to -

cd /usr/src
mkdir uk
cd uk

next grab the files -

next extract the files that were downloaded -

find . -name ‘Alison_Keenan-British-English-*’ -exec tar xvfz {} ;

now we’re going to replace the file extensions on some of the files to match the default Asterisk ones -

find . -exec rename .g711a .alaw {} ;
find . -exec rename .g711u .ulaw {} ;

now remove the original tar files, copy over the new files and tidy up the download folder -

rm -f Alison_Keenan-British-English-*
unalias cp
cp -rf * /var/lib/asterisk/sounds/en
cd ..
rm -rf uk

You can hear an example of these prompts by calling the echo test number here – http://sysadminman.net/livedemo.html

Good prompts – Notes

FreePBX DAHDI Trunk Routing with DID

HowTo: Elastix DAHDI Trunk Routing with DID

If you have multiple FXO (PSTN) lines into your PBX, it is always nice to be able to route these in-bound calls based on the physical line they arrive upon.  Getting this working with DAHDI in Elastix has been driving me up the wall!

This issue has been bugging me for over a week now and I have finally got it to work.  I have two trunks connected via FXO modules on a TDM400 card, but I could not get the DID working with them (CLI with BT sorted).  But once Asterisk had the call, I could not make Asterisk make a decision with call based on which number/line the caller called.  Not the number the caller is calling from, this is CLI or CID, but the number they dialled to make your line ‘ring’.

Asterisk was either saying there was no route and answering the call to say the number you have called is not in service, or just handling the 2 lines in the same way – i.e. it could not tell them apart.  Here I detail my findings so you can process lines automatically.

I had most of the configuration right, but I had to hand edit another configuration file to actually to get the changes made via the web interface actually working.  Trying to find this last little bit of information on the forums has been maddening to say the least.

Changing the route

First you need to correct the router handler, by changing a setting in a configuration file.  There is no graphical interface for this I’m afraid and it is the only file you need to manually edit by a suitable means.

The default setting in this configuration file is ‘from-pstn’ and this needs to be changed to ‘from-zaptel’.  You need to edit:

/etc/asterisk/dahdi-channels.conf

You need to find the correct section for your line connection.  For me this was lines 3 & 4.  Below is the example original settings for my channel 3:

;;; line=”3 WCTDM/4/2 FXSKS”
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
channel => 3
callerid=
group=
context=default

And you need to edit this for each channel to become like this:

;;; line=”3 WCTDM/4/2 FXSKS”
signalling=fxs_ks
callerid=asreceived
group=0
context=from-zaptel
channel => 3
callerid=
group=
context=default

Then save the file back and restart Asterisk.

Marking the Channel DID

The next stage is to assign DID numbers to these channels so a decision can be made on how to process the call based on line ID.

Elastix does not have an interface to the required facility, so you need to un-embed the FreePBX console, details are here.

Once in the FreePBX console, you need to choose ‘ZAP Channel DIDs’ from the menu on the left.  You should get a screen similar to:

ZAP DIDs

ZAP DIDs

It is quite simple to complete, needing only 3 bits of information:

  • Channel – The DAHDI channel you are assigning the DID to.
  • Description – Your description for this allocation.  I would suggest an name and a summary of the DID you will be allocating.
  • DID: The DID number need to call to make this channel ‘ring’.

An example UK configuration might look like this for channel 3, used to be routed (Inbound Routes) to the sales department for the number: 01234-123456:

ZAP DID Sample

ZAP DID Sample

Once completed, you can click ‘Submit Changes’.  You need to repeat this for each FXO port you have for inbound calls.

You can then save the changes back and configure the ‘Inbound Routes’ to actually ‘route’ the calls where you want them.

You can actually use almost any number in the DID, but I suggest you use the full number, including the STD, in case you have any ‘out of area’ number.  And it generally reduces confusion in the future.

Notes

How To create a DID for PIKA FXO lines

How To create a DID for PIKA FXO lines

It is easy to use DIDs with SIP and BRI lines as they send there own number in the call messaging. When using FXO lines though, this has to be done based on hardware indexes. This can be done in FreePBX with zaptel trunks quite easily but as the chan_pika trunks are only supported as custom trunks, this functionality is not available through the GUI.

This thread is to show you how to do it by editing the asterisk config files by hand. For this example I will assign a DID of 1234567 for FXO line 1 and a DID of 5551234 for FXO line 2.

To get our PIKA FXO trunks to behave like zaptel ones, add the following to the /etc/asterisk/extensions_custom.conf file. Do not add it to /etc/asterisk/extensions_additional.conf file because this file is overwritten every time changes are applied in the FreePBX GUI. The /etc/asterisk/extensions_custom.conf file is not over written.

NOTE: The “**” below should be a close curly brace. For some reason the forum replaces them.

Code:
[macro-from-pika-fxo-1]include => macro-from-pika-fxo-1-customexten => s,1,Noop(Entering macro-from-pika-fxo-1 with DID = ${DID** and setting to: 1234567)exten => s,n,Set(__FROM_DID=1234567)exten => s,n,Goto(from-trunk,1234567,1); end of [macro-from-pika-fxo-1][macro-from-pika-fxo-2]include => macro-from-pika-fxo-2-customexten => s,1,Noop(Entering macro-from-pika-fxo-2 with DID = ${DID** and setting to: 5551234)exten => s,n,Set(__FROM_DID=5551234)exten => s,n,Goto(from-trunk,5551234,1); end of [macro-from-pika-fxo-2][from-pika-fxo]include => from-pika-fxo-customexten => _X.,1,Set(DID=${EXTEN**)exten => _X.,n,Goto(s,1)exten => s,1,Noop(Entering from-pika-fxo with DID == ${DID**)exten => s,n,Ringing()exten => s,n,Set(DID=${IF($["${DID**"= ""]?s:${DID**)**)exten => s,n,Noop(DID is now ${DID**)exten => s,n,Set(CHAN=${CHANNEL:4**)exten => s,n,Set(CHAN=${CUT(CHAN,/,3)**)exten => s,n,Macro(from-pika-fxo-${CHAN**,${DID**,1)exten => s,n,Noop(Returned from Macro from-pika-fxo-${CHAN**)exten => s,n,Goto(from-pstn,${DID**,1)exten => fax,1,Goto(ext-fax,in_fax,1); end of [from-pika-fxo]

Now you need to go into the /etc/asterisk/pika.conf file and change the context to from-pika-fxo instead of from-pstn as highlighted below.

Code:
[fxo]gp_group=0conf_ref=TRUNK_23800186context=from-pika-fxo  extension=s

Now you need to create your incoming routes for the two DIDs you just created using the FreePBX GUI and apply configuration changes. You can now route based on the FXO line the call comes in.

If you want to create additional DID numbers for your other PIKA FXO lines, just add additional macro-from-pika-fxo-# as shown above where # is the line number. Any line that does not have a macro-from-pika-fxo-# associated with it will route through the from-pstn context the way it did before.

Hope this helps,
Skar

Works great – Notes

FreePBX v3 and Asterisk Installation Guide on Fedora 12

FreePBX v3 and Asterisk Installation Guide on Fedora 12

 

Anyone who is familiar with Asterisk has probably taken a look at FreePBX at one time or another. I decided to give the newest version of FreePBX a try. Since the Asterisk Driver has only recently come available, there aren’t any good installation guides that I could find. I ended up using the FreeSwitch Installation guide at the FreePBX website as a guide to get started.

I am using Fedora Core 12 with only the standard repos. All software was installed via YUM except for FreePBX which I checked out via subversion. I know a lot of people look at YUM with disgust, but I find it a pretty useful tool. Building from source is fun, but unless I have a real reason to do so I try to stay away from that. I chose Fedora over CentOS because the packages available for CentOS are generally behind (i.e. stable? :P ) and FreePBX v3 requires PHP >= 5.2.

So, here are my installation steps to get a working installation of FreePBX v3 and Asterisk 1.6.1.17, which is the latest version available via the Fedora repo.

Loosely based on http://www.freepbx.org/v3/wiki/Installation

 

Install Fedora Core 12

yum update

You can omit nano and use your favorite command line text editor… I like nano.

yum install nano php php-pdo php-mysl php-xml php-xmlrpc php-soap mysql-server mysql  libpri libss7 subversion dahdi-tools openssl openssl-devel mod_ssl bind sendmail bison bison-devel gcc gcc-c++ ncurses ncurses-devel zlib zlib-devel gnutls-devel

Optionally install sendmail, bind and configure mod_ssl. Also setup your httpd.conf how you see fit and probably enable AllowOverride All.

service httpd start

service sshd start

service mysqld start

chkconfig mysqld on

chkconfig httpd on

chkconfig sshd on

nano /etc/sysconfig/iptables and ensure you have the rules:

 

-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT

-A INPUT -m state –state NEW -m tcp -p tcp –dport 443 -j ACCEPT

-A input -m state –state NEW -m udp -p udp –dport 5060 -j ACCEPT

-A INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j ACCEPT

nano /selinux/enforce and change 1 to 0

nano /etc/sysconfig/selinux and set selinux=permissive (or disabled)

yum install asterisk

service asterisk start

chkconfig asterisk on

mysqladmin -u root password ‘setyourpasswordhere’

mysql -u root -p

grant all privileges on freepbx.* to freepbx@localhost identified by ‘setpasshere’;

flush privileges;

go to your web enabled folder (i.e. /var/www/html) and run: svn co http://www.freepbx.org/v3/svn/trunk freepbx/

chown -R apache:apache freepbx/

nano /etc/asterisk/manager.conf

change:

enabled=no to enabled = yes

add (i added all privileges which might not be neccessary and made sure i locked down ip / made super secret password):

[freepbx]

secret = yoursupersecretpassword

deny = 0.0.0.0/0.0.0.0

permit = 127.0.0.1/255.255.255.0

read = system,call,log,verbose,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate

write = system,call,log,verbose,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate

now go to http://yourhost/freepbx and follow the installer

read, agree, and hit continue

if you get prompted that cache and logs aren’t usable try:

chmod 777 /var/www/html/freepbx/freepbx/cache

chmod 777 /var/www/html/freepbx/freepbx/logs

check to be sure your database settings match what your user / pass was that you granted privileges for and hit continue

select the asterisk driver and enter the info you put in manager.conf

continue, don’t select any modules that arent selected (you can add them later if you want them and can get them to work)

continue through the wizard and you should end up with a working installation.

One nice thing to note is that permissions were greatly simplified with v3 compared to the v2 branch. Essentially, FreePBX now uses Asterisk Manager so it doesnt need access to your /etc/asterisk folder, just the files in your web enabled directory.

Now I know I’m missing some stuff such as asterisk sounds and addons and such but this should be a pretty good start at getting a SIP based Asterisk installation up and running with FreePBX to experiment on. I do not recommend, and niether does FreePBX, using this as a production server yet. The interface is easy to follow so you shouldn’t need any more instructions once you can login.

Good guide to test out FreePBX V3.0

Siemens Hipath HG1500 to Asterisk FreePBX

This info came from Achmad Taufik who was kind enough to share the setup, should make it alot easier for anyone integrating the siemens hipath HG1500 with Asterisk.

If you want to do the same integration using PRI TSM2 card instead of SIP see http://joekane.eu/siemens-hipath-3750-to-asterisk-te110p

The HG1500 is an expansion card for the Hipath that enables SIP extensions and in this case Trunks.

This it the System Config

Hipath Manager E + Asterisk

Once you installed the hg1500 card, go the web based configuration panel. Create a node for the asterisk pbx. Explorers -> Voice Gateways -> Nodes

Hipath Manager E + Asterisk

Create call address for the node. All my asterisk extension start with digit 6XX.

Hipath Manager E + Asterisk

On the asterisk box, create sip trunk, the host=10.0.1.7 is the IP address of hipath hg1500 card.

Hipath Manager E + Asterisk

This the outbound route from asterisk to the hipath. It routes asterisk users dialing [1238]XX to the hipath SIP trunk.

Hipath Manager E + Asterisk

On the hipath create a dialplan for asterisk extensions.

Hipath Manager E + Asterisk

I had to create a virtual port on the hipath for all asterisk extensions (all extensions 6XX are virtual ports). Whenever I dial this extension on the hipath it forwards the calls to the SIP trunk. I did try using the dial plan without creating all virtual stations but it didn’t work.

 

Hipath Manager E + Asterisk

This is how I create a virtual port (see check sign on “Virtual Station”). Forward all calls to this station to SIP trunk.

Thats it, Thanks again to Achmad Taufik for the guide and screenshots. Any issues post a comment and we can try to fix.

Some extra screenshots for the Route config

Siemens Hipath 3750 to Asterisk TE110P

I put this together about 6 months back – 100% stable and working great.
I need to post this as notes more than anything. See the diagram for the current setup

This post won’t go into every detail so if you have any questions post a comment.

Siemens HiPath 3750 + tsm2 (PRI) card
|
| Crossover T1 Cable
v
Asterisk + TE110P

The goal was to keep the current phone system and allow for VOIP calls – €€€ saving So I purchased an old HP DL380 G4 server for €250 and I had an old TE110P card from testing.

So the steps involved,

1. Install TE110P into server

2. Install Debian net install 5.0

3. Install Asterisk 1.4, libpri, addon’s + FreePBX (If you using an ISO based install, I can highly recommend PBX in a Flash – The name, site, etc… looks amateur but this is without doubt the best Asterisk ISO available.

4. Test the PRI card – The TE110P is notorious with interrupt errors
a. Disable all non essential items in the bios – Make sure the TE110P has its own interrupt

5. Create a loopback cable and max the card, all the time checking for interrupt errors (see for details http://bit.ly/avfKlF)

6. When you’re happy the card it working correctly connect it to your TSM card in your Hipath system using the crossover T1 Cable

7. Now configure the card – SSH onto the server and edit the following config files.

/etc/Zaptel.conf

——————-
span=1,0,0,ccs,hdb3,crc4 → This sequence is very important 1,1,0 will send clock info through the Siemens box and bring down your Telco PRI
bchan=1-15,17-31
dchan=16
loadzone = uk
defaultzone = uk
——————-

/etc/asterisk/zapata.conf

——————-
[trunkgroups]

[channels]

language = en
context = from-internal
pridialplan = unknown
resetinterval = never
prilocaldialplan = unknown
usecallerid = yes
hidecallerid = no
callwaiting = yes
usecallingpres = yes
callwaitingcallerid = yes
threewaycalling = yes
transfer = yes
cancallforward = yes
callreturn = yes
echocancel = yes
echocancelwhenbridged = yes
echotraining = 400
rxgain = 0.0
txgain = 0.0
group = 0
callgroup = 1
pickupgroup = 1
immediate = no
overlapdial=yes
facilityenable = yes
callerid = asrecieved
switchtype = euroisdn
signalling = pri_net
channel = 1-15,17-31
——————-

# ztcfg -v

The lights on the card will show green.

Now we need to configure both dial plans to play nice.

1. Freepbx create a trunk ZAP/G0, Trunk to your VOIP Provider & [Trunks to your GSM gateway → will get to this a little later.]

2. Create outbound routes to your SIP provider, ZAP/G0 & GSM gateway

3. You need to configure the route dial plans based on your own setup Use http://bit.ly/b0YzhM as a guide

4. Setup your Hipath’s TSM2 card and dialplan – You will need the hipath Manager E application → It’s a pain to get access to and your installer most likely wont give it to you. Post a comment and I’ll send you a mail.

5. See images for the Route setup and Dial Plans – Post a comment if you have any questions on these

Hipath_routesHipath_dial_planPri_loopback_cableVoip_setup

Asterisk in a Fortune 500 company

John Todd has posted an interesting link about a speech that will take place in which Jeremy Wadhams from Yahoo will discuss an Asterisk implementation in a Fortune 500 company.

I don’t know how many of you are going to be at ITEXPO/Digium Asterisk World in Miami next week – I hope to see as many of you as possible, though.

There has been an interesting change in the line-up for the show, that I think bears mentioning here since it possibly will help quite a few of you in your discussions about getting Asterisk into your company. We’ve had the good fortune to have a last-minute keynote addition at the show, which is going to be Jeremy Wadhams from Yahoo. He’s going to be talking about a Fortune 500 implementation of Asterisk across their entire network, and why they made the decision to move to Open-Source telephony for the core of their voice network.

Keynote: 3:30 – 4:00 PM on Wednesday – Jeremy Wadhams, Yahoo

It’s not yet on the ITEXPO site, since we only confirmed this yesterday with Jeremy, who is really being a great sport for doing this on short notice.

Having Yahoo giving a keynote on their multi-thousand seat installation is great news for the Asterisk community in general, and is great news specifically for other Enterprise managers who have been looking for that all-important set of examples of public users of a technology. (Enterprise tends to move in herds.) There are large numbers of Enterprise users of Asterisk, but it’s always great to get a “name-brand” company who can be offered as a proponent of Asterisk.

Again, hope to see all of you there in Miami next week!

http://www.tmcnet.com/voip/conference/

This will be interesting!!! Stay tuned