[Freeswitch-branches] [commit] r11442 - in freeswitch/branches/1.0: build conf src/mod/applications/mod_dptools src/mod/applications/mod_fax src/mod/applications/mod_fifo src/mod/applications/mod_limit src/mod/applications/mod_soundtouch src/mod/applications/mod_voicemail src/mod/asr_tts/mod_pocketsphinx src/mod/formats/mod_shout

FreeSWITCH SVN mikej at freeswitch.org
Thu Jan 22 16:05:16 PST 2009


Author: mikej
Date: Thu Jan 22 18:05:15 2009
New Revision: 11442

Log:


Modified:
   freeswitch/branches/1.0/build/Makefile
   freeswitch/branches/1.0/conf/vars.xml
   freeswitch/branches/1.0/src/mod/applications/mod_dptools/mod_dptools.c
   freeswitch/branches/1.0/src/mod/applications/mod_fax/mod_fax.c
   freeswitch/branches/1.0/src/mod/applications/mod_fifo/mod_fifo.c
   freeswitch/branches/1.0/src/mod/applications/mod_limit/mod_limit.c
   freeswitch/branches/1.0/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp
   freeswitch/branches/1.0/src/mod/applications/mod_voicemail/mod_voicemail.c
   freeswitch/branches/1.0/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c
   freeswitch/branches/1.0/src/mod/formats/mod_shout/mod_shout.c

Modified: freeswitch/branches/1.0/build/Makefile
==============================================================================
--- freeswitch/branches/1.0/build/Makefile	(original)
+++ freeswitch/branches/1.0/build/Makefile	Thu Jan 22 18:05:15 2009
@@ -14,6 +14,9 @@
 	@echo " +       (uhd-sounds includes hd-sounds, sounds) +"
 	@echo " +       (hd-sounds includes sounds)             +"
 	@echo " +       ------------------------------------    +"
+	@echo " +               $(MAKE) cd-sounds-install          +"  
+	@echo " +               $(MAKE) cd-moh-install             +"  
+	@echo " +                                               +"
 	@echo " +               $(MAKE) uhd-sounds-install         +"  
 	@echo " +               $(MAKE) uhd-moh-install            +"  
 	@echo " +                                               +"

Modified: freeswitch/branches/1.0/conf/vars.xml
==============================================================================
--- freeswitch/branches/1.0/conf/vars.xml	(original)
+++ freeswitch/branches/1.0/conf/vars.xml	Thu Jan 22 18:05:15 2009
@@ -11,11 +11,12 @@
   -->
   <X-PRE-PROCESS cmd="set" data="domain=$${local_ip_v4}"/>
   <X-PRE-PROCESS cmd="set" data="hold_music=local_stream://moh"/>
-  <!-- xmpp_client_profile and xmpp_server_profile
-       xmpp_client_profile can be any string. 
-       xmpp_server_profile is appended to "dingaling_" to form the database name
-       containing the "subscriptions" table.
-       used by: dingaling.conf.xml enum.conf.xml 
+  <!--
+      xmpp_client_profile and xmpp_server_profile
+      xmpp_client_profile can be any string. 
+      xmpp_server_profile is appended to "dingaling_" to form the database name
+      containing the "subscriptions" table.
+      used by: dingaling.conf.xml enum.conf.xml 
   --> 
   <!-- 
        Examples of codec options: (module must be compiled and loaded)
@@ -71,7 +72,11 @@
   <X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=PCMU,PCMA,GSM"/>
   <X-PRE-PROCESS cmd="set" data="xmpp_client_profile=xmppc"/>
   <X-PRE-PROCESS cmd="set" data="xmpp_server_profile=xmpps"/>
-  <!-- bind_server_ip
+  <!-- 
+       THIS IS ONLY USED FOR DINGALING
+
+       bind_server_ip
+
        Can be an ip address, a dns name, or "auto". 
        This determines an ip address available on this host to bind.
        If you are separating RTP and SIP traffic, you will want to have

Modified: freeswitch/branches/1.0/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/branches/1.0/src/mod/applications/mod_dptools/mod_dptools.c	(original)
+++ freeswitch/branches/1.0/src/mod/applications/mod_dptools/mod_dptools.c	Thu Jan 22 18:05:15 2009
@@ -603,14 +603,14 @@
 SWITCH_STANDARD_APP(presence_function)
 {
 	char *argv[6] = { 0 };
-    int argc;
-    char *mydata = NULL;
+	int argc;
+	char *mydata = NULL;
 	switch_channel_t *channel = switch_core_session_get_channel(session);
 
 	if (switch_strlen_zero(data) || !(mydata = switch_core_session_strdup(session, data))) {
-        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "INVALID ARGS!\n");
-        return;
-    }
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "INVALID ARGS!\n");
+		return;
+	}
 
 	if ((argc = switch_separate_string(mydata, ' ', argv, sizeof(argv) / sizeof(argv[0]))) < 2) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "INVALID ARGS!\n");
@@ -2105,7 +2105,7 @@
 	}
 
 
- done:
+  done:
 
 	if (dest && dest != template) {
 		switch_safe_free(dest);

Modified: freeswitch/branches/1.0/src/mod/applications/mod_fax/mod_fax.c
==============================================================================
--- freeswitch/branches/1.0/src/mod/applications/mod_fax/mod_fax.c	(original)
+++ freeswitch/branches/1.0/src/mod/applications/mod_fax/mod_fax.c	Thu Jan 22 18:05:15 2009
@@ -89,7 +89,7 @@
 
 	/* UNUSED AT THE MOMENT
 	   int          enable_t38_reinvite;
-    */
+	*/
 
 };
 
@@ -131,7 +131,7 @@
 
 	if (!switch_strlen_zero(msg)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, fs_log_level, "%s", msg);
-    }
+	}
 }
 
 /*
@@ -149,7 +149,7 @@
 
 	pvt = (pvt_t *) user_data;
 	switch_assert(pvt);
-    
+	
 	session = pvt->session;
 	switch_assert(session);
 
@@ -166,11 +166,11 @@
 
 		if (pvt->app_mode == FUNCTION_TX) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Fax successfully sent.\n");
-        } else if (pvt->app_mode == FUNCTION_RX) {
+		} else if (pvt->app_mode == FUNCTION_RX) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Fax successfully received.\n");
-        } else {
+		} else {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Fax successfully managed. How ?\n");
-        }
+		}
 		switch_channel_set_variable(channel, "fax_success", "1");
 	} else {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Fax processing not successful - result (%d) %s.\n", result,
@@ -193,8 +193,8 @@
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "==============================================================================\n");
 
 	/*
-      Set our channel variables
-    */
+	Set our channel variables
+	*/
 
 	tmp = switch_mprintf("%i", result);
 	if (tmp) {
@@ -244,11 +244,11 @@
 		switch_safe_free(tmp);
 	}
 
-    switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
+switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
 
 	/*
-      TODO Fire events
-    */
+	TODO Fire events
+	*/
 }
 
 static switch_status_t spanfax_init(pvt_t * pvt, transport_mode_t trans_mode)
@@ -272,10 +272,10 @@
 			pvt->fax_state = (fax_state_t *) switch_core_session_alloc(pvt->session, sizeof(fax_state_t));
 		} else {
 			return SWITCH_STATUS_FALSE;
-        }
+		}
 
 		fax = pvt->fax_state;
-        t30 = fax_get_t30_state(fax);
+		t30 = fax_get_t30_state(fax);
 
 		memset(fax, 0, sizeof(fax_state_t));
 		if (fax_init(fax, pvt->caller) == NULL) {
@@ -335,7 +335,7 @@
 		   Here goes the T.38 SpanDSP initializing functions 
 		   T.38 will require a big effort as it needs a different approach
 		   but the pieces are already in place
-        */
+		*/
 	default:
 		assert(0);				/* Whaaat ? */
 		break;
@@ -352,14 +352,14 @@
 	if (pvt->fax_state) {
 		if (pvt->t38_state) {
 			terminate = 0;
-        } else {
+		} else {
 			terminate = 1;
-        }
+		}
 
-        t30 = fax_get_t30_state(pvt->fax_state);
+		t30 = fax_get_t30_state(pvt->fax_state);
 		if (terminate && t30) {
 			t30_terminate(t30);
-        }
+		}
 
 		fax_release(pvt->fax_state);
 	}
@@ -367,14 +367,14 @@
 	if (pvt->t38_state) {
 		if (pvt->t38_state) {
 			terminate = 1;
-        } else {
+		} else {
 			terminate = 0;
-        }
+		}
 
-        t30 = t38_terminal_get_t30_state(pvt->t38_state);
+		t30 = t38_terminal_get_t30_state(pvt->t38_state);
 		if (terminate && t30) {
 			t30_terminate(t30);
-        }
+		}
 
 		t38_terminal_release(pvt->t38_state);
 	}
@@ -405,10 +405,10 @@
 	channel = switch_core_session_get_channel(session);
 	switch_assert(channel != NULL);
 
-    if (!switch_channel_media_ready(channel)) {
-        switch_channel_answer(channel);
-    }
-    
+	if (!switch_channel_media_ready(channel)) {
+		switch_channel_answer(channel);
+	}
+	
 	/* Allocate our structs */
 	pvt = switch_core_session_alloc(session, sizeof(pvt_t));
 
@@ -428,11 +428,11 @@
 
 		if (pvt->app_mode == FUNCTION_TX) {
 			pvt->caller = 1;
-        } else if (pvt->app_mode == FUNCTION_RX) {
+		} else if (pvt->app_mode == FUNCTION_RX) {
 			pvt->caller = 0;
-        } else {
+		} else {
 			assert(0);			/* UH ? */
-        }
+		}
 	}
 
 
@@ -542,12 +542,12 @@
 	}
 
 	/*
-   *** Initialize the SpanDSP elements ***
+	*** Initialize the SpanDSP elements ***
 
-   Note: we could analyze if a fax was already detected in previous stages
-   and if so, when T.38 will be supported, send a reinvite in T38_MODE,
-   bypassing AUDIO_MODE.
-    */
+	Note: we could analyze if a fax was already detected in previous stages
+	and if so, when T.38 will be supported, send a reinvite in T38_MODE,
+	bypassing AUDIO_MODE.
+	*/
 
 	if ((spanfax_init(pvt, AUDIO_MODE) != SWITCH_STATUS_SUCCESS)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot initialize Fax engine\n");
@@ -557,14 +557,14 @@
 	/* 
 	   Note: Disable echocan on the channel, remember to call app "disable_ec" in the dialplan
 	   before invoking fax applications
-    */
+	*/
 
 	/*
-      Note: we are disabling the Jitterbuffer, here, before we answer.
-      If you have set it to something else and the channel is pre-answered,
-      it will have no effect. Make sure that if you want more reliable
-      faxes, it is disabled.
-    */
+	Note: we are disabling the Jitterbuffer, here, before we answer.
+	If you have set it to something else and the channel is pre-answered,
+	it will have no effect. Make sure that if you want more reliable
+	faxes, it is disabled.
+	*/
 	switch_channel_set_variable(channel, "jitterbuffer_msec", "0");
 
 
@@ -608,8 +608,8 @@
 		goto done;
 	}
 
-    switch_ivr_sleep(session, 250, SWITCH_TRUE, NULL);
-    
+	switch_ivr_sleep(session, 250, SWITCH_TRUE, NULL);
+	
 	while (switch_channel_ready(channel)) {
 		int tx = 0;
 		switch_status_t status;
@@ -623,7 +623,7 @@
 		   - call t38_terminal_send_timeout(), sleep for a while
 
 		   The T.38 stuff can be placed here (and the audio stuff can be skipped)
-        */
+		*/
 
 		/* read new audio frame from the channel */
 		status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0);
@@ -635,12 +635,12 @@
 
 		/* Skip CNG frames (auto-generated by FreeSWITCH, usually) */
 		if (!switch_test_flag(read_frame, SFF_CNG)) {
-            /* pass the new incoming audio frame to the fax_rx function */
-            if (fax_rx(pvt->fax_state, (int16_t *) read_frame->data, read_frame->samples)) {
-                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "fax_rx reported an error\n");
-                goto done;
-            }
-        }
+		/* pass the new incoming audio frame to the fax_rx function */
+			if (fax_rx(pvt->fax_state, (int16_t *) read_frame->data, read_frame->samples)) {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "fax_rx reported an error\n");
+				goto done;
+			}
+		}
 
 		if ((tx = fax_tx(pvt->fax_state, buf, write_codec.implementation->samples_per_packet)) < 0) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "fax_tx reported an error\n");

Modified: freeswitch/branches/1.0/src/mod/applications/mod_fifo/mod_fifo.c
==============================================================================
--- freeswitch/branches/1.0/src/mod/applications/mod_fifo/mod_fifo.c	(original)
+++ freeswitch/branches/1.0/src/mod/applications/mod_fifo/mod_fifo.c	Thu Jan 22 18:05:15 2009
@@ -389,16 +389,16 @@
 {
 	switch_hash_index_t *hi;
 	void *val;
-    const void *var;
+	const void *var;
 	switch_core_session_t *session;
-    switch_channel_t *channel;
+	switch_channel_t *channel;
 	int total = 0;
 
 	switch_mutex_lock(node->mutex);
 	for (hi = switch_hash_first(NULL, node->consumer_hash); hi; hi = switch_hash_next(hi)) {
 		switch_hash_this(hi, &var, NULL, &val);
 		session = (switch_core_session_t *) val;
-        channel = switch_core_session_get_channel(session);
+		channel = switch_core_session_get_channel(session);
 		if (!switch_channel_test_flag(channel, CF_BRIDGED)) {
 			total++;
 		}
@@ -469,7 +469,7 @@
 	switch_channel_set_state(channel, CS_EXECUTE);
 	switch_core_session_rwunlock(session);
 
- end:
+  end:
 
 	switch_core_destroy_memory_pool(&h->pool);
 
@@ -1607,7 +1607,7 @@
 		stream->write_function(stream, "-ERR Usage: %s\n", FIFO_API_SYNTAX);
 	}
 
- done:
+  done:
 
 	switch_mutex_unlock(globals.mutex);
 	return SWITCH_STATUS_SUCCESS;
@@ -1814,7 +1814,7 @@
 	}
 	switch_xml_free(xml);
 
- done:
+  done:
 
 	if (reload) {
 		switch_hash_index_t *hi;
@@ -1863,8 +1863,8 @@
 	
 	sql = switch_mprintf("delete from fifo_outbound where fifo_name='%q' and uuid = '%q'", fifo_name, digest);
 	switch_assert(sql);
-    fifo_execute_sql(sql, globals.sql_mutex);
-    free(sql);
+	fifo_execute_sql(sql, globals.sql_mutex);
+	free(sql);
 	
 	
 	switch_mutex_lock(globals.mutex);
@@ -1895,8 +1895,8 @@
 	
 	sql = switch_mprintf("delete from fifo_outbound where fifo_name='%q' and uuid = '%q' and hostname='%q'", fifo_name, digest, globals.hostname);
 	switch_assert(sql);
-    fifo_execute_sql(sql, globals.sql_mutex);
-    free(sql);
+	fifo_execute_sql(sql, globals.sql_mutex);
+	free(sql);
 }
 
 #define FIFO_MEMBER_API_SYNTAX "[add <fifo_name> <originate_string> [<simo_count>] [<timeout>] [<lag>] | del <fifo_name> <originate_string>]"
@@ -1956,10 +1956,10 @@
 		stream->write_function(stream, "%s", "+OK\n");
 	} else {
 		stream->write_function(stream, "%s", "-ERR Invalid!\n");
-        goto done;
+		goto done;
 	}
 
- done:
+  done:
 
 	free(mydata);
 

Modified: freeswitch/branches/1.0/src/mod/applications/mod_limit/mod_limit.c
==============================================================================
--- freeswitch/branches/1.0/src/mod/applications/mod_limit/mod_limit.c	(original)
+++ freeswitch/branches/1.0/src/mod/applications/mod_limit/mod_limit.c	Thu Jan 22 18:05:15 2009
@@ -767,16 +767,16 @@
 	callback_t cbt = { 0 };
 
 
-    if (!switch_strlen_zero(cmd)) {
-        mydata = strdup(cmd);
-        switch_assert(mydata);
-        argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
-    }
+	if (!switch_strlen_zero(cmd)) {
+		mydata = strdup(cmd);
+		switch_assert(mydata);
+		argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
+	}
 
-    if (argc < 2) {
-        stream->write_function(stream, "USAGE: limit_usage %s\n", LIMIT_USAGE_USAGE);
+	if (argc < 2) {
+		stream->write_function(stream, "USAGE: limit_usage %s\n", LIMIT_USAGE_USAGE);
 		goto end;
-    }
+	}
 
 
 	realm = argv[0];
@@ -788,7 +788,7 @@
 	limit_execute_sql_callback(NULL, sql, sql2str_callback, &cbt);
 	switch_safe_free(sql);
 
-    stream->write_function(stream, "%s", buf);
+	stream->write_function(stream, "%s", buf);
 
 end:
 	switch_safe_free(mydata);

Modified: freeswitch/branches/1.0/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp
==============================================================================
--- freeswitch/branches/1.0/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp	(original)
+++ freeswitch/branches/1.0/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp	Thu Jan 22 18:05:15 2009
@@ -310,7 +310,7 @@
 
 SWITCH_MODULE_LOAD_FUNCTION(mod_soundtouch_load)
 {
-    switch_application_interface_t *app_interface;
+	switch_application_interface_t *app_interface;
 
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = switch_loadable_module_create_module_interface(pool, modname); 

Modified: freeswitch/branches/1.0/src/mod/applications/mod_voicemail/mod_voicemail.c
==============================================================================
--- freeswitch/branches/1.0/src/mod/applications/mod_voicemail/mod_voicemail.c	(original)
+++ freeswitch/branches/1.0/src/mod/applications/mod_voicemail/mod_voicemail.c	Thu Jan 22 18:05:15 2009
@@ -1310,7 +1310,7 @@
 	}
 	ret = tmp_path;
 	
- end:
+  end:
 
 	if (fh) {
 		switch_core_file_close(fh);
@@ -2262,7 +2262,7 @@
 		/*switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Send mail is %d, var is %s\n", send_mail, var);*/
 	}
 
-    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Deliver VM to %s@%s\n", myid, domain_name);
+	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Deliver VM to %s@%s\n", myid, domain_name);
 
 	if (!switch_strlen_zero(vm_storage_dir)) {
 		dir_path = switch_mprintf("%s%s%s", vm_storage_dir, SWITCH_PATH_SEPARATOR, myid);
@@ -2490,7 +2490,7 @@
 		}
 	}
 
- failed:
+  failed:
 
 	switch_event_destroy(&local_event);
 
@@ -2661,7 +2661,7 @@
 		switch_xml_free(xml_root);
 	}
 
- end:
+  end:
 
 	switch_safe_free(dup);
 
@@ -2860,7 +2860,7 @@
 	}
 
 	if (*buf != '\0') {
-greet_key_press:
+  greet_key_press:
 		if (!strcasecmp(buf, profile->main_menu_key)) {
 			voicemail_check_main(session, profile_name, domain_name, id, 0);
 		} else if (!strcasecmp(buf, profile->operator_key) && !switch_strlen_zero(profile->operator_key)) {
@@ -2964,7 +2964,7 @@
 		TRY_CODE(switch_ivr_phrase_macro(session, VM_ACK_MACRO, "deleted", NULL, NULL));
 	}
 
- end:
+  end:
 
 	if (x_domain_root) {
 		switch_xml_free(x_domain_root);

Modified: freeswitch/branches/1.0/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c
==============================================================================
--- freeswitch/branches/1.0/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c	(original)
+++ freeswitch/branches/1.0/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c	Thu Jan 22 18:05:15 2009
@@ -46,7 +46,7 @@
 	char *model8k;
 	char *model16k;
 	uint32_t thresh;
-    uint32_t silence_hits;
+	uint32_t silence_hits;
 	uint32_t listen_hits;
 	int auto_reload;
 	switch_memory_pool_t *pool;
@@ -65,7 +65,7 @@
 	switch_mutex_t *flag_mutex;
 	uint32_t org_silence_hits;
 	uint32_t thresh;
-    uint32_t silence_hits;
+	uint32_t silence_hits;
 	uint32_t listen_hits;
 	uint32_t listening;
 	uint32_t countdown;
@@ -391,7 +391,7 @@
 								 "  <input>%s</input>\n"
 								 "</interpretation>",
 								 ps->grammar, ps->confidence,
- 								 "match", 
+								"match", 
 								 ps->hyp, 
 								 ps->hyp
 								 );

Modified: freeswitch/branches/1.0/src/mod/formats/mod_shout/mod_shout.c
==============================================================================
--- freeswitch/branches/1.0/src/mod/formats/mod_shout/mod_shout.c	(original)
+++ freeswitch/branches/1.0/src/mod/formats/mod_shout/mod_shout.c	Thu Jan 22 18:05:15 2009
@@ -365,7 +365,7 @@
 		}
 	}
 
- end:
+  end:
 	
 	used = switch_buffer_inuse(context->audio_buffer);
 
@@ -378,7 +378,7 @@
 
 	return 0;
 
- error:
+  error:
 	switch_mutex_lock(context->audio_mutex);
 	context->err++;
 	switch_mutex_unlock(context->audio_mutex);



More information about the Freeswitch-branches mailing list