wxc_sdk.cdr package

CDR API

class wxc_sdk.cdr.CDRCallType(value)[source]

Bases: str, Enum

An enumeration.

sip_meeting = 'SIP_MEETING'
sip_international = 'SIP_INTERNATIONAL'
sip_shortcode = 'SIP_SHORTCODE'
sip_inbound = 'SIP_INBOUND'
unknown = 'UNKNOWN'
sip_emergency = 'SIP_EMERGENCY'
sip_premium = 'SIP_PREMIUM'
sip_enterprise = 'SIP_ENTERPRISE'
sip_tollfree = 'SIP_TOLLFREE'
sip_national = 'SIP_NATIONAL'
sip_mobile = 'SIP_MOBILE'
class wxc_sdk.cdr.CDRClientType(value)[source]

Bases: str, Enum

An enumeration.

sip = 'SIP'
wxc_client = 'WXC_CLIENT'
wxc_third_party = 'WXC_THIRD_PARTY'
teams_wxc_client = 'TEAMS_WXC_CLIENT'
wxc_device = 'WXC_DEVICE'
wxc_sip_gw = 'WXC_SIP_GW'
class wxc_sdk.cdr.CDRDirection(value)[source]

Bases: str, Enum

An enumeration.

originating = 'ORIGINATING'
terminating = 'TERMINATING'
class wxc_sdk.cdr.CDROriginalReason(value)[source]

Bases: str, Enum

An enumeration.

unconditional = 'Unconditional'
no_answer = 'NoAnswer'
call_queue = 'CallQueue'
time_of_day = 'TimeOfDay'
user_busy = 'UserBusy'
follow_me = 'FollowMe'
unrecognised = 'Unrecognised'
unknown = 'Unknown'
class wxc_sdk.cdr.CDRRedirectReason(value)[source]

Bases: str, Enum

An enumeration.

unconditional = 'Unconditional'
no_answer = 'NoAnswer'
call_queue = 'CallQueue'
time_of_day = 'TimeOfDay'
user_busy = 'UserBusy'
follow_me = 'FollowMe'
hunt_group = 'HuntGroup'
deflection = 'Deflection'
unknown = 'Unknown'
unavailable = 'Unavailable'
class wxc_sdk.cdr.CDRRelatedReason(value)[source]

Bases: str, Enum

An enumeration.

consultative_transfer = 'ConsultativeTransfer'
call_forward_selective = 'CallForwardSelective'
call_park = 'CallPark'
call_park_retrieve = 'CallParkRetrieve'
call_queue = 'CallQueue'
unrecognised = 'Unrecognised'
call_pickup = 'CallPickup'
call_forward_always = 'CallForwardAlways'
fax_deposit = 'FaxDeposit'
hunt_group = 'HuntGroup'
push_notification_retrieval = 'PushNotificationRetrieval'
voice_xml_script_termination = 'VoiceXMLScriptTermination'
call_forward_no_answer = 'CallForwardNoAnswer'
anywhere_location = 'AnywhereLocation'
class wxc_sdk.cdr.CDRUserType(value)[source]

Bases: str, Enum

An enumeration.

automated_attendant_video = 'AutomatedAttendantVideo'
anchor = 'Anchor'
broadworks_anywhere = 'BroadworksAnywhere'
voice_mail_retrieval = 'VoiceMailRetrieval'
local_gateway = 'LocalGateway'
hunt_group = 'HuntGroup'
group_paging = 'GroupPaging'
user = 'User'
voice_mail_group = 'VoiceMailGroup'
call_center_standard = 'CallCenterStandard'
voice_xml = 'VoiceXML'
route_point = 'RoutePoint'
class wxc_sdk.cdr.CDR(*, answer_time: Optional[datetime] = None, Answered: Optional[bool] = None, call_id: Optional[str] = None, call_type: Optional[Union[CDRCallType, str]] = None, called_line_id: Optional[str] = None, called_number: Optional[str] = None, calling_line_id: Optional[str] = None, calling_number: Optional[str] = None, client_type: Optional[Union[CDRClientType, str]] = None, client_version: Optional[str] = None, correlation_id: Optional[str] = None, device_mac: Optional[str] = None, Direction: Optional[Union[CDRDirection, str]] = None, Duration: Optional[int] = None, inbound_trunk: Optional[str] = None, international_country: Optional[str] = None, Location: Optional[str] = None, org_uuid: Optional[str] = None, original_reason: Optional[Union[CDROriginalReason, str]] = None, os_type: Optional[str] = None, outbound_trunk: Optional[str] = None, redirect_reason: Optional[Union[CDRRedirectReason, str]] = None, related_reason: Optional[Union[CDRRelatedReason, str]] = None, report_id: Optional[str] = None, report_time: Optional[datetime] = None, route_group: Optional[str] = None, site_main_number: Optional[str] = None, site_timezone: Optional[str] = None, start_time: Optional[datetime] = None, sub_client_type: Optional[str] = None, user_type: Optional[Union[CDRUserType, str]] = None, user_uuid: Optional[str] = None)[source]

Bases: ApiModel

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

classmethod force_none(values: dict)[source]

Pop all empty strings so that they get caught by Optional[] :param values: :return:

answer_time: Optional[datetime]

The time the call was answered. Time is in UTC.

answered: Optional[bool]
call_id: Optional[str]
call_type: Optional[Union[CDRCallType, str]]

Type of call. For example:

called_line_id: Optional[str]
called_number: Optional[str]
calling_line_id: Optional[str]
calling_number: Optional[str]
client_type: Optional[Union[CDRClientType, str]]

The type of client that the user (creating this record) is using to make or receive the call. For example:

client_version: Optional[str]

The version of the client that the user (creating this record) is using to make or receive the call.

correlation_id: Optional[str]

Correlation ID to tie together multiple call legs of the same call session.

device_mac: Optional[str]

The MAC address of the device, if known.

direction: Optional[Union[CDRDirection, str]]

Whether the call was inbound or outbound. The possible values are:

duration: Optional[int]

The length of the call in seconds.

inbound_trunk: Optional[str]

Inbound trunk may be presented in Originating and Terminating records.

international_country: Optional[str]

The country code of the dialed number. This is only populated for international calls.

location: Optional[str]

Location of the report.

org_uuid: Optional[str]

A unique identifier for the organization that made the call. This is a unique identifier across Cisco.

original_reason: Optional[Union[CDROriginalReason, str]]

Populated for calls that transfer, hold, wait, and so on. For example:

os_type: Optional[str]

The operating system that the app was running on, if available.

outbound_trunk: Optional[str]

Outbound trunk may be presented in Originating and Terminating records.

redirect_reason: Optional[Union[CDRRedirectReason, str]]

Populated for calls that transfer, hold, wait, and so on. For example:

related_reason: Optional[Union[CDRRelatedReason, str]]

Populated for calls that transfer, hold, wait, and so on. For example:

report_id: Optional[str]

A unique ID for this particular record. This can be used when processing records to aid in deduplication.

report_time: Optional[datetime]

The time this report was created. Time is in UTC.

route_group: Optional[str]
site_main_number: Optional[str]

The main number for the user’s site where the call was made or received.

site_timezone: Optional[str]

Site timezone is the offset in minutes from UTC time of the user’s timezone.

start_time: Optional[datetime]

This is the start time of the call, the answer time may be slightly after this. Time is in UTC.

sub_client_type: Optional[str]
user_type: Optional[Union[CDRUserType, str]]

The type of user (user or workspace) that made or received the call. For example:

user_uuid: Optional[str]

A unique identifier for the user associated with the call. This is a unique identifier across Cisco products.

class wxc_sdk.cdr.DetailedCDRApi(*, session: RestSession, base: Optional[str] = None)[source]

Bases: ApiChild

To retrieve Detailed Call History information, you must use a token with the spark-admin:calling_cdr_read scope. The authenticating user must be a read-only-admin or full-admin of the organization and have the administrator role “Webex Calling Detailed Call History API access” enabled.

Detailed Call History information is available 5 minutes after a call has ended and may be retrieved for up to 48 hours. For example, if a call ends at 9:46 am, the record for that call can be collected using the API from 9:51 am, and is available until 9:46 am two days later.

This API is rate-limited to one call every 5 minutes for a given organization ID.

get_cdr_history(start_time: Optional[datetime] = None, end_time: Optional[datetime] = None, locations: Optional[list[str]] = None, **params) Generator[CDR, None, None][source]

Provides Webex Calling Detailed Call History data for your organization.

Results can be filtered with the startTime, endTime and locations request parameters. The startTime and endTime parameters specify the start and end of the time period for the Detailed Call History reports you wish to collect. The API will return all reports that were created between startTime and endTime.

Parameters
  • start_time – Time of the first report you wish to collect. (report time is the time the call finished). Note: The specified time must be between 5 minutes ago and 48 hours ago.

  • end_time – Time of the last report you wish to collect. Note: The specified time should be earlier than startTime and no earlier than 48 hours ago

  • locations – Names of the location (as shown in Control Hub). Up to 10 comma-separated locations can be provided. Allows you to query reports by location.

  • params – additional arguments

Returns

base = 'devices'
session: RestSession

REST session