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

Add option to set RX telephone-event PT #3705

Merged
merged 1 commit into from
Sep 19, 2023
Merged

Add option to set RX telephone-event PT #3705

merged 1 commit into from
Sep 19, 2023

Conversation

sauwming
Copy link
Member

@sauwming sauwming commented Sep 18, 2023

To implement the proposal by @nanangizz as described in #3661:
Allow app overriding si->rx_event_pt via PJSUA callback on_stream_precreate() (and PJSUA2). This can be useful for cases such as:

  • if remote doesn't specify telephone-event in its SDP answer
  • if remote sends tel-event PT different than the one negotiated in the SDP

To avoid multiple PTs offered, it is recommended to disable PJMEDIA_TELEPHONE_EVENT_ALL_CLOCKRATES. Then application can simply override param->stream_info.info.aud.rx_event_pt to PJMEDIA_RTP_PT_TELEPHONE_EVENTS or the PT expected to be sent by remote.

To fix #3700 as well.

Tested here and it seems to work as expected:
Before patch (if remote sends DTMF PT different than the SDP):

14:00:33.055        strm0x10c9b1928  Bad RTP pt 122 (expecting 96)
14:00:33.075        strm0x10c9b1928  Bad RTP pt 122 (expecting 96)
14:00:33.094        strm0x10c9b1928  Bad RTP pt 122 (expecting 96)
14:00:33.114        strm0x10c9b1928  Bad RTP pt 122 (expecting 96)

After patch:

14:04:55.036            pjsua_app.c  .Incoming DTMF on call 0: 1, using RFC2833 method
14:04:55.276            pjsua_app.c  .Incoming DTMF on call 0: 2, using RFC2833 method
14:04:55.517            pjsua_app.c  .Incoming DTMF on call 0: 3, using RFC2833 method

@sauwming sauwming merged commit cde87db into master Sep 19, 2023
34 checks passed
@sauwming sauwming deleted the rx-event-pt branch September 19, 2023 06:51
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.

DTMF does't detect as PJSIP Ignores telephony event type from remote SDP
3 participants