*of*=off
Main Topics
Browse All TopicsHello,
I am not new to linux, but not well adversed. I would like to script asterisk to via an IVR when '1' is pressed for example, to light an LED or throw a ground. I have two ports i could use, a USB port or a serial port. Prefer the USB port.
Basically I have an alix board from pc engines (just a sbc), and I would like to have two leads (wires) from it that need to through a relay. I am very new to this type of programming, so detailed instructions are definitely needed.
Any suggestions?
Thanks in advance for your time!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Ok, This would be even better. If I could just complete a ground! I have a usb port, db9 serial port, 2 Mini-PCI ports, and a LPC port. If I can get anyone of these ports to just complete a ground, that would do it for me.
I think I have found that the 5v's supplied to the USB ports can not be removed, as they are hardwired to the power supply. (However, the schematics say that one port is switched and the other is fused, not sure what this means)
Adam
Here's a quick tutorial for doing IVR with Asterisk,
http://www.asteriskguru.co
The last example is probably the clearest and is a 'press 1 for ' type situation. Not sure of your level of familiarity with Asterisk, but the dialplan is contained in the extensions.conf file. Here's a couple of links to get you started if you need them,
http://www.voip-info.org/w
http://www.voip-info.org/t
To execute your script or program for controlling the external device you have to use the dialplan 'System' command,
http://www.voip-info.org/w
Which allows you to simple execute commands from within Asterisk as though on the linux command line. Note that whatever user Asterisk runs under must have rights to run the command line for it to work.
I covered a few options about the physical port control and just stuck to Asterisk stuff here.
Somebody used to have a whole how-to for operating a bird or fish feeder running off Asterisk through a serial interface but I cannot seem to find it.
I would suggest using a python linux script for a couple of reasons. The interface with serail / usb ports is very simple. There is a nice robotics interface for python. And python comes with all major linux releases
pyro project
http://pyrorobotics.org/?
anything you write in python can be executed like so
exten => s,1,AGI(runcc.py|PARAM1|PA
the python script can be put into this folder
/var/lib/asterisk/agi-bin
with execute permissions granted for asterisk
Business Accounts
Answer for Membership
by: chuckycharmsPosted on 2009-11-07 at 19:51:22ID: 25769341
OK, doing research here, how about just turning of the usb ports power? Can this be done?