Install a PBX at home
Have fun with your phone !
why a pbx ? | basic configuration

Why a pbx ?

picture from wikipedia

A pbx (private branch exchange) does the work of operators in the olds days: it connects phones together. Here are some reasons to install a pbx at home:
  • you have two phone lines : the one from the historical operator, one from your adsl box,
  • you have two phones you would like to connect,
  • you want to program your answering machine,
  • you would like to check your answering machine on the web,
  • from anywhere in the world you would like to ring phones in the house for free just using an internet connection.
  • If you are interested in one of the items above, you might consider installing a pbx at home.

    Basic configuration

    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.

    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, but I did not tried. You can check the installation of the cards using:
    Zaptel Configuration
    Channel map:
    Channel 01: FXS Kewlstart (Default) (Slaves: 01)
    Channel 02: FXS Kewlstart (Default) (Slaves: 02)
    2 channels configured.


    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:
    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
    ; default context is where incoming calls go
    ; make all incoming calls ring the main phone in the house
    ; local context is used by the console only
    ; dialing 666 on the console rings my phone at work
    ; dialing 200 on the console ring the main phone in the house
    ; directly dial number beginning with 0 to adsl line
    ; internal context is for phones in the house
    ; directly dial number beginning with 0 to adsl or pstn
    ; store the extension in variable MY_EXTEN
    ; if adsl line is available try to ring it
    ; in case of a time out (adsl down) try pstn
    Here is my /etc/asterisk/sip.conf file to connect the Linksys PAP2 device to the computer:
    type=friend                       ; this enables to send and reveive calls
    username=siplogin@     ; is the ip address of asterisk server
    secret=*****                      ; replace ***** with a password
    context=internal                  ; tells that this sip user
                                      ; goes to "internal" context
    Back to my home page