[asterisk-users] Fwd: Re: Asterisk as a Condo door opener/intercom

David - asterisk list dbc_asterisk at advan.ca
Wed Apr 13 07:08:11 CDT 2011


Asterisk as a phone system makes perfect sense in a condo. You can get

all the DID's you want and eliminate costs for the owners. You can offer
standard FXO for people who don't care and IP sets for people who want
to "upgrade" to feature sets.

Your door openner is a piece of cake.
1.  Create an option in your dialplan only in the "from-access-door"
context that reads DTMF from the called station only.
2. Use this to access an external program to turn on a serial port line
for 10 seconds.
3. This line drives a solid state relay (~$30) so you won't blow the
sink current on the PC port that drives a standard door lock.

A commercial door strike is about $100. The program to run the port is
childs play. Here is a test prog I used for turning on a power hungry
last printer. Change the comments and the sleep time and you're done.

   /*
    * lpon         Lineprinter ON
    *              *** test program only **
    *
    *              (c) David Cook, 1994
    *
    *              Set signlal lines on serial port to turn on 5vdc
    *              signal. Used for solid-state relay (low current
    *              draw on RS232C port) to switch high voltage/high
    *              current load for printer.
    *
    *              Part of an intelligent print spooler to only power
    *              on/off high draw printer when required.
    *
    * Usage:       lpon<device>  <bits to set>
    *              For example, lpon /dev/cua4 4 to set bit 3 on
    *              port /dev/cua4.
    *              "4" = 00000100 or bit 3 which is DTR
    *              "2" = 00000010 or bit 2 which is RTS
    *              "6" = 00000110 or both DRT&  RTS
    */
   #include<sys/types.h>
   #include<sys/ioctl.h>
   #include<termios.h>
   #include<fcntl.h>
   #include<errno.h>
   #include<stdlib.h>
   #include<unistd.h>
   #include<stdio.h>
   #include<signal.h>

   #include "lpswitch.h"

   /* Main program. */
   int main(int argc, char **argv)
   {
     struct termios port_config;
     int fd;
     int set_bits = 2;

     /* Open monitor device. */
     if ((fd = open(SWDEV, O_RDWR | O_NDELAY))<  0) {
       fprintf(stderr, "lpswtich: %s: %d\n", SWDEV, strerror(errno));
       exit(1);}

     cfmakeraw(&port_config );
     port_config.c_iflag=port_config.c_iflag|IXON;
     port_config.c_oflag=port_config.c_oflag|CLOCAL|~CRTSCTS;
     tcsetattr( fd, TCSANOW,&port_config );
     ioctl(fd, TIOCMSET,&set_bits );

     /* wait for printer to warm up */
     sleep(45);

     /* not say "ready" and release the printer */
     set_bits = 6;

     cfmakeraw(&port_config );
     port_config.c_iflag=port_config.c_iflag|IXON;
     port_config.c_oflag=port_config.c_oflag|CLOCAL|~CRTSCTS;
     tcsetattr( fd, TCSANOW,&port_config );
     ioctl(fd, TIOCMSET,&set_bits );

     close(fd);
}



On 12/04/2011 8:16 AM, asterisk-users-request at lists.digium.com wrote:
>  Message: 3
>  Date: Mon, 11 Apr 2011 18:21:39 -0500
>  From: "Don Kelly"<dk at donkelly.biz>
>  Subject: Re: [asterisk-users] Asterisk as a Condo door opener/intercom
>  To: "'Asterisk Users Mailing List - Non-Commercial Discussion'"
>  	<asterisk-users at lists.digium.com>
>  Message-ID:<8E20A6A94C9548C8A0E27B502B18F200 at DonPC>
>  Content-Type: text/plain;	charset="us-ascii"
>
>  Continuing top posting...
>
>  The same argument could be made for any commercial solution. Why use
>  Asterisk when we could throw $4,000 at our problem for a commercial
>  solution?
>
>  I'd like to have a solution that would have the features you suggest for
>  $400.
>
>  --Don
>
>
>  On Behalf Of C F
>  Sent: Monday, April 11, 2011 11:43 AM
>
>  Search the lists. Some hints:
>  Viking electronics makes a door box that connects to any analog line
>  (IIRC e-20).
>  They also make a DTMF keypad that integrates in series with any analog
>  line. They might also make a door box with a DTMF keypad on it.
>  Sandman makes a relay that will get energized when there is a ring on
>  the line which could be used to unlock the door.
>
>  However, why would you use asterisk? Using asterisk for the sole
>  purpose of MDU entry system is like using windows for asterisk, it
>  works but why?
>  Go for the commercial solutions, it comes with a geziilion options for
>  your setup one of them the ability of chosing an apartment, another
>  add key fobs, another one is the ability of using a code for the
>  residence (not guests) to unlock the door. Also the interface with
>  asterisk you will have to build one from scratch. The commercial
>  solutions have em built in.
>
>  On 4/10/11, Bruce B<bruceb444 at gmail.com>   wrote:
>>  >   Hi Everyone,
>>  >
>>  >   Looking to replace a condo intercom system. Apparently the current one
>  taps
>>  >   into the lines and dials phone numbers but needs to be changed as it's
>>  >   faulty.
>>  >
>>  >   I will probably still use the same analogue dialing and back it up with a
>>  >   VoIP line and use the current cabling that is in place. But as for as the
>>  >   door opening function goes, I am not sure how to interface and how open
>>  >   these modules are usually built.
>>  >
>>  >   I would appreciate it if someone with experience can throw in some
>  pointers
>>  >   as to what I might be facing and what challenges I have to solve to
>  replace
>>  >   this with a nice Asterisk system.
>>  >
>>  >   Thanks,
>>  >




More information about the asterisk-users mailing list