Forum Discussion
KrushiV
Sep 11, 2025Copper Contributor
Azure Communication Services - Python SDK Call Media not working with CallConnectionClient
Hi team, I’m working on a FastAPI service that uses Azure Communication Services Call Automation (Python SDK) to handle outbound PSTN calls and real-time speech interaction. So far it is able to ma...
KrushiV
Sep 12, 2025Copper Contributor
it was solved after going through microsoft official docs and i got another error
code snippet:
# Play greeting
play_source = TextSource(
text="Hello, this is your AI assistant. You can start speaking now.",
voice_name=VOICE_NAME
)
try:
call_connection.play_media(
play_source=play_source,
play_to=[pstn],
operation_context="welcome"
)
print("Played welcome greeting.")
except Exception as e:
print("Play Greeting Failed: ", repr(e))
try:
call_connection.start_recognizing_media(
target_participant=pstn,
input_type=RecognizeInputType.SPEECH,
interrupt_call_media_operation=True,
operation_context="speech-recognition"
)
print("Started recognition after playCompleted.")
except Exception as e:
print("Recognition start failed after playCompleted.:", repr(e))
error:
8565 message: Action failed due to a bad request to Cognitive Services. Please check your input parameters.
i have checked...
- My ACS resource is connected to Speech Resource
- My endpoints for both acs and speech are correct, but i am still getting this error