Sessions

List current active call sessions.

Get a collection of current active call sessions.

GEThttp://127.0.0.1:8888/api/sessions
Response

OK

Body
countinteger (int64)

Total number of resource.

Example: 100
itemsarray of object
Request
const response = await fetch('http://127.0.0.1:8888/api/sessions', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "count": 100,
  "items": [
    {
      "id": {},
      "calls": [
        {
          "caller": "text",
          "caller_display_name": "text",
          "callee": "text",
          "trunk": "text",
          "started_at": {}
        }
      ]
    }
  ]
}

Create call session

Create call session

POSThttp://127.0.0.1:8888/api/sessions
Body
caller*string

The caller number of the call.

caller_display_namestring

The caller display name of the call.

callee*string

The callee number of the call.

send_sdp*boolean

Whether to send sdp packets.

trunkstring

The name of the trunk.

rewrite_fromstring

When call through the trunk specified by trunk,
change the user part in the FROM header to specified value.

rewrite_paistring

When call through the trunk specified by trunk,
change the user part in the P-Asserted-Identity header to specified value.

rewrite_rpistring

When call through the trunk specified by trunk,
change the user part in the Remote-Party-ID header to specified value.

user_datastring

The user context of the call.

targetstring

The callee target address.

additional_headerenum

Specifies whether to add an additional SIP header (RFC 5373) to the INVITE SIP message. The possible values are:

  • ANSWER_MODE: Adds the Answer-Mode header to the INVITE SIP message.
  • CALL_INFO: Adds the Call-Info header with answer-after=0 to the INVITE SIP message.
  • ALERT_INFO_AUTO_ANSWER_DELAY0: Adds the Alert-Info header with info=alert-autoanswer;delay=0 to the INVITE SIP message.
  • ALERT_INFO_AUTO_ANSWER: Adds the Alert-Info header with info=Auto Answer to the INVITE SIP message.
  • ALERT_INFO_INTERCOM: Adds the Alert-Info header with info=intercom to the INVITE SIP message.
ANSWER_MODECALL_INFOALERT_INFO_AUTO_ANSWER_DELAY0ALERT_INFO_AUTO_ANSWERALERT_INFO_INTERCOM
header_directionenum

Specifies which party of the call should receive the additional_header, if the additional_header is not specified, this parameter will be ignored. The possible values are:

  • CALLER: Adds the specified header in additional_header to the INVITE SIP message sent to the caller.
  • CALLEE: Adds the specified header in additional_header to the INVITE SIP message sent to the callee.
  • ALL: Adds the specified header in additional_header to the INVITE SIP messages sent to both the caller and callee.
CALLERCALLEEALL
Response

OK

Body
idall of

The unique ID of session.

Request
const response = await fetch('http://127.0.0.1:8888/api/sessions', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "caller": "text",
      "callee": "text",
      "send_sdp": false
    }),
});
const data = await response.json();
Response
{
  "id": {}
}

Retrieve call session by ID.

Retrieve details of call sessions by it's ID.

GEThttp://127.0.0.1:8888/api/sessions/{id}
Path parameters
id*all of

The unique ID of session.

Response

OK

Body
idall of

The unique ID of session.

callsarray of object
Request
const response = await fetch('http://127.0.0.1:8888/api/sessions/{id}', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "id": {},
  "calls": [
    {
      "caller": "text",
      "caller_display_name": "text",
      "callee": "text",
      "trunk": "text",
      "started_at": {}
    }
  ]
}