Add new application providers
This commit is contained in:
parent
db83ba74c2
commit
6a52923307
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
//application details
|
||||
$apps[$x]['name'] = "Providers";
|
||||
$apps[$x]['uuid'] = "b12946a2-f5f7-4eb9-8b79-7d90b89f8aef";
|
||||
$apps[$x]['category'] = "Switch";
|
||||
$apps[$x]['subcategory'] = "";
|
||||
$apps[$x]['version'] = "1.0";
|
||||
$apps[$x]['license'] = "Mozilla Public License 1.1";
|
||||
$apps[$x]['url'] = "http://www.fusionpbx.com";
|
||||
$apps[$x]['description']['en-us'] = "";
|
||||
$apps[$x]['description']['ar-eg'] = "";
|
||||
$apps[$x]['description']['de-at'] = "";
|
||||
$apps[$x]['description']['de-ch'] = "";
|
||||
$apps[$x]['description']['de-de'] = "";
|
||||
$apps[$x]['description']['es-cl'] = "";
|
||||
$apps[$x]['description']['es-mx'] = "";
|
||||
$apps[$x]['description']['fr-ca'] = "";
|
||||
$apps[$x]['description']['fr-fr'] = "";
|
||||
$apps[$x]['description']['he-il'] = "";
|
||||
$apps[$x]['description']['it-it'] = "";
|
||||
$apps[$x]['description']['nl-nl'] = "";
|
||||
$apps[$x]['description']['pl-pl'] = "";
|
||||
$apps[$x]['description']['pt-br'] = "";
|
||||
$apps[$x]['description']['pt-pt'] = "";
|
||||
$apps[$x]['description']['ro-ro'] = "";
|
||||
$apps[$x]['description']['ru-ru'] = "";
|
||||
$apps[$x]['description']['sv-se'] = "";
|
||||
$apps[$x]['description']['uk-ua'] = "";
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,303 @@
|
|||
<?php
|
||||
|
||||
$text['title-providers']['en-us'] = "Providers";
|
||||
$text['title-providers']['ar-eg'] = "";
|
||||
$text['title-providers']['de-at'] = "";
|
||||
$text['title-providers']['de-ch'] = "";
|
||||
$text['title-providers']['de-de'] = "";
|
||||
$text['title-providers']['es-cl'] = "";
|
||||
$text['title-providers']['es-mx'] = "";
|
||||
$text['title-providers']['fr-ca'] = "";
|
||||
$text['title-providers']['fr-fr'] = "";
|
||||
$text['title-providers']['he-il'] = "";
|
||||
$text['title-providers']['it-it'] = "";
|
||||
$text['title-providers']['nl-nl'] = "";
|
||||
$text['title-providers']['pl-pl'] = "";
|
||||
$text['title-providers']['pt-br'] = "";
|
||||
$text['title-providers']['pt-pt'] = "";
|
||||
$text['title-providers']['ro-ro'] = "";
|
||||
$text['title-providers']['ru-ru'] = "";
|
||||
$text['title-providers']['sv-se'] = "";
|
||||
$text['title-providers']['uk-ua'] = "";
|
||||
|
||||
$text['description-providers']['en-us'] = "From this page you can easily configure one of the VoIP providers in the list. When you click on setup it will add entries to the Domains access control list, create a gateway and add outbound routes for that carrier. These providers support the project.";
|
||||
$text['description-providers']['ar-eg'] = "";
|
||||
$text['description-providers']['de-at'] = "";
|
||||
$text['description-providers']['de-ch'] = "";
|
||||
$text['description-providers']['de-de'] = "";
|
||||
$text['description-providers']['es-cl'] = "";
|
||||
$text['description-providers']['es-mx'] = "";
|
||||
$text['description-providers']['fr-ca'] = "";
|
||||
$text['description-providers']['fr-fr'] = "";
|
||||
$text['description-providers']['he-il'] = "";
|
||||
$text['description-providers']['it-it'] = "";
|
||||
$text['description-providers']['nl-nl'] = "";
|
||||
$text['description-providers']['pl-pl'] = "";
|
||||
$text['description-providers']['pt-br'] = "";
|
||||
$text['description-providers']['pt-pt'] = "";
|
||||
$text['description-providers']['ro-ro'] = "";
|
||||
$text['description-providers']['ru-ru'] = "";
|
||||
$text['description-providers']['sv-se'] = "";
|
||||
$text['description-providers']['uk-ua'] = "";
|
||||
|
||||
$text['button-website']['en-us'] = "Website";
|
||||
$text['button-website']['ar-eg'] = "";
|
||||
$text['button-website']['de-at'] = "";
|
||||
$text['button-website']['de-ch'] = "";
|
||||
$text['button-website']['de-de'] = "";
|
||||
$text['button-website']['es-cl'] = "";
|
||||
$text['button-website']['es-mx'] = "";
|
||||
$text['button-website']['fr-ca'] = "";
|
||||
$text['button-website']['fr-fr'] = "";
|
||||
$text['button-website']['he-il'] = "";
|
||||
$text['button-website']['it-it'] = "";
|
||||
$text['button-website']['nl-nl'] = "";
|
||||
$text['button-website']['pl-pl'] = "";
|
||||
$text['button-website']['pt-br'] = "";
|
||||
$text['button-website']['pt-pt'] = "";
|
||||
$text['button-website']['ro-ro'] = "";
|
||||
$text['button-website']['ru-ru'] = "";
|
||||
$text['button-website']['sv-se'] = "";
|
||||
$text['button-website']['uk-ua'] = "";
|
||||
|
||||
$text['button-pricing']['en-us'] = "Pricing";
|
||||
$text['button-pricing']['ar-eg'] = "";
|
||||
$text['button-pricing']['de-at'] = "";
|
||||
$text['button-pricing']['de-ch'] = "";
|
||||
$text['button-pricing']['de-de'] = "";
|
||||
$text['button-pricing']['es-cl'] = "";
|
||||
$text['button-pricing']['es-mx'] = "";
|
||||
$text['button-pricing']['fr-ca'] = "";
|
||||
$text['button-pricing']['fr-fr'] = "";
|
||||
$text['button-pricing']['he-il'] = "";
|
||||
$text['button-pricing']['it-it'] = "";
|
||||
$text['button-pricing']['nl-nl'] = "";
|
||||
$text['button-pricing']['pl-pl'] = "";
|
||||
$text['button-pricing']['pt-br'] = "";
|
||||
$text['button-pricing']['pt-pt'] = "";
|
||||
$text['button-pricing']['ro-ro'] = "";
|
||||
$text['button-pricing']['ru-ru'] = "";
|
||||
$text['button-pricing']['sv-se'] = "";
|
||||
$text['button-pricing']['uk-ua'] = "";
|
||||
|
||||
$text['button-signup']['en-us'] = "Signup";
|
||||
$text['button-signup']['ar-eg'] = "";
|
||||
$text['button-signup']['de-at'] = "";
|
||||
$text['button-signup']['de-ch'] = "";
|
||||
$text['button-signup']['de-de'] = "";
|
||||
$text['button-signup']['es-cl'] = "";
|
||||
$text['button-signup']['es-mx'] = "";
|
||||
$text['button-signup']['fr-ca'] = "";
|
||||
$text['button-signup']['fr-fr'] = "";
|
||||
$text['button-signup']['he-il'] = "";
|
||||
$text['button-signup']['it-it'] = "";
|
||||
$text['button-signup']['nl-nl'] = "";
|
||||
$text['button-signup']['pl-pl'] = "";
|
||||
$text['button-signup']['pt-br'] = "";
|
||||
$text['button-signup']['pt-pt'] = "";
|
||||
$text['button-signup']['ro-ro'] = "";
|
||||
$text['button-signup']['ru-ru'] = "";
|
||||
$text['button-signup']['sv-se'] = "";
|
||||
$text['button-signup']['uk-ua'] = "";
|
||||
|
||||
$text['button-setup']['en-us'] = "Setup";
|
||||
$text['button-setup']['ar-eg'] = "";
|
||||
$text['button-setup']['de-at'] = "";
|
||||
$text['button-setup']['de-ch'] = "";
|
||||
$text['button-setup']['de-de'] = "";
|
||||
$text['button-setup']['es-cl'] = "";
|
||||
$text['button-setup']['es-mx'] = "";
|
||||
$text['button-setup']['fr-ca'] = "";
|
||||
$text['button-setup']['fr-fr'] = "";
|
||||
$text['button-setup']['he-il'] = "";
|
||||
$text['button-setup']['it-it'] = "";
|
||||
$text['button-setup']['nl-nl'] = "";
|
||||
$text['button-setup']['pl-pl'] = "";
|
||||
$text['button-setup']['pt-br'] = "";
|
||||
$text['button-setup']['pt-pt'] = "";
|
||||
$text['button-setup']['ro-ro'] = "";
|
||||
$text['button-setup']['ru-ru'] = "";
|
||||
$text['button-setup']['sv-se'] = "";
|
||||
$text['button-setup']['uk-ua'] = "";
|
||||
|
||||
$text['label-region']['en-us'] = "Region";
|
||||
$text['label-region']['ar-eg'] = "";
|
||||
$text['label-region']['de-at'] = "";
|
||||
$text['label-region']['de-ch'] = "";
|
||||
$text['label-region']['de-de'] = "";
|
||||
$text['label-region']['es-cl'] = "";
|
||||
$text['label-region']['es-mx'] = "";
|
||||
$text['label-region']['fr-ca'] = "";
|
||||
$text['label-region']['fr-fr'] = "";
|
||||
$text['label-region']['he-il'] = "";
|
||||
$text['label-region']['it-it'] = "";
|
||||
$text['label-region']['nl-nl'] = "";
|
||||
$text['label-region']['pl-pl'] = "";
|
||||
$text['label-region']['pt-br'] = "";
|
||||
$text['label-region']['pt-pt'] = "";
|
||||
$text['label-region']['ro-ro'] = "";
|
||||
$text['label-region']['ru-ru'] = "";
|
||||
$text['label-region']['sv-se'] = "";
|
||||
$text['label-region']['uk-ua'] = "";
|
||||
|
||||
$text['label-about']['en-us'] = "About";
|
||||
$text['label-about']['ar-eg'] = "";
|
||||
$text['label-about']['de-at'] = "";
|
||||
$text['label-about']['de-ch'] = "";
|
||||
$text['label-about']['de-de'] = "";
|
||||
$text['label-about']['es-cl'] = "";
|
||||
$text['label-about']['es-mx'] = "";
|
||||
$text['label-about']['fr-ca'] = "";
|
||||
$text['label-about']['fr-fr'] = "";
|
||||
$text['label-about']['he-il'] = "";
|
||||
$text['label-about']['it-it'] = "";
|
||||
$text['label-about']['nl-nl'] = "";
|
||||
$text['label-about']['pl-pl'] = "";
|
||||
$text['label-about']['pt-br'] = "";
|
||||
$text['label-about']['pt-pt'] = "";
|
||||
$text['label-about']['ro-ro'] = "";
|
||||
$text['label-about']['ru-ru'] = "";
|
||||
$text['label-about']['sv-se'] = "";
|
||||
$text['label-about']['uk-ua'] = "";
|
||||
|
||||
$text['label-features']['en-us'] = "Features";
|
||||
$text['label-features']['ar-eg'] = "";
|
||||
$text['label-features']['de-at'] = "";
|
||||
$text['label-features']['de-ch'] = "";
|
||||
$text['label-features']['de-de'] = "";
|
||||
$text['label-features']['es-cl'] = "";
|
||||
$text['label-features']['es-mx'] = "";
|
||||
$text['label-features']['fr-ca'] = "";
|
||||
$text['label-features']['fr-fr'] = "";
|
||||
$text['label-features']['he-il'] = "";
|
||||
$text['label-features']['it-it'] = "";
|
||||
$text['label-features']['nl-nl'] = "";
|
||||
$text['label-features']['pl-pl'] = "";
|
||||
$text['label-features']['pt-br'] = "";
|
||||
$text['label-features']['pt-pt'] = "";
|
||||
$text['label-features']['ro-ro'] = "";
|
||||
$text['label-features']['ru-ru'] = "";
|
||||
$text['label-features']['sv-se'] = "";
|
||||
$text['label-features']['uk-ua'] = "";
|
||||
|
||||
$text['label-region_skyetel']['en-us'] = "Providing service to the United States.";
|
||||
$text['label-region_skyetel']['ar-eg'] = "";
|
||||
$text['label-region_skyetel']['de-at'] = "";
|
||||
$text['label-region_skyetel']['de-ch'] = "";
|
||||
$text['label-region_skyetel']['de-de'] = "";
|
||||
$text['label-region_skyetel']['es-cl'] = "";
|
||||
$text['label-region_skyetel']['es-mx'] = "";
|
||||
$text['label-region_skyetel']['fr-ca'] = "";
|
||||
$text['label-region_skyetel']['fr-fr'] = "";
|
||||
$text['label-region_skyetel']['he-il'] = "";
|
||||
$text['label-region_skyetel']['it-it'] = "";
|
||||
$text['label-region_skyetel']['nl-nl'] = "";
|
||||
$text['label-region_skyetel']['pl-pl'] = "";
|
||||
$text['label-region_skyetel']['pt-br'] = "";
|
||||
$text['label-region_skyetel']['pt-pt'] = "";
|
||||
$text['label-region_skyetel']['ro-ro'] = "";
|
||||
$text['label-region_skyetel']['ru-ru'] = "";
|
||||
$text['label-region_skyetel']['sv-se'] = "";
|
||||
$text['label-region_skyetel']['uk-ua'] = "";
|
||||
|
||||
$text['label-about_skyetel']['en-us'] = "Based out of the Pacific Northwest, Skyetel offers triple redundancy, a beautiful UI, and aggressive pricing. Skyetel has been awarded multiple times for its commitment to customer service and maintains a full time support team who can help you get your systems up and running quickly.";
|
||||
$text['label-about_skyetel']['ar-eg'] = "";
|
||||
$text['label-about_skyetel']['de-at'] = "";
|
||||
$text['label-about_skyetel']['de-ch'] = "";
|
||||
$text['label-about_skyetel']['de-de'] = "";
|
||||
$text['label-about_skyetel']['es-cl'] = "";
|
||||
$text['label-about_skyetel']['es-mx'] = "";
|
||||
$text['label-about_skyetel']['fr-ca'] = "";
|
||||
$text['label-about_skyetel']['fr-fr'] = "";
|
||||
$text['label-about_skyetel']['he-il'] = "";
|
||||
$text['label-about_skyetel']['it-it'] = "";
|
||||
$text['label-about_skyetel']['nl-nl'] = "";
|
||||
$text['label-about_skyetel']['pl-pl'] = "";
|
||||
$text['label-about_skyetel']['pt-br'] = "";
|
||||
$text['label-about_skyetel']['pt-pt'] = "";
|
||||
$text['label-about_skyetel']['ro-ro'] = "";
|
||||
$text['label-about_skyetel']['ru-ru'] = "";
|
||||
$text['label-about_skyetel']['sv-se'] = "";
|
||||
$text['label-about_skyetel']['uk-ua'] = "";
|
||||
|
||||
$text['label-features_skyetel']['en-us'] = "Origination, Termination, Local Presence, Dialer support, Uptime and QOS monitoring, E911, CNAM, Restful API.";
|
||||
$text['label-features_skyetel']['ar-eg'] = "";
|
||||
$text['label-features_skyetel']['de-at'] = "";
|
||||
$text['label-features_skyetel']['de-ch'] = "";
|
||||
$text['label-features_skyetel']['de-de'] = "";
|
||||
$text['label-features_skyetel']['es-cl'] = "";
|
||||
$text['label-features_skyetel']['es-mx'] = "";
|
||||
$text['label-features_skyetel']['fr-ca'] = "";
|
||||
$text['label-features_skyetel']['fr-fr'] = "";
|
||||
$text['label-features_skyetel']['he-il'] = "";
|
||||
$text['label-features_skyetel']['it-it'] = "";
|
||||
$text['label-features_skyetel']['nl-nl'] = "";
|
||||
$text['label-features_skyetel']['pl-pl'] = "";
|
||||
$text['label-features_skyetel']['pt-br'] = "";
|
||||
$text['label-features_skyetel']['pt-pt'] = "";
|
||||
$text['label-features_skyetel']['ro-ro'] = "";
|
||||
$text['label-features_skyetel']['ru-ru'] = "";
|
||||
$text['label-features_skyetel']['sv-se'] = "";
|
||||
$text['label-features_skyetel']['uk-ua'] = "";
|
||||
|
||||
$text['label-region_voicetel']['en-us'] = "Providing service to the United States and Canada.";
|
||||
$text['label-region_voicetel']['ar-eg'] = "";
|
||||
$text['label-region_voicetel']['de-at'] = "";
|
||||
$text['label-region_voicetel']['de-ch'] = "";
|
||||
$text['label-region_voicetel']['de-de'] = "";
|
||||
$text['label-region_voicetel']['es-cl'] = "";
|
||||
$text['label-region_voicetel']['es-mx'] = "";
|
||||
$text['label-region_voicetel']['fr-ca'] = "";
|
||||
$text['label-region_voicetel']['fr-fr'] = "";
|
||||
$text['label-region_voicetel']['he-il'] = "";
|
||||
$text['label-region_voicetel']['it-it'] = "";
|
||||
$text['label-region_voicetel']['nl-nl'] = "";
|
||||
$text['label-region_voicetel']['pl-pl'] = "";
|
||||
$text['label-region_voicetel']['pt-br'] = "";
|
||||
$text['label-region_voicetel']['pt-pt'] = "";
|
||||
$text['label-region_voicetel']['ro-ro'] = "";
|
||||
$text['label-region_voicetel']['ru-ru'] = "";
|
||||
$text['label-region_voicetel']['sv-se'] = "";
|
||||
$text['label-region_voicetel']['uk-ua'] = "";
|
||||
|
||||
$text['label-about_voicetel']['en-us'] = "VoiceTel offers local inbound phone service at exceptionally low monthly and per minute rates. We provide businesses and individuals access to a nationwide footprint covering over 90% of the U.S. Population. Substantially lower your telecommunications costs and improve your quality of service with our IP enhanced outbound phone service.";
|
||||
$text['label-about_voicetel']['ar-eg'] = "";
|
||||
$text['label-about_voicetel']['de-at'] = "";
|
||||
$text['label-about_voicetel']['de-ch'] = "";
|
||||
$text['label-about_voicetel']['de-de'] = "";
|
||||
$text['label-about_voicetel']['es-cl'] = "";
|
||||
$text['label-about_voicetel']['es-mx'] = "";
|
||||
$text['label-about_voicetel']['fr-ca'] = "";
|
||||
$text['label-about_voicetel']['fr-fr'] = "";
|
||||
$text['label-about_voicetel']['he-il'] = "";
|
||||
$text['label-about_voicetel']['it-it'] = "";
|
||||
$text['label-about_voicetel']['nl-nl'] = "";
|
||||
$text['label-about_voicetel']['pl-pl'] = "";
|
||||
$text['label-about_voicetel']['pt-br'] = "";
|
||||
$text['label-about_voicetel']['pt-pt'] = "";
|
||||
$text['label-about_voicetel']['ro-ro'] = "";
|
||||
$text['label-about_voicetel']['ru-ru'] = "";
|
||||
$text['label-about_voicetel']['sv-se'] = "";
|
||||
$text['label-about_voicetel']['uk-ua'] = "";
|
||||
|
||||
$text['label-features_voicetel']['en-us'] = "Origination, Termination, Send and receive SMS Messages from your computer, tablet, or mobile device. Optionally automate or embed SMS transmission through the use of our RESTful API.";
|
||||
$text['label-features_voicetel']['ar-eg'] = "";
|
||||
$text['label-features_voicetel']['de-at'] = "";
|
||||
$text['label-features_voicetel']['de-ch'] = "";
|
||||
$text['label-features_voicetel']['de-de'] = "";
|
||||
$text['label-features_voicetel']['es-cl'] = "";
|
||||
$text['label-features_voicetel']['es-mx'] = "";
|
||||
$text['label-features_voicetel']['fr-ca'] = "";
|
||||
$text['label-features_voicetel']['fr-fr'] = "";
|
||||
$text['label-features_voicetel']['he-il'] = "";
|
||||
$text['label-features_voicetel']['it-it'] = "";
|
||||
$text['label-features_voicetel']['nl-nl'] = "";
|
||||
$text['label-features_voicetel']['pl-pl'] = "";
|
||||
$text['label-features_voicetel']['pt-br'] = "";
|
||||
$text['label-features_voicetel']['pt-pt'] = "";
|
||||
$text['label-features_voicetel']['ro-ro'] = "";
|
||||
$text['label-features_voicetel']['ru-ru'] = "";
|
||||
$text['label-features_voicetel']['sv-se'] = "";
|
||||
$text['label-features_voicetel']['uk-ua'] = "";
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
$y=0;
|
||||
$apps[$x]['menu'][$y]['title']['en-us'] = "Providers";
|
||||
$apps[$x]['menu'][$y]['title']['ar-eg'] = "";
|
||||
$apps[$x]['menu'][$y]['title']['de-at'] = "";
|
||||
$apps[$x]['menu'][$y]['title']['de-ch'] = "";
|
||||
$apps[$x]['menu'][$y]['title']['de-de'] = "";
|
||||
$apps[$x]['menu'][$y]['title']['es-cl'] = "";
|
||||
$apps[$x]['menu'][$y]['title']['es-mx'] = "";
|
||||
$apps[$x]['menu'][$y]['title']['fr-ca'] = "";
|
||||
$apps[$x]['menu'][$y]['title']['fr-fr'] = "";
|
||||
$apps[$x]['menu'][$y]['title']['he-il'] = "";
|
||||
$apps[$x]['menu'][$y]['title']['it-it'] = "";
|
||||
$apps[$x]['menu'][$y]['title']['nl-nl'] = "";
|
||||
$apps[$x]['menu'][$y]['title']['pl-pl'] = "";
|
||||
$apps[$x]['menu'][$y]['title']['pt-br'] = "";
|
||||
$apps[$x]['menu'][$y]['title']['pt-pt'] = "";
|
||||
$apps[$x]['menu'][$y]['title']['ro-ro'] = "";
|
||||
$apps[$x]['menu'][$y]['title']['ru-ru'] = "";
|
||||
$apps[$x]['menu'][$y]['title']['sv-se'] = "";
|
||||
$apps[$x]['menu'][$y]['title']['uk-ua'] = "";
|
||||
$apps[$x]['menu'][$y]['uuid'] = "b3b249a9-39e3-46d4-aae7-c3dcb4e4d07b";
|
||||
$apps[$x]['menu'][$y]['parent_uuid'] = "bc96d773-ee57-0cdd-c3ac-2d91aba61b55";
|
||||
$apps[$x]['menu'][$y]['category'] = "internal";
|
||||
$apps[$x]['menu'][$y]['path'] = "/app/providers/providers.php";
|
||||
$apps[$x]['menu'][$y]['groups'][] = "superadmin";
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2017
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
//includes
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
|
||||
//check permissions
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('dialplan_edit')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//get the provider
|
||||
if (isset($_GET["provider"])) {
|
||||
$provider = new providers;
|
||||
$reports->domain_uuid = $_SESSION['domain_uuid'];
|
||||
$provider->delete($_GET["provider"]);
|
||||
}
|
||||
|
||||
//clear the cache
|
||||
$cache = new cache;
|
||||
$cache->delete("dialplan:".$_SESSION["context"]);
|
||||
|
||||
//set the add message
|
||||
messages::add($text['message-delete']);
|
||||
|
||||
//redirect the user
|
||||
header("Location: index.php");
|
||||
return;
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2017
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
//includes
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
|
||||
//check permissions
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('dialplan_edit')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//get the provider
|
||||
if (isset($_GET["provider"])) {
|
||||
$provider = new providers;
|
||||
$reports->domain_uuid = $_SESSION['domain_uuid'];
|
||||
$provider->setup($_GET["provider"]);
|
||||
}
|
||||
|
||||
//clear the cache
|
||||
$cache = new cache;
|
||||
$cache->delete("dialplan:".$_SESSION["context"]);
|
||||
|
||||
//set the add message
|
||||
messages::add($text['message-add']);
|
||||
|
||||
//redirect the user
|
||||
header("Location: index.php");
|
||||
return;
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,162 @@
|
|||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2017
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
//includes
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
|
||||
//check permissions
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('dialplan_edit')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//get the provider
|
||||
if (isset($_REQUEST["provider"])) {
|
||||
$provider = check_str($_REQUEST["provider"]);
|
||||
switch ($provider) {
|
||||
case 'voicetel':
|
||||
break;
|
||||
case 'skyetel':
|
||||
break;
|
||||
default:
|
||||
$provider = '';
|
||||
}
|
||||
echo $provider;
|
||||
exit;
|
||||
}
|
||||
|
||||
//skyetel installed
|
||||
$sql = "select gateway_uuid from v_gateways ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$gateways = $prep_statement->fetchAll();
|
||||
$skyetel_installed = false;
|
||||
$voicetel_installed = false;
|
||||
foreach ($gateways as $row) {
|
||||
if ($row['gateway_uuid'] === "22245a48-552c-463a-a723-ce01ebbd69a2") {
|
||||
$skyetel_installed = true;
|
||||
}
|
||||
if ($row['gateway_uuid'] === "d61be0f0-3a4c-434a-b9f6-4fef15e1a634") {
|
||||
$voicetel_installed = true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
<div class='col-xs-12'>
|
||||
<?php
|
||||
echo "<b>".$text['title-providers']."</b>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-providers']."\n";
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div style='clear: both;'><hr /></div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-4" style='padding-top: 0px;'>
|
||||
<br /><br /><br />
|
||||
<a href='http://tiny.cc/voicetel' target='_blank'>
|
||||
<img src="/app/providers/resources/images/logo_voicetel.png" style="max-width: 159px;" class="center-block img-responsive"><br>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-8" style='padding-top: 0px;'>
|
||||
<?php
|
||||
echo "<h2>VoiceTel</h2>\n";
|
||||
echo "<br />\n";
|
||||
echo "<strong>".$text['label-region']."</strong><br />\n";
|
||||
echo $text['label-region_voicetel']."\n";
|
||||
echo "<br /><br />\n";
|
||||
echo "<strong>".$text['label-about']."</strong><br />\n";
|
||||
echo $text['label-about_voicetel']."\n";
|
||||
echo "<br /><br />\n";
|
||||
echo "<strong>".$text['label-features']."</strong><br />\n";
|
||||
echo $text['label-features_voicetel']."\n";
|
||||
echo "<br /><br />\n";
|
||||
echo "<a href='http://tiny.cc/voicetel' target='_blank'><button type=\"button\" class=\"btn btn-success\">".$text['button-website']."</button></a>\n";
|
||||
echo "<a href='http://tiny.cc/voicetel' target='_blank'><button type=\"button\" class=\"btn btn-success\">".$text['button-signup']."</button></a>\n";
|
||||
if (!$voicetel_installed) {
|
||||
echo "<button type=\"button\" onclick=\"window.location='provider_setup.php?provider=voicetel'\" class=\"btn btn-primary\">".$text['button-setup']."</button>\n";
|
||||
}
|
||||
else {
|
||||
echo "<button type=\"button\" onclick=\"window.location='provider_delete.php?provider=voicetel'\" class=\"btn btn-danger\">".$text['button-delete']."</button>\n";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div style='clear: both;'><br/><br/><hr /><br/></div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-4" style='padding-top: 0px;'>
|
||||
<br /><br />
|
||||
<a href='http://skye.tel/fusion-contact' target='_blank'>
|
||||
<img src="/app/providers/resources/images/skyetel-logo.png" style="max-width: 159px;" class="center-block img-responsive"><br>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-8" style='padding-top: 0px;'>
|
||||
<?php
|
||||
echo "<h2>Skyetel</h2>\n";
|
||||
echo "<br />\n";
|
||||
echo "<strong>".$text['label-region']."</strong><br />\n";
|
||||
echo $text['label-region_skyetel']."\n";
|
||||
echo "<br /><br />\n";
|
||||
echo "<strong>".$text['label-about']."</strong><br />\n";
|
||||
echo $text['label-about_skyetel']."\n";
|
||||
echo "<br /><br />\n";
|
||||
echo "<strong>".$text['label-features']."</strong><br />\n";
|
||||
echo $text['label-features_skyetel']."\n";
|
||||
echo "<br /><br />\n";
|
||||
echo "<a href='http://skye.tel/fusionpbx-about' target='_blank'><button type=\"button\" class=\"btn btn-success\">".$text['button-website']."</button></a>\n";
|
||||
echo "<a href='http://skye.tel/fusion-pricing' target='_blank'><button type=\"button\" class=\"btn btn-success\">".$text['button-pricing']."</button></a>\n";
|
||||
echo "<a href='http://skye.tel/fusion-contact' target='_blank'><button type=\"button\" class=\"btn btn-success\">".$text['button-signup']."</button></a>\n";
|
||||
if (!$skyetel_installed) {
|
||||
echo "<button type=\"button\" onclick=\"window.location='provider_setup.php?provider=skyetel'\" class=\"btn btn-primary\">".$text['button-setup']."</button>\n";
|
||||
}
|
||||
else {
|
||||
echo "<button type=\"button\" onclick=\"window.location='provider_delete.php?provider=skyetel'\" class=\"btn btn-danger\">".$text['button-delete']."</button>\n";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style='clear: both;'><br><br></div>
|
||||
|
||||
<?php
|
||||
require_once "resources/footer.php";
|
||||
?>
|
||||
|
|
@ -0,0 +1,565 @@
|
|||
2<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2017
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* providers class provides methods for providing an overview
|
||||
*
|
||||
* @method boolean add
|
||||
*/
|
||||
if (!class_exists('providers')) {
|
||||
class providers {
|
||||
|
||||
//define variables
|
||||
public $db;
|
||||
public $debug;
|
||||
public $domain_uuid;
|
||||
public $array;
|
||||
|
||||
/**
|
||||
* Called when the object is created
|
||||
*/
|
||||
public function __construct() {
|
||||
//connect to the database if not connected
|
||||
if (!$this->db) {
|
||||
require_once "resources/classes/database.php";
|
||||
$database = new database;
|
||||
$database->connect();
|
||||
$this->db = $database->db;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when there are no references to a particular object
|
||||
* unset the variables used in the class
|
||||
*/
|
||||
public function __destruct() {
|
||||
if (isset($this)) foreach ($this as $key => $value) {
|
||||
unset($this->$key);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* nodes array
|
||||
*/
|
||||
public function nodes($provider) {
|
||||
|
||||
//build the skyetel node array
|
||||
if ($provider == 'skyetel') {
|
||||
$x = 0;
|
||||
$nodes[$x]['uuid'] = 'af26484f-03a1-4f93-857b-b8cef1ac28f5';
|
||||
$nodes[$x]['cidr'] = '52.41.52.34/32';
|
||||
$nodes[$x]['description'] = 'Skyetel - North West';
|
||||
$x++;
|
||||
$nodes[$x]['uuid'] = '87eb7803-9b96-41d3-ac5a-42ed3f213777';
|
||||
$nodes[$x]['cidr'] = '52.8.201.128/32';
|
||||
$nodes[$x]['description'] = 'Skyetel - South West';
|
||||
$x++;
|
||||
$nodes[$x]['uuid'] = 'cf61ab01-1465-4eca-9152-2e6fd4a02073';
|
||||
$nodes[$x]['cidr'] = '52.60.138.31/32';
|
||||
$nodes[$x]['description'] = 'Skyetel - North East';
|
||||
$x++;
|
||||
$nodes[$x]['uuid'] = 'b43ebeef-c214-492b-8f22-4bfc6b647668';
|
||||
$nodes[$x]['cidr'] = '50.17.48.216/32';
|
||||
$nodes[$x]['description'] = 'Skyetel - South East';
|
||||
$x++;
|
||||
$nodes[$x]['uuid'] = '28615834-4517-4515-b474-5ca54ee958fc';
|
||||
$nodes[$x]['cidr'] = '35.156.192.164/32';
|
||||
$nodes[$x]['description'] = 'Skyetel - Europe';
|
||||
}
|
||||
|
||||
//build the voicetel node array
|
||||
if ($provider == 'voicetel') {
|
||||
$x = 0;
|
||||
$nodes[$x]['uuid'] = 'dae9ab41-73c1-4792-bfdb-eccbedeebac9';
|
||||
$nodes[$x]['cidr'] = '199.101.184.146/32';
|
||||
$nodes[$x]['description'] = 'VoiceTel';
|
||||
$x++;
|
||||
$nodes[$x]['uuid'] = '3167d47d-0679-4336-b4c4-be68cdc28e5b';
|
||||
$nodes[$x]['cidr'] = '162.243.249.135/32';
|
||||
$nodes[$x]['description'] = 'VoiceTel';
|
||||
$x++;
|
||||
$nodes[$x]['uuid'] = 'e3d2e9b8-5807-4175-9ffc-57480ac94f83';
|
||||
$nodes[$x]['cidr'] = '192.254.76.222/32';
|
||||
$nodes[$x]['description'] = 'VoiceTel';
|
||||
$x++;
|
||||
$nodes[$x]['uuid'] = 'a1d70666-ab25-425a-9884-60530f4dd8b7';
|
||||
$nodes[$x]['cidr'] = '162.243.156.185/32';
|
||||
$nodes[$x]['description'] = 'VoiceTel';
|
||||
$x++;
|
||||
$nodes[$x]['uuid'] = '0bf5450f-c23b-4139-9e89-884bd0972912';
|
||||
$nodes[$x]['cidr'] = '94.75.246.200/32';
|
||||
$nodes[$x]['description'] = 'VoiceTel';
|
||||
$x++;
|
||||
$nodes[$x]['uuid'] = '181dcaf8-f990-4869-90e3-97de7d2daa5a';
|
||||
$nodes[$x]['cidr'] = '204.77.3.60/32';
|
||||
$nodes[$x]['description'] = 'VoiceTel';
|
||||
}
|
||||
|
||||
//return the array
|
||||
return $nodes;
|
||||
}
|
||||
|
||||
/**
|
||||
* gateways array
|
||||
*/
|
||||
public function gateways($provider) {
|
||||
|
||||
//build the array
|
||||
if ($provider == 'skyetel') {
|
||||
$x=0;
|
||||
$gateways[$x]['uuid'] = '22245a48-552c-463a-a723-ce01ebbd69a2';
|
||||
$gateways[$x]['name'] = 'term.skyetel.com';
|
||||
$gateways[$x]['proxy'] = 'term.skyetel.com';
|
||||
$gateways[$x]['username'] = 'username';
|
||||
$gateways[$x]['password'] = 'password';
|
||||
$gateways[$x]['register'] = 'false';
|
||||
$x++;
|
||||
$gateways[$x]['uuid'] = 'b171ba70-06a5-4560-82be-596ed9d00041';
|
||||
$gateways[$x]['name'] = 'skyetel.34';
|
||||
$gateways[$x]['proxy'] = '52.41.52.34';
|
||||
$gateways[$x]['username'] = 'username';
|
||||
$gateways[$x]['password'] = 'password';
|
||||
$gateways[$x]['register'] = 'false';
|
||||
$x++;
|
||||
$gateways[$x]['uuid'] = '4864ac6e-9e50-4fff-8381-2c508f8912b5';
|
||||
$gateways[$x]['name'] = 'skyetel.128';
|
||||
$gateways[$x]['proxy'] = '52.8.201.128';
|
||||
$gateways[$x]['username'] = 'username';
|
||||
$gateways[$x]['password'] = 'password';
|
||||
$gateways[$x]['register'] = 'false';
|
||||
$x++;
|
||||
$gateways[$x]['uuid'] = '5553606b-e543-4427-bb63-ebed16001937';
|
||||
$gateways[$x]['name'] = 'skyetel.216';
|
||||
$gateways[$x]['proxy'] = '50.17.48.216';
|
||||
$gateways[$x]['username'] = 'username';
|
||||
$gateways[$x]['password'] = 'password';
|
||||
$gateways[$x]['register'] = 'false';
|
||||
$x++;
|
||||
}
|
||||
if ($provider == 'voicetel') {
|
||||
//build the array
|
||||
$x=0;
|
||||
$gateways[$x]['uuid'] = 'd61be0f0-3a4c-434a-b9f6-4fef15e1a634';
|
||||
$gateways[$x]['name'] = 'voicetel';
|
||||
$gateways[$x]['proxy'] = 'sbc.voicetel.com';
|
||||
$gateways[$x]['username'] = 'username';
|
||||
$gateways[$x]['password'] = 'password';
|
||||
$gateways[$x]['register'] = 'true';
|
||||
$x++;
|
||||
}
|
||||
|
||||
//return the array
|
||||
return $gateways;
|
||||
}
|
||||
|
||||
/**
|
||||
* setup the provider
|
||||
*/
|
||||
public function setup($provider) {
|
||||
|
||||
//validate the provider
|
||||
switch ($provider) {
|
||||
case 'voicetel':
|
||||
break;
|
||||
case 'skyetel':
|
||||
break;
|
||||
default:
|
||||
$provider = '';
|
||||
}
|
||||
|
||||
//get the domains access control uuid
|
||||
$sql = "select access_control_uuid from v_access_controls ";
|
||||
$sql .= "where access_control_name = 'domains'; ";
|
||||
if ($this->debug) {
|
||||
echo $sql."<br />\n";
|
||||
}
|
||||
$prep_statement = $this->db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
$access_control_uuid = $result['access_control_uuid'];
|
||||
}
|
||||
unset($prep_statement);
|
||||
|
||||
//get the existing nodes
|
||||
$sql = "select * from v_access_control_nodes ";
|
||||
$sql .= "where access_control_uuid = '".$access_control_uuid."' ";
|
||||
$sql .= "and node_cidr <> '' ";
|
||||
if ($this->debug) {
|
||||
echo $sql."<br />\n";
|
||||
}
|
||||
$prep_statement = $this->db->prepare(check_sql($sql));
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$access_control_nodes = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
|
||||
//echo "<pre>\n";
|
||||
//print_r($access_control_nodes);
|
||||
//echo "</pre>\n";
|
||||
}
|
||||
|
||||
//get the existing nodes
|
||||
$sql = "select * from v_sip_profiles ";
|
||||
$sql .= "where sip_profile_enabled = 'true' ";
|
||||
$sql .= "order by sip_profile_name asc ";
|
||||
$sql .= "limit 1; ";
|
||||
if ($this->debug) {
|
||||
echo $sql."<br />\n";
|
||||
}
|
||||
$prep_statement = $this->db->prepare(check_sql($sql));
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
$sip_profile_name = $result['sip_profile_name'];
|
||||
}
|
||||
|
||||
//get the nodes array
|
||||
$nodes = $this->nodes($provider);
|
||||
|
||||
//add gateways
|
||||
$x = 0;
|
||||
foreach ($nodes as $row) {
|
||||
$array['access_control_nodes'][$x]['access_control_node_uuid'] = $row['uuid'];
|
||||
$array['access_control_nodes'][$x]['access_control_uuid'] = $access_control_uuid;
|
||||
$array['access_control_nodes'][$x]['node_type'] = 'allow';
|
||||
$array['access_control_nodes'][$x]['node_cidr'] = $row['cidr'];
|
||||
$array['access_control_nodes'][$x]['node_description']= $row['description'];
|
||||
$x++;
|
||||
}
|
||||
|
||||
//get the gateways array
|
||||
$gateways = $this->gateways($provider);
|
||||
|
||||
//gateways array
|
||||
if ($provider == 'skyetel') {
|
||||
//dialplan settings
|
||||
$dialplan_expression = '^\+?1?(\d{10})$';
|
||||
$dialplan_prefix = '1';
|
||||
}
|
||||
if ($provider == 'voicetel') {
|
||||
//dialplan settings
|
||||
$dialplan_expression = '^\+?1?(\d{10})$';
|
||||
$dialplan_prefix = '1';
|
||||
}
|
||||
|
||||
//add gateways
|
||||
$x = 0;
|
||||
foreach ($gateways as $row) {
|
||||
$array['gateways'][$x]['gateway_uuid'] = $row['uuid'];
|
||||
$array['gateways'][$x]['gateway'] = $row['name'];
|
||||
$array['gateways'][$x]['username'] = $row['username'];
|
||||
$array['gateways'][$x]['password'] = $row['password'];
|
||||
$array['gateways'][$x]['proxy'] = $row['proxy'];
|
||||
$array['gateways'][$x]['register'] = $row['register'];
|
||||
$array['gateways'][$x]['retry_seconds'] = '30';
|
||||
$array['gateways'][$x]['ping'] = '90';
|
||||
$array['gateways'][$x]['expire_seconds'] = '800';
|
||||
$array['gateways'][$x]['context'] = 'public';
|
||||
$array['gateways'][$x]['profile'] = $sip_profile_name;
|
||||
$array['gateways'][$x]['enabled'] = 'true';
|
||||
$array['gateways'][$x]['description'] = '';
|
||||
$x++;
|
||||
}
|
||||
|
||||
//set the dialplan variables
|
||||
if ($provider == 'skyetel') { $dialplan_uuid = '777bf012-9746-4ccb-a7cc-95c1714f15fe'; }
|
||||
if ($provider == 'voicetel') { $dialplan_uuid = '513e3710-1cbd-48da-b8f1-792eae471d3a'; }
|
||||
$app_uuid = '8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3';
|
||||
$dialplan_name = $provider;
|
||||
$dialplan_order = '100';
|
||||
$dialplan_continue = 'false';
|
||||
$dialplan_context = '${domain_name}';
|
||||
$dialplan_enabled = 'true';
|
||||
$dialplan_description = '10-11 digits';
|
||||
|
||||
//add outbound routes
|
||||
$x = 0;
|
||||
//$array['dialplans'][$x]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$array['dialplans'][$x]['dialplan_uuid'] = $dialplan_uuid;
|
||||
$array['dialplans'][$x]['app_uuid'] = $app_uuid;
|
||||
$array['dialplans'][$x]['dialplan_name'] = $dialplan_name;
|
||||
$array['dialplans'][$x]['dialplan_order'] = $dialplan_order;
|
||||
$array['dialplans'][$x]['dialplan_continue'] = $dialplan_continue;
|
||||
$array['dialplans'][$x]['dialplan_context'] = $dialplan_context;
|
||||
$array['dialplans'][$x]['dialplan_enabled'] = $dialplan_enabled;
|
||||
$array['dialplans'][$x]['dialplan_description'] = $dialplan_description;
|
||||
$y = 0;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_uuid'] = $dialplan_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_tag'] = 'condition';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_type'] = '${user_exists}';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'false';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
|
||||
$y++;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_uuid'] = $dialplan_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_tag'] = 'condition';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_type'] = 'destination_number';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = $dialplan_expression;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
|
||||
$y++;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_uuid'] = $dialplan_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_tag'] = 'action';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_type'] = 'set';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'sip_h_X-accountcode=${accountcode}';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
|
||||
$y++;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_uuid'] = $dialplan_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_tag'] = 'action';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_type'] = 'set';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'call_direction=outbound';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
|
||||
$y++;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_uuid'] = $dialplan_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_tag'] = 'action';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_type'] = 'unset';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'call_timeout';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
|
||||
$y++;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_uuid'] = $dialplan_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_tag'] = 'action';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_type'] = 'set';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'hangup_after_bridge=true';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
|
||||
$y++;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_uuid'] = $dialplan_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_tag'] = 'action';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_type'] = 'set';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'effective_caller_id_name=${outbound_caller_id_name}';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
|
||||
$y++;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_uuid'] = $dialplan_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_tag'] = 'action';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_type'] = 'set';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'effective_caller_id_number=${outbound_caller_id_number}';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
|
||||
$y++;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_uuid'] = $dialplan_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_tag'] = 'action';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_type'] = 'set';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'inherit_codec=true';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
|
||||
$y++;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_uuid'] = $dialplan_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_tag'] = 'action';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_type'] = 'set';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'ignore_display_updates=true';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
|
||||
$y++;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_uuid'] = $dialplan_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_tag'] = 'action';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_type'] = 'set';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'callee_id_number=$1';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
|
||||
$y++;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_uuid'] = $dialplan_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_tag'] = 'action';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_type'] = 'set';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'continue_on_fail=true';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
|
||||
$y++;
|
||||
|
||||
foreach ($gateways as $row) {
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_uuid'] = uuid();
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_uuid'] = $dialplan_uuid;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_tag'] = 'action';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_type'] = 'bridge';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_data'] = 'sofia/gateway/'.$row['uuid'].'/'.$dialplan_prefix.'$1';
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_order'] = $y * 10;
|
||||
$array['dialplans'][$x]['dialplan_details'][$y]['dialplan_detail_group'] = '0';
|
||||
$y++;
|
||||
}
|
||||
|
||||
//save to the data
|
||||
$database = new database;
|
||||
$database->app_name = 'outbound_routes';
|
||||
$database->app_uuid = '8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3';
|
||||
$database->save($array);
|
||||
$message = $database->message;
|
||||
|
||||
//debug
|
||||
//echo "<pre>\n";
|
||||
//print_r($array);
|
||||
//echo "<pre>\n";
|
||||
//exit;
|
||||
|
||||
//update the dialplan xml
|
||||
$dialplans = new dialplan;
|
||||
$dialplans->source = "details";
|
||||
$dialplans->destination = "database";
|
||||
$dialplans->uuid = $dialplan_uuid;
|
||||
$dialplans->xml();
|
||||
|
||||
//clear the cache
|
||||
$cache = new cache;
|
||||
$cache->delete("configuration:acl.conf");
|
||||
$cache->delete("configuration:sofia.conf:".$sip_profile_hostname);
|
||||
|
||||
//create the event socket connection
|
||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||
|
||||
//get the hostname
|
||||
if ($fp) { $sip_profile_hostname = event_socket_request($fp, 'api switchname'); }
|
||||
|
||||
//reload acl and rescan the sip profile
|
||||
if ($fp) { event_socket_request($fp, "api reloadacl"); }
|
||||
if ($fp) { event_socket_request($fp, "api sofia profile ".$sip_profile_name." rescan"); }
|
||||
}
|
||||
|
||||
/**
|
||||
* delete the provider
|
||||
*/
|
||||
public function delete($provider) {
|
||||
|
||||
//validate the provider
|
||||
switch ($provider) {
|
||||
case 'voicetel':
|
||||
break;
|
||||
case 'skyetel':
|
||||
break;
|
||||
default:
|
||||
$provider = '';
|
||||
}
|
||||
|
||||
//set the dialplan_uuid
|
||||
if ($provider == 'skyetel') { $dialplan_uuid = '777bf012-9746-4ccb-a7cc-95c1714f15fe'; }
|
||||
if ($provider == 'voicetel') { $dialplan_uuid = '513e3710-1cbd-48da-b8f1-792eae471d3a'; }
|
||||
|
||||
//delete child data
|
||||
$sql = "delete from v_dialplan_details ";
|
||||
$sql .= "where dialplan_uuid = '".$dialplan_uuid."'; ";
|
||||
$this->db->query($sql);
|
||||
unset($sql);
|
||||
|
||||
//delete parent data
|
||||
$sql = "delete from v_dialplans ";
|
||||
$sql .= "where dialplan_uuid = '".$dialplan_uuid."'; ";
|
||||
$this->db->query($sql);
|
||||
unset($sql);
|
||||
|
||||
//get the nodes array
|
||||
$nodes = $this->nodes($provider);
|
||||
|
||||
//delete each node
|
||||
foreach ($nodes as $row) {
|
||||
$sql = "delete from v_access_control_nodes ";
|
||||
$sql .= "where access_control_node_uuid = '".$row['uuid']."'; ";
|
||||
$this->db->query($sql);
|
||||
unset($sql);
|
||||
}
|
||||
|
||||
//get the gateways array
|
||||
$gateways = $this->gateways($provider);
|
||||
|
||||
//get the existing nodes
|
||||
$sql = "select * from v_sip_profiles ";
|
||||
$sql .= "where sip_profile_enabled = 'true' ";
|
||||
$sql .= "order by sip_profile_name asc ";
|
||||
$sql .= "limit 1; ";
|
||||
if ($this->debug) {
|
||||
echo $sql."<br />\n";
|
||||
}
|
||||
$prep_statement = $this->db->prepare(check_sql($sql));
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
$sip_profile_name = $result['sip_profile_name'];
|
||||
}
|
||||
|
||||
//create the event socket connection
|
||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||
|
||||
//delete each gateway
|
||||
foreach ($gateways as $row) {
|
||||
//stop the gateway
|
||||
if ($fp) { event_socket_request($fp, "api sofia profile ".$sip_profile_name." killgw ".$row['uuid']); }
|
||||
|
||||
//delete the gateway
|
||||
$sql = "delete from v_gateways ";
|
||||
$sql .= "where gateway_uuid = '".$row['uuid']."'; ";
|
||||
$this->db->query($sql);
|
||||
unset($sql);
|
||||
}
|
||||
|
||||
//clear the cache
|
||||
$cache = new cache;
|
||||
$cache->delete("configuration:acl.conf");
|
||||
$cache->delete("configuration:sofia.conf:".$sip_profile_hostname);
|
||||
|
||||
//get the hostname
|
||||
if ($fp) { $sip_profile_hostname = event_socket_request($fp, 'api switchname'); }
|
||||
|
||||
//reload acl and rescan the sip profile
|
||||
if ($fp) { event_socket_request($fp, "api reloadacl"); }
|
||||
if ($fp) { event_socket_request($fp, "api sofia profile ".$sip_profile_name." rescan"); }
|
||||
}
|
||||
|
||||
} //end scripts class
|
||||
}
|
||||
|
||||
/*
|
||||
//example use
|
||||
$provider = new providers;
|
||||
$reports->domain_uuid = $_SESSION['domain_uuid'];
|
||||
$provider->setup();
|
||||
*/
|
||||
|
||||
?>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
|
|
@ -0,0 +1,90 @@
|
|||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
// make sure the PATH_SEPARATOR is defined
|
||||
umask(2);
|
||||
if (!defined("PATH_SEPARATOR")) {
|
||||
if (strpos($_ENV["OS"], "Win") !== false) {
|
||||
define("PATH_SEPARATOR", ";");
|
||||
} else {
|
||||
define("PATH_SEPARATOR", ":");
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html';
|
||||
|
||||
// make sure the document_root is set
|
||||
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]);
|
||||
if(PHP_SAPI == 'cli'){
|
||||
chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME));
|
||||
$script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]);
|
||||
$dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME));
|
||||
if (file_exists('/project_root.php')) {
|
||||
$path = '/';
|
||||
} else {
|
||||
$i = 1;
|
||||
$path = '';
|
||||
while ($i < count($dirs)) {
|
||||
$path .= '/' . $dirs[$i];
|
||||
if (file_exists($path. '/project_root.php')) {
|
||||
break;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$_SERVER["DOCUMENT_ROOT"] = $path;
|
||||
}else{
|
||||
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
|
||||
}
|
||||
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
|
||||
// try to detect if a project path is being used
|
||||
if (!defined('PROJECT_PATH')) {
|
||||
if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) {
|
||||
define('PROJECT_PATH', '/fusionpbx');
|
||||
} elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) {
|
||||
define('PROJECT_PATH', '');
|
||||
} else {
|
||||
$dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME)));
|
||||
$i = 1;
|
||||
$path = $_SERVER["DOCUMENT_ROOT"];
|
||||
while ($i < count($dirs)) {
|
||||
$path .= '/' . $dirs[$i];
|
||||
if (file_exists($path. '/project_root.php')) {
|
||||
break;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if(!file_exists($path. '/project_root.php')){
|
||||
die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance");
|
||||
}
|
||||
$project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path);
|
||||
define('PROJECT_PATH', $project_path);
|
||||
}
|
||||
$_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH);
|
||||
set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]);
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Reference in New Issue