Trixbox + sphinx + gate intercom = automatic gate operation
I've been playing around with trixbox for a while. This was easier to do this than I thought.
We have one of those phone systems that dials your phone when your unit is called at the intercom. You can't pass DTMF from the keypad after the call is initiated. On the phone that is called, you press 8 to open the gate. I decided that I wanted to automate the process if the visitor knew the name of one of my rabbits and said the name when asked.
Some things that show how easy it is to work with asterisk and trixbox:
I only use MS products, this is my 5th installation of any type of linux or unix os. I've only dabbled with the os.
This was my first attempt at writing any kind of perl script
this was the first time I created a custom dial plan
this is the first time I created a sentence corpus for use with sphinx
everything I needed was found here, on voip-info and google (the perl stuff)
Using dos2unix is the key to universe
asterisk rocks
basically my steps were as follows:
created a sentence corpus containing the names of my rabbits, 4 of them adn put it through a phinx generator thingy.
created an incoming route with CID of gate phone number and sent to a custom application (custom-sphinx,s,1)
custom-sphinx is a dial plan I created in extensions-custom using the freepbx tools|config edit web app
It basically uses a playback to ask who-would-you-like-to-call (one of the default sounds)
It monitors the line to a specific file (\home\Speech\sphinx\name-in) for 5 seconds
It then uses a combination of the sphinxserver.pl and sphinxclient.pl to go through the sound file and produce what it thinks is what was said and outputs it to a text file. I'm sure I could have done this better but I'm a unix noob so the command was something like shpinxclient.pl > output.txt
It's terrible I know
It then compares this to a names file, simply containing a list of names of the rabbits. I could use one of the files created when I made the sentence corpus but names.txt just seemed so much easier
it then uses gotoif to playback a dtmf of the correct number or hangs up
Dead easy
took me about 4 days after hours to struggle through understanding everything, learning new stuff and troubleshooting along the way.
Some things I can take from this. Wordpad mangles files that are eventually going to be executable.
file and folder permissions make a big difference to the way things work, especially the folder the monitor output is going to be put in.
chmod +x makes files executable
dos2unix unmangles files that have been mangled by wordpad

Member Since:
2008-02-20