Problem statement
Rapida currently emits conversation-level webhook events (conversation.begin/completed/failed and endpoint-api events), but CRM systems need lower-level telephony lifecycle visibility before and around conversation startup.
For SIP call-center workflows, downstream systems must:
- create exactly one backend call session per provider
call_id
- avoid duplicate contact lookup/create caused by multiple browser clients reacting independently
- notify intended users on transfer attempts
- close stale notifications when another target answers
- track final outcome for each attempted target (connected/no_answer/busy/rejected/cancelled/failed)
Without granular SIP/call-routing events, CRM disposition and real-time routing UX are incomplete.
Proposed solution
Extend the existing SIP webhook pipeline (server-to-server, same webhook executor path) with additional lifecycle events and normalized outcomes.
Add/extend events:
- Call lifecycle:
call.created, call.ringing, call.answered, call.no_answer, call.busy, call.rejected, call.cancelled, call.ended, call.failed
- Transfer lifecycle:
transfer.requested, transfer.attempt.started, transfer.connected, transfer.attempt.ended, transfer.cancelled, transfer.failed
- Define (but only emit with reliable hooks):
call.media.started, transfer.target.ringing
Emission semantics:
call.created before/around ringing once SIP session identity is established
call.ringing around 180 Ringing
call.answered around 200 OK / connected
- classify known SIP failures into
call.no_answer / call.busy / call.rejected; keep call.failed for unclassified/technical failures
transfer.requested before per-target attempts
transfer.attempt.ended for every attempted target terminal outcome
transfer.cancelled for pending targets when another target answers (reason=answered_by_other)
Non-goals:
- no browser websocket implementation
- no separate realtime server
- no broad SIP refactor
Alternatives considered
No response
Impact area
None
Problem statement
Rapida currently emits conversation-level webhook events (conversation.begin/completed/failed and endpoint-api events), but CRM systems need lower-level telephony lifecycle visibility before and around conversation startup.
For SIP call-center workflows, downstream systems must:
call_idWithout granular SIP/call-routing events, CRM disposition and real-time routing UX are incomplete.
Proposed solution
Extend the existing SIP webhook pipeline (server-to-server, same webhook executor path) with additional lifecycle events and normalized outcomes.
Add/extend events:
call.created,call.ringing,call.answered,call.no_answer,call.busy,call.rejected,call.cancelled,call.ended,call.failedtransfer.requested,transfer.attempt.started,transfer.connected,transfer.attempt.ended,transfer.cancelled,transfer.failedcall.media.started,transfer.target.ringingEmission semantics:
call.createdbefore/around ringing once SIP session identity is establishedcall.ringingaround 180 Ringingcall.answeredaround 200 OK / connectedcall.no_answer/call.busy/call.rejected; keepcall.failedfor unclassified/technical failurestransfer.requestedbefore per-target attemptstransfer.attempt.endedfor every attempted target terminal outcometransfer.cancelledfor pending targets when another target answers (reason=answered_by_other)Non-goals:
Alternatives considered
No response
Impact area
None