LogoLogo
Help
  • Overview
    • Introduction
    • Characteristics
    • Platforms
  • INITIAL Installation
    • 1. Instructions by platform
      • ProSBC Requirements Matrix
      • Baremetal Installation
        • List of Supported Network Interface Cards
        • SBC Certified Hardware
          • High Performance Baremetal Server
          • Medium Performance Baremetal Server
          • Ciena 3906mvi server for Customer Premises Equipment (CPE)
          • Qotom Barebone server for Customer Premises Equipment (CPE)
          • Lanner Barebone server for Customer Premises Equipment (CPE)
          • Telco Systems virtualization platform on Lanner NCA-2510 server for Customer Premises Equipment(CPE)
      • Virtual, self-hosted Installation
        • Virtual - Proxmox
        • Virtual - VMware
          • Launching an Instance of VMware vSphere
          • Deploying ProSBC on VMware
          • Adding Network Interfaces in VMware
          • Configuring Passtrough interfaces on VMware
      • Cloud Installation
        • Cloud - AWS
          • AWS Installation
          • Cloud Formation Installation
          • Instance Upgrade
          • AWS Additional Interface
          • AWS Installation Troubleshooting
          • Recovering an Elastic IP address
        • Cloud - Azure
    • 2. Initial Configuration
      • Initial Setup
        • SBC Management IP configuration
      • Basic configuration
        • Configuring IP interfaces
        • Creating a SIP stack
        • Creating a SIP transport server
        • Allocating an SIP NAP
        • Allocating a SIP open NAP
        • SIP Transport DNS settings
        • Creating a first call route
    • 3. Uploading a License
      • Host-control
        • SELinux
        • SELinux management
      • Add/Change Licenses
        • Add/Change Licenses Manually
  • Use Cases
    • Applications
      • Carrier Interconnection
      • Monitoring as a Service (MaaS)
      • NGN Interconnection
      • Operator Interconnection
      • SIP subscribe notify publish forwarding
      • STIR/SHAKEN
      • Transcoding
      • SIP Trunking
      • Hosted PBX
      • SIP Network Peering
      • Remote Workers
    • Interoperability Examples
      • STIR/SHAKEN with Transnexus and ClearIP
      • Fraud Detection [YouMail]
      • Skype Connect
      • Skype for Business S4B TCP
      • Skype for Business S4B TLS
      • Asterisk
      • 3CX
      • FreePBX
      • FusionPBX
      • FreeSWITCH
      • Twilio
      • Sippy
      • Avaya IP Office
      • Cisco UCM 12
      • Brekeke PBX
      • VitalPBX
      • Yeastar P-Series Cloud
      • VoIP.ms
      • Wildix
  • CONFIGURATION DETAILS
    • Configuration By Web Portal Category
      • System Settings
        • Setting the Role to Standalone
        • Setting the Role to a Primary Unit in a 1+1 System
        • Setting the Role to a Secondary Unit in a 1+1 System
        • Resetting the Host Role
        • Resetting the Network Device Role
        • Create Session Border Gateway Access Control List (ACL)
        • Session Border Gateway: Advanced Parameter Settngs
        • Create Session Border Gateway Access Control List (ACL) Filters
        • Connecting to the Web Server and Logging on to the Web Portal
        • Logging Off
        • Modifying Security Settings
        • Creating Web User groups
        • Creating Web Users
        • Modifying Web User Permissions
        • Enabling and Disabling a User
        • Deleting a User
        • Accessing Audit Logs
        • Activating the Configuration
        • Configuring a Web Portal Profile
        • Configuring the Date, Time, Timezone and NTP servers
        • Configuring the DNS
        • Create HTTP Service
        • Use HTTPS service
        • Configure HTTPS certificates
        • Configuring letsencrypt certificate
        • Configuring the ICMP
        • Configuring the SSH
        • Upgrade Telcobridges linux software packages
        • Retrieving a Software Release
        • Uploading a Software Release
        • Activating a Software Release
        • Retrieving a License
        • Uploading a License
        • Database Backup
        • Downloading a Database Backup
        • Uploading a Database Backup
        • Restoring a Database
        • Enabling the SNMP Agent
        • Configuring the SNMP Agent
        • Creating an SNMPv1/SNMPv2 Community
        • Creating an SNMPv3 User
        • Creating an SNMP Trap Destination
      • IP Network Settings
        • Configuring a Virtual Port
        • Configuring a VLAN
        • Configuring an IP Port Range
        • Configuring IP Interfaces
        • Configuring NAT Traversal
          • Local NAT Traversal
          • Remote NAT Traversal
        • DNS Configuration
          • Creating a DNS Local Entry
        • Configuring VoIP Interfaces
      • SIP
        • Creating a SIP Stack
        • Creating a SIP Transport Server
        • TLS/SRTP
          • Creating TLS Certificates
          • Adding TLS Certificates
          • Configuring TLS Profiles
        • Enabling SIP-I/SIP-T
        • SIPREC Forwarding
      • SIP Registrar
        • Creating a SIP Domain
        • Creating a SIP Registrar
        • Creating a SIP Register Filtering Rule
        • Creating a SIP Register Filtering Rule Condition
        • Creating a SIP Register Filtering Rule Action
      • Network Access Points (NAP)
        • Allocating a SIP Open Network Access Point (NAP)
        • SIP NAP Polling
      • NAP Profiles
        • Profile SDP Description
        • Fax Settings
          • Configuring Fax Relay
          • Configure Fax Passthrough
          • Configure Fax T38
          • Configure Fax NSE
          • Configure Fax VBD
      • Call Routing
        • Creating a First Call Route
        • Enable Flexible NOA Routing Script
        • Add NOA Columns in Routes
        • Import Customized Routing Script
        • Add Customer Column in Routes
        • Add Customized Filter Script To Main Script
        • Adding Label Routing to a Routing Script
        • Assign Routing Script Database Files to the Gateway Application
        • Add Digitmap Files to the System
        • Add Routeset Definition Files to the System
        • Assign Definition Digitmap Files on a per NAP Basis
        • Generate Dynamic Routes
        • Steps to configure label routing for Group of DIDs to a single outbound NAPs
        • Steps to configure label routing for Group of DIDs to multiple outbound NAPs
        • Group of DIDs to multiple outbound NAPs: Load-sharing mode
        • Group of DIDs to multiple outbound NAPs: Priority Mode
        • Update the Digitmap Files
        • Update the Routeset Definition Files
        • Configuring RADIUS Authorization
        • Importing a RADIUS Custom Dictionary
      • Lawful Intercept
        • Lawful Intercept Status
        • Verifying lawful interception
        • Importing a Lawful Interception .CSV File
        • Enabling Lawful Interception in a Routing Script
        • Configuring Lawful Interception
      • Call Detail Records (CDR)
        • CDR Variables
          • Call statistics format
        • Retrieve Text CDRs
          • Automatic CDR Retrieval
        • RADIUS CDRs
          • Configuring RADIUS
          • Adding RADIUS Server(s)
          • RADIUS CDR attributes
      • Routing Scripts
        • Development Guides & Tutorials
          • Accessing Routing Script Parameters
          • Parameter Mapping
          • Script Parameters Definition
          • Script Parameters Definition for SIP
          • Accessing Information about Registered Users
          • Route Parameters and Call Routing
          • Playing prompts, announcements, and tones
          • Recording
          • User-to-User Information
          • Radius Authorization
          • ENUM Query
          • DNS Query
          • Call Diversion Options
          • Call Transfer Requests
          • Redirection
          • Connect Number
          • Terminating Calls
          • NAP Status and other NAP Information
          • Telephony Services (CNAM Requests over SS7)
          • Custom User Context
          • Routing Script Tests
          • Create New Routing Script
          • Enable Routing Script
    • Configuration By Use Case
      • SIP Trunking Configuration
        • Configuration Files for SIP Trunking Scenario
        • SIP Trunk Configuration Instruction with 3CX
        • SIP Trunk Configuration Instruction with FreePBX
        • SIP Trunk Configuration Instruction with FusionPBX
        • SIP Trunk Configuration Instruction with FreeSWITCH
        • SIP Trunk Configuration Instruction with Twilio Elastic trunking
        • SIP Trunk Configuration Instruction with Avaya IP Office
        • SIP Trunk Configuration Instruction with Brekeke PBX
        • SIP Trunk Configuration Instruction with Avaya IP Office
        • SIP Trunk Configuration Instruction with Yeastar P-Series Cloud
        • SIP Trunk Configuration Instruction with Cisco UCM
        • SIP Trunk Configuration Instruction with VoIP.ms SIP trunking
        • SIP Trunk Configuration Instruction with Wildix Cloud VoIP PBX
        • Configuration for Adding ProSBC as a SIP Trunk in the FreePBX Server
        • FreePBX Extension Creation
        • FusionPBX SIP Trunk Creation
        • FusionPBX Extension Creation
        • FreeSWITCH SIP Trunk Creation
        • Twilio Elastic SIP Trunking Configuration
        • Sippy SIP Trunk Creation
        • Avaya IP Office Trunk Creation
        • Cisco UCM 12 Trunk Creation
        • Adding ProSBC as a SIP Trunk in the Brekeke PBX
        • VitalPBX Extension Creation
        • Adding ProSBC as a SIP Trunk in the Yeastar P-Series Cloud
        • Adding ProSBC as a SIP Trunk in the Wildix Cloud VoIP PBX
        • SIP Trunk Configuration Instruction with VitalPBX
        • VitalPBX SIP Trunk Creation
      • Configuring SIP Registration to SIP Proxy
      • Configuring a Hosted PBX
      • Multiple Domains/Hosted PBXs
      • SIP Network Peering / IP Carrier Interconnection
      • Remote Workers
        • Configuration Files for Remote Office/Workers
        • Remote Workers Configuration Instruction with FusionPBX
        • Remote Workers Configuration Instruction with 3CX
        • Remote Workers Configuration Instruction with FreePBX
        • Remote Workers Configuration Instruction with VitalPBX
      • ProSBC and ClearIP (TransNexus)
        • Configuration for STIR/SHAKEN with Transnexus' ClearIP service
        • Configuration for CNAM Verification and Robocall Analytics with Transnexus' ClearIP service
        • Configuration for Robocall Mitigation with Transnexus' ClearIP service
        • Configuration for 302 Redirect routing with Transnexus' ClearIP service
        • Configuration for CAPTCHA Authentication – 302 Redirect with Transnexus' ClearIP service
        • Configuration for STIR/SHAKEN with Transnexus' ClearIP service
      • Transcoding Unit Configuration
        • Baremetal and Virtual Machine
        • Show the Hardware Units menu
        • Adding Transcoding Unit
      • Configuration for Adding YouMail Script to Routing Scripts
      • Skype Connect Example Configuration
      • Skype for Business Example Configuration
      • 3CX Phone Provisioning Configuration
        • Configuration for 3CX PBX Server with the ProSBC to receive T38 Faxes
        • Configuration for 3CX PBX Server with the ProSBC as SIP trunk
      • SIP Emergency
      • SIP registration forwarding
        • Creating a SIP Domain
        • Configuring SIP Registration for Open NAP
        • Configuring SIP Registration for regular NAP
      • RTP no-anchoring
        • Parameter: Allow low-delay media relay
          • Configuring an IP Port Range
        • Creating Profiles
          • Modifying SDP Profile Settings
          • Modifying SIP Profile Settings
          • Modifying RTP and Audio Settings
          • Modifying FAX Relay Profile Settings
          • Modifying Telephony Profile Settings
          • Modifying Tones and Call Progress Options
          • Modifying IVR Record Profile Settings
          • Modifying LNP Profile Settings
          • Modifying Multilevel Precedence and Preemption (MLPP) Options
          • Modifying Call Transfer Profile Settings
          • Modifying Tone Definition Profile Settings
    • Configuration Parameters (all)
    • Routing Script - SIP 302 Handling
  • Maintenance & Troubleshooting
    • Maintenance Guide
      • Check Disk Space
      • ProSBC Processor Usage
      • Troubleshooting Toolpack
      • Restoring a Database
    • System Upgrades
      • Migrate current database
      • Upgrade Telcobridges linux software packages
    • Software version release notes
    • Software version release download
    • ProSBC public roadmap
  • Troubleshooting & Support
    • Troubleshooting Tips & Actions
      • Configuring Call Trace
        • Retrieving Call Trace
        • Call Trace Filter Parameters
      • Creating a test call
      • tbsigtrace: Signaling trace capture tool
        • Accessing Device
          • TMG:Change Management IP Address
          • Password less ssh
          • How to setup ssh tunnel with PuTTY
        • Live Signaling Capture with tbsigtrace
      • How to Get Rid of Sub Optimal Warning
      • How to Lower The Trace Level on an Application
      • TBReport
      • VoIP Ethernet Capture on a ProSBC
      • Enabling Call Recording
      • Accessing the Call Recording
      • Routing Scripts
        • Update Your Routing Scripts
        • Disabling a Call Route
    • Troubleshooting Common Problems
    • Support Links
      • Support Forums
      • ProSBC Training
      • Customer Dashboard User Guide
      • Contacting TelcoBridges technical support
      • Frequently Asked Questions
      • Sending Large Files to TelcoBridges
    • How to use tbx cli tools remote program
  • Tools, Tips, and Tricks
    • TelcoBridges Magic Bookmark
    • Video Library
    • RESTful API
      • Postman Examples
      • Ruby Examples
      • TBConfig Examples
        • Exporting a Configuration
        • Importing a Configuration
        • Activating a Configuration
        • Updating a Route
        • Dropping Calls
      • ProSBC:Restful API SIP Domain
      • ProSBC:Restful API SIP Domain Registrar
      • Extracting Call Traces with the API
    • TBStatus API
      • Tbstatus monitoring
      • Status API
      • Dropping calls
  • Appendices
    • Appendix A: Glossary
      • Glossary: Call Detail Records (CDR)
      • Glossary: Call routing
      • Glossary: DNS
      • Glossary: Mean Opinion Score (MOS)
      • Glossary: NAP
      • Glossary: RADIUS
      • Glossary: Ringback tones
      • Glossary: SAP
      • Glossary: Signaling protocols
      • Glossary: SIP
        • Glossary: Route retry
        • Glossary: SIGTRAN
        • Glossary: SIP-I/SIP-T
        • Glossary: SIP gateway
        • Glossary: SIP Registration
      • Glossary: Softswitch
      • Glossary: Toolpack
        • Glossary: Web server
        • Glossary: tboamapp
          • Glossary: Tbtoolpack Service
            • System Id
              • Gateway Port
          • Primary/Secondary
          • Master/Slave
            • Active/Standby
      • Glossary: Unified communications
      • Glossary: Web Portal
      • Glossary: DTMF Relay
    • Appendix B: Product Datasheets
Powered by GitBook
On this page
  • Getting used with Status API
  • Viewing status tree using Web Portal
  • Viewing status tree using the command-line tool
  • Viewing statistics field description with the command-line tool
  • Paths for ISUP Circuit states
  • Querying/modifying individual field value using the command-line tool
  • How to write code that use that API

Was this helpful?

  1. Tools, Tips, and Tricks
  2. TBStatus API

Status API

The Status API allows to fetch statistics from the software components running in Toolpack or TMG-CONTROL.

Getting used with Status API

Status API consists of status request queries based on a "path". Each status has a path, like:

/adapter
/adapter/ip_interface
/isup/interface
/clock/ref
etc.

We already provide two ways of accessing the Toolpack Status:

- Web Portal
- Command-line tool "tbstatus", that you will find installed within toolpack installation under /lib/tb/toolpack/pkg/2.X.X/bin/release/[your_platform]/tbstatus

Viewing status tree using Web Portal

I suggest that you start by using the "browse" option in the WEB portal: Go to the Web Portal -> Status -> Browse This tool will list available paths that can be queried. When you click one of these paths, the web page will show a table that list all fields returned from that path.

Note: If you bring the mouse over a field name, a tool tip will appear and show a short description.

Viewing status tree using the command-line tool

The command-line tool will also allow getting a list of available paths:

./tbstatus

You can also query stats using one of these path, result is formatted as text output:

./tbstatus /adapter

Example above show stat of all adapters. You can query more specific stats too:

./tbstatus /adapter:TB005432 

Or you can query "recursive" information that also includes paths "under" a base path:

./tbstatus /adapter:TB005432/* 

Or you can query very deep and specific information:

./tbstatus /isup:ISUP/interface:ISUP_INTERFACE/cic_group:C002020_2_0_12

Viewing statistics field description with the command-line tool

You can query a short description of each statistic field by providing the '-D' option to the command-line tool.

./tbstatus /isup/interface/cic_group -D

For example:

[root@TB011107 monitoring]# tbstatus /isup/interface/cic_group -D
The requested path is '/isup/interface/cic_group'.
0:/isup:ISUP/interface:ISUP_IF0/cic_group:C011107_00
C011107_00 -
  - desired_group_state                   : Default       (Default,Blocked,Unblocked) Circuit Group desired state.
  - toggle_group_reset                    : No            (No,Yes) Setting this flag will toggle a Circuit Group reset.
  - start_continuity_check                : No            (No,Yes) Setting this flag will send a Continuity Check Request (CCR) on all CICs of the group (not available if no drop box).
  - interface_down                        false           Circuit group's interface is down.
  - idle_cnt                              30              Number of idle circuits.
  - incoming_cnt                          0               Number of active incoming circuits.
  - outgoing_cnt                          0               Number of active outgoing circuits.
  - locally_blocked_cnt                   0               Number of circuits in locally blocked state (maintenance).
  - remotely_blocked_cnt                  0               Number of circuits in remotely blocked state (maintenance)).
  - locally_remotely_blocked_cnt          0               Number of circuits in locally remotely blocked state.
  - reset_cnt                             0               Number of circuits in reset state.
  - total_ccr_success_cnt                 0               Total number of CCR tests that were succesful for any CIC of this group.
  - total_ccr_fail_cnt                    0               Total number of CCR tests that failed for any CIC of this group.
  - last_ccr_unknown_cnt                  30              Number of circuits for which no CCR test was started.
  - last_ccr_in_progress_cnt              0               Number of circuits for which a CCR test is in progress
  - last_ccr_success_cnt                  0               Number of circuits for which the last CCR test was succesful.
  - last_ccr_fail_cnt                     0               Number of circuits for which the last CCR test failed.
  - last_ccr_error_cnt                    0               Number of circuits for which an internal error occured in the last CCR test. Might be because circuit was not idle prior to launching the test

Paths for ISUP Circuit states

You can query states for one circuit group using a path like this one (replace C002020_2_0_12 by your circuit group name, as seen in it's Web portal configuration):

./tbstatus /isup/interface/cic_group:C002020_2_0_12

If you're using version 2.4 or up, you also have access to individual circuits states... but you HAVE to use "-x" option (extended stats mode) to get these. To get states for all CICs of a group:

./tbstatus [u]-x[/u] /isup/interface/cic_group:C002020_2_0_12/*

For example, to get states for CIC #1705, you can use:

./tbstatus -x /isup/interface/cic_group/cic:1705

Querying/modifying individual field value using the command-line tool

To query individual field value, you add "::" after the path, then specify the specific field name. For example:

./tbstatus /isup/interface/cic_group/cic:1705::desired_cic_state

Or to modify the circuit state (here to force blocking state):

./tbstatus /isup/interface/cic_group/cic:1705::desired_cic_state=Blocked
  • Note: Remember that this change is PERSISTENT, which means circuit will remain blocked forever (no matter trunk state) until you change it again (to "Default", or "Unblocked" for example).

How to write code that use that API

Now that you understand a bit how Status API works, here is a short explanation on how to write code to manipulate these states.

In short you need to create and start the status client service in your application:

 pClient = tbnew CTBCAFServiceStatusClient();
 pClient->Start();

Then each available stat is reported under a "path". Your code can call the following function to get available paths:

 pClient->GetRegisteredPaths();

Once you know the path you want to query, you can retrieve the stats, either synchronously or asynchronously: Synchronously:

 pStatList = pClient->GetStat(
   "your_path",
   "x"
 );

Asynchronously:

 pClient->ReqStat(
   pMyStatPipe,
   "your_path",
   "x"
 );

Available options:

- Option "x" passed to in_pszOptions means "extended" stats query (provides more detailed stats in some cases, like individual circuits)
- Option "d" will make documentation be returned for each field with the query response (by default, only field names and values are returned)

For more information on "pMyStatPipe", please read documentation from the header files in the code.

Once you get your "pStatList", you can get each item it retBold texturned (there can be many if your request matches many):

 pStat = pStatList->GetItem( un32StatIdx );

And for each item, you can get list of fields:

 pFieldList = pStat->GetFields();

... and list each field (one field is one individual stat value):

 pField = pFieldList->GetItem( un32FieldIdx );

Now, as you traverse the stat tree, you will encounter some values that can be changed using:

 pField->Set( "new value" );

Once you have changed one or more fields of the stat, you can commit it:

 pStat->CommitStates();

For more detailed information, please refer to the source code of the "tbstatus" application, and to documentation in appropriate header files.

Note

In order to get/set individual circuits states, you need:
- Release 2.4 or more recent, since release 2.3 allowed only to change state per circuit group... (per trunk in other words)
- Need to use "-x" in the options field of GetStat, as per-circuit stats are shown only in "extended" mode
PreviousTbstatus monitoringNextDropping calls

Last updated 8 months ago

Was this helpful?