REST
The REST-API in anynode - The Software SBC introduces powerful features for streamlined configuration and administration. Key additions include advanced hot standby management, the ability to retrieve SIP call history, enhanced web server connector controls, and comprehensive detached objects management. These updates significantly improve system integration, monitoring, and management through the REST API, offering more control and flexibility without relying on the graphical user interface.
Automating routine tasks and processes through the REST API reduces manual effort and minimizes errors, making system management more efficient and reliable.
Supplied sample scripts provided with every anynode installation offer a valuable resource for administrators and developers. These scripts serve as practical examples and simplify the introduction to using the API. The PowerShell module, which is automatically installed with anynode, provides easy access to the REST API, further simplifying the integration and automation processes.
Characteristics
-
Script-based configuration and management
-
Extended REST API functions
-
Integration with third-party software
-
Supplied sample scripts
-
PowerShell plugin with REST API functions
-
Continuous expansion of supported functions
Benefits
-
Seamless integration with existing backend systems
-
Reduced manual effort and minimized errors through automation
-
Easy introduction to API usage with sample scripts
-
Simplified access to REST API via PowerShell plugin
-
Flexible adaptation to changing business and technological needs
In our example, we demonstrate how to retrieve a SIP Flow in text format using a PowerShell script within PowerShell ISE. This process leverages the REST API support provided by anynode, allowing the analysis of recorded SIP Flows with external programs.
Please note that the REST service must be activated in the anynode frontend, and the user must have the appropriate access rights. For more details, refer to our REST API documentation, available in the Help menu at the top of any anynode frontend.
To enable the REST API, navigate to the top menu, select Extras, Web Server and Connectors.
Select your connector and click on .
The Web server connector assistant will open.
Under Services, activate the REST API option and click .
Make sure that there are calls with SIP Flow enabled in the Call History. You can enable this in the Extras menu in the Monitor Settings.
More details on enabling SIP Flow Recording in anynode
The PowerShell module is automatically installed with any anynode installation, providing easy access to the REST API. The module path is as follows:
C:\Program Files\TE-SYSTEMS\anynode frontend\res\powershell
Use the Import-Module command to load modules and import their cmdlets, functions, aliases, and variables into the current session. By importing the anynode PowerShell module, you make the commands and resources it contains available in your current PowerShell session.
We will use the following example script to retrieve the SIP Flow:
Before using our example PowerShell script, ensure that the correct URL and port for the anynode frontend are set. These details can easily be retrieved from the settings of the configured HTTPS connector within the anynode frontend.
For this, check the anynode frontend in the main menu and navigate to Extras, Web Server and Connectors.
In this example, we are using the default connector and the standard port.(8088)
In the second line of our script, the path for the anynode PowerShell module is specified. Various parameters are available for exporting the SIP Flow recordings. These can be defined at the end of the script under
ResultFormat.
Here are the available options:
-
pcapRetrieves the SIP Flow recording in PCAP format, which can be opened with any PCAP-compatible program, such as Wireshark. -
textFlowRetrieves the SIP Flow recording as a text-based format with a three-way signal flow diagram. -
textMessagesRetrieves detailed SIP messages in text format. -
HTMLRetrieves an HTML page with the three-way signal flow diagram and details of the SIP messages. -
detailsRetrieves a JSON array containing detailed information about each SIP message. JSON arrays can be easily processed in various programming languages, as most modern languages offer libraries or built-in support for JSON.
In our example, we use the textFlow parameter.
The script retrieves all session IDs of the calls in the Call History. The most recent call entry in the Call History is then used for the SIP Flow retrieval. Note that our example script retrieves only a single SIP Flow.
You can limit the time period of the Call History entries to be retrieved using the $FilterDateTimePeriod
parameter. For example, use the value "TODAY" to retrieve all call entries from today.
Finally, save the script and execute it.