[Freeswitch-branches] [commit] r11345 - freeswitch/branches/ctrix/mod_airpe

FreeSWITCH SVN ctrix at freeswitch.org
Wed Jan 21 16:02:16 PST 2009


Author: ctrix
Date: Wed Jan 21 18:02:15 2009
New Revision: 11345

Log:
other fixes for airpe

Modified:
   freeswitch/branches/ctrix/mod_airpe/airpe_if_common.c
   freeswitch/branches/ctrix/mod_airpe/mod_airpe.c
   freeswitch/branches/ctrix/mod_airpe/mod_airpe.h

Modified: freeswitch/branches/ctrix/mod_airpe/airpe_if_common.c
==============================================================================
--- freeswitch/branches/ctrix/mod_airpe/airpe_if_common.c	(original)
+++ freeswitch/branches/ctrix/mod_airpe/airpe_if_common.c	Wed Jan 21 18:02:15 2009
@@ -255,13 +255,13 @@
     assert(pvt->session);
     assert(pvt->airpe);
 
-    if ( !switch_test_flag(pvt, TFLAG_IO) )
+    if ( !switch_test_flag(pvt, TFLAG_IO) ) {
 	return SWITCH_STATUS_SUCCESS;
+    }
 
     airpe = pvt->airpe;
     pool = switch_core_session_get_pool(pvt->session);
 
-
     if ( !airpe->audio_in_active_socket ) {
 	rv = switch_socket_accept(&inbound_socket, airpe->audio_in_socket, pool);
         if ( rv == SWITCH_STATUS_SUCCESS ) {
@@ -275,6 +275,7 @@
 
     mbuf = frame->data;
     mlen = frame->datalen;
+
     rv = switch_socket_send(airpe->audio_in_active_socket, mbuf, &mlen);
 
     return rv;
@@ -295,8 +296,9 @@
     airpe = pvt->airpe;
     pool = switch_core_session_get_pool(pvt->session);
 
-    if ( !switch_test_flag(pvt, TFLAG_IO) )
+    if ( !switch_test_flag(pvt, TFLAG_IO) ) {
 	return SWITCH_STATUS_SUCCESS;
+    }
 
     if ( !airpe->audio_out_active_socket ) {
 	rv = switch_socket_accept(&inbound_socket, airpe->audio_out_socket, pool);
@@ -317,6 +319,7 @@
     if ( (rv==SWITCH_STATUS_SUCCESS) ) {
 	    pvt->read_frame.datalen = mlen;
     }
+
     return rv;
 }
 
@@ -470,15 +473,14 @@
 		airpe_cmd_write(airpe, buf);
 		airpe_cmd_write(airpe, "PING");
 	        switch_set_flag(airpe->tech_pvt, TFLAG_IO);
-
+/*
 		snprintf(buf, sizeof(buf), "ALTER CALL %d STOP_VIDEO_SEND", callid );
 		airpe_cmd_write(airpe, buf);
 		snprintf(buf, sizeof(buf), "ALTER CALL %d STOP_VIDEO_RECEIVE", callid );
 		airpe_cmd_write(airpe, buf);
-
-	        switch_channel_answer(channel);
+*/
+	        switch_channel_mark_answered(channel);
 	    }
-
 	}
 	else if ( !strncmp(status, "FINISHED", strlen("FINISHED")) ) {
 	    if ( channel )

Modified: freeswitch/branches/ctrix/mod_airpe/mod_airpe.c
==============================================================================
--- freeswitch/branches/ctrix/mod_airpe/mod_airpe.c	(original)
+++ freeswitch/branches/ctrix/mod_airpe/mod_airpe.c	Wed Jan 21 18:02:15 2009
@@ -443,8 +443,8 @@
     assert(tech_pvt);
 
     tech_pvt->read_frame.flags = SFF_NONE;
-    *frame = NULL;
 
+    *frame = NULL;
     if ( airpe_audio_read(tech_pvt) != SWITCH_STATUS_SUCCESS) {
 /*
 	if ( tech_pvt->airpe->debug )
@@ -471,9 +471,9 @@
     return SWITCH_STATUS_SUCCESS;
 }
 
-static switch_status_t channel_write_frame(switch_core_session_t * session,
-                                           switch_frame_t * frame, 
-					    switch_io_flag_t flags,
+static switch_status_t channel_write_frame(switch_core_session_t *session,
+                                           switch_frame_t *frame, 
+					   switch_io_flag_t flags,
                                            int stream_id)
 {
     switch_channel_t *channel = NULL;
@@ -489,7 +489,6 @@
 
     if ( !tech_pvt->airpe ) {
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "airpe_audio_write ERROR: no client\n");
-	return SWITCH_STATUS_FALSE;
     }
 
     airpe = tech_pvt->airpe;

Modified: freeswitch/branches/ctrix/mod_airpe/mod_airpe.h
==============================================================================
--- freeswitch/branches/ctrix/mod_airpe/mod_airpe.h	(original)
+++ freeswitch/branches/ctrix/mod_airpe/mod_airpe.h	Wed Jan 21 18:02:15 2009
@@ -39,7 +39,7 @@
 #define SKYPE_MSG_LEN	1024
 
 #define CODEC_SAMPLE_RATE	16000
-#define CODEC_INTERVAL_MS	20
+#define CODEC_INTERVAL_MS	10
 #define FRAMES_PER_SECOND	1000 / CODEC_INTERVAL_MS
 #define	SAMPLES_PER_FRAME	CODEC_SAMPLE_RATE / FRAMES_PER_SECOND
 



More information about the Freeswitch-branches mailing list