wxc_sdk.cdr package¶
CDR API
- class wxc_sdk.cdr.CDRCallType(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
str
,SafeEnum
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_enterprise = 'SIP_ENTERPRISE'¶
- sip_tollfree = 'SIP_TOLLFREE'¶
- sip_national = 'SIP_NATIONAL'¶
- sip_mobile = 'SIP_MOBILE'¶
- class wxc_sdk.cdr.CDRClientType(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
str
,SafeEnum
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=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
str
,SafeEnum
An enumeration.
- originating = 'ORIGINATING'¶
- terminating = 'TERMINATING'¶
- class wxc_sdk.cdr.CDROriginalReason(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
str
,SafeEnum
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=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
str
,SafeEnum
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'¶
- class wxc_sdk.cdr.CDRRelatedReason(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
str
,SafeEnum
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=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
str
,SafeEnum
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: datetime | None = None, Answered: bool | None = None, Direction: CDRDirection | str | None = None, called_line_id: str | None = None, call_id: str | None = None, calling_line_id: str | None = None, start_time: datetime | None = None, call_type: CDRCallType | str | None = None, client_type: CDRClientType | str | None = None, client_version: str | None = None, correlation_id: str | None = None, international_country: str | None = None, device_mac: str | None = None, Duration: int | None = None, inbound_trunk: str | None = None, org_uuid: str | None = None, original_reason: CDROriginalReason | str | None = None, os_type: str | None = None, outbound_trunk: str | None = None, redirect_reason: CDRRedirectReason | str | None = None, related_reason: CDRRelatedReason | str | None = None, report_id: str | None = None, report_time: datetime | None = None, route_group: str | None = None, site_main_number: str | None = None, site_timezone: str | None = None, sub_client_type: str | None = None, user_uuid: str | None = None, user_type: CDRUserType | str | None = None, called_number: str | None = None, calling_number: str | None = None, Location: str | None = None, dialed_digits: str | None = None, releasing_party: str | None = None, redirecting_number: str | None = None, site_uuid: str | None = None, department_id: str | None = None, transfer_related_call_id: str | None = None, authorization_code: str | None = None, Model: str | None = 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: datetime | None¶
The time the call was answered. Time is in UTC.
- answered: bool | None¶
- direction: CDRDirection | str | None¶
Whether the call was inbound or outbound. The possible values are:
- called_line_id: str | None¶
For incoming calls, the calling line ID of the user. For outgoing calls, it’s the calling line ID of the called party.
- call_id: str | None¶
- calling_line_id: str | None¶
- start_time: datetime | None¶
This is the start time of the call, the answer time may be slightly after this. Time is in UTC.
- call_type: CDRCallType | str | None¶
Type of call. For example:
- client_type: CDRClientType | str | None¶
The type of client that the user (creating this record) is using to make or receive the call. For example:
- client_version: str | None¶
The version of the client that the user (creating this record) is using to make or receive the call.
- correlation_id: str | None¶
Correlation ID to tie together multiple call legs of the same call session.
- international_country: str | None¶
The country code of the dialed number. This is only populated for international calls.
- device_mac: str | None¶
The MAC address of the device, if known.
- duration: int | None¶
The length of the call in seconds.
- inbound_trunk: str | None¶
Inbound trunk may be presented in Originating and Terminating records.
- org_uuid: str | None¶
A unique identifier for the organization that made the call. This is a unique identifier across Cisco.
- original_reason: CDROriginalReason | str | None¶
Populated for calls that transfer, hold, wait, and so on. For example:
- os_type: str | None¶
The operating system that the app was running on, if available.
- outbound_trunk: str | None¶
Outbound trunk may be presented in Originating and Terminating records.
- redirect_reason: CDRRedirectReason | str | None¶
Populated for calls that transfer, hold, wait, and so on. For example:
Populated for calls that transfer, hold, wait, and so on. For example:
- report_id: str | None¶
A unique ID for this particular record. This can be used when processing records to aid in deduplication.
- report_time: datetime | None¶
The time this report was created. Time is in UTC.
- route_group: str | None¶
If present, this field’s only reported in Originating records. Route group identifies the route group used for outbound calls routed via a route group to Premises-based PSTN or an on-prem deployment integrated with Webex Calling (dial plan or unknown extension).
- site_main_number: str | None¶
The main number for the user’s site where the call was made or received.
- site_timezone: str | None¶
Site timezone is the offset in minutes from UTC time of the user’s timezone.
- sub_client_type: str | None¶
If the call is TO or FROM a mobile phone using Webex Go, the Client type will show SIP, and Sub client type will show MOBILE_NETWORK.
- user_uuid: str | None¶
A unique identifier for the user associated with the call. This is a unique identifier across Cisco products.
- user_type: CDRUserType | str | None¶
The type of user (user or workspace) that made or received the call. For example:
- called_number: str | None¶
For incoming calls, the telephone number of the user. For outgoing calls, it’s the telephone number of the called party.
- calling_number: str | None¶
For incoming calls, the telephone number of the calling party. For outgoing calls, it’s the telephone number of the user.
- location: str | None¶
Location of the report.
- dialed_digits: str | None¶
Feature access codes (FAC) used for invoking features such as Last Number Redial or a Call Return.
An extension that got dialed and a mis-dialed keypad digit from a device/app.
When a user must dial an outside access code (for example, 9+) before dialing a number, this access code is also reported, as well as the digits dialed thereafter. Note that when pre-translations have no effect, the dialed digits field contains the same data as the called number field. This field is only used for originating (outgoing) Calls and is not available for terminating (incoming) Calls.
- releasing_party: str | None¶
Indicates which party released the call first. The possible values are:
Local: Used when the local user has released the call first. Remote: Used when the far end party releases the call first. Unknown: Used when the call has partial information or is unable to gather enough information about the party who released the call. It could be because of situations like force lock or because of a session audit failure.
- redirecting_number: str | None¶
When the call has been redirected one or more times, this field reports the last redirecting number. Identifies who last redirected the call. Only applies to call scenarios such as transfer, call forwarded calls, simultaneous rings, etc.
- site_uuid: str | None¶
A unique identifier for the site associated with the call. Unique across Cisco products.
- department_id: str | None¶
A unique identifier for the user’s department name.
Transfer related call ID is used as a call identifier of the other call involved in the transfer. You can share this ID with Cisco TAC to help them pinpoint parties who are involved during a call transfer.
- authorization_code: str | None¶
The authorization code admin created for a location or site for users to use. Collected by the Account/Authorization Codes or Enhanced Outgoing Calling Plan services.
- model: str | None¶
The device model type the user is using to make or receive the call.
- class wxc_sdk.cdr.DetailedCDRApi(*, session: RestSession, base: str | None = 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: datetime | None = None, end_time: datetime | None = None, locations: list[str] | None = 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