Merge remote-tracking branch 'remotes/fusionpbx/master' into Install_Rewrite

Conflicts:
	themes/enhanced/app_defaults.php
This commit is contained in:
Matthew Vale 2015-11-20 10:50:27 +00:00
commit ea86150b33
16 changed files with 1523 additions and 449 deletions

View File

@ -679,7 +679,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
if ($row["dialplan_detail_tag"] != "condition") {
if ($row["dialplan_detail_tag"] == "action" && $row["dialplan_detail_type"] == "set" && strpos($row["dialplan_detail_data"], "accountcode") == 0) { continue; } //exclude set:accountcode actions
echo " <tr>\n";
echo " <td>\n";
echo " <td style='padding-top: 5px; padding-right: 3px; white-space: nowrap;'>\n";
if (strlen($row['dialplan_detail_uuid']) > 0) {
echo " <input name='dialplan_details[".$x."][dialplan_detail_uuid]' type='hidden' value=\"".$row['dialplan_detail_uuid']."\">\n";
}

View File

@ -179,6 +179,13 @@
$array[$x]['default_setting_enabled'] = 'false';
$array[$x]['default_setting_description'] = '';
$x++;
$array[$x]['default_setting_category'] = 'provision';
$array[$x]['default_setting_subcategory'] = 'directory_extensions';
$array[$x]['default_setting_name'] = 'boolean';
$array[$x]['default_setting_value'] = 'true';
$array[$x]['default_setting_enabled'] = 'false';
$array[$x]['default_setting_description'] = 'allow extensions to be provisioned as contacts as $extensions in provision templates';
$x++;
$array[$x]['default_setting_category'] = 'ntp_server_primary';
$array[$x]['default_setting_subcategory'] = 'directory';
$array[$x]['default_setting_name'] = 'text';

View File

@ -180,11 +180,17 @@ include "root.php";
if (strlen($device_template) == 0) {
$sql = "SELECT * FROM v_devices ";
$sql .= "WHERE device_mac_address=:mac ";
if($provision['http_domain_filter'] == "true") {
$sql .= "AND domain_uuid=:domain_uuid ";
}
//$sql .= "WHERE device_mac_address= '$mac' ";
$prep_statement_2 = $this->db->prepare(check_sql($sql));
if ($prep_statement_2) {
//use the prepared statement
$prep_statement_2->bindParam(':mac', $mac);
if($provision['http_domain_filter'] == "true") {
$prep_statement_2->bindParam(':domain_uuid', $domain_uuid);
}
$prep_statement_2->execute();
$row = $prep_statement_2->fetch();
//set the variables from values in the database
@ -300,8 +306,14 @@ include "root.php";
if (strlen($device_uuid) > 0) {
$sql = "SELECT * FROM v_devices ";
$sql .= "WHERE device_uuid = '".$device_uuid."' ";
if($provision['http_domain_filter'] == "true") {
$sql .= "AND domain_uuid=:domain_uuid ";
}
$prep_statement_3 = $this->db->prepare(check_sql($sql));
if ($prep_statement_3) {
if($provision['http_domain_filter'] == "true") {
$prep_statement_3->bindParam(':domain_uuid', $domain_uuid);
}
$prep_statement_3->execute();
$row = $prep_statement_3->fetch();
$device_uuid_alternate = $row["device_uuid_alternate"];
@ -311,8 +323,14 @@ include "root.php";
//get the new devices information
$sql = "SELECT * FROM v_devices ";
$sql .= "WHERE device_uuid = '".$device_uuid."' ";
if($provision['http_domain_filter'] == "true") {
$sql .= "AND domain_uuid=:domain_uuid ";
}
$prep_statement_4 = $this->db->prepare(check_sql($sql));
if ($prep_statement_4) {
if($provision['http_domain_filter'] == "true") {
$prep_statement_4->bindParam(':domain_uuid', $domain_uuid);
}
$prep_statement_4->execute();
$row = $prep_statement_4->fetch();
$device_label = $row["device_label"];
@ -455,6 +473,29 @@ include "root.php";
unset ($prep_statement);
}
//get the extensions array and add to the template engine
if (strlen($device_uuid) > 0 and strlen($domain_uuid) > 0 and $_SESSION['provision']['directory_extensions']['boolean'] == "true") {
//get contacts from the database
$sql = "select c.contact_organization, c.contact_name_given, c.contact_name_family, e.extension ";
$sql .= "from v_contacts as c, v_extension_users as cte, v_extensions as e, v_users as u ";
$sql .= "where c.domain_uuid = '".$domain_uuid."' ";
$sql .= "and c.contact_uuid = u.contact_uuid ";
$sql .= "and u.user_uuid = cte.user_uuid ";
$sql .= "and cte.extension_uuid = e.extension_uuid ";
$sql .= "and e.directory_visible = 'true' ";
foreach ($lines as $line){
$sql .= "and e.extension != '" . $line['user_id']. "' ";
}
$sql .= "order by c.contact_organization desc, c.contact_name_given asc, c.contact_name_family asc ";
$prep_statement = $this->db->prepare(check_sql($sql));
$prep_statement->execute();
$extensions = $prep_statement->fetchAll(PDO::FETCH_NAMED);
unset ($prep_statement, $sql);
//assign the contacts array
$view->assign("extensions", $extensions);
}
//get the provisioning information from device keys
if (strlen($device_uuid) > 0) {
//get the device keys array

View File

@ -92,15 +92,18 @@
$sip_profile_description = "The Internal IPV6 profile binds to the IP version 6 address and is similar to the Internal profile.\n";
break;
case "external":
$sip_profile_description .= "The External profile external provides anonymous calling in the public context. ";
$sip_profile_description = "The External profile external provides anonymous calling in the public context. ";
$sip_profile_description .= "By default the External profile binds to port 5080. ";
$sip_profile_description .= "Calls can be sent using a SIP URL \"voip.domain.com:5080\" ";
break;
case "external-ipv6":
$sip_profile_description = "The External IPV6 profile binds to the IP version 6 address and is similar to the External profile.\n";
break;
case "lan":
$sip_profile_description = "The LAN profile is the same as the Internal profile except that it is bound to the LAN IP.\n";
break;
default:
$sip_profile_description .= '';
$sip_profile_description = '';
}
//add the sip profile if it is not false

View File

@ -0,0 +1,23 @@
<profile name="{v_sip_profile_name}">
<!-- http://wiki.freeswitch.org/wiki/Sofia_Configuration_Files -->
<!--aliases are other names that will work as a valid profile name for this profile-->
<aliases>
<!--
<alias name="outbound"/>
<alias name="nat"/>
-->
</aliases>
<!-- Outbound Registrations -->
<gateways>
<X-PRE-PROCESS cmd="include" data="{v_sip_profile_name}/*.xml"/>
</gateways>
<domains>
<domain name="all" alias="false" parse="true"/>
</domains>
<settings>
{v_sip_profile_settings}
</settings>
</profile>

View File

@ -860,7 +860,7 @@ function add_custom_condition($destination, $group_id, $dialplan_action = '') {
echo " <td colspan='2' class='vtable'>".$text['label-group']."</td>\n";
echo " </tr>";
echo " <tr>";
echo " <td colspan='2' style='padding-top: 3px;'>";
echo " <td colspan='2' style='padding-top: 3px; padding-right: 3px; white-space: nowrap;'>";
//$destination = new destinations;
echo $destination->select('dialplan', 'dialplan_action['.$group_id.']', $dialplan_action);
echo " </td>";

View File

@ -43,12 +43,34 @@ $vars = <<<EOD
{"var_name":"call_debug","var_value":"false","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"console_loglevel","var_value":"info","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"default_areacode","var_value":"208","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"uk-ring","var_value":"%(400,200,400,450);%(400,2200,400,450)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"us-ring","var_value":"%(2000, 4000, 440.0, 480.0)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"pt-ring","var_value":"%(1000, 5000, 400.0, 0.0)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"fr-ring","var_value":"%(1500, 3500, 440.0, 0.0)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"rs-ring","var_value":"%(1000, 4000, 425.0, 0.0)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"it-ring","var_value":"%(1000, 4000, 425.0, 0.0)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"be-ring","var_value":"%(1000,3000,425)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"ca-ring","var_value":"%(2000,4000,440,480)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"cn-ring","var_value":"%(1000,4000,450)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"cy-ring","var_value":"%(1500,3000,425)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"cz-ring","var_value":"%(1000,4000,425)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"de-ring","var_value":"%(1000,4000,425)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"dk-ring","var_value":"%(1000,4000,425)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"dz-ring","var_value":"%(1500,3500,425)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"eg-ring","var_value":"%(2000,1000,475,375)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"fi-ring","var_value":"%(1000,4000,425)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"fr-ring","var_value":"%(1500,3500,440)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"pt-ring","var_value":"%(1000,5000,400)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"hk-ring","var_value":"%(400,200,440,480);%(400,3000,440,480)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"hu-ring","var_value":"%(1250,3750,425)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"il-ring","var_value":"%(1000,3000,400)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"in-ring","var_value":"%(400,200,425,375);%(400,2000,425,375)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"jp-ring","var_value":"%(1000,2000,420,380)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"ko-ring","var_value":"%(1000,2000,440,480)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"pk-ring","var_value":"%(1000,2000,400)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"pl-ring","var_value":"%(1000,4000,425)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"ro-ring","var_value":"%(1850,4150,475,425)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"rs-ring","var_value":"%(1000,4000,425)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"it-ring","var_value":"%(1000,4000,425)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"ru-ring","var_value":"%(800,3200,425)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"sa-ring","var_value":"%(1200,4600,425)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"tr-ring","var_value":"%(2000,4000,450)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"uk-ring","var_value":"%(400,200,400,450);%(400,2000,400,450)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"us-ring","var_value":"%(2000,4000,440,480)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"bong-ring","var_value":"v=-7;%(100,0,941.0,1477.0);v=-7;>=2;+=.1;%(1400,0,350,440)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"sit","var_value":"%(274,0,913.8);%(274,0,1370.6);%(380,0,1776.7)","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"sip_tls_version","var_value":"tlsv1","var_cat":"SIP","var_enabled":"true","var_description":"U0lQIGFuZCBUTFMgc2V0dGluZ3Mu"},
@ -56,12 +78,12 @@ $vars = <<<EOD
{"var_name":"internal_sip_port","var_value":"5060","var_cat":"SIP Profile: Internal","var_enabled":"true","var_description":""},
{"var_name":"internal_tls_port","var_value":"5061","var_cat":"SIP Profile: Internal","var_enabled":"true","var_description":""},
{"var_name":"internal_ssl_enable","var_value":"false","var_cat":"SIP Profile: Internal","var_enabled":"true","var_description":""},
{"var_name":"internal_ssl_dir","var_value":"\$\${base_dir}/conf/ssl","var_cat":"SIP Profile: Internal","var_enabled":"true","var_description":""},
{"var_name":"internal_ssl_dir","var_value":"\$\${conf_dir}/ssl","var_cat":"SIP Profile: Internal","var_enabled":"true","var_description":""},
{"var_name":"external_auth_calls","var_value":"false","var_cat":"SIP Profile: External","var_enabled":"true","var_description":""},
{"var_name":"external_sip_port","var_value":"5080","var_cat":"SIP Profile: External","var_enabled":"true","var_description":""},
{"var_name":"external_tls_port","var_value":"5081","var_cat":"SIP Profile: External","var_enabled":"true","var_description":""},
{"var_name":"external_ssl_enable","var_value":"false","var_cat":"SIP Profile: External","var_enabled":"true","var_description":""},
{"var_name":"external_ssl_dir","var_value":"\$\${base_dir}/conf/ssl","var_cat":"SIP Profile: External","var_enabled":"true","var_description":""},
{"var_name":"external_ssl_dir","var_value":"\$\${conf_dir}/ssl","var_cat":"SIP Profile: External","var_enabled":"true","var_description":""},
{"var_name":"use_profile","var_value":"internal","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"default_language","var_value":"en","var_cat":"Defaults","var_enabled":"true","var_description":""},
{"var_name":"default_dialect","var_value":"us","var_cat":"Defaults","var_enabled":"true","var_description":""},
@ -77,239 +99,7 @@ EOD;
// Set country depend variables as country code and international direct dialing code (exit code)
if (!function_exists('set_country_vars')) {
function set_country_vars($db, $x) {
$country_list = <<<EOD
[
{"country":"Afghanistan","countrycode":"93","exitcode":"00","isocode":"AF"}
,{"country":"Albania","countrycode":"355","exitcode":"00","isocode":"AL"}
,{"country":"Algeria","countrycode":"213","exitcode":"00","isocode":"DZ"}
,{"country":"American Samoa","countrycode":"1","exitcode":"011","isocode":"AS"}
,{"country":"Andorra","countrycode":"376","exitcode":"00","isocode":"AD"}
,{"country":"Angola","countrycode":"244","exitcode":"00","isocode":"AO"}
,{"country":"Anguilla","countrycode":"1","exitcode":"011","isocode":"AI"}
,{"country":"Antigua and Barbuda","countrycode":"1","exitcode":"011","isocode":"AG"}
,{"country":"Argentina","countrycode":"54","exitcode":"00","isocode":"AR"}
,{"country":"Armenia","countrycode":"374","exitcode":"00","isocode":"AM"}
,{"country":"Aruba","countrycode":"297","exitcode":"00","isocode":"AW"}
,{"country":"Ascension","countrycode":"247","exitcode":"00","isocode":"AC"}
,{"country":"Australia","countrycode":"61","exitcode":"0011","isocode":"AU"}
,{"country":"Austria","countrycode":"43","exitcode":"00","isocode":"AT"}
,{"country":"Azerbaijan","countrycode":"994","exitcode":"00","isocode":"AZ"}
,{"country":"Bahamas","countrycode":"1","exitcode":"011","isocode":"BS"}
,{"country":"Bahrain","countrycode":"973","exitcode":"00","isocode":"BH"}
,{"country":"Bangladesh","countrycode":"880","exitcode":"00","isocode":"BD"}
,{"country":"Barbados","countrycode":"1","exitcode":"011","isocode":"BB"}
,{"country":"Belarus","countrycode":"375","exitcode":"810","isocode":"BY"}
,{"country":"Belgium","countrycode":"32","exitcode":"00","isocode":"BE"}
,{"country":"Belize","countrycode":"501","exitcode":"00","isocode":"BZ"}
,{"country":"Benin","countrycode":"229","exitcode":"00","isocode":"BJ"}
,{"country":"Bermuda","countrycode":"1","exitcode":"011","isocode":"BM"}
,{"country":"Bhutan","countrycode":"975","exitcode":"00","isocode":"BT"}
,{"country":"Bolivia","countrycode":"591","exitcode":"00","isocode":"BO"}
,{"country":"Bosnia and Herzegovina","countrycode":"387","exitcode":"00","isocode":"BA"}
,{"country":"Botswana","countrycode":"267","exitcode":"00","isocode":"BW"}
,{"country":"Brazil","countrycode":"55","exitcode":"0014","isocode":"BR"}
,{"country":"British Virgin Islands","countrycode":"1","exitcode":"011","isocode":"VG"}
,{"country":"Brunei","countrycode":"673","exitcode":"00","isocode":"BN"}
,{"country":"Bulgaria","countrycode":"359","exitcode":"00","isocode":"BG"}
,{"country":"Burkina Faso","countrycode":"226","exitcode":"00","isocode":"BF"}
,{"country":"Burundi","countrycode":"257","exitcode":"00","isocode":"BI"}
,{"country":"Cambodia","countrycode":"855","exitcode":"001, 007, 008","isocode":"KH"}
,{"country":"Cameroon","countrycode":"237","exitcode":"00","isocode":"CM"}
,{"country":"Canada","countrycode":"1","exitcode":"011","isocode":"CA"}
,{"country":"Cape Verde","countrycode":"238","exitcode":"00","isocode":"CV"}
,{"country":"Cayman Islands","countrycode":"1","exitcode":"011","isocode":"KY"}
,{"country":"Central African Republic","countrycode":"236","exitcode":"00","isocode":"CF"}
,{"country":"Chad","countrycode":"235","exitcode":"00","isocode":"TD"}
,{"country":"Chile","countrycode":"56","exitcode":"1230","isocode":"CL"}
,{"country":"China","countrycode":"86","exitcode":"00","isocode":"CN"}
,{"country":"Colombia","countrycode":"57","exitcode":"005","isocode":"CO"}
,{"country":"Comoros","countrycode":"269","exitcode":"00","isocode":"KM"}
,{"country":"Congo","countrycode":"242","exitcode":"00","isocode":"CD"}
,{"country":"Cook Islands","countrycode":"682","exitcode":"00","isocode":"CK"}
,{"country":"Costa Rica","countrycode":"506","exitcode":"00","isocode":"CR"}
,{"country":"Croatia","countrycode":"385","exitcode":"00","isocode":"HR"}
,{"country":"Cuba","countrycode":"53","exitcode":"119","isocode":"CU"}
,{"country":"Cyprus","countrycode":"357","exitcode":"00","isocode":"CY"}
,{"country":"Czech Republic","countrycode":"420","exitcode":"00","isocode":"CZ"}
,{"country":"Democratic Republic of Congo","countrycode":"243","exitcode":"00","isocode":"CD"}
,{"country":"Denmark","countrycode":"45","exitcode":"00","isocode":"DK"}
,{"country":"Djibouti","countrycode":"253","exitcode":"00","isocode":"DJ"}
,{"country":"Dominica","countrycode":"1","exitcode":"011","isocode":"DM"}
,{"country":"Dominican Republic","countrycode":"1","exitcode":"011","isocode":"DO"}
,{"country":"East Timor","countrycode":"670","exitcode":"00","isocode":"TL"}
,{"country":"Ecuador","countrycode":"593","exitcode":"00","isocode":"EC"}
,{"country":"Egypt","countrycode":"20","exitcode":"00","isocode":"EG"}
,{"country":"El Salvador","countrycode":"503","exitcode":"00","isocode":"SV"}
,{"country":"Equatorial Guinea","countrycode":"240","exitcode":"00","isocode":"GQ"}
,{"country":"Eritrea","countrycode":"291","exitcode":"00","isocode":"ER"}
,{"country":"Estonia","countrycode":"372","exitcode":"00","isocode":"EE"}
,{"country":"Ethiopia","countrycode":"251","exitcode":"00","isocode":"ET"}
,{"country":"Falkland (Malvinas) Islands","countrycode":"500","exitcode":"00","isocode":"FK"}
,{"country":"Faroe Islands","countrycode":"298","exitcode":"00","isocode":"FO"}
,{"country":"Fiji","countrycode":"679","exitcode":"00","isocode":"FJ"}
,{"country":"Finland","countrycode":"358","exitcode":"00, 990, 994, 999","isocode":"FI"}
,{"country":"France","countrycode":"33","exitcode":"00","isocode":"FR"}
,{"country":"French Guiana","countrycode":"594","exitcode":"00","isocode":"GF"}
,{"country":"French Polynesia","countrycode":"689","exitcode":"00","isocode":"PF"}
,{"country":"Gabon","countrycode":"241","exitcode":"00","isocode":"GA"}
,{"country":"Gambia","countrycode":"220","exitcode":"00","isocode":"GM"}
,{"country":"Georgia","countrycode":"995","exitcode":"00","isocode":"GE"}
,{"country":"Germany","countrycode":"49","exitcode":"00","isocode":"DE"}
,{"country":"Ghana","countrycode":"233","exitcode":"00","isocode":"GH"}
,{"country":"Gibraltar","countrycode":"350","exitcode":"00","isocode":"GI"}
,{"country":"Greece","countrycode":"30","exitcode":"00","isocode":"GR"}
,{"country":"Greenland","countrycode":"299","exitcode":"00","isocode":"GL"}
,{"country":"Grenada","countrycode":"1","exitcode":"011","isocode":"GD"}
,{"country":"Guadeloupe","countrycode":"590","exitcode":"00","isocode":"GP"}
,{"country":"Guam","countrycode":"1","exitcode":"011","isocode":"GU"}
,{"country":"Guatemala","countrycode":"502","exitcode":"00","isocode":"GT"}
,{"country":"Guinea","countrycode":"224","exitcode":"00","isocode":"GN"}
,{"country":"Guinea-Bissau","countrycode":"245","exitcode":"00","isocode":"GW"}
,{"country":"Guyana","countrycode":"592","exitcode":"001","isocode":"GY"}
,{"country":"Haiti","countrycode":"509","exitcode":"00","isocode":"HT"}
,{"country":"Honduras","countrycode":"504","exitcode":"00","isocode":"HN"}
,{"country":"Hong Kong","countrycode":"852","exitcode":"001","isocode":"HK"}
,{"country":"Hungary","countrycode":"36","exitcode":"00","isocode":"HU"}
,{"country":"Iceland","countrycode":"354","exitcode":"00","isocode":"IS"}
,{"country":"India","countrycode":"91","exitcode":"00","isocode":"IN"}
,{"country":"Indonesia","countrycode":"62","exitcode":"001","isocode":"ID"}
,{"country":"Iran","countrycode":"98","exitcode":"00","isocode":"IR"}
,{"country":"Iraq","countrycode":"964","exitcode":"00","isocode":"IQ"}
,{"country":"Ireland","countrycode":"353","exitcode":"00","isocode":"IE"}
,{"country":"Israel","countrycode":"972","exitcode":"00, 012, 013, 014, 018","isocode":"IL"}
,{"country":"Italy","countrycode":"39","exitcode":"00","isocode":"IT"}
,{"country":"Ivory Coast","countrycode":"225","exitcode":"00","isocode":"CI"}
,{"country":"Jamaica","countrycode":"1","exitcode":"011","isocode":"JM"}
,{"country":"Japan","countrycode":"81","exitcode":"010","isocode":"JP"}
,{"country":"Jordan","countrycode":"962","exitcode":"00","isocode":"JO"}
,{"country":"Kazakhstan","countrycode":"7","exitcode":"810","isocode":"KZ"}
,{"country":"Kenya","countrycode":"254","exitcode":"000","isocode":"KE"}
,{"country":"Kiribati","countrycode":"686","exitcode":"00","isocode":"KI"}
,{"country":"Kuwait","countrycode":"965","exitcode":"00","isocode":"KW"}
,{"country":"Kyrgyzstan","countrycode":"996","exitcode":"00","isocode":"KG"}
,{"country":"Laos","countrycode":"856","exitcode":"00","isocode":"LA"}
,{"country":"Latvia","countrycode":"371","exitcode":"00","isocode":"LV"}
,{"country":"Lebanon","countrycode":"961","exitcode":"00","isocode":"LB"}
,{"country":"Lesotho","countrycode":"266","exitcode":"00","isocode":"LS"}
,{"country":"Liberia","countrycode":"231","exitcode":"00","isocode":"LR"}
,{"country":"Libya","countrycode":"218","exitcode":"00","isocode":"LY"}
,{"country":"Liechtenstein","countrycode":"423","exitcode":"00","isocode":"LI"}
,{"country":"Lithuania","countrycode":"370","exitcode":"00","isocode":"LT"}
,{"country":"Luxembourg","countrycode":"352","exitcode":"00","isocode":"LU"}
,{"country":"Macau","countrycode":"853","exitcode":"00","isocode":"MO"}
,{"country":"Macedonia","countrycode":"389","exitcode":"00","isocode":"MK"}
,{"country":"Madagascar","countrycode":"261","exitcode":"00","isocode":"MG"}
,{"country":"Malawi","countrycode":"265","exitcode":"00","isocode":"MW"}
,{"country":"Malaysia","countrycode":"60","exitcode":"00","isocode":"MY"}
,{"country":"Maldives","countrycode":"960","exitcode":"00","isocode":"MV"}
,{"country":"Mali","countrycode":"223","exitcode":"00","isocode":"ML"}
,{"country":"Malta","countrycode":"356","exitcode":"00","isocode":"MT"}
,{"country":"Marshall Islands","countrycode":"692","exitcode":"011","isocode":"MH"}
,{"country":"Martinique","countrycode":"596","exitcode":"00","isocode":"MQ"}
,{"country":"Mauritania","countrycode":"222","exitcode":"00","isocode":"MR"}
,{"country":"Mauritius","countrycode":"230","exitcode":"00","isocode":"MU"}
,{"country":"Mayotte","countrycode":"262","exitcode":"00","isocode":"YT"}
,{"country":"Mexico","countrycode":"52","exitcode":"00","isocode":"MX"}
,{"country":"Micronesia","countrycode":"691","exitcode":"011","isocode":"FM"}
,{"country":"Moldova","countrycode":"373","exitcode":"00","isocode":"MD"}
,{"country":"Monaco","countrycode":"377","exitcode":"00","isocode":"MC"}
,{"country":"Mongolia","countrycode":"976","exitcode":"001","isocode":"MN"}
,{"country":"Montenegro","countrycode":"382","exitcode":"00","isocode":"ME"}
,{"country":"Montserrat","countrycode":"1","exitcode":"011","isocode":"MS"}
,{"country":"Morocco","countrycode":"212","exitcode":"00","isocode":"MA"}
,{"country":"Mozambique","countrycode":"258","exitcode":"00","isocode":"MZ"}
,{"country":"Myanmar","countrycode":"95","exitcode":"00","isocode":"MM"}
,{"country":"Namibia","countrycode":"264","exitcode":"00","isocode":"NA"}
,{"country":"Nauru","countrycode":"674","exitcode":"00","isocode":"NR"}
,{"country":"Nepal","countrycode":"977","exitcode":"00","isocode":"NP"}
,{"country":"Netherlands","countrycode":"31","exitcode":"00","isocode":"NL"}
,{"country":"Netherlands Antilles","countrycode":"599","exitcode":"00","isocode":"AN"}
,{"country":"New Caledonia","countrycode":"687","exitcode":"00","isocode":"NC"}
,{"country":"New Zealand","countrycode":"64","exitcode":"00","isocode":"NZ"}
,{"country":"Nicaragua","countrycode":"505","exitcode":"00","isocode":"NI"}
,{"country":"Niger","countrycode":"227","exitcode":"00","isocode":"NE"}
,{"country":"Nigeria","countrycode":"234","exitcode":"009","isocode":"NG"}
,{"country":"Niue","countrycode":"683","exitcode":"00","isocode":"NU"}
,{"country":"Norfolk Island","countrycode":"6723","exitcode":"00","isocode":"NF"}
,{"country":"North Korea","countrycode":"850","exitcode":"99","isocode":"KP"}
,{"country":"Norway","countrycode":"47","exitcode":"00","isocode":"NO"}
,{"country":"Oman","countrycode":"968","exitcode":"00","isocode":"OM"}
,{"country":"Pakistan","countrycode":"92","exitcode":"00","isocode":"PK"}
,{"country":"Palau","countrycode":"680","exitcode":"011","isocode":"PW"}
,{"country":"Panama","countrycode":"507","exitcode":"00","isocode":"PA"}
,{"country":"Papua New Guinea","countrycode":"675","exitcode":"00","isocode":"PG"}
,{"country":"Paraguay","countrycode":"595","exitcode":"00","isocode":"PY"}
,{"country":"Peru","countrycode":"51","exitcode":"00","isocode":"PE"}
,{"country":"Philippines","countrycode":"63","exitcode":"00","isocode":"PH"}
,{"country":"Poland","countrycode":"48","exitcode":"00","isocode":"PL"}
,{"country":"Portugal","countrycode":"351","exitcode":"00","isocode":"PT"}
,{"country":"Puerto Rico","countrycode":"1","exitcode":"011","isocode":"PR"}
,{"country":"Qatar","countrycode":"974","exitcode":"00","isocode":"QA"}
,{"country":"Reunion","countrycode":"262","exitcode":"00","isocode":"RE"}
,{"country":"Romania","countrycode":"40","exitcode":"00","isocode":"RO"}
,{"country":"Russian Federation","countrycode":"7","exitcode":"810","isocode":"RU"}
,{"country":"Rwanda","countrycode":"250","exitcode":"00","isocode":"RW"}
,{"country":"Saint Helena","countrycode":"290","exitcode":"00","isocode":"SH"}
,{"country":"Saint Kitts and Nevis","countrycode":"1","exitcode":"011","isocode":"KN"}
,{"country":"Saint Lucia","countrycode":"1","exitcode":"011","isocode":"LC"}
,{"country":"Saint Barthelemy","countrycode":"590","exitcode":"00","isocode":"GP"}
,{"country":"Saint Pierre and Miquelon","countrycode":"508","exitcode":"00","isocode":"PM"}
,{"country":"Saint Vincent and the Grenadines","countrycode":"1","exitcode":"011","isocode":"VC"}
,{"country":"Samoa","countrycode":"685","exitcode":"0","isocode":"WS"}
,{"country":"San Marino","countrycode":"378","exitcode":"00","isocode":"SM"}
,{"country":"Sao Tome and Principe","countrycode":"239","exitcode":"00","isocode":"ST"}
,{"country":"Saudi Arabia","countrycode":"966","exitcode":"00","isocode":"SA"}
,{"country":"Senegal","countrycode":"221","exitcode":"00","isocode":"SN"}
,{"country":"Serbia","countrycode":"381","exitcode":"00","isocode":"RS"}
,{"country":"Seychelles","countrycode":"248","exitcode":"00","isocode":"SC"}
,{"country":"Sierra Leone","countrycode":"232","exitcode":"00","isocode":"SL"}
,{"country":"Singapore","countrycode":"65","exitcode":"001, 008","isocode":"SG"}
,{"country":"Slovakia","countrycode":"421","exitcode":"00","isocode":"SK"}
,{"country":"Slovenia","countrycode":"386","exitcode":"00","isocode":"SI"}
,{"country":"Solomon Islands","countrycode":"677","exitcode":"00","isocode":"SB"}
,{"country":"Somalia","countrycode":"252","exitcode":"00","isocode":"SO"}
,{"country":"South Africa","countrycode":"27","exitcode":"00","isocode":"ZA"}
,{"country":"South Korea","countrycode":"82","exitcode":"001, 002","isocode":"KR"}
,{"country":"Spain","countrycode":"34","exitcode":"00","isocode":"ES"}
,{"country":"Sri Lanka","countrycode":"94","exitcode":"00","isocode":"LK"}
,{"country":"Sudan","countrycode":"249","exitcode":"00","isocode":"SD"}
,{"country":"Suriname","countrycode":"597","exitcode":"00","isocode":"SR"}
,{"country":"Swaziland","countrycode":"268","exitcode":"00","isocode":"SZ"}
,{"country":"Sweden","countrycode":"46","exitcode":"00","isocode":"SE"}
,{"country":"Switzerland","countrycode":"41","exitcode":"00","isocode":"CH"}
,{"country":"Syria","countrycode":"963","exitcode":"00","isocode":"SY"}
,{"country":"Taiwan","countrycode":"886","exitcode":"002","isocode":"TW"}
,{"country":"Tajikistan","countrycode":"992","exitcode":"810","isocode":"TJ"}
,{"country":"Tanzania","countrycode":"255","exitcode":"000","isocode":"TZ"}
,{"country":"Thailand","countrycode":"66","exitcode":"001","isocode":"TH"}
,{"country":"Togo","countrycode":"228","exitcode":"00","isocode":"TG"}
,{"country":"Tokelau","countrycode":"690","exitcode":"00","isocode":"TK"}
,{"country":"Tonga","countrycode":"676","exitcode":"00","isocode":"TO"}
,{"country":"Trinidad and Tobago","countrycode":"1","exitcode":"011","isocode":"TT"}
,{"country":"Tunisia","countrycode":"216","exitcode":"00","isocode":"TN"}
,{"country":"Turkey","countrycode":"90","exitcode":"00","isocode":"TR"}
,{"country":"Turkmenistan","countrycode":"993","exitcode":"810","isocode":"TM"}
,{"country":"Turks and Caicos Islands","countrycode":"1","exitcode":"0","isocode":"TC"}
,{"country":"Tuvalu","countrycode":"688","exitcode":"00","isocode":"TV"}
,{"country":"Uganda","countrycode":"256","exitcode":"000","isocode":"UG"}
,{"country":"Ukraine","countrycode":"380","exitcode":"00","isocode":"UA"}
,{"country":"United Arab Emirates","countrycode":"971","exitcode":"00","isocode":"AE"}
,{"country":"United Kingdom","countrycode":"44","exitcode":"00","isocode":"GB"}
,{"country":"United States","countrycode":"1","exitcode":"011","isocode":"US"}
,{"country":"U.S. Virgin Islands","countrycode":"1","exitcode":"011","isocode":"VI"}
,{"country":"Uruguay","countrycode":"598","exitcode":"00","isocode":"UY"}
,{"country":"Uzbekistan","countrycode":"998","exitcode":"8 - wait for dial tone - 10","isocode":"UZ"}
,{"country":"Vanuatu","countrycode":"678","exitcode":"00","isocode":"VU"}
,{"country":"Vatican City","countrycode":"379, 39","exitcode":"00","isocode":"VA"}
,{"country":"Venezuela","countrycode":"58","exitcode":"00","isocode":"VE"}
,{"country":"Vietnam","countrycode":"84","exitcode":"00","isocode":"VN"}
,{"country":"Wallis and Futuna","countrycode":"681","exitcode":"00","isocode":"WF"}
,{"country":"Yemen","countrycode":"967","exitcode":"00","isocode":"YE"}
,{"country":"Zambia","countrycode":"260","exitcode":"00","isocode":"ZM"}
,{"country":"Zimbabwe","countrycode":"263","exitcode":"00","isocode":"ZW"}
]
EOD;
require "resources/countries.php";
// $country_iso=$_SESSION['domain']['country']['iso_code'];
@ -331,131 +121,121 @@ EOD;
if ( $country_iso===NULL ) {
return;
}
if(isset($countries[$country_iso])){
$country = $countries[$country_iso];
$countries = json_decode($country_list, true);
$found = false;
foreach($countries as $country) {
if ( $country["isocode"]==$country_iso ) {
$found = true;
break;
// Set default Country ISO code
$sql = "select count(*) as num_rows from v_vars ";
$sql .= "where var_name = 'default_country' ";
$sql .= "and var_cat = 'Defaults' ";
$prep_statement = $db->prepare(check_sql($sql));
if ($prep_statement) {
$prep_statement->execute();
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
if ($row['num_rows'] == 0) {
$sql = "insert into v_vars ";
$sql .= "(";
$sql .= "var_uuid, ";
$sql .= "var_name, ";
$sql .= "var_value, ";
$sql .= "var_cat, ";
$sql .= "var_enabled, ";
$sql .= "var_order, ";
$sql .= "var_description ";
$sql .= ")";
$sql .= "values ";
$sql .= "(";
$sql .= "'".uuid()."', ";
$sql .= "'default_country', ";
$sql .= "'".$country["isocode"]."', ";
$sql .= "'Defaults', ";
$sql .= "'true', ";
$sql .= "'".$x."', ";
$sql .= "'' ";
$sql .= ");";
$db->exec(check_sql($sql));
unset($sql, $row);
$x++;
}
}
}
if ( !$found ) {
return;
}
// Set default Country ISO code
$sql = "select count(*) as num_rows from v_vars ";
$sql .= "where var_name = 'default_country' ";
$sql .= "and var_cat = 'Defaults' ";
$prep_statement = $db->prepare(check_sql($sql));
if ($prep_statement) {
$prep_statement->execute();
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
if ($row['num_rows'] == 0) {
$sql = "insert into v_vars ";
$sql .= "(";
$sql .= "var_uuid, ";
$sql .= "var_name, ";
$sql .= "var_value, ";
$sql .= "var_cat, ";
$sql .= "var_enabled, ";
$sql .= "var_order, ";
$sql .= "var_description ";
$sql .= ")";
$sql .= "values ";
$sql .= "(";
$sql .= "'".uuid()."', ";
$sql .= "'default_country', ";
$sql .= "'".$country["isocode"]."', ";
$sql .= "'Defaults', ";
$sql .= "'true', ";
$sql .= "'".$x."', ";
$sql .= "'' ";
$sql .= ");";
$db->exec(check_sql($sql));
unset($sql, $row);
$x++;
unset($prep_statement, $sql);
// Set default Country code
$sql = "select count(*) as num_rows from v_vars ";
$sql .= "where var_name = 'default_countrycode' ";
$sql .= "and var_cat = 'Defaults' ";
$prep_statement = $db->prepare(check_sql($sql));
if ($prep_statement) {
$prep_statement->execute();
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
if ($row['num_rows'] == 0) {
$sql = "insert into v_vars ";
$sql .= "(";
$sql .= "var_uuid, ";
$sql .= "var_name, ";
$sql .= "var_value, ";
$sql .= "var_cat, ";
$sql .= "var_enabled, ";
$sql .= "var_order, ";
$sql .= "var_description ";
$sql .= ")";
$sql .= "values ";
$sql .= "(";
$sql .= "'".uuid()."', ";
$sql .= "'default_countrycode', ";
$sql .= "'".$country["countrycode"]."', ";
$sql .= "'Defaults', ";
$sql .= "'true', ";
$sql .= "'".$x."', ";
$sql .= "'' ";
$sql .= ");";
$db->exec(check_sql($sql));
unset($sql, $row);
$x++;
}
}
}
unset($prep_statement, $sql);
// Set default Country code
$sql = "select count(*) as num_rows from v_vars ";
$sql .= "where var_name = 'default_countrycode' ";
$sql .= "and var_cat = 'Defaults' ";
$prep_statement = $db->prepare(check_sql($sql));
if ($prep_statement) {
$prep_statement->execute();
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
if ($row['num_rows'] == 0) {
$sql = "insert into v_vars ";
$sql .= "(";
$sql .= "var_uuid, ";
$sql .= "var_name, ";
$sql .= "var_value, ";
$sql .= "var_cat, ";
$sql .= "var_enabled, ";
$sql .= "var_order, ";
$sql .= "var_description ";
$sql .= ")";
$sql .= "values ";
$sql .= "(";
$sql .= "'".uuid()."', ";
$sql .= "'default_countrycode', ";
$sql .= "'".$country["countrycode"]."', ";
$sql .= "'Defaults', ";
$sql .= "'true', ";
$sql .= "'".$x."', ";
$sql .= "'' ";
$sql .= ");";
$db->exec(check_sql($sql));
unset($sql, $row);
$x++;
unset($prep_statement, $sql);
// Set default International Direct Dialing code
$sql = "select count(*) as num_rows from v_vars ";
$sql .= "where var_name = 'default_exitcode' ";
$sql .= "and var_cat = 'Defaults' ";
$prep_statement = $db->prepare(check_sql($sql));
if ($prep_statement) {
$prep_statement->execute();
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
if ($row['num_rows'] == 0) {
$sql = "insert into v_vars ";
$sql .= "(";
$sql .= "var_uuid, ";
$sql .= "var_name, ";
$sql .= "var_value, ";
$sql .= "var_cat, ";
$sql .= "var_enabled, ";
$sql .= "var_order, ";
$sql .= "var_description ";
$sql .= ")";
$sql .= "values ";
$sql .= "(";
$sql .= "'".uuid()."', ";
$sql .= "'default_exitcode', ";
$sql .= "'".$country["exitcode"]."', ";
$sql .= "'Defaults', ";
$sql .= "'true', ";
$sql .= "'".$x."', ";
$sql .= "'' ";
$sql .= ");";
$db->exec(check_sql($sql));
unset($sql, $row);
$x++;
}
}
unset($prep_statement, $sql);
unset($countries);
}
unset($prep_statement, $sql);
// Set default International Direct Dialing code
$sql = "select count(*) as num_rows from v_vars ";
$sql .= "where var_name = 'default_exitcode' ";
$sql .= "and var_cat = 'Defaults' ";
$prep_statement = $db->prepare(check_sql($sql));
if ($prep_statement) {
$prep_statement->execute();
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
if ($row['num_rows'] == 0) {
$sql = "insert into v_vars ";
$sql .= "(";
$sql .= "var_uuid, ";
$sql .= "var_name, ";
$sql .= "var_value, ";
$sql .= "var_cat, ";
$sql .= "var_enabled, ";
$sql .= "var_order, ";
$sql .= "var_description ";
$sql .= ")";
$sql .= "values ";
$sql .= "(";
$sql .= "'".uuid()."', ";
$sql .= "'default_exitcode', ";
$sql .= "'".$country["exitcode"]."', ";
$sql .= "'Defaults', ";
$sql .= "'true', ";
$sql .= "'".$x."', ";
$sql .= "'' ";
$sql .= ");";
$db->exec(check_sql($sql));
unset($sql, $row);
$x++;
}
}
unset($prep_statement, $sql);
unset($countries);
}
}

916
resources/countries.php Normal file
View File

@ -0,0 +1,916 @@
<?php
$countries['AF']['country'] = 'Afghanistan';
$countries['AF']['countrycode'] = '93';
$countries['AF']['exitcode'] = '00';
$countries['AF']['isocode'] = 'AF';
$countries['AL']['country'] = 'Albania';
$countries['AL']['countrycode'] = '355';
$countries['AL']['exitcode'] = '00';
$countries['AL']['isocode'] = 'AL';
$countries['DZ']['country'] = 'Algeria';
$countries['DZ']['countrycode'] = '213';
$countries['DZ']['exitcode'] = '00';
$countries['DZ']['isocode'] = 'DZ';
$countries['AS']['country'] = 'American Samoa';
$countries['AS']['countrycode'] = '1';
$countries['AS']['exitcode'] = '011';
$countries['AS']['isocode'] = 'AS';
$countries['AD']['country'] = 'Andorra';
$countries['AD']['countrycode'] = '376';
$countries['AD']['exitcode'] = '00';
$countries['AD']['isocode'] = 'AD';
$countries['AO']['country'] = 'Angola';
$countries['AO']['countrycode'] = '244';
$countries['AO']['exitcode'] = '00';
$countries['AO']['isocode'] = 'AO';
$countries['AI']['country'] = 'Anguilla';
$countries['AI']['countrycode'] = '1';
$countries['AI']['exitcode'] = '011';
$countries['AI']['isocode'] = 'AI';
$countries['AG']['country'] = 'Antigua and Barbuda';
$countries['AG']['countrycode'] = '1';
$countries['AG']['exitcode'] = '011';
$countries['AG']['isocode'] = 'AG';
$countries['AR']['country'] = 'Argentina';
$countries['AR']['countrycode'] = '54';
$countries['AR']['exitcode'] = '00';
$countries['AR']['isocode'] = 'AR';
$countries['AM']['country'] = 'Armenia';
$countries['AM']['countrycode'] = '374';
$countries['AM']['exitcode'] = '00';
$countries['AM']['isocode'] = 'AM';
$countries['AW']['country'] = 'Aruba';
$countries['AW']['countrycode'] = '297';
$countries['AW']['exitcode'] = '00';
$countries['AW']['isocode'] = 'AW';
$countries['AC']['country'] = 'Ascension';
$countries['AC']['countrycode'] = '247';
$countries['AC']['exitcode'] = '00';
$countries['AC']['isocode'] = 'AC';
$countries['AU']['country'] = 'Australia';
$countries['AU']['countrycode'] = '61';
$countries['AU']['exitcode'] = '0011';
$countries['AU']['isocode'] = 'AU';
$countries['AT']['country'] = 'Austria';
$countries['AT']['countrycode'] = '43';
$countries['AT']['exitcode'] = '00';
$countries['AT']['isocode'] = 'AT';
$countries['AZ']['country'] = 'Azerbaijan';
$countries['AZ']['countrycode'] = '994';
$countries['AZ']['exitcode'] = '00';
$countries['AZ']['isocode'] = 'AZ';
$countries['BS']['country'] = 'Bahamas';
$countries['BS']['countrycode'] = '1';
$countries['BS']['exitcode'] = '011';
$countries['BS']['isocode'] = 'BS';
$countries['BH']['country'] = 'Bahrain';
$countries['BH']['countrycode'] = '973';
$countries['BH']['exitcode'] = '00';
$countries['BH']['isocode'] = 'BH';
$countries['BD']['country'] = 'Bangladesh';
$countries['BD']['countrycode'] = '880';
$countries['BD']['exitcode'] = '00';
$countries['BD']['isocode'] = 'BD';
$countries['BB']['country'] = 'Barbados';
$countries['BB']['countrycode'] = '1';
$countries['BB']['exitcode'] = '011';
$countries['BB']['isocode'] = 'BB';
$countries['BY']['country'] = 'Belarus';
$countries['BY']['countrycode'] = '375';
$countries['BY']['exitcode'] = '810';
$countries['BY']['isocode'] = 'BY';
$countries['BE']['country'] = 'Belgium';
$countries['BE']['countrycode'] = '32';
$countries['BE']['exitcode'] = '00';
$countries['BE']['isocode'] = 'BE';
$countries['BZ']['country'] = 'Belize';
$countries['BZ']['countrycode'] = '501';
$countries['BZ']['exitcode'] = '00';
$countries['BZ']['isocode'] = 'BZ';
$countries['BJ']['country'] = 'Benin';
$countries['BJ']['countrycode'] = '229';
$countries['BJ']['exitcode'] = '00';
$countries['BJ']['isocode'] = 'BJ';
$countries['BM']['country'] = 'Bermuda';
$countries['BM']['countrycode'] = '1';
$countries['BM']['exitcode'] = '011';
$countries['BM']['isocode'] = 'BM';
$countries['BT']['country'] = 'Bhutan';
$countries['BT']['countrycode'] = '975';
$countries['BT']['exitcode'] = '00';
$countries['BT']['isocode'] = 'BT';
$countries['BO']['country'] = 'Bolivia';
$countries['BO']['countrycode'] = '591';
$countries['BO']['exitcode'] = '00';
$countries['BO']['isocode'] = 'BO';
$countries['BA']['country'] = 'Bosnia and Herzegovina';
$countries['BA']['countrycode'] = '387';
$countries['BA']['exitcode'] = '00';
$countries['BA']['isocode'] = 'BA';
$countries['BW']['country'] = 'Botswana';
$countries['BW']['countrycode'] = '267';
$countries['BW']['exitcode'] = '00';
$countries['BW']['isocode'] = 'BW';
$countries['BR']['country'] = 'Brazil';
$countries['BR']['countrycode'] = '55';
$countries['BR']['exitcode'] = '0014';
$countries['BR']['isocode'] = 'BR';
$countries['VG']['country'] = 'British Virgin Islands';
$countries['VG']['countrycode'] = '1';
$countries['VG']['exitcode'] = '011';
$countries['VG']['isocode'] = 'VG';
$countries['BN']['country'] = 'Brunei';
$countries['BN']['countrycode'] = '673';
$countries['BN']['exitcode'] = '00';
$countries['BN']['isocode'] = 'BN';
$countries['BG']['country'] = 'Bulgaria';
$countries['BG']['countrycode'] = '359';
$countries['BG']['exitcode'] = '00';
$countries['BG']['isocode'] = 'BG';
$countries['BF']['country'] = 'Burkina Faso';
$countries['BF']['countrycode'] = '226';
$countries['BF']['exitcode'] = '00';
$countries['BF']['isocode'] = 'BF';
$countries['BI']['country'] = 'Burundi';
$countries['BI']['countrycode'] = '257';
$countries['BI']['exitcode'] = '00';
$countries['BI']['isocode'] = 'BI';
$countries['KH']['country'] = 'Cambodia';
$countries['KH']['countrycode'] = '855';
$countries['KH']['exitcode'] = '001, 007, 008';
$countries['KH']['isocode'] = 'KH';
$countries['CM']['country'] = 'Cameroon';
$countries['CM']['countrycode'] = '237';
$countries['CM']['exitcode'] = '00';
$countries['CM']['isocode'] = 'CM';
$countries['CA']['country'] = 'Canada';
$countries['CA']['countrycode'] = '1';
$countries['CA']['exitcode'] = '011';
$countries['CA']['isocode'] = 'CA';
$countries['CV']['country'] = 'Cape Verde';
$countries['CV']['countrycode'] = '238';
$countries['CV']['exitcode'] = '00';
$countries['CV']['isocode'] = 'CV';
$countries['KY']['country'] = 'Cayman Islands';
$countries['KY']['countrycode'] = '1';
$countries['KY']['exitcode'] = '011';
$countries['KY']['isocode'] = 'KY';
$countries['CF']['country'] = 'Central African Republic';
$countries['CF']['countrycode'] = '236';
$countries['CF']['exitcode'] = '00';
$countries['CF']['isocode'] = 'CF';
$countries['TD']['country'] = 'Chad';
$countries['TD']['countrycode'] = '235';
$countries['TD']['exitcode'] = '00';
$countries['TD']['isocode'] = 'TD';
$countries['CL']['country'] = 'Chile';
$countries['CL']['countrycode'] = '56';
$countries['CL']['exitcode'] = '1230';
$countries['CL']['isocode'] = 'CL';
$countries['CN']['country'] = 'China';
$countries['CN']['countrycode'] = '86';
$countries['CN']['exitcode'] = '00';
$countries['CN']['isocode'] = 'CN';
$countries['CO']['country'] = 'Colombia';
$countries['CO']['countrycode'] = '57';
$countries['CO']['exitcode'] = '005';
$countries['CO']['isocode'] = 'CO';
$countries['KM']['country'] = 'Comoros';
$countries['KM']['countrycode'] = '269';
$countries['KM']['exitcode'] = '00';
$countries['KM']['isocode'] = 'KM';
$countries['CD']['country'] = 'Congo';
$countries['CD']['countrycode'] = '242';
$countries['CD']['exitcode'] = '00';
$countries['CD']['isocode'] = 'CD';
$countries['CK']['country'] = 'Cook Islands';
$countries['CK']['countrycode'] = '682';
$countries['CK']['exitcode'] = '00';
$countries['CK']['isocode'] = 'CK';
$countries['CR']['country'] = 'Costa Rica';
$countries['CR']['countrycode'] = '506';
$countries['CR']['exitcode'] = '00';
$countries['CR']['isocode'] = 'CR';
$countries['HR']['country'] = 'Croatia';
$countries['HR']['countrycode'] = '385';
$countries['HR']['exitcode'] = '00';
$countries['HR']['isocode'] = 'HR';
$countries['CU']['country'] = 'Cuba';
$countries['CU']['countrycode'] = '53';
$countries['CU']['exitcode'] = '119';
$countries['CU']['isocode'] = 'CU';
$countries['CY']['country'] = 'Cyprus';
$countries['CY']['countrycode'] = '357';
$countries['CY']['exitcode'] = '00';
$countries['CY']['isocode'] = 'CY';
$countries['CZ']['country'] = 'Czech Republic';
$countries['CZ']['countrycode'] = '420';
$countries['CZ']['exitcode'] = '00';
$countries['CZ']['isocode'] = 'CZ';
$countries['CD']['country'] = 'Democratic Republic of Congo';
$countries['CD']['countrycode'] = '243';
$countries['CD']['exitcode'] = '00';
$countries['CD']['isocode'] = 'CD';
$countries['DK']['country'] = 'Denmark';
$countries['DK']['countrycode'] = '45';
$countries['DK']['exitcode'] = '00';
$countries['DK']['isocode'] = 'DK';
$countries['DJ']['country'] = 'Djibouti';
$countries['DJ']['countrycode'] = '253';
$countries['DJ']['exitcode'] = '00';
$countries['DJ']['isocode'] = 'DJ';
$countries['DM']['country'] = 'Dominica';
$countries['DM']['countrycode'] = '1';
$countries['DM']['exitcode'] = '011';
$countries['DM']['isocode'] = 'DM';
$countries['DO']['country'] = 'Dominican Republic';
$countries['DO']['countrycode'] = '1';
$countries['DO']['exitcode'] = '011';
$countries['DO']['isocode'] = 'DO';
$countries['TL']['country'] = 'East Timor';
$countries['TL']['countrycode'] = '670';
$countries['TL']['exitcode'] = '00';
$countries['TL']['isocode'] = 'TL';
$countries['EC']['country'] = 'Ecuador';
$countries['EC']['countrycode'] = '593';
$countries['EC']['exitcode'] = '00';
$countries['EC']['isocode'] = 'EC';
$countries['EG']['country'] = 'Egypt';
$countries['EG']['countrycode'] = '20';
$countries['EG']['exitcode'] = '00';
$countries['EG']['isocode'] = 'EG';
$countries['SV']['country'] = 'El Salvador';
$countries['SV']['countrycode'] = '503';
$countries['SV']['exitcode'] = '00';
$countries['SV']['isocode'] = 'SV';
$countries['GQ']['country'] = 'Equatorial Guinea';
$countries['GQ']['countrycode'] = '240';
$countries['GQ']['exitcode'] = '00';
$countries['GQ']['isocode'] = 'GQ';
$countries['ER']['country'] = 'Eritrea';
$countries['ER']['countrycode'] = '291';
$countries['ER']['exitcode'] = '00';
$countries['ER']['isocode'] = 'ER';
$countries['EE']['country'] = 'Estonia';
$countries['EE']['countrycode'] = '372';
$countries['EE']['exitcode'] = '00';
$countries['EE']['isocode'] = 'EE';
$countries['ET']['country'] = 'Ethiopia';
$countries['ET']['countrycode'] = '251';
$countries['ET']['exitcode'] = '00';
$countries['ET']['isocode'] = 'ET';
$countries['FK']['country'] = 'Falkland (Malvinas) Islands';
$countries['FK']['countrycode'] = '500';
$countries['FK']['exitcode'] = '00';
$countries['FK']['isocode'] = 'FK';
$countries['FO']['country'] = 'Faroe Islands';
$countries['FO']['countrycode'] = '298';
$countries['FO']['exitcode'] = '00';
$countries['FO']['isocode'] = 'FO';
$countries['FJ']['country'] = 'Fiji';
$countries['FJ']['countrycode'] = '679';
$countries['FJ']['exitcode'] = '00';
$countries['FJ']['isocode'] = 'FJ';
$countries['FI']['country'] = 'Finland';
$countries['FI']['countrycode'] = '358';
$countries['FI']['exitcode'] = '00, 990, 994, 999';
$countries['FI']['isocode'] = 'FI';
$countries['FR']['country'] = 'France';
$countries['FR']['countrycode'] = '33';
$countries['FR']['exitcode'] = '00';
$countries['FR']['isocode'] = 'FR';
$countries['GF']['country'] = 'French Guiana';
$countries['GF']['countrycode'] = '594';
$countries['GF']['exitcode'] = '00';
$countries['GF']['isocode'] = 'GF';
$countries['PF']['country'] = 'French Polynesia';
$countries['PF']['countrycode'] = '689';
$countries['PF']['exitcode'] = '00';
$countries['PF']['isocode'] = 'PF';
$countries['GA']['country'] = 'Gabon';
$countries['GA']['countrycode'] = '241';
$countries['GA']['exitcode'] = '00';
$countries['GA']['isocode'] = 'GA';
$countries['GM']['country'] = 'Gambia';
$countries['GM']['countrycode'] = '220';
$countries['GM']['exitcode'] = '00';
$countries['GM']['isocode'] = 'GM';
$countries['GE']['country'] = 'Georgia';
$countries['GE']['countrycode'] = '995';
$countries['GE']['exitcode'] = '00';
$countries['GE']['isocode'] = 'GE';
$countries['DE']['country'] = 'Germany';
$countries['DE']['countrycode'] = '49';
$countries['DE']['exitcode'] = '00';
$countries['DE']['isocode'] = 'DE';
$countries['GH']['country'] = 'Ghana';
$countries['GH']['countrycode'] = '233';
$countries['GH']['exitcode'] = '00';
$countries['GH']['isocode'] = 'GH';
$countries['GI']['country'] = 'Gibraltar';
$countries['GI']['countrycode'] = '350';
$countries['GI']['exitcode'] = '00';
$countries['GI']['isocode'] = 'GI';
$countries['GR']['country'] = 'Greece';
$countries['GR']['countrycode'] = '30';
$countries['GR']['exitcode'] = '00';
$countries['GR']['isocode'] = 'GR';
$countries['GL']['country'] = 'Greenland';
$countries['GL']['countrycode'] = '299';
$countries['GL']['exitcode'] = '00';
$countries['GL']['isocode'] = 'GL';
$countries['GD']['country'] = 'Grenada';
$countries['GD']['countrycode'] = '1';
$countries['GD']['exitcode'] = '011';
$countries['GD']['isocode'] = 'GD';
$countries['GP']['country'] = 'Guadeloupe';
$countries['GP']['countrycode'] = '590';
$countries['GP']['exitcode'] = '00';
$countries['GP']['isocode'] = 'GP';
$countries['GU']['country'] = 'Guam';
$countries['GU']['countrycode'] = '1';
$countries['GU']['exitcode'] = '011';
$countries['GU']['isocode'] = 'GU';
$countries['GT']['country'] = 'Guatemala';
$countries['GT']['countrycode'] = '502';
$countries['GT']['exitcode'] = '00';
$countries['GT']['isocode'] = 'GT';
$countries['GN']['country'] = 'Guinea';
$countries['GN']['countrycode'] = '224';
$countries['GN']['exitcode'] = '00';
$countries['GN']['isocode'] = 'GN';
$countries['GW']['country'] = 'Guinea-Bissau';
$countries['GW']['countrycode'] = '245';
$countries['GW']['exitcode'] = '00';
$countries['GW']['isocode'] = 'GW';
$countries['GY']['country'] = 'Guyana';
$countries['GY']['countrycode'] = '592';
$countries['GY']['exitcode'] = '001';
$countries['GY']['isocode'] = 'GY';
$countries['HT']['country'] = 'Haiti';
$countries['HT']['countrycode'] = '509';
$countries['HT']['exitcode'] = '00';
$countries['HT']['isocode'] = 'HT';
$countries['HN']['country'] = 'Honduras';
$countries['HN']['countrycode'] = '504';
$countries['HN']['exitcode'] = '00';
$countries['HN']['isocode'] = 'HN';
$countries['HK']['country'] = 'Hong Kong';
$countries['HK']['countrycode'] = '852';
$countries['HK']['exitcode'] = '001';
$countries['HK']['isocode'] = 'HK';
$countries['HU']['country'] = 'Hungary';
$countries['HU']['countrycode'] = '36';
$countries['HU']['exitcode'] = '00';
$countries['HU']['isocode'] = 'HU';
$countries['IS']['country'] = 'Iceland';
$countries['IS']['countrycode'] = '354';
$countries['IS']['exitcode'] = '00';
$countries['IS']['isocode'] = 'IS';
$countries['IN']['country'] = 'India';
$countries['IN']['countrycode'] = '91';
$countries['IN']['exitcode'] = '00';
$countries['IN']['isocode'] = 'IN';
$countries['ID']['country'] = 'Indonesia';
$countries['ID']['countrycode'] = '62';
$countries['ID']['exitcode'] = '001';
$countries['ID']['isocode'] = 'ID';
$countries['IR']['country'] = 'Iran';
$countries['IR']['countrycode'] = '98';
$countries['IR']['exitcode'] = '00';
$countries['IR']['isocode'] = 'IR';
$countries['IQ']['country'] = 'Iraq';
$countries['IQ']['countrycode'] = '964';
$countries['IQ']['exitcode'] = '00';
$countries['IQ']['isocode'] = 'IQ';
$countries['IE']['country'] = 'Ireland';
$countries['IE']['countrycode'] = '353';
$countries['IE']['exitcode'] = '00';
$countries['IE']['isocode'] = 'IE';
$countries['IL']['country'] = 'Israel';
$countries['IL']['countrycode'] = '972';
$countries['IL']['exitcode'] = '00, 012, 013, 014, 018';
$countries['IL']['isocode'] = 'IL';
$countries['IT']['country'] = 'Italy';
$countries['IT']['countrycode'] = '39';
$countries['IT']['exitcode'] = '00';
$countries['IT']['isocode'] = 'IT';
$countries['CI']['country'] = 'Ivory Coast';
$countries['CI']['countrycode'] = '225';
$countries['CI']['exitcode'] = '00';
$countries['CI']['isocode'] = 'CI';
$countries['JM']['country'] = 'Jamaica';
$countries['JM']['countrycode'] = '1';
$countries['JM']['exitcode'] = '011';
$countries['JM']['isocode'] = 'JM';
$countries['JP']['country'] = 'Japan';
$countries['JP']['countrycode'] = '81';
$countries['JP']['exitcode'] = '010';
$countries['JP']['isocode'] = 'JP';
$countries['JO']['country'] = 'Jordan';
$countries['JO']['countrycode'] = '962';
$countries['JO']['exitcode'] = '00';
$countries['JO']['isocode'] = 'JO';
$countries['KZ']['country'] = 'Kazakhstan';
$countries['KZ']['countrycode'] = '7';
$countries['KZ']['exitcode'] = '810';
$countries['KZ']['isocode'] = 'KZ';
$countries['KE']['country'] = 'Kenya';
$countries['KE']['countrycode'] = '254';
$countries['KE']['exitcode'] = '000';
$countries['KE']['isocode'] = 'KE';
$countries['KI']['country'] = 'Kiribati';
$countries['KI']['countrycode'] = '686';
$countries['KI']['exitcode'] = '00';
$countries['KI']['isocode'] = 'KI';
$countries['KW']['country'] = 'Kuwait';
$countries['KW']['countrycode'] = '965';
$countries['KW']['exitcode'] = '00';
$countries['KW']['isocode'] = 'KW';
$countries['KG']['country'] = 'Kyrgyzstan';
$countries['KG']['countrycode'] = '996';
$countries['KG']['exitcode'] = '00';
$countries['KG']['isocode'] = 'KG';
$countries['LA']['country'] = 'Laos';
$countries['LA']['countrycode'] = '856';
$countries['LA']['exitcode'] = '00';
$countries['LA']['isocode'] = 'LA';
$countries['LV']['country'] = 'Latvia';
$countries['LV']['countrycode'] = '371';
$countries['LV']['exitcode'] = '00';
$countries['LV']['isocode'] = 'LV';
$countries['LB']['country'] = 'Lebanon';
$countries['LB']['countrycode'] = '961';
$countries['LB']['exitcode'] = '00';
$countries['LB']['isocode'] = 'LB';
$countries['LS']['country'] = 'Lesotho';
$countries['LS']['countrycode'] = '266';
$countries['LS']['exitcode'] = '00';
$countries['LS']['isocode'] = 'LS';
$countries['LR']['country'] = 'Liberia';
$countries['LR']['countrycode'] = '231';
$countries['LR']['exitcode'] = '00';
$countries['LR']['isocode'] = 'LR';
$countries['LY']['country'] = 'Libya';
$countries['LY']['countrycode'] = '218';
$countries['LY']['exitcode'] = '00';
$countries['LY']['isocode'] = 'LY';
$countries['LI']['country'] = 'Liechtenstein';
$countries['LI']['countrycode'] = '423';
$countries['LI']['exitcode'] = '00';
$countries['LI']['isocode'] = 'LI';
$countries['LT']['country'] = 'Lithuania';
$countries['LT']['countrycode'] = '370';
$countries['LT']['exitcode'] = '00';
$countries['LT']['isocode'] = 'LT';
$countries['LU']['country'] = 'Luxembourg';
$countries['LU']['countrycode'] = '352';
$countries['LU']['exitcode'] = '00';
$countries['LU']['isocode'] = 'LU';
$countries['MO']['country'] = 'Macau';
$countries['MO']['countrycode'] = '853';
$countries['MO']['exitcode'] = '00';
$countries['MO']['isocode'] = 'MO';
$countries['MK']['country'] = 'Macedonia';
$countries['MK']['countrycode'] = '389';
$countries['MK']['exitcode'] = '00';
$countries['MK']['isocode'] = 'MK';
$countries['MG']['country'] = 'Madagascar';
$countries['MG']['countrycode'] = '261';
$countries['MG']['exitcode'] = '00';
$countries['MG']['isocode'] = 'MG';
$countries['MW']['country'] = 'Malawi';
$countries['MW']['countrycode'] = '265';
$countries['MW']['exitcode'] = '00';
$countries['MW']['isocode'] = 'MW';
$countries['MY']['country'] = 'Malaysia';
$countries['MY']['countrycode'] = '60';
$countries['MY']['exitcode'] = '00';
$countries['MY']['isocode'] = 'MY';
$countries['MV']['country'] = 'Maldives';
$countries['MV']['countrycode'] = '960';
$countries['MV']['exitcode'] = '00';
$countries['MV']['isocode'] = 'MV';
$countries['ML']['country'] = 'Mali';
$countries['ML']['countrycode'] = '223';
$countries['ML']['exitcode'] = '00';
$countries['ML']['isocode'] = 'ML';
$countries['MT']['country'] = 'Malta';
$countries['MT']['countrycode'] = '356';
$countries['MT']['exitcode'] = '00';
$countries['MT']['isocode'] = 'MT';
$countries['MH']['country'] = 'Marshall Islands';
$countries['MH']['countrycode'] = '692';
$countries['MH']['exitcode'] = '011';
$countries['MH']['isocode'] = 'MH';
$countries['MQ']['country'] = 'Martinique';
$countries['MQ']['countrycode'] = '596';
$countries['MQ']['exitcode'] = '00';
$countries['MQ']['isocode'] = 'MQ';
$countries['MR']['country'] = 'Mauritania';
$countries['MR']['countrycode'] = '222';
$countries['MR']['exitcode'] = '00';
$countries['MR']['isocode'] = 'MR';
$countries['MU']['country'] = 'Mauritius';
$countries['MU']['countrycode'] = '230';
$countries['MU']['exitcode'] = '00';
$countries['MU']['isocode'] = 'MU';
$countries['YT']['country'] = 'Mayotte';
$countries['YT']['countrycode'] = '262';
$countries['YT']['exitcode'] = '00';
$countries['YT']['isocode'] = 'YT';
$countries['MX']['country'] = 'Mexico';
$countries['MX']['countrycode'] = '52';
$countries['MX']['exitcode'] = '00';
$countries['MX']['isocode'] = 'MX';
$countries['FM']['country'] = 'Micronesia';
$countries['FM']['countrycode'] = '691';
$countries['FM']['exitcode'] = '011';
$countries['FM']['isocode'] = 'FM';
$countries['MD']['country'] = 'Moldova';
$countries['MD']['countrycode'] = '373';
$countries['MD']['exitcode'] = '00';
$countries['MD']['isocode'] = 'MD';
$countries['MC']['country'] = 'Monaco';
$countries['MC']['countrycode'] = '377';
$countries['MC']['exitcode'] = '00';
$countries['MC']['isocode'] = 'MC';
$countries['MN']['country'] = 'Mongolia';
$countries['MN']['countrycode'] = '976';
$countries['MN']['exitcode'] = '001';
$countries['MN']['isocode'] = 'MN';
$countries['ME']['country'] = 'Montenegro';
$countries['ME']['countrycode'] = '382';
$countries['ME']['exitcode'] = '00';
$countries['ME']['isocode'] = 'ME';
$countries['MS']['country'] = 'Montserrat';
$countries['MS']['countrycode'] = '1';
$countries['MS']['exitcode'] = '011';
$countries['MS']['isocode'] = 'MS';
$countries['MA']['country'] = 'Morocco';
$countries['MA']['countrycode'] = '212';
$countries['MA']['exitcode'] = '00';
$countries['MA']['isocode'] = 'MA';
$countries['MZ']['country'] = 'Mozambique';
$countries['MZ']['countrycode'] = '258';
$countries['MZ']['exitcode'] = '00';
$countries['MZ']['isocode'] = 'MZ';
$countries['MM']['country'] = 'Myanmar';
$countries['MM']['countrycode'] = '95';
$countries['MM']['exitcode'] = '00';
$countries['MM']['isocode'] = 'MM';
$countries['NA']['country'] = 'Namibia';
$countries['NA']['countrycode'] = '264';
$countries['NA']['exitcode'] = '00';
$countries['NA']['isocode'] = 'NA';
$countries['NR']['country'] = 'Nauru';
$countries['NR']['countrycode'] = '674';
$countries['NR']['exitcode'] = '00';
$countries['NR']['isocode'] = 'NR';
$countries['NP']['country'] = 'Nepal';
$countries['NP']['countrycode'] = '977';
$countries['NP']['exitcode'] = '00';
$countries['NP']['isocode'] = 'NP';
$countries['NL']['country'] = 'Netherlands';
$countries['NL']['countrycode'] = '31';
$countries['NL']['exitcode'] = '00';
$countries['NL']['isocode'] = 'NL';
$countries['AN']['country'] = 'Netherlands Antilles';
$countries['AN']['countrycode'] = '599';
$countries['AN']['exitcode'] = '00';
$countries['AN']['isocode'] = 'AN';
$countries['NC']['country'] = 'New Caledonia';
$countries['NC']['countrycode'] = '687';
$countries['NC']['exitcode'] = '00';
$countries['NC']['isocode'] = 'NC';
$countries['NZ']['country'] = 'New Zealand';
$countries['NZ']['countrycode'] = '64';
$countries['NZ']['exitcode'] = '00';
$countries['NZ']['isocode'] = 'NZ';
$countries['NI']['country'] = 'Nicaragua';
$countries['NI']['countrycode'] = '505';
$countries['NI']['exitcode'] = '00';
$countries['NI']['isocode'] = 'NI';
$countries['NE']['country'] = 'Niger';
$countries['NE']['countrycode'] = '227';
$countries['NE']['exitcode'] = '00';
$countries['NE']['isocode'] = 'NE';
$countries['NG']['country'] = 'Nigeria';
$countries['NG']['countrycode'] = '234';
$countries['NG']['exitcode'] = '009';
$countries['NG']['isocode'] = 'NG';
$countries['NU']['country'] = 'Niue';
$countries['NU']['countrycode'] = '683';
$countries['NU']['exitcode'] = '00';
$countries['NU']['isocode'] = 'NU';
$countries['NF']['country'] = 'Norfolk Island';
$countries['NF']['countrycode'] = '6723';
$countries['NF']['exitcode'] = '00';
$countries['NF']['isocode'] = 'NF';
$countries['KP']['country'] = 'North Korea';
$countries['KP']['countrycode'] = '850';
$countries['KP']['exitcode'] = '99';
$countries['KP']['isocode'] = 'KP';
$countries['NO']['country'] = 'Norway';
$countries['NO']['countrycode'] = '47';
$countries['NO']['exitcode'] = '00';
$countries['NO']['isocode'] = 'NO';
$countries['OM']['country'] = 'Oman';
$countries['OM']['countrycode'] = '968';
$countries['OM']['exitcode'] = '00';
$countries['OM']['isocode'] = 'OM';
$countries['PK']['country'] = 'Pakistan';
$countries['PK']['countrycode'] = '92';
$countries['PK']['exitcode'] = '00';
$countries['PK']['isocode'] = 'PK';
$countries['PW']['country'] = 'Palau';
$countries['PW']['countrycode'] = '680';
$countries['PW']['exitcode'] = '011';
$countries['PW']['isocode'] = 'PW';
$countries['PA']['country'] = 'Panama';
$countries['PA']['countrycode'] = '507';
$countries['PA']['exitcode'] = '00';
$countries['PA']['isocode'] = 'PA';
$countries['PG']['country'] = 'Papua New Guinea';
$countries['PG']['countrycode'] = '675';
$countries['PG']['exitcode'] = '00';
$countries['PG']['isocode'] = 'PG';
$countries['PY']['country'] = 'Paraguay';
$countries['PY']['countrycode'] = '595';
$countries['PY']['exitcode'] = '00';
$countries['PY']['isocode'] = 'PY';
$countries['PE']['country'] = 'Peru';
$countries['PE']['countrycode'] = '51';
$countries['PE']['exitcode'] = '00';
$countries['PE']['isocode'] = 'PE';
$countries['PH']['country'] = 'Philippines';
$countries['PH']['countrycode'] = '63';
$countries['PH']['exitcode'] = '00';
$countries['PH']['isocode'] = 'PH';
$countries['PL']['country'] = 'Poland';
$countries['PL']['countrycode'] = '48';
$countries['PL']['exitcode'] = '00';
$countries['PL']['isocode'] = 'PL';
$countries['PT']['country'] = 'Portugal';
$countries['PT']['countrycode'] = '351';
$countries['PT']['exitcode'] = '00';
$countries['PT']['isocode'] = 'PT';
$countries['PR']['country'] = 'Puerto Rico';
$countries['PR']['countrycode'] = '1';
$countries['PR']['exitcode'] = '011';
$countries['PR']['isocode'] = 'PR';
$countries['QA']['country'] = 'Qatar';
$countries['QA']['countrycode'] = '974';
$countries['QA']['exitcode'] = '00';
$countries['QA']['isocode'] = 'QA';
$countries['RE']['country'] = 'Reunion';
$countries['RE']['countrycode'] = '262';
$countries['RE']['exitcode'] = '00';
$countries['RE']['isocode'] = 'RE';
$countries['RO']['country'] = 'Romania';
$countries['RO']['countrycode'] = '40';
$countries['RO']['exitcode'] = '00';
$countries['RO']['isocode'] = 'RO';
$countries['RU']['country'] = 'Russian Federation';
$countries['RU']['countrycode'] = '7';
$countries['RU']['exitcode'] = '810';
$countries['RU']['isocode'] = 'RU';
$countries['RW']['country'] = 'Rwanda';
$countries['RW']['countrycode'] = '250';
$countries['RW']['exitcode'] = '00';
$countries['RW']['isocode'] = 'RW';
$countries['SH']['country'] = 'Saint Helena';
$countries['SH']['countrycode'] = '290';
$countries['SH']['exitcode'] = '00';
$countries['SH']['isocode'] = 'SH';
$countries['KN']['country'] = 'Saint Kitts and Nevis';
$countries['KN']['countrycode'] = '1';
$countries['KN']['exitcode'] = '011';
$countries['KN']['isocode'] = 'KN';
$countries['LC']['country'] = 'Saint Lucia';
$countries['LC']['countrycode'] = '1';
$countries['LC']['exitcode'] = '011';
$countries['LC']['isocode'] = 'LC';
$countries['GP']['country'] = 'Saint Barthelemy';
$countries['GP']['countrycode'] = '590';
$countries['GP']['exitcode'] = '00';
$countries['GP']['isocode'] = 'GP';
$countries['PM']['country'] = 'Saint Pierre and Miquelon';
$countries['PM']['countrycode'] = '508';
$countries['PM']['exitcode'] = '00';
$countries['PM']['isocode'] = 'PM';
$countries['VC']['country'] = 'Saint Vincent and the Grenadines';
$countries['VC']['countrycode'] = '1';
$countries['VC']['exitcode'] = '011';
$countries['VC']['isocode'] = 'VC';
$countries['WS']['country'] = 'Samoa';
$countries['WS']['countrycode'] = '685';
$countries['WS']['exitcode'] = '0';
$countries['WS']['isocode'] = 'WS';
$countries['SM']['country'] = 'San Marino';
$countries['SM']['countrycode'] = '378';
$countries['SM']['exitcode'] = '00';
$countries['SM']['isocode'] = 'SM';
$countries['ST']['country'] = 'Sao Tome and Principe';
$countries['ST']['countrycode'] = '239';
$countries['ST']['exitcode'] = '00';
$countries['ST']['isocode'] = 'ST';
$countries['SA']['country'] = 'Saudi Arabia';
$countries['SA']['countrycode'] = '966';
$countries['SA']['exitcode'] = '00';
$countries['SA']['isocode'] = 'SA';
$countries['SN']['country'] = 'Senegal';
$countries['SN']['countrycode'] = '221';
$countries['SN']['exitcode'] = '00';
$countries['SN']['isocode'] = 'SN';
$countries['RS']['country'] = 'Serbia';
$countries['RS']['countrycode'] = '381';
$countries['RS']['exitcode'] = '00';
$countries['RS']['isocode'] = 'RS';
$countries['SC']['country'] = 'Seychelles';
$countries['SC']['countrycode'] = '248';
$countries['SC']['exitcode'] = '00';
$countries['SC']['isocode'] = 'SC';
$countries['SL']['country'] = 'Sierra Leone';
$countries['SL']['countrycode'] = '232';
$countries['SL']['exitcode'] = '00';
$countries['SL']['isocode'] = 'SL';
$countries['SG']['country'] = 'Singapore';
$countries['SG']['countrycode'] = '65';
$countries['SG']['exitcode'] = '001, 008';
$countries['SG']['isocode'] = 'SG';
$countries['SK']['country'] = 'Slovakia';
$countries['SK']['countrycode'] = '421';
$countries['SK']['exitcode'] = '00';
$countries['SK']['isocode'] = 'SK';
$countries['SI']['country'] = 'Slovenia';
$countries['SI']['countrycode'] = '386';
$countries['SI']['exitcode'] = '00';
$countries['SI']['isocode'] = 'SI';
$countries['SB']['country'] = 'Solomon Islands';
$countries['SB']['countrycode'] = '677';
$countries['SB']['exitcode'] = '00';
$countries['SB']['isocode'] = 'SB';
$countries['SO']['country'] = 'Somalia';
$countries['SO']['countrycode'] = '252';
$countries['SO']['exitcode'] = '00';
$countries['SO']['isocode'] = 'SO';
$countries['ZA']['country'] = 'South Africa';
$countries['ZA']['countrycode'] = '27';
$countries['ZA']['exitcode'] = '00';
$countries['ZA']['isocode'] = 'ZA';
$countries['KR']['country'] = 'South Korea';
$countries['KR']['countrycode'] = '82';
$countries['KR']['exitcode'] = '001, 002';
$countries['KR']['isocode'] = 'KR';
$countries['ES']['country'] = 'Spain';
$countries['ES']['countrycode'] = '34';
$countries['ES']['exitcode'] = '00';
$countries['ES']['isocode'] = 'ES';
$countries['LK']['country'] = 'Sri Lanka';
$countries['LK']['countrycode'] = '94';
$countries['LK']['exitcode'] = '00';
$countries['LK']['isocode'] = 'LK';
$countries['SD']['country'] = 'Sudan';
$countries['SD']['countrycode'] = '249';
$countries['SD']['exitcode'] = '00';
$countries['SD']['isocode'] = 'SD';
$countries['SR']['country'] = 'Suriname';
$countries['SR']['countrycode'] = '597';
$countries['SR']['exitcode'] = '00';
$countries['SR']['isocode'] = 'SR';
$countries['SZ']['country'] = 'Swaziland';
$countries['SZ']['countrycode'] = '268';
$countries['SZ']['exitcode'] = '00';
$countries['SZ']['isocode'] = 'SZ';
$countries['SE']['country'] = 'Sweden';
$countries['SE']['countrycode'] = '46';
$countries['SE']['exitcode'] = '00';
$countries['SE']['isocode'] = 'SE';
$countries['CH']['country'] = 'Switzerland';
$countries['CH']['countrycode'] = '41';
$countries['CH']['exitcode'] = '00';
$countries['CH']['isocode'] = 'CH';
$countries['SY']['country'] = 'Syria';
$countries['SY']['countrycode'] = '963';
$countries['SY']['exitcode'] = '00';
$countries['SY']['isocode'] = 'SY';
$countries['TW']['country'] = 'Taiwan';
$countries['TW']['countrycode'] = '886';
$countries['TW']['exitcode'] = '002';
$countries['TW']['isocode'] = 'TW';
$countries['TJ']['country'] = 'Tajikistan';
$countries['TJ']['countrycode'] = '992';
$countries['TJ']['exitcode'] = '810';
$countries['TJ']['isocode'] = 'TJ';
$countries['TZ']['country'] = 'Tanzania';
$countries['TZ']['countrycode'] = '255';
$countries['TZ']['exitcode'] = '000';
$countries['TZ']['isocode'] = 'TZ';
$countries['TH']['country'] = 'Thailand';
$countries['TH']['countrycode'] = '66';
$countries['TH']['exitcode'] = '001';
$countries['TH']['isocode'] = 'TH';
$countries['TG']['country'] = 'Togo';
$countries['TG']['countrycode'] = '228';
$countries['TG']['exitcode'] = '00';
$countries['TG']['isocode'] = 'TG';
$countries['TK']['country'] = 'Tokelau';
$countries['TK']['countrycode'] = '690';
$countries['TK']['exitcode'] = '00';
$countries['TK']['isocode'] = 'TK';
$countries['TO']['country'] = 'Tonga';
$countries['TO']['countrycode'] = '676';
$countries['TO']['exitcode'] = '00';
$countries['TO']['isocode'] = 'TO';
$countries['TT']['country'] = 'Trinidad and Tobago';
$countries['TT']['countrycode'] = '1';
$countries['TT']['exitcode'] = '011';
$countries['TT']['isocode'] = 'TT';
$countries['TN']['country'] = 'Tunisia';
$countries['TN']['countrycode'] = '216';
$countries['TN']['exitcode'] = '00';
$countries['TN']['isocode'] = 'TN';
$countries['TR']['country'] = 'Turkey';
$countries['TR']['countrycode'] = '90';
$countries['TR']['exitcode'] = '00';
$countries['TR']['isocode'] = 'TR';
$countries['TM']['country'] = 'Turkmenistan';
$countries['TM']['countrycode'] = '993';
$countries['TM']['exitcode'] = '810';
$countries['TM']['isocode'] = 'TM';
$countries['TC']['country'] = 'Turks and Caicos Islands';
$countries['TC']['countrycode'] = '1';
$countries['TC']['exitcode'] = '0';
$countries['TC']['isocode'] = 'TC';
$countries['TV']['country'] = 'Tuvalu';
$countries['TV']['countrycode'] = '688';
$countries['TV']['exitcode'] = '00';
$countries['TV']['isocode'] = 'TV';
$countries['UG']['country'] = 'Uganda';
$countries['UG']['countrycode'] = '256';
$countries['UG']['exitcode'] = '000';
$countries['UG']['isocode'] = 'UG';
$countries['UA']['country'] = 'Ukraine';
$countries['UA']['countrycode'] = '380';
$countries['UA']['exitcode'] = '00';
$countries['UA']['isocode'] = 'UA';
$countries['AE']['country'] = 'United Arab Emirates';
$countries['AE']['countrycode'] = '971';
$countries['AE']['exitcode'] = '00';
$countries['AE']['isocode'] = 'AE';
$countries['GB']['country'] = 'United Kingdom';
$countries['GB']['countrycode'] = '44';
$countries['GB']['exitcode'] = '00';
$countries['GB']['isocode'] = 'GB';
$countries['US']['country'] = 'United States';
$countries['US']['countrycode'] = '1';
$countries['US']['exitcode'] = '011';
$countries['US']['isocode'] = 'US';
$countries['VI']['country'] = 'U.S. Virgin Islands';
$countries['VI']['countrycode'] = '1';
$countries['VI']['exitcode'] = '011';
$countries['VI']['isocode'] = 'VI';
$countries['UY']['country'] = 'Uruguay';
$countries['UY']['countrycode'] = '598';
$countries['UY']['exitcode'] = '00';
$countries['UY']['isocode'] = 'UY';
$countries['UZ']['country'] = 'Uzbekistan';
$countries['UZ']['countrycode'] = '998';
$countries['UZ']['exitcode'] = '8 - wait for dial tone - 10';
$countries['UZ']['isocode'] = 'UZ';
$countries['VU']['country'] = 'Vanuatu';
$countries['VU']['countrycode'] = '678';
$countries['VU']['exitcode'] = '00';
$countries['VU']['isocode'] = 'VU';
$countries['VA']['country'] = 'Vatican City';
$countries['VA']['countrycode'] = '379, 39';
$countries['VA']['exitcode'] = '00';
$countries['VA']['isocode'] = 'VA';
$countries['VE']['country'] = 'Venezuela';
$countries['VE']['countrycode'] = '58';
$countries['VE']['exitcode'] = '00';
$countries['VE']['isocode'] = 'VE';
$countries['VN']['country'] = 'Vietnam';
$countries['VN']['countrycode'] = '84';
$countries['VN']['exitcode'] = '00';
$countries['VN']['isocode'] = 'VN';
$countries['WF']['country'] = 'Wallis and Futuna';
$countries['WF']['countrycode'] = '681';
$countries['WF']['exitcode'] = '00';
$countries['WF']['isocode'] = 'WF';
$countries['YE']['country'] = 'Yemen';
$countries['YE']['countrycode'] = '967';
$countries['YE']['exitcode'] = '00';
$countries['YE']['isocode'] = 'YE';
$countries['ZM']['country'] = 'Zambia';
$countries['ZM']['countrycode'] = '260';
$countries['ZM']['exitcode'] = '00';
$countries['ZM']['isocode'] = 'ZM';
$countries['ZW']['country'] = 'Zimbabwe';
$countries['ZW']['countrycode'] = '263';
$countries['ZW']['exitcode'] = '00';
$countries['ZW']['isocode'] = 'ZW';
?>

View File

@ -0,0 +1,94 @@
<profile name="external-ipv6">
<!-- http://wiki.freeswitch.org/wiki/Sofia_Configuration_Files -->
<!-- This profile is only for outbound registrations to providers -->
<aliases>
<!--
<alias name="outbound"/>
<alias name="nat"/>
-->
</aliases>
<domains>
<domain name="all" alias="false" parse="true"/>
</domains>
<settings>
<param name="debug" value="0"/>
<!-- If you want FreeSWITCH to shutdown if this profile fails to load, uncomment the next line. -->
<param name="shutdown-on-fail" value="true" enabled="false"/>
<param name="sip-trace" value="no"/>
<param name="sip-capture" value="no"/>
<param name="rfc2833-pt" value="101"/>
<!-- RFC 5626 : Send reg-id and sip.instance -->
<param name="enable-rfc-5626" value="true" enabled="false"/>
<param name="sip-port" value="$${external_sip_port}"/>
<param name="dialplan" value="XML"/>
<param name="context" value="public"/>
<param name="dtmf-duration" value="2000"/>
<param name="inbound-codec-prefs" value="$${global_codec_prefs}"/>
<param name="outbound-codec-prefs" value="$${outbound_codec_prefs}"/>
<param name="hold-music" value="$${hold_music}"/>
<param name="zrtp-passthru" value="true"/>
<param name="rtp-timer-name" value="soft"/>
<param name="enable-100rel" value="true" enabled="false"/>
<param name="disable-srv503" value="true" enabled="false"/>
<!-- This could be set to "passive" -->
<param name="local-network-acl" value="localnet.auto"/>
<param name="manage-presence" value="false"/>
<!-- used to share presence info across sofia profiles
manage-presence needs to be set to passive on this profile
if you want it to behave as if it were the internal profile
for presence.
-->
<!-- Name of the db to use for this profile -->
<param name="dbname" value="share_presence" enabled="false"/>
<param name="presence-hosts" value="$${domain}" enabled="false"/>
<param name="force-register-domain" value="$${domain}" enabled="false"/>
<!--all inbound reg will stored in the db using this domain -->
<param name="force-register-db-domain" value="$${domain}" enabled="false"/>
<!-- ************************************************* -->
<!--<param name="aggressive-nat-detection" value="true"/>-->
<param name="inbound-codec-negotiation" value="generous"/>
<param name="nonce-ttl" value="60"/>
<param name="auth-calls" value="false"/>
<!-- ip address to use for rtp, DO NOT USE HOSTNAMES ONLY IP ADDRESSES -->
<param name="rtp-ip" value="$${local_ip_v6}"/>
<!-- ip address to bind to, DO NOT USE HOSTNAMES ONLY IP ADDRESSES -->
<param name="sip-ip" value="$${local_ip_v6}"/>
<param name="ext-rtp-ip" value="$${external_rtp_ip}"/>
<param name="ext-sip-ip" value="$${external_sip_ip}"/>
<param name="rtp-timeout-sec" value="300"/>
<param name="rtp-hold-timeout-sec" value="1800"/>
<!--<param name="enable-3pcc" value="true"/>-->
<!-- TLS: disabled by default, set to "true" to enable -->
<param name="tls" value="$${external_ssl_enable}"/>
<!-- Set to true to not bind on the normal sip-port but only on the TLS port -->
<param name="tls-only" value="false"/>
<!-- additional bind parameters for TLS -->
<param name="tls-bind-params" value="transport=tls"/>
<!-- Port to listen on for TLS requests. (5081 will be used if unspecified) -->
<param name="tls-sip-port" value="$${external_tls_port}"/>
<!-- Location of the agent.pem and cafile.pem ssl certificates (needed for TLS server) -->
<param name="tls-cert-dir" value="$${external_ssl_dir}"/>
<!-- Optionally set the passphrase password used by openSSL to encrypt/decrypt TLS private key files -->
<param name="tls-passphrase" value=""/>
<!-- Verify the date on TLS certificates -->
<param name="tls-verify-date" value="true"/>
<!-- TLS verify policy, when registering/inviting gateways with other servers (outbound) or handling inbound registration/invite requests how should we verify their certificate -->
<!-- set to 'in' to only verify incoming connections, 'out' to only verify outgoing connections, 'all' to verify all connections, also 'in_subjects', 'out_subjects' and 'all_subjects' for subject validation. Multiple policies can be split with a '|' pipe -->
<param name="tls-verify-policy" value="none"/>
<!-- Certificate max verify depth to use for validating peer TLS certificates when the verify policy is not none -->
<param name="tls-verify-depth" value="2"/>
<!-- If the tls-verify-policy is set to subjects_all or subjects_in this sets which subjects are allowed, multiple subjects can be split with a '|' pipe -->
<param name="tls-verify-in-subjects" value=""/>
<!-- TLS version ("sslv23" (default), "tlsv1"). NOTE: Phones may not work with TLSv1 -->
<param name="tls-version" value="$${sip_tls_version}"/>
<!--If you have ODBC support and a working dsn you can use it instead of SQLite-->
<param name="odbc-dsn" value="$${dsn}" enabled="false"/>
</settings>
</profile>

View File

@ -26,8 +26,45 @@ network.pc_port.speed_duplex =
network.pc_port.dhcp_server = 1
network.static_dns_enable = 1
{if isset($vlan_port_id) }
#######################################################################################
## VLAN ##
## VLAN ENABLED ##
#######################################################################################
network.vlan.internet_port_enable = 1
#Configure the VLAN ID, it ranges from 1 to 4094, the default value is 1.
#Require reboot;
network.vlan.internet_port_vid = {$vlan_port_id}
#Configure the VLAN priority, it ranges from 0 (default) to 7.
#Require reboot;
network.vlan.internet_port_priority =
#Enable or disable the VLAN of PC port; 0-Disabled (default), 1-Enabled;
#Require reboot;
network.vlan.pc_port_enable = 1
#Configure the VLAN ID, it ranges from 1 to 4094, the default value is 1.
#Require reboot;
network.vlan.pc_port_vid = {$vlan_pc_port_id}
#Configure the VLAN priority, it ranges from 0 (default) to 7.
#Require reboot;
network.vlan.pc_port_priority =
#Enable or disable the DHCP to obtain the information of the VLAN; 0-Disabled; 1-Enabled (default);
#Require reboot;
network.vlan.dhcp_enable =
#Configure the DHCP option to obtain the information of the VLAN. It ranges from 0 to 255.
#Multiple options separated by a comma. It supports up to 5 options in all.
#Require reboot;
network.vlan.dhcp_option =
{else}
#######################################################################################
## VLAN DISABLED ##
#######################################################################################
network.vlan.internet_port_enable = 0
@ -60,6 +97,9 @@ network.vlan.dhcp_enable =
#Require reboot;
network.vlan.dhcp_option =
{/if}
#######################################################################################
## WEB Port ##
#######################################################################################

View File

@ -26,8 +26,45 @@ network.pc_port.speed_duplex =
network.pc_port.dhcp_server = 1
network.static_dns_enable = 0
{if isset($vlan_port_id) }
#######################################################################################
## VLAN ##
## VLAN ENABLED ##
#######################################################################################
network.vlan.internet_port_enable = 1
#Configure the VLAN ID, it ranges from 1 to 4094, the default value is 1.
#Require reboot;
network.vlan.internet_port_vid = {$vlan_port_id}
#Configure the VLAN priority, it ranges from 0 (default) to 7.
#Require reboot;
network.vlan.internet_port_priority =
#Enable or disable the VLAN of PC port; 0-Disabled (default), 1-Enabled;
#Require reboot;
network.vlan.pc_port_enable = 1
#Configure the VLAN ID, it ranges from 1 to 4094, the default value is 1.
#Require reboot;
network.vlan.pc_port_vid = {$vlan_pc_port_id}
#Configure the VLAN priority, it ranges from 0 (default) to 7.
#Require reboot;
network.vlan.pc_port_priority =
#Enable or disable the DHCP to obtain the information of the VLAN; 0-Disabled; 1-Enabled (default);
#Require reboot;
network.vlan.dhcp_enable =
#Configure the DHCP option to obtain the information of the VLAN. It ranges from 0 to 255.
#Multiple options separated by a comma. It supports up to 5 options in all.
#Require reboot;
network.vlan.dhcp_option =
{else}
#######################################################################################
## VLAN DISABLED ##
#######################################################################################
network.vlan.internet_port_enable = 0
@ -60,6 +97,9 @@ network.vlan.dhcp_enable =
#Require reboot;
network.vlan.dhcp_option =
{/if}
#######################################################################################
## WEB Port ##
#######################################################################################

View File

@ -26,8 +26,45 @@ network.pc_port.speed_duplex =
network.pc_port.dhcp_server = 1
network.static_dns_enable = 1
{if isset($vlan_port_id) }
#######################################################################################
## VLAN ##
## VLAN ENABLED ##
#######################################################################################
network.vlan.internet_port_enable = 1
#Configure the VLAN ID, it ranges from 1 to 4094, the default value is 1.
#Require reboot;
network.vlan.internet_port_vid = {$vlan_port_id}
#Configure the VLAN priority, it ranges from 0 (default) to 7.
#Require reboot;
network.vlan.internet_port_priority =
#Enable or disable the VLAN of PC port; 0-Disabled (default), 1-Enabled;
#Require reboot;
network.vlan.pc_port_enable = 1
#Configure the VLAN ID, it ranges from 1 to 4094, the default value is 1.
#Require reboot;
network.vlan.pc_port_vid = {$vlan_pc_port_id}
#Configure the VLAN priority, it ranges from 0 (default) to 7.
#Require reboot;
network.vlan.pc_port_priority =
#Enable or disable the DHCP to obtain the information of the VLAN; 0-Disabled; 1-Enabled (default);
#Require reboot;
network.vlan.dhcp_enable =
#Configure the DHCP option to obtain the information of the VLAN. It ranges from 0 to 255.
#Multiple options separated by a comma. It supports up to 5 options in all.
#Require reboot;
network.vlan.dhcp_option =
{else}
#######################################################################################
## VLAN DISABLED ##
#######################################################################################
network.vlan.internet_port_enable = 0
@ -60,6 +97,9 @@ network.vlan.dhcp_enable =
#Require reboot;
network.vlan.dhcp_option =
{/if}
#######################################################################################
## WEB Port ##
#######################################################################################

View File

@ -26,8 +26,45 @@ network.pc_port.speed_duplex =
network.pc_port.dhcp_server = 1
network.static_dns_enable = 0
{if isset($vlan_port_id) }
#######################################################################################
## VLAN ##
## VLAN ENABLED ##
#######################################################################################
network.vlan.internet_port_enable = 1
#Configure the VLAN ID, it ranges from 1 to 4094, the default value is 1.
#Require reboot;
network.vlan.internet_port_vid = {$vlan_port_id}
#Configure the VLAN priority, it ranges from 0 (default) to 7.
#Require reboot;
network.vlan.internet_port_priority =
#Enable or disable the VLAN of PC port; 0-Disabled (default), 1-Enabled;
#Require reboot;
network.vlan.pc_port_enable = 1
#Configure the VLAN ID, it ranges from 1 to 4094, the default value is 1.
#Require reboot;
network.vlan.pc_port_vid = {$vlan_pc_port_id}
#Configure the VLAN priority, it ranges from 0 (default) to 7.
#Require reboot;
network.vlan.pc_port_priority =
#Enable or disable the DHCP to obtain the information of the VLAN; 0-Disabled; 1-Enabled (default);
#Require reboot;
network.vlan.dhcp_enable =
#Configure the DHCP option to obtain the information of the VLAN. It ranges from 0 to 255.
#Multiple options separated by a comma. It supports up to 5 options in all.
#Require reboot;
network.vlan.dhcp_option =
{else}
#######################################################################################
## VLAN ENABLED ##
#######################################################################################
network.vlan.internet_port_enable = 0
@ -60,6 +97,8 @@ network.vlan.dhcp_enable =
#Require reboot;
network.vlan.dhcp_option =
{/if}
#######################################################################################
## WEB Port ##
#######################################################################################
@ -521,30 +560,25 @@ bw.directory_enable = 0
#######################################################################################
## LDAP ##
#######################################################################################
#Configure the search criteria for name and number lookups.
ldap.enable =
ldap.name_filter =
ldap.number_filter =
ldap.host = 0.0.0.0
ldap.port = 389
ldap.base =
ldap.user =
ldap.password =
#Specify the maximum of the displayed search results. It ranges from 1 to 32000, the default value is 50.
ldap.max_hits =
ldap.name_attr =
ldap.numb_attr =
ldap.display_name =
#Configure the LDAP version. The valid value is 2 or 3 (default).
ldap.version =
#Enable or disable the phone to query the contact name from the LDAP server when receiving an incoming call; 0-Disabled (default), 1-Enabled;
ldap.call_in_lookup =
#Enable or disable the phone to sort the search results in alphabetical order; 0-Disabled (default), 1-Enabled;
ldap.ldap_sort =
#Configure the backlight time (in seconds). The valid values are: 1-Always on, 60 (default), 120, 300, 600, 1800.
security.trust_certificates = 0
phone_setting.backlight_time = 0
ldap.name_filter = {$ldap_name_filter}
ldap.number_filter = {$ldap_number_filter}
ldap.host = {$ldap_host}
ldap.base = {$ldap_base}
ldap.user = {$ldap_user}
ldap.password = {$ldap_password}
ldap.display_name = {$ldap_display_name}
ldap.version = {$ldap_version}
ldap.call_in_lookup = {$ldap_call_in_lookup}
ldap.dial_lookup = {$ldap_dial_lookup}
ldap.enable = {$ldap_enable}
ldap.ldap_sort = {$ldap_sort}
ldap.port = {$ldap_port}
ldap.max_hits = {$ldap_max_hits}
ldap.name_attr = {$ldap_name_attr}
ldap.numb_attr = {$ldap_numb_attr}
#######################################################################################
## Features ##
@ -1525,7 +1559,7 @@ super_search.url =
## Directory Setting ##
#######################################################################################
#Configure the access URL of the directory setting file.
directory_setting.url =
directory_setting.url ={$yealink_directory_setting_url}
#######################################################################################
## Configure the access URL of firmware ##

View File

@ -26,8 +26,45 @@ network.pc_port.speed_duplex =
network.pc_port.dhcp_server = 1
network.static_dns_enable = 1
{if isset($vlan_port_id) }
#######################################################################################
## VLAN ##
## VLAN ENABLED ##
#######################################################################################
network.vlan.internet_port_enable = 1
#Configure the VLAN ID, it ranges from 1 to 4094, the default value is 1.
#Require reboot;
network.vlan.internet_port_vid = {$vlan_port_id}
#Configure the VLAN priority, it ranges from 0 (default) to 7.
#Require reboot;
network.vlan.internet_port_priority =
#Enable or disable the VLAN of PC port; 0-Disabled (default), 1-Enabled;
#Require reboot;
network.vlan.pc_port_enable = 1
#Configure the VLAN ID, it ranges from 1 to 4094, the default value is 1.
#Require reboot;
network.vlan.pc_port_vid = {$vlan_pc_port_id}
#Configure the VLAN priority, it ranges from 0 (default) to 7.
#Require reboot;
network.vlan.pc_port_priority =
#Enable or disable the DHCP to obtain the information of the VLAN; 0-Disabled; 1-Enabled (default);
#Require reboot;
network.vlan.dhcp_enable =
#Configure the DHCP option to obtain the information of the VLAN. It ranges from 0 to 255.
#Multiple options separated by a comma. It supports up to 5 options in all.
#Require reboot;
network.vlan.dhcp_option =
{else}
#######################################################################################
## VLAN DISABLED ##
#######################################################################################
network.vlan.internet_port_enable = 0
@ -60,6 +97,9 @@ network.vlan.dhcp_enable =
#Require reboot;
network.vlan.dhcp_option =
{/if}
#######################################################################################
## WEB Port ##
#######################################################################################
@ -715,11 +755,11 @@ features.remote_phonebook.flash_time =
#######################################################################################
## Features Action ##
#######################################################################################
#Specifie the address(es) or enters ¡°any¡± from which Action URI will be accepted.
#Specifie the address(es) or enters ¡°any¡± from which Action URI will be accepted.
#For discontinuous IP addresses, each IP address is separated by comma, for example: 192.168.1.20,10.2.1.30
#For continuous IP addresses, the format likes *.*.*.* and the ¡°*¡± stands for the values 0~255. For example: 10.10.*.* stands for the IP addresses that range from 10.10.0.0~10.10.255.255.
#For continuous IP addresses, the format likes *.*.*.* and the ¡°*¡± stands for the values 0~255. For example: 10.10.*.* stands for the IP addresses that range from 10.10.0.0~10.10.255.255.
#If left blank, the IP phone cannot receive or handle any HTTP GET request.
#If set to ¡°any¡±, the IP phone accepts and handles HTTP GET requests from any IP address.
#If set to ¡°any¡±, the IP phone accepts and handles HTTP GET requests from any IP address.
features.action_uri_limit_ip =
features.action_uri_reboot_now = 0
@ -815,7 +855,7 @@ phone_setting.inactive_backlight_level = 1
phone_setting.blf_list_enable = 1
phone_setting.auto_blf_list_enable = 1
#Specify the prior of the line keys and EXP keys when automatically configure the blf list£»0-Configure the line keys first, 1-Configure the EXP keys first;
#Specify the prior of the line keys and EXP keys when automatically configure the blf list£»0-Configure the line keys first, 1-Configure the EXP keys first;
phone_setting.blf_list_sequence_type =
#######################################################################################

View File

@ -26,7 +26,64 @@
if ($domains_processed == 1) {
//get the background images
$relative_path = PROJECT_PATH.'/themes/enhanced/images/backgrounds';
$backgrounds = opendir($_SERVER["DOCUMENT_ROOT"].'/'.$relative_path);
unset($array);
$x = 0;
while (false !== ($file = readdir($backgrounds))) {
if ($file != "." AND $file != ".."){
$new_path = $dir.'/'.$file;
$level = explode('/',$new_path);
$ext = pathinfo($file, PATHINFO_EXTENSION);
if ($ext == "png" || $ext == "jpg" || $ext == "jpeg" || $ext == "gif") {
$x++;
$array[$x]['default_setting_category'] = 'theme';
$array[$x]['default_setting_subcategory'] = 'background_image';
$array[$x]['default_setting_name'] = 'array';
$array[$x]['default_setting_value'] = $relative_path.'/'.$file;
$array[$x]['default_setting_enabled'] = 'false';
$array[$x]['default_setting_description'] = 'Set a relative path or URL within a selected compatible template.';
}
if ($x > 300) { break; };
}
}
if(!$set_session_theme){
//get default settings
$sql = "select * from v_default_settings ";
$sql .= "where default_setting_category = 'theme' ";
$sql .= "and default_setting_subcategory = 'background_image' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
unset($prep_statement);
$background_image_enabled = false;
//add theme default settings
foreach ($array as $row) {
$found = false;
foreach ($default_settings as $field) {
if ($field["default_setting_value"] == $row["default_setting_value"]) {
$found = true;
}
//enable_background_image is a new setting, if a user has any background images enabled we should turn it on
if ($field["default_setting_enabled"] == 'enabled') {
$background_image_enabled = true;
}
}
if (!$found) {
$orm = new orm;
$orm->name('default_settings');
$orm->save($row);
$message = $orm->message;
//print_r($message);
}
}
}
//define array of settings
unset($array);
$x = 0;
$array[$x]['default_setting_category'] = 'theme';
$array[$x]['default_setting_subcategory'] = 'login_opacity';
@ -181,6 +238,14 @@ if ($domains_processed == 1) {
$array[$x]['default_setting_value'] = '0.96';
$array[$x]['default_setting_enabled'] = 'false';
$array[$x]['default_setting_description'] = 'Set the opacity of the main menu (decimal, Minimized theme only).';
$x++;
$array[$x]['default_setting_category'] = 'theme';
$array[$x]['default_setting_subcategory'] = 'background_image_enabled';
$array[$x]['default_setting_name'] = 'boolean';
$array[$x]['default_setting_value'] = 'true';
$array[$x]['default_setting_enabled'] = 'false';
if($background_image_enabled) { $array[$x]['default_setting_enabled'] = 'true'; }
$array[$x]['default_setting_description'] = 'Enable use of background images.';
if($set_session_theme){
foreach ($array as $index => $default_settings) {
@ -268,55 +333,6 @@ if ($domains_processed == 1) {
}
}
//get the background images
$relative_path = PROJECT_PATH.'/themes/enhanced/images/backgrounds';
$backgrounds = opendir($_SERVER["DOCUMENT_ROOT"].'/'.$relative_path);
unset($array);
$x = 0;
while (false !== ($file = readdir($backgrounds))) {
if ($file != "." AND $file != ".."){
$new_path = $dir.'/'.$file;
$level = explode('/',$new_path);
$ext = pathinfo($file, PATHINFO_EXTENSION);
if ($ext == "png" || $ext == "jpg" || $ext == "jpeg" || $ext == "gif") {
$x++;
$array[$x]['default_setting_category'] = 'theme';
$array[$x]['default_setting_subcategory'] = 'background_image';
$array[$x]['default_setting_name'] = 'array';
$array[$x]['default_setting_value'] = $relative_path.'/'.$file;
$array[$x]['default_setting_enabled'] = 'false';
$array[$x]['default_setting_description'] = 'Set a relative path or URL within a selected compatible template.';
}
if ($x > 300) { break; };
}
}
//get default settings
$sql = "select * from v_default_settings ";
$sql .= "where default_setting_category = 'theme' ";
$sql .= "and default_setting_subcategory = 'background_image' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$default_settings = $prep_statement->fetchAll(PDO::FETCH_NAMED);
unset($prep_statement);
//add theme default settings
foreach ($array as $row) {
$found = false;
foreach ($default_settings as $field) {
if ($field["default_setting_value"] == $row["default_setting_value"]) {
$found = true;
}
}
if (!$found) {
$orm = new orm;
$orm->name('default_settings');
$orm->save($row);
$message = $orm->message;
//print_r($message);
}
}
//unset the array variable
unset($array);
}

View File

@ -1424,7 +1424,7 @@ if (strlen($_SESSION['message']) > 0) {
<?php
// check for background image
if (isset($_SESSION['theme']['background_image'])) {
if (isset($_SESSION['theme']['background_image_enabled']['boolean']) and $_SESSION['theme']['background_image_enabled']['boolean'] == 'true') {
// background image is enabled
$image_extensions = array('jpg','jpeg','png','gif');