Getting below error when doing call transfer. Any ...
# telephony
g
Getting below error when doing call transfer. Any idea how to fix this? Anyone else faced this issue?
Copy code
TwirpError(code=not_found, message=twirp error unknown: participant does not exist, status=404)
Looks like same issue as mentioned here https://github.com/livekit/agents/issues/1305
r
That generally means the number you are calling does not exist
g
This is an actual phone number. Should it be with a telephony provider or any real number will work?
@refined-appointment-81829 Should I configure any outbound trunk for this? I referred to this documentation https://docs.livekit.io/sip/transfer-cold/
r
Real number should work. It is based on the SIP provider and permissions your account has with them
Do you have a call id where that happened?
g
Real number as in any phone number right? Doesn't need to be a phone number provided by telephony provider. We are using Exotel for inbound and outbound. Below are the two call ids where I faced this issue
Copy code
SCL_2Z9EcirKMCk7
and
Copy code
SCL_DMakdV6BjgZ7
r
correct
But many providers have restrictions on forwarding.
g
So this could be an issue from Exotel provider? Do you known anyone who has made call transfer work with Exotel?
Also, Exotel is asking for Trunk source IPs (for outbound trunking): Any idea how I can get it? Thank you 🙏
r
You can use DNS based allow listing. See this page: https://docs.livekit.io/home/cloud/firewall/ This is a range for US and India if the calls of for those countries: https://docs.livekit.io/home/cloud/firewall/#static-ips
g
Thank you so much.. I've asked Exotel to check.
Hi.. I updated the participant identity with local participant identity when transferring a call. Now I receive this error
Copy code
twirp error unknown: no SIP session associated with participant
Below is the code
Copy code
@function_tool()
    async def transfer_call(self, ctx: RunContext):
        """Transfer the call to a human agent, called after confirming with the user"""

        job_context = get_job_context()
        room = job_context.room
        room_name = room.name
        transfer_to = "+91XXXXXXXXXX"  # actual number is replaced with XXXXXXXXXX
        participant_identity = room.local_participant.identity


        logger.debug(f"Transfer request: {room_name} and participant identity: {participant_identity} to number: {transfer_to}")

        # let the message play fully before transferring
        try:
            await job_context.api.sip.transfer_sip_participant(
                api.TransferSIPParticipantRequest(
                    room_name=room_name,
                    participant_identity=participant_identity,
                    # to use a sip destination, use `sip:user@host` format
                    transfer_to=f"tel:{transfer_to}",
                )
            )
        except Exception as e:
            logger.error(f"error transferring call: {e}")
            return "could not transfer call"
r
You have to call the exotel api to transfer the call
g
Thanks @rapid-van-16677 Any idea which API would that be?
how you have done the setup of livekit? self hosted or using livekit cloud
g
Using livekit cloud.
We use this api to place outbound call. How can we use this for human agent transfer? I tried to use the api which connects two numbers. But the problem is that customer is already on a call with livekit agent. So they get another call so customers needs to end the current call and accept the new one. Exotel provides an app called Call Transfer. I’ll try to use that and see if we can transfer the call.
r
Yeah bro i contacted exotel support they told we don't have currently api to transfer the call. So they told me to use this outbound connecting two numbers api
g
Yup…. That’s really a worst experience for customer to see another call coming which still being on a call. Anyway, we’ll try to figure out a workaround.
Thanks
r
Let me also know
👍 1