Estatus de registro en escritorio - VoIP.ms Wiki

Check out our YouTube channel to watch our simple tutorials that will help you set up most of our features.

Estatus de registro en escritorio

From VoIP.ms Wiki

Revision as of 18:27, 8 September 2011 by Alex.voip.ms (Talk | contribs)
Jump to: navigation, search

Esta es una herramienta util para usuarios Mac, le permitirá verificar el estado de su registro desde el escritorio, simplemente utilizando algunas aplicaciones e interactuando con la API de VoIP.ms, usted podrá monitorear sus lineas. La configuracion de diferentes aplicaciones es necesaria para esta herramienta, por lo cual está recomendada para usuarios avanzados.

Primero necesita bajar e instalar GeekTool, si quiere tener alertas que le notifiquen acerca de cualquier cambio en el registro, también debera bajar Growl y asegurarse de instalar Growlnotify de la carpeta "Extras" en el disco.

  • Inicie sesión en su cuenta de VoIP.ms. En la pestaña de "Main Menu", seleccione "SOAP and JSON/REST API".
  • Muevas a la parte de abajo en la página y active la API, asigne una contraseña (puede ser diferente de la contraseña principal de la cuenta) y escriba su dirección IP. Presione el boton de "actualizar" después de cada cambio.
  • En la misma pagina, busque el enlace "Click here to download Example Codes and API Documentation" , descargue este documento y busque la carpeta llamada "Examples SOAP for PHP5". En esta carpeta busque el documento "class.voipms.php"
  • Abra el documento "class.voipms.php" usando el editor de texto, ponga su número de cuenta y el password de la API en la parte de arriba y guarde la información para tenerla a mano.

Su cuenta esta ahora lista para el acceso automatiza y monitoreo. Ahora vea el siguiente "script" que llamaremos desde GeekTool:

<?php
require_once("class.voipms.php");
$voipms = new VoIPms();
/* Account #1 */
$account = "[account_subaccount goes here]";
/* Get Registration Status */
$response = $voipms->getRegistrationStatus($account);
/* Get Errors - Invalid_Account */
if($response[status]!='success')
{
echo $response[status];
exit;
}
/* Is Registered */
echo "{$account} Registered : {$response[registered]}
";
if($response[registered]!='yes')
{
exec ('/usr/local/bin/growlnotify -m "VoIP Down"');
}
/* Account #2 */
$account = "[account_subaccount #2 goes here]";
/* Get Registration Status */
$response = $voipms->getRegistrationStatus($account);
/* Get Errors - Invalid_Account */
if($response[status]!='success')
{
echo $response[status];
exit;
}
/* Is Registered */
echo "{$account} Registered : {$response[registered]}
";
if($response[registered]!='yes')
{
exec ('/usr/local/bin/growlnotify -m "VoIP Down"');
}
date_default_timezone_set ("America/Los_Angeles");
echo date("d M y   H:i:s",time())
?>


Copy that and paste into TextEdit. (Note example is made to check two subaccounts-- the code is easily modified to handle any number.) Put your subaccount number(s) in it, and save it with a .php extension in the same folder you just saved class.voipms.php in. In this case, the file is named voip.php.

Geek1.png

Now, open GeekTool. Drag a Shell object onto your desktop. In the Command field of the object, type a php command to execute the file you just saved, the command looks like:

php ~/Documents/geekvoip/voip.php

Good settings for the GeekTool object are a Refresh of perhaps 600 seconds and a timeout of maybe 10 seconds.

Geek2.png

You're done! Position and size the GeekTool object as desired, and it will always be on your desktop. If you've installed Growlnotify, you'll see a pop-up notification on the exceedingly rare occasion that your VoIP line can't be reached.

This Article was originally created by Scott Jordan. Source link: http://unvexed.blogspot.com/2011/07/how-to-be-alerted-when-your-voip-goes.html

Namespaces
Variants
Actions
VoIP.ms Wiki
Guides 🇨🇦
Guías 🇲🇽