Call Sessions

Manage your call sessions.

List current active call sessions.

get

Get a collection of current active call sessions.

Authorizations
Responses
201
OK
application/json
get
GET /api/sessions HTTP/1.1
Host: hostname:8887
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "count": 100,
  "items": [
    {
      "id": "NzAwNTUxOTA5NzczMTQ4MTYw",
      "calls": [
        {
          "caller": "text",
          "caller_display_name": "text",
          "callee": "text",
          "trunk": "text",
          "started_at": "2017-07-21T17:32:28Z",
          "talking_time": 1
        }
      ]
    }
  ]
}

Create call session

post

Create call session

Authorizations
Body
callerstring · max: 256Required

The caller number of the call.

caller_display_namestring · max: 1024Optional

The caller display name of the call.

calleestring · max: 256Required

The callee number of the call.

send_sdpbooleanRequired

Whether to send sdp packets.

trunkstring · min: 1 · max: 64Optional

The name of the trunk.

rewrite_fromstring · min: 1 · max: 16Optional

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

rewrite_paistring · min: 1 · max: 16Optional

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

rewrite_rpistring · min: 1 · max: 16Optional

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

user_datastring · max: 128Optional

The user context of the call.

targetstring · max: 128Optional

The target address.

target_instance_idstring · max: 128Optional

The target instance ID.

target_extension_numberstring · max: 128Optional

The target extension number.

additional_headerstring · enumOptional

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.
Possible values:
header_directionstring · enumOptional

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.
Possible values:
Responses
201
OK
application/json
post
POST /api/sessions HTTP/1.1
Host: hostname:8887
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 315

{
  "caller": "text",
  "caller_display_name": "text",
  "callee": "text",
  "send_sdp": true,
  "trunk": "text",
  "rewrite_from": "text",
  "rewrite_pai": "text",
  "rewrite_rpi": "text",
  "user_data": "text",
  "target": "text",
  "target_instance_id": "text",
  "target_extension_number": "text",
  "additional_header": "ANSWER_MODE",
  "header_direction": "CALLER"
}
{
  "id": "NzAwNTUxOTA5NzczMTQ4MTYw"
}

Create call session directly

get

Create call session directly.

Query parameters
extension_numberstring · min: 3 · max: 64Required

The extension number.

Pattern: [0-9]{3,64}
passwordstringRequired

The extension password.

domainstring · min: 1 · max: 280Required

The SIP domain of tenant.
It is usually a fully qualified domain name (FQDN). If there is no FQDN, you can also use the IP address of the PBX server as the SIP domain. The SIP domain name is only used for SIP message authentication and does not require analysis.

callerstring · max: 256Required

The caller number of the call.

caller_display_namestring · max: 1024Optional

The caller display name of the call.

calleestring · max: 256Required

The callee number of the call.

send_sdpbooleanRequired

Whether to send sdp packets.

trunkstring · min: 1 · max: 64Optional

The name of the trunk.

rewrite_fromstring · min: 1 · max: 16Optional

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

rewrite_paistring · min: 1 · max: 16Optional

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

rewrite_rpistring · min: 1 · max: 16Optional

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

user_datastring · max: 128Optional

The user context of the call.

targetstring · max: 128Optional

The target address.

target_instance_idstring · max: 128Optional

The target instance ID.

target_extension_numberstring · max: 128Optional

The target extension number.

additional_headerstring · enumOptional

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.
Possible values:
header_directionstring · enumOptional

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.
Possible values:
Responses
201
OK
application/json
get
GET /api/sessions/directly HTTP/1.1
Host: hostname:8887
Accept: */*
{
  "id": "NzAwNTUxOTA5NzczMTQ4MTYw"
}

Retrieve call session by ID.

get

Retrieve details of call sessions by it's ID.

Authorizations
Path parameters
idall ofRequired

The unique ID of session.

stringOptional

The unique ID of the resource.

Example: NzAwNTUxOTA5NzczMTQ4MTYw
Responses
200
OK
application/json
get
GET /api/sessions/{id} HTTP/1.1
Host: hostname:8887
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "NzAwNTUxOTA5NzczMTQ4MTYw",
  "calls": [
    {
      "caller": "text",
      "caller_display_name": "text",
      "callee": "text",
      "trunk": "text",
      "started_at": "2017-07-21T17:32:28Z",
      "talking_time": 1
    }
  ]
}

Hold call session

post

Hold call session by it's session ID.

Authorizations
Path parameters
idall ofRequired

The unique ID of session.

stringOptional

The unique ID of the resource.

Example: NzAwNTUxOTA5NzczMTQ4MTYw
Body
extension_numberall ofRequired

The extension number to hold the session.

string · min: 3 · max: 64Optional

The extension number.

Pattern: [0-9]{3,64}
Responses
200
Ok
post
POST /api/sessions/{id}/hold HTTP/1.1
Host: hostname:8887
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 27

{
  "extension_number": "text"
}

No content

Unhold call session

post

Un-hold call session by it's session ID.

Authorizations
Path parameters
idall ofRequired

The unique ID of session.

stringOptional

The unique ID of the resource.

Example: NzAwNTUxOTA5NzczMTQ4MTYw
Body
extension_numberall ofRequired

The extension number to unhold the session.

string · min: 3 · max: 64Optional

The extension number.

Pattern: [0-9]{3,64}
Responses
200
OK
post
POST /api/sessions/{id}/unhold HTTP/1.1
Host: hostname:8887
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 27

{
  "extension_number": "text"
}

No content

Refer a call session

post

Refer a call session by it's session ID.

Authorizations
Path parameters
idall ofRequired

The unique ID of session.

stringOptional

The unique ID of the resource.

Example: NzAwNTUxOTA5NzczMTQ4MTYw
Body
extension_numberall ofRequired

The extension number to refer the session.

string · min: 3 · max: 64Optional

The extension number.

Pattern: [0-9]{3,64}
refer_tostringRequired

The refer target, usually a number.

Responses
200
Ok
post
POST /api/sessions/{id}/refer HTTP/1.1
Host: hostname:8887
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 45

{
  "extension_number": "text",
  "refer_to": "text"
}

No content

Attend refer a call session.

post

Attend refer a call session by it's session ID.

Authorizations
Path parameters
idall ofRequired

The unique ID of session.

stringOptional

The unique ID of the resource.

Example: NzAwNTUxOTA5NzczMTQ4MTYw
Body
extension_numberall ofRequired

The extension number to attend refer the session.

string · min: 3 · max: 64Optional

The extension number.

Pattern: [0-9]{3,64}
refer_to_1stringRequired

The refer target, usually a number.

session_1all ofOptional

The unique ID of the session specified by refer_to_1, this session ID is not mandatory.

stringOptional

The unique ID of the resource.

Example: NzAwNTUxOTA5NzczMTQ4MTYw
refer_to_2stringRequired

The refer target, usually a number.

session_2all ofOptional

The unique ID of the session specified by refer_to_2, this session ID is not mandatory.

stringOptional

The unique ID of the resource.

Example: NzAwNTUxOTA5NzczMTQ4MTYw
Responses
200
Ok
post
POST /api/sessions/{id}/attended_refer HTTP/1.1
Host: hostname:8887
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 145

{
  "extension_number": "text",
  "refer_to_1": "text",
  "session_1": "NzAwNTUxOTA5NzczMTQ4MTYw",
  "refer_to_2": "text",
  "session_2": "NzAwNTUxOTA5NzczMTQ4MTYw"
}

No content

Destroy call session

post

Destroy call session by it's session ID.

Authorizations
Path parameters
idall ofRequired

The unique ID of session.

stringOptional

The unique ID of the resource.

Example: NzAwNTUxOTA5NzczMTQ4MTYw
Responses
204
No Content
post
POST /api/sessions/{id}/destroy HTTP/1.1
Host: hostname:8887
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content