diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index ea3bdbc084..e307a005ba 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -319,7 +319,6 @@ typedef enum { TFLAG_CAPTURE, TFLAG_REINVITED, TFLAG_PASS_ACK, - TFLAG_BYPASS_MEDIA_AFTER_HOLD, /* No new flags below this line */ TFLAG_MAX } TFLAGS; @@ -509,7 +508,8 @@ typedef enum { typedef enum { MEDIA_OPT_NONE = 0, MEDIA_OPT_MEDIA_ON_HOLD = (1 << 0), - MEDIA_OPT_BYPASS_AFTER_ATT_XFER = (1 << 1) + MEDIA_OPT_BYPASS_AFTER_ATT_XFER = (1 << 1), + MEDIA_OPT_BYPASS_AFTER_HOLD = (1 << 2) } sofia_media_options_t; typedef enum { diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index c59d448738..753a8e4a40 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -4305,13 +4305,13 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name) profile->media_options |= MEDIA_OPT_MEDIA_ON_HOLD; } else if (!strcasecmp(val, "bypass-media-after-att-xfer")) { profile->media_options |= MEDIA_OPT_BYPASS_AFTER_ATT_XFER; - } - } else if (!strcasecmp(var, "bypass-media-after-hold") && switch_true(val)) { - if(profile->media_options & MEDIA_OPT_MEDIA_ON_HOLD) { - sofia_set_flag(profile, TFLAG_BYPASS_MEDIA_AFTER_HOLD); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, - "bypass-media-after-hold can be set only with resume-media-on-hold media-option\n"); + } else if (!strcasecmp(val, "bypass-media-after-hold")) { + if (profile->media_options & MEDIA_OPT_MEDIA_ON_HOLD) { + profile->media_options |= MEDIA_OPT_BYPASS_AFTER_HOLD; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + "bypass-media-after-hold can be set only with resume-media-on-hold media-option\n"); + } } } else if (!strcasecmp(var, "pnp-provision-url")) { profile->pnp_prov_url = switch_core_strdup(profile->pool, val); @@ -8548,7 +8548,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia switch_channel_set_flag(channel, CF_PROXY_MODE); } - if (sofia_test_flag(tech_pvt, TFLAG_BYPASS_MEDIA_AFTER_HOLD)) { + if (profile->media_options & MEDIA_OPT_BYPASS_AFTER_HOLD) { switch_channel_set_flag(channel, CF_BYPASS_MEDIA_AFTER_HOLD); }