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

Freeswitch SVN anthm at freeswitch.org
Fri Apr 6 23:04:46 EDT 2007


Author: anthm
Date: Fri Apr  6 23:04:46 2007
New Revision: 4880

Modified:
   freeswitch/trunk/conf/sofia.conf.xml
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c

Log:
added patch from http://jira.freeswitch.org/browse/MODENDP-9

Modified: freeswitch/trunk/conf/sofia.conf.xml
==============================================================================
--- freeswitch/trunk/conf/sofia.conf.xml	(original)
+++ freeswitch/trunk/conf/sofia.conf.xml	Fri Apr  6 23:04:46 2007
@@ -16,6 +16,8 @@
 	  <!--<param name="proxy" value="asterlink.com"/>-->
 	  <!--/// expire in seconds: *optional* 3600, if blank ///-->
 	  <!--<param name="expire-seconds" value="60"/>-->
+	  <!--/// do not register ///-->
+	  <!--<param name="register" value="false"/>-->
 	<!--</gateway>-->
       </gateways>
       <settings>

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	Fri Apr  6 23:04:46 2007
@@ -27,6 +27,7 @@
  * Ken Rice, Asteria Solutions Group, Inc <ken at asteriasgi.com>
  * Paul D. Tinsley <pdt at jackhammer.org>
  * Bret McDanel <trixter AT 0xdecafbad.com>
+ * Marcel Barbulescu <marcelbarbulescu at gmail.com>
  *
  *
  * mod_sofia.h -- SOFIA SIP Endpoint
@@ -159,7 +160,8 @@
 	REG_STATE_REGISTER,
 	REG_STATE_REGED,
 	REG_STATE_FAILED,
-	REG_STATE_EXPIRED
+	REG_STATE_EXPIRED,
+	REG_STATE_NOREG
 } reg_state_t;
 
 struct outbound_reg {

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	Fri Apr  6 23:04:46 2007
@@ -27,6 +27,7 @@
  * Ken Rice, Asteria Solutions Group, Inc <ken at asteriasgi.com>
  * Paul D. Tinsley <pdt at jackhammer.org>
  * Bret McDanel <trixter AT 0xdecafbad.com>
+ * Marcel Barbulescu <marcelbarbulescu at gmail.com>
  *
  *
  * sofia.c -- SOFIA SIP Endpoint (sofia code)
@@ -668,7 +669,7 @@
 						}
 
 						if ((gateway = switch_core_alloc(profile->pool, sizeof(*gateway)))) {
-							char *scheme = "Digest",
+							char *register_str = "true", *scheme = "Digest",
 								*realm = NULL,
 								*username = NULL, *password = NULL, *extension = NULL, *proxy = NULL, *context = "default", *expire_seconds = "3600";
 
@@ -682,7 +683,9 @@
 								char *var = (char *) switch_xml_attr_soft(param, "name");
 								char *val = (char *) switch_xml_attr_soft(param, "value");
 
-								if (!strcmp(var, "scheme")) {
+								if (!strcmp(var, "register")) {
+									register_str = val;
+								} else if (!strcmp(var, "scheme")) {
 									scheme = val;
 								} else if (!strcmp(var, "realm")) {
 									realm = val;
@@ -725,6 +728,9 @@
 								proxy = realm;
 							}
 
+							if (!switch_true(register_str)) {
+								gateway->state = REG_STATE_NOREG;
+							}
 							gateway->register_scheme = switch_core_strdup(gateway->pool, scheme);
 							gateway->register_context = switch_core_strdup(gateway->pool, context);
 							gateway->register_realm = switch_core_strdup(gateway->pool, realm);

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c	Fri Apr  6 23:04:46 2007
@@ -27,6 +27,7 @@
  * Ken Rice, Asteria Solutions Group, Inc <ken at asteriasgi.com>
  * Paul D. Tinsley <pdt at jackhammer.org>
  * Bret McDanel <trixter AT 0xdecafbad.com>
+ * Marcel Barbulescu <marcelbarbulescu at gmail.com>
  *
  *
  * sofia_ref.c -- SOFIA SIP Endpoint (registration code)
@@ -56,6 +57,8 @@
 		reg_state_t ostate = gateway_ptr->state;
 
 		switch (ostate) {
+		case REG_STATE_NOREG:
+			break;
 		case REG_STATE_REGISTER:
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "registered %s\n", gateway_ptr->name);
 			gateway_ptr->expires = now + gateway_ptr->freq;



More information about the Freeswitch-svn mailing list