Green phones in the house

Siemens-N300AA long time ago I did a post about the new home phone setup. Since that time I really liked the combination of Asterisk with the Siemens Gigaset VOIP handset. Now that I’ve moved to a bigger place with more than one floor I decided it was time to get another handset. I don’t know if it was a stupid coincidence, but the base station stopped transmitting the DECT signal a few days before moving. So this was a good moment to investigate what to buy as replacement. I eventually chose the N300A IP with two C610 handsets. The main reasons where IP for VOIP and the ECO DECT / ECO DECT+ option. The plus variant claims to shutdown the DECT signal completely while in standby modes, so it’s safe to put this one the night stand. It also has a baby phone function, which might get handy.

Also this new base station N300A works flawlessly with the running Asterisk setup.

VOIP problemo

Today I encountered a strange problem when I tried making a phone call using my home VOIP telephone. I could dial out, but there was no sound coming through, which is pretty confusing. At first I thought it had something to do with the firmware update I did recently on my Siemens A580 IP. After spending half an hour troubleshooting it appeared to be my VOIP provider uses another sip server to talk back to my Asterisk server. After adding this new server ip to my firewall configuration the sound is coming through again, which is the essence of telephony.

Added firewall rule:
[code lang=”text”]
access-list 101 permit udp host 83.143.188.182 host
access-list 101 permit udp host 83.143.188.186 host
[/code]
I think this could be useful for other Budgetphone VOIP users experiencing the same.

Home phone by Asterisk

Last week I’ve spend some time doing an Asterisk PBX setup at home. Because I like the technique and my girlfriend likes to use the phone I decided to build my own PBX (Private Branch Exchange). In other words a telephone exchange. So doing some research I figured out what the requirements where and came up with the following components:
– a SIP provider
– a SIP compliant phone
– Asterisk PBX software
– an Internet connected Linux server running 24/7

As for the SIP provider I chose the Budgetphone company because they support Asterisk and you get a local area number on which you can be called.

On my search for a suitable phone selected the Siemens Gigaset A580 IP. The main reasons I chose this phone where:
– it’s a hybrid phone so you can use POTS and or VOIP
– it’s energy efficient by using multiple energy-saving technologies
– it’s in a affordable price range

The installation of Asterisk was a piece of cake. Being a very happy user of Debian Linux, I installed the pre-compiled package from the Debian repository by executing the following command:

[code lang=”text”]
# apt-get install asterisk asterisk-sounds-main
[/code]

In my case the Asterisk server has a public ip-address, and the phone base station is located in private ip space behind a NAT router.

Below you’ll find the Asterisk configuration. This configuration is known to work on Asterisk version 1.4.21.2~dfsg-3. In my case all configuration files reside in ‘/etc/asterisk/’.

sip.conf:
[code lang=”text”]
[general]
context=default
subscribemwi=yes
allowoverlap=no
bindport=5060
bindaddr=0.0.0.0
srvlookup=yes
disallow=all
allow=alaw
allow=ulaw
allow=g726
allow=ilbc
allow=gsm
language=us
dtmfmode = auto

register => 31123456789@sip1.budgetphone.nl:***:31123456789@sip1.budgetphone.nl/101

[31123456789]
type=friend
context=from-budgetphone
host=sip1.budgetphone.nl
fromuser=31123456789
fromdomain=sip1.budgetphone.nl
username=31123456789
insecure=very
secret=***
qualify=yes
port=5060

[phone]
type=friend
context=internal
host=dynamic
nat=yes
callerid=”Home phone”
canreinvite=no
qualify=yes
secret=password
mailbox=1001
[/code]

extensions.conf:
[code lang=”text”]
[general]
static=yes
writeprotect=no
clearglobalvars=no

[globals]
INT1=SIP/phone
OUTBOUNDTRUNK=SIP/31123456789

[from-budgetphone]
exten => 101,1,Dial(${INT1},28)
exten => 101,n,GotoIf($[“${DIALSTATUS}” = “BUSY”]?busy:unavail)
exten => 101,n(unavail),VoiceMail(1001@default,u)
exten => 101,n,Hangup()
exten => 101,n(busy),VoiceMail(1001@default,b)
exten => 101,n,Hangup()

[internal]
; internal number
exten => 1001,1,Dail(${INT1})
; voicemail number
exten => 700,1,VoiceMailMain()
; external numbers
exten => _XXXX.,1,Set(CALLERID(all)=31123456789)
exten => _XXXX.,2,Dial(${OUTBOUNDTRUNK}/${EXTEN})
exten => _XXXX.,3,Hangup()
[/code]

voicemail.conf
[code lang=”text”]
[general]
format=wav49|gsm|wav
serveremail=asterisk
attach=yes
skipms=3000
maxsilence=10
silencethreshold=128
maxlogins=3
emaildateformat=%A, %B %d, %Y at %r
sendvoicemail=yes

[zonemessages]
eastern=America/New_York|’vm-received’ Q ‘digits/at’ IMp
central=America/Chicago|’vm-received’ Q ‘digits/at’ IMp
central24=America/Chicago|’vm-received’ q ‘digits/at’ H N ‘hours’
military=Zulu|’vm-received’ q ‘digits/at’ H N ‘hours’ ‘phonetic/z_p’
european=Europe/Copenhagen|’vm-received’ a d b ‘digits/at’ HM

[default]
1001 => 1234,Your name,user@domain.net,,tz=european
[/code]

When done editing those files, you need to connect to the Asterisk CLI (Command Line Interface) by using the following command:
[code lang=”text”]
# asterisk -r
[/code]

Set the verbosity level to 10:
[code lang=”text”]
*CLI> core set verbose 10
[/code]

To reload the new configuration issue:
[code lang=”text”]
*CLI> reload
[/code]

To see if the SIP services have registered succesfully issue:
[code lang=”text”]
*CLI> sip show peers
[/code]

I needed to configure the next fields in the base station configuration to get the phone registered with Asterisk. Go to ‘settings’ -> ‘telephony’ -> ‘connections’ -> ‘edit’ -> ‘show advanced settings’.
– Authentication Name: phone
– Authentication password: *******
– Username: phone

– Domain: local
– Proxy server address: Asterisk server ip
– Registrar server: Asterisk server ip

To make the MWI (Message Wait Indicator) work on the handset you need to follow the next steps:
Web browse to the Siemens phone web interface, go to ‘settings’ -> ‘telephony’ -> ‘Network Mailbox’. For the connection you want MWI with, enter the voicemail access number into the ‘Call Number’ box, in my case 1001 and tick the ‘Active’ box. This will make the Siemens phone subscribe to the mailbox status.

Have fun!

UPDATE: Since the upgrade of my server system Debian Lenny (asterisk 1.4) to Debian Squeeze (asterisk 1.6) incoming calls were not coming through. After some searches I found out one parameter needed to change at the sip.conf file.

[code lang=”text”]
insecure=port,invite
[/code]