calm-eye-57311
10/27/2025, 9:35 AMtall-airline-16756
10/27/2025, 9:35 AMtall-airline-16756
10/27/2025, 9:36 AMcalm-eye-57311
10/27/2025, 9:43 AMtall-airline-16756
10/27/2025, 9:43 AMcalm-eye-57311
10/27/2025, 9:46 AMtall-airline-16756
10/27/2025, 9:47 AMSIPTransferStatus 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:
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!