Execute a shell script using asterisk to define extensions


I want to execute a shell script which will turn on/off LED lights based on input number while call is going on.

For example :

User experience:
Pick up phone
Dial *** (any number or signs)
Fire/triggered a shell script to mange the LEDs

I do have little bit idea about to take inputs from users while call is going and based on that perform some action using dial plans define in extenstions.conf file but I don’t know how to run/triggered a shell script.

Please guide/suggest some solution to do the same.

See features.conf.sample in the source distribution.

Are you asking:

  1. How can I execute a shell script while I am in a conversation? Do as david551 suggests.
  2. How can I execute a shell script by dialing a number? See system() or agi()

I made this using System command also shell() will work

Can you please send me a extenstion.conf file?

@david551 thank you for the response,

Actually, I want to trigger a shell script once the call has been connected and user input the correct number.

Lets say,

After connected a call, if user inputs a 111 then I need to run a shell script.

My answer is unchanged.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.