Freeswitch-trunk
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- 14172 discussions
Author: anthm
Date: Mon May 12 11:38:51 2008
New Revision: 8363
Modified:
freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp
Log:
fix the hangup hook extra arg code
Modified: freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp (original)
+++ freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp Mon May 12 11:38:51 2008
@@ -83,6 +83,7 @@
{
if (hh && !mark) {
const char *err = NULL;
+ int arg_count = 1;
mark++;
if (!getLUA()) {
@@ -94,10 +95,11 @@
lua_pushstring(L, hook_state == CS_HANGUP ? "hangup" : "transfer");
if (hangup_func_arg) {
- lua_pushstring(L, hangup_func_arg);
+ lua_getfield(L, LUA_GLOBALSINDEX, (char *)hangup_func_arg);
+ arg_count++;
}
-
- lua_call(L, 1, 1);
+
+ lua_call(L, arg_count, 1);
err = lua_tostring(L, -1);
if (!switch_strlen_zero(err)) {
1
0
Author: anthm
Date: Mon May 12 11:29:04 2008
New Revision: 8362
Modified:
freeswitch/trunk/src/switch_cpp.cpp
Log:
force swap thing on hangup to find hangup hook
Modified: freeswitch/trunk/src/switch_cpp.cpp
==============================================================================
--- freeswitch/trunk/src/switch_cpp.cpp (original)
+++ freeswitch/trunk/src/switch_cpp.cpp Mon May 12 11:29:04 2008
@@ -435,7 +435,9 @@
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CoreSession::hangup\n");
sanity_check_noreturn;
+ this->begin_allow_threads();
switch_channel_hangup(channel, switch_channel_str2cause(cause));
+ this->end_allow_threads();
}
SWITCH_DECLARE(void) CoreSession::setPrivate(char *var, void *val)
1
0
Author: anthm
Date: Mon May 12 11:21:29 2008
New Revision: 8361
Modified:
freeswitch/trunk/src/mod/formats/mod_shout/layer3.c
Log:
fix FSCORE-124
Modified: freeswitch/trunk/src/mod/formats/mod_shout/layer3.c
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_shout/layer3.c (original)
+++ freeswitch/trunk/src/mod/formats/mod_shout/layer3.c Mon May 12 11:21:29 2008
@@ -609,6 +609,7 @@
{
int shift = 1 + gr_info->scalefac_scale;
real *xrpnt = (real *) xr;
+ real *toomuch = (real *) xr + (SBLIMIT * SBLIMIT * sizeof(real));
int l[3], l3;
int part2remain = gr_info->part2_3_length - part2bits;
int *me;
@@ -668,7 +669,9 @@
register int x, y;
if ((!mc)) {
mc = *m++;
- xrpnt = ((real *) xr) + (*m++);
+ if ((xrpnt = ((real *) xr) + (*m++)) > toomuch) {
+ return 1;
+ }
lwin = *m++;
cb = *m++;
if (lwin == 3) {
@@ -707,7 +710,9 @@
part2remain--;
} else
*xrpnt = 0.0;
- xrpnt += step;
+ if ((xrpnt += step) > toomuch) {
+ return 1;
+ }
if (y == 15) {
max[lwin] = cb;
part2remain -= h->linbits + 1;
@@ -725,7 +730,9 @@
part2remain--;
} else
*xrpnt = 0.0;
- xrpnt += step;
+ if ((xrpnt += step) > toomuch) {
+ return 1;
+ }
}
}
for (; l3 && (part2remain > 0); l3--) {
@@ -747,7 +754,9 @@
if (!(i & 1)) {
if (!mc) {
mc = *m++;
- xrpnt = ((real *) xr) + (*m++);
+ if ((xrpnt = ((real *) xr) + (*m++)) > toomuch) {
+ return 1;
+ }
lwin = *m++;
cb = *m++;
if (lwin == 3) {
@@ -773,14 +782,18 @@
*xrpnt = v;
} else
*xrpnt = 0.0;
- xrpnt += step;
+ if ((xrpnt += step) > toomuch) {
+ return 1;
+ }
}
}
while (m < me) {
if (!mc) {
mc = *m++;
- xrpnt = ((real *) xr) + *m++;
+ if ((xrpnt = ((real *) xr) + *m++) > toomuch) {
+ return 1;
+ }
if ((*m++) == 3)
step = 1;
else
@@ -789,9 +802,13 @@
}
mc--;
*xrpnt = 0.0;
- xrpnt += step;
+ if ((xrpnt += step) > toomuch) {
+ return 1;
+ }
*xrpnt = 0.0;
- xrpnt += step;
+ if ((xrpnt += step) > toomuch) {
+ return 1;
+ }
/* we could add a little opt. here:
* if we finished a band for window 3 or a long band
* further bands could copied in a simple loop without a
@@ -863,6 +880,11 @@
x = y >> 4;
y &= 0xf;
}
+
+ if (xrpnt >= toomuch) {
+ return 1;
+ }
+
if (x == 15) {
max = cb;
part2remain -= h->linbits + 1;
@@ -971,7 +993,7 @@
#if 0
static int III_dequantize_sample_ms(real xr[2][SBLIMIT][SSLIMIT], int *scf, struct gr_info_s *gr_info, int sfreq, int part2bits)
-{
+{ma
int shift = 1 + gr_info->scalefac_scale;
real *xrpnt = (real *) xr[1];
real *xr0pnt = (real *) xr[0];
1
0
12 May '08
Author: anthm
Date: Mon May 12 10:19:48 2008
New Revision: 8360
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c
Log:
update
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Mon May 12 10:19:48 2008
@@ -345,6 +345,10 @@
default:
if (nh && ((sofia_private && sofia_private->destroy_nh) || !nua_handle_magic(nh))) {
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Destroy handle [%s]\n", nua_event_name(event));
+ if (sofia_private) {
+ nua_handle_bind(nh, NULL);
+ sofia_private->destroy_me = 1;
+ }
nua_handle_destroy(nh);
}
break;
@@ -1532,8 +1536,6 @@
}
gateway->ping = switch_timestamp(NULL) + gateway->ping_freq;
sofia_reg_release_gateway(gateway);
- nua_handle_bind(nh, NULL);
- free(sofia_private);
gateway->pinging = 0;
} else if ((profile->pflags & PFLAG_UNREG_OPTIONS_FAIL) && status != 200 && sip && sip->sip_to) {
char *sql;
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c Mon May 12 10:19:48 2008
@@ -88,6 +88,7 @@
switch_assert(pvt);
memset(pvt, 0, sizeof(*pvt));
pvt->destroy_nh = 1;
+ pvt->destroy_me = 1;
switch_copy_string(pvt->gateway_name, gateway_ptr->name, sizeof(pvt->gateway_name));
nua_handle_bind(nh, pvt);
1
0
12 May '08
Author: anthm
Date: Mon May 12 09:46:07 2008
New Revision: 8359
Modified:
freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
freeswitch/trunk/src/mod/endpoints/mod_alsa/mod_alsa.c
freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
freeswitch/trunk/src/mod/endpoints/mod_iax/mod_iax.c
freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c
freeswitch/trunk/src/mod/endpoints/mod_reference/mod_reference.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/trunk/src/mod/endpoints/mod_wanpipe/libsangoma/libsangoma.c
freeswitch/trunk/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c
freeswitch/trunk/src/switch_core_state_machine.c
freeswitch/trunk/src/switch_ivr_bridge.c
Log:
more name changes
Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c Mon May 12 09:46:07 2008
@@ -3733,7 +3733,7 @@
channel = switch_core_session_get_channel(session);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CUSTOM RING\n");
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CUSTOM ROUTING\n");
/* put the channel in a passive state so we can loop audio to it */
switch_channel_set_state(channel, CS_SOFT_EXECUTE);
Modified: freeswitch/trunk/src/mod/endpoints/mod_alsa/mod_alsa.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_alsa/mod_alsa.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_alsa/mod_alsa.c Mon May 12 09:46:07 2008
@@ -311,7 +311,7 @@
tech_pvt = switch_core_session_get_private(session);
assert(tech_pvt != NULL);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL RING\n", switch_channel_get_name(channel));
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL ROUTING\n", switch_channel_get_name(channel));
return SWITCH_STATUS_SUCCESS;
}
Modified: freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c Mon May 12 09:46:07 2008
@@ -1180,7 +1180,7 @@
tech_pvt = switch_core_session_get_private(session);
switch_assert(tech_pvt != NULL);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL RING\n", switch_channel_get_name(channel));
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL ROUTING\n", switch_channel_get_name(channel));
return SWITCH_STATUS_SUCCESS;
}
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 Mon May 12 09:46:07 2008
@@ -478,7 +478,7 @@
static switch_status_t channel_on_routing(switch_core_session_t *session)
{
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL RING\n", switch_channel_get_name(switch_core_session_get_channel(session)));
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL ROUTING\n", switch_channel_get_name(switch_core_session_get_channel(session)));
return SWITCH_STATUS_SUCCESS;
}
Modified: freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c Mon May 12 09:46:07 2008
@@ -291,7 +291,7 @@
static switch_status_t channel_on_routing(switch_core_session_t *session)
{
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL RING\n", switch_channel_get_name(switch_core_session_get_channel(session)));
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL ROUTING\n", switch_channel_get_name(switch_core_session_get_channel(session)));
return SWITCH_STATUS_SUCCESS;
}
Modified: freeswitch/trunk/src/mod/endpoints/mod_reference/mod_reference.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_reference/mod_reference.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_reference/mod_reference.c Mon May 12 09:46:07 2008
@@ -162,7 +162,7 @@
tech_pvt = switch_core_session_get_private(session);
assert(tech_pvt != NULL);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL RING\n", switch_channel_get_name(channel));
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL ROUTING\n", switch_channel_get_name(channel));
return SWITCH_STATUS_SUCCESS;
}
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Mon May 12 09:46:07 2008
@@ -116,7 +116,7 @@
switch_clear_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s SOFIA RING\n", switch_channel_get_name(switch_core_session_get_channel(session)));
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s SOFIA ROUTING\n", switch_channel_get_name(switch_core_session_get_channel(session)));
return SWITCH_STATUS_SUCCESS;
}
Modified: freeswitch/trunk/src/mod/endpoints/mod_wanpipe/libsangoma/libsangoma.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_wanpipe/libsangoma/libsangoma.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_wanpipe/libsangoma/libsangoma.c Mon May 12 09:46:07 2008
@@ -826,7 +826,7 @@
break;
case WP_TDM_EVENT_RING_TRIP:
- printf("%d: GOT RING TRIP EVENT\n",(int)fd);
+ printf("%d: GOT ROUTING TRIP EVENT\n",(int)fd);
if (tdm_api->wp_tdm_event.wp_ringtrip_event) {
tdm_api->wp_tdm_event.wp_ringtrip_event(fd,
rx_event->wp_tdm_api_event_ring_state);
Modified: freeswitch/trunk/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c Mon May 12 09:46:07 2008
@@ -629,7 +629,7 @@
tech_pvt = switch_core_session_get_private(session);
assert(tech_pvt != NULL);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "WANPIPE RING\n");
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "WANPIPE ROUTING\n");
Modified: freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c Mon May 12 09:46:07 2008
@@ -240,7 +240,7 @@
static switch_status_t woomera_on_routing(switch_core_session_t *session)
{
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s WOOMERA RING\n", switch_channel_get_name(switch_core_session_get_channel(session)));
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s WOOMERA ROUTING\n", switch_channel_get_name(switch_core_session_get_channel(session)));
return SWITCH_STATUS_SUCCESS;
}
Modified: freeswitch/trunk/src/switch_core_state_machine.c
==============================================================================
--- freeswitch/trunk/src/switch_core_state_machine.c (original)
+++ freeswitch/trunk/src/switch_core_state_machine.c Mon May 12 09:46:07 2008
@@ -62,7 +62,7 @@
char *expanded = NULL;
char *dpstr = NULL;
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard RING %s\n", switch_channel_get_name(session->channel));
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard ROUTING %s\n", switch_channel_get_name(session->channel));
if ((caller_profile = switch_channel_get_caller_profile(session->channel)) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't get profile!\n");
@@ -369,7 +369,7 @@
break;
case CS_DONE:
goto done;
- /* HANGUP INIT RING and RESET are all short term so we signal lock during their callbacks */
+ /* HANGUP INIT ROUTING and RESET are all short term so we signal lock during their callbacks */
case CS_HANGUP: /* Deactivate and end the thread */
{
const char *var = switch_channel_get_variable(session->channel, SWITCH_PROCESS_CDR_VARIABLE);
Modified: freeswitch/trunk/src/switch_ivr_bridge.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_bridge.c (original)
+++ freeswitch/trunk/src/switch_ivr_bridge.c Mon May 12 09:46:07 2008
@@ -381,7 +381,7 @@
{
switch_channel_t *channel = switch_core_session_get_channel(session);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CUSTOM RING\n", switch_channel_get_name(channel));
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CUSTOM ROUTING\n", switch_channel_get_name(channel));
/* put the channel in a passive state so we can loop audio to it */
switch_channel_set_state(channel, CS_CONSUME_MEDIA);
1
0
12 May '08
Author: anthm
Date: Mon May 12 09:37:36 2008
New Revision: 8358
Modified:
freeswitch/trunk/src/mod/languages/mod_perl/Makefile
freeswitch/trunk/src/mod/languages/mod_perl/freeswitch.pm
freeswitch/trunk/src/mod/languages/mod_perl/freeswitch_perl.cpp
freeswitch/trunk/src/mod/languages/mod_perl/freeswitch_perl.h
freeswitch/trunk/src/mod/languages/mod_perl/hack.diff
freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp
Log:
add namespace to perl
Modified: freeswitch/trunk/src/mod/languages/mod_perl/Makefile
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_perl/Makefile (original)
+++ freeswitch/trunk/src/mod/languages/mod_perl/Makefile Mon May 12 09:37:36 2008
@@ -16,7 +16,7 @@
mod_perl_wrap.cpp:
swig -static -shadow -perl5 -c++ -DMULTIPLICITY -I../../../../src/include -o mod_perl_wrap.cpp freeswitch.i
echo "#include \"mod_perl_extra.c\"" >> mod_perl_wrap.cpp
- patch -s -p0 -i hack.diff
+ # patch -s -p0 -i hack.diff
Modified: freeswitch/trunk/src/mod/languages/mod_perl/freeswitch.pm
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_perl/freeswitch.pm (original)
+++ freeswitch/trunk/src/mod/languages/mod_perl/freeswitch.pm Mon May 12 09:37:36 2008
@@ -307,6 +307,7 @@
*setPrivate = *freeswitchc::CoreSession_setPrivate;
*getPrivate = *freeswitchc::CoreSession_getPrivate;
*getVariable = *freeswitchc::CoreSession_getVariable;
+*process_callback_result = *freeswitchc::CoreSession_process_callback_result;
*recordFile = *freeswitchc::CoreSession_recordFile;
*setCallerData = *freeswitchc::CoreSession_setCallerData;
*originate = *freeswitchc::CoreSession_originate;
Modified: freeswitch/trunk/src/mod/languages/mod_perl/freeswitch_perl.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_perl/freeswitch_perl.cpp (original)
+++ freeswitch/trunk/src/mod/languages/mod_perl/freeswitch_perl.cpp Mon May 12 09:37:36 2008
@@ -6,6 +6,8 @@
#define init_me() cb_function = hangup_func_str = NULL; hangup_func_arg = NULL; hh = mark = 0; my_perl = NULL; cb_arg = NULL
+using namespace PERL;
+
Session::Session() : CoreSession()
{
init_me();
Modified: freeswitch/trunk/src/mod/languages/mod_perl/freeswitch_perl.h
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_perl/freeswitch_perl.h (original)
+++ freeswitch/trunk/src/mod/languages/mod_perl/freeswitch_perl.h Mon May 12 09:37:36 2008
@@ -17,6 +17,7 @@
#include <switch_cpp.h>
+namespace PERL {
class Session : public CoreSession {
private:
virtual void do_hangup_hook();
@@ -45,5 +46,5 @@
char *hangup_func_arg;
void setPERL(PerlInterpreter *pi);
};
-
+}
#endif
Modified: freeswitch/trunk/src/mod/languages/mod_perl/hack.diff
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_perl/hack.diff (original)
+++ freeswitch/trunk/src/mod/languages/mod_perl/hack.diff Mon May 12 09:37:36 2008
@@ -1,30 +1,29 @@
---- mod_perl_wrap.cpp 2008-05-01 18:05:28.000000000 -0400
-+++ old.cpp 2008-05-01 18:05:51.000000000 -0400
-
-@@ -6293,7 +6293,7 @@
+--- mod_perl_wrap2.cpp 2008-05-11 20:28:24.000000000 -0400
++++ mod_perl_wrap.cpp 2008-05-11 20:26:06.000000000 -0400
+@@ -6754,7 +6754,7 @@
if ((items < 0) || (items > 0)) {
SWIG_croak("Usage: new_Session();");
}
-- result = (Session *)new Session();
-+ result = (Session *)new Session(); result->setPERL(my_perl);
- ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Session, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
+- result = (PERL::Session *)new PERL::Session(); result->setPERL(my_perl);
++ result = (PERL::Session *)new PERL::Session();
+ ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PERL__Session, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
-@@ -6320,7 +6320,7 @@
+@@ -6781,7 +6781,7 @@
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Session" "', argument " "1"" of type '" "char *""'");
}
arg1 = reinterpret_cast< char * >(buf1);
-- result = (Session *)new Session(arg1);
-+ result = (Session *)new Session(arg1); result->setPERL(my_perl);
- ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Session, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
+- result = (PERL::Session *)new PERL::Session(arg1); result->setPERL(my_perl);
++ result = (PERL::Session *)new PERL::Session(arg1);
+ ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PERL__Session, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
XSRETURN(argvi);
-@@ -6348,7 +6348,7 @@
+@@ -6809,7 +6809,7 @@
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Session" "', argument " "1"" of type '" "switch_core_session_t *""'");
}
arg1 = reinterpret_cast< switch_core_session_t * >(argp1);
-- result = (Session *)new Session(arg1);
-+ result = (Session *)new Session(arg1); result->setPERL(my_perl);
- ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Session, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
+- result = (PERL::Session *)new PERL::Session(arg1); result->setPERL(my_perl);
++ result = (PERL::Session *)new PERL::Session(arg1);
+ ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PERL__Session, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
Modified: freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp (original)
+++ freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp Mon May 12 09:37:36 2008
@@ -1450,8 +1450,8 @@
#define SWIGTYPE_p_CoreSession swig_types[1]
#define SWIGTYPE_p_Event swig_types[2]
#define SWIGTYPE_p_IVRMenu swig_types[3]
-#define SWIGTYPE_p_PerlInterpreter swig_types[4]
-#define SWIGTYPE_p_Session swig_types[5]
+#define SWIGTYPE_p_PERL__Session swig_types[4]
+#define SWIGTYPE_p_PerlInterpreter swig_types[5]
#define SWIGTYPE_p_Stream swig_types[6]
#define SWIGTYPE_p_char swig_types[7]
#define SWIGTYPE_p_input_callback_state swig_types[8]
@@ -4661,6 +4661,45 @@
}
+XS(_wrap_CoreSession_process_callback_result) {
+ {
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ switch_status_t result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int argvi = 0;
+ dXSARGS;
+
+ if ((items < 2) || (items > 2)) {
+ SWIG_croak("Usage: CoreSession_process_callback_result(self,ret);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_process_callback_result" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_process_callback_result" "', argument " "2"" of type '" "char *""'");
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ result = (arg1)->process_callback_result(arg2);
+ ST(argvi) = SWIG_NewPointerObj((new switch_status_t(static_cast< const switch_status_t& >(result))), SWIGTYPE_p_switch_status_t, SWIG_POINTER_OWN | 0); argvi++ ;
+
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ XSRETURN(argvi);
+ fail:
+
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ SWIG_croak_null();
+ }
+}
+
+
XS(_wrap_CoreSession_recordFile__SWIG_0) {
{
CoreSession *arg1 = (CoreSession *) 0 ;
@@ -6708,15 +6747,15 @@
XS(_wrap_new_Session__SWIG_0) {
{
- Session *result = 0 ;
+ PERL::Session *result = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 0) || (items > 0)) {
SWIG_croak("Usage: new_Session();");
}
- result = (Session *)new Session(); result->setPERL(my_perl);
- ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Session, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
+ result = (PERL::Session *)new PERL::Session();
+ ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PERL__Session, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
@@ -6727,7 +6766,7 @@
XS(_wrap_new_Session__SWIG_1) {
{
char *arg1 = (char *) 0 ;
- Session *result = 0 ;
+ PERL::Session *result = 0 ;
int res1 ;
char *buf1 = 0 ;
int alloc1 = 0 ;
@@ -6742,8 +6781,8 @@
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Session" "', argument " "1"" of type '" "char *""'");
}
arg1 = reinterpret_cast< char * >(buf1);
- result = (Session *)new Session(arg1); result->setPERL(my_perl);
- ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Session, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
+ result = (PERL::Session *)new PERL::Session(arg1);
+ ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PERL__Session, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
XSRETURN(argvi);
fail:
@@ -6756,7 +6795,7 @@
XS(_wrap_new_Session__SWIG_2) {
{
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
- Session *result = 0 ;
+ PERL::Session *result = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
@@ -6770,8 +6809,8 @@
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Session" "', argument " "1"" of type '" "switch_core_session_t *""'");
}
arg1 = reinterpret_cast< switch_core_session_t * >(argp1);
- result = (Session *)new Session(arg1); result->setPERL(my_perl);
- ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Session, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
+ result = (PERL::Session *)new PERL::Session(arg1);
+ ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PERL__Session, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
@@ -6854,7 +6893,7 @@
XS(_wrap_delete_Session) {
{
- Session *arg1 = (Session *) 0 ;
+ PERL::Session *arg1 = (PERL::Session *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
@@ -6863,11 +6902,11 @@
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: delete_Session(self);");
}
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Session, SWIG_POINTER_DISOWN | 0 );
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Session" "', argument " "1"" of type '" "Session *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Session" "', argument " "1"" of type '" "PERL::Session *""'");
}
- arg1 = reinterpret_cast< Session * >(argp1);
+ arg1 = reinterpret_cast< PERL::Session * >(argp1);
delete arg1;
@@ -6882,7 +6921,7 @@
XS(_wrap_Session_begin_allow_threads) {
{
- Session *arg1 = (Session *) 0 ;
+ PERL::Session *arg1 = (PERL::Session *) 0 ;
bool result;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -6892,11 +6931,11 @@
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Session_begin_allow_threads(self);");
}
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Session, 0 | 0 );
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_begin_allow_threads" "', argument " "1"" of type '" "Session *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_begin_allow_threads" "', argument " "1"" of type '" "PERL::Session *""'");
}
- arg1 = reinterpret_cast< Session * >(argp1);
+ arg1 = reinterpret_cast< PERL::Session * >(argp1);
result = (bool)(arg1)->begin_allow_threads();
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
@@ -6910,7 +6949,7 @@
XS(_wrap_Session_end_allow_threads) {
{
- Session *arg1 = (Session *) 0 ;
+ PERL::Session *arg1 = (PERL::Session *) 0 ;
bool result;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -6920,11 +6959,11 @@
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Session_end_allow_threads(self);");
}
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Session, 0 | 0 );
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_end_allow_threads" "', argument " "1"" of type '" "Session *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_end_allow_threads" "', argument " "1"" of type '" "PERL::Session *""'");
}
- arg1 = reinterpret_cast< Session * >(argp1);
+ arg1 = reinterpret_cast< PERL::Session * >(argp1);
result = (bool)(arg1)->end_allow_threads();
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
@@ -6938,7 +6977,7 @@
XS(_wrap_Session_check_hangup_hook) {
{
- Session *arg1 = (Session *) 0 ;
+ PERL::Session *arg1 = (PERL::Session *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
@@ -6947,11 +6986,11 @@
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Session_check_hangup_hook(self);");
}
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Session, 0 | 0 );
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_check_hangup_hook" "', argument " "1"" of type '" "Session *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_check_hangup_hook" "', argument " "1"" of type '" "PERL::Session *""'");
}
- arg1 = reinterpret_cast< Session * >(argp1);
+ arg1 = reinterpret_cast< PERL::Session * >(argp1);
(arg1)->check_hangup_hook();
@@ -6965,7 +7004,7 @@
XS(_wrap_Session_run_dtmf_callback) {
{
- Session *arg1 = (Session *) 0 ;
+ PERL::Session *arg1 = (PERL::Session *) 0 ;
void *arg2 = (void *) 0 ;
switch_input_type_t arg3 ;
switch_status_t result;
@@ -6980,11 +7019,11 @@
if ((items < 3) || (items > 3)) {
SWIG_croak("Usage: Session_run_dtmf_callback(self,input,itype);");
}
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Session, 0 | 0 );
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_run_dtmf_callback" "', argument " "1"" of type '" "Session *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_run_dtmf_callback" "', argument " "1"" of type '" "PERL::Session *""'");
}
- arg1 = reinterpret_cast< Session * >(argp1);
+ arg1 = reinterpret_cast< PERL::Session * >(argp1);
res2 = SWIG_ConvertPtr(ST(1),SWIG_as_voidptrptr(&arg2), 0, 0);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Session_run_dtmf_callback" "', argument " "2"" of type '" "void *""'");
@@ -7015,7 +7054,7 @@
XS(_wrap_Session_setInputCallback) {
{
- Session *arg1 = (Session *) 0 ;
+ PERL::Session *arg1 = (PERL::Session *) 0 ;
char *arg2 = (char *) 0 ;
char *arg3 = (char *) 0 ;
void *argp1 = 0 ;
@@ -7032,11 +7071,11 @@
if ((items < 3) || (items > 3)) {
SWIG_croak("Usage: Session_setInputCallback(self,cbfunc,funcargs);");
}
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Session, 0 | 0 );
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_setInputCallback" "', argument " "1"" of type '" "Session *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_setInputCallback" "', argument " "1"" of type '" "PERL::Session *""'");
}
- arg1 = reinterpret_cast< Session * >(argp1);
+ arg1 = reinterpret_cast< PERL::Session * >(argp1);
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Session_setInputCallback" "', argument " "2"" of type '" "char *""'");
@@ -7064,7 +7103,7 @@
XS(_wrap_Session_setHangupHook__SWIG_0) {
{
- Session *arg1 = (Session *) 0 ;
+ PERL::Session *arg1 = (PERL::Session *) 0 ;
char *arg2 = (char *) 0 ;
char *arg3 = (char *) 0 ;
void *argp1 = 0 ;
@@ -7081,11 +7120,11 @@
if ((items < 3) || (items > 3)) {
SWIG_croak("Usage: Session_setHangupHook(self,func,arg);");
}
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Session, 0 | 0 );
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_setHangupHook" "', argument " "1"" of type '" "Session *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_setHangupHook" "', argument " "1"" of type '" "PERL::Session *""'");
}
- arg1 = reinterpret_cast< Session * >(argp1);
+ arg1 = reinterpret_cast< PERL::Session * >(argp1);
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Session_setHangupHook" "', argument " "2"" of type '" "char *""'");
@@ -7113,7 +7152,7 @@
XS(_wrap_Session_setHangupHook__SWIG_1) {
{
- Session *arg1 = (Session *) 0 ;
+ PERL::Session *arg1 = (PERL::Session *) 0 ;
char *arg2 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -7126,11 +7165,11 @@
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Session_setHangupHook(self,func);");
}
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Session, 0 | 0 );
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_setHangupHook" "', argument " "1"" of type '" "Session *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_setHangupHook" "', argument " "1"" of type '" "PERL::Session *""'");
}
- arg1 = reinterpret_cast< Session * >(argp1);
+ arg1 = reinterpret_cast< PERL::Session * >(argp1);
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Session_setHangupHook" "', argument " "2"" of type '" "char *""'");
@@ -7162,7 +7201,7 @@
int _v = 0;
{
void *vptr = 0;
- int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_Session, 0);
+ int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_PERL__Session, 0);
_v = SWIG_CheckState(res);
}
if (!_v) goto check_1;
@@ -7191,7 +7230,7 @@
int _v = 0;
{
void *vptr = 0;
- int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_Session, 0);
+ int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_PERL__Session, 0);
_v = SWIG_CheckState(res);
}
if (!_v) goto check_2;
@@ -7237,7 +7276,7 @@
XS(_wrap_Session_ready) {
{
- Session *arg1 = (Session *) 0 ;
+ PERL::Session *arg1 = (PERL::Session *) 0 ;
bool result;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -7247,11 +7286,11 @@
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Session_ready(self);");
}
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Session, 0 | 0 );
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_ready" "', argument " "1"" of type '" "Session *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_ready" "', argument " "1"" of type '" "PERL::Session *""'");
}
- arg1 = reinterpret_cast< Session * >(argp1);
+ arg1 = reinterpret_cast< PERL::Session * >(argp1);
result = (bool)(arg1)->ready();
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
@@ -7265,7 +7304,7 @@
XS(_wrap_Session_cb_function_set) {
{
- Session *arg1 = (Session *) 0 ;
+ PERL::Session *arg1 = (PERL::Session *) 0 ;
char *arg2 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -7278,11 +7317,11 @@
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Session_cb_function_set(self,cb_function);");
}
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Session, 0 | 0 );
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_cb_function_set" "', argument " "1"" of type '" "Session *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_cb_function_set" "', argument " "1"" of type '" "PERL::Session *""'");
}
- arg1 = reinterpret_cast< Session * >(argp1);
+ arg1 = reinterpret_cast< PERL::Session * >(argp1);
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Session_cb_function_set" "', argument " "2"" of type '" "char *""'");
@@ -7309,7 +7348,7 @@
XS(_wrap_Session_cb_function_get) {
{
- Session *arg1 = (Session *) 0 ;
+ PERL::Session *arg1 = (PERL::Session *) 0 ;
char *result = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -7319,11 +7358,11 @@
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Session_cb_function_get(self);");
}
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Session, 0 | 0 );
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_cb_function_get" "', argument " "1"" of type '" "Session *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_cb_function_get" "', argument " "1"" of type '" "PERL::Session *""'");
}
- arg1 = reinterpret_cast< Session * >(argp1);
+ arg1 = reinterpret_cast< PERL::Session * >(argp1);
result = (char *) ((arg1)->cb_function);
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
@@ -7337,7 +7376,7 @@
XS(_wrap_Session_cb_arg_set) {
{
- Session *arg1 = (Session *) 0 ;
+ PERL::Session *arg1 = (PERL::Session *) 0 ;
char *arg2 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -7350,11 +7389,11 @@
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Session_cb_arg_set(self,cb_arg);");
}
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Session, 0 | 0 );
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_cb_arg_set" "', argument " "1"" of type '" "Session *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_cb_arg_set" "', argument " "1"" of type '" "PERL::Session *""'");
}
- arg1 = reinterpret_cast< Session * >(argp1);
+ arg1 = reinterpret_cast< PERL::Session * >(argp1);
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Session_cb_arg_set" "', argument " "2"" of type '" "char *""'");
@@ -7381,7 +7420,7 @@
XS(_wrap_Session_cb_arg_get) {
{
- Session *arg1 = (Session *) 0 ;
+ PERL::Session *arg1 = (PERL::Session *) 0 ;
char *result = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -7391,11 +7430,11 @@
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Session_cb_arg_get(self);");
}
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Session, 0 | 0 );
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_cb_arg_get" "', argument " "1"" of type '" "Session *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_cb_arg_get" "', argument " "1"" of type '" "PERL::Session *""'");
}
- arg1 = reinterpret_cast< Session * >(argp1);
+ arg1 = reinterpret_cast< PERL::Session * >(argp1);
result = (char *) ((arg1)->cb_arg);
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
@@ -7409,7 +7448,7 @@
XS(_wrap_Session_hangup_func_str_set) {
{
- Session *arg1 = (Session *) 0 ;
+ PERL::Session *arg1 = (PERL::Session *) 0 ;
char *arg2 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -7422,11 +7461,11 @@
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Session_hangup_func_str_set(self,hangup_func_str);");
}
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Session, 0 | 0 );
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_hangup_func_str_set" "', argument " "1"" of type '" "Session *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_hangup_func_str_set" "', argument " "1"" of type '" "PERL::Session *""'");
}
- arg1 = reinterpret_cast< Session * >(argp1);
+ arg1 = reinterpret_cast< PERL::Session * >(argp1);
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Session_hangup_func_str_set" "', argument " "2"" of type '" "char *""'");
@@ -7453,7 +7492,7 @@
XS(_wrap_Session_hangup_func_str_get) {
{
- Session *arg1 = (Session *) 0 ;
+ PERL::Session *arg1 = (PERL::Session *) 0 ;
char *result = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -7463,11 +7502,11 @@
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Session_hangup_func_str_get(self);");
}
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Session, 0 | 0 );
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_hangup_func_str_get" "', argument " "1"" of type '" "Session *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_hangup_func_str_get" "', argument " "1"" of type '" "PERL::Session *""'");
}
- arg1 = reinterpret_cast< Session * >(argp1);
+ arg1 = reinterpret_cast< PERL::Session * >(argp1);
result = (char *) ((arg1)->hangup_func_str);
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
@@ -7481,7 +7520,7 @@
XS(_wrap_Session_hangup_func_arg_set) {
{
- Session *arg1 = (Session *) 0 ;
+ PERL::Session *arg1 = (PERL::Session *) 0 ;
char *arg2 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -7494,11 +7533,11 @@
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Session_hangup_func_arg_set(self,hangup_func_arg);");
}
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Session, 0 | 0 );
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_hangup_func_arg_set" "', argument " "1"" of type '" "Session *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_hangup_func_arg_set" "', argument " "1"" of type '" "PERL::Session *""'");
}
- arg1 = reinterpret_cast< Session * >(argp1);
+ arg1 = reinterpret_cast< PERL::Session * >(argp1);
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Session_hangup_func_arg_set" "', argument " "2"" of type '" "char *""'");
@@ -7525,7 +7564,7 @@
XS(_wrap_Session_hangup_func_arg_get) {
{
- Session *arg1 = (Session *) 0 ;
+ PERL::Session *arg1 = (PERL::Session *) 0 ;
char *result = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -7535,11 +7574,11 @@
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: Session_hangup_func_arg_get(self);");
}
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Session, 0 | 0 );
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_hangup_func_arg_get" "', argument " "1"" of type '" "Session *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_hangup_func_arg_get" "', argument " "1"" of type '" "PERL::Session *""'");
}
- arg1 = reinterpret_cast< Session * >(argp1);
+ arg1 = reinterpret_cast< PERL::Session * >(argp1);
result = (char *) ((arg1)->hangup_func_arg);
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
@@ -7553,7 +7592,7 @@
XS(_wrap_Session_setPERL) {
{
- Session *arg1 = (Session *) 0 ;
+ PERL::Session *arg1 = (PERL::Session *) 0 ;
PerlInterpreter *arg2 = (PerlInterpreter *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -7565,11 +7604,11 @@
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: Session_setPERL(self,pi);");
}
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Session, 0 | 0 );
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_setPERL" "', argument " "1"" of type '" "Session *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_setPERL" "', argument " "1"" of type '" "PERL::Session *""'");
}
- arg1 = reinterpret_cast< Session * >(argp1);
+ arg1 = reinterpret_cast< PERL::Session * >(argp1);
res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_PerlInterpreter, 0 | 0 );
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Session_setPERL" "', argument " "2"" of type '" "PerlInterpreter *""'");
@@ -7591,15 +7630,15 @@
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
-static void *_p_SessionTo_p_CoreSession(void *x, int *newmemory) {
- return (void *)((CoreSession *) ((Session *) x));
+static void *_p_PERL__SessionTo_p_CoreSession(void *x, int *newmemory) {
+ return (void *)((CoreSession *) ((PERL::Session *) x));
}
static swig_type_info _swigt__p_API = {"_p_API", "API *", 0, 0, (void*)"freeswitch::API", 0};
static swig_type_info _swigt__p_CoreSession = {"_p_CoreSession", "CoreSession *", 0, 0, (void*)"freeswitch::CoreSession", 0};
static swig_type_info _swigt__p_Event = {"_p_Event", "Event *", 0, 0, (void*)"freeswitch::Event", 0};
static swig_type_info _swigt__p_IVRMenu = {"_p_IVRMenu", "IVRMenu *", 0, 0, (void*)"freeswitch::IVRMenu", 0};
+static swig_type_info _swigt__p_PERL__Session = {"_p_PERL__Session", "PERL::Session *", 0, 0, (void*)"freeswitch::Session", 0};
static swig_type_info _swigt__p_PerlInterpreter = {"_p_PerlInterpreter", "PerlInterpreter *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_Session = {"_p_Session", "Session *", 0, 0, (void*)"freeswitch::Session", 0};
static swig_type_info _swigt__p_Stream = {"_p_Stream", "Stream *", 0, 0, (void*)"freeswitch::Stream", 0};
static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state", "input_callback_state_t *|input_callback_state *", 0, 0, (void*)"freeswitch::input_callback_state_t", 0};
@@ -7620,8 +7659,8 @@
&_swigt__p_CoreSession,
&_swigt__p_Event,
&_swigt__p_IVRMenu,
+ &_swigt__p_PERL__Session,
&_swigt__p_PerlInterpreter,
- &_swigt__p_Session,
&_swigt__p_Stream,
&_swigt__p_char,
&_swigt__p_input_callback_state,
@@ -7639,11 +7678,11 @@
};
static swig_cast_info _swigc__p_API[] = { {&_swigt__p_API, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_CoreSession[] = { {&_swigt__p_CoreSession, 0, 0, 0}, {&_swigt__p_Session, _p_SessionTo_p_CoreSession, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CoreSession[] = { {&_swigt__p_CoreSession, 0, 0, 0}, {&_swigt__p_PERL__Session, _p_PERL__SessionTo_p_CoreSession, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Event[] = { {&_swigt__p_Event, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_IVRMenu[] = { {&_swigt__p_IVRMenu, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_PERL__Session[] = { {&_swigt__p_PERL__Session, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_PerlInterpreter[] = { {&_swigt__p_PerlInterpreter, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_Session[] = { {&_swigt__p_Session, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Stream[] = { {&_swigt__p_Stream, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_input_callback_state[] = { {&_swigt__p_input_callback_state, 0, 0, 0},{0, 0, 0, 0}};
@@ -7664,8 +7703,8 @@
_swigc__p_CoreSession,
_swigc__p_Event,
_swigc__p_IVRMenu,
+ _swigc__p_PERL__Session,
_swigc__p_PerlInterpreter,
- _swigc__p_Session,
_swigc__p_Stream,
_swigc__p_char,
_swigc__p_input_callback_state,
@@ -7756,6 +7795,7 @@
{"freeswitchc::CoreSession_setPrivate", _wrap_CoreSession_setPrivate},
{"freeswitchc::CoreSession_getPrivate", _wrap_CoreSession_getPrivate},
{"freeswitchc::CoreSession_getVariable", _wrap_CoreSession_getVariable},
+{"freeswitchc::CoreSession_process_callback_result", _wrap_CoreSession_process_callback_result},
{"freeswitchc::CoreSession_recordFile", _wrap_CoreSession_recordFile},
{"freeswitchc::CoreSession_setCallerData", _wrap_CoreSession_setCallerData},
{"freeswitchc::CoreSession_originate", _wrap_CoreSession_originate},
@@ -8121,7 +8161,7 @@
SWIG_TypeClientData(SWIGTYPE_p_Stream, (void*) "freeswitch::Stream");
SWIG_TypeClientData(SWIGTYPE_p_Event, (void*) "freeswitch::Event");
SWIG_TypeClientData(SWIGTYPE_p_CoreSession, (void*) "freeswitch::CoreSession");
- SWIG_TypeClientData(SWIGTYPE_p_Session, (void*) "freeswitch::Session");
+ SWIG_TypeClientData(SWIGTYPE_p_PERL__Session, (void*) "freeswitch::Session");
ST(0) = &PL_sv_yes;
XSRETURN(1);
}
1
0
Author: anthm
Date: Sun May 11 20:29:57 2008
New Revision: 8357
Modified:
freeswitch/trunk/src/include/switch_cpp.h
freeswitch/trunk/src/switch_cpp.cpp
Log:
up
Modified: freeswitch/trunk/src/include/switch_cpp.h
==============================================================================
--- freeswitch/trunk/src/include/switch_cpp.h (original)
+++ freeswitch/trunk/src/include/switch_cpp.h Sun May 11 20:29:57 2008
@@ -14,7 +14,7 @@
#define sanity_check(x) do { if (!(session && allocated)) { switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_ERROR, "session is not initalized\n"); return x;}} while(0)
#define sanity_check_noreturn do { if (!(session && allocated)) { switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_ERROR, "session is not initalized\n"); return;}} while(0)
-#define init_vars() do { session = NULL; channel = NULL; uuid = NULL; tts_name = NULL; voice_name = NULL; memset(&args, 0, sizeof(args)); ap = NULL; caller_profile.source = "mod_unknown"; caller_profile.dialplan = ""; caller_profile.context = ""; caller_profile.caller_id_name = ""; caller_profile.caller_id_number = ""; caller_profile.network_addr = ""; caller_profile.ani = ""; caller_profile.aniii = ""; caller_profile.rdnis = ""; caller_profile.username = ""; on_hangup = NULL; memset(&cb_state, 0, sizeof(cb_state)); hook_state = CS_NEW; } while(0)
+#define init_vars() do { session = NULL; channel = NULL; uuid = NULL; tts_name = NULL; voice_name = NULL; xml_cdr_text = NULL; memset(&args, 0, sizeof(args)); ap = NULL; caller_profile.source = "mod_unknown"; caller_profile.dialplan = ""; caller_profile.context = ""; caller_profile.caller_id_name = ""; caller_profile.caller_id_number = ""; caller_profile.network_addr = ""; caller_profile.ani = ""; caller_profile.aniii = ""; caller_profile.rdnis = ""; caller_profile.username = ""; on_hangup = NULL; memset(&cb_state, 0, sizeof(cb_state)); hook_state = CS_NEW; } while(0)
//
@@ -169,12 +169,12 @@
switch_file_handle_t local_fh;
switch_file_handle_t *fhp;
char dtmf_buf[512];
- SWITCH_DECLARE(switch_status_t) process_callback_result(char *ret);
+
public:
SWITCH_DECLARE_CONSTRUCTOR CoreSession();
SWITCH_DECLARE_CONSTRUCTOR CoreSession(char *uuid);
SWITCH_DECLARE_CONSTRUCTOR CoreSession(switch_core_session_t *new_session);
- virtual SWITCH_DECLARE_CONSTRUCTOR ~CoreSession();
+ SWITCH_DECLARE_CONSTRUCTOR ~CoreSession();
switch_core_session_t *session;
switch_channel_t *channel;
unsigned int flags;
@@ -185,12 +185,12 @@
SWITCH_DECLARE(int) answer();
SWITCH_DECLARE(int) preAnswer();
- virtual SWITCH_DECLARE(void) hangup(char *cause = "normal_clearing");
+ SWITCH_DECLARE(void) hangup(char *cause = "normal_clearing");
SWITCH_DECLARE(void) setVariable(char *var, char *val);
SWITCH_DECLARE(void) setPrivate(char *var, void *val);
SWITCH_DECLARE(void *)getPrivate(char *var);
SWITCH_DECLARE(const char *)getVariable(char *var);
-
+ SWITCH_DECLARE(switch_status_t) process_callback_result(char *ret);
/** \brief Record to a file
* \param filename
Modified: freeswitch/trunk/src/switch_cpp.cpp
==============================================================================
--- freeswitch/trunk/src/switch_cpp.cpp (original)
+++ freeswitch/trunk/src/switch_cpp.cpp Sun May 11 20:29:57 2008
@@ -936,7 +936,6 @@
}
-
SWITCH_DECLARE(switch_status_t) CoreSession::process_callback_result(char *ret)
{
1
0
Author: anthm
Date: Sun May 11 20:24:38 2008
New Revision: 8356
Modified:
freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp
freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.h
freeswitch/trunk/src/mod/languages/mod_lua/hack.diff
freeswitch/trunk/src/mod/languages/mod_lua/mod_lua.cpp
freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp
Log:
add namespace
Modified: freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp (original)
+++ freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp Sun May 11 20:24:38 2008
@@ -1,5 +1,7 @@
+
#include <switch.h>
#include "freeswitch_lua.h"
+using namespace LUA;
Session::Session() : CoreSession()
{
Modified: freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.h
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.h (original)
+++ freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.h Sun May 11 20:24:38 2008
@@ -10,6 +10,7 @@
#include <switch_cpp.h>
+namespace LUA {
class Session : public CoreSession {
private:
virtual void do_hangup_hook();
@@ -38,5 +39,5 @@
char *hangup_func_arg;
void setLUA(lua_State *state);
};
-
+}
#endif
Modified: freeswitch/trunk/src/mod/languages/mod_lua/hack.diff
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_lua/hack.diff (original)
+++ freeswitch/trunk/src/mod/languages/mod_lua/hack.diff Sun May 11 20:24:38 2008
@@ -1,29 +1,29 @@
---- hack.cpp 2008-04-29 13:49:22.000000000 -0400
-+++ mod_lua_wrap.cpp 2008-04-29 13:49:10.000000000 -0400
-@@ -4028,7 +4028,7 @@
- SWIG_check_num_args("Session",0,0)
- result = (Session *)new Session();
+--- mod_lua_wrap.cpp 2008-05-11 20:03:58.000000000 -0400
++++ mod_lua_wrap2.cpp 2008-05-11 20:05:08.000000000 -0400
+@@ -5158,7 +5158,7 @@
+ SWIG_check_num_args("LUA::Session",0,0)
+ result = (LUA::Session *)new LUA::Session();
SWIG_arg=0;
-- SWIG_NewPointerObj(L,result,SWIGTYPE_p_Session,1); SWIG_arg++;
-+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_Session,1); SWIG_arg++; result->setLUA(L);
+- SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++;
++ SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L);
return SWIG_arg;
if(0) SWIG_fail;
-@@ -4049,7 +4049,7 @@
+@@ -5179,7 +5179,7 @@
arg1 = (char *)lua_tostring(L, 1);
- result = (Session *)new Session(arg1);
+ result = (LUA::Session *)new LUA::Session(arg1);
SWIG_arg=0;
-- SWIG_NewPointerObj(L,result,SWIGTYPE_p_Session,1); SWIG_arg++;
-+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_Session,1); SWIG_arg++; result->setLUA(L);
+- SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++;
++ SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L);
return SWIG_arg;
if(0) SWIG_fail;
-@@ -4074,7 +4074,7 @@
+@@ -5204,7 +5204,7 @@
- result = (Session *)new Session(arg1);
+ result = (LUA::Session *)new LUA::Session(arg1);
SWIG_arg=0;
-- SWIG_NewPointerObj(L,result,SWIGTYPE_p_Session,1); SWIG_arg++;
-+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_Session,1); SWIG_arg++; result->setLUA(L);
+- SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++;
++ SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L);
return SWIG_arg;
if(0) SWIG_fail;
Modified: freeswitch/trunk/src/mod/languages/mod_lua/mod_lua.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_lua/mod_lua.cpp (original)
+++ freeswitch/trunk/src/mod/languages/mod_lua/mod_lua.cpp Sun May 11 20:24:38 2008
@@ -29,6 +29,8 @@
*
*/
+
+
#include <switch.h>
SWITCH_BEGIN_EXTERN_C
#include "lua.h"
Modified: freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp (original)
+++ freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp Sun May 11 20:24:38 2008
@@ -1488,7 +1488,7 @@
#define SWIGTYPE_p_CoreSession swig_types[1]
#define SWIGTYPE_p_Event swig_types[2]
#define SWIGTYPE_p_IVRMenu swig_types[3]
-#define SWIGTYPE_p_Session swig_types[4]
+#define SWIGTYPE_p_LUA__Session swig_types[4]
#define SWIGTYPE_p_Stream swig_types[5]
#define SWIGTYPE_p_input_callback_state swig_types[6]
#define SWIGTYPE_p_lua_State swig_types[7]
@@ -3719,6 +3719,37 @@
}
+static int _wrap_CoreSession_process_callback_result(lua_State* L) {
+ int SWIG_arg = -1;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ switch_status_t result;
+
+ SWIG_check_num_args("process_callback_result",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("process_callback_result",1,"CoreSession *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("process_callback_result",2,"char *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
+ SWIG_fail_ptr("CoreSession_process_callback_result",1,SWIGTYPE_p_CoreSession);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ result = (arg1)->process_callback_result(arg2);
+ SWIG_arg=0;
+ {
+ switch_status_t * resultptr = new switch_status_t((switch_status_t &) result);
+ SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_status_t,1); SWIG_arg++;
+ }
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
static int _wrap_CoreSession_recordFile__SWIG_0(lua_State* L) {
int SWIG_arg = -1;
CoreSession *arg1 = (CoreSession *) 0 ;
@@ -4961,6 +4992,7 @@
{"setPrivate", _wrap_CoreSession_setPrivate},
{"getPrivate", _wrap_CoreSession_getPrivate},
{"getVariable", _wrap_CoreSession_getVariable},
+ {"process_callback_result", _wrap_CoreSession_process_callback_result},
{"recordFile", _wrap_CoreSession_recordFile},
{"setCallerData", _wrap_CoreSession_setCallerData},
{"originate", _wrap_CoreSession_originate},
@@ -5153,12 +5185,12 @@
static int _wrap_new_Session__SWIG_0(lua_State* L) {
int SWIG_arg = -1;
- Session *result = 0 ;
+ LUA::Session *result = 0 ;
- SWIG_check_num_args("Session",0,0)
- result = (Session *)new Session();
+ SWIG_check_num_args("LUA::Session",0,0)
+ result = (LUA::Session *)new LUA::Session();
SWIG_arg=0;
- SWIG_NewPointerObj(L,result,SWIGTYPE_p_Session,1); SWIG_arg++; result->setLUA(L);
+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L);
return SWIG_arg;
if(0) SWIG_fail;
@@ -5172,14 +5204,14 @@
static int _wrap_new_Session__SWIG_1(lua_State* L) {
int SWIG_arg = -1;
char *arg1 = (char *) 0 ;
- Session *result = 0 ;
+ LUA::Session *result = 0 ;
- SWIG_check_num_args("Session",1,1)
- if(!lua_isstring(L,1)) SWIG_fail_arg("Session",1,"char *");
+ SWIG_check_num_args("LUA::Session",1,1)
+ if(!lua_isstring(L,1)) SWIG_fail_arg("LUA::Session",1,"char *");
arg1 = (char *)lua_tostring(L, 1);
- result = (Session *)new Session(arg1);
+ result = (LUA::Session *)new LUA::Session(arg1);
SWIG_arg=0;
- SWIG_NewPointerObj(L,result,SWIGTYPE_p_Session,1); SWIG_arg++; result->setLUA(L);
+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L);
return SWIG_arg;
if(0) SWIG_fail;
@@ -5193,18 +5225,18 @@
static int _wrap_new_Session__SWIG_2(lua_State* L) {
int SWIG_arg = -1;
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
- Session *result = 0 ;
+ LUA::Session *result = 0 ;
- SWIG_check_num_args("Session",1,1)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Session",1,"switch_core_session_t *");
+ SWIG_check_num_args("LUA::Session",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session",1,"switch_core_session_t *");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_switch_core_session_t,0))){
SWIG_fail_ptr("new_Session",1,SWIGTYPE_p_switch_core_session_t);
}
- result = (Session *)new Session(arg1);
+ result = (LUA::Session *)new LUA::Session(arg1);
SWIG_arg=0;
- SWIG_NewPointerObj(L,result,SWIGTYPE_p_Session,1); SWIG_arg++; result->setLUA(L);
+ SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L);
return SWIG_arg;
if(0) SWIG_fail;
@@ -5256,13 +5288,13 @@
static int _wrap_delete_Session(lua_State* L) {
int SWIG_arg = -1;
- Session *arg1 = (Session *) 0 ;
+ LUA::Session *arg1 = (LUA::Session *) 0 ;
- SWIG_check_num_args("Session",1,1)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Session",1,"Session *");
+ SWIG_check_num_args("LUA::~Session",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::~Session",1,"LUA::Session *");
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Session,SWIG_POINTER_DISOWN))){
- SWIG_fail_ptr("delete_Session",1,SWIGTYPE_p_Session);
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,SWIG_POINTER_DISOWN))){
+ SWIG_fail_ptr("delete_Session",1,SWIGTYPE_p_LUA__Session);
}
delete arg1;
@@ -5281,14 +5313,14 @@
static int _wrap_Session_begin_allow_threads(lua_State* L) {
int SWIG_arg = -1;
- Session *arg1 = (Session *) 0 ;
+ LUA::Session *arg1 = (LUA::Session *) 0 ;
bool result;
SWIG_check_num_args("begin_allow_threads",1,1)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("begin_allow_threads",1,"Session *");
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("begin_allow_threads",1,"LUA::Session *");
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Session,0))){
- SWIG_fail_ptr("Session_begin_allow_threads",1,SWIGTYPE_p_Session);
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
+ SWIG_fail_ptr("Session_begin_allow_threads",1,SWIGTYPE_p_LUA__Session);
}
result = (bool)(arg1)->begin_allow_threads();
@@ -5306,14 +5338,14 @@
static int _wrap_Session_end_allow_threads(lua_State* L) {
int SWIG_arg = -1;
- Session *arg1 = (Session *) 0 ;
+ LUA::Session *arg1 = (LUA::Session *) 0 ;
bool result;
SWIG_check_num_args("end_allow_threads",1,1)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("end_allow_threads",1,"Session *");
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("end_allow_threads",1,"LUA::Session *");
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Session,0))){
- SWIG_fail_ptr("Session_end_allow_threads",1,SWIGTYPE_p_Session);
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
+ SWIG_fail_ptr("Session_end_allow_threads",1,SWIGTYPE_p_LUA__Session);
}
result = (bool)(arg1)->end_allow_threads();
@@ -5331,13 +5363,13 @@
static int _wrap_Session_check_hangup_hook(lua_State* L) {
int SWIG_arg = -1;
- Session *arg1 = (Session *) 0 ;
+ LUA::Session *arg1 = (LUA::Session *) 0 ;
SWIG_check_num_args("check_hangup_hook",1,1)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("check_hangup_hook",1,"Session *");
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("check_hangup_hook",1,"LUA::Session *");
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Session,0))){
- SWIG_fail_ptr("Session_check_hangup_hook",1,SWIGTYPE_p_Session);
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
+ SWIG_fail_ptr("Session_check_hangup_hook",1,SWIGTYPE_p_LUA__Session);
}
(arg1)->check_hangup_hook();
@@ -5355,19 +5387,19 @@
static int _wrap_Session_run_dtmf_callback(lua_State* L) {
int SWIG_arg = -1;
- Session *arg1 = (Session *) 0 ;
+ LUA::Session *arg1 = (LUA::Session *) 0 ;
void *arg2 = (void *) 0 ;
switch_input_type_t arg3 ;
switch_status_t result;
switch_input_type_t *argp3 ;
SWIG_check_num_args("run_dtmf_callback",3,3)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("run_dtmf_callback",1,"Session *");
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("run_dtmf_callback",1,"LUA::Session *");
if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("run_dtmf_callback",2,"void *");
if(!lua_isuserdata(L,3)) SWIG_fail_arg("run_dtmf_callback",3,"switch_input_type_t");
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Session,0))){
- SWIG_fail_ptr("Session_run_dtmf_callback",1,SWIGTYPE_p_Session);
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
+ SWIG_fail_ptr("Session_run_dtmf_callback",1,SWIGTYPE_p_LUA__Session);
}
arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"Session_run_dtmf_callback");
@@ -5395,17 +5427,17 @@
static int _wrap_Session_setInputCallback(lua_State* L) {
int SWIG_arg = -1;
- Session *arg1 = (Session *) 0 ;
+ LUA::Session *arg1 = (LUA::Session *) 0 ;
char *arg2 = (char *) 0 ;
char *arg3 = (char *) 0 ;
SWIG_check_num_args("setInputCallback",3,3)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setInputCallback",1,"Session *");
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setInputCallback",1,"LUA::Session *");
if(!lua_isstring(L,2)) SWIG_fail_arg("setInputCallback",2,"char *");
if(!lua_isstring(L,3)) SWIG_fail_arg("setInputCallback",3,"char *");
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Session,0))){
- SWIG_fail_ptr("Session_setInputCallback",1,SWIGTYPE_p_Session);
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
+ SWIG_fail_ptr("Session_setInputCallback",1,SWIGTYPE_p_LUA__Session);
}
arg2 = (char *)lua_tostring(L, 2);
@@ -5425,17 +5457,17 @@
static int _wrap_Session_setHangupHook__SWIG_0(lua_State* L) {
int SWIG_arg = -1;
- Session *arg1 = (Session *) 0 ;
+ LUA::Session *arg1 = (LUA::Session *) 0 ;
char *arg2 = (char *) 0 ;
char *arg3 = (char *) 0 ;
SWIG_check_num_args("setHangupHook",3,3)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setHangupHook",1,"Session *");
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setHangupHook",1,"LUA::Session *");
if(!lua_isstring(L,2)) SWIG_fail_arg("setHangupHook",2,"char *");
if(!lua_isstring(L,3)) SWIG_fail_arg("setHangupHook",3,"char *");
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Session,0))){
- SWIG_fail_ptr("Session_setHangupHook",1,SWIGTYPE_p_Session);
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
+ SWIG_fail_ptr("Session_setHangupHook",1,SWIGTYPE_p_LUA__Session);
}
arg2 = (char *)lua_tostring(L, 2);
@@ -5455,15 +5487,15 @@
static int _wrap_Session_setHangupHook__SWIG_1(lua_State* L) {
int SWIG_arg = -1;
- Session *arg1 = (Session *) 0 ;
+ LUA::Session *arg1 = (LUA::Session *) 0 ;
char *arg2 = (char *) 0 ;
SWIG_check_num_args("setHangupHook",2,2)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setHangupHook",1,"Session *");
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setHangupHook",1,"LUA::Session *");
if(!lua_isstring(L,2)) SWIG_fail_arg("setHangupHook",2,"char *");
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Session,0))){
- SWIG_fail_ptr("Session_setHangupHook",1,SWIGTYPE_p_Session);
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
+ SWIG_fail_ptr("Session_setHangupHook",1,SWIGTYPE_p_LUA__Session);
}
arg2 = (char *)lua_tostring(L, 2);
@@ -5491,7 +5523,7 @@
int _v;
{
void *ptr;
- if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Session, 0)) {
+ if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_LUA__Session, 0)) {
_v = 0;
} else {
_v = 1;
@@ -5510,7 +5542,7 @@
int _v;
{
void *ptr;
- if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Session, 0)) {
+ if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_LUA__Session, 0)) {
_v = 0;
} else {
_v = 1;
@@ -5538,14 +5570,14 @@
static int _wrap_Session_ready(lua_State* L) {
int SWIG_arg = -1;
- Session *arg1 = (Session *) 0 ;
+ LUA::Session *arg1 = (LUA::Session *) 0 ;
bool result;
SWIG_check_num_args("ready",1,1)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ready",1,"Session *");
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ready",1,"LUA::Session *");
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Session,0))){
- SWIG_fail_ptr("Session_ready",1,SWIGTYPE_p_Session);
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
+ SWIG_fail_ptr("Session_ready",1,SWIGTYPE_p_LUA__Session);
}
result = (bool)(arg1)->ready();
@@ -5563,15 +5595,15 @@
static int _wrap_Session_cb_function_set(lua_State* L) {
int SWIG_arg = -1;
- Session *arg1 = (Session *) 0 ;
+ LUA::Session *arg1 = (LUA::Session *) 0 ;
char *arg2 = (char *) 0 ;
SWIG_check_num_args("cb_function",2,2)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_function",1,"Session *");
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_function",1,"LUA::Session *");
if(!lua_isstring(L,2)) SWIG_fail_arg("cb_function",2,"char *");
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Session,0))){
- SWIG_fail_ptr("Session_cb_function_set",1,SWIGTYPE_p_Session);
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
+ SWIG_fail_ptr("Session_cb_function_set",1,SWIGTYPE_p_LUA__Session);
}
arg2 = (char *)lua_tostring(L, 2);
@@ -5598,14 +5630,14 @@
static int _wrap_Session_cb_function_get(lua_State* L) {
int SWIG_arg = -1;
- Session *arg1 = (Session *) 0 ;
+ LUA::Session *arg1 = (LUA::Session *) 0 ;
char *result = 0 ;
SWIG_check_num_args("cb_function",1,1)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_function",1,"Session *");
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_function",1,"LUA::Session *");
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Session,0))){
- SWIG_fail_ptr("Session_cb_function_get",1,SWIGTYPE_p_Session);
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
+ SWIG_fail_ptr("Session_cb_function_get",1,SWIGTYPE_p_LUA__Session);
}
result = (char *) ((arg1)->cb_function);
@@ -5623,15 +5655,15 @@
static int _wrap_Session_cb_arg_set(lua_State* L) {
int SWIG_arg = -1;
- Session *arg1 = (Session *) 0 ;
+ LUA::Session *arg1 = (LUA::Session *) 0 ;
char *arg2 = (char *) 0 ;
SWIG_check_num_args("cb_arg",2,2)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_arg",1,"Session *");
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_arg",1,"LUA::Session *");
if(!lua_isstring(L,2)) SWIG_fail_arg("cb_arg",2,"char *");
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Session,0))){
- SWIG_fail_ptr("Session_cb_arg_set",1,SWIGTYPE_p_Session);
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
+ SWIG_fail_ptr("Session_cb_arg_set",1,SWIGTYPE_p_LUA__Session);
}
arg2 = (char *)lua_tostring(L, 2);
@@ -5658,14 +5690,14 @@
static int _wrap_Session_cb_arg_get(lua_State* L) {
int SWIG_arg = -1;
- Session *arg1 = (Session *) 0 ;
+ LUA::Session *arg1 = (LUA::Session *) 0 ;
char *result = 0 ;
SWIG_check_num_args("cb_arg",1,1)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_arg",1,"Session *");
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_arg",1,"LUA::Session *");
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Session,0))){
- SWIG_fail_ptr("Session_cb_arg_get",1,SWIGTYPE_p_Session);
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
+ SWIG_fail_ptr("Session_cb_arg_get",1,SWIGTYPE_p_LUA__Session);
}
result = (char *) ((arg1)->cb_arg);
@@ -5683,15 +5715,15 @@
static int _wrap_Session_hangup_func_str_set(lua_State* L) {
int SWIG_arg = -1;
- Session *arg1 = (Session *) 0 ;
+ LUA::Session *arg1 = (LUA::Session *) 0 ;
char *arg2 = (char *) 0 ;
SWIG_check_num_args("hangup_func_str",2,2)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_str",1,"Session *");
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_str",1,"LUA::Session *");
if(!lua_isstring(L,2)) SWIG_fail_arg("hangup_func_str",2,"char *");
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Session,0))){
- SWIG_fail_ptr("Session_hangup_func_str_set",1,SWIGTYPE_p_Session);
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
+ SWIG_fail_ptr("Session_hangup_func_str_set",1,SWIGTYPE_p_LUA__Session);
}
arg2 = (char *)lua_tostring(L, 2);
@@ -5718,14 +5750,14 @@
static int _wrap_Session_hangup_func_str_get(lua_State* L) {
int SWIG_arg = -1;
- Session *arg1 = (Session *) 0 ;
+ LUA::Session *arg1 = (LUA::Session *) 0 ;
char *result = 0 ;
SWIG_check_num_args("hangup_func_str",1,1)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_str",1,"Session *");
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_str",1,"LUA::Session *");
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Session,0))){
- SWIG_fail_ptr("Session_hangup_func_str_get",1,SWIGTYPE_p_Session);
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
+ SWIG_fail_ptr("Session_hangup_func_str_get",1,SWIGTYPE_p_LUA__Session);
}
result = (char *) ((arg1)->hangup_func_str);
@@ -5743,15 +5775,15 @@
static int _wrap_Session_hangup_func_arg_set(lua_State* L) {
int SWIG_arg = -1;
- Session *arg1 = (Session *) 0 ;
+ LUA::Session *arg1 = (LUA::Session *) 0 ;
char *arg2 = (char *) 0 ;
SWIG_check_num_args("hangup_func_arg",2,2)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_arg",1,"Session *");
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_arg",1,"LUA::Session *");
if(!lua_isstring(L,2)) SWIG_fail_arg("hangup_func_arg",2,"char *");
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Session,0))){
- SWIG_fail_ptr("Session_hangup_func_arg_set",1,SWIGTYPE_p_Session);
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
+ SWIG_fail_ptr("Session_hangup_func_arg_set",1,SWIGTYPE_p_LUA__Session);
}
arg2 = (char *)lua_tostring(L, 2);
@@ -5778,14 +5810,14 @@
static int _wrap_Session_hangup_func_arg_get(lua_State* L) {
int SWIG_arg = -1;
- Session *arg1 = (Session *) 0 ;
+ LUA::Session *arg1 = (LUA::Session *) 0 ;
char *result = 0 ;
SWIG_check_num_args("hangup_func_arg",1,1)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_arg",1,"Session *");
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_arg",1,"LUA::Session *");
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Session,0))){
- SWIG_fail_ptr("Session_hangup_func_arg_get",1,SWIGTYPE_p_Session);
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
+ SWIG_fail_ptr("Session_hangup_func_arg_get",1,SWIGTYPE_p_LUA__Session);
}
result = (char *) ((arg1)->hangup_func_arg);
@@ -5803,15 +5835,15 @@
static int _wrap_Session_setLUA(lua_State* L) {
int SWIG_arg = -1;
- Session *arg1 = (Session *) 0 ;
+ LUA::Session *arg1 = (LUA::Session *) 0 ;
lua_State *arg2 = (lua_State *) 0 ;
arg2 = L;
SWIG_check_num_args("setLUA",1,1)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setLUA",1,"Session *");
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setLUA",1,"LUA::Session *");
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Session,0))){
- SWIG_fail_ptr("Session_setLUA",1,SWIGTYPE_p_Session);
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
+ SWIG_fail_ptr("Session_setLUA",1,SWIGTYPE_p_LUA__Session);
}
(arg1)->setLUA(arg2);
@@ -5828,10 +5860,10 @@
static void swig_delete_Session(void *obj) {
-Session *arg1 = (Session *) obj;
+LUA::Session *arg1 = (LUA::Session *) obj;
delete arg1;
}
-static swig_lua_method swig_Session_methods[] = {
+static swig_lua_method swig_LUA_Session_methods[] = {
{"begin_allow_threads", _wrap_Session_begin_allow_threads},
{"end_allow_threads", _wrap_Session_end_allow_threads},
{"check_hangup_hook", _wrap_Session_check_hangup_hook},
@@ -5842,16 +5874,16 @@
{"setLUA", _wrap_Session_setLUA},
{0,0}
};
-static swig_lua_attribute swig_Session_attributes[] = {
+static swig_lua_attribute swig_LUA_Session_attributes[] = {
{ "cb_function", _wrap_Session_cb_function_get, _wrap_Session_cb_function_set},
{ "cb_arg", _wrap_Session_cb_arg_get, _wrap_Session_cb_arg_set},
{ "hangup_func_str", _wrap_Session_hangup_func_str_get, _wrap_Session_hangup_func_str_set},
{ "hangup_func_arg", _wrap_Session_hangup_func_arg_get, _wrap_Session_hangup_func_arg_set},
{0,0,0}
};
-static swig_lua_class *swig_Session_bases[] = {0,0};
-static const char *swig_Session_base_names[] = {"CoreSession *",0};
-static swig_lua_class _wrap_class_Session = { "Session", &SWIGTYPE_p_Session,_wrap_new_Session, swig_delete_Session, swig_Session_methods, swig_Session_attributes, swig_Session_bases, swig_Session_base_names };
+static swig_lua_class *swig_LUA_Session_bases[] = {0,0};
+static const char *swig_LUA_Session_base_names[] = {"CoreSession *",0};
+static swig_lua_class _wrap_class_LUA_Session = { "Session", &SWIGTYPE_p_LUA__Session,_wrap_new_Session, swig_delete_Session, swig_LUA_Session_methods, swig_LUA_Session_attributes, swig_LUA_Session_bases, swig_LUA_Session_base_names };
#ifdef __cplusplus
}
@@ -5881,14 +5913,14 @@
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
-static void *_p_SessionTo_p_CoreSession(void *x, int *newmemory) {
- return (void *)((CoreSession *) ((Session *) x));
+static void *_p_LUA__SessionTo_p_CoreSession(void *x, int *newmemory) {
+ return (void *)((CoreSession *) ((LUA::Session *) x));
}
static swig_type_info _swigt__p_API = {"_p_API", "API *", 0, 0, (void*)&_wrap_class_API, 0};
static swig_type_info _swigt__p_CoreSession = {"_p_CoreSession", "CoreSession *", 0, 0, (void*)&_wrap_class_CoreSession, 0};
static swig_type_info _swigt__p_Event = {"_p_Event", "Event *", 0, 0, (void*)&_wrap_class_Event, 0};
static swig_type_info _swigt__p_IVRMenu = {"_p_IVRMenu", "IVRMenu *", 0, 0, (void*)&_wrap_class_IVRMenu, 0};
-static swig_type_info _swigt__p_Session = {"_p_Session", "Session *", 0, 0, (void*)&_wrap_class_Session, 0};
+static swig_type_info _swigt__p_LUA__Session = {"_p_LUA__Session", "LUA::Session *", 0, 0, (void*)&_wrap_class_LUA_Session, 0};
static swig_type_info _swigt__p_Stream = {"_p_Stream", "Stream *", 0, 0, (void*)&_wrap_class_Stream, 0};
static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state", "input_callback_state_t *|input_callback_state *", 0, 0, (void*)&_wrap_class_input_callback_state_t, 0};
static swig_type_info _swigt__p_lua_State = {"_p_lua_State", "lua_State *", 0, 0, (void*)0, 0};
@@ -5909,7 +5941,7 @@
&_swigt__p_CoreSession,
&_swigt__p_Event,
&_swigt__p_IVRMenu,
- &_swigt__p_Session,
+ &_swigt__p_LUA__Session,
&_swigt__p_Stream,
&_swigt__p_input_callback_state,
&_swigt__p_lua_State,
@@ -5927,10 +5959,10 @@
};
static swig_cast_info _swigc__p_API[] = { {&_swigt__p_API, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_CoreSession[] = { {&_swigt__p_CoreSession, 0, 0, 0}, {&_swigt__p_Session, _p_SessionTo_p_CoreSession, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CoreSession[] = { {&_swigt__p_CoreSession, 0, 0, 0}, {&_swigt__p_LUA__Session, _p_LUA__SessionTo_p_CoreSession, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Event[] = { {&_swigt__p_Event, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_IVRMenu[] = { {&_swigt__p_IVRMenu, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_Session[] = { {&_swigt__p_Session, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_LUA__Session[] = { {&_swigt__p_LUA__Session, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_Stream[] = { {&_swigt__p_Stream, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_input_callback_state[] = { {&_swigt__p_input_callback_state, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_lua_State[] = { {&_swigt__p_lua_State, 0, 0, 0},{0, 0, 0, 0}};
@@ -5951,7 +5983,7 @@
_swigc__p_CoreSession,
_swigc__p_Event,
_swigc__p_IVRMenu,
- _swigc__p_Session,
+ _swigc__p_LUA__Session,
_swigc__p_Stream,
_swigc__p_input_callback_state,
_swigc__p_lua_State,
1
0
Author: stkn
Date: Sat May 10 18:50:48 2008
New Revision: 8355
Modified:
freeswitch/trunk/configure.in
Log:
Fix AC_ARG_ENABLE value handling and rename --enable-resampler to --disable-resampler in help output since it is default enabled
Modified: freeswitch/trunk/configure.in
==============================================================================
--- freeswitch/trunk/configure.in (original)
+++ freeswitch/trunk/configure.in Sat May 10 18:50:48 2008
@@ -67,7 +67,7 @@
# Optional Features
AC_ARG_ENABLE(resample,
-[AC_HELP_STRING([--enable-resample],[build with embedded resampler])],[enable_resample="$enable_resample"],[enable_resample="yes"])
+[AC_HELP_STRING([--disable-resample],[build without embedded resampler])],[enable_resample="$enableval"],[enable_resample="yes"])
# We should add checking for out of tree libresample here
RESAMPLE_LIB=
1
0
Author: mikej
Date: Sat May 10 17:10:44 2008
New Revision: 8354
Modified:
freeswitch/trunk/src/include/switch_stun.h
freeswitch/trunk/src/switch_rtp.c
freeswitch/trunk/src/switch_stun.c
Log:
catch buffer overflow from invalid stun packet.
Modified: freeswitch/trunk/src/include/switch_stun.h
==============================================================================
--- freeswitch/trunk/src/include/switch_stun.h (original)
+++ freeswitch/trunk/src/include/switch_stun.h Sat May 10 17:10:44 2008
@@ -221,7 +221,7 @@
\param attribute the pointer to increment
\return true or false depending on if there are any more attributes
*/
-#define switch_stun_packet_next_attribute(attribute) (attribute = (switch_stun_packet_attribute_t *) (attribute->value + attribute->length)) && attribute->length
+#define switch_stun_packet_next_attribute(attribute, end) (attribute && (attribute = (switch_stun_packet_attribute_t *) (attribute->value + attribute->length)) && ((void *)attribute < end) && attribute->length && ((void *)(attribute + attribute->length) < end))
/*!
\brief Obtain the correct length in bytes of a stun packet
Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c (original)
+++ freeswitch/trunk/src/switch_rtp.c Sat May 10 17:10:44 2008
@@ -238,6 +238,7 @@
{
switch_stun_packet_t *packet;
switch_stun_packet_attribute_t *attr;
+ void *end_buf;
char username[33] = { 0 };
unsigned char buf[512] = { 0 };
switch_size_t cpylen = len;
@@ -260,6 +261,7 @@
memcpy(buf, data, cpylen);
packet = switch_stun_packet_parse(buf, sizeof(buf));
+ end_buf = buf + sizeof(buf);
rtp_session->last_stun = switch_time_now();
switch_stun_packet_first_attribute(packet, attr);
@@ -279,7 +281,7 @@
}
break;
}
- } while (switch_stun_packet_next_attribute(attr));
+ } while (switch_stun_packet_next_attribute(attr, end_buf));
if ((packet->header.type == SWITCH_STUN_BINDING_REQUEST) && !strcmp(rtp_session->user_ice, username)) {
uint8_t stunbuf[512];
Modified: freeswitch/trunk/src/switch_stun.c
==============================================================================
--- freeswitch/trunk/src/switch_stun.c (original)
+++ freeswitch/trunk/src/switch_stun.c Sat May 10 17:10:44 2008
@@ -117,6 +117,7 @@
{
switch_stun_packet_t *packet;
switch_stun_packet_attribute_t *attr;
+ void *end_buf = buf + len;
if (len < SWITCH_STUN_PACKET_MIN_LEN) {
return NULL;
@@ -141,7 +142,7 @@
}
break;
}
- } while (switch_stun_packet_next_attribute(attr));
+ } while (switch_stun_packet_next_attribute(attr, end_buf));
return packet;
}
@@ -273,6 +274,7 @@
switch_sockaddr_t *local_addr = NULL, *remote_addr = NULL, *from_addr = NULL;
switch_socket_t *sock = NULL;
uint8_t buf[256] = { 0 };
+ void *end_buf;
switch_stun_packet_t *packet;
switch_stun_packet_attribute_t *attr;
switch_size_t bytes = 0;
@@ -335,6 +337,7 @@
switch_socket_close(sock);
packet = switch_stun_packet_parse(buf, sizeof(buf));
+ end_buf = buf + sizeof(buf);
switch_stun_packet_first_attribute(packet, attr);
do {
@@ -350,7 +353,7 @@
}
break;
}
- } while (switch_stun_packet_next_attribute(attr));
+ } while (switch_stun_packet_next_attribute(attr, end_buf));
if (packet->header.type == SWITCH_STUN_BINDING_RESPONSE) {
*ip = switch_core_strdup(pool, rip);
1
0