|

Hardware
First of all you need an old computer, on which you can install linux.
Then I bought two Digium Wildcard X100P FXO cards on ebay from ngnsky.
Current price for each card is $19.99, but it was cheaper from ebay. I bought two cards since I have two phone lines (one PSTN and one ADSL).
Then I bought for 60 euros the linksys pap2 phone adapter which enables to put two standard phones I already had in the house to the computer.

Software
For the software I used a linux system with asterisk.
Since I am familiar with gentoo
I juste typed emerge -av asterisk zaptel. I just had to compile the
alsa modules with oss support in the kernel. I guess it works fine with any linux distro.
If you do not want to install a linux box it looks like there is an already installed system
named "asterisk now" available from asterisk.org, but I did not tried.
You can check the installation of the cards using:
>ztcfg
Zaptel Configuration
======================
Channel map:
Channel 01: FXS Kewlstart (Default) (Slaves: 01)
Channel 02: FXS Kewlstart (Default) (Slaves: 02)
2 channels configured.
Configuration
First thing I want to do is: all incoming calls will ring the main phone in the house,
and outgoing phone calls will go to ADSL line.
Here is my /etc/asterisk/extensions.conf file:
[globals]
ADSL_LINE=Zap/1 ; i plugged my adsl line on the first FXO card
PSTN_LINE=Zap/2 ; i plugged pstn line on second FXO card
CONSOLE=Console/dsp ; this is the asterisk console
MAIN_PHONE=SIP/home ; name of the linksys PAP2 phone
PHONE_AT_WORK=0169081234
;
; default context is where incoming calls go
;
[default]
; make all incoming calls ring the main phone in the house
exten=>s,1,Dial(${MAIN_PHONE})
;
; local context is used by the console only
;
[local]
; dialing 666 on the console rings my phone at work
exten=>666,1,Dial(${ADSL_LINE}/${PHONE_AT_WORK})
; dialing 200 on the console ring the main phone in the house
exten=>200,1,Dial(${MAIN_PHONE})
; directly dial number beginning with 0 to adsl line
exten=>_0XXXX.,1,Dial(${ADSL_LINE}/${EXTEN})
;
; internal context is for phones in the house
;
[internal]
; directly dial number beginning with 0 to adsl or pstn
; store the extension in variable MY_EXTEN
exten=>_0XXXX.,1,SET(MY_EXTEN=${EXTEN})
; if adsl line is available try to ring it
exten=>_0XXXX.,2,Dial(${ADSL_LINE}/${MY_EXTEN})
; in case of a time out (adsl down) try pstn
exten=>t,1,Dial(${PSTN_LINE}/${MY_EXTEN})
Here is my /etc/asterisk/sip.conf file to connect the Linksys PAP2 device to the computer:
[general]
context=sipdefault
srvlookup=yes
bindport=5060
bindaddr=192.168.0.4
[home]
type=friend ; this enables to send and reveive calls
username=siplogin@192.168.0.4 ; 192.168.0.4 is the ip address of asterisk server
secret=***** ; replace ***** with a password
qualify=yes
nat=no
host=dynamic
canreinvite=no
context=internal ; tells that this sip user
; goes to "internal" context
|