Putting a Robot on a Phone Call: Layered Signaling, Bounded Occupancy and Turn Arbitration over WebRTC
We put a Thor robot on a browser voice call, with speech sent from Safari, answers played through the robot's loudspeaker and transcripts returned to the phone. We separate HTTPS signaling, relayed WebRTC media and speech generation into independently observable routes.
From the abstract. Our summary is in progress.
Full paper
Putting a Robot on a Phone Call: Layered Signaling, Bounded Occupancy and Turn Arbitration over WebRTC
Published under CC BY 4.0. Reproduced with attribution; original at arXiv:2611.32308 (PDF).
Abstract
We put a Thor robot on a browser voice call, with speech sent from Safari, answers played through the robot’s loudspeaker and transcripts returned to the phone. We separate HTTPS signaling, relayed WebRTC media and speech generation into independently observable routes. The browser prefetches relay credentials and allows a 500 ms window after its first relay candidate. The backend starts speech and WebRTC-answer preparation concurrently within a 55 s deadline. A session slot and a non-blocking speaker lock coordinate calls with local voice access. A 2 s gate gives the controller an opportunity to suppress chat before playback. Fifteen of sixteen first dials reached ready-to-speak, comprising seven of eight Wi-Fi calls with a median of 5.57 s and eight of eight cellular calls with a median of 6.76 s. All twenty scored occupancy and recovery scenarios admitted a later call. During five 60 s outages, the backend released the line while the phone remained offline. Across 40 controlled replays, enabling the gate suppressed chat when the controller decided at 1 s. At 3 s, chat and controller feedback both played in sequence, with no overlapping output in any trace. Two additional boundary traces exposed a receipt naming a later feedback item and a new call’s query returning its predecessor’s feedback. These measurements cover application events on one platform and simulated controller decisions, with acoustic output and task correctness outside their scope.
1 Introduction
A person taps Call on an iPhone. The answer comes from the speaker beside Thor, while the caller reads the same words on the phone. That arrangement puts the caller’s microphone, a public web entry, a speech service and a shared loudspeaker on one conversational path. It also gives a task controller and a conversational model an opportunity to answer the same utterance.
We need to decide when the line is ready, who holds the speaker and which answer gets the next turn. A loaded page establishes access to the web entry. A working call additionally needs relayed media and a live speech connection. Once those connections exist, local voice and another remote caller still compete for the physical output device. Even with one caller admitted, a delayed controller decision may arrive after chat has begun speaking.
We build a browser-to-robot voice path around these boundaries. Separate signaling, media and speech routes expose connection state at each layer. Credential prefetch and concurrent backend setup overlap independent waits. A session slot and an operating-system speaker lock coordinate remote and local access, while a bounded gate lets the controller claim a turn before chat reaches playback. The same path reports text and software playback events to the caller.
We evaluated first-dial readiness over Wi-Fi and cellular access, recovery under four disturbances, and output ordering under controlled controller timings. Two boundary traces locate feedback-association errors within a call and across calls.
2 Related Work
2.1 Making a robot remotely accessible
Mobile telepresence connects a remote operator with people at the robot’s physical site Kristoffersson et al. (2013); Desai et al. (2011); Tsui et al. (2011). Research on socially interactive robots and HRI situates that access within ongoing human activity Fong et al. (2003); Goodrich and Schultz (2008). Cloud robotics and web interfaces extend the computation and interfaces available remotely Kehoe et al. (2015); Toris et al. (2015). We address access at the loudspeaker, where remote calls and a local voice process contend for the same device.
2.2 Allocating a speaking turn
Conversation analysis describes how participants allocate the next turn Sacks et al. (1974). Spoken-dialogue research examines timing and multimodal cues around a turn boundary Skantze et al. (2014); Skantze (2021). Engagement research follows people as they enter or leave an interaction Bohus and Horvitz (2009); Bohus and Horvitz (2014). We apply an explicit deadline to the software sources competing after the caller yields the floor.
2.3 Identifying the source of a robot voice
Physical embodiment affects how people encounter a robot Kidd and Breazeal (2004); Li (2015). Studies of voice interfaces describe how users interpret replies and revise expectations after misunderstandings Luger and Sellen (2016); Clark et al. (2019); Porcheron et al. (2018). Language-grounded robotics and language-model dialogue provide several routes from an utterance to an answer Tellex et al. (2020); Cherakara et al. (2023). We preserve the submitting component’s identity through the response path so that a controller status and a generated answer remain distinguishable in the record.
2.4 Choosing the evaluation target
HRI measures depend on the question being asked Steinfeld et al. (2006). Usability ratings and perceived-intelligence measures address a user’s experience Bangor et al. (2008); Bartneck et al. (2009). We evaluate application events at connection, resource and output boundaries, using the audio fixture’s reference mapping to check the identity reported by the player.
3 Design Problem and Three Principles
3.1 Four commitments in a call
We fix four things for each call. The session identifies the connection whose lifecycle is being managed. Speaker ownership identifies the process allowed to write to the physical device. Turn ownership identifies the subsystem permitted to answer a particular utterance. Evidence identifies what an exported event establishes about the call. A controller may take a turn while the same caller continues to hold the speaker.
These commitments have different lifetimes. A task callback may outlive its call, and a feedback submission may precede completion of earlier audio. Identifiers must survive asynchronous delivery and observations must retain their source.
3.2 Three design principles
Independently failing connection paths must remain separately observable. Contention for the line, speaker and next turn requires an explicit owner and a bounded wait. Asynchronous output must retain its originating call and turn, while each observation identifies the claim it supports.
3.3 Seven evidence levels
A controller may report task completion while its spoken feedback waits in the queue. Table 1 assigns those observations to their corresponding claims. We use the levels to select a measurement for each design choice and to keep an answer-area message’s source visible during analysis.
- Input transcript
- The recognizer returned these words for the input.
- Generated response text
- The service produced this answer text.
- Audio queued
- The playback process accepted audio for scheduling.
- Software playback receipt
- The player reported completion for the identified audio.
- Controller feedback
- The controller reported the indicated task state.
- Acoustic recording
- A microphone captured sound at its location.
- Listener or task observation
- A listener interpreted the utterance, or an independent check verified the physical outcome, under the stated test conditions.
4 System
4.1 Separating signaling, media and speech
We need to inspect the connection beyond the page-load event. A browser may reach the public entry while media negotiation or speech generation encounters a separate failure. The web entry also has its own lifecycle, so restarting it requires us to inspect the established call’s downstream state.
We carry HTTPS signaling through Sakura Frp and relayed WebRTC through Cloudflare TURN Alvestrand (2021); Keränen et al. (2018); Reddy et al. (2020); Jesup et al. (2021). The media route bypasses the web tunnel. Safari creates a send-only audio transceiver and a data channel for text and status. On the robot, the call backend opens a separate WebSocket to the MOSS speech API. Audio responses go to the room speaker, while the data channel returns transcripts and playback progress. Figure 1 shows the routes and the response-selection path. Each connection exposes its own state for inspection and reconnection.
The gateway and robot still depend on network reachability along their respective routes.
Section 5.1 checks application readiness across the complete path and reports the earlier integration observations.
4.2 Overlapping connection setup
We coordinate credential retrieval, microphone permission and relay-candidate gathering before sending an offer. Waiting for each operation to finish before beginning the next would serialize independent work. Candidate gathering also needs an exit condition when one available relay route is sufficient to proceed.
We prefetch TURN credentials when the page opens and reuse that browser request for up to 1 h. On Call, retrieval overlaps microphone authorization. After the first relay candidate, we allow 500 ms for candidates gathered in the same batch, proceeding immediately if gathering completes. At the 20 s fallback, we retain an available relay candidate and reject negotiation when none exists. Backend offer handling has a 55 s deadline, within which speech-service startup and WebRTC-answer generation run concurrently. Failure in either operation cancels its partner and invokes cleanup. TURN credentials last 2 h. Backend reuse requires enough remaining validity for the 1 h call limit plus a 10 min margin.
The setup budget follows the event path from page opening through credential retrieval, microphone authorization, candidate gathering, offer submission, concurrent speech and answer preparation, and readiness. Ready-to-speak is the interface state in which the page first offers the caller the floor. Prefetch may finish before the tap, and retrieval overlaps microphone authorization. The phone logs the tap, microphone readiness, the pre-offer state and ready-to-speak. Backend status samples add connection states. Credential completion, the first relay candidate and the separate backend operations lack individual timing events in these records, so the observed readiness median has no per-stage decomposition. The 500 ms candidate window and 55 s backend deadline constrain their respective stages. They start at different events and cannot be summed into a tap-to-ready budget.
Section 5.1 reports first-dial readiness for this configuration. Its elapsed times include the application path through setup, and its first-attempt counting rule retains failures even when a separately recorded retry connects.
4.3 Reserving the session and speaker
A remote call, local voice process or management entry may request the same speaker. We need to settle ownership while the connection is being prepared, before the caller sees readiness. A process-local flag alone leaves another participating process able to request the device independently.
We reserve the session slot during setup and acquire a non-blocking operating-system file lock on the speaker. A second offer encounters HTTP 409 while the first setup or call owns the line. The local voice process obtains the same file lock, extending exclusion across process boundaries. The operating system releases the lock when its holder exits. Hangup names the current session, and the backend compares that identifier before releasing it. Local components enter through a permission-restricted Unix socket and use the same call path. Management operations are restricted to that socket. The setup exception path closes any partially created session and releases its reservation and lock.
Remote access is unavailable while the local voice process holds the speaker lock.
Section 5.2 checks rejection during a remote call and local lock ownership, then checks admission after release. Closing a tab and interrupting connectivity exercise cleanup while the caller’s view and the backend’s state diverge.
4.4 Audio blocks, half-duplex input and receipts
A room microphone may capture the robot’s own answer and feed it back to recognition. We also need a playback representation that retains the response identity while audio arrives in multiple blocks. Completion must refer to the run that supplied those blocks.
We resample incoming audio to 16 kHz mono PCM16 and accumulate 3,200 B per block, equivalent to 100 ms. While output is queued or playing, we replace uplink blocks with silence, which also drops an attempted interruption during playback. This application-level half-duplex policy operates alongside the browser’s echo-cancellation request. The player accepts 48 kHz mono PCM16 with run, turn and chunk metadata and writes queued audio to the output process. It estimates chunk completion from written bytes and the scheduled playback endpoint, then reports run completion after pending chunks finish. Safari displays transcripts and player progress over the data channel, so text may appear before playback finishes.
Section 5.3 checks source identity, ordering and software completion in replay. Section 5.4 examines the association between a run and its feedback owner.
4.5 A bounded gate for competing answers
The speech service prepares chat while the controller examines the same final transcript. We need to choose what enters the speaker queue when either component becomes ready first. Waiting indefinitely for the controller would also hold chat indefinitely when the controller stays silent.
We forward the final transcript to the controller bridge and hold chat audio for up to 2 s. A controller claim inside that window discards the buffered chat. An explicit chat decision releases it. Expiry also releases chat, while the controller request continues and later feedback enters playback. Stop requests bypass the bridge’s ordinary event queue. We deduplicate final transcripts by turn and discard queued events older than 4 s before delivery. For session-level commentary with an empty turn field, the existing bridge associates a new audio run with the most recent feedback submitted within a 15 s window. Receipts subsequently consult that run mapping. The within-call trace in Section 5.4 exercises this association rule.
A controller response arriving after chat release may add another spoken answer, as in the 3 s replay condition.
Section 5.3 tests the gate deadline with paired on/off schedules. Section 5.4 tests feedback ownership at two asynchronous boundaries, locating where the current association rules require a stronger binding.
4.6 Cleaning up and releasing resources
We send a heartbeat when the data channel opens and every 10 s thereafter. Every 5 s, the backend checks the 45 s inactivity threshold and 1 h call limit. Data-channel closure, media-track termination and peer-connection failure or closure also invoke cleanup. The close path stops playback, closes speech and media connections and releases the session slot and speaker lock. Closure is serialized and tolerates repeated requests.
4.7 Implementation scope
We used one iPhone 17 with Safari over Wi-Fi and cellular access, with the same Thor speaker and public entry. Controlled replay used a simulated controller. Evaluation of tunnel and gateway security lies outside this study.
5 Reliability Validation
5.1 First-dial readiness
The integration record of 18 November 2026 separately recorded relay candidates at both endpoints, an answer from the speech service and a player report of 268,800 B at 48 kHz, PCM16, mono, equivalent to 2.8 s. It also recorded HTTP 409 for a second offer and an idle backend after hangup.
We tested the connection path of Sections 4.1–4.2 using first-dial readiness. The operator alternated Wi-Fi and cellular calls on the same authorized, warm-start Safari page, holding questions, device and speaker volume fixed. For cellular calls, the operator disabled Wi-Fi in the phone settings. We froze the calibrated rules in protocol.json before collection. After the fourth pair, the operator amended the target to eight calls per network, recording the change from frozen.json to frozen-v2.json.
Of 16 first dials, 15 reached ready-to-speak. Wi-Fi yielded 7/8 with a median of 5.573 s and range 3.731–7.592 s. Cellular yielded 8/8 with a median of 6.7635 s and range 5.911–10.368 s. The frozen first-attempt rule excluded the additional dials for Wi-Fi pairs 1 and 4 from these counts. Table 2 retains the absent readiness event for pair 4 and reports its retry separately.
- 01
- 4.258
- 7.307
- 02
- 5.573
- 6.113
- 03
- 6.204
- 10.368
- 04
- —a
- 6.220
- 05
- 3.731
- 5.911
- 06
- 4.672
- 6.073
- 07
- 5.787
- 7.909
- 08
- 7.592
- 7.535
Among the 15 ready calls, one failed the fixed two-question exchange and 14 were unchecked, comprising six Wi-Fi and eight cellular calls. Zero complete exchanges were confirmed by turn-by-turn review of the room recording. In Wi-Fi pair 2, the controller reported that the language model was unavailable after readiness. The phone logged brain.feedback and displayed the message in the answer area. A later re-ask on the same call yielded an answer, while the original question remained the failed exchange.
For timing, we matched the phone microphone’s speech-segment endpoint to the page’s first nonempty answer-text event on the same clock, retaining 25 of 30 question slots after the five exclusions in Table 2. Their median was 3.010 s with range 2.094–4.176 s, including the first cellular question at 12.973 minus 9.803 s, or 3.170 s.
5.2 Occupancy and recovery under four disturbances
We tested the session reservation, speaker lock and release path of Sections 4.3 and 4.6 in 20 scored scenarios, five per condition. Each ended with a later call on the same line. The busy-line protocol specified an ordinary second offer. We excluded an initial run that displayed a takeover prompt without sending that offer and scored the prescribed repeat.
During an occupied call, the second offer received HTTP 409 in 5/5 checks while the first call completed its current answer. Following hangup, the next call connected in 5/5 checks. With local voice holding the speaker lock, incoming calls were rejected in 5/5 checks and connected after release in 5/5 checks.
Closing the active Safari tab cleared the backend slot and admitted a later call in 5/5 checks. The fourth initial recording contained only idle samples, so we used its retry for that planned slot. For the outage condition, the operator disabled both networks for 60 s with the call tab open. In all five checks, the backend became idle 31.9–36.1 s after its first connected sample while the phone was still offline, and a new call connected after access returned in 5/5 checks.
5.3 Ordering and suppression at the shared speaker
We tested the bounded gate and playback queue of Sections 4.4–4.5 with paired gate-on and gate-off fixtures. Relative to injection of the final transcript, chat audio arrived at 0.20, 0.45, 0.70, 1.10 or 2.25 s. Controller decisions were scheduled at 1 s for fast tasks and at 3 s for slow tasks, against the 2 s gate. The replay exercised the session, bridge, gate and player through their event interfaces, routing playback to a local sink.
We identified distinct outputs by the player’s run identifier and checked their source against expected_by_run and fixture_audio in each trace. Table 3 reports all 40 schedules. With the gate enabled, chat was suppressed for every fast-task timing. At 3 s both settings yielded chat followed by controller feedback. The chat-decision and no-decision conditions started the same chat source, while decision events distinguished explicit release from timeout.
- Chat decision
- 0/5 / 0/5
- Both settings: chat only.
- No decision
- 0/5 / 0/5
- Both settings: chat only.
- Fast task, 1 s
- 5/5 / 0/5
- Off: chat and controller feedback. On: controller feedback only.
- Slow task, 3 s
- 5/5 / 5/5
- Both settings: chat followed by controller feedback.
We checked player start and finish intervals for distinct runs and the feedback identifier on completion receipts. All 40 scheduled traces had no overlapping output and matching feedback identifiers. With the fast-task gate disabled, the controller reached playback first at the latest chat arrival setting, showing that the queue preserved arrival-dependent order.
5.4 Two remaining errors at asynchronous boundaries
We tested the feedback-association rule of Section 4.5 at boundaries where more than one item could supply an owner. The two fixtures were collected separately from the 40 schedules. Figure 2 retains their independent clocks.
Within a call, Figure 2a uses the monotonic clock at playback-fixture construction as time zero, before either feedback submission. The fixture supplied f1 at 0.005 s and f2 at 0.456 s. Its reference mapping assigns the audio run n-f1 to f1. The arriving audio carried that run identifier and an empty turn_id.
For an unseen run with an empty turn, the bridge assigns the latest feedback submitted within 15 s and uses that mapping for subsequent receipts. By the arrival of n-f1, the remembered submission was f2.
The player began n-f1 at 0.915 s. At 1.149 s the controller-side log recorded the first chunk completion for that run, and at 1.248 s it recorded completion of the whole run. Both reports carried feedback_id=f2. Both retained the correct call identifier, call-9e49673f268254bd07e396f5. The lost distinction was between feedback items within that call.
- Separate signaling, media and speech routes
- A page-load event standing in for a working call
- Integration record of 18 November (Section 5.1).
- Credential prefetch, 500 ms candidate window and 55 s concurrent setup
- Serial setup waits and first-dial failure
- 15/16 ready, with medians 5.573 s and 6.7635 s (Section 5.1).
- Session slot and non-blocking speaker lock
- Multiple calls or a local process writing to one speaker
- 20/20 later calls connected, HTTP 409 in 5/5 busy-line checks (Section 5.2).
- Half-duplex uplink during playback
- The robot’s output re-entering recognition
- Implementation policy in Section 4.4. Acoustic effect unmeasured.
- 2 s gate, timeout release and stop bypass
- Competing answers entering playback
- 40 traces without overlapping output, chat suppressed 5/5 at 1 s with the gate enabled (Section 5.3). Stop bypass unmeasured separately.
- Run/turn/chunk binding on receipts (proposed repair)
- A receipt or late feedback acquiring the wrong owner
- Two association errors motivate the binding and generation checks (Section 5.4).
Across calls, Figure 2b sets a fresh monotonic origin just before feedback-service startup and records each timestamp after the corresponding request returns. The service acknowledged opening call-A at 0.182 s, closing A at 0.386 s and opening call-B at 0.558 s. Only then did the fixture submit the delayed completion of task-A with the original request identifier call-A:1.
At 0.738 s the feedback query for B returned that item. Its session_id named call-B, while both request_id and event_id retained call-A:1. The request and event fields still identify A’s turn. This timestamp marks receipt of the query result.
The fixtures establish a mismatched receipt owner within one call and delivery into a later call’s feedback query.
5.5 Design choices and their evidence
We matched each mechanism to the failure boundary it addresses and the observation used to inspect it. Table 4 includes the proposed receipt-binding repair as a design implication of the boundary traces.
6 Discussion
6.1 Why the boundaries matter
We place ownership decisions at resource boundaries. The setup reservation covers the interval before readiness, and the file lock extends exclusion across participating processes. After gate expiry, the continuing controller request explains the second sequential answer in the slow condition. Resource admission and turn selection operate on different lifetimes.
Wi-Fi pair 2 makes the separation between layers concrete. The line reached readiness, then the controller returned a language-model-unavailable message that appeared in the answer area. Recording brain.feedback alongside readiness preserves both the working channel and the failed exchange. A call interface could use those sources to show progress at the corresponding layer.
Release also has a source and a clock. The outage intervals were 8.9–13.1 s shorter than the configured 45 s inactivity threshold. Status samples bracketing each session also bound its entire occupancy below 45 s. A 45 s inactivity timeout therefore cannot have completed within that session, excluding the heartbeat path. Section 4.6 lists three further triggers, media-track termination, peer-connection failure or closure, and data-channel closure. The logs do not identify which of these fired. Redundant release paths make the call resilient to any single signal failing, at the cost of not knowing afterwards which one acted. Backend release while the phone remains offline gives the returning interface a state to reconcile. A release event carrying the call identifier and cause would let it do so.
6.2 The costs of waiting and half-duplex input
We trade waiting time against the opportunity for a late controller answer to follow chat. Spoken-dialogue work relates response timing to the transfer of the floor Skantze et al. (2014); Skantze (2021). Here, the floor is available but its software owner is undecided. Extending the gate would extend the delay whenever the controller stays silent. Shortening it would bring chat release closer to controller deliberation. The tested deadline defines which of the scheduled decisions suppresses chat.
Half-duplex input introduces another explicit cost. Replacing uplink blocks with silence prevents caller speech during playback from reaching the service, including an attempted spoken interruption in that interval. The stop-event bypass concerns delivery after a stop request has been recognized. It addresses queue waiting at that later stage. Local speaker ownership similarly makes the public entry unavailable for the duration of local use. These are operational consequences of the mechanisms that an interface needs to expose.
6.3 Transferable mechanisms and deployment dependencies
We can carry the separation of connection states, process-level exclusion and bounded turn arbitration into another voice path by identifying its corresponding resources and events. Telepresence and cloud-robotics work situate remote access across physical and computational boundaries Kristoffersson et al. (2013); Kehoe et al. (2015); Toris et al. (2015). Our implementation adds explicit admission and output decisions at the shared device, using ordinary WebRTC and operating-system facilities.
The concrete path depends on Safari’s media behavior, TURN access, the tunnel and the MOSS event schema. WebRTC transports the application identifiers attached to a message Alvestrand (2021); Jesup et al. (2021). A receipt’s owner therefore remains an application responsibility. The within-call trace motivates a stable call, turn and chunk binding carried from feedback submission into the audio run and its completion reports. The cross-call trace motivates checking the originating call and connection generation when feedback is stored and again when delivered.
7 Limitations
The field calls used one device and browser, and the target of eight calls per network was set after the fourth pair. Fourteen ready first dials lack a checked exchange outcome. Timing ends at answer text on the phone, leaving audible-response time unmeasured. Replay used a simulated controller and a local sink at the listed schedules. The boundary fixtures locate association errors without estimating their deployed frequency. We evaluated these implementation behaviors without a baseline system or a user study.
8 Conclusion
We put a robot on a browser voice call through separate signaling, relayed-media and speech-service paths. Prefetch and concurrent setup supported 15/16 ready first dials in the recorded configuration. Session reservation and a shared speaker lock governed admission across remote and local use, with later calls admitted in all 20 scored scenarios. A 2 s gate suppressed chat for the 1 s controller decisions and released it before the 3 s decisions, leaving sequential answers. The two boundary traces connect the remaining feedback errors to identifier scope and motivate preserving the originating call and turn through asynchronous delivery.