[Freeswitch-trunk] [commit] r3872 - freeswitch/trunk/src/mod/endpoints/mod_iax
Freeswitch SVN
anthm at freeswitch.org
Sat Dec 30 12:22:18 EST 2006
Author: anthm
Date: Sat Dec 30 12:22:17 2006
New Revision: 3872
Modified:
freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c
Log:
add break to iax
Modified: freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c Sat Dec 30 12:22:17 2006
@@ -56,7 +56,8 @@
TFLAG_VOICE = (1 << 4),
TFLAG_HANGUP = (1 << 5),
TFLAG_LINEAR = (1 << 6),
- TFLAG_CODEC = (1 << 7)
+ TFLAG_CODEC = (1 << 7),
+ TFLAG_BREAK = (1 << 8)
} TFLAGS;
typedef enum {
@@ -573,6 +574,9 @@
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
//switch_thread_cond_signal(tech_pvt->cond);
break;
+ case SWITCH_SIG_BREAK:
+ switch_set_flag_locked(tech_pvt, TFLAG_BREAK);
+ break;
default:
break;
}
@@ -644,10 +648,19 @@
tech_pvt = switch_core_session_get_private(session);
assert(tech_pvt != NULL);
-
-
+ tech_pvt->read_frame.flags = SFF_NONE;
+
while (switch_test_flag(tech_pvt, TFLAG_IO)) {
//switch_thread_cond_wait(tech_pvt->cond, tech_pvt->mutex);
+ if (switch_test_flag_locked(tech_pvt, TFLAG_BREAK)) {
+ switch_clear_flag(tech_pvt, TFLAG_BREAK);
+ tech_pvt->read_frame.datalen = 13;
+ memset(tech_pvt->read_frame.data, 0, 13);
+ tech_pvt->read_frame.flags = SFF_CNG;
+ *frame = &tech_pvt->read_frame;
+ return SWITCH_STATUS_SUCCESS;
+ }
+
if (!switch_test_flag(tech_pvt, TFLAG_IO)) {
return SWITCH_STATUS_FALSE;
}
More information about the Freeswitch-trunk
mailing list