Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
JAVA_HOME=/opt/openfire/jre
GAPSLITE_HOME=/tftpboot/GS_CFG_GEN
Buscamos en /var/www/html/modules/endpoint_configuration/libs/paloSantoFileEndPoint.class.php :
exec("/tftpboot/GS_CFG_GEN/bin/encode.sh {$ArrayData['data']['filename']}
/tftpboot/gxp{$ArrayData['data']['filename']}.cfg
/tftpboot/cfg{$ArrayData['data']['filename']}.cfg",$arrConsole,
$flagStatus);
Y lo reemplazamos con:
exec("/tftpboot/GS_CFG_GEN/bin/encode.sh {$ArrayData['data']['filename']}
/tftpboot/gxp{$ArrayData['data']['filename']}.cfg
/tftpboot/cfg{$ArrayData['data']['filename']}",$arrConsole,$flagStatus);
Despus de estas modificaciones el mdulo podr crear y guardar los archivos que el telfono requiere
para que funcione en nuestra implementacin.
Lo primero que necesitaremos es descargar el firmware, paquete de lenguaje castellano y tonos de
timbre para el modelo de telfono GXP280/GXP2000 (el mismo firmware sirve para ambos telfonos):
cd /tftpboot
wget
http://www.grandstream.com/firmware/BT200_GXP/Release_BT200_GXP_1.2.5.3.z
ip
unzip Release_BT200_GXP_1.2.2.26.zip
wget http://www.grandstream.com/firmware/BT200_GXP/GXP_Language_Pack.zip
unzip GXP_Language_Pack.zip
unzip Spanish.zip
wget http://www.grandstream.com/firmware/BT200_GXP/RingTone.zip
unzip RingTone.zip
El modulo de provisionamiento no muestra en sus opciones el modelo GXP280, podemos agregarlo con
el siguiente procedimiento:
sqlite3 /var/www/db/endpoint.db
sqlite> insert into model values(50,'GXP280','GXP280',3);
sqlite> insert into model values(51,'BT200','BT200',3);
sqlite> .exit
Reemplazamos la plantilla que esta ubicada en
/var/www/html/modules/endpoint_configuration/libs/vendors/Grandstream.cfg.php :
<?php/*
PrincipalFileGrandstream nos retorna el contenido del archivo de
configuracion de los EndPoint
Grandstream, para ello es necesario enviarle el DisplayName,
id_device, secret, ipAdressServer
*/function PrincipalFileGrandstream($DisplayName, $id_device, $secret,
$ipAdressServer)
{
$content="
# Clave de administracion del dispositivo
# Recuerden cambiarla por una contrasea mas segura
P2 = verysecurepassword
# Nombre de la cuenta
P270 = $id_device
# Servidor SIP
P47 = $ipAdressServer
# Proxy SIP
P48 = $ipAdressServer
# SIP User ID
P35 = $id_device
# Authenticate ID
P36 = $id_device
# Authenticate password
P34 = $secret
# Busy Tone
P348 = f1=425,f2=425,c=33/33;
# NTP Server
P30 = $ipAdressServer
#----------------------------------------
# XML Phonebook
#----------------------------------------
# Enable Phonebook XML Download
# 0 = No
# 1 = YES, HTTP
# 2 = YES, TFTP
P330 = 2
return $content;
}
function templatesFileGrandstream($ipAdressServer)
{
$content= <<<TEMP# SIP Server
P47 = $ipAdressServer
# Outbound Proxy
P48 = $ipAdressServer
# SIP User ID
P35 = 8000
# Authenticate ID
P36 = 8000
# Authenticate password
P34 = 0000
<?php
// File: gs_phonebook.php
// version: 1.0
// Date: 07-17-2006
// Author: Shane Steinbeck http://www.steinbeckconsulting.com
// Description: Realtime XML phonebook from MySQL database for
Grandstream GXP-2000 firmware 1.1.1.17
// Modified by Guillermo Salas <gsalas@mantareys.com> to use the FreePBX
database to show the name and
// extension number.
header("Content-type: text/xml");
$host = "localhost";$user = "root";$pass = "eLaStIx.2oo7";$database =
"asterisk";
$linkID = mysql_connect($host, $user, $pass) or die("Could not connect to
host.");mysql_select_db($database, $linkID) or die("Could not find
database.");
$query = "SELECT user, description FROM devices ORDER BY description
ASC";
$resultID = mysql_query($query, $linkID) or die("Data not found.");
$xml_output .= "\t\t\t</Phone>\n";
$xml_output .= "\t</Contact>\n";
}
$xml_output .= "</AddressBook>";
/************************************************************************
***************
* Author: Mike
* Date: 10/03/2006
* This snipplet will save your xml file to the server for easier
updating of your phone.
* To facilitate automatic updates, add a cron job to run this file at
your desired interval (i.e. hourly).
*/
$filename = "/tftpboot/gs_phonebook.xml";
$fp = fopen($filename, 'wb');
fwrite($fp, $xml_output);
fclose($fp);
/************************************************************************
**************/
print($xml_output);
echo $xml_output;
?>
vi /etc/cron.daily/gs_phonebook
/usr/bin/php /tftpboot/gs_phonebook.php