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

[mod_spandsp] Fix compilation against >=2023/06/02 spandsp #2668

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pfournier
Copy link
Contributor

This patch from my colleague allows FreeSWITCH to compile with latest or earlier spandsp code base:

spandsp, beginning with commit d9681c37 and coinciding with the SPANDSP_RELEASE_DATE of 20230620, introduced the following changes to its V.18 protocol API, which FreeSWITCH is not able to compile against:

  • Certain V.18 constants were renamed.
  • The v18_init function now requires passing a third function, handling the V.18 modem's status changes.

This patch allows FreeSWITCH to build against current versions of spandsp by:

  • Using the new V.18 constant names.
  • Implementing a simple status reporter callback function and passing it as the third function to v18_init.

Additionally, it retains backward compatibility with prior versions of spandp through #if conditions checking the value of SPANDSP_RELEASE_DATE.

@andywolk andywolk force-pushed the fix_spandsp_v18_breaking_changes branch from 54c664a to 7d06105 Compare December 18, 2024 11:21
@andywolk andywolk self-requested a review December 18, 2024 11:49
@andywolk andywolk added the bug Something isn't working label Dec 18, 2024
spandsp, beginning with commit d9681c37 and coinciding with the
SPANDSP_RELEASE_DATE of 20230620, introduced the following changes to
its V.18 protocol API, which FreeSWITCH is not able to compile against:
- Certain V.18 constants were renamed.
- The v18_init function now requires passing a third function, handling
the V.18 modem's status changes.

This patch allows FreeSWITCH to build against current versions of
spandsp by:
- Using the new V.18 constant names.
- Implementing a simple status reporter callback function and passing it
as the third function to v18_init.

Additionally, it retains backward compatibility with prior versions of
spandp through #if conditions checking the value of
SPANDSP_RELEASE_DATE.

Signed-off-by: Patrice Fournier <[email protected]>
@andywolk andywolk force-pushed the fix_spandsp_v18_breaking_changes branch from 7d06105 to 65093fe Compare December 19, 2024 17:25
@@ -213,8 +224,11 @@ switch_status_t spandsp_tdd_send_session(switch_core_session_t *session, const c
return SWITCH_STATUS_FALSE;
}

#if SPANDSP_RELEASE_DATE >= 20230620
tdd_state = v18_init(NULL, TRUE, get_v18_mode(session), V18_AUTOMODING_GLOBAL, put_text_msg, NULL, handle_v18_status, NULL);
Copy link
Contributor

Choose a reason for hiding this comment

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

user data is null and will crash in handle_v18_status due to a null pointer dereference?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants