Registration status on desktop - VoIP.ms Wiki

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

Registration status on desktop

From VoIP.ms Wiki

Jump to: navigation, search
Article en Français Artículo en Español
Français

Español


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.

  • Log on to your voip.ms account. In the tab marked "Main Menu", select the "SOAP and JSON/REST API".
  • Scroll down to the bottom. Enable the API, assign a password (which can be different from your login password), and enter your IP address. Click the update buttons after each entry.
  • Scroll up a bit, and look for the link that says "Click here to download Example Codes and API Documentation" Download this, unzip, and look for the folder entitled "Examples SOAP for PHP5." In this folder, look for the document "class.voipms.php".
  • Open class.voipms.php using TextEdit. Put your account number and API password in it up top, then save it somewhere handy.

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

  • Direct link to your Portal home page (Account icon)
  • Direct link to "Add funds" page (Balance icon)
  • Show your current balance
  • Show to which server you are currently registered.
  • Show the last 7 calls. (Inbound & Outbound).
  • Some icons have tooltip hover to show more details. (Registration Device IP:Port, Call Duration, Caller Name)
  • The gadget updates itself automaticaly every 5 minutes and can also be updated manually.

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 Blog
Guides (Français)
Guías (Español)