CYOO中文
Menu

Home / Blog / Where Node.js fits in a live phone conversation

Where Node.js fits in a live phone conversation

An XML call-control response can tell a carrier how to answer a call. A live conversation also needs a process that follows the audio, tracks the turn and knows when the caller has hung up.

Cece connects a phone audio interface to a developer laptop.

Separate the two connections

The incoming request asks for call instructions. A subsequent media connection carries audio for that call. Associate both with the same call identifier so a second caller cannot inherit the first caller's context.

Handle a change of mind

Imagine Cece is reading opening hours when a caller interrupts to ask about parking. A useful turn handler can stop pending playback and record which answer the caller actually heard. Test the change with a real handset.

Close the call cleanly

A hangup can arrive while a model is composing a reply. Stop work tied to the media connection and mark the call complete once. FIIDA’s CYOO service uses Node.js to connect Twilio’s telephone media stream to the configured voice model.

Continue reading

Contact Sales

Discuss this with CYOO