---
sourceDocument: Australia API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/api-reference

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# NowVoiceCallbacks structure - iOS

# NowVoiceCallbacks structure - iOS {#ariaid-title1}

Release version: Australia  
Updated July 14, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read  
Specifies callbacks for voice session lifecycle and content events.

## NowVoiceCallbacks - init(onMuteStateChanged: ((Bool) -\> Void)?, onMessageReceived: ((NowVoiceTranscriptMessage) -\> Void)?, onCallEnded: NowVoiceDismissHandler?, onCallMinimized: (() -\> Void)?) {#ariaid-title2}

Creates a NowVoiceCallbacks instance with the specified voice session event handlers.
A `VoiceAgentError` is delivered as the second parameter of the onCallEnded callback.  
{#NVoiceCallbacks-init_B_O_O__table_p2p_4v1_zjc__entry__2}

| Case | Description |
|-|-|
| `.connectionTimeout` | The connection to the voice agent timed out. |
| `.connectionFailed` | A connection to the voice agent could not be established. |
| `.disconnectedUnexpectedly` | The connection dropped during an active session. |
| `.serverEnded` | The server terminated the session. |
[Table 1. VoiceAgentError]

{#NVoiceCallbacks-init_B_O_O__table_p2p_4v1_zjc}
{#NVoiceCallbacks-init_B_O_O__table_pft_qzv_nvo5__entry__3}

| Name | Type | Description |
|-|-|-|
| onMuteStateChanged | ((Bool) -\> Void)? | Called each time the user mutes or unmutes the microphone. The Bool parameter is `true` when the microphone is muted. |
| onMessageReceived | (([NowVoiceTranscriptMessage](https://servicenow-prod.fluidtopics.net/aDEArpBYyb2VD33g6fLNXg "Represents a single message in the voice session transcript.")) -\> Void)? | Called each time a new transcript message arrives during the session. |
| onCallEnded | NowVoiceDismissHandler? | Called when the voice UI is dismissed. public typealias NowVoiceDismissHandler = ( _ conversationId: String?, _ error: VoiceAgentError?, _ endedFromCallKitUI: Bool ) -> Void * conversationId: Conversation ID. * error: Optional error containing the reason the call ended. * endedFromCallKitUI: `true` when the call was ended by the user from the iOS CallKit UI (lock screen or Dynamic Island). `false` for all in-app dismissals. {#NVoiceCallbacks-init_B_O_O__ul_mwk_wb2_lkc} |
| onCallMinimized | (() -\> Void)? | Called when the voice session UI is minimized by the user (the call remains active in the background). Providing this callback is what surfaces the minimize button in the voice UI. |
[Table 2. Parameters]

{#NVoiceCallbacks-init_B_O_O__table_pft_qzv_nvo5}  
The following code example shows how to initialize a NowVoiceCallbacks. In each callback function, implement the desired functionality for handling the event.

    let callbacks = NowVoiceCallbacks(
        onMuteStateChanged: { isMuted in
            // Update your UI to reflect the current mute state.
            print("Microphone muted: \(isMuted)")
        },
        onMessageReceived: { message in
            // Receive real-time transcript messages during the session.
            print("[\(message.role)]: \(message.content)")
        },
        onCallEnded: { conversationId, error, endedFromCallKitUI in
            // Called when the voice session ends.
            if let error {
                print("Session ended with error: \(error)")
            } else {
                print("Session complete. Conversation ID: \(conversationId ?? "unknown")")
            }
        },
        onCallMinimized: {
            // Called when the voice UI is minimized.
            print("Voice chat is minimized")
        }
    )


