Call Statistics from Sonus UX 1000/2000 using the RESTful API

We all love statistics

Posted on August 06, 2015

Introduction

Challenged to collect call statistics from our Sonus UX 1000 SBC the first thought was to use SNMP. After enabling SNMP and pointing an SNMPwalk tool with MIB to the SBC, I struggled to find anything useful that could be used by our monitoring software with its native SNMP sensor. Why taunt me with your call counters in the web administration interface and not expose them through SNMP?

My colleagues have been using the Sonus UX REST API and PowerShell to load up configurations when deploying so thought I’d give it a go. Not much browsing time later and I had the API calls needed:

This is what I ended up with.

The Script

Nothing much to it.

.\Get-SonusUxCallCounters.ps1 -Username "restuser" -Password "restpassword" -ServerFqdn "sbc.contoso.com" -Type SIP -Id 1

Type can be SIP, ISDN or CAS.

PRTG

Choose the “EXE/Script Advanced” sensor type and fill in the settings:

![](/assets/img/prtg.png)

I’ve used the Linux username and password of the parent device to pass through the REST credentials.

A little while later…

Stats!

![](/assets/img/graph.png)

Guess everyone went home around 5.30 :)

![](/assets/img/table.png)

That’ll keep the boss entertained.

Download

Downoad Get-SonusUxCallCounters.ps1