Closed lgaetz closed 12 years ago
To get value to set global var:
$sip_settings = sipsettings_get(); $sip_settings[externip_val] //external IP set in SIP Settings
Also need to collect the public FQDN and LAN name (i.e. pbx.local) and LAN ip address
test for presence of custom contexts: $active_modules[customcontexts] will be an array of values if installed or undefined if not.
page.xxx.php will test for presence and display warning.
function to get list of system devices:
$list = core_devices_list() //returns 2d array of system devices $list[1]['id'] $list[2]['id'] //etc
method to check context of system devices:
$device = core_devices_get(101) $device[context] will equal the context define for ext 101
Proper way to set global Asterisk variables in FreePBX:
$sql ="REPLACE INTO globals (value,variable) VALUES ('test', 'TEST') ";
$check = $db->query($sql);
if (DB::IsError($check)) {
die_freepbx( "Can not set global variable TEST" . $check->getMessage() . "\n");
}
Idea is to implement the steps in this post: http://pbxinaflash.com/community/index.php?threads/sip-uri-dialing-piaf-purple.8717/page-2#post-56463
Need to edit
/etc/asterisk/global_custom.conf
in freePBX the path is$amp_conf[ASTETCDIR]."/global_custom.conf'
Need to set SIP Settings option srvlookup:
Need to edit
/etc/asterisk/extensions_custom.conf
, path is$amp_conf[ASTETCDIR].'/extension_custom.conf'