Make bypass-media-after-hold a media-option
FS-6186 --resolve Thanks-to: Matteo Brancaleoni <mbrancaleoni@voismart.it>
This commit is contained in:
parent
ee60781d6e
commit
8fa385b0d7
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue