My Asterisk and Blueface setup

A little about my setup:

1 x Linux box (P4 2Ghz, 1024Mb, 1.2Tb)

1 x Irish Broadband connection (3Mb symmetric!)

1 x CAT 5e Network (around the home.. also have an 802.11g network too, copper gives me more SPEED for video serving)

1 x Aastra 9112i VoIP Phone (Thanks to [ ])

1 x ATA (Ethernet to POTS fone) [ ]

The Linux box [ ] is running (among other services):

Bind (DNS server)

DHCP service

Jay’s Firewall [ ]

Asterisk [ here ]


For blueface you’ll need to open the following UDP ports to the outside world (or Internet connection!): 5060->5070 and 10000->20000.

The linux box in a multi-homed host (ie it has two NIC’s and one connected to Irish Broadband’s Ethernet and the other connected to a hub and on through a patch panel to the ports around the house). The internal network has an address range of -> with the DHCP server making sure that the address are handed out fairly!

The ATA and Aastra VioP phone are connected to the internal network. Through DHCP and BIND these are known, on the internal network, as and

Asterisk is easy to install.. [ a great place to start is ]. I’ve got it working well on both SuSE and Ubuntu. If you are doing a SIP only setup, you will not need to buy any interface cards, it can all be done with software!

To the asterisk config files!

There are two main configuration files that you will have to get to know well! They are the extensions.conf and sip.conf. Sip.conf is where you tell asterisk about the accounts that you want to use. The extensions.conf file is where you tell asterisk what to do with the accounts.

Lets have a look an example:


; this opens a sip channel from blueface's server to asterisk (to allow you receive calls)
register => <blufaceusername>:<bluefacepassword>

[blueface] ; this sets up the channel so you can use it in extensions.cof type=friend insecure=very username=<blufaceusername> authname=<blufaceusername> fromuser=<blufaceusername> secret=<blufacepassword> context=fromblueface ; needed in the extensions.conf file

[fone1] type=friend username=fone1 ; this is the user name I use in the Aastra phone secret=<passwd> ; this should be the password (clear text) host=dynamic context=homepbx ; the context for use in the extensions.conf file

[ata1] type=friend username=fone1 ; the username for the ATA secret=<password> host=dynamic context=homepbx

Now to look in the extensions.conf file

exten => <blufaceusername>,1,Answer		; First thing is to get asterisk to answer the call
exten => <blufaceusername>,2,Dial(SIP/fone1&SIP/ata1,45,tr)	; Then ring fone1 and ata1
									; for 45 seconds
									; allow calls to be tx'fered
exten => <blufaceusername>,3,Hangup		; after 45 seconds, handup
							; of course we could go to voicemail....

[homepbx] ; the “internal” PBX exten => 1000,1,Dial(SIP/fone1,30) ; then someone inside dials 1000, ring fone1 exten => 1000,2,VoiceMail(1000@mb_homepbx) ; after 30 seconds, goto voice mail exten => 1000,3,PlayBack(vm-goodbye) ; say good bye! exten => 1000,4,HangUp() ; and hangup

exten => 2000,1,Dial(SIP/ata1,30) ; then someone inside dials 2000, ring ata1 exten => 2000,2,VoiceMail(2000@mb_homepbx) ; after 30 seconds, goto voice mail exten => 2000,3,PlayBack(vm-goodbye) ; say good bye! exten => 2000,4,HangUp() ; and hangup

exten => 303,1,Dial(SIP/303@blueface) ; A fun one here.. blueface’s speaking clock exten => 303,2,Hangup ; and hangup

; Send PSTN calls to Blue Face. exten => _X.,1,Dial(SIP/${EXTEN}@blueface) ; any other number dialed, send it to blueface exten => _X.,2,Hangup ; finish up.

You need to read about and setup the voicemail.conf if you want to configure voicemail.

That is about it…

nnect to the asterisk server with:

asterisk -vvvvr

Now you can type:

sip debug ip

Try “sip debug ip” to see what is going on when you get and make a call or “sip debug ip

what is happening with the internal phones

sip no debug

This will turn it all off

sip reload

You can edit the sip.conf file in one session then type “sip reload” to get asterisk to look at them.

extensions reload

Like sip reload, you can edit the extensions.conf file and reload it with this command

sip show peers

This should show all the sip channels that are currently registered (useful to see if a phone has made a successful connection to asterisk)

Some other options that might be useful..

I can run X-lite on my laptop [ ] and with an addition to the sip.conf (for an account) and extensions.conf (for what to do!), I can take and make calls on my laptop!

Final few words

With this setup it is possible to to make or take one, two, three and more calls at the same time (your bandwidth will limit what you can do!… kinna neat!)