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>