From 0ec34662f5fae0b633d15ea59d134fc279ff975b Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Fri, 31 Oct 2008 00:24:33 +0000 Subject: package FreeSWITCH 0.2 additional changes --- packages/freeswitch/freeswitch.inc | 469 +++++++++++++++++++++++----- packages/freeswitch/freeswitch_gateways.xml | 80 ++++- packages/freeswitch/freeswitch_status.tmp | 6 +- 3 files changed, 467 insertions(+), 88 deletions(-) diff --git a/packages/freeswitch/freeswitch.inc b/packages/freeswitch/freeswitch.inc index 21bd75b5..e94362c9 100644 --- a/packages/freeswitch/freeswitch.inc +++ b/packages/freeswitch/freeswitch.inc @@ -120,7 +120,7 @@ function event_socket_request($fp, $cmd) } -function event_socket_request_reloadxml() +function event_socket_request_cmd($cmd) { global $config; @@ -131,15 +131,13 @@ function event_socket_request_reloadxml() if (pkg_is_service_running('freeswitch')) { $fp = event_socket_create($host, $port, $password); - $cmd = "api reloadxml"; $response = event_socket_request($fp, $cmd); fclose($fp); } unset($host, $port, $password); } - - + function sync_package_freeswitch_settings() { @@ -199,7 +197,9 @@ function sync_package_freeswitch_settings() } conf_mount_ro(); - event_socket_request_reloadxml(); + $cmd = "api reloadxml"; + event_socket_request_cmd($cmd); + unset($cmd); } } @@ -228,8 +228,10 @@ function sync_package_freeswitch_dialplan() unset($tmpxml); } - conf_mount_ro(); - event_socket_request_reloadxml(); + conf_mount_ro(); + $cmd = "api reloadxml"; + event_socket_request_cmd($cmd); + unset($cmd); } @@ -297,7 +299,9 @@ function sync_package_freeswitch_extensions() } conf_mount_ro(); - event_socket_request_reloadxml(); + $cmd = "api reloadxml"; + event_socket_request_cmd($cmd); + unset($cmd); } } @@ -319,17 +323,50 @@ function sync_package_freeswitch_gateways() $fout = fopen("/usr/local/freeswitch/conf/sip_profiles/external/".$rowhelper['gateway'].".xml","w"); $tmpxml .= "\n"; - $tmpxml .= " \n"; - $tmpxml .= " \n"; - $tmpxml .= " \n"; - $tmpxml .= " \n"; - $tmpxml .= " \n"; - $tmpxml .= " \n"; - $tmpxml .= " \n"; - $tmpxml .= " \n"; - $tmpxml .= " \n"; - $tmpxml .= " \n"; - $tmpxml .= " \n"; + $tmpxml .= " \n"; + if (strlen($rowhelper['username']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['password']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['realm']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['from-user']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['from-domain']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['proxy']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['expire-seconds']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['register']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['register-transport']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['retry-seconds']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['extension']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['context']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['caller-id-in-from']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['supress-cng']) > 0) { + $tmpxml .= " \n"; + } + $tmpxml .= " \n"; $tmpxml .= ""; @@ -339,7 +376,9 @@ function sync_package_freeswitch_gateways() } conf_mount_ro(); - event_socket_request_reloadxml(); + $cmd = "api sofia profile external restart reloadxml"; + event_socket_request_cmd($cmd); + unset($cmd); } @@ -351,27 +390,118 @@ function sync_package_freeswitch_modules() global $config; conf_mount_rw(); config_unlock(); - - if(strlen($config['installedpackages']['freeswitchmodules']['config'][0]['modules_conf_xml']) == 0) { - /* dialplan not found in the pfsense config.xml get the default dialplan and save to config.xml. */ - $filename = "/usr/local/freeswitch/conf/autoload_configs/modules.conf.xml"; - $fout = fopen($filename,"r"); - $tmpxml = fread($fout, filesize($filename)); - $config['installedpackages']['freeswitchmodules']['config'][0]['modules_conf_xml'] = base64_encode($tmpxml); - unset($filename, $dialplan); - fclose($fout); - } - else { - /* found the dialplan in the pfsense config.xml save it to default.xml. */ - $fout = fopen("/usr/local/freeswitch/conf/autoload_configs/modules.conf.xml","w"); - $tmpxml = $config['installedpackages']['freeswitchmodules']['config'][0]['modules_conf_xml']; - fwrite($fout, base64_decode($tmpxml)); - fclose($fout); + + foreach($config['installedpackages']['freeswitchmodules']['config'] as $rowhelper) { + $fout = fopen("/usr/local/freeswitch/conf/autoload_configs/modules.conf.xml","w"); + + $tmpxml =""; + $tmpxml .= "\n"; + $tmpxml .= " \n"; + $tmpxml .= "\n"; + $tmpxml .= " \n"; + if ($rowhelper['mod_console'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_logfile'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_syslog'] == "enable"){ $tmpxml .= " \n"; } + $tmpxml .= "\n"; + if ($rowhelper['mod_yaml'] == "enable"){ $tmpxml .= " \n"; } + $tmpxml .= "\n"; + $tmpxml .= " \n"; + $tmpxml .= " \n"; + if ($rowhelper['mod_enum'] == "enable"){ $tmpxml .= " \n"; } + $tmpxml .= "\n"; + $tmpxml .= " \n"; + if ($rowhelper['mod_xml_rpc'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_xml_curl'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_xml_cdr'] == "enable"){ $tmpxml .= " \n"; } + $tmpxml .= "\n"; + $tmpxml .= " \n"; + if ($rowhelper['mod_cdr_csv'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_event_multicast'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_event_socket'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_zeroconf'] == "enable"){ $tmpxml .= " \n"; } + $tmpxml .= "\n"; + $tmpxml .= " \n"; + if ($rowhelper['mod_ldap'] == "enable"){ $tmpxml .= " \n"; } + $tmpxml .= "\n"; + $tmpxml .= " \n"; + if ($rowhelper['mod_dingaling'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_iax'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_portaudio'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_alsa'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_sofia'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_loopback'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_wanpipe'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_woomera'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_openzap'] == "enable"){ $tmpxml .= " \n"; } + $tmpxml .= "\n"; + $tmpxml .= " \n"; + if ($rowhelper['mod_commands'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_conference'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_dptools'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_expr'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_fifo'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_voicemail'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_limit'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_esf'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_fsv'] == "enable"){ $tmpxml .= " \n"; } + $tmpxml .= "\n"; + $tmpxml .= " \n"; + if ($rowhelper['mod_snom'] == "enable"){ $tmpxml .= " \n"; } + $tmpxml .= "\n"; + $tmpxml .= " \n"; + if ($rowhelper['mod_dialplan_directory'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_dialplan_xml'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_dialplan_asterisk'] == "enable"){ $tmpxml .= " \n"; } + $tmpxml .= "\n"; + $tmpxml .= " \n"; + if ($rowhelper['mod_voipcodecs'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_g723_1'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_g729'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_amr'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_ilbc'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_speex'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_h26x'] == "enable"){ $tmpxml .= " \n"; } + $tmpxml .= "\n"; + $tmpxml .= " \n"; + if ($rowhelper['mod_sndfile'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_native_file'] == "enable"){ $tmpxml .= " \n"; } + $tmpxml .= " \n"; + if ($rowhelper['mod_shout'] == "enable"){ $tmpxml .= " \n"; } + $tmpxml .= " \n"; + if ($rowhelper['mod_local_stream'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_tone_stream'] == "enable"){ $tmpxml .= " \n"; } + $tmpxml .= "\n"; + $tmpxml .= " \n"; + $tmpxml .= "\n"; + $tmpxml .= " \n"; + if ($rowhelper['mod_spidermonkey'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_perl'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_python'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_java'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_lua'] == "enable"){ $tmpxml .= " \n"; } + $tmpxml .= "\n"; + $tmpxml .= " \n"; + if ($rowhelper['mod_flite'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_pocketsphinx'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_cepstral'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_openmrcp'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_rss'] == "enable"){ $tmpxml .= " \n"; } + $tmpxml .= "\n"; + $tmpxml .= " \n"; + if ($rowhelper['mod_say_en'] == "enable"){ $tmpxml .= " \n"; } + if ($rowhelper['mod_say_zh'] == "enable"){ $tmpxml .= " \n"; } + $tmpxml .= " \n"; + $tmpxml .= ""; + + fwrite($fout, $tmpxml); unset($tmpxml); + fclose($fout); } conf_mount_ro(); - event_socket_request_reloadxml(); + $cmd = "api reloadxml"; + event_socket_request_cmd($cmd); + unset($cmd); } @@ -401,7 +531,9 @@ function sync_package_freeswitch_public() } conf_mount_ro(); - event_socket_request_reloadxml(); + $cmd = "api reloadxml"; + event_socket_request_cmd($cmd); + unset($cmd); } @@ -431,10 +563,13 @@ function sync_package_freeswitch_vars() } conf_mount_ro(); - event_socket_request_reloadxml(); + $cmd = "api reloadxml"; + event_socket_request_cmd($cmd); + unset($cmd); } + function sync_package_freeswitch_internal() { global $config; @@ -460,10 +595,13 @@ function sync_package_freeswitch_internal() } conf_mount_ro(); - event_socket_request_reloadxml(); + $cmd = "api reloadxml"; + event_socket_request_cmd($cmd); + unset($cmd); } + function sync_package_freeswitch_external() { global $config; @@ -489,9 +627,12 @@ function sync_package_freeswitch_external() } conf_mount_ro(); - event_socket_request_reloadxml(); + $cmd = "api reloadxml"; + event_socket_request_cmd($cmd); + unset($cmd); } + function sync_package_freeswitch() { @@ -524,42 +665,30 @@ function freeswitch_php_install_command() exec("tar zxvf /tmp/freeswitch.tgz -C /usr/local/"); unlink_if_exists("/tmp/freeswitch.tgz"); - - /* set default numbering_plan */ - if (strlen($config['installedpackages']['freeswitchsettings']['config'][0]['numbering_plan']) == 0) { - $config['installedpackages']['freeswitchsettings']['config'][0]['numbering_plan'] = "US"; - } - - /* set default event_socket_password */ - if(strlen($config['installedpackages']['freeswitchsettings']['config'][0]['event_socket_password']) == 0) { - $config['installedpackages']['freeswitchsettings']['config'][0]['event_socket_password'] = "ClueCon"; - } - - /* set default event_socket_port */ - if (strlen($config['installedpackages']['freeswitchsettings']['config'][0]['event_socket_port']) == 0) { - $config['installedpackages']['freeswitchsettings']['config'][0]['event_socket_port'] = "8021"; - } - - /* set default xml_rpc_http_port */ - if (strlen($config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_http_port']) == 0) { - $config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_http_port'] = "8787"; - } - - /* set default xml_rpc_auth_realm */ - if (strlen($config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_realm']) == 0) { - $config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_realm'] = "freeswitch"; - } - - /* set default xml_rpc_auth_user */ - if (strlen($config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_user']) == 0) { - $config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_user'] = "freeswitch"; - } - - /* set default xml_rpc_auth_pass */ - if (strlen($config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_pass']) == 0) { - $config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_pass'] = "works"; - } + /* freeswitch settings defaults */ + if (strlen($config['installedpackages']['freeswitchsettings']['config'][0]['numbering_plan']) == 0) { + $config['installedpackages']['freeswitchsettings']['config'][0]['numbering_plan'] = "US"; + } + if(strlen($config['installedpackages']['freeswitchsettings']['config'][0]['event_socket_password']) == 0) { + $config['installedpackages']['freeswitchsettings']['config'][0]['event_socket_password'] = "ClueCon"; + } + if (strlen($config['installedpackages']['freeswitchsettings']['config'][0]['event_socket_port']) == 0) { + $config['installedpackages']['freeswitchsettings']['config'][0]['event_socket_port'] = "8021"; + } + if (strlen($config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_http_port']) == 0) { + $config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_http_port'] = "8787"; + } + if (strlen($config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_realm']) == 0) { + $config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_realm'] = "freeswitch"; + } + if (strlen($config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_user']) == 0) { + $config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_user'] = "freeswitch"; + } + if (strlen($config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_pass']) == 0) { + $config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_pass'] = "works"; + } + $numbering_plan = $config['installedpackages']['freeswitchsettings']['config'][0]['numbering_plan']; $event_socket_password = $config['installedpackages']['freeswitchsettings']['config'][0]['event_socket_password']; $event_socket_port = $config['installedpackages']['freeswitchsettings']['config'][0]['event_socket_port']; @@ -580,13 +709,195 @@ function freeswitch_php_install_command() fwrite($fout, $tmpxml); unset($tmpxml); fclose($fout); - + + /* freeswitch modules defaults */ + + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_console']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_console'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_logfile']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_logfile'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_syslog']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_syslog'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_yaml']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_yaml'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_enum']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_enum'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_xml_rpc']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_xml_rpc'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_xml_curl']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_xml_curl'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_xml_cdr']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_xml_cdr'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_cdr_csv']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_cdr_csv'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_event_multicast']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_event_multicast'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_event_socket']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_event_socket'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_zeroconf']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_zeroconf'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_ldap']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_ldap'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_dingaling']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_dingaling'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_iax']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_iax'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_portaudio']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_portaudio'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_alsa']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_alsa'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_sofia']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_sofia'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_loopback']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_loopback'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_wanpipe']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_wanpipe'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_woomera']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_woomera'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_openzap']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_openzap'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_commands']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_commands'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_conference']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_conference'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_dptools']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_dptools'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_expr']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_expr'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_fifo']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_fifo'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_voicemail']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_voicemail'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_limit']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_limit'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_esf']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_esf'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_fsv']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_fsv'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_snom']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_snom'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_dialplan_directory']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_dialplan_directory'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_dialplan_xml']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_dialplan_xml'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_dialplan_asterisk']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_dialplan_asterisk'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_voipcodecs']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_voipcodecs'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_g723_1']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_g723_1'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_g729']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_g729'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_amr']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_amr'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_ilbc']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_ilbc'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_speex']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_speex'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_h26x']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_h26x'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_sndfile']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_sndfile'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_native_file']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_native_file'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_shout']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_shout'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_local_stream']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_local_stream'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_tone_stream']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_tone_stream'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_spidermonkey']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_spidermonkey'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_perl']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_perl'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_python']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_python'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_java']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_java'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_lua']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_lua'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_flite']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_flite'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_pocketsphinx']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_pocketsphinx'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_cepstral']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_cepstral'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_openmrcp']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_openmrcp'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_rss']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_rss'] = "disable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_say_en']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_say_en'] = "enable"; + } + if (strlen($config['installedpackages']['freeswitchmodules']['config'][0]['mod_say_zh']) == 0) { + $config['installedpackages']['freeswitchmodules']['config'][0]['mod_say_zh'] = "disable"; + } + write_rcfile(array( "file" => "freeswitch.sh", "start" => "/usr/local/freeswitch/bin/./freeswitch -nc", "stop" => "/usr/local/freeswitch/bin/./freeswitch -stop" ) ); + + exec("rm -R /freeswitch"); sync_package_freeswitch(); $handle = popen("/usr/local/etc/rc.d/freeswitch.sh start", "r"); @@ -602,6 +913,7 @@ function freeswitch_php_install_command() function freeswitch_deinstall_command() { + conf_mount_rw(); config_lock(); exec("killall -9 freeswitch"); @@ -623,9 +935,8 @@ function freeswitch_deinstall_command() unlink_if_exists("/tmp/pkg_mgr_FreeSWITCH.log"); conf_mount_ro(); config_unlock(); + } - - ?> \ No newline at end of file diff --git a/packages/freeswitch/freeswitch_gateways.xml b/packages/freeswitch/freeswitch_gateways.xml index 0975eccb..4db6c3b5 100644 --- a/packages/freeswitch/freeswitch_gateways.xml +++ b/packages/freeswitch/freeswitch_gateways.xml @@ -47,12 +47,12 @@ */ /* ========================================================================== */ ]]> - + FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow. Describe your package requirements here Currently there are no FAQ items provided. freeswitchgateways - 0.1 + 0.2 FreeSWITCH: Gateways /usr/local/pkg/freeswitch.inc @@ -134,7 +134,14 @@ Enter the password here. input - + + + Realm + realm + Enter the realm here. + input + + From-user from-user @@ -180,8 +187,28 @@ - Retry_seconds - retry_seconds + Register-transport + register-transport + Choose whether to register-transport. + select + + + + + + + + Retry-seconds + retry-seconds Enter the retry_seconds here. Example: 30 input 30 @@ -200,6 +227,46 @@ input public + + Caller-id-in-from + caller-id-in-from + Choose caller-id-in-from. + select + + + + + + + + Supress-cng + supress-cng + Choose whether to supress-cng. + select + + + + + + Gateway Description description @@ -218,5 +285,4 @@ - - + \ No newline at end of file diff --git a/packages/freeswitch/freeswitch_status.tmp b/packages/freeswitch/freeswitch_status.tmp index 67b73767..3178a277 100644 --- a/packages/freeswitch/freeswitch_status.tmp +++ b/packages/freeswitch/freeswitch_status.tmp @@ -102,7 +102,7 @@ function event_socket_request($fp, $cmd) { } -$pgtitle = "FreeSWITCH: Status"; + include("head.inc"); $password = $config['installedpackages']['freeswitchsettings']['config'][0]['event_socket_password']; @@ -113,11 +113,12 @@ $host = $config['interfaces']['lan']['ipaddr']; ?> -

+

FreeSWITCH: Status

+
+
-- cgit v1.2.3