Skip to content

SIP Call Transfer Fails on Voice-Triggered Response #1

@shwetd19

Description

@shwetd19

The SIP call transfer fails to execute when triggered by a voice-based "yes" response. The system does not provide error logs for further insights, and the call remains in the current room. However, the transfer works correctly when initiated using DTMF keypad inputs. This indicates a potential issue with either voice-triggered responses or SIP transfer configuration.


Logs:

The relevant logs are as follows:

INFO Logs:

INFO:__mp_main__:Preparing transfer request for +919765122239 to sip:[email protected]
{"message": "Preparing transfer request for +919765122239 to sip:[email protected]", "level": "INFO", "name": "__mp_main__", "pid": 12, "job_id": "AJ_kULBnMvL5TDM", "timestamp": "2025-01-09T09:32:47.580077+00:00"}
INFO:__mp_main__:Executing transfer request: participant_identity: "+919765122239"
room_name: "call-cm4fkcpp000002nhd3o681isc"
transfer_to: "sip:[email protected]"

{"message": "Executing transfer request: participant_identity: \"+919765122239\"\nroom_name: \"call-cm4fkcpp000002nhd3o681isc\"\ntransfer_to: \"sip:[email protected]\"\n", "level": "INFO", "name": "__mp_main__", "pid": 12, "job_id": "AJ_kULBnMvL5TDM", "timestamp": "2025-01-09T09:32:47.580950+00:00"}

Request Debug Logs:

DEBUG:openai._base_client:Request options: {
    'method': 'post',
    'url': '/audio/speech',
    'headers': {'Accept': 'application/octet-stream', 'X-Stainless-Raw-Response': 'stream'},
    'timeout': Timeout(connect=10.0, read=30, write=30, pool=30),
    'files': None,
    'json_data': {
        'input': 'Transferring you to our billing department. Please hold.',
        'model': 'tts-1',
        'voice': 'alloy',
        'response_format': 'pcm',
        'speed': 1.0
    }
}

Error Logs:

ERROR:__mp_main__:Transfer failed with exception: ('canceled', 'call transfer failed')
Traceback (most recent call last):
  File "/app/main.py", line 130, in handle_transfer
    response = await livekit_api.sip.transfer_sip_participant(transfer_request)
  File "/usr/local/lib/python3.9/site-packages/livekit/api/sip_service.py", line 170, in transfer_sip_participant
    return await self._client.request(
  File "/usr/local/lib/python3.9/site-packages/livekit/api/twirp_client.py", line 101, in request
    raise TwirpError(error_data["code"], error_data["msg"])
livekit.api.twirp_client.TwirpError: ('canceled', 'call transfer failed')

Expected Behavior:

The SIP call transfer should complete successfully regardless of the input method (voice-based or DTMF).


Actual Behavior:

  • The transfer fails when initiated with a voice-based "yes" response.
  • No detailed error logs are provided to diagnose the issue.

Relevant Code Reference

The changes and logic related to this issue can be reviewed here:
Code Reference


Additional Context:

  • The error occurs specifically in the handle_transfer method at line 130 in main.py.
  • A similar transfer using DTMF inputs works as expected.

Please investigate and address this issue to ensure proper SIP call transfers for voice-based triggers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions