Skip to content

Fix/start continuous dtmf recognition (start_continuous_dtmf_recognition)#47936

Open
komayama wants to merge 3 commits into
Azure:mainfrom
komayama:fix/start_continuous_dtmf_recognition
Open

Fix/start continuous dtmf recognition (start_continuous_dtmf_recognition)#47936
komayama wants to merge 3 commits into
Azure:mainfrom
komayama:fix/start_continuous_dtmf_recognition

Conversation

@komayama

@komayama komayama commented Jul 8, 2026

Copy link
Copy Markdown
Member

Description

This pull request adds support for specifying a custom callback URL for the start_continuous_dtmf_recognition operation in both the synchronous and asynchronous CallConnectionClient classes. This allows users to override the default callback URL set during call creation or answering on a per-operation basis. The changes also update the API documentation and expand test coverage to ensure the new parameter is handled correctly.

API and SDK enhancements:

  • Added the optional operation_callback_url parameter to the start_continuous_dtmf_recognition method in both the synchronous (_call_connection_client.py) and asynchronous (_call_connection_client_async.py) clients, allowing users to specify a custom callback URL for this operation. [1] [2]
  • Updated the internal ContinuousDtmfRecognitionRequest construction to set the operation_callback_uri field using the new parameter. [1] [2]

Documentation updates:

  • Updated the API documentation (api.md) for both sync and async namespaces to include the new operation_callback_url parameter and its behavior. [1] [2]

Test improvements:

  • Modified and expanded unit tests in both sync (test_call_media_client.py) and async (test_call_media_client_async.py) test suites to cover the new operation_callback_url parameter, verifying that it is correctly passed and set in the request object. [1] [2] [3] [4]

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an optional operation_callback_url keyword parameter to the start_continuous_dtmf_recognition operation in both the synchronous and asynchronous CallConnectionClient classes for azure-communication-callautomation. This lets callers override the default callback URL (set during CreateCall/AnswerCall) on a per-operation basis, bringing start_continuous_dtmf_recognition in line with the already-supported stop_continuous_dtmf_recognition method. The change is correct: the underlying ContinuousDtmfRecognitionRequest model exposes the operation_callback_uri field, and the new parameter is wired through consistently.

Changes:

  • Added operation_callback_url keyword param (with docstring) to start_continuous_dtmf_recognition in the sync and async clients, mapping it to the request's operation_callback_uri.
  • Updated api.md for both sync and async namespaces.
  • Expanded sync and async unit tests to pass and assert the new parameter (and operation_context).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
azure/communication/callautomation/_call_connection_client.py Adds operation_callback_url param + docstring; sets operation_callback_uri on the request.
azure/communication/callautomation/aio/_call_connection_client_async.py Same change for the async client.
api.md Documents the new keyword arg in sync and async namespaces.
tests/test_call_media_client.py Extends sync test to pass/assert operation_callback_url and operation_context.
tests/test_call_media_client_async.py Extends async test equivalently.

target_participant: "CommunicationIdentifier",
*,
operation_context: Optional[str] = None,
operation_callback_url: Optional[str] = None,
@komayama

komayama commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

Run test results:
image

python -m pytest tests/test_call_media_client.py::TestCallMediaClient::test_start_continuous_dtmf_recognition tests/test_call_media_client_async.py::TestCallMediaClientAsync::test_start_continuous_dtmf_recognition -v
====================================================================================== test session starts =======================================================================================
platform linux -- Python 3.12.10, pytest-9.0.1, pluggy-1.6.0 -- /home/komayama/.anyenv/envs/pyenv/versions/3.12.10/bin/python
cachedir: .pytest_cache
rootdir: /home/komayama/Gitlocal/azure-sdk-for-python/sdk/communication/azure-communication-callautomation
configfile: pytest.ini
plugins: asyncio-1.4.0, anyio-4.12.0, xdist-3.8.0, forked-1.6.0
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=class, asyncio_default_test_loop_scope=function
collected 2 items                                                                                                                                                                                

tests/test_call_media_client.py::TestCallMediaClient::test_start_continuous_dtmf_recognition PASSED                                                                                        [ 50%]
tests/test_call_media_client_async.py::TestCallMediaClientAsync::test_start_continuous_dtmf_recognition PASSED                                                                             [100%]

======================================================================================= 2 passed in 0.91s ========================================================================================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants