Are there any fallbacks in case a cold transfer (D...
# ask-ai
c
Are there any fallbacks in case a cold transfer (During call forwarding) fails? For example, if the number being transferred to is not responding? Or is this warm transfer only?
t
Thanks for reaching out, Anton. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm happy to help you with this! LiveKit does support cold transfers and offers ways to detect if a transfer doesn’t go through. For example, if the number you’re transferring to isn’t responding, you can set up some fallback strategies in your application to make sure nothing gets missed. Here are a few ideas: • Use error detection features to catch transfer failures and manage them within your app. • Create a fallback chain to try transferring the call to other numbers if the first one doesn’t answer. • Set up a warm transfer fallback, so the call can return to the original caller if all transfer attempts don’t succeed. Since LiveKit doesn’t automatically retry failed cold transfers, these fallback methods need to be built into your application. If you’d like, I’m here to walk you through some examples or provide more details to make this easier. Just let me know! Sources: livekit-protocol/livekit/protocol/sip.pyi | livekit-agents/livekit/agents/worker.py | Agents telephony integration | LiveKit Docs | Transferring calls | LiveKit Docs | Preserving Caller ID During SIP Transfers in LiveKit Agents
c
Direct me to the documentation showcasing fallbacks for cold transfers
t
I understand that you’re looking for specific documentation on fallbacks for cold transfers in LiveKit. While there isn’t dedicated documentation just yet, you can definitely use the transfer status tracking and error handling features to create fallbacks programmatically. I’d be more than happy to walk you through some detailed examples or help you implement these strategies in your application—just let me know how I can support you!
c
Show me these features
t
I'm happy to help you implement fallbacks for cold transfers using LiveKit! Here are some key features you can use to make the process smoother: • Transfer Status Tracking: You can rely on the
SIPTransferStatus
enum, which includes statuses like
STS_TRANSFER_FAILED
to let you know when a transfer doesn't go through. • Error Handling: The
SIPTransferInfo
object returned from transfer operations has a
transfer_status
field and an
error
field, giving you detailed info about any issues. • Application-Level Fallbacks: It’s a great idea to add fallback logic in your app using try-catch blocks and alternative numbers to retry if needed. Here’s an example using the
transfer_sip_participant
method to attempt a transfer and gracefully handle any failures:
Copy code
try:
    await job_ctx.api.sip.transfer_sip_participant(
        api.TransferSIPParticipantRequest(
            room_name=job_ctx.room.name,
            participant_identity=self.participant.identity,
            transfer_to=f"tel:{transfer_to}",
            play_dialtone=True,
        )
    )
    logger.info(f"Successfully transferred call to {transfer_to}")
except Exception as e:
    logger.error(f"Error transferring call: {e}")
    # This is a great spot to add your fallback logic
    await self.handle_transfer_failure(transfer_to, e)
If you'd like, I’m here to walk you through these steps or provide more examples to make this even easier. Just let me know!