wxc_sdk.telephony.virtual_extensions package

class wxc_sdk.telephony.virtual_extensions.VirtualExtensionsApi(*, session: RestSession, base: str | None = None)[source]

Bases: ApiChild

Features: Virtual Extensions

Features: Virtual Extensions allow assigning extensions to frequently called external numbers for simplified dialing within Webex Calling.

Viewing these read-only organization settings requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.

Modifying these organization settings requires a full administrator auth token with a scope of spark-admin:telephony_config_write.

A partner administrator can retrieve or change settings in a customer’s organization using the optional orgId query parameter.

list_range(order: str | None = None, name: str | None = None, prefix: str | None = None, location_id: str | None = None, org_level_only: bool | None = None, org_id: str | None = None, **params) Generator[VirtualExtensionRange, None, None][source]

Get a list of a Virtual Extension Range

Retrieves the list of Virtual Extension Ranges.

Virtual extension ranges integrate remote workers on a separate telephony system into Webex Calling and enable extension dialing. Using these ranges, you can define patterns that can be used to route calls at a location level or an organization level. You are allowed to define virtual extensions ranges in addition to individual virtual extensions. This works in both Standard and Enhanced modes

Retrieving a virtual extension range requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.

Parameters:
  • order (str) – Sort the list of virtual extension ranges by name or prefix, either ASC or DSC. Default sort order is ASC.

  • name (str) – Filter the list of virtual extension ranges by name.

  • prefix (str) – Filter the list of virtual extension ranges by prefix.

  • location_id (str) – Filter the list of virtual extension ranges by location ID. Only one of the locationId and OrgLevelOnly query parameters is allowed at the same time.

  • org_level_only (bool) – Filter the list of virtual extension ranges by organization level. If orgLevelOnly is true, return only the organization level virtual extension ranges.

  • org_id (str) – Unique identifier for the organization.

Returns:

Generator yielding GetVirtualExtensionRangeListObject instances

create_range(name: str, prefix: str, patterns: list[str] | None = None, location_id: str | None = None, org_id: str | None = None) str[source]

Create a Virtual Extension Range

Create a new Virtual Extension Range for the given organization or location.

Virtual extension ranges integrate remote workers on a separate telephony system into Webex Calling and enable extension dialing. Using these ranges, you can define patterns that can be used to route calls at a location level or an organization level. You are allowed to define virtual extensions ranges in addition to individual virtual extensions. This works in both Standard and Enhanced modes

Virtual extension range can be set up at the organization or location level.

Creating a virtual extension range requires a full administrator or location administrator auth token with a scope of spark-admin:telephony_config_write.

Parameters:
  • name (str) – Name of the virtual extension range. This is a unique name for the virtual extension range.

  • prefix (str) – Prefix used for a virtual extension range. Prefix works in Standard and Enhanced modes. In Standard mode, it must be E.164 and unique. In Enhanced mode, it can be E.164 or non-E.164.

  • patterns (list[str]) – List of virtual extension patterns. You can add up to 100 patterns at a time. Extension patterns can include one or more right-justified wildcards “X” matching any digit.

  • location_id (str) – ID of the location to which the virtual extension range is assigned. The location ID is a unique identifier for the location in Webex Calling. This is set only when location level virtual extension range is added.

  • org_id (str) – Unique identifier for the organization.

Return type:

str

validate_range(location_id: str | None = None, name: str | None = None, prefix: str | None = None, patterns: list[str] | None = None, range_id: str | None = None, org_id: str | None = None) ValidateVirtualExtensionRange[source]

Validate the prefix and extension pattern for a Virtual Extension Range.

Virtual extension ranges integrate remote workers on a separate telephony system into Webex Calling and enable extension dialing. Using these ranges, you can define patterns that can be used to route calls at a location level or an organization level. You are allowed to define virtual extensions ranges in addition to individual virtual extensions. This works in both Standard and Enhanced modes

Validating a prefix and extension pattern for a Virtual Extension Range requires a full administrator or location administrator auth token with a scope of spark-admin:telephony_config_write.

Parameters:
  • location_id (str) – ID of the location to which the virtual extension range is assigned. The location ID is a unique identifier for the location in Webex Calling.

  • name (str) – Name of the virtual extension range. This is a unique name for the virtual extension range.

  • prefix (str) – Prefix used for a virtual extension range.

  • patterns (list[str]) – List of virtual extension patterns. The maximum number of patterns supported at a time is 100.

  • range_id (str) – ID of the virtual extension range. This is mandatory when validating for an existing virtual extension range, not present when validating a new virtual extension range before adding it.

  • org_id (str) – Unique identifier for the organization.

Return type:

ValidateVirtualExtensionRange

delete_range(extension_range_id: str, org_id: str | None = None)[source]

Delete a Virtual Extension Range

Delete a virtual extension range for the given extension range ID.

Virtual extension ranges integrate remote workers on a separate telephony system into Webex Calling and enable extension dialing. Using these ranges, you can define patterns that can be used to route calls at a location level or an organization level. You are allowed to define virtual extensions ranges in addition to individual virtual extensions. This works in both Standard and Enhanced modes

Deleting a virtual extension range requires a full administrator or location administrator auth token with a scope of spark-admin:telephony_config_write.

Parameters:
  • extension_range_id (str) – ID of the virtual extension range.

  • org_id (str) – Unique identifier for the organization.

Return type:

None

details_range(extension_range_id: str, org_id: str | None = None) VirtualExtensionRange[source]

Get details of a Virtual Extension Range

Retrieve virtual extension range details for the given extension range ID.

Virtual extension ranges integrate remote workers on a separate telephony system into Webex Calling and enable extension dialing. Using these ranges, you can define patterns that can be used to route calls at a location level or an organization level. You are allowed to define virtual extensions ranges in addition to individual virtual extensions. This works in both Standard and Enhanced modes

Retrieving a virtual extension range requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.

Parameters:
  • extension_range_id (str) – ID of the virtual extension range.

  • org_id (str) – Unique identifier for the organization.

Return type:

VirtualExtensionRange

modify_range(extension_range_id: str, name: str | None = None, prefix: str | None = None, patterns: list[str] | None = None, action: VirtualExtensionRangeAction | None = None, org_id: str | None = None)[source]

Modify Virtual Extension Range

Modify virtual extension range for the given extension range ID.

Virtual extension ranges integrate remote workers on a separate telephony system into Webex Calling and enable extension dialing. Using these ranges, you can define patterns that can be used to route calls at a location level or an organization level. You are allowed to define virtual extensions ranges in addition to individual virtual extensions. This works in both Standard and Enhanced modes

Modifying a virtual extension range requires a full administrator or location administrator auth token with a scope of spark-admin:telephony_config_write.

Parameters:
  • extension_range_id (str) – ID of the virtual extension range.

  • name (str) – Name of the virtual extension range. This is a unique name for the virtual extension range.

  • prefix (str) – Prefix used for a virtual extension range.

  • patterns (list[str]) – The pattern to be added, replaced, or removed from a virtual extension range. The maximum number of patterns supported at a time is 100.

  • action (VirtualExtensionRangeAction) – Action to be performed on the virtual extension range. It can be either ADD, REMOVE or REPLACE. This is mandatory when patterns are provided.

  • org_id (str) – Unique identifier for the organization.

Return type:

None

list_extensions(order: str | None = None, extension: str | None = None, phone_number: str | None = None, name: str | None = None, location_name: str | None = None, location_id: str | None = None, org_level_only: bool | None = None, org_id: str | None = None, **params) Generator[VirtualExtension, None, None][source]

Read the List of Virtual Extensions

Retrieve virtual extensions associated with a specific customer.

The GET Virtual Extensions API allows administrators to retrieve a list of virtual extensions configured within their organization. Virtual extensions enable users to dial extension numbers that route to external phone numbers, such as those of remote workers or frequently contacted clients. This API returns key information including the extension, associated phone number (in E.164 format), display name, and the location to which the virtual extension belongs The API supports filtering by various parameters, such as extension number, phone number, and location name. The results can be paginated using the max and start parameters, and the order of the results can be specified using the order parameter.

Retrieving a Virtual Extension requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.

Parameters:
  • order (str) – Order the list of virtual extensions in ascending or descending order. Default is ascending.

  • extension (str) – Filter the list of virtual extensions by extension number.

  • phone_number (str) – Filter the list of virtual extensions by phone number.

  • name (str) – Filter the list of virtual extensions by name. This can be either first name or last name.

  • location_name (str) – Filter the list of virtual extensions by location name.(Only one of the locationName, locationId, and OrgLevelOnly query parameters is allowed at the same time.)

  • location_id (str) – Filter the list of virtual extensions by location ID.

  • org_level_only (bool) – Filter the list of virtual extensions by organization level. If orgLevelOnly is true, return only the organization level virtual extensions.

  • org_id (str) – Unique identifier for the organization.

Returns:

Generator yielding GetVirtualExtensionObject instances

create_extension(display_name: str, phone_number: str, extension: str, first_name: str | None = None, last_name: str | None = None, location_id: str | None = None, org_id: str | None = None) str[source]

Create a Virtual Extension

Create new Virtual Extension for the given organization or location.

You can set up virtual extensions at the organization or location level. The organization level enables everyone across your organization to dial the same extension number to reach someone. You can use the location level virtual extension like any other extension assigned to the specific location. Users at the specific location can dial the extension. However, users at other locations can reach the virtual extension by dialing the ESN.

Creating a virtual extension requires a full administrator or location administrator auth token with a scope of spark-admin:telephony_config_write and identity:contacts_rw.

Parameters:
  • display_name (str) – Display name of the person at the virtual extension.

  • phone_number (str) – Directory number of the virtual extension.

  • extension (str) – Extension of the virtual extension.

  • first_name (str) – First name of the person at the virtual extension.

  • last_name (str) – Last name of the person at the virtual extension.

  • location_id (str) – ID of the location to which the virtual extension is assigned. The location ID is a unique identifier for the location in Webex Calling.

  • org_id (str) – Unique identifier for the organization.

Return type:

str

validate_external_phone_number(phone_numbers: list[str], org_id: str | None = None) ValidatePhoneNumber[source]

Validate an external phone number

Validate external phone number for the given organization.

This API is designed to validate external phone numbers before they are assigned as virtual extensions for a customer. It ensures that the provided numbers are properly formatted, eligible for use, and not already in use within the system. This validation is typically part of a pre-check process during provisioning or number assignment workflows, helping administrators or systems prevent conflicts or errors related to number reuse or format issues.

Creating a virtual extension requires a full administrator or location administrator auth token with a scope of spark-admin:telephony_config_write.

Parameters:
  • phone_numbers (list[str]) – List of external phone numbers to be validated.

  • org_id (str) – Unique identifier for the organization.

Return type:

ValidatePhoneNumber

get_extension_settings(org_id: str | None = None) VirtualExtensionMode[source]

Get Virtual extension settings

Retrieve Virtual Extension settings for the given Org.

This API retrieves the virtual extension mode settings configured for a given organization. Virtual extensions can operate in two modes: STANDARD and ENHANCED. The selected mode determines how the system handles routing and signaling for virtual extensions. By default, the virtual extensions that you create use the Standard mode. Another mode, enhanced signaling mode, is available to all customers, however, virtual extensions won’t function properly in this mode unless your PSTN provider supports special network signaling extensions and there aren’t many PSTN providers that do.

Retrieving a Virtual Extension settings requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.

Parameters:

org_id (str) – Unique identifier for the organization.

Return type:

VirtualExtensionMode

modify_extension_settings(mode: VirtualExtensionMode, org_id: str | None = None)[source]

Modify Virtual Extension Settings

Update Virtual Extension details for the given extension ID.

This endpoint updates the virtual extension settings for an organization. It is primarily used to configure the operating mode for virtual extensions. Modes determine how virtual extensions are assigned or managed within the system.

Updating a Virtual Extension requires a full administrator or location administrator auth token with a scope of spark-admin:telephony_config_write.

Parameters:

mode – Mode of the virtual extension. It can be either STANDARD or ENHANCED.

  • STANDARD - Standard Virtual extension mode in which virtual extensions must be associated with a valid

E.164 number, but this requires no enhanced signaling support from the PSTN provider. + ENHANCED - Enhanced signaling mode: only a few PSTN providers support this special network signaling extension. :type mode: VirtualExtensionMode :param org_id: Unique identifier for the organization. :type org_id: str :rtype: None

delete_extension(extension_id: str, org_id: str | None = None)[source]

Delete a Virtual Extension

Delete Virtual Extension using the extension ID.

This API permanently deletes a virtual extension from the organization. Once deleted, the extension will no longer route calls to the external phone number, and users won’t be able to reach it via the assigned extension.

Deleting a Virtual Extension requires a full administrator or location administrator auth token with a scope of spark-admin:telephony_config_write and identity:contacts_rw.

Parameters:
  • extension_id (str) – ID of the virtual extension.

  • org_id (str) – Unique identifier for the organization.

Return type:

None

details_extension(extension_id: str, org_id: str | None = None) VirtualExtension[source]

Get a Virtual Extension

Retrieve Virtual Extension details for the given extension ID.

Virtual extensions integrate remote workers on separate telephony systems into Webex Calling, enabling users to reach them via extension dialing. This endpoint allows administrators to retrieve configuration details for a specific virtual extension, ensuring visibility into the mapping between extensions and external phone numbers.

Retrieving a Virtual Extension requires a full or read-only administrator auth token with a scope of spark-admin:telephony_config_read.

Parameters:
  • extension_id (str) – ID of the virtual extension.

  • org_id (str) – Unique identifier for the organization.

Return type:

VirtualExtension

update_extension(extension_id: str, first_name: str | None = None, last_name: str | None = None, display_name: str | None = None, phone_number: str | None = None, extension: str | None = None, org_id: str | None = None)[source]

Update a Virtual Extension

Update Virtual Extension details for the given extension ID.

This API updates the configuration of an existing virtual extension identified by its unique extension ID. Administrators can modify fields such as the extension, associated phone number (in E.164 format), display name, and location etc.

Updating a Virtual Extension requires a full administrator or location administrator auth token with a scope of spark-admin:telephony_config_write and identity:contacts_rw.

Parameters:
  • extension_id (str) – ID of the virtual extension.

  • first_name (str) – First name of the person at the virtual extension.

  • last_name (str) – Last name of the person at the virtual extension.

  • display_name (str) – Display name of the person at the virtual extension.

  • phone_number (str) – Directory number of the virtual extension.

  • extension (str) – Extension of the virtual extension.

  • org_id (str) – Unique identifier for the organization.

Return type:

None

base = 'telephony/config'
class wxc_sdk.telephony.virtual_extensions.VirtualExtension(*, id: str | None = None, extension: str | None = None, routingPrefix: str | None = None, esn: str | None = None, phoneNumber: str | None = None, firstName: str | None = None, lastName: str | None = None, level: VirtualExtensionLevel | None = None, locationId: str | None = None, locationName: str | None = None, displayName: str | None = None, **extra_data: Any)[source]

Bases: ApiModel

id: str | None

ID of the virtual extension.

extension: str | None

Extension of the virtual extension.

routing_prefix: str | None

Routing prefix of the virtual extension’s location.

esn: str | None

ESN of the virtual extension.

phone_number: str | None

Directory number of the virtual extension.

first_name: str | None

First name of the person at the virtual extension.

last_name: str | None

Last name of the person at the virtual extension.

level: VirtualExtensionLevel | None

Level of the virtual extension. It can be either ORGANIZATION or LOCATION.

location_id: str | None

ID of the location to which the virtual extension is assigned. The location ID is a unique identifier for the location in Webex Calling.

location_name: str | None

Name of the location to which the virtual extension is assigned.

display_name: str | None

Display name of the person at the virtual extension.

class wxc_sdk.telephony.virtual_extensions.VirtualExtensionMode(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, SafeEnum

An enumeration.

standard = 'STANDARD'
enhanced = 'ENHANCED'
class wxc_sdk.telephony.virtual_extensions.VirtualExtensionLevel(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, SafeEnum

An enumeration.

location = 'LOCATION'
organization = 'ORGANIZATION'
class wxc_sdk.telephony.virtual_extensions.VirtualExtensionRange(*, id: str | None = None, name: str | None = None, prefix: str | None = None, level: VirtualExtensionLevel | None = None, patterns: list[str] | None = None, locationId: str | None = None, locationName: str | None = None, **extra_data: Any)[source]

Bases: ApiModel

id: str | None

ID of the virtual extension range.

name: str | None

Name of the virtual extension range. This is a unique name for the virtual extension range.

prefix: str | None

Prefix used for a virtual extension range. Prefix works in Standard and Enhanced modes. In Standard mode, it must be E.164 and it must be unique. In Enhanced mode, it can be E.164 or non-E.164.

level: VirtualExtensionLevel | None

Level of the virtual extension range. It can be either ORGANIZATION or LOCATION.

patterns: list[str] | None

List of virtual extension patterns. The maximum number of patterns supported at a time is 100. Extension patterns can include one or more right-justified wildcards “X” matching any digit.

location_id: str | None

ID of the location to which the virtual extension range is assigned. This is set only for virtual extension ranges at the location level.

location_name: str | None

Name of the location to which the virtual extension range is assigned. This is set only for virtual extension ranges at the location level

class wxc_sdk.telephony.virtual_extensions.VirtualExtensionRangeAction(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, SafeEnum

An enumeration.

add = 'ADD'

Add new patterns to the existing virtual extension range.

remove = 'REMOVE'

Remove existing patterns from the virtual extension range.

replace = 'REPLACE'

Replace existing patterns with new patterns in the virtual extension range.

class wxc_sdk.telephony.virtual_extensions.ValidateVirtualExtensionStatus(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, SafeEnum

An enumeration.

ok = 'OK'

Validation is successful.

errors = 'ERRORS'

Validation failed.

class wxc_sdk.telephony.virtual_extensions.VirtualExtensionValidationStatus(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, SafeEnum

An enumeration.

valid = 'VALID'

Validation is successful.

duplicate = 'DUPLICATE'

Duplicate patterns for virtual extension range.

duplicate_in_list = 'DUPLICATE_IN_LIST'

Duplicate routing number in the pattern list.

invalid = 'INVALID'

Invalid prefix length.

limit_exceeded = 'LIMIT_EXCEEDED'

Exceeding pattern limit of 100 in the request.

class wxc_sdk.telephony.virtual_extensions.VirtualExtensionRangeValidationResult(*, name: str | None = None, prefix: str | None = None, pattern: str | None = None, errorCode: int | None = None, message: str | None = None, status: VirtualExtensionValidationStatus | None = None, **extra_data: Any)[source]

Bases: ApiModel

name: str | None

Name used for virtual extension range validation.

prefix: str | None

Prefix used for a virtual extension range validation.

pattern: str | None

Pattern used for a virtual extension range validation.

error_code: int | None

Error code for the virtual extension range validation.

message: str | None

Error message for the virtual extension range validation.

status: VirtualExtensionValidationStatus | None

Virtual extension range validation status.

class wxc_sdk.telephony.virtual_extensions.ValidateVirtualExtensionRange(*, status: ValidateVirtualExtensionStatus | None = None, virtualExtensionRangeValidationStatus: list[VirtualExtensionRangeValidationResult] | None = None, **extra_data: Any)[source]

Bases: ApiModel

status: ValidateVirtualExtensionStatus | None

Virtual extension range validation status.

validation_status: list[VirtualExtensionRangeValidationResult] | None

Array of virtual extension range validation status. This is set only when the status is ERRORS.

class wxc_sdk.telephony.virtual_extensions.PhoneNumberStatus(*, phoneNumber: str | None = None, state: VirtualExtensionValidationStatus | None = None, errorCode: int | None = None, message: str | None = None, **extra_data: Any)[source]

Bases: ApiModel

phone_number: str | None
state: VirtualExtensionValidationStatus | None
error_code: int | None
message: str | None
class wxc_sdk.telephony.virtual_extensions.ValidatePhoneNumber(*, status: ~wxc_sdk.telephony.virtual_extensions.ValidateVirtualExtensionStatus | None = None, phoneNumberStatus: list[~wxc_sdk.telephony.virtual_extensions.PhoneNumberStatus] | None = <factory>, **extra_data: ~typing.Any)[source]

Bases: ApiModel

status: ValidateVirtualExtensionStatus | None
phone_number_status: list[PhoneNumberStatus] | None