VKA
VKA

Reputation: 319

Running a Shell Script from Free PBX/Trixbox

I have no luck finding a solution for my requirement. I have a delivery service and would like to notify set of users by calling them on their phone numbers. I have list of phone numbers and a way to call people as a shell script however, I would like to execute this script by calling an extension number and preferably a passcode so that only person having a passcode can make the call even if extension is expose somehow.

I am running TrixBox 2.8.0.4 with IVR as main menu and enabling direct dialing.

Here is what i have tried hoping the solution is around custom extension. Not sure if I am heading in right direction.

  1. Uncommented the extensions_custom.conf in the extensions.conf file.
  2. Added an entry in extensions_custom.conf file as follows.

[from-internal-custom] exten => 200,1,System(/home/rj/call.sh)

Now when I call extension 200, PBX says that it is not a valid extension. Since this extension is not create in the standard extensions so probably PBX is not able to find it. It seems like I need to either create a inbound route or create extension in a different way so that PBX can see it and run my script.

Can you please advise what is being missed or my complete approach is not correct? If this works, I would like to have some input from the person dialing extension to validate a code etc before script can be executed.

Thanks in advance for your support.

-RJ

Upvotes: 0

Views: 5617

Answers (2)

derlinuxer
derlinuxer

Reputation: 574

You incoming call has to match the context [from-internal-custom]. Your configured extension (200) works only in this context. To check if your setting is generally enabled run following command and check for your 200:

asterisk -rx "dialplan show"

Upvotes: 0

Mbrevda
Mbrevda

Reputation: 3090

Create a custom contest for your application, using extension s. Using Custom Destinations, add your custom context as a destination like this: Custom Destination

Then add a Misc App, with a feature code of (as per your example) 200, and point it to your Custom Destination, like this:

enter image description here

Dont forget to hit Apply Configs when your done!

Upvotes: 0

Related Questions