Open Source Training Seminar


Not Logged in - No Account?

Don't have an account? Registering an account with us allows you to post to the forums, easily track new posts, subscribe to threads, pm (private message) other forum members, and receive periodic news letters (you can opt out if you desire). Once you are logged in this message will no longer appear. If you don't have an account, you can create one by registering here. Lost your password, request a new password. We respect your privacy which means we collect minimal information when you register and we do not resell that information or use it in any objectionable way. You can review our privacy policy for full details.


mysql insert to add bulk sip,users,devices issues.

swolfe's picture

I have written a small Windows app to import new extensions by placing the proper information into sip,users and devices and everything looks fine. When I look at the data that was made by freepbx and the import I did, it looks the same. Freepbx can see that data that I import but when I do the "red bar" reload or any reboot the data is not making it into the Asterisk Database. Only after I go into each extension, click submit, then a red bar reload does it actually go into the asterisk database, 'database show'.

'sip show peers' shows the new data I imported with my program without having to go into each extension and clicking submit. I must be missing something crucial so that freePBX can add them to the astersisk database with a single update.

I did notice that when I add records to the sip table my records end up all over the place and when FreePBX adds records it seems to add them in a clustered format(all of extension keywords grouped). Could this be my problem?

Thanks.


__________________


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

mysql insert to add bulk sip,users,devices issues.

p_lindheimer's picture

there is more involved then just adding the info to the db tables. How does your porgram work, is it just accessing the db over the network?

You really need to access the core_add_users() and core_add_devices() calls to properly get everything added correctly.


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


Yes..mysql directly

swolfe's picture

Yes I was trying to add them directly to the tables then thinking that once I did the update in freePBX the newly added data would get placed in the asterisk database. I'll look for the functions and see what it does.


mysql insert to add bulk sip,users,devices issues.

p_lindheimer's picture

you will want to use the function vs. trying to copy what it does. Things will change in the coming future, using the function will keep your app working. Also - once you get your app up and working, why don't you ping me to take a look at it, I'm sure it would be useful.


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


you bet

swolfe's picture

I'll let you know once I get it working.

This was really a twister..cause all the *.conf files were updated fine but the database show was not giving me any new information about the extensions that were added.

point of referance, I am running the beta version.


Same problem here

andrelg's picture

Hi swolfe !

I'm writing a script to create extensios from the Linux Cli and I'm having the same problem you have.

Did you solve it ? and how did u do it ?

p_lindheimer, i was trying to use the functions core_users_add() and core_devices_add().
I called them in my script but i get some errors. Is there any secret in how to use it ? or some include ?

Thanks


__________________

"Se debugar é a arte de retirar erros de programas, programar deve ser a arte de inserí-los."


Hi, I've created a php file

samyantoun's picture

Hi,

I've created a php file that allow adding extensions using core_users_add and core_devices_add. Please be advised that it's not been tested on a production environment. File location:
http://samyantoun.50webs.com/asterisk/freepbx/createext.php.txt

Comments and Tweaks are welcome.

Regards.


Thank you Samy

swolfe's picture

Thanks Samy. Works great.

However it only seems to work if I have your php file in the /var/www/html directory. I put it in another directory the include for the header.php fails.

-Scott


samyantoun - thanks for the

kjohnsoncda's picture

samyantoun - thanks for the php script/page - I'm using it with a bash script to bulkload users from a csv file to a backup server.


Is there a way to batch edit

ronald.lew's picture

Is there a way to batch edit existing user extensions? I may want to restore from an old backup and may need to add/edit/remove some of them in an automated manner.


sounds gr8 but how do i use it , i am a newbie :(

fahed2000's picture

i don't seem to know how to automate the calling of the url's with the data i have


Well this is what we need to

WeBoat's picture

Well this is what we need to do also. I had hoped to just populate the databases and then issue an update or something.

We use a coldfusion dev enviornment, so I'm not sure we can access the functions directly.

Also, we need to set the followme modules settings.

Any ideas?

Thanks