SIPping away
At the recent Apricot the folk from APEET were selling wireless IP phones for a givaway price. It reminds me of the early times of 802.11 when these devices were made available for about 50-100 bucks.
So having this device inspired me to try and configure an asterisk server on my multipurpose home router/gateway. The machine I run this on is a Dell Power edge, one of these somewhat older machines with only the powersupply van as a moving components. The 300Mhz CPU (if I’m not mistaking), 96M memory. Machine runs Debian Linux and has an EICON DIVA 2.01 S/T ISA ISDN card.
I’ve installed asterisk and mucked about for a day or two, first to get incomming ISDN calls working. Once you understand the ‘channel’ and ‘context’ concepts its pretty easy to setup.
I’ve set it up so that:
- a call to one of my MSN numbers gets rerouted to the sip phone.
- a call from the SIP phone to “100” calls the other MSN (so I can call my wife.
- any call starting with “0” is routed to the plain old PSTN network
So to be able to do this one needs to setup two channels, the SIP and MODEM channel and create a couple of extentions.
In sip.conf i defined the following
[olaf]
type=friend
host=dynamic
username=olaf
context=olaf_from_sip
secret= ****
dtmfmode=inband ; Choices are inband, rfc2833, or info
In modem.conf I added the following:
[interfaces]
context=isdngroup=1 ; group=1
msn=201234567 ; the incomming MSN
incomingmsn=*
device => /dev/ttyI0
device => /dev/ttyI1
In extensions.conf I have the following relevant entries:
[default]
; This is for the incomming sip calls that are addressed to sip@
; off course you need a SRV entry for
exten => olaf,1,Dial(SIP/olaf,100,r)[olaf_from_sip]
ignorepat => 0
exten => 100,1,Dial(Modem/g1:0209876543,100,r) ; when 100 is dialed the ‘hotline’ number is called
exten => _0.,1,Dial(Modem/g1/201234567:${EXTEN}) ; any extention starting with 0 is routed to the PSTN with Caller ID 2012345657
exten => _0.,2,Congestion[isdn] ; see modem.conf
exten => 201234567,1,Dial(SIP/olaf,100,r) ; a call on the isdn line, to 201234567 is rerouted to the SIP/olaf extention.
Setting this up is not hard indeed and it is truly remarkable that his technology is available to home users.