Revision
15020
Author
gmaruzz
Date
2009-09-30 07:37:02 -0500 (Wed, 30 Sep 2009)

Log Message

celliax: beginning configuration file parsing

Modified Paths

Diff

Modified: freeswitch/branches/gmaruzz/mod_celliax/mod_celliax.c (15019 => 15020)


--- freeswitch/branches/gmaruzz/mod_celliax/mod_celliax.c	2009-09-30 12:25:28 UTC (rev 15019)
+++ freeswitch/branches/gmaruzz/mod_celliax/mod_celliax.c	2009-09-30 12:37:02 UTC (rev 15020)
@@ -177,8 +177,8 @@
 SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan);
 SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_context, globals.context);
 SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_destination, globals.destination);
-SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_string, globals.codec_string);
-SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_rates_string, globals.codec_rates_string);
+//SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_string, globals.codec_string);
+//SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_rates_string, globals.codec_rates_string);
 
 /* BEGIN: Changes here */
 static switch_status_t interface_exists(char *the_interface);
@@ -1132,14 +1132,6 @@
 			} else if (!strcasecmp(var, "hold-music")) {
 				switch_set_string(globals.hold_music, val);
 				DEBUGA_CELLIAX("globals.hold_music=%s\n", CELLIAX_P_LOG, globals.hold_music);
-			} else if (!strcmp(var, "port")) {
-				globals.port = atoi(val);
-				DEBUGA_CELLIAX("globals.port=%d\n", CELLIAX_P_LOG, globals.port);
-			} else if (!strcmp(var, "codec-master")) {
-				if (!strcasecmp(val, "us")) {
-					switch_set_flag(&globals, GFLAG_MY_CODEC_PREFS);
-				}
-				DEBUGA_CELLIAX("codec-master globals.debug=%d\n", CELLIAX_P_LOG, globals.debug);
 			} else if (!strcmp(var, "dialplan")) {
 				set_global_dialplan(val);
 				DEBUGA_CELLIAX("globals.dialplan=%s\n", CELLIAX_P_LOG, globals.dialplan);
@@ -1149,6 +1141,16 @@
 			} else if (!strcmp(var, "context")) {
 				set_global_context(val);
 				DEBUGA_CELLIAX("globals.context=%s\n", CELLIAX_P_LOG, globals.context);
+
+/*
+			} else if (!strcmp(var, "port")) {
+				globals.port = atoi(val);
+				DEBUGA_CELLIAX("globals.port=%d\n", CELLIAX_P_LOG, globals.port);
+			} else if (!strcmp(var, "codec-master")) {
+				if (!strcasecmp(val, "us")) {
+					switch_set_flag(&globals, GFLAG_MY_CODEC_PREFS);
+				}
+				DEBUGA_CELLIAX("codec-master globals.debug=%d\n", CELLIAX_P_LOG, globals.debug);
 			} else if (!strcmp(var, "codec-prefs")) {
 				set_global_codec_string(val);
 				DEBUGA_CELLIAX("globals.codec_string=%s\n", CELLIAX_P_LOG, globals.codec_string);
@@ -1157,6 +1159,7 @@
 				set_global_codec_rates_string(val);
 				DEBUGA_CELLIAX("globals.codec_rates_string=%s\n", CELLIAX_P_LOG, globals.codec_rates_string);
 				globals.codec_rates_last = switch_separate_string(globals.codec_rates_string, ',', globals.codec_rates, SWITCH_MAX_CODECS);
+*/
 			}
 
 		}
@@ -1179,10 +1182,10 @@
 			char *hold_music = NULL;
 			char *fail_dial_regex = NULL;
 			char *enable_callerid = "true";
-			char *X11_display = NULL;
-			char *tcp_cli_port = NULL;
-			char *tcp_srv_port = NULL;
-			char *celliax_user = NULL;
+			//char *X11_display = NULL;
+			//char *tcp_cli_port = NULL;
+			//char *tcp_srv_port = NULL;
+			//char *celliax_user = NULL;
 
 			uint32_t interface_id = 0, to = 0, max = 0;
 			uint32_t controldevice_speed = B115200;
@@ -1212,6 +1215,7 @@
 					fail_dial_regex = val;
 				} else if (!strcasecmp(var, "hold-music")) {
 					hold_music = val;
+/*
 				} else if (!strcasecmp(var, "celliax_user")) {
 					celliax_user = val;
 				} else if (!strcasecmp(var, "tcp_cli_port")) {
@@ -1220,6 +1224,7 @@
 					tcp_srv_port = val;
 				} else if (!strcasecmp(var, "X11-display") || !strcasecmp(var, "X11_display")) {
 					X11_display = val;
+*/
 				} else if (!strcasecmp(var, "max_digits") || !strcasecmp(var, "max-digits")) {
 					max_digits = val;
 				} else if (!strcasecmp(var, "hotline")) {
@@ -1227,10 +1232,12 @@
 				}
 
 			}
+/*
 			if (!celliax_user) {
 				ERRORA("interface missing REQUIRED param 'celliax_user'\n", CELLIAX_P_LOG);
 				continue;
 			}
+*/
 
 			/* BEGIN: Changes here */
 			if (reload_type == SOFT_RELOAD) {
@@ -1243,6 +1250,7 @@
 			}
 			/* END: Changes here */
 
+/*
 			if (!X11_display) {
 				ERRORA("interface missing REQUIRED param 'X11_display'\n", CELLIAX_P_LOG);
 				continue;
@@ -1256,6 +1264,7 @@
 				ERRORA("interface missing REQUIRED param 'tcp_srv_port'\n", CELLIAX_P_LOG);
 				continue;
 			}
+*/
 			if (!id) {
 				ERRORA("interface missing REQUIRED param 'id'\n", CELLIAX_P_LOG);
 				continue;
@@ -1306,6 +1315,7 @@
 					switch_set_string(globals.CELLIAX_INTERFACES[interface_id].name, "N/A");
 				}
 				DEBUGA_CELLIAX("CONFIGURING interface_id=%d\n", CELLIAX_P_LOG, interface_id);
+#if 0
 #ifdef WIN32
 				globals.CELLIAX_INTERFACES[interface_id].tcp_cli_port = (unsigned short) atoi(tcp_cli_port);
 				globals.CELLIAX_INTERFACES[interface_id].tcp_srv_port = (unsigned short) atoi(tcp_srv_port);
@@ -1315,6 +1325,7 @@
 #endif /* WIN32 */
 				switch_set_string(globals.CELLIAX_INTERFACES[interface_id].X11_display, X11_display);
 				switch_set_string(globals.CELLIAX_INTERFACES[interface_id].celliax_user, celliax_user);
+#endif //0
 				switch_set_string(globals.CELLIAX_INTERFACES[interface_id].context, context);
 				switch_set_string(globals.CELLIAX_INTERFACES[interface_id].dialplan, dialplan);
 				switch_set_string(globals.CELLIAX_INTERFACES[interface_id].destination, destination);
@@ -1401,6 +1412,7 @@
 				celliax_store_boost("5", &globals.CELLIAX_INTERFACES[interface_id].capture_boost);
 				celliax_store_boost("10", &globals.CELLIAX_INTERFACES[interface_id].playback_boost);
 /*********************/
+/*
 				DEBUGA_CELLIAX
 					("interface_id=%d globals.CELLIAX_INTERFACES[interface_id].X11_display=%s\n",
 					 CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].X11_display);
@@ -1413,12 +1425,10 @@
 				DEBUGA_CELLIAX
 					("interface_id=%d globals.CELLIAX_INTERFACES[interface_id].tcp_srv_port=%d\n",
 					 CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].tcp_srv_port);
+*/
 				DEBUGA_CELLIAX("interface_id=%d globals.CELLIAX_INTERFACES[interface_id].name=%s\n",
 							   CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].name);
 				DEBUGA_CELLIAX
-					("interface_id=%d globals.CELLIAX_INTERFACES[interface_id].context=%s\n",
-					 CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].context);
-				DEBUGA_CELLIAX
 					("interface_id=%d globals.CELLIAX_INTERFACES[interface_id].dialplan=%s\n",
 					 CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].dialplan);
 				DEBUGA_CELLIAX
@@ -1483,12 +1493,10 @@
 				tech_pvt = &globals.CELLIAX_INTERFACES[i];
 
 				DEBUGA_CELLIAX("i=%d globals.CELLIAX_INTERFACES[%d].interface_id=%s\n", CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].interface_id);
-				DEBUGA_CELLIAX("i=%d globals.CELLIAX_INTERFACES[%d].X11_display=%s\n", CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].X11_display);
 				DEBUGA_CELLIAX("i=%d globals.CELLIAX_INTERFACES[%d].name=%s\n", CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].name);
 				DEBUGA_CELLIAX("i=%d globals.CELLIAX_INTERFACES[%d].context=%s\n", CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].context);
 				DEBUGA_CELLIAX("i=%d globals.CELLIAX_INTERFACES[%d].dialplan=%s\n", CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].dialplan);
 				DEBUGA_CELLIAX("i=%d globals.CELLIAX_INTERFACES[%d].destination=%s\n", CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].destination);
-				DEBUGA_CELLIAX("i=%d globals.CELLIAX_INTERFACES[%d].context=%s\n", CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].context);
 			}
 		}
 	}