sipRefer()
Use sipCallTransfer() when moving a call between Daily rooms or when Daily should remain in the call path. Use SIP REFER when the call must be handed off to an external SIP endpoint and Daily should exit the flow entirely. While sipCallTransfer keeps the call anchored to Daily and continues to accrue usage on both active legs, sipRefer removes Daily from the media path once the REFER succeeds.
Note that the participant who initiates this must be an owner or an admin.
Example Scenario: Call transfer using SIP REFER
SIP REFER instructs the original SIP caller (e.g., sip:ivr@sip.example.com) to establish a direct connection with the target SIP destination (e.g., sip:support-level3@sip.example.com or sip:support@sip.elsewhere.com). Once the REFER succeeds, Daily is no longer part of the media path.
sip:ivr@sip.example.comis in Daily Room A. Ths SIP may have been dialled out to or dialled in.- An agent or automation in Room A decides to send the call to
sip:support@sip.elsewhere.com. - Room A calls
sipReferon thesessionIdassociated withsip:ivr@sip.example.comandtoEndpoint: "sip:support@sip.elsewhere.com". - When the REFER is triggered,
participant-leftanddialin-stopped|dialout-stoppedevents fire in Room A, and the destination begins ringing as the external systems connect directly. In addition to participant and dial-in and dial-out webhooks,calltransferwebhooks (triggered,initiated,answered,complete) are emitted for Room A.
sipRefer(params)
Parameters
sessionIdthe participant of the sip/pstn participant we want to transfer.toEndPointdestination sip/pstn where call will be transferred.