XML-RPC API - Manage Active Calls

S
Written by Sergiiy
Updated 11 months ago

listAllCalls()

This application returns list of calls in any state. Only calls made under authenticated customer are returned. Root customer receives full list.

The application supports trusted mode and i_customer parameter should be supplied in this case 

Parameters:

  • recursive - Should the calls of subcustomers be included in the returned list (new in post 1.7.1). Boolean. Optional. Default: True
  • i_account - Return only calls which belong to the specified account. Integer. Optional. 
  • i_vendor - Return only calls which are currently routed via a connection belonging to the specified vendor. Integer. Optional. 
  • i_connection - Return only calls which are currently routed via the specified connection. This parameter takes precedence over the i_vendor parameter. Integer. Optional. 
  • order - How to order calls. String. Optional.
     Possible values:
    • oldest_first (default)
    • oldest_last
    • longest_first
    • longest_last

Trusted Mode:

In trusted mode the i_customer integer parameter must be used to specify under which access rights this application should execute 

Returns:

  • list of dictionaries. Here is an example of returned value in Python syntax:

       {
         'CLI' : '801',
         'I_CONNECTION' : 1,
         'CLD' : '812',
         'CALL_ID' : '[email protected]',
         'DELAY' : 6.102700465,
         'DURATION' : 0,
         'CC_STATE' : 'ARComplete',
         'I_ACCOUNT' : 3,
         'ID' : '960',
         'I_CUSTOMER' : '1',
         'I_ENVIRONMENT' : '1',
         'CALLER_MEDIA_IP' : '192.168.22.7',
         'CALLEE_MEDIA_IP' : '192.168.22.54',
         'SETUP_TIME' :  '20210822T10:11:52.000',
         'DIRECTION' :  'vendor',
     
    
       },
       {
         'CLI' : '10545',
         'I_CONNECTION' : 1,
         'CLD' : '123456',
         'CALL_ID' : '[email protected]',
         'DELAY' : 2.233400465,
         'DURATION' : 22.704463777,
         'CC_STATE' : 'Connected',
         'I_ACCOUNT' : 223,
         'ID' : '944',
         'I_CUSTOMER' : '1',
         'I_ENVIRONMENT' : '1',
         'CALLER_MEDIA_IP' : '192.168.22.2',
         'CALLEE_MEDIA_IP' : '192.168.22.49',
         'SETUP_TIME' :  '20210822T10:12:52.000',
         'DIRECTION' :  'onnet_in',
       }
    Text

  • XMLRPC fault in case of any error.

CC_STATE statuses and their description:

Idle - the call has been received and the processing of the call has been started.

WaitAuth - authentication procedure has started but is not yet completed.

WaitRoute - authentication has been done successfully, the b2bua is waiting for routing information.

ARComplete - authentication and routing have been completed, the b2bua tries to establish a connection.

Connected - both call legs have connected successfully. The conversation is in progress.

Disconnecting - the call is being disconnected.

Dead - the call has been disconnected successfully. B2bua waits for late requests and responses which might have been delayed.

Data types of values in the dictionary:

CLI String
I_CONNECTION Integer
CLD String
CALL_ID String
DELAY Double
DURATION Double
CC_STATE String
I_CUSTOMER Integer
I_ENVIRONMENT Integer
I_ACCOUNT Integer
ID String
CALLER_MEDIA_IP String
CALLEE_MEDIA_IP String
DIRECTION String
SETUP_TIME** String

listActiveCalls()

This is the same as the listAllCalls application, but returns the call list containing calls in states Connected, ARComplete or WaitRoute? only.

disconnectCall()

This application is used to disconnect an active call.

Parameters:

  • ID - ID of the call to disconnect (see the listAllCalls application). String. Required.

Returns:

  • result - OK means that disconnect request was sent successfully
  • result - Call not found or not accessible - means that disconnect cannot be initiated
  • XMLRPC fault in case of any error.

disconnectAccount()

This application is used to disconnect all active calls of a given account. 

Top level customer could also issue this API call for any account in his hierarchy, including accounts of his subcustomers.

Parameters:

  • i_account - Integer. Required.

Returns:

  • result - OK means that disconnect request was sent successfully
  • count - number of disconnected sessions
  • XMLRPC fault in case of any error.

getAccountCallStats()

This application is used to get aggregated statistics of active calls in the softswitch. This is a lightweight API call and it is recommended to be used instead of listAllCalls() or listActiveCalls() when summary only is needed. 

Currently limited to accounts of root customer only.

Parameters:

None

Returns:

  • result - OK
  • data - dictionary of the following format:

    {
i_account1 : [ <total calls>, <connected calls> ],
i_account2 : [ <total calls>, <connected calls> ],
    }

  • XMLRPC fault in case of any error.

disconnectCustomer()

This application is used to disconnect all active calls of a given customer. All calls of accounts that belong to the customer and all descendant subcustomers will be dropped.

Top level customer could also issue this API call for any subcustomer in his hierarchy, including customers of his subcustomers.

Parameters:

  • i_customer - ID of customer. Integer. Required.

Trusted mode:

In trusted mode the i_wholesaler integer parameter can be used to specify under which access rights this application should execute.

Returns:

  • result - OK means that all calls were disconnected successfully
  • count - number of disconnected calls
  • XMLRPC fault in case of any error
Did this answer your question?