<!-- Turn on a jitterbuffer for every call -->
<!-- <param name="auto-jitterbuffer-msec" value="60"/> -->
+
+
+ <!-- By default mod_sofia will ignore the codecs in the sdp for hold/unhold operations
+ Set this to true if you want to actually parse the sdp and re-negotiate the codec during hold/unhold.
+ It's probably not what you want so stick with the default unless you really need to change this.
+ -->
+ <!--<param name="renegotiate-codec-on-hold" value="true"/>-->
</settings>
</profile>
PFLAG_PRESENCE_ON_REGISTER,
PFLAG_PRESENCE_ON_FIRST_REGISTER,
PFLAG_NO_CONNECTION_REUSE,
+ PFLAG_RENEG_ON_HOLD,
/* No new flags below this line */
PFLAG_MAX
} PFLAGS;
void sofia_reg_send_reboot(sofia_profile_t *profile, const char *user, const char *host, const char *contact, const char *user_agent,
const char *network_ip);
void sofia_glue_restart_all_profiles(void);
-void sofia_glue_toggle_hold(private_object_t *tech_pvt, int sendonly);
+int sofia_glue_toggle_hold(private_object_t *tech_pvt, int sendonly);
const char *sofia_state_string(int state);
switch_status_t sofia_glue_tech_set_codec(private_object_t *tech_pvt, int force);
void sofia_wait_for_reply(struct private_object *tech_pvt, nua_event_t event, uint32_t timeout);
} else {
sofia_clear_pflag(profile, PFLAG_IGNORE_183NOSDP);
}
+ } else if (!strcasecmp(var, "renegotiate-codec-on-hold")) {
+ if (switch_true(val)) {
+ sofia_set_pflag(profile, PFLAG_RENEG_ON_HOLD);
+ } else {
+ sofia_clear_pflag(profile, PFLAG_RENEG_ON_HOLD);
+ }
} else if (!strcasecmp(var, "presence-probe-on-register")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_PRESENCE_PROBE_ON_REGISTER);
} else {
sofia_clear_pflag(profile, PFLAG_IGNORE_183NOSDP);
}
+ } else if (!strcasecmp(var, "renegotiate-codec-on-hold")) {
+ if (switch_true(val)) {
+ sofia_set_pflag(profile, PFLAG_RENEG_ON_HOLD);
+ } else {
+ sofia_clear_pflag(profile, PFLAG_RENEG_ON_HOLD);
+ }
} else if (!strcasecmp(var, "presence-probe-on-register")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_PRESENCE_PROBE_ON_REGISTER);
return SWITCH_STATUS_FALSE;
}
-void sofia_glue_toggle_hold(private_object_t *tech_pvt, int sendonly)
+int sofia_glue_toggle_hold(private_object_t *tech_pvt, int sendonly)
{
+ int changed = 0;
+
if (sendonly && switch_channel_test_flag(tech_pvt->channel, CF_ANSWERED)) {
if (!sofia_test_flag(tech_pvt, TFLAG_SIP_HOLD)) {
const char *stream;
switch_channel_set_flag(tech_pvt->channel, CF_LEG_HOLDING);
switch_channel_mark_hold(tech_pvt->channel, SWITCH_TRUE);
switch_channel_presence(tech_pvt->channel, "unknown", msg, NULL);
+ changed = 1;
if (tech_pvt->max_missed_hold_packets) {
switch_rtp_set_max_missed_packets(tech_pvt->rtp_session, tech_pvt->max_missed_hold_packets);
sofia_set_flag(tech_pvt, TFLAG_SIP_HOLD);
switch_channel_set_flag(tech_pvt->channel, CF_LEG_HOLDING);
switch_channel_mark_hold(tech_pvt->channel, SWITCH_TRUE);
+ changed = 1;
}
sofia_clear_flag_locked(tech_pvt, TFLAG_HOLD_LOCK);
switch_channel_clear_flag(tech_pvt->channel, CF_LEG_HOLDING);
switch_channel_mark_hold(tech_pvt->channel, SWITCH_FALSE);
switch_channel_presence(tech_pvt->channel, "unknown", "unhold", NULL);
+ changed = 1;
}
}
+
+ return changed;
}
void sofia_glue_copy_t38_options(switch_t38_options_t *t38_options, switch_core_session_t *session)
if (!tech_pvt->hold_laps) {
tech_pvt->hold_laps++;
- sofia_glue_toggle_hold(tech_pvt, sendonly);
+ if (sofia_glue_toggle_hold(tech_pvt, sendonly)) {
+ int reneg = sofia_test_pflag(tech_pvt->profile, PFLAG_RENEG_ON_HOLD);
+
+ if ((val = switch_channel_get_variable(tech_pvt->channel, "sip_renegotiate_codec_on_hold"))) {
+ reneg = switch_true(val);
+ }
+
+ if (!reneg) {
+ match = 1;
+ goto done;
+ }
+ }
+
}
}