Revision
17475
Author
anthm
Date
2010-05-03 12:35:48 -0500 (Mon, 03 May 2010)

Log Message

add disable_hold var or disable-hold profile param

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h (17474 => 17475)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h	2010-05-03 17:36:23 UTC (rev 17474)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h	2010-05-03 17:35:48 UTC (rev 17475)
@@ -200,6 +200,7 @@
 	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,

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (17474 => 17475)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2010-05-03 17:36:23 UTC (rev 17474)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2010-05-03 17:35:48 UTC (rev 17475)
@@ -2156,6 +2156,12 @@
 						} 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 @@
 						} 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;

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (17474 => 17475)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	2010-05-03 17:36:23 UTC (rev 17474)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c	2010-05-03 17:35:48 UTC (rev 17475)
@@ -3392,6 +3392,11 @@
 		}
 	}
 
+	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);