BetaVoiceAgentsTelephonyOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

AIProjectClient's

<xref:telephony> attribute.

Constructor

BetaVoiceAgentsTelephonyOperations(*args, **kwargs)

Methods

cancel_call_job

Cancel an outbound telephony call job.

Requests cancellation of a durable outbound call job. A connected call is allowed to finish.

create_binding

Create an agent telephony binding.

Creates a telephony binding for the voice agent named in the path.

create_call_job

Create an outbound telephony call job.

Creates one durable direct outbound call job. The latest agent definition is resolved when each attempt executes.

delete_binding

Delete an agent telephony binding.

Deletes a telephony binding owned by the voice agent named in the path.

end_call

End an active agent telephony call.

Ends an active inbound call owned by the voice agent named in the path.

get_binding

Get an agent telephony binding.

Retrieves a telephony binding owned by the voice agent named in the path.

get_call

Get an agent telephony call.

Retrieves a durable inbound call record owned by the voice agent named in the path.

get_call_job

Get an outbound telephony call job.

Retrieves a durable direct or campaign-created outbound call job.

get_transfer_targets

Get agent telephony transfer targets.

Returns all transfer targets configured for the voice agent named in the path.

list_bindings

List agent telephony bindings.

Returns the telephony bindings owned by the voice agent named in the path.

list_calls

List agent telephony calls.

Returns the durable inbound call history for the voice agent named in the path.

replace_transfer_targets

Replace agent telephony transfer targets.

Replaces all transfer targets configured for the voice agent named in the path.

transfer_call

Transfer an active agent telephony call.

Transfers an active inbound call to a configured target for the voice agent named in the path.

update_binding

Update an agent telephony binding.

Updates a telephony binding owned by the voice agent named in the path.

cancel_call_job

Cancel an outbound telephony call job.

Requests cancellation of a durable outbound call job. A connected call is allowed to finish.

cancel_call_job(agent_name: str, call_job_id: str, *, etag: str, match_condition: MatchConditions, **kwargs: Any) -> TelephonyCallJob

Parameters

Name Description
agent_name
Required
str

Required.

call_job_id
Required
str

Required.

Keyword-Only Parameters

Name Description
etag
str

check if resource is changed. Set None to skip checking etag. Required.

match_condition

The match condition to use upon the etag. Required.

Returns

Type Description

TelephonyCallJob. The TelephonyCallJob is compatible with MutableMapping

Exceptions

Type Description

create_binding

Create an agent telephony binding.

Creates a telephony binding for the voice agent named in the path.

create_binding(agent_name: str, telephony_binding: _models.CreateTelephonyBindingRequest, *, content_type: str = 'application/json', **kwargs: Any) -> _models.TelephonyBinding

Parameters

Name Description
agent_name
Required
str

The name of the voice agent that owns the binding. Required.

telephony_binding
Required

The provider-specific binding to create. Is one of the following types: CreateTelephonyBindingRequest, JSON, IO[bytes] Required.

Returns

Type Description

TelephonyBinding. The TelephonyBinding is compatible with MutableMapping

Exceptions

Type Description

create_call_job

Create an outbound telephony call job.

Creates one durable direct outbound call job. The latest agent definition is resolved when each attempt executes.

create_call_job(agent_name: str, body: _models.CreateTelephonyCallJobRequest, *, idempotency_key: str, content_type: str = 'application/json', **kwargs: Any) -> _models.TelephonyCallJob

Parameters

Name Description
agent_name
Required
str

The name of the voice agent that executes the call. Required.

body
Required

The direct outbound call to create. Is one of the following types: CreateTelephonyCallJobRequest, JSON, IO[bytes] Required.

Keyword-Only Parameters

Name Description
idempotency_key
str

A customer-generated idempotency key. Reusing it with an equivalent request returns the same call job. Required.

Returns

Type Description

TelephonyCallJob. The TelephonyCallJob is compatible with MutableMapping

Exceptions

Type Description

delete_binding

Delete an agent telephony binding.

Deletes a telephony binding owned by the voice agent named in the path.

delete_binding(agent_name: str, binding_id: str, *, etag: str, match_condition: MatchConditions, **kwargs: Any) -> None

Parameters

Name Description
agent_name
Required
str

The name of the voice agent that owns the binding. Required.

binding_id
Required
str

The service-generated binding identifier. Required.

Keyword-Only Parameters

Name Description
etag
str

check if resource is changed. Set None to skip checking etag. Required.

match_condition

The match condition to use upon the etag. Required.

Returns

Type Description

None

Exceptions

Type Description

end_call

End an active agent telephony call.

Ends an active inbound call owned by the voice agent named in the path.

end_call(agent_name: str, call_id: str, **kwargs: Any) -> TelephonyCallRecord

Parameters

Name Description
agent_name
Required
str

The name of the voice agent that owns the active call. Required.

call_id
Required
str

The service-generated call identifier. Required.

Returns

Type Description

TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping

Exceptions

Type Description

get_binding

Get an agent telephony binding.

Retrieves a telephony binding owned by the voice agent named in the path.

get_binding(agent_name: str, binding_id: str, **kwargs: Any) -> TelephonyBinding

Parameters

Name Description
agent_name
Required
str

The name of the voice agent that owns the binding. Required.

binding_id
Required
str

The service-generated binding identifier. Required.

Returns

Type Description

TelephonyBinding. The TelephonyBinding is compatible with MutableMapping

Exceptions

Type Description

get_call

Get an agent telephony call.

Retrieves a durable inbound call record owned by the voice agent named in the path.

get_call(agent_name: str, call_id: str, **kwargs: Any) -> TelephonyCallRecord

Parameters

Name Description
agent_name
Required
str

The name of the voice agent that owns the call record. Required.

call_id
Required
str

The service-generated call identifier. Required.

Returns

Type Description

TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping

Exceptions

Type Description

get_call_job

Get an outbound telephony call job.

Retrieves a durable direct or campaign-created outbound call job.

get_call_job(agent_name: str, call_job_id: str, **kwargs: Any) -> TelephonyCallJob

Parameters

Name Description
agent_name
Required
str

Required.

call_job_id
Required
str

Required.

Returns

Type Description

TelephonyCallJob. The TelephonyCallJob is compatible with MutableMapping

Exceptions

Type Description

get_transfer_targets

Get agent telephony transfer targets.

Returns all transfer targets configured for the voice agent named in the path.

get_transfer_targets(agent_name: str, **kwargs: Any) -> TelephonyTransferTargets

Parameters

Name Description
agent_name
Required
str

The name of the voice agent whose transfer targets are retrieved. Required.

Returns

Type Description

TelephonyTransferTargets. The TelephonyTransferTargets is compatible with MutableMapping

Exceptions

Type Description

list_bindings

List agent telephony bindings.

Returns the telephony bindings owned by the voice agent named in the path.

list_bindings(agent_name: str, *, provider: str | TelephonyProvider | None = None, status: str | TelephonyBindingStatus | None = None, limit: int | None = None, order: str | PageOrder | None = None, before: str | None = None, **kwargs: Any) -> ItemPaged[TelephonyBindingListItem]

Parameters

Name Description
agent_name
Required
str

The name of the voice agent whose bindings are listed. Required.

Keyword-Only Parameters

Name Description
provider

Filters bindings by provider. Known values are: "teams_phone_extension" and "twilio". Default value is None.

Default value: None
status

Filters bindings by lifecycle status. Known values are: "active" and "suspended". Default value is None.

Default value: None
limit
int

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. Default value is None.

Default value: None
order

Sort order by the created_at timestamp of the objects. asc for ascending order anddesc for descending order. Known values are: "asc" and "desc". Default value is None.

Default value: None
before
str

A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. Default value is None.

Default value: None

Returns

Type Description

An iterator like instance of TelephonyBindingListItem

Exceptions

Type Description

list_calls

List agent telephony calls.

Returns the durable inbound call history for the voice agent named in the path.

list_calls(agent_name: str, *, provider: str | TelephonyProvider | None = None, status: str | TelephonyCallStatus | None = None, started_after_time: datetime | None = None, started_before_time: datetime | None = None, limit: int | None = None, order: str | PageOrder | None = None, before: str | None = None, **kwargs: Any) -> ItemPaged[TelephonyCallSummary]

Parameters

Name Description
agent_name
Required
str

The name of the voice agent whose calls are listed. Required.

Keyword-Only Parameters

Name Description
provider

Filters calls by provider. Known values are: "teams_phone_extension" and "twilio". Default value is None.

Default value: None
status

Filters calls by lifecycle status. Known values are: "in_progress", "success", and "failed". Default value is None.

Default value: None
started_after_time

Includes calls that started at or after this Unix timestamp in seconds. Default value is None.

Default value: None
started_before_time

Includes calls that started at or before this Unix timestamp in seconds. Default value is None.

Default value: None
limit
int

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. Default value is None.

Default value: None
order

Sort order by the created_at timestamp of the objects. asc for ascending order anddesc for descending order. Known values are: "asc" and "desc". Default value is None.

Default value: None
before
str

A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. Default value is None.

Default value: None

Returns

Type Description

An iterator like instance of TelephonyCallSummary

Exceptions

Type Description

replace_transfer_targets

Replace agent telephony transfer targets.

Replaces all transfer targets configured for the voice agent named in the path.

replace_transfer_targets(agent_name: str, *, etag: str, match_condition: MatchConditions, transfer_targets: List[_models.TelephonyTransferTarget], content_type: str = 'application/json', **kwargs: Any) -> _models.TelephonyTransferTargets

Parameters

Name Description
agent_name
Required
str

The name of the voice agent whose transfer targets are replaced. Required.

body
<xref:JSON> or IO[bytes]

Is either a JSON type or a IO[bytes] type. Required.

Keyword-Only Parameters

Name Description
etag
str

check if resource is changed. Set None to skip checking etag. Required.

match_condition

The match condition to use upon the etag. Required.

transfer_targets

The complete set of destinations to which the voice agent may transfer calls. An empty array clears all targets when replacing the configuration. Required.

Default value: <object object at 0x0000024ED00CEE20>

Returns

Type Description

TelephonyTransferTargets. The TelephonyTransferTargets is compatible with MutableMapping

Exceptions

Type Description

transfer_call

Transfer an active agent telephony call.

Transfers an active inbound call to a configured target for the voice agent named in the path.

transfer_call(agent_name: str, call_id: str, *, target: str, content_type: str = 'application/json', **kwargs: Any) -> _models.TelephonyCallRecord

Parameters

Name Description
agent_name
Required
str

The name of the voice agent that owns the active call. Required.

call_id
Required
str

The service-generated call identifier. Required.

body
<xref:JSON> or IO[bytes]

Is either a JSON type or a IO[bytes] type. Required.

Keyword-Only Parameters

Name Description
target
str

The name of a transfer target configured for the voice agent. Required.

Default value: <object object at 0x0000024ED00CEE20>

Returns

Type Description

TelephonyCallRecord. The TelephonyCallRecord is compatible with MutableMapping

Exceptions

Type Description

update_binding

Update an agent telephony binding.

Updates a telephony binding owned by the voice agent named in the path.

update_binding(agent_name: str, binding_id: str, body: _models.UpdateTelephonyBindingRequest, *, etag: str, match_condition: MatchConditions, content_type: str = 'application/merge-patch+json', **kwargs: Any) -> _models.TelephonyBinding

Parameters

Name Description
agent_name
Required
str

The name of the voice agent that owns the binding. Required.

binding_id
Required
str

The service-generated binding identifier. Required.

body
Required

The binding properties to update. Is one of the following types: UpdateTelephonyBindingRequest, JSON, IO[bytes] Required.

Keyword-Only Parameters

Name Description
etag
str

check if resource is changed. Set None to skip checking etag. Required.

match_condition

The match condition to use upon the etag. Required.

Returns

Type Description

TelephonyBinding. The TelephonyBinding is compatible with MutableMapping

Exceptions

Type Description