API apply_changes problem

On certain installations and sizes the API Call “apply_changes” will drop audio for a few seconds.
I am open to show this problem remotely since it might be hard reproduce. But some users had this issue.

There is clearly something happening that will not even allow ping (icmp) to go through. Up to some seconds of downtime. This will not effect new small installations much but as soon as you have some extensions, routes and so on the downtime will extend. Even if you have the best hardware in the world.
Maybe this issue happened on some update and new installations are not effected at all.

There is clearly something different happening then like in the Web-Gui apply changes.

Maybe if we can not find a solution for the “apply ALL changes” we could have a way to apply certain modules through the API?

Please help accordingly. Thanks.

EDIT, here we go:
firewalld is involved somehow on the “apply changes” API. This will cause the dropouts.
dump_asterisk_c is only at 10% CPU. firewalld at 11%.
After everything is done firewalld is not even found anywhere in TOP. So consuming almost none CPU anymore. Hope this helps finding this.

  507 root      20   0  408728  71304   4224 S  11,0  7,0   2:54.73 firewalld
25483 root      20   0  364004  42892  12404 S  10,3  4,2   0:01.31 dump_asterisk_c

Edit2:
When Firewall is disabled, this problem does not happen.

Are you using the latest version?

I have a server with multiple tenants and a lot of data, and I don’t see the firewall at the top. Maybe, just maybe, it is something that enables the O.S on its own.

I can tell you by evidence that the code never sent a request to reload the firewall nor fail2ban.

The server you are using is one migrated from V2?

Version 3.1.1-1
Any way to see if it was an Update from V2? Can not remember 100% but should have always been V3.

Still really strange because the exact same thing is happening when the Firewall is disabled and enabled again.

Any way to reset Firewall and Fail2ban to defaults?

On apply_changes API it seems that firewall-cmd (/usr/bin/firewall-cmd) is executed somehow. Just saw that multiple times only when running apply_changes API. “ipset” as well.

image

{"status":"success","message":"All the changes has been successfully applied on tenant vitalpbx","data":[]}

Okay, here we go:
Uninstalled Geo-Firewall: fixed. no problem anymore.
Sadly, once more: Geo-Firewall causing pain.
Just disable it does not work. Uninstall necessary.

Hope this helps to find and fix the problem.
Thanks

1 Like

This might have been fixed in Version 3.1.5 -3

But looks like reload_dialplan in ombu_settings set to yes is needed now if you want asterisk config files to be generated again.

I don’t know what else can be done with apply_changes API.

Some details here:

hello,
it works by setting the “reload_dialplan” field to “yes”.
But is it a final choice or will it be changed/corrected?
Thank you

1 Like

Not working if followme is changed…

I don’t think this i fixed yet.

You need a mysql command right now to make it work:

" reload_dialplan in ombu_settings set to yes is needed now if you want asterisk config files to be generated again."

Would be really good if this can be fixed in apply_changes API by the VitalPBX-Team.

sorry but reload_dialplan is set to yes and all changes are correctly reloaded, but not followme.

Was this working for you before with follow me?
Happened now in the latest version?
Explain more in Detail.
Because i have it working (3.0.9-5) with followme but not testest in latest version.

What exactly do you change in follow me and what does not work?

Sorry.
Last version of VitalPbx :

  • choice a queue
  • choice an extension
  • Set “allow diversions” to “yes”
  • Change music on hold (for test) on this queue
  • Set reload dialplan to yes
  • use API to reload

Result :

  1. Music on hold is changed
  2. Allow diversions is not functionnal

NB : if i reload using UI, Allow diversions is ok

Can you please try:

  • save allow diversions in Queue to yes and save with UI.
  • Change FollowMe enable/disable (or change the follow me number)
  • Set reload dialplan to yes
  • use API to reload
  • check if follow me changes worked

Keep in mind, sometimes something like this is needed when changing follow me dialplan (often not needed):

Asterisk Command: module reload app_followme.so

So maybe this needs to be done for a Queue when you change allow diversions?!:

module reload app_queue.so

Looks like this has nothing to do with follow me but with a Queue.

Apply_changes still an issue, i agree.

No, it still doesn’t work :frowning:

  • Allow Follow me in extension

UPDATE ombu_extension_diversions SET enable=‘yes’ WHERE extension_id=1 AND name=‘FWM’

  • Allow diversion in queue

UPDATE ombu_queue_members SET queue_id=1,extension_id=1,diversions=‘yes’ WHERE queue_member_id=1

  • Set reload_plan to yes and reload vitalpbx (module_id) module to yes.
  • Set ALL reload modules in ombu_queued_changes (or reloading in Asterisk console…)

Two results :

  • if i clic on “update” (and only this one) in vitalbpx UI : all is working fine
  • if i call API reload : follow me not working (all other changes are ok)

I’m sorry but while waiting for a more “compliant” solution:

include_once “includes/bootstrap.php”;
vitalpbx\OmbuSystemConf::applyConfig();
[…]

and all is working fine without using the UI…

NB : with an open source code we could easily debug many things quickly :frowning:

You are right, apply changes API does NOT work anymore.
Not even with setting “reload dialplan” to yes.
Some changes will just not be applied.