What is the proper procedure to add a new value in amportal.conf

what is the proper procedure to add a new value in amportal.conf and have access to that information it in a agi script?

I have several things I’m working on to integrate multiple asterisk boxes together. To this end I need a location and variable that will contain all the asterisk boxes in a cluster.

So I created a new entry ASTSERVERLIST. It’s purpose is to be a dns based list of all remote servers in the cluster so that you can use this list to communicate with those servers.

I also use this value in the patch for unified directory listings that I submitted but can’t get this part working.

I figured all I needed to do was edit the webroot/admin/functions.inc.php file and add the line below to the $amp_conf_defaults defination:

‘ASTSERVERLIST’ => array(‘std’ , ‘’),

Since the parse_amportal_conf file will then read the amportal.conf file and replace the program level defaults with the values found in the config file.

But when I make this change and attempt to use it in the agi-bin/directory script, it get’s a empty value like nothing happened in the functions.inc.php file…

you can add anything you would like and it will get inserted into the array that FreePBX uses. However, that does not make it available to an AGI script. There are a handful of the core amportal.conf variables that are automatically inserted as Asterisk global variables in the dialplan. This is so that AGI scripts can have access to those variables without having to run their own parser and parse amportal.conf every time. If you need a set of information like that, I would suggest you create a module that will insert the desired globals into the dialplan and then you pull those values out of the channel through the AGI interface in you script. This keeps from re-parsing amportal.conf and is consistent with how all (I hope all anyhow) the AGI scripts now do it. The module would be extremely simply - consisting of nothing more than a ‘modulename_get_config()’ function to insert the variable when retrieve_conf runs.

Philippe Lindheimer - FreePBX Project Lead
http//freepbx.org - IRC #freepbx

I’ll go take a look at several other agi scripts and modules for a example I hope. All I know is that the directory agi script does not have this.

it may not - you can look at the core module to see where it inserts global variables, it is a bit of a special case but the concept is the same.

Philippe Lindheimer - FreePBX Project Lead
http//freepbx.org - IRC #freepbx