I'm implementing a RingCentral integration that requires starting calls from a server-side application and later transferring those active calls to a client-side web application. Specifically:
-
I use the server-side softphone JS implementation (ringcentral-softphone-js) to initiate outbound calls
-
When needed, I want to transfer the active call to a WebPhone instance running in a React client application
My research indicates RingCentral has a built-in "Switch call to this device" feature, which appears to accomplish this type of transfer using SIP protocol mechanisms rather than the REST API.
Technical Research So Far
I've analyzed the SIP traffic during a "Switch call to this device" operation and found it sends a specialized SIP INVITE with a Replaces header:
INVITE sip:+15551234567@sip.ringcentral.com SIP/2.0
Via: SIP/2.0/WSS xxxx.invalid;branch=z9hG4bKxxxxxxx
Max-Forwards: 70
To: <sip:+15551234567@sip.ringcentral.com>
From: <sip:15551234567*101@sip.ringcentral.com>;tag=xxxxxxxx
Call-ID: xxxxxxxxxxxx
CSeq: 8607 INVITE
Replaces: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx;to-tag=xxxx-xxxx-xxxx;from-tag=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
RC-call-type: replace
p-rc-capabilities: promote-rcv; e2ee
P-rc-endpoint-id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Client-id: xxxxxxxxxxxx
P-Asserted-Identity: sip:15551234567*101@sip.ringcentral.com
P-rc-country-id: 1
Contact: <sip:xxxxxxxx@xxxx.invalid;transport=ws;ob>
Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER
Supported: outbound
User-Agent: RingCentral WebPhone
Content-Type: application/sdp
Content-Length: 1415
>SDP payload omitted]
I've also checked the REST API for call transfer, but found that /restapi/v1.0/account/~/telephony/sessions/${sessionId}/parties/${partyId}/transfer
does not accept a deviceId
parameter as needed for this use case.
Question:
What are the possible ways to transfer call from softphone to webphone like in my case ?
Technical Environment
-
Server: Node.js application using ringcentral-softphone-js (https://github.com/ringcentral/ringcentral-softphone-js)
-
Client: React web application using ringcentral-web-phone (https://github.com/ringcentral/ringcentral-web-phone)
-
RingCentral SDK version: latest
Any code examples, documentation references, or implementation guidance would be extremely helpful. I believe this functionality should be possible given the "Switch call to this device" feature exists natively, but I need guidance on programmatically implementing it in custom applications.
Thank you in advance for your help!