Home Automation‎ > ‎

Door communication

Components

Configuration

Overview

Our basic use case is to setup a door communication system that allows home owners to look at and communicate with individuals at the door, before they open the door.  Given the flexibility of SIP and especially the Asterisk PBX software there are endless scenario's we can implement on top of our basic scenario.  But let's not get ahead of ourselves and start at the beginning.

In short, we'll configure two SIP clients in the Asterisk PBX and define a dialplan that tells Asterisk how to route calls between clients.

2N Door phone

Out of the box, the 2H Helios door station is configured to use DHCP to obtain an IP address on your local network.  Most home networks have a device that performs DHCP and hands out IP addresses, typically this is the wireless router.
Find out the IP address that got assigned to the 2N device through the DHCP device's user interface.  Once you know the IP address, point your browser to it.  (e.g. http://192.168.2.42)

First, configure the 2N device with the SIP account that we'll configure on the Asterisk server.

There are a boatload of configuration options with SIP communication, so the details of your configuration might be different.
Second, we need to tell the door station which number to dial when a visitor presses the door bell.  I have a 2N Helios device with just a single button.  This button maps to the first entry in the phone book.  So we need to add the correct number to dial in the first position in the phone book.
As you can see, when a visitor presses the doorbell, my station will dial the number 888.  You'll see how this is configured in the Asterisk dial plan later.  My 2N Helios has a camera as well.  There's very little that you have to do to make this work.  There's just a single setting in Asterisk that says to enable video.  We'll cover that in a bit.

Other things to keep in mind:
  • Save your settings after you made changes.
  • I have bought an additional license which gives access to mode codes for audio and video.  Depending on the indoor phone you use to terminate the door phone call you might need this too.  SIP clients negotiate for common codecs while setting up communication.  If they don't have codecs in common, there will be no communication possible.
  • I use the 2N Helios with power-over-ethernet (POE), this way I only need a single ethernet cable at the door.  No power necessary.  POE doesn't otherwise influence how the device works... just saves you some wiring.
  • The default login for the device is Admin/2n.  I suggest you change this after you install the device.

Grandstream IP phone

This phone if packed with features, so you'll want to explore those further.  For our purposes, all we need to for this phone to register as a SIP client and wait for incoming calls.  All it needs to do that is a valid SIP configuration.


Other things to keep in mind:
  • You can configure this phone to auto-answer.  This prevents you from having to pick up the phone, however it has disadvantages:  visitors at the door can hear what's going on inside and you don't hear the phone ring (since the call has started!)
  • Visitors can't see you inside.  Video is one way only, since the 2N device doesn't have a display (at least not the one I have)

Asterisk


  • sip.conf
[general]
videosupport=yes    # allow video calls.
localnet=192.168.2.0/24

[indoor]
type=friend
secret=indoor
host=dynamic
dtmfmode=rfc2833
context=default
qualify=yes
canreinvite=no
disallow=all
allow=ulaw
allow=alaw
allow=h264
mailbox=102@default
callerid=Living <102>
nat=no       # we run all this on the internal network.

[door]
type=friend
secret=doorsecret
host=dynamic
dtmfmode=rfc2833
context=default
qualify=yes
canreinvite=no
disallow=all
allow=ulaw
allow=alaw
allow=h264
mailbox=101@default
callerid=Doorbell <101>
nat=no        # we run all this on the internal network.

  • extensions.conf
[default]

# extension for calling the clients directly.
exten => 101,1,Dial(SIP/door)
exten => 102,1,Dial(SIP/indoor)

exten => 888,1,Dial(SIP/indoor,30)    # ring for 30 seconds only.
  same => n,Hangup()

Next

Where to go from here?
  • Not at home?  Forward calls to PSTN.
  • Google Talk integration
  • SIP on Android integration

Comments