[Freeswitch-branches] [commit] r10266 - in freeswitch/branches/gmaruzz: src/mod/endpoints/mod_skypiax stuff

Freeswitch SVN gmaruzz at freeswitch.org
Fri Nov 7 11:40:42 PST 2008


Author: gmaruzz
Date: Thu Nov  6 05:31:25 2008
New Revision: 10266

Modified:
   freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c
   freeswitch/branches/gmaruzz/stuff/skypiax.conf.xml

Log:
skypiax: continue to parse nested configuration, eg: multiple interfaces

Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c	Thu Nov  6 05:31:25 2008
@@ -2688,7 +2688,7 @@
 				if (!strcasecmp(val, "us")) {
 					switch_set_flag(&globals, GFLAG_MY_CODEC_PREFS);
 				}
-				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "globals.debug=%d\n", globals.debug);
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "codec-master globals.debug=%d\n", globals.debug);
 			} else if (!strcmp(var, "dialplan")) {
 				set_global_dialplan(val);
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "globals.dialplan=%s\n", globals.dialplan);
@@ -2709,7 +2709,6 @@
 		for (myspan = switch_xml_child(spans, "span"); myspan; myspan = myspan->next) {
 			char *id = (char *) switch_xml_attr(myspan, "id");
 			char *name = (char *) switch_xml_attr(myspan, "name");
-			//FIXME zap_status_t zstatus = ZAP_FAIL;
 			char *context = "default";
 			char *dialplan = "XML";
 			char *tonegroup = NULL;
@@ -2722,8 +2721,6 @@
 			char *enable_callerid = "true";
 
 			uint32_t span_id = 0, to = 0, max = 0;
-			//FIXME zap_span_t *span = NULL;
-			//analog_option_t analog_options = ANALOG_OPTION_NONE;
 			
 			for (param = switch_xml_child(myspan, "param"); param; param = param->next) {
 				char *var = (char *) switch_xml_attr_soft(param, "name");
@@ -2754,7 +2751,7 @@
 			}
 				
 			if (!id && !name) {
-				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "span missing required param 'id'\n");
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "span missing BOTH required param 'id' AND 'name'\n");
 				continue;
 			}
 
@@ -2773,28 +2770,24 @@
 			}
 
 			if (name) {
-				//FIXME zstatus = zap_span_find_by_name(name, &span);
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "name=%s\n", name);
 			} else {
 				if (switch_is_number(id)) {
 					span_id = atoi(id);
-					//FIXME zstatus = zap_span_find(span_id, &span);
+					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "span_id=%d\n", span_id);
 				}
-
-				//FIXME if (zstatus != ZAP_SUCCESS) {
-					//FIXME zstatus = zap_span_find_by_name(id, &span);
-				//FIXME }
 			}
 
-			//FIXME if (zstatus != ZAP_SUCCESS) {
-				//FIXME zap_log(ZAP_LOG_ERROR, "Error finding Skypiax span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name));
-				//FIXME continue;
-			//FIXME }
+//FIXME 
+			/*
+			if (zstatus != ZAP_SUCCESS) {
+				zap_log(ZAP_LOG_ERROR, "Error finding Skypiax span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name));
+				continue;
+			}
 			
 			if (!span_id) {
-				//FIXME span_id = span->span_id;
+				span_id = span->span_id;
 			}
-//FIXME 
-			/*
 			if (zap_configure_span("analog", span, on_analog_signal, 
 								   "tonemap", tonegroup, 
 								   "digit_timeout", &to,
@@ -2809,7 +2802,6 @@
 			SPAN_CONFIG[span->span_id].span = span;
 			switch_set_string(SPAN_CONFIG[span->span_id].context, context);
 			switch_set_string(SPAN_CONFIG[span->span_id].dialplan, dialplan);
-			//SPAN_CONFIG[span->span_id].analog_options = analog_options | globals.analog_options;
 			
 			if (dial_regex) {
 				switch_set_string(SPAN_CONFIG[span->span_id].dial_regex, dial_regex);

Modified: freeswitch/branches/gmaruzz/stuff/skypiax.conf.xml
==============================================================================
--- freeswitch/branches/gmaruzz/stuff/skypiax.conf.xml	(original)
+++ freeswitch/branches/gmaruzz/stuff/skypiax.conf.xml	Thu Nov  6 05:31:25 2008
@@ -1,5 +1,4 @@
-
-<configuration name="skypiax.conf" description="Skype Endpoint">
+<configuration name="skypiax.conf" description="Skypiax Configuration">
   <settings>
     <param name="debug" value="8"/>
     <param name="port" value="4569"/>
@@ -8,39 +7,31 @@
     <param name="dialplan" value="default"/>
     <param name="codec-prefs" value="gsm,ulaw"/>
     <param name="codec-rates" value="8000,16000"/>
-
-	<!-- PORTAUDIO BEGINS -->
-    <!-- indev, outdev, ringdev: 
-	 partial case sensitive string match on something in the name 
-	 or the device number prefixed with # eg "#1" (or blank for default) -->
-
-    <!-- device to use for input -->
-    <param name="indev" value="#7"/>
-    <!-- device to use for output -->
-    <param name="outdev" value="#7"/>
-
-    <!--device to use for inbound ring -->
-    <param name="ringdev" value="#7"/>
-    <!--File to play as the ring sound -->
-    <!--<param name="ring-file" value="/sounds/ring.wav"/>-->
-    <!--Number of seconds to pause between rings -->
-    <!--<param name="ring-interval" value="5"/>-->
-
-    <!--file to play when calls are on hold-->
-    <!--<param name="hold-file" value="/sounds/holdmusic.wav"/>-->
-    <!--Timer to use for hold music (i'd leave this one commented)-->
-    <!--<param name="timer-name" value="soft"/>-->
-
-    <!--Default dialplan and caller-id info -->
-	<!--
-    <param name="dialplan" value="XML"/>
-	-->
-    <param name="cid-name" value="$${outbound_caller_name}"/>
-    <param name="cid-num" value="$${outbound_caller_id}"/>
-
-    <!--audio sample rate and interval -->
-    <param name="sample-rate" value="8000"/>
-    <param name="codec-ms" value="20"/>
-	<!-- PORTAUDIO ENDS -->
+    <param name="hold-music" value="$${moh_uri}"/>
   </settings>
+  <!-- one entry here per skypiax span -->
+  <analog_spans>
+    <span id="1">
+      <param name="hold-music" value="$${moh_uri}"/>
+      <param name="tonegroup" value="us"/>
+      <param name="digit-timeout" value="2000"/>
+      <param name="max-digits" value="11"/>
+      <param name="dialplan" value="XML"/>
+      <param name="context" value="default"/>
+      <param name="enable-callerid" value="true"/>
+	  <param name="dial-regex" value="9996"/> 
+	  <param name="dial-regex-fail" value="9996"/>
+    </span>
+    <span id="2">
+      <param name="hold-music" value="$${moh_uri}"/>
+      <param name="tonegroup" value="us"/>
+      <param name="digit-timeout" value="2000"/>
+      <param name="max-digits" value="11"/>
+      <param name="dialplan" value="XML"/>
+      <param name="context" value="default"/>
+      <param name="enable-callerid" value="true"/>
+	  <param name="dial-regex" value="9996"/> 
+	  <param name="dial-regex-fail" value="9996"/>
+    </span>
+  </analog_spans>
 </configuration>



More information about the Freeswitch-branches mailing list