<- ...Back
Setting Up Cards

 

Digium sell a number of cards for use with Asterisk, these range from single FXO in the guise of the X100P through to fully fledged quad E/T1 cards. If you are setting up Asterisk at home then an X100P (or two if you have 2 lines) should be enough for your needs. You might also want to get an FXS card so that you can get standard analog phones working with Asterisk.

 

My own configuration at home consists of a single X100P and a dual port TDM20B card – TDM400P is the generic name for the card, specific names exist for the number of ports on the card i.e.:

 

TDMx0B where x is either 1, 2, 3 or 4 – denoting the number of ports.

 

There are a couple of things to note about the X100P. Although the card should work in your country things like caller id detection may not. In the USA you should have no problems at all, but in Europe/rest of the world you should consider searching the archives for information.

 

At the time of writing the following countries appear to have either full or rudimentary support for caller id:

 

 

USA             Full

UK               Not on BT, *SOME* cable companies may work.

FR/DE          Yes

RO               Yes

NL/DK          Yes (only on TDM40B not with X100P)

 

 

If anyone has any other locations that are known to work/not work please let me know. If you are not going to be adding cards to your system you may want to skip this section to get started, although it is recommended that you read the entire document for completeness.

 

 

In the machine I use for Asterisk; a Dell Optiplex GX115 I have disabled the soundcard since I do not need it. You may wish to keep it enabled but bear this in mind if you get IRQ conflicts. Ideally you will disable any hardware that you are not going to use on this machine. It can't harm to disable the parallel and serial ports for a start,

 

 


X100P Installation

 

I hope I can make the assumption that you are capable of adding a new card to your system, if not get someone who knows what they are doing to help out. Oh and please wear a wrist strap.

 

The X100P card is what we call an FXO (Foreign Exchange Office) card. Unless you know about telecoms then that probably didn’t mean much. What it means to you and me is that you can plug a cable into the phone socket on your wall and into the back of the X100P; this is your incoming line from your telecoms provider (KPN/BT/Bell etc).

 

 


 

 


You may have noticed that there are 2 sockets on the back of the X100P; one marked as the line interface and the other as a phone interface. Plug in an appropriate cable between the wall socket and the line interface on the card. If you have a spare phone then plug this into the phone interface on the card too. It is always good to have a phone plugged into this interface because in the event of asterisk failing, or a power cut the card actually still allows access to the PSTN line. Obviously if you decide to use a phone that is not powered from the phone line, if you have a power cut, it will not work. During the normal operation of Asterisk do not use this phone to try and make calls. This is your emergency backup phone. If you try to use the phone attached to the phone port Asterisk thinks it's an incoming call and tries to answer it – chaos ensues.

 

TDM400P Installation

 

The TDM400P card is an FXS (Foreign Exchange Station) / FXO (Foreign Exchange Office) card.

 

For those using phones from the UK you may need an adapter that provides a ring capacitor to actually get the phone to physically ring. I have both a BT Easicom 1000 and a Panasonic KXTCD-777 (this is a DECT base station and 2 handsets sold in one box). The Panasonic phones do not require the adapter with ring capacitor but the BT Easicom does.

 

If you are using phones from the USA (aside from any power requirements they may have) you should just be able to plug them in.

 

 


 

 


The TDM400P is modular, you can add up to four modules in any combination. FXO modules are what phone lines plug into, FXS (Foreign Exchange Station) are what you plug standard analog phones into to use them with Asterisk.

 

The newer versions of this card have a power connector on them – plug it in! Try to use a spur from your power supply that is not used by anything else. I have had a number of problems using this card with under powered PSU's. I have never successfully been able to use all four ports regardless of the PSU used.

 

 

TE410P/TE405P  Installation

 

These two cards are nearly identical. The major difference is the voltage that they require:

 

The TE410P is a quad span E1/T1 card. The ports can individually be switched  to E1 or T1 via on board dip switches. You can have some ports set to E1 and others to T1 without trouble. This card requires a 64 bit 3.3 volt PCI slot.

 

 


 


64 bit, 3.3 volt PCI slot

 

 

 

The TE410P is a quad span E1/T1 card. The ports can individually be switched  to E1 or T1 via on board dip switches. You can have some ports set to E1 and others to T1 without trouble. This card requires a 64 bit 5.0 volt PCI slot.

 

 


 


64 bit, 5.0 volt PCI slot

 

 

 

Configuration

 

Once the cards have been physically plugged into your Asterisk machine, power it up again. Once you’ve logged in you’ll need to configure the cards. It’s worth pointing out that you do not have to have one of each card type but this section will make the assumption that you have got one of each so that we can cover a much fuller configuration.

 

 

We will not, at this stage, deal with setting up a TE410P or Te405P although much is the same there are some very specific configuration options required depending on the what you are connecting the card to. This may be added at a later date.

 

 

There are two configuration files related to setting up zaptel cards these are /etc/zaptel.conf and /etc/asterisk/zapata.conf. The first, /etc/zaptel.conf is a configuration file for the card driver, the seconds /etc/asterisk/zapata.conf tells Asterisk how to use the card.

 

 

 TODO
Voice Mail

 

 

Voicemail.conf  TODO

Music On Hold

 

We've all heard that nasty plink-plinky music that some companies play when you're on hold. Well now you can do the same, only better. Asterisk supports music on hold allowing you to play music, special offer voice overs or whatever you please (subject to copyright restrictions) to your callers while you nip off and grab a coffee.

 

 

In most cases setting up Music on hold is as simple as ensuring you have a copy of mpg123 installed, preferably version 0.59r, copying some mp3's into the appropriate directory and setting the class of music in your extensions.conf

 

 

The music on hold config file, /etc/asterisk/musiconhold.conf contains a section called [classes] – within this section you can define different types of music on hold, or apply different parameters to the music played. Take a look at this example

 

 

 

[classes]

default => mp3:/var/lib/asterisk/moh/default,-z

funkyquiet => quietmp3:/var/lib/asterisk/moh/funky,-z

 

 

Here there are two classes of music defined, default and funkyquiet. Each points to it's own path, in this case default points to /var/lib/asterisk/moh/default/ and funkyquiet points to /var/lib/asterisk/moh/funky. The option immediately after the => defines the type of files located in the location, mp3 means mp3's and quietmp3 means mp3's, but lower the volume.

 

 


mpg123 accepts paramters, at the end of the definition you can add

parameters to pass to it for example in the example

 

default => mp3:/var/lib/asterisk/moh/default,-z

 

the -z at the end means shuffle the playlist (entries in the directory)

 

Use 'man mpg123' for other options.

 

 

 


The default entry is used for music on hold if you do not explicitly specify which class to use in your dialplan by using the SetMusicOnHold(class) command, eg

 

 

 

exten => s,1,SetMusicOnHold(funkyquiet)

 

 

You can also use the WaitMusicOnHold(seconds) command in your dialplan to pause for a number of seconds, playing music on hold, before continuing on through the priorities. Remember to set the music on hold class before issuing this command, unless you want the default music to play. Using WaitMusicOnHold when you have no music in your directories will result in no sound, but the pause will still be there.

 

 

You can also stream music on hold from a url, have a look at this example

 

 

 

 

network => custom:/var/lib/asterisk/moh-dummy,/usr/bin/mpg123

-q -s --mono -r 8000 -f 8192 -b 0  http://192.168.1.232:8080/stream.mp3

 

(Note this should be all one line in your config file)

 

To use it simply replace the url (http://192.168.1.232:8080/stream.mp3) part and set

the class in you extensions.conf.

 

 


 

If you use Internet streams, aside from any legal implications, there

are a couple of things to ask yourself:

 

1.      Streaming uses your bandwidth – do you have that much to spare?

 

2.      Can you be sure the content is suitable to all your callers? All the time?

 

 

 

 

 


Call Parking

 

Call parking is a wonderful invention, the best way to explain how useful it can be is to use a real world example.

 

Imagine the scene, you're on your own in the office. Your desk is on the 2nd floor and the computer room is on the 4th. You are working late to fix a problem on one of the servers, but you need some help. You call another support team - they say they are busy but will call you back in 5 minutes. When they call you back they ask you to fiddle with the server. So, now you have a number of options

 

 

1. Say "hang on", run up stairs and do what they ask then run back and say "done that"

only to hear them ask you to do something else.

 

2. Say "hang on, I'll transfer the call upstairs", you transfer the call to the computer

room, run up stairs, pick up the phone in the computer room, run downstairs hang up,

run upstairs and talk to the support team.

 

3. Say "hang on, I'll transfer the call upstairs", you park the call, hang up, run upstairs

to the computer room and pick up the parked call.

 

 

Now, it's clear that option 3 is the best for us. Parking the call, basically involves transferring the call to a 'fictional' extension that will hold the call until we either pick it up, the caller hangs up, or the timeout period expires. Call parking is a wonderful thing... embrace it with open arms. So How do we do this with Asterisk? Well, it's simple. In your Asterisk config directory is a file called features.conf. Let's take a look at it:

 

 

 

[general]

parkext => 701

parkpos => 702-720

context => parkedcalls

parkingtime => 45

transferdigittimeout => 3

courtesytone = beep

adsipark = yes

 

 

It should be self explanatory, but we'll go through it just to be sure you understand.

 

 

 

 

parkext => is the extension you will dial to park a call. You will probably note that your

features.conf file has this number set at 700. I've changed mine to 701 because I was

having an issue with Asterisk - although it would 'see' (looking at the console) I had tried

to transfer to 700 it appeared not to believe that I had dialed it. This was essentially

due to the 00 in the 700, changing it to 701 eliminates the problem completely.

 

parkpos=> is the range of numbers used to park calls in the extract above I get 19

parking extensions, enough for me but you might like to expand it if you have more

users.

 

context=> is the context that you need to include to allow types of call to use call

parking, this prevents external users parking YOU on your own system!

 

parkingtime => is the length of time in seconds to park the call. Once this time expires

the original extension will be called again.

 

transferdigittimeout=> is the time between pressing the digits when transferring a call –

i.e. the number of seconds before Asterisk thinks you have competed dialing, you dial 7,

0 then 3 and wait 3 seconds (as per the example) and you will transfer the call.

 

courtesytone=> plays this file when you dial the extension a parked call is on. Doesn't

appear to work if you have music on hold.

 

adsipark=> Sends ADSI data to ADSI phones to display information on their screens.

 

The process of parking a call is simple, but dependent on your phone, here's the process

on a Cisco 7960:

 

1.     A call comes in and is answered on the 7960, press the more key then the Trnsfer (transfer) key.

2.     Dial your parkext (in this case 701). An announcement is played telling you where the caller is parked, this will be in the range specified in the parkpos line.

3.     You will then be transferred to the park extension, finally press the Trnsfer button again and your phone will hang up, and the remote caller will be parked. Unfortunately, if you try to use the blind transfer feature on a Cisco phone, you wont hear the announcement, so wont know where the caller was parked!

 

 

 


 

In order to use call parking you must have transfers enabled on the

dial command, ie

 

Dial(SIP/1234,20,Tt), Dial(SIP/1234,20,T) or Dial(SIP/1234,20,t)

 

see common dialplan commands for more details

 

 

 

 

Queues

 

 TODO

 

queues.conf

 

 

 


A Basic Configuration

 

dial, voicemail

get voicemail

 

 TODO

 


An Advanced Configuration

 

Macros

Speaking clock

 

 

 TODO

 installed or using live cd/cf/pxe

 

 


Tips And Tricks

 

Marco Polo test

 

Marco Polo (1254-1324), is probably the most famous Westerner to have traveled on the Silk Road. He excelled all the other travelers in his determination, his writing, and his influence. His journey through Asia lasted 24 years. He reached further than any of his predecessors, beyond Mongolia to China. He became a confidant of Kublai Khan (1214-1294). He traveled the whole of China and returned to tell the tale, which became the greatest travelogue.

 

The Marco Polo test has nothing to do Marco Polo, we're just borrowing his name for a little while. This is a useful little test to audibly check latency and requires two users one at each end of the link being checked. To setup the test simply one end simply calls the other, once the other end answered and the social niceties have taken place the  test can begin. We'll start by calling one end A and the other end B, for illustrative purposes.

 

The A end begins by saying “Marco” on hearing “Marco” the B end replies “Polo”, when the A end hears “Polo” they reply “Marco” again and so on.

 

Very quickly both sides can ascertain the latency of the connection.

 

After the above has taken place a few times, the B end should suddenly reply “Marco” instead of “Polo”. What happens next depends on the person at the A end, either they will start stammering and acting all confused or they will reply “Polo”. The second of these two events is what we are really after.

 

 

That's it, that is the Marco Polo test.

 

 

 

Separate Applications/Macros

 

 

 TODO

 

Set Your CallerID

 

 TODO

seperate applications/cpabilities into their own contexts

set callerid appropriate for network you are calling

closing time

Retry an extension

Speaking Clock

camp on an extension

 

Office hours

 

 TODO

 

Target

 installed or using live cd/cf/pxe

 

Cover following

 

Basic Configuration

 

sip.conf

iax[2].conf

extensions.conf

voicemail.conf

 

Advanced Configuration

 

Misc Configuration

 

 

 

 


Quick Reference

 

 TODO

 

Some links that you may find useful, the list consists of a variety of helpful sources most of which are provided by people for free. Please, where this is true and the person asks for donations, help them out a little by giving something back. We all have to eat and pay

 


Codec Bandwidth Requirements


 

 


 

 

 

 

 

 

 



Useful Links

 

Here are some links that you may find useful, the list consists of a variety of helpful sources most of which are provided by people for free. Please, where this is true and the person asks for donations, help them out a little by giving something back. We all have to eat and pay the bills.

 

 

Digium

Most of the Asterisk codebase comes from them, plus hardware is available (E1/T1/Analogue cards)

http://www.digium.com

 

 

 

automated.it

My Website. Lots of things I've done can be found here.

http://www.automated.it/asterisk/

 

 

 

voip-info.org

User maintained wikki – not always 100% reliable info, but very useful

http://www.voip-info.org

 

 

 

 

 

 

 


<- ...Back