Â
Configuration SOAP API
The SOAP API for sipXconfig lets you perform many operations offered by sipXconfig in a programmatic way and without interacting with the sipXconfig WEB UI. The sipXconfig API is extended all the time and offers most of the functionality available in the Web UI.
I can think of at least 3 cases where you might want to use it:
- You are integrating sipXecs with your company's IT infrastructure: In this case you probably have some kind of Enterprise Web Portal (i.e. an Intranet) and you want to connect sipXecs functionality to it. You can call it a mashup.
- You are looking to automate or script some processes: Adding or importing users, upgrading phones. assigning phones to groups and many more
- You do not like the sipXconfig UI and want to replace it with something different
You can use SOAP in may ways: Usually it involves getting WSDL, which is a formal API definition, and generate bindings in your favorite language (Python, Perl, Ruby, Java, etc.). Pick the language with good SOAP client support. Strictly speaking you can also send low level SOAP requests but most modern SOAP client libraries let you operate on a higher level.
Resources for building SOAP clients
- Unit tests - Great examples of how to use API.
- Source Written in ruby, uses SOAP4R and wsdl2ruby for easy API.
- Sample Code - Written in Perl Using SOAP::Lite
- Sample Code - Written in Python Using SOAPpy
- Sample PHP Code
sipxecs 4.4:Â Every sipXconfig installation already publishes the SOAP API on URLs https://yourdomain:8443/sipxconfig/services/*Service
. See the documentation above to get a list of all the services
sipxecs 4.6:Â https://yourdomain/sipxconfig/services/*Service
.
Ruby
From the WSDL, you can use the SOAP4R project to build client bindings.
Perl
Here is a sample script that adds 10 users to a system. You can adapt the sample script to your needs. This script requires SOAP support for perl to be installed on your machine. The script can be modified to run from any host.
To install SOAP support for perl, CentOS systems will need to install rpmforge first. NOTE: Alternative approach using CPAN
to install of SOAP::Lite consistently failed.
yum install perl-libwww-perl perl-SOAP-Lite
Generating API documentation
wsdldoc from bluetetra is used to generate the API documention from the WSDL
java -jar $WsdlDocDir/wsdldoc.jar \ -title "sipXconfig SOAP API v3.2" \ -dir `pwd`"/ws-api-3.2" \ http://sipxecs.sipfoundry.org/rep/sipXecs/main/sipXconfig/web/src/org/sipfoundry/sipxconfig/api/sipxconfig.wsdl