Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

"callautomation-azure-openai-voice" RuntimeWarning: coroutine 'CallMediaOperations.start_media_streaming' was never awaited self._call_media_client.start_media_streaming(

Đang mở
#59 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
azure, python
Lĩnh vực
api, audio-video-rtc

Hướng nghiên cứu

Bắt đầu với các điểm vào incoming_call_handler và callbacks, đặc biệt là nhánh PlayCompleted và lệnh gọi start_media_streaming của nó, bằng cách sử dụng azure-communication-callautomation==1.4.0b1. Tái hiện RuntimeWarning với luồng cuộc gọi tối thiểu và xác minh rằng tính năng truyền phát media bắt đầu mà không có cảnh báo, đồng thời gửi âm thanh đến websocket đã cấu hình.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Please provide us with the following information:

This issue is for a: (mark with an x)
- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [x] regression (a behavior that used to work and stopped in a new release)
Minimal steps to reproduce

call_connection_client = acs_client.get_call_connection(call_connection_id)
await call_connection_client.start_media_streaming(
operation_callback_url=callback_uri,
operation_context="startMediaStreamingContext"
)

Any log messages given by the failure
Expected/desired behavior

I have played an audio source to the user once the call has been connected I started the media streaming so that I can send the audio to AI for assistance . but it is not happeing. this is my main code
<<<@app.route("/api/incomingCall", methods=['POST'])
async def incoming_call_handler():
app.logger.info("incoming event data")
for event_dict in await request.json:
global callback_uri,caller_id_latest
event = EventGridEvent.from_dict(event_dict)
app.logger.info("incoming event data --> %s", event.data)
if event.event_type == SystemEventNames.EventGridSubscriptionValidationEventName:
app.logger.info("Validating subscription")
validation_code = event.data['validationCode']
validation_response = {'validationResponse': validation_code}
return Response(response=json.dumps(validation_response), status=200)
elif event.event_type =="Microsoft.Communication.IncomingCall":
app.logger.info("Incoming call received: data=%s",
event.data)
if event.data['from']['kind'] =="phoneNumber":
caller_id = event.data['from']["phoneNumber"]["value"]
else :
caller_id = event.data['from']['rawId']
caller_id_latest = str(caller_id)
app.logger.info("incoming call handler caller id: %s",
caller_id)
incoming_call_context=event.data['incomingCallContext']
guid =uuid.uuid4()
query_parameters = urlencode({"callerId": caller_id})
callback_uri = f"{CALLBACK_EVENTS_URI}/{guid}?{query_parameters}"

            parsed_url = urlparse(CALLBACK_EVENTS_URI)
            websocket_url = urlunparse(('wss',parsed_url.netloc,'/ws','', '', ''))

            app.logger.info("callback url: %s",  callback_uri)
            app.logger.info("websocket url: %s",  websocket_url)

            media_streaming_options = MediaStreamingOptions(
                    transport_url=websocket_url,
                    transport_type=MediaStreamingTransportType.WEBSOCKET,
                    content_type=MediaStreamingContentType.AUDIO,
                    audio_channel_type=MediaStreamingAudioChannelType.MIXED,
                    start_media_streaming=False,
                    enable_bidirectional=True,
                    audio_format=AudioFormat.PCM24_K_MONO)
            
            answer_call_result = await acs_client.answer_call(incoming_call_context=incoming_call_context,
                                                        operation_context="incomingCall",
                                                        callback_url=callback_uri,                                                            media_streaming=media_streaming_options,cognitive_services_endpoint=cognitiveservices_endpoint_playmsg)
            app.logger.info("Answered call for connection id: %s",
                            answer_call_result.call_connection_id)
        return Response(status=200)

@app.route('/api/callbacks/', methods=['POST'])
async def callbacks(contextId):
for event in await request.json:
# Parsing callback events
global call_connection_id,transfer_call_agent,callback_uri
event_data = event['data']
call_connection_id = event_data["callConnectionId"]
app.logger.info(f"Received Event:-> {event['type']}, Correlation Id:-> {event_data['correlationId']}, CallConnectionId:-> {call_connection_id}")
if event['type'] == "Microsoft.Communication.CallConnected":
await handle_play(
call_connection_id=call_connection_id,
text_to_play="Hello how can i help you today?",
context="GetFreeFormText"
)
elif event['type'] == "Microsoft.Communication.PlayCompleted":
call_automation_client.get_call_connection(call_connection_id=event.data['callConnectionId'])
# # await call_connection_client.transfer_call_to_participant(target_participant=transfer_destination)
# # app.logger.info(f"Transfer call initiated: {context}")
call_connection_properties = await acs_client.get_call_connection(call_connection_id).get_call_properties()
call_connection_client = acs_client.get_call_connection(call_connection_id)
await call_connection_client.start_media_streaming(
operation_callback_url=callback_uri,
operation_context="startMediaStreamingContext"
) >>>

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
windows 10 using the devtunnels

Versions

I am using "azure-communication-callautomation==1.4.0b1" version

Mention any other details that might be useful

Thanks! We'll be in touch soon.

Ngôn ngữ chính
Python
Star
45
Fork
53
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Azure-Samples/communication-services-python-quickstarts

Tất cả issue của Azure-Samples/communication-services-python-quickstarts

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.