API : SBC Sessions List
Introduction
This request will return the call sessions the SBCs hold, sorted by start time with the oldest first.
Request
| URL | https://api.telecomx.dk/sbc/session |
| Method | GET |
| Access level | RESELLER_ADMIN with TELE feature, or ADMIN. |
| Query | offset | [optional] Index of first session to return, default 0. |
| limit | [optional] Number of sessions to return, default 100, max 1000. |
| number | [optional] A-number or B-number to match or part of it: digits with an optional leading +, sent URL-encoded as %2B. A value in any other form is ignored. |
| customer | [optional] Id of customer the calls must be made from or to. A value that is not a valid id is ignored. |
| full | [optional] If true the full session object will be returned, otherwise only a subset will. |
| live | [optional] If true, only return calls that are ongoing and not completed. |
| direction | [optional] I for inbound O for outbound, omit for any direction. |
| international | [optional] True if only calls with an international destination should be returned. |
| hostFilter | [optional] IP address the call must come from or be sent to. |
Query examples
https://api.telecomx.dk/sbc/session
https://api.telecomx.dk/sbc/session?number=%2B457030
https://api.telecomx.dk/sbc/session?customer=650000000000000000000301
https://api.telecomx.dk/sbc/session?customer=650000000000000000000301&number=%2B4570305050&offset=100&limit=1000
Response
| JSON object |
| offset | Integer | Index of the first session to return. |
| limit | Integer | Number of sessions to return. Less sessions may be returned if the limit is past the end of the list. |
| total | Integer | Number of session that can be returned of offset and limit is not taken into consideration. This is used for paging through the sessions. |
| sessions | Array | Array of session objects. See below. |
| Session object (JSON, normal) |
| callId | String | Call-ID from the SIP request |
| aNumber | String | E.164 number of the caller or anonymous |
| bNumber | String | E.164 number that is being called |
| divertedBy | String | E.164 number that diverted the call |
| sbcServer | String | IP address of the SBC server that created the session/handles the session |
| direction | String | 'I' for calls received from a peer, 'O' for calls received from a trusted host |
| sourceCustomerId | String | Id of the customer |
| destinationCustomerId | String | Id of the customer the request was sent to, if destination is internal |
| started | Date | DateTime in UTC of when the call started - INVITE received |
| answered | Date | DateTime in UTC of when the call was answered by the remote end - 200 OK received |
| ended | Date | DateTime in UTC of when the call ended - BYE/CANCEL/Terminating ErrorCode received |
| mvno | String | Name of mvno provider that the call is coming from or going to, blank if non-mvno |
| sourceIP | String | IP address that initiated the call - made the INVITE |
| destinationIP | String | IP address that the request was sent to |
| sourceIPType | String | Type of source IP server |
| destinationIPType | String | Type of destination IP server |
| sourceCustomerName | String | Name of source customer, if available. |
| destinationCustomerName | String | Name of destination customer, if available. |
| Session object (JSON, full=true) |
| callId | String | Call-ID from the SIP request |
| relatedCallId | String | Related-Call-ID from the SIP request as set by the VPBX if this call is to be bound to another inbound call |
| aNumber | String | E.164 number of the caller or anonymous |
| aNumberPrivacy | String | 1 if caller number should be hidden, 0 if not |
| bNumber | String | E.164 number that is being called |
| divertedBy | String | E.164 number that diverted the call |
| sbcServer | String | IP address of the SBC server that created the session/handles the session |
| sourcePeer | String | Id of peer request was received from, if received from a peer |
| destinationPeer | String | Id of peer request was sent to, if destination was a peer |
| rtpProxyId | String | Id of the RTP proxy used |
| rtpProxyFlags | String | Flags for the RTP proxy used |
| sourceIP | String | IP address that initiated the call - made the INVITE |
| destinationIP | String | IP address that the request was sent to |
| direction | String | 'I' for calls received from a peer, 'O' for calls received from a trusted host |
| mobileOriginated | String | 1 if call originated from a mobile device, 0 if not - see X-MO: 1 SIP header |
| mvno | String | Name of mvno provider that the call is coming from or going to, blank if non-mvno |
| mvnoData | String | additional data from the MVNO, if TDC, then prefix, if Telenor then accountcode |
| started | Date | DateTime in UTC of when the call started - INVITE received |
| answered | Date | DateTime in UTC of when the call was answered by the remote end - 200 OK received |
| ended | Date | DateTime in UTC of when the call ended - BYE/CANCEL/Terminating ErrorCode received |
| endedReason | String | BYE or CANCEL or 4xx, 5xx or 6xx SIP error code, BLOCKED, BLACKLISTED or FRAUD |
| endedBy | String | A for caller, B for callee (whoever sends the CANCEL or BYE) or F for fraud or S for system |
| userAgent | String | User agent string from host that initiated the call |
| sourceCustomerId | String | Id of the customer |
| sourceVoiceAccountId | String | Id of the voice account that made the call (if outbound) |
| sourceRatePlanId | String | Id of the rate plan used for the call |
| destinationCustomerId | String | Id of the customer the request was sent to, if destination is internal |
| userName | String | Name of the person who made the call/owns the number/phone |
| userLocation | String | Name of the users location |
| userExtension | String | Extension number of the user/device that made the call |
| rtpStat | String | RTP statistics |
| sourceIPType | String | Type of source IP server |
| destinationIPType | String | Type of destination IP server |
| sourceCustomerName | String | Name of source customer, if available. |
| destinationCustomerName | String | Name of destination customer, if available. |
Properties holding no value may be omitted from the object or be null.
Response example
{
"offset": 0,
"limit": 100,
"total": 1,
"sessions": [
{
"callId": "123465743567845918237459354653@203.0.113.7",
"aNumber": "+4500000001",
"bNumber": "+4500000002",
"divertedBy": "",
"sbcServer": "203.0.113.3",
"direction": "O",
"sourceCustomerId": "650000000000000000000301",
"destinationCustomerId": "",
"ended": "2014-01-01T12:05:00.000Z",
"started": "2014-01-01T12:00:00.000Z",
"answered": "2014-01-01T12:00:05.000Z",
"sourceIP": "198.51.100.50",
"destinationIP": "203.0.113.5",
"mvno": "",
"sourceIPType": "pbx",
"sourceCustomerName": "Example Customer A/S"
}
]
}
Response example, full
{
"offset": 0,
"limit": 100,
"total": 1,
"sessions": [
{
"callId": "123465743567845918237459354653@203.0.113.7",
"relatedCallId": "563745935465788123465743234591@198.51.100.50",
"aNumber": "+4500000001",
"aNumberPrivacy": "0",
"bNumber": "+4500000002",
"divertedBy": "",
"sbcServer": "203.0.113.3",
"sourcePeer": "Telenor",
"destinationPeer": "SuperTel",
"rtpProxyId": "1",
"rtpProxyFlags": "rip",
"sourceIP": "198.51.100.50",
"destinationIP": "203.0.113.5",
"direction": "O",
"mobileOriginated": "1",
"mvno": "Telenor",
"mvnoData": "54563657663",
"started": "2014-01-01T12:00:00.000Z",
"answered": "2014-01-01T12:00:05.000Z",
"ended": "2014-01-01T12:05:00.000Z",
"endedReason": "BYE",
"endedBy": "A",
"userAgent": "myPBX 12.3beta7",
"sourceCustomerId": "650000000000000000000301",
"sourceVoiceAccountId": "650000000000000000000302",
"sourceRatePlanId": "650000000000000000000303",
"destinationCustomerId": "",
"userName": "Example User",
"userLocation": "CPH",
"userExtension": "211",
"rtpStat": "2534,4634,23,7,2",
"sourceIPType": "pbx",
"sourceCustomerName": "Example Customer A/S"
}
]
}
Errors
| Error code | Message | Description |
| 403 | access_denied | Insufficient access level |
| 500 | internal_error | <Unspecified> |