Pro-lite LED sign in kitchen alerts the hungry to new calls

richsonn
Posts: 46
Member Since:
2007-08-08

We migrated from an old Panasonic key system to Trixbox 2.6 and my team loves everything about it except for one thing: losing the ability to see whose extension is ringing and pick it up from any phone. This problem was most keenly felt while in the kitchen; employees munched away happily, not knowing they were missing an important call.

When I learned that Pro-lite signs like the Pro-Lite TruColor II were available periodically on ebay for around $100 and elsewhere for around $200, I started poking around the web to see if anyone had developed Linux drivers for the serial port on these signs. Sure enough, there were many people out there programming these signs. I found a comprehensive set of commands at http://wls.wwco.com/ledsigns/prolite/ProliteProtocol.html, for example.

This was all I needed to get the sign initially working in centOS:

 ln -s /dev/ttyS0 /dev/prolite

 chmod a+rw /dev/prolite

 stty opost -ocrnl onlcr < /dev/prolite

Then I could send commands to the sign with a simple echo:

echo "<ID01><PA>Enrich Consulting " > /dev/prolite

This was perfect, because our trixbox was already in the kitchen, so it was easy enough to route a serial cable from the server to the sign and mount the sign on top of a cabinet.

In order to ensure the sign would be ready to accept commands after a reboot of my trixbox, I saved the following as signfix in /etc/init.d:

#!/bin/bash
#
# Simple script to fix the permissions on the serial port
#
# chkconfig: 2345 90 10
# description: signfix - sets the permissions on COM1:

chmod a+rw /dev/ttyS0

exit

And then used Chkconfig to make sure that signfix would run every boot:

chmod 755 signfix
Chkconfig --add signfix

Next I went out looking for something a little more turnkey, and found a hobbyist-built Prolite application on CPAN (http://search.cpan.org/dist/ProLite/). This module is really cool because it provides a higher-level interface to the sign. There was only one fix I needed to make to the Prolite.pm code: in the sendCommand subroutine I needed to add $global = 1; just before the do loop. Otherwise the sendCommand subroutine would wait forever expecting an echo of the command just sent to the sign; my sign didn't seem to be capable of echoing the command it had just received without garbling it.

The next step was to create a script that trixbox could run whenever a call came in that would post the call on the sign in the kitchen. The script needs to send a directive to the sign, sit tight for 10 seconds, and then clear the sign. I wanted the sign to show something like:

Richard: Mann, Thomas 408-555-1212

I've trained our staff to dial **ext on the kitchen phone to answer their calls. That works well for us, though I know others have reported problems with directed call pickup under trixbox 2.6.

I saved the following as cid.agi in var/lib/asterisk/agi-bin:

#!/usr/bin/perl 
use lib 'blib/lib';

use ProLite qw(:core :commands :colors :styles :dingbats :effects);

my $s = new ProLite(id=>1, device=>'/dev/ttyS0', debug=>0, charDelay=>2000);

$|=1;

open STDOUT, '>/dev/null'; 
fork and exit; 

my $cidnum = $ARGV[0]; 
my $cidname = $ARGV[1]; 
my $extension = $ARGV[2];

$err = $s->connect();
die "Can't connect to device - $err" if $err;

if ( IsNumeric( $cidnum ) ) {
	if (length($cidnum) == 10) {
		$cidnum = substr($cidnum,0,3) . '.' . substr($cidnum,3,3) . '.' . substr($cidnum,6,4);
	} else {
		$cidnum = substr($cidnum,0,2) . '-' . substr($cidnum,2);
	}
}

$s->wakeUp();

$s->setPage(24, " ");
$s->runPage(24);

$s->setPage(25, RESET, green, "$extension:", red, " $cidname", orange, " $cidnum ") ;
$s->setPage(26, beep, telephone, " ", chain(25));
$s->runPage(26);

sleep(10);

$s->setPage(25, " ");

sub IsNumeric {
    my $val = $_[0];
        my $DIGITS = qr{ \d+ (?: [.] \d*)? | [.] \d+ }xms;
        my $SIGN   = qr{ [+-] }xms;
        my $NUMBER = qr{ ($SIGN?) ($DIGITS) }xms;
        if ( $val !~ /^${NUMBER}$/ ) {
        return 0;   #Non-numeric
    } else {
        return 1;   #Numeric
    }
}  #End IsNumeric

exit;

Then I needed to override from-did-direct so that my cid.agi script would get called. I'm sure there is a much better way of doing this, but it worked for me. The following went into extensions_override_freepbx_custom:

[from-did-direct]
exten => 125,1,AGI(cid.agi|${CALLERID(num)}|${CALLERID(name)}|Rich) 
exten => 125,n,Goto(from-did-direct-post-sign,125,1)
exten => 103,1,AGI(cid.agi|${CALLERID(num)}|${CALLERID(name)}|Ron) 
exten => 103,n,Goto(from-did-direct-post-sign,103,1)
exten => 102,1,AGI(cid.agi|${CALLERID(num)}|${CALLERID(name)}|Rick) 
exten => 102,n,Goto(from-did-direct-post-sign,102,1)
exten => 123,1,AGI(cid.agi|${CALLERID(num)}|${CALLERID(name)}|Jane) 
exten => 123,n,Goto(from-did-direct-post-sign,123,1)
exten => 108,1,AGI(cid.agi|${CALLERID(num)}|${CALLERID(name)}|Jill)
exten => 108,n,Goto(from-did-direct-post-sign,108,1)
exten => 111,1,AGI(cid.agi|${CALLERID(num)}|${CALLERID(name)}|Jasper)
exten => 111,n,Goto(from-did-direct-post-sign,111,1)
exten => 198,1,AGI(cid.agi|${CALLERID(num)}|${CALLERID(name)}|Conf1)
exten => 198,n,Goto(from-did-direct-post-sign,198,1)
exten => 199,1,AGI(cid.agi|${CALLERID(num)}|${CALLERID(name)}|Conf2)
exten => 199,n,Goto(from-did-direct-post-sign,199,1)
include => ext-findmefollow
include => ext-local

New extensions need to be added to this by hand, which is ok for me since I only wanted our consulting team to be listed here, since they are the ones worried about missing calls. Once the sign was loaded up we would need to continue with the original directives that were in the from-did-direct context, so the following went into extensions_custom.conf:

[from-did-direct-post-sign]
include => ext-findmefollow
include => ext-local

That was it! This was my first trixbox scripting project, my first agi project, my first perl project, and my first Linux serial port project. No one at my office knows what I had to go through for this to work, or how satisfying it is for me to see the messages scroll by while I wait for my espresso to pour! I hope that others can build their own sign applications using the trail of crumbs I've left here.

I am having trouble finding the prolite signs on ebay these days (I did all of this last winter) but there are plenty of other programmable signs out there, like those at www.bigbrite.com. You might ask Gary at bigbrite if he has any more Prolite Trucolors; he used to post them on ebay when he had them.

Happy Trixing,

Rich



ethans
Posts: 519
Member Since:
2007-01-16
Hilarious. I almost want to

Hilarious. I almost want to do this just because I can.



IcelandDreams
Posts: 415
Member Since:
2007-09-11
That is funny. Wish I had

That is funny. Wish I had time to do something like that. But for now I just use followme/ring groups to the kitchen phone which serves the same purpose. maybe I would get more respect at work if it had been more involved like this idea.

:)



jchuby
Posts: 611
Member Since:
2006-07-20
Thats really brilliant.

Thats really brilliant.

--

JChuby
Experienced Trixbox Tech for Hire in Greater NYC
Experienced in Remote Tech Support / Custom DialPlan / Assistance As Well
JChubak@gmail.com or PM me on Trixbox.org Forums



richsonn
Posts: 46
Member Since:
2007-08-08
Thanks

It was a lot of fun, pulling information from various sources around the web to make this work seamlessly. My day job involves projects that take anywhere from 6-36 months, so it was very satisfying to do something like this and achieve a short-term (two-weeks of evenings) win.

Figuring out the asterisk contexts and making sure that I didn't send all our calls into the ether was the hardest part. It is tough to filter the vast amount of information out there describing how to program in the asterisk command language when you have a very specific task in mind, as I did.



mcisar
Posts: 83
Member Since:
2007-02-13
Awesome idea

Awesome idea!!! I've been wracking my brain trying to figure out a way to create a nice big bright caller-id display (and clock) for my mother who is 83 and just is no longer able to read the small displays on her digital clock, nor the caller ID on the phone, and tends to lose track of the day of week. I never would have even thought to look at this type of "commercial" display to solve the problem... but I've got a Trixbox in the house already, so this should solve both problems wonderfully! I can also forsee myself throwing in some reminders of doctor's appointments and shopping trips, and perhaps with some creative wiring interface the doorbell too. I was lucky enough to score a couple of Pro-Lite II's at a very reasonable price on eBay this morning. This will make a wonderful Christmas gift for my mother, even if I won't have it all set up quite in time.

Thank you, thank you and thank you!

Cheers,
>>>>> Mike

P.S. And of course the 2nd one will be going in my office... just because I can :-)



richsonn
Posts: 46
Member Since:
2007-08-08
You are most welcome. I have

You are most welcome. I have gotten so much out of the 1000's of postings on this forum that contributing my Prolite story is the very least I can do!

Rich



hkgonra
Posts: 73
Member Since:
2008-12-04
OK, now we have to see pics

OK, now we have to see pics of this thing in action. ;-)



UnDeRDoG
Posts: 90
Member Since:
2006-06-01
Ethernet Serial

This is a nice idea, I like it! You also can get a ethernet serial port so you don't need to have it in the same room. GOOD JOB!!

--



jdwebcc
Posts: 149
Member Since:
2006-09-27
What about BLF & an ATA

mcisar -- why not just use a cheap ATA with a cheap analog CID box from Walmart ?

I am even using ATAs for a big welding shop with a analog external ringer so the shop guys can hear the phone ringing... then in a radio station I used the ATAs for the strobe lights as they can't have a phone ringing..

On the first post of being in the kitchen and knowing about a persons phone ringing.. what about BLF ? Include the kitchen phone in the other ring groups & and then set your speed dial buttons with BLF for the other extensions you want to know are ringing.. you can even pick up the call using it.

JD

Jason S Derr, JDWEB.cc LLC
Creator of ASR Manager

--

Jason S Derr, JDWEB.cc LLC
Creator of ASR Manager



richsonn
Posts: 46
Member Since:
2007-08-08
We needed a big sign

JD -

This is a 30 inches-wide sign which can be read from anywhere in the kitchen. We already had BLF on a phone in the kitchen and nobody could be bothered to stare at the phone while they were munching. This works better. You can see a picture of the sign here.

Rich



tshif
Posts: 79
Member Since:
2007-12-27
Caller ID Superfecta Wants YOU!

Or, to be precise, we would like to explore adding this function to the Caller ID Superfecta Module for FreePBX. Richsonn - we sent a private message enquiring - did you receive?

We already have several output data sources like this one - and I think it would make a great additon - Drop by, read up on the module, and see if you think it would be a good match - we would love to have you participate.

Read more about the project here:
http://projects.colsolgrp.net/projects/show/superfecta



richsonn
Posts: 46
Member Since:
2007-08-08
Thanks tshif

Unfortunately the tutorial I've left here will have to do until someone else picks up the baton! This was a side-project and I don't have time to gussy it up for what looks like a great FreePBX module. Thanks for your interest though.

Rich



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.