Registration status on desktop - VoIP.ms Wiki

Registration status on desktop

From VoIP.ms Wiki

Revision as of 17:11, 17 February 2012 by Esenterre (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents


Mac version

This is a useful tool for Mac, that lets you to see your Registration status on your desktop, using a few applications and interacting with VoIP.ms API, you can achieve this and monitor your lines. Downloading/configuring several apps will be required, so this guide is recommended only for advanced users.

First you need to download and install GeekTool, if you want alerts to pop up to notify you when an outage occurs, also download Growl and be sure to install Growlnotify from the Extras folder on its disk.

Your account is now set up for automated access and monitoring. Here's a simple script which we'll call from 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

Windows Version

Windows (Vista / 7) users can now also have the registration status on their desktop (and a little more). This new gadget was based on Scott Jordan idea and was extended to add other useful informations available thru the VoIP.ms API.

This is the first version of the gadget and it basically answers my personal needs for the moment. Any feedback/suggestions are welcome.

You can grab a copy of this gadget at this Google Code website : http://code.google.com/p/voipms-monitor-gadget/

Features

Screenshot

Windows-gadget-screenshot1.png Windows-gadget-screenshot2.png


This gadget was developped by Éric Senterre as a personal projet, VoIP.ms doesn't support this.

Personal tools
Namespaces
Variants
Actions
VoIP.ms Wiki
Configuration
Guides (English)
Guides (Français)
Guías (Español)
Toolbox