diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/freeswitch/freeswitch.inc | 469 | ||||
-rw-r--r-- | packages/freeswitch/freeswitch_gateways.xml | 80 | ||||
-rw-r--r-- | 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 .= "<include>\n"; - $tmpxml .= " <gateway name=\"" . $rowhelper['gateway'] . "\">\n"; - $tmpxml .= " <param name=\"username\" value=\"" . $rowhelper['username'] . "\"/>\n"; - $tmpxml .= " <param name=\"password\" value=\"" . $rowhelper['password'] . "\"/>\n"; - $tmpxml .= " <param name=\"from-user\" value=\"" . $rowhelper['from-user'] . "\"/>\n"; - $tmpxml .= " <param name=\"from-domain\" value=\"" . $rowhelper['from-domain'] . "\"/>\n"; - $tmpxml .= " <param name=\"proxy\" value=\"" . $rowhelper['proxy'] . "\"/>\n"; - $tmpxml .= " <param name=\"expire-seconds\" value=\"" . $rowhelper['expire-seconds'] . "\"/>\n"; - $tmpxml .= " <param name=\"register\" value=\"" . $rowhelper['register'] . "\"/>\n"; - $tmpxml .= " <param name=\"retry_seconds\" value=\"" . $rowhelper['retry_seconds'] . "\"/>\n"; - $tmpxml .= " <param name=\"extension\" value=\"" . $rowhelper['extension'] . "\"/>\n"; - $tmpxml .= " <param name=\"context\" value=\"" . $rowhelper['context'] . "\"/>\n"; + $tmpxml .= " <gateway name=\"" . $rowhelper['gateway'] . "\">\n"; + if (strlen($rowhelper['username']) > 0) { + $tmpxml .= " <param name=\"username\" value=\"" . $rowhelper['username'] . "\"/>\n"; + } + if (strlen($rowhelper['password']) > 0) { + $tmpxml .= " <param name=\"password\" value=\"" . $rowhelper['password'] . "\"/>\n"; + } + if (strlen($rowhelper['realm']) > 0) { + $tmpxml .= " <param name=\"realm\" value=\"" . $rowhelper['realm'] . "\"/>\n"; + } + if (strlen($rowhelper['from-user']) > 0) { + $tmpxml .= " <param name=\"from-user\" value=\"" . $rowhelper['from-user'] . "\"/>\n"; + } + if (strlen($rowhelper['from-domain']) > 0) { + $tmpxml .= " <param name=\"from-domain\" value=\"" . $rowhelper['from-domain'] . "\"/>\n"; + } + if (strlen($rowhelper['proxy']) > 0) { + $tmpxml .= " <param name=\"proxy\" value=\"" . $rowhelper['proxy'] . "\"/>\n"; + } + if (strlen($rowhelper['expire-seconds']) > 0) { + $tmpxml .= " <param name=\"expire-seconds\" value=\"" . $rowhelper['expire-seconds'] . "\"/>\n"; + } + if (strlen($rowhelper['register']) > 0) { + $tmpxml .= " <param name=\"register\" value=\"" . $rowhelper['register'] . "\"/>\n"; + } + if (strlen($rowhelper['register-transport']) > 0) { + $tmpxml .= " <param name=\"register-transport\" value=\"" . $rowhelper['register-transport'] . "\"/>\n"; + } + if (strlen($rowhelper['retry-seconds']) > 0) { + $tmpxml .= " <param name=\"retry-seconds\" value=\"" . $rowhelper['retry-seconds'] . "\"/>\n"; + } + if (strlen($rowhelper['extension']) > 0) { + $tmpxml .= " <param name=\"extension\" value=\"" . $rowhelper['extension'] . "\"/>\n"; + } + if (strlen($rowhelper['context']) > 0) { + $tmpxml .= " <param name=\"context\" value=\"" . $rowhelper['context'] . "\"/>\n"; + } + if (strlen($rowhelper['caller-id-in-from']) > 0) { + $tmpxml .= " <param name=\"context\" value=\"" . $rowhelper['context'] . "\"/>\n"; + } + if (strlen($rowhelper['supress-cng']) > 0) { + $tmpxml .= " <param name=\"context\" value=\"" . $rowhelper['context'] . "\"/>\n"; + } + $tmpxml .= " </gateway>\n"; $tmpxml .= "</include>"; @@ -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 .= "<configuration name=\"modules.conf\" description=\"Modules\">\n"; + $tmpxml .= " <modules>\n"; + $tmpxml .= "\n"; + $tmpxml .= " <!-- Loggers (I'd load these first) -->\n"; + if ($rowhelper['mod_console'] == "enable"){ $tmpxml .= " <load module=\"mod_console\"/>\n"; } + if ($rowhelper['mod_logfile'] == "enable"){ $tmpxml .= " <load module=\"mod_logfile\"/>\n"; } + if ($rowhelper['mod_syslog'] == "enable"){ $tmpxml .= " <load module=\"mod_syslog\"/>\n"; } + $tmpxml .= "\n"; + if ($rowhelper['mod_yaml'] == "enable"){ $tmpxml .= " <load module=\"mod_yaml\"/>\n"; } + $tmpxml .= "\n"; + $tmpxml .= " <!-- Multi-Faceted -->\n"; + $tmpxml .= " <!-- mod_enum is a dialplan interface, an application interface and an api command interface -->\n"; + if ($rowhelper['mod_enum'] == "enable"){ $tmpxml .= " <load module=\"mod_enum\"/>\n"; } + $tmpxml .= "\n"; + $tmpxml .= " <!-- XML Interfaces -->\n"; + if ($rowhelper['mod_xml_rpc'] == "enable"){ $tmpxml .= " <load module=\"mod_xml_rpc\"/>\n"; } + if ($rowhelper['mod_xml_curl'] == "enable"){ $tmpxml .= " <load module=\"mod_xml_curl\"/>\n"; } + if ($rowhelper['mod_xml_cdr'] == "enable"){ $tmpxml .= " <load module=\"mod_xml_cdr\"/>\n"; } + $tmpxml .= "\n"; + $tmpxml .= " <!-- Event Handlers -->\n"; + if ($rowhelper['mod_cdr_csv'] == "enable"){ $tmpxml .= " <load module=\"mod_cdr_csv\"/>\n"; } + if ($rowhelper['mod_event_multicast'] == "enable"){ $tmpxml .= " <load module=\"mod_event_multicast\"/>\n"; } + if ($rowhelper['mod_event_socket'] == "enable"){ $tmpxml .= " <load module=\"mod_event_socket\"/>\n"; } + if ($rowhelper['mod_zeroconf'] == "enable"){ $tmpxml .= " <load module=\"mod_zeroconf\"/>\n"; } + $tmpxml .= "\n"; + $tmpxml .= " <!-- Directory Interfaces -->\n"; + if ($rowhelper['mod_ldap'] == "enable"){ $tmpxml .= " <load module=\"mod_ldap\"/>\n"; } + $tmpxml .= "\n"; + $tmpxml .= " <!-- Endpoints -->\n"; + if ($rowhelper['mod_dingaling'] == "enable"){ $tmpxml .= " <load module=\"mod_dingaling\"/>\n"; } + if ($rowhelper['mod_iax'] == "enable"){ $tmpxml .= " <load module=\"mod_iax\"/>\n"; } + if ($rowhelper['mod_portaudio'] == "enable"){ $tmpxml .= " <load module=\"mod_portaudio\"/>\n"; } + if ($rowhelper['mod_alsa'] == "enable"){ $tmpxml .= " <load module=\"mod_alsa\"/>\n"; } + if ($rowhelper['mod_sofia'] == "enable"){ $tmpxml .= " <load module=\"mod_sofia\"/>\n"; } + if ($rowhelper['mod_loopback'] == "enable"){ $tmpxml .= " <load module=\"mod_loopback\"/>\n"; } + if ($rowhelper['mod_wanpipe'] == "enable"){ $tmpxml .= " <load module=\"mod_wanpipe\"/>\n"; } + if ($rowhelper['mod_woomera'] == "enable"){ $tmpxml .= " <load module=\"mod_woomera\"/>\n"; } + if ($rowhelper['mod_openzap'] == "enable"){ $tmpxml .= " <load module=\"mod_openzap\"/>\n"; } + $tmpxml .= "\n"; + $tmpxml .= " <!-- Applications -->\n"; + if ($rowhelper['mod_commands'] == "enable"){ $tmpxml .= " <load module=\"mod_commands\"/>\n"; } + if ($rowhelper['mod_conference'] == "enable"){ $tmpxml .= " <load module=\"mod_conference\"/>\n"; } + if ($rowhelper['mod_dptools'] == "enable"){ $tmpxml .= " <load module=\"mod_dptools\"/>\n"; } + if ($rowhelper['mod_expr'] == "enable"){ $tmpxml .= " <load module=\"mod_expr\"/>\n"; } + if ($rowhelper['mod_fifo'] == "enable"){ $tmpxml .= " <load module=\"mod_fifo\"/>\n"; } + if ($rowhelper['mod_voicemail'] == "enable"){ $tmpxml .= " <load module=\"mod_voicemail\"/>\n"; } + if ($rowhelper['mod_limit'] == "enable"){ $tmpxml .= " <load module=\"mod_limit\"/>\n"; } + if ($rowhelper['mod_esf'] == "enable"){ $tmpxml .= " <load module=\"mod_esf\"/>\n"; } + if ($rowhelper['mod_fsv'] == "enable"){ $tmpxml .= " <load module=\"mod_fsv\"/>\n"; } + $tmpxml .= "\n"; + $tmpxml .= " <!-- SNOM Module -->\n"; + if ($rowhelper['mod_snom'] == "enable"){ $tmpxml .= " <load module=\"mod_snom\"/>\n"; } + $tmpxml .= "\n"; + $tmpxml .= " <!-- Dialplan Interfaces -->\n"; + if ($rowhelper['mod_dialplan_directory'] == "enable"){ $tmpxml .= " <load module=\"mod_dialplan_directory\"/>\n"; } + if ($rowhelper['mod_dialplan_xml'] == "enable"){ $tmpxml .= " <load module=\"mod_dialplan_xml\"/>\n"; } + if ($rowhelper['mod_dialplan_asterisk'] == "enable"){ $tmpxml .= " <load module=\"mod_dialplan_asterisk\"/>\n"; } + $tmpxml .= "\n"; + $tmpxml .= " <!-- Codec Interfaces -->\n"; + if ($rowhelper['mod_voipcodecs'] == "enable"){ $tmpxml .= " <load module=\"mod_voipcodecs\"/>\n"; } + if ($rowhelper['mod_g723_1'] == "enable"){ $tmpxml .= " <load module=\"mod_g723_1\"/>\n"; } + if ($rowhelper['mod_g729'] == "enable"){ $tmpxml .= " <load module=\"mod_g729\"/>\n"; } + if ($rowhelper['mod_amr'] == "enable"){ $tmpxml .= " <load module=\"mod_amr\"/>\n"; } + if ($rowhelper['mod_ilbc'] == "enable"){ $tmpxml .= " <load module=\"mod_ilbc\"/>\n"; } + if ($rowhelper['mod_speex'] == "enable"){ $tmpxml .= " <load module=\"mod_speex\"/>\n"; } + if ($rowhelper['mod_h26x'] == "enable"){ $tmpxml .= " <load module=\"mod_h26x\"/>\n"; } + $tmpxml .= "\n"; + $tmpxml .= " <!-- File Format Interfaces -->\n"; + if ($rowhelper['mod_sndfile'] == "enable"){ $tmpxml .= " <load module=\"mod_sndfile\"/>\n"; } + if ($rowhelper['mod_native_file'] == "enable"){ $tmpxml .= " <load module=\"mod_native_file\"/>\n"; } + $tmpxml .= " <!--For icecast/mp3 streams/files-->\n"; + if ($rowhelper['mod_shout'] == "enable"){ $tmpxml .= " <load module=\"mod_shout\"/>\n"; } + $tmpxml .= " <!--For local streams (play all the files in a directory)-->\n"; + if ($rowhelper['mod_local_stream'] == "enable"){ $tmpxml .= " <load module=\"mod_local_stream\"/>\n"; } + if ($rowhelper['mod_tone_stream'] == "enable"){ $tmpxml .= " <load module=\"mod_tone_stream\"/>\n"; } + $tmpxml .= "\n"; + $tmpxml .= " <!-- Timers -->\n"; + $tmpxml .= "\n"; + $tmpxml .= " <!-- Languages -->\n"; + if ($rowhelper['mod_spidermonkey'] == "enable"){ $tmpxml .= " <load module=\"mod_spidermonkey\"/>\n"; } + if ($rowhelper['mod_perl'] == "enable"){ $tmpxml .= " <load module=\"mod_perl\"/>\n"; } + if ($rowhelper['mod_python'] == "enable"){ $tmpxml .= " <load module=\"mod_python\"/>\n"; } + if ($rowhelper['mod_java'] == "enable"){ $tmpxml .= " <load module=\"mod_java\"/>\n"; } + if ($rowhelper['mod_lua'] == "enable"){ $tmpxml .= " <load module=\"mod_lua\"/>\n"; } + $tmpxml .= "\n"; + $tmpxml .= " <!-- ASR /TTS -->\n"; + if ($rowhelper['mod_flite'] == "enable"){ $tmpxml .= " <load module=\"mod_flite\"/>\n"; } + if ($rowhelper['mod_pocketsphinx'] == "enable"){ $tmpxml .= " <load module=\"mod_pocketsphinx\"/>\n"; } + if ($rowhelper['mod_cepstral'] == "enable"){ $tmpxml .= " <load module=\"mod_cepstral\"/>\n"; } + if ($rowhelper['mod_openmrcp'] == "enable"){ $tmpxml .= " <load module=\"mod_openmrcp\"/>\n"; } + if ($rowhelper['mod_rss'] == "enable"){ $tmpxml .= " <load module=\"mod_rss\"/>\n"; } + $tmpxml .= "\n"; + $tmpxml .= " <!-- Say -->\n"; + if ($rowhelper['mod_say_en'] == "enable"){ $tmpxml .= " <load module=\"mod_say_en\"/>\n"; } + if ($rowhelper['mod_say_zh'] == "enable"){ $tmpxml .= " <load module=\"mod_say_zh\"/>\n"; } + $tmpxml .= " </modules>\n"; + $tmpxml .= "</configuration>"; + + 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 @@ */ /* ========================================================================== */ ]]> - </copyright> + </copyright> <description>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.</description> <requirements>Describe your package requirements here</requirements> <faq>Currently there are no FAQ items provided.</faq> <name>freeswitchgateways</name> - <version>0.1</version> + <version>0.2</version> <title>FreeSWITCH: Gateways</title> <include_file>/usr/local/pkg/freeswitch.inc</include_file> <tabs> @@ -134,7 +134,14 @@ <description>Enter the password here.</description> <type>input</type> <value></value> - </field> + </field> + <field> + <fielddescr>Realm</fielddescr> + <fieldname>realm</fieldname> + <description>Enter the realm here.</description> + <type>input</type> + <value></value> + </field> <field> <fielddescr>From-user</fielddescr> <fieldname>from-user</fieldname> @@ -180,8 +187,28 @@ </options> </field> <field> - <fielddescr>Retry_seconds</fielddescr> - <fieldname>retry_seconds</fieldname> + <fielddescr>Register-transport</fielddescr> + <fieldname>register-transport</fieldname> + <description>Choose whether to register-transport.</description> + <type>select</type> + <options> + <option> + <name></name> + <value></value> + </option> + <option> + <name>udp</name> + <value>udp</value> + </option> + <option> + <name>tcp</name> + <value>tcp</value> + </option> + </options> + </field> + <field> + <fielddescr>Retry-seconds</fielddescr> + <fieldname>retry-seconds</fieldname> <description>Enter the retry_seconds here. Example: 30</description> <type>input</type> <value>30</value> @@ -200,6 +227,46 @@ <type>input</type> <value>public</value> </field> + <field> + <fielddescr>Caller-id-in-from</fielddescr> + <fieldname>caller-id-in-from</fieldname> + <description>Choose caller-id-in-from.</description> + <type>select</type> + <options> + <option> + <name></name> + <value></value> + </option> + <option> + <name>True</name> + <value>true</value> + </option> + <option> + <name>False</name> + <value>false</value> + </option> + </options> + </field> + <field> + <fielddescr>Supress-cng</fielddescr> + <fieldname>supress-cng</fieldname> + <description>Choose whether to supress-cng.</description> + <type>select</type> + <options> + <option> + <name></name> + <value></value> + </option> + <option> + <name>True</name> + <value>true</value> + </option> + <option> + <name>False</name> + <value>false</value> + </option> + </options> + </field> <field> <fielddescr>Gateway Description</fielddescr> <fieldname>description</fieldname> @@ -218,5 +285,4 @@ </custom_delete_php_command> <custom_php_deinstall_command> </custom_php_deinstall_command> -</packagegui> - +</packagegui>
\ 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']; ?> <body link="#0000CC" vlink="#0000CC" alink="#0000CC"> <?php include("fbegin.inc"); ?> -<p class="pgtitle"><?=$pgtitle?></font></p> +<p class="pgtitle">FreeSWITCH: Status</font></p> <?php if ($savemsg) print_info_box($savemsg); ?> <div id="mainlevel"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> +<tr><td class="tabnavtbl"> <?php $tab_array = array(); @@ -134,6 +135,7 @@ $host = $config['interfaces']['lan']['ipaddr']; display_top_tabs($tab_array); ?> +</td></tr> </table> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> |