[Freeswitch-svn] [commit] r8723 - in freeswitch/trunk: conf/sip_profiles src/mod/endpoints/mod_sofia

Freeswitch SVN mikej at freeswitch.org
Thu May 29 16:02:07 EDT 2008


Author: mikej
Date: Thu May 29 16:02:06 2008
New Revision: 8723

Modified:
   freeswitch/trunk/conf/sip_profiles/external.xml
   freeswitch/trunk/conf/sip_profiles/internal.xml
   freeswitch/trunk/conf/sip_profiles/nat.xml
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c

Log:
add enable-3pcc sofia profile param, it is now disabled by default.

Modified: freeswitch/trunk/conf/sip_profiles/external.xml
==============================================================================
--- freeswitch/trunk/conf/sip_profiles/external.xml	(original)
+++ freeswitch/trunk/conf/sip_profiles/external.xml	Thu May 29 16:02:06 2008
@@ -37,5 +37,6 @@
     <param name="ext-sip-ip" value="$${external_sip_ip}"/>
     <param name="rtp-timeout-sec" value="300"/>
     <param name="rtp-hold-timeout-sec" value="1800"/>
+    <!--<param name="enable-3pcc" value="true"/>-->
   </settings>
 </profile>

Modified: freeswitch/trunk/conf/sip_profiles/internal.xml
==============================================================================
--- freeswitch/trunk/conf/sip_profiles/internal.xml	(original)
+++ freeswitch/trunk/conf/sip_profiles/internal.xml	Thu May 29 16:02:06 2008
@@ -118,6 +118,8 @@
     <!-- disable register and transfer which may be undesirable in a public switch -->
     <!--<param name="disable-transfer" value="true"/>-->
     <!--<param name="disable-register" value="true"/>-->
+    <!--<param name="enable-3pcc" value="true"/>-->
+
   </settings>
 </profile>
 

Modified: freeswitch/trunk/conf/sip_profiles/nat.xml
==============================================================================
--- freeswitch/trunk/conf/sip_profiles/nat.xml	(original)
+++ freeswitch/trunk/conf/sip_profiles/nat.xml	Thu May 29 16:02:06 2008
@@ -28,5 +28,6 @@
     <param name="ext-sip-ip" value="$${external_sip_ip}"/>
     <param name="rtp-timeout-sec" value="300"/>
     <param name="rtp-hold-timeout-sec" value="1800"/>
+    <!--<param name="enable-3pcc" value="true"/>-->
   </settings>
 </profile>

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h	Thu May 29 16:02:06 2008
@@ -147,7 +147,8 @@
 	PFLAG_DISABLE_TIMER = (1 << 19),
 	PFLAG_DISABLE_100REL = (1 << 20),
 	PFLAG_AGGRESSIVE_NAT_DETECTION = (1 << 21),
-	PFLAG_RECIEVED_IN_NAT_REG_CONTACT = (1 << 22)
+	PFLAG_RECIEVED_IN_NAT_REG_CONTACT = (1 << 22),
+	PFLAG_3PCC = (1 << 23)
 } PFLAGS;
 
 typedef enum {

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	Thu May 29 16:02:06 2008
@@ -1244,6 +1244,10 @@
 						if (switch_true(val)) {
 							profile->pflags |= PFLAG_BLIND_REG;
 						}
+					} else if (!strcasecmp(var, "enable-3pcc")) {
+						if (switch_true(val)) {
+							profile->pflags |= PFLAG_3PCC;
+						}
 					} else if (!strcasecmp(var, "accept-blind-auth")) {
 						if (switch_true(val)) {
 							profile->pflags |= PFLAG_BLIND_AUTH;
@@ -1877,15 +1881,20 @@
 				if (switch_channel_test_flag(channel, CF_PROXY_MODE) || switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
 					goto done;
 				} else {
-					switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "RECEIVED_NOSDP");
-					sofia_glue_tech_choose_port(tech_pvt, 0);
-					sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
-					switch_channel_set_state(channel, CS_HIBERNATE);
-					nua_respond(tech_pvt->nh, SIP_200_OK,
-								SIPTAG_CONTACT_STR(tech_pvt->profile->url),
-								SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
-								SOATAG_REUSE_REJECTED(1),
-								SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1), TAG_END());
+					if (profile->pflags & PFLAG_3PCC) {
+						switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "RECEIVED_NOSDP");
+						sofia_glue_tech_choose_port(tech_pvt, 0);
+						sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
+						switch_channel_set_state(channel, CS_HIBERNATE);
+						nua_respond(tech_pvt->nh, SIP_200_OK,
+									SIPTAG_CONTACT_STR(tech_pvt->profile->url),
+									SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
+									SOATAG_REUSE_REJECTED(1),
+									SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1), TAG_END());
+					} else {
+						switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "3PCC DISABLED");
+						switch_channel_hangup(channel, SWITCH_CAUSE_MANDATORY_IE_MISSING);
+					}
 					goto done;
 				}
 			}



More information about the Freeswitch-svn mailing list