sip icon indicating copy to clipboard operation
sip copied to clipboard

Call transfer via SIP REFER

Open maik-parloa opened this issue 1 year ago • 8 comments

I wasn't able to find any documentation/source code reference that enables me to transfer an ongoing call (e.g., in the case of a human handover).

Is transferring a call supported / what would be the steps to extend the current implementation to support SIP REFER use cases?

maik-parloa avatar May 08 '24 17:05 maik-parloa

We also need this capability. From reviewing the code, I am quite certain it is not there currently. However, I was wondering what would be the general approach of getting events or RPC commands from the main LiveKit server to the SIP adapter? I was thinking about how we might be able to implement this functionality.

justin0mcateer avatar May 14 '24 15:05 justin0mcateer

I'd second this question @justin0mcateer. 👍 Is there a way to send RPC commands from the Livekit Agents to the SIP Gateway? We are also happy to dive into an implementation and open a PR with this capability.

maik-parloa avatar May 14 '24 16:05 maik-parloa

Could you please explain the use case a bit more? Do you want to transfer SIP participant away from LiveKit SIP server? Or you want to switch existing LiveKit SIP participant to a different SIP endpoint?

dennwc avatar May 14 '24 19:05 dennwc

The goal is to enable call handovers to Human Agents (e.g. for their existing CCaaS solution). So calls would be transferred to a different SIP URI and the original call would be closed (after the Invite + Refer has been accepted by the target SIP).

maik-parloa avatar May 14 '24 19:05 maik-parloa

This is very similar to our use case.

However, in our case we need the SIP leg on LiveKit to survive the 200 OK SipFrag from the third-party. We would remove the participant from the LiveKit bridge by another action.

justin0mcateer avatar May 14 '24 20:05 justin0mcateer

I'll need to think a bit how to better expose the control API for SIP participants. There were a few similar requests about controlling its behavior (e.g. selective subscription to tracks, etc), so we should define a generic API to send commands. We already have a data channel open for the participant, but using it could be racy (there's a delay between participant creation and data channel coming online). So it should run via our psrpc, probably.

dennwc avatar May 17 '24 15:05 dennwc

+1 I also need this

ChrisFeldmeier avatar Sep 10 '24 04:09 ChrisFeldmeier

Twilio has such an transfer API, maybe this can also help you. https://www.twilio.com/docs/sip-trunking#calltransfer SCR-20240910-c78

ChrisFeldmeier avatar Sep 10 '24 04:09 ChrisFeldmeier

Has anyone been able to get this to work by chance? I am also looking to do a transfer to a number from a Livekit UI for the purpose of escalating a call to a live agent if they are unable to get the help they need from the virtual agent.

mdwoicke avatar Nov 10 '24 21:11 mdwoicke

this feature is implemented but we are investigating compatibility & behavior with Telnyx. Docs will be available for it soon

davidzhao avatar Nov 10 '24 21:11 davidzhao

Awesome,  thanks! 👍

Yahoo Mail: Search, Organize, Conquer

On Sun, Nov 10, 2024 at 3:16 PM, David @.***> wrote:

this feature is implemented but we are investigating compatibility & behavior with Telnyx. Docs will be available for it soon

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

mdwoicke avatar Nov 10 '24 21:11 mdwoicke

this feature is implemented but we are investigating compatibility & behavior with Telnyx. Docs will be available for it soon

That's really great to hear from you. Can we use it using the python SDK once the docs are realised?

parshva-softmaxai avatar Nov 11 '24 03:11 parshva-softmaxai

Hello! I'm also very interested in this. We currently use a local VoIP provider that redirects incoming calls to LiveKit's SIP, and then, we connect to the automatically created room via WebRTC (that is, we add an agent to the room and subscribe to the caller's audio track). I would need to be able to redirect the original caller to another SIP or, ideally, a PSTN number.

I've been looking at this for a while but I'm unsure on the best way to achieve this using the current SDKs. Any pointers are very much appreciated.

Thank you!

rmonvfer avatar Nov 11 '24 20:11 rmonvfer

Hello again! I don't know if this is new or maybe I missed it but this seems to be what we are all looking for https://docs.livekit.io/sip/transfer-cold/

Edit: it seems like the documentation is still a work in progress and the implementation is only available for nodejs

rmonvfer avatar Nov 15 '24 04:11 rmonvfer

Thanks, Ramón! Have you happened to try this out yourself by chance? I started to try to implement this but could not get it to work correctly. For example, this sample code does not take in the authentication credentials you establish in Twilio. Also, Twilio asks for IP range which I assume is Livekit's IP. Is that correct?

Yahoo Mail: Search, Organize, Conquer

On Thu, Nov 14, 2024 at 10:59 PM, Ramón @.***> wrote:

Hello again! I don't know if this is new or maybe I missed it but this seems to be what we are all looking for https://docs.livekit.io/sip/transfer-cold/

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

mdwoicke avatar Nov 16 '24 17:11 mdwoicke

any updates here? and what is with warm transfer?

ChrisFeldmeier avatar Nov 21 '24 20:11 ChrisFeldmeier

@mdwoicke Twilio authentication is established during the trunk setup, please refer to the docs on that here. Currently there is a bug with TCP based REFER support. So please use UDP transport on your trunk for now.

davidzhao avatar Nov 22 '24 05:11 davidzhao

Is there still a bug in the SIP REFER? I seem to have a bunch of call participants that are not kind == SIP, what would be the best practice for transferring STANDARD participants?

free-soellingeraj avatar Jan 30 '25 23:01 free-soellingeraj

@free-soellingeraj REFER is a SIP feature, thus non-SIP participants cannot be transferred. If you would like to connect a standard participant with a SIP endpoint, consider starting an outbound call in that room.

dennwc avatar Feb 02 '25 18:02 dennwc