After adding 5000 exetension ApplyConfig Doesn't work

I added 5000 extensions and it parseed OK, but after ApplyConfig I receive:

Error: Did not receive valid response from server

XHR response code: 0 XHR responseText: undefined jQuery status: timeout

I see notyfication:

retrieve_conf failed, config not applied
Reload failed because retrieve_conf encountered an error: 255
Added 25 seconds ago
(freepbx.RCONFFAIL)

Any idea how to ApplyConfig maybe using shell?

or any idea how to fix it?

I’ve never done 5000 extensions before, but we ran into it when attempting large reloads on embedded boxes with slower CPUs. You can try adjusting the reload timeout setting to see if that helps.

It may have changed around, but if you look in [your Web Directory]/admin/views/freepbx_reload.php

Look for the line that starts with “$.ajax({”, and in the properties listed there should be one that says “dataType: ‘json’,”. You can add the timeout as another property by adding “timeout: 7600000,” or whatever time value is appropriate for you. So the final code would end up something like:

 $.ajax({
                                        type: 'POST',
                                        url: "<?php echo $_SERVER["PHP_SELF"]; ?>",
                                        data: "handler=reload",
                                        dataType: 'json',
                                        timeout:760000,
                                        success: function(data) {
etc...

I would also run a caching DNS server on the box. Asterisk is really weird about DNS lookups on reloads.

You can apply configs from the shell by running

amportal a r