wxc_sdk.telephony.pstn package
- class wxc_sdk.telephony.pstn.PSTNServiceType(*values)[source]
Bases:
str,SafeEnumAn enumeration.
- geographic_numbers = 'GEOGRAPHIC_NUMBERS'
PSTN service type for geographic numbers.
- tollfree_numbers = 'TOLLFREE_NUMBERS'
PSTN service type for toll-free numbers.
- business_texting = 'BUSINESS_TEXTING'
PSTN service type for business texting.
- contact_center = 'CONTACT_CENTER'
PSTN service type for contact center services.
- service_numbers = 'SERVICE_NUMBERS'
PSTN service type for service numbers.
- non_geographic_numbers = 'NON_GEOGRAPHIC_NUMBERS'
PSTN service type for non-geographic numbers.
- mobile_numbers = 'MOBILE_NUMBERS'
PSTN service type for mobile numbers.
- class wxc_sdk.telephony.pstn.PSTNConnectionOption(*, id: str | None = None, displayName: str | None = None, pstnServices: list[PSTNServiceType] | None = None, pstnConnectionType: PSTNType | None = None, routeType: RouteType | None = None, routeId: str | None = None, **extra_data: Any)[source]
Bases:
ApiModel- id: str | None
A unique identifier for the connection.
- display_name: str | None
The display name of the PSTN connection.
- pstn_services: list[PSTNServiceType] | None
The PSTN services available for this connection.
- route_type: RouteType | None
Premise route type. This is required if connection type is LOCAL_GATEWAY.
- route_id: str | None
Premise route ID. This refers to either a Trunk ID or a Route Group ID. This field is optional but required if the connection type is LOCAL_GATEWAY.
- class wxc_sdk.telephony.pstn.PSTNType(*values)[source]
Bases:
str,SafeEnumAn enumeration.
- local_gateway = 'LOCAL_GATEWAY'
PSTN connection type for a premises-based connection.
- non_integrated_ccp = 'NON_INTEGRATED_CCP'
PSTN connection type for a Non-Integrated Cloud Connected PSTN connection.
- integrated_ccp = 'INTEGRATED_CCP'
PSTN connection type for an Integrated Cloud Connected PSTN connection. Updating the location with this connection type is currently not supported using the API.
- cisco_pstn = 'CISCO_PSTN'
PSTN connection type for a Cisco PSTN connection. Updating the location with this connection type is currently not supported using the API.
- class wxc_sdk.telephony.pstn.PSTNApi(*, session: RestSession, base: str = None)[source]
Bases:
ApiChildPSTN
PSTN Location Connection Settings supports PSTN selection when creating a location or changing a PSTN type for a location. This is only supported for Local Gateway and Non-integrated CCP.
Viewing these read-only organization settings requires a full or read-only administrator auth token with a scope of spark-admin:telephony_pstn_read.
Modifying these organization settings requires a full administrator auth token with a scope of spark-admin:telephony_pstn_write.
A partner administrator can retrieve or change settings in a customer’s organization using the optional orgId query parameter.
- list(location_id: str, service_types: list[PSTNServiceType] = None, org_id: str = None) list[PSTNConnectionOption][source]
Retrieve PSTN Connection Options for a Location
Retrieve the list of PSTN connection options available for a location.
PSTN location connection settings enables the admin to configure or change the PSTN provider for a location.
Retrieving this list requires a full or read-only administrator auth token with a scope of spark-admin:telephony_pstn_read.
- Parameters:
location_id (str) – Return the list of List PSTN location connection options for this location.
service_types (list[PSTNServiceType]) –
Use the serviceTypes parameter to fetch connections for the following services
MOBILE_NUMBERS
org_id (str) – List PSTN location connection options for this organization.
- Return type:
list[PSTNConnectionOption]
- configure(location_id: str, id: str = None, premise_route_type: str = None, premise_route_id: str = None, org_id: str = None)[source]
Setup PSTN Connection for a Location
Set up or update the PSTN connection details for a location.
PSTN location connection settings enables the admin to configure or change the PSTN provider for a location.
Setting up PSTN connection on a location requires a full administrator auth token with a scope of spark-admin:telephony_pstn_write.
- Parameters:
location_id (str) – Setup PSTN location connection options for this location.
id (str) – A unique identifier for the connection. This is required for non-integrated CCP.
premise_route_type (str) – Premise route type. The possible types are TRUNK and ROUTE_GROUP. This is required for the local gateway.
premise_route_id (str) – Premise route ID. This refers to either a Trunk ID or a Route Group ID and is required for the local gateway.
org_id (str) – Setup PSTN location connection for this organization.
- Return type:
None
- read(location_id: str, org_id: str = None) PSTNConnectionOption[source]
Retrieve PSTN Connection for a Location
Retrieves the current configured PSTN connection details for a location.
PSTN location connection settings enables the admin to configure or change the PSTN provider for a location.
Retrieving the PSTN connection details for a location requires a full or read-only administrator auth token with a scope of spark-admin:telephony_pstn_read.
- Parameters:
location_id (str) – Retrieve PSTN location connection details for this location.
org_id (str) – Retrieve PSTN location connection details for this organization.
- Return type:
- perform_numbers_action(location_id: str, action: ModifyNumberAction, numbers: list[str], org_id: str = None) list[ModifyNumbersActionOrder][source]
Perform Numbers Action
Perform number usage action for the specified list of numbers. The required action query parameter specifies the operation to apply to the numbers in the request body. The API supports modifying number usage between STANDARD/SERVICE/ELIN.
A phone number’s usage type determines how it is used within a Webex Calling location. STANDARD numbers support regular calling and can be assigned to people, workspaces, or features. SERVICE numbers support services such as Auto Attendant, Call Queue, Hunt Groups, and Webex Contact Center. ELIN (Emergency Location Identification Number) numbers provide emergency services with accurate caller information and support callbacks to the person or workspace that initiated the emergency call, including people with extension-only lines.
Executing number actions requires an administrator auth token with a scope of spark-admin:telephony_pstn_write.
- Parameters:
location_id (str) – Location identifier in Webex format.
action (ModifyNumberAction) – Action to execute.
numbers (list[str]) – Phone numbers to process.
org_id (str) – Organization ID. If not specified, uses the organization from the OAuth token.
- Return type:
list[ModifyNumbersActionOrder]
- get_modifiable_numbers(location_id: str, action: ModifyNumberAction, org_id: str = None) list[ModifiableNumber][source]
Get Modifiable Numbers
Retrieve modifiable numbers for a location based on action type.
The required action query parameter specifies the operation used to identify eligible numbers.
This endpoint does not support pagination. Up to a configurable server-side maximum of candidate numbers (default 2000) are retrieved and filtered for eligibility, and all eligible numbers within that candidate window are returned in a single response.
A phone number’s usage type determines how it is used within a Webex Calling location. STANDARD numbers support regular calling and can be assigned to people, workspaces, or features. SERVICE numbers support services such as Auto Attendant, Call Queue, Hunt Groups, and Webex Contact Center. ELIN (Emergency Location Identification Number) numbers provide emergency services with accurate caller information and support callbacks to the person or workspace that initiated the emergency call, including people with extension-only lines.
Viewing number availability requires an administrator auth token with a scope of spark-admin:telephony_pstn_read.
- Parameters:
location_id (str) – Location identifier in Webex format.
action (ModifyNumberAction) – Action type for modifiable numbers.
org_id (str) – Organization ID. If not specified, uses the organization from the OAuth token.
- Return type:
list[ModifiableNumber]
- base = 'telephony/pstn'
- class wxc_sdk.telephony.pstn.ModifyNumberAction(*values)[source]
Bases:
str,SafeEnumAn enumeration.
- modify_elin = 'modifyElin'
- modify_standard = 'modifyStandard'
- modify_service = 'modifyService'
- class wxc_sdk.telephony.pstn.ModifyNumbersActionOrderStatus(*values)[source]
Bases:
str,SafeEnumAn enumeration.
- pending = 'PENDING'
- partial = 'PARTIAL'
- complete = 'COMPLETE'
- provisioned = 'PROVISIONED'
- error = 'ERROR'
- class wxc_sdk.telephony.pstn.ModifiableNumber(*, phoneNumber: str | None = None, state: NumberState | None = None, isServiceNumber: bool | None = None, tollFreeNumber: bool | None = None, mainNumber: bool | None = None, isELIN: bool | None = None, isReservedNumber: bool | None = None, telephonyType: TelephonyType | None = None, **extra_data: Any)[source]
Bases:
ApiModel- phone_number: str | None
Phone number in E.164 format.
- state: NumberState | None
Phone number state.
ACTIVE — The phone number is active.
INACTIVE — The phone number is inactive.
- is_service_number: bool | None
Indicates whether this is a service number.
- toll_free_number: bool | None
Indicates whether this is a toll-free number.
- main_number: bool | None
Indicates whether this is the location main number.
- is_elin: bool | None
Indicates whether this number is currently an ELIN.
- is_reserved_number: bool | None
Indicates whether this is a reserved number.
- telephony_type: TelephonyType | None
Telephony type.
PSTN_NUMBER — A standard PSTN number.
MOBILE_NUMBER — A mobile telephone number.
- class wxc_sdk.telephony.pstn.ModifyNumbersActionError(*, number: str | None = None, errorType: str | None = None, errorCode: str | None = None, errorTitle: str | None = None, errorMessage: str | None = None, **extra_data: Any)[source]
Bases:
ApiModel- number: str | None
Phone number associated with the error.
- error_type: str | None
Category of the error, such as VERIFICATION or FAILED.
- error_code: str | None
Stable machine-readable error code, such as ERR.V.TRM.TMN60045.
- error_title: str | None
Stable symbolic title associated with the error code, such as NUMBER_HAS_BUSINESS_TEXTING.
- error_message: str | None
Human-readable explanation of the error. Defaults to the message associated with errorCode and may contain more specific runtime detail.
- class wxc_sdk.telephony.pstn.ModifyNumbersActionOrder(*, orderId: str | None = None, status: ModifyNumbersActionOrderStatus | None = None, numbers: list[ModifyNumbersActionOrderNumber] | None = None, errors: list[ModifyNumbersActionError] | None = None, **extra_data: Any)[source]
Bases:
ApiModel- order_id: str | None
Order identifier in Webex format.
- status: ModifyNumbersActionOrderStatus | None
Order status.
PENDING — The order is waiting to be processed.
PARTIAL — The order completed with only some number actions succeeding.
COMPLETE — The order completed successfully.
PROVISIONED — The requested number changes were successfully provisioned.
ERROR — The order failed.
- numbers: list[ModifyNumbersActionOrderNumber] | None
Results for the phone numbers included in the order.
- errors: list[ModifyNumbersActionError] | None
Validation or provisioning errors associated with the order.
- class wxc_sdk.telephony.pstn.ModifyNumbersActionOrderNumber(*, number: str | None = None, status: ModifyNumbersActionOrderNumberStatus | None = None, usage: ModifyNumbersActionOrderNumberUsage | None = None, errors: list[ModifyNumbersActionError] | None = None, **extra_data: Any)[source]
Bases:
ApiModel- number: str | None
Phone number.
- status: ModifyNumbersActionOrderNumberStatus | None
Number-level action status.
SUCCESS — The action completed successfully for the number.
FAILED — The action failed for the number.
PENDING — The action is still being processed for the number.
- usage: ModifyNumbersActionOrderNumberUsage | None
Final number usage type.
NONE — Standard number usage.
SERVICE — Service number usage.
ELIN — Emergency Location Identification Number usage.
- errors: list[ModifyNumbersActionError] | None
Validation or execution errors for this number.