Package: azure-communication-callautomation
Azure Communication Call Automation client library for PythonThis package contains a Python SDK for Azure Communication Call Automation. Call Automation provides developers the ability to build server-based, intelligent call workflows, and call recording for voice and PSTN channels.Overview of Call Automation|Product documentationDisclaimerAzure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please
refer tohttps://github.com/Azure/azure-sdk-for-python/issues/20691Getting startedPrerequisitesPython 3.7 or later is required to use this package.You need anAzure subscriptionto use this package.A deployed Communication Services resource. You can use theAzure Portalor theAzure PowerShellto set it up.InstallingInstall the Azure Communication Service Call Automation SDK.pipinstallazure-communication-callautomationKey conceptsNameDescriptionCallAutomationClientCallAutomationClientis the primary interface for developers using this client library. It can be used to initiate calls bycreateCalloranswerCall. It can also be used to do recording actions such asstartRecordingCallConnectionClientCallConnectionClientrepresents a ongoing call. Once the call is established withcreateCalloranswerCall, further actions can be performed for the call, such astransferorplay_media.Callback EventsCallback events are events sent back during duration of the call. It gives information and state of the call, such asCallConnected.CallbackUrlmust be provided duringcreateCallandanswerCall, and callback events will be sent to this url.Incoming Call EventWhen incoming call happens (that can be answered withanswerCall), incoming call eventgrid event will be sent. This is different from Callback events above, and should be setup on Azure portal. SeeIncoming Callfor detail.ExamplesInitialize CallAutomationClientfromazure.communication.callautomationimport(CallAutomationClient)# Your unique Azure Communication service endpointendpoint_url='<ENDPOINT>'client=CallAutomationClient.from_connection_string(endpoint_url)Create Callfromazure.communication.callautomationimport(CallAutomationClient,CommunicationUserIdentifier)# target endpoint for ACS Useruser=CommunicationUserIdentifier("8:acs:...")# callback url to receive callback eventscallback_url="https://<MY-EVENT-HANDLER-URL>/events"# send out the invitation, creating callresult=client.create_call(user,callback_url)# this id can be used to do further actions in the callcall_connection_id=result.call_connection_idPlay Media# using call connection id, get call connectioncall_connection=client.get_call_connection(call_connection_id)# from callconnection of result above, play media to all participantsmy_file=FileSource(url="https://<FILE-SOURCE>/<SOME-FILE>.wav")call_connection.play_media(my_file)TroubleshootingNext stepsCall Automation OverviewIncoming Call ConceptBuild a customer interaction workflow using Call AutomationRedirect inbound telephony calls with Call AutomationConnect Azure Communication Services with Azure AI servicesQuickstart: Play actionQuickstart: Recognize actionRead more about Call Recording in Azure Communication ServicesRecord and download calls with Event GridProvide FeedbackIf you encounter any bugs or have suggestions, please file an issue in theIssuessection of the projectContributingThis project welcomes contributions and suggestions. Most contributions require
you to agree to a Contributor License Agreement (CLA) declaring that you have
the right to, and actually do, grant us the rights to use your contribution.
For details, visithttps://cla.microsoft.com.When you submit a pull request, a CLA-bot will automatically determine whether
you need to provide a CLA and decorate the PR appropriately (e.g., label,
comment). Simply follow the instructions provided by the bot. You will only
need to do this once across all repos using our CLA.This project has adopted the
[Microsoft Open Source Code of Conduct][code_of_conduct]. For more information,
see the Code of Conduct FAQ or contactopencode@microsoft.comwith any
additional questions or comments.