Bulk insert extension

Status
Not open for further replies.

mos

New Member
Sep 15, 2019
22
0
1
25
Dears,

I have created a .sql file like below:

SQL:
INSERT INTO v_extensions (extension_uuid, domain_uuid, extension, password, outbound_caller_id_number, directory_visible, directory_exten_visible, limit_max, limit_destination, user_context, call_timeout, call_screen_enabled, enabled) VALUES
(uuid_in(md5(random()::text || clock_timestamp()::text)::cstring),'ba667558-7747-4edf-9e8f-69635da4fa45','2220000','emsjH45o','2220000','true','true','5','error/user_busy','mysip.net','30','false','true'),
(uuid_in(md5(random()::text || clock_timestamp()::text)::cstring),'ba667558-7747-4edf-9e8f-69635da4fa45','2220001','NvwR7rja','2220001','true','true','5','error/user_busy','mysip.net','30','false','true'),
(uuid_in(md5(random()::text || clock_timestamp()::text)::cstring),'ba667558-7747-4edf-9e8f-69635da4fa45','2220002','fWsr5Eaj','2220002','true','true','5','error/user_busy','mysip.net','30','false','true');

the extension will be added to Postgres database, everything looks fine, and from GUI I can also see and search for the added extensions, but the point here when you add an extension from the database differs from when you are adding it from GUI, when I am adding the extension from GUI it can get registered and things looks fine, by the way, same entry in database when adding it from GUI, but it seems GUI is doing further than adding it to v_extensions table only,

I have used also batch creation which exists in the GUI, but when I add 10K 3 or sometimes 4 to 5 will be missing, and will not get created by the FUPBX, I have tried also the cv bulk upload it does not shows any record in the preview page,

I like the .sql way, would you please let me know how I can fix this issue ?

one more thing, those extensions which I created using .sql file, when I am changing their password from GUI then they can register. do I need to add those extensions to any other tables after v_extensions ? or execute a specific command or what ?
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,044
565
113
Read the code, it does more than just the extensions table, it also sets up voicemail etc. I think here though you are likely just a victim of cache. After you have done the database changes, flush the cache.
 

mos

New Member
Sep 15, 2019
22
0
1
25
Thanks for the reply, so you mean it is feasible to do the bulk insert via the sql file, but I need to setup some other tables + flush the cache as well, right ?
 

mos

New Member
Sep 15, 2019
22
0
1
25
Thanks James for your reply, you mean I should create a record on 2 tables only and no need to flush ?

1- v_extensions
2- v_voicemails

?
 
Status
Not open for further replies.