Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audio: fix inbound dtmf END event #2802

Merged
merged 1 commit into from
Nov 11, 2023

Conversation

cspiel1
Copy link
Collaborator

@cspiel1 cspiel1 commented Nov 10, 2023

DTMF END is missing when registered to Asterisk.

Asterisk sends less RTP EVENT packets than baresip and does not mix audio RTP packets and DTMF packets like baresip. If the "DTMF end" follows directly a normal DTMF packet than it was not recognized.

  • call stream_pt_handler() always
  • stream_pt_handler() in audio and video have a lightweight check at top
  • NULL pointer check of audio.rx is not needed

Alternative check with less lines, but more difficult to read:

	if (pt == rx->pt && (!rx->pt_tel || pt != rx->pt_tel))
		return 0;

Does somebody prefer the shorter check?

- call `stream_pt_handler()` always
- `stream_pt_handler()` in audio and video have a lightweight check at top
- NULL pointer check of audio.rx is not needed
handle_telev(a, mb);
return ENODATA;
}

if (!lc)
return ENOENT;

if (rx->pt == pt)
Copy link
Collaborator Author

@cspiel1 cspiel1 Nov 10, 2023

Choose a reason for hiding this comment

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

This check is not needed. But helps to validate that decoder is not set more than once.

@alfredh alfredh merged commit a85b535 into baresip:main Nov 11, 2023
16 checks passed
@cspiel1 cspiel1 deleted the audio_inbound_dtmf_end branch November 13, 2023 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants