Execute file PHP in Dialplan

I try to exeple my test.php file, but it shows this error >> pbx_config.c: 1824 pbx_load_config: Invalid priority / label ‘’ in line 3 of extensions.conf.

<< My file Extensions.conf >>
[testing]
exten => _XXXXXXXXXXXXXXX, 1, NoOp ()
exten => System (test.php)
same => n, Dial (PJSIP / $ {EXTEN})


Why show this error?

Because “php” is not a valid value for the priority field.

I doubt that you intended the extension field to be “System (test”, but it is syntactically valid.

1 Like

but who execute my file .PHP in server?

You haven’t included any dialplan action that would cause a PHP file to be run. In particular the dialplan action for your second exten line is an empty string.

If you had constructed syntactically valid dialplan line with the action System(test.php), the file if any, if executable and readable to the user under which Asterisk was running, and which could be found by combining the PATH an current directory information of the asterisk process, would have its first line read. If that began with "#! the first word following that would be invoked, assuming it was an executable binary, with the name of a file as a parameter. Typically that would be the PHP interpreter.

should be:
same => n,System (test.php)

If test.php is in the correct directory and is executable, that should work

OK, done that, another bug show!

pbx.c:2907 pbx_extension_helper: N o application ‘System’ for extension (testing, 000000002601107, 2)

sorry for the cut&paste, there should be no space between System & the open parenthesis
same => n,System(test.php)

no problem, my file extensions.conf
[testing]
exten => _XXXXXXXXXXXXXXX,1,NoOp()
exten => _XXXXXXXXXXXXXXX,2,System(/var/lib/asterisk/agi-bin/phpagi/teste.php)
same => n,Dial(PJSIP/${EXTEN})

another bug show!

pbx.c:2907 pbx_extension_helper: N o application ‘System’ for extension (testing, 000000002601107, 2)

try core show application system from the cli, if it does not show, you have an installation problem.
In any case, you may want to read some litterature about asterisk dialplan, that will probably help

J.