Migrate the Single Call Flow
This is the connector contract for the most common case: one inbound call, accepted, connected, and ended.
| Lifecycle Moment | Direction | What Happens |
|---|---|---|
| Call rings on backend | Connector → Salesforce | publishEvent(CALL_STARTED, { call }) with state: RINGING |
| Rep clicks Accept | Salesforce → Connector | acceptCall(call) → return Promise<CallResult> |
| Framework publishes | (auto) | Framework publishes CALL_CONNECTED from your CallResult |
| Rep clicks Mute | Salesforce → Connector | mute(call) → return Promise<MuteToggleResult> |
| Rep clicks End Call | Salesforce → Connector | endCall(call) → return Promise<HangupResult> |
| Framework publishes | (auto) | Framework publishes HANGUP from your HangupResult |
| Customer hangs up first | Connector → Salesforce | publishEvent(HANGUP, { calls: [call], reason }) |
| ACW timer expires or rep ends wrap-up | Salesforce → Connector | wrapUpCall(call) → return Promise<GenericResult> |