VoiceAgentsTelephonyOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

AIProjectClient's

<xref:telephony> attribute.

Constructor

VoiceAgentsTelephonyOperations(*args, **kwargs)

Methods

cancel_call_job

Cancel an outbound telephony call job.

Cancels future attempts using If-Match; completion may be asynchronous. New cancellation after connection returns 409 and lets the active call finish. Cancelling a SIP call job requires the VoiceAgents=V1Preview opt-in.

create_binding

Create an agent telephony binding.

Creates a telephony binding for the voice agent named in the path. Creating a SIP binding requires the VoiceAgents=V1Preview opt-in.

create_call_job

Create an outbound telephony call job.

Creates one durable outbound CallJob. Each attempt pins the Agent endpoint's execution version for validation and its voice session. A call job over a SipOutbound connection requires the VoiceAgents=V1Preview opt-in.

delete_binding

Delete an agent telephony binding.

Deletes a telephony binding owned by the voice agent named in the path. Deleting a SIP binding requires the VoiceAgents=V1Preview opt-in.

delete_call_job

Delete an outbound telephony call job.

Deletes a terminal, reconciled job (otherwise 409), without cancelling calls or removing Campaign outcomes/call history. Later GET returns 404; repeated DELETE returns 204. Deleting a SIP call job requires the VoiceAgents=V1Preview opt-in.

end_call

End an active agent telephony call.

Ends an active inbound call owned by the voice agent named in the path. Ending a SIP call requires the VoiceAgents=V1Preview opt-in.

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_call_jobs

List outbound telephony call jobs.

Lists current direct/Campaign jobs, excluding deleted or superseded rounds. Pages are live. Campaign cursors survive boundary deletion/cancel, not replacement/name reuse (400 invalid_cursor).

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. Configuring a SIP destination requires the VoiceAgents=V1Preview opt-in.

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. Transferring a SIP call requires the VoiceAgents=V1Preview opt-in.

update_binding

Update an agent telephony binding.

Updates a telephony binding owned by the voice agent named in the path. Updating a SIP binding requires the VoiceAgents=V1Preview opt-in.

cancel_call_job

Cancel an outbound telephony call job.

Cancels future attempts using If-Match; completion may be asynchronous. New cancellation after connection returns 409 and lets the active call finish. Cancelling a SIP call job requires the VoiceAgents=V1Preview opt-in.

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

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

call_job_id
Required
str

The service-generated identifier of the call job to cancel. 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. Creating a SIP binding requires the VoiceAgents=V1Preview opt-in.

create_binding(agent_name: str, binding: _models.TelephonyBinding, *, 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.

binding
Required
TelephonyBinding or <xref:JSON> or IO[bytes]

The provider-specific binding to create. Is one of the following types: TelephonyBinding, 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 outbound CallJob. Each attempt pins the Agent endpoint's execution version for validation and its voice session. A call job over a SipOutbound connection requires the VoiceAgents=V1Preview opt-in.

create_call_job(agent_name: str, job: _models.TelephonyCallJobCreate, *, 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.

job
Required
TelephonyCallJobCreate or <xref:JSON> or IO[bytes]

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

Keyword-Only Parameters

Name Description
idempotency_key
str

Customer retry key. Equivalent requests return the same job; retained keys for deleted jobs return 409 call_job_deleted, never redial. 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. Deleting a SIP binding requires the VoiceAgents=V1Preview opt-in.

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

delete_call_job

Delete an outbound telephony call job.

Deletes a terminal, reconciled job (otherwise 409), without cancelling calls or removing Campaign outcomes/call history. Later GET returns 404; repeated DELETE returns 204. Deleting a SIP call job requires the VoiceAgents=V1Preview opt-in.

delete_call_job(agent_name: str, call_job_id: str, **kwargs: Any) -> None

Parameters

Name Description
agent_name
Required
str

The owning voice agent. Required.

call_job_id
Required
str

The call-job identifier. 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. Ending a SIP call requires the VoiceAgents=V1Preview opt-in.

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

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

call_job_id
Required
str

The service-generated identifier of the call job to retrieve. 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, 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_extensibility", "twilio", and "sip". 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_call_jobs

List outbound telephony call jobs.

Lists current direct/Campaign jobs, excluding deleted or superseded rounds. Pages are live. Campaign cursors survive boundary deletion/cancel, not replacement/name reuse (400 invalid_cursor).

list_call_jobs(agent_name: str, *, limit: int | None = None, order: str | PageOrder | None = None, before: str | None = None, status: str | TelephonyCallJobStatus | None = None, campaign_name: str | None = None, **kwargs: Any) -> ItemPaged[TelephonyCallJob]

Parameters

Name Description
agent_name
Required
str

The owning voice agent. Authorization is applied before pagination. Required.

Keyword-Only Parameters

Name Description
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
status

Optional lifecycle filter. Known values are: "accepted", "waiting_for_schedule", "queued", "dispatching", "in_progress", "waiting_for_retry", "cancellation_requested", "completed", "blocked", "expired", "failed", and "cancelled". Default value is None.

Default value: None
campaign_name
str

Current Campaign round: 404 if absent, empty while deleting. Omit for direct and Campaign jobs. Replacement/name reuse invalidates cursors. Default value is None.

Default value: None

Returns

Type Description

An iterator like instance of TelephonyCallJob

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_extensibility", "twilio", and "sip". 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. Configuring a SIP destination requires the VoiceAgents=V1Preview opt-in.

replace_transfer_targets(agent_name: str, *, transfer_targets: List[_models.TelephonyTransferTarget], etag: str, match_condition: MatchConditions, 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
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 0x0000029F297D0430>
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

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. Transferring a SIP call requires the VoiceAgents=V1Preview opt-in.

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 0x0000029F297D0430>

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. Updating a SIP binding requires the VoiceAgents=V1Preview opt-in.

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