Skip to content

WebSocket Handler

ghost_brain.handlers.websocket

WebSocket and HTTP endpoints for live call handling.

logger = logging.getLogger(__name__) module-attribute

router = APIRouter() module-attribute

incoming_call(request: Request) -> Response async

Handle incoming call requests and return TwiML.

websocket_endpoint(websocket: WebSocket) -> None async

Accept Twilio WebSocket, run Pipecat pipeline, save transcript on disconnect.