Doddle Phone(WebPhone)
Posted: Sun Feb 06, 2011 9:16 pm
I modified zoiperweb_redirect.php to work with doddlephone, a web based java softphone. Going to post in the Issue Tracker in case the VICI team wants to incorporate it.
- Code: Select all
<?php
# doddling_redirect.php - used for loading doddlephone with variables
#
# Modified by Acidshock to work with doddlephone. Originally written by Matt Florell. See copyright information below.
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGELOG
# 100827-1419 - First Build
#
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];}
elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];}
if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];}
elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];}
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
if (isset($_GET["callerid"])) {$callerid=$_GET["callerid"];}
elseif (isset($_POST["callerid"])) {$callerid=$_POST["callerid"];}
if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];}
elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];}
if (isset($_GET["codecs"])) {$codecs=$_GET["codecs"];}
elseif (isset($_POST["codecs"])) {$codecs=$_POST["codecs"];}
if (isset($_GET["options"])) {$options=$_GET["options"];}
elseif (isset($_POST["options"])) {$options=$_POST["options"];}
if (isset($_GET["system_key"])) {$system_key=$_GET["system_key"];}
elseif (isset($_POST["system_key"])) {$system_key=$_POST["system_key"];}
$phone_pass = base64_decode($phone_pass);
$server_ip = base64_decode($server_ip);
$phone_login = base64_decode($phone_login);
$query_string = "/embed/webphone.jsp?sipserver=$server_ip&username=$phone_login&password=$phone_pass";
$servers = array("widget.doddlephone.com","widget.doddlephone.com");
$server = $servers[array_rand($servers)];
$URL = "http://$server$query_string";
header("Location: $URL");
echo"<TITLE>Webphone Redirect</TITLE>\n";
echo"<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">\n";
echo"<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=$URL\">\n";
echo"</HEAD>\n";
echo"<BODY BGCOLOR=#FFFFFF marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
echo"<a href=\"$URL\">click here to continue. . .</a>\n";
exit;
?>