]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add disable_hold var or disable-hold profile param
authorAnthony Minessale <anthm@freeswitch.org>
Sat, 1 May 2010 00:14:39 +0000 (19:14 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 3 May 2010 17:35:48 +0000 (12:35 -0500)
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_glue.c

index 7fe7c5fe2b1ee3fd42edafa7f50bd7ae7709d251..cc999cdf9bf3a232fc7276ebccda6d9b67991225 100644 (file)
@@ -200,6 +200,7 @@ typedef enum {
        PFLAG_MESSAGE_QUERY_ON_FIRST_REGISTER,
        PFLAG_RTP_AUTOFLUSH_DURING_BRIDGE,
        PFLAG_MANUAL_REDIRECT,
+       PFLAG_DISABLE_HOLD,
        PFLAG_AUTO_NAT,
        PFLAG_SIPCOMPACT,
        PFLAG_SQL_IN_TRANS,
index c405822fcfb6cdcea828c9bd45dc56fb0fa7e518..bbc0321d788ea076b8539ff61e3134928106431e 100644 (file)
@@ -2156,6 +2156,12 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
                                                } else {
                                                        sofia_clear_pflag(profile, PFLAG_PASS_CALLEE_ID);
                                                }
+                                       } else if (!strcasecmp(var, "disable-hold")) {
+                                               if (switch_true(val)) {
+                                                       sofia_set_pflag(profile, PFLAG_DISABLE_HOLD);
+                                               } else {
+                                                       sofia_clear_pflag(profile, PFLAG_DISABLE_HOLD);
+                                               }
                                        } else if (!strcasecmp(var, "sip-trace")) {
                                                if (switch_true(val)) {
                                                        sofia_set_flag(profile, TFLAG_TPORT_LOG);
@@ -2791,6 +2797,12 @@ switch_status_t config_sofia(int reload, char *profile_name)
                                                } else {
                                                        sofia_clear_pflag(profile, PFLAG_LOG_AUTH_FAIL);
                                                }
+                                       } else if (!strcasecmp(var, "disable-hold")) {
+                                               if (switch_true(val)) {
+                                                       sofia_set_pflag(profile, PFLAG_DISABLE_HOLD);
+                                               } else {
+                                                       sofia_clear_pflag(profile, PFLAG_DISABLE_HOLD);
+                                               }
                                        } else if (!strcasecmp(var, "dtmf-type")) {
                                                if (!strcasecmp(val, "rfc2833")) {
                                                        profile->dtmf_type = DTMF_2833;
index 3875fd215460c78c88aa9792e275773329cc6167..a692ec275cb55f9db554623eb76a48a276d7696e 100644 (file)
@@ -3392,6 +3392,11 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, sdp_session_t *
                }
        }
 
+       if (sofia_test_flag(tech_pvt->profile, PFLAG_DISABLE_HOLD) ||
+               ((val = switch_channel_get_variable(tech_pvt->channel, "sip_disable_hold")) && switch_true(val))) {
+               sendonly = 0;
+       }
+
        if (!tech_pvt->hold_laps) {
                tech_pvt->hold_laps++;
                sofia_glue_toggle_hold(tech_pvt, sendonly);