Configure Asterisk Dialplan in Freepbx

Hello,
I am new to Freepbx. However, I would like to try the following:
In the file “/etc/asterisk/extensions_custom.conf” I have written:
[TEST]
exten => 1,1,Answer()
exten => 1,2,TrySystem(/etc/asterisk/test.sh)
exten => 1,3,Hangup()

I reloaded the dialplan with “dialplan reload”. Now when I call the 1. The call is not answered automatically. It is only the response “The person at extension 1 is unavailable …” after about 15 seconds. Furthermore, the script is not executed, although the script has the owner asterisk and the rights 777. How can I debug this? Thank you for your help.

Welcome to the forum @query

There are a few ways to add your own dialplan. One of the safest is to start with what you’ve already done then go in the GUI to Admin → Custom Destination and create one with a target of:

TEST,1,1

That destination can be referenced anywhere in the GUI that will accept a destination. It’s still not dialable at this point, so you would then need to create a feature code to dial it creating a Misc Application.

Hello @lgaetz,
I created a Misc Application with extension number 3 and the dialplan worked. Now I am confused. The number 1 which is a part of my dialplan is an pjsip-extension. Does this mean I can not create an additional dial plan for a pjsip-extension?

My actual plan is to execute my script when the extension 1 is called. And when it is answered it should execute another script

You want a dialplan hook

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