Description

Simple API is a wrapper of XMLAPI in Trusted Mode. Access to this API is disabled by default and softswitch admin should enable it manually. All API scripts are available under /simpleapi directory of web server.

Authentication

As Simple API always performs its tasks in trusted mode, HTTP basic authentication is used to control the access to the API. The softswitch administrator should add users to/home/ssp/sippy_web/simpleapi/.htpassword file using htpasswd utility:

# htpasswd /home/ssp/sippy_web/simpleapi/.htpassword username
Case  you need to do the configuration for the particular environment, check  /tmp/envX/httpd.conf for AuthUserFile in simpleapi section.
And run the htpasswd for the particular file. 


API scripts

Callback

This script uses make2WayCallback application to initiate a callback.

  • Location: /simpleapi/callback.php
  • Parameters: 
    • authname - VoIP login to be used as callback initiator,
    • cld_first - number to make callback,
    • cli_first - make call leg look like to be made from specified CLI,
    • cld_second - number to dial to,
    • cli_second - make call leg look like to be made from specified CLI,
    • credit_time - terminate first call leg after this number of seconds.

Example of usage

To initiate a callback on behalf of account1 with CLI 1111 to CLD 2222 and limit duration of call to 5 minutes use next HTTP request:

https://sip.server.addr/simpleapi/callback.php?authname=account1&cld_first=1111&cli_first=1111&cld_second=2222&cli_second=1111&credit_time=300

Get available credit

This script uses getAccountInfo application to retrieve account's available credit.

  • Location: /simpleapi/available_credit.php
  • Parameters: 
    • username - username of account
  • Returns: 
    • available credit of account in form 'N.NNNNNNNN CURRENCY'
    • in case of error string in form 'ERROR: Error explanation'

Example of usage

To get available credit of account with username 00001 use next HTTP request:

https://sip.server.addr/simpleapi/available_credit.php?username=00001