wxc_sdk.telephony package
Telephony types and API (location and organisation settings)
- class wxc_sdk.telephony.OwnerType(value)[source]
Bases:
str
,Enum
An enumeration.
- people = 'PEOPLE'
- place = 'PLACE'
- auto_attendant = 'AUTO_ATTENDANT'
- call_center = 'CALL_CENTER'
- group_paging = 'GROUP_PAGING'
- hunt_group = 'HUNT_GROUP'
- voice_messaging = 'VOICE_MESSAGING'
- broadworks_anywhere = 'BROADWORKS_ANYWHERE'
- contact_center_link = 'CONTACT_CENTER_LINK'
- route_list = 'ROUTE_LIST'
- voicemail_group = 'VOICEMAIL_GROUP'
- class wxc_sdk.telephony.NumberLocation(*, id: str, name: str)[source]
Bases:
ApiModel
Location of a phone number
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.
- location_id: str
ID of location for phone number.
- name: str
Name of the location for phone number
- class wxc_sdk.telephony.NumberOwner(*, id: str = None, type: OwnerType = None, lastName: str = None, firstName: str = None)[source]
Bases:
ApiModel
Owner of a phone number
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.
- owner_id: Optional[str]
ID of the owner to which PSTN Phone number is assigned.
- last_name: Optional[str]
Last name of the PSTN phone number’s owner
- first_name: Optional[str]
First name of the PSTN phone number’s owner
- class wxc_sdk.telephony.NumberListPhoneNumberType(value)[source]
Bases:
str
,Enum
An enumeration.
- primary = 'PRIMARY'
- alternate = 'ALTERNATE'
- class wxc_sdk.telephony.NumberListPhoneNumber(*, phoneNumber: str = None, extension: str = None, state: NumberState = None, phoneNumberType: NumberListPhoneNumberType = None, mainNumber: bool, tollFreeNumber: bool, location: NumberLocation, owner: NumberOwner = None)[source]
Bases:
ApiModel
Phone Number
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.
- phone_number: Optional[str]
A unique identifier for the PSTN phone number.
- extension: Optional[str]
Extension for a PSTN phone number.
- state: Optional[NumberState]
Phone number’s state.
- phone_number_type: Optional[NumberListPhoneNumberType]
Type of phone number.
- main_number: bool
Indicates if the phone number is used as location clid.
- toll_free_number: bool
Indicates if a phone number is a toll free number.
- location: NumberLocation
- owner: Optional[NumberOwner]
- class wxc_sdk.telephony.NumberType(value)[source]
Bases:
str
,Enum
An enumeration.
- extension = 'EXTENSION'
- number = 'NUMBER'
- class wxc_sdk.telephony.NumberDetails(*, assigned: int, unAssigned: int, inActive: int, extensionOnly: int, tollFreeNumbers: int, total: int)[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.
- assigned: int
- un_assigned: int
- in_active: int
- extension_only: int
- toll_free_numbers: int
- total: int
- class wxc_sdk.telephony.UCMProfile(*, id: str, name: str)[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.
- profile_id: str
A unique identifier for the calling UC Manager Profile.
- name: str
Unique name for the calling UC Manager Profile.
- class wxc_sdk.telephony.TestCallRoutingResult(*, language: str, timeZone: str, callSourceInfo: CallSourceInfo = None, destinationType: DestinationType, routingAddress: str, outsideAccessCode: str, isRejected: bool, hostedAgent: HostedAgentDestination = None, hostedFeature: HostedFeatureDestination = None, pbxUser: PbxUserDestination = None, pstnNumber: PstnNumberDestination = None, virtualExtension: VirtualExtensionDestination = None, routeList: RouteListDestination = None, featureAccessCode: FeatureAccessCodeDestination = None, emergency: EmergencyDestination = None, repair: TrunkDestination = None, unknownExtension: TrunkDestination = None, unknownNumber: TrunkDestination = 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.
- language: str
Language for call queue.
- time_zone: str
Time zone for the call queue.
- call_source_info: Optional[CallSourceInfo]
This data object is only returned when originatorNumber is specified in the request.
- destination_type: DestinationType
Matching destination type for the call.
- routing_address: str
FAC code if destinationType is FAC. The routing address will be returned for all other destination types.
- outside_access_code: str
Outside access code.
- is_rejected: bool
true if the call would be rejected.
- hosted_agent: Optional[HostedAgentDestination]
This data object is returned when destinationType is HOSTED_AGENT.
- hosted_feature: Optional[HostedFeatureDestination]
This data object is returned when destinationType is HOSTED_FEATURE.
- pbx_user: Optional[PbxUserDestination]
This data object is returned when destinationType is PBX_USER.
- pstn_number: Optional[PstnNumberDestination]
This data object is returned when destinationType is PSTN_NUMBER.
- virtual_extension: Optional[VirtualExtensionDestination]
This data object is returned when destinationType is VIRTUAL_EXTENSION.
- route_list: Optional[RouteListDestination]
This data object is returned when destinationType is ROUTE_LIST.
- feature_access_code: Optional[FeatureAccessCodeDestination]
This data object is returned when destinationType is FAC.
- emergency: Optional[EmergencyDestination]
This data object is returned when destinationType is EMERGENCY.
- repair: Optional[TrunkDestination]
This data object is returned when destinationType is REPAIR.
- unknown_extension: Optional[TrunkDestination]
This data object is returned when destinationType is UNKNOWN_EXTENSION.
- unknown_number: Optional[TrunkDestination]
This data object is returned when destinationType is UNKNOWN_NUMBER.
- class wxc_sdk.telephony.OriginatorType(value)[source]
Bases:
str
,Enum
An enumeration.
- user = 'USER'
User
- trunk = 'TRUNK'
Connection between Webex Calling and the premises.
- class wxc_sdk.telephony.CallSourceType(value)[source]
Bases:
str
,Enum
The type of call source.
- route_list = 'ROUTE_LIST'
Indicates that the call source is a route list
- dial_pattern = 'DIAL_PATTERN'
Indicates that the call source is a dial pattern.
- unknown_extension = 'UNKNOWN_EXTENSION'
Indicates that the call source extension is unknown.
- unknown_number = 'UNKNOWN_NUMBER'
Indicates that the call source phone number is unknown.
- class wxc_sdk.telephony.CallSourceInfo(*, callSourceType: CallSourceType, routeListName: str = None, routeListId: str = None, dialPlanName: str = None, dialPattern: str = None, dialPlanId: str = None)[source]
Bases:
ApiModel
This data object is only returned when originatorNumber is specified in the request.
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.
- call_source_type: CallSourceType
The type of call source.
- route_list_name: Optional[str]
When originatorType is “trunk”, originatorId is a valid trunk, this trunk belongs to a route group which is assigned to a route list with the name routeListA, and originatorNumber is a number assigned to routeListA. routeListA is returned here. This element is returned when callSourceType is ROUTE_LIST.
- route_list_id: Optional[str]
route list id
- dial_plan_name: Optional[str]
When originatorType is “trunk”, originatorId is a valid trunk with name trunkA, trunkA belongs to a route group which is assigned to a route list with name routeListA, trunkA is also assigned to dialPlanA as routing choice, dialPlanA has dialPattern xxxx assigned. If the originatorNumber match the dialPattern xxxx, dialPlanA is returned. This element is returned when callSourceType is DIAL_PATTERN.
- dial_pattern: Optional[str]
When originatorType is “trunk”, originatorId is a valid trunk with the name trunkA, trunkA belongs to a route group which is assigned to a route list with the name routeListA, trunkA is also assigned to dialPlanA as routing choice, dialPlanA has dialPattern xxxx assigned. If the originatorNumber match the dialPattern xxxx, dialPattern xxxx is returned. This element is returned when callSourceType is DIAL_PATTERN.
- dial_plan_id: Optional[str]
dial plan id
- class wxc_sdk.telephony.DestinationType(value)[source]
Bases:
str
,Enum
Matching destination type for the call.
- hosted_agent = 'HOSTED_AGENT'
Matching destination is a person or workspace with details in the hostedAgent field.
- hosted_feature = 'HOSTED_FEATURE'
Matching destination is a calling feature like auto-attendant or hunt group with details in the hostedFeature field.
- pbx_user = 'PBX_USER'
Matching destination routes into a separate PBX with details in the pbxUser field.
- pstn_number = 'PSTN_NUMBER'
Matching destination routes into a PSTN phone number with details in the pstnNumber field.
- virtual_extension = 'VIRTUAL_EXTENSION'
Matching destination routes into a virtual extension with details in the virtualExtension field.
- route_list = 'ROUTE_LIST'
Matching destination routes into a route list with details in the routeList field.
- fac = 'FAC'
Matching destination routes into a feature access code (FAC) with details in the featureAccessCode field.
- emergency = 'EMERGENCY'
Matching destination routes into an emergency service like Red Sky, with details in the emergency field.
- repair = 'REPAIR'
The route is in a repair state with routing choice details in the repair field.
- unknown_extension = 'UNKNOWN_EXTENSION'
Target extension is unknown with routing choice details in the unknownExtension field.
- unknown_number = 'UNKNOWN_NUMBER'
The target phone number is unknown with routing choice details in the unknownNumber field.
- class wxc_sdk.telephony.LocationAndNumbers(*, locationName: str, locationId: str, phoneNumber: str, extension: str)[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.
- location_name: str
- location_id: str
- phone_number: str
- extension: str
- class wxc_sdk.telephony.HostedAgentDestination(*, locationName: str, locationId: str, phoneNumber: str, extension: str, id: str, type: UserType, firstName: str, lastName: str)[source]
Bases:
LocationAndNumbers
This data object is returned when destinationType is HOSTED_AGENT.
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.
- ha_id: str
person/workspace’s id
- first_name: str
Person or workspace’s first name.
- last_name: str
Person or workspace’s last name.
- class wxc_sdk.telephony.ServiceType(value)[source]
Bases:
str
,Enum
An enumeration.
- auto_attendant = 'AUTO_ATTENDANT'
- broadworks_anywhere = 'BROADWORKS_ANYWHERE'
- call_center = 'CALL_CENTER'
- contact_center_link = 'CONTACT_CENTER_LINK'
- group_paging = 'GROUP_PAGING'
- hunt_group = 'HUNT_GROUP'
- voice_messaging = 'VOICE_MESSAGING'
- voicemail_group = 'VOICEMAIL_GROUP'
- class wxc_sdk.telephony.HostedFeatureDestination(*, locationName: str, locationId: str, phoneNumber: str, extension: str, tyoe: ServiceType, name: str, id: str)[source]
Bases:
LocationAndNumbers
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.
- service_type: ServiceType
- name: str
- service_instance_id: str
- class wxc_sdk.telephony.TrunkDestination(*, trunkName: str = None, trunkId: str = None, routeGroupName: str = None, routeGroupId: str = None, trunkLocationName: str = None, trunkLocationId: 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.
- trunk_name: Optional[str]
- trunk_id: Optional[str]
- route_group_name: Optional[str]
- route_group_id: Optional[str]
- trunk_location_name: Optional[str]
location of the trunk, required if trunkName is returned
- trunk_location_id: Optional[str]
location id of the trunk, required if trunkName is returned
- class wxc_sdk.telephony.PbxUserDestination(*, trunkName: str = None, trunkId: str = None, routeGroupName: str = None, routeGroupId: str = None, trunkLocationName: str = None, trunkLocationId: str = None, dialPlanName: str, dialPlanId: str, dialPattern: str)[source]
Bases:
TrunkDestination
This data object is returned when destinationType is PBX_USER.
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.
- dial_plan_name: str
the dial plan name that the called string matches
- dial_plan_id: str
- dial_pattern: str
the dial pattern that the called string matches
- class wxc_sdk.telephony.PstnNumberDestination(*, trunkName: str = None, trunkId: str = None, routeGroupName: str = None, routeGroupId: str = None, trunkLocationName: str = None, trunkLocationId: str = None)[source]
Bases:
TrunkDestination
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.
- trunk_name: Optional[str]
- trunk_id: Optional[str]
- route_group_name: Optional[str]
- route_group_id: Optional[str]
- trunk_location_name: Optional[str]
location of the trunk, required if trunkName is returned
- trunk_location_id: Optional[str]
location id of the trunk, required if trunkName is returned
- class wxc_sdk.telephony.VirtualExtensionDestination(*, trunkName: str = None, trunkId: str = None, routeGroupName: str = None, routeGroupId: str = None, trunkLocationName: str = None, trunkLocationId: str = None, locationName: str, locationId: str, phoneNumber: str, extension: str, id: str, firstName: str, lastName: str, displayName: str)[source]
Bases:
LocationAndNumbers
,TrunkDestination
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.
- virtual_extension_id: str
- first_name: str
- last_name: str
- display_name: str
- class wxc_sdk.telephony.RouteListDestination(*, id: str, name: str, routeGroupName: str, routeGroupId: str, locationName: str, locationId: str)[source]
Bases:
ApiModel
This data object is returned when destinationType is ROUTE_LIST.
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.
- route_list_id: str
- name: str
- route_group_name: str
- route_group_id: str
- location_name: str
- location_id: str
- class wxc_sdk.telephony.FeatureAccessCodeDestination(*, code: str, name: str)[source]
Bases:
ApiModel
This data object is returned when destinationType is FAC.
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.
- code: str
- name: str
- class wxc_sdk.telephony.EmergencyDestination(*, trunkName: str = None, trunkId: str = None, routeGroupName: str = None, routeGroupId: str = None, trunkLocationName: str = None, trunkLocationId: str = None, isRedSky: bool)[source]
Bases:
TrunkDestination
This data object is returned when destinationType is EMERGENCY.
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.
- is_red_sky: bool
- class wxc_sdk.telephony.TelephonyApi(session: RestSession)[source]
Bases:
ApiChild
The telephony settings (features) API.
- access_codes: AccessCodesApi
access or authentication codes
- auto_attendant: AutoAttendantApi
- callpark: CallParkApi
- callpark_extension: CallparkExtensionApi
- callqueue: CallQueueApi
- huntgroup: HuntGroupApi
- location: TelephonyLocationApi
location specific settings
- base = 'telephony'
- organisation_voicemail: OrganisationVoicemailSettingsAPI
organisation voicemail settings
- permissions_out: OutgoingPermissionsApi
- pickup: CallPickupApi
- prem_pstn: PremisePstnApi
- schedules: ScheduleApi
- voicemail_groups: VoicemailGroupsApi
- voicemail_rules: VoicemailRulesApi
- voiceportal: VoicePortalApi
- phone_numbers(*, location_id: Optional[str] = None, phone_number: Optional[str] = None, available: Optional[bool] = None, order: Optional[str] = None, owner_name: Optional[str] = None, owner_id: Optional[str] = None, owner_type: Optional[OwnerType] = None, extension: Optional[str] = None, number_type: Optional[NumberType] = None, phone_number_type: Optional[NumberListPhoneNumberType] = None, state: Optional[NumberState] = None, toll_free_numbers: Optional[bool] = None, org_id: Optional[str] = None, **params) Generator[NumberListPhoneNumber, None, None] [source]
Get Phone Numbers for an Organization with given criteria.
List all the phone numbers for the given organization along with the status and owner (if any).
PSTN phone numbers are associated with a specific location and can be active/inactive and assigned/unassigned. The owner is the person, workspace, or feature to which the number is assigned.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters
location_id (str) – Return the list of phone numbers for this location within the given organization.
phone_number (str) – Search for this phone number.
available (bool) – Search among the available phone numbers. This parameter cannot be used along with owner_type parameter when set to true.
order (str) – Sort the list of phone numbers based on the following:lastName,dn,extension. Default sort will be based on number and extension in an Ascending order
owner_name (str) – Return the list of phone numbers that is owned by given owner name. Maximum length is 255.
owner_id (str) – Returns only the matched number/extension entries assigned to the feature with specified uuid/broadsoftId.
owner_type (OwnerType) – Returns the list of phone numbers that are of given owner_type.
extension (str) – Returns the list of PSTN phone numbers with given extension.
number_type (NumberType) – Returns the filtered list of PSTN phone numbers that contains given type of numbers. This parameter cannot be used along with available or state.
phone_number_type (NumberListPhoneNumberType) – Returns the filtered list of PSTN phone numbers that are of given phoneNumberType.
state (NumberState) – Returns the list of PSTN phone numbers with matching state.
toll_free_numbers (bool) – Returns the list of toll free phone numbers.
org_id (str) – List numbers for this organization.
- Returns
yields
NumberListPhoneNumber
instances
- phone_number_details(*, org_id: Optional[str] = None) NumberDetails [source]
get summary (counts) of phone numbers
- Parameters
org_id (str) – detaild for numbers in this organization.
- Returns
phone number details
- Return type
- validate_extensions(*, extensions: list[str]) ValidateExtensionsResponse [source]
Validate the List of Extensions
Validate the List of Extensions. Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters
extensions (list[str]) – Array of Strings of ID of Extensions.
- Returns
validation response
- Return type
- validate_phone_numbers(phone_numbers: list[str], org_id: Optional[str] = None) ValidatePhoneNumbersResponse [source]
Validate the list of phone numbers in an organization. Each phone number’s availability is indicated in the response.
Each location has a set of phone numbers that can be assigned to people, workspaces, or features. Phone numbers must follow E.164 format for all countries, except for the United States, which can also follow the National format. Active phone numbers are in service.
Validating a phone number in an organization requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters
phone_numbers (list[str]) – List of phone numbers to be validated.
org_id (str) – Organization of the Route Group.
- Returns
validation result
- Return type
- ucm_profiles(*, org_id: Optional[str] = None) list[wxc_sdk.telephony.UCMProfile] [source]
Read the List of UC Manager Profiles
List all calling UC Manager Profiles for the organization.
UC Manager Profiles are applicable if your organization uses Jabber in Team Messaging mode or Calling in Webex Teams (Unified CM).
The UC Manager Profile has an organization-wide default and may be overridden for individual persons, although currently only setting at a user level is supported by Webex APIs.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:people_read as this API is designed to be used in conjunction with calling behavior at the user level.
- Parameters
org_id (str) – List manager profiles in this organization.
- Returns
list of
UCMProfile
- change_announcement_language(*, location_id: str, language_code: str, agent_enabled: Optional[bool] = None, service_enabled: Optional[bool] = None, org_id: Optional[str] = None)[source]
Change Announcement Language
Change announcement language for the given location.
Change announcement language for current people/workspaces and/or existing feature configurations. This does not change the default announcement language which is applied to new users/workspaces and new feature configurations.
Changing announcement language for the given location requires a full administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters
location_id (str) – Change announcement language for this location.
language_code (str) – Language code.
agent_enabled (bool) – Set to true to change announcement language for existing people and workspaces.
service_enabled (bool) – Set to true to change announcement language for existing feature configurations.
org_id (str) – Change announcement language for this organization.
- route_choices(route_group_name: Optional[str] = None, trunk_name: Optional[str] = None, order: Optional[str] = None, org_id: Optional[str] = None) Generator[RouteIdentity, None, None] [source]
List all Routes for the organization.
Trunk and Route Group qualify as Route. Trunks and Route Groups provide you the ability to configure Webex Calling to manage calls between Webex Calling hosted users and premises PBX(s) users. This solution lets you configure users to use Cloud PSTN (CCP or Cisco PSTN) or Premises-based PSTN.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.
- Parameters
route_group_name – Return the list of route identities matching the route group name.
trunk_name – Return the list of route identities matching the trunk name.
order – Order the route identities according to the designated fields. Available sort fields: routeName, routeType.
org_id – List route identities for this organization.
- Returns
- test_call_routing(*, originator_id: str, originator_type: OriginatorType, destination: str, originator_number: Optional[str] = None, org_id: Optional[str] = None) TestCallRoutingResult [source]
Validates that an incoming call can be routed.
Dial plans route calls to on-premises destinations by use of trunks or route groups. They are configured globally for an enterprise and apply to all users, regardless of location. A dial plan also specifies the routing choice (trunk or route group) for calls that match any of its dial patterns. Specific dial patterns can be defined as part of your dial plan.
Test call routing requires a full or write-only administrator auth token with a scope of spark-admin:telephony_config_write.
- Parameters
originator_id (str) – This element is used to identify the originating party. It can be user UUID or trunk UUID.
originator_type (
OriginatorType
) –destination (str) – This element specifies called party. It can be any dialable string, for example, an ESN number, E.164 number, hosted user DN, extension, extension with location code, URL, FAC code.
originator_number (str) – Only used when originatorType is TRUNK. This element could be a phone number or URI.
org_id (str) – Organization in which we are validating a call routing.
- Returns
call routing test result
- Return type
Subpackages
Submodules
- wxc_sdk.telephony.access_codes module
- wxc_sdk.telephony.autoattendant module
- wxc_sdk.telephony.callpark module
- wxc_sdk.telephony.callpark_extension module
- wxc_sdk.telephony.callpickup module
- wxc_sdk.telephony.calls module
- wxc_sdk.telephony.forwarding module
- wxc_sdk.telephony.hg_and_cq module
- wxc_sdk.telephony.huntgroup module
- wxc_sdk.telephony.organisation_vm module
- wxc_sdk.telephony.paging module
- wxc_sdk.telephony.pnc module
- wxc_sdk.telephony.vm_rules module
- wxc_sdk.telephony.voicemail_groups module
- wxc_sdk.telephony.voiceportal module