Open
Description
- Package Name: azure-communication-callautomation
- Package Version: 1.3.0b1
- Operating System: MacOS 15.0.1 (24A348)
- Python Version: 3.11.7
Describe the bug
When using MediaStreamingOptions
with custom transport_url
to create a new call, then receive audio data and send it back immediately, no audio can be heard. I cannot seem to find any documentation talking about sending WebSocket data back to Azure.
To Reproduce
Steps to reproduce the behavior:
- Create a new call
media_streaming_options = MediaStreamingOptions(
transport_url=ws_base_url,
transport_type=MediaStreamingTransportType.WEBSOCKET,
content_type=MediaStreamingContentType.AUDIO,
audio_channel_type=MediaStreamingAudioChannelType.MIXED,
start_media_streaming=record,
)
call_conn_props: CallConnectionProperties = (
await call_automation_client.create_call(
target_participant=target,
callback_url=AzureClientService._gen_events_callback_url(
base_url=base_url, call_id=call_id
),
source_caller_id_number=source,
media_streaming=media_streaming_options,
)
)
- Receive the WebSocket connection. Send back the data (The whole object), I've tried sending back only the data, too, and it still won't work
@router.websocket("/connect_call/{id}/azure")
async def connect_call_azure(id: str, websocket: WebSocket) -> None:
await ws.accept()
while True:
try:
message: str = await ws.receive_text()
await ws.send_text(data=message)
except Exception as e:
logger.error(
message=f"Unknown Exception:{e}\n traceback:{traceback.format_exc()}"
)
break
Expected behavior
In the call, I can hear my voice back when I speak.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Any documentation discussing this feature when using create_call
with MediaStreamingOptions
, how to handle the WebSocket connection, the format, and the data specifications would be great. Thanks.
Metadata
Metadata
Assignees
Labels
This issue points to a problem in the data-plane of the library.Workflow: This issue is responsible by Azure service team.Issues that are reported by GitHub users external to the Azure organization.Workflow: This issue needs attention from Azure service team or SDK teamThe issue doesn't require a change to the product in order to be resolved. Most issues start as that