Creating and deleting extensions from a phone


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 php script uses functions that require:

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

Has anyone information about solving that??

Thanks in advance