Inbound Route to custom extension

I’ve configured in the extension_custom.conf a stasis app.

[from-internal-custom]
exten => _X.,1,NoOp()
same => n,Stasis(my-app)
same => n,Hangup()

I’ve also configured a sip trunk and want to route inbound calls with inbound route to this stasis app.

What do I have to configure in the set destination in the inbound route configuration to route the incoming call from the sip trunk to the stasis app?

You can’t use the dialplan as written. Modify to something like

[custom-app]
exten => s,1,NoOp()
same => n,Stasis(my-app)
same => n,Hangup()

Then under Admin → Custom Destination create a new custom dest with a goto string of

custom-app,s,1

From there, you can create an inbound route like normal and direct calls to this destination.

I don’t think that is true. On the other hand, the OP needs to explain why it is written like that. I’m pretty sure, as a minimum there is a variable containing the DID, which can be accessed, possibly direct from the custom destination, or by its code.

I’d also have to consider that they might not actually need to use any FreePBX dialplan. Depending on the actual requirement, they might be able to set the trunk’s context to be custom-app.

To clarify, there is nothing preventing anyone from using the dialplan as written. To be more precise, doing so will completely break calls from local extensions, and will probably have other unintended consequences.

Dialplan from above:

FreePBX17*CLI> dialplan show from-internal-custom
[ Context 'from-internal-custom' created by 'pbx_config' ]
  '_X.' =>          1. NoOp()                                     [extensions_custom.conf:85]
                    2. Stasis(my-app)                             [extensions_custom.conf:86]
                    3. Hangup()                                   [extensions_custom.conf:87]

What happens when I attempt to dial a local extension on the system

FreePBX17*CLI> dialplan show 4002@from-internal
[ Included context 'from-internal-custom' created by 'pbx_config' ]
  '_X.' =>          1. NoOp()                                     [extensions_custom.conf:85]
                    2. Stasis(my-app)                             [extensions_custom.conf:86]
                    3. Hangup()                                   [extensions_custom.conf:87]

[ Included context 'ext-findmefollow' created by 'pbx_config' ]
  '4002' =>         1. GotoIf($[${DB_EXISTS(AMPUSER/${EXTEN}/followme/ddial)} != 1 | "${DB(AMPUSER/${EXTEN}/followme/ddial)}" = "EXTENSION"]?ext-local,${EXTEN},1:foll
...<snip>

What happens when I dial an external number

FreePBX17*CLI> dialplan show 8005551234@from-internal
[ Included context 'from-internal-custom' created by 'pbx_config' ]
  '_X.' =>          1. NoOp()                                     [extensions_custom.conf:85]
                    2. Stasis(my-app)                             [extensions_custom.conf:86]
                    3. Hangup()                                   [extensions_custom.conf:87]

[ Included context 'outrt-7' created by 'pbx_config' ]
... <snip>

You are assuming that the context is included. I read it as a standalone context.

from-internal-custom is always included. It’s a part of the fpbx core.

The OP’s context is custom-app, not from-internal-custom

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