You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there's no mechanism to cancel an ongoing TransferSIPParticipant() operation after it has been initiated. This leads to race conditions and conflicting states when users change their mind mid-transfer or when the system needs to handle interruptions.
Current Behavior
When TransferSIPParticipant() is called:
The transfer process begins immediately
There's no way to stop or cancel the transfer
Any subsequent operations (like starting a new workflow) can run concurrently with the transfer
This can lead to undefined behavior and poor user experience
Example Scenario
User: "I need billing"
System: Initiates TransferSIPParticipant() to billing department
User: "Wait, actually I want to schedule an appointment"
System: Starts appointment scheduling workflow
[Problem: Transfer continues in background while appointment scheduling begins]
Proposed Solution
Add a cancellation mechanism for TransferSIPParticipant() that could work in one of these ways:
Cancel Method:
transfer=awaitroom.TransferSIPParticipant(...)
awaittransfer.cancel() # New method
Context Manager Approach:
withawaitroom.TransferSIPParticipant(...) astransfer:
try:
# Transfer in progressexceptUserInterruption:
awaittransfer.cancel()
Cancellation Token:
cancellation_token=CancellationToken()
awaitroom.TransferSIPParticipant(..., cancellation_token=cancellation_token)
# Later when needed:cancellation_token.cancel()
Technical Considerations
Implementation Requirements
Thread-safe cancellation mechanism
Proper cleanup of resources
Clear state management during cancellation
Event notifications for cancellation status
Edge Cases to Handle
Cancellation during different stages of transfer
Multiple rapid cancel requests
Partial transfer states
Resource cleanup
Connection handling
This request comes from production usage where voice assistants need to handle dynamic user interactions and change of intent during transfers.
The text was updated successfully, but these errors were encountered:
CC : @mike-r-mclaughlin
Description
Currently, there's no mechanism to cancel an ongoing
TransferSIPParticipant()
operation after it has been initiated. This leads to race conditions and conflicting states when users change their mind mid-transfer or when the system needs to handle interruptions.Current Behavior
When
TransferSIPParticipant()
is called:Example Scenario
Proposed Solution
Add a cancellation mechanism for
TransferSIPParticipant()
that could work in one of these ways:Technical Considerations
Implementation Requirements
Edge Cases to Handle
This request comes from production usage where voice assistants need to handle dynamic user interactions and change of intent during transfers.
The text was updated successfully, but these errors were encountered: