Skip to content

app_dial: Properly handle callee hangup while sending digits.#1916

Merged
github-actions[bot] merged 1 commit into
asterisk:masterfrom
InterLinked1:master-issue-1915
May 12, 2026
Merged

app_dial: Properly handle callee hangup while sending digits.#1916
github-actions[bot] merged 1 commit into
asterisk:masterfrom
InterLinked1:master-issue-1915

Conversation

@InterLinked1
Copy link
Copy Markdown
Contributor

@InterLinked1 InterLinked1 commented May 6, 2026

If we are sending digits (either DTMF, MF, or SF) to the called channel
after receiving progress or a wink, and the callee hangs up before we
have finished sending it digits, there are several problems that can ensue:

  • If the callee hung up without answering, the calling channel would
    hang up and not continue in the dialplan.
  • If the callee did answer before hanging up, the answer was never
    passed through to the caller, since this gets "eaten" by the various
    digit streaming functions and is never processed by app_dial.

This is generally an edge case that occurs due to some kind of signaling
failure, but to better handle this:

  • Set to_answer to 0 to prevent hangup on the exit path, just like other
    parts of wait_for_answer.
  • Better document this usage of to_answer.
  • If the channel did answer while it was receiving digits, manually
    answer the calling channel before we abort. The call would not continue
    in the dialplan anyways (either before or after this fix), but technically
    the call was answered, so the CDRs should probably reflect that, and this
    mirrors the behavior of calls which normally do not continue.

Resolves: #1915

UserNote: If a called channel sends progress or wink and the caller begins
sending digits but the callee answers and then hangs up before digit
sending can finish, the call is now answered before being disconnected.
If the callee hangs up without answering, the call now continues in
the dialplan.

@InterLinked1
Copy link
Copy Markdown
Contributor Author

cherry-pick-to: 23
cherry-pick-to: 22
cherry-pick-to: 20

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Workflow Check completed successfully

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Workflow Check failed
master-ari1: FAILED TEST: rest_api/external_interaction/attended_transfer/stasis_bridge_to_stasis_app

Comment thread apps/app_dial.c
If we are sending digits (either DTMF, MF, or SF) to the called channel
after receiving progress or a wink, and the callee hangs up before we
have finished sending it digits, there are several problems that can ensue:

* If the callee hung up without answering, the calling channel would
  hang up and not continue in the dialplan.
* If the callee *did* answer before hanging up, the answer was never
  passed through to the caller, since this gets "eaten" by the various
  digit streaming functions and is never processed by app_dial.

This is generally an edge case that occurs due to some kind of signaling
failure, but to better handle this:

* Set to_answer to 0 to prevent hangup on the exit path, just like other
  parts of wait_for_answer.
* Better document this usage of to_answer.
* If the channel did answer while it was receiving digits, manually
  answer the calling channel before we abort. The call would not continue
  in the dialplan anyways (either before or after this fix), but technically
  the call was answered, so the CDRs should probably reflect that, and this
  mirrors the behavior of calls which normally do not continue.

Resolves: asterisk#1915

UserNote: If a called channel sends progress or wink and the caller begins
sending digits but the callee answers and then hangs up before digit
sending can finish, the call is now answered before being disconnected.
If the callee hangs up without answering, the call now continues in
the dialplan.
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Pull Request Checklist Complete

@github-actions github-actions Bot added the has-pr-checklist A PR Checklist is present on the PR label May 11, 2026
@github-actions
Copy link
Copy Markdown

Workflow Check failed
master-pjs5: FAILED TEST: channels/pjsip/subscriptions/rls/lists_of_lists/nominal/mwi/batched

@InterLinked1 InterLinked1 requested a review from jcolp May 11, 2026 15:23
@github-actions github-actions Bot dismissed their stale review May 12, 2026 02:20

Pull Request Checklist Complete

@github-actions github-actions Bot removed the has-pr-checklist A PR Checklist is present on the PR label May 12, 2026
@gtjoseph gtjoseph added the cherry-pick-test Trigger dry run of cherry-picks label May 12, 2026
@github-actions github-actions Bot added cherry-pick-testing-in-progress Cherry-Pick tests in progress cherry-pick-checks-failed Cherry-Pick checks failed and removed cherry-pick-test Trigger dry run of cherry-picks cherry-pick-testing-in-progress Cherry-Pick tests in progress labels May 12, 2026
@github-actions
Copy link
Copy Markdown

Workflow CPCheck failed
23-pjs5: FAILED TEST: channels/pjsip/subscriptions/rls/lists/nominal/mwi/batched/single_resource_multiple_changes

@github-actions github-actions Bot merged commit 7988d11 into asterisk:master May 12, 2026
84 of 86 checks passed
@github-actions
Copy link
Copy Markdown

Successfully merged to branch master and cherry-picked to ["23","22","20"]

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.

[bug]: app_dial: Channel not handled properly if callee disconnects while caller is sending it digits prior to answer

3 participants