Skip to content

Commit

Permalink
[mod_spandsp] Pass session to handle_v18_status.
Browse files Browse the repository at this point in the history
  • Loading branch information
andywolk committed Feb 4, 2025
1 parent ed0e327 commit aa88cb5
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/mod/applications/mod_spandsp/mod_spandsp_dsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,10 @@ static void put_text_msg(void *user_data, const uint8_t *msg, int len)
#if SPANDSP_RELEASE_DATE >= 20230620
static void handle_v18_status(void *user_data, int status)
{
switch_tdd_t *pvt = (switch_tdd_t *) user_data;
switch_channel_t *channel = switch_core_session_get_channel(pvt->session);

switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(pvt->session), SWITCH_LOG_INFO, "%s detected V.18 modem: %s\n", switch_channel_get_name(channel), v18_status_to_str(status));
switch_core_session_t *session = (switch_core_session_t *) user_data;
switch_channel_t *channel = switch_core_session_get_channel(session);

switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "%s detected V.18 modem: %s\n", switch_channel_get_name(channel), v18_status_to_str(status));
}
#endif

Expand Down Expand Up @@ -225,7 +224,7 @@ switch_status_t spandsp_tdd_send_session(switch_core_session_t *session, const c
}

#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);
tdd_state = v18_init(NULL, TRUE, get_v18_mode(session), V18_AUTOMODING_GLOBAL, put_text_msg, NULL, handle_v18_status, session);
#else
tdd_state = v18_init(NULL, TRUE, get_v18_mode(session), V18_AUTOMODING_GLOBAL, put_text_msg, NULL);
#endif
Expand Down Expand Up @@ -276,7 +275,7 @@ switch_status_t spandsp_tdd_encode_session(switch_core_session_t *session, const
pvt->session = session;

#if SPANDSP_RELEASE_DATE >= 20230620
pvt->tdd_state = v18_init(NULL, TRUE, get_v18_mode(session), V18_AUTOMODING_GLOBAL, put_text_msg, NULL, handle_v18_status, pvt);
pvt->tdd_state = v18_init(NULL, TRUE, get_v18_mode(session), V18_AUTOMODING_GLOBAL, put_text_msg, NULL, handle_v18_status, session);
#else
pvt->tdd_state = v18_init(NULL, TRUE, get_v18_mode(session), V18_AUTOMODING_GLOBAL, put_text_msg, NULL);
#endif
Expand Down Expand Up @@ -360,7 +359,7 @@ switch_status_t spandsp_tdd_decode_session(switch_core_session_t *session)
pvt->session = session;

#if SPANDSP_RELEASE_DATE >= 20230620
pvt->tdd_state = v18_init(NULL, FALSE, get_v18_mode(session), V18_AUTOMODING_GLOBAL, put_text_msg, pvt, handle_v18_status, pvt);
pvt->tdd_state = v18_init(NULL, FALSE, get_v18_mode(session), V18_AUTOMODING_GLOBAL, put_text_msg, pvt, handle_v18_status, session);
#else
pvt->tdd_state = v18_init(NULL, FALSE, get_v18_mode(session), V18_AUTOMODING_GLOBAL, put_text_msg, pvt);
#endif
Expand Down

0 comments on commit aa88cb5

Please sign in to comment.