I’m developping an web interface that do the provisionning of Sip extentions. I have Asterisk and freepbx installed in a Centos Os.
I looked up all the tables in Asterisk database using Mysql, and i found ‘all’ the tables and field that are related to an extention, and i’ve done the same thing to create a new extention directly in the database. i executed afterwards the /var/lib/asterisk/bin/retrieve_conf script.
When browzing in the freepbx extention web page, i noticed that the extention that i added exists. i use a harphone, and when i put this extension on it, i can only have incomming calls( from other Extentions to this Extention added) .
i have those warnings :
[2013-08-21 11:15:24] WARNING: ast_expr2.fl:445 ast_yyerror: ast_yyerror(): syntax error: syntax error, unexpected ‘>’, expecting $end; Input:
[2013-08-21 11:15:24] WARNING: ast_expr2.fl:449 ast_yyerror: If you have questions, please refer to doc/tex/channelvariables.tex.
[2013-08-21 11:15:24] WARNING: func_logic.c:188 acf_if: Syntax IF(?[:]) (expr must be non-null, and either or must be non-null)
[2013-08-21 11:15:24] WARNING: func_logic.c:189 acf_if: In this case, =’’, =’’, and =‘15’
Thank you for your reply, it confirms my depths.
Now the question is that i want to seed this those values to asterisk database using the informations in the freepbx database, in another words, i have to simulate the ‘submit’ button in the buttom of the freepbx Extention webpage. Is it possible? or i have to seed those fields directly in asterisk console?
Even if you figure out all the places that should be updated, they can change from release to release.
You should be using the FreePBX API calls. Unfortunately, adding/updating extensions is one of the ‘ugliest’ as those are very old and badly written meaning they are dependent on lots of various values being in the _REQUEST array. They’ve been slated to be modified which may likely happen in 2.12 so that they are much easier to call but in the meantime that is the reality.
You can look at something like the Bulk Extension’s module as an example of code that sets up and configures those.
I succeded on developpin a script that does the double job of adding a new extension on both asterisk and freepbx databases. It’s like simulating the work of the freepbx web interface. Thank you for your replies
Im doing this work for à company as my internship , i dont think they will accept sharing the process… i will ask the boss anyway.
I have to do the same work too for DID & trunks. I will tell you more if found more about trunks. All you have to do is to browse the Mysql database for freepbx, and see all the tables, and locate those of your interest. it’s quite a long work, but it a working method.
good luck and we stay in touch