I am trying to activate a custom dialplan to operate a gate opener relay. The relay is working as I can access it through a web page. Various other pages talk about putting a custom dial plan in /etc/asterisk/extensions_custom.conf. But then I guess for FreePBX we use /etc/asterisk/extensions_override_freepbx.conf?
Is that right?
I’ve placed my plan there and created an entry under Misc Apps. But it doesn’t look like my dial plan is being used. Any ideas?
It is commented out If I manually uncomment it, FreePBX whines about modified files. When I had done this, my dial plan actually was executing. So my question is, how do I create custom dial plans within the FreePBX ecosystem without the system complaining?
Now that I look at this, both extensions_override_freepbx.conf and extensions_custom.conf are commented out. I need to activate one or both. EDIT: I’m told this is correct and the files are indeed activated in Asterisk.
I don’t understand your other points. I thought I was supposed to create both a “Custom Destination” and a “Misc Application” in order to execute a custom dial plan. The “gateopener,s,1” is what I put in the Custom Destination not the dial plan.
Now that I’ve figured out the conf setup I’ve moved my dial plan back to extensions_custom.conf. The “gateopener,s,1” bit was referring to what I setup under Custom Destinations not under my dial plan. I have corrected the dial plan:
With these changes, you now have an Gateopener,s,1 step (you didn’t before) and your script will “hangup” (which it couldn’t before because you had two step ‘1’ instances.
Now, set up your system so that your custom pointers so that “80” points to gateopener,s,1 and you should be good to go.
Okay, will do as soon as I get home. So the context [gateopener] is the “connector” back into FreePBX and not the extension number. I guess that was what was confusing me. I thought I needed the 80 to “find” and execute the dial plan.
That would work if you were adding the dialplan to a context that was already being executed (like “from-internal”). Since you are executing the context directly, you can set it up so that the custom-extension points to the context ‘start’ step.
There are several books that cover writing custom contexts, include the classic “Asterisk for Dummies” and their ilk. If you check around the asterisk.org website, I’m pretty sure you’ll find a few wikis that will help. It seems to me that O’Reilly even has one that you can download for free.
If you search google for “asterisk custom context primer”, the first 10 hits are all good places to start - especially the one from the actual asterisk.org website. Contexts are common to all Asterisk implementations, not just FreePBX, so it should be relatively easy to find plenty of documentation.
Nope, still doesn’t work. I dial that extension that I get a busy signal. I’ve placed your revised dial plan in extensions_custom.conf with a context of [gateopener].
I have a custom destination with a target of “gateopener,s,1”.
I have a Misc Application with a feature code setting the extension to dial and the target of that custom destination.
in extensions_custom.conf put this in with no context then dial *812 (as long as you are not using *812 for something else)
you can take it from there.
Oh duh! I forgot to make the script executable! I said the script worked and it did elsewhere. Then I copied it to /var/lib/asterisk and forgot to reset permissions!
The script runs, the gate opens/closes. Next problem: on dialing the extension the phone says “No Response” and gives a busy signal. I thought the hangup would handle this. How can I just execute and gracefully end the call?
It turns out the Playback command is what was needed. If I add that command then the hangup command works correctly.
This was my next step, playing an acknowledgement sound. Now the collection of recordings in /var/lib/asterisk/sounds/en are vast and fun. But all I really want to do is play a tone. I tried the command “Playtones” but that wasn’t working for some reason.
Anyone know how to play a custom tone instead of a recording?
Still need the wait command to allow the tones to play. The exclamation mark means the tones do not repeat. Now I can play with the timing and frequency of the sounds.