User Tools

Site Tools


api:sbc:session:list

API : SBC Sessions List

Introduction

This request will return a list of all the peers that the SBC exchanges traffic with.

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.
customer [optional] Id of customer the calls must be made from or to.
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 onging 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.

Query examples

https://api.telecomx.dk/sbc/session
https://api.telecomx.dk/sbc/session?number=+457030
https://api.telecomx.dk/sbc/session?customer=1234567890ABCDEF12345678
https://api.telecomx.dk/sbc/session?customer=1234567890ABCDEF12345678&number=+4570305050&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 Number 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 Number 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 Number 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.

Note that properties holding no value may be omitted from the object.

Response example

[
  {
      callId: '123465743567845918237459354653@8.7.6.7',
      aNumber: '+4581808888',
      bNumber: '+4580808080',
      divertedBy: '',
      sbcServer: '2.1.1.3',
      direction: 'O',
      sourceCustomerId: '1234567890ABCDEF12345678',
      destinationCustomerId: ''
  },
  {
    ...
  }
]

Response example, full

[
  {
      callId: '123465743567845918237459354653@8.7.6.7',
      relatedCallId: '563745935465788123465743234591@80.198.52.50',
      aNumber: '+4581808888',
      aNumberPrivacy: '0',
      bNumber: '+4580808080',
      divertedBy: '',
      sbcServer: '2.1.1.3',
      sourcePeer: 'Telenor',
      destinationPeer: 'SuperTel',
      rtpProxyId: '1',
      rtpProxyFlags: 'rip',
      sourceIP: '80.198.52.50',
      destinationIP: '8.7.6.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: '1234567890ABCDEF12345678',
      sourceVoiceAccountId: '1234567890ABCDEF12345678',
      sourceRatePlanId: '1234567890ABCDEF12345678',
      destinationCustomerId: '',
      userName: 'Per',
      userLocation: 'CPH',
      userExtension: '211',
      rtpStat: '2534,4634,23,7,2'
  },
  {
    ...
  }
]

Errors

Error code Message Description
403 access_denied Insufficient access level
500 internal_error <Unspecified>
api/sbc/session/list.txt · Last modified: 2023/10/30 21:41 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki