Repository navigation
Conversation
When AT+CHLD named an unsupported operation or an unknown call index, the AG sent +CME ERROR but then fell through, sent OK as well and emitted the call_hold event. The HF takes the error as the final result of AT+CHLD, so the extra OK is read as the result of its next command, and every later command then gets the previous command's response. Return after sending the error.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An HFP Audio Gateway built with Bumble answers a rejected
AT+CHLD(unsupported operation or unknown call index) with both+CME ERRORandOK, which shifts every later response on the HF side by one command and still reports the rejected request to the application as acall_holdevent.Root cause
AgProtocol._on_chldsends+CME ERRORwhen the operation is not insupported_ag_call_hold_operationsor when no call matches the index, but it does not return. It falls through tosend_ok()andemit(EVENT_CALL_HOLD, ...). The HF treats the error as the final result ofAT+CHLD, so the extraOKstays queued and becomes the result of the next command. With Bumble's ownHfProtocol, a followingAT+CIND?then fails withHfpProtocolError(NO ANSWER), and from there each command receives the previous command's response.Fix
Return right after sending each error, like the invalid operation branch just above already does.
Test
test_hold_call_with_unknown_call_indexintests/hfp_test.pysendsAT+CHLD=11with no active call, expects theHfpProtocolError, then checks that a followingAT+CIND?gets its own+CINDresponse and that nocall_holdevent was emitted. Before the change the second command fails withNO ANSWER; after it, the test passes. All tests intests/hfp_test.pypass andblack -S --checkis clean on the changed files.