TelephonyCallRecord Class

Detailed diagnostics for a durable inbound call to a voice agent.

Constructor

TelephonyCallRecord(*args: Any, **kwargs: Any)

Variables

Name Description
id
str

The service-generated call identifier. Required.

provider

The telephony provider. Required. Known values are: "teams_phone_extension" and "twilio".

provider_call_id
str

The provider-assigned call identifier, when available.

caller_number
str

The caller's phone number, when supplied by the provider.

provider_number
str

The Teams Phone Extension or Twilio number that received the call.

status

The lifecycle status of the call. Required. Known values are: "in_progress", "success", and "failed".

phase

The provider-neutral lifecycle phase reached by the call. Required. Known values are: "received", "validated", "admitted", "answering", "answered", "media_connected", "agent_session_ready", "bridging", "managing", "completed", "rejected", and "failed".

started_at

The Unix timestamp (in seconds) for when the inbound webhook was received. Required.

answered_at

The Unix timestamp (in seconds) for when the provider reported the call as answered.

media_connected_at

The Unix timestamp (in seconds) for when the provider media channel connected.

agent_session_ready_at

The Unix timestamp (in seconds) for when the voice-agent session became ready.

ended_at

The Unix timestamp (in seconds) for when the call ended.

duration_ms

The call duration.

end_reason

The service-generated reason that this single call ended, rather than the outcome of an overall outbound call job. Additional string codes may be returned. Known values are: "invalid_webhook_payload", "webhook_validation_failed", "binding_not_found", "binding_suspended", "admission_rejected", "admission_check_failed", "route_agent_mismatch", "invalid_binding_configuration", "credential_resolution_failed", "provider_resource_mismatch", "endpoint_resolution_failed", "ingress_setup_failed", "live_call_conflict", "live_call_persistence_failed", "answer_failed", "provider_disconnected", "provider_busy", "provider_no_answer", "provider_cancelled", "provider_failed", "provider_stream_error", "provider_stream_stopped", "agent_session_connect_failed", "media_stream_ended", "bridge_cancelled", "bridge_failed", "managed_hangup", "managed_transfer", "manage_hangup_failed", and "manage_transfer_failed".

provider_status_code
int

The provider status code associated with the terminal result.

provider_sub_code
int

The provider subcode associated with the terminal result.

provider_message
str

The provider message associated with the terminal result.

timing

Detailed provider-neutral call timing. Required.

trace

Correlation to the customer-facing Foundry trace.

events

The lifecycle timeline. Required.

events_truncated

Whether older lifecycle events were omitted from the timeline. Required.

Methods

as_dict

Return a dict that can be turned into json using json.dump.

clear

Remove all items from the dictionary.

copy
get

Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None :returns: The value for key if key is in the dictionary, else default. :rtype: any

items
keys
pop

Removes specified key and return the corresponding value. :param str key: The key to pop. :param any default: The value to return if key is not in the dictionary :returns: The value corresponding to the key. :rtype: any :raises KeyError: If key is not found and default is not given.

popitem

Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple :raises KeyError: if the dictionary is empty.

setdefault

Return the value for key if key is in the dictionary; otherwise set the key to default and return default. :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary :returns: The value for key if key is in the dictionary, else default. :rtype: any

update

Update the dictionary from a mapping or an iterable of key-value pairs. :param any args: Either a mapping object or an iterable of key-value pairs.

values

as_dict

Return a dict that can be turned into json using json.dump.

as_dict(*, exclude_readonly: bool = False) -> dict[str, Any]

Keyword-Only Parameters

Name Description
exclude_readonly

Whether to remove the readonly properties.

Default value: False

Returns

Type Description

A dict JSON compatible object

clear

Remove all items from the dictionary.

clear() -> None

copy

copy() -> Model

get

Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None :returns: The value for key if key is in the dictionary, else default. :rtype: any

get(key: str, default: Any = None) -> Any

Parameters

Name Description
key
Required
default
Default value: None

items

items() -> ItemsView[str, Any]

Returns

Type Description

a set-like object providing a view on the mapping's items

keys

keys() -> KeysView[str]

Returns

Type Description

a set-like object providing a view on the mapping's keys

pop

Removes specified key and return the corresponding value. :param str key: The key to pop. :param any default: The value to return if key is not in the dictionary :returns: The value corresponding to the key. :rtype: any :raises KeyError: If key is not found and default is not given.

pop(key: str, default: ~typing.Any = <object object>) -> Any

Parameters

Name Description
key
Required
default

popitem

Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple :raises KeyError: if the dictionary is empty.

popitem() -> tuple[str, Any]

setdefault

Return the value for key if key is in the dictionary; otherwise set the key to default and return default. :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary :returns: The value for key if key is in the dictionary, else default. :rtype: any

setdefault(key: str, default: ~typing.Any = <object object>) -> Any

Parameters

Name Description
key
Required
default

update

Update the dictionary from a mapping or an iterable of key-value pairs. :param any args: Either a mapping object or an iterable of key-value pairs.

update(*args: Any, **kwargs: Any) -> None

values

values() -> ValuesView[Any]

Returns

Type Description

an object providing a view on the mapping's values

Attributes

agent_session_ready_at

The Unix timestamp (in seconds) for when the voice-agent session became ready.

agent_session_ready_at: datetime | None

answered_at

The Unix timestamp (in seconds) for when the provider reported the call as answered.

answered_at: datetime | None

caller_number

The caller's phone number, when supplied by the provider.

caller_number: str | None

duration_ms

The call duration.

duration_ms: timedelta | None

end_reason

The service-generated reason that this single call ended, rather than the outcome of an overall outbound call job. Additional string codes may be returned. Known values are: "invalid_webhook_payload", "webhook_validation_failed", "binding_not_found", "binding_suspended", "admission_rejected", "admission_check_failed", "route_agent_mismatch", "invalid_binding_configuration", "credential_resolution_failed", "provider_resource_mismatch", "endpoint_resolution_failed", "ingress_setup_failed", "live_call_conflict", "live_call_persistence_failed", "answer_failed", "provider_disconnected", "provider_busy", "provider_no_answer", "provider_cancelled", "provider_failed", "provider_stream_error", "provider_stream_stopped", "agent_session_connect_failed", "media_stream_ended", "bridge_cancelled", "bridge_failed", "managed_hangup", "managed_transfer", "manage_hangup_failed", and "manage_transfer_failed".

end_reason: str | _models.TelephonyCallEndReason | None

ended_at

The Unix timestamp (in seconds) for when the call ended.

ended_at: datetime | None

events

The lifecycle timeline. Required.

events: list['_models.TelephonyCallLifecycleEvent']

events_truncated

Whether older lifecycle events were omitted from the timeline. Required.

events_truncated: bool

id

The service-generated call identifier. Required.

id: str

media_connected_at

The Unix timestamp (in seconds) for when the provider media channel connected.

media_connected_at: datetime | None

phase

The provider-neutral lifecycle phase reached by the call. Required. Known values are: "received", "validated", "admitted", "answering", "answered", "media_connected", "agent_session_ready", "bridging", "managing", "completed", "rejected", and "failed".

phase: str | _models.TelephonyCallPhase

provider

"teams_phone_extension" and "twilio".

provider: str | _models.TelephonyProvider

provider_call_id

The provider-assigned call identifier, when available.

provider_call_id: str | None

provider_message

The provider message associated with the terminal result.

provider_message: str | None

provider_number

The Teams Phone Extension or Twilio number that received the call.

provider_number: str | None

provider_status_code

The provider status code associated with the terminal result.

provider_status_code: int | None

provider_sub_code

The provider subcode associated with the terminal result.

provider_sub_code: int | None

started_at

The Unix timestamp (in seconds) for when the inbound webhook was received. Required.

started_at: datetime

status

"in_progress", "success", and "failed".

status: str | _models.TelephonyCallStatus

timing

Detailed provider-neutral call timing. Required.

timing: _models.TelephonyCallTiming

trace

Correlation to the customer-facing Foundry trace.

trace: _models.TelephonyCallTrace | None