[Freeswitch-svn] [commit] r13028 - in freeswitch/trunk/src: . include mod/endpoints/mod_sofia mod/languages/mod_lua mod/languages/mod_managed mod/languages/mod_managed/managed
FreeSWITCH SVN
anthm at freeswitch.org
Wed Apr 15 08:08:21 PDT 2009
Author: anthm
Date: Wed Apr 15 10:08:21 2009
New Revision: 13028
Log:
change names to protect the ignorant
Modified:
freeswitch/trunk/src/include/switch_types.h
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
freeswitch/trunk/src/mod/languages/mod_lua/freeswitch.i
freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx
freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs
freeswitch/trunk/src/switch_rtp.c
Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h (original)
+++ freeswitch/trunk/src/include/switch_types.h Wed Apr 15 10:08:21 2009
@@ -439,8 +439,8 @@
} switch_rtp_numbers_t;
typedef struct {
- switch_rtp_numbers_t in;
- switch_rtp_numbers_t out;
+ switch_rtp_numbers_t inbound;
+ switch_rtp_numbers_t outbound;
} switch_rtp_stats_t;
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Wed Apr 15 10:08:21 2009
@@ -1702,23 +1702,23 @@
if (stats) {
- add_stat(stats->in.raw_bytes, "in_raw_bytes");
- add_stat(stats->in.media_bytes, "in_media_bytes");
- add_stat(stats->in.packet_count, "in_packet_count");
- add_stat(stats->in.media_packet_count, "in_media_packet_count");
- add_stat(stats->in.skip_packet_count, "in_skip_packet_count");
- add_stat(stats->in.jb_packet_count, "in_jb_packet_count");
- add_stat(stats->in.dtmf_packet_count, "in_dtmf_packet_count");
- add_stat(stats->in.cng_packet_count, "in_cng_packet_count");
- add_stat(stats->in.cng_packet_count, "in_flush_packet_count");
-
- add_stat(stats->out.raw_bytes, "out_raw_bytes");
- add_stat(stats->out.media_bytes, "out_media_bytes");
- add_stat(stats->out.packet_count, "out_packet_count");
- add_stat(stats->out.media_packet_count, "out_media_packet_count");
- add_stat(stats->out.skip_packet_count, "out_skip_packet_count");
- add_stat(stats->out.dtmf_packet_count, "out_dtmf_packet_count");
- add_stat(stats->out.cng_packet_count, "out_cng_packet_count");
+ add_stat(stats->inbound.raw_bytes, "in_raw_bytes");
+ add_stat(stats->inbound.media_bytes, "in_media_bytes");
+ add_stat(stats->inbound.packet_count, "in_packet_count");
+ add_stat(stats->inbound.media_packet_count, "in_media_packet_count");
+ add_stat(stats->inbound.skip_packet_count, "in_skip_packet_count");
+ add_stat(stats->inbound.jb_packet_count, "in_jb_packet_count");
+ add_stat(stats->inbound.dtmf_packet_count, "in_dtmf_packet_count");
+ add_stat(stats->inbound.cng_packet_count, "in_cng_packet_count");
+ add_stat(stats->inbound.cng_packet_count, "in_flush_packet_count");
+
+ add_stat(stats->outbound.raw_bytes, "out_raw_bytes");
+ add_stat(stats->outbound.media_bytes, "out_media_bytes");
+ add_stat(stats->outbound.packet_count, "out_packet_count");
+ add_stat(stats->outbound.media_packet_count, "out_media_packet_count");
+ add_stat(stats->outbound.skip_packet_count, "out_skip_packet_count");
+ add_stat(stats->outbound.dtmf_packet_count, "out_dtmf_packet_count");
+ add_stat(stats->outbound.cng_packet_count, "out_cng_packet_count");
}
}
Modified: freeswitch/trunk/src/mod/languages/mod_lua/freeswitch.i
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_lua/freeswitch.i (original)
+++ freeswitch/trunk/src/mod/languages/mod_lua/freeswitch.i Wed Apr 15 10:08:21 2009
@@ -25,7 +25,44 @@
* build all sorts of c wrappers and lua shadows of the c wrappers.
*/
%include switch_swigable_cpp.h
-%include freeswitch_lua.h
+
+
+namespace LUA {
+class Session : public CoreSession {
+ private:
+ virtual void do_hangup_hook();
+ lua_State *getLUA();
+ lua_State *L;
+ int hh;
+ int mark;
+ public:
+ Session();
+ Session(char *uuid, CoreSession *a_leg = NULL);
+ Session(switch_core_session_t *session);
+ ~Session();
+ virtual void destroy(void);
+
+ virtual bool begin_allow_threads();
+ virtual bool end_allow_threads();
+ virtual void check_hangup_hook();
+
+ virtual switch_status_t run_dtmf_callback(void *input, switch_input_type_t itype);
+ void unsetInputCallback(void);
+ void setInputCallback(char *cbfunc, char *funcargs = NULL);
+ void setHangupHook(char *func, char *arg = NULL);
+ bool ready();
+ int originate(CoreSession *a_leg_session, char *dest, int timeout);
+
+ char *cb_function;
+ char *cb_arg;
+ char *hangup_func_str;
+ char *hangup_func_arg;
+ void setLUA(lua_State *state);
+
+};
+}
+
+
Modified: freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx (original)
+++ freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx Wed Apr 15 10:08:21 2009
@@ -2698,47 +2698,47 @@
}
-SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_stats_t_in_set(void * jarg1, void * jarg2) {
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_stats_t_inbound_set(void * jarg1, void * jarg2) {
switch_rtp_stats_t *arg1 = (switch_rtp_stats_t *) 0 ;
switch_rtp_numbers_t *arg2 = (switch_rtp_numbers_t *) 0 ;
arg1 = (switch_rtp_stats_t *)jarg1;
arg2 = (switch_rtp_numbers_t *)jarg2;
- if (arg1) (arg1)->in = *arg2;
+ if (arg1) (arg1)->inbound = *arg2;
}
-SWIGEXPORT void * SWIGSTDCALL CSharp_switch_rtp_stats_t_in_get(void * jarg1) {
+SWIGEXPORT void * SWIGSTDCALL CSharp_switch_rtp_stats_t_inbound_get(void * jarg1) {
void * jresult ;
switch_rtp_stats_t *arg1 = (switch_rtp_stats_t *) 0 ;
switch_rtp_numbers_t *result = 0 ;
arg1 = (switch_rtp_stats_t *)jarg1;
- result = (switch_rtp_numbers_t *)& ((arg1)->in);
+ result = (switch_rtp_numbers_t *)& ((arg1)->inbound);
jresult = (void *)result;
return jresult;
}
-SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_stats_t_out_set(void * jarg1, void * jarg2) {
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_stats_t_outbound_set(void * jarg1, void * jarg2) {
switch_rtp_stats_t *arg1 = (switch_rtp_stats_t *) 0 ;
switch_rtp_numbers_t *arg2 = (switch_rtp_numbers_t *) 0 ;
arg1 = (switch_rtp_stats_t *)jarg1;
arg2 = (switch_rtp_numbers_t *)jarg2;
- if (arg1) (arg1)->out = *arg2;
+ if (arg1) (arg1)->outbound = *arg2;
}
-SWIGEXPORT void * SWIGSTDCALL CSharp_switch_rtp_stats_t_out_get(void * jarg1) {
+SWIGEXPORT void * SWIGSTDCALL CSharp_switch_rtp_stats_t_outbound_get(void * jarg1) {
void * jresult ;
switch_rtp_stats_t *arg1 = (switch_rtp_stats_t *) 0 ;
switch_rtp_numbers_t *result = 0 ;
arg1 = (switch_rtp_stats_t *)jarg1;
- result = (switch_rtp_numbers_t *)& ((arg1)->out);
+ result = (switch_rtp_numbers_t *)& ((arg1)->outbound);
jresult = (void *)result;
return jresult;
}
Modified: freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs (original)
+++ freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs Wed Apr 15 10:08:21 2009
@@ -5103,17 +5103,17 @@
[DllImport("mod_managed", EntryPoint="CSharp_delete_switch_rtp_numbers_t")]
public static extern void delete_switch_rtp_numbers_t(HandleRef jarg1);
- [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_stats_t_in_set")]
- public static extern void switch_rtp_stats_t_in_set(HandleRef jarg1, HandleRef jarg2);
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_stats_t_inbound_set")]
+ public static extern void switch_rtp_stats_t_inbound_set(HandleRef jarg1, HandleRef jarg2);
- [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_stats_t_in_get")]
- public static extern IntPtr switch_rtp_stats_t_in_get(HandleRef jarg1);
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_stats_t_inbound_get")]
+ public static extern IntPtr switch_rtp_stats_t_inbound_get(HandleRef jarg1);
- [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_stats_t_out_set")]
- public static extern void switch_rtp_stats_t_out_set(HandleRef jarg1, HandleRef jarg2);
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_stats_t_outbound_set")]
+ public static extern void switch_rtp_stats_t_outbound_set(HandleRef jarg1, HandleRef jarg2);
- [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_stats_t_out_get")]
- public static extern IntPtr switch_rtp_stats_t_out_get(HandleRef jarg1);
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_stats_t_outbound_get")]
+ public static extern IntPtr switch_rtp_stats_t_outbound_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_new_switch_rtp_stats_t")]
public static extern IntPtr new_switch_rtp_stats_t();
@@ -23713,23 +23713,23 @@
}
}
- public switch_rtp_numbers_t in {
+ public switch_rtp_numbers_t inbound {
set {
- freeswitchPINVOKE.switch_rtp_stats_t_in_set(swigCPtr, switch_rtp_numbers_t.getCPtr(value));
+ freeswitchPINVOKE.switch_rtp_stats_t_inbound_set(swigCPtr, switch_rtp_numbers_t.getCPtr(value));
}
get {
- IntPtr cPtr = freeswitchPINVOKE.switch_rtp_stats_t_in_get(swigCPtr);
+ IntPtr cPtr = freeswitchPINVOKE.switch_rtp_stats_t_inbound_get(swigCPtr);
switch_rtp_numbers_t ret = (cPtr == IntPtr.Zero) ? null : new switch_rtp_numbers_t(cPtr, false);
return ret;
}
}
- public switch_rtp_numbers_t out {
+ public switch_rtp_numbers_t outbound {
set {
- freeswitchPINVOKE.switch_rtp_stats_t_out_set(swigCPtr, switch_rtp_numbers_t.getCPtr(value));
+ freeswitchPINVOKE.switch_rtp_stats_t_outbound_set(swigCPtr, switch_rtp_numbers_t.getCPtr(value));
}
get {
- IntPtr cPtr = freeswitchPINVOKE.switch_rtp_stats_t_out_get(swigCPtr);
+ IntPtr cPtr = freeswitchPINVOKE.switch_rtp_stats_t_outbound_get(swigCPtr);
switch_rtp_numbers_t ret = (cPtr == IntPtr.Zero) ? null : new switch_rtp_numbers_t(cPtr, false);
return ret;
}
Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c (original)
+++ freeswitch/trunk/src/switch_rtp.c Wed Apr 15 10:08:21 2009
@@ -1251,8 +1251,8 @@
rtp_session->dtmf_data.out_digit_packet, 4, 0,
rtp_session->te, rtp_session->dtmf_data.timestamp_dtmf, &flags);
- rtp_session->stats.out.raw_bytes += wrote;
- rtp_session->stats.out.dtmf_packet_count++;
+ rtp_session->stats.outbound.raw_bytes += wrote;
+ rtp_session->stats.outbound.dtmf_packet_count++;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Send %s packet for [%c] ts=%u dur=%d/%d/%d seq=%d\n",
@@ -1316,8 +1316,8 @@
rtp_session->rtp_bugs & RTP_BUG_CISCO_SKIP_MARK_BIT_2833 ? 0 : 1,
rtp_session->te, rtp_session->dtmf_data.timestamp_dtmf, &flags);
- rtp_session->stats.out.raw_bytes += wrote;
- rtp_session->stats.out.dtmf_packet_count++;
+ rtp_session->stats.outbound.raw_bytes += wrote;
+ rtp_session->stats.outbound.dtmf_packet_count++;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Send start packet for [%c] ts=%u dur=%d/%d/%d seq=%d\n",
rtp_session->dtmf_data.out_digit,
@@ -1361,9 +1361,9 @@
bytes = sizeof(rtp_msg_t);
status = switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock_input, 0, (void *) &rtp_session->recv_msg, &bytes);
if (bytes) {
- rtp_session->stats.in.raw_bytes += bytes;
- rtp_session->stats.in.flush_packet_count++;
- rtp_session->stats.in.packet_count++;
+ rtp_session->stats.inbound.raw_bytes += bytes;
+ rtp_session->stats.inbound.flush_packet_count++;
+ rtp_session->stats.inbound.packet_count++;
}
} else {
break;
@@ -1392,17 +1392,17 @@
status = switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock_input, 0, (void *) &rtp_session->recv_msg, bytes);
if (*bytes) {
- rtp_session->stats.in.raw_bytes += *bytes;
+ rtp_session->stats.inbound.raw_bytes += *bytes;
if (rtp_session->te && rtp_session->recv_msg.header.pt == rtp_session->te) {
- rtp_session->stats.in.dtmf_packet_count++;
+ rtp_session->stats.inbound.dtmf_packet_count++;
} else if (rtp_session->cng_pt && (rtp_session->recv_msg.header.pt == rtp_session->cng_pt || rtp_session->recv_msg.header.pt == 13)) {
- rtp_session->stats.in.cng_packet_count++;
+ rtp_session->stats.inbound.cng_packet_count++;
} else {
- rtp_session->stats.in.media_packet_count++;
- rtp_session->stats.in.media_bytes += *bytes;
+ rtp_session->stats.inbound.media_packet_count++;
+ rtp_session->stats.inbound.media_bytes += *bytes;
}
- rtp_session->stats.in.packet_count++;
+ rtp_session->stats.inbound.packet_count++;
}
if (rtp_session->jb && rtp_session->recv_msg.header.version == 2 && *bytes) {
@@ -1421,7 +1421,7 @@
if (jb_frame->plc) {
*flags |= SFF_PLC;
} else {
- rtp_session->stats.in.jb_packet_count++;
+ rtp_session->stats.inbound.jb_packet_count++;
}
*bytes = jb_frame->dlen + rtp_header_len;
rtp_session->recv_msg.header.ts = htonl(jb_frame->ts);
@@ -1772,7 +1772,7 @@
*flags |= SFF_CNG;
*payload_type = (switch_payload_t) rtp_session->recv_msg.header.pt;
ret = 2 + rtp_header_len;
- rtp_session->stats.in.skip_packet_count++;
+ rtp_session->stats.inbound.skip_packet_count++;
goto end;
}
@@ -2225,14 +2225,14 @@
goto end;
}
- rtp_session->stats.out.raw_bytes += bytes;
- rtp_session->stats.out.packet_count++;
+ rtp_session->stats.outbound.raw_bytes += bytes;
+ rtp_session->stats.outbound.packet_count++;
if (send_msg->header.pt == rtp_session->cng_pt) {
- rtp_session->stats.out.cng_packet_count++;
+ rtp_session->stats.outbound.cng_packet_count++;
} else {
- rtp_session->stats.out.media_packet_count++;
- rtp_session->stats.out.media_bytes += bytes;
+ rtp_session->stats.outbound.media_packet_count++;
+ rtp_session->stats.outbound.media_bytes += bytes;
}
if (rtp_session->timer.interval) {
@@ -2346,10 +2346,10 @@
return -1;
}
- rtp_session->stats.out.raw_bytes += bytes;
- rtp_session->stats.out.media_bytes += bytes;
- rtp_session->stats.out.media_packet_count++;
- rtp_session->stats.out.packet_count++;
+ rtp_session->stats.outbound.raw_bytes += bytes;
+ rtp_session->stats.outbound.media_bytes += bytes;
+ rtp_session->stats.outbound.media_packet_count++;
+ rtp_session->stats.outbound.packet_count++;
return (int) bytes;
}
@@ -2369,10 +2369,10 @@
switch_size_t wrote = switch_rtp_write_manual(rtp_session, frame->data, frame->datalen,
frame->m, frame->payload, (uint32_t) (frame->timestamp), &frame->flags);
- rtp_session->stats.out.raw_bytes += wrote;
- rtp_session->stats.out.media_bytes += wrote;
- rtp_session->stats.out.media_packet_count++;
- rtp_session->stats.out.packet_count++;
+ rtp_session->stats.outbound.raw_bytes += wrote;
+ rtp_session->stats.outbound.media_bytes += wrote;
+ rtp_session->stats.outbound.media_packet_count++;
+ rtp_session->stats.outbound.packet_count++;
}
if (fwd) {
More information about the Freeswitch-svn
mailing list