Call Mapper with Apply Confg

configuration
asterisk
freepbx
Tags: #<Tag:0x00007f7028dd4cb8> #<Tag:0x00007f7028dd4b28> #<Tag:0x00007f7028dd49e8>

(Ira Holden) #1

I have written a program that displays call routes from DNIS to wherever a call travels through the FreePBX , in a tree type format.

It can also make changes to the MySQL asterisk database.

What I would like to know is: Where is the flag that tells the GUI to activate the “Apply Config” button?
I have a button to issue the ‘fwconsole reload’ command, but would like to be able to control the flag that states if the “Apply Config” is active or not.

TIA, Ira


#2

I suggest you submit your code for review first


(Jared Busch) #3
fwconsole reload

(Ira Holden) #4

Thanks for the quick response.
However, neither response has anything to do with my question.

Sorvani: Thanks for the info, but I already had that command .

Dicko: …submit code… What code? I’m looking for the flag that signifies where or not the “Apply Config” needs to be clicked.

Let me try again: When User 1 makes a change using the GUI (a Submit), they now see the red “Apply Config” button. Lets say User 1 closes the GUI without hitting the Apply Config button.

Now, later on, User 2 logs onto the same box. And because User 1 did not hit the “Apply Config”, User 2 will see the same red Apply Config button on their GUI. Somehow the HTML/PHP used when loading the page, knew the “Apply Config” button had not be clicked. Where is that flag? Is it in a database table? Is it in a file somewhere? Somewhere in the box is located a flag that states where or not there was a change to the configuration and that configuration needs to be applied.

Hope this helps clarifies my needs.


(Lorne Gaetz) #5

The php method to do this is needreload

[root@uc-80606708 tmp]# cat reload.php
<?php
include '/etc/freepbx.conf';
needreload();

[root@uc-80606708 tmp]# php reload.php

running the above script will enable the reload button in the GUI. If you can find where the method is defined, it will tell you how it’s stored.


(Ira Holden) #6

lgaetz: Thank you. That helped.

Before reading you reply, I did a little more digging and did find the Flag:

MariaDB [asterisk]> select * from admin;
±--------------------------------±--------------+
| variable | value |
±--------------------------------±--------------+
| ALLOW_SIP_ANON | no |
| default_directory | 1 |
| directory28_migrated | 1 |
|** need_reload | true** |
| version | 14.0.13.28 |
±-------------------------------±--------------+
5 rows in set (0.00 sec)


(Jared Busch) #7

But the point remains that there is no reason to do that.

If you change anything in the MySQL database, simply issuing a reload will cause everything to be rewritten. Why set the bit in the GUI? Just reload.


(Ira Holden) #8

Yes, that is true. Running “fwconsole reload” not only rebuilds and loads the dialplan and config files, but also resets the “need_reload” flag to “false”.

However, after modifying the database, there are times I may wish not to hit “Apply config”. And setting the “need_reload” flag to true will allow someone else to do the honors when ready.

Also, without having to log into the GUI, I would like to know if that flag was set before I make additional changes.

I do like to keep my options open.

Thanks for the advise anyway.


(system) closed #9

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.