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
"callautomation-azure-openai-voice" RuntimeWarning: coroutine 'CallMediaOperations.start_media_streaming' was never awaited self._call_media_client.start_media_streaming(
#59
Open
venkatasaive opened this issue
Dec 16, 2024
· 0 comments
- [ ] 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)
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}"
This issue is for a: (mark with an
x
)Minimal steps to reproduce
Any log messages given by the failure
Expected/desired behavior
@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?
Versions
Mention any other details that might be useful
The text was updated successfully, but these errors were encountered: