VOIP Babyphone

So at one time in my life I was confronted with the problem that a baby would need to be monitored. Being a geek I couldn't go out and just buy a babyphone. That would have been too easy. So I started fiddling around with asterisk, and my two cisco 7960 phones.

Finally, after many hours of investigation I got that thing to work. What does it do?

The phone next to the baby places a call to number "2" (in hands-free mode, the microphone of the cisco phone is very good so this works very well), which invokes asterisk to open up a conference room, call the other phone in our living-room (which picks up automatically) and mutes the output-sound to the baby (you can't talk back as you could on more expensive babyphones, but right now this is not necessary).

Asterisk Configuration

I assume you have a working asterisk setup, with SIP accounts enabled. If not, I can't help you here. The phone next to the baby is connected via sip.conf:

 

[babyphone]

type=friend

username=mybabyphone

secret=asdf

host=dynamic

dtmfmode=rfc2833

context=babyphone

canreinvite=yes

nat=yes

allow=all

 

and the phone that receives the call can also be found in sip.conf:

 

[babyphoneclient]

type=friend

username=mybabyphoneclient

secret=xxx

host=dynamic

dtmfmode=rfc2833

context=add-to-conference

canreinvite=yes

nat=yes

allow=all

 

And here's my relevant extensions.conf:

 

[babyphone]

exten => 3,1,Playback(baerenkinder) # if I dial 3, play the sleeping song and then activate the babyphone

exten => 3,2,Goto(2,1)

exten => 2,1,AGI(callall) # 2 is the extension that the baby unit needs to dial

exten => 2,2,MeetMe(2,dtqp) ; press # to exit the conference

exten => 2,3,MeetMeAdmin(2,K) ; kick all users out

exten => 2,4,Hangup

exten => h,1,Hangup

 

[add-to-conference]

exten => start,1,MeetMe(2,dmqp)

exten => h,1,Hangup

 

the AGI Part is the most important. It instructs asterisk to execute a binary called callall. More on that later.

Here's my meetme.conf:

 

[rooms]

conf => 2

 

And in the asterisk AGI directory (in my case /usr/share/asterisk/agi-bin/) the callall shellscript, which just copies a couple of files to the outgoing directory of asterisk, which simply invokes a call from asterisk (which monitors that directory).

callall:

 

#!/bin/sh

cp /etc/asterisk/intercom/*conf /var/spool/asterisk/outgoing

 

Now what's in those intercom-files? looks like that:

 

Channel: SIP/mybabyphoneclient

Context: add-to-conference

WaitTime: 2

Extension: start

Priority: 1

CallerID: Baby

 

So this basically calls the phone registered as "mybabyphoneclient" in the living room and the add-to-converence context is applied, so it is joining the meetme-room. So much for the asterisk config.

Cisco Phone Configuration

The cisco phone configuration is straightforward. On my tftp-server resides a file called SIPDefault.cnf with the following content:

 

services_url: "http://www.wogri.at/path/to/menu.xml"

telnet_level: "2"

sntp_server: "193.171.23.163"

sntp_mode: "unicast"

time_zone : "CET"

date_format : "D/M/Y"

messages_uri: "50000"

time_format_24hr : 1

proxy_register : 1

 

and the phone-config file (SIPXXX.cnf) - where XXX is the mac address of the phone:

 

image_version: P0S3-8-12-00

logo_url: "http://www.wogri.at/path/to/wophone.bmp"

phone_label: "1234/57890"

phone_prompt : "WoPhone"

 

line3_name : "xxx"

line2_name : "yyy"

line1_name : "zzz"

line4_name : "mybabyphoneclient"

...

line4_authname : "mybabyphoneclient"

...

line4_password : "xxx"

...

line4_shortname : "babyphone"

...

proxy4_address : "my.proxy.wogri.at"

...

proxy4_port : 5060

 

And that should do the trick. Except for the automatic pickup in the living-room. This must be configured directly on the phone (can't remember where, you'll figure it out), there is no config-file option for that. The cool part is, that I also have got a wireless SIP-Phone, so I can hook up into any wireless network and use my babyphone. I like that :)

 

 

 

Last Update: 12.08.2012