Apply-configuration-changes -- What happens in the background

Hi,

When I click on the orange bar “apply-configuration-changes” what all happens (read what commands are executed) in the background ??

I am using FreePBX 2.5.1.0 and every time I reboot the server, I have to go to the ADMIN console, make any dummy change so that the “apply-configuration-changes” button appears and press the button. The moment, I click on “apply-configuration-changes”, calls starts to come into the queue and the users can recv the call.

If I do not do all this after a server reboot, the IP-PBX is like a dead box.

My IP-PBX is on a dedciated Xeon with 4 GB RAM server.

My first aim is to understand what happens when “apply-configuration-changes” button is pressed so that I can do the same using a shell script called from rc.local.

Then, as a long term solution, I need to understand why the IP-PBX does not work upon reboot.

All help from form members is deeply appreciated.

Thx in advance.

regards,
Vai

When searching some more, I found this post:
http://www.freepbx.org/forum/freepbx/development/a-question-regarding-apply-configuration-changes-bar

Can I simply hit this command “php -q /var/lib/asterisk/bin/retrieve_conf” ?
Will it work ?
Since I am on a production server, I cannot experiment.

Have you tried to reboot the server, after it comes up wait 15 seconds and then just doing a simple “asterisk -rx reload” command at the linux prompt?

Why it’s not working is a hard guess. You’d have to take a look at the /var/asterisk/full logs from the time it starts and see if it is complaining about a config setting or module not available. You’ve provided very little info to go on.

If you are not really making a change then the config files that asterisk reads should be the same as before you did the apply which would lead me be believe that it does not like something, a module didn’t load up (due to a driver being slow maybe?), something along that line.

But I’m just guessing as I don’t know the version of asterisk, this a distro build or hand build, if hand built what OS, who’s directions did you use, what did you change from the directions and why, etc…

If you have a T1/E1 card it might be that your provider see’s the card drop and then come back but has some kind of flip/flop protection that doesn’t really enable the connection until it see’s it up for a given period of time like a minute.

Again I’m just guessing, so if you take a look the the log and see if there are any errors and provide some info to go on maybe somebody will be able to narrow it down.

Good Pointers.
I will try a reboot tomorrow (during off hours and evaluate the logs).
Meanwhile I will try “asterisk -rx reload” on-boot with a 60 sec delay.

I will keep the forum updated.

Thx & regards,
Vai

When you do the reload if it does not work the first time wait another 60 seconds or so and try again.

If not then do the dummy change and compare that load to the initial load and/or reload. Something will stick out as being different and that should point to what is going on. Doing a dummy change should make no actual changes in the config files that asterisk reads. make a backup of them before you reboot so you can diff them afterwards. which means it’s something in the box just not coming online, connecting properly, or responding in time (slow sip provider?)…

Hi,

When analyzing /var/log/asterisk/full I found these following lines.


[Jan 23 03:11:26] VERBOSE[2780] logger.c: == Registered translator ‘ulawtolin’ from format ulaw to slin, cost 1
[Jan 23 03:11:26] VERBOSE[2780] logger.c: == Registered translator ‘lintoulaw’ from format slin to ulaw, cost 1
[Jan 23 03:11:26] VERBOSE[2780] logger.c: codec_ulaw.so => (mu-Law Coder/Decoder)
[Jan 23 03:11:26] VERBOSE[2780] logger.c: == Registered application ‘SMS’
[Jan 23 03:11:26] VERBOSE[2780] logger.c: app_sms.so => (SMS/PSTN handler)
[Jan 23 03:11:26] VERBOSE[2780] logger.c: == Parsing ‘/etc/asterisk/res_mysql.conf’: [Jan 23 03:11:26] VERBOSE[2780] logger.c: Found
[Jan 23 03:11:26] WARNING[2780] res_config_mysql.c: MySQL RealTime: No database user found, using ‘asterisk’ as default.
[Jan 23 03:11:26] WARNING[2780] res_config_mysql.c: MySQL RealTime: No database password found, using ‘asterisk’ as default.
[Jan 23 03:11:26] WARNING[2780] res_config_mysql.c: MySQL RealTime: No database host found, using localhost via socket.
[Jan 23 03:11:26] WARNING[2780] res_config_mysql.c: MySQL RealTime: No database name found, using ‘asterisk’ as default.
[Jan 23 03:11:26] WARNING[2780] res_config_mysql.c: MySQL RealTime: No database port found, using 3306 as default.
[Jan 23 03:11:26] WARNING[2780] res_config_mysql.c: MySQL RealTime: No database socket found, using ‘/tmp/mysql.sock’ as default.
[Jan 23 03:11:26] DEBUG[2780] res_config_mysql.c: MySQL RealTime Host:
[Jan 23 03:11:26] DEBUG[2780] res_config_mysql.c: MySQL RealTime Port: 3306
[Jan 23 03:11:26] DEBUG[2780] res_config_mysql.c: MySQL RealTime User: asterisk
[Jan 23 03:11:26] DEBUG[2780] res_config_mysql.c: MySQL RealTime Password: asterisk
[Jan 23 03:11:26] ERROR[2780] res_config_mysql.c: MySQL RealTime: Failed to connect database server asterisk on (err 2002). Check debug for more info.
[Jan 23 03:11:26] DEBUG[2780] res_config_mysql.c: MySQL RealTime: Cannot Connect (2002): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
[Jan 23 03:11:26] WARNING[2780] res_config_mysql.c: MySQL RealTime: Couldn’t establish connection. Check debug.
[Jan 23 03:11:26] DEBUG[2780] res_config_mysql.c: MySQL RealTime: Cannot Connect: Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
[Jan 23 03:11:26] NOTICE[2780] config.c: Registered Config Engine mysql
[Jan 23 03:11:26] VERBOSE[2780] logger.c: MySQL RealTime driver loaded.
[Jan 23 03:11:26] VERBOSE[2780] logger.c: res_config_mysql.so => (MySQL RealTime Configuration Driver)
[Jan 23 03:11:26] VERBOSE[2780] logger.c: == Registered application ‘WaitForSilence’
[Jan 23 03:11:26] VERBOSE[2780] logger.c: app_waitforsilence.so => (Wait For Silence)
[Jan 23 03:11:26] VERBOSE[2780] logger.c: == Registered application ‘TestClient’

I understand MySQL connection is an issue.
May be MySQL takes some time to start and Asterisk tries to start before MySQL or something like that.

Please advice if I understand the logs correctly and what corrective measures should I take.

Thx

Vai

Any help on this one ??

Vai

FreePBX and the asterisk Realtime config are not compatible with each other and it is not supported in that way. So seeing it complaining about not finding it configured is ok and what you want.