Creating and deleting extensions from a phone

Hello,

I’m trying to do a module for creating and deleting extensions from a sip phone.

First I modify the bulkextensions module, so I make an php page that ask you for the extensions number and pass and generate a csv file, then i execute a php code for creating the extension with that csv.

Now I have to use it in the extensions_custom.conf, I ask for the extension number and pass to be dialed by the user through the phone, create the csv file and then with the asterisk function system() I execute the php file for creating the extension in freepbx.

THE PROBLEM:
The php script uses functions that require:
include(’/var/www/html/admin/header.php’);
include(’/var/www/html/admin/modules/core/functions.inc.php’);

So, I have to autenticate, that is the problem.

Has anyone information about solving that??

Thanks in advance