Freeswitch-branches
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
June 2007
- 6 participants
- 67 discussions
[commit] r5395 - in freeswitch/branches/greenlizard: . build src src/include src/mod/applications/mod_conference src/mod/applications/mod_dptools src/mod/endpoints/mod_sofia src/mod/event_handlers/mod_radius_cdr src/mod/languages/mod_spidermonkey
by Freeswitch SVN 19 Jun '07
by Freeswitch SVN 19 Jun '07
19 Jun '07
Author: greenlizard
Date: Tue Jun 19 19:32:04 2007
New Revision: 5395
Modified:
freeswitch/branches/greenlizard/build/modules.conf.in
freeswitch/branches/greenlizard/configure.in
freeswitch/branches/greenlizard/src/include/switch_ivr.h
freeswitch/branches/greenlizard/src/include/switch_stun.h
freeswitch/branches/greenlizard/src/mod/applications/mod_conference/mod_conference.c
freeswitch/branches/greenlizard/src/mod/applications/mod_dptools/mod_dptools.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/branches/greenlizard/src/mod/event_handlers/mod_radius_cdr/README
freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.h
freeswitch/branches/greenlizard/src/switch_core_media_bug.c
freeswitch/branches/greenlizard/src/switch_ivr_async.c
freeswitch/branches/greenlizard/src/switch_ivr_originate.c
freeswitch/branches/greenlizard/src/switch_ivr_play_say.c
Log:
merge trunk version 5382 to 5394
Modified: freeswitch/branches/greenlizard/build/modules.conf.in
==============================================================================
--- freeswitch/branches/greenlizard/build/modules.conf.in (original)
+++ freeswitch/branches/greenlizard/build/modules.conf.in Tue Jun 19 19:32:04 2007
@@ -31,6 +31,7 @@
#event_handlers/mod_cdr
#event_handlers/mod_event_multicast
event_handlers/mod_event_socket
+#event_handlers/mod_radius_cdr
#event_handlers/mod_event_test
#event_handlers/mod_xmpp_event
#event_handlers/mod_zeroconf
Modified: freeswitch/branches/greenlizard/configure.in
==============================================================================
--- freeswitch/branches/greenlizard/configure.in (original)
+++ freeswitch/branches/greenlizard/configure.in Tue Jun 19 19:32:04 2007
@@ -334,6 +334,7 @@
src/mod/Makefile
src/mod/event_handlers/mod_cdr/Makefile
src/mod/endpoints/mod_sofia/Makefile
+ src/mod/event_handlers/mod_radius_cdr/Makefile
src/include/switch_am_config.h
build/getlib.sh
build/modmake.rules])
Modified: freeswitch/branches/greenlizard/src/include/switch_ivr.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_ivr.h (original)
+++ freeswitch/branches/greenlizard/src/include/switch_ivr.h Tue Jun 19 19:32:04 2007
@@ -267,6 +267,7 @@
*/
SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *session, switch_file_handle_t *fh, char *file, switch_input_args_t *args);
+SWITCH_DECLARE(switch_status_t) switch_ivr_gentones(switch_core_session_t *session, char *script, int32_t loops, switch_input_args_t *args);
/*!
\brief record a file from the session to a file
Modified: freeswitch/branches/greenlizard/src/include/switch_stun.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_stun.h (original)
+++ freeswitch/branches/greenlizard/src/include/switch_stun.h Tue Jun 19 19:32:04 2007
@@ -106,12 +106,12 @@
typedef struct {
int16_t type;
uint16_t length;
- char value[1];
+ char value[];
} switch_stun_packet_attribute_t;
typedef struct {
switch_stun_packet_header_t header;
- uint8_t first_attribute[1];
+ uint8_t first_attribute[];
} switch_stun_packet_t;
typedef struct {
@@ -228,7 +228,7 @@
\param packet the packet in question
\return the size in bytes (host order) of the entire packet
*/
-#define switch_stun_packet_length(packet) ntohs(packet->header.length) + sizeof(switch_stun_packet_header_t)
+#define switch_stun_packet_length(packet) ntohs(packet->header.length) + (sizeof(switch_stun_packet_header_t))
///\}
SWITCH_END_EXTERN_C
Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_conference/mod_conference.c (original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_conference/mod_conference.c Tue Jun 19 19:32:04 2007
@@ -2118,7 +2118,7 @@
char *dfile = NULL, *expanded = NULL;
if (member != NULL && file != NULL) {
- conference_file_node_t *fnode, *nptr;
+ conference_file_node_t *fnode, *nptr = NULL;
switch_memory_pool_t *pool;
if ((expanded = switch_channel_expand_variables(switch_core_session_get_channel(member->session), file)) != file) {
@@ -2128,7 +2128,7 @@
}
if (!strncasecmp(file, "say:", 4)) {
- status = conference_say(member->conference, file + 4, leadin);
+ status = conference_member_say(member, file + 4, leadin);
goto done;
}
@@ -2139,7 +2139,7 @@
}
file = dfile;
} else {
- status = conference_say(member->conference, file, leadin);
+ status = conference_member_say(member, file, leadin);
goto done;
}
}
Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_dptools/mod_dptools.c (original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_dptools/mod_dptools.c Tue Jun 19 19:32:04 2007
@@ -820,6 +820,35 @@
}
+static void gentones_function(switch_core_session_t *session, char *data)
+{
+ switch_channel_t *channel;
+ char *tone_script = NULL;
+ switch_input_args_t args = { 0 };
+ char *l;
+ int32_t loops = 0;
+
+ tone_script = switch_core_session_strdup(session, data);
+
+ channel = switch_core_session_get_channel(session);
+ assert(channel != NULL);
+
+ switch_channel_pre_answer(channel);
+
+ if ((l = strchr(tone_script, '|'))) {
+ *l++ = '\0';
+ loops = atoi(l);
+
+ if (loops < 0) {
+ loops = -1;
+ }
+ }
+
+ args.input_callback = on_dtmf;
+ switch_ivr_gentones(session, tone_script, loops, &args);
+
+}
+
static void displace_session_function(switch_core_session_t *session, char *data)
{
switch_channel_t *channel;
@@ -1064,7 +1093,7 @@
};
static switch_application_interface_t displace_application_interface = {
- /*.interface_name */ "displace",
+ /*.interface_name */ "displace_session",
/*.application_function */ displace_session_function,
/* long_desc */ "Displace audio from a file to the channels input",
/* short_desc */ "Displace File",
@@ -1074,7 +1103,7 @@
};
static switch_application_interface_t stop_displace_application_interface = {
- /*.interface_name */ "displace",
+ /*.interface_name */ "stop_displace_session",
/*.application_function */ stop_displace_session_function,
/* long_desc */ "Stop Displacing to a file",
/* short_desc */ "Stop Displace File",
@@ -1124,6 +1153,17 @@
/* flags */ SAF_NONE,
/*.next */ &stop_record_session_application_interface
};
+
+static switch_application_interface_t gentones_application_interface = {
+ /*.interface_name */ "gentones",
+ /*.application_function */ gentones_function,
+ /* long_desc */ "Generate tones to the channel",
+ /* short_desc */ "Generate Tones",
+ /* syntax */ "<tgml_script>[|<loops>]",
+ /* flags */ SAF_NONE,
+ /*.next */ &playback_application_interface
+};
+
static switch_application_interface_t park_application_interface = {
/*.interface_name */ "park",
/*.application_function */ park_function,
@@ -1131,7 +1171,7 @@
/* short_desc */ NULL,
/* syntax */ NULL,
/* flags */ SAF_NONE,
- /*.next */ &playback_application_interface
+ /*.next */ &gentones_application_interface
};
static switch_application_interface_t echo_application_interface = {
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.c Tue Jun 19 19:32:04 2007
@@ -227,6 +227,8 @@
switch_core_session_rwunlock(a_session);
}
+ switch_mutex_lock(tech_pvt->profile->flag_mutex);
+
if (tech_pvt->nh) {
if (!switch_test_flag(tech_pvt, TFLAG_BYE)) {
if (switch_test_flag(tech_pvt, TFLAG_ANS)) {
@@ -241,13 +243,11 @@
nua_cancel(tech_pvt->nh, TAG_END());
}
}
- switch_set_flag_locked(tech_pvt, TFLAG_BYE);
+ switch_set_flag(tech_pvt, TFLAG_BYE);
}
}
- switch_clear_flag_locked(tech_pvt, TFLAG_IO);
-
-
+ switch_clear_flag(tech_pvt, TFLAG_IO);
tech_pvt->profile->inuse--;
switch_mutex_unlock(tech_pvt->profile->flag_mutex);
Modified: freeswitch/branches/greenlizard/src/mod/event_handlers/mod_radius_cdr/README
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/event_handlers/mod_radius_cdr/README (original)
+++ freeswitch/branches/greenlizard/src/mod/event_handlers/mod_radius_cdr/README Tue Jun 19 19:32:04 2007
@@ -28,17 +28,31 @@
1) Compile and install freeradius-client library.
-2) Edit the top-level 'modules.conf'. Add the following entry:
+2) Edit the top level 'configure.in'. At approx line 336 you need to add:
+
+---
+AC_CONFIG_FILES([Makefile
+ src/Makefile
+ src/mod/Makefile
+ src/mod/event_handlers/mod_cdr/Makefile
++ src/mod/event_handlers/mod_radius_cdr/Makefile
+ src/mod/endpoints/mod_sofia/Makefile
+ src/include/switch_am_config.h
+ build/getlib.sh
+ build/modmake.rules])
+---
+
+3) Rerun bootstrap, re-run configure
+
+4) Edit the top-level 'modules.conf'. Add the following entry:
...
event_handlers/mod_radius_cdr
...
-3) Re-run configure ??? ( does this need to be done???)
-
-4) Run make, and make install. Make sure the module is built and installed.
+5) Run make, and make install. Make sure the module is built and installed.
-5) Configure FreeSWITCH to load it
+6) Configure FreeSWITCH to load mod_radius_cdr
- Copy the 'mod_radius_cdr.conf.xml' file to the FreeSWITCH conf directory
- Copy the 'radius/' directory to the FreeSWITCH conf directory
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c Tue Jun 19 19:32:04 2007
@@ -63,6 +63,7 @@
static void session_destroy(JSContext * cx, JSObject * obj);
static JSBool session_construct(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval);
static JSBool session_originate(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval);
+static JSBool session_set_callerdata(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval);
static switch_api_interface_t js_run_interface;
static switch_api_interface_t jsapi_interface;
@@ -80,7 +81,7 @@
static JSClass global_class = {
"Global", JSCLASS_HAS_PRIVATE,
- JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, DEFAULT_SET_PROPERTY,
+ JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub
};
@@ -1994,6 +1995,7 @@
static JSFunctionSpec session_methods[] = {
{"originate", session_originate, 2},
+ {"setCallerData", session_set_callerdata, 2},
{"setHangupHook", session_hanguphook, 1},
{"setAutoHangup", session_autohangup, 1},
{"sayPhrase", session_sayphrase, 1},
@@ -2173,6 +2175,51 @@
return JS_TRUE;
}
+static JSBool session_set_callerdata(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
+{
+ struct js_session *jss = NULL;
+ jss = JS_GetPrivate(cx, obj);
+ *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
+
+ if (argc > 1) {
+ char *var, *val, **toset = NULL;
+ var = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
+ val = JS_GetStringBytes(JS_ValueToString(cx, argv[1]));
+
+ if (!strcasecmp(var, "dialplan")) {
+ toset = &jss->dialplan;
+ } else if (!strcasecmp(var, "username")) {
+ toset = &jss->username;
+ } else if (!strcasecmp(var, "caller_id_name")) {
+ toset = &jss->caller_id_name;
+ } else if (!strcasecmp(var, "ani")) {
+ toset = &jss->ani;
+ } else if (!strcasecmp(var, "aniii")) {
+ toset = &jss->aniii;
+ } else if (!strcasecmp(var, "caller_id_number")) {
+ toset = &jss->caller_id_number;
+ } else if (!strcasecmp(var, "network_addr")) {
+ toset = &jss->network_addr;
+ } else if (!strcasecmp(var, "rdnis")) {
+ toset = &jss->rdnis;
+ } else if (!strcasecmp(var, "destination_number")) {
+ toset = &jss->destination_number;
+ } else if (!strcasecmp(var, "context")) {
+ toset = &jss->context;
+ }
+
+ if (toset) {
+ switch_safe_free(*toset);
+ *toset = strdup(val);
+ }
+
+ }
+
+ return JS_TRUE;
+
+}
+
+
static JSBool session_originate(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
{
struct js_session *jss = NULL;
@@ -2196,7 +2243,8 @@
char *context = "";
char *username = NULL;
char *to = NULL;
-
+ char *tmp;
+
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
if (JS_ValueToObject(cx, argv[0], &session_obj)) {
@@ -2215,6 +2263,15 @@
}
}
+ if (!switch_strlen_zero(jss->dialplan)) dialplan = jss->dialplan;
+ if (!switch_strlen_zero(jss->caller_id_name)) cid_name = jss->caller_id_name;
+ if (!switch_strlen_zero(jss->caller_id_number)) cid_num = jss->caller_id_number;
+ if (!switch_strlen_zero(jss->ani)) ani = jss->ani;
+ if (!switch_strlen_zero(jss->aniii)) aniii = jss->aniii;
+ if (!switch_strlen_zero(jss->rdnis)) rdnis = jss->rdnis;
+ if (!switch_strlen_zero(jss->context)) context = jss->context;
+ if (!switch_strlen_zero(jss->username)) username = jss->username;
+
dest = JS_GetStringBytes(JS_ValueToString(cx, argv[1]));
if (!strchr(dest, '/')) {
@@ -2223,36 +2280,12 @@
}
if (argc > 2) {
- dialplan = JS_GetStringBytes(JS_ValueToString(cx, argv[2]));
+ tmp = JS_GetStringBytes(JS_ValueToString(cx, argv[2]));
+ if (!switch_strlen_zero(tmp)) {
+ to = tmp;
+ }
}
- if (argc > 3) {
- context = JS_GetStringBytes(JS_ValueToString(cx, argv[3]));
- }
- if (argc > 4) {
- cid_name = JS_GetStringBytes(JS_ValueToString(cx, argv[4]));
- }
- if (argc > 5) {
- cid_num = JS_GetStringBytes(JS_ValueToString(cx, argv[5]));
- }
- if (argc > 6) {
- network_addr = JS_GetStringBytes(JS_ValueToString(cx, argv[6]));
- }
- if (argc > 7) {
- ani = JS_GetStringBytes(JS_ValueToString(cx, argv[7]));
- }
- if (argc > 8) {
- aniii = JS_GetStringBytes(JS_ValueToString(cx, argv[8]));
- }
- if (argc > 9) {
- rdnis = JS_GetStringBytes(JS_ValueToString(cx, argv[9]));
- }
- if (argc > 10) {
- username = JS_GetStringBytes(JS_ValueToString(cx, argv[10]));
- }
- if (argc > 11) {
- to = JS_GetStringBytes(JS_ValueToString(cx, argv[11]));
- }
-
+
if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
return JS_FALSE;
@@ -2293,18 +2326,28 @@
if (jss->session) {
channel = switch_core_session_get_channel(jss->session);
switch_channel_set_private(channel, "jss", NULL);
- }
+ switch_core_event_hook_remove_state_change(jss->session, hanguphook);
- switch_core_event_hook_remove_state_change(jss->session, hanguphook);
-
- if (channel && switch_test_flag(jss, S_HUP)) {
- switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
- }
+ if (switch_test_flag(jss, S_HUP)) {
+ switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
+ }
+
+ if (switch_test_flag(jss, S_RDLOCK)) {
+ switch_core_session_rwunlock(jss->session);
+ }
- if (jss->session && switch_test_flag(jss, S_RDLOCK)) {
- switch_core_session_rwunlock(jss->session);
+ switch_safe_free(jss->dialplan);
+ switch_safe_free(jss->username);
+ switch_safe_free(jss->caller_id_name);
+ switch_safe_free(jss->ani);
+ switch_safe_free(jss->aniii);
+ switch_safe_free(jss->caller_id_number);
+ switch_safe_free(jss->network_addr);
+ switch_safe_free(jss->rdnis);
+ switch_safe_free(jss->destination_number);
+ switch_safe_free(jss->context);
}
-
+
if (switch_test_flag(jss, S_FREE)) {
free(jss);
}
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.h
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.h (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.h Tue Jun 19 19:32:04 2007
@@ -131,6 +131,16 @@
JSFunction *on_hangup;
int stack_depth;
switch_channel_state_t hook_state;
+ char *destination_number;
+ char *dialplan;
+ char *caller_id_name;
+ char *caller_id_number;
+ char *network_addr;
+ char *ani;
+ char *aniii;
+ char *rdnis;
+ char *context;
+ char *username;
};
JSBool DEFAULT_SET_PROPERTY(JSContext * cx, JSObject *obj, jsval id, jsval *vp)
Modified: freeswitch/branches/greenlizard/src/switch_core_media_bug.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_core_media_bug.c (original)
+++ freeswitch/branches/greenlizard/src/switch_core_media_bug.c Tue Jun 19 19:32:04 2007
@@ -156,10 +156,11 @@
switch_media_bug_callback_t callback,
void *user_data, time_t stop_time, switch_media_bug_flag_t flags, switch_media_bug_t **new_bug)
{
- switch_media_bug_t *bug, *bp;
+ switch_media_bug_t *bug;//, *bp;
switch_size_t bytes;
if (flags & SMBF_WRITE_REPLACE) {
+#if 0
switch_thread_rwlock_wrlock(session->bug_rwlock);
for (bp = session->bugs; bp; bp = bp->next) {
if (switch_test_flag(bp, SMBF_WRITE_REPLACE)) {
@@ -169,9 +170,11 @@
}
}
switch_thread_rwlock_unlock(session->bug_rwlock);
+#endif
}
if (flags & SMBF_READ_REPLACE) {
+#if 0
switch_thread_rwlock_wrlock(session->bug_rwlock);
for (bp = session->bugs; bp; bp = bp->next) {
if (switch_test_flag(bp, SMBF_READ_REPLACE)) {
@@ -181,6 +184,7 @@
}
}
switch_thread_rwlock_unlock(session->bug_rwlock);
+#endif
}
if (!(bug = switch_core_session_alloc(session, sizeof(*bug)))) {
Modified: freeswitch/branches/greenlizard/src/switch_ivr_async.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_ivr_async.c (original)
+++ freeswitch/branches/greenlizard/src/switch_ivr_async.c Tue Jun 19 19:32:04 2007
@@ -605,7 +605,7 @@
}
for(i = 0; i < cont->index; i++) {
- if (!strcasecmp(key, cont->list[cont->index].key )) {
+ if (!switch_strlen_zero(cont->list[cont->index].key) && !strcasecmp(key, cont->list[cont->index].key)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Renabling %s\n", key);
cont->list[cont->index].up = 1;
teletone_multi_tone_init(&cont->list[i].mt, &cont->list[i].map);
@@ -663,7 +663,7 @@
teletone_multi_tone_init(&cont->list[cont->index].mt, &cont->list[cont->index].map);
cont->session = session;
- switch_channel_answer(channel);
+ switch_channel_pre_answer(channel);
if (switch_strlen_zero(flags)) {
bflags = SMBF_READ_REPLACE;
Modified: freeswitch/branches/greenlizard/src/switch_ivr_originate.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_ivr_originate.c (original)
+++ freeswitch/branches/greenlizard/src/switch_ivr_originate.c Tue Jun 19 19:32:04 2007
@@ -663,6 +663,7 @@
} else {
teletone_init_session(&ringback.ts, 0, teletone_handler, &ringback);
+ ringback.ts.rate = read_codec->implementation->samples_per_second;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Play Ringback Tone [%s]\n", ringback_data);
//ringback.ts.debug = 1;
//ringback.ts.debug_stream = switch_core_get_console();
Modified: freeswitch/branches/greenlizard/src/switch_ivr_play_say.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_ivr_play_say.c (original)
+++ freeswitch/branches/greenlizard/src/switch_ivr_play_say.c Tue Jun 19 19:32:04 2007
@@ -477,6 +477,94 @@
return status;
}
+static int teletone_handler(teletone_generation_session_t * ts, teletone_tone_map_t * map)
+{
+ switch_buffer_t *audio_buffer = ts->user_data;
+ int wrote;
+
+ if (!audio_buffer) {
+ return -1;
+ }
+
+ wrote = teletone_mux_tones(ts, map);
+ switch_buffer_write(audio_buffer, ts->buffer, wrote * 2);
+
+ return 0;
+}
+
+SWITCH_DECLARE(switch_status_t) switch_ivr_gentones(switch_core_session_t *session, char *script, int32_t loops, switch_input_args_t *args)
+{
+ teletone_generation_session_t ts;
+ switch_buffer_t *audio_buffer;
+ switch_frame_t *read_frame = NULL;
+ switch_codec_t *read_codec = NULL, write_codec;
+ switch_frame_t write_frame;
+ switch_byte_t data[1024];
+ switch_channel_t *channel;
+
+ assert(session != NULL);
+
+ channel = switch_core_session_get_channel(session);
+ assert(channel != NULL);
+
+ switch_channel_pre_answer(channel);
+ read_codec = switch_core_session_get_read_codec(session);
+
+ if (switch_core_codec_init(&write_codec,
+ "L16",
+ NULL,
+ read_codec->implementation->samples_per_second,
+ read_codec->implementation->microseconds_per_frame / 1000,
+ 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
+ NULL, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
+
+ return SWITCH_STATUS_FALSE;
+ }
+
+ write_frame.codec = &write_codec;
+ write_frame.data = data;
+
+ switch_buffer_create_dynamic(&audio_buffer, 512, 1024, 0);
+ teletone_init_session(&ts, 0, teletone_handler, audio_buffer);
+ ts.rate = read_codec->implementation->samples_per_second;
+
+ teletone_run(&ts, script);
+
+ if (loops) {
+ switch_buffer_set_loops(audio_buffer, loops);
+ }
+
+ while(switch_channel_ready(channel)) {
+ switch_status_t status = switch_core_session_read_frame(session, &read_frame, 1000, 0);
+
+ if (!SWITCH_READ_ACCEPTABLE(status)) {
+ break;
+ }
+
+ if (read_frame->datalen < 2 || switch_test_flag(read_frame, SFF_CNG)) {
+ continue;
+ }
+
+ if ((write_frame.datalen = (uint32_t) switch_buffer_read_loop(audio_buffer, write_frame.data,
+ read_frame->codec->implementation->bytes_per_frame)) <= 0) {
+ break;
+ }
+
+ write_frame.samples = write_frame.datalen / 2;
+
+ if (switch_core_session_write_frame(session, &write_frame, 1000, 0) != SWITCH_STATUS_SUCCESS) {
+ break;
+ }
+ }
+
+ switch_core_codec_destroy(&write_codec);
+ switch_buffer_destroy(&audio_buffer);
+ teletone_destroy_session(&ts);
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
+
#define FILE_STARTSAMPLES 1024 * 32
#define FILE_BLOCKSIZE 1024 * 8
#define FILE_BUFSIZE 1024 * 64
1
0
[commit] r5393 - in freeswitch/branches/greenlizard/src: . include mod/languages/mod_python
by Freeswitch SVN 19 Jun '07
by Freeswitch SVN 19 Jun '07
19 Jun '07
Author: greenlizard
Date: Tue Jun 19 19:01:33 2007
New Revision: 5393
Modified:
freeswitch/branches/greenlizard/src/include/switch_cpp.h
freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py
freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.cpp
freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.h
freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.i
freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp
freeswitch/branches/greenlizard/src/switch_cpp.cpp
Log:
implement originate() and bridge() methods. api changes for originate() per anthony's request: no longer passes 11 arguments
Modified: freeswitch/branches/greenlizard/src/include/switch_cpp.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_cpp.h (original)
+++ freeswitch/branches/greenlizard/src/include/switch_cpp.h Tue Jun 19 19:01:33 2007
@@ -16,6 +16,16 @@
void console_clean_log(char *msg);
char *api_execute(char *cmd, char *arg);
void api_reply_delete(char *reply);
+
+
+/**
+ * \brief - process language specific callback results
+ *
+ * First the actual callback is called, (in the case of python,
+ * PythonDTMFCallback), it then calls the language specific callback defined
+ * by the user (eg, some python method), and then _this_ function is called
+ * with the results of the language specific callback.
+ */
switch_status_t process_callback_result(char *raw_result,
struct input_callback_state *cb_state,
switch_core_session_t *session);
@@ -28,30 +38,55 @@
// eg, PyThreadState *threadState
void *extra; // currently used to store a switch_file_handle_t
char *funcargs; // extra string that will be passed to callback function
-} input_callback_state;
+} input_callback_state_t;
class CoreSession {
protected:
- switch_input_args_t args;
- switch_input_args_t *ap;
+ switch_input_args_t args; // holds ptr to cb function and input_callback_state struct
+ // which has a language specific callback function
+ switch_input_args_t *ap; // ptr to args .. (is this really needed?)
+ switch_caller_profile_t caller_profile; // avoid passing so many args to originate,
+ // instead set them here first
char *uuid;
char *tts_name;
char *voice_name;
void store_file_handle(switch_file_handle_t *fh);
public:
+ CoreSession();
CoreSession(char *uuid);
CoreSession(switch_core_session_t *new_session);
virtual ~CoreSession();
switch_core_session_t *session;
switch_channel_t *channel;
- input_callback_state cb_state;
+ input_callback_state cb_state; // callback state, always pointed to by the buf
+ // field in this->args
+
int answer();
int preAnswer();
void hangup(char *cause);
void setVariable(char *var, char *val);
char *getVariable(char *var);
+ /** \brief Set attributes of caller data for purposes of outgoing calls
+ * \param var - the variable name, eg, "caller_id_name"
+ * \param val - the data to set, eg, "bob"
+ */
+ void setCallerData(char *var, char *val);
+
+ /** \brief Originate a call to a destination
+ *
+ * \param old_session - the session where the call is originating from
+ * and also the session in which _this_ session was
+ * created
+ * \param dest - a string representing destination, eg, sofia/mydomain.com/foo@bar.com
+ * \return an int status code indicating success or failure
+ *
+ */
+ int originate(CoreSession *aleg_session,
+ char *dest,
+ int timeout=60);
+
/** \brief Play a file that resides on disk into the channel
*
* \param file - the path to the .wav/.mp3 to be played
@@ -125,10 +160,35 @@
virtual void begin_allow_threads();
virtual void end_allow_threads();
+ /** \brief Get the uuid of this session
+ * \return the uuid of this session
+ */
+ char* get_uuid() const { return uuid; };
+
+ /** \brief Get the callback function arguments associated with this session
+ * \return a const reference to the callback function arguments
+ */
+ const switch_input_args_t& get_cb_args() const { return args; };
+
};
+/* ---- functions not bound to CoreSession instance ----- */
+
+void console_log(char *level_str, char *msg);
+void console_clean_log(char *msg);
+char *api_execute(char *cmd, char *arg);
+void api_reply_delete(char *reply);
+
+/** \brief bridge the audio of session_b into session_a
+ *
+ * NOTE: the stuff regarding the dtmf callback might be completely
+ * wrong and has not been reviewed or tested
+ */
+void bridge(CoreSession &session_a, CoreSession &session_b);
+
+
#ifdef __cplusplus
}
#endif
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py Tue Jun 19 19:01:33 2007
@@ -53,32 +53,32 @@
api_execute = _freeswitch.api_execute
api_reply_delete = _freeswitch.api_reply_delete
process_callback_result = _freeswitch.process_callback_result
-class input_callback_state(_object):
+class input_callback_state_t(_object):
__swig_setmethods__ = {}
- __setattr__ = lambda self, name, value: _swig_setattr(self, input_callback_state, name, value)
+ __setattr__ = lambda self, name, value: _swig_setattr(self, input_callback_state_t, name, value)
__swig_getmethods__ = {}
- __getattr__ = lambda self, name: _swig_getattr(self, input_callback_state, name)
+ __getattr__ = lambda self, name: _swig_getattr(self, input_callback_state_t, name)
__repr__ = _swig_repr
- __swig_setmethods__["function"] = _freeswitch.input_callback_state_function_set
- __swig_getmethods__["function"] = _freeswitch.input_callback_state_function_get
- if _newclass:function = _swig_property(_freeswitch.input_callback_state_function_get, _freeswitch.input_callback_state_function_set)
- __swig_setmethods__["threadState"] = _freeswitch.input_callback_state_threadState_set
- __swig_getmethods__["threadState"] = _freeswitch.input_callback_state_threadState_get
- if _newclass:threadState = _swig_property(_freeswitch.input_callback_state_threadState_get, _freeswitch.input_callback_state_threadState_set)
- __swig_setmethods__["extra"] = _freeswitch.input_callback_state_extra_set
- __swig_getmethods__["extra"] = _freeswitch.input_callback_state_extra_get
- if _newclass:extra = _swig_property(_freeswitch.input_callback_state_extra_get, _freeswitch.input_callback_state_extra_set)
- __swig_setmethods__["funcargs"] = _freeswitch.input_callback_state_funcargs_set
- __swig_getmethods__["funcargs"] = _freeswitch.input_callback_state_funcargs_get
- if _newclass:funcargs = _swig_property(_freeswitch.input_callback_state_funcargs_get, _freeswitch.input_callback_state_funcargs_set)
+ __swig_setmethods__["function"] = _freeswitch.input_callback_state_t_function_set
+ __swig_getmethods__["function"] = _freeswitch.input_callback_state_t_function_get
+ if _newclass:function = _swig_property(_freeswitch.input_callback_state_t_function_get, _freeswitch.input_callback_state_t_function_set)
+ __swig_setmethods__["threadState"] = _freeswitch.input_callback_state_t_threadState_set
+ __swig_getmethods__["threadState"] = _freeswitch.input_callback_state_t_threadState_get
+ if _newclass:threadState = _swig_property(_freeswitch.input_callback_state_t_threadState_get, _freeswitch.input_callback_state_t_threadState_set)
+ __swig_setmethods__["extra"] = _freeswitch.input_callback_state_t_extra_set
+ __swig_getmethods__["extra"] = _freeswitch.input_callback_state_t_extra_get
+ if _newclass:extra = _swig_property(_freeswitch.input_callback_state_t_extra_get, _freeswitch.input_callback_state_t_extra_set)
+ __swig_setmethods__["funcargs"] = _freeswitch.input_callback_state_t_funcargs_set
+ __swig_getmethods__["funcargs"] = _freeswitch.input_callback_state_t_funcargs_get
+ if _newclass:funcargs = _swig_property(_freeswitch.input_callback_state_t_funcargs_get, _freeswitch.input_callback_state_t_funcargs_set)
def __init__(self, *args):
- this = _freeswitch.new_input_callback_state(*args)
+ this = _freeswitch.new_input_callback_state_t(*args)
try: self.this.append(this)
except: self.this = this
- __swig_destroy__ = _freeswitch.delete_input_callback_state
+ __swig_destroy__ = _freeswitch.delete_input_callback_state_t
__del__ = lambda self : None;
-input_callback_state_swigregister = _freeswitch.input_callback_state_swigregister
-input_callback_state_swigregister(input_callback_state)
+input_callback_state_t_swigregister = _freeswitch.input_callback_state_t_swigregister
+input_callback_state_t_swigregister(input_callback_state_t)
class CoreSession(_object):
__swig_setmethods__ = {}
@@ -106,6 +106,8 @@
def hangup(*args): return _freeswitch.CoreSession_hangup(*args)
def setVariable(*args): return _freeswitch.CoreSession_setVariable(*args)
def getVariable(*args): return _freeswitch.CoreSession_getVariable(*args)
+ def setCallerData(*args): return _freeswitch.CoreSession_setCallerData(*args)
+ def originate(*args): return _freeswitch.CoreSession_originate(*args)
def playFile(*args): return _freeswitch.CoreSession_playFile(*args)
def setDTMFCallback(*args): return _freeswitch.CoreSession_setDTMFCallback(*args)
def speak(*args): return _freeswitch.CoreSession_speak(*args)
@@ -118,9 +120,12 @@
def execute(*args): return _freeswitch.CoreSession_execute(*args)
def begin_allow_threads(*args): return _freeswitch.CoreSession_begin_allow_threads(*args)
def end_allow_threads(*args): return _freeswitch.CoreSession_end_allow_threads(*args)
+ def get_uuid(*args): return _freeswitch.CoreSession_get_uuid(*args)
+ def get_cb_args(*args): return _freeswitch.CoreSession_get_cb_args(*args)
CoreSession_swigregister = _freeswitch.CoreSession_swigregister
CoreSession_swigregister(CoreSession)
+bridge = _freeswitch.bridge
PythonDTMFCallback = _freeswitch.PythonDTMFCallback
class PySession(CoreSession):
__swig_setmethods__ = {}
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.cpp (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.cpp Tue Jun 19 19:01:33 2007
@@ -1,6 +1,22 @@
#include "freeswitch_python.h"
#define sanity_check(x) do { if (!session) { switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_ERROR, "session is not initalized\n"); return x;}} while(0)
+#define init_vars() do { caller_profile.source = "mod_python"; } while(0)
+
+PySession::PySession() : CoreSession()
+{
+ init_vars();
+}
+
+PySession::PySession(char *uuid) : CoreSession(uuid)
+{
+ init_vars();
+}
+
+PySession::PySession(switch_core_session_t *new_session) : CoreSession(new_session)
+{
+ init_vars();
+}
void PySession::setDTMFCallback(PyObject *pyfunc, char *funcargs)
@@ -34,15 +50,16 @@
void PySession::begin_allow_threads(void) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "PySession::begin_allow_threads() called\n");
+ // swap out threadstate and store in instance variable
threadState = (void *) PyEval_SaveThread();
cb_state.threadState = threadState;
- // cb_state.extra = &fh;
args.buf = &cb_state;
ap = &args;
}
void PySession::end_allow_threads(void) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "PySession::end_allow_threads() called\n");
+ // swap in threadstate from instance variable saved earlier
PyEval_RestoreThread(((PyThreadState *)threadState));
}
@@ -52,4 +69,88 @@
}
+/* ----- functions not bound to PySession instance ------ */
+
+
+switch_status_t PythonDTMFCallback(switch_core_session_t *session,
+ void *input,
+ switch_input_type_t itype,
+ void *buf,
+ unsigned int buflen)
+{
+ PyObject *func, *arglist;
+ PyObject *result;
+ char *resultStr;
+ char *funcargs;
+ input_callback_state_t *cb_state;
+ switch_file_handle_t *fh = NULL;
+ PyThreadState *threadState = NULL;
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "PythonDTMFCallback\n");
+
+ if (!buf) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "buf pointer is null");
+ return SWITCH_STATUS_FALSE;
+ }
+
+ cb_state = (input_callback_state *) buf;
+
+ func = (PyObject *) cb_state->function;
+ if (!func) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "cb_state->function is null\n");
+ return SWITCH_STATUS_FALSE;
+ }
+ else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "cb_state->function is NOT null\n");
+ }
+ if (!PyCallable_Check(func)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "function not callable\n");
+ return SWITCH_STATUS_FALSE;
+ }
+
+ funcargs = (char *) cb_state->funcargs;
+
+ arglist = Py_BuildValue("(sis)", input, itype, funcargs);
+ if (!arglist) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error building arglist");
+ return SWITCH_STATUS_FALSE;
+ }
+
+ threadState = (PyThreadState *) cb_state->threadState;
+ if (!threadState) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error, invalid threadstate\n");
+ return SWITCH_STATUS_FALSE;
+ }
+ else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "restoring threadstate: %p\n", threadState);
+ }
+
+ PyEval_RestoreThread(threadState); // nasty stuff happens when py interp has no thread state
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "restored threadstate, calling python function: %p\n", func);
+
+ result = PyEval_CallObject(func, arglist);
+
+ threadState = PyEval_SaveThread();
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "called python function\n");
+
+ Py_DECREF(arglist); // Trash arglist
+ if (result && result != Py_None) {
+ resultStr = (char *) PyString_AsString(result);
+ Py_XDECREF(result);
+ return process_callback_result(resultStr, cb_state, session);
+ }
+ else {
+ return SWITCH_STATUS_FALSE;
+ }
+
+
+}
+
+
+
+
+
+
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.h
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.h (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.h Tue Jun 19 19:01:33 2007
@@ -14,12 +14,12 @@
-// declaration for function that is defined in mod_python.i
-extern switch_status_t PythonDTMFCallback(switch_core_session *session,
- void *input,
- switch_input_type_t itype,
- void *buf,
- unsigned int buflen);
+switch_status_t PythonDTMFCallback(switch_core_session *session,
+ void *input,
+ switch_input_type_t itype,
+ void *buf,
+ unsigned int buflen);
+
void console_log(char *level_str, char *msg);
void console_clean_log(char *msg);
@@ -30,8 +30,9 @@
private:
void *threadState;
public:
- PySession(char *uuid) : CoreSession(uuid) {}
- PySession(switch_core_session_t *session) : CoreSession(session) {}
+ PySession();
+ PySession(char *uuid);
+ PySession(switch_core_session_t *session);
~PySession();
void setDTMFCallback(PyObject *pyfunc, char *funcargs);
void begin_allow_threads();
@@ -39,6 +40,7 @@
};
+
#ifdef __cplusplus
}
#endif
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.i
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.i (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.i Tue Jun 19 19:01:33 2007
@@ -1,218 +1,21 @@
%module freeswitch
%include "cstring.i"
-%cstring_bounded_mutable(char *dtmf_buf, 128);
-%cstring_bounded_mutable(char *terminator, 8);
-
+/** insert the following includes into generated code so it compiles */
%{
#include "switch_cpp.h"
#include "freeswitch_python.h"
%}
+/**
+ * tell swig to grok everything defined in these header files and
+ * build all sorts of c wrappers and python shadows of the c wrappers.
+ */
%include switch_cpp.h
%include freeswitch_python.h
-%{
-
-
-
-switch_status_t PythonDTMFCallback(switch_core_session_t *session,
- void *input,
- switch_input_type_t itype,
- void *buf,
- unsigned int buflen)
-{
- PyObject *func, *arglist;
- PyObject *result;
- char *resultStr;
- char *funcargs;
- struct input_callback_state *cb_state;
- switch_file_handle_t *fh = NULL;
- PyThreadState *threadState = NULL;
-
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "PythonDTMFCallback\n");
-
- if (!buf) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "buf pointer is null");
- return SWITCH_STATUS_FALSE;
- }
-
- cb_state = (input_callback_state *) buf;
-
- func = (PyObject *) cb_state->function;
- if (!func) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "cb_state->function is null\n");
- return SWITCH_STATUS_FALSE;
- }
- else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "cb_state->function is NOT null\n");
- }
- if (!PyCallable_Check(func)) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "function not callable\n");
- return SWITCH_STATUS_FALSE;
- }
-
- funcargs = (char *) cb_state->funcargs;
-
- arglist = Py_BuildValue("(sis)", input, itype, funcargs);
- if (!arglist) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error building arglist");
- return SWITCH_STATUS_FALSE;
- }
-
- threadState = (PyThreadState *) cb_state->threadState;
- if (!threadState) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error, invalid threadstate\n");
- return SWITCH_STATUS_FALSE;
- }
- else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "restoring threadstate: %p\n", threadState);
- }
-
- PyEval_RestoreThread(threadState); // nasty stuff happens when py interp has no thread state
-
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "restored threadstate, calling python function: %p\n", func);
-
- result = PyEval_CallObject(func, arglist);
-
- threadState = PyEval_SaveThread();
-
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "called python function\n");
-
- Py_DECREF(arglist); // Trash arglist
- if (result && result != Py_None) {
- resultStr = (char *) PyString_AsString(result);
- Py_XDECREF(result);
- return process_callback_result(resultStr, cb_state, session);
- }
- else {
- return SWITCH_STATUS_FALSE;
- }
-
-
-}
-
-
-switch_status_t process_callback_result(char *ret,
- struct input_callback_state *cb_state,
- switch_core_session_t *session)
-{
-
- switch_file_handle_t *fh = NULL;
- fh = (switch_file_handle_t *) cb_state->extra;
-
- if (!fh) {
- return SWITCH_STATUS_FALSE;
- }
-
- if (!ret) {
- return SWITCH_STATUS_FALSE;
- }
-
- if (!strncasecmp(ret, "speed", 4)) {
- char *p;
-
- if ((p = strchr(ret, ':'))) {
- p++;
- if (*p == '+' || *p == '-') {
- int step;
- if (!(step = atoi(p))) {
- step = 1;
- }
- fh->speed += step;
- } else {
- int speed = atoi(p);
- fh->speed = speed;
- }
- return SWITCH_STATUS_SUCCESS;
- }
-
- return SWITCH_STATUS_FALSE;
-
- } else if (!strcasecmp(ret, "pause")) {
- if (switch_test_flag(fh, SWITCH_FILE_PAUSE)) {
- switch_clear_flag(fh, SWITCH_FILE_PAUSE);
- } else {
- switch_set_flag(fh, SWITCH_FILE_PAUSE);
- }
- return SWITCH_STATUS_SUCCESS;
- } else if (!strcasecmp(ret, "stop")) {
- return SWITCH_STATUS_FALSE;
- } else if (!strcasecmp(ret, "restart")) {
- unsigned int pos = 0;
- fh->speed = 0;
- switch_core_file_seek(fh, &pos, 0, SEEK_SET);
- return SWITCH_STATUS_SUCCESS;
- } else if (!strncasecmp(ret, "seek", 4)) {
- switch_codec_t *codec;
- unsigned int samps = 0;
- unsigned int pos = 0;
- char *p;
- codec = switch_core_session_get_read_codec(session);
-
- if ((p = strchr(ret, ':'))) {
- p++;
- if (*p == '+' || *p == '-') {
- int step;
- if (!(step = atoi(p))) {
- step = 1000;
- }
- if (step > 0) {
- samps = step * (codec->implementation->samples_per_second / 1000);
- switch_core_file_seek(fh, &pos, samps, SEEK_CUR);
- } else {
- samps = step * (codec->implementation->samples_per_second / 1000);
- switch_core_file_seek(fh, &pos, fh->pos - samps, SEEK_SET);
- }
- } else {
- samps = atoi(p) * (codec->implementation->samples_per_second / 1000);
- switch_core_file_seek(fh, &pos, samps, SEEK_SET);
- }
- }
-
- return SWITCH_STATUS_SUCCESS;
- }
-
- if (!strcmp(ret, "true") || !strcmp(ret, "undefined")) {
- return SWITCH_STATUS_SUCCESS;
- }
-
- return SWITCH_STATUS_FALSE;
-
-
-}
-
-
-void console_log(char *level_str, char *msg)
-{
- switch_log_level_t level = SWITCH_LOG_DEBUG;
- if (level_str) {
- level = switch_log_str2level(level_str);
- }
- switch_log_printf(SWITCH_CHANNEL_LOG, level, msg);
-}
-
-void console_clean_log(char *msg)
-{
- switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN,SWITCH_LOG_DEBUG, msg);
-}
-
-
- char *api_execute(char *cmd, char *arg)
- {
- switch_stream_handle_t stream = { 0 };
- SWITCH_STANDARD_STREAM(stream);
- switch_api_execute(cmd, arg, NULL, &stream);
- return (char *) stream.data;
- }
-
- void api_reply_delete(char *reply)
- {
- if (!switch_strlen_zero(reply)) {
- free(reply);
- }
- }
-
+/** hmm .. dunno why this is here */
+%cstring_bounded_mutable(char *dtmf_buf, 128);
+%cstring_bounded_mutable(char *terminator, 8);
-%}
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp Tue Jun 19 19:01:33 2007
@@ -2472,13 +2472,14 @@
#define SWIGTYPE_p_switch_channel_t swig_types[4]
#define SWIGTYPE_p_switch_core_session swig_types[5]
#define SWIGTYPE_p_switch_core_session_t swig_types[6]
-#define SWIGTYPE_p_switch_input_callback_function_t swig_types[7]
-#define SWIGTYPE_p_switch_input_type_t swig_types[8]
-#define SWIGTYPE_p_switch_status_t swig_types[9]
-#define SWIGTYPE_p_uint32_t swig_types[10]
-#define SWIGTYPE_p_void swig_types[11]
-static swig_type_info *swig_types[13];
-static swig_module_info swig_module = {swig_types, 12, 0, 0, 0, 0};
+#define SWIGTYPE_p_switch_input_args_t swig_types[7]
+#define SWIGTYPE_p_switch_input_callback_function_t swig_types[8]
+#define SWIGTYPE_p_switch_input_type_t swig_types[9]
+#define SWIGTYPE_p_switch_status_t swig_types[10]
+#define SWIGTYPE_p_uint32_t swig_types[11]
+#define SWIGTYPE_p_void swig_types[12]
+static swig_type_info *swig_types[14];
+static swig_module_info swig_module = {swig_types, 13, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
@@ -2887,209 +2888,6 @@
return res;
}
-
-
-
-
-switch_status_t PythonDTMFCallback(switch_core_session_t *session,
- void *input,
- switch_input_type_t itype,
- void *buf,
- unsigned int buflen)
-{
- PyObject *func, *arglist;
- PyObject *result;
- char *resultStr;
- char *funcargs;
- struct input_callback_state *cb_state;
- switch_file_handle_t *fh = NULL;
- PyThreadState *threadState = NULL;
-
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "PythonDTMFCallback\n");
-
- if (!buf) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "buf pointer is null");
- return SWITCH_STATUS_FALSE;
- }
-
- cb_state = (input_callback_state *) buf;
-
- func = (PyObject *) cb_state->function;
- if (!func) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "cb_state->function is null\n");
- return SWITCH_STATUS_FALSE;
- }
- else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "cb_state->function is NOT null\n");
- }
- if (!PyCallable_Check(func)) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "function not callable\n");
- return SWITCH_STATUS_FALSE;
- }
-
- funcargs = (char *) cb_state->funcargs;
-
- arglist = Py_BuildValue("(sis)", input, itype, funcargs);
- if (!arglist) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error building arglist");
- return SWITCH_STATUS_FALSE;
- }
-
- threadState = (PyThreadState *) cb_state->threadState;
- if (!threadState) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error, invalid threadstate\n");
- return SWITCH_STATUS_FALSE;
- }
- else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "restoring threadstate: %p\n", threadState);
- }
-
- PyEval_RestoreThread(threadState); // nasty stuff happens when py interp has no thread state
-
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "restored threadstate, calling python function: %p\n", func);
-
- result = PyEval_CallObject(func, arglist);
-
- threadState = PyEval_SaveThread();
-
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "called python function\n");
-
- Py_DECREF(arglist); // Trash arglist
- if (result && result != Py_None) {
- resultStr = (char *) PyString_AsString(result);
- Py_XDECREF(result);
- return process_callback_result(resultStr, cb_state, session);
- }
- else {
- return SWITCH_STATUS_FALSE;
- }
-
-
-}
-
-
-switch_status_t process_callback_result(char *ret,
- struct input_callback_state *cb_state,
- switch_core_session_t *session)
-{
-
- switch_file_handle_t *fh = NULL;
- fh = (switch_file_handle_t *) cb_state->extra;
-
- if (!fh) {
- return SWITCH_STATUS_FALSE;
- }
-
- if (!ret) {
- return SWITCH_STATUS_FALSE;
- }
-
- if (!strncasecmp(ret, "speed", 4)) {
- char *p;
-
- if ((p = strchr(ret, ':'))) {
- p++;
- if (*p == '+' || *p == '-') {
- int step;
- if (!(step = atoi(p))) {
- step = 1;
- }
- fh->speed += step;
- } else {
- int speed = atoi(p);
- fh->speed = speed;
- }
- return SWITCH_STATUS_SUCCESS;
- }
-
- return SWITCH_STATUS_FALSE;
-
- } else if (!strcasecmp(ret, "pause")) {
- if (switch_test_flag(fh, SWITCH_FILE_PAUSE)) {
- switch_clear_flag(fh, SWITCH_FILE_PAUSE);
- } else {
- switch_set_flag(fh, SWITCH_FILE_PAUSE);
- }
- return SWITCH_STATUS_SUCCESS;
- } else if (!strcasecmp(ret, "stop")) {
- return SWITCH_STATUS_FALSE;
- } else if (!strcasecmp(ret, "restart")) {
- unsigned int pos = 0;
- fh->speed = 0;
- switch_core_file_seek(fh, &pos, 0, SEEK_SET);
- return SWITCH_STATUS_SUCCESS;
- } else if (!strncasecmp(ret, "seek", 4)) {
- switch_codec_t *codec;
- unsigned int samps = 0;
- unsigned int pos = 0;
- char *p;
- codec = switch_core_session_get_read_codec(session);
-
- if ((p = strchr(ret, ':'))) {
- p++;
- if (*p == '+' || *p == '-') {
- int step;
- if (!(step = atoi(p))) {
- step = 1000;
- }
- if (step > 0) {
- samps = step * (codec->implementation->samples_per_second / 1000);
- switch_core_file_seek(fh, &pos, samps, SEEK_CUR);
- } else {
- samps = step * (codec->implementation->samples_per_second / 1000);
- switch_core_file_seek(fh, &pos, fh->pos - samps, SEEK_SET);
- }
- } else {
- samps = atoi(p) * (codec->implementation->samples_per_second / 1000);
- switch_core_file_seek(fh, &pos, samps, SEEK_SET);
- }
- }
-
- return SWITCH_STATUS_SUCCESS;
- }
-
- if (!strcmp(ret, "true") || !strcmp(ret, "undefined")) {
- return SWITCH_STATUS_SUCCESS;
- }
-
- return SWITCH_STATUS_FALSE;
-
-
-}
-
-
-void console_log(char *level_str, char *msg)
-{
- switch_log_level_t level = SWITCH_LOG_DEBUG;
- if (level_str) {
- level = switch_log_str2level(level_str);
- }
- switch_log_printf(SWITCH_CHANNEL_LOG, level, msg);
-}
-
-void console_clean_log(char *msg)
-{
- switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN,SWITCH_LOG_DEBUG, msg);
-}
-
-
- char *api_execute(char *cmd, char *arg)
- {
- switch_stream_handle_t stream = { 0 };
- SWITCH_STANDARD_STREAM(stream);
- switch_api_execute(cmd, arg, NULL, &stream);
- return (char *) stream.data;
- }
-
- void api_reply_delete(char *reply)
- {
- if (!switch_strlen_zero(reply)) {
- free(reply);
- }
- }
-
-
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -3257,9 +3055,9 @@
}
-SWIGINTERN PyObject *_wrap_input_callback_state_function_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_input_callback_state_t_function_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- input_callback_state *arg1 = (input_callback_state *) 0 ;
+ input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
void *arg2 = (void *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -3267,15 +3065,15 @@
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
- if (!PyArg_ParseTuple(args,(char *)"OO:input_callback_state_function_set",&obj0,&obj1)) SWIG_fail;
+ if (!PyArg_ParseTuple(args,(char *)"OO:input_callback_state_t_function_set",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_function_set" "', argument " "1"" of type '" "input_callback_state *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_function_set" "', argument " "1"" of type '" "input_callback_state_t *""'");
}
- arg1 = reinterpret_cast< input_callback_state * >(argp1);
+ arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN);
if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "input_callback_state_function_set" "', argument " "2"" of type '" "void *""'");
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "input_callback_state_t_function_set" "', argument " "2"" of type '" "void *""'");
}
if (arg1) (arg1)->function = arg2;
@@ -3286,20 +3084,20 @@
}
-SWIGINTERN PyObject *_wrap_input_callback_state_function_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_input_callback_state_t_function_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- input_callback_state *arg1 = (input_callback_state *) 0 ;
+ input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
void *result = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
- if (!PyArg_ParseTuple(args,(char *)"O:input_callback_state_function_get",&obj0)) SWIG_fail;
+ if (!PyArg_ParseTuple(args,(char *)"O:input_callback_state_t_function_get",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_function_get" "', argument " "1"" of type '" "input_callback_state *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_function_get" "', argument " "1"" of type '" "input_callback_state_t *""'");
}
- arg1 = reinterpret_cast< input_callback_state * >(argp1);
+ arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
result = (void *) ((arg1)->function);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 );
return resultobj;
@@ -3308,9 +3106,9 @@
}
-SWIGINTERN PyObject *_wrap_input_callback_state_threadState_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_input_callback_state_t_threadState_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- input_callback_state *arg1 = (input_callback_state *) 0 ;
+ input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
void *arg2 = (void *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -3318,15 +3116,15 @@
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
- if (!PyArg_ParseTuple(args,(char *)"OO:input_callback_state_threadState_set",&obj0,&obj1)) SWIG_fail;
+ if (!PyArg_ParseTuple(args,(char *)"OO:input_callback_state_t_threadState_set",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_threadState_set" "', argument " "1"" of type '" "input_callback_state *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_threadState_set" "', argument " "1"" of type '" "input_callback_state_t *""'");
}
- arg1 = reinterpret_cast< input_callback_state * >(argp1);
+ arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN);
if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "input_callback_state_threadState_set" "', argument " "2"" of type '" "void *""'");
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "input_callback_state_t_threadState_set" "', argument " "2"" of type '" "void *""'");
}
if (arg1) (arg1)->threadState = arg2;
@@ -3337,20 +3135,20 @@
}
-SWIGINTERN PyObject *_wrap_input_callback_state_threadState_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_input_callback_state_t_threadState_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- input_callback_state *arg1 = (input_callback_state *) 0 ;
+ input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
void *result = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
- if (!PyArg_ParseTuple(args,(char *)"O:input_callback_state_threadState_get",&obj0)) SWIG_fail;
+ if (!PyArg_ParseTuple(args,(char *)"O:input_callback_state_t_threadState_get",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_threadState_get" "', argument " "1"" of type '" "input_callback_state *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_threadState_get" "', argument " "1"" of type '" "input_callback_state_t *""'");
}
- arg1 = reinterpret_cast< input_callback_state * >(argp1);
+ arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
result = (void *) ((arg1)->threadState);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 );
return resultobj;
@@ -3359,9 +3157,9 @@
}
-SWIGINTERN PyObject *_wrap_input_callback_state_extra_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_input_callback_state_t_extra_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- input_callback_state *arg1 = (input_callback_state *) 0 ;
+ input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
void *arg2 = (void *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -3369,15 +3167,15 @@
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
- if (!PyArg_ParseTuple(args,(char *)"OO:input_callback_state_extra_set",&obj0,&obj1)) SWIG_fail;
+ if (!PyArg_ParseTuple(args,(char *)"OO:input_callback_state_t_extra_set",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_extra_set" "', argument " "1"" of type '" "input_callback_state *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_extra_set" "', argument " "1"" of type '" "input_callback_state_t *""'");
}
- arg1 = reinterpret_cast< input_callback_state * >(argp1);
+ arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN);
if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "input_callback_state_extra_set" "', argument " "2"" of type '" "void *""'");
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "input_callback_state_t_extra_set" "', argument " "2"" of type '" "void *""'");
}
if (arg1) (arg1)->extra = arg2;
@@ -3388,20 +3186,20 @@
}
-SWIGINTERN PyObject *_wrap_input_callback_state_extra_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_input_callback_state_t_extra_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- input_callback_state *arg1 = (input_callback_state *) 0 ;
+ input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
void *result = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
- if (!PyArg_ParseTuple(args,(char *)"O:input_callback_state_extra_get",&obj0)) SWIG_fail;
+ if (!PyArg_ParseTuple(args,(char *)"O:input_callback_state_t_extra_get",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_extra_get" "', argument " "1"" of type '" "input_callback_state *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_extra_get" "', argument " "1"" of type '" "input_callback_state_t *""'");
}
- arg1 = reinterpret_cast< input_callback_state * >(argp1);
+ arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
result = (void *) ((arg1)->extra);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 );
return resultobj;
@@ -3410,9 +3208,9 @@
}
-SWIGINTERN PyObject *_wrap_input_callback_state_funcargs_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_input_callback_state_t_funcargs_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- input_callback_state *arg1 = (input_callback_state *) 0 ;
+ input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
char *arg2 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
@@ -3422,15 +3220,15 @@
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
- if (!PyArg_ParseTuple(args,(char *)"OO:input_callback_state_funcargs_set",&obj0,&obj1)) SWIG_fail;
+ if (!PyArg_ParseTuple(args,(char *)"OO:input_callback_state_t_funcargs_set",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_funcargs_set" "', argument " "1"" of type '" "input_callback_state *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_funcargs_set" "', argument " "1"" of type '" "input_callback_state_t *""'");
}
- arg1 = reinterpret_cast< input_callback_state * >(argp1);
+ arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "input_callback_state_funcargs_set" "', argument " "2"" of type '" "char *""'");
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "input_callback_state_t_funcargs_set" "', argument " "2"" of type '" "char *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
if (arg1->funcargs) delete[] arg1->funcargs;
@@ -3449,20 +3247,20 @@
}
-SWIGINTERN PyObject *_wrap_input_callback_state_funcargs_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_input_callback_state_t_funcargs_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- input_callback_state *arg1 = (input_callback_state *) 0 ;
+ input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
char *result = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
- if (!PyArg_ParseTuple(args,(char *)"O:input_callback_state_funcargs_get",&obj0)) SWIG_fail;
+ if (!PyArg_ParseTuple(args,(char *)"O:input_callback_state_t_funcargs_get",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_funcargs_get" "', argument " "1"" of type '" "input_callback_state *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_t_funcargs_get" "', argument " "1"" of type '" "input_callback_state_t *""'");
}
- arg1 = reinterpret_cast< input_callback_state * >(argp1);
+ arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
result = (char *) ((arg1)->funcargs);
resultobj = SWIG_FromCharPtr((const char *)result);
return resultobj;
@@ -3471,12 +3269,12 @@
}
-SWIGINTERN PyObject *_wrap_new_input_callback_state(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_new_input_callback_state_t(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- input_callback_state *result = 0 ;
+ input_callback_state_t *result = 0 ;
- if (!PyArg_ParseTuple(args,(char *)":new_input_callback_state")) SWIG_fail;
- result = (input_callback_state *)new input_callback_state();
+ if (!PyArg_ParseTuple(args,(char *)":new_input_callback_state_t")) SWIG_fail;
+ result = (input_callback_state_t *)new input_callback_state_t();
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_input_callback_state, SWIG_POINTER_NEW | 0 );
return resultobj;
fail:
@@ -3484,19 +3282,19 @@
}
-SWIGINTERN PyObject *_wrap_delete_input_callback_state(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_delete_input_callback_state_t(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
- input_callback_state *arg1 = (input_callback_state *) 0 ;
+ input_callback_state_t *arg1 = (input_callback_state_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
- if (!PyArg_ParseTuple(args,(char *)"O:delete_input_callback_state",&obj0)) SWIG_fail;
+ if (!PyArg_ParseTuple(args,(char *)"O:delete_input_callback_state_t",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_input_callback_state" "', argument " "1"" of type '" "input_callback_state *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_input_callback_state_t" "', argument " "1"" of type '" "input_callback_state_t *""'");
}
- arg1 = reinterpret_cast< input_callback_state * >(argp1);
+ arg1 = reinterpret_cast< input_callback_state_t * >(argp1);
delete arg1;
resultobj = SWIG_Py_Void();
@@ -3506,7 +3304,7 @@
}
-SWIGINTERN PyObject *input_callback_state_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *input_callback_state_t_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_input_callback_state, SWIG_NewClientData(obj));
@@ -3515,6 +3313,19 @@
SWIGINTERN PyObject *_wrap_new_CoreSession__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
+ CoreSession *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)":new_CoreSession")) SWIG_fail;
+ result = (CoreSession *)new CoreSession();
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CoreSession, SWIG_POINTER_NEW | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CoreSession__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
char *arg1 = (char *) 0 ;
CoreSession *result = 0 ;
int res1 ;
@@ -3538,7 +3349,7 @@
}
-SWIGINTERN PyObject *_wrap_new_CoreSession__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_new_CoreSession__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
CoreSession *result = 0 ;
@@ -3570,13 +3381,16 @@
for (ii = 0; (ii < argc) && (ii < 1); ii++) {
argv[ii] = PyTuple_GET_ITEM(args,ii);
}
+ if (argc == 0) {
+ return _wrap_new_CoreSession__SWIG_0(self, args);
+ }
if (argc == 1) {
int _v;
void *vptr = 0;
int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_switch_core_session_t, 0);
_v = SWIG_CheckState(res);
if (_v) {
- return _wrap_new_CoreSession__SWIG_1(self, args);
+ return _wrap_new_CoreSession__SWIG_2(self, args);
}
}
if (argc == 1) {
@@ -3584,12 +3398,12 @@
int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
_v = SWIG_CheckState(res);
if (_v) {
- return _wrap_new_CoreSession__SWIG_0(self, args);
+ return _wrap_new_CoreSession__SWIG_1(self, args);
}
}
fail:
- SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_CoreSession'.\n Possible C/C++ prototypes are:\n CoreSession(char *)\n CoreSession(switch_core_session_t *)\n");
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_CoreSession'.\n Possible C/C++ prototypes are:\n CoreSession()\n CoreSession(char *)\n CoreSession(switch_core_session_t *)\n");
return NULL;
}
@@ -3931,6 +3745,105 @@
}
+SWIGINTERN PyObject *_wrap_CoreSession_setCallerData(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_setCallerData",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_setCallerData" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_setCallerData" "', argument " "2"" of type '" "char *""'");
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_setCallerData" "', argument " "3"" of type '" "char *""'");
+ }
+ arg3 = reinterpret_cast< char * >(buf3);
+ (arg1)->setCallerData(arg2,arg3);
+ resultobj = SWIG_Py_Void();
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoreSession_originate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ CoreSession *arg2 = (CoreSession *) 0 ;
+ char *arg3 = (char *) 0 ;
+ int arg4 = (int) 60 ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ void *argp2 = 0 ;
+ int res2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ int val4 ;
+ int ecode4 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO|O:CoreSession_originate",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_originate" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_originate" "', argument " "2"" of type '" "CoreSession *""'");
+ }
+ arg2 = reinterpret_cast< CoreSession * >(argp2);
+ res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_originate" "', argument " "3"" of type '" "char *""'");
+ }
+ arg3 = reinterpret_cast< char * >(buf3);
+ if (obj3) {
+ ecode4 = SWIG_AsVal_int(obj3, &val4);
+ if (!SWIG_IsOK(ecode4)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CoreSession_originate" "', argument " "4"" of type '" "int""'");
+ }
+ arg4 = static_cast< int >(val4);
+ }
+ result = (int)(arg1)->originate(arg2,arg3,arg4);
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ return resultobj;
+fail:
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ return NULL;
+}
+
+
SWIGINTERN PyObject *_wrap_CoreSession_playFile(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
@@ -4130,9 +4043,7 @@
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
- char temp2[128+1] ;
- char *t2 = 0 ;
- size_t n2 = 0 ;
+ char *buf2 = 0 ;
int alloc2 = 0 ;
int val3 ;
int ecode3 = 0 ;
@@ -4140,9 +4051,7 @@
char *buf4 = 0 ;
int alloc4 = 0 ;
int res5 ;
- char temp5[8+1] ;
- char *t5 = 0 ;
- size_t n5 = 0 ;
+ char *buf5 = 0 ;
int alloc5 = 0 ;
int val6 ;
int ecode6 = 0 ;
@@ -4159,15 +4068,11 @@
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_getDigits" "', argument " "1"" of type '" "CoreSession *""'");
}
arg1 = reinterpret_cast< CoreSession * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(obj1, &t2, &n2, &alloc2);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_getDigits" "', argument " "2"" of type '" "char *dtmf_buf""'");
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_getDigits" "', argument " "2"" of type '" "char *""'");
}
- if ( n2 > (size_t) 128 ) n2 = (size_t) 128;
- memcpy(temp2, t2, sizeof(char)*n2);
- if (alloc2 == SWIG_NEWOBJ) delete[] t2;
- temp2[n2 - 1] = 0;
- arg2 = (char *) temp2;
+ arg2 = reinterpret_cast< char * >(buf2);
ecode3 = SWIG_AsVal_int(obj2, &val3);
if (!SWIG_IsOK(ecode3)) {
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoreSession_getDigits" "', argument " "3"" of type '" "int""'");
@@ -4178,15 +4083,11 @@
SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CoreSession_getDigits" "', argument " "4"" of type '" "char *""'");
}
arg4 = reinterpret_cast< char * >(buf4);
- res5 = SWIG_AsCharPtrAndSize(obj4, &t5, &n5, &alloc5);
+ res5 = SWIG_AsCharPtrAndSize(obj4, &buf5, NULL, &alloc5);
if (!SWIG_IsOK(res5)) {
- SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CoreSession_getDigits" "', argument " "5"" of type '" "char *terminator""'");
+ SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CoreSession_getDigits" "', argument " "5"" of type '" "char *""'");
}
- if ( n5 > (size_t) 8 ) n5 = (size_t) 8;
- memcpy(temp5, t5, sizeof(char)*n5);
- if (alloc5 == SWIG_NEWOBJ) delete[] t5;
- temp5[n5 - 1] = 0;
- arg5 = (char *) temp5;
+ arg5 = reinterpret_cast< char * >(buf5);
ecode6 = SWIG_AsVal_int(obj5, &val6);
if (!SWIG_IsOK(ecode6)) {
SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "CoreSession_getDigits" "', argument " "6"" of type '" "int""'");
@@ -4194,14 +4095,14 @@
arg6 = static_cast< int >(val6);
result = (int)(arg1)->getDigits(arg2,arg3,arg4,arg5,arg6);
resultobj = SWIG_From_int(static_cast< int >(result));
- arg2[128] = 0;
- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(arg2));
- arg5[8] = 0;
- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(arg5));
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
+ if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
return resultobj;
fail:
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
+ if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
return NULL;
}
@@ -4297,9 +4198,7 @@
char *buf8 = 0 ;
int alloc8 = 0 ;
int res9 ;
- char temp9[128+1] ;
- char *t9 = 0 ;
- size_t n9 = 0 ;
+ char *buf9 = 0 ;
int alloc9 = 0 ;
int res10 ;
char *buf10 = 0 ;
@@ -4356,15 +4255,11 @@
SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "CoreSession_playAndGetDigits" "', argument " "8"" of type '" "char *""'");
}
arg8 = reinterpret_cast< char * >(buf8);
- res9 = SWIG_AsCharPtrAndSize(obj8, &t9, &n9, &alloc9);
+ res9 = SWIG_AsCharPtrAndSize(obj8, &buf9, NULL, &alloc9);
if (!SWIG_IsOK(res9)) {
- SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CoreSession_playAndGetDigits" "', argument " "9"" of type '" "char *dtmf_buf""'");
+ SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CoreSession_playAndGetDigits" "', argument " "9"" of type '" "char *""'");
}
- if ( n9 > (size_t) 128 ) n9 = (size_t) 128;
- memcpy(temp9, t9, sizeof(char)*n9);
- if (alloc9 == SWIG_NEWOBJ) delete[] t9;
- temp9[n9 - 1] = 0;
- arg9 = (char *) temp9;
+ arg9 = reinterpret_cast< char * >(buf9);
res10 = SWIG_AsCharPtrAndSize(obj9, &buf10, NULL, &alloc10);
if (!SWIG_IsOK(res10)) {
SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "CoreSession_playAndGetDigits" "', argument " "10"" of type '" "char *""'");
@@ -4372,17 +4267,17 @@
arg10 = reinterpret_cast< char * >(buf10);
result = (int)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
resultobj = SWIG_From_int(static_cast< int >(result));
- arg9[128] = 0;
- resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(arg9));
if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
if (alloc7 == SWIG_NEWOBJ) delete[] buf7;
if (alloc8 == SWIG_NEWOBJ) delete[] buf8;
+ if (alloc9 == SWIG_NEWOBJ) delete[] buf9;
if (alloc10 == SWIG_NEWOBJ) delete[] buf10;
return resultobj;
fail:
if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
if (alloc7 == SWIG_NEWOBJ) delete[] buf7;
if (alloc8 == SWIG_NEWOBJ) delete[] buf8;
+ if (alloc9 == SWIG_NEWOBJ) delete[] buf9;
if (alloc10 == SWIG_NEWOBJ) delete[] buf10;
return NULL;
}
@@ -4540,6 +4435,53 @@
}
+SWIGINTERN PyObject *_wrap_CoreSession_get_uuid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *result = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_get_uuid",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_get_uuid" "', argument " "1"" of type '" "CoreSession const *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ result = (char *)((CoreSession const *)arg1)->get_uuid();
+ resultobj = SWIG_FromCharPtr((const char *)result);
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoreSession_get_cb_args(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ switch_input_args_t *result = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_get_cb_args",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_get_cb_args" "', argument " "1"" of type '" "CoreSession const *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ {
+ switch_input_args_t const &_result_ref = ((CoreSession const *)arg1)->get_cb_args();
+ result = (switch_input_args_t *) &_result_ref;
+ }
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_switch_input_args_t, 0 | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
SWIGINTERN PyObject *CoreSession_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
@@ -4547,6 +4489,42 @@
return SWIG_Py_Void();
}
+SWIGINTERN PyObject *_wrap_bridge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = 0 ;
+ CoreSession *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ void *argp2 = 0 ;
+ int res2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:bridge",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_CoreSession, 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bridge" "', argument " "1"" of type '" "CoreSession &""'");
+ }
+ if (!argp1) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "bridge" "', argument " "1"" of type '" "CoreSession &""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_CoreSession, 0 );
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bridge" "', argument " "2"" of type '" "CoreSession &""'");
+ }
+ if (!argp2) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "bridge" "', argument " "2"" of type '" "CoreSession &""'");
+ }
+ arg2 = reinterpret_cast< CoreSession * >(argp2);
+ bridge(*arg1,*arg2);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
SWIGINTERN PyObject *_wrap_PythonDTMFCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
switch_core_session *arg1 = (switch_core_session *) 0 ;
@@ -4611,6 +4589,19 @@
SWIGINTERN PyObject *_wrap_new_PySession__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
+ PySession *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)":new_PySession")) SWIG_fail;
+ result = (PySession *)new PySession();
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PySession, SWIG_POINTER_NEW | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_PySession__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
char *arg1 = (char *) 0 ;
PySession *result = 0 ;
int res1 ;
@@ -4634,7 +4625,7 @@
}
-SWIGINTERN PyObject *_wrap_new_PySession__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_new_PySession__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
PySession *result = 0 ;
@@ -4666,13 +4657,16 @@
for (ii = 0; (ii < argc) && (ii < 1); ii++) {
argv[ii] = PyTuple_GET_ITEM(args,ii);
}
+ if (argc == 0) {
+ return _wrap_new_PySession__SWIG_0(self, args);
+ }
if (argc == 1) {
int _v;
void *vptr = 0;
int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_switch_core_session_t, 0);
_v = SWIG_CheckState(res);
if (_v) {
- return _wrap_new_PySession__SWIG_1(self, args);
+ return _wrap_new_PySession__SWIG_2(self, args);
}
}
if (argc == 1) {
@@ -4680,12 +4674,12 @@
int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
_v = SWIG_CheckState(res);
if (_v) {
- return _wrap_new_PySession__SWIG_0(self, args);
+ return _wrap_new_PySession__SWIG_1(self, args);
}
}
fail:
- SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_PySession'.\n Possible C/C++ prototypes are:\n PySession(char *)\n PySession(switch_core_session_t *)\n");
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_PySession'.\n Possible C/C++ prototypes are:\n PySession()\n PySession(char *)\n PySession(switch_core_session_t *)\n");
return NULL;
}
@@ -4803,17 +4797,17 @@
{ (char *)"api_execute", _wrap_api_execute, METH_VARARGS, NULL},
{ (char *)"api_reply_delete", _wrap_api_reply_delete, METH_VARARGS, NULL},
{ (char *)"process_callback_result", _wrap_process_callback_result, METH_VARARGS, NULL},
- { (char *)"input_callback_state_function_set", _wrap_input_callback_state_function_set, METH_VARARGS, NULL},
- { (char *)"input_callback_state_function_get", _wrap_input_callback_state_function_get, METH_VARARGS, NULL},
- { (char *)"input_callback_state_threadState_set", _wrap_input_callback_state_threadState_set, METH_VARARGS, NULL},
- { (char *)"input_callback_state_threadState_get", _wrap_input_callback_state_threadState_get, METH_VARARGS, NULL},
- { (char *)"input_callback_state_extra_set", _wrap_input_callback_state_extra_set, METH_VARARGS, NULL},
- { (char *)"input_callback_state_extra_get", _wrap_input_callback_state_extra_get, METH_VARARGS, NULL},
- { (char *)"input_callback_state_funcargs_set", _wrap_input_callback_state_funcargs_set, METH_VARARGS, NULL},
- { (char *)"input_callback_state_funcargs_get", _wrap_input_callback_state_funcargs_get, METH_VARARGS, NULL},
- { (char *)"new_input_callback_state", _wrap_new_input_callback_state, METH_VARARGS, NULL},
- { (char *)"delete_input_callback_state", _wrap_delete_input_callback_state, METH_VARARGS, NULL},
- { (char *)"input_callback_state_swigregister", input_callback_state_swigregister, METH_VARARGS, NULL},
+ { (char *)"input_callback_state_t_function_set", _wrap_input_callback_state_t_function_set, METH_VARARGS, NULL},
+ { (char *)"input_callback_state_t_function_get", _wrap_input_callback_state_t_function_get, METH_VARARGS, NULL},
+ { (char *)"input_callback_state_t_threadState_set", _wrap_input_callback_state_t_threadState_set, METH_VARARGS, NULL},
+ { (char *)"input_callback_state_t_threadState_get", _wrap_input_callback_state_t_threadState_get, METH_VARARGS, NULL},
+ { (char *)"input_callback_state_t_extra_set", _wrap_input_callback_state_t_extra_set, METH_VARARGS, NULL},
+ { (char *)"input_callback_state_t_extra_get", _wrap_input_callback_state_t_extra_get, METH_VARARGS, NULL},
+ { (char *)"input_callback_state_t_funcargs_set", _wrap_input_callback_state_t_funcargs_set, METH_VARARGS, NULL},
+ { (char *)"input_callback_state_t_funcargs_get", _wrap_input_callback_state_t_funcargs_get, METH_VARARGS, NULL},
+ { (char *)"new_input_callback_state_t", _wrap_new_input_callback_state_t, METH_VARARGS, NULL},
+ { (char *)"delete_input_callback_state_t", _wrap_delete_input_callback_state_t, METH_VARARGS, NULL},
+ { (char *)"input_callback_state_t_swigregister", input_callback_state_t_swigregister, METH_VARARGS, NULL},
{ (char *)"new_CoreSession", _wrap_new_CoreSession, METH_VARARGS, NULL},
{ (char *)"delete_CoreSession", _wrap_delete_CoreSession, METH_VARARGS, NULL},
{ (char *)"CoreSession_session_set", _wrap_CoreSession_session_set, METH_VARARGS, NULL},
@@ -4827,6 +4821,8 @@
{ (char *)"CoreSession_hangup", _wrap_CoreSession_hangup, METH_VARARGS, NULL},
{ (char *)"CoreSession_setVariable", _wrap_CoreSession_setVariable, METH_VARARGS, NULL},
{ (char *)"CoreSession_getVariable", _wrap_CoreSession_getVariable, METH_VARARGS, NULL},
+ { (char *)"CoreSession_setCallerData", _wrap_CoreSession_setCallerData, METH_VARARGS, NULL},
+ { (char *)"CoreSession_originate", _wrap_CoreSession_originate, METH_VARARGS, NULL},
{ (char *)"CoreSession_playFile", _wrap_CoreSession_playFile, METH_VARARGS, NULL},
{ (char *)"CoreSession_setDTMFCallback", _wrap_CoreSession_setDTMFCallback, METH_VARARGS, NULL},
{ (char *)"CoreSession_speak", _wrap_CoreSession_speak, METH_VARARGS, NULL},
@@ -4839,7 +4835,10 @@
{ (char *)"CoreSession_execute", _wrap_CoreSession_execute, METH_VARARGS, NULL},
{ (char *)"CoreSession_begin_allow_threads", _wrap_CoreSession_begin_allow_threads, METH_VARARGS, NULL},
{ (char *)"CoreSession_end_allow_threads", _wrap_CoreSession_end_allow_threads, METH_VARARGS, NULL},
+ { (char *)"CoreSession_get_uuid", _wrap_CoreSession_get_uuid, METH_VARARGS, NULL},
+ { (char *)"CoreSession_get_cb_args", _wrap_CoreSession_get_cb_args, METH_VARARGS, NULL},
{ (char *)"CoreSession_swigregister", CoreSession_swigregister, METH_VARARGS, NULL},
+ { (char *)"bridge", _wrap_bridge, METH_VARARGS, NULL},
{ (char *)"PythonDTMFCallback", _wrap_PythonDTMFCallback, METH_VARARGS, NULL},
{ (char *)"new_PySession", _wrap_new_PySession, METH_VARARGS, NULL},
{ (char *)"delete_PySession", _wrap_delete_PySession, METH_VARARGS, NULL},
@@ -4863,6 +4862,7 @@
static swig_type_info _swigt__p_switch_channel_t = {"_p_switch_channel_t", "switch_channel_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_switch_core_session = {"_p_switch_core_session", "switch_core_session *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_switch_core_session_t = {"_p_switch_core_session_t", "switch_core_session_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_switch_input_args_t = {"_p_switch_input_args_t", "switch_input_args_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_switch_input_callback_function_t = {"_p_switch_input_callback_function_t", "switch_input_callback_function_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_switch_input_type_t = {"_p_switch_input_type_t", "switch_input_type_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_switch_status_t = {"_p_switch_status_t", "switch_status_t *", 0, 0, (void*)0, 0};
@@ -4877,6 +4877,7 @@
&_swigt__p_switch_channel_t,
&_swigt__p_switch_core_session,
&_swigt__p_switch_core_session_t,
+ &_swigt__p_switch_input_args_t,
&_swigt__p_switch_input_callback_function_t,
&_swigt__p_switch_input_type_t,
&_swigt__p_switch_status_t,
@@ -4891,6 +4892,7 @@
static swig_cast_info _swigc__p_switch_channel_t[] = { {&_swigt__p_switch_channel_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_switch_core_session[] = { {&_swigt__p_switch_core_session, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_switch_core_session_t[] = { {&_swigt__p_switch_core_session_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_switch_input_args_t[] = { {&_swigt__p_switch_input_args_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_switch_input_callback_function_t[] = { {&_swigt__p_switch_input_callback_function_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_switch_input_type_t[] = { {&_swigt__p_switch_input_type_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_switch_status_t[] = { {&_swigt__p_switch_status_t, 0, 0, 0},{0, 0, 0, 0}};
@@ -4905,6 +4907,7 @@
_swigc__p_switch_channel_t,
_swigc__p_switch_core_session,
_swigc__p_switch_core_session_t,
+ _swigc__p_switch_input_args_t,
_swigc__p_switch_input_callback_function_t,
_swigc__p_switch_input_type_t,
_swigc__p_switch_status_t,
Modified: freeswitch/branches/greenlizard/src/switch_cpp.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_cpp.cpp (original)
+++ freeswitch/branches/greenlizard/src/switch_cpp.cpp Tue Jun 19 19:01:33 2007
@@ -7,7 +7,14 @@
#define sanity_check(x) do { if (!session) { 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) { 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;} 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 = ""; } while(0)
+
+
+
+CoreSession::CoreSession()
+{
+ init_vars();
+}
CoreSession::CoreSession(char *nuuid)
{
@@ -177,7 +184,9 @@
{
switch_status_t status;
sanity_check(-1);
+ begin_allow_threads();
status = switch_ivr_session_transfer(session, extension, dialplan, context);
+ end_allow_threads();
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
}
@@ -251,6 +260,83 @@
}
+int CoreSession::originate(CoreSession *aleg_session,
+ char *dest,
+ int timeout)
+{
+
+ switch_memory_pool_t *pool = NULL;
+ switch_core_session_t *aleg_core_session = NULL;
+ switch_call_cause_t cause;
+
+ cause = SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
+
+ if (aleg_session != NULL) {
+ aleg_core_session = aleg_session->session;
+ }
+
+ begin_allow_threads();
+
+ if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
+ goto failed;
+ }
+
+ if (switch_ivr_originate(aleg_core_session,
+ &session,
+ &cause,
+ dest,
+ timeout,
+ NULL,
+ NULL,
+ NULL,
+ &caller_profile) != SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Error Creating Outgoing Channel! [%s]\n", dest);
+ goto failed;
+
+ }
+
+ end_allow_threads();
+ return SWITCH_STATUS_SUCCESS;
+
+ failed:
+ end_allow_threads();
+ return SWITCH_STATUS_FALSE;
+}
+
+
+void CoreSession::setCallerData(char *var, char *val) {
+
+ if (strcmp(var, "dialplan") == 0) {
+ caller_profile.dialplan = val;
+ }
+ if (strcmp(var, "context") == 0) {
+ caller_profile.context = val;
+ }
+ if (strcmp(var, "caller_id_name") == 0) {
+ caller_profile.caller_id_name = val;
+ }
+ if (strcmp(var, "caller_id_number") == 0) {
+ caller_profile.caller_id_number = val;
+ }
+ if (strcmp(var, "network_addr") == 0) {
+ caller_profile.network_addr = val;
+ }
+ if (strcmp(var, "ani") == 0) {
+ caller_profile.ani = val;
+ }
+ if (strcmp(var, "aniii") == 0) {
+ caller_profile.aniii = val;
+ }
+ if (strcmp(var, "rdnis") == 0) {
+ caller_profile.rdnis = val;
+ }
+ if (strcmp(var, "username") == 0) {
+ caller_profile.username = val;
+ }
+
+}
+
void CoreSession::begin_allow_threads() {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CoreSession::begin_allow_threads() called and does nothing\n");
}
@@ -275,6 +361,147 @@
}
+/* ---- methods not bound to CoreSession instance ---- */
+
+
+void console_log(char *level_str, char *msg)
+{
+ switch_log_level_t level = SWITCH_LOG_DEBUG;
+ if (level_str) {
+ level = switch_log_str2level(level_str);
+ }
+ switch_log_printf(SWITCH_CHANNEL_LOG, level, msg);
+ fflush(stdout); // TEMP ONLY!! SHOULD NOT BE CHECKED IN!!
+}
+
+void console_clean_log(char *msg)
+{
+ switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN,SWITCH_LOG_DEBUG, msg);
+}
+
+
+char *api_execute(char *cmd, char *arg)
+{
+ switch_stream_handle_t stream = { 0 };
+ SWITCH_STANDARD_STREAM(stream);
+ switch_api_execute(cmd, arg, NULL, &stream);
+ return (char *) stream.data;
+}
+
+void api_reply_delete(char *reply)
+{
+ if (!switch_strlen_zero(reply)) {
+ free(reply);
+ }
+}
+
+
+void bridge(CoreSession &session_a, CoreSession &session_b)
+{
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "bridge called, session_a uuid: %s\n", session_a.get_uuid());
+ switch_input_callback_function_t dtmf_func = NULL;
+ switch_input_args_t args;
+
+ session_a.begin_allow_threads();
+ args = session_a.get_cb_args(); // get the cb_args data structure for session a
+ dtmf_func = args.input_callback; // get the call back function
+ switch_ivr_multi_threaded_bridge(session_a.session, session_b.session, dtmf_func, args.buf, args.buf);
+ session_a.end_allow_threads();
+
+}
+
+
+
+switch_status_t process_callback_result(char *ret,
+ struct input_callback_state *cb_state,
+ switch_core_session_t *session)
+{
+
+ switch_file_handle_t *fh = NULL;
+ fh = (switch_file_handle_t *) cb_state->extra;
+
+ if (!fh) {
+ return SWITCH_STATUS_FALSE;
+ }
+
+ if (!ret) {
+ return SWITCH_STATUS_FALSE;
+ }
+
+ if (!strncasecmp(ret, "speed", 4)) {
+ char *p;
+
+ if ((p = strchr(ret, ':'))) {
+ p++;
+ if (*p == '+' || *p == '-') {
+ int step;
+ if (!(step = atoi(p))) {
+ step = 1;
+ }
+ fh->speed += step;
+ } else {
+ int speed = atoi(p);
+ fh->speed = speed;
+ }
+ return SWITCH_STATUS_SUCCESS;
+ }
+
+ return SWITCH_STATUS_FALSE;
+
+ } else if (!strcasecmp(ret, "pause")) {
+ if (switch_test_flag(fh, SWITCH_FILE_PAUSE)) {
+ switch_clear_flag(fh, SWITCH_FILE_PAUSE);
+ } else {
+ switch_set_flag(fh, SWITCH_FILE_PAUSE);
+ }
+ return SWITCH_STATUS_SUCCESS;
+ } else if (!strcasecmp(ret, "stop")) {
+ return SWITCH_STATUS_FALSE;
+ } else if (!strcasecmp(ret, "restart")) {
+ unsigned int pos = 0;
+ fh->speed = 0;
+ switch_core_file_seek(fh, &pos, 0, SEEK_SET);
+ return SWITCH_STATUS_SUCCESS;
+ } else if (!strncasecmp(ret, "seek", 4)) {
+ switch_codec_t *codec;
+ unsigned int samps = 0;
+ unsigned int pos = 0;
+ char *p;
+ codec = switch_core_session_get_read_codec(session);
+
+ if ((p = strchr(ret, ':'))) {
+ p++;
+ if (*p == '+' || *p == '-') {
+ int step;
+ if (!(step = atoi(p))) {
+ step = 1000;
+ }
+ if (step > 0) {
+ samps = step * (codec->implementation->samples_per_second / 1000);
+ switch_core_file_seek(fh, &pos, samps, SEEK_CUR);
+ } else {
+ samps = step * (codec->implementation->samples_per_second / 1000);
+ switch_core_file_seek(fh, &pos, fh->pos - samps, SEEK_SET);
+ }
+ } else {
+ samps = atoi(p) * (codec->implementation->samples_per_second / 1000);
+ switch_core_file_seek(fh, &pos, samps, SEEK_SET);
+ }
+ }
+
+ return SWITCH_STATUS_SUCCESS;
+ }
+
+ if (!strcmp(ret, "true") || !strcmp(ret, "undefined")) {
+ return SWITCH_STATUS_SUCCESS;
+ }
+
+ return SWITCH_STATUS_FALSE;
+
+
+}
+
+
/* For Emacs:
* Local Variables:
* mode:c
1
0
Author: greenlizard
Date: Sat Jun 16 17:05:07 2007
New Revision: 5382
Added:
freeswitch/branches/greenlizard/src/mod/event_handlers/mod_radius_cdr/Makefile.am
- copied unchanged from r5381, /freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/Makefile.am
freeswitch/branches/greenlizard/src/mod/event_handlers/mod_radius_cdr/README
- copied unchanged from r5381, /freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/README
freeswitch/branches/greenlizard/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c
- copied unchanged from r5381, /freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c
freeswitch/branches/greenlizard/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.conf.xml
- copied unchanged from r5381, /freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.conf.xml
freeswitch/branches/greenlizard/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.h
- copied unchanged from r5381, /freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.h
freeswitch/branches/greenlizard/src/mod/event_handlers/mod_radius_cdr/radius/
- copied from r5381, /freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/radius/
freeswitch/branches/greenlizard/src/mod/event_handlers/mod_radius_cdr/radius/dictionary
- copied unchanged from r5381, /freeswitch/trunk/src/mod/event_handlers/mod_radius_cdr/radius/dictionary
Modified:
freeswitch/branches/greenlizard/build/modules.conf.in
freeswitch/branches/greenlizard/libs/libteletone/src/libteletone_detect.c
freeswitch/branches/greenlizard/libs/libteletone/src/libteletone_detect.h
freeswitch/branches/greenlizard/libs/libteletone/teletone.def
freeswitch/branches/greenlizard/src/include/switch_cpp.h
freeswitch/branches/greenlizard/src/include/switch_ivr.h
freeswitch/branches/greenlizard/src/include/switch_types.h
freeswitch/branches/greenlizard/src/mod/applications/mod_commands/mod_commands.c
freeswitch/branches/greenlizard/src/mod/applications/mod_dptools/mod_dptools.c
freeswitch/branches/greenlizard/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp
freeswitch/branches/greenlizard/src/mod/asr_tts/mod_lumenvox/Makefile
freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia_glue.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
freeswitch/branches/greenlizard/src/mod/languages/mod_python/Makefile
freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py
freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp
freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.h
freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_core_db/mod_spidermonkey_core_db.c
freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_etpan/mod_spidermonkey_etpan.c
freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.c
freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_skel/mod_spidermonkey_skel.c
freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_teletone/mod_spidermonkey_teletone.c
freeswitch/branches/greenlizard/src/switch_core_codec.c
freeswitch/branches/greenlizard/src/switch_core_io.c
freeswitch/branches/greenlizard/src/switch_cpp.cpp
freeswitch/branches/greenlizard/src/switch_event.c
freeswitch/branches/greenlizard/src/switch_ivr_async.c
freeswitch/branches/greenlizard/src/switch_rtp.c
Log:
merge trunk 5360 to 5381
Modified: freeswitch/branches/greenlizard/build/modules.conf.in
==============================================================================
--- freeswitch/branches/greenlizard/build/modules.conf.in (original)
+++ freeswitch/branches/greenlizard/build/modules.conf.in Sat Jun 16 17:05:07 2007
@@ -38,6 +38,7 @@
formats/mod_sndfile
#formats/mod_shout
#languages/mod_perl
+#languages/mod_python
#languages/mod_spidermonkey
#languages/mod_spidermonkey_teletone
#languages/mod_spidermonkey_core_db
Modified: freeswitch/branches/greenlizard/libs/libteletone/src/libteletone_detect.c
==============================================================================
--- freeswitch/branches/greenlizard/libs/libteletone/src/libteletone_detect.c (original)
+++ freeswitch/branches/greenlizard/libs/libteletone/src/libteletone_detect.c Sat Jun 16 17:05:07 2007
@@ -106,9 +106,8 @@
static teletone_detection_descriptor_t dtmf_detect_row_2nd[GRID_FACTOR];
static teletone_detection_descriptor_t dtmf_detect_col_2nd[GRID_FACTOR];
-static teletone_process_t dtmf_row[] = {697.0, 770.0, 852.0, 941.0};
-static teletone_process_t dtmf_col[] = {1209.0, 1336.0, 1477.0, 1633.0};
-
+static float dtmf_row[] = {697.0f, 770.0f, 852.0f, 941.0f};
+static float dtmf_col[] = {1209.0f, 1336.0f, 1477.0f, 1633.0f};
static char dtmf_positions[] = "123A" "456B" "789C" "*0#D";
@@ -122,39 +121,36 @@
int samples)
{
int i;
- teletone_process_t v1;
+ float v1;
for (i = 0; i < samples; i++) {
v1 = goertzel_state->v2;
goertzel_state->v2 = goertzel_state->v3;
- goertzel_state->v3 = goertzel_state->fac*goertzel_state->v2 - v1 + sample_buffer[i];
+ goertzel_state->v3 = (float)(goertzel_state->fac*goertzel_state->v2 - v1 + sample_buffer[i]);
}
}
-teletone_process_t teletone_goertzel_result (teletone_goertzel_state_t *goertzel_state)
-{
- return goertzel_state->v3 * goertzel_state->v3 + goertzel_state->v2 * goertzel_state->v2 - goertzel_state->v2 * goertzel_state->v3 * goertzel_state->fac;
-}
+#define teletone_goertzel_result(gs) ((gs)->v3 * (gs)->v3 + (gs)->v2 * (gs)->v2 - (gs)->v2 * (gs)->v3 * (gs)->fac)
void teletone_dtmf_detect_init (teletone_dtmf_detect_state_t *dtmf_detect_state, int sample_rate)
{
int i;
- teletone_process_t theta;
+ float theta;
dtmf_detect_state->hit1 = dtmf_detect_state->hit2 = 0;
for (i = 0; i < GRID_FACTOR; i++) {
- theta = M_TWO_PI*(dtmf_row[i]/(teletone_process_t)sample_rate);
- dtmf_detect_row[i].fac = 2.0*cos(theta);
+ theta = (float)(M_TWO_PI*(dtmf_row[i]/(float)sample_rate));
+ dtmf_detect_row[i].fac = (float)(2.0f*cos(theta));
- theta = M_TWO_PI*(dtmf_col[i]/(teletone_process_t)sample_rate);
- dtmf_detect_col[i].fac = 2.0*cos(theta);
+ theta = (float)(M_TWO_PI*(dtmf_col[i]/(float)sample_rate));
+ dtmf_detect_col[i].fac = (float)(2.0f*cos(theta));
- theta = M_TWO_PI*(dtmf_row[i]*2.0/(teletone_process_t)sample_rate);
- dtmf_detect_row_2nd[i].fac = 2.0*cos(theta);
+ theta = (float)(M_TWO_PI*(dtmf_row[i]*2.0/(float)sample_rate));
+ dtmf_detect_row_2nd[i].fac = (float)(2.0f*cos(theta));
- theta = M_TWO_PI*(dtmf_col[i]*2.0/(teletone_process_t)sample_rate);
- dtmf_detect_col_2nd[i].fac = 2.0*cos(theta);
+ theta = (float)(M_TWO_PI*(dtmf_col[i]*2.0/(float)sample_rate));
+ dtmf_detect_col_2nd[i].fac = (float)(2.0f*cos(theta));
goertzel_init (&dtmf_detect_state->row_out[i], &dtmf_detect_row[i]);
goertzel_init (&dtmf_detect_state->col_out[i], &dtmf_detect_col[i]);
@@ -172,7 +168,7 @@
void teletone_multi_tone_init(teletone_multi_tone_t *mt, teletone_tone_map_t *map)
{
- teletone_process_t theta = 0;
+ float theta = 0;
int x = 0;
if(!mt->min_samples) {
@@ -200,8 +196,8 @@
break;
}
mt->tone_count++;
- theta = M_TWO_PI*(map->freqs[x]/(teletone_process_t)mt->sample_rate);
- mt->tdd[x].fac = 2.0 * cos(theta);
+ theta = (float)(M_TWO_PI*(map->freqs[x]/(float)mt->sample_rate));
+ mt->tdd[x].fac = (float)(2.0f * cos(theta));
goertzel_init (&mt->gs[x], &mt->tdd[x]);
goertzel_init (&mt->gs2[x], &mt->tdd[x]);
}
@@ -213,8 +209,8 @@
int samples)
{
int sample, limit, j, x = 0;
- teletone_process_t v1, famp;
- teletone_process_t eng_sum = 0, eng_all[TELETONE_MAX_TONES];
+ float v1, famp;
+ float eng_sum = 0, eng_all[TELETONE_MAX_TONES];
int gtest = 0, see_hit = 0;
for (sample = 0; sample < samples; sample = limit) {
@@ -234,11 +230,11 @@
for(x = 0; x < mt->tone_count; x++) {
v1 = mt->gs[x].v2;
mt->gs[x].v2 = mt->gs[x].v3;
- mt->gs[x].v3 = mt->gs[x].fac * mt->gs[x].v2 - v1 + famp;
+ mt->gs[x].v3 = (float)(mt->gs[x].fac * mt->gs[x].v2 - v1 + famp);
v1 = mt->gs2[x].v2;
mt->gs2[x].v2 = mt->gs2[x].v3;
- mt->gs2[x].v3 = mt->gs2[x].fac*mt->gs2[x].v2 - v1 + famp;
+ mt->gs2[x].v3 = (float)(mt->gs2[x].fac*mt->gs2[x].v2 - v1 + famp);
}
}
@@ -249,7 +245,7 @@
eng_sum = 0;
for(x = 0; x < mt->tone_count; x++) {
- eng_all[x] = teletone_goertzel_result (&mt->gs[x]);
+ eng_all[x] = (float)(teletone_goertzel_result (&mt->gs[x]));
eng_sum += eng_all[x];
}
@@ -299,10 +295,10 @@
int16_t sample_buffer[],
int samples)
{
- teletone_process_t row_energy[GRID_FACTOR];
- teletone_process_t col_energy[GRID_FACTOR];
- teletone_process_t famp;
- teletone_process_t v1;
+ float row_energy[GRID_FACTOR];
+ float col_energy[GRID_FACTOR];
+ float famp;
+ float v1;
int i;
int j;
int sample;
@@ -329,19 +325,19 @@
for(x = 0; x < GRID_FACTOR; x++) {
v1 = dtmf_detect_state->row_out[x].v2;
dtmf_detect_state->row_out[x].v2 = dtmf_detect_state->row_out[x].v3;
- dtmf_detect_state->row_out[x].v3 = dtmf_detect_state->row_out[x].fac*dtmf_detect_state->row_out[x].v2 - v1 + famp;
+ dtmf_detect_state->row_out[x].v3 = (float)(dtmf_detect_state->row_out[x].fac*dtmf_detect_state->row_out[x].v2 - v1 + famp);
v1 = dtmf_detect_state->col_out[x].v2;
dtmf_detect_state->col_out[x].v2 = dtmf_detect_state->col_out[x].v3;
- dtmf_detect_state->col_out[x].v3 = dtmf_detect_state->col_out[x].fac*dtmf_detect_state->col_out[x].v2 - v1 + famp;
+ dtmf_detect_state->col_out[x].v3 = (float)(dtmf_detect_state->col_out[x].fac*dtmf_detect_state->col_out[x].v2 - v1 + famp);
v1 = dtmf_detect_state->col_out2nd[x].v2;
dtmf_detect_state->col_out2nd[x].v2 = dtmf_detect_state->col_out2nd[x].v3;
- dtmf_detect_state->col_out2nd[x].v3 = dtmf_detect_state->col_out2nd[x].fac*dtmf_detect_state->col_out2nd[x].v2 - v1 + famp;
+ dtmf_detect_state->col_out2nd[x].v3 = (float)(dtmf_detect_state->col_out2nd[x].fac*dtmf_detect_state->col_out2nd[x].v2 - v1 + famp);
v1 = dtmf_detect_state->row_out2nd[x].v2;
dtmf_detect_state->row_out2nd[x].v2 = dtmf_detect_state->row_out2nd[x].v3;
- dtmf_detect_state->row_out2nd[x].v3 = dtmf_detect_state->row_out2nd[x].fac*dtmf_detect_state->row_out2nd[x].v2 - v1 + famp;
+ dtmf_detect_state->row_out2nd[x].v3 = (float)(dtmf_detect_state->row_out2nd[x].fac*dtmf_detect_state->row_out2nd[x].v2 - v1 + famp);
}
}
@@ -352,15 +348,15 @@
}
/* We are at the end of a DTMF detection block */
/* Find the peak row and the peak column */
- row_energy[0] = teletone_goertzel_result (&dtmf_detect_state->row_out[0]);
- col_energy[0] = teletone_goertzel_result (&dtmf_detect_state->col_out[0]);
+ row_energy[0] = (float)(teletone_goertzel_result (&dtmf_detect_state->row_out[0]));
+ col_energy[0] = (float)(teletone_goertzel_result (&dtmf_detect_state->col_out[0]));
for (best_row = best_col = 0, i = 1; i < GRID_FACTOR; i++) {
- row_energy[i] = teletone_goertzel_result (&dtmf_detect_state->row_out[i]);
+ row_energy[i] = (float)(teletone_goertzel_result (&dtmf_detect_state->row_out[i]));
if (row_energy[i] > row_energy[best_row]) {
best_row = i;
}
- col_energy[i] = teletone_goertzel_result (&dtmf_detect_state->col_out[i]);
+ col_energy[i] = (float)(teletone_goertzel_result (&dtmf_detect_state->col_out[i]));
if (col_energy[i] > col_energy[best_col]) {
best_col = i;
}
Modified: freeswitch/branches/greenlizard/libs/libteletone/src/libteletone_detect.h
==============================================================================
--- freeswitch/branches/greenlizard/libs/libteletone/src/libteletone_detect.h (original)
+++ freeswitch/branches/greenlizard/libs/libteletone/src/libteletone_detect.h Sat Jun 16 17:05:07 2007
@@ -136,9 +136,9 @@
/*! \brief A continer for the elements of a Goertzel Algorithm (The names are from his formula) */
typedef struct {
- teletone_process_t v2;
- teletone_process_t v3;
- teletone_process_t fac;
+ float v2;
+ float v3;
+ double fac;
} teletone_goertzel_state_t;
/*! \brief A container for a DTMF detection state.*/
@@ -153,7 +153,7 @@
teletone_goertzel_state_t col_out[GRID_FACTOR];
teletone_goertzel_state_t row_out2nd[GRID_FACTOR];
teletone_goertzel_state_t col_out2nd[GRID_FACTOR];
- teletone_process_t energy;
+ float energy;
int current_sample;
char digits[TELETONE_MAX_DTMF_DIGITS + 1];
@@ -165,7 +165,7 @@
/*! \brief An abstraction to store the coefficient of a tone frequency */
typedef struct {
- teletone_process_t fac;
+ float fac;
} teletone_detection_descriptor_t;
/*! \brief A container for a single multi-tone detection
@@ -180,7 +180,7 @@
teletone_goertzel_state_t gs2[TELETONE_MAX_TONES];
int tone_count;
- teletone_process_t energy;
+ float energy;
int current_sample;
int min_samples;
@@ -253,13 +253,6 @@
int16_t sample_buffer[],
int samples);
- /*!
- \brief Compute the result of the last applied step of the Goertzel Algorithm
- \param goertzel_state the goertzel state to retrieve from
- \return the computed value for consideration in furthur audio tests
- */
- teletone_process_t teletone_goertzel_result (teletone_goertzel_state_t *goertzel_state);
-
#ifdef __cplusplus
Modified: freeswitch/branches/greenlizard/libs/libteletone/teletone.def
==============================================================================
--- freeswitch/branches/greenlizard/libs/libteletone/teletone.def (original)
+++ freeswitch/branches/greenlizard/libs/libteletone/teletone.def Sat Jun 16 17:05:07 2007
@@ -5,7 +5,6 @@
teletone_init_session
teletone_set_map
teletone_set_tone
-teletone_goertzel_result
teletone_goertzel_update
teletone_dtmf_get
teletone_dtmf_detect
Modified: freeswitch/branches/greenlizard/src/include/switch_cpp.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_cpp.h (original)
+++ freeswitch/branches/greenlizard/src/include/switch_cpp.h Sat Jun 16 17:05:07 2007
@@ -28,7 +28,7 @@
// eg, PyThreadState *threadState
void *extra; // currently used to store a switch_file_handle_t
char *funcargs; // extra string that will be passed to callback function
-};
+} input_callback_state;
class CoreSession {
Modified: freeswitch/branches/greenlizard/src/include/switch_ivr.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_ivr.h (original)
+++ freeswitch/branches/greenlizard/src/include/switch_ivr.h Sat Jun 16 17:05:07 2007
@@ -200,6 +200,9 @@
*/
SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t *session, char *file, uint32_t limit, switch_file_handle_t *fh);
+SWITCH_DECLARE(switch_status_t) switch_ivr_displace_session(switch_core_session_t *session, char *file, uint32_t limit, const char *flags);
+SWITCH_DECLARE(switch_status_t) switch_ivr_stop_displace_session(switch_core_session_t *session, char *file);
+
/*!
\brief Stop Recording a session
\param session the session to stop recording
@@ -230,18 +233,27 @@
SWITCH_DECLARE(void) switch_ivr_session_echo(switch_core_session_t *session);
/*!
- \brief Stop looking for FAX CNG
+ \brief Stop looking for TONES
\param session the session to stop looking
\return SWITCH_STATUS_SUCCESS if all is well
*/
-SWITCH_DECLARE(switch_status_t) switch_ivr_stop_fax_detect_session(switch_core_session_t *session);
+SWITCH_DECLARE(switch_status_t) switch_ivr_stop_tone_detect_session(switch_core_session_t *session);
/*!
- \brief Start looking for FAX CNG
+ \brief Start looking for TONES
\param session the session to start looking
+ \param key the name of the tone.
+ \param tone_spec comma sep list of tone freqs
+ \param flags one or both of 'r' and 'w'
+ \param timeout timeout
+ \param app optional application to execute when tone is found
+ \param data optional data for appliaction
\return SWITCH_STATUS_SUCCESS if all is well
*/
-SWITCH_DECLARE(switch_status_t) switch_ivr_fax_detect_session(switch_core_session_t *session);
+SWITCH_DECLARE(switch_status_t) switch_ivr_tone_detect_session(switch_core_session_t *session,
+ const char *key, const char *tone_spec,
+ const char *flags, time_t timeout,
+ const char *app, const char *data);
Modified: freeswitch/branches/greenlizard/src/include/switch_types.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_types.h (original)
+++ freeswitch/branches/greenlizard/src/include/switch_types.h Sat Jun 16 17:05:07 2007
@@ -852,7 +852,7 @@
SWITCH_EVENT_CODEC - Codec Change
SWITCH_EVENT_BACKGROUND_JOB - Background Job
SWITCH_EVENT_DETECTED_SPEECH - Detected Speech
- SWITCH_EVENT_DETECTED_FAX - Detected Fax CNG Tone
+ SWITCH_EVENT_DETECTED_TONE - Detected Tone
SWITCH_EVENT_PRIVATE_COMMAND - A private command event
SWITCH_EVENT_HEARTBEAT - Machine is alive
SWITCH_EVENT_TRAP - Error Trap
@@ -902,7 +902,7 @@
SWITCH_EVENT_CODEC,
SWITCH_EVENT_BACKGROUND_JOB,
SWITCH_EVENT_DETECTED_SPEECH,
- SWITCH_EVENT_DETECTED_FAX,
+ SWITCH_EVENT_DETECTED_TONE,
SWITCH_EVENT_PRIVATE_COMMAND,
SWITCH_EVENT_HEARTBEAT,
SWITCH_EVENT_TRAP,
Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_commands/mod_commands.c (original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_commands/mod_commands.c Sat Jun 16 17:05:07 2007
@@ -276,6 +276,54 @@
return SWITCH_STATUS_SUCCESS;
}
+SWITCH_STANDARD_API(tone_detect_session_function)
+{
+ char *argv[6] = { 0 };
+ int argc;
+ char *mydata = NULL;
+ time_t to = 0;
+ switch_core_session_t *rsession;
+
+ mydata = strdup(cmd);
+ assert(mydata != NULL);
+
+ if ((argc = switch_separate_string(mydata, ' ', argv, sizeof(argv) / sizeof(argv[0]))) < 3) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "INVALID ARGS!\n");
+ }
+
+ if (!(rsession = switch_core_session_locate(argv[0]))) {
+ stream->write_function(stream, "-Error Cannot locate session!\n");
+ return SWITCH_STATUS_SUCCESS;
+ }
+
+ if (argv[4]) {
+ uint32_t mto;
+ if (*argv[4] == '+') {
+ if ((mto = atoi(argv[4]+1)) > 0) {
+ to = time(NULL) + mto;
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "INVALID Timeout!\n");
+ goto done;
+ }
+ } else {
+ if ((to = atoi(argv[4])) < time(NULL)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "INVALID Timeout!\n");
+ to = 0;
+ goto done;
+ }
+ }
+ }
+
+ switch_ivr_tone_detect_session(rsession, argv[1], argv[2], argv[3], to, argv[5], argv[6]);
+ stream->write_function(stream, "Enabling tone detection '%s' '%s' '%s'\n", argv[1], argv[2], argv[3]);
+
+ done:
+
+ free(mydata);
+ switch_core_session_rwunlock(rsession);
+
+ return SWITCH_STATUS_SUCCESS;
+}
SWITCH_STANDARD_API(sched_transfer_function)
{
@@ -565,7 +613,7 @@
goto usage;
}
- if ((argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) != 3) {
+ if ((argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) < 3) {
goto usage;
}
@@ -609,6 +657,73 @@
return SWITCH_STATUS_SUCCESS;
}
+
+SWITCH_STANDARD_API(session_displace_function)
+{
+ switch_core_session_t *rsession = NULL;
+ char *mycmd = NULL, *argv[5] = { 0 };
+ char *uuid = NULL, *action = NULL, *path = NULL;
+ int argc = 0;
+ uint32_t limit = 0;
+ char *flags = NULL;
+
+ if (session) {
+ return SWITCH_STATUS_FALSE;
+ }
+
+ if (switch_strlen_zero(cmd)) {
+ goto usage;
+ }
+
+ if (!(mycmd = strdup(cmd))) {
+ goto usage;
+ }
+
+ if ((argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) < 3) {
+ goto usage;
+ }
+
+ uuid = argv[0];
+ action = argv[1];
+ path = argv[2];
+ limit = argv[3] ? atoi(argv[3]) : 0;
+ flags = argv[4];
+
+ if (!(rsession = switch_core_session_locate(uuid))) {
+ stream->write_function(stream, "-Error Cannot locate session!\n");
+ return SWITCH_STATUS_SUCCESS;
+ }
+
+ if (switch_strlen_zero(action) || switch_strlen_zero(path)) {
+ goto usage;
+ }
+
+ if (!strcasecmp(action, "start")) {
+ switch_ivr_displace_session(rsession, path, limit, flags);
+ } else if (!strcasecmp(action, "stop")) {
+ switch_ivr_stop_displace_session(rsession, path);
+ } else {
+ goto usage;
+ }
+
+ goto done;
+
+ usage:
+
+ stream->write_function(stream, "INVALID SYNTAX\n");
+ switch_safe_free(mycmd);
+
+
+ done:
+
+ if (rsession) {
+ switch_core_session_rwunlock(rsession);
+ }
+
+ switch_safe_free(mycmd);
+ return SWITCH_STATUS_SUCCESS;
+}
+
SWITCH_STANDARD_API(pause_function)
{
switch_core_session_t *psession = NULL;
@@ -1237,12 +1352,20 @@
/*.next */ &broadcast_api_interface
};
+static switch_api_interface_t session_displace_api_interface = {
+ /*.interface_name */ "session_displace",
+ /*.desc */ "session displace",
+ /*.function */ session_displace_function,
+ /*.syntax */ "<uuid> [start|stop] <path> [<limit>] [mux]",
+ /*.next */ &broadcast_api_interface
+};
+
static switch_api_interface_t uuid_bridge_api_interface = {
/*.interface_name */ "uuid_bridge",
/*.desc */ "uuid_bridge",
/*.function */ uuid_bridge_function,
/*.syntax */ "<uuid> <other_uuid>",
- /*.next */ &session_record_api_interface
+ /*.next */ &session_displace_api_interface
};
static switch_api_interface_t status_api_interface = {
@@ -1310,13 +1433,22 @@
/*.next */ &reload_api_interface
};
+static switch_api_interface_t tone_detect_session_interface = {
+ /*.interface_name */ "tone_detect",
+ /*.desc */ "Start Tone Detection on a channel",
+ /*.function */ tone_detect_session_function,
+ /*.syntax */
+ "<uuid> <key> <tone_spec> [<flags> <timeout> <app> <args>]",
+ /*.next */ &kill_api_interface
+};
+
static switch_api_interface_t originate_api_interface = {
/*.interface_name */ "originate",
/*.desc */ "Originate a Call",
/*.function */ originate_function,
/*.syntax */
"<call url> <exten>|&<application_name>(<app_args>) [<dialplan>] [<context>] [<cid_name>] [<cid_num>] [<timeout_sec>]",
- /*.next */ &kill_api_interface
+ /*.next */ &tone_detect_session_interface
};
static switch_loadable_module_interface_t commands_module_interface = {
Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_dptools/mod_dptools.c (original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_dptools/mod_dptools.c Sat Jun 16 17:05:07 2007
@@ -664,14 +664,45 @@
static void fax_detect_session_function(switch_core_session_t *session, char *data)
{
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Enabling fax detection\n");
- switch_ivr_fax_detect_session(session);
+ switch_ivr_tone_detect_session(session, "fax", "1100.0", "r", 0, NULL, NULL);
+}
+
+static void tone_detect_session_function(switch_core_session_t *session, char *data)
+{
+ char *argv[6] = { 0 };
+ int argc;
+ char *mydata = NULL;
+ time_t to = 0;
+
+ mydata = switch_core_session_strdup(session, data);
+ if ((argc = switch_separate_string(mydata, ' ', argv, sizeof(argv) / sizeof(argv[0]))) < 2) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "INVALID ARGS!\n");
+ }
+ if (argv[3]) {
+ uint32_t mto;
+ if (*argv[3] == '+') {
+ if ((mto = atol(argv[3]+1)) > 0) {
+ to = time(NULL) + mto;
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "INVALID Timeout!\n");
+ }
+ } else {
+ if ((to = atol(argv[3])) < time(NULL)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "INVALID Timeout!\n");
+ to = 0;
+ }
+ }
+ }
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Enabling tone detection '%s' '%s'\n", argv[0], argv[1]);
+
+ switch_ivr_tone_detect_session(session, argv[0], argv[1], argv[2], to, argv[4], argv[5]);
}
static void stop_fax_detect_session_function(switch_core_session_t *session, char *data)
{
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Disabling fax detection\n");
- switch_ivr_stop_fax_detect_session(session);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Disabling tone detection\n");
+ switch_ivr_stop_tone_detect_session(session);
}
static void echo_function(switch_core_session_t *session, char *data)
@@ -789,6 +820,43 @@
}
+static void displace_session_function(switch_core_session_t *session, char *data)
+{
+ switch_channel_t *channel;
+ char *path = NULL;
+ uint32_t limit = 0;
+ char *argv[6];
+ int x, argc;
+ char *lbuf = NULL;
+ char *flags = NULL;
+
+ channel = switch_core_session_get_channel(session);
+ assert(channel != NULL);
+
+ if (data && (lbuf = switch_core_session_strdup(session, data))
+ && (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
+ path = argv[0];
+ for(x = 0; x < argc; x++) {
+ if (strchr(argv[x], '+')) {
+ limit = atoi(argv[x]);
+ } else if (!switch_strlen_zero(argv[x])) {
+ flags = argv[x];
+ }
+ }
+ switch_ivr_displace_session(session, path, limit, flags);
+ }
+}
+
+
+static void stop_displace_session_function(switch_core_session_t *session, char *data)
+{
+ switch_channel_t *channel;
+ channel = switch_core_session_get_channel(session);
+ assert(channel != NULL);
+
+ switch_ivr_stop_displace_session(session, data);
+}
+
static void record_function(switch_core_session_t *session, char *data)
{
@@ -995,6 +1063,26 @@
&bridge_application_interface
};
+static switch_application_interface_t displace_application_interface = {
+ /*.interface_name */ "displace",
+ /*.application_function */ displace_session_function,
+ /* long_desc */ "Displace audio from a file to the channels input",
+ /* short_desc */ "Displace File",
+ /* syntax */ "<path> [+time_limit_ms] [mux]",
+ /* flags */ SAF_NONE,
+ &speak_application_interface
+};
+
+static switch_application_interface_t stop_displace_application_interface = {
+ /*.interface_name */ "displace",
+ /*.application_function */ stop_displace_session_function,
+ /* long_desc */ "Stop Displacing to a file",
+ /* short_desc */ "Stop Displace File",
+ /* syntax */ "<path>",
+ /* flags */ SAF_NONE,
+ &displace_application_interface
+};
+
static switch_application_interface_t record_application_interface = {
/*.interface_name */ "record",
/*.application_function */ record_function,
@@ -1002,7 +1090,7 @@
/* short_desc */ "Record File",
/* syntax */ "<path> [+time_limit_ms]",
/* flags */ SAF_NONE,
- &speak_application_interface
+ &stop_displace_application_interface
};
@@ -1056,6 +1144,17 @@
/*.next */ &park_application_interface
};
+
+static switch_application_interface_t tone_detect_application_interface = {
+ /*.interface_name */ "tone_detect",
+ /*.application_function */ tone_detect_session_function,
+ /* long_desc */ "Detect tones",
+ /* short_desc */ "Detect tones",
+ /* syntax */ "",
+ /* flags */ SAF_NONE,
+ /*.next */ &echo_application_interface
+};
+
static switch_application_interface_t fax_detect_application_interface = {
/*.interface_name */ "fax_detect",
/*.application_function */ fax_detect_session_function,
@@ -1063,14 +1162,14 @@
/* short_desc */ "Detect faxes",
/* syntax */ "",
/* flags */ SAF_NONE,
- /*.next */ &echo_application_interface
+ /*.next */ &tone_detect_application_interface
};
-static switch_application_interface_t stop_fax_detect_application_interface = {
- /*.interface_name */ "stop_fax_detect",
+static switch_application_interface_t stop_tone_detect_application_interface = {
+ /*.interface_name */ "stop_tone_detect",
/*.application_function */ stop_fax_detect_session_function,
- /* long_desc */ "Stop detecting fax send tones",
- /* short_desc */ "stop detecting faxes",
+ /* long_desc */ "Stop detecting tones",
+ /* short_desc */ "stop detecting tones",
/* syntax */ "",
/* flags */ SAF_NONE,
/* next */ &fax_detect_application_interface
@@ -1083,7 +1182,7 @@
/* short_desc */ "Detect dtmf",
/* syntax */ "",
/* flags */ SAF_NONE,
- /* next */ &stop_fax_detect_application_interface
+ /* next */ &stop_tone_detect_application_interface
};
static switch_application_interface_t stop_dtmf_application_interface = {
Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp (original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp Sat Jun 16 17:05:07 2007
@@ -257,8 +257,13 @@
char *lbuf = NULL;
int x;
- if (switch_channel_get_private(channel, "_soundtouch_")) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot run 2 at once on the same channel!\n");
+ if ((bug = (switch_media_bug_t *) switch_channel_get_private(channel, "_soundtouch_"))) {
+ if (!switch_strlen_zero(data) && !strcasecmp(data, "stop")) {
+ switch_channel_set_private(channel, "_soundtouch_", NULL);
+ switch_core_media_bug_remove(session, &bug);
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot run 2 at once on the same channel!\n");
+ }
return;
}
Modified: freeswitch/branches/greenlizard/src/mod/asr_tts/mod_lumenvox/Makefile
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/asr_tts/mod_lumenvox/Makefile (original)
+++ freeswitch/branches/greenlizard/src/mod/asr_tts/mod_lumenvox/Makefile Sat Jun 16 17:05:07 2007
@@ -3,7 +3,9 @@
# and define these variables to impact your build
-LVENGINE_DIR=/opt/lumenvox/engine_7.0
+LVENGINE_DIR=/opt/lumenvox/engine_7.5
+LVINCLUDE=$(LVENGINE_DIR)/include
+LVLIB=$(LVENGINE_DIR)/lib
LOCAL_CFLAGS= -fpermissive -Wno-deprecated -Wno-conversion -fpermissive -Wno-unused
LOCAL_CFLAGS+= -Wno-comment -Wno-sign-compare -Wno-conversion -Wno-reorder -I$(LVINCLUDE)
LOCAL_LDFLAGS= -L$(LVLIB) -llv_lvspeechport
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia_glue.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia_glue.c Sat Jun 16 17:05:07 2007
@@ -913,6 +913,20 @@
uint8_t vad_out = switch_test_flag(tech_pvt, TFLAG_VAD_OUT) ? 1 : 0;
uint8_t inb = switch_test_flag(tech_pvt, TFLAG_OUTBOUND) ? 0 : 1;
+ if ((val = switch_channel_get_variable(tech_pvt->channel, "rtp_enable_vad_in")) && switch_true(val)) {
+ vad_in = 1;
+ }
+ if ((val = switch_channel_get_variable(tech_pvt->channel, "rtp_enable_vad_out")) && switch_true(val)) {
+ vad_out = 1;
+ }
+
+ if ((val = switch_channel_get_variable(tech_pvt->channel, "rtp_disable_vad_in")) && switch_true(val)) {
+ vad_in = 0;
+ }
+ if ((val = switch_channel_get_variable(tech_pvt->channel, "rtp_disable_vad_out")) && switch_true(val)) {
+ vad_out = 0;
+ }
+
tech_pvt->ssrc = switch_rtp_get_ssrc(tech_pvt->rtp_session);
switch_set_flag_locked(tech_pvt, TFLAG_RTP);
switch_set_flag_locked(tech_pvt, TFLAG_IO);
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c Sat Jun 16 17:05:07 2007
@@ -111,7 +111,8 @@
uint32_t samples_per_frame;
int dtmf_on;
int dtmf_off;
- int supress_dtmf_tone;
+ int suppress_dtmf_tone;
+ int ignore_dtmf_tone;
int configured_spans;
int configured_boost_spans;
char *dialplan;
@@ -524,8 +525,11 @@
tech_pvt->tone_session.rate = rate;
tech_pvt->tone_session.duration = globals.dtmf_on * (tech_pvt->tone_session.rate / 1000);
tech_pvt->tone_session.wait = globals.dtmf_off * (tech_pvt->tone_session.rate / 1000);
+
+ if (!globals.ignore_dtmf_tone) {
+ teletone_dtmf_detect_init (&tech_pvt->dtmf_detect, rate);
+ }
- teletone_dtmf_detect_init (&tech_pvt->dtmf_detect, rate);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Audio init %s\n", switch_channel_get_name(channel));
switch_set_flag(tech_pvt, TFLAG_CODEC);
@@ -786,25 +790,26 @@
tech_pvt->read_frame.datalen = bytes;
tech_pvt->read_frame.samples = bytes / 2;
-
- teletone_dtmf_detect (&tech_pvt->dtmf_detect, tech_pvt->read_frame.data, tech_pvt->read_frame.samples);
- teletone_dtmf_get(&tech_pvt->dtmf_detect, digit_str, sizeof(digit_str));
- if(digit_str[0]) {
- switch_channel_queue_dtmf(channel, digit_str);
- if (globals.debug) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "DTMF DETECTED: [%s]\n", digit_str);
- }
- if (globals.supress_dtmf_tone) {
- tech_pvt->skip_read_frames = 20;
+ if (!globals.ignore_dtmf_tone) {
+ teletone_dtmf_detect (&tech_pvt->dtmf_detect, tech_pvt->read_frame.data, tech_pvt->read_frame.samples);
+ teletone_dtmf_get(&tech_pvt->dtmf_detect, digit_str, sizeof(digit_str));
+
+ if(digit_str[0]) {
+ switch_channel_queue_dtmf(channel, digit_str);
+ if (globals.debug) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "DTMF DETECTED: [%s]\n", digit_str);
+ }
+ if (globals.suppress_dtmf_tone) {
+ tech_pvt->skip_read_frames = 20;
+ }
}
- }
- if (tech_pvt->skip_read_frames > 0) {
- memset(tech_pvt->read_frame.data, 0, tech_pvt->read_frame.datalen);
- tech_pvt->skip_read_frames--;
+ if (tech_pvt->skip_read_frames > 0) {
+ memset(tech_pvt->read_frame.data, 0, tech_pvt->read_frame.datalen);
+ tech_pvt->skip_read_frames--;
+ }
}
-
#ifdef DOTRACE
write(tech_pvt->fd2, tech_pvt->read_frame.data, (int) tech_pvt->read_frame.datalen);
#endif
@@ -2220,8 +2225,10 @@
globals.dtmf_off = atoi(val);
} else if (!strcmp(var, "dialplan")) {
set_global_dialplan(val);
- } else if (!strcmp(var, "supress-dtmf-tone")) {
- globals.supress_dtmf_tone = switch_true(val);
+ } else if (!strcmp(var, "suppress-dtmf-tone")) {
+ globals.suppress_dtmf_tone = switch_true(val);
+ } else if (!strcmp(var, "ignore-dtmf-tone")) {
+ globals.ignore_dtmf_tone = switch_true(val);
}
}
}
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/Makefile
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/Makefile (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/Makefile Sat Jun 16 17:05:07 2007
@@ -3,8 +3,8 @@
# and define these variables to impact your build
-LOCAL_CFLAGS=-I/usr/include/python2.4/
-LOCAL_LDFLAGS=-lpython2.4 -L/usr/lib/python2.4/config/ -lutil -lstdc++
+LOCAL_CFLAGS=-I$(PREFIX)/include/python2.5/
+LOCAL_LDFLAGS=-lpython2.5 -L$(PREFIX)/lib/python2.5/config/ -lutil -lstdc++
LOCAL_OBJS=freeswitch_python.o mod_python_wrap.o
include ../../../../build/modmake.rules
@@ -13,8 +13,8 @@
SWIGCFILE=../../../switch_swig.c
SWIGIFILE=../../../switch_swig.i
-#local_depend:
-# MAKE=$(MAKE) PY_CFLAGS=-fPIC $(BASE)/build/buildlib.sh $(BASE) install Python-2.4.3.tgz --prefix=$(PREFIX) --enable-threads
+local_depend:
+ MAKE=$(MAKE) $(BASE)/build/buildlib.sh $(BASE) install Python-2.5.1.tgz --prefix=$(PREFIX) --enable-threads CFLAGSFORSHARED="-fPIC"
reswig:
swig -python -shadow -c++ -I../../../../src/include -o mod_python_wrap.cpp mod_python.i
@@ -26,7 +26,5 @@
$(CC) -w $(CFLAGS) -c $< -o $@
local_install:
- cp -f freeswitch.py /usr/lib/python2.4/site-packages/
-
-
+ cp -f freeswitch.py $(PREFIX)/lib/python2.5/site-packages/
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py Sat Jun 16 17:05:07 2007
@@ -1,10 +1,16 @@
-# This file was created automatically by SWIG 1.3.29.
+# This file was automatically generated by SWIG (http://www.swig.org)
+# Version 1.3.31
+#
# Don't modify this file, modify the SWIG interface instead.
# This file is compatible with both classic and new-style classes.
import _freeswitch
import new
new_instancemethod = new.instancemethod
+try:
+ _swig_property = property
+except NameError:
+ pass # Python < 2.2 doesn't have 'property'.
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name == "this"):
@@ -55,16 +61,16 @@
__repr__ = _swig_repr
__swig_setmethods__["function"] = _freeswitch.input_callback_state_function_set
__swig_getmethods__["function"] = _freeswitch.input_callback_state_function_get
- if _newclass:function = property(_freeswitch.input_callback_state_function_get, _freeswitch.input_callback_state_function_set)
+ if _newclass:function = _swig_property(_freeswitch.input_callback_state_function_get, _freeswitch.input_callback_state_function_set)
__swig_setmethods__["threadState"] = _freeswitch.input_callback_state_threadState_set
__swig_getmethods__["threadState"] = _freeswitch.input_callback_state_threadState_get
- if _newclass:threadState = property(_freeswitch.input_callback_state_threadState_get, _freeswitch.input_callback_state_threadState_set)
+ if _newclass:threadState = _swig_property(_freeswitch.input_callback_state_threadState_get, _freeswitch.input_callback_state_threadState_set)
__swig_setmethods__["extra"] = _freeswitch.input_callback_state_extra_set
__swig_getmethods__["extra"] = _freeswitch.input_callback_state_extra_get
- if _newclass:extra = property(_freeswitch.input_callback_state_extra_get, _freeswitch.input_callback_state_extra_set)
+ if _newclass:extra = _swig_property(_freeswitch.input_callback_state_extra_get, _freeswitch.input_callback_state_extra_set)
__swig_setmethods__["funcargs"] = _freeswitch.input_callback_state_funcargs_set
__swig_getmethods__["funcargs"] = _freeswitch.input_callback_state_funcargs_get
- if _newclass:funcargs = property(_freeswitch.input_callback_state_funcargs_get, _freeswitch.input_callback_state_funcargs_set)
+ if _newclass:funcargs = _swig_property(_freeswitch.input_callback_state_funcargs_get, _freeswitch.input_callback_state_funcargs_set)
def __init__(self, *args):
this = _freeswitch.new_input_callback_state(*args)
try: self.this.append(this)
@@ -88,13 +94,13 @@
__del__ = lambda self : None;
__swig_setmethods__["session"] = _freeswitch.CoreSession_session_set
__swig_getmethods__["session"] = _freeswitch.CoreSession_session_get
- if _newclass:session = property(_freeswitch.CoreSession_session_get, _freeswitch.CoreSession_session_set)
+ if _newclass:session = _swig_property(_freeswitch.CoreSession_session_get, _freeswitch.CoreSession_session_set)
__swig_setmethods__["channel"] = _freeswitch.CoreSession_channel_set
__swig_getmethods__["channel"] = _freeswitch.CoreSession_channel_get
- if _newclass:channel = property(_freeswitch.CoreSession_channel_get, _freeswitch.CoreSession_channel_set)
+ if _newclass:channel = _swig_property(_freeswitch.CoreSession_channel_get, _freeswitch.CoreSession_channel_set)
__swig_setmethods__["cb_state"] = _freeswitch.CoreSession_cb_state_set
__swig_getmethods__["cb_state"] = _freeswitch.CoreSession_cb_state_get
- if _newclass:cb_state = property(_freeswitch.CoreSession_cb_state_get, _freeswitch.CoreSession_cb_state_set)
+ if _newclass:cb_state = _swig_property(_freeswitch.CoreSession_cb_state_get, _freeswitch.CoreSession_cb_state_set)
def answer(*args): return _freeswitch.CoreSession_answer(*args)
def preAnswer(*args): return _freeswitch.CoreSession_preAnswer(*args)
def hangup(*args): return _freeswitch.CoreSession_hangup(*args)
@@ -118,10 +124,10 @@
PythonDTMFCallback = _freeswitch.PythonDTMFCallback
class PySession(CoreSession):
__swig_setmethods__ = {}
- for _s in [CoreSession]: __swig_setmethods__.update(_s.__swig_setmethods__)
+ for _s in [CoreSession]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, PySession, name, value)
__swig_getmethods__ = {}
- for _s in [CoreSession]: __swig_getmethods__.update(_s.__swig_getmethods__)
+ for _s in [CoreSession]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, PySession, name)
__repr__ = _swig_repr
def __init__(self, *args):
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp Sat Jun 16 17:05:07 2007
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org)
- * Version 1.3.29
+ * Version 1.3.31
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
@@ -120,7 +120,7 @@
#endif
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
-#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER)
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE
#endif
@@ -137,7 +137,7 @@
/* This should only be incremented when either the layout of swig_type_info changes,
or for whatever reason, the runtime changes incompatibly */
-#define SWIG_RUNTIME_VERSION "2"
+#define SWIG_RUNTIME_VERSION "3"
/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
#ifdef SWIG_TYPE_TABLE
@@ -714,8 +714,6 @@
-/* Python.h has to appear first */
-#include <Python.h>
/* Add PyOS_snprintf for old Pythons */
#if PY_VERSION_HEX < 0x02020000
@@ -796,6 +794,14 @@
}
#endif
+/* Py_ssize_t for old Pythons */
+/* This code is as recommended by: */
+/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+typedef int Py_ssize_t;
+# define PY_SSIZE_T_MAX INT_MAX
+# define PY_SSIZE_T_MIN INT_MIN
+#endif
/* -----------------------------------------------------------------------------
* error manipulation
@@ -1189,7 +1195,7 @@
SWIGRUNTIMEINLINE PyObject *
_SWIG_Py_None(void)
{
- PyObject *none = Py_BuildValue("");
+ PyObject *none = Py_BuildValue((char*)"");
Py_DECREF(none);
return none;
}
@@ -2048,7 +2054,7 @@
void *vptr = 0;
/* here we get the method pointer for callbacks */
- char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
+ const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
if (desc) {
desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
@@ -2169,7 +2175,7 @@
return;
}
#endif
- dict = PyObject_GetAttrString(inst, "__dict__");
+ dict = PyObject_GetAttrString(inst, (char*)"__dict__");
PyDict_SetItem(dict, SWIG_This(), swig_this);
Py_DECREF(dict);
}
@@ -2310,7 +2316,7 @@
/* The python cached type query */
SWIGRUNTIME PyObject *
-SWIG_Python_TypeCache() {
+SWIG_Python_TypeCache(void) {
static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
return cache;
}
@@ -2480,7 +2486,7 @@
#if (PY_VERSION_HEX <= 0x02000000)
# if !defined(SWIG_PYTHON_CLASSIC)
-# error "This python version requires to use swig with the '-classic' option"
+# error "This python version requires swig to be run with the '-classic' option"
# endif
#endif
@@ -2491,7 +2497,8 @@
#define SWIG_name "_freeswitch"
-#define SWIGVERSION 0x010329
+#define SWIGVERSION 0x010331
+#define SWIG_VERSION SWIGVERSION
#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
@@ -2566,7 +2573,7 @@
SWIGINTERN swig_type_info*
-SWIG_pchar_descriptor()
+SWIG_pchar_descriptor(void)
{
static int init = 0;
static swig_type_info* info = 0;
@@ -2582,7 +2589,7 @@
SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
{
if (PyString_Check(obj)) {
- char *cstr; int len;
+ char *cstr; Py_ssize_t len;
PyString_AsStringAndSize(obj, &cstr, &len);
if (cptr) {
if (alloc) {
@@ -3104,12 +3111,12 @@
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "console_log" "', argument " "1"" of type '" "char *""'");
}
- arg1 = buf1;
+ arg1 = reinterpret_cast< char * >(buf1);
res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "console_log" "', argument " "2"" of type '" "char *""'");
}
- arg2 = buf2;
+ arg2 = reinterpret_cast< char * >(buf2);
console_log(arg1,arg2);
resultobj = SWIG_Py_Void();
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
@@ -3135,7 +3142,7 @@
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "console_clean_log" "', argument " "1"" of type '" "char *""'");
}
- arg1 = buf1;
+ arg1 = reinterpret_cast< char * >(buf1);
console_clean_log(arg1);
resultobj = SWIG_Py_Void();
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
@@ -3165,14 +3172,14 @@
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "api_execute" "', argument " "1"" of type '" "char *""'");
}
- arg1 = buf1;
+ arg1 = reinterpret_cast< char * >(buf1);
res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "api_execute" "', argument " "2"" of type '" "char *""'");
}
- arg2 = buf2;
+ arg2 = reinterpret_cast< char * >(buf2);
result = (char *)api_execute(arg1,arg2);
- resultobj = SWIG_FromCharPtr(result);
+ resultobj = SWIG_FromCharPtr((const char *)result);
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
return resultobj;
@@ -3196,7 +3203,7 @@
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "api_reply_delete" "', argument " "1"" of type '" "char *""'");
}
- arg1 = buf1;
+ arg1 = reinterpret_cast< char * >(buf1);
api_reply_delete(arg1);
resultobj = SWIG_Py_Void();
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
@@ -3229,7 +3236,7 @@
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "process_callback_result" "', argument " "1"" of type '" "char *""'");
}
- arg1 = buf1;
+ arg1 = reinterpret_cast< char * >(buf1);
res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_input_callback_state, 0 | 0 );
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "process_callback_result" "', argument " "2"" of type '" "input_callback_state *""'");
@@ -3425,11 +3432,11 @@
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "input_callback_state_funcargs_set" "', argument " "2"" of type '" "char *""'");
}
- arg2 = buf2;
+ arg2 = reinterpret_cast< char * >(buf2);
if (arg1->funcargs) delete[] arg1->funcargs;
if (arg2) {
- size_t size = strlen(arg2) + 1;
- arg1->funcargs = reinterpret_cast< char* >(memcpy((new char[size]), arg2, sizeof(char)*(size)));
+ size_t size = strlen(reinterpret_cast< const char * >(arg2)) + 1;
+ arg1->funcargs = (char *)reinterpret_cast< char* >(memcpy((new char[size]), reinterpret_cast< const char * >(arg2), sizeof(char)*(size)));
} else {
arg1->funcargs = 0;
}
@@ -3457,7 +3464,7 @@
}
arg1 = reinterpret_cast< input_callback_state * >(argp1);
result = (char *) ((arg1)->funcargs);
- resultobj = SWIG_FromCharPtr(result);
+ resultobj = SWIG_FromCharPtr((const char *)result);
return resultobj;
fail:
return NULL;
@@ -3520,7 +3527,7 @@
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CoreSession" "', argument " "1"" of type '" "char *""'");
}
- arg1 = buf1;
+ arg1 = reinterpret_cast< char * >(buf1);
result = (CoreSession *)new CoreSession(arg1);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CoreSession, SWIG_POINTER_NEW | 0 );
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
@@ -3582,7 +3589,7 @@
}
fail:
- SWIG_SetErrorMsg(PyExc_NotImplementedError,"No matching function for overloaded 'new_CoreSession'");
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_CoreSession'.\n Possible C/C++ prototypes are:\n CoreSession(char *)\n CoreSession(switch_core_session_t *)\n");
return NULL;
}
@@ -3834,7 +3841,7 @@
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_hangup" "', argument " "2"" of type '" "char *""'");
}
- arg2 = buf2;
+ arg2 = reinterpret_cast< char * >(buf2);
(arg1)->hangup(arg2);
resultobj = SWIG_Py_Void();
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
@@ -3872,12 +3879,12 @@
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_setVariable" "', argument " "2"" of type '" "char *""'");
}
- arg2 = buf2;
+ arg2 = reinterpret_cast< char * >(buf2);
res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
if (!SWIG_IsOK(res3)) {
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_setVariable" "', argument " "3"" of type '" "char *""'");
}
- arg3 = buf3;
+ arg3 = reinterpret_cast< char * >(buf3);
(arg1)->setVariable(arg2,arg3);
resultobj = SWIG_Py_Void();
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
@@ -3913,9 +3920,9 @@
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_getVariable" "', argument " "2"" of type '" "char *""'");
}
- arg2 = buf2;
+ arg2 = reinterpret_cast< char * >(buf2);
result = (char *)(arg1)->getVariable(arg2);
- resultobj = SWIG_FromCharPtr(result);
+ resultobj = SWIG_FromCharPtr((const char *)result);
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
return resultobj;
fail:
@@ -3952,12 +3959,12 @@
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_playFile" "', argument " "2"" of type '" "char *""'");
}
- arg2 = buf2;
+ arg2 = reinterpret_cast< char * >(buf2);
res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
if (!SWIG_IsOK(res3)) {
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_playFile" "', argument " "3"" of type '" "char *""'");
}
- arg3 = buf3;
+ arg3 = reinterpret_cast< char * >(buf3);
result = (int)(arg1)->playFile(arg2,arg3);
resultobj = SWIG_From_int(static_cast< int >(result));
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
@@ -4055,7 +4062,7 @@
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_speak" "', argument " "2"" of type '" "char *""'");
}
- arg2 = buf2;
+ arg2 = reinterpret_cast< char * >(buf2);
result = (int)(arg1)->speak(arg2);
resultobj = SWIG_From_int(static_cast< int >(result));
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
@@ -4093,12 +4100,12 @@
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_set_tts_parms" "', argument " "2"" of type '" "char *""'");
}
- arg2 = buf2;
+ arg2 = reinterpret_cast< char * >(buf2);
res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
if (!SWIG_IsOK(res3)) {
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_set_tts_parms" "', argument " "3"" of type '" "char *""'");
}
- arg3 = buf3;
+ arg3 = reinterpret_cast< char * >(buf3);
(arg1)->set_tts_parms(arg2,arg3);
resultobj = SWIG_Py_Void();
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
@@ -4170,7 +4177,7 @@
if (!SWIG_IsOK(res4)) {
SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CoreSession_getDigits" "', argument " "4"" of type '" "char *""'");
}
- arg4 = buf4;
+ arg4 = reinterpret_cast< char * >(buf4);
res5 = SWIG_AsCharPtrAndSize(obj4, &t5, &n5, &alloc5);
if (!SWIG_IsOK(res5)) {
SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CoreSession_getDigits" "', argument " "5"" of type '" "char *terminator""'");
@@ -4232,17 +4239,17 @@
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_transfer" "', argument " "2"" of type '" "char *""'");
}
- arg2 = buf2;
+ arg2 = reinterpret_cast< char * >(buf2);
res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
if (!SWIG_IsOK(res3)) {
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_transfer" "', argument " "3"" of type '" "char *""'");
}
- arg3 = buf3;
+ arg3 = reinterpret_cast< char * >(buf3);
res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
if (!SWIG_IsOK(res4)) {
SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CoreSession_transfer" "', argument " "4"" of type '" "char *""'");
}
- arg4 = buf4;
+ arg4 = reinterpret_cast< char * >(buf4);
result = (int)(arg1)->transfer(arg2,arg3,arg4);
resultobj = SWIG_From_int(static_cast< int >(result));
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
@@ -4338,17 +4345,17 @@
if (!SWIG_IsOK(res6)) {
SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CoreSession_playAndGetDigits" "', argument " "6"" of type '" "char *""'");
}
- arg6 = buf6;
+ arg6 = reinterpret_cast< char * >(buf6);
res7 = SWIG_AsCharPtrAndSize(obj6, &buf7, NULL, &alloc7);
if (!SWIG_IsOK(res7)) {
SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CoreSession_playAndGetDigits" "', argument " "7"" of type '" "char *""'");
}
- arg7 = buf7;
+ arg7 = reinterpret_cast< char * >(buf7);
res8 = SWIG_AsCharPtrAndSize(obj7, &buf8, NULL, &alloc8);
if (!SWIG_IsOK(res8)) {
SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "CoreSession_playAndGetDigits" "', argument " "8"" of type '" "char *""'");
}
- arg8 = buf8;
+ arg8 = reinterpret_cast< char * >(buf8);
res9 = SWIG_AsCharPtrAndSize(obj8, &t9, &n9, &alloc9);
if (!SWIG_IsOK(res9)) {
SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CoreSession_playAndGetDigits" "', argument " "9"" of type '" "char *dtmf_buf""'");
@@ -4362,7 +4369,7 @@
if (!SWIG_IsOK(res10)) {
SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "CoreSession_playAndGetDigits" "', argument " "10"" of type '" "char *""'");
}
- arg10 = buf10;
+ arg10 = reinterpret_cast< char * >(buf10);
result = (int)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
resultobj = SWIG_From_int(static_cast< int >(result));
arg9[128] = 0;
@@ -4408,7 +4415,7 @@
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_streamfile" "', argument " "2"" of type '" "char *""'");
}
- arg2 = buf2;
+ arg2 = reinterpret_cast< char * >(buf2);
ecode3 = SWIG_AsVal_int(obj2, &val3);
if (!SWIG_IsOK(ecode3)) {
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoreSession_streamfile" "', argument " "3"" of type '" "int""'");
@@ -4473,12 +4480,12 @@
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_execute" "', argument " "2"" of type '" "char *""'");
}
- arg2 = buf2;
+ arg2 = reinterpret_cast< char * >(buf2);
res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
if (!SWIG_IsOK(res3)) {
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_execute" "', argument " "3"" of type '" "char *""'");
}
- arg3 = buf3;
+ arg3 = reinterpret_cast< char * >(buf3);
(arg1)->execute(arg2,arg3);
resultobj = SWIG_Py_Void();
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
@@ -4616,7 +4623,7 @@
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_PySession" "', argument " "1"" of type '" "char *""'");
}
- arg1 = buf1;
+ arg1 = reinterpret_cast< char * >(buf1);
result = (PySession *)new PySession(arg1);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PySession, SWIG_POINTER_NEW | 0 );
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
@@ -4678,7 +4685,7 @@
}
fail:
- SWIG_SetErrorMsg(PyExc_NotImplementedError,"No matching function for overloaded 'new_PySession'");
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_PySession'.\n Possible C/C++ prototypes are:\n PySession(char *)\n PySession(switch_core_session_t *)\n");
return NULL;
}
@@ -4730,7 +4737,7 @@
if (!SWIG_IsOK(res3)) {
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "PySession_setDTMFCallback" "', argument " "3"" of type '" "char *""'");
}
- arg3 = buf3;
+ arg3 = reinterpret_cast< char * >(buf3);
(arg1)->setDTMFCallback(arg2,arg3);
resultobj = SWIG_Py_Void();
if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
@@ -4928,7 +4935,7 @@
* structures together.
*
* The generated swig_type_info structures are assigned staticly to an initial
- * array. We just loop though that array, and handle each type individually.
+ * array. We just loop through that array, and handle each type individually.
* First we lookup if this type has been already loaded, and if so, use the
* loaded structure instead of the generated one. Then we have to fill in the
* cast linked list. The cast data is initially stored in something like a
@@ -4966,30 +4973,47 @@
#define SWIGRUNTIME_DEBUG
#endif
+
SWIGRUNTIME void
SWIG_InitializeModule(void *clientdata) {
size_t i;
- swig_module_info *module_head;
- static int init_run = 0;
+ swig_module_info *module_head, *iter;
+ int found;
clientdata = clientdata;
- if (init_run) return;
- init_run = 1;
-
- /* Initialize the swig_module */
- swig_module.type_initial = swig_type_initial;
- swig_module.cast_initial = swig_cast_initial;
+ /* check to see if the circular list has been setup, if not, set it up */
+ if (swig_module.next==0) {
+ /* Initialize the swig_module */
+ swig_module.type_initial = swig_type_initial;
+ swig_module.cast_initial = swig_cast_initial;
+ swig_module.next = &swig_module;
+ }
/* Try and load any already created modules */
module_head = SWIG_GetModule(clientdata);
- if (module_head) {
+ if (!module_head) {
+ /* This is the first module loaded for this interpreter */
+ /* so set the swig module into the interpreter */
+ SWIG_SetModule(clientdata, &swig_module);
+ module_head = &swig_module;
+ } else {
+ /* the interpreter has loaded a SWIG module, but has it loaded this one? */
+ found=0;
+ iter=module_head;
+ do {
+ if (iter==&swig_module) {
+ found=1;
+ break;
+ }
+ iter=iter->next;
+ } while (iter!= module_head);
+
+ /* if the is found in the list, then all is done and we may leave */
+ if (found) return;
+ /* otherwise we must add out module into the list */
swig_module.next = module_head->next;
module_head->next = &swig_module;
- } else {
- /* This is the first module loaded */
- swig_module.next = &swig_module;
- SWIG_SetModule(clientdata, &swig_module);
}
/* Now work on filling in swig_module.types */
@@ -5302,7 +5326,7 @@
}
SWIGINTERN PyObject *
- SWIG_globals() {
+ SWIG_globals(void) {
static PyObject *_SWIG_globals = 0;
if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();
return _SWIG_globals;
@@ -5347,11 +5371,11 @@
swig_type_info **types_initial) {
size_t i;
for (i = 0; methods[i].ml_name; ++i) {
- char *c = methods[i].ml_doc;
+ const char *c = methods[i].ml_doc;
if (c && (c = strstr(c, "swig_ptr: "))) {
int j;
swig_const_info *ci = 0;
- char *name = c + 10;
+ const char *name = c + 10;
for (j = 0; const_table[j].type; ++j) {
if (strncmp(const_table[j].name, name,
strlen(const_table[j].name)) == 0) {
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c Sat Jun 16 17:05:07 2007
@@ -37,11 +37,29 @@
#ifdef HAVE_CURL
#include <curl/curl.h>
#endif
+static int foo = 0;
+
SWITCH_MODULE_LOAD_FUNCTION(mod_spidermonkey_load);
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_spidermonkey_shutdown);
SWITCH_MODULE_DEFINITION(mod_spidermonkey, mod_spidermonkey_load, mod_spidermonkey_shutdown, NULL);
+#define METHOD_SANITY_CHECK() do { \
+if (!jss || !jss->session) { \
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n"); \
+ *rval = BOOLEAN_TO_JSVAL(JS_FALSE); \
+ return JS_TRUE; \
+ } \
+ } while(foo == 1)
+
+#define CHANNEL_SANITY_CHECK() do { \
+ if (!switch_channel_ready(channel)) { \
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n"); \
+ *rval = BOOLEAN_TO_JSVAL(JS_FALSE); \
+ return JS_TRUE; \
+ } \
+ } while (foo == 1)
+
static void session_destroy(JSContext * cx, JSObject * obj);
static JSBool session_construct(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval);
static JSBool session_originate(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval);
@@ -62,7 +80,7 @@
static JSClass global_class = {
"Global", JSCLASS_HAS_PRIVATE,
- JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
+ JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, DEFAULT_SET_PROPERTY,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub
};
@@ -277,7 +295,7 @@
JSClass request_class = {
"Request", JSCLASS_HAS_PRIVATE,
- JS_PropertyStub, JS_PropertyStub, request_getProperty, JS_PropertyStub,
+ JS_PropertyStub, JS_PropertyStub, request_getProperty, DEFAULT_SET_PROPERTY,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, request_destroy, NULL, NULL, NULL, NULL
};
@@ -582,7 +600,7 @@
JSClass event_class = {
"Event", JSCLASS_HAS_PRIVATE,
- JS_PropertyStub, JS_PropertyStub, event_getProperty, JS_PropertyStub,
+ JS_PropertyStub, JS_PropertyStub, event_getProperty, DEFAULT_SET_PROPERTY,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, event_destroy, NULL, NULL, NULL,
event_construct
};
@@ -818,11 +836,9 @@
uintN argc = 0;
jsval argv[4];
JSObject *Event = NULL;
+ jsval nval , *rval = &nval;
- if (!jss || !jss->session) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
- return SWITCH_STATUS_FALSE;
- }
+ METHOD_SANITY_CHECK();
jss->stack_depth++;
@@ -1012,11 +1028,7 @@
switch_size_t has;
switch_channel_t *channel;
- if (!jss || !jss->session) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
+ METHOD_SANITY_CHECK();
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
@@ -1067,20 +1079,12 @@
int32 limit = 0;
switch_input_args_t args = { 0 };
- if (!jss || !jss->session) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
+ METHOD_SANITY_CHECK();
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
- if (!switch_channel_ready(channel)) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
+ CHANNEL_SANITY_CHECK();
if (argc > 0) {
@@ -1150,21 +1154,12 @@
switch_input_args_t args = { 0 };
- if (!jss || !jss->session) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
+ METHOD_SANITY_CHECK();
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
- if (!switch_channel_ready(channel)) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
-
+ CHANNEL_SANITY_CHECK();
if (argc > 0) {
if ((function = JS_ValueToFunction(cx, argv[0]))) {
@@ -1217,21 +1212,12 @@
JSFunction *function;
switch_input_args_t args = { 0 };
- if (!jss || !jss->session) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
+ METHOD_SANITY_CHECK();
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
- if (!switch_channel_ready(channel)) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
-
+ CHANNEL_SANITY_CHECK();
if (argc > 0) {
phrase_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
@@ -1360,20 +1346,12 @@
switch_input_args_t args = { 0 };
char *prebuf;
- if (!jss || !jss->session) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
+ METHOD_SANITY_CHECK();
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
- if (!switch_channel_ready(channel)) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
+ CHANNEL_SANITY_CHECK();
if (argc > 0) {
@@ -1433,11 +1411,7 @@
struct js_session *jss = JS_GetPrivate(cx, obj);
switch_channel_t *channel;
- if (!jss || !jss->session) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
+ METHOD_SANITY_CHECK();
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
@@ -1503,21 +1477,12 @@
JSFunction *function;
switch_input_args_t args = { 0 };
- if (!jss || !jss->session) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
+ METHOD_SANITY_CHECK();
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
- if (!switch_channel_ready(channel)) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
-
+ CHANNEL_SANITY_CHECK();
if (argc > 0) {
tts_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
@@ -1571,21 +1536,12 @@
int32 digits = 0, timeout = 5000;
switch_channel_t *channel;
- if (!jss || !jss->session) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
+ METHOD_SANITY_CHECK();
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
- if (!switch_channel_ready(channel)) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
-
+ CHANNEL_SANITY_CHECK();
if (argc > 0) {
char term;
@@ -1617,11 +1573,7 @@
struct js_session *jss = JS_GetPrivate(cx, obj);
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- if (!jss || !jss->session) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
+ METHOD_SANITY_CHECK();
if (argv[0]) {
JSBool tf;
@@ -1642,21 +1594,12 @@
struct js_session *jss = JS_GetPrivate(cx, obj);
switch_channel_t *channel;
- if (!jss || !jss->session) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
+ METHOD_SANITY_CHECK();
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
- if (!switch_channel_ready(channel)) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
-
+ CHANNEL_SANITY_CHECK();
switch_channel_answer(channel);
return JS_TRUE;
@@ -1671,10 +1614,7 @@
/*Always a pessimist... sheesh! */
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- if (!jss || !jss->session) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
- return JS_TRUE;
- }
+ METHOD_SANITY_CHECK();
if (switch_ivr_generate_xml_cdr(jss->session, &cdr) == SWITCH_STATUS_SUCCESS) {
char *xml_text;
@@ -1693,11 +1633,7 @@
struct js_session *jss = JS_GetPrivate(cx, obj);
switch_channel_t *channel;
- if (!jss || !jss->session) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
+ METHOD_SANITY_CHECK();
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
@@ -1717,11 +1653,7 @@
unsigned int elapsed;
int32 timeout = 60;
- if (!jss || !jss->session) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
+ METHOD_SANITY_CHECK();
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
@@ -1760,11 +1692,7 @@
unsigned int elapsed;
int32 timeout = 60;
- if (!jss || !jss->session) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
+ METHOD_SANITY_CHECK();
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
@@ -1799,20 +1727,13 @@
switch_channel_t *channel;
struct js_session *jss = JS_GetPrivate(cx, obj);
- if (!jss || !jss->session) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
+ METHOD_SANITY_CHECK();
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
- if (!switch_channel_ready(channel)) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
+
+ CHANNEL_SANITY_CHECK();
if (argc > 1) {
@@ -1822,11 +1743,7 @@
struct js_session *jss = JS_GetPrivate(cx, obj);
jsrefcount saveDepth;
- if (!jss || !jss->session) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
+ METHOD_SANITY_CHECK();
if ((application_interface = switch_loadable_module_get_application_interface(app_name))) {
if (application_interface->application_function) {
@@ -1847,11 +1764,7 @@
struct js_session *jss = JS_GetPrivate(cx, obj);
switch_event_t *event;
- if (!jss || !jss->session) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
+ METHOD_SANITY_CHECK();
if (switch_core_session_dequeue_event(jss->session, &event) == SWITCH_STATUS_SUCCESS) {
JSObject *Event;
@@ -1881,11 +1794,7 @@
JSObject *Event;
struct event_obj *eo;
- if (!jss || !jss->session) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
+ METHOD_SANITY_CHECK();
if (argc > 0) {
if (JS_ValueToObject(cx, argv[0], &Event)) {
@@ -1913,20 +1822,12 @@
char *cause_name = NULL;
switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
- if (!jss || !jss->session) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "You must call the session.originate method before calling this method!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
+ METHOD_SANITY_CHECK();
channel = switch_core_session_get_channel(jss->session);
assert(channel != NULL);
- if (!switch_channel_ready(channel)) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Session is not active!\n");
- *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
- return JS_TRUE;
- }
+ CHANNEL_SANITY_CHECK();
if (argc > 1) {
cause_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
@@ -2135,6 +2036,7 @@
{0}
};
+
static JSBool session_getProperty(JSContext * cx, JSObject * obj, jsval id, jsval * vp)
{
struct js_session *jss = JS_GetPrivate(cx, obj);
@@ -2228,7 +2130,7 @@
JSClass session_class = {
"Session", JSCLASS_HAS_PRIVATE,
- JS_PropertyStub, JS_PropertyStub, session_getProperty, JS_PropertyStub,
+ JS_PropertyStub, JS_PropertyStub, session_getProperty, DEFAULT_SET_PROPERTY,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, session_destroy, NULL, NULL, NULL,
session_construct
};
@@ -2606,7 +2508,7 @@
JSClass fileio_class = {
"FileIO", JSCLASS_HAS_PRIVATE,
- JS_PropertyStub, JS_PropertyStub, fileio_getProperty, JS_PropertyStub,
+ JS_PropertyStub, JS_PropertyStub, fileio_getProperty, DEFAULT_SET_PROPERTY,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, fileio_destroy, NULL, NULL, NULL,
fileio_construct
};
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.h
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.h (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.h Sat Jun 16 17:05:07 2007
@@ -133,6 +133,11 @@
switch_channel_state_t hook_state;
};
+JSBool DEFAULT_SET_PROPERTY(JSContext * cx, JSObject *obj, jsval id, jsval *vp)
+{
+ return JS_FALSE;
+}
+
SWITCH_END_EXTERN_C
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_core_db/mod_spidermonkey_core_db.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_core_db/mod_spidermonkey_core_db.c (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_core_db/mod_spidermonkey_core_db.c Sat Jun 16 17:05:07 2007
@@ -268,7 +268,7 @@
JSClass db_class = {
modname, JSCLASS_HAS_PRIVATE,
- JS_PropertyStub, JS_PropertyStub, db_getProperty, JS_PropertyStub,
+ JS_PropertyStub, JS_PropertyStub, db_getProperty, DEFAULT_SET_PROPERTY,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, db_destroy, NULL, NULL, NULL,
db_construct
};
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_etpan/mod_spidermonkey_etpan.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_etpan/mod_spidermonkey_etpan.c (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_etpan/mod_spidermonkey_etpan.c Sat Jun 16 17:05:07 2007
@@ -216,7 +216,7 @@
JSClass etpan_class = {
modname, JSCLASS_HAS_PRIVATE,
- JS_PropertyStub, JS_PropertyStub, etpan_getProperty, JS_PropertyStub,
+ JS_PropertyStub, JS_PropertyStub, etpan_getProperty, DEFAULT_SET_PROPERTY,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, etpan_destroy, NULL, NULL, NULL,
etpan_construct
};
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.c (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.c Sat Jun 16 17:05:07 2007
@@ -438,7 +438,7 @@
JSClass odbc_class = {
modname, JSCLASS_HAS_PRIVATE,
- JS_PropertyStub, JS_PropertyStub, odbc_getProperty, JS_PropertyStub,
+ JS_PropertyStub, JS_PropertyStub, odbc_getProperty, DEFAULT_SET_PROPERTY,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, odbc_destroy, NULL, NULL, NULL,
odbc_construct
};
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_skel/mod_spidermonkey_skel.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_skel/mod_spidermonkey_skel.c (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_skel/mod_spidermonkey_skel.c Sat Jun 16 17:05:07 2007
@@ -74,7 +74,7 @@
JSClass skel_class = {
modname, JSCLASS_HAS_PRIVATE,
- JS_PropertyStub, JS_PropertyStub, skel_getProperty, JS_PropertyStub,
+ JS_PropertyStub, JS_PropertyStub, skel_getProperty, DEFAULT_SET_PROPERTY,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, skel_destroy, NULL, NULL, NULL,
skel_construct
};
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_teletone/mod_spidermonkey_teletone.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_teletone/mod_spidermonkey_teletone.c (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey_teletone/mod_spidermonkey_teletone.c Sat Jun 16 17:05:07 2007
@@ -331,7 +331,7 @@
JSClass teletone_class = {
modname, JSCLASS_HAS_PRIVATE,
- JS_PropertyStub, JS_PropertyStub, teletone_getProperty, JS_PropertyStub,
+ JS_PropertyStub, JS_PropertyStub, teletone_getProperty, DEFAULT_SET_PROPERTY,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, teletone_destroy, NULL, NULL, NULL,
teletone_construct
};
Modified: freeswitch/branches/greenlizard/src/switch_core_codec.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_core_codec.c (original)
+++ freeswitch/branches/greenlizard/src/switch_core_codec.c Sat Jun 16 17:05:07 2007
@@ -50,6 +50,8 @@
session->read_codec = codec;
session->raw_read_frame.codec = session->read_codec;
session->raw_write_frame.codec = session->read_codec;
+ session->enc_read_frame.codec = session->read_codec;
+ session->enc_write_frame.codec = session->read_codec;
return SWITCH_STATUS_SUCCESS;
}
Modified: freeswitch/branches/greenlizard/src/switch_core_io.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_core_io.c (original)
+++ freeswitch/branches/greenlizard/src/switch_core_io.c Sat Jun 16 17:05:07 2007
@@ -232,7 +232,7 @@
switch_mutex_lock(bp->read_mutex);
switch_buffer_write(bp->raw_read_buffer, read_frame->data, read_frame->datalen);
if (bp->callback) {
- if (bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_READ) == SWITCH_FALSE || (bp->stop_time && bp->stop_time >= time(NULL))) {
+ if (bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_READ) == SWITCH_FALSE || (bp->stop_time && bp->stop_time <= time(NULL))) {
ok = SWITCH_FALSE;
}
}
@@ -241,7 +241,7 @@
do_bugs = 0;
if (bp->callback) {
bp->read_replace_frame_in = read_frame;
- bp->read_replace_frame_out = NULL;
+ bp->read_replace_frame_out = read_frame;
if ((ok = bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_READ_REPLACE)) == SWITCH_TRUE) {
read_frame = bp->read_replace_frame_out;
}
@@ -509,14 +509,14 @@
do_bugs = 0;
if (bp->callback) {
bp->write_replace_frame_in = write_frame;
- bp->write_replace_frame_out = NULL;
+ bp->write_replace_frame_out = write_frame;
if ((ok = bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_WRITE_REPLACE)) == SWITCH_TRUE) {
write_frame = bp->write_replace_frame_out;
}
}
}
- if (bp->stop_time && bp->stop_time >= time(NULL)) {
+ if (bp->stop_time && bp->stop_time <= time(NULL)) {
ok = SWITCH_FALSE;
}
Modified: freeswitch/branches/greenlizard/src/switch_cpp.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_cpp.cpp (original)
+++ freeswitch/branches/greenlizard/src/switch_cpp.cpp Sat Jun 16 17:05:07 2007
@@ -208,12 +208,11 @@
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
}
+
int CoreSession::streamfile(char *file, int starting_sample_count) {
switch_status_t status;
switch_file_handle_t fh = { 0 };
- unsigned int samps;
- unsigned int pos = 0;
char *prebuf;
sanity_check(-1);
Modified: freeswitch/branches/greenlizard/src/switch_event.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_event.c (original)
+++ freeswitch/branches/greenlizard/src/switch_event.c Sat Jun 16 17:05:07 2007
@@ -133,7 +133,7 @@
"CODEC",
"BACKGROUND_JOB",
"DETECTED_SPEECH",
- "DETECTED_FAX",
+ "DETECTED_TONE",
"PRIVATE_COMMAND",
"HEARTBEAT",
"TRAP",
Modified: freeswitch/branches/greenlizard/src/switch_ivr_async.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_ivr_async.c (original)
+++ freeswitch/branches/greenlizard/src/switch_ivr_async.c Sat Jun 16 17:05:07 2007
@@ -96,6 +96,151 @@
}
+typedef struct {
+ switch_file_handle_t fh;
+ int mux;
+} displace_helper_t;
+
+static switch_bool_t displace_callback(switch_media_bug_t *bug, void *user_data, switch_abc_type_t type)
+{
+ displace_helper_t *dh = (displace_helper_t *) user_data;
+ uint8_t data[SWITCH_RECOMMENDED_BUFFER_SIZE];
+ switch_frame_t frame = { 0 };
+
+ frame.data = data;
+ frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE;
+
+ switch (type) {
+ case SWITCH_ABC_TYPE_INIT:
+ break;
+ case SWITCH_ABC_TYPE_CLOSE:
+ if (dh) {
+ switch_core_file_close(&dh->fh);
+ }
+ break;
+ case SWITCH_ABC_TYPE_READ_REPLACE:
+ {
+ switch_frame_t *frame = switch_core_media_bug_get_read_replace_frame(bug);
+ if (dh && !dh->mux) {
+ memset(frame->data, 255, frame->datalen);
+ }
+ switch_core_media_bug_set_read_replace_frame(bug, frame);
+ }
+ break;
+ case SWITCH_ABC_TYPE_WRITE_REPLACE:
+ if (dh) {
+ switch_frame_t *frame = NULL;
+ switch_size_t len;
+
+ frame = switch_core_media_bug_get_write_replace_frame(bug);
+ len = frame->samples;
+
+ if (dh->mux) {
+ int16_t buf[1024];
+ int16_t *fp = frame->data;
+ uint32_t x;
+
+ switch_core_file_read(&dh->fh, buf, &len);
+
+ for(x = 0; x < (uint32_t) len; x++) {
+ int32_t mixed = fp[x] + buf[x];
+ switch_normalize_to_16bit(mixed);
+ fp[x] = (int16_t) mixed;
+ }
+ } else {
+ switch_core_file_read(&dh->fh, frame->data, &len);
+ frame->samples = (uint32_t) len;
+ frame->datalen = frame->samples * 2;
+ }
+ switch_core_media_bug_set_write_replace_frame(bug, frame);
+ }
+ break;
+ case SWITCH_ABC_TYPE_WRITE:
+ default:
+ break;
+ }
+
+ return SWITCH_TRUE;
+}
+
+SWITCH_DECLARE(switch_status_t) switch_ivr_stop_displace_session(switch_core_session_t *session, char *file)
+{
+ switch_media_bug_t *bug;
+ switch_channel_t *channel = switch_core_session_get_channel(session);
+
+ assert(channel != NULL);
+ if ((bug = switch_channel_get_private(channel, file))) {
+ switch_channel_set_private(channel, file, NULL);
+ switch_core_media_bug_remove(session, &bug);
+ return SWITCH_STATUS_SUCCESS;
+ }
+
+ return SWITCH_STATUS_FALSE;
+
+}
+
+SWITCH_DECLARE(switch_status_t) switch_ivr_displace_session(switch_core_session_t *session, char *file, uint32_t limit, const char *flags)
+{
+ switch_channel_t *channel;
+ switch_codec_t *read_codec;
+ switch_media_bug_t *bug;
+ switch_status_t status;
+ time_t to = 0;
+ displace_helper_t *dh;
+
+
+ channel = switch_core_session_get_channel(session);
+ assert(channel != NULL);
+
+ if ((bug = switch_channel_get_private(channel, file))) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Only 1 of the same file per channel please!\n");
+ return SWITCH_STATUS_FALSE;
+ }
+
+ if (!(dh = switch_core_session_alloc(session, sizeof(*dh)))) {
+ return SWITCH_STATUS_MEMERR;
+ }
+
+
+
+ read_codec = switch_core_session_get_read_codec(session);
+ assert(read_codec != NULL);
+
+ dh->fh.channels = read_codec->implementation->number_of_channels;
+ dh->fh.samplerate = read_codec->implementation->samples_per_second;
+
+
+ if (switch_core_file_open(&dh->fh,
+ file,
+ read_codec->implementation->number_of_channels,
+ read_codec->implementation->samples_per_second,
+ SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT,
+ switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
+ switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+ switch_core_session_reset(session);
+ return SWITCH_STATUS_GENERR;
+ }
+
+ switch_channel_answer(channel);
+
+ if (limit) {
+ to = time(NULL) + limit;
+ }
+
+ if (flags && strchr(flags, 'm')) {
+ dh->mux++;
+ }
+
+ if ((status = switch_core_media_bug_add(session, displace_callback, dh, to, SMBF_WRITE_REPLACE | SMBF_READ_REPLACE, &bug)) != SWITCH_STATUS_SUCCESS) {
+ switch_core_file_close(&dh->fh);
+ return status;
+ }
+
+ switch_channel_set_private(channel, file, bug);
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, switch_abc_type_t type)
{
@@ -158,14 +303,20 @@
switch_status_t status;
time_t to = 0;
+ channel = switch_core_session_get_channel(session);
+ assert(channel != NULL);
+
+ if ((bug = switch_channel_get_private(channel, file))) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Only 1 of the same file per channel please!\n");
+ return SWITCH_STATUS_FALSE;
+ }
+
if (!fh) {
if (!(fh = switch_core_session_alloc(session, sizeof(*fh)))) {
return SWITCH_STATUS_MEMERR;
}
}
- channel = switch_core_session_get_channel(session);
- assert(channel != NULL);
read_codec = switch_core_session_get_read_codec(session);
assert(read_codec != NULL);
@@ -326,117 +477,212 @@
}
+#define MAX_TONES 16
typedef struct {
- switch_core_session_t *session;
- teletone_multi_tone_t mt;
-} switch_fax_detect_t;
-
-static switch_bool_t fax_detect_callback(switch_media_bug_t *bug, void *user_data, switch_abc_type_t type)
-{
- switch_fax_detect_t *pvt = (switch_fax_detect_t *) user_data;
- uint8_t data[SWITCH_RECOMMENDED_BUFFER_SIZE];
- switch_frame_t frame = { 0 };
- // switch_channel_t *channel = switch_core_session_get_channel(pvt->session);
-
- // assert(channel != NULL);
- frame.data = data;
- frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE;
-
- switch (type) {
- case SWITCH_ABC_TYPE_INIT:
- break;
- case SWITCH_ABC_TYPE_CLOSE:
- break;
- case SWITCH_ABC_TYPE_READ:
- if (switch_core_media_bug_read(bug, &frame) == SWITCH_STATUS_SUCCESS) {
- if(teletone_multi_tone_detect(&pvt->mt, frame.data, frame.samples)) {
- switch_event_t *event;
+ teletone_multi_tone_t mt;
+ char *app;
+ char *data;
+ char *key;
+ teletone_tone_map_t map;
+ int up;
+} switch_tone_detect_t;
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "FAX CNG DETECTED\n");
- if (switch_event_create(&event, SWITCH_EVENT_DETECTED_FAX) == SWITCH_STATUS_SUCCESS) {
- switch_event_t *dup;
+typedef struct {
+ switch_tone_detect_t list[MAX_TONES+1];
+ int index;
+ switch_media_bug_t *bug;
+ switch_core_session_t *session;
+} switch_tone_container_t;
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "fax", "detected");
-
- if (switch_event_dup(&dup, event) == SWITCH_STATUS_SUCCESS) {
- switch_event_fire(&dup);
- }
-
+static switch_bool_t tone_detect_callback(switch_media_bug_t *bug, void *user_data, switch_abc_type_t type)
+{
+ switch_tone_container_t *cont = (switch_tone_container_t *) user_data;
+ switch_frame_t *frame = NULL;
+ int i = 0;
- if (switch_core_session_queue_event(pvt->session, &event) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Event queue failed!\n");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "delivery-failure", "true");
- switch_event_fire(&event);
- }
+ switch (type) {
+ case SWITCH_ABC_TYPE_INIT:
+ break;
+ case SWITCH_ABC_TYPE_CLOSE:
+ break;
+ case SWITCH_ABC_TYPE_READ_REPLACE:
+ frame = switch_core_media_bug_get_read_replace_frame(bug);
+ case SWITCH_ABC_TYPE_WRITE_REPLACE:
+ {
+
+ if (!frame) {
+ frame = switch_core_media_bug_get_write_replace_frame(bug);
+ }
+
+ for (i = 0 ; i < cont->index; cont++) {
+ if (cont->list[i].up && teletone_multi_tone_detect(&cont->list[i].mt, frame->data, frame->samples)) {
+ switch_event_t *event;
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "TONE %s DETECTED\n", cont->list[i].key);
+ cont->list[i].up = 0;
+
+ if (cont->list[i].app) {
+ if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "execute-app-name", "%s", cont->list[i].app);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "execute-app-arg", "%s", cont->list[i].data);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "lead-frames", "%d", 5);
+ switch_core_session_queue_private_event(cont->session, &event);
+ }
+ }
+
+ if (switch_event_create(&event, SWITCH_EVENT_DETECTED_TONE) == SWITCH_STATUS_SUCCESS) {
+ switch_event_t *dup;
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Detected-Tone", "%s", cont->list[i].key);
+
+ if (switch_event_dup(&dup, event) == SWITCH_STATUS_SUCCESS) {
+ switch_event_fire(&dup);
+ }
+
+ if (switch_core_session_queue_event(cont->session, &event) != SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Event queue failed!\n");
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "delivery-failure", "true");
+ switch_event_fire(&event);
+ }
+ }
+ }
+ }
+ }
+ break;
+ case SWITCH_ABC_TYPE_WRITE:
+ default:
+ break;
}
- }
- }
- break;
- case SWITCH_ABC_TYPE_WRITE:
- default:
- break;
- }
- return SWITCH_TRUE;
+ return SWITCH_TRUE;
}
-SWITCH_DECLARE(switch_status_t) switch_ivr_stop_fax_detect_session(switch_core_session_t *session)
+SWITCH_DECLARE(switch_status_t) switch_ivr_stop_tone_detect_session(switch_core_session_t *session)
{
- switch_media_bug_t *bug;
- switch_channel_t *channel = switch_core_session_get_channel(session);
-
- assert(channel != NULL);
- if ((bug = switch_channel_get_private(channel, "fax"))) {
- switch_channel_set_private(channel, "fax", NULL);
- switch_core_media_bug_remove(session, &bug);
- return SWITCH_STATUS_SUCCESS;
- }
-
- return SWITCH_STATUS_FALSE;
+ switch_channel_t *channel = switch_core_session_get_channel(session);
+ switch_tone_container_t *cont;
+
+ assert(channel != NULL);
+ if ((cont = switch_channel_get_private(channel, "_tone_detect_"))) {
+ switch_channel_set_private(channel, "_tone_detect_", NULL);
+ switch_core_media_bug_remove(session, &cont->bug);
+ return SWITCH_STATUS_SUCCESS;
+ }
+ return SWITCH_STATUS_FALSE;
+
}
-SWITCH_DECLARE(switch_status_t) switch_ivr_fax_detect_session(switch_core_session_t *session)
+SWITCH_DECLARE(switch_status_t) switch_ivr_tone_detect_session(switch_core_session_t *session,
+ const char *key, const char *tone_spec,
+ const char *flags, time_t timeout,
+ const char *app, const char *data)
{
switch_channel_t *channel;
switch_codec_t *read_codec;
- switch_media_bug_t *bug;
switch_status_t status;
- switch_fax_detect_t *pvt;
- teletone_tone_map_t *map;
- int i;
+ switch_tone_container_t *cont = NULL;
+ char *p, *next;
+ int i = 0, ok = 0;
+
+ switch_media_bug_flag_t bflags = 0;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
-
read_codec = switch_core_session_get_read_codec(session);
assert(read_codec != NULL);
+
+ if (switch_strlen_zero(key)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Key Specified!\n");
+ return SWITCH_STATUS_FALSE;
+ }
+
+ if ((cont = switch_channel_get_private(channel, "_tone_detect_"))) {
+ if (cont->index >= MAX_TONES) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Max Tones Reached!\n");
+ return SWITCH_STATUS_FALSE;
+ }
- if (!(pvt = switch_core_session_alloc(session, sizeof(*pvt)))) {
- return SWITCH_STATUS_MEMERR;
+ for(i = 0; i < cont->index; i++) {
+ if (!strcasecmp(key, cont->list[cont->index].key )) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Renabling %s\n", key);
+ cont->list[cont->index].up = 1;
+ teletone_multi_tone_init(&cont->list[i].mt, &cont->list[i].map);
+ return SWITCH_STATUS_SUCCESS;
+ }
+ }
}
- if (!(map = switch_core_session_alloc(session, sizeof(*map)))) {
- return SWITCH_STATUS_MEMERR;
+ if (switch_strlen_zero(tone_spec)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Spec Specified!\n");
+ return SWITCH_STATUS_FALSE;
}
- for(i=0;i<TELETONE_MAX_TONES;i++) {
- map->freqs[i] = 1100.0;
+ if (!cont && !(cont = switch_core_session_alloc(session, sizeof(*cont)))) {
+ return SWITCH_STATUS_MEMERR;
}
- pvt->mt.sample_rate = read_codec->implementation->samples_per_second;
- pvt->session = session;
- teletone_multi_tone_init(&pvt->mt, map);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Adding tone spec %s index %d\n", tone_spec, cont->index);
- switch_channel_answer(channel);
+ i = 0;
+ p = (char *) tone_spec;
+
+ do {
+ teletone_process_t this;
+ next = strchr(p, ',');
+ while(*p == ' ') p++;
+ if ((this = (teletone_process_t) atof(p))) {
+ ok++;
+ cont->list[cont->index].map.freqs[i++] = this;
+ }
+ if (next) {
+ p = next + 1;
+ }
+ } while (next);
+ cont->list[cont->index].map.freqs[i++] = 0;
+
+ if (!ok) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid tone spec!\n");
+ return SWITCH_STATUS_FALSE;
- if ((status = switch_core_media_bug_add(session, fax_detect_callback, pvt, 0, SMBF_READ_STREAM, &bug)) != SWITCH_STATUS_SUCCESS) {
- return status;
}
- switch_channel_set_private(channel, "fax", bug);
+ cont->list[cont->index].key = switch_core_session_strdup(session, key);
+
+ if (app) {
+ cont->list[cont->index].app = switch_core_session_strdup(session, app);
+ }
+
+ if (data) {
+ cont->list[cont->index].data = switch_core_session_strdup(session, data);
+ }
+
+ cont->list[cont->index].up = 1;
+ cont->list[cont->index].mt.sample_rate = read_codec->implementation->samples_per_second;
+ teletone_multi_tone_init(&cont->list[cont->index].mt, &cont->list[cont->index].map);
+ cont->session = session;
+
+ switch_channel_answer(channel);
+
+ if (switch_strlen_zero(flags)) {
+ bflags = SMBF_READ_REPLACE;
+ } else {
+ if (strchr(flags, 'r')) {
+ bflags |= SMBF_READ_REPLACE;
+ } else if (strchr(flags, 'w')) {
+ bflags |= SMBF_WRITE_REPLACE;
+ }
+ }
+
+
+ if ((status = switch_core_media_bug_add(session, tone_detect_callback, cont, timeout, bflags, &cont->bug)) != SWITCH_STATUS_SUCCESS) {
+ return status;
+ }
+ switch_channel_set_private(channel, "_tone_detect_", cont);
+ cont->index++;
+
return SWITCH_STATUS_SUCCESS;
}
Modified: freeswitch/branches/greenlizard/src/switch_rtp.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_rtp.c (original)
+++ freeswitch/branches/greenlizard/src/switch_rtp.c Sat Jun 16 17:05:07 2007
@@ -1435,6 +1435,10 @@
rtp_session->last_write_samplecount = rtp_session->timer.samplecount;
}
switch_socket_sendto(rtp_session->sock, rtp_session->remote_addr, 0, (void *) send_msg, &bytes);
+ } else if (!fwd) {
+ /* nevermind save this seq inc for next time */
+ rtp_session->seq--;
+ rtp_session->send_msg.header.seq = htons(rtp_session->seq);
}
if (rtp_session->ice_user) {
1
0
Author: greenlizard
Date: Thu Jun 14 20:13:18 2007
New Revision: 5365
Modified:
freeswitch/branches/greenlizard/src/switch_cpp.cpp
Log:
FSCORE-32 fixed
Modified: freeswitch/branches/greenlizard/src/switch_cpp.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_cpp.cpp (original)
+++ freeswitch/branches/greenlizard/src/switch_cpp.cpp Thu Jun 14 20:13:18 2007
@@ -127,6 +127,16 @@
switch_codec_t *codec;
sanity_check(-1);
+ if (!tts_name) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No TTS engine specified");
+ return SWITCH_STATUS_FALSE;
+ }
+
+ if (!voice_name) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No TTS voice specified");
+ return SWITCH_STATUS_FALSE;
+ }
+
codec = switch_core_session_get_read_codec(session);
begin_allow_threads();
status = switch_ivr_speak_text(session, tts_name, voice_name, codec->implementation->samples_per_second, text, ap);
1
0
14 Jun '07
Author: greenlizard
Date: Thu Jun 14 13:07:10 2007
New Revision: 5363
Modified:
freeswitch/branches/greenlizard/scripts/socket/sock.pl
Log:
local change for sock.pl was accidentally committed, revert to orig
Modified: freeswitch/branches/greenlizard/scripts/socket/sock.pl
==============================================================================
--- freeswitch/branches/greenlizard/scripts/socket/sock.pl (original)
+++ freeswitch/branches/greenlizard/scripts/socket/sock.pl Thu Jun 14 13:07:10 2007
@@ -22,7 +22,7 @@
$o = $fs->call_command("answer");
#to turn on events when in async mode
#$o = $fs->raw_command("myevents");
-$o = $fs->call_command("playback", "/pub/music/wakeup/greed.wav");
+$o = $fs->call_command("playback", "/ram/swimp.raw");
$o = $fs->call_command("hangup");
#comment exit in async mode
1
0
14 Jun '07
Author: greenlizard
Date: Thu Jun 14 13:05:19 2007
New Revision: 5362
Modified:
freeswitch/branches/greenlizard/scripts/mytest.py
freeswitch/branches/greenlizard/scripts/socket/sock.pl
Log:
update example after changes for MODLANG-33 and MODLANG-34
Modified: freeswitch/branches/greenlizard/scripts/mytest.py
==============================================================================
--- freeswitch/branches/greenlizard/scripts/mytest.py (original)
+++ freeswitch/branches/greenlizard/scripts/mytest.py Thu Jun 14 13:05:19 2007
@@ -3,42 +3,37 @@
# before reporting errors
import sys, time
+from freeswitch import *
def onDTMF(input, itype, funcargs):
- console_log("1","\n\nonDTMF input: %s\n" % input)
- if input == "5":
- return "pause"
- if input == "3":
- return "seek:+60000"
- if input == "1":
- return "seek:-60000"
- if input == "4":
- return "seek:-120000"
- if input == "6":
- return "seek:+120000"
- if input == "7":
- return "seek:-360000"
- if input == "9":
- return "seek:+360000"
- if input == "0":
- return "stop"
- return None # will make the streamfile audio stop
+ console_log("1","\n\nonDTMF input: %s\n" % input)
+ if input == "5":
+ return "pause"
+ if input == "3":
+ return "seek:+60000"
+ if input == "1":
+ return "seek:-60000"
+ if input == "0":
+ return "stop"
+ return None # will make the streamfile audio stop
-console_log("1","test from my python program\n")
-session.answer()
-session.setDTMFCallback(onDTMF, "")
-session.set_tts_parms("cepstral", "david")
-session.playFile("/pub/music/Bob Marley - exodus.mp3", "")
-session.speakText("Please enter telephone number with area code and press pound sign. ")
-input = session.getDigits("", 11, "*#", "#", 10000)
-console_log("1","result from get digits is %s\n" % input)
-phone_number = session.playAndGetDigits(5, 11, 3, 10000, "*#",
- "/sounds/test.gsm",
- "/sounds/invalid.gsm",
- "",
- "^17771112222$");
+def handler(uuid):
-console_log("1","result from play_and_get_digits is %s\n" % phone_number)
-session.transfer("1000", "XML", "default")
-session.hangup("1")
+ console_log("1","... test from my python program\n")
+ session = PySession(uuid)
+ session.answer()
+ session.setDTMFCallback(onDTMF, "")
+ session.set_tts_parms("cepstral", "david")
+ session.playFile("/path/to/your.mp3", "")
+ session.speak("Please enter telephone number with area code and press pound sign. ")
+ input = session.getDigits("", 11, "*#", "#", 10000)
+ console_log("1","result from get digits is %s\n" % input)
+ phone_number = session.playAndGetDigits(5, 11, 3, 10000, "*#",
+ "/sounds/test.gsm",
+ "/sounds/invalid.gsm",
+ "",
+ "^17771112222$");
+ console_log("1","result from play_and_get_digits is %s\n" % phone_number)
+ session.transfer("1000", "XML", "default")
+ session.hangup("1")
Modified: freeswitch/branches/greenlizard/scripts/socket/sock.pl
==============================================================================
--- freeswitch/branches/greenlizard/scripts/socket/sock.pl (original)
+++ freeswitch/branches/greenlizard/scripts/socket/sock.pl Thu Jun 14 13:05:19 2007
@@ -22,7 +22,7 @@
$o = $fs->call_command("answer");
#to turn on events when in async mode
#$o = $fs->raw_command("myevents");
-$o = $fs->call_command("playback", "/ram/swimp.raw");
+$o = $fs->call_command("playback", "/pub/music/wakeup/greed.wav");
$o = $fs->call_command("hangup");
#comment exit in async mode
1
0
Author: greenlizard
Date: Thu Jun 14 12:39:04 2007
New Revision: 5361
Added:
freeswitch/branches/greenlizard/scripts/contrib/
- copied from r5360, /freeswitch/trunk/scripts/contrib/
freeswitch/branches/greenlizard/scripts/contrib/trixter/
- copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/
freeswitch/branches/greenlizard/scripts/contrib/trixter/Parse_XML_CDR.php
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/Parse_XML_CDR.php
freeswitch/branches/greenlizard/scripts/contrib/trixter/conf-dtmf.pl (props changed)
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/conf-dtmf.pl
freeswitch/branches/greenlizard/scripts/contrib/trixter/faxlib.jm
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/faxlib.jm
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-cdr/
- copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-cdr/
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-cdr/Parse_XML_CDR.php
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-cdr/Parse_XML_CDR.php
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-cdr/README
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-cdr/README
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-cdr/cdr.php
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-cdr/cdr.php
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-curl/
- copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-curl/
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-curl/README
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-curl/README
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-curl/curlrouting.php
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-curl/curlrouting.php
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-curl/templates/
- copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-curl/templates/switch1/
- copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-curl/templates/switch1/conference.conf.tpl
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/conference.conf.tpl
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-curl/templates/switch1/fail.tpl
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/fail.tpl
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-curl/templates/switch1/frompstn.tpl
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-curl/templates/switch1/frompstn.tpl
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/
- copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/README
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/README
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/fsxmlrpc.inc
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/fsxmlrpc.inc
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/index.php
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/index.php
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/templates_c/
- copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/templates_c/
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/
- copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/default/
- copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/default/
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/default/channels.tpl
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/default/channels.tpl
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/default/conference.tpl
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/default/conference.tpl
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/default/errors.inc
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/default/errors.inc
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/default/errors.tpl
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/default/errors.tpl
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/default/images/
- copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/default/images/
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/default/images/submit.gif (props changed)
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/default/images/submit.gif
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/default/index.tpl
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/default/index.tpl
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/default/style.css
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/default/style.css
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/es/
- copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/es/
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/es/channels.tpl
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/es/channels.tpl
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/es/conference.tpl
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/es/conference.tpl
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/es/errors.inc
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/es/errors.inc
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/es/errors.tpl
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/es/errors.tpl
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/es/images/
- copied from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/es/images/
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/es/images/submit.gif (props changed)
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/es/images/submit.gif
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/es/index.tpl
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/es/index.tpl
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/themes/es/style.css
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/themes/es/style.css
freeswitch/branches/greenlizard/scripts/contrib/trixter/xml-rpc/xmlrpc.inc
- copied unchanged from r5360, /freeswitch/trunk/scripts/contrib/trixter/xml-rpc/xmlrpc.inc
freeswitch/branches/greenlizard/src/mod/applications/mod_soundtouch/
- copied from r5360, /freeswitch/trunk/src/mod/applications/mod_soundtouch/
freeswitch/branches/greenlizard/src/mod/applications/mod_soundtouch/Makefile
- copied unchanged from r5360, /freeswitch/trunk/src/mod/applications/mod_soundtouch/Makefile
freeswitch/branches/greenlizard/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp
- copied unchanged from r5360, /freeswitch/trunk/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp
Removed:
freeswitch/branches/greenlizard/src/mod/applications/mod_bridgecall/
freeswitch/branches/greenlizard/src/mod/applications/mod_echo/
freeswitch/branches/greenlizard/src/mod/applications/mod_park/
freeswitch/branches/greenlizard/src/mod/applications/mod_playback/
Modified:
freeswitch/branches/greenlizard/Freeswitch.sln
freeswitch/branches/greenlizard/build/modules.conf.in
freeswitch/branches/greenlizard/conf/default_context.xml
freeswitch/branches/greenlizard/conf/modules.conf.xml
freeswitch/branches/greenlizard/scripts/socket/socket2me/Makefile
freeswitch/branches/greenlizard/src/include/private/switch_core_pvt.h
freeswitch/branches/greenlizard/src/include/switch_apr.h
freeswitch/branches/greenlizard/src/include/switch_core.h
freeswitch/branches/greenlizard/src/include/switch_core_event_hook.h
freeswitch/branches/greenlizard/src/include/switch_loadable_module.h
freeswitch/branches/greenlizard/src/include/switch_module_interfaces.h
freeswitch/branches/greenlizard/src/include/switch_platform.h
freeswitch/branches/greenlizard/src/include/switch_types.h
freeswitch/branches/greenlizard/src/mod/applications/mod_commands/mod_commands.c
freeswitch/branches/greenlizard/src/mod/applications/mod_conference/mod_conference.c
freeswitch/branches/greenlizard/src/mod/applications/mod_dptools/mod_dptools.c
freeswitch/branches/greenlizard/src/mod/applications/mod_enum/mod_enum.c
freeswitch/branches/greenlizard/src/mod/applications/mod_esf/mod_esf.c
freeswitch/branches/greenlizard/src/mod/applications/mod_ivrtest/mod_ivrtest.c
freeswitch/branches/greenlizard/src/mod/applications/mod_rss/mod_rss.c
freeswitch/branches/greenlizard/src/mod/applications/mod_skel/mod_skel.c
freeswitch/branches/greenlizard/src/mod/asr_tts/mod_cepstral/mod_cepstral.c
freeswitch/branches/greenlizard/src/mod/asr_tts/mod_lumenvox/mod_lumenvox.cpp
freeswitch/branches/greenlizard/src/mod/codecs/mod_amr/mod_amr.c
freeswitch/branches/greenlizard/src/mod/codecs/mod_g711/mod_g711.c
freeswitch/branches/greenlizard/src/mod/codecs/mod_g722/mod_g722.c
freeswitch/branches/greenlizard/src/mod/codecs/mod_g723_1/mod_g723_1.c
freeswitch/branches/greenlizard/src/mod/codecs/mod_g726/mod_g726.c
freeswitch/branches/greenlizard/src/mod/codecs/mod_g729/mod_g729.c
freeswitch/branches/greenlizard/src/mod/codecs/mod_gsm/mod_gsm.c
freeswitch/branches/greenlizard/src/mod/codecs/mod_h26x/mod_h26x.c
freeswitch/branches/greenlizard/src/mod/codecs/mod_ilbc/mod_ilbc.c
freeswitch/branches/greenlizard/src/mod/codecs/mod_l16/mod_l16.c
freeswitch/branches/greenlizard/src/mod/codecs/mod_lpc10/mod_lpc10.c
freeswitch/branches/greenlizard/src/mod/codecs/mod_speex/mod_speex.c
freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c
freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
freeswitch/branches/greenlizard/src/mod/directories/mod_ldap/mod_ldap.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_alsa/mod_alsa.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_dingaling/mod_dingaling.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_iax/mod_iax.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/mod_portaudio.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.h
freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
freeswitch/branches/greenlizard/src/mod/endpoints/mod_woomera/mod_woomera.c
freeswitch/branches/greenlizard/src/mod/event_handlers/mod_cdr/mod_cdr.cpp
freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c
freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_test/mod_event_test.c
freeswitch/branches/greenlizard/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c
freeswitch/branches/greenlizard/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c
freeswitch/branches/greenlizard/src/mod/formats/mod_native_file/mod_native_file.c
freeswitch/branches/greenlizard/src/mod/formats/mod_shout/mod_shout.c
freeswitch/branches/greenlizard/src/mod/formats/mod_sndfile/mod_sndfile.c
freeswitch/branches/greenlizard/src/mod/languages/mod_mono/mod_mono.c
freeswitch/branches/greenlizard/src/mod/languages/mod_perl/mod_perl.c
freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.c
freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
freeswitch/branches/greenlizard/src/mod/loggers/mod_console/mod_console.c
freeswitch/branches/greenlizard/src/mod/loggers/mod_syslog/mod_syslog.c
freeswitch/branches/greenlizard/src/mod/say/mod_say_en/mod_say_en.c
freeswitch/branches/greenlizard/src/mod/timers/mod_softtimer/mod_softtimer.c
freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c
freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c
freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
freeswitch/branches/greenlizard/src/switch_channel.c
freeswitch/branches/greenlizard/src/switch_core_codec.c
freeswitch/branches/greenlizard/src/switch_core_event_hook.c
freeswitch/branches/greenlizard/src/switch_core_io.c
freeswitch/branches/greenlizard/src/switch_core_media_bug.c
freeswitch/branches/greenlizard/src/switch_ivr.c
freeswitch/branches/greenlizard/src/switch_ivr_bridge.c
freeswitch/branches/greenlizard/src/switch_loadable_module.c
freeswitch/branches/greenlizard/w32/Setup/Setup.vdproj
Log:
merge in trunk changes from revision 5309-5359
Modified: freeswitch/branches/greenlizard/Freeswitch.sln
==============================================================================
--- freeswitch/branches/greenlizard/Freeswitch.sln (original)
+++ freeswitch/branches/greenlizard/Freeswitch.sln Thu Jun 14 12:39:04 2007
@@ -44,12 +44,6 @@
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_bridgecall", "src\mod\applications\mod_bridgecall\mod_bridgecall.vcproj", "{E1794405-29D4-466D-9BE3-DD2344C2A663}"
- ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
- {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
- EndProjectSection
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_event_test", "src\mod\event_handlers\mod_event_test\mod_event_test.vcproj", "{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}"
ProjectSection(ProjectDependencies) = postProject
{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
@@ -68,12 +62,6 @@
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_playback", "src\mod\applications\mod_playback\mod_playback.vcproj", "{78100236-7CEA-4948-96CC-E8ED3160329C}"
- ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
- {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
- EndProjectSection
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_PortAudio", "src\mod\endpoints\mod_portaudio\mod_PortAudio.vcproj", "{5FD31A25-5D83-4794-8BEE-904DAD84CE71}"
ProjectSection(ProjectDependencies) = postProject
{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
@@ -128,12 +116,6 @@
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_ivrtest", "src\mod\applications\mod_ivrtest\mod_ivrtest.vcproj", "{419AA391-5F3F-4BFE-A869-9D154D62A792}"
- ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
- {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
- EndProjectSection
-EndProject
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "FreeSwitchSetup", "w32\Setup\Setup.vdproj", "{B17FFBE6-A942-4056-8346-B624FB5D995B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Directories", "Directories", "{B8F5B47B-8568-46EB-B320-64C17D2A98BC}"
@@ -192,12 +174,6 @@
{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_echo", "src\mod\applications\mod_echo\mod_echo.vcproj", "{0E2C6395-13B9-46E5-9264-8859D346018D}"
- ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
- {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
- EndProjectSection
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_ilbc", "src\mod\codecs\mod_ilbc\mod_ilbc.vcproj", "{D3EC0AFF-76FC-4210-A825-9A17410660A3}"
ProjectSection(ProjectDependencies) = postProject
{989BB874-7AF1-44CB-8E5C-CC8113D267E8} = {989BB874-7AF1-44CB-8E5C-CC8113D267E8}
@@ -367,12 +343,6 @@
{D71E7338-8D9C-4FE4-A15F-D5CC60202C7C} = {D71E7338-8D9C-4FE4-A15F-D5CC60202C7C}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_park", "src\mod\applications\mod_park\mod_park.vcproj", "{2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}"
- ProjectSection(ProjectDependencies) = postProject
- {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
- {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
- EndProjectSection
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsofia_sip_ua_static", "libs\win32\sofia\libsofia_sip_ua_static.vcproj", "{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}"
ProjectSection(ProjectDependencies) = postProject
{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}
@@ -584,6 +554,8 @@
configure.in = configure.in
Makefile.am = Makefile.am
build\modmake.sh = build\modmake.sh
+ build\modules.conf.in = build\modules.conf.in
+ libs\win32\util.vbs = libs\win32\util.vbs
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "m4", "m4", "{CDE9B06A-3C27-4987-8FAE-DF1006BC705D}"
@@ -651,12 +623,6 @@
{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Win32.ActiveCfg = Release|Win32
{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Win32.Build.0 = Release|Win32
{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|x64.ActiveCfg = Release|Win32
- {E1794405-29D4-466D-9BE3-DD2344C2A663}.Debug|Win32.ActiveCfg = Debug|Win32
- {E1794405-29D4-466D-9BE3-DD2344C2A663}.Debug|Win32.Build.0 = Debug|Win32
- {E1794405-29D4-466D-9BE3-DD2344C2A663}.Debug|x64.ActiveCfg = Debug|Win32
- {E1794405-29D4-466D-9BE3-DD2344C2A663}.Release|Win32.ActiveCfg = Release|Win32
- {E1794405-29D4-466D-9BE3-DD2344C2A663}.Release|Win32.Build.0 = Release|Win32
- {E1794405-29D4-466D-9BE3-DD2344C2A663}.Release|x64.ActiveCfg = Release|Win32
{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}.Debug|Win32.ActiveCfg = Debug|Win32
{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}.Debug|Win32.Build.0 = Debug|Win32
{3A2A7795-C216-4FFF-B8EF-4D17A84BACCC}.Debug|x64.ActiveCfg = Debug|Win32
@@ -675,12 +641,6 @@
{3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|Win32.ActiveCfg = Release|Win32
{3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|Win32.Build.0 = Release|Win32
{3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|x64.ActiveCfg = Release|Win32
- {78100236-7CEA-4948-96CC-E8ED3160329C}.Debug|Win32.ActiveCfg = Debug|Win32
- {78100236-7CEA-4948-96CC-E8ED3160329C}.Debug|Win32.Build.0 = Debug|Win32
- {78100236-7CEA-4948-96CC-E8ED3160329C}.Debug|x64.ActiveCfg = Debug|Win32
- {78100236-7CEA-4948-96CC-E8ED3160329C}.Release|Win32.ActiveCfg = Release|Win32
- {78100236-7CEA-4948-96CC-E8ED3160329C}.Release|Win32.Build.0 = Release|Win32
- {78100236-7CEA-4948-96CC-E8ED3160329C}.Release|x64.ActiveCfg = Release|Win32
{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|Win32.ActiveCfg = Debug|Win32
{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|Win32.Build.0 = Debug|Win32
{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|x64.ActiveCfg = Debug|Win32
@@ -721,12 +681,6 @@
{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|Win32.ActiveCfg = Release|Win32
{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|Win32.Build.0 = Release|Win32
{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|x64.ActiveCfg = Release|Win32
- {419AA391-5F3F-4BFE-A869-9D154D62A792}.Debug|Win32.ActiveCfg = Debug|Win32
- {419AA391-5F3F-4BFE-A869-9D154D62A792}.Debug|Win32.Build.0 = Debug|Win32
- {419AA391-5F3F-4BFE-A869-9D154D62A792}.Debug|x64.ActiveCfg = Debug|Win32
- {419AA391-5F3F-4BFE-A869-9D154D62A792}.Release|Win32.ActiveCfg = Release|Win32
- {419AA391-5F3F-4BFE-A869-9D154D62A792}.Release|Win32.Build.0 = Release|Win32
- {419AA391-5F3F-4BFE-A869-9D154D62A792}.Release|x64.ActiveCfg = Release|Win32
{B17FFBE6-A942-4056-8346-B624FB5D995B}.Debug|Win32.ActiveCfg = Debug
{B17FFBE6-A942-4056-8346-B624FB5D995B}.Debug|x64.ActiveCfg = Debug with MySql
{B17FFBE6-A942-4056-8346-B624FB5D995B}.Debug|x64.Build.0 = Debug with MySql
@@ -781,12 +735,6 @@
{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|x64.ActiveCfg = Debug|Win32
{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|Win32.ActiveCfg = Release|Win32
{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|x64.ActiveCfg = Release|Win32
- {0E2C6395-13B9-46E5-9264-8859D346018D}.Debug|Win32.ActiveCfg = Debug|Win32
- {0E2C6395-13B9-46E5-9264-8859D346018D}.Debug|Win32.Build.0 = Debug|Win32
- {0E2C6395-13B9-46E5-9264-8859D346018D}.Debug|x64.ActiveCfg = Debug|Win32
- {0E2C6395-13B9-46E5-9264-8859D346018D}.Release|Win32.ActiveCfg = Release|Win32
- {0E2C6395-13B9-46E5-9264-8859D346018D}.Release|Win32.Build.0 = Release|Win32
- {0E2C6395-13B9-46E5-9264-8859D346018D}.Release|x64.ActiveCfg = Release|Win32
{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Win32.ActiveCfg = Debug|Win32
{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Win32.Build.0 = Debug|Win32
{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|x64.ActiveCfg = Debug|Win32
@@ -1015,12 +963,6 @@
{D42518CC-7475-454D-B392-0E132C07D761}.Release|Win32.ActiveCfg = Release|Win32
{D42518CC-7475-454D-B392-0E132C07D761}.Release|Win32.Build.0 = Release|Win32
{D42518CC-7475-454D-B392-0E132C07D761}.Release|x64.ActiveCfg = Release|Win32
- {2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}.Debug|Win32.ActiveCfg = Debug|Win32
- {2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}.Debug|Win32.Build.0 = Debug|Win32
- {2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}.Debug|x64.ActiveCfg = Debug|Win32
- {2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}.Release|Win32.ActiveCfg = Release|Win32
- {2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}.Release|Win32.Build.0 = Release|Win32
- {2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B}.Release|x64.ActiveCfg = Release|Win32
{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Win32.ActiveCfg = Debug|Win32
{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Win32.Build.0 = Debug|Win32
{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|x64.ActiveCfg = Debug|Win32
@@ -1165,15 +1107,10 @@
{3D1EED36-A510-4EDB-B4D9-4E0F4A5EC2A8} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
{9254C4B0-6F60-42B6-BB3A-36D63FC001C7} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
- {78100236-7CEA-4948-96CC-E8ED3160329C} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
- {E1794405-29D4-466D-9BE3-DD2344C2A663} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
- {419AA391-5F3F-4BFE-A869-9D154D62A792} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
- {0E2C6395-13B9-46E5-9264-8859D346018D} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
{30A5B29C-983E-4580-9FD0-D647CCDCC7EB} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
{C24FB505-05D7-4319-8485-7540B44C8603} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
{B5881A85-FE70-4F64-8607-2CAAE52669C6} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
- {2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
{71A967D5-0E99-4CEF-A587-98836EE6F2EF} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
{3850D93A-5F24-4922-BC1C-74D08C37C256} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
{5FD31A25-5D83-4794-8BEE-904DAD84CE71} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
Modified: freeswitch/branches/greenlizard/build/modules.conf.in
==============================================================================
--- freeswitch/branches/greenlizard/build/modules.conf.in (original)
+++ freeswitch/branches/greenlizard/build/modules.conf.in Thu Jun 14 12:39:04 2007
@@ -1,16 +1,12 @@
loggers/mod_console
loggers/mod_syslog
-applications/mod_bridgecall
applications/mod_commands
applications/mod_conference
applications/mod_dptools
-applications/mod_echo
applications/mod_enum
#applications/mod_ivrtest
-#applications/mod_park
-applications/mod_playback
+#applications/mod_soundtouch
#applications/mod_rss
-#applications/mod_skel
#asr_tts/mod_cepstral
#codecs/mod_amr
codecs/mod_g711
Modified: freeswitch/branches/greenlizard/conf/default_context.xml
==============================================================================
--- freeswitch/branches/greenlizard/conf/default_context.xml (original)
+++ freeswitch/branches/greenlizard/conf/default_context.xml Thu Jun 14 12:39:04 2007
@@ -19,6 +19,24 @@
</condition>
</extension>
+ <extension name="9193">
+ <condition field="destination_number" expression="^9193$">
+ <action application="set" data="bridge_pre_execute_bleg_app=soundtouch"/>
+ <!-- send or recv indicates which direction the dtmf is parsed from
+ since this example is send and it's being called on the b leg
+ the application will intercept the dtmf from being sent to the b leg
+ a.k.a. by the dtmf of the A leg.
+ if it were 'recv' then it would be parsed when the dtmf was
+ received *from* the b leg so it could control itself.
+ The optional keywords "read" and "write" will also change the stream replaced
+ -->
+ <action application="set" data="bridge_pre_execute_bleg_data=send -4s"/>
+ <action application="bridge" data="sofia/$${domain}/foo"/>
+ </condition>
+ </extension>
+
+
+
<extension name="9192">
<condition field="destination_number" expression="^9192$">
<!-- Maintain Buffer of 128k of audio (default is 64k) -->
Modified: freeswitch/branches/greenlizard/conf/modules.conf.xml
==============================================================================
--- freeswitch/branches/greenlizard/conf/modules.conf.xml (original)
+++ freeswitch/branches/greenlizard/conf/modules.conf.xml Thu Jun 14 12:39:04 2007
@@ -33,13 +33,9 @@
<!-- <load module="mod_woomera"/> -->
<!-- Applications -->
- <load module="mod_bridgecall"/>
<load module="mod_commands"/>
<load module="mod_conference"/>
<load module="mod_dptools"/>
- <load module="mod_echo"/>
- <!--<load module="mod_park"/>-->
- <load module="mod_playback"/>
<!-- Dialplan Interfaces -->
<!-- <load module="mod_dialplan_directory"/> -->
Modified: freeswitch/branches/greenlizard/scripts/socket/socket2me/Makefile
==============================================================================
--- freeswitch/branches/greenlizard/scripts/socket/socket2me/Makefile (original)
+++ freeswitch/branches/greenlizard/scripts/socket/socket2me/Makefile Thu Jun 14 12:39:04 2007
@@ -1,4 +1,5 @@
+all: socket2me
socket2me: socket2me.c
- $(CC) -Wall socket2me.c -o socket2me -l spandsp
+ $(CC) $(CFLAGS) socket2me.c -o socket2me -l spandsp
clean:
rm socket2me
Modified: freeswitch/branches/greenlizard/src/include/private/switch_core_pvt.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/private/switch_core_pvt.h (original)
+++ freeswitch/branches/greenlizard/src/include/private/switch_core_pvt.h Thu Jun 14 12:39:04 2007
@@ -127,8 +127,10 @@
struct switch_media_bug {
switch_buffer_t *raw_write_buffer;
switch_buffer_t *raw_read_buffer;
- switch_frame_t *replace_frame_in;
- switch_frame_t *replace_frame_out;
+ switch_frame_t *read_replace_frame_in;
+ switch_frame_t *read_replace_frame_out;
+ switch_frame_t *write_replace_frame_in;
+ switch_frame_t *write_replace_frame_out;
switch_media_bug_callback_t callback;
switch_mutex_t *read_mutex;
switch_mutex_t *write_mutex;
Modified: freeswitch/branches/greenlizard/src/include/switch_apr.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_apr.h (original)
+++ freeswitch/branches/greenlizard/src/include/switch_apr.h Thu Jun 14 12:39:04 2007
@@ -55,7 +55,7 @@
* @{
*/
/** The fundamental pool type */
- typedef struct apr_pool_t switch_memory_pool_t;
+/* see switch types.h typedef struct apr_pool_t switch_memory_pool_t;*/
/**
Modified: freeswitch/branches/greenlizard/src/include/switch_core.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_core.h (original)
+++ freeswitch/branches/greenlizard/src/include/switch_core.h Thu Jun 14 12:39:04 2007
@@ -142,14 +142,27 @@
\brief Obtain a replace frame from a media bug
\param bug the bug to get the data from
*/
-SWITCH_DECLARE(switch_frame_t *) switch_core_media_bug_get_replace_frame(switch_media_bug_t *bug);
+SWITCH_DECLARE(switch_frame_t *) switch_core_media_bug_get_write_replace_frame(switch_media_bug_t *bug);
/*!
\brief Set a return replace frame
\param bug the bug to set the frame on
\param frame the frame to set
*/
-SWITCH_DECLARE(void) switch_core_media_bug_set_replace_frame(switch_media_bug_t *bug, switch_frame_t *frame);
+SWITCH_DECLARE(void) switch_core_media_bug_set_write_replace_frame(switch_media_bug_t *bug, switch_frame_t *frame);
+
+/*!
+ \brief Obtain a replace frame from a media bug
+ \param bug the bug to get the data from
+*/
+SWITCH_DECLARE(switch_frame_t *) switch_core_media_bug_get_read_replace_frame(switch_media_bug_t *bug);
+
+/*!
+ \brief Set a return replace frame
+ \param bug the bug to set the frame on
+ \param frame the frame to set
+*/
+SWITCH_DECLARE(void) switch_core_media_bug_set_read_replace_frame(switch_media_bug_t *bug, switch_frame_t *frame);
/*!
\brief Remove a media bug from the session
@@ -789,7 +802,15 @@
\param dtmf string to send to the session
\return SWITCH_STATUS_SUCCESS if the dtmf was written
*/
-SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf(switch_core_session_t *session, char *dtmf);
+SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf(switch_core_session_t *session, const char *dtmf);
+
+/*!
+ \brief RECV DTMF on a session
+ \param session session to recv DTMF from
+ \param dtmf string to recv from the session
+ \return SWITCH_STATUS_SUCCESS if the dtmf is ok to queue
+*/
+SWITCH_DECLARE(switch_status_t) switch_core_session_recv_dtmf(switch_core_session_t *session, const char *dtmf);
///\}
@@ -1440,6 +1461,10 @@
\return TRUE or FALSE
*/
SWITCH_DECLARE(uint8_t) switch_core_session_compare(switch_core_session_t *a, switch_core_session_t *b);
+
+
+SWITCH_DECLARE(switch_loadable_module_interface_t *) switch_loadable_module_create_module_interface(switch_memory_pool_t *pool, const char *name);
+SWITCH_DECLARE(void *) switch_loadable_module_create_interface(switch_loadable_module_interface_t *mod, switch_module_interface_name_t iname);
///\}
/*!
Modified: freeswitch/branches/greenlizard/src/include/switch_core_event_hook.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_core_event_hook.h (original)
+++ freeswitch/branches/greenlizard/src/include/switch_core_event_hook.h Thu Jun 14 12:39:04 2007
@@ -32,7 +32,8 @@
#define SWITCH_EVENT_HOOKS_H
#include <switch.h>
-SWITCH_BEGIN_EXTERN_C typedef struct switch_io_event_hooks switch_io_event_hooks_t;
+SWITCH_BEGIN_EXTERN_C
+typedef struct switch_io_event_hooks switch_io_event_hooks_t;
typedef struct switch_io_event_hook_outgoing_channel switch_io_event_hook_outgoing_channel_t;
typedef struct switch_io_event_hook_receive_message switch_io_event_hook_receive_message_t;
@@ -45,9 +46,8 @@
typedef struct switch_io_event_hook_waitfor_read switch_io_event_hook_waitfor_read_t;
typedef struct switch_io_event_hook_waitfor_write switch_io_event_hook_waitfor_write_t;
typedef struct switch_io_event_hook_send_dtmf switch_io_event_hook_send_dtmf_t;
+typedef struct switch_io_event_hook_recv_dtmf switch_io_event_hook_recv_dtmf_t;
typedef struct switch_io_event_hook_state_change switch_io_event_hook_state_change_t;
-
-
typedef switch_status_t (*switch_outgoing_channel_hook_t) (switch_core_session_t *, switch_caller_profile_t *, switch_core_session_t *);
typedef switch_status_t (*switch_receive_message_hook_t) (switch_core_session_t *, switch_core_session_message_t *);
typedef switch_status_t (*switch_receive_event_hook_t) (switch_core_session_t *, switch_event_t *);
@@ -58,24 +58,24 @@
typedef switch_status_t (*switch_kill_channel_hook_t) (switch_core_session_t *, int);
typedef switch_status_t (*switch_waitfor_read_hook_t) (switch_core_session_t *, int, int);
typedef switch_status_t (*switch_waitfor_write_hook_t) (switch_core_session_t *, int, int);
-typedef switch_status_t (*switch_send_dtmf_hook_t) (switch_core_session_t *, char *);
+typedef switch_status_t (*switch_send_dtmf_hook_t) (switch_core_session_t *, const char *);
+typedef switch_status_t (*switch_recv_dtmf_hook_t) (switch_core_session_t *, const char *);
typedef switch_status_t (*switch_state_change_hook_t) (switch_core_session_t *);
-/*! \brief Node in which to store custom outgoing channel callback hooks */
+/*! \brief Node in which to store custom receive message callback hooks */
struct switch_io_event_hook_outgoing_channel {
- /*! the outgoing channel callback hook */
switch_outgoing_channel_hook_t outgoing_channel;
struct switch_io_event_hook_outgoing_channel *next;
};
/*! \brief Node in which to store custom receive message callback hooks */
struct switch_io_event_hook_receive_message {
- /*! the message callback hook */
switch_receive_message_hook_t receive_message;
struct switch_io_event_hook_receive_message *next;
};
+
/*! \brief Node in which to store custom receive message callback hooks */
struct switch_io_event_hook_receive_event {
/*! the event callback hook */
@@ -139,9 +139,16 @@
struct switch_io_event_hook_send_dtmf *next;
};
+/*! \brief Node in which to store custom recv dtmf channel callback hooks */
+struct switch_io_event_hook_recv_dtmf {
+ /*! the recv dtmf channel callback hook */
+ switch_recv_dtmf_hook_t recv_dtmf;
+ struct switch_io_event_hook_recv_dtmf *next;
+};
+
/*! \brief Node in which to store state change callback hooks */
struct switch_io_event_hook_state_change {
- /*! the send dtmf channel callback hook */
+ /*! the state change channel callback hook */
switch_state_change_hook_t state_change;
struct switch_io_event_hook_state_change *next;
};
@@ -170,106 +177,82 @@
switch_io_event_hook_waitfor_write_t *waitfor_write;
/*! a list of send dtmf hooks */
switch_io_event_hook_send_dtmf_t *send_dtmf;
+ /*! a list of recv dtmf hooks */
+ switch_io_event_hook_recv_dtmf_t *recv_dtmf;
/*! a list of state change hooks */
switch_io_event_hook_state_change_t *state_change;
};
extern switch_io_event_hooks_t switch_core_session_get_event_hooks(switch_core_session_t *session);
+#define NEW_HOOK_DECL_ADD_P(_NAME) SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_##_NAME \
+ (switch_core_session_t *session, switch_##_NAME##_hook_t _NAME)
+#define NEW_HOOK_DECL_REM_P(_NAME) SWITCH_DECLARE(switch_status_t) switch_core_event_hook_remove_##_NAME \
+ (switch_core_session_t *session, switch_##_NAME##_hook_t _NAME)
-///\defgroup shooks Session Hook Callbacks
-///\ingroup core1
-///\{
-
-/*!
- \brief Add an event hook to be executed when a session requests an outgoing extension
- \param session session to bind hook to
- \param outgoing_channel hook to bind
- \return SWITCH_STATUS_SUCCESS on suceess
-*/
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_outgoing_channel(switch_core_session_t *session,
- switch_outgoing_channel_hook_t outgoing_channel);
-
-/*!
- \brief Add an event hook to be executed when a session sends a message
- \param session session to bind hook to
- \param receive_message hook to bind
- \return SWITCH_STATUS_SUCCESS on suceess
-*/
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_receive_message(switch_core_session_t *session, switch_receive_message_hook_t receive_message);
-
-/*!
- \brief Add an event hook to be executed when a session reads a frame
- \param session session to bind hook to
- \param read_frame hook to bind
- \return SWITCH_STATUS_SUCCESS on suceess
-*/
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_read_frame(switch_core_session_t *session, switch_read_frame_hook_t read_frame);
-
-/*!
- \brief Add an event hook to be executed when a session reads a frame
- \param session session to bind hook to
- \param video_read_frame hook to bind
- \return SWITCH_STATUS_SUCCESS on suceess
-*/
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_video_read_frame(switch_core_session_t *session, switch_read_frame_hook_t video_read_frame);
-
-/*!
- \brief Add an event hook to be executed when a session writes a frame
- \param session session to bind hook to
- \param write_frame hook to bind
- \return SWITCH_STATUS_SUCCESS on suceess
-*/
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_write_frame(switch_core_session_t *session, switch_write_frame_hook_t write_frame);
-
-/*!
- \brief Add an event hook to be executed when a session writes a video frame
- \param session session to bind hook to
- \param video_write_frame hook to bind
- \return SWITCH_STATUS_SUCCESS on suceess
-*/
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_video_write_frame(switch_core_session_t *session, switch_video_write_frame_hook_t video_write_frame);
-
-/*!
- \brief Add an event hook to be executed when a session kills a channel
- \param session session to bind hook to
- \param kill_channel hook to bind
- \return SWITCH_STATUS_SUCCESS on suceess
-*/
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_kill_channel(switch_core_session_t *session, switch_kill_channel_hook_t kill_channel);
-
-/*!
- \brief Add an event hook to be executed when a session waits for a read event
- \param session session to bind hook to
- \param waitfor_read hook to bind
- \return SWITCH_STATUS_SUCCESS on suceess
-*/
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_waitfor_read(switch_core_session_t *session, switch_waitfor_read_hook_t waitfor_read);
-
-/*!
- \brief Add an event hook to be executed when a session waits for a write event
- \param session session to bind hook to
- \param waitfor_write hook to bind
- \return SWITCH_STATUS_SUCCESS on suceess
-*/
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_waitfor_write(switch_core_session_t *session, switch_waitfor_write_hook_t waitfor_write);
-
-/*!
- \brief Add an event hook to be executed when a session sends dtmf
- \param session session to bind hook to
- \param send_dtmf hook to bind
- \return SWITCH_STATUS_SUCCESS on suceess
-*/
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_send_dtmf(switch_core_session_t *session, switch_send_dtmf_hook_t send_dtmf);
-
-/*!
- \brief Add an event hook to be executed when a session receives a state change signal
- \param session session to bind hook to
- \param state_change hook to bind
- \return SWITCH_STATUS_SUCCESS on suceess
-*/
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_state_change(switch_core_session_t *session, switch_state_change_hook_t state_change);
+#define NEW_HOOK_DECL(_NAME) NEW_HOOK_DECL_ADD_P(_NAME) \
+ { \
+ switch_io_event_hook_##_NAME##_t *hook, *ptr; \
+ assert(_NAME != NULL); \
+ if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) { \
+ hook->_NAME = _NAME ; \
+ if (! session->event_hooks._NAME ) { \
+ session->event_hooks._NAME = hook; \
+ } else { \
+ for (ptr = session->event_hooks._NAME; ptr && ptr->next; ptr = ptr->next); \
+ ptr->next = hook; \
+ } \
+ return SWITCH_STATUS_SUCCESS; \
+ } \
+ return SWITCH_STATUS_MEMERR; \
+ } \
+ NEW_HOOK_DECL_REM_P(_NAME) \
+ { \
+ switch_io_event_hook_##_NAME##_t *ptr, *last = NULL; \
+ assert(_NAME != NULL); \
+ for (ptr = session->event_hooks._NAME; ptr; ptr = ptr->next) { \
+ if (ptr->_NAME == _NAME) { \
+ if (last) { \
+ last->next = ptr->next; \
+ } else { \
+ session->event_hooks._NAME = ptr->next; \
+ } \
+ return SWITCH_STATUS_SUCCESS; \
+ } \
+ last = ptr; \
+ } \
+ return SWITCH_STATUS_FALSE; \
+ }
+
+
+NEW_HOOK_DECL_ADD_P(outgoing_channel);
+NEW_HOOK_DECL_ADD_P(receive_message);
+NEW_HOOK_DECL_ADD_P(receive_event);
+NEW_HOOK_DECL_ADD_P(state_change);
+NEW_HOOK_DECL_ADD_P(read_frame);
+NEW_HOOK_DECL_ADD_P(write_frame);
+NEW_HOOK_DECL_ADD_P(video_read_frame);
+NEW_HOOK_DECL_ADD_P(video_write_frame);
+NEW_HOOK_DECL_ADD_P(kill_channel);
+NEW_HOOK_DECL_ADD_P(waitfor_read);
+NEW_HOOK_DECL_ADD_P(waitfor_write);
+NEW_HOOK_DECL_ADD_P(send_dtmf);
+NEW_HOOK_DECL_ADD_P(recv_dtmf);
+
+NEW_HOOK_DECL_REM_P(outgoing_channel);
+NEW_HOOK_DECL_REM_P(receive_message);
+NEW_HOOK_DECL_REM_P(receive_event);
+NEW_HOOK_DECL_REM_P(state_change);
+NEW_HOOK_DECL_REM_P(read_frame);
+NEW_HOOK_DECL_REM_P(write_frame);
+NEW_HOOK_DECL_REM_P(video_read_frame);
+NEW_HOOK_DECL_REM_P(video_write_frame);
+NEW_HOOK_DECL_REM_P(kill_channel);
+NEW_HOOK_DECL_REM_P(waitfor_read);
+NEW_HOOK_DECL_REM_P(waitfor_write);
+NEW_HOOK_DECL_REM_P(send_dtmf);
+NEW_HOOK_DECL_REM_P(recv_dtmf);
///\}
SWITCH_END_EXTERN_C
Modified: freeswitch/branches/greenlizard/src/include/switch_loadable_module.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_loadable_module.h (original)
+++ freeswitch/branches/greenlizard/src/include/switch_loadable_module.h Thu Jun 14 12:39:04 2007
@@ -54,31 +54,32 @@
/*! the name of the module */
const char *module_name;
/*! the table of endpoints the module has implmented */
- const switch_endpoint_interface_t *endpoint_interface;
+ switch_endpoint_interface_t *endpoint_interface;
/*! the table of timers the module has implmented */
- const switch_timer_interface_t *timer_interface;
+ switch_timer_interface_t *timer_interface;
/*! the table of dialplans the module has implmented */
- const switch_dialplan_interface_t *dialplan_interface;
+ switch_dialplan_interface_t *dialplan_interface;
/*! the table of codecs the module has implmented */
- const switch_codec_interface_t *codec_interface;
+ switch_codec_interface_t *codec_interface;
/*! the table of applications the module has implmented */
- const switch_application_interface_t *application_interface;
+ switch_application_interface_t *application_interface;
/*! the table of api functions the module has implmented */
- const switch_api_interface_t *api_interface;
+ switch_api_interface_t *api_interface;
/*! the table of file formats the module has implmented */
- const switch_file_interface_t *file_interface;
+ switch_file_interface_t *file_interface;
/*! the table of speech interfaces the module has implmented */
- const switch_speech_interface_t *speech_interface;
+ switch_speech_interface_t *speech_interface;
/*! the table of directory interfaces the module has implmented */
- const switch_directory_interface_t *directory_interface;
+ switch_directory_interface_t *directory_interface;
/*! the table of chat interfaces the module has implmented */
- const switch_chat_interface_t *chat_interface;
+ switch_chat_interface_t *chat_interface;
/*! the table of say interfaces the module has implmented */
- const switch_say_interface_t *say_interface;
+ switch_say_interface_t *say_interface;
/*! the table of asr interfaces the module has implmented */
- const switch_asr_interface_t *asr_interface;
+ switch_asr_interface_t *asr_interface;
/*! the table of management interfaces the module has implmented */
- const switch_management_interface_t *management_interface;
+ switch_management_interface_t *management_interface;
+ switch_memory_pool_t *pool;
};
/*!
Modified: freeswitch/branches/greenlizard/src/include/switch_module_interfaces.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_module_interfaces.h (original)
+++ freeswitch/branches/greenlizard/src/include/switch_module_interfaces.h Thu Jun 14 12:39:04 2007
@@ -44,7 +44,19 @@
SWITCH_BEGIN_EXTERN_C
/*! \brief A table of functions to execute at various states
*/
- struct switch_state_handler_table {
+
+typedef enum {
+ SWITCH_SHN_ON_INIT,
+ SWITCH_SHN_ON_RING,
+ SWITCH_SHN_ON_EXECUTE,
+ SWITCH_SHN_ON_HANGUP,
+ SWITCH_SHN_ON_LOOPBACK,
+ SWITCH_SHN_ON_TRANSMIT,
+ SWITCH_SHN_ON_HOLD,
+ SWITCH_SHN_ON_HIBERNATE
+} switch_state_handler_name_t;
+
+struct switch_state_handler_table {
/*! executed when the state changes to init */
switch_state_handler_t on_init;
/*! executed when the state changes to ring */
@@ -61,6 +73,7 @@
switch_state_handler_t on_hold;
/*! executed when the state changes to hibernate */
switch_state_handler_t on_hibernate;
+ void *padding[10];
};
struct switch_stream_handle {
@@ -77,32 +90,62 @@
struct switch_io_event_hooks;
+typedef switch_call_cause_t
+(*switch_io_outgoing_channel_t)(switch_core_session_t *, switch_caller_profile_t *, switch_core_session_t **, switch_memory_pool_t **);
+typedef switch_status_t (*switch_io_read_frame_t) (switch_core_session_t *, switch_frame_t **, int, switch_io_flag_t, int);
+typedef switch_status_t (*switch_io_write_frame_t) (switch_core_session_t *, switch_frame_t *, int, switch_io_flag_t, int);
+typedef switch_status_t (*switch_io_kill_channel_t) (switch_core_session_t *, int);
+typedef switch_status_t (*switch_io_waitfor_read_t) (switch_core_session_t *, int, int);
+typedef switch_status_t (*switch_io_waitfor_write_t) (switch_core_session_t *, int, int);
+typedef switch_status_t (*switch_io_send_dtmf_t) (switch_core_session_t *, char *);
+typedef switch_status_t (*switch_io_receive_message_t) (switch_core_session_t *, switch_core_session_message_t *);
+typedef switch_status_t (*switch_io_receive_event_t) (switch_core_session_t *, switch_event_t *);
+typedef switch_status_t (*switch_io_state_change_t) (switch_core_session_t *);
+typedef switch_status_t (*switch_io_read_video_frame_t) (switch_core_session_t *, switch_frame_t **, int, switch_io_flag_t, int);
+typedef switch_status_t (*switch_io_write_video_frame_t) (switch_core_session_t *, switch_frame_t *, int, switch_io_flag_t, int);
+
+typedef enum {
+ SWITCH_IO_OUTGOING_CHANNEL,
+ SWITCH_IO_READ_FRAME,
+ SWITCH_IO_WRITE_FRAME,
+ SWITCH_IO_KILL_CHANNEL,
+ SWITCH_IO_WAITFOR_READ,
+ SWITCH_IO_WAITFOR_WRITE,
+ SWITCH_IO_SEND_DTMF,
+ SWITCH_IO_RECEIVE_MESSAGE,
+ SWITCH_IO_RECEIVE_EVENT,
+ SWITCH_IO_STATE_CHANGE,
+ SWITCH_IO_READ_VIDEO_FRAME,
+ SWITCH_IO_WRITE_VIDEO_FRAME
+} switch_io_routine_name_t;
+
/*! \brief A table of i/o routines that an endpoint interface can implement */
struct switch_io_routines {
/*! creates an outgoing session from given session, caller profile */
- switch_call_cause_t (*outgoing_channel) (switch_core_session_t *, switch_caller_profile_t *, switch_core_session_t **, switch_memory_pool_t **);
+ switch_io_outgoing_channel_t outgoing_channel;
/*! read a frame from a session */
- switch_status_t (*read_frame) (switch_core_session_t *, switch_frame_t **, int, switch_io_flag_t, int);
+ switch_io_read_frame_t read_frame;
/*! write a frame to a session */
- switch_status_t (*write_frame) (switch_core_session_t *, switch_frame_t *, int, switch_io_flag_t, int);
+ switch_io_write_frame_t write_frame;
/*! send a kill signal to the session's channel */
- switch_status_t (*kill_channel) (switch_core_session_t *, int);
+ switch_io_kill_channel_t kill_channel;
/*! wait for the session's channel to be ready to read audio */
- switch_status_t (*waitfor_read) (switch_core_session_t *, int, int);
+ switch_io_waitfor_read_t waitfor_read;
/*! wait for the session's channel to be ready to write audio */
- switch_status_t (*waitfor_write) (switch_core_session_t *, int, int);
+ switch_io_waitfor_write_t waitfor_write;
/*! send a string of DTMF digits to a session's channel */
- switch_status_t (*send_dtmf) (switch_core_session_t *, char *);
+ switch_io_send_dtmf_t send_dtmf;
/*! receive a message from another session */
- switch_status_t (*receive_message) (switch_core_session_t *, switch_core_session_message_t *);
+ switch_io_receive_message_t receive_message;
/*! queue a message for another session */
- switch_status_t (*receive_event) (switch_core_session_t *, switch_event_t *);
+ switch_io_receive_event_t receive_event;
/*! change a sessions channel state */
- switch_status_t (*state_change) (switch_core_session_t *);
+ switch_io_state_change_t state_change;
/*! read a video frame from a session */
- switch_status_t (*read_video_frame) (switch_core_session_t *, switch_frame_t **, int, switch_io_flag_t, int);
+ switch_io_read_video_frame_t read_video_frame;
/*! write a video frame to a session */
- switch_status_t (*write_video_frame) (switch_core_session_t *, switch_frame_t *, int, switch_io_flag_t, int);
+ switch_io_write_video_frame_t write_video_frame;
+ void *padding[10];
};
/*! \brief Abstraction of an module endpoint interface
@@ -116,16 +159,16 @@
const char *interface_name;
/*! channel abstraction methods */
- const switch_io_routines_t *io_routines;
+ switch_io_routines_t *io_routines;
/*! state machine methods */
- const switch_state_handler_table_t *state_handler;
+ switch_state_handler_table_t *state_handler;
/*! private information */
void *private_info;
/* to facilitate linking */
- const struct switch_endpoint_interface *next;
+ struct switch_endpoint_interface *next;
};
/*! \brief Abstract handler to a timer module */
@@ -146,6 +189,14 @@
void *private_info;
};
+typedef enum {
+ SWITCH_TIMER_FUNC_TIMER_INIT,
+ SWITCH_TIMER_FUNC_TIMER_NEXT,
+ SWITCH_TIMER_FUNC_TIMER_STEP,
+ SWITCH_TIMER_FUNC_TIMER_CHECK,
+ SWITCH_TIMER_FUNC_TIMER_DESTROY
+} switch_timer_func_name_t;
+
/*! \brief A table of functions that a timer module implements */
struct switch_timer_interface {
/*! the name of the interface */
@@ -160,7 +211,7 @@
switch_status_t (*timer_check) (switch_timer_t *);
/*! function to deallocate the timer */
switch_status_t (*timer_destroy) (switch_timer_t *);
- const struct switch_timer_interface *next;
+ struct switch_timer_interface *next;
};
/*! \brief Abstract interface to a dialplan module */
@@ -169,7 +220,7 @@
const char *interface_name;
/*! the function to read an extension and set a channels dialpan */
switch_dialplan_hunt_function_t hunt_function;
- const struct switch_dialplan_interface *next;
+ struct switch_dialplan_interface *next;
};
/*! \brief Abstract interface to a file format module */
@@ -192,7 +243,7 @@
switch_status_t (*file_get_string) (switch_file_handle_t *fh, switch_audio_col_t col, const char **string);
/*! list of supported file extensions */
char **extens;
- const struct switch_file_interface *next;
+ struct switch_file_interface *next;
};
/*! an abstract representation of a file handle (some parameters based on compat with libsndfile) */
@@ -254,7 +305,7 @@
switch_status_t (*asr_check_results) (switch_asr_handle_t *ah, switch_asr_flag_t *flags);
/*! function to read results from the ASR */
switch_status_t (*asr_get_results) (switch_asr_handle_t *ah, char **xmlstr, switch_asr_flag_t *flags);
- const struct switch_asr_interface *next;
+ struct switch_asr_interface *next;
};
/*! an abstract representation of an asr speech interface. */
@@ -293,7 +344,7 @@
void (*speech_numeric_param_tts) (switch_speech_handle_t *sh, char *param, int val);
void (*speech_float_param_tts) (switch_speech_handle_t *sh, char *param, double val);
- const struct switch_speech_interface *next;
+ struct switch_speech_interface *next;
};
@@ -322,7 +373,7 @@
const char *interface_name;
/*! function to pass down to the module */
switch_say_callback_t say_function;
- const struct switch_say_interface *next;
+ struct switch_say_interface *next;
};
/*! \brief Abstract interface to a chat module */
@@ -331,7 +382,7 @@
const char *interface_name;
/*! function to open the directory interface */
switch_status_t (*chat_send) (char *proto, char *from, char *to, char *subject, char *body, char *hint);
- const struct switch_chat_interface *next;
+ struct switch_chat_interface *next;
};
/*! \brief Abstract interface to a management module */
@@ -340,7 +391,7 @@
const char *relative_oid;
/*! function to open the directory interface */
switch_status_t (*management_function) (char *relative_oid, switch_management_action_t action, char *data, switch_size_t datalen);
- const struct switch_management_interface *next;
+ struct switch_management_interface *next;
};
/*! \brief Abstract interface to a directory module */
@@ -358,7 +409,7 @@
/*! function to advance to the next name/value pair in the current record */
switch_status_t (*directory_next_pair) (switch_directory_handle_t *dh, char **var, char **val);
- const struct switch_directory_interface *next;
+ struct switch_directory_interface *next;
};
/*! an abstract representation of a directory interface. */
@@ -476,7 +527,7 @@
uint32_t encoded_rate, void *decoded_data, uint32_t * decoded_data_len, uint32_t * decoded_rate, unsigned int *flag);
/*! deinitalize a codec handle using this implementation */
switch_status_t (*destroy) (switch_codec_t *);
- const struct switch_codec_implementation *next;
+ struct switch_codec_implementation *next;
};
/*! \brief Top level module interface to implement a series of codec implementations */
@@ -484,8 +535,8 @@
/*! the name of the interface */
const char *interface_name;
/*! a list of codec implementations related to the codec */
- const switch_codec_implementation_t *implementations;
- const struct switch_codec_interface *next;
+ switch_codec_implementation_t *implementations;
+ struct switch_codec_interface *next;
};
/*! \brief A module interface to implement an application */
@@ -502,7 +553,7 @@
const char *syntax;
/*! flags to control behaviour */
uint32_t flags;
- const struct switch_application_interface *next;
+ struct switch_application_interface *next;
};
/*! \brief A module interface to implement an api function */
@@ -515,7 +566,7 @@
switch_api_function_t function;
/*! an example of the api syntax */
const char *syntax;
- const struct switch_api_interface *next;
+ struct switch_api_interface *next;
};
SWITCH_END_EXTERN_C
Modified: freeswitch/branches/greenlizard/src/include/switch_platform.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_platform.h (original)
+++ freeswitch/branches/greenlizard/src/include/switch_platform.h Thu Jun 14 12:39:04 2007
@@ -146,10 +146,13 @@
#endif
#if defined(SWITCH_MOD_DECLARE_STATIC)
#define SWITCH_MOD_DECLARE(type) type __cdecl
+#define SWITCH_MOD_DECLARE_DATA
#elif defined(MOD_EXPORTS)
#define SWITCH_MOD_DECLARE(type) __declspec(dllexport) type __cdecl
+#define SWITCH_MOD_DECLARE_DATA __declspec(dllexport)
#else
#define SWITCH_MOD_DECLARE(type) __declspec(dllimport) type __cdecl
+#define SWITCH_MOD_DECLARE_DATA __declspec(dllimport)
#endif
#define SIGHUP SIGTERM
#ifndef S_IRUSR
@@ -164,6 +167,7 @@
#define SWITCH_DECLARE_NONSTD(type) type
#define SWITCH_MOD_DECLARE(type) type
#define SWITCH_DECLARE_DATA
+#define SWITCH_MOD_DECLARE_DATA
#define SWITCH_THREAD_FUNC
#endif
#ifdef DOXYGEN
Modified: freeswitch/branches/greenlizard/src/include/switch_types.h
==============================================================================
--- freeswitch/branches/greenlizard/src/include/switch_types.h (original)
+++ freeswitch/branches/greenlizard/src/include/switch_types.h Thu Jun 14 12:39:04 2007
@@ -125,6 +125,22 @@
typedef enum {
+ SWITCH_ENDPOINT_INTERFACE,
+ SWITCH_TIMER_INTERFACE,
+ SWITCH_DIALPLAN_INTERFACE,
+ SWITCH_CODEC_INTERFACE,
+ SWITCH_APPLICATION_INTERFACE,
+ SWITCH_API_INTERFACE,
+ SWITCH_FILE_INTERFACE,
+ SWITCH_SPEECH_INTERFACE,
+ SWITCH_DIRECTORY_INTERFACE,
+ SWITCH_CHAT_INTERFACE,
+ SWITCH_SAY_INTERFACE,
+ SWITCH_ASR_INTERFACE,
+ SWITCH_MANAGEMENT_INTERFACE
+} switch_module_interface_name_t;
+
+typedef enum {
SUF_NONE = 0,
SUF_THREAD_RUNNING = (1 << 0),
SUF_READY = (1 << 1),
@@ -196,6 +212,7 @@
SWITCH_ABC_TYPE_READ,
SWITCH_ABC_TYPE_WRITE,
SWITCH_ABC_TYPE_WRITE_REPLACE,
+ SWITCH_ABC_TYPE_READ_REPLACE,
SWITCH_ABC_TYPE_CLOSE
} switch_abc_type_t;
@@ -742,14 +759,16 @@
<pre>
SMBF_READ_STREAM - Include the Read Stream
SMBF_WRITE_STREAM - Include the Write Stream
-SMBF_WRITE_STREAM - Replace the Write Stream
+SMBF_WRITE_REPLACE - Replace the Write Stream
+SMBF_READ_REPLACE - Replace the Read Stream
</pre>
*/
typedef enum {
SMBF_BOTH = 0,
SMBF_READ_STREAM = (1 << 0),
SMBF_WRITE_STREAM = (1 << 1),
- SMBF_WRITE_REPLACE = (1 << 2)
+ SMBF_WRITE_REPLACE = (1 << 2),
+ SMBF_READ_REPLACE = (1 << 3)
} switch_media_bug_flag_t;
/*!
@@ -968,6 +987,7 @@
SCSC_CHECK_RUNNING
} switch_session_ctl_t;
+typedef struct apr_pool_t switch_memory_pool_t;
typedef uint16_t switch_port_t;
typedef uint8_t switch_payload_t;
typedef struct switch_app_log switch_app_log_t;
@@ -1042,19 +1062,41 @@
} switch_input_args_t;
typedef switch_status_t (*switch_say_callback_t) (switch_core_session_t *session,
char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args);
-typedef switch_status_t (*switch_module_load_t) (switch_loadable_module_interface_t **, char *);
-typedef switch_status_t (*switch_module_reload_t) (void);
-typedef switch_status_t (*switch_module_pause_t) (void);
-typedef switch_status_t (*switch_module_resume_t) (void);
-typedef switch_status_t (*switch_module_status_t) (void);
-typedef switch_status_t (*switch_module_runtime_t) (void);
-typedef switch_status_t (*switch_module_shutdown_t) (void);
typedef struct switch_xml *switch_xml_t;
typedef struct switch_core_time_duration switch_core_time_duration_t;
typedef switch_xml_t(*switch_xml_search_function_t) (const char *section,
const char *tag_name, const char *key_name, const char *key_value, const char *params,
void *user_data);
+
+#define SWITCH_API_VERSION 1
+#define SWITCH_MODULE_LOAD_ARGS (switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool)
+#define SWITCH_MODULE_RUNTIME_ARGS (void)
+#define SWITCH_MODULE_SHUTDOWN_ARGS (void)
+typedef switch_status_t (*switch_module_load_t) SWITCH_MODULE_LOAD_ARGS ;
+typedef switch_status_t (*switch_module_runtime_t) SWITCH_MODULE_RUNTIME_ARGS ;
+typedef switch_status_t (*switch_module_shutdown_t) SWITCH_MODULE_SHUTDOWN_ARGS ;
+#define SWITCH_MODULE_LOAD_FUNCTION(name) switch_status_t name SWITCH_MODULE_LOAD_ARGS
+#define SWITCH_MODULE_RUNTIME_FUNCTION(name) switch_status_t name SWITCH_MODULE_RUNTIME_ARGS
+#define SWITCH_MODULE_SHUTDOWN_FUNCTION(name) switch_status_t name SWITCH_MODULE_SHUTDOWN_ARGS
+
+typedef struct switch_loadable_module_function_table {
+ int switch_api_version;
+ switch_module_load_t load;
+ switch_module_shutdown_t shutdown;
+ switch_module_runtime_t runtime;
+} switch_loadable_module_function_table_t;
+
+#define SWITCH_MODULE_DEFINITION(name, load, shutdown, runtime) \
+static const char modname[] = #name ; \
+SWITCH_MOD_DECLARE_DATA switch_loadable_module_function_table_t name##_module_interface = { \
+ SWITCH_API_VERSION, \
+ load, \
+ shutdown, \
+ runtime \
+}
+
+
/* things we don't deserve to know about */
/*! \brief A channel */
struct switch_channel;
Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_commands/mod_commands.c (original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_commands/mod_commands.c Thu Jun 14 12:39:04 2007
@@ -36,8 +36,9 @@
#include <switch.h>
#include <switch_version.h>
+SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load);
+SWITCH_MODULE_DEFINITION(mod_commands, mod_commands_load, NULL, NULL);
-static const char modname[] = "mod_commands";
static switch_api_interface_t ctl_api_interface;
static switch_api_interface_t uuid_bridge_api_interface;
static switch_api_interface_t session_record_api_interface;
@@ -1318,7 +1319,7 @@
/*.next */ &kill_api_interface
};
-static const switch_loadable_module_interface_t mod_commands_module_interface = {
+static switch_loadable_module_interface_t commands_module_interface = {
/*.module_name */ modname,
/*.endpoint_interface */ NULL,
/*.timer_interface */ NULL,
@@ -1328,10 +1329,10 @@
/*.api_interface */ &originate_api_interface
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
{
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &mod_commands_module_interface;
+ *module_interface = &commands_module_interface;
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_NOUNLOAD;
Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_conference/mod_conference.c (original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_conference/mod_conference.c Thu Jun 14 12:39:04 2007
@@ -33,7 +33,10 @@
*/
#include <switch.h>
-static const char modname[] = "mod_conference";
+SWITCH_MODULE_LOAD_FUNCTION(mod_conference_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_conference_shutdown);
+SWITCH_MODULE_DEFINITION(mod_conference, mod_conference_load, mod_conference_shutdown, NULL);
+
static const char global_app_name[] = "conference";
static char *global_cf_name = "conference.conf";
static switch_api_interface_t conf_api_interface;
@@ -54,7 +57,8 @@
typedef enum {
FILE_STOP_CURRENT,
- FILE_STOP_ALL
+ FILE_STOP_ALL,
+ FILE_STOP_ASYNC
} file_stop_t;
/* Global Values */
@@ -176,6 +180,7 @@
char *exit_sound;
char *alone_sound;
char *perpetual_sound;
+ char *moh_sound;
char *ack_sound;
char *nack_sound;
char *muted_sound;
@@ -500,8 +505,14 @@
switch_event_fire(&event);
}
- if (conference->count > 1 && conference->enter_sound) {
- conference_play_file(conference, conference->enter_sound, CONF_DEFAULT_LEADIN, switch_core_session_get_channel(member->session), 0);
+ if (conference->count > 1) {
+ if(conference->moh_sound) {
+ /* stop MoH if any */
+ conference_stop_file(conference, FILE_STOP_ASYNC);
+ }
+ if(conference->enter_sound) {
+ conference_play_file(conference, conference->enter_sound, CONF_DEFAULT_LEADIN, switch_core_session_get_channel(member->session), 0);
+ }
}
channel = switch_core_session_get_channel(member->session);
@@ -541,6 +552,7 @@
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", conference->name);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "add-member");
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Size", "%u", conference->count);
switch_event_fire(&event);
}
}
@@ -638,6 +650,7 @@
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", conference->name);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "del-member");
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Size", "%u", conference->count);
switch_event_fire(&event);
}
}
@@ -686,7 +699,9 @@
int has_file_data = 0;
if (conference->perpetual_sound && !conference->fnode) {
- conference_play_file(conference, conference->perpetual_sound, CONF_DEFAULT_LEADIN, NULL, 0);
+ conference_play_file(conference, conference->perpetual_sound, CONF_DEFAULT_LEADIN, NULL, 1);
+ } else if (conference->moh_sound && conference->count == 1 && !conference->fnode) {
+ conference_play_file(conference, conference->moh_sound, CONF_DEFAULT_LEADIN, NULL, 1);
}
/* Sync the conference to a single timing source */
@@ -1935,6 +1950,11 @@
conference->async_fnode->done++;
count++;
}
+ } else if (stop == FILE_STOP_ASYNC) {
+ if (conference->async_fnode) {
+ conference->async_fnode->done++;
+ count++;
+ }
} else {
if (conference->fnode) {
conference->fnode->done++;
@@ -3546,7 +3566,7 @@
return SWITCH_STATUS_FALSE;
}
-static const switch_state_handler_table_t audio_bridge_peer_state_handlers = {
+static switch_state_handler_table_t audio_bridge_peer_state_handlers = {
/*.on_init */ NULL,
/*.on_ring */ audio_bridge_on_ring,
/*.on_execute */ NULL,
@@ -4318,7 +4338,7 @@
switch_thread_create(&thread, thd_attr, conference_record_thread_run, rec, rec->pool);
}
-static const switch_application_interface_t conference_autocall_application_interface = {
+static switch_application_interface_t conference_autocall_application_interface = {
/*.interface_name */ "conference_set_auto_outcall",
/*.application_function */ conference_auto_function,
NULL, NULL, NULL,
@@ -4326,7 +4346,7 @@
/*.next */
};
-static const switch_application_interface_t conference_application_interface = {
+static switch_application_interface_t conference_application_interface = {
/*.interface_name */ global_app_name,
/*.application_function */ conference_function,
NULL, NULL, NULL,
@@ -4411,7 +4431,7 @@
return SWITCH_STATUS_SUCCESS;
}
-static const switch_chat_interface_t conference_chat_interface = {
+static switch_chat_interface_t conference_chat_interface = {
/*.name */ CONF_CHAT_PROTO,
/*.chat_send */ chat_send,
@@ -4543,6 +4563,7 @@
char *caller_controls = NULL;
char *member_flags = NULL;
char *perpetual_sound = NULL;
+ char *moh_sound = NULL;
uint32_t max_members = 0;
uint32_t anounce_count = 0;
char *maxmember_sound = NULL;
@@ -4592,6 +4613,8 @@
alone_sound = val;
} else if (!strcasecmp(var, "perpetual-sound")) {
perpetual_sound = val;
+ } else if (!strcasecmp(var, "moh-sound")) {
+ moh_sound = val;
} else if (!strcasecmp(var, "ack-sound")) {
ack_sound = val;
} else if (!strcasecmp(var, "nack-sound")) {
@@ -4713,6 +4736,10 @@
conference->mflags = MFLAG_CAN_SPEAK | MFLAG_CAN_HEAR;
}
+ if (!switch_strlen_zero(moh_sound)) {
+ conference->moh_sound = switch_core_strdup(conference->pool, moh_sound);
+ }
+
if (member_flags) {
set_mflags(member_flags, &conference->mflags);
}
@@ -4909,7 +4936,7 @@
}
/* Called by FreeSWITCH when the module loads */
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_conference_load)
{
uint32_t i;
size_t nl, ol = 0;
@@ -4974,7 +5001,7 @@
return status;
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_conference_shutdown)
{
if (globals.running) {
Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_dptools/mod_dptools.c (original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_dptools/mod_dptools.c Thu Jun 14 12:39:04 2007
@@ -34,10 +34,11 @@
*/
#include <switch.h>
-static const char modname[] = "mod_dptools";
+SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load);
+SWITCH_MODULE_DEFINITION(mod_dptools, mod_dptools_load, NULL, NULL);
-static const switch_application_interface_t detect_speech_application_interface;
-static const switch_application_interface_t exe_application_interface;
+static switch_application_interface_t detect_speech_application_interface;
+static switch_application_interface_t exe_application_interface;
static void detect_speech_function(switch_core_session_t *session, char *data)
{
@@ -673,8 +674,276 @@
switch_ivr_stop_fax_detect_session(session);
}
+static void echo_function(switch_core_session_t *session, char *data)
+{
+ switch_channel_t *channel;
+
+ channel = switch_core_session_get_channel(session);
+ assert(channel != NULL);
+
+ switch_channel_answer(channel);
+
+ switch_channel_set_state(channel, CS_LOOPBACK);
+}
+
+static void park_function(switch_core_session_t *session, char *data)
+{
+ switch_ivr_park(session, NULL);
+
+}
+
+/********************************************************************************/
+/* Playback/Record Functions */
+/********************************************************************************/
+
+/*
+ dtmf handler function you can hook up to be executed when a digit is dialed during playback
+ if you return anything but SWITCH_STATUS_SUCCESS the playback will stop.
+*/
+static switch_status_t on_dtmf(switch_core_session_t *session, void *input, switch_input_type_t itype, void *buf, unsigned int buflen)
+{
+
+
+ switch (itype) {
+ case SWITCH_INPUT_TYPE_DTMF:{
+ char *dtmf = (char *) input;
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Digits %s\n", dtmf);
+
+ if (*dtmf == '*') {
+ return SWITCH_STATUS_BREAK;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
+
+static void speak_function(switch_core_session_t *session, char *data)
+{
+ switch_channel_t *channel;
+ char buf[10];
+ char *argv[4] = { 0 };
+ int argc;
+ char *engine = NULL;
+ char *voice = NULL;
+ char *text = NULL;
+ char *mydata = NULL;
+ switch_codec_t *codec;
+ switch_input_args_t args = { 0 };
+
+ codec = switch_core_session_get_read_codec(session);
+ assert(codec != NULL);
+
+ channel = switch_core_session_get_channel(session);
+ assert(channel != NULL);
+
+ mydata = switch_core_session_strdup(session, data);
+ argc = switch_separate_string(mydata, '|', argv, sizeof(argv) / sizeof(argv[0]));
+
+ engine = argv[0];
+ voice = argv[1];
+ text = argv[2];
+
+ if (!(engine && voice && text)) {
+ if (!engine) {
+ engine = "NULL";
+ }
+ if (!voice) {
+ voice = "NULL";
+ }
+ if (!text) {
+ text = "NULL";
+ }
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Params! [%s][%s][%s]\n", engine, voice, text);
+ switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+ }
+
+ switch_channel_pre_answer(channel);
+
+ args.input_callback = on_dtmf;
+ args.buf = buf;
+ args.buflen = sizeof(buf);
+ switch_ivr_speak_text(session, engine, voice, codec->implementation->samples_per_second, text, &args);
+
+}
+
+static void playback_function(switch_core_session_t *session, char *data)
+{
+ switch_channel_t *channel;
+ char *file_name = NULL;
+ switch_input_args_t args = { 0 };
+
+ file_name = switch_core_session_strdup(session, data);
+
+ channel = switch_core_session_get_channel(session);
+ assert(channel != NULL);
+
+ switch_channel_pre_answer(channel);
+
+ args.input_callback = on_dtmf;
+ switch_ivr_play_file(session, NULL, file_name, &args);
+
+}
+
+
+static void record_function(switch_core_session_t *session, char *data)
+{
+ switch_channel_t *channel;
+ switch_status_t status;
+ uint32_t limit = 0;
+ char *path;
+ char *p;
+ switch_input_args_t args = { 0 };
+
+ channel = switch_core_session_get_channel(session);
+ assert(channel != NULL);
+
+ path = switch_core_session_strdup(session, data);
+ if ((p = strchr(path, '+'))) {
+ char *q = p - 1;
+ while(q && *q == ' ') {
+ *q = '\0';
+ q--;
+ }
+ *p++ = '\0';
+ limit = atoi(p);
+ }
+
+ args.input_callback = on_dtmf;
+ status = switch_ivr_record_file(session, NULL, path, &args, limit);
+
+ if (!switch_channel_ready(channel) || (status != SWITCH_STATUS_SUCCESS && !SWITCH_STATUS_IS_BREAK(status))) {
+ switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+ }
+}
+
+
+static void record_session_function(switch_core_session_t *session, char *data)
+{
+ switch_channel_t *channel;
+ char *p, *path = NULL;
+ uint32_t limit = 0;
-static const switch_api_interface_t strepoch_api_interface = {
+ channel = switch_core_session_get_channel(session);
+ assert(channel != NULL);
+
+ path = switch_core_session_strdup(session, data);
+ if ((p = strchr(path, '+'))) {
+ char *q = p - 1;
+ while(q && *q == ' ') {
+ *q = '\0';
+ q--;
+ }
+ *p++ = '\0';
+ limit = atoi(p);
+ }
+
+ switch_ivr_record_session(session, path, limit, NULL);
+}
+
+
+static void stop_record_session_function(switch_core_session_t *session, char *data)
+{
+ switch_channel_t *channel;
+ channel = switch_core_session_get_channel(session);
+ assert(channel != NULL);
+
+ switch_ivr_stop_record_session(session, data);
+}
+
+/********************************************************************************/
+/* Bridge Functions */
+/********************************************************************************/
+
+static void audio_bridge_function(switch_core_session_t *session, char *data)
+{
+ switch_channel_t *caller_channel;
+ switch_core_session_t *peer_session = NULL;
+ unsigned int timelimit = 60;
+ char *var;
+ uint8_t no_media_bridge = 0;
+ switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
+ uint8_t do_continue = 0;
+
+ if (switch_strlen_zero(data)) {
+ return;
+ }
+
+ caller_channel = switch_core_session_get_channel(session);
+ assert(caller_channel != NULL);
+
+ if ((var = switch_channel_get_variable(caller_channel, "call_timeout"))) {
+ timelimit = atoi(var);
+ }
+
+ if ((var = switch_channel_get_variable(caller_channel, "continue_on_fail"))) {
+ do_continue = switch_true(var);
+ }
+
+ if (switch_channel_test_flag(caller_channel, CF_BYPASS_MEDIA)
+ || ((var = switch_channel_get_variable(caller_channel, SWITCH_BYPASS_MEDIA_VARIABLE)) && switch_true(var))) {
+ if (!switch_channel_test_flag(caller_channel, CF_ANSWERED)
+ && !switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA)) {
+ switch_channel_set_flag(caller_channel, CF_BYPASS_MEDIA);
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel is already up, delaying point-to-point mode 'till both legs are up.\n");
+ no_media_bridge = 1;
+ }
+ }
+
+ if (switch_ivr_originate(session, &peer_session, &cause, data, timelimit, NULL, NULL, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Originate Failed. Cause: %s\n", switch_channel_cause2str(cause));
+ if (!do_continue && cause != SWITCH_CAUSE_NO_ANSWER) {
+ /* All Causes besides NO_ANSWER terminate the originating session unless continue_on_fail is set.
+ We will pass the fail cause on when we hangup. */
+ switch_channel_hangup(caller_channel, cause);
+ }
+ /* Otherwise.. nobody answered. Go back to the dialplan instructions in case there was more to do. */
+ return;
+ } else {
+ if (no_media_bridge) {
+ switch_channel_t *peer_channel = switch_core_session_get_channel(peer_session);
+ switch_frame_t *read_frame;
+ /* SIP won't let us redir media until the call has been answered #$^#%& so we will proxy any early media until they do */
+ while (switch_channel_ready(caller_channel) && switch_channel_ready(peer_channel)
+ && !switch_channel_test_flag(peer_channel, CF_ANSWERED)) {
+ switch_status_t status = switch_core_session_read_frame(peer_session, &read_frame, -1, 0);
+ uint8_t bad = 1;
+
+ if (SWITCH_READ_ACCEPTABLE(status)
+ && switch_core_session_write_frame(session, read_frame, -1, 0) == SWITCH_STATUS_SUCCESS) {
+ bad = 0;
+ }
+ if (bad) {
+ switch_channel_hangup(caller_channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+ switch_channel_hangup(peer_channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+ goto end;
+ }
+ }
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Redirecting media to point-to-point mode.\n");
+ switch_ivr_nomedia(switch_core_session_get_uuid(session), SMF_FORCE);
+ switch_ivr_nomedia(switch_core_session_get_uuid(peer_session), SMF_FORCE);
+ switch_ivr_signal_bridge(session, peer_session);
+ } else {
+ if (switch_channel_test_flag(caller_channel, CF_BYPASS_MEDIA)) {
+ switch_ivr_signal_bridge(session, peer_session);
+ } else {
+ switch_ivr_multi_threaded_bridge(session, peer_session, NULL, NULL, NULL);
+ }
+ }
+ end:
+ if (peer_session) {
+ switch_core_session_rwunlock(peer_session);
+ }
+ }
+}
+
+static switch_api_interface_t strepoch_api_interface = {
/*.interface_name */ "strepoch",
/*.desc */ "Convert a date string into epoch time",
/*.function */ strepoch_api_function,
@@ -682,7 +951,7 @@
/*.next */ NULL
};
-static const switch_api_interface_t chat_api_interface = {
+static switch_api_interface_t chat_api_interface = {
/*.interface_name */ "chat",
/*.desc */ "chat",
/*.function */ chat_api_function,
@@ -690,7 +959,7 @@
/*.next */ &strepoch_api_interface
};
-static const switch_api_interface_t dptools_api_interface = {
+static switch_api_interface_t dptools_api_interface = {
/*.interface_name */ "strftime",
/*.desc */ "strftime",
/*.function */ strftime_api_function,
@@ -698,7 +967,7 @@
/*.next */ &chat_api_interface
};
-static const switch_api_interface_t presence_api_interface = {
+static switch_api_interface_t presence_api_interface = {
/*.interface_name */ "presence",
/*.desc */ "presence",
/*.function */ presence_api_function,
@@ -707,17 +976,97 @@
};
-static const switch_application_interface_t fax_detect_application_interface = {
+static switch_application_interface_t bridge_application_interface = {
+ /*.interface_name */ "bridge",
+ /*.application_function */ audio_bridge_function,
+ /* long_desc */ "Bridge the audio between two sessions",
+ /* short_desc */ "Bridge Audio",
+ /* syntax */ "<channel_url>",
+ /* flags */ SAF_SUPPORT_NOMEDIA
+};
+
+static switch_application_interface_t speak_application_interface = {
+ /*.interface_name */ "speak",
+ /*.application_function */ speak_function,
+ /* long_desc */ "Speak text to a channel via the tts interface",
+ /* short_desc */ "Speak text",
+ /* syntax */ "<engine>|<voice>|<text>",
+ /* flags */ SAF_NONE,
+ &bridge_application_interface
+};
+
+static switch_application_interface_t record_application_interface = {
+ /*.interface_name */ "record",
+ /*.application_function */ record_function,
+ /* long_desc */ "Record a file from the channels input",
+ /* short_desc */ "Record File",
+ /* syntax */ "<path> [+time_limit_ms]",
+ /* flags */ SAF_NONE,
+ &speak_application_interface
+};
+
+
+static switch_application_interface_t record_session_application_interface = {
+ /*.interface_name */ "record_session",
+ /*.application_function */ record_session_function,
+ /* long_desc */ "Starts a background recording of the entire session",
+ /* short_desc */ "Record Session",
+ /* syntax */ "<path>",
+ /* flags */ SAF_NONE,
+ &record_application_interface
+};
+
+
+static switch_application_interface_t stop_record_session_application_interface = {
+ /*.interface_name */ "stop_record_session",
+ /*.application_function */ stop_record_session_function,
+ /* long_desc */ "Stops a background recording of the entire session",
+ /* short_desc */ "Stop Record Session",
+ /* syntax */ "<path>",
+ /* flags */ SAF_NONE,
+ &record_session_application_interface
+};
+
+static switch_application_interface_t playback_application_interface = {
+ /*.interface_name */ "playback",
+ /*.application_function */ playback_function,
+ /* long_desc */ "Playback a file to the channel",
+ /* short_desc */ "Playback File",
+ /* syntax */ "<path>",
+ /* flags */ SAF_NONE,
+ /*.next */ &stop_record_session_application_interface
+};
+static switch_application_interface_t park_application_interface = {
+ /*.interface_name */ "park",
+ /*.application_function */ park_function,
+ /* long_desc */ NULL,
+ /* short_desc */ NULL,
+ /* syntax */ NULL,
+ /* flags */ SAF_NONE,
+ /*.next */ &playback_application_interface
+};
+
+static switch_application_interface_t echo_application_interface = {
+ /*.interface_name */ "echo",
+ /*.application_function */ echo_function,
+ /* long_desc */ "Perform an echo test against the calling channel",
+ /* short_desc */ "Echo",
+ /* syntax */ "",
+ /* flags */ SAF_NONE,
+ /*.next */ &park_application_interface
+};
+
+static switch_application_interface_t fax_detect_application_interface = {
/*.interface_name */ "fax_detect",
/*.application_function */ fax_detect_session_function,
/* long_desc */ "Detect fax send tone",
/* short_desc */ "Detect faxes",
/* syntax */ "",
/* flags */ SAF_NONE,
- /*.next */ NULL
+ /*.next */ &echo_application_interface
};
-static const switch_application_interface_t stop_fax_detect_application_interface = {
+static switch_application_interface_t stop_fax_detect_application_interface = {
/*.interface_name */ "stop_fax_detect",
/*.application_function */ stop_fax_detect_session_function,
/* long_desc */ "Stop detecting fax send tones",
@@ -727,7 +1076,7 @@
/* next */ &fax_detect_application_interface
};
-static const switch_application_interface_t dtmf_application_interface = {
+static switch_application_interface_t dtmf_application_interface = {
/*.interface_name */ "start_dtmf",
/*.application_function */ dtm_session_function,
/* long_desc */ "Detect inband dtmf on the session",
@@ -737,7 +1086,7 @@
/* next */ &stop_fax_detect_application_interface
};
-static const switch_application_interface_t stop_dtmf_application_interface = {
+static switch_application_interface_t stop_dtmf_application_interface = {
/*.interface_name */ "stop_dtmf",
/*.application_function */ stop_dtmf_session_function,
/* long_desc */ "Stop detecting inband dtmf.",
@@ -747,7 +1096,7 @@
&dtmf_application_interface
};
-static const switch_application_interface_t exe_application_interface = {
+static switch_application_interface_t exe_application_interface = {
/*.interface_name */ "execute_extension",
/*.application_function */ exe_function,
/*.long_desc */ "Execute an extension",
@@ -757,7 +1106,7 @@
/*.next */ &stop_dtmf_application_interface
};
-static const switch_application_interface_t sched_transfer_application_interface = {
+static switch_application_interface_t sched_transfer_application_interface = {
/*.interface_name */ "sched_transfer",
/*.application_function */ sched_transfer_function,
/*.long_desc */ "Schedule a transfer in the future",
@@ -767,7 +1116,7 @@
/*.next */ &exe_application_interface
};
-static const switch_application_interface_t sched_broadcast_application_interface = {
+static switch_application_interface_t sched_broadcast_application_interface = {
/*.interface_name */ "sched_broadcast",
/*.application_function */ sched_broadcast_function,
/*.long_desc */ "Schedule a broadcast in the future",
@@ -777,7 +1126,7 @@
/*.next */ &sched_transfer_application_interface
};
-static const switch_application_interface_t sched_hangup_application_interface = {
+static switch_application_interface_t sched_hangup_application_interface = {
/*.interface_name */ "sched_hangup",
/*.application_function */ sched_hangup_function,
/*.long_desc */ "Schedule a hangup in the future",
@@ -788,7 +1137,7 @@
};
-static const switch_application_interface_t queuedtmf_application_interface = {
+static switch_application_interface_t queuedtmf_application_interface = {
/*.interface_name */ "queue_dtmf",
/*.application_function */ queue_dtmf_function,
/* long_desc */ "Queue dtmf to be sent from a session",
@@ -798,7 +1147,7 @@
/*.next */ &sched_hangup_application_interface
};
-static const switch_application_interface_t reject_application_interface = {
+static switch_application_interface_t reject_application_interface = {
/*.interface_name */ "reject",
/*.application_function */ reject_function,
/* long_desc */ "Send a reject message to a session.",
@@ -808,7 +1157,7 @@
/*.next */ &queuedtmf_application_interface
};
-static const switch_application_interface_t redirect_application_interface = {
+static switch_application_interface_t redirect_application_interface = {
/*.interface_name */ "redirect",
/*.application_function */ redirect_function,
/* long_desc */ "Send a redirect message to a session.",
@@ -818,7 +1167,7 @@
/*.next */ &reject_application_interface
};
-static const switch_application_interface_t ivr_application_interface = {
+static switch_application_interface_t ivr_application_interface = {
/*.interface_name */ "ivr",
/*.application_function */ ivr_application_function,
/* long_desc */ "Run an ivr menu.",
@@ -828,7 +1177,7 @@
/*.next */ &redirect_application_interface
};
-static const switch_application_interface_t detect_speech_application_interface = {
+static switch_application_interface_t detect_speech_application_interface = {
/*.interface_name */ "detect_speech",
/*.application_function */ detect_speech_function,
/* long_desc */ "Detect speech on a channel.",
@@ -838,7 +1187,7 @@
/*.next */ &ivr_application_interface
};
-static const switch_application_interface_t ring_ready_application_interface = {
+static switch_application_interface_t ring_ready_application_interface = {
/*.interface_name */ "ring_ready",
/*.application_function */ ring_ready_function,
/* long_desc */ "Indicate Ring_Ready on a channel.",
@@ -848,7 +1197,7 @@
/*.next */ &detect_speech_application_interface
};
-static const switch_application_interface_t unset_application_interface = {
+static switch_application_interface_t unset_application_interface = {
/*.interface_name */ "unset",
/*.application_function */ unset_function,
/* long_desc */ "Unset a channel varaible for the channel calling the application.",
@@ -858,7 +1207,7 @@
/*.next */ &ring_ready_application_interface
};
-static const switch_application_interface_t set_application_interface = {
+static switch_application_interface_t set_application_interface = {
/*.interface_name */ "set",
/*.application_function */ set_function,
/* long_desc */ "Set a channel varaible for the channel calling the application.",
@@ -868,7 +1217,7 @@
/*.next */ &unset_application_interface
};
-static const switch_application_interface_t export_application_interface = {
+static switch_application_interface_t export_application_interface = {
/*.interface_name */ "export",
/*.application_function */ export_function,
/* long_desc */ "Set and export a channel varaible for the channel calling the application.",
@@ -878,7 +1227,7 @@
/*.next */ &set_application_interface
};
-static const switch_application_interface_t info_application_interface = {
+static switch_application_interface_t info_application_interface = {
/*.interface_name */ "info",
/*.application_function */ info_function,
/* long_desc */ "Display Call Info",
@@ -888,7 +1237,7 @@
/*.next */ &export_application_interface
};
-static const switch_application_interface_t log_application_interface = {
+static switch_application_interface_t log_application_interface = {
/*.interface_name */ "log",
/*.application_function */ log_function,
/* long_desc */ "Logs a channel varaible for the channel calling the application.",
@@ -899,7 +1248,7 @@
};
-static const switch_application_interface_t hangup_application_interface = {
+static switch_application_interface_t hangup_application_interface = {
/*.interface_name */ "hangup",
/*.application_function */ hangup_function,
/* long_desc */ "Hangup the call for a channel.",
@@ -909,7 +1258,7 @@
/*.next */ &log_application_interface
};
-static const switch_application_interface_t answer_application_interface = {
+static switch_application_interface_t answer_application_interface = {
/*.interface_name */ "answer",
/*.application_function */ answer_function,
/* long_desc */ "Answer the call for a channel.",
@@ -919,7 +1268,7 @@
/*.next */ &hangup_application_interface
};
-static const switch_application_interface_t pre_answer_application_interface = {
+static switch_application_interface_t pre_answer_application_interface = {
/*.interface_name */ "pre_answer",
/*.application_function */ pre_answer_function,
/* long_desc */ "Pre-Answer the call for a channel.",
@@ -929,7 +1278,7 @@
/*.next */ &answer_application_interface
};
-static const switch_application_interface_t eval_application_interface = {
+static switch_application_interface_t eval_application_interface = {
/*.interface_name */ "eval",
/*.application_function */ eval_function,
/* long_desc */ "Do Nothing",
@@ -939,7 +1288,7 @@
/*.next */ &pre_answer_application_interface
};
-static const switch_application_interface_t phrase_application_interface = {
+static switch_application_interface_t phrase_application_interface = {
/*.interface_name */ "phrase",
/*.application_function */ phrase_function,
/* long_desc */ "Say a Phrase",
@@ -949,7 +1298,7 @@
/*.next */ &eval_application_interface
};
-static const switch_application_interface_t strftime_application_interface = {
+static switch_application_interface_t strftime_application_interface = {
/*.interface_name */ "strftime",
/*.application_function */ strftime_function,
/* long_desc */ NULL,
@@ -959,7 +1308,7 @@
/*.next */ &phrase_application_interface
};
-static const switch_application_interface_t sleep_application_interface = {
+static switch_application_interface_t sleep_application_interface = {
/*.interface_name */ "sleep",
/*.application_function */ sleep_function,
/* long_desc */
@@ -970,7 +1319,7 @@
/* next */ &strftime_application_interface
};
-static const switch_application_interface_t transfer_application_interface = {
+static switch_application_interface_t transfer_application_interface = {
/*.interface_name */ "transfer",
/*.application_function */ transfer_function,
/* long_desc */ "Immediatly transfer the calling channel to a new extension",
@@ -980,7 +1329,7 @@
/* next */ &sleep_application_interface
};
-static const switch_application_interface_t privacy_application_interface = {
+static switch_application_interface_t privacy_application_interface = {
/*.interface_name */ "privacy",
/*.application_function */ privacy_function,
/* long_desc */ "Set caller privacy on calls.",
@@ -990,7 +1339,7 @@
/*.next */ &transfer_application_interface
};
-static const switch_loadable_module_interface_t mod_dptools_module_interface = {
+static switch_loadable_module_interface_t dptools_module_interface = {
/*.module_name = */ modname,
/*.endpoint_interface = */ NULL,
/*.timer_interface = */ NULL,
@@ -1000,23 +1349,17 @@
/*.api_interface */ &presence_api_interface
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
{
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &mod_dptools_module_interface;
+ *module_interface = &dptools_module_interface;
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
}
-/* 'switch_module_runtime' will start up in a thread by itself just by having it exist
-if it returns anything but SWITCH_STATUS_TERM it will be called again automaticly
-*/
-
-
-//switch_status_t switch_module_runtime(void)
/* For Emacs:
* Local Variables:
Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_enum/mod_enum.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_enum/mod_enum.c (original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_enum/mod_enum.c Thu Jun 14 12:39:04 2007
@@ -36,7 +36,8 @@
#define closesocket close
#endif
-static const char modname[] = "mod_enum";
+SWITCH_MODULE_LOAD_FUNCTION(mod_enum_load);
+SWITCH_MODULE_DEFINITION(mod_enum, mod_enum_load, NULL, NULL);
struct enum_record {
int order;
@@ -684,13 +685,13 @@
}
-static const switch_dialplan_interface_t enum_dialplan_interface = {
+static switch_dialplan_interface_t enum_dialplan_interface = {
/*.interface_name = */ "enum",
/*.hunt_function = */ enum_dialplan_hunt
/*.next = NULL */
};
-static const switch_application_interface_t enum_application_interface = {
+static switch_application_interface_t enum_application_interface = {
/*.interface_name */ "enum",
/*.application_function */ enum_app_function,
/* long_desc */ "Perform an ENUM lookup",
@@ -721,7 +722,7 @@
/*.directory_interface */ NULL
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_enum_load)
{
if (dns_init(0) < 0) {
Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_esf/mod_esf.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_esf/mod_esf.c (original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_esf/mod_esf.c Thu Jun 14 12:39:04 2007
@@ -31,7 +31,8 @@
*/
#include <switch.h>
-static const char modname[] = "mod_esf";
+SWITCH_MODULE_LOAD_FUNCTION(mod_esf_load);
+SWITCH_MODULE_DEFINITION(mod_esf, mod_esf_load, NULL, NULL);
struct ls_control_packet {
uint32_t unique_id;
@@ -227,7 +228,7 @@
}
-static const switch_application_interface_t bcast_application_interface = {
+static switch_application_interface_t bcast_application_interface = {
/*.interface_name */ "esf_ls_page_group",
/*.application_function */ bcast_function,
NULL, NULL, NULL,
@@ -235,7 +236,7 @@
/*.next */ NULL
};
-static const switch_loadable_module_interface_t mod_ivrtest_module_interface = {
+static switch_loadable_module_interface_t mod_ivrtest_module_interface = {
/*.module_name = */ modname,
/*.endpoint_interface = */ NULL,
/*.timer_interface = */ NULL,
@@ -244,7 +245,7 @@
/*.application_interface */ &bcast_application_interface
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_esf_load)
{
/* connect my internal structure to the blank pointer passed to me */
Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_ivrtest/mod_ivrtest.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_ivrtest/mod_ivrtest.c (original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_ivrtest/mod_ivrtest.c Thu Jun 14 12:39:04 2007
@@ -31,9 +31,8 @@
*/
#include <switch.h>
-
-static const char modname[] = "mod_ivrtest";
-
+SWITCH_MODULE_LOAD_FUNCTION(mod_ivrtest_load);
+SWITCH_MODULE_DEFINITION(mod_ivrtest, mod_ivrtest_load, NULL, NULL);
/*
dtmf handler function you can hook up to be executed when a digit is dialed during playback
@@ -424,7 +423,7 @@
}
-static const switch_state_handler_table_t state_handlers = {
+static switch_state_handler_table_t state_handlers = {
/*.on_init */ NULL,
/*.on_ring */ NULL,
/*.on_execute */ NULL,
@@ -435,7 +434,7 @@
-static const switch_application_interface_t bug_application_interface = {
+static switch_application_interface_t bug_application_interface = {
/*.interface_name */ "bugtest",
/*.application_function */ bugtest_function,
NULL, NULL, NULL,
@@ -443,7 +442,7 @@
/*.next */ NULL
};
-static const switch_application_interface_t ivr_application_interface = {
+static switch_application_interface_t ivr_application_interface = {
/*.interface_name */ "ivrmenu",
/*.application_function */ ivr_application_function,
NULL, NULL, NULL,
@@ -451,7 +450,7 @@
/*.next */ &bug_application_interface
};
-static const switch_application_interface_t xml_application_interface = {
+static switch_application_interface_t xml_application_interface = {
/*.interface_name */ "xml",
/*.application_function */ xml_function,
NULL, NULL, NULL,
@@ -459,7 +458,7 @@
/*.next */ &ivr_application_interface
};
-static const switch_application_interface_t disast_application_interface = {
+static switch_application_interface_t disast_application_interface = {
/*.interface_name */ "disast",
/*.application_function */ disast_function,
NULL, NULL, NULL,
@@ -467,7 +466,7 @@
/*.next */ &xml_application_interface
};
-static const switch_application_interface_t tts_application_interface = {
+static switch_application_interface_t tts_application_interface = {
/*.interface_name */ "tts",
/*.application_function */ tts_function,
NULL, NULL, NULL,
@@ -475,7 +474,7 @@
/*.next */ &disast_application_interface
};
-static const switch_application_interface_t dirtest_application_interface = {
+static switch_application_interface_t dirtest_application_interface = {
/*.interface_name */ "dirtest",
/*.application_function */ dirtest_function,
NULL, NULL, NULL,
@@ -483,7 +482,7 @@
/*.next */ &tts_application_interface
};
-static const switch_application_interface_t ivrtest_application_interface = {
+static switch_application_interface_t ivrtest_application_interface = {
/*.interface_name */ "ivrtest",
/*.application_function */ ivrtest_function,
NULL, NULL, NULL,
@@ -491,7 +490,7 @@
/*.next */ &dirtest_application_interface
};
-static const switch_application_interface_t asrtest_application_interface = {
+static switch_application_interface_t asrtest_application_interface = {
/*.interface_name */ "asrtest",
/*.application_function */ asrtest_function,
NULL, NULL, NULL,
@@ -499,7 +498,7 @@
/*.next */ &ivrtest_application_interface
};
-static const switch_loadable_module_interface_t mod_ivrtest_module_interface = {
+static switch_loadable_module_interface_t ivrtest_module_interface = {
/*.module_name = */ modname,
/*.endpoint_interface = */ NULL,
/*.timer_interface = */ NULL,
@@ -508,11 +507,11 @@
/*.application_interface */ &asrtest_application_interface
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_ivrtest_load)
{
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &mod_ivrtest_module_interface;
+ *module_interface = &ivrtest_module_interface;
/* test global state handlers */
switch_core_add_state_handler(&state_handlers);
@@ -521,12 +520,6 @@
return SWITCH_STATUS_SUCCESS;
}
-/* 'switch_module_runtime' will start up in a thread by itself just by having it exist
- if it returns anything but SWITCH_STATUS_TERM it will be called again automaticly
-*/
-
-
-//switch_status_t switch_module_runtime(void)
/* For Emacs:
* Local Variables:
Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_rss/mod_rss.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_rss/mod_rss.c (original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_rss/mod_rss.c Thu Jun 14 12:39:04 2007
@@ -31,7 +31,8 @@
*/
#include <switch.h>
-static const char modname[] = "mod_rss";
+SWITCH_MODULE_LOAD_FUNCTION(mod_rss_load);
+SWITCH_MODULE_DEFINITION(mod_rss, mod_rss_load, NULL, NULL);
typedef enum {
SFLAG_INSTRUCT = (1 << 0),
@@ -612,7 +613,7 @@
switch_core_session_reset(session);
}
-static const switch_application_interface_t rss_application_interface = {
+static switch_application_interface_t rss_application_interface = {
/*.interface_name */ "rss",
/*.application_function */ rss_function,
NULL, NULL, NULL,
@@ -635,7 +636,7 @@
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_rss_load)
{
/* connect my internal structure to the blank pointer passed to me */
*module_interface = &rss_module_interface;
Modified: freeswitch/branches/greenlizard/src/mod/applications/mod_skel/mod_skel.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/applications/mod_skel/mod_skel.c (original)
+++ freeswitch/branches/greenlizard/src/mod/applications/mod_skel/mod_skel.c Thu Jun 14 12:39:04 2007
@@ -32,7 +32,11 @@
*/
#include <switch.h>
-static const char modname[] = "mod_skel";
+//SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skel_shutdown);
+//SWITCH_MODULE_RUNTIME_FUNCTION(mod_skel_runtime);
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_skel_load);
+SWITCH_MODULE_DEFINITION(mod_skel, mod_skel_load, NULL, NULL);
static switch_loadable_module_interface_t skel_module_interface = {
/*.module_name */ modname,
@@ -47,7 +51,7 @@
/*.directory_interface */ NULL
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_skel_load)
{
/* connect my internal structure to the blank pointer passed to me */
*module_interface = &skel_module_interface;
@@ -60,7 +64,7 @@
/*
Called when the system shuts down
-SWITCH_MOD_DECLARE(switch_status) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skel_shutdown);
{
return SWITCH_STATUS_SUCCESS;
}
@@ -69,7 +73,7 @@
/*
If it exists, this is called in it's own thread when the module-load completes
If it returns anything but SWITCH_STATUS_TERM it will be called again automaticly
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_skel_runtime);
{
while(looping)
{
Modified: freeswitch/branches/greenlizard/src/mod/asr_tts/mod_cepstral/mod_cepstral.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/asr_tts/mod_cepstral/mod_cepstral.c (original)
+++ freeswitch/branches/greenlizard/src/mod/asr_tts/mod_cepstral/mod_cepstral.c Thu Jun 14 12:39:04 2007
@@ -51,7 +51,8 @@
#undef SWIFT_FAILED
#define SWIFT_FAILED(r) ((void *)(r) < (void *)0)
-static const char modname[] = "mod_cepstral";
+SWITCH_MODULE_LOAD_FUNCTION(mod_cepstral_load);
+SWITCH_MODULE_DEFINITION(mod_cepstral, mod_cepstral_load, NULL, NULL);
static swift_engine *engine;
@@ -401,7 +402,7 @@
}
-static const switch_speech_interface_t cepstral_speech_interface = {
+static switch_speech_interface_t cepstral_speech_interface = {
/*.interface_name */ "cepstral",
/*.speech_open */ cepstral_speech_open,
/*.speech_close */ cepstral_speech_close,
@@ -413,7 +414,7 @@
/*.speech_numeric_param_tts */ cepstral_float_param_tts
};
-static const switch_loadable_module_interface_t cepstral_module_interface = {
+static switch_loadable_module_interface_t cepstral_module_interface = {
/*.module_name */ modname,
/*.endpoint_interface */ NULL,
/*.timer_interface */ NULL,
@@ -426,7 +427,7 @@
/*.directory_interface */ NULL
};
-switch_status_t switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_cepstral_load)
{
/* Open the Swift TTS Engine */
Modified: freeswitch/branches/greenlizard/src/mod/asr_tts/mod_lumenvox/mod_lumenvox.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/asr_tts/mod_lumenvox/mod_lumenvox.cpp (original)
+++ freeswitch/branches/greenlizard/src/mod/asr_tts/mod_lumenvox/mod_lumenvox.cpp Thu Jun 14 12:39:04 2007
@@ -38,7 +38,9 @@
#include <switch.h>
#include <sstream>
-static const char modname[] = "mod_lumenvox";
+SWITCH_MODULE_LOAD_FUNCTION(mod_lumenvox_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_lumenvox_shutdown);
+SWITCH_MODULE_DEFINITION(mod_lumenvox, mod_lumenvox_load, mod_lumenvox_shutdown, NULL);
typedef enum {
LVFLAG_HAS_TEXT = (1 << 0),
@@ -441,7 +443,7 @@
/*.asr_interface */ &lumenvox_asr_interface
};
-switch_status_t switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_lumenvox_load)
{
LVSpeechPort::RegisterAppLogMsg(log_callback, NULL, 5);
//LVSpeechPort::SetClientPropertyEx(PROP_EX_SRE_SERVERS, PROP_EX_VALUE_TYPE_STRING, (void *)"127.0.0.1");
@@ -453,7 +455,7 @@
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_lumenvox_shutdown)
{
return SWITCH_STATUS_UNLOAD;
}
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_amr/mod_amr.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_amr/mod_amr.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_amr/mod_amr.c Thu Jun 14 12:39:04 2007
@@ -32,7 +32,9 @@
*
*/
#include "switch.h"
-static const char modname[] = "mod_amr";
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_amr_load);
+SWITCH_MODULE_DEFINITION(mod_amr, mod_amr_load, NULL, NULL);
#ifndef AMR_PASSTHROUGH
#include "amr/interf_enc.h"
@@ -288,7 +290,7 @@
/* Registration */
-static const switch_codec_implementation_t amr_implementation = {
+static switch_codec_implementation_t amr_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 96,
/*.iananame */ "AMR",
@@ -308,7 +310,7 @@
/*.destroy */ switch_amr_destroy,
};
-static const switch_codec_interface_t amr_codec_interface = {
+static switch_codec_interface_t amr_codec_interface = {
/*.interface_name */ "GSM-AMR",
/*.implementations */ &amr_implementation,
};
@@ -322,7 +324,7 @@
/*.application_interface */ NULL
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_amr_load)
{
#ifndef AMR_PASSTHROUGH
char *cf = "amr.conf";
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_g711/mod_g711.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_g711/mod_g711.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_g711/mod_g711.c Thu Jun 14 12:39:04 2007
@@ -32,8 +32,8 @@
#include <switch.h>
#include <g7xx/g711.h>
-
-static const char modname[] = "mod_g711";
+SWITCH_MODULE_LOAD_FUNCTION(mod_g711_load);
+SWITCH_MODULE_DEFINITION(mod_g711, mod_g711_load, NULL, NULL);
static switch_status_t switch_g711u_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings)
@@ -182,7 +182,7 @@
/* Registration */
-static const switch_codec_implementation_t g711u_8k_120ms_implementation = {
+static switch_codec_implementation_t g711u_8k_120ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 0,
/*.iananame */ "PCMU",
@@ -202,7 +202,7 @@
/*.destroy */ switch_g711u_destroy
};
-static const switch_codec_implementation_t g711u_8k_60ms_implementation = {
+static switch_codec_implementation_t g711u_8k_60ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 0,
/*.iananame */ "PCMU",
@@ -223,7 +223,7 @@
/*.next */ &g711u_8k_120ms_implementation
};
-static const switch_codec_implementation_t g711u_8k_30ms_implementation = {
+static switch_codec_implementation_t g711u_8k_30ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 0,
/*.iananame */ "PCMU",
@@ -244,7 +244,7 @@
/*.next */ &g711u_8k_60ms_implementation
};
-static const switch_codec_implementation_t g711u_8k_20ms_implementation = {
+static switch_codec_implementation_t g711u_8k_20ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 0,
/*.iananame */ "PCMU",
@@ -265,7 +265,7 @@
/*.next */ &g711u_8k_30ms_implementation
};
-static const switch_codec_implementation_t g711u_8k_10ms_implementation = {
+static switch_codec_implementation_t g711u_8k_10ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 0,
/*.iananame */ "PCMU",
@@ -288,7 +288,7 @@
-static const switch_codec_implementation_t g711a_8k_120ms_implementation = {
+static switch_codec_implementation_t g711a_8k_120ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 8,
/*.iananame */ "PCMA",
@@ -308,7 +308,7 @@
/*.destroy */ switch_g711a_destroy
};
-static const switch_codec_implementation_t g711a_8k_60ms_implementation = {
+static switch_codec_implementation_t g711a_8k_60ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 8,
/*.iananame */ "PCMA",
@@ -329,7 +329,7 @@
/*.next */ &g711a_8k_120ms_implementation
};
-static const switch_codec_implementation_t g711a_8k_30ms_implementation = {
+static switch_codec_implementation_t g711a_8k_30ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 8,
/*.iananame */ "PCMA",
@@ -350,7 +350,7 @@
/*.next */ &g711a_8k_60ms_implementation
};
-static const switch_codec_implementation_t g711a_8k_20ms_implementation = {
+static switch_codec_implementation_t g711a_8k_20ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 8,
/*.iananame */ "PCMA",
@@ -371,7 +371,7 @@
/*.next */ &g711a_8k_30ms_implementation
};
-static const switch_codec_implementation_t g711a_8k_10ms_implementation = {
+static switch_codec_implementation_t g711a_8k_10ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 8,
/*.iananame */ "PCMA",
@@ -394,12 +394,12 @@
-static const switch_codec_interface_t g711a_codec_interface = {
+static switch_codec_interface_t g711a_codec_interface = {
/*.interface_name */ "g711 alaw",
/*.implementations */ &g711a_8k_10ms_implementation
};
-static const switch_codec_interface_t g711u_codec_interface = {
+static switch_codec_interface_t g711u_codec_interface = {
/*.interface_name */ "g711 ulaw",
/*.implementations */ &g711u_8k_10ms_implementation,
/*.next */ &g711a_codec_interface
@@ -415,7 +415,7 @@
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_g711_load)
{
/* connect my internal structure to the blank pointer passed to me */
*module_interface = &g711_module_interface;
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_g722/mod_g722.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_g722/mod_g722.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_g722/mod_g722.c Thu Jun 14 12:39:04 2007
@@ -33,7 +33,8 @@
#include <switch.h>
#include "g7xx/g722.h"
-static const char modname[] = "mod_g722";
+SWITCH_MODULE_LOAD_FUNCTION(mod_g722_load);
+SWITCH_MODULE_DEFINITION(mod_g722, mod_g722_load, NULL, NULL);
struct g722_context {
g722_decode_state_t decoder_object;
@@ -117,7 +118,7 @@
/* Registration */
-static const switch_codec_implementation_t g722_8k_implementation = {
+static switch_codec_implementation_t g722_8k_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 109,
/*.iananame */ "G722_8",
@@ -137,7 +138,7 @@
/*.destroy */ switch_g722_destroy,
};
-static const switch_codec_implementation_t g722_16k_implementation = {
+static switch_codec_implementation_t g722_16k_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 9,
/*.iananame */ "G722",
@@ -158,7 +159,7 @@
/*.next */ &g722_8k_implementation
};
-static const switch_codec_interface_t g722_codec_interface = {
+static switch_codec_interface_t g722_codec_interface = {
/*.interface_name */ "g722",
/*.implementations */ &g722_16k_implementation
};
@@ -172,7 +173,7 @@
/*.application_interface */ NULL
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_g722_load)
{
/* connect my internal structure to the blank pointer passed to me */
*module_interface = &g722_module_interface;
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_g723_1/mod_g723_1.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_g723_1/mod_g723_1.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_g723_1/mod_g723_1.c Thu Jun 14 12:39:04 2007
@@ -49,7 +49,8 @@
enum Crate WrkRate = Rate63;
#endif
-static const char modname[] = "mod_g723_1";
+SWITCH_MODULE_LOAD_FUNCTION(mod_g723_1_load);
+SWITCH_MODULE_DEFINITION(mod_g723_1, mod_g723_1_load, NULL, NULL);
#ifndef G723_PASSTHROUGH
struct g723_context {
@@ -168,7 +169,7 @@
/* Registration */
-static const switch_codec_implementation_t g723_1_implementation = {
+static switch_codec_implementation_t g723_1_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 4,
/*.iananame */ "G723",
@@ -188,7 +189,7 @@
/*.destroy */ switch_g723_destroy,
};
-static const switch_codec_interface_t g723_1_codec_interface = {
+static switch_codec_interface_t g723_1_codec_interface = {
/*.interface_name */ "g723.1 6.3k",
/*.implementations */ &g723_1_implementation,
};
@@ -202,7 +203,7 @@
/*.application_interface */ NULL
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_g723_1_load)
{
/* connect my internal structure to the blank pointer passed to me */
*module_interface = &g723_module_interface;
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_g726/mod_g726.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_g726/mod_g726.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_g726/mod_g726.c Thu Jun 14 12:39:04 2007
@@ -33,7 +33,8 @@
#include "g72x.h"
#include "switch_bitpack.h"
-static const char modname[] = "mod_g726";
+SWITCH_MODULE_LOAD_FUNCTION(mod_g726_load);
+SWITCH_MODULE_DEFINITION(mod_g726, mod_g726_load, NULL, NULL);
typedef int (*encoder_t) (int, int, g726_state *);
typedef int (*decoder_t) (int, int, g726_state *);
@@ -203,7 +204,7 @@
/* Registration */
-static const switch_codec_implementation_t g726_16k_implementation = {
+static switch_codec_implementation_t g726_16k_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 127,
/*.iananame */ "G726-16",
@@ -224,7 +225,7 @@
};
-static const switch_codec_implementation_t g726_24k_implementation = {
+static switch_codec_implementation_t g726_24k_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 126,
/*.iananame */ "G726-24",
@@ -244,7 +245,7 @@
/*.destroy */ switch_g726_destroy,
};
-static const switch_codec_implementation_t g726_32k_implementation = {
+static switch_codec_implementation_t g726_32k_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 2,
/*.iananame */ "G726-32",
@@ -264,7 +265,7 @@
/*.destroy */ switch_g726_destroy,
};
-static const switch_codec_implementation_t g726_40k_implementation = {
+static switch_codec_implementation_t g726_40k_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 125,
/*.iananame */ "G726-40",
@@ -286,7 +287,7 @@
-static const switch_codec_implementation_t aal2_g726_16k_implementation = {
+static switch_codec_implementation_t aal2_g726_16k_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 124,
/*.iananame */ "AAL2-G726-16",
@@ -307,7 +308,7 @@
};
-static const switch_codec_implementation_t aal2_g726_24k_implementation = {
+static switch_codec_implementation_t aal2_g726_24k_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 123,
/*.iananame */ "AAL2-G726-24",
@@ -327,7 +328,7 @@
/*.destroy */ switch_g726_destroy,
};
-static const switch_codec_implementation_t aal2_g726_32k_implementation = {
+static switch_codec_implementation_t aal2_g726_32k_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 2,
/*.iananame */ "AAL2-G726-32",
@@ -347,7 +348,7 @@
/*.destroy */ switch_g726_destroy,
};
-static const switch_codec_implementation_t aal2_g726_40k_implementation = {
+static switch_codec_implementation_t aal2_g726_40k_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 122,
/*.iananame */ "AAL2-G726-40",
@@ -367,50 +368,48 @@
/*.destroy */ switch_g726_destroy,
};
-const switch_codec_interface_t g726_16k_codec_interface = {
+static switch_codec_interface_t g726_16k_codec_interface = {
/*.interface_name */ "G.726 16k",
/*.implementations */ &g726_16k_implementation,
};
-const switch_codec_interface_t g726_24k_codec_interface = {
+static switch_codec_interface_t g726_24k_codec_interface = {
/*.interface_name */ "G.726 24k",
/*.implementations */ &g726_24k_implementation,
/*.next */ &g726_16k_codec_interface
};
-const switch_codec_interface_t g726_32k_codec_interface = {
+static switch_codec_interface_t g726_32k_codec_interface = {
/*.interface_name */ "G.726 32k",
/*.implementations */ &g726_32k_implementation,
/*.next */ &g726_24k_codec_interface
};
-const switch_codec_interface_t g726_40k_codec_interface = {
+static switch_codec_interface_t g726_40k_codec_interface = {
/*.interface_name */ "G.726 40k",
/*.implementations */ &g726_40k_implementation,
/*.next */ &g726_32k_codec_interface
};
-
-
-const switch_codec_interface_t aal2_g726_16k_codec_interface = {
+static switch_codec_interface_t aal2_g726_16k_codec_interface = {
/*.interface_name */ "G.726 16k (aal2)",
/*.implementations */ &aal2_g726_16k_implementation,
/*.next */ &g726_40k_codec_interface
};
-const switch_codec_interface_t aal2_g726_24k_codec_interface = {
+static switch_codec_interface_t aal2_g726_24k_codec_interface = {
/*.interface_name */ "G.726 24k (aal2)",
/*.implementations */ &aal2_g726_24k_implementation,
/*.next */ &aal2_g726_16k_codec_interface
};
-const switch_codec_interface_t aal2_g726_32k_codec_interface = {
+static switch_codec_interface_t aal2_g726_32k_codec_interface = {
/*.interface_name */ "G.726 32k (aal2)",
/*.implementations */ &aal2_g726_32k_implementation,
/*.next */ &aal2_g726_24k_codec_interface
};
-const switch_codec_interface_t aal2_g726_40k_codec_interface = {
+static switch_codec_interface_t aal2_g726_40k_codec_interface = {
/*.interface_name */ "G.726 40k (aal2)",
/*.implementations */ &aal2_g726_40k_implementation,
/*.next */ &aal2_g726_32k_codec_interface
@@ -427,7 +426,7 @@
/*.application_interface */ NULL
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_g726_load)
{
/* connect my internal structure to the blank pointer passed to me */
*module_interface = &g726_module_interface;
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_g729/mod_g729.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_g729/mod_g729.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_g729/mod_g729.c Thu Jun 14 12:39:04 2007
@@ -31,11 +31,11 @@
* mod_g729.c -- G729 Codec Module
*
*/
-
-static const char modname[] = "mod_g729";
-
#include "switch.h"
+SWITCH_MODULE_LOAD_FUNCTION(mod_g729_load);
+SWITCH_MODULE_DEFINITION(mod_g729, mod_g729_load, NULL, NULL);
+
#ifndef G729_PASSTHROUGH
#include "g729/g729.h"
@@ -212,7 +212,7 @@
/* Registration */
-static const switch_codec_implementation_t g729_40ms_8k_implementation = {
+static switch_codec_implementation_t g729_40ms_8k_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 18,
/*.iananame */ "G729",
@@ -232,7 +232,7 @@
/*.destroy */ switch_g729_destroy,
};
-static const switch_codec_implementation_t g729_30ms_8k_implementation = {
+static switch_codec_implementation_t g729_30ms_8k_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 18,
/*.iananame */ "G729",
@@ -253,7 +253,7 @@
&g729_40ms_8k_implementation
};
-static const switch_codec_implementation_t g729_10ms_8k_implementation = {
+static switch_codec_implementation_t g729_10ms_8k_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 18,
/*.iananame */ "G729",
@@ -274,7 +274,7 @@
&g729_30ms_8k_implementation
};
-static const switch_codec_implementation_t g729_8k_implementation = {
+static switch_codec_implementation_t g729_8k_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 18,
/*.iananame */ "G729",
@@ -295,7 +295,7 @@
&g729_10ms_8k_implementation
};
-static const switch_codec_interface_t g729_codec_interface = {
+static switch_codec_interface_t g729_codec_interface = {
/*.interface_name */ "g729",
/*.implementations */ &g729_8k_implementation,
/*.next */ NULL
@@ -310,7 +310,7 @@
/*.application_interface */ NULL
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_g729_load)
{
/* connect my internal structure to the blank pointer passed to me */
*module_interface = &g729_module_interface;
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_gsm/mod_gsm.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_gsm/mod_gsm.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_gsm/mod_gsm.c Thu Jun 14 12:39:04 2007
@@ -31,7 +31,10 @@
*/
#include "switch.h"
#include "gsm.h"
-static const char modname[] = "mod_gsm";
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_gsm_load);
+SWITCH_MODULE_DEFINITION(mod_gsm, mod_gsm_load, NULL, NULL);
+
struct gsm_context {
gsm encoder;
gsm decoder;
@@ -131,7 +134,7 @@
/* Registration */
-static const switch_codec_implementation_t gsm_8k_implementation = {
+static switch_codec_implementation_t gsm_8k_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 3,
/*.iananame */ "GSM",
@@ -150,7 +153,7 @@
/*.decode */ switch_gsm_decode,
/*.destroy */ switch_gsm_destroy,
};
-static const switch_codec_interface_t gsm_codec_interface = {
+static switch_codec_interface_t gsm_codec_interface = {
/*.interface_name */ "gsm",
/*.implementations */ &gsm_8k_implementation,
};
@@ -162,7 +165,8 @@
/*.codec_interface */ &gsm_codec_interface,
/*.application_interface */ NULL
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_gsm_load)
{
/* connect my internal structure to the blank pointer passed to me */
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_h26x/mod_h26x.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_h26x/mod_h26x.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_h26x/mod_h26x.c Thu Jun 14 12:39:04 2007
@@ -31,8 +31,8 @@
*/
#include <switch.h>
-static const char modname[] = "mod_h26x";
-
+SWITCH_MODULE_LOAD_FUNCTION(mod_h26x_load);
+SWITCH_MODULE_DEFINITION(mod_h26x, mod_h26x_load, NULL, NULL);
static switch_status_t switch_h26x_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings)
{
@@ -75,7 +75,7 @@
return SWITCH_STATUS_SUCCESS;
}
-static const switch_codec_implementation_t h264_90000_implementation = {
+static switch_codec_implementation_t h264_90000_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_VIDEO,
/*.ianacode */ 99,
/*.iananame */ "H264",
@@ -96,7 +96,7 @@
/*.next = */
};
-static const switch_codec_implementation_t h263_90000_implementation = {
+static switch_codec_implementation_t h263_90000_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_VIDEO,
/*.ianacode */ 34,
/*.iananame */ "H263",
@@ -117,7 +117,7 @@
/*.next = */&h264_90000_implementation
};
-static const switch_codec_interface_t h26x_codec_interface = {
+static switch_codec_interface_t h26x_codec_interface = {
/*.interface_name */ "h26x video (passthru)",
/*.implementations */ &h263_90000_implementation
};
@@ -132,8 +132,7 @@
/*.api_interface */ NULL,
};
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_h26x_load)
{
/* connect my internal structure to the blank pointer passed to me */
*module_interface = &h26x_module_interface;
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_ilbc/mod_ilbc.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_ilbc/mod_ilbc.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_ilbc/mod_ilbc.c Thu Jun 14 12:39:04 2007
@@ -34,7 +34,8 @@
#include "iLBC_decode.h"
#include "iLBC_define.h"
-static const char modname[] = "mod_ilbc";
+SWITCH_MODULE_LOAD_FUNCTION(mod_ilbc_load);
+SWITCH_MODULE_DEFINITION(mod_ilbc, mod_ilbc_load, NULL, NULL);
struct ilbc_context {
iLBC_Enc_Inst_t encoder;
@@ -181,7 +182,7 @@
/* Registration */
-static const switch_codec_implementation_t ilbc_8k_30ms_implementation = {
+static switch_codec_implementation_t ilbc_8k_30ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 97,
/*.iananame */ "iLBC",
@@ -201,7 +202,7 @@
/*.destroy */ switch_ilbc_destroy
};
-static const switch_codec_implementation_t ilbc_8k_20ms_implementation = {
+static switch_codec_implementation_t ilbc_8k_20ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 97,
/*.iananame */ "iLBC",
@@ -224,7 +225,7 @@
-static const switch_codec_implementation_t ilbc_102_8k_30ms_implementation = {
+static switch_codec_implementation_t ilbc_102_8k_30ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 102,
/*.iananame */ "iLBC",
@@ -244,7 +245,7 @@
/*.destroy */ switch_ilbc_destroy
};
-static const switch_codec_implementation_t ilbc_102_8k_20ms_implementation = {
+static switch_codec_implementation_t ilbc_102_8k_20ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 102,
/*.iananame */ "iLBC102",
@@ -266,7 +267,7 @@
};
-static const switch_codec_implementation_t ilbc_8k_20ms_nonext_implementation = {
+static switch_codec_implementation_t ilbc_8k_20ms_nonext_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 97,
/*.iananame */ "iLBC20ms",
@@ -287,18 +288,18 @@
};
-static const switch_codec_interface_t ilbc_20ms_codec_interface = {
+static switch_codec_interface_t ilbc_20ms_codec_interface = {
/*.interface_name */ "ilbc",
/*.implementations */ &ilbc_8k_20ms_nonext_implementation
};
-static const switch_codec_interface_t ilbc_102_codec_interface = {
+static switch_codec_interface_t ilbc_102_codec_interface = {
/*.interface_name */ "ilbc",
/*.implementations */ &ilbc_102_8k_20ms_implementation,
/*.next */ &ilbc_20ms_codec_interface
};
-static const switch_codec_interface_t ilbc_codec_interface = {
+static switch_codec_interface_t ilbc_codec_interface = {
/*.interface_name */ "ilbc",
/*.implementations */ &ilbc_8k_20ms_implementation,
/*.next */ &ilbc_102_codec_interface
@@ -314,9 +315,7 @@
/*.application_interface */ NULL
};
-
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_ilbc_load)
{
/* connect my internal structure to the blank pointer passed to me */
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_l16/mod_l16.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_l16/mod_l16.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_l16/mod_l16.c Thu Jun 14 12:39:04 2007
@@ -31,8 +31,8 @@
*/
#include <switch.h>
-static const char modname[] = "mod_l16";
-
+SWITCH_MODULE_LOAD_FUNCTION(mod_l16_load);
+SWITCH_MODULE_DEFINITION(mod_l16, mod_l16_load, NULL, NULL);
static switch_status_t switch_raw_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings)
{
@@ -86,7 +86,7 @@
return SWITCH_STATUS_SUCCESS;
}
-static const switch_codec_implementation_t raw_32k_60ms_implementation = {
+static switch_codec_implementation_t raw_32k_60ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 119,
/*.iananame */ "L16",
@@ -107,7 +107,7 @@
/*.next = */
};
-static const switch_codec_implementation_t raw_32k_30ms_implementation = {
+static switch_codec_implementation_t raw_32k_30ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 119,
/*.iananame */ "L16",
@@ -128,7 +128,7 @@
/*.next = */ &raw_32k_60ms_implementation
};
-static const switch_codec_implementation_t raw_32k_20ms_implementation = {
+static switch_codec_implementation_t raw_32k_20ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 119,
/*.iananame */ "L16",
@@ -149,7 +149,7 @@
/*.next = */ &raw_32k_30ms_implementation
};
-static const switch_codec_implementation_t raw_32k_10ms_implementation = {
+static switch_codec_implementation_t raw_32k_10ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 119,
/*.iananame */ "L16",
@@ -170,7 +170,7 @@
/*.next = */ &raw_32k_20ms_implementation
};
-static const switch_codec_implementation_t raw_22k_20ms_implementation = {
+static switch_codec_implementation_t raw_22k_20ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 118,
/*.iananame */ "L16",
@@ -191,7 +191,7 @@
/*.next = */ &raw_32k_10ms_implementation
};
-static const switch_codec_implementation_t raw_16k_120ms_implementation = {
+static switch_codec_implementation_t raw_16k_120ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 117,
/*.iananame */ "L16",
@@ -212,7 +212,7 @@
/*.next */ &raw_22k_20ms_implementation
};
-static const switch_codec_implementation_t raw_16k_60ms_implementation = {
+static switch_codec_implementation_t raw_16k_60ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 117,
/*.iananame */ "L16",
@@ -233,7 +233,7 @@
/*.next */ &raw_16k_120ms_implementation
};
-static const switch_codec_implementation_t raw_16k_30ms_implementation = {
+static switch_codec_implementation_t raw_16k_30ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 117,
/*.iananame */ "L16",
@@ -254,7 +254,7 @@
/*.next */ &raw_16k_60ms_implementation
};
-static const switch_codec_implementation_t raw_16k_20ms_implementation = {
+static switch_codec_implementation_t raw_16k_20ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 117,
/*.iananame */ "L16",
@@ -275,7 +275,7 @@
/*.next = */ &raw_16k_30ms_implementation
};
-static const switch_codec_implementation_t raw_16k_10ms_implementation = {
+static switch_codec_implementation_t raw_16k_10ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 117,
/*.iananame */ "L16",
@@ -299,7 +299,7 @@
///////////////////////////////
-static const switch_codec_implementation_t raw_8k_120ms_implementation = {
+static switch_codec_implementation_t raw_8k_120ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 10,
/*.iananame */ "L16",
@@ -321,7 +321,7 @@
};
-static const switch_codec_implementation_t raw_8k_60ms_implementation = {
+static switch_codec_implementation_t raw_8k_60ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 10,
/*.iananame */ "L16",
@@ -342,7 +342,7 @@
/*.next */ &raw_8k_120ms_implementation
};
-static const switch_codec_implementation_t raw_8k_30ms_implementation = {
+static switch_codec_implementation_t raw_8k_30ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 10,
/*.iananame */ "L16",
@@ -362,7 +362,7 @@
/*.destroy */ switch_raw_destroy,
/*.next */ &raw_8k_60ms_implementation
};
-static const switch_codec_implementation_t raw_8k_20ms_implementation = {
+static switch_codec_implementation_t raw_8k_20ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 10,
/*.iananame */ "L16",
@@ -385,7 +385,7 @@
-static const switch_codec_implementation_t raw_8k_10ms_implementation = {
+static switch_codec_implementation_t raw_8k_10ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 10,
/*.iananame */ "L16",
@@ -407,7 +407,7 @@
};
-static const switch_codec_interface_t raw_codec_interface = {
+static switch_codec_interface_t raw_codec_interface = {
/*.interface_name */ "raw signed linear (16 bit)",
/*.implementations */ &raw_8k_10ms_implementation
};
@@ -424,7 +424,7 @@
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_l16_load)
{
/* connect my internal structure to the blank pointer passed to me */
*module_interface = &raw_module_interface;
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_lpc10/mod_lpc10.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_lpc10/mod_lpc10.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_lpc10/mod_lpc10.c Thu Jun 14 12:39:04 2007
@@ -156,7 +156,7 @@
/* Registration */
-static const switch_codec_implementation_t lpc10_implementation = {
+static switch_codec_implementation_t lpc10_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 7,
/*.iananame */ "LPC",
Modified: freeswitch/branches/greenlizard/src/mod/codecs/mod_speex/mod_speex.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/codecs/mod_speex/mod_speex.c (original)
+++ freeswitch/branches/greenlizard/src/mod/codecs/mod_speex/mod_speex.c Thu Jun 14 12:39:04 2007
@@ -33,9 +33,10 @@
#include <speex/speex.h>
#include <speex/speex_preprocess.h>
-static const char modname[] = "mod_speex";
+SWITCH_MODULE_LOAD_FUNCTION(mod_speex_load);
+SWITCH_MODULE_DEFINITION(mod_speex, mod_speex_load, NULL, NULL);
-static const switch_codec_settings_t default_codec_settings = {
+static switch_codec_settings_t default_codec_settings = {
/*.quality */ 5,
/*.complexity */ 5,
/*.enhancement */ 1,
@@ -261,7 +262,7 @@
}
/* Registration */
-static const switch_codec_implementation_t speex_32k_implementation = {
+static switch_codec_implementation_t speex_32k_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 102,
/*.iananame */ "speex",
@@ -281,7 +282,7 @@
/*.destroy */ switch_speex_destroy
};
-static const switch_codec_implementation_t speex_16k_implementation = {
+static switch_codec_implementation_t speex_16k_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 99,
/*.iananame */ "speex",
@@ -303,7 +304,7 @@
};
-static const switch_codec_implementation_t speex_8k_60ms_implementation = {
+static switch_codec_implementation_t speex_8k_60ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 98,
/*.iananame */ "speex",
@@ -324,7 +325,7 @@
/*.next */ &speex_16k_implementation
};
-static const switch_codec_implementation_t speex_8k_40ms_implementation = {
+static switch_codec_implementation_t speex_8k_40ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 98,
/*.iananame */ "speex",
@@ -347,7 +348,7 @@
};
-static const switch_codec_implementation_t speex_8k_30ms_implementation = {
+static switch_codec_implementation_t speex_8k_30ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 98,
/*.iananame */ "speex",
@@ -368,7 +369,7 @@
/*.next */ &speex_8k_40ms_implementation
};
-static const switch_codec_implementation_t speex_8k_20ms_implementation = {
+static switch_codec_implementation_t speex_8k_20ms_implementation = {
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
/*.ianacode */ 98,
/*.iananame */ "speex",
@@ -389,7 +390,7 @@
/*.next */ &speex_8k_30ms_implementation
};
-static const switch_codec_interface_t speex_codec_interface = {
+static switch_codec_interface_t speex_codec_interface = {
/*.interface_name */ "speex",
/*.implementations */ &speex_8k_20ms_implementation
};
@@ -403,7 +404,7 @@
/*.application_interface */ NULL
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_speex_load)
{
/* connect my internal structure to the blank pointer passed to me */
*module_interface = &speex_module_interface;
Modified: freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c (original)
+++ freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.c Thu Jun 14 12:39:04 2007
@@ -34,8 +34,8 @@
#include <sys/stat.h>
#include <fcntl.h>
-
-static const char modname[] = "mod_dialplan_directory";
+SWITCH_MODULE_LOAD_FUNCTION(mod_dialplan_directory_load);
+SWITCH_MODULE_DEFINITION(mod_dialplan_directory, mod_dialplan_directory_load, NULL, NULL);
static struct {
char *directory_name;
@@ -151,13 +151,13 @@
}
-static const switch_dialplan_interface_t directory_dialplan_interface = {
+static switch_dialplan_interface_t directory_dialplan_interface = {
/*.interface_name = */ "directory",
/*.hunt_function = */ directory_dialplan_hunt
/*.next = NULL */
};
-static const switch_loadable_module_interface_t directory_dialplan_module_interface = {
+static switch_loadable_module_interface_t directory_dialplan_module_interface = {
/*.module_name = */ modname,
/*.endpoint_interface = */ NULL,
/*.timer_interface = */ NULL,
@@ -166,7 +166,7 @@
/*.application_interface = */ NULL
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_dialplan_directory_load)
{
load_config();
Modified: freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c (original)
+++ freeswitch/branches/greenlizard/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c Thu Jun 14 12:39:04 2007
@@ -34,7 +34,8 @@
#include <sys/stat.h>
#include <fcntl.h>
-static const char modname[] = "mod_dialplan_xml";
+SWITCH_MODULE_LOAD_FUNCTION(mod_dialplan_xml_load);
+SWITCH_MODULE_DEFINITION(mod_dialplan_xml, mod_dialplan_xml_load, NULL, NULL);
typedef enum {
BREAK_ON_TRUE,
@@ -377,13 +378,13 @@
}
-static const switch_dialplan_interface_t dialplan_interface = {
+static switch_dialplan_interface_t dialplan_interface = {
/*.interface_name = */ "XML",
/*.hunt_function = */ dialplan_hunt
/*.next = NULL */
};
-static const switch_loadable_module_interface_t dialplan_module_interface = {
+static switch_loadable_module_interface_t dialplan_module_interface = {
/*.module_name = */ modname,
/*.endpoint_interface = */ NULL,
/*.timer_interface = */ NULL,
@@ -392,7 +393,7 @@
/*.application_interface = */ NULL
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_dialplan_xml_load)
{
/* connect my internal structure to the blank pointer passed to me */
Modified: freeswitch/branches/greenlizard/src/mod/directories/mod_ldap/mod_ldap.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/directories/mod_ldap/mod_ldap.c (original)
+++ freeswitch/branches/greenlizard/src/mod/directories/mod_ldap/mod_ldap.c Thu Jun 14 12:39:04 2007
@@ -40,7 +40,8 @@
#include <ldap.h>
#endif
-static const char modname[] = "mod_ldap";
+SWITCH_MODULE_LOAD_FUNCTION(mod_ldap_load);
+SWITCH_MODULE_DEFINITION(mod_ldap, mod_ldap_load, NULL, NULL);
struct ldap_context {
LDAP *ld;
@@ -197,7 +198,7 @@
}
-static const switch_directory_interface_t ldap_directory_interface = {
+static switch_directory_interface_t ldap_directory_interface = {
/*.interface_name */ "ldap",
/*.directory_open */ mod_ldap_open,
/*.directory_close */ mod_ldap_close,
@@ -207,7 +208,7 @@
};
-static switch_loadable_module_interface_t skel_module_interface = {
+static switch_loadable_module_interface_t ldap_module_interface = {
/*.module_name */ modname,
/*.endpoint_interface */ NULL,
/*.timer_interface */ NULL,
@@ -220,10 +221,10 @@
/*.directory_interface */ &ldap_directory_interface
};
-switch_status_t switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_ldap_load)
{
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &skel_module_interface;
+ *module_interface = &ldap_module_interface;
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_alsa/mod_alsa.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_alsa/mod_alsa.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_alsa/mod_alsa.c Thu Jun 14 12:39:04 2007
@@ -39,7 +39,9 @@
#define MY_EVENT_RINGING "alsa::ringing"
-static const char modname[] = "mod_alsa";
+SWITCH_MODULE_LOAD_FUNCTION(mod_alsa_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_alsa_shutdown);
+SWITCH_MODULE_DEFINITION(mod_alsa, mod_alsa_load, mod_alsa_shutdown, NULL);
static switch_memory_pool_t *module_pool = NULL;
//static int running = 1;
@@ -733,7 +735,7 @@
/*.next */
};
-static const switch_state_handler_table_t channel_event_handlers = {
+static switch_state_handler_table_t channel_event_handlers = {
/*.on_init */ channel_on_init,
/*.on_ring */ channel_on_ring,
/*.on_execute */ channel_on_execute,
@@ -742,7 +744,7 @@
/*.on_transmit */ channel_on_transmit
};
-static const switch_io_routines_t channel_io_routines = {
+static switch_io_routines_t channel_io_routines = {
/*.outgoing_channel */ channel_outgoing_channel,
/*.read_frame */ channel_read_frame,
/*.write_frame */ channel_write_frame,
@@ -753,7 +755,7 @@
/*.receive_message */ channel_receive_message
};
-static const switch_endpoint_interface_t channel_endpoint_interface = {
+static switch_endpoint_interface_t channel_endpoint_interface = {
/*.interface_name */ "alsa",
/*.io_routines */ &channel_io_routines,
/*.event_handlers */ &channel_event_handlers,
@@ -761,7 +763,7 @@
/*.next */ NULL
};
-static const switch_loadable_module_interface_t channel_module_interface = {
+static switch_loadable_module_interface_t channel_module_interface = {
/*.module_name */ modname,
/*.endpoint_interface */ &channel_endpoint_interface,
/*.timer_interface */ NULL,
@@ -825,7 +827,7 @@
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_alsa_load)
{
switch_status_t status;
@@ -943,7 +945,7 @@
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_alsa_shutdown)
{
deactivate_audio_device();
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_dingaling/mod_dingaling.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_dingaling/mod_dingaling.c Thu Jun 14 12:39:04 2007
@@ -43,7 +43,9 @@
#define DL_EVENT_CONNECTED "dingaling::connected"
#define MDL_CHAT_PROTO "jingle"
-static const char modname[] = "mod_dingaling";
+SWITCH_MODULE_LOAD_FUNCTION(mod_dingaling_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_dingaling_shutdown);
+SWITCH_MODULE_DEFINITION(mod_dingaling, mod_dingaling_load, mod_dingaling_shutdown, NULL);
static switch_memory_pool_t *module_pool = NULL;
@@ -1567,7 +1569,7 @@
return SWITCH_STATUS_SUCCESS;
}
-static const switch_state_handler_table_t channel_event_handlers = {
+static switch_state_handler_table_t channel_event_handlers = {
/*.on_init */ channel_on_init,
/*.on_ring */ channel_on_ring,
/*.on_execute */ channel_on_execute,
@@ -1576,7 +1578,7 @@
/*.on_transmit */ channel_on_transmit
};
-static const switch_io_routines_t channel_io_routines = {
+static switch_io_routines_t channel_io_routines = {
/*.outgoing_channel */ channel_outgoing_channel,
/*.read_frame */ channel_read_frame,
/*.write_frame */ channel_write_frame,
@@ -1588,7 +1590,7 @@
/*.receive_event */ channel_receive_event
};
-static const switch_endpoint_interface_t channel_endpoint_interface = {
+static switch_endpoint_interface_t channel_endpoint_interface = {
/*.interface_name */ "dingaling",
/*.io_routines */ &channel_io_routines,
/*.event_handlers */ &channel_event_handlers,
@@ -1629,12 +1631,12 @@
/*.next */ &logout_api_interface
};
-static const switch_chat_interface_t channel_chat_interface = {
+static switch_chat_interface_t channel_chat_interface = {
/*.name */ MDL_CHAT_PROTO,
/*.chat_send */ chat_send,
};
-static const switch_loadable_module_interface_t channel_module_interface = {
+static switch_loadable_module_interface_t channel_module_interface = {
/*.module_name */ modname,
/*.endpoint_interface */ &channel_endpoint_interface,
/*.timer_interface */ NULL,
@@ -1824,7 +1826,7 @@
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_dingaling_load)
{
if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
@@ -1927,8 +1929,7 @@
return SWITCH_STATUS_SUCCESS;
}
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_dingaling_shutdown)
{
sign_off();
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_iax/mod_iax.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_iax/mod_iax.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_iax/mod_iax.c Thu Jun 14 12:39:04 2007
@@ -31,6 +31,11 @@
*/
#include <switch.h>
+SWITCH_MODULE_LOAD_FUNCTION(mod_iax_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_iax_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_iax_runtime);
+SWITCH_MODULE_DEFINITION(mod_iax, mod_iax_load, mod_iax_shutdown, mod_iax_runtime);
+
#include <iax2.h>
#include <iax-client.h>
#include <iax2-parser.h>
@@ -38,8 +43,7 @@
#include <sys/timeb.h>
#endif
-static const char modname[] = "mod_iax";
-
+static switch_endpoint_interface_t *channel_endpoint_interface;
static switch_memory_pool_t *module_pool = NULL;
static int running = 1;
@@ -770,44 +774,6 @@
return SWITCH_STATUS_SUCCESS;
}
-static const switch_state_handler_table_t channel_event_handlers = {
- /*.on_init */ channel_on_init,
- /*.on_ring */ channel_on_ring,
- /*.on_execute */ channel_on_execute,
- /*.on_hangup */ channel_on_hangup,
- /*.on_loopback */ channel_on_loopback,
- /*.on_transmit */ channel_on_transmit
-};
-
-static const switch_io_routines_t channel_io_routines = {
- /*.outgoing_channel */ channel_outgoing_channel,
- /*.read_frame */ channel_read_frame,
- /*.write_frame */ channel_write_frame,
- /*.kill_channel */ channel_kill_channel,
- /*.waitfor_read */ channel_waitfor_read,
- /*.waitfor_write */ channel_waitfor_write,
- /*.send_dtmf */ channel_send_dtmf,
- /*.receive_message*/ channel_receive_message
-};
-
-static const switch_endpoint_interface_t channel_endpoint_interface = {
- /*.interface_name */ "iax",
- /*.io_routines */ &channel_io_routines,
- /*.event_handlers */ &channel_event_handlers,
- /*.private */ NULL,
- /*.next */ NULL
-};
-
-static const switch_loadable_module_interface_t channel_module_interface = {
- /*.module_name */ modname,
- /*.endpoint_interface */ &channel_endpoint_interface,
- /*.timer_interface */ NULL,
- /*.dialplan_interface */ NULL,
- /*.codec_interface */ NULL,
- /*.application_interface */ NULL
-};
-
-
/* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
*/
@@ -815,7 +781,7 @@
switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t **pool)
{
- if ((*new_session = switch_core_session_request(&channel_endpoint_interface, pool)) != 0) {
+ if ((*new_session = switch_core_session_request(channel_endpoint_interface, pool)) != 0) {
private_t *tech_pvt;
switch_channel_t *channel;
switch_caller_profile_t *caller_profile;
@@ -875,17 +841,36 @@
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
-{
+static switch_state_handler_table_t channel_state_handlers = {
+ /*.on_init */ channel_on_init,
+ /*.on_ring */ channel_on_ring,
+ /*.on_execute */ channel_on_execute,
+ /*.on_hangup */ channel_on_hangup,
+ /*.on_loopback */ channel_on_loopback,
+ /*.on_transmit */ channel_on_transmit
+};
- if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
- return SWITCH_STATUS_TERM;
- }
+static switch_io_routines_t channel_io_routines = {
+ /*.outgoing_channel */ channel_outgoing_channel,
+ /*.read_frame */ channel_read_frame,
+ /*.write_frame */ channel_write_frame,
+ /*.kill_channel */ channel_kill_channel,
+ /*.waitfor_read */ channel_waitfor_read,
+ /*.waitfor_write */ channel_waitfor_write,
+ /*.send_dtmf */ channel_send_dtmf,
+ /*.receive_message*/ channel_receive_message
+};
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_iax_load)
+{
+ module_pool = pool;
- /* connect my internal structure to the blank pointer passed to me */
- *module_interface = &channel_module_interface;
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ channel_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE);
+ channel_endpoint_interface->interface_name = modname;
+ channel_endpoint_interface->io_routines = &channel_io_routines;
+ channel_endpoint_interface->state_handler = &channel_state_handlers;
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
@@ -967,7 +952,7 @@
return status;
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_iax_runtime)
{
//int refresh;
struct iax_event *iaxevent = NULL;
@@ -1089,7 +1074,7 @@
switch_core_session_t *session;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "New Inbound Channel %s!\n", iaxevent->ies.calling_name);
- if ((session = switch_core_session_request(&channel_endpoint_interface, NULL)) != 0) {
+ if ((session = switch_core_session_request(channel_endpoint_interface, NULL)) != 0) {
private_t *tech_pvt;
switch_channel_t *channel;
@@ -1217,7 +1202,7 @@
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_iax_shutdown)
{
int x = 0;
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/mod_portaudio.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/mod_portaudio.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_portaudio/mod_portaudio.c Thu Jun 14 12:39:04 2007
@@ -39,7 +39,9 @@
#define MY_EVENT_RINGING "portaudio::ringing"
-static const char modname[] = "mod_portaudio";
+SWITCH_MODULE_LOAD_FUNCTION(mod_portaudio_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_portaudio_shutdown);
+SWITCH_MODULE_DEFINITION(mod_portaudio, mod_portaudio_load, mod_portaudio_shutdown, NULL);
static switch_memory_pool_t *module_pool = NULL;
//static int running = 1;
@@ -780,7 +782,7 @@
/*.next */ &channel_call_interface
};
-static const switch_state_handler_table_t channel_event_handlers = {
+static switch_state_handler_table_t channel_event_handlers = {
/*.on_init */ channel_on_init,
/*.on_ring */ channel_on_ring,
/*.on_execute */ channel_on_execute,
@@ -789,7 +791,7 @@
/*.on_transmit */ channel_on_transmit
};
-static const switch_io_routines_t channel_io_routines = {
+static switch_io_routines_t channel_io_routines = {
/*.outgoing_channel */ channel_outgoing_channel,
/*.read_frame */ channel_read_frame,
/*.write_frame */ channel_write_frame,
@@ -800,7 +802,7 @@
/*.receive_message */ channel_receive_message
};
-static const switch_endpoint_interface_t channel_endpoint_interface = {
+static switch_endpoint_interface_t channel_endpoint_interface = {
/*.interface_name */ "portaudio",
/*.io_routines */ &channel_io_routines,
/*.event_handlers */ &channel_event_handlers,
@@ -808,7 +810,7 @@
/*.next */ NULL
};
-static const switch_loadable_module_interface_t channel_module_interface = {
+static switch_loadable_module_interface_t channel_module_interface = {
/*.module_name */ modname,
/*.endpoint_interface */ &channel_endpoint_interface,
/*.timer_interface */ NULL,
@@ -872,7 +874,7 @@
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_portaudio_load)
{
switch_status_t status;
@@ -1039,7 +1041,7 @@
return status;
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_portaudio_shutdown)
{
if (globals.read_codec.implementation) {
switch_core_codec_destroy(&globals.read_codec);
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.c Thu Jun 14 12:39:04 2007
@@ -38,8 +38,12 @@
#include "mod_sofia.h"
+SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_sofia_shutdown);
+SWITCH_MODULE_DEFINITION(mod_sofia, mod_sofia_load, mod_sofia_shutdown, NULL);
+
struct mod_sofia_globals mod_sofia_globals;
-const switch_endpoint_interface_t sofia_endpoint_interface;
+switch_endpoint_interface_t sofia_endpoint_interface;
static switch_frame_t silence_frame = { 0 };
static char silence_data[13] = "";
@@ -461,7 +465,7 @@
if (switch_test_flag(tech_pvt, TFLAG_IO)) {
switch_status_t status;
-
+
if (!switch_test_flag(tech_pvt, TFLAG_RTP)) {
return SWITCH_STATUS_GENERR;
}
@@ -1260,7 +1264,7 @@
}
-static const switch_io_routines_t sofia_io_routines = {
+static switch_io_routines_t sofia_io_routines = {
/*.outgoing_channel */ sofia_outgoing_channel,
/*.read_frame */ sofia_read_frame,
/*.write_frame */ sofia_write_frame,
@@ -1275,7 +1279,7 @@
/*.write_video_frame*/ sofia_write_video_frame
};
-static const switch_state_handler_table_t sofia_event_handlers = {
+static switch_state_handler_table_t sofia_event_handlers = {
/*.on_init */ sofia_on_init,
/*.on_ring */ sofia_on_ring,
/*.on_execute */ sofia_on_execute,
@@ -1284,7 +1288,7 @@
/*.on_transmit */ sofia_on_transmit
};
-const switch_endpoint_interface_t sofia_endpoint_interface = {
+switch_endpoint_interface_t sofia_endpoint_interface = {
/*.interface_name */ "sofia",
/*.io_routines */ &sofia_io_routines,
/*.event_handlers */ &sofia_event_handlers,
@@ -1292,7 +1296,7 @@
/*.next */ NULL
};
-static const switch_chat_interface_t sofia_chat_interface = {
+static switch_chat_interface_t sofia_chat_interface = {
/*.name */ SOFIA_CHAT_PROTO,
/*.sofia_presence_chat_send */ sofia_presence_chat_send,
@@ -1303,7 +1307,7 @@
return SWITCH_STATUS_SUCCESS;
}
-static const switch_management_interface_t sofia_management_interface = {
+static switch_management_interface_t sofia_management_interface = {
/*.relative_oid */ "1",
/*.management_function */ sofia_manage
};
@@ -1316,7 +1320,7 @@
/*.next */ NULL
};
-static const switch_loadable_module_interface_t sofia_module_interface = {
+static switch_loadable_module_interface_t sofia_module_interface = {
/*.module_name */ modname,
/*.endpoint_interface */ &sofia_endpoint_interface,
/*.timer_interface */ NULL,
@@ -1497,7 +1501,7 @@
return cause;
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
{
silence_frame.data = silence_data;
@@ -1575,7 +1579,7 @@
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_sofia_shutdown)
{
int sanity = 0;
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.h
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.h (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/mod_sofia.h Thu Jun 14 12:39:04 2007
@@ -45,7 +45,7 @@
#include <switch_odbc.h>
#endif
-static const char modname[] = "mod_sofia";
+#define MODNAME "mod_sofia"
static const switch_state_handler_table_t noop_state_handler = { 0 };
struct sofia_gateway;
typedef struct sofia_gateway sofia_gateway_t;
@@ -465,7 +465,7 @@
void sofia_glue_do_xfer_invite(switch_core_session_t *session);
uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sip_t const *sip,
sofia_regtype_t regtype, char *key, uint32_t keylen, switch_event_t **v_event);
-extern const switch_endpoint_interface_t sofia_endpoint_interface;
+extern switch_endpoint_interface_t sofia_endpoint_interface;
void sofia_presence_set_chat_hash(private_object_t *tech_pvt, sip_t const *sip);
switch_status_t sofia_on_hangup(switch_core_session_t *session);
char *sofia_glue_get_url_from_contact(char *buf, uint8_t to_dup);
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_sofia/sofia.c Thu Jun 14 12:39:04 2007
@@ -1931,7 +1931,7 @@
tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
from_user,
profile->dialplan,
- displayname, from_user, network_ip, NULL, NULL, NULL, modname, context, destination_number);
+ displayname, from_user, network_ip, NULL, NULL, NULL, MODNAME, context, destination_number);
if (tech_pvt->caller_profile) {
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c Thu Jun 14 12:39:04 2007
@@ -41,7 +41,9 @@
#endif
//#define DOTRACE
-static const char modname[] = "mod_wanpipe";
+SWITCH_MODULE_LOAD_FUNCTION(mod_wanpipe_load);
+SWITCH_MODULE_DEFINITION(mod_wanpipe, mod_wanpipe_load, NULL, NULL);
+
#define STRLEN 15
static switch_memory_pool_t *module_pool = NULL;
@@ -961,7 +963,7 @@
}
-static const switch_io_routines_t wanpipe_io_routines = {
+static switch_io_routines_t wanpipe_io_routines = {
/*.outgoing_channel */ wanpipe_outgoing_channel,
/*.read_frame */ wanpipe_read_frame,
/*.write_frame */ wanpipe_write_frame,
@@ -972,7 +974,7 @@
/*.receive_message*/ wanpipe_receive_message
};
-static const switch_state_handler_table_t wanpipe_state_handlers = {
+static switch_state_handler_table_t wanpipe_state_handlers = {
/*.on_init */ wanpipe_on_init,
/*.on_ring */ wanpipe_on_ring,
/*.on_execute */ NULL,
@@ -981,7 +983,7 @@
/*.on_transmit */ wanpipe_on_transmit
};
-static const switch_endpoint_interface_t wanpipe_endpoint_interface = {
+static switch_endpoint_interface_t wanpipe_endpoint_interface = {
/*.interface_name */ "wanpipe",
/*.io_routines */ &wanpipe_io_routines,
/*.state_handlers */ &wanpipe_state_handlers,
@@ -989,7 +991,7 @@
/*.next */ NULL
};
-static const switch_loadable_module_interface_t wanpipe_module_interface = {
+static switch_loadable_module_interface_t wanpipe_module_interface = {
/*.module_name */ modname,
/*.endpoint_interface */ &wanpipe_endpoint_interface,
/*.timer_interface */ NULL,
@@ -1308,7 +1310,7 @@
}
#endif
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_wanpipe_load)
{
switch_status_t status = SWITCH_STATUS_SUCCESS;
@@ -1335,7 +1337,7 @@
}
/* connect my internal structure to the blank pointer passed to me */
- *interface = &wanpipe_module_interface;
+ *module_interface = &wanpipe_module_interface;
/* indicate that the module should continue to be loaded */
return status;
Modified: freeswitch/branches/greenlizard/src/mod/endpoints/mod_woomera/mod_woomera.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/endpoints/mod_woomera/mod_woomera.c (original)
+++ freeswitch/branches/greenlizard/src/mod/endpoints/mod_woomera/mod_woomera.c Thu Jun 14 12:39:04 2007
@@ -48,7 +48,10 @@
//#define MEDIA_ANSWER "ANSWER"
//#define USE_ANSWER 1
-static const char modname[] = "mod_woomera";
+SWITCH_MODULE_LOAD_FUNCTION(mod_woomera_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_woomera_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_woomera_runtime);
+SWITCH_MODULE_DEFINITION(mod_woomera, mod_woomera_load, mod_woomera_shutdown, mod_woomera_runtime);
static switch_memory_pool_t *module_pool = NULL;
@@ -438,7 +441,7 @@
return SWITCH_STATUS_GENERR;
}
-static const switch_state_handler_table_t woomera_event_handlers = {
+static switch_state_handler_table_t woomera_event_handlers = {
/*.on_init */ woomera_on_init,
/*.on_ring */ woomera_on_ring,
/*.on_execute */ woomera_on_execute,
@@ -447,7 +450,7 @@
/*.on_transmit */ woomera_on_transmit
};
-static const switch_io_routines_t woomera_io_routines = {
+static switch_io_routines_t woomera_io_routines = {
/*.outgoing_channel */ woomera_outgoing_channel,
/*.read_frame */ woomera_read_frame,
/*.write_frame */ woomera_write_frame,
@@ -456,7 +459,7 @@
/*.waitfor_write */ woomera_waitfor_write
};
-static const switch_endpoint_interface_t woomera_endpoint_interface = {
+static switch_endpoint_interface_t woomera_endpoint_interface = {
/*.interface_name */ "woomera",
/*.io_routines */ &woomera_io_routines,
/*.event_handlers */ &woomera_event_handlers,
@@ -464,7 +467,7 @@
/*.next */ NULL
};
-static const switch_loadable_module_interface_t woomera_module_interface = {
+static switch_loadable_module_interface_t woomera_module_interface = {
/*.module_name */ modname,
/*.endpoint_interface */ &woomera_endpoint_interface,
/*.timer_interface */ NULL,
@@ -1269,7 +1272,7 @@
return NULL;
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_woomera_runtime)
{
woomera_thread_run(&default_profile);
@@ -1277,7 +1280,7 @@
return SWITCH_STATUS_TERM;
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_woomera_shutdown)
{
int x = 0;
woomera_profile_thread_running(&default_profile, 1, 0);
@@ -1291,7 +1294,7 @@
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_woomera_load)
{
struct woomera_profile *profile = &default_profile;
Modified: freeswitch/branches/greenlizard/src/mod/event_handlers/mod_cdr/mod_cdr.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/event_handlers/mod_cdr/mod_cdr.cpp (original)
+++ freeswitch/branches/greenlizard/src/mod/event_handlers/mod_cdr/mod_cdr.cpp Thu Jun 14 12:39:04 2007
@@ -40,7 +40,11 @@
#include <sys/stat.h>
#include <fcntl.h>
-static const char modname[] = "mod_cdr - CDR Engine";
+SWITCH_MODULE_LOAD_FUNCTION(mod_cdr_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_cdr_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_cdr_runtime);
+SWITCH_MODULE_DEFINITION(mod_cdr, mod_cdr_load, mod_cdr_shutdown, mod_cdr_runtime);
+
static int RUNNING = 0;
static CDRContainer *newcdrcontainer;
static switch_memory_pool_t *module_pool;
@@ -104,7 +108,7 @@
/*.next */ &modcdr_queue_pause_api
};
-static const switch_loadable_module_interface_t cdr_module_interface = {
+static switch_loadable_module_interface_t cdr_module_interface = {
/*.module_name */ modname,
/*.endpoint_interface */ NULL,
/*.timer_interface */ NULL,
@@ -122,10 +126,10 @@
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface **interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_cdr_load)
{
/* connect my internal structure to the blank pointer passed to me */
- *interface = &cdr_module_interface;
+ *module_interface = &cdr_module_interface;
switch_core_add_state_handler(&state_handlers);
@@ -142,7 +146,7 @@
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_cdr_runtime)
{
RUNNING = 1;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "mod_cdr made it to runtime. Wee!\n");
@@ -196,7 +200,7 @@
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_cdr_shutdown)
{
delete newcdrcontainer;
switch_thread_rwlock_destroy(cdr_rwlock);
Modified: freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c (original)
+++ freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c Thu Jun 14 12:39:04 2007
@@ -32,7 +32,10 @@
#include <switch.h>
static char *MARKER = "1";
-static const char modname[] = "mod_event_multicast";
+SWITCH_MODULE_LOAD_FUNCTION(mod_event_multicast_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_multicast_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_multicast_runtime);
+SWITCH_MODULE_DEFINITION(mod_event_multicast, mod_event_multicast_load, mod_event_multicast_shutdown, mod_event_multicast_runtime);
static switch_memory_pool_t *module_pool = NULL;
@@ -183,7 +186,7 @@
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_event_multicast_load)
{
memset(&globals, 0, sizeof(globals));
@@ -246,7 +249,7 @@
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_multicast_shutdown)
{
int x = 0;
@@ -259,8 +262,7 @@
return SWITCH_STATUS_SUCCESS;
}
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_multicast_runtime)
{
switch_event_t *local_event;
char buf[65536] = { 0 };
Modified: freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_socket/mod_event_socket.c (original)
+++ freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_socket/mod_event_socket.c Thu Jun 14 12:39:04 2007
@@ -32,7 +32,11 @@
#include <switch.h>
#define CMD_BUFLEN 1024 * 1000
-static const char modname[] = "mod_event_socket";
+SWITCH_MODULE_LOAD_FUNCTION(mod_event_socket_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_socket_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_socket_runtime);
+SWITCH_MODULE_DEFINITION(mod_event_socket, mod_event_socket_load, mod_event_socket_shutdown, mod_event_socket_runtime);
+
static char *MARKER = "1";
typedef enum {
@@ -136,11 +140,6 @@
if (event->event_id != SWITCH_EVENT_CUSTOM || (event->subclass && switch_core_hash_find(l->event_hash, event->subclass->name))) {
send = 1;
}
- } else {
- int x;
- for(x = 0; x <= SWITCH_EVENT_ALL; x++) {
- printf("%d ", l->event_list[x]);
- }
}
if (send && switch_test_flag(l, LFLAG_MYEVENTS)) {
@@ -252,7 +251,7 @@
}
-static const switch_application_interface_t socket_application_interface = {
+static switch_application_interface_t socket_application_interface = {
/*.interface_name */ "socket",
/*.application_function */ socket_function,
/* long_desc */ "Connect to a socket",
@@ -285,7 +284,7 @@
switch_mutex_unlock(listen_list.sock_mutex);
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_socket_shutdown)
{
listener_t *l;
@@ -305,8 +304,7 @@
}
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_event_socket_load)
{
/* connect my internal structure to the blank pointer passed to me */
*module_interface = &event_socket_module_interface;
@@ -1193,7 +1191,7 @@
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_socket_runtime)
{
switch_memory_pool_t *pool = NULL, *listener_pool = NULL;
switch_status_t rv;
Modified: freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_test/mod_event_test.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_test/mod_event_test.c (original)
+++ freeswitch/branches/greenlizard/src/mod/event_handlers/mod_event_test/mod_event_test.c Thu Jun 14 12:39:04 2007
@@ -31,7 +31,8 @@
*/
#include <switch.h>
-static const char modname[] = "mod_event_test";
+SWITCH_MODULE_LOAD_FUNCTION(mod_event_test_load);
+SWITCH_MODULE_DEFINITION(mod_event_test, mod_event_test_load, NULL, NULL);
//#define TORTURE_ME
@@ -124,8 +125,7 @@
}
#endif
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_event_test_load)
{
/* connect my internal structure to the blank pointer passed to me */
*module_interface = &event_test_module_interface;
Modified: freeswitch/branches/greenlizard/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c (original)
+++ freeswitch/branches/greenlizard/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c Thu Jun 14 12:39:04 2007
@@ -32,7 +32,10 @@
#include <switch.h>
#include <iksemel.h>
-static const char modname[] = "mod_xmpp_event";
+SWITCH_MODULE_LOAD_FUNCTION(mod_xmpp_event_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xmpp_event_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_xmpp_event_runtime);
+SWITCH_MODULE_DEFINITION(mod_xmpp_event, mod_xmpp_event_load, mod_xmpp_event_shutdown, mod_xmpp_event_runtime);
static int RUNNING = 0;
static iksfilter *my_filter;
@@ -397,7 +400,7 @@
/*.application_interface */ NULL
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_xmpp_event_load)
{
/* connect my internal structure to the blank pointer passed to me */
*module_interface = &xmpp_event_module_interface;
@@ -411,7 +414,7 @@
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xmpp_event_shutdown)
{
if (RUNNING) {
@@ -424,7 +427,7 @@
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_xmpp_event_runtime)
{
RUNNING = 1;
xmpp_connect(globals.jid, globals.passwd);
Modified: freeswitch/branches/greenlizard/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c (original)
+++ freeswitch/branches/greenlizard/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c Thu Jun 14 12:39:04 2007
@@ -35,7 +35,10 @@
#endif
#include <howl.h>
-static const char modname[] = "mod_zeroconf";
+SWITCH_MODULE_LOAD_FUNCTION(mod_zeroconf_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_zeroconf_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_zeroconf_runtime);
+SWITCH_MODULE_DEFINITION(mod_zeroconf, mod_zeroconf_load, mod_zeroconf_shutdown, mod_zeroconf_runtime);
static switch_memory_pool_t *module_pool = NULL;
@@ -249,7 +252,7 @@
static int RUNNING = 0;
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_zeroconf_shutdown)
{
if (RUNNING == 1) {
RUNNING = -1;
@@ -258,8 +261,7 @@
return SWITCH_STATUS_SUCCESS;
}
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_zeroconf_load)
{
memset(&globals, 0, sizeof(globals));
@@ -298,7 +300,7 @@
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_zeroconf_runtime)
{
RUNNING = 1;
Modified: freeswitch/branches/greenlizard/src/mod/formats/mod_native_file/mod_native_file.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/formats/mod_native_file/mod_native_file.c (original)
+++ freeswitch/branches/greenlizard/src/mod/formats/mod_native_file/mod_native_file.c Thu Jun 14 12:39:04 2007
@@ -31,7 +31,8 @@
*/
#include <switch.h>
-static const char modname[] = "mod_native_file";
+SWITCH_MODULE_LOAD_FUNCTION(mod_native_file_load);
+SWITCH_MODULE_DEFINITION(mod_native_file, mod_native_file_load, NULL, NULL);
struct native_file_context {
switch_file_t *fd;
@@ -163,7 +164,7 @@
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_native_file_load)
{
const switch_codec_implementation_t *codecs[SWITCH_MAX_CODECS];
Modified: freeswitch/branches/greenlizard/src/mod/formats/mod_shout/mod_shout.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/formats/mod_shout/mod_shout.c (original)
+++ freeswitch/branches/greenlizard/src/mod/formats/mod_shout/mod_shout.c Thu Jun 14 12:39:04 2007
@@ -37,14 +37,13 @@
#include <lame.h>
#include <curl/curl.h>
-
#define OUTSCALE 8192
#define MP3_SCACHE 16384
#define MP3_DCACHE 8192
-static const char modname[] = "mod_shout";
-
-
+SWITCH_MODULE_LOAD_FUNCTION(mod_shout_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_shout_shutdown);
+SWITCH_MODULE_DEFINITION(mod_shout, mod_shout_load, mod_shout_shutdown, NULL);
static char *supported_formats[SWITCH_MAX_CODECS] = { 0 };
@@ -889,7 +888,7 @@
/*.directory_interface */ NULL
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_shout_load)
{
supported_formats[0] = "shout";
supported_formats[1] = "mp3";
@@ -908,7 +907,7 @@
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_shout_shutdown)
{
curl_global_cleanup();
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/formats/mod_sndfile/mod_sndfile.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/formats/mod_sndfile/mod_sndfile.c (original)
+++ freeswitch/branches/greenlizard/src/mod/formats/mod_sndfile/mod_sndfile.c Thu Jun 14 12:39:04 2007
@@ -32,7 +32,8 @@
#include <switch.h>
#include <sndfile.h>
-static const char modname[] = "mod_sndfile";
+SWITCH_MODULE_LOAD_FUNCTION(mod_sndfile_load);
+SWITCH_MODULE_DEFINITION(mod_sndfile, mod_sndfile_load, NULL, NULL);
static switch_memory_pool_t *module_pool = NULL;
@@ -361,7 +362,7 @@
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_sndfile_load)
{
if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_mono/mod_mono.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_mono/mod_mono.c (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_mono/mod_mono.c Thu Jun 14 12:39:04 2007
@@ -50,7 +50,10 @@
/* Managed functions */
void mod_mono_switch_console_printf(switch_text_channel_t channel, char *file, const char *func, int line, char *fmt, char *msg);
-static const char modname[] = "mod_mono";
+SWITCH_MODULE_LOAD_FUNCTION(mod_mono_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_mono_shutdown);
+SWITCH_MODULE_DEFINITION(mod_mono, mod_mono_load, mod_mono_shutdown, NULL);
+
static switch_memory_pool_t *mono_pool = NULL;
static struct {
@@ -74,9 +77,9 @@
* This function will initialise the memory pool and plugin hash for this module,
* it will then initialise a new mono domain.
*/
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_mono_load)
{
- *interface = &mono_module_interface;
+ *module_interface = &mono_module_interface;
/* Initialise memory pool */
if (switch_core_new_memory_pool(&mono_pool) != SWITCH_STATUS_SUCCESS) {
@@ -158,7 +161,7 @@
* Function for cleanly shutting down mod_mono
*
*/
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_mono_shutdown)
{
if (globals.domain) {
mono_jit_cleanup(globals.domain);
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_perl/mod_perl.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_perl/mod_perl.c (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_perl/mod_perl.c Thu Jun 14 12:39:04 2007
@@ -43,7 +43,9 @@
static char *embedding[] = { "", "-e", "" };
EXTERN_C void xs_init(pTHX);
-static const char modname[] = "mod_perl";
+SWITCH_MODULE_LOAD_FUNCTION(mod_perl_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_perl_shutdown);
+SWITCH_MODULE_DEFINITION(mod_perl, mod_perl_load, mod_perl_shutdown, NULL);
static struct {
PerlInterpreter *my_perl;
@@ -77,7 +79,7 @@
destroy_perl(&my_perl);
}
-static const switch_application_interface_t perl_application_interface = {
+static switch_application_interface_t perl_application_interface = {
/*.interface_name */ "perl",
/*.application_function */ perl_function,
NULL, NULL, NULL,
@@ -100,7 +102,7 @@
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_perl_shutdown)
{
if (globals.my_perl) {
perl_destruct(globals.my_perl);
@@ -111,7 +113,7 @@
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_perl_load)
{
PerlInterpreter *my_perl;
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.c (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.c Thu Jun 14 12:39:04 2007
@@ -49,7 +49,9 @@
void init_freeswitch(void);
static switch_api_interface_t python_run_interface;
-const char modname[] = "mod_python";
+SWITCH_MODULE_LOAD_FUNCTION(mod_python_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_python_shutdown);
+SWITCH_MODULE_DEFINITION(mod_python, mod_python_load, mod_python_shutdown, NULL);
static void eval_some_python(char *uuid, char *args)
{
@@ -219,7 +221,7 @@
return SWITCH_STATUS_SUCCESS;
}
-static const switch_application_interface_t python_application_interface = {
+static switch_application_interface_t python_application_interface = {
/*.interface_name */ "python",
/*.application_function */ python_function,
NULL, NULL, NULL,
@@ -249,7 +251,7 @@
/*.directory_interface */ NULL
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_python_load)
{
/* connect my internal structure to the blank pointer passed to me */
*module_interface = &python_module_interface;
@@ -281,7 +283,7 @@
/*
Called when the system shuts down*/
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_python_shutdown)
{
PyInterpreterState *mainInterpreterState;
PyThreadState *myThreadState;
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c Thu Jun 14 12:39:04 2007
@@ -38,8 +38,9 @@
#include <curl/curl.h>
#endif
-static const char modname[] = "mod_spidermonkey";
-
+SWITCH_MODULE_LOAD_FUNCTION(mod_spidermonkey_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_spidermonkey_shutdown);
+SWITCH_MODULE_DEFINITION(mod_spidermonkey, mod_spidermonkey_load, mod_spidermonkey_shutdown, NULL);
static void session_destroy(JSContext * cx, JSObject * obj);
static JSBool session_construct(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval);
@@ -2392,6 +2393,8 @@
switch_channel_set_private(channel, "jss", NULL);
}
+ switch_core_event_hook_remove_state_change(jss->session, hanguphook);
+
if (channel && switch_test_flag(jss, S_HUP)) {
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
}
@@ -2981,7 +2984,7 @@
}
-static const switch_application_interface_t ivrtest_application_interface = {
+static switch_application_interface_t ivrtest_application_interface = {
/*.interface_name */ "javascript",
/*.application_function */ js_dp_function,
/* long_desc */ "Run a javascript ivr on a channel",
@@ -3044,7 +3047,7 @@
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_spidermonkey_load)
{
switch_status_t status;
@@ -3067,7 +3070,7 @@
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_spidermonkey_shutdown)
{
curl_global_cleanup();
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/loggers/mod_console/mod_console.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/loggers/mod_console/mod_console.c (original)
+++ freeswitch/branches/greenlizard/src/mod/loggers/mod_console/mod_console.c Thu Jun 14 12:39:04 2007
@@ -31,7 +31,9 @@
*/
#include <switch.h>
-static const char modname[] = "mod_console";
+SWITCH_MODULE_LOAD_FUNCTION(mod_console_load);
+SWITCH_MODULE_DEFINITION(mod_console, mod_console_load, NULL, NULL);
+
static const uint8_t STATIC_LEVELS[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
static int COLORIZE = 0;
#ifdef WIN32
@@ -188,7 +190,7 @@
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_console_load)
{
if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
Modified: freeswitch/branches/greenlizard/src/mod/loggers/mod_syslog/mod_syslog.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/loggers/mod_syslog/mod_syslog.c (original)
+++ freeswitch/branches/greenlizard/src/mod/loggers/mod_syslog/mod_syslog.c Thu Jun 14 12:39:04 2007
@@ -39,7 +39,10 @@
#define DEFAULT_FORMAT "[message]"
#define MAX_LENGTH 1024
-static const char modname[] = "mod_syslog";
+SWITCH_MODULE_LOAD_FUNCTION(mod_syslog_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_syslog_shutdown);
+SWITCH_MODULE_DEFINITION(mod_syslog, mod_syslog_load, mod_syslog_shutdown, NULL);
+
static switch_status_t load_config(void);
static struct {
@@ -148,10 +151,10 @@
return 0;
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_syslog_load)
{
switch_status_t status;
- *interface = &console_module_interface;
+ *module_interface = &console_module_interface;
if ((status = load_config()) != SWITCH_STATUS_SUCCESS) {
return status;
@@ -164,7 +167,7 @@
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_unload(const switch_loadable_module_interface_t **interface)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_syslog_shutdown)
{
closelog();
Modified: freeswitch/branches/greenlizard/src/mod/say/mod_say_en/mod_say_en.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/say/mod_say_en/mod_say_en.c (original)
+++ freeswitch/branches/greenlizard/src/mod/say/mod_say_en/mod_say_en.c Thu Jun 14 12:39:04 2007
@@ -33,8 +33,8 @@
#include <math.h>
#include <ctype.h>
-static const char modname[] = "mod_say_en";
-
+SWITCH_MODULE_LOAD_FUNCTION(mod_say_en_load);
+SWITCH_MODULE_DEFINITION(mod_say_en, mod_say_en_load, NULL, NULL);
#define say_num(num, t) { \
char tmp[80];\
@@ -510,12 +510,12 @@
return SWITCH_STATUS_FALSE;
}
-static const switch_say_interface_t es_say_interface = {
+static switch_say_interface_t es_say_interface = {
/*.name */ "es",
/*.say_function */ en_say,
};
-static const switch_say_interface_t en_say_interface = {
+static switch_say_interface_t en_say_interface = {
/*.name */ "en",
/*.say_function */ en_say,
/*.next */ &es_say_interface
@@ -537,7 +537,7 @@
/*.asr_interface */ NULL
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_say_en_load)
{
/* connect my internal structure to the blank pointer passed to me */
*module_interface = &say_en_module_interface;
Modified: freeswitch/branches/greenlizard/src/mod/timers/mod_softtimer/mod_softtimer.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/timers/mod_softtimer/mod_softtimer.c (original)
+++ freeswitch/branches/greenlizard/src/mod/timers/mod_softtimer/mod_softtimer.c Thu Jun 14 12:39:04 2007
@@ -46,7 +46,11 @@
switch_mutex_t *mutex;
} globals;
-static const char modname[] = "mod_softtimer";
+SWITCH_MODULE_LOAD_FUNCTION(mod_softtimer_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_softtimer_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_softtimer_runtime);
+SWITCH_MODULE_DEFINITION(mod_softtimer, mod_softtimer_load, mod_softtimer_shutdown, mod_softtimer_runtime);
+
#define MAX_ELEMENTS 1000
struct timer_private {
@@ -182,7 +186,7 @@
return SWITCH_STATUS_SUCCESS;
}
-static const switch_timer_interface_t timer_interface = {
+static switch_timer_interface_t timer_interface = {
/*.interface_name */ "soft",
/*.timer_init */ timer_init,
/*.timer_next */ timer_next,
@@ -191,13 +195,13 @@
/*.timer_destroy */ timer_destroy
};
-static const switch_loadable_module_interface_t mod_softtimer_module_interface = {
+static switch_loadable_module_interface_t softtimer_module_interface = {
/*.module_name */ modname,
/*.endpoint_interface */ NULL,
/*.timer_interface */ &timer_interface
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_softtimer_load)
{
if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
@@ -206,7 +210,7 @@
}
/* connect my internal structure to the blank pointer passed to me */
- *module_interface = &mod_softtimer_module_interface;
+ *module_interface = &softtimer_module_interface;
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
@@ -218,7 +222,8 @@
#define STEP_MS 1
#define STEP_MIC 1000
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_softtimer_runtime)
{
switch_time_t reference = switch_time_now();
uint32_t current_ms = 0;
@@ -267,8 +272,7 @@
return SWITCH_STATUS_TERM;
}
-
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_softtimer_shutdown)
{
if (globals.RUNNING) {
Modified: freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c (original)
+++ freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c Thu Jun 14 12:39:04 2007
@@ -32,7 +32,8 @@
#include <sys/stat.h>
#include <switch.h>
-static const char modname[] = "mod_xml_cdr";
+SWITCH_MODULE_LOAD_FUNCTION(mod_xml_cdr_load);
+SWITCH_MODULE_DEFINITION(mod_xml_cdr, mod_xml_cdr_load, NULL, NULL);
static switch_status_t my_on_hangup(switch_core_session_t *session)
{
@@ -81,7 +82,7 @@
return SWITCH_STATUS_SUCCESS;
}
-static const switch_state_handler_table_t state_handlers = {
+static switch_state_handler_table_t state_handlers = {
/*.on_init */ NULL,
/*.on_ring */ NULL,
/*.on_execute */ NULL,
@@ -91,7 +92,7 @@
};
-static const switch_loadable_module_interface_t mod_xml_cdr_module_interface = {
+static switch_loadable_module_interface_t xml_cdr_module_interface = {
/*.module_name = */ modname,
/*.endpoint_interface = */ NULL,
/*.timer_interface = */ NULL,
@@ -100,12 +101,12 @@
/*.application_interface */ NULL
};
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_xml_cdr_load)
{
/* test global state handlers */
switch_core_add_state_handler(&state_handlers);
- *module_interface = &mod_xml_cdr_module_interface;
+ *module_interface = &xml_cdr_module_interface;
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c (original)
+++ freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c Thu Jun 14 12:39:04 2007
@@ -31,7 +31,9 @@
#include <switch.h>
#include <curl/curl.h>
-static const char modname[] = "mod_xml_curl";
+SWITCH_MODULE_LOAD_FUNCTION(mod_xml_curl_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_curl_shutdown);
+SWITCH_MODULE_DEFINITION(mod_xml_curl, mod_xml_curl_load, mod_xml_curl_shutdown, NULL);
struct xml_binding {
char *url;
@@ -229,7 +231,7 @@
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_xml_curl_load)
{
/* connect my internal structure to the blank pointer passed to me */
*module_interface = &xml_curl_module_interface;
@@ -244,7 +246,7 @@
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_curl_shutdown)
{
curl_global_cleanup();
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c (original)
+++ freeswitch/branches/greenlizard/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c Thu Jun 14 12:39:04 2007
@@ -42,7 +42,10 @@
#include <xmlrpc-c/server.h>
#include <xmlrpc-c/server_abyss.h>
-static const char modname[] = "mod_xml_rpc";
+SWITCH_MODULE_LOAD_FUNCTION(mod_xml_rpc_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_rpc_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_xml_rpc_runtime);
+SWITCH_MODULE_DEFINITION(mod_xml_rpc, mod_xml_rpc_load, mod_xml_rpc_shutdown, mod_xml_rpc_runtime);
static switch_loadable_module_interface_t xml_rpc_module_interface = {
/*.module_name */ modname,
@@ -112,7 +115,7 @@
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename)
+SWITCH_MODULE_LOAD_FUNCTION(mod_xml_rpc_load)
{
/* connect my internal structure to the blank pointer passed to me */
*module_interface = &xml_rpc_module_interface;
@@ -357,7 +360,7 @@
return val;
}
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void)
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_xml_rpc_runtime)
{
TServer abyssServer;
xmlrpc_registry *registryP;
@@ -402,7 +405,7 @@
-SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_rpc_shutdown)
{
globals.running = 0;
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/switch_channel.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_channel.c (original)
+++ freeswitch/branches/greenlizard/src/switch_channel.c Thu Jun 14 12:39:04 2007
@@ -208,7 +208,11 @@
assert(channel != NULL);
- switch_mutex_lock(channel->dtmf_mutex);
+ switch_mutex_lock(channel->dtmf_mutex);
+
+ if ((status = switch_core_session_recv_dtmf(channel->session, dtmf) != SWITCH_STATUS_SUCCESS)) {
+ goto done;
+ }
inuse = switch_buffer_inuse(channel->dtmf_buffer);
len = strlen(dtmf);
@@ -227,6 +231,9 @@
p++;
}
status = switch_buffer_write(channel->dtmf_buffer, dtmf, wr) ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_MEMERR;
+
+ done:
+
switch_mutex_unlock(channel->dtmf_mutex);
return status;
Modified: freeswitch/branches/greenlizard/src/switch_core_codec.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_core_codec.c (original)
+++ freeswitch/branches/greenlizard/src/switch_core_codec.c Thu Jun 14 12:39:04 2007
@@ -48,6 +48,9 @@
}
session->read_codec = codec;
+ session->raw_read_frame.codec = session->read_codec;
+ session->raw_write_frame.codec = session->read_codec;
+
return SWITCH_STATUS_SUCCESS;
}
Modified: freeswitch/branches/greenlizard/src/switch_core_event_hook.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_core_event_hook.c (original)
+++ freeswitch/branches/greenlizard/src/switch_core_event_hook.c Thu Jun 14 12:39:04 2007
@@ -31,222 +31,18 @@
#include "switch.h"
#include "private/switch_core_pvt.h"
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_outgoing(switch_core_session_t *session, switch_outgoing_channel_hook_t outgoing_channel)
-{
- switch_io_event_hook_outgoing_channel_t *hook, *ptr;
+
- assert(outgoing_channel != NULL);
- if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) {
- hook->outgoing_channel = outgoing_channel;
- if (!session->event_hooks.outgoing_channel) {
- session->event_hooks.outgoing_channel = hook;
- } else {
- for (ptr = session->event_hooks.outgoing_channel; ptr && ptr->next; ptr = ptr->next);
- ptr->next = hook;
-
- }
-
- return SWITCH_STATUS_SUCCESS;
- }
-
- return SWITCH_STATUS_MEMERR;
-}
-
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_state_change(switch_core_session_t *session, switch_state_change_hook_t state_change)
-{
- switch_io_event_hook_state_change_t *hook, *ptr;
-
- assert(state_change != NULL);
- if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) {
- hook->state_change = state_change;
- if (!session->event_hooks.state_change) {
- session->event_hooks.state_change = hook;
- } else {
- for (ptr = session->event_hooks.state_change; ptr && ptr->next; ptr = ptr->next);
- ptr->next = hook;
-
- }
-
- return SWITCH_STATUS_SUCCESS;
- }
-
- return SWITCH_STATUS_MEMERR;
-
-}
-
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_read_frame(switch_core_session_t *session, switch_read_frame_hook_t read_frame)
-{
- switch_io_event_hook_read_frame_t *hook, *ptr;
-
- assert(read_frame != NULL);
- if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) {
- hook->read_frame = read_frame;
- if (!session->event_hooks.read_frame) {
- session->event_hooks.read_frame = hook;
- } else {
- for (ptr = session->event_hooks.read_frame; ptr && ptr->next; ptr = ptr->next);
- ptr->next = hook;
-
- }
-
- return SWITCH_STATUS_SUCCESS;
- }
-
- return SWITCH_STATUS_MEMERR;
-
-}
-
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_write_frame(switch_core_session_t *session, switch_write_frame_hook_t write_frame)
-{
- switch_io_event_hook_write_frame_t *hook, *ptr;
-
- assert(write_frame != NULL);
- if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) {
- hook->write_frame = write_frame;
- if (!session->event_hooks.write_frame) {
- session->event_hooks.write_frame = hook;
- } else {
- for (ptr = session->event_hooks.write_frame; ptr && ptr->next; ptr = ptr->next);
- ptr->next = hook;
-
- }
-
- return SWITCH_STATUS_SUCCESS;
- }
-
- return SWITCH_STATUS_MEMERR;
-
-}
-
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_video_read_frame(switch_core_session_t *session, switch_video_read_frame_hook_t video_read_frame)
-{
- switch_io_event_hook_video_read_frame_t *hook, *ptr;
-
- assert(video_read_frame != NULL);
- if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) {
- hook->video_read_frame = video_read_frame;
- if (!session->event_hooks.video_read_frame) {
- session->event_hooks.video_read_frame = hook;
- } else {
- for (ptr = session->event_hooks.video_read_frame; ptr && ptr->next; ptr = ptr->next);
- ptr->next = hook;
-
- }
-
- return SWITCH_STATUS_SUCCESS;
- }
-
- return SWITCH_STATUS_MEMERR;
-
-}
-
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_video_write_frame(switch_core_session_t *session, switch_video_write_frame_hook_t video_write_frame)
-{
- switch_io_event_hook_video_write_frame_t *hook, *ptr;
-
- assert(video_write_frame != NULL);
- if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) {
- hook->video_write_frame = video_write_frame;
- if (!session->event_hooks.video_write_frame) {
- session->event_hooks.video_write_frame = hook;
- } else {
- for (ptr = session->event_hooks.video_write_frame; ptr && ptr->next; ptr = ptr->next);
- ptr->next = hook;
-
- }
-
- return SWITCH_STATUS_SUCCESS;
- }
-
- return SWITCH_STATUS_MEMERR;
-
-}
-
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_kill_channel(switch_core_session_t *session, switch_kill_channel_hook_t kill_channel)
-{
- switch_io_event_hook_kill_channel_t *hook, *ptr;
-
- assert(kill_channel != NULL);
- if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) {
- hook->kill_channel = kill_channel;
- if (!session->event_hooks.kill_channel) {
- session->event_hooks.kill_channel = hook;
- } else {
- for (ptr = session->event_hooks.kill_channel; ptr && ptr->next; ptr = ptr->next);
- ptr->next = hook;
-
- }
-
- return SWITCH_STATUS_SUCCESS;
- }
-
- return SWITCH_STATUS_MEMERR;
-
-}
-
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_waitfor_read(switch_core_session_t *session, switch_waitfor_read_hook_t waitfor_read)
-{
- switch_io_event_hook_waitfor_read_t *hook, *ptr;
-
- assert(waitfor_read != NULL);
- if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) {
- hook->waitfor_read = waitfor_read;
- if (!session->event_hooks.waitfor_read) {
- session->event_hooks.waitfor_read = hook;
- } else {
- for (ptr = session->event_hooks.waitfor_read; ptr && ptr->next; ptr = ptr->next);
- ptr->next = hook;
-
- }
-
- return SWITCH_STATUS_SUCCESS;
- }
-
- return SWITCH_STATUS_MEMERR;
-
-}
-
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_waitfor_write(switch_core_session_t *session, switch_waitfor_write_hook_t waitfor_write)
-{
- switch_io_event_hook_waitfor_write_t *hook, *ptr;
-
- assert(waitfor_write != NULL);
- if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) {
- hook->waitfor_write = waitfor_write;
- if (!session->event_hooks.waitfor_write) {
- session->event_hooks.waitfor_write = hook;
- } else {
- for (ptr = session->event_hooks.waitfor_write; ptr && ptr->next; ptr = ptr->next);
- ptr->next = hook;
-
- }
-
- return SWITCH_STATUS_SUCCESS;
- }
-
- return SWITCH_STATUS_MEMERR;
-
-}
-
-
-SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_send_dtmf(switch_core_session_t *session, switch_send_dtmf_hook_t send_dtmf)
-{
- switch_io_event_hook_send_dtmf_t *hook, *ptr;
-
- assert(send_dtmf != NULL);
- if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) {
- hook->send_dtmf = send_dtmf;
- if (!session->event_hooks.send_dtmf) {
- session->event_hooks.send_dtmf = hook;
- } else {
- for (ptr = session->event_hooks.send_dtmf; ptr && ptr->next; ptr = ptr->next);
- ptr->next = hook;
-
- }
-
- return SWITCH_STATUS_SUCCESS;
- }
-
- return SWITCH_STATUS_MEMERR;
-
-}
+NEW_HOOK_DECL(outgoing_channel)
+NEW_HOOK_DECL(receive_message)
+NEW_HOOK_DECL(receive_event)
+NEW_HOOK_DECL(state_change)
+NEW_HOOK_DECL(read_frame)
+NEW_HOOK_DECL(write_frame)
+NEW_HOOK_DECL(video_read_frame)
+NEW_HOOK_DECL(video_write_frame)
+NEW_HOOK_DECL(kill_channel)
+NEW_HOOK_DECL(waitfor_read)
+NEW_HOOK_DECL(waitfor_write)
+NEW_HOOK_DECL(send_dtmf)
+NEW_HOOK_DECL(recv_dtmf)
Modified: freeswitch/branches/greenlizard/src/switch_core_io.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_core_io.c (original)
+++ freeswitch/branches/greenlizard/src/switch_core_io.c Thu Jun 14 12:39:04 2007
@@ -225,7 +225,7 @@
if (session->bugs) {
switch_media_bug_t *bp, *dp, *last = NULL;
-
+ switch_bool_t ok = SWITCH_TRUE;
switch_thread_rwlock_rdlock(session->bug_rwlock);
for (bp = session->bugs; bp; bp = bp->next) {
if (bp->ready && switch_test_flag(bp, SMBF_READ_STREAM)) {
@@ -233,23 +233,35 @@
switch_buffer_write(bp->raw_read_buffer, read_frame->data, read_frame->datalen);
if (bp->callback) {
if (bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_READ) == SWITCH_FALSE || (bp->stop_time && bp->stop_time >= time(NULL))) {
- bp->ready = 0;
- if (last) {
- last->next = bp->next;
- } else {
- session->bugs = bp->next;
- }
- switch_mutex_unlock(bp->read_mutex);
- dp = bp;
- bp = last;
- switch_core_media_bug_close(&dp);
- if (!bp) {
- break;
- }
- continue;
+ ok = SWITCH_FALSE;
}
}
switch_mutex_unlock(bp->read_mutex);
+ } else if (switch_test_flag(bp, SMBF_READ_REPLACE)) {
+ do_bugs = 0;
+ if (bp->callback) {
+ bp->read_replace_frame_in = read_frame;
+ bp->read_replace_frame_out = NULL;
+ if ((ok = bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_READ_REPLACE)) == SWITCH_TRUE) {
+ read_frame = bp->read_replace_frame_out;
+ }
+ }
+ }
+
+ if (ok == SWITCH_FALSE) {
+ bp->ready = 0;
+ if (last) {
+ last->next = bp->next;
+ } else {
+ session->bugs = bp->next;
+ }
+ dp = bp;
+ bp = last;
+ switch_core_media_bug_close(&dp);
+ if (!bp) {
+ break;
+ }
+ continue;
}
last = bp;
}
@@ -288,6 +300,7 @@
enc_frame = &session->raw_read_frame;
}
session->enc_read_frame.datalen = session->enc_read_frame.buflen;
+
assert(session->read_codec != NULL);
assert(enc_frame != NULL);
assert(enc_frame->data != NULL);
@@ -304,7 +317,6 @@
case SWITCH_STATUS_RESAMPLE:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "fixme 1\n");
case SWITCH_STATUS_SUCCESS:
- session->enc_read_frame.codec = session->read_codec;
session->enc_read_frame.samples = session->read_codec->implementation->bytes_per_frame / sizeof(int16_t);
session->enc_read_frame.timestamp = read_frame->timestamp;
session->enc_read_frame.rate = read_frame->rate;
@@ -315,7 +327,6 @@
*frame = &session->enc_read_frame;
break;
case SWITCH_STATUS_NOOP:
- session->raw_read_frame.codec = session->read_codec;
session->raw_read_frame.samples = enc_frame->codec->implementation->samples_per_frame;
session->raw_read_frame.timestamp = read_frame->timestamp;
session->raw_read_frame.payload = enc_frame->codec->implementation->ianacode;
@@ -464,7 +475,7 @@
session->write_resampler->from_len = write_frame->datalen / 2;
switch_short_to_float(data, session->write_resampler->from, session->write_resampler->from_len);
-
+
session->write_resampler->to_len = (uint32_t)
switch_resample_process(session->write_resampler, session->write_resampler->from,
@@ -497,10 +508,10 @@
} else if (switch_test_flag(bp, SMBF_WRITE_REPLACE)) {
do_bugs = 0;
if (bp->callback) {
- bp->replace_frame_in = frame;
- bp->replace_frame_out = NULL;
+ bp->write_replace_frame_in = write_frame;
+ bp->write_replace_frame_out = NULL;
if ((ok = bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_WRITE_REPLACE)) == SWITCH_TRUE) {
- write_frame = bp->replace_frame_out;
+ write_frame = bp->write_replace_frame_out;
}
}
}
@@ -790,14 +801,34 @@
}
-SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf(switch_core_session_t *session, char *dtmf)
+SWITCH_DECLARE(switch_status_t) switch_core_session_recv_dtmf(switch_core_session_t *session, const char *dtmf)
+{
+ switch_io_event_hook_recv_dtmf_t *ptr;
+ switch_status_t status;
+
+ for (ptr = session->event_hooks.recv_dtmf; ptr; ptr = ptr->next) {
+ if ((status = ptr->recv_dtmf(session, dtmf)) != SWITCH_STATUS_SUCCESS) {
+ return status;
+ }
+ }
+ return SWITCH_STATUS_SUCCESS;
+}
+
+SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf(switch_core_session_t *session, const char *dtmf)
{
switch_io_event_hook_send_dtmf_t *ptr;
switch_status_t status = SWITCH_STATUS_FALSE;
-
+
+
+ for (ptr = session->event_hooks.send_dtmf; ptr; ptr = ptr->next) {
+ if ((status = ptr->send_dtmf(session, dtmf)) != SWITCH_STATUS_SUCCESS) {
+ return SWITCH_STATUS_SUCCESS;
+ }
+ }
+
if (session->endpoint_interface->io_routines->send_dtmf) {
if (strchr(dtmf, 'w') || strchr(dtmf, 'W')) {
- char *d;
+ const char *d;
for (d = dtmf; d && *d; d++) {
char digit[2] = { 0 };
@@ -815,16 +846,9 @@
}
}
} else {
- status = session->endpoint_interface->io_routines->send_dtmf(session, dtmf);
+ status = session->endpoint_interface->io_routines->send_dtmf(session, (char *)dtmf);
}
- if (status == SWITCH_STATUS_SUCCESS) {
- for (ptr = session->event_hooks.send_dtmf; ptr; ptr = ptr->next) {
- if ((status = ptr->send_dtmf(session, dtmf)) != SWITCH_STATUS_SUCCESS) {
- break;
- }
- }
- }
}
return status;
Modified: freeswitch/branches/greenlizard/src/switch_core_media_bug.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_core_media_bug.c (original)
+++ freeswitch/branches/greenlizard/src/switch_core_media_bug.c Thu Jun 14 12:39:04 2007
@@ -41,14 +41,24 @@
}
-SWITCH_DECLARE(switch_frame_t *) switch_core_media_bug_get_replace_frame(switch_media_bug_t *bug)
+SWITCH_DECLARE(switch_frame_t *) switch_core_media_bug_get_write_replace_frame(switch_media_bug_t *bug)
{
- return bug->replace_frame_in;
+ return bug->write_replace_frame_in;
}
-SWITCH_DECLARE(void) switch_core_media_bug_set_replace_frame(switch_media_bug_t *bug, switch_frame_t *frame)
+SWITCH_DECLARE(void) switch_core_media_bug_set_write_replace_frame(switch_media_bug_t *bug, switch_frame_t *frame)
{
- bug->replace_frame_out = frame;
+ bug->write_replace_frame_out = frame;
+}
+
+SWITCH_DECLARE(switch_frame_t *) switch_core_media_bug_get_read_replace_frame(switch_media_bug_t *bug)
+{
+ return bug->read_replace_frame_in;
+}
+
+SWITCH_DECLARE(void) switch_core_media_bug_set_read_replace_frame(switch_media_bug_t *bug, switch_frame_t *frame)
+{
+ bug->read_replace_frame_out = frame;
}
SWITCH_DECLARE(void *) switch_core_media_bug_get_user_data(switch_media_bug_t *bug)
@@ -161,6 +171,18 @@
switch_thread_rwlock_unlock(session->bug_rwlock);
}
+ if (flags & SMBF_READ_REPLACE) {
+ switch_thread_rwlock_wrlock(session->bug_rwlock);
+ for (bp = session->bugs; bp; bp = bp->next) {
+ if (switch_test_flag(bp, SMBF_READ_REPLACE)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Only one bug of this type allowed!\n");
+ switch_thread_rwlock_unlock(session->bug_rwlock);
+ return SWITCH_STATUS_GENERR;
+ }
+ }
+ switch_thread_rwlock_unlock(session->bug_rwlock);
+ }
+
if (!(bug = switch_core_session_alloc(session, sizeof(*bug)))) {
return SWITCH_STATUS_MEMERR;
}
Modified: freeswitch/branches/greenlizard/src/switch_ivr.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_ivr.c (original)
+++ freeswitch/branches/greenlizard/src/switch_ivr.c Thu Jun 14 12:39:04 2007
@@ -871,6 +871,14 @@
context = new_profile->context;
}
+ if (switch_strlen_zero(context)) {
+ context = "default";
+ }
+
+ if (switch_strlen_zero(dialplan)) {
+ context = "XML";
+ }
+
switch_channel_set_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE, NULL);
if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))
Modified: freeswitch/branches/greenlizard/src/switch_ivr_bridge.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_ivr_bridge.c (original)
+++ freeswitch/branches/greenlizard/src/switch_ivr_bridge.c Thu Jun 14 12:39:04 2007
@@ -120,7 +120,6 @@
char dtmf[128];
switch_channel_dequeue_dtmf(chan_a, dtmf, sizeof(dtmf));
switch_core_session_send_dtmf(session_b, dtmf);
-
if (input_callback) {
if (input_callback(session_a, dtmf, SWITCH_INPUT_TYPE_DTMF, user_data, 0) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s ended call via DTMF\n", switch_channel_get_name(chan_a));
@@ -526,13 +525,13 @@
switch_copy_string(b_leg->b_uuid, switch_core_session_get_uuid(session), sizeof(b_leg->b_uuid));
b_leg->stream_id = stream_id;
b_leg->input_callback = input_callback;
- b_leg->session_data = session_data;
+ b_leg->session_data = peer_session_data;
a_leg->session = session;
switch_copy_string(a_leg->b_uuid, switch_core_session_get_uuid(peer_session), sizeof(a_leg->b_uuid));
- b_leg->stream_id = stream_id;
- b_leg->input_callback = input_callback;
- b_leg->session_data = peer_session_data;
+ a_leg->stream_id = stream_id;
+ a_leg->input_callback = input_callback;
+ a_leg->session_data = session_data;
switch_channel_add_state_handler(peer_channel, &audio_bridge_peer_state_handlers);
@@ -543,6 +542,8 @@
if (switch_channel_test_flag(peer_channel, CF_ANSWERED) || switch_channel_test_flag(peer_channel, CF_EARLY_MEDIA)) {
switch_event_t *event;
switch_core_session_message_t msg = { 0 };
+ const switch_application_interface_t *application_interface;
+ char *app, *data;
switch_channel_set_state(peer_channel, CS_HOLD);
@@ -555,6 +556,21 @@
switch_channel_set_variable(caller_channel, SWITCH_BRIDGE_VARIABLE, switch_core_session_get_uuid(peer_session));
switch_channel_set_variable(peer_channel, SWITCH_BRIDGE_VARIABLE, switch_core_session_get_uuid(session));
+ if ((app = switch_channel_get_variable(caller_channel, "bridge_pre_execute_aleg_app"))) {
+ data = switch_channel_get_variable(caller_channel, "bridge_pre_execute_aleg_data");
+ if ((application_interface = switch_loadable_module_get_application_interface(app))) {
+ switch_core_session_exec(session, application_interface, data);
+ }
+ }
+
+ if ((app = switch_channel_get_variable(caller_channel, "bridge_pre_execute_bleg_app"))) {
+ data = switch_channel_get_variable(caller_channel, "bridge_pre_execute_bleg_data");
+ if ((application_interface = switch_loadable_module_get_application_interface(app))) {
+ switch_core_session_exec(peer_session, application_interface, data);
+ }
+ }
+
+
msg.message_id = SWITCH_MESSAGE_INDICATE_BRIDGE;
msg.from = __FILE__;
msg.string_arg = switch_core_session_strdup(peer_session, switch_core_session_get_uuid(session));
Modified: freeswitch/branches/greenlizard/src/switch_loadable_module.c
==============================================================================
--- freeswitch/branches/greenlizard/src/switch_loadable_module.c (original)
+++ freeswitch/branches/greenlizard/src/switch_loadable_module.c Thu Jun 14 12:39:04 2007
@@ -44,7 +44,7 @@
char *key;
char *filename;
int perm;
- const switch_loadable_module_interface_t *module_interface;
+ switch_loadable_module_interface_t *module_interface;
void *lib;
switch_module_load_t switch_module_load;
switch_module_runtime_t switch_module_runtime;
@@ -636,11 +636,14 @@
}
-static switch_status_t switch_loadable_module_load_file(char *filename, switch_loadable_module_t **new_module)
+static switch_status_t switch_loadable_module_load_file(char *path, char *filename, switch_loadable_module_t **new_module)
{
switch_loadable_module_t *module = NULL;
switch_dso_handle_t *dso = NULL;
apr_status_t status = SWITCH_STATUS_SUCCESS;
+ switch_dso_handle_sym_t interface_struct_handle = NULL;
+ switch_loadable_module_function_table_t *mod_interface_functions = NULL;
+ char *struct_name = NULL;
switch_dso_handle_sym_t load_function_handle = NULL;
switch_dso_handle_sym_t shutdown_function_handle = NULL;
switch_dso_handle_sym_t runtime_function_handle = NULL;
@@ -651,10 +654,10 @@
char derr[512] = "";
switch_memory_pool_t *pool;
- assert(filename != NULL);
+ assert(path != NULL);
*new_module = NULL;
- status = switch_dso_load(&dso, filename, loadable_modules.pool);
+ status = switch_dso_load(&dso, path, loadable_modules.pool);
if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
@@ -668,15 +671,22 @@
break;
}
- status = switch_dso_sym(&load_function_handle, dso, "switch_module_load");
- load_func_ptr = (switch_module_load_t) (intptr_t) load_function_handle;
+ struct_name = switch_core_sprintf(pool, "%s_module_interface", filename);
+ status = switch_dso_sym(&interface_struct_handle, dso, struct_name);
+ if (interface_struct_handle) {
+ mod_interface_functions = interface_struct_handle;
+ load_func_ptr = mod_interface_functions->load;
+ } else {
+ status = switch_dso_sym(&load_function_handle, dso, "switch_module_load");
+ load_func_ptr = (switch_module_load_t) (intptr_t) load_function_handle;
+ }
if (load_func_ptr == NULL) {
err = "Cannot locate symbol 'switch_module_load' please make sure this is a vaild module.";
break;
}
- status = load_func_ptr(&module_interface, filename);
+ status = load_func_ptr(&module_interface, pool);
if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_NOUNLOAD) {
err = "Module load routine returned an error";
@@ -701,19 +711,24 @@
if (pool) {
switch_core_destroy_memory_pool(&pool);
}
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Loading module %s\n**%s**\n", filename, err);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Loading module %s\n**%s**\n", path, err);
return SWITCH_STATUS_GENERR;
}
module->pool = pool;
- module->filename = switch_core_strdup(module->pool, filename);
+ module->filename = switch_core_strdup(module->pool, path);
module->module_interface = module_interface;
module->switch_module_load = load_func_ptr;
- switch_dso_sym(&shutdown_function_handle, dso, "switch_module_shutdown");
- module->switch_module_shutdown = (switch_module_shutdown_t) (intptr_t) shutdown_function_handle;
- switch_dso_sym(&runtime_function_handle, dso, "switch_module_runtime");
- module->switch_module_runtime = (switch_module_runtime_t) (intptr_t) runtime_function_handle;
+ if (mod_interface_functions) {
+ module->switch_module_shutdown = mod_interface_functions->shutdown;
+ module->switch_module_runtime = mod_interface_functions->runtime;
+ } else {
+ switch_dso_sym(&shutdown_function_handle, dso, "switch_module_shutdown");
+ module->switch_module_shutdown = (switch_module_shutdown_t) (intptr_t) shutdown_function_handle;
+ switch_dso_sym(&runtime_function_handle, dso, "switch_module_runtime");
+ module->switch_module_runtime = (switch_module_runtime_t) (intptr_t) runtime_function_handle;
+ }
module->lib = dso;
@@ -728,7 +743,7 @@
{
switch_size_t len = 0;
char *path;
- char *file;
+ char *file, *dot;
switch_loadable_module_t *new_module = NULL;
switch_status_t status;
@@ -747,29 +762,28 @@
if (*file == '/') {
path = switch_core_strdup(loadable_modules.pool, file);
+ file = (char *)switch_cut_path(file);
+ if ((dot = strchr(file, '.'))) {
+ dot = '\0';
+ }
} else {
- if (strchr(file, '.')) {
- len = strlen(dir);
- len += strlen(file);
- len += 4;
- path = (char *) switch_core_alloc(loadable_modules.pool, len);
- snprintf(path, len, "%s%s%s", dir, SWITCH_PATH_SEPARATOR, file);
- } else {
- len = strlen(dir);
- len += strlen(file);
- len += 8;
- path = (char *) switch_core_alloc(loadable_modules.pool, len);
- snprintf(path, len, "%s%s%s%s", dir, SWITCH_PATH_SEPARATOR, file, ext);
+ if ((dot = strchr(file, '.'))) {
+ dot = '\0';
}
+ len = strlen(dir);
+ len += strlen(file);
+ len += 8;
+ path = (char *) switch_core_alloc(loadable_modules.pool, len);
+ snprintf(path, len, "%s%s%s%s", dir, SWITCH_PATH_SEPARATOR, file, ext);
}
switch_mutex_lock(loadable_modules.mutex);
if (switch_core_hash_find(loadable_modules.module_hash, file)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Module %s Already Loaded!\n", file);
- *err = "Module already loadedn\n";
+ *err = "Module already loaded";
status = SWITCH_STATUS_FALSE;
- } else if ((status = switch_loadable_module_load_file(path, &new_module) == SWITCH_STATUS_SUCCESS)) {
- if ((status = switch_loadable_module_process((char *) file, new_module)) == SWITCH_STATUS_SUCCESS && runtime) {
+ } else if ((status = switch_loadable_module_load_file(path, file, &new_module) == SWITCH_STATUS_SUCCESS)) {
+ if ((status = switch_loadable_module_process(file, new_module)) == SWITCH_STATUS_SUCCESS && runtime) {
if (new_module->switch_module_runtime) {
switch_core_launch_thread(switch_loadable_module_exec, new_module, new_module->pool);
}
@@ -785,37 +799,11 @@
SWITCH_DECLARE(switch_status_t) switch_loadable_module_unload_module(char *dir, char *fname, const char **err)
{
- char *path = NULL;
- char *file = NULL;
switch_loadable_module_t *module = NULL;
switch_status_t status = SWITCH_STATUS_SUCCESS;
-#ifdef WIN32
- const char *ext = ".dll";
-#elif defined (MACOSX) || defined (DARWIN)
- const char *ext = ".dylib";
-#else
- const char *ext = ".so";
-#endif
-
-
- if (!(file = strdup(fname))) {
- abort();
- }
-
- if (*file == '/') {
- path = strdup(file);
- } else {
- if (strchr(file, '.')) {
- path = switch_mprintf("%s%s%s", dir, SWITCH_PATH_SEPARATOR, file);
- } else {
- path = switch_mprintf("%s%s%s%s", dir, SWITCH_PATH_SEPARATOR, file, ext);
- }
- }
-
-
switch_mutex_lock(loadable_modules.mutex);
- if ((module = switch_core_hash_find(loadable_modules.module_hash, file))) {
+ if ((module = switch_core_hash_find(loadable_modules.module_hash, fname))) {
if (module->perm) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Module is not unloadable.\n");
*err = "Module is not unloadable";
@@ -829,9 +817,6 @@
}
switch_mutex_unlock(loadable_modules.mutex);
- switch_safe_free(file);
- switch_safe_free(path);
-
return status;
}
@@ -870,7 +855,7 @@
break;
}
- status = load_func_ptr(&module_interface, filename);
+ status = load_func_ptr(&module_interface, pool);
if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_NOUNLOAD) {
err = "Module load routine returned an error";
@@ -1212,7 +1197,7 @@
/* oh well we will use what we have */
array[i++] = codec_interface->implementations;
- found:
+ found:
if (i > arraylen) {
break;
@@ -1297,7 +1282,7 @@
}
}
- found:
+ found:
if (i > arraylen) {
break;
@@ -1348,6 +1333,84 @@
return status;
}
+
+SWITCH_DECLARE(switch_loadable_module_interface_t *) switch_loadable_module_create_module_interface(switch_memory_pool_t *pool, const char *name)
+{
+ switch_loadable_module_interface_t *mod;
+
+ mod = switch_core_alloc(pool, sizeof(switch_loadable_module_interface_t));
+ assert(mod != NULL);
+
+ mod->pool = pool;
+
+ mod->module_name = switch_core_strdup(mod->pool, name);
+
+ return mod;
+}
+
+#define ALLOC_INTERFACE(_TYPE_) for(;;) { \
+ switch_##_TYPE_##_interface_t *i, *ptr; \
+ i = switch_core_alloc(mod->pool, sizeof(switch_##_TYPE_##_interface_t)); \
+ assert(i != NULL); \
+ for (ptr = mod->_TYPE_##_interface; ptr && ptr->next; ptr = ptr->next); \
+ if (ptr) { \
+ ptr->next = i; \
+ } else { \
+ mod->_TYPE_##_interface = i; \
+ } \
+ \
+ return i; }
+
+
+SWITCH_DECLARE(void *) switch_loadable_module_create_interface(switch_loadable_module_interface_t *mod, switch_module_interface_name_t iname)
+{
+
+ switch(iname) {
+ case SWITCH_ENDPOINT_INTERFACE:
+ ALLOC_INTERFACE(endpoint);
+
+ case SWITCH_TIMER_INTERFACE:
+ ALLOC_INTERFACE(timer);
+
+ case SWITCH_DIALPLAN_INTERFACE:
+ ALLOC_INTERFACE(dialplan);
+
+ case SWITCH_CODEC_INTERFACE:
+ ALLOC_INTERFACE(codec);
+
+ case SWITCH_APPLICATION_INTERFACE:
+ ALLOC_INTERFACE(application);
+
+ case SWITCH_API_INTERFACE:
+ ALLOC_INTERFACE(api);
+
+ case SWITCH_FILE_INTERFACE:
+ ALLOC_INTERFACE(file);
+
+ case SWITCH_SPEECH_INTERFACE:
+ ALLOC_INTERFACE(speech);
+
+ case SWITCH_DIRECTORY_INTERFACE:
+ ALLOC_INTERFACE(directory);
+
+ case SWITCH_CHAT_INTERFACE:
+ ALLOC_INTERFACE(chat);
+
+ case SWITCH_SAY_INTERFACE:
+ ALLOC_INTERFACE(say);
+
+ case SWITCH_ASR_INTERFACE:
+ ALLOC_INTERFACE(asr);
+
+ case SWITCH_MANAGEMENT_INTERFACE:
+ ALLOC_INTERFACE(management);
+
+ default:
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid Module Type!\n");
+ return NULL;
+ }
+}
+
/* For Emacs:
* Local Variables:
* mode:c
Modified: freeswitch/branches/greenlizard/w32/Setup/Setup.vdproj
==============================================================================
--- freeswitch/branches/greenlizard/w32/Setup/Setup.vdproj (original)
+++ freeswitch/branches/greenlizard/w32/Setup/Setup.vdproj Thu Jun 14 12:39:04 2007
@@ -21,168 +21,270 @@
}
"Entry"
{
+ "MsmKey" = "8:_0F091427EEA0245FBA87474748D35ABD"
+ "OwnerKey" = "8:_4A285D260C3748A4BEFA6E5A9004D128"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
"MsmKey" = "8:_1273F63008CF585CA0E063E436B4646F"
"OwnerKey" = "8:_2D09AB81AB8D45FF97E9DFA4DAC3465D"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_1CFB1AB04E024FC993E0EB4859DF8408"
- "OwnerKey" = "8:_UNDEFINED"
+ "MsmKey" = "8:_1273F63008CF585CA0E063E436B4646F"
+ "OwnerKey" = "8:_FBB0E565B1DE49CE9C827ACAC337AC5B"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_2814E641538B42EFA83525986A9D5AC1"
+ "MsmKey" = "8:_1CFB1AB04E024FC993E0EB4859DF8408"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_28FBC5A60B44423B8A2CC378347483CE"
- "OwnerKey" = "8:_UNDEFINED"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "OwnerKey" = "8:_1CFB1AB04E024FC993E0EB4859DF8408"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_2D09AB81AB8D45FF97E9DFA4DAC3465D"
- "OwnerKey" = "8:_UNDEFINED"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "OwnerKey" = "8:_FBB0E565B1DE49CE9C827ACAC337AC5B"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_2F2FEC549F02436EB87961BD1B9E5783"
- "OwnerKey" = "8:_UNDEFINED"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "OwnerKey" = "8:_FB1B9FBDC3294F1C96DAC4246C013C22"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_318FCC99E8D143D6B4F9F534E63009B3"
- "OwnerKey" = "8:_UNDEFINED"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "OwnerKey" = "8:_F84240319757424DB1C58AD0AD420127"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
- "OwnerKey" = "8:_1CFB1AB04E024FC993E0EB4859DF8408"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "OwnerKey" = "8:_F0B800E719294692A02518CFD8CBAEFF"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
- "OwnerKey" = "8:_3E37631016BC45B2B672FE23257D542B"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "OwnerKey" = "8:_EF14CB99F3414BB689D0CB0E6D6B8AB8"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
- "OwnerKey" = "8:_FBB0E565B1DE49CE9C827ACAC337AC5B"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "OwnerKey" = "8:_E763C699DF0948B6984DDEB96A2DFD06"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
- "OwnerKey" = "8:_F0B800E719294692A02518CFD8CBAEFF"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "OwnerKey" = "8:_D7EC5795A9C645AC8E129C2EE6D461ED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
- "OwnerKey" = "8:_EF14CB99F3414BB689D0CB0E6D6B8AB8"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "OwnerKey" = "8:_D6F0F5845FAD4707975CE012A33CD607"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
"OwnerKey" = "8:_D2EF447106B24E67907DAED3D39CFBB1"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
"OwnerKey" = "8:_D1269F1E49D442CF8EAC96C23E60325D"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
- "OwnerKey" = "8:_BB649A2C1ABE4895859025B09A240323"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "OwnerKey" = "8:_D0BB09AFB8D94B76918F0EE85BCCAD0A"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "OwnerKey" = "8:_C81AC700C1BC4A55B98DF12C0CBAFD6F"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "OwnerKey" = "8:_C105055EE271471A999CE7022E617EB7"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
"OwnerKey" = "8:_B20769E090034897B32E3EA4EC1BA8A0"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
- "OwnerKey" = "8:_A944ADCEDF884574A23F7BA5420A6BA1"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "OwnerKey" = "8:_B0A2E9B4C45D4098AFD734D0C4E3EAFB"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "OwnerKey" = "8:_AD2EB44FE6D548F2A8DA4F9F2CE817AC"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
"OwnerKey" = "8:_A0D5F714A0F94250A1C39603B699AB82"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "OwnerKey" = "8:_87768631363249B2B301143C193612F7"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
"OwnerKey" = "8:_83C1B93AD71B4F8F9E074F9607B60DF1"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "OwnerKey" = "8:_7358123D2D064AD1BC517911A8B23D1B"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "OwnerKey" = "8:_6E5C001E7A314DCEA0A4BF52BF74BCAD"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "OwnerKey" = "8:_684D96FA2BDD46909367E651099D8C4E"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "OwnerKey" = "8:_5A636BB90F7F4B86ACB8839EA2C899AA"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
"OwnerKey" = "8:_59CFED0C4EC0492C945E4EBC04FE965F"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
"OwnerKey" = "8:_4A285D260C3748A4BEFA6E5A9004D128"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
"OwnerKey" = "8:_3FBEFE0119944C6781F81104ECEF37CA"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "OwnerKey" = "8:_3E37631016BC45B2B672FE23257D542B"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
"OwnerKey" = "8:_318FCC99E8D143D6B4F9F534E63009B3"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
"OwnerKey" = "8:_2F2FEC549F02436EB87961BD1B9E5783"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "OwnerKey" = "8:_2D09AB81AB8D45FF97E9DFA4DAC3465D"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
"OwnerKey" = "8:_28FBC5A60B44423B8A2CC378347483CE"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "MsmKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
"OwnerKey" = "8:_2814E641538B42EFA83525986A9D5AC1"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
+ "MsmKey" = "8:_2814E641538B42EFA83525986A9D5AC1"
+ "OwnerKey" = "8:_UNDEFINED"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
+ "MsmKey" = "8:_28FBC5A60B44423B8A2CC378347483CE"
+ "OwnerKey" = "8:_UNDEFINED"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
+ "MsmKey" = "8:_2D09AB81AB8D45FF97E9DFA4DAC3465D"
+ "OwnerKey" = "8:_UNDEFINED"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
+ "MsmKey" = "8:_2F2FEC549F02436EB87961BD1B9E5783"
+ "OwnerKey" = "8:_UNDEFINED"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
+ "MsmKey" = "8:_318FCC99E8D143D6B4F9F534E63009B3"
+ "OwnerKey" = "8:_UNDEFINED"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
"MsmKey" = "8:_329D8DAE6C01FCF026E9DFB48B932203"
"OwnerKey" = "8:_28FBC5A60B44423B8A2CC378347483CE"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
+ "MsmKey" = "8:_35FACDFFDDB943568B7588D14D0513A7"
+ "OwnerKey" = "8:_27200676A75147D0BB7FA5500BB31A6D"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
"MsmKey" = "8:_3E37631016BC45B2B672FE23257D542B"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
@@ -201,6 +303,18 @@
}
"Entry"
{
+ "MsmKey" = "8:_525E8ED430D44113995AB8FBF1945569"
+ "OwnerKey" = "8:_548996CD77304E3598846F122E79431A"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
+ "MsmKey" = "8:_548996CD77304E3598846F122E79431A"
+ "OwnerKey" = "8:_D1269F1E49D442CF8EAC96C23E60325D"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
"MsmKey" = "8:_59CFED0C4EC0492C945E4EBC04FE965F"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
@@ -219,7 +333,7 @@
}
"Entry"
{
- "MsmKey" = "8:_69EB1A147CC2428435BDCA35014C96E1"
+ "MsmKey" = "8:_6A4CAD73F43678BF7C05E8FB41042F74"
"OwnerKey" = "8:_D2EF447106B24E67907DAED3D39CFBB1"
"MsmSig" = "8:_UNDEFINED"
}
@@ -231,12 +345,6 @@
}
"Entry"
{
- "MsmKey" = "8:_72A8732C0C0C4D0EAAE89DBB82073335"
- "OwnerKey" = "8:_UNDEFINED"
- "MsmSig" = "8:_UNDEFINED"
- }
- "Entry"
- {
"MsmKey" = "8:_7358123D2D064AD1BC517911A8B23D1B"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
@@ -268,12 +376,6 @@
"Entry"
{
"MsmKey" = "8:_879085EF680EFDF6242DCB77439EC825"
- "OwnerKey" = "8:_F0B800E719294692A02518CFD8CBAEFF"
- "MsmSig" = "8:_UNDEFINED"
- }
- "Entry"
- {
- "MsmKey" = "8:_879085EF680EFDF6242DCB77439EC825"
"OwnerKey" = "8:_D2EF447106B24E67907DAED3D39CFBB1"
"MsmSig" = "8:_UNDEFINED"
}
@@ -285,20 +387,14 @@
}
"Entry"
{
- "MsmKey" = "8:_91BA2668F87764F53188E93BC8D363D7"
- "OwnerKey" = "8:_59CFED0C4EC0492C945E4EBC04FE965F"
- "MsmSig" = "8:_UNDEFINED"
- }
- "Entry"
- {
- "MsmKey" = "8:_98CF7609810C41BABC219DFBA0A6075D"
- "OwnerKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "MsmKey" = "8:_8BDB1C76D7153C0CC909D697582518E3"
+ "OwnerKey" = "8:_1CFB1AB04E024FC993E0EB4859DF8408"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_9A293E8A356A4959BB6E541B7DC213CD"
- "OwnerKey" = "8:_UNDEFINED"
+ "MsmKey" = "8:_91BA2668F87764F53188E93BC8D363D7"
+ "OwnerKey" = "8:_59CFED0C4EC0492C945E4EBC04FE965F"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
@@ -339,6 +435,24 @@
}
"Entry"
{
+ "MsmKey" = "8:_ADA22D44BCDEBA509E09A5D4C155AA41"
+ "OwnerKey" = "8:_1CFB1AB04E024FC993E0EB4859DF8408"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
+ "MsmKey" = "8:_ADA22D44BCDEBA509E09A5D4C155AA41"
+ "OwnerKey" = "8:_FBB0E565B1DE49CE9C827ACAC337AC5B"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
+ "MsmKey" = "8:_ADA22D44BCDEBA509E09A5D4C155AA41"
+ "OwnerKey" = "8:_D2EF447106B24E67907DAED3D39CFBB1"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
"MsmKey" = "8:_B0A2E9B4C45D4098AFD734D0C4E3EAFB"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
@@ -357,6 +471,12 @@
}
"Entry"
{
+ "MsmKey" = "8:_BB7F62033A5B7A961202771F5A4E4995"
+ "OwnerKey" = "8:_1CFB1AB04E024FC993E0EB4859DF8408"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
"MsmKey" = "8:_C105055EE271471A999CE7022E617EB7"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
@@ -417,12 +537,6 @@
}
"Entry"
{
- "MsmKey" = "8:_E4BCD553B2054B0F8BC67428E1A11674"
- "OwnerKey" = "8:_UNDEFINED"
- "MsmSig" = "8:_UNDEFINED"
- }
- "Entry"
- {
"MsmKey" = "8:_E763C699DF0948B6984DDEB96A2DFD06"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
@@ -648,6 +762,26 @@
"IsDependency" = "11:FALSE"
"IsolateTo" = "8:"
}
+ "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_0F091427EEA0245FBA87474748D35ABD"
+ {
+ "SourcePath" = "8:js32.dll"
+ "TargetName" = "8:js32.dll"
+ "Tag" = "8:"
+ "Folder" = "8:_B6E020422C78490D96F78DB0E1A3F521"
+ "Condition" = "8:"
+ "Transitive" = "11:FALSE"
+ "Vital" = "11:TRUE"
+ "ReadOnly" = "11:FALSE"
+ "Hidden" = "11:FALSE"
+ "System" = "11:FALSE"
+ "Permanent" = "11:FALSE"
+ "SharedLegacy" = "11:FALSE"
+ "PackageAs" = "3:1"
+ "Register" = "3:1"
+ "Exclude" = "11:FALSE"
+ "IsDependency" = "11:TRUE"
+ "IsolateTo" = "8:"
+ }
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_1273F63008CF585CA0E063E436B4646F"
{
"SourcePath" = "8:iphlpapi.dll"
@@ -688,10 +822,10 @@
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
- "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_69EB1A147CC2428435BDCA35014C96E1"
+ "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_6A4CAD73F43678BF7C05E8FB41042F74"
{
- "SourcePath" = "8:libsqlite.dll"
- "TargetName" = "8:libsqlite.dll"
+ "SourcePath" = "8:libteletone.dll"
+ "TargetName" = "8:libteletone.dll"
"Tag" = "8:"
"Folder" = "8:_04AC783F1C9F41AEB4E947C46CE9C9FF"
"Condition" = "8:"
@@ -704,7 +838,7 @@
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
- "Exclude" = "11:TRUE"
+ "Exclude" = "11:FALSE"
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
@@ -744,7 +878,27 @@
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
- "Exclude" = "11:TRUE"
+ "Exclude" = "11:FALSE"
+ "IsDependency" = "11:TRUE"
+ "IsolateTo" = "8:"
+ }
+ "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_8BDB1C76D7153C0CC909D697582518E3"
+ {
+ "SourcePath" = "8:libapr.dll"
+ "TargetName" = "8:libapr.dll"
+ "Tag" = "8:"
+ "Folder" = "8:_B6E020422C78490D96F78DB0E1A3F521"
+ "Condition" = "8:"
+ "Transitive" = "11:FALSE"
+ "Vital" = "11:TRUE"
+ "ReadOnly" = "11:FALSE"
+ "Hidden" = "11:FALSE"
+ "System" = "11:FALSE"
+ "Permanent" = "11:FALSE"
+ "SharedLegacy" = "11:FALSE"
+ "PackageAs" = "3:1"
+ "Register" = "3:1"
+ "Exclude" = "11:FALSE"
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
@@ -784,7 +938,7 @@
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
- "Exclude" = "11:TRUE"
+ "Exclude" = "11:FALSE"
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
@@ -828,6 +982,46 @@
"IsDependency" = "11:FALSE"
"IsolateTo" = "8:"
}
+ "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_ADA22D44BCDEBA509E09A5D4C155AA41"
+ {
+ "SourcePath" = "8:ODBC32.dll"
+ "TargetName" = "8:ODBC32.dll"
+ "Tag" = "8:"
+ "Folder" = "8:_B6E020422C78490D96F78DB0E1A3F521"
+ "Condition" = "8:"
+ "Transitive" = "11:FALSE"
+ "Vital" = "11:TRUE"
+ "ReadOnly" = "11:FALSE"
+ "Hidden" = "11:FALSE"
+ "System" = "11:FALSE"
+ "Permanent" = "11:FALSE"
+ "SharedLegacy" = "11:FALSE"
+ "PackageAs" = "3:1"
+ "Register" = "3:1"
+ "Exclude" = "11:FALSE"
+ "IsDependency" = "11:TRUE"
+ "IsolateTo" = "8:"
+ }
+ "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_BB7F62033A5B7A961202771F5A4E4995"
+ {
+ "SourcePath" = "8:libaprutil.dll"
+ "TargetName" = "8:libaprutil.dll"
+ "Tag" = "8:"
+ "Folder" = "8:_B6E020422C78490D96F78DB0E1A3F521"
+ "Condition" = "8:"
+ "Transitive" = "11:FALSE"
+ "Vital" = "11:TRUE"
+ "ReadOnly" = "11:FALSE"
+ "Hidden" = "11:FALSE"
+ "System" = "11:FALSE"
+ "Permanent" = "11:FALSE"
+ "SharedLegacy" = "11:FALSE"
+ "PackageAs" = "3:1"
+ "Register" = "3:1"
+ "Exclude" = "11:FALSE"
+ "IsDependency" = "11:TRUE"
+ "IsolateTo" = "8:"
+ }
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_D7E82DD20D5B47395F635480C8E3A1D3"
{
"SourcePath" = "8:FreeSwitch.dll"
@@ -1610,7 +1804,7 @@
}
"MergeModule"
{
- "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_327123955D614480BF2995F2C39195DD"
+ "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_27200676A75147D0BB7FA5500BB31A6D"
{
"UseDynamicProperties" = "11:TRUE"
"IsDependency" = "11:TRUE"
@@ -1624,7 +1818,7 @@
"Feature" = "8:"
"IsolateTo" = "8:"
}
- "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_98CF7609810C41BABC219DFBA0A6075D"
+ "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_35FACDFFDDB943568B7588D14D0513A7"
{
"UseDynamicProperties" = "11:TRUE"
"IsDependency" = "11:TRUE"
@@ -1638,6 +1832,34 @@
"Feature" = "8:"
"IsolateTo" = "8:"
}
+ "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_525E8ED430D44113995AB8FBF1945569"
+ {
+ "UseDynamicProperties" = "11:TRUE"
+ "IsDependency" = "11:TRUE"
+ "SourcePath" = "8:policy_8_0_microsoft_vc80_crt_x86.msm"
+ "Properties"
+ {
+ }
+ "LanguageId" = "3:0"
+ "Exclude" = "11:FALSE"
+ "Folder" = "8:"
+ "Feature" = "8:"
+ "IsolateTo" = "8:"
+ }
+ "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_548996CD77304E3598846F122E79431A"
+ {
+ "UseDynamicProperties" = "11:TRUE"
+ "IsDependency" = "11:TRUE"
+ "SourcePath" = "8:Microsoft_VC80_CRT_x86.msm"
+ "Properties"
+ {
+ }
+ "LanguageId" = "3:0"
+ "Exclude" = "11:FALSE"
+ "Folder" = "8:"
+ "Feature" = "8:"
+ "IsolateTo" = "8:"
+ }
}
"ProjectOutput"
{
@@ -2005,34 +2227,6 @@
{
}
}
- "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_72A8732C0C0C4D0EAAE89DBB82073335"
- {
- "SourcePath" = "8:..\\..\\debug\\mod\\mod_playback.dll"
- "TargetName" = "8:"
- "Tag" = "8:"
- "Folder" = "8:_B6E020422C78490D96F78DB0E1A3F521"
- "Condition" = "8:"
- "Transitive" = "11:FALSE"
- "Vital" = "11:TRUE"
- "ReadOnly" = "11:FALSE"
- "Hidden" = "11:FALSE"
- "System" = "11:FALSE"
- "Permanent" = "11:FALSE"
- "SharedLegacy" = "11:FALSE"
- "PackageAs" = "3:1"
- "Register" = "3:1"
- "Exclude" = "11:FALSE"
- "IsDependency" = "11:FALSE"
- "IsolateTo" = "8:"
- "ProjectOutputGroupRegister" = "3:1"
- "OutputConfiguration" = "8:"
- "OutputGroupCanonicalName" = "8:Built"
- "OutputProjectGuid" = "8:{78100236-7CEA-4948-96CC-E8ED3160329C}"
- "ShowKeyOutput" = "11:TRUE"
- "ExcludeFilters"
- {
- }
- }
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_7358123D2D064AD1BC517911A8B23D1B"
{
"SourcePath" = "8:..\\..\\debug\\mod\\mod_softtimer.dll"
@@ -2117,37 +2311,9 @@
{
}
}
- "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_9A293E8A356A4959BB6E541B7DC213CD"
- {
- "SourcePath" = "8:..\\..\\debug\\mod\\mod_bridgecall.dll"
- "TargetName" = "8:"
- "Tag" = "8:"
- "Folder" = "8:_B6E020422C78490D96F78DB0E1A3F521"
- "Condition" = "8:"
- "Transitive" = "11:FALSE"
- "Vital" = "11:TRUE"
- "ReadOnly" = "11:FALSE"
- "Hidden" = "11:FALSE"
- "System" = "11:FALSE"
- "Permanent" = "11:FALSE"
- "SharedLegacy" = "11:FALSE"
- "PackageAs" = "3:1"
- "Register" = "3:1"
- "Exclude" = "11:FALSE"
- "IsDependency" = "11:FALSE"
- "IsolateTo" = "8:"
- "ProjectOutputGroupRegister" = "3:1"
- "OutputConfiguration" = "8:"
- "OutputGroupCanonicalName" = "8:Built"
- "OutputProjectGuid" = "8:{E1794405-29D4-466D-9BE3-DD2344C2A663}"
- "ShowKeyOutput" = "11:TRUE"
- "ExcludeFilters"
- {
- }
- }
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_A0D5F714A0F94250A1C39603B699AB82"
{
- "SourcePath" = "8:..\\..\\libs\\libteletone\\Debug\\libteletone.dll"
+ "SourcePath" = "8:..\\..\\debug\\libteletone.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_04AC783F1C9F41AEB4E947C46CE9C9FF"
@@ -2175,7 +2341,7 @@
}
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_A944ADCEDF884574A23F7BA5420A6BA1"
{
- "SourcePath" = "8:..\\..\\debug\\libsqlite.dll"
+ "SourcePath" = "8:..\\..\\libs\\win32\\sqlite\\Debug\\libsqlite.lib"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_04AC783F1C9F41AEB4E947C46CE9C9FF"
@@ -2287,7 +2453,7 @@
}
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_BB649A2C1ABE4895859025B09A240323"
{
- "SourcePath" = "8:..\\..\\debug\\libpcre.dll"
+ "SourcePath" = "8:..\\..\\libs\\win32\\pcre\\Debug\\libpcre.lib"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_04AC783F1C9F41AEB4E947C46CE9C9FF"
@@ -2509,34 +2675,6 @@
{
}
}
- "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_E4BCD553B2054B0F8BC67428E1A11674"
- {
- "SourcePath" = "8:..\\..\\debug\\mod\\mod_echo.dll"
- "TargetName" = "8:"
- "Tag" = "8:"
- "Folder" = "8:_B6E020422C78490D96F78DB0E1A3F521"
- "Condition" = "8:"
- "Transitive" = "11:FALSE"
- "Vital" = "11:TRUE"
- "ReadOnly" = "11:FALSE"
- "Hidden" = "11:FALSE"
- "System" = "11:FALSE"
- "Permanent" = "11:FALSE"
- "SharedLegacy" = "11:FALSE"
- "PackageAs" = "3:1"
- "Register" = "3:1"
- "Exclude" = "11:FALSE"
- "IsDependency" = "11:FALSE"
- "IsolateTo" = "8:"
- "ProjectOutputGroupRegister" = "3:1"
- "OutputConfiguration" = "8:"
- "OutputGroupCanonicalName" = "8:Built"
- "OutputProjectGuid" = "8:{0E2C6395-13B9-46E5-9264-8859D346018D}"
- "ShowKeyOutput" = "11:TRUE"
- "ExcludeFilters"
- {
- }
- }
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_E763C699DF0948B6984DDEB96A2DFD06"
{
"SourcePath" = "8:..\\..\\debug\\mod\\mod_PortAudio.dll"
1
0
[commit] r5360 - freeswitch/branches/greenlizard/src/mod/languages/mod_python
by Freeswitch SVN 14 Jun '07
by Freeswitch SVN 14 Jun '07
14 Jun '07
Author: greenlizard
Date: Thu Jun 14 11:29:01 2007
New Revision: 5360
Modified:
freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py
freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.cpp
freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.c
freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.i
freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp
Log:
MODLANG-33 and MODLANG-34
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch.py Thu Jun 14 11:29:01 2007
@@ -1,19 +1,19 @@
-# This file was created automatically by SWIG.
+# This file was created automatically by SWIG 1.3.29.
# Don't modify this file, modify the SWIG interface instead.
# This file is compatible with both classic and new-style classes.
import _freeswitch
-
+import new
+new_instancemethod = new.instancemethod
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
+ if (name == "thisown"): return self.this.own(value)
if (name == "this"):
- if isinstance(value, class_type):
- self.__dict__[name] = value.this
- if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
- del value.thisown
+ if type(value).__name__ == 'PySwigObject':
+ self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
- if (not static) or hasattr(self,name) or (name == "thisown"):
+ if (not static) or hasattr(self,name):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
@@ -22,10 +22,16 @@
return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name):
+ if (name == "thisown"): return self.this.own()
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError,name
+def _swig_repr(self):
+ try: strthis = "proxy of " + self.this.__repr__()
+ except: strthis = ""
+ return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
+
import types
try:
_object = types.ObjectType
@@ -36,23 +42,17 @@
del types
-
console_log = _freeswitch.console_log
-
console_clean_log = _freeswitch.console_clean_log
-
api_execute = _freeswitch.api_execute
-
api_reply_delete = _freeswitch.api_reply_delete
-
process_callback_result = _freeswitch.process_callback_result
class input_callback_state(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, input_callback_state, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, input_callback_state, name)
- def __repr__(self):
- return "<%s.%s; proxy of C++ input_callback_state instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
+ __repr__ = _swig_repr
__swig_setmethods__["function"] = _freeswitch.input_callback_state_function_set
__swig_getmethods__["function"] = _freeswitch.input_callback_state_function_get
if _newclass:function = property(_freeswitch.input_callback_state_function_get, _freeswitch.input_callback_state_function_set)
@@ -65,37 +65,27 @@
__swig_setmethods__["funcargs"] = _freeswitch.input_callback_state_funcargs_set
__swig_getmethods__["funcargs"] = _freeswitch.input_callback_state_funcargs_get
if _newclass:funcargs = property(_freeswitch.input_callback_state_funcargs_get, _freeswitch.input_callback_state_funcargs_set)
- def __init__(self, *args):
- _swig_setattr(self, input_callback_state, 'this', _freeswitch.new_input_callback_state(*args))
- _swig_setattr(self, input_callback_state, 'thisown', 1)
- def __del__(self, destroy=_freeswitch.delete_input_callback_state):
- try:
- if self.thisown: destroy(self)
- except: pass
-
-
-class input_callback_statePtr(input_callback_state):
- def __init__(self, this):
- _swig_setattr(self, input_callback_state, 'this', this)
- if not hasattr(self,"thisown"): _swig_setattr(self, input_callback_state, 'thisown', 0)
- _swig_setattr(self, input_callback_state,self.__class__,input_callback_state)
-_freeswitch.input_callback_state_swigregister(input_callback_statePtr)
+ def __init__(self, *args):
+ this = _freeswitch.new_input_callback_state(*args)
+ try: self.this.append(this)
+ except: self.this = this
+ __swig_destroy__ = _freeswitch.delete_input_callback_state
+ __del__ = lambda self : None;
+input_callback_state_swigregister = _freeswitch.input_callback_state_swigregister
+input_callback_state_swigregister(input_callback_state)
class CoreSession(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, CoreSession, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, CoreSession, name)
- def __repr__(self):
- return "<%s.%s; proxy of C++ CoreSession instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
- def __init__(self, *args):
- _swig_setattr(self, CoreSession, 'this', _freeswitch.new_CoreSession(*args))
- _swig_setattr(self, CoreSession, 'thisown', 1)
- def __del__(self, destroy=_freeswitch.delete_CoreSession):
- try:
- if self.thisown: destroy(self)
- except: pass
-
+ __repr__ = _swig_repr
+ def __init__(self, *args):
+ this = _freeswitch.new_CoreSession(*args)
+ try: self.this.append(this)
+ except: self.this = this
+ __swig_destroy__ = _freeswitch.delete_CoreSession
+ __del__ = lambda self : None;
__swig_setmethods__["session"] = _freeswitch.CoreSession_session_set
__swig_getmethods__["session"] = _freeswitch.CoreSession_session_get
if _newclass:session = property(_freeswitch.CoreSession_session_get, _freeswitch.CoreSession_session_set)
@@ -122,14 +112,8 @@
def execute(*args): return _freeswitch.CoreSession_execute(*args)
def begin_allow_threads(*args): return _freeswitch.CoreSession_begin_allow_threads(*args)
def end_allow_threads(*args): return _freeswitch.CoreSession_end_allow_threads(*args)
-
-class CoreSessionPtr(CoreSession):
- def __init__(self, this):
- _swig_setattr(self, CoreSession, 'this', this)
- if not hasattr(self,"thisown"): _swig_setattr(self, CoreSession, 'thisown', 0)
- _swig_setattr(self, CoreSession,self.__class__,CoreSession)
-_freeswitch.CoreSession_swigregister(CoreSessionPtr)
-
+CoreSession_swigregister = _freeswitch.CoreSession_swigregister
+CoreSession_swigregister(CoreSession)
PythonDTMFCallback = _freeswitch.PythonDTMFCallback
class PySession(CoreSession):
@@ -139,25 +123,18 @@
__swig_getmethods__ = {}
for _s in [CoreSession]: __swig_getmethods__.update(_s.__swig_getmethods__)
__getattr__ = lambda self, name: _swig_getattr(self, PySession, name)
- def __repr__(self):
- return "<%s.%s; proxy of C++ PySession instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
- def __init__(self, *args):
- _swig_setattr(self, PySession, 'this', _freeswitch.new_PySession(*args))
- _swig_setattr(self, PySession, 'thisown', 1)
- def __del__(self, destroy=_freeswitch.delete_PySession):
- try:
- if self.thisown: destroy(self)
- except: pass
-
+ __repr__ = _swig_repr
+ def __init__(self, *args):
+ this = _freeswitch.new_PySession(*args)
+ try: self.this.append(this)
+ except: self.this = this
+ __swig_destroy__ = _freeswitch.delete_PySession
+ __del__ = lambda self : None;
def setDTMFCallback(*args): return _freeswitch.PySession_setDTMFCallback(*args)
def begin_allow_threads(*args): return _freeswitch.PySession_begin_allow_threads(*args)
def end_allow_threads(*args): return _freeswitch.PySession_end_allow_threads(*args)
+PySession_swigregister = _freeswitch.PySession_swigregister
+PySession_swigregister(PySession)
-class PySessionPtr(PySession):
- def __init__(self, this):
- _swig_setattr(self, PySession, 'this', this)
- if not hasattr(self,"thisown"): _swig_setattr(self, PySession, 'thisown', 0)
- _swig_setattr(self, PySession,self.__class__,PySession)
-_freeswitch.PySession_swigregister(PySessionPtr)
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.cpp (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/freeswitch_python.cpp Thu Jun 14 11:29:01 2007
@@ -48,7 +48,7 @@
PySession::~PySession() {
// Should we do any cleanup here?
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "PySession::~PySession desctructor\");
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "PySession::~PySession desctructor\n");
}
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.c
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.c (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.c Thu Jun 14 11:29:01 2007
@@ -54,92 +54,115 @@
static void eval_some_python(char *uuid, char *args)
{
PyThreadState *tstate = NULL;
- FILE *pythonfile = NULL;
char *dupargs = NULL;
char *argv[128] = {0};
int argc;
int lead = 0;
- char *script = NULL, *script_path = NULL, *path = NULL;
+ char *script = NULL;
+ PyObject *module = NULL;
+ PyObject *function = NULL;
+ PyObject *arg = NULL;
+ PyObject *result = NULL;
if (args) {
- dupargs = strdup(args);
+ dupargs = strdup(args);
} else {
- return;
+ return;
}
assert(dupargs != NULL);
if (!(argc = switch_separate_string(dupargs, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No script name specified!\n");
- goto done;
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No module name specified!\n");
+ goto done;
}
script = argv[0];
lead = 1;
- if (switch_is_file_path(script)) {
- script_path = script;
- if ((script = strrchr(script_path, *SWITCH_PATH_SEPARATOR))) {
- script++;
- } else {
- script = script_path;
- }
- } else if ((path = switch_mprintf("%s%s%s", SWITCH_GLOBAL_dirs.script_dir, SWITCH_PATH_SEPARATOR, script))) {
- script_path = path;
- }
- if (script_path) {
- if (!switch_file_exists(script_path, NULL) == SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot Open File: %s\n", script_path);
- goto done;
- }
- }
-
-
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "running %s\n", script_path);
-
-
- if ((pythonfile = fopen(script_path, "r"))) {
-
- PyEval_AcquireLock();
- tstate = PyThreadState_New(mainThreadState->interp);
- if (!tstate) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error acquiring tstate\n");
- goto done;
- }
- PyThreadState_Swap(tstate);
- init_freeswitch();
- PyRun_SimpleString("from freeswitch import *");
- if (uuid) {
- char code[128];
- snprintf(code, sizeof(code), "session = PySession(\"%s\");", uuid);
- PyRun_SimpleString(code);
- }
- PySys_SetArgv(argc - lead, &argv[lead]);
- PyRun_SimpleFile(pythonfile, script);
- if (uuid) {
- char code[128];
- snprintf(code, sizeof(code), "del session");
- PyRun_SimpleString(code);
- }
- PyThreadState_Swap(NULL);
- PyThreadState_Clear(tstate);
- PyThreadState_Delete(tstate);
- PyEval_ReleaseLock();
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Invoking py module: %s\n", script);
-
- } else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error running %s\n", script_path);
+ tstate = PyThreadState_New(mainThreadState->interp);
+ if (!tstate) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error acquiring tstate\n");
+ goto done;
+ }
+
+ // swap in thread state
+ PyEval_AcquireThread(tstate);
+ init_freeswitch();
+
+ // import the module
+ module = PyImport_ImportModule( (char *) script);
+ if (!module) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error importing module\n");
+ PyErr_Print();
+ PyErr_Clear();
+ goto done_swap_out;
+ }
+
+ // reload the module
+ module = PyImport_ReloadModule(module);
+ if (!module) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error reloading module\n");
+ PyErr_Print();
+ PyErr_Clear();
+ goto done_swap_out;
+ }
+
+ // get the handler function to be called
+ function = PyObject_GetAttrString(module, "handler");
+ if (!function) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Module does not define handler(uuid)\n");
+ PyErr_Print();
+ PyErr_Clear();
+ goto done_swap_out;
+ }
+
+ if (uuid) {
+ // build a tuple to pass the args, the uuid of session
+ arg = Py_BuildValue("(s)", uuid);
+ if (!arg) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error building args\n");
+ PyErr_Print();
+ PyErr_Clear();
+ goto done_swap_out;
+ }
+ }
+ else {
+ arg = PyTuple_New(1);
+ PyObject *nada = Py_BuildValue("");
+ PyTuple_SetItem(arg, 0, nada);
+ }
+
+ // invoke the handler
+ result = PyEval_CallObjectWithKeywords(function, arg, (PyObject *)NULL);
+
+ // check the result and print out any errors
+ if (!result) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error calling python script\n");
+ PyErr_Print();
+ PyErr_Clear();
}
+ goto done_swap_out;
done:
+ switch_safe_free(dupargs);
- if (pythonfile) {
- fclose(pythonfile);
- }
+ done_swap_out:
+ // decrement ref counts
+ Py_XDECREF(module);
+ Py_XDECREF(function);
+ Py_XDECREF(arg);
+ Py_XDECREF(result);
+
+ // swap out thread state
+ PyEval_ReleaseThread(tstate);
switch_safe_free(dupargs);
- switch_safe_free(path);
+
+
}
static void python_function(switch_core_session_t *session, char *data)
@@ -232,14 +255,25 @@
*module_interface = &python_module_interface;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Python Framework Loading...\n");
- Py_Initialize();
- PyEval_InitThreads();
+ if (!Py_IsInitialized()) {
- mainThreadState = PyThreadState_Get();
+ // initialize python system
+ Py_Initialize();
- PyThreadState_Swap(NULL);
+ // create GIL and a threadstate
+ PyEval_InitThreads();
- PyEval_ReleaseLock();
+ // save threadstate since it's interp field will be needed
+ // to create new threadstates, and will be needed for shutdown
+ mainThreadState = PyThreadState_Get();
+
+ // swap out threadstate since the call threads will create
+ // their own and swap in their threadstate
+ PyThreadState_Swap(NULL);
+
+ // release GIL
+ PyEval_ReleaseLock();
+ }
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.i
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.i (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python.i Thu Jun 14 11:29:01 2007
@@ -74,6 +74,7 @@
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "restored threadstate, calling python function: %p\n", func);
result = PyEval_CallObject(func, arglist);
+
threadState = PyEval_SaveThread();
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "called python function\n");
Modified: freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp
==============================================================================
--- freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp (original)
+++ freeswitch/branches/greenlizard/src/mod/languages/mod_python/mod_python_wrap.cpp Thu Jun 14 11:29:01 2007
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org)
- * Version 1.3.24
+ * Version 1.3.29
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
@@ -9,6 +9,7 @@
* ----------------------------------------------------------------------------- */
#define SWIGPYTHON
+#define SWIG_PYTHON_DIRECTOR_NO_VTABLE
#ifdef __cplusplus
template<class T> class SwigValueWrapper {
@@ -26,47 +27,125 @@
};
#endif
+/* -----------------------------------------------------------------------------
+ * This section contains generic SWIG labels for method/variable
+ * declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC)
+# if (__SUNPRO_CC <= 0x560)
+# define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+# define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+# else
+# define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+# define SWIGINLINE inline
+# else
+# define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define SWIGUNUSED __attribute__ ((__unused__))
+# else
+# define SWIGUNUSED
+# endif
+# elif defined(__ICC)
+# define SWIGUNUSED __attribute__ ((__unused__))
+# else
+# define SWIGUNUSED
+# endif
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+# define SWIGUNUSEDPARM(p)
+# else
+# define SWIGUNUSEDPARM(p) p SWIGUNUSED
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
-#ifndef SWIG_TEMPLATE_DISAMBIGUATOR
-# if defined(__SUNPRO_CC)
-# define SWIG_TEMPLATE_DISAMBIGUATOR template
-# else
-# define SWIG_TEMPLATE_DISAMBIGUATOR
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+# ifndef GCC_HASCLASSVISIBILITY
+# define GCC_HASCLASSVISIBILITY
# endif
#endif
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+# if defined(STATIC_LINKED)
+# define SWIGEXPORT
+# else
+# define SWIGEXPORT __declspec(dllexport)
+# endif
+# else
+# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+# define SWIGEXPORT __attribute__ ((visibility("default")))
+# else
+# define SWIGEXPORT
+# endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+# define SWIGSTDCALL __stdcall
+# else
+# define SWIGSTDCALL
+# endif
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Python.h has to appear first */
#include <Python.h>
-/***********************************************************************
+/* -----------------------------------------------------------------------------
* swigrun.swg
*
- * This file contains generic CAPI SWIG runtime support for pointer
- * type checking.
- *
- ************************************************************************/
+ * This file contains generic CAPI SWIG runtime support for pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
/* This should only be incremented when either the layout of swig_type_info changes,
or for whatever reason, the runtime changes incompatibly */
-#define SWIG_RUNTIME_VERSION "1"
+#define SWIG_RUNTIME_VERSION "2"
/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
#ifdef SWIG_TYPE_TABLE
-#define SWIG_QUOTE_STRING(x) #x
-#define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
-#define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
-#else
-#define SWIG_TYPE_TABLE_NAME
-#endif
-
-#include <string.h>
-
-#ifndef SWIGINLINE
-#if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
-# define SWIGINLINE inline
+# define SWIG_QUOTE_STRING(x) #x
+# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
+# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
#else
-# define SWIGINLINE
-#endif
+# define SWIG_TYPE_TABLE_NAME
#endif
/*
@@ -77,13 +156,158 @@
But only do this if is strictly necessary, ie, if you have problems
with your compiler or so.
*/
+
#ifndef SWIGRUNTIME
-#define SWIGRUNTIME static
+# define SWIGRUNTIME SWIGINTERN
#endif
+
#ifndef SWIGRUNTIMEINLINE
-#define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
+# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
+#endif
+
+/* Generic buffer size */
+#ifndef SWIG_BUFFER_SIZE
+# define SWIG_BUFFER_SIZE 1024
+#endif
+
+/* Flags for pointer conversions */
+#define SWIG_POINTER_DISOWN 0x1
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_OWN 0x1
+
+
+/*
+ Flags/methods for returning states.
+
+ The swig conversion methods, as ConvertPtr, return and integer
+ that tells if the conversion was successful or not. And if not,
+ an error code can be returned (see swigerrors.swg for the codes).
+
+ Use the following macros/flags to set or process the returning
+ states.
+
+ In old swig versions, you usually write code as:
+
+ if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
+ // success code
+ } else {
+ //fail code
+ }
+
+ Now you can be more explicit as:
+
+ int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
+ if (SWIG_IsOK(res)) {
+ // success code
+ } else {
+ // fail code
+ }
+
+ that seems to be the same, but now you can also do
+
+ Type *ptr;
+ int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
+ if (SWIG_IsOK(res)) {
+ // success code
+ if (SWIG_IsNewObj(res) {
+ ...
+ delete *ptr;
+ } else {
+ ...
+ }
+ } else {
+ // fail code
+ }
+
+ I.e., now SWIG_ConvertPtr can return new objects and you can
+ identify the case and take care of the deallocation. Of course that
+ requires also to SWIG_ConvertPtr to return new result values, as
+
+ int SWIG_ConvertPtr(obj, ptr,...) {
+ if (<obj is ok>) {
+ if (<need new object>) {
+ *ptr = <ptr to new allocated object>;
+ return SWIG_NEWOBJ;
+ } else {
+ *ptr = <ptr to old object>;
+ return SWIG_OLDOBJ;
+ }
+ } else {
+ return SWIG_BADOBJ;
+ }
+ }
+
+ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
+ more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
+ swig errors code.
+
+ Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
+ allows to return the 'cast rank', for example, if you have this
+
+ int food(double)
+ int fooi(int);
+
+ and you call
+
+ food(1) // cast rank '1' (1 -> 1.0)
+ fooi(1) // cast rank '0'
+
+ just use the SWIG_AddCast()/SWIG_CheckState()
+
+
+ */
+#define SWIG_OK (0)
+#define SWIG_ERROR (-1)
+#define SWIG_IsOK(r) (r >= 0)
+#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
+
+/* The CastRankLimit says how many bits are used for the cast rank */
+#define SWIG_CASTRANKLIMIT (1 << 8)
+/* The NewMask denotes the object was created (using new/malloc) */
+#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
+/* The TmpMask is for in/out typemaps that use temporal objects */
+#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
+/* Simple returning values */
+#define SWIG_BADOBJ (SWIG_ERROR)
+#define SWIG_OLDOBJ (SWIG_OK)
+#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
+#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
+/* Check, add and del mask methods */
+#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
+#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
+#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
+#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
+#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
+#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
+
+
+/* Cast-Rank Mode */
+#if defined(SWIG_CASTRANK_MODE)
+# ifndef SWIG_TypeRank
+# define SWIG_TypeRank unsigned long
+# endif
+# ifndef SWIG_MAXCASTRANK /* Default cast allowed */
+# define SWIG_MAXCASTRANK (2)
+# endif
+# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
+# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
+SWIGINTERNINLINE int SWIG_AddCast(int r) {
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
+}
+SWIGINTERNINLINE int SWIG_CheckState(int r) {
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
+}
+#else /* no cast-rank mode */
+# define SWIG_AddCast
+# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
#endif
+
+
+
+#include <string.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -91,16 +315,36 @@
typedef void *(*swig_converter_func)(void *);
typedef struct swig_type_info *(*swig_dycast_func)(void **);
+/* Structure to store inforomation on one type */
typedef struct swig_type_info {
- const char *name;
- swig_converter_func converter;
- const char *str;
- void *clientdata;
- swig_dycast_func dcast;
- struct swig_type_info *next;
- struct swig_type_info *prev;
+ const char *name; /* mangled name of this type */
+ const char *str; /* human readable name of this type */
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
+ void *clientdata; /* language specific type data */
+ int owndata; /* flag if the structure owns the clientdata */
} swig_type_info;
+/* Structure to store a type and conversion function used for casting */
+typedef struct swig_cast_info {
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
+ swig_converter_func converter; /* function to cast the void pointers */
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
+ struct swig_cast_info *prev; /* pointer to the previous cast */
+} swig_cast_info;
+
+/* Structure used to store module information
+ * Each module generates one structure like this, and the runtime collects
+ * all of these structures and stores them in a circularly linked list.*/
+typedef struct swig_module_info {
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
+ size_t size; /* Number of types in this module */
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
+ swig_type_info **type_initial; /* Array of initially generated type structures */
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
+ void *clientdata; /* Language specific module data */
+} swig_module_info;
+
/*
Compare two type names skipping the space characters, therefore
"char*" == "char *" and "Class<int>" == "Class<int >", etc.
@@ -114,13 +358,14 @@
for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
while ((*f1 == ' ') && (f1 != l1)) ++f1;
while ((*f2 == ' ') && (f2 != l2)) ++f2;
- if (*f1 != *f2) return *f1 - *f2;
+ if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
}
return (l1 - f1) - (l2 - f2);
}
/*
Check type equivalence in a name list like <name1>|<name2>|...
+ Return 0 if not equal, 1 if equal
*/
SWIGRUNTIME int
SWIG_TypeEquiv(const char *nb, const char *tb) {
@@ -131,96 +376,73 @@
for (nb = ne; *ne; ++ne) {
if (*ne == '|') break;
}
- equiv = SWIG_TypeNameComp(nb, ne, tb, te) == 0;
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
if (*ne) ++ne;
}
return equiv;
}
/*
- Register a type mapping with the type-checking
+ Check type equivalence in a name list like <name1>|<name2>|...
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
*/
-SWIGRUNTIME swig_type_info *
-SWIG_TypeRegisterTL(swig_type_info **tl, swig_type_info *ti) {
- swig_type_info *tc, *head, *ret, *next;
- /* Check to see if this type has already been registered */
- tc = *tl;
- while (tc) {
- /* check simple type equivalence */
- int typeequiv = (strcmp(tc->name, ti->name) == 0);
- /* check full type equivalence, resolving typedefs */
- if (!typeequiv) {
- /* only if tc is not a typedef (no '|' on it) */
- if (tc->str && ti->str && !strstr(tc->str,"|")) {
- typeequiv = SWIG_TypeEquiv(ti->str,tc->str);
- }
- }
- if (typeequiv) {
- /* Already exists in the table. Just add additional types to the list */
- if (ti->clientdata) tc->clientdata = ti->clientdata;
- head = tc;
- next = tc->next;
- goto l1;
- }
- tc = tc->prev;
- }
- head = ti;
- next = 0;
-
- /* Place in list */
- ti->prev = *tl;
- *tl = ti;
-
- /* Build linked lists */
- l1:
- ret = head;
- tc = ti + 1;
- /* Patch up the rest of the links */
- while (tc->name) {
- head->next = tc;
- tc->prev = head;
- head = tc;
- tc++;
+SWIGRUNTIME int
+SWIG_TypeCompare(const char *nb, const char *tb) {
+ int equiv = 0;
+ const char* te = tb + strlen(tb);
+ const char* ne = nb;
+ while (!equiv && *ne) {
+ for (nb = ne; *ne; ++ne) {
+ if (*ne == '|') break;
+ }
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+ if (*ne) ++ne;
}
- if (next) next->prev = head;
- head->next = next;
-
- return ret;
+ return equiv;
}
+
+/* think of this as a c++ template<> or a scheme macro */
+#define SWIG_TypeCheck_Template(comparison, ty) \
+ if (ty) { \
+ swig_cast_info *iter = ty->cast; \
+ while (iter) { \
+ if (comparison) { \
+ if (iter == ty->cast) return iter; \
+ /* Move iter to the top of the linked list */ \
+ iter->prev->next = iter->next; \
+ if (iter->next) \
+ iter->next->prev = iter->prev; \
+ iter->next = ty->cast; \
+ iter->prev = 0; \
+ if (ty->cast) ty->cast->prev = iter; \
+ ty->cast = iter; \
+ return iter; \
+ } \
+ iter = iter->next; \
+ } \
+ } \
+ return 0
+
/*
Check the typename
*/
-SWIGRUNTIME swig_type_info *
+SWIGRUNTIME swig_cast_info *
SWIG_TypeCheck(const char *c, swig_type_info *ty) {
- swig_type_info *s;
- if (!ty) return 0; /* Void pointer */
- s = ty->next; /* First element always just a name */
- do {
- if (strcmp(s->name,c) == 0) {
- if (s == ty->next) return s;
- /* Move s to the top of the linked list */
- s->prev->next = s->next;
- if (s->next) {
- s->next->prev = s->prev;
- }
- /* Insert s as second element in the list */
- s->next = ty->next;
- if (ty->next) ty->next->prev = s;
- ty->next = s;
- s->prev = ty;
- return s;
- }
- s = s->next;
- } while (s && (s != ty->next));
- return 0;
+ SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+}
+
+/* Same as previous function, except strcmp is replaced with a pointer comparison */
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
+ SWIG_TypeCheck_Template(iter->type == from, into);
}
/*
Cast a pointer up an inheritance hierarchy
*/
SWIGRUNTIMEINLINE void *
-SWIG_TypeCast(swig_type_info *ty, void *ptr) {
+SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
}
@@ -256,6 +478,7 @@
type, separated by vertical-bar characters. We choose
to print the last name, as it is often (?) the most
specific. */
+ if (!type) return NULL;
if (type->str != NULL) {
const char *last_name = type->str;
const char *s;
@@ -267,41 +490,108 @@
return type->name;
}
-/*
- Search for a swig_type_info structure
-*/
-SWIGRUNTIME swig_type_info *
-SWIG_TypeQueryTL(swig_type_info *tl, const char *name) {
- swig_type_info *ty = tl;
- while (ty) {
- if (ty->str && (SWIG_TypeEquiv(ty->str,name))) return ty;
- if (ty->name && (strcmp(name,ty->name) == 0)) return ty;
- ty = ty->prev;
- }
- return 0;
-}
-
/*
Set the clientdata field for a type
*/
SWIGRUNTIME void
-SWIG_TypeClientDataTL(swig_type_info *tl, swig_type_info *ti, void *clientdata) {
- swig_type_info *tc, *equiv;
- if (ti->clientdata) return;
+SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
+ swig_cast_info *cast = ti->cast;
/* if (ti->clientdata == clientdata) return; */
ti->clientdata = clientdata;
- equiv = ti->next;
- while (equiv) {
- if (!equiv->converter) {
- tc = tl;
- while (tc) {
- if ((strcmp(tc->name, equiv->name) == 0))
- SWIG_TypeClientDataTL(tl,tc,clientdata);
- tc = tc->prev;
+
+ while (cast) {
+ if (!cast->converter) {
+ swig_type_info *tc = cast->type;
+ if (!tc->clientdata) {
+ SWIG_TypeClientData(tc, clientdata);
}
+ }
+ cast = cast->next;
+ }
+}
+SWIGRUNTIME void
+SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
+ SWIG_TypeClientData(ti, clientdata);
+ ti->owndata = 1;
+}
+
+/*
+ Search for a swig_type_info structure only by mangled name
+ Search is a O(log #types)
+
+ We start searching at module start, and finish searching when start == end.
+ Note: if start == end at the beginning of the function, we go all the way around
+ the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_MangledTypeQueryModule(swig_module_info *start,
+ swig_module_info *end,
+ const char *name) {
+ swig_module_info *iter = start;
+ do {
+ if (iter->size) {
+ register size_t l = 0;
+ register size_t r = iter->size - 1;
+ do {
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
+ register size_t i = (l + r) >> 1;
+ const char *iname = iter->types[i]->name;
+ if (iname) {
+ register int compare = strcmp(name, iname);
+ if (compare == 0) {
+ return iter->types[i];
+ } else if (compare < 0) {
+ if (i) {
+ r = i - 1;
+ } else {
+ break;
+ }
+ } else if (compare > 0) {
+ l = i + 1;
+ }
+ } else {
+ break; /* should never happen */
+ }
+ } while (l <= r);
}
- equiv = equiv->next;
+ iter = iter->next;
+ } while (iter != end);
+ return 0;
+}
+
+/*
+ Search for a swig_type_info structure for either a mangled name or a human readable name.
+ It first searches the mangled names of the types, which is a O(log #types)
+ If a type is not found it then searches the human readable names, which is O(#types).
+
+ We start searching at module start, and finish searching when start == end.
+ Note: if start == end at the beginning of the function, we go all the way around
+ the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeQueryModule(swig_module_info *start,
+ swig_module_info *end,
+ const char *name) {
+ /* STEP 1: Search the name field using binary search */
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
+ if (ret) {
+ return ret;
+ } else {
+ /* STEP 2: If the type hasn't been found, do a complete search
+ of the str field (the human readable name) */
+ swig_module_info *iter = start;
+ do {
+ register size_t i = 0;
+ for (; i < iter->size; ++i) {
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
+ return iter->types[i];
+ }
+ iter = iter->next;
+ } while (iter != end);
}
+
+ /* neither found a match */
+ return 0;
}
/*
@@ -309,12 +599,11 @@
*/
SWIGRUNTIME char *
SWIG_PackData(char *c, void *ptr, size_t sz) {
- static char hex[17] = "0123456789abcdef";
- unsigned char *u = (unsigned char *) ptr;
- const unsigned char *eu = u + sz;
- register unsigned char uu;
+ static const char hex[17] = "0123456789abcdef";
+ register const unsigned char *u = (unsigned char *) ptr;
+ register const unsigned char *eu = u + sz;
for (; u != eu; ++u) {
- uu = *u;
+ register unsigned char uu = *u;
*(c++) = hex[(uu & 0xf0) >> 4];
*(c++) = hex[uu & 0xf];
}
@@ -327,10 +616,10 @@
SWIGRUNTIME const char *
SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
register unsigned char *u = (unsigned char *) ptr;
- register const unsigned char *eu = u + sz;
+ register const unsigned char *eu = u + sz;
for (; u != eu; ++u) {
- register int d = *(c++);
- register unsigned char uu = 0;
+ register char d = *(c++);
+ register unsigned char uu;
if ((d >= '0') && (d <= '9'))
uu = ((d - '0') << 4);
else if ((d >= 'a') && (d <= 'f'))
@@ -349,30 +638,6 @@
return c;
}
-/*
- This function will propagate the clientdata field of type to any new
- swig_type_info structures that have been added into the list of
- equivalent types. It is like calling SWIG_TypeClientData(type,
- clientdata) a second time.
-*/
-SWIGRUNTIME void
-SWIG_PropagateClientDataTL(swig_type_info *tl, swig_type_info *type) {
- swig_type_info *equiv = type->next;
- swig_type_info *tc;
- if (!type->clientdata) return;
- while (equiv) {
- if (!equiv->converter) {
- tc = tl;
- while (tc) {
- if ((strcmp(tc->name, equiv->name) == 0) && !tc->clientdata)
- SWIG_TypeClientDataTL(tl,tc, type->clientdata);
- tc = tc->prev;
- }
- }
- equiv = equiv->next;
- }
-}
-
/*
Pack 'void *' into a string buffer.
*/
@@ -432,294 +697,886 @@
}
#endif
-/***********************************************************************
- * common.swg
- *
- * This file contains generic SWIG runtime support for pointer
- * type checking as well as a few commonly used macros to control
- * external linkage.
- *
- * Author : David Beazley (beazley(a)cs.uchicago.edu)
- *
- * Copyright (c) 1999-2000, The University of Chicago
- *
- * This file may be freely redistributed without license or fee provided
- * this copyright message remains intact.
- ************************************************************************/
+/* Errors in SWIG */
+#define SWIG_UnknownError -1
+#define SWIG_IOError -2
+#define SWIG_RuntimeError -3
+#define SWIG_IndexError -4
+#define SWIG_TypeError -5
+#define SWIG_DivisionByZero -6
+#define SWIG_OverflowError -7
+#define SWIG_SyntaxError -8
+#define SWIG_ValueError -9
+#define SWIG_SystemError -10
+#define SWIG_AttributeError -11
+#define SWIG_MemoryError -12
+#define SWIG_NullReferenceError -13
-#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-# if !defined(STATIC_LINKED)
-# define SWIGEXPORT(a) __declspec(dllexport) a
-# else
-# define SWIGEXPORT(a) a
-# endif
-#else
-# define SWIGEXPORT(a) a
-#endif
-#ifdef __cplusplus
-extern "C" {
+/* Python.h has to appear first */
+#include <Python.h>
+
+/* Add PyOS_snprintf for old Pythons */
+#if PY_VERSION_HEX < 0x02020000
+# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
+# define PyOS_snprintf _snprintf
+# else
+# define PyOS_snprintf snprintf
+# endif
#endif
+/* A crude PyString_FromFormat implementation for old Pythons */
+#if PY_VERSION_HEX < 0x02020000
-/*************************************************************************/
+#ifndef SWIG_PYBUFFER_SIZE
+# define SWIG_PYBUFFER_SIZE 1024
+#endif
+static PyObject *
+PyString_FromFormat(const char *fmt, ...) {
+ va_list ap;
+ char buf[SWIG_PYBUFFER_SIZE * 2];
+ int res;
+ va_start(ap, fmt);
+ res = vsnprintf(buf, sizeof(buf), fmt, ap);
+ va_end(ap);
+ return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf);
+}
+#endif
-/* The static type info list */
+/* Add PyObject_Del for old Pythons */
+#if PY_VERSION_HEX < 0x01060000
+# define PyObject_Del(op) PyMem_DEL((op))
+#endif
+#ifndef PyObject_DEL
+# define PyObject_DEL PyObject_Del
+#endif
-static swig_type_info *swig_type_list = 0;
-static swig_type_info **swig_type_list_handle = &swig_type_list;
-
+/* A crude PyExc_StopIteration exception for old Pythons */
+#if PY_VERSION_HEX < 0x02020000
+# ifndef PyExc_StopIteration
+# define PyExc_StopIteration PyExc_RuntimeError
+# endif
+# ifndef PyObject_GenericGetAttr
+# define PyObject_GenericGetAttr 0
+# endif
+#endif
+/* Py_NotImplemented is defined in 2.1 and up. */
+#if PY_VERSION_HEX < 0x02010000
+# ifndef Py_NotImplemented
+# define Py_NotImplemented PyExc_RuntimeError
+# endif
+#endif
-/* Register a type mapping with the type-checking */
-static swig_type_info *
-SWIG_TypeRegister(swig_type_info *ti) {
- return SWIG_TypeRegisterTL(swig_type_list_handle, ti);
-}
-/* Search for a swig_type_info structure */
-static swig_type_info *
-SWIG_TypeQuery(const char *name) {
- return SWIG_TypeQueryTL(*swig_type_list_handle, name);
-}
+/* A crude PyString_AsStringAndSize implementation for old Pythons */
+#if PY_VERSION_HEX < 0x02010000
+# ifndef PyString_AsStringAndSize
+# define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}
+# endif
+#endif
-/* Set the clientdata field for a type */
-static void
-SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
- SWIG_TypeClientDataTL(*swig_type_list_handle, ti, clientdata);
-}
+/* PySequence_Size for old Pythons */
+#if PY_VERSION_HEX < 0x02000000
+# ifndef PySequence_Size
+# define PySequence_Size PySequence_Length
+# endif
+#endif
-/* This function will propagate the clientdata field of type to
-* any new swig_type_info structures that have been added into the list
-* of equivalent types. It is like calling
-* SWIG_TypeClientData(type, clientdata) a second time.
-*/
-static void
-SWIG_PropagateClientData(swig_type_info *type) {
- SWIG_PropagateClientDataTL(*swig_type_list_handle, type);
-}
-#ifdef __cplusplus
+/* PyBool_FromLong for old Pythons */
+#if PY_VERSION_HEX < 0x02030000
+static
+PyObject *PyBool_FromLong(long ok)
+{
+ PyObject *result = ok ? Py_True : Py_False;
+ Py_INCREF(result);
+ return result;
}
#endif
+
/* -----------------------------------------------------------------------------
- * SWIG API. Portion that goes into the runtime
+ * error manipulation
* ----------------------------------------------------------------------------- */
-#ifdef __cplusplus
-extern "C" {
+SWIGRUNTIME PyObject*
+SWIG_Python_ErrorType(int code) {
+ PyObject* type = 0;
+ switch(code) {
+ case SWIG_MemoryError:
+ type = PyExc_MemoryError;
+ break;
+ case SWIG_IOError:
+ type = PyExc_IOError;
+ break;
+ case SWIG_RuntimeError:
+ type = PyExc_RuntimeError;
+ break;
+ case SWIG_IndexError:
+ type = PyExc_IndexError;
+ break;
+ case SWIG_TypeError:
+ type = PyExc_TypeError;
+ break;
+ case SWIG_DivisionByZero:
+ type = PyExc_ZeroDivisionError;
+ break;
+ case SWIG_OverflowError:
+ type = PyExc_OverflowError;
+ break;
+ case SWIG_SyntaxError:
+ type = PyExc_SyntaxError;
+ break;
+ case SWIG_ValueError:
+ type = PyExc_ValueError;
+ break;
+ case SWIG_SystemError:
+ type = PyExc_SystemError;
+ break;
+ case SWIG_AttributeError:
+ type = PyExc_AttributeError;
+ break;
+ default:
+ type = PyExc_RuntimeError;
+ }
+ return type;
+}
+
+
+SWIGRUNTIME void
+SWIG_Python_AddErrorMsg(const char* mesg)
+{
+ PyObject *type = 0;
+ PyObject *value = 0;
+ PyObject *traceback = 0;
+
+ if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
+ if (value) {
+ PyObject *old_str = PyObject_Str(value);
+ PyErr_Clear();
+ Py_XINCREF(type);
+ PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
+ Py_DECREF(old_str);
+ Py_DECREF(value);
+ } else {
+ PyErr_Format(PyExc_RuntimeError, mesg);
+ }
+}
+
+
+
+#if defined(SWIG_PYTHON_NO_THREADS)
+# if defined(SWIG_PYTHON_THREADS)
+# undef SWIG_PYTHON_THREADS
+# endif
+#endif
+#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
+# if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
+# if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */
+# define SWIG_PYTHON_USE_GIL
+# endif
+# endif
+# if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
+# ifndef SWIG_PYTHON_INITIALIZE_THREADS
+# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads()
+# endif
+# ifdef __cplusplus /* C++ code */
+ class SWIG_Python_Thread_Block {
+ bool status;
+ PyGILState_STATE state;
+ public:
+ void end() { if (status) { PyGILState_Release(state); status = false;} }
+ SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
+ ~SWIG_Python_Thread_Block() { end(); }
+ };
+ class SWIG_Python_Thread_Allow {
+ bool status;
+ PyThreadState *save;
+ public:
+ void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
+ SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
+ ~SWIG_Python_Thread_Allow() { end(); }
+ };
+# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block
+# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end()
+# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow
+# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end()
+# else /* C code */
+# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
+# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block)
+# define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread()
+# define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow)
+# endif
+# else /* Old thread way, not implemented, user must provide it */
+# if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
+# define SWIG_PYTHON_INITIALIZE_THREADS
+# endif
+# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
+# define SWIG_PYTHON_THREAD_BEGIN_BLOCK
+# endif
+# if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
+# define SWIG_PYTHON_THREAD_END_BLOCK
+# endif
+# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
+# define SWIG_PYTHON_THREAD_BEGIN_ALLOW
+# endif
+# if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
+# define SWIG_PYTHON_THREAD_END_ALLOW
+# endif
+# endif
+#else /* No thread support */
+# define SWIG_PYTHON_INITIALIZE_THREADS
+# define SWIG_PYTHON_THREAD_BEGIN_BLOCK
+# define SWIG_PYTHON_THREAD_END_BLOCK
+# define SWIG_PYTHON_THREAD_BEGIN_ALLOW
+# define SWIG_PYTHON_THREAD_END_ALLOW
#endif
/* -----------------------------------------------------------------------------
- * for internal method declarations
+ * Python API portion that goes into the runtime
* ----------------------------------------------------------------------------- */
-#ifndef SWIGINTERN
-#define SWIGINTERN static
-#endif
-
-#ifndef SWIGINTERNSHORT
#ifdef __cplusplus
-#define SWIGINTERNSHORT static inline
-#else /* C case */
-#define SWIGINTERNSHORT static
-#endif /* __cplusplus */
+extern "C" {
+#if 0
+} /* cc-mode */
+#endif
#endif
-
-
-/*
- Exception handling in wrappers
-*/
-#define SWIG_fail goto fail
-#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg)
-#define SWIG_append_errmsg(msg) SWIG_Python_AddErrMesg(msg,0)
-#define SWIG_preppend_errmsg(msg) SWIG_Python_AddErrMesg(msg,1)
-#define SWIG_type_error(type,obj) SWIG_Python_TypeError(type,obj)
-#define SWIG_null_ref(type) SWIG_Python_NullRef(type)
-
-/*
- Contract support
-*/
-#define SWIG_contract_assert(expr, msg) \
- if (!(expr)) { PyErr_SetString(PyExc_RuntimeError, (char *) msg ); goto fail; } else
/* -----------------------------------------------------------------------------
* Constant declarations
* ----------------------------------------------------------------------------- */
/* Constant Types */
-#define SWIG_PY_INT 1
-#define SWIG_PY_FLOAT 2
-#define SWIG_PY_STRING 3
#define SWIG_PY_POINTER 4
#define SWIG_PY_BINARY 5
/* Constant information structure */
typedef struct swig_const_info {
- int type;
- char *name;
- long lvalue;
- double dvalue;
- void *pvalue;
- swig_type_info **ptype;
+ int type;
+ char *name;
+ long lvalue;
+ double dvalue;
+ void *pvalue;
+ swig_type_info **ptype;
} swig_const_info;
-
-/* -----------------------------------------------------------------------------
- * Alloc. memory flags
- * ----------------------------------------------------------------------------- */
-#define SWIG_OLDOBJ 1
-#define SWIG_NEWOBJ SWIG_OLDOBJ + 1
-#define SWIG_PYSTR SWIG_NEWOBJ + 1
-
#ifdef __cplusplus
+#if 0
+{ /* cc-mode */
+#endif
}
#endif
-/***********************************************************************
+/* -----------------------------------------------------------------------------
+ * See the LICENSE file for information on copyright, usage and redistribution
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
+ *
* pyrun.swg
*
- * This file contains the runtime support for Python modules
- * and includes code for managing global variables and pointer
- * type checking.
+ * This file contains the runtime support for Python modules
+ * and includes code for managing global variables and pointer
+ * type checking.
*
- * Author : David Beazley (beazley(a)cs.uchicago.edu)
- ************************************************************************/
+ * ----------------------------------------------------------------------------- */
/* Common SWIG API */
-#define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Python_ConvertPtr(obj, pp, type, flags)
-#define SWIG_NewPointerObj(p, type, flags) SWIG_Python_NewPointerObj(p, type, flags)
-#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
-
-/* Python-specific SWIG API */
-#define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) SWIG_Python_ConvertPacked(obj, ptr, sz, ty, flags)
-#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
+/* for raw pointers */
+#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
+#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags)
+#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
+#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(ptr, type, flags)
+#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty)
+#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src)
+#define swig_owntype int
+/* for raw packed data */
+#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
+#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
-/* -----------------------------------------------------------------------------
- * Pointer declarations
- * ----------------------------------------------------------------------------- */
-/*
- Use SWIG_NO_COBJECT_TYPES to force the use of strings to represent
- C/C++ pointers in the python side. Very useful for debugging, but
- not always safe.
-*/
-#if !defined(SWIG_NO_COBJECT_TYPES) && !defined(SWIG_COBJECT_TYPES)
-# define SWIG_COBJECT_TYPES
-#endif
+/* for class or struct pointers */
+#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
+#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
-/* Flags for pointer conversion */
-#define SWIG_POINTER_EXCEPTION 0x1
-#define SWIG_POINTER_DISOWN 0x2
+/* for C or C++ function pointers */
+#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
+#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(ptr, type, 0)
+/* for C++ member pointers, ie, member methods */
+#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
+#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
-#ifdef __cplusplus
-extern "C" {
-#endif
-/* -----------------------------------------------------------------------------
- * Create a new pointer string
- * ----------------------------------------------------------------------------- */
+/* Runtime API */
-#ifndef SWIG_BUFFER_SIZE
-#define SWIG_BUFFER_SIZE 1024
-#endif
+#define SWIG_GetModule(clientdata) SWIG_Python_GetModule()
+#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
+#define SWIG_NewClientData(obj) PySwigClientData_New(obj)
-#if defined(SWIG_COBJECT_TYPES)
-#if !defined(SWIG_COBJECT_PYTHON)
-/* -----------------------------------------------------------------------------
- * Implements a simple Swig Object type, and use it instead of PyCObject
- * ----------------------------------------------------------------------------- */
+#define SWIG_SetErrorObj SWIG_Python_SetErrorObj
+#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg
+#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code)
+#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
+#define SWIG_fail goto fail
-typedef struct {
- PyObject_HEAD
- void *ptr;
- const char *desc;
-} PySwigObject;
-/* Declarations for objects of type PySwigObject */
+/* Runtime API implementation */
-SWIGRUNTIME int
-PySwigObject_print(PySwigObject *v, FILE *fp, int flags)
-{
- char result[SWIG_BUFFER_SIZE];
- if (SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result))) {
- fputs("<Swig Object at ", fp); fputs(result, fp); fputs(">", fp);
- return 0;
- } else {
- return 1;
- }
-}
-
-SWIGRUNTIME PyObject *
-PySwigObject_repr(PySwigObject *v)
-{
- char result[SWIG_BUFFER_SIZE];
- return SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result)) ?
- PyString_FromFormat("<Swig Object at %s>", result) : 0;
-}
+/* Error manipulation */
-SWIGRUNTIME PyObject *
-PySwigObject_str(PySwigObject *v)
-{
- char result[SWIG_BUFFER_SIZE];
- return SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result)) ?
- PyString_FromString(result) : 0;
+SWIGINTERN void
+SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
+ SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+ PyErr_SetObject(errtype, obj);
+ Py_DECREF(obj);
+ SWIG_PYTHON_THREAD_END_BLOCK;
}
-SWIGRUNTIME PyObject *
-PySwigObject_long(PySwigObject *v)
-{
- return PyLong_FromUnsignedLong((unsigned long) v->ptr);
+SWIGINTERN void
+SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
+ SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+ PyErr_SetString(errtype, (char *) msg);
+ SWIG_PYTHON_THREAD_END_BLOCK;
}
-SWIGRUNTIME PyObject *
-PySwigObject_oct(PySwigObject *v)
-{
- char buf[100];
- unsigned long x = (unsigned long)v->ptr;
- if (x == 0)
- strcpy(buf, "0");
- else
- PyOS_snprintf(buf, sizeof(buf), "0%lo", x);
- return PyString_FromString(buf);
+#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
+
+/* Set a constant value */
+
+SWIGINTERN void
+SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
+ PyDict_SetItemString(d, (char*) name, obj);
+ Py_DECREF(obj);
+}
+
+/* Append a value to the result obj */
+
+SWIGINTERN PyObject*
+SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
+#if !defined(SWIG_PYTHON_OUTPUT_TUPLE)
+ if (!result) {
+ result = obj;
+ } else if (result == Py_None) {
+ Py_DECREF(result);
+ result = obj;
+ } else {
+ if (!PyList_Check(result)) {
+ PyObject *o2 = result;
+ result = PyList_New(1);
+ PyList_SetItem(result, 0, o2);
+ }
+ PyList_Append(result,obj);
+ Py_DECREF(obj);
+ }
+ return result;
+#else
+ PyObject* o2;
+ PyObject* o3;
+ if (!result) {
+ result = obj;
+ } else if (result == Py_None) {
+ Py_DECREF(result);
+ result = obj;
+ } else {
+ if (!PyTuple_Check(result)) {
+ o2 = result;
+ result = PyTuple_New(1);
+ PyTuple_SET_ITEM(result, 0, o2);
+ }
+ o3 = PyTuple_New(1);
+ PyTuple_SET_ITEM(o3, 0, obj);
+ o2 = result;
+ result = PySequence_Concat(o2, o3);
+ Py_DECREF(o2);
+ Py_DECREF(o3);
+ }
+ return result;
+#endif
+}
+
+/* Unpack the argument tuple */
+
+SWIGINTERN int
+SWIG_Python_UnpackTuple(PyObject *args, const char *name, int min, int max, PyObject **objs)
+{
+ if (!args) {
+ if (!min && !max) {
+ return 1;
+ } else {
+ PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none",
+ name, (min == max ? "" : "at least "), min);
+ return 0;
+ }
+ }
+ if (!PyTuple_Check(args)) {
+ PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
+ return 0;
+ } else {
+ register int l = PyTuple_GET_SIZE(args);
+ if (l < min) {
+ PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
+ name, (min == max ? "" : "at least "), min, l);
+ return 0;
+ } else if (l > max) {
+ PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
+ name, (min == max ? "" : "at most "), max, l);
+ return 0;
+ } else {
+ register int i;
+ for (i = 0; i < l; ++i) {
+ objs[i] = PyTuple_GET_ITEM(args, i);
+ }
+ for (; l < max; ++l) {
+ objs[l] = 0;
+ }
+ return i + 1;
+ }
+ }
+}
+
+/* A functor is a function object with one single object argument */
+#if PY_VERSION_HEX >= 0x02020000
+#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL);
+#else
+#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj);
+#endif
+
+/*
+ Helper for static pointer initialization for both C and C++ code, for example
+ static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
+*/
+#ifdef __cplusplus
+#define SWIG_STATIC_POINTER(var) var
+#else
+#define SWIG_STATIC_POINTER(var) var = 0; if (!var) var
+#endif
+
+/* -----------------------------------------------------------------------------
+ * Pointer declarations
+ * ----------------------------------------------------------------------------- */
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1)
+#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
+
+#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1)
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* cc-mode */
+#endif
+#endif
+
+/* How to access Py_None */
+#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+# ifndef SWIG_PYTHON_NO_BUILD_NONE
+# ifndef SWIG_PYTHON_BUILD_NONE
+# define SWIG_PYTHON_BUILD_NONE
+# endif
+# endif
+#endif
+
+#ifdef SWIG_PYTHON_BUILD_NONE
+# ifdef Py_None
+# undef Py_None
+# define Py_None SWIG_Py_None()
+# endif
+SWIGRUNTIMEINLINE PyObject *
+_SWIG_Py_None(void)
+{
+ PyObject *none = Py_BuildValue("");
+ Py_DECREF(none);
+ return none;
+}
+SWIGRUNTIME PyObject *
+SWIG_Py_None(void)
+{
+ static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None();
+ return none;
+}
+#endif
+
+/* The python void return value */
+
+SWIGRUNTIMEINLINE PyObject *
+SWIG_Py_Void(void)
+{
+ PyObject *none = Py_None;
+ Py_INCREF(none);
+ return none;
+}
+
+/* PySwigClientData */
+
+typedef struct {
+ PyObject *klass;
+ PyObject *newraw;
+ PyObject *newargs;
+ PyObject *destroy;
+ int delargs;
+ int implicitconv;
+} PySwigClientData;
+
+SWIGRUNTIMEINLINE int
+SWIG_Python_CheckImplicit(swig_type_info *ty)
+{
+ PySwigClientData *data = (PySwigClientData *)ty->clientdata;
+ return data ? data->implicitconv : 0;
+}
+
+SWIGRUNTIMEINLINE PyObject *
+SWIG_Python_ExceptionType(swig_type_info *desc) {
+ PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0;
+ PyObject *klass = data ? data->klass : 0;
+ return (klass ? klass : PyExc_RuntimeError);
+}
+
+
+SWIGRUNTIME PySwigClientData *
+PySwigClientData_New(PyObject* obj)
+{
+ if (!obj) {
+ return 0;
+ } else {
+ PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData));
+ /* the klass element */
+ data->klass = obj;
+ Py_INCREF(data->klass);
+ /* the newraw method and newargs arguments used to create a new raw instance */
+ if (PyClass_Check(obj)) {
+ data->newraw = 0;
+ data->newargs = obj;
+ Py_INCREF(obj);
+ } else {
+#if (PY_VERSION_HEX < 0x02020000)
+ data->newraw = 0;
+#else
+ data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__");
+#endif
+ if (data->newraw) {
+ Py_INCREF(data->newraw);
+ data->newargs = PyTuple_New(1);
+ PyTuple_SetItem(data->newargs, 0, obj);
+ } else {
+ data->newargs = obj;
+ }
+ Py_INCREF(data->newargs);
+ }
+ /* the destroy method, aka as the C++ delete method */
+ data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__");
+ if (PyErr_Occurred()) {
+ PyErr_Clear();
+ data->destroy = 0;
+ }
+ if (data->destroy) {
+ int flags;
+ Py_INCREF(data->destroy);
+ flags = PyCFunction_GET_FLAGS(data->destroy);
+#ifdef METH_O
+ data->delargs = !(flags & (METH_O));
+#else
+ data->delargs = 0;
+#endif
+ } else {
+ data->delargs = 0;
+ }
+ data->implicitconv = 0;
+ return data;
+ }
+}
+
+SWIGRUNTIME void
+PySwigClientData_Del(PySwigClientData* data)
+{
+ Py_XDECREF(data->newraw);
+ Py_XDECREF(data->newargs);
+ Py_XDECREF(data->destroy);
+}
+
+/* =============== PySwigObject =====================*/
+
+typedef struct {
+ PyObject_HEAD
+ void *ptr;
+ swig_type_info *ty;
+ int own;
+ PyObject *next;
+} PySwigObject;
+
+SWIGRUNTIME PyObject *
+PySwigObject_long(PySwigObject *v)
+{
+ return PyLong_FromVoidPtr(v->ptr);
+}
+
+SWIGRUNTIME PyObject *
+PySwigObject_format(const char* fmt, PySwigObject *v)
+{
+ PyObject *res = NULL;
+ PyObject *args = PyTuple_New(1);
+ if (args) {
+ if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) {
+ PyObject *ofmt = PyString_FromString(fmt);
+ if (ofmt) {
+ res = PyString_Format(ofmt,args);
+ Py_DECREF(ofmt);
+ }
+ Py_DECREF(args);
+ }
+ }
+ return res;
+}
+
+SWIGRUNTIME PyObject *
+PySwigObject_oct(PySwigObject *v)
+{
+ return PySwigObject_format("%o",v);
}
SWIGRUNTIME PyObject *
PySwigObject_hex(PySwigObject *v)
{
- char buf[100];
- PyOS_snprintf(buf, sizeof(buf), "0x%lx", (unsigned long)v->ptr);
- return PyString_FromString(buf);
+ return PySwigObject_format("%x",v);
+}
+
+SWIGRUNTIME PyObject *
+#ifdef METH_NOARGS
+PySwigObject_repr(PySwigObject *v)
+#else
+PySwigObject_repr(PySwigObject *v, PyObject *args)
+#endif
+{
+ const char *name = SWIG_TypePrettyName(v->ty);
+ PyObject *hex = PySwigObject_hex(v);
+ PyObject *repr = PyString_FromFormat("<Swig Object of type '%s' at 0x%s>", name, PyString_AsString(hex));
+ Py_DECREF(hex);
+ if (v->next) {
+#ifdef METH_NOARGS
+ PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next);
+#else
+ PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next, args);
+#endif
+ PyString_ConcatAndDel(&repr,nrep);
+ }
+ return repr;
}
SWIGRUNTIME int
-PySwigObject_compare(PySwigObject *v, PySwigObject *w)
+PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
{
- int c = strcmp(v->desc, w->desc);
- if (c) {
- return c;
- } else {
- void *i = v->ptr;
- void *j = w->ptr;
- return (i < j) ? -1 : (i > j) ? 1 : 0;
+#ifdef METH_NOARGS
+ PyObject *repr = PySwigObject_repr(v);
+#else
+ PyObject *repr = PySwigObject_repr(v, NULL);
+#endif
+ if (repr) {
+ fputs(PyString_AsString(repr), fp);
+ Py_DECREF(repr);
+ return 0;
+ } else {
+ return 1;
}
}
+SWIGRUNTIME PyObject *
+PySwigObject_str(PySwigObject *v)
+{
+ char result[SWIG_BUFFER_SIZE];
+ return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ?
+ PyString_FromString(result) : 0;
+}
+
+SWIGRUNTIME int
+PySwigObject_compare(PySwigObject *v, PySwigObject *w)
+{
+ void *i = v->ptr;
+ void *j = w->ptr;
+ return (i < j) ? -1 : ((i > j) ? 1 : 0);
+}
+
+SWIGRUNTIME PyTypeObject* _PySwigObject_type(void);
+
+SWIGRUNTIME PyTypeObject*
+PySwigObject_type(void) {
+ static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type();
+ return type;
+}
+
+SWIGRUNTIMEINLINE int
+PySwigObject_Check(PyObject *op) {
+ return ((op)->ob_type == PySwigObject_type())
+ || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0);
+}
+
+SWIGRUNTIME PyObject *
+PySwigObject_New(void *ptr, swig_type_info *ty, int own);
+
SWIGRUNTIME void
-PySwigObject_dealloc(PySwigObject *self)
+PySwigObject_dealloc(PyObject *v)
+{
+ PySwigObject *sobj = (PySwigObject *) v;
+ PyObject *next = sobj->next;
+ if (sobj->own) {
+ swig_type_info *ty = sobj->ty;
+ PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
+ PyObject *destroy = data ? data->destroy : 0;
+ if (destroy) {
+ /* destroy is always a VARARGS method */
+ PyObject *res;
+ if (data->delargs) {
+ /* we need to create a temporal object to carry the destroy operation */
+ PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0);
+ res = SWIG_Python_CallFunctor(destroy, tmp);
+ Py_DECREF(tmp);
+ } else {
+ PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
+ PyObject *mself = PyCFunction_GET_SELF(destroy);
+ res = ((*meth)(mself, v));
+ }
+ Py_XDECREF(res);
+ } else {
+ const char *name = SWIG_TypePrettyName(ty);
+#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
+ printf("swig/python detected a memory leak of type '%s', no destructor found.\n", name);
+#endif
+ }
+ }
+ Py_XDECREF(next);
+ PyObject_DEL(v);
+}
+
+SWIGRUNTIME PyObject*
+PySwigObject_append(PyObject* v, PyObject* next)
+{
+ PySwigObject *sobj = (PySwigObject *) v;
+#ifndef METH_O
+ PyObject *tmp = 0;
+ if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
+ next = tmp;
+#endif
+ if (!PySwigObject_Check(next)) {
+ return NULL;
+ }
+ sobj->next = next;
+ Py_INCREF(next);
+ return SWIG_Py_Void();
+}
+
+SWIGRUNTIME PyObject*
+#ifdef METH_NOARGS
+PySwigObject_next(PyObject* v)
+#else
+PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+#endif
+{
+ PySwigObject *sobj = (PySwigObject *) v;
+ if (sobj->next) {
+ Py_INCREF(sobj->next);
+ return sobj->next;
+ } else {
+ return SWIG_Py_Void();
+ }
+}
+
+SWIGINTERN PyObject*
+#ifdef METH_NOARGS
+PySwigObject_disown(PyObject *v)
+#else
+PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+#endif
+{
+ PySwigObject *sobj = (PySwigObject *)v;
+ sobj->own = 0;
+ return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject*
+#ifdef METH_NOARGS
+PySwigObject_acquire(PyObject *v)
+#else
+PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+#endif
+{
+ PySwigObject *sobj = (PySwigObject *)v;
+ sobj->own = SWIG_POINTER_OWN;
+ return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject*
+PySwigObject_own(PyObject *v, PyObject *args)
+{
+ PyObject *val = 0;
+#if (PY_VERSION_HEX < 0x02020000)
+ if (!PyArg_ParseTuple(args,(char *)"|O:own",&val))
+#else
+ if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val))
+#endif
+ {
+ return NULL;
+ }
+ else
+ {
+ PySwigObject *sobj = (PySwigObject *)v;
+ PyObject *obj = PyBool_FromLong(sobj->own);
+ if (val) {
+#ifdef METH_NOARGS
+ if (PyObject_IsTrue(val)) {
+ PySwigObject_acquire(v);
+ } else {
+ PySwigObject_disown(v);
+ }
+#else
+ if (PyObject_IsTrue(val)) {
+ PySwigObject_acquire(v,args);
+ } else {
+ PySwigObject_disown(v,args);
+ }
+#endif
+ }
+ return obj;
+ }
+}
+
+#ifdef METH_O
+static PyMethodDef
+swigobject_methods[] = {
+ {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"},
+ {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"},
+ {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
+ {(char *)"append", (PyCFunction)PySwigObject_append, METH_O, (char *)"appends another 'this' object"},
+ {(char *)"next", (PyCFunction)PySwigObject_next, METH_NOARGS, (char *)"returns the next 'this' object"},
+ {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_NOARGS, (char *)"returns object representation"},
+ {0, 0, 0, 0}
+};
+#else
+static PyMethodDef
+swigobject_methods[] = {
+ {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"},
+ {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"},
+ {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
+ {(char *)"append", (PyCFunction)PySwigObject_append, METH_VARARGS, (char *)"appends another 'this' object"},
+ {(char *)"next", (PyCFunction)PySwigObject_next, METH_VARARGS, (char *)"returns the next 'this' object"},
+ {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_VARARGS, (char *)"returns object representation"},
+ {0, 0, 0, 0}
+};
+#endif
+
+#if PY_VERSION_HEX < 0x02020000
+SWIGINTERN PyObject *
+PySwigObject_getattr(PySwigObject *sobj,char *name)
{
- PyObject_DEL(self);
+ return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
}
+#endif
SWIGRUNTIME PyTypeObject*
-PySwigObject_GetType() {
- static char PySwigObject_Type__doc__[] =
- "Swig object carries a C/C++ instance pointer";
+_PySwigObject_type(void) {
+ static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
static PyNumberMethods PySwigObject_as_number = {
(binaryfunc)0, /*nb_add*/
@@ -745,89 +1602,95 @@
(unaryfunc)0, /*nb_float*/
(unaryfunc)PySwigObject_oct, /*nb_oct*/
(unaryfunc)PySwigObject_hex, /*nb_hex*/
-#if PY_VERSION_HEX >= 0x02000000
+#if PY_VERSION_HEX >= 0x02020000
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
+#elif PY_VERSION_HEX >= 0x02000000
+ 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
#endif
};
- static int type_init = 0;
- static PyTypeObject PySwigObject_Type;
-
+ static PyTypeObject pyswigobject_type;
+ static int type_init = 0;
if (!type_init) {
- PyTypeObject tmp = {
- PyObject_HEAD_INIT(&PyType_Type)
- 0, /*ob_size*/
- "PySwigObject", /*tp_name*/
- sizeof(PySwigObject), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- /* methods */
- (destructor)PySwigObject_dealloc, /*tp_dealloc*/
- (printfunc)PySwigObject_print, /*tp_print*/
- (getattrfunc)0, /*tp_getattr*/
- (setattrfunc)0, /*tp_setattr*/
- (cmpfunc)PySwigObject_compare, /*tp_compare*/
- (reprfunc)PySwigObject_repr, /*tp_repr*/
- &PySwigObject_as_number, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- (hashfunc)0, /*tp_hash*/
- (ternaryfunc)0, /*tp_call*/
- (reprfunc)PySwigObject_str, /*tp_str*/
- /* Space for future expansion */
- 0L,0L,0L,0L,
- PySwigObject_Type__doc__, /* Documentation string */
-#if PY_VERSION_HEX >= 0x02000000
- 0, /* tp_traverse */
- 0, /* tp_clear */
-#endif
-#if PY_VERSION_HEX >= 0x02010000
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
+ const PyTypeObject tmp
+ = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /* ob_size */
+ (char *)"PySwigObject", /* tp_name */
+ sizeof(PySwigObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ (destructor)PySwigObject_dealloc, /* tp_dealloc */
+ (printfunc)PySwigObject_print, /* tp_print */
+#if PY_VERSION_HEX < 0x02020000
+ (getattrfunc)PySwigObject_getattr, /* tp_getattr */
+#else
+ (getattrfunc)0, /* tp_getattr */
#endif
+ (setattrfunc)0, /* tp_setattr */
+ (cmpfunc)PySwigObject_compare, /* tp_compare */
+ (reprfunc)PySwigObject_repr, /* tp_repr */
+ &PySwigObject_as_number, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ (hashfunc)0, /* tp_hash */
+ (ternaryfunc)0, /* tp_call */
+ (reprfunc)PySwigObject_str, /* tp_str */
+ PyObject_GenericGetAttr, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT, /* tp_flags */
+ swigobject_doc, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
#if PY_VERSION_HEX >= 0x02020000
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ swigobject_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ 0, /* tp_bases */
+ 0, /* tp_mro */
+ 0, /* tp_cache */
+ 0, /* tp_subclasses */
+ 0, /* tp_weaklist */
#endif
#if PY_VERSION_HEX >= 0x02030000
- 0, /* tp_del */
+ 0, /* tp_del */
#endif
#ifdef COUNT_ALLOCS
- 0,0,0,0 /* tp_alloc -> tp_next */
+ 0,0,0,0 /* tp_alloc -> tp_next */
#endif
- };
-
- PySwigObject_Type = tmp;
+ };
+ pyswigobject_type = tmp;
+ pyswigobject_type.ob_type = &PyType_Type;
type_init = 1;
}
-
- return &PySwigObject_Type;
+ return &pyswigobject_type;
}
SWIGRUNTIME PyObject *
-PySwigObject_FromVoidPtrAndDesc(void *ptr, const char *desc)
-{
- PySwigObject *self = PyObject_NEW(PySwigObject, PySwigObject_GetType());
- if (self == NULL) return NULL;
- self->ptr = ptr;
- self->desc = desc;
- return (PyObject *)self;
-}
-
-SWIGRUNTIMEINLINE void *
-PySwigObject_AsVoidPtr(PyObject *self)
-{
- return ((PySwigObject *)self)->ptr;
-}
-
-SWIGRUNTIMEINLINE const char *
-PySwigObject_GetDesc(PyObject *self)
+PySwigObject_New(void *ptr, swig_type_info *ty, int own)
{
- return ((PySwigObject *)self)->desc;
-}
-
-SWIGRUNTIMEINLINE int
-PySwigObject_Check(PyObject *op) {
- return ((op)->ob_type == PySwigObject_GetType())
- || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0);
+ PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type());
+ if (sobj) {
+ sobj->ptr = ptr;
+ sobj->ty = ty;
+ sobj->own = own;
+ sobj->next = 0;
+ }
+ return (PyObject *)sobj;
}
/* -----------------------------------------------------------------------------
@@ -837,12 +1700,12 @@
typedef struct {
PyObject_HEAD
void *pack;
- const char *desc;
+ swig_type_info *ty;
size_t size;
} PySwigPacked;
SWIGRUNTIME int
-PySwigPacked_print(PySwigPacked *v, FILE *fp, int flags)
+PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
{
char result[SWIG_BUFFER_SIZE];
fputs("<Swig Packed ", fp);
@@ -850,7 +1713,7 @@
fputs("at ", fp);
fputs(result, fp);
}
- fputs(v->desc,fp);
+ fputs(v->ty->name,fp);
fputs(">", fp);
return 0;
}
@@ -860,9 +1723,9 @@
{
char result[SWIG_BUFFER_SIZE];
if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
- return PyString_FromFormat("<Swig Packed at %s%s>", result, v->desc);
+ return PyString_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
} else {
- return PyString_FromFormat("<Swig Packed %s>", v->desc);
+ return PyString_FromFormat("<Swig Packed %s>", v->ty->name);
}
}
@@ -871,426 +1734,489 @@
{
char result[SWIG_BUFFER_SIZE];
if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
- return PyString_FromFormat("%s%s", result, v->desc);
+ return PyString_FromFormat("%s%s", result, v->ty->name);
} else {
- return PyString_FromFormat("%s", v->desc);
+ return PyString_FromString(v->ty->name);
}
}
SWIGRUNTIME int
PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w)
{
- int c = strcmp(v->desc, w->desc);
- if (c) {
- return c;
- } else {
- size_t i = v->size;
- size_t j = w->size;
- int s = (i < j) ? -1 : (i > j) ? 1 : 0;
- return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
- }
+ size_t i = v->size;
+ size_t j = w->size;
+ int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
+ return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
+}
+
+SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void);
+
+SWIGRUNTIME PyTypeObject*
+PySwigPacked_type(void) {
+ static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type();
+ return type;
+}
+
+SWIGRUNTIMEINLINE int
+PySwigPacked_Check(PyObject *op) {
+ return ((op)->ob_type == _PySwigPacked_type())
+ || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0);
}
SWIGRUNTIME void
-PySwigPacked_dealloc(PySwigPacked *self)
+PySwigPacked_dealloc(PyObject *v)
{
- free(self->pack);
- PyObject_DEL(self);
+ if (PySwigPacked_Check(v)) {
+ PySwigPacked *sobj = (PySwigPacked *) v;
+ free(sobj->pack);
+ }
+ PyObject_DEL(v);
}
SWIGRUNTIME PyTypeObject*
-PySwigPacked_GetType() {
- static char PySwigPacked_Type__doc__[] =
- "Swig object carries a C/C++ instance pointer";
- static int type_init = 0;
-
- static PyTypeObject PySwigPacked_Type;
+_PySwigPacked_type(void) {
+ static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
+ static PyTypeObject pyswigpacked_type;
+ static int type_init = 0;
if (!type_init) {
- PyTypeObject tmp = {
- PyObject_HEAD_INIT(&PyType_Type)
- 0, /*ob_size*/
- "PySwigPacked", /*tp_name*/
- sizeof(PySwigPacked), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- /* methods */
- (destructor)PySwigPacked_dealloc, /*tp_dealloc*/
- (printfunc)PySwigPacked_print, /*tp_print*/
- (getattrfunc)0, /*tp_getattr*/
- (setattrfunc)0, /*tp_setattr*/
- (cmpfunc)PySwigPacked_compare, /*tp_compare*/
- (reprfunc)PySwigPacked_repr, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- (hashfunc)0, /*tp_hash*/
- (ternaryfunc)0, /*tp_call*/
- (reprfunc)PySwigPacked_str, /*tp_str*/
- /* Space for future expansion */
- 0L,0L,0L,0L,
- PySwigPacked_Type__doc__, /* Documentation string */
-#if PY_VERSION_HEX >= 0x02000000
- 0, /* tp_traverse */
- 0, /* tp_clear */
-#endif
-#if PY_VERSION_HEX >= 0x02010000
- 0, /* tp_richcompare */
- 0, /* tp_weaklistoffset */
-#endif
-#if PY_VERSION_HEX >= 0x02020000
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
+ const PyTypeObject tmp
+ = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /* ob_size */
+ (char *)"PySwigPacked", /* tp_name */
+ sizeof(PySwigPacked), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ (destructor)PySwigPacked_dealloc, /* tp_dealloc */
+ (printfunc)PySwigPacked_print, /* tp_print */
+ (getattrfunc)0, /* tp_getattr */
+ (setattrfunc)0, /* tp_setattr */
+ (cmpfunc)PySwigPacked_compare, /* tp_compare */
+ (reprfunc)PySwigPacked_repr, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ (hashfunc)0, /* tp_hash */
+ (ternaryfunc)0, /* tp_call */
+ (reprfunc)PySwigPacked_str, /* tp_str */
+ PyObject_GenericGetAttr, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT, /* tp_flags */
+ swigpacked_doc, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+#if PY_VERSION_HEX >= 0x02020000
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ 0, /* tp_bases */
+ 0, /* tp_mro */
+ 0, /* tp_cache */
+ 0, /* tp_subclasses */
+ 0, /* tp_weaklist */
#endif
#if PY_VERSION_HEX >= 0x02030000
- 0, /* tp_del */
+ 0, /* tp_del */
#endif
#ifdef COUNT_ALLOCS
- 0,0,0,0 /* tp_alloc -> tp_next */
+ 0,0,0,0 /* tp_alloc -> tp_next */
#endif
- };
-
- PySwigPacked_Type = tmp;
+ };
+ pyswigpacked_type = tmp;
+ pyswigpacked_type.ob_type = &PyType_Type;
type_init = 1;
}
-
-
-
- return &PySwigPacked_Type;
+ return &pyswigpacked_type;
}
SWIGRUNTIME PyObject *
-PySwigPacked_FromDataAndDesc(void *ptr, size_t size, const char *desc)
+PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty)
{
- PySwigPacked *self = PyObject_NEW(PySwigPacked, PySwigPacked_GetType());
- if (self == NULL) {
- return NULL;
- } else {
+ PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type());
+ if (sobj) {
void *pack = malloc(size);
- memcpy(pack, ptr, size);
- self->pack = pack;
- self->desc = desc;
- self->size = size;
- return (PyObject *) self;
+ if (pack) {
+ memcpy(pack, ptr, size);
+ sobj->pack = pack;
+ sobj->ty = ty;
+ sobj->size = size;
+ } else {
+ PyObject_DEL((PyObject *) sobj);
+ sobj = 0;
+ }
}
+ return (PyObject *) sobj;
}
-SWIGRUNTIMEINLINE const char *
+SWIGRUNTIME swig_type_info *
PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
{
- PySwigPacked *self = (PySwigPacked *)obj;
- if (self->size != size) return 0;
- memcpy(ptr, self->pack, size);
- return self->desc;
-}
-
-SWIGRUNTIMEINLINE const char *
-PySwigPacked_GetDesc(PyObject *self)
-{
- return ((PySwigPacked *)self)->desc;
-}
-
-SWIGRUNTIMEINLINE int
-PySwigPacked_Check(PyObject *op) {
- return ((op)->ob_type == PySwigPacked_GetType())
- || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0);
+ if (PySwigPacked_Check(obj)) {
+ PySwigPacked *sobj = (PySwigPacked *)obj;
+ if (sobj->size != size) return 0;
+ memcpy(ptr, sobj->pack, size);
+ return sobj->ty;
+ } else {
+ return 0;
+ }
}
-#else
/* -----------------------------------------------------------------------------
- * Use the old Python PyCObject instead of PySwigObject
+ * pointers/data manipulation
* ----------------------------------------------------------------------------- */
-#define PySwigObject_GetDesc(obj) PyCObject_GetDesc(obj)
-#define PySwigObject_Check(obj) PyCObject_Check(obj)
-#define PySwigObject_AsVoidPtr(obj) PyCObject_AsVoidPtr(obj)
-#define PySwigObject_FromVoidPtrAndDesc(p, d) PyCObject_FromVoidPtrAndDesc(p, d, NULL)
-
-#endif
+SWIGRUNTIMEINLINE PyObject *
+_SWIG_This(void)
+{
+ return PyString_FromString("this");
+}
-#endif
+SWIGRUNTIME PyObject *
+SWIG_This(void)
+{
+ static PyObject *SWIG_STATIC_POINTER(swig_this) = _SWIG_This();
+ return swig_this;
+}
-/* -----------------------------------------------------------------------------
- * errors manipulation
- * ----------------------------------------------------------------------------- */
+/* #define SWIG_PYTHON_SLOW_GETSET_THIS */
-SWIGRUNTIME void
-SWIG_Python_TypeError(const char *type, PyObject *obj)
+SWIGRUNTIME PySwigObject *
+SWIG_Python_GetSwigThis(PyObject *pyobj)
{
- if (type) {
-#if defined(SWIG_COBJECT_TYPES)
- if (PySwigObject_Check(obj)) {
- const char *otype = (const char *) PySwigObject_GetDesc(obj);
- if (otype) {
- PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received",
- type, otype);
- return;
- }
- } else
-#endif
- {
- const char *otype = (obj ? obj->ob_type->tp_name : 0);
- if (otype) {
- PyObject *str = PyObject_Str(obj);
- const char *cstr = str ? PyString_AsString(str) : 0;
- if (cstr) {
- PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
- type, otype, cstr);
+ if (PySwigObject_Check(pyobj)) {
+ return (PySwigObject *) pyobj;
+ } else {
+ PyObject *obj = 0;
+#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
+ if (PyInstance_Check(pyobj)) {
+ obj = _PyInstance_Lookup(pyobj, SWIG_This());
+ } else {
+ PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
+ if (dictptr != NULL) {
+ PyObject *dict = *dictptr;
+ obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
+ } else {
+#ifdef PyWeakref_CheckProxy
+ if (PyWeakref_CheckProxy(pyobj)) {
+ PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
+ return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
+ }
+#endif
+ obj = PyObject_GetAttr(pyobj,SWIG_This());
+ if (obj) {
+ Py_DECREF(obj);
} else {
- PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
- type, otype);
+ if (PyErr_Occurred()) PyErr_Clear();
+ return 0;
}
- Py_DECREF(str);
- return;
}
- }
- PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
- } else {
- PyErr_Format(PyExc_TypeError, "unexpected type is received");
+ }
+#else
+ obj = PyObject_GetAttr(pyobj,SWIG_This());
+ if (obj) {
+ Py_DECREF(obj);
+ } else {
+ if (PyErr_Occurred()) PyErr_Clear();
+ return 0;
+ }
+#endif
+ if (obj && !PySwigObject_Check(obj)) {
+ /* a PyObject is called 'this', try to get the 'real this'
+ PySwigObject from it */
+ return SWIG_Python_GetSwigThis(obj);
+ }
+ return (PySwigObject *)obj;
}
}
-SWIGRUNTIMEINLINE void
-SWIG_Python_NullRef(const char *type)
-{
- if (type) {
- PyErr_Format(PyExc_TypeError, "null reference of type '%s' was received",type);
- } else {
- PyErr_Format(PyExc_TypeError, "null reference was received");
- }
-}
+/* Acquire a pointer value */
SWIGRUNTIME int
-SWIG_Python_AddErrMesg(const char* mesg, int infront)
-{
- if (PyErr_Occurred()) {
- PyObject *type = 0;
- PyObject *value = 0;
- PyObject *traceback = 0;
- PyErr_Fetch(&type, &value, &traceback);
- if (value) {
- PyObject *old_str = PyObject_Str(value);
- Py_XINCREF(type);
- PyErr_Clear();
- if (infront) {
- PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str));
- } else {
- PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
- }
- Py_DECREF(old_str);
+SWIG_Python_AcquirePtr(PyObject *obj, int own) {
+ if (own) {
+ PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
+ if (sobj) {
+ int oldown = sobj->own;
+ sobj->own = own;
+ return oldown;
}
- return 1;
- } else {
- return 0;
}
+ return 0;
}
+/* Convert a pointer value */
+
SWIGRUNTIME int
-SWIG_Python_ArgFail(int argnum)
-{
- if (PyErr_Occurred()) {
- /* add information about failing argument */
- char mesg[256];
- sprintf(mesg, "argument number %d:", argnum);
- return SWIG_Python_AddErrMesg(mesg, 1);
+SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
+ if (!obj) return SWIG_ERROR;
+ if (obj == Py_None) {
+ if (ptr) *ptr = 0;
+ return SWIG_OK;
} else {
- return 0;
+ PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
+ while (sobj) {
+ void *vptr = sobj->ptr;
+ if (ty) {
+ swig_type_info *to = sobj->ty;
+ if (to == ty) {
+ /* no type cast needed */
+ if (ptr) *ptr = vptr;
+ break;
+ } else {
+ swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
+ if (!tc) {
+ sobj = (PySwigObject *)sobj->next;
+ } else {
+ if (ptr) *ptr = SWIG_TypeCast(tc,vptr);
+ break;
+ }
+ }
+ } else {
+ if (ptr) *ptr = vptr;
+ break;
+ }
+ }
+ if (sobj) {
+ if (own) *own = sobj->own;
+ if (flags & SWIG_POINTER_DISOWN) {
+ sobj->own = 0;
+ }
+ return SWIG_OK;
+ } else {
+ int res = SWIG_ERROR;
+ if (flags & SWIG_POINTER_IMPLICIT_CONV) {
+ PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
+ if (data && !data->implicitconv) {
+ PyObject *klass = data->klass;
+ if (klass) {
+ PyObject *impconv;
+ data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
+ impconv = SWIG_Python_CallFunctor(klass, obj);
+ data->implicitconv = 0;
+ if (PyErr_Occurred()) {
+ PyErr_Clear();
+ impconv = 0;
+ }
+ if (impconv) {
+ PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv);
+ if (iobj) {
+ void *vptr;
+ res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
+ if (SWIG_IsOK(res)) {
+ if (ptr) {
+ *ptr = vptr;
+ /* transfer the ownership to 'ptr' */
+ iobj->own = 0;
+ res = SWIG_AddCast(res);
+ res = SWIG_AddNewMask(res);
+ } else {
+ res = SWIG_AddCast(res);
+ }
+ }
+ }
+ Py_DECREF(impconv);
+ }
+ }
+ }
+ }
+ return res;
+ }
}
}
+/* Convert a function ptr value */
-/* -----------------------------------------------------------------------------
- * pointers/data manipulation
- * ----------------------------------------------------------------------------- */
-
-/* Convert a pointer value */
SWIGRUNTIME int
-SWIG_Python_ConvertPtr(PyObject *obj, void **ptr, swig_type_info *ty, int flags) {
- swig_type_info *tc;
- const char *c = 0;
- static PyObject *SWIG_this = 0;
- int newref = 0;
- PyObject *pyobj = 0;
- void *vptr;
-
- if (!obj) return 0;
- if (obj == Py_None) {
- *ptr = 0;
- return 0;
- }
-
-#ifdef SWIG_COBJECT_TYPES
- if (!(PySwigObject_Check(obj))) {
- if (!SWIG_this)
- SWIG_this = PyString_FromString("this");
- pyobj = obj;
- obj = PyObject_GetAttr(obj,SWIG_this);
- newref = 1;
- if (!obj) goto type_error;
- if (!PySwigObject_Check(obj)) {
- Py_DECREF(obj);
- goto type_error;
+SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
+ if (!PyCFunction_Check(obj)) {
+ return SWIG_ConvertPtr(obj, ptr, ty, 0);
+ } else {
+ void *vptr = 0;
+
+ /* here we get the method pointer for callbacks */
+ char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
+ const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
+ if (desc) {
+ desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
+ if (!desc) return SWIG_ERROR;
}
- }
- vptr = PySwigObject_AsVoidPtr(obj);
- c = (const char *) PySwigObject_GetDesc(obj);
- if (newref) { Py_DECREF(obj); }
- goto type_check;
-#else
- if (!(PyString_Check(obj))) {
- if (!SWIG_this)
- SWIG_this = PyString_FromString("this");
- pyobj = obj;
- obj = PyObject_GetAttr(obj,SWIG_this);
- newref = 1;
- if (!obj) goto type_error;
- if (!PyString_Check(obj)) {
- Py_DECREF(obj);
- goto type_error;
+ if (ty) {
+ swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
+ if (!tc) return SWIG_ERROR;
+ *ptr = SWIG_TypeCast(tc,vptr);
+ } else {
+ *ptr = vptr;
}
- }
- c = PyString_AS_STRING(obj);
- /* Pointer values must start with leading underscore */
- c = SWIG_UnpackVoidPtr(c, &vptr, ty->name);
- if (newref) { Py_DECREF(obj); }
- if (!c) goto type_error;
-#endif
+ return SWIG_OK;
+ }
+}
-type_check:
+/* Convert a packed value value */
+SWIGRUNTIME int
+SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
+ swig_type_info *to = PySwigPacked_UnpackData(obj, ptr, sz);
+ if (!to) return SWIG_ERROR;
if (ty) {
- tc = SWIG_TypeCheck(c,ty);
- if (!tc) goto type_error;
- *ptr = SWIG_TypeCast(tc,vptr);
- } else {
- *ptr = vptr;
+ if (to != ty) {
+ /* check type cast? */
+ swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
+ if (!tc) return SWIG_ERROR;
+ }
}
+ return SWIG_OK;
+}
- if ((pyobj) && (flags & SWIG_POINTER_DISOWN)) {
- PyObject_SetAttrString(pyobj,(char*)"thisown",Py_False);
- }
- return 0;
+/* -----------------------------------------------------------------------------
+ * Create a new pointer object
+ * ----------------------------------------------------------------------------- */
+
+/*
+ Create a new instance object, whitout calling __init__, and set the
+ 'this' attribute.
+*/
-type_error:
- PyErr_Clear();
- if (pyobj && !obj) {
- obj = pyobj;
- if (PyCFunction_Check(obj)) {
- /* here we get the method pointer for callbacks */
- char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
- c = doc ? strstr(doc, "swig_ptr: ") : 0;
- if (c) {
- c = SWIG_UnpackVoidPtr(c + 10, &vptr, ty->name);
- if (!c) goto type_error;
- goto type_check;
+SWIGRUNTIME PyObject*
+SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this)
+{
+#if (PY_VERSION_HEX >= 0x02020000)
+ PyObject *inst = 0;
+ PyObject *newraw = data->newraw;
+ if (newraw) {
+ inst = PyObject_Call(newraw, data->newargs, NULL);
+ if (inst) {
+#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
+ PyObject **dictptr = _PyObject_GetDictPtr(inst);
+ if (dictptr != NULL) {
+ PyObject *dict = *dictptr;
+ if (dict == NULL) {
+ dict = PyDict_New();
+ *dictptr = dict;
+ PyDict_SetItem(dict, SWIG_This(), swig_this);
+ }
}
+#else
+ PyObject *key = SWIG_This();
+ PyObject_SetAttr(inst, key, swig_this);
+#endif
}
+ } else {
+ PyObject *dict = PyDict_New();
+ PyDict_SetItem(dict, SWIG_This(), swig_this);
+ inst = PyInstance_NewRaw(data->newargs, dict);
+ Py_DECREF(dict);
}
- if (flags & SWIG_POINTER_EXCEPTION) {
- if (ty) {
- SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
- } else {
- SWIG_Python_TypeError("C/C++ pointer", obj);
- }
+ return inst;
+#else
+#if (PY_VERSION_HEX >= 0x02010000)
+ PyObject *inst;
+ PyObject *dict = PyDict_New();
+ PyDict_SetItem(dict, SWIG_This(), swig_this);
+ inst = PyInstance_NewRaw(data->newargs, dict);
+ Py_DECREF(dict);
+ return (PyObject *) inst;
+#else
+ PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
+ if (inst == NULL) {
+ return NULL;
}
- return -1;
-}
-
-/* Convert a pointer value, signal an exception on a type mismatch */
-SWIGRUNTIME void *
-SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) {
- void *result;
- if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
- PyErr_Clear();
- if (flags & SWIG_POINTER_EXCEPTION) {
- SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
- SWIG_Python_ArgFail(argnum);
- }
+ inst->in_class = (PyClassObject *)data->newargs;
+ Py_INCREF(inst->in_class);
+ inst->in_dict = PyDict_New();
+ if (inst->in_dict == NULL) {
+ Py_DECREF(inst);
+ return NULL;
}
- return result;
+#ifdef Py_TPFLAGS_HAVE_WEAKREFS
+ inst->in_weakreflist = NULL;
+#endif
+#ifdef Py_TPFLAGS_GC
+ PyObject_GC_Init(inst);
+#endif
+ PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
+ return (PyObject *) inst;
+#endif
+#endif
}
-/* Convert a packed value value */
-SWIGRUNTIME int
-SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty, int flags) {
- swig_type_info *tc;
- const char *c = 0;
-
-#if defined(SWIG_COBJECT_TYPES) && !defined(SWIG_COBJECT_PYTHON)
- c = PySwigPacked_UnpackData(obj, ptr, sz);
-#else
- if ((!obj) || (!PyString_Check(obj))) goto type_error;
- c = PyString_AS_STRING(obj);
- /* Pointer values must start with leading underscore */
- c = SWIG_UnpackDataName(c, ptr, sz, ty->name);
+SWIGRUNTIME void
+SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
+{
+ PyObject *dict;
+#if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
+ PyObject **dictptr = _PyObject_GetDictPtr(inst);
+ if (dictptr != NULL) {
+ dict = *dictptr;
+ if (dict == NULL) {
+ dict = PyDict_New();
+ *dictptr = dict;
+ }
+ PyDict_SetItem(dict, SWIG_This(), swig_this);
+ return;
+ }
#endif
- if (!c) goto type_error;
- if (ty) {
- tc = SWIG_TypeCheck(c,ty);
- if (!tc) goto type_error;
- }
- return 0;
+ dict = PyObject_GetAttrString(inst, "__dict__");
+ PyDict_SetItem(dict, SWIG_This(), swig_this);
+ Py_DECREF(dict);
+}
-type_error:
- PyErr_Clear();
- if (flags & SWIG_POINTER_EXCEPTION) {
- if (ty) {
- SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
+
+SWIGINTERN PyObject *
+SWIG_Python_InitShadowInstance(PyObject *args) {
+ PyObject *obj[2];
+ if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) {
+ return NULL;
+ } else {
+ PySwigObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
+ if (sthis) {
+ PySwigObject_append((PyObject*) sthis, obj[1]);
} else {
- SWIG_Python_TypeError("C/C++ packed data", obj);
+ SWIG_Python_SetSwigThis(obj[0], obj[1]);
}
+ return SWIG_Py_Void();
}
- return -1;
-}
+}
+
+/* Create a new pointer object */
-/* Create a new array object */
SWIGRUNTIME PyObject *
-SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int own) {
- PyObject *robj = 0;
+SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
if (!ptr) {
- Py_INCREF(Py_None);
- return Py_None;
- }
-#ifdef SWIG_COBJECT_TYPES
- robj = PySwigObject_FromVoidPtrAndDesc((void *) ptr, (char *)type->name);
-#else
- {
- char result[SWIG_BUFFER_SIZE];
- robj = SWIG_PackVoidPtr(result, ptr, type->name, sizeof(result)) ?
- PyString_FromString(result) : 0;
- }
-#endif
- if (!robj || (robj == Py_None)) return robj;
- if (type->clientdata) {
- PyObject *inst;
- PyObject *args = Py_BuildValue((char*)"(O)", robj);
- Py_DECREF(robj);
- inst = PyObject_CallObject((PyObject *) type->clientdata, args);
- Py_DECREF(args);
- if (inst) {
- if (own) {
- PyObject_SetAttrString(inst,(char*)"thisown",Py_True);
+ return SWIG_Py_Void();
+ } else {
+ int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
+ PyObject *robj = PySwigObject_New(ptr, type, own);
+ PySwigClientData *clientdata = type ? (PySwigClientData *)(type->clientdata) : 0;
+ if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
+ PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
+ if (inst) {
+ Py_DECREF(robj);
+ robj = inst;
}
- robj = inst;
}
+ return robj;
}
- return robj;
}
-SWIGRUNTIME PyObject *
+/* Create a new packed object */
+
+SWIGRUNTIMEINLINE PyObject *
SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
- PyObject *robj = 0;
- if (!ptr) {
- Py_INCREF(Py_None);
- return Py_None;
- }
-#if defined(SWIG_COBJECT_TYPES) && !defined(SWIG_COBJECT_PYTHON)
- robj = PySwigPacked_FromDataAndDesc((void *) ptr, sz, (char *)type->name);
-#else
- {
- char result[SWIG_BUFFER_SIZE];
- robj = SWIG_PackDataName(result, ptr, sz, type->name, sizeof(result)) ?
- PyString_FromString(result) : 0;
- }
-#endif
- return robj;
+ return ptr ? PySwigPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
}
/* -----------------------------------------------------------------------------*
@@ -1301,8 +2227,8 @@
void *SWIG_ReturnGlobalTypeList(void *);
#endif
-SWIGRUNTIME swig_type_info **
-SWIG_Python_GetTypeListHandle() {
+SWIGRUNTIME swig_module_info *
+SWIG_Python_GetModule(void) {
static void *type_pointer = (void *)0;
/* first check if module already created */
if (!type_pointer) {
@@ -1315,356 +2241,643 @@
PyErr_Clear();
type_pointer = (void *)0;
}
- }
#endif
- return (swig_type_info **) type_pointer;
+ }
+ return (swig_module_info *) type_pointer;
}
-/*
- Search for a swig_type_info structure
- */
-SWIGRUNTIMEINLINE swig_type_info *
-SWIG_Python_GetTypeList() {
- swig_type_info **tlh = SWIG_Python_GetTypeListHandle();
- return tlh ? *tlh : (swig_type_info*)0;
+#if PY_MAJOR_VERSION < 2
+/* PyModule_AddObject function was introduced in Python 2.0. The following function
+ is copied out of Python/modsupport.c in python version 2.3.4 */
+SWIGINTERN int
+PyModule_AddObject(PyObject *m, char *name, PyObject *o)
+{
+ PyObject *dict;
+ if (!PyModule_Check(m)) {
+ PyErr_SetString(PyExc_TypeError,
+ "PyModule_AddObject() needs module as first arg");
+ return SWIG_ERROR;
+ }
+ if (!o) {
+ PyErr_SetString(PyExc_TypeError,
+ "PyModule_AddObject() needs non-NULL value");
+ return SWIG_ERROR;
+ }
+
+ dict = PyModule_GetDict(m);
+ if (dict == NULL) {
+ /* Internal error -- modules must have a dict! */
+ PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
+ PyModule_GetName(m));
+ return SWIG_ERROR;
+ }
+ if (PyDict_SetItemString(dict, name, o))
+ return SWIG_ERROR;
+ Py_DECREF(o);
+ return SWIG_OK;
}
+#endif
-#define SWIG_Runtime_GetTypeList SWIG_Python_GetTypeList
-
-#ifdef __cplusplus
+SWIGRUNTIME void
+SWIG_Python_DestroyModule(void *vptr)
+{
+ swig_module_info *swig_module = (swig_module_info *) vptr;
+ swig_type_info **types = swig_module->types;
+ size_t i;
+ for (i =0; i < swig_module->size; ++i) {
+ swig_type_info *ty = types[i];
+ if (ty->owndata) {
+ PySwigClientData *data = (PySwigClientData *) ty->clientdata;
+ if (data) PySwigClientData_Del(data);
+ }
+ }
+ Py_DECREF(SWIG_This());
}
-#endif
+SWIGRUNTIME void
+SWIG_Python_SetModule(swig_module_info *swig_module) {
+ static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */
-/* -------- TYPES TABLE (BEGIN) -------- */
+ PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
+ swig_empty_runtime_method_table);
+ PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
+ if (pointer && module) {
+ PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
+ } else {
+ Py_XDECREF(pointer);
+ }
+}
-#define SWIGTYPE_std__size_t swig_types[0]
-#define SWIGTYPE_size_t swig_types[1]
-#define SWIGTYPE_p_uint32_t swig_types[2]
-#define SWIGTYPE_p_switch_core_session_t swig_types[3]
-#define SWIGTYPE_p_void swig_types[4]
-#define SWIGTYPE_p_switch_input_callback_function_t swig_types[5]
-#define SWIGTYPE_p_char swig_types[6]
-#define SWIGTYPE_p_input_callback_state swig_types[7]
-#define SWIGTYPE_std__ptrdiff_t swig_types[8]
-#define SWIGTYPE_ptrdiff_t swig_types[9]
-#define SWIGTYPE_p_switch_status_t swig_types[10]
-#define SWIGTYPE_p_switch_channel_t swig_types[11]
-#define SWIGTYPE_p_switch_core_session swig_types[12]
-#define SWIGTYPE_p_CoreSession swig_types[13]
-#define SWIGTYPE_p_PySession swig_types[14]
-#define SWIGTYPE_p_switch_input_type_t swig_types[15]
-static swig_type_info *swig_types[17];
+/* The python cached type query */
+SWIGRUNTIME PyObject *
+SWIG_Python_TypeCache() {
+ static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
+ return cache;
+}
-/* -------- TYPES TABLE (END) -------- */
+SWIGRUNTIME swig_type_info *
+SWIG_Python_TypeQuery(const char *type)
+{
+ PyObject *cache = SWIG_Python_TypeCache();
+ PyObject *key = PyString_FromString(type);
+ PyObject *obj = PyDict_GetItem(cache, key);
+ swig_type_info *descriptor;
+ if (obj) {
+ descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
+ } else {
+ swig_module_info *swig_module = SWIG_Python_GetModule();
+ descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
+ if (descriptor) {
+ obj = PyCObject_FromVoidPtr(descriptor, NULL);
+ PyDict_SetItem(cache, key, obj);
+ Py_DECREF(obj);
+ }
+ }
+ Py_DECREF(key);
+ return descriptor;
+}
+/*
+ For backward compatibility only
+*/
+#define SWIG_POINTER_EXCEPTION 0
+#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg)
+#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
-/*-----------------------------------------------
+SWIGRUNTIME int
+SWIG_Python_AddErrMesg(const char* mesg, int infront)
+{
+ if (PyErr_Occurred()) {
+ PyObject *type = 0;
+ PyObject *value = 0;
+ PyObject *traceback = 0;
+ PyErr_Fetch(&type, &value, &traceback);
+ if (value) {
+ PyObject *old_str = PyObject_Str(value);
+ Py_XINCREF(type);
+ PyErr_Clear();
+ if (infront) {
+ PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str));
+ } else {
+ PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
+ }
+ Py_DECREF(old_str);
+ }
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+SWIGRUNTIME int
+SWIG_Python_ArgFail(int argnum)
+{
+ if (PyErr_Occurred()) {
+ /* add information about failing argument */
+ char mesg[256];
+ PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
+ return SWIG_Python_AddErrMesg(mesg, 1);
+ } else {
+ return 0;
+ }
+}
+
+SWIGRUNTIMEINLINE const char *
+PySwigObject_GetDesc(PyObject *self)
+{
+ PySwigObject *v = (PySwigObject *)self;
+ swig_type_info *ty = v ? v->ty : 0;
+ return ty ? ty->str : (char*)"";
+}
+
+SWIGRUNTIME void
+SWIG_Python_TypeError(const char *type, PyObject *obj)
+{
+ if (type) {
+#if defined(SWIG_COBJECT_TYPES)
+ if (obj && PySwigObject_Check(obj)) {
+ const char *otype = (const char *) PySwigObject_GetDesc(obj);
+ if (otype) {
+ PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received",
+ type, otype);
+ return;
+ }
+ } else
+#endif
+ {
+ const char *otype = (obj ? obj->ob_type->tp_name : 0);
+ if (otype) {
+ PyObject *str = PyObject_Str(obj);
+ const char *cstr = str ? PyString_AsString(str) : 0;
+ if (cstr) {
+ PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
+ type, otype, cstr);
+ } else {
+ PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
+ type, otype);
+ }
+ Py_XDECREF(str);
+ return;
+ }
+ }
+ PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
+ } else {
+ PyErr_Format(PyExc_TypeError, "unexpected type is received");
+ }
+}
+
+
+/* Convert a pointer value, signal an exception on a type mismatch */
+SWIGRUNTIME void *
+SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) {
+ void *result;
+ if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
+ PyErr_Clear();
+ if (flags & SWIG_POINTER_EXCEPTION) {
+ SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
+ SWIG_Python_ArgFail(argnum);
+ }
+ }
+ return result;
+}
+
+
+#ifdef __cplusplus
+#if 0
+{ /* cc-mode */
+#endif
+}
+#endif
+
+
+
+#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
+
+#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
+
+
+
+/* -------- TYPES TABLE (BEGIN) -------- */
+
+#define SWIGTYPE_p_CoreSession swig_types[0]
+#define SWIGTYPE_p_PySession swig_types[1]
+#define SWIGTYPE_p_char swig_types[2]
+#define SWIGTYPE_p_input_callback_state swig_types[3]
+#define SWIGTYPE_p_switch_channel_t swig_types[4]
+#define SWIGTYPE_p_switch_core_session swig_types[5]
+#define SWIGTYPE_p_switch_core_session_t swig_types[6]
+#define SWIGTYPE_p_switch_input_callback_function_t swig_types[7]
+#define SWIGTYPE_p_switch_input_type_t swig_types[8]
+#define SWIGTYPE_p_switch_status_t swig_types[9]
+#define SWIGTYPE_p_uint32_t swig_types[10]
+#define SWIGTYPE_p_void swig_types[11]
+static swig_type_info *swig_types[13];
+static swig_module_info swig_module = {swig_types, 12, 0, 0, 0, 0};
+#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
+#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
+
+/* -------- TYPES TABLE (END) -------- */
+
+#if (PY_VERSION_HEX <= 0x02000000)
+# if !defined(SWIG_PYTHON_CLASSIC)
+# error "This python version requires to use swig with the '-classic' option"
+# endif
+#endif
+
+/*-----------------------------------------------
@(target):= _freeswitch.so
------------------------------------------------*/
#define SWIG_init init_freeswitch
#define SWIG_name "_freeswitch"
+#define SWIGVERSION 0x010329
+
+
+#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
+#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
+
+
+#include <stdexcept>
+
+
+namespace swig {
+ class PyObject_ptr {
+ protected:
+ PyObject *_obj;
+
+ public:
+ PyObject_ptr() :_obj(0)
+ {
+ }
+
+ PyObject_ptr(const PyObject_ptr& item) : _obj(item._obj)
+ {
+ Py_XINCREF(_obj);
+ }
+
+ PyObject_ptr(PyObject *obj, bool initial_ref = true) :_obj(obj)
+ {
+ if (initial_ref) Py_XINCREF(_obj);
+ }
+
+ PyObject_ptr & operator=(const PyObject_ptr& item)
+ {
+ Py_XINCREF(item._obj);
+ Py_XDECREF(_obj);
+ _obj = item._obj;
+ return *this;
+ }
+
+ ~PyObject_ptr()
+ {
+ Py_XDECREF(_obj);
+ }
+
+ operator PyObject *() const
+ {
+ return _obj;
+ }
+
+ PyObject *operator->() const
+ {
+ return _obj;
+ }
+ };
+}
+
+
+namespace swig {
+ struct PyObject_var : PyObject_ptr {
+ PyObject_var(PyObject* obj = 0) : PyObject_ptr(obj, false) { }
+
+ PyObject_var & operator = (PyObject* obj)
+ {
+ Py_XDECREF(_obj);
+ _obj = obj;
+ return *this;
+ }
+ };
+}
+
+
#include "switch_cpp.h"
#include "freeswitch_python.h"
-extern "C" void console_log(char *,char *);
-/* returns SWIG_OLDOBJ if the input is a raw char*, SWIG_PYSTR if is a PyString */
+SWIGINTERN swig_type_info*
+SWIG_pchar_descriptor()
+{
+ static int init = 0;
+ static swig_type_info* info = 0;
+ if (!init) {
+ info = SWIG_TypeQuery("_p_char");
+ init = 1;
+ }
+ return info;
+}
+
+
SWIGINTERN int
-SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize)
+SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
{
- static swig_type_info* pchar_info = 0;
- char* vptr = 0;
- if (!pchar_info) pchar_info = SWIG_TypeQuery("char *");
- if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_info, 0) != -1) {
- if (cptr) *cptr = vptr;
- if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
- return SWIG_OLDOBJ;
- } else {
- PyErr_Clear();
- if (PyString_Check(obj)) {
- if (cptr) {
- *cptr = PyString_AS_STRING(obj);
- if (psize) {
- *psize = PyString_GET_SIZE(obj) + 1;
+ if (PyString_Check(obj)) {
+ char *cstr; int len;
+ PyString_AsStringAndSize(obj, &cstr, &len);
+ if (cptr) {
+ if (alloc) {
+ /*
+ In python the user should not be able to modify the inner
+ string representation. To warranty that, if you define
+ SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string
+ buffer is always returned.
+
+ The default behavior is just to return the pointer value,
+ so, be careful.
+ */
+#if defined(SWIG_PYTHON_SAFE_CSTRINGS)
+ if (*alloc != SWIG_OLDOBJ)
+#else
+ if (*alloc == SWIG_NEWOBJ)
+#endif
+ {
+ *cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1)));
+ *alloc = SWIG_NEWOBJ;
+ }
+ else {
+ *cptr = cstr;
+ *alloc = SWIG_OLDOBJ;
}
+ } else {
+ *cptr = PyString_AsString(obj);
+ }
+ }
+ if (psize) *psize = len + 1;
+ return SWIG_OK;
+ } else {
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+ if (pchar_descriptor) {
+ void* vptr = 0;
+ if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
+ if (cptr) *cptr = (char *) vptr;
+ if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
+ if (alloc) *alloc = SWIG_OLDOBJ;
+ return SWIG_OK;
}
- return SWIG_PYSTR;
}
}
- if (cptr) {
- SWIG_type_error("char *", obj);
- }
- return 0;
+ return SWIG_TypeError;
}
-SWIGINTERNSHORT int
-SWIG_AsCharPtr(PyObject *obj, char **val)
+
+
+
+SWIGINTERNINLINE PyObject *
+SWIG_FromCharPtrAndSize(const char* carray, size_t size)
{
- if (SWIG_AsCharPtrAndSize(obj, val, (size_t*)(0))) {
- return 1;
- }
- if (val) {
- PyErr_Clear();
- SWIG_type_error("char *", obj);
+ if (carray) {
+ if (size > INT_MAX) {
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+ return pchar_descriptor ?
+ SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
+ } else {
+ return PyString_FromStringAndSize(carray, static_cast< int >(size));
+ }
+ } else {
+ return SWIG_Py_Void();
}
- return 0;
}
-extern "C" void console_clean_log(char *);
-extern "C" char *api_execute(char *,char *);
-SWIGINTERN PyObject *
-SWIG_FromCharPtr(const char* cptr)
+SWIGINTERNINLINE PyObject *
+SWIG_FromCharPtr(const char *cptr)
{
- if (cptr) {
- size_t size = strlen(cptr);
- if (size > INT_MAX) {
- return SWIG_NewPointerObj((char*)(cptr),
- SWIG_TypeQuery("char *"), 0);
+ return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
+}
+
+
+ #define SWIG_From_long PyInt_FromLong
+
+
+SWIGINTERNINLINE PyObject *
+SWIG_From_int (int value)
+{
+ return SWIG_From_long (value);
+}
+
+
+#include <limits.h>
+#ifndef LLONG_MIN
+# define LLONG_MIN LONG_LONG_MIN
+#endif
+#ifndef LLONG_MAX
+# define LLONG_MAX LONG_LONG_MAX
+#endif
+#ifndef ULLONG_MAX
+# define ULLONG_MAX ULONG_LONG_MAX
+#endif
+
+
+SWIGINTERN int
+SWIG_AsVal_double (PyObject *obj, double *val)
+{
+ int res = SWIG_TypeError;
+ if (PyFloat_Check(obj)) {
+ if (val) *val = PyFloat_AsDouble(obj);
+ return SWIG_OK;
+ } else if (PyInt_Check(obj)) {
+ if (val) *val = PyInt_AsLong(obj);
+ return SWIG_OK;
+ } else if (PyLong_Check(obj)) {
+ double v = PyLong_AsDouble(obj);
+ if (!PyErr_Occurred()) {
+ if (val) *val = v;
+ return SWIG_OK;
} else {
- if (size != 0) {
- return PyString_FromStringAndSize(cptr, size);
+ PyErr_Clear();
+ }
+ }
+#ifdef SWIG_PYTHON_CAST_MODE
+ {
+ int dispatch = 0;
+ double d = PyFloat_AsDouble(obj);
+ if (!PyErr_Occurred()) {
+ if (val) *val = d;
+ return SWIG_AddCast(SWIG_OK);
+ } else {
+ PyErr_Clear();
+ }
+ if (!dispatch) {
+ long v = PyLong_AsLong(obj);
+ if (!PyErr_Occurred()) {
+ if (val) *val = v;
+ return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
} else {
- return PyString_FromString(cptr);
+ PyErr_Clear();
}
}
}
- Py_INCREF(Py_None);
- return Py_None;
+#endif
+ return res;
}
-extern "C" void api_reply_delete(char *);
-extern "C" switch_status_t process_callback_result(char *,input_callback_state *,switch_core_session_t *);
- /*@/usr/share/swig1.3/python/pymacros.swg,66,SWIG_define@*/
-#define SWIG_From_int PyInt_FromLong
-/*@@*/
+#include <float.h>
-#include <limits.h>
+#include <math.h>
-SWIGINTERN int
- SWIG_CheckLongInRange(long value, long min_value, long max_value,
- const char *errmsg)
-{
- if (value < min_value) {
- if (errmsg) {
- PyErr_Format(PyExc_OverflowError,
- "value %ld is less than '%s' minimum %ld",
- value, errmsg, min_value);
- }
- return 0;
- } else if (value > max_value) {
- if (errmsg) {
- PyErr_Format(PyExc_OverflowError,
- "value %ld is greater than '%s' maximum %ld",
- value, errmsg, max_value);
- }
- return 0;
+SWIGINTERNINLINE int
+SWIG_CanCastAsInteger(double *d, double min, double max) {
+ double x = *d;
+ if ((min <= x && x <= max)) {
+ double fx = floor(x);
+ double cx = ceil(x);
+ double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */
+ if ((errno == EDOM) || (errno == ERANGE)) {
+ errno = 0;
+ } else {
+ double summ, reps, diff;
+ if (rd < x) {
+ diff = x - rd;
+ } else if (rd > x) {
+ diff = rd - x;
+ } else {
+ return 1;
+ }
+ summ = rd + x;
+ reps = diff/summ;
+ if (reps < 8*DBL_EPSILON) {
+ *d = rd;
+ return 1;
+ }
+ }
}
- return 1;
+ return 0;
}
SWIGINTERN int
- SWIG_AsVal_long(PyObject * obj, long* val)
+SWIG_AsVal_long (PyObject *obj, long* val)
{
if (PyInt_Check(obj)) {
- if (val) *val = PyInt_AS_LONG(obj);
- return 1;
- }
- if (PyLong_Check(obj)) {
+ if (val) *val = PyInt_AsLong(obj);
+ return SWIG_OK;
+ } else if (PyLong_Check(obj)) {
long v = PyLong_AsLong(obj);
if (!PyErr_Occurred()) {
if (val) *val = v;
- return 1;
+ return SWIG_OK;
} else {
- if (!val) PyErr_Clear();
- return 0;
+ PyErr_Clear();
}
}
- if (val) {
- SWIG_type_error("long", obj);
- }
- return 0;
- }
-
-
-#if INT_MAX != LONG_MAX
-SWIGINTERN int
- SWIG_AsVal_int(PyObject *obj, int *val)
-{
- const char* errmsg = val ? "int" : (char*)0;
- long v;
- if (SWIG_AsVal_long(obj, &v)) {
- if (SWIG_CheckLongInRange(v, INT_MIN,INT_MAX, errmsg)) {
- if (val) *val = (int)(v);
- return 1;
+#ifdef SWIG_PYTHON_CAST_MODE
+ {
+ int dispatch = 0;
+ long v = PyInt_AsLong(obj);
+ if (!PyErr_Occurred()) {
+ if (val) *val = v;
+ return SWIG_AddCast(SWIG_OK);
} else {
- return 0;
+ PyErr_Clear();
+ }
+ if (!dispatch) {
+ double d;
+ int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
+ if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
+ if (val) *val = (long)(d);
+ return res;
+ }
}
- } else {
- PyErr_Clear();
- }
- if (val) {
- SWIG_type_error(errmsg, obj);
}
- return 0;
-}
-#else
-SWIGINTERNSHORT int
- SWIG_AsVal_int(PyObject *obj, int *val)
-{
- return SWIG_AsVal_long(obj,(long*)val);
-}
#endif
-
-
-SWIGINTERNSHORT int
-SWIG_As_int(PyObject* obj)
-{
- int v;
- if (!SWIG_AsVal_int(obj, &v)) {
- /*
- this is needed to make valgrind/purify happier.
- */
- memset((void*)&v, 0, sizeof(int));
- }
- return v;
-}
-
-
-SWIGINTERNSHORT int
-SWIG_Check_int(PyObject* obj)
-{
- return SWIG_AsVal_int(obj, (int*)0);
+ return SWIG_TypeError;
}
-SWIGINTERN PyObject*
-t_output_helper(PyObject* target, PyObject* o) {
- if (!target) {
- target = o;
- } else if (target == Py_None) {
- Py_DECREF(target);
- target = o;
- } else {
- if (!PyList_Check(target)) {
- PyObject *o2 = target;
- target = PyList_New(1);
- PyList_SetItem(target, 0, o2);
- }
- PyList_Append(target,o);
+SWIGINTERN int
+SWIG_AsVal_int (PyObject * obj, int *val)
+{
+ long v;
+ int res = SWIG_AsVal_long (obj, &v);
+ if (SWIG_IsOK(res)) {
+ if ((v < INT_MIN || v > INT_MAX)) {
+ return SWIG_OverflowError;
+ } else {
+ if (val) *val = static_cast< int >(v);
}
- return target;
+ }
+ return res;
}
-SWIGINTERNSHORT PyObject*
- SWIG_From_bool(bool value)
+SWIGINTERNINLINE PyObject*
+ SWIG_From_bool (bool value)
{
- PyObject *obj = value ? Py_True : Py_False;
- Py_INCREF(obj);
- return obj;
+ return PyBool_FromLong(value ? 1 : 0);
}
-extern "C" switch_status_t PythonDTMFCallback(switch_core_session *,void *,switch_input_type_t,void *,unsigned int);
-
-SWIGINTERNSHORT int
- SWIG_CheckUnsignedLongInRange(unsigned long value,
- unsigned long max_value,
- const char *errmsg)
-{
- if (value > max_value) {
- if (errmsg) {
- PyErr_Format(PyExc_OverflowError,
- "value %lu is greater than '%s' minimum %lu",
- value, errmsg, max_value);
- }
- return 0;
- }
- return 1;
- }
-
SWIGINTERN int
- SWIG_AsVal_unsigned_SS_long(PyObject *obj, unsigned long *val)
+SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
{
if (PyInt_Check(obj)) {
- long v = PyInt_AS_LONG(obj);
+ long v = PyInt_AsLong(obj);
if (v >= 0) {
if (val) *val = v;
- return 1;
- }
+ return SWIG_OK;
+ } else {
+ return SWIG_OverflowError;
+ }
+ } else if (PyLong_Check(obj)) {
+ unsigned long v = PyLong_AsUnsignedLong(obj);
+ if (!PyErr_Occurred()) {
+ if (val) *val = v;
+ return SWIG_OK;
+ } else {
+ PyErr_Clear();
+ }
}
- if (PyLong_Check(obj)) {
+#ifdef SWIG_PYTHON_CAST_MODE
+ {
+ int dispatch = 0;
unsigned long v = PyLong_AsUnsignedLong(obj);
if (!PyErr_Occurred()) {
if (val) *val = v;
- return 1;
+ return SWIG_AddCast(SWIG_OK);
} else {
- if (!val) PyErr_Clear();
- return 0;
+ PyErr_Clear();
+ }
+ if (!dispatch) {
+ double d;
+ int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
+ if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
+ if (val) *val = (unsigned long)(d);
+ return res;
+ }
}
- }
- if (val) {
- SWIG_type_error("unsigned long", obj);
}
- return 0;
+#endif
+ return SWIG_TypeError;
}
-#if UINT_MAX != ULONG_MAX
SWIGINTERN int
- SWIG_AsVal_unsigned_SS_int(PyObject *obj, unsigned int *val)
-{
- const char* errmsg = val ? "unsigned int" : (char*)0;
+SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val)
+{
unsigned long v;
- if (SWIG_AsVal_unsigned_SS_long(obj, &v)) {
- if (SWIG_CheckUnsignedLongInRange(v, INT_MAX, errmsg)) {
- if (val) *val = (unsigned int)(v);
- return 1;
+ int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
+ if (SWIG_IsOK(res)) {
+ if ((v > UINT_MAX)) {
+ return SWIG_OverflowError;
+ } else {
+ if (val) *val = static_cast< unsigned int >(v);
}
- } else {
- PyErr_Clear();
- }
- if (val) {
- SWIG_type_error(errmsg, obj);
- }
- return 0;
-}
-#else
-SWIGINTERNSHORT unsigned int
- SWIG_AsVal_unsigned_SS_int(PyObject *obj, unsigned int *val)
-{
- return SWIG_AsVal_unsigned_SS_long(obj,(unsigned long *)val);
-}
-#endif
-
-
-SWIGINTERNSHORT unsigned int
-SWIG_As_unsigned_SS_int(PyObject* obj)
-{
- unsigned int v;
- if (!SWIG_AsVal_unsigned_SS_int(obj, &v)) {
- /*
- this is needed to make valgrind/purify happier.
- */
- memset((void*)&v, 0, sizeof(unsigned int));
- }
- return v;
-}
-
-
-SWIGINTERNSHORT int
-SWIG_Check_unsigned_SS_int(PyObject* obj)
-{
- return SWIG_AsVal_unsigned_SS_int(obj, (unsigned int*)0);
+ }
+ return res;
}
@@ -1729,6 +2942,7 @@
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "restored threadstate, calling python function: %p\n", func);
result = PyEval_CallObject(func, arglist);
+
threadState = PyEval_SaveThread();
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "called python function\n");
@@ -1872,1292 +3086,1710 @@
#ifdef __cplusplus
extern "C" {
#endif
-static PyObject *_wrap_console_log(PyObject *, PyObject *args) {
- PyObject *resultobj;
- char *arg1 = (char *) 0 ;
- char *arg2 = (char *) 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OO:console_log",&obj0,&obj1)) goto fail;
- if (!SWIG_AsCharPtr(obj0, (char**)&arg1)) {
- SWIG_arg_fail(1);SWIG_fail;
- }
- if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) {
- SWIG_arg_fail(2);SWIG_fail;
- }
- console_log(arg1,arg2);
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
-}
-
-
-static PyObject *_wrap_console_clean_log(PyObject *, PyObject *args) {
- PyObject *resultobj;
- char *arg1 = (char *) 0 ;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:console_clean_log",&obj0)) goto fail;
- if (!SWIG_AsCharPtr(obj0, (char**)&arg1)) {
- SWIG_arg_fail(1);SWIG_fail;
- }
- console_clean_log(arg1);
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
-}
-
-
-static PyObject *_wrap_api_execute(PyObject *, PyObject *args) {
- PyObject *resultobj;
- char *arg1 = (char *) 0 ;
- char *arg2 = (char *) 0 ;
- char *result;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OO:api_execute",&obj0,&obj1)) goto fail;
- if (!SWIG_AsCharPtr(obj0, (char**)&arg1)) {
- SWIG_arg_fail(1);SWIG_fail;
- }
- if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) {
- SWIG_arg_fail(2);SWIG_fail;
- }
- result = (char *)api_execute(arg1,arg2);
-
- resultobj = SWIG_FromCharPtr(result);
- return resultobj;
- fail:
- return NULL;
-}
-
-
-static PyObject *_wrap_api_reply_delete(PyObject *, PyObject *args) {
- PyObject *resultobj;
- char *arg1 = (char *) 0 ;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:api_reply_delete",&obj0)) goto fail;
- if (!SWIG_AsCharPtr(obj0, (char**)&arg1)) {
- SWIG_arg_fail(1);SWIG_fail;
- }
- api_reply_delete(arg1);
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_console_log(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ char *arg1 = (char *) 0 ;
+ char *arg2 = (char *) 0 ;
+ int res1 ;
+ char *buf1 = 0 ;
+ int alloc1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:console_log",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "console_log" "', argument " "1"" of type '" "char *""'");
+ }
+ arg1 = buf1;
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "console_log" "', argument " "2"" of type '" "char *""'");
+ }
+ arg2 = buf2;
+ console_log(arg1,arg2);
+ resultobj = SWIG_Py_Void();
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ return resultobj;
+fail:
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ return NULL;
}
-static PyObject *_wrap_process_callback_result(PyObject *, PyObject *args) {
- PyObject *resultobj;
- char *arg1 = (char *) 0 ;
- input_callback_state *arg2 = (input_callback_state *) 0 ;
- switch_core_session_t *arg3 = (switch_core_session_t *) 0 ;
- switch_status_t result;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OOO:process_callback_result",&obj0,&obj1,&obj2)) goto fail;
- if (!SWIG_AsCharPtr(obj0, (char**)&arg1)) {
- SWIG_arg_fail(1);SWIG_fail;
- }
- SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_input_callback_state, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(2)) SWIG_fail;
- SWIG_Python_ConvertPtr(obj2, (void **)&arg3, SWIGTYPE_p_switch_core_session_t, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(3)) SWIG_fail;
- result = process_callback_result(arg1,arg2,arg3);
-
- {
- switch_status_t * resultptr;
- resultptr = new switch_status_t((switch_status_t &)(result));
- resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_switch_status_t, 1);
- }
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_console_clean_log(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ char *arg1 = (char *) 0 ;
+ int res1 ;
+ char *buf1 = 0 ;
+ int alloc1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:console_clean_log",&obj0)) SWIG_fail;
+ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "console_clean_log" "', argument " "1"" of type '" "char *""'");
+ }
+ arg1 = buf1;
+ console_clean_log(arg1);
+ resultobj = SWIG_Py_Void();
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
+ return resultobj;
+fail:
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
+ return NULL;
}
-static PyObject *_wrap_input_callback_state_function_set(PyObject *, PyObject *args) {
- PyObject *resultobj;
- input_callback_state *arg1 = (input_callback_state *) 0 ;
- void *arg2 = (void *) 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OO:input_callback_state_function_set",&obj0,&obj1)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_input_callback_state, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- {
- if ((SWIG_ConvertPtr(obj1,(void **)(&arg2),0,SWIG_POINTER_EXCEPTION|SWIG_POINTER_DISOWN))== -1) {
- SWIG_arg_fail(2);SWIG_fail;
- }
- }
- if (arg1) (arg1)->function = arg2;
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_api_execute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ char *arg1 = (char *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *result = 0 ;
+ int res1 ;
+ char *buf1 = 0 ;
+ int alloc1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:api_execute",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "api_execute" "', argument " "1"" of type '" "char *""'");
+ }
+ arg1 = buf1;
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "api_execute" "', argument " "2"" of type '" "char *""'");
+ }
+ arg2 = buf2;
+ result = (char *)api_execute(arg1,arg2);
+ resultobj = SWIG_FromCharPtr(result);
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ return resultobj;
+fail:
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ return NULL;
}
-static PyObject *_wrap_input_callback_state_function_get(PyObject *, PyObject *args) {
- PyObject *resultobj;
- input_callback_state *arg1 = (input_callback_state *) 0 ;
- void *result;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:input_callback_state_function_get",&obj0)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_input_callback_state, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- result = (void *) ((arg1)->function);
-
- resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_void, 0);
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_api_reply_delete(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ char *arg1 = (char *) 0 ;
+ int res1 ;
+ char *buf1 = 0 ;
+ int alloc1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:api_reply_delete",&obj0)) SWIG_fail;
+ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "api_reply_delete" "', argument " "1"" of type '" "char *""'");
+ }
+ arg1 = buf1;
+ api_reply_delete(arg1);
+ resultobj = SWIG_Py_Void();
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
+ return resultobj;
+fail:
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
+ return NULL;
}
-static PyObject *_wrap_input_callback_state_threadState_set(PyObject *, PyObject *args) {
- PyObject *resultobj;
- input_callback_state *arg1 = (input_callback_state *) 0 ;
- void *arg2 = (void *) 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OO:input_callback_state_threadState_set",&obj0,&obj1)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_input_callback_state, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- {
- if ((SWIG_ConvertPtr(obj1,(void **)(&arg2),0,SWIG_POINTER_EXCEPTION|SWIG_POINTER_DISOWN))== -1) {
- SWIG_arg_fail(2);SWIG_fail;
- }
- }
- if (arg1) (arg1)->threadState = arg2;
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_process_callback_result(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ char *arg1 = (char *) 0 ;
+ input_callback_state *arg2 = (input_callback_state *) 0 ;
+ switch_core_session_t *arg3 = (switch_core_session_t *) 0 ;
+ switch_status_t result;
+ int res1 ;
+ char *buf1 = 0 ;
+ int alloc1 = 0 ;
+ void *argp2 = 0 ;
+ int res2 = 0 ;
+ void *argp3 = 0 ;
+ int res3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:process_callback_result",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "process_callback_result" "', argument " "1"" of type '" "char *""'");
+ }
+ arg1 = buf1;
+ res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_input_callback_state, 0 | 0 );
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "process_callback_result" "', argument " "2"" of type '" "input_callback_state *""'");
+ }
+ arg2 = reinterpret_cast< input_callback_state * >(argp2);
+ res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_switch_core_session_t, 0 | 0 );
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "process_callback_result" "', argument " "3"" of type '" "switch_core_session_t *""'");
+ }
+ arg3 = reinterpret_cast< switch_core_session_t * >(argp3);
+ result = process_callback_result(arg1,arg2,arg3);
+ resultobj = SWIG_NewPointerObj((new switch_status_t(static_cast< const switch_status_t& >(result))), SWIGTYPE_p_switch_status_t, SWIG_POINTER_OWN | 0 );
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
+ return resultobj;
+fail:
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
+ return NULL;
}
-static PyObject *_wrap_input_callback_state_threadState_get(PyObject *, PyObject *args) {
- PyObject *resultobj;
- input_callback_state *arg1 = (input_callback_state *) 0 ;
- void *result;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:input_callback_state_threadState_get",&obj0)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_input_callback_state, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- result = (void *) ((arg1)->threadState);
-
- resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_void, 0);
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_input_callback_state_function_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ input_callback_state *arg1 = (input_callback_state *) 0 ;
+ void *arg2 = (void *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:input_callback_state_function_set",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_function_set" "', argument " "1"" of type '" "input_callback_state *""'");
+ }
+ arg1 = reinterpret_cast< input_callback_state * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "input_callback_state_function_set" "', argument " "2"" of type '" "void *""'");
+ }
+ if (arg1) (arg1)->function = arg2;
+
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_input_callback_state_extra_set(PyObject *, PyObject *args) {
- PyObject *resultobj;
- input_callback_state *arg1 = (input_callback_state *) 0 ;
- void *arg2 = (void *) 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OO:input_callback_state_extra_set",&obj0,&obj1)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_input_callback_state, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- {
- if ((SWIG_ConvertPtr(obj1,(void **)(&arg2),0,SWIG_POINTER_EXCEPTION|SWIG_POINTER_DISOWN))== -1) {
- SWIG_arg_fail(2);SWIG_fail;
- }
- }
- if (arg1) (arg1)->extra = arg2;
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_input_callback_state_function_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ input_callback_state *arg1 = (input_callback_state *) 0 ;
+ void *result = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:input_callback_state_function_get",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_function_get" "', argument " "1"" of type '" "input_callback_state *""'");
+ }
+ arg1 = reinterpret_cast< input_callback_state * >(argp1);
+ result = (void *) ((arg1)->function);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 );
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_input_callback_state_extra_get(PyObject *, PyObject *args) {
- PyObject *resultobj;
- input_callback_state *arg1 = (input_callback_state *) 0 ;
- void *result;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:input_callback_state_extra_get",&obj0)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_input_callback_state, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- result = (void *) ((arg1)->extra);
-
- resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_void, 0);
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_input_callback_state_threadState_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ input_callback_state *arg1 = (input_callback_state *) 0 ;
+ void *arg2 = (void *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:input_callback_state_threadState_set",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_threadState_set" "', argument " "1"" of type '" "input_callback_state *""'");
+ }
+ arg1 = reinterpret_cast< input_callback_state * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "input_callback_state_threadState_set" "', argument " "2"" of type '" "void *""'");
+ }
+ if (arg1) (arg1)->threadState = arg2;
+
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_input_callback_state_funcargs_set(PyObject *, PyObject *args) {
- PyObject *resultobj;
- input_callback_state *arg1 = (input_callback_state *) 0 ;
- char *arg2 = (char *) 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OO:input_callback_state_funcargs_set",&obj0,&obj1)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_input_callback_state, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) {
- SWIG_arg_fail(2);SWIG_fail;
- }
- {
- if (arg1->funcargs) delete [] arg1->funcargs;
- if (arg2) {
- arg1->funcargs = (char *) (new char[strlen(arg2)+1]);
- strcpy((char *) arg1->funcargs,arg2);
- } else {
- arg1->funcargs = 0;
- }
- }
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_input_callback_state_threadState_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ input_callback_state *arg1 = (input_callback_state *) 0 ;
+ void *result = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:input_callback_state_threadState_get",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_threadState_get" "', argument " "1"" of type '" "input_callback_state *""'");
+ }
+ arg1 = reinterpret_cast< input_callback_state * >(argp1);
+ result = (void *) ((arg1)->threadState);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 );
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_input_callback_state_funcargs_get(PyObject *, PyObject *args) {
- PyObject *resultobj;
- input_callback_state *arg1 = (input_callback_state *) 0 ;
- char *result;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:input_callback_state_funcargs_get",&obj0)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_input_callback_state, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- result = (char *) ((arg1)->funcargs);
-
- resultobj = SWIG_FromCharPtr(result);
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_input_callback_state_extra_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ input_callback_state *arg1 = (input_callback_state *) 0 ;
+ void *arg2 = (void *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:input_callback_state_extra_set",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_extra_set" "', argument " "1"" of type '" "input_callback_state *""'");
+ }
+ arg1 = reinterpret_cast< input_callback_state * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "input_callback_state_extra_set" "', argument " "2"" of type '" "void *""'");
+ }
+ if (arg1) (arg1)->extra = arg2;
+
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_new_input_callback_state(PyObject *, PyObject *args) {
- PyObject *resultobj;
- input_callback_state *result;
-
- if(!PyArg_ParseTuple(args,(char *)":new_input_callback_state")) goto fail;
- result = (input_callback_state *)new input_callback_state();
-
- resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_input_callback_state, 1);
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_input_callback_state_extra_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ input_callback_state *arg1 = (input_callback_state *) 0 ;
+ void *result = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:input_callback_state_extra_get",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_extra_get" "', argument " "1"" of type '" "input_callback_state *""'");
+ }
+ arg1 = reinterpret_cast< input_callback_state * >(argp1);
+ result = (void *) ((arg1)->extra);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 );
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_delete_input_callback_state(PyObject *, PyObject *args) {
- PyObject *resultobj;
- input_callback_state *arg1 = (input_callback_state *) 0 ;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:delete_input_callback_state",&obj0)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_input_callback_state, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- delete arg1;
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_input_callback_state_funcargs_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ input_callback_state *arg1 = (input_callback_state *) 0 ;
+ char *arg2 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:input_callback_state_funcargs_set",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_funcargs_set" "', argument " "1"" of type '" "input_callback_state *""'");
+ }
+ arg1 = reinterpret_cast< input_callback_state * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "input_callback_state_funcargs_set" "', argument " "2"" of type '" "char *""'");
+ }
+ arg2 = buf2;
+ if (arg1->funcargs) delete[] arg1->funcargs;
+ if (arg2) {
+ size_t size = strlen(arg2) + 1;
+ arg1->funcargs = reinterpret_cast< char* >(memcpy((new char[size]), arg2, sizeof(char)*(size)));
+ } else {
+ arg1->funcargs = 0;
+ }
+ resultobj = SWIG_Py_Void();
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ return NULL;
}
-static PyObject * input_callback_state_swigregister(PyObject *, PyObject *args) {
- PyObject *obj;
- if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL;
- SWIG_TypeClientData(SWIGTYPE_p_input_callback_state, obj);
- Py_INCREF(obj);
- return Py_BuildValue((char *)"");
-}
-static PyObject *_wrap_new_CoreSession__SWIG_0(PyObject *, PyObject *args) {
- PyObject *resultobj;
- char *arg1 = (char *) 0 ;
- CoreSession *result;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:new_CoreSession",&obj0)) goto fail;
- if (!SWIG_AsCharPtr(obj0, (char**)&arg1)) {
- SWIG_arg_fail(1);SWIG_fail;
- }
- result = (CoreSession *)new CoreSession(arg1);
-
- resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_CoreSession, 1);
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_input_callback_state_funcargs_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ input_callback_state *arg1 = (input_callback_state *) 0 ;
+ char *result = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:input_callback_state_funcargs_get",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "input_callback_state_funcargs_get" "', argument " "1"" of type '" "input_callback_state *""'");
+ }
+ arg1 = reinterpret_cast< input_callback_state * >(argp1);
+ result = (char *) ((arg1)->funcargs);
+ resultobj = SWIG_FromCharPtr(result);
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_new_CoreSession__SWIG_1(PyObject *, PyObject *args) {
- PyObject *resultobj;
- switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
- CoreSession *result;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:new_CoreSession",&obj0)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_switch_core_session_t, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- result = (CoreSession *)new CoreSession(arg1);
-
- resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_CoreSession, 1);
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_new_input_callback_state(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ input_callback_state *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)":new_input_callback_state")) SWIG_fail;
+ result = (input_callback_state *)new input_callback_state();
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_input_callback_state, SWIG_POINTER_NEW | 0 );
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_new_CoreSession(PyObject *self, PyObject *args) {
- int argc;
- PyObject *argv[2];
- int ii;
-
- argc = PyObject_Length(args);
- for (ii = 0; (ii < argc) && (ii < 1); ii++) {
- argv[ii] = PyTuple_GetItem(args,ii);
- }
- if (argc == 1) {
- int _v;
- {
- void *ptr;
- if (SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_switch_core_session_t, 0) == -1) {
- _v = 0;
- PyErr_Clear();
- } else {
- _v = 1;
- }
- }
- if (_v) {
- return _wrap_new_CoreSession__SWIG_1(self,args);
- }
- }
- if (argc == 1) {
- int _v;
- _v = SWIG_AsCharPtr(argv[0], (char **)(0));
- if (_v) {
- return _wrap_new_CoreSession__SWIG_0(self,args);
- }
- }
-
- PyErr_SetString(PyExc_NotImplementedError,"No matching function for overloaded 'new_CoreSession'");
- return NULL;
+SWIGINTERN PyObject *_wrap_delete_input_callback_state(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ input_callback_state *arg1 = (input_callback_state *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:delete_input_callback_state",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_input_callback_state, SWIG_POINTER_DISOWN | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_input_callback_state" "', argument " "1"" of type '" "input_callback_state *""'");
+ }
+ arg1 = reinterpret_cast< input_callback_state * >(argp1);
+ delete arg1;
+
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_delete_CoreSession(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:delete_CoreSession",&obj0)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- delete arg1;
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *input_callback_state_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *obj;
+ if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
+ SWIG_TypeNewClientData(SWIGTYPE_p_input_callback_state, SWIG_NewClientData(obj));
+ return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_CoreSession__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ char *arg1 = (char *) 0 ;
+ CoreSession *result = 0 ;
+ int res1 ;
+ char *buf1 = 0 ;
+ int alloc1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:new_CoreSession",&obj0)) SWIG_fail;
+ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CoreSession" "', argument " "1"" of type '" "char *""'");
+ }
+ arg1 = buf1;
+ result = (CoreSession *)new CoreSession(arg1);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CoreSession, SWIG_POINTER_NEW | 0 );
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
+ return resultobj;
+fail:
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
+ return NULL;
}
-static PyObject *_wrap_CoreSession_session_set(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- switch_core_session_t *arg2 = (switch_core_session_t *) 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OO:CoreSession_session_set",&obj0,&obj1)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_switch_core_session_t, SWIG_POINTER_EXCEPTION | SWIG_POINTER_DISOWN);
- if (SWIG_arg_fail(2)) SWIG_fail;
- if (arg1) (arg1)->session = arg2;
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_new_CoreSession__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+ CoreSession *result = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:new_CoreSession",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_switch_core_session_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CoreSession" "', argument " "1"" of type '" "switch_core_session_t *""'");
+ }
+ arg1 = reinterpret_cast< switch_core_session_t * >(argp1);
+ result = (CoreSession *)new CoreSession(arg1);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CoreSession, SWIG_POINTER_NEW | 0 );
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_CoreSession_session_get(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- switch_core_session_t *result;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:CoreSession_session_get",&obj0)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- result = (switch_core_session_t *) ((arg1)->session);
-
- resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_switch_core_session_t, 0);
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_new_CoreSession(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[2];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 1); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 1) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_switch_core_session_t, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_new_CoreSession__SWIG_1(self, args);
+ }
+ }
+ if (argc == 1) {
+ int _v;
+ int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_new_CoreSession__SWIG_0(self, args);
+ }
+ }
+
+fail:
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"No matching function for overloaded 'new_CoreSession'");
+ return NULL;
}
-static PyObject *_wrap_CoreSession_channel_set(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- switch_channel_t *arg2 = (switch_channel_t *) 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OO:CoreSession_channel_set",&obj0,&obj1)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_switch_channel_t, SWIG_POINTER_EXCEPTION | SWIG_POINTER_DISOWN);
- if (SWIG_arg_fail(2)) SWIG_fail;
- if (arg1) (arg1)->channel = arg2;
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_delete_CoreSession(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:delete_CoreSession",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, SWIG_POINTER_DISOWN | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CoreSession" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ delete arg1;
+
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_CoreSession_channel_get(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- switch_channel_t *result;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:CoreSession_channel_get",&obj0)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- result = (switch_channel_t *) ((arg1)->channel);
-
- resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_switch_channel_t, 0);
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_CoreSession_session_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ switch_core_session_t *arg2 = (switch_core_session_t *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ void *argp2 = 0 ;
+ int res2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:CoreSession_session_set",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_session_set" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_switch_core_session_t, SWIG_POINTER_DISOWN | 0 );
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_session_set" "', argument " "2"" of type '" "switch_core_session_t *""'");
+ }
+ arg2 = reinterpret_cast< switch_core_session_t * >(argp2);
+ if (arg1) (arg1)->session = arg2;
+
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_CoreSession_cb_state_set(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- input_callback_state *arg2 = (input_callback_state *) 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OO:CoreSession_cb_state_set",&obj0,&obj1)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_input_callback_state, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(2)) SWIG_fail;
- if (arg1) (arg1)->cb_state = *arg2;
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_CoreSession_session_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ switch_core_session_t *result = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_session_get",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_session_get" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ result = (switch_core_session_t *) ((arg1)->session);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_switch_core_session_t, 0 | 0 );
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_CoreSession_cb_state_get(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- input_callback_state *result;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:CoreSession_cb_state_get",&obj0)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- result = (input_callback_state *)& ((arg1)->cb_state);
-
- resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_input_callback_state, 0);
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_CoreSession_channel_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ switch_channel_t *arg2 = (switch_channel_t *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ void *argp2 = 0 ;
+ int res2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:CoreSession_channel_set",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_channel_set" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_switch_channel_t, SWIG_POINTER_DISOWN | 0 );
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_channel_set" "', argument " "2"" of type '" "switch_channel_t *""'");
+ }
+ arg2 = reinterpret_cast< switch_channel_t * >(argp2);
+ if (arg1) (arg1)->channel = arg2;
+
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_CoreSession_answer(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- int result;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:CoreSession_answer",&obj0)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- result = (int)(arg1)->answer();
-
- {
- resultobj = SWIG_From_int((int)(result));
- }
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_CoreSession_channel_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ switch_channel_t *result = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_channel_get",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_channel_get" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ result = (switch_channel_t *) ((arg1)->channel);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_switch_channel_t, 0 | 0 );
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_CoreSession_preAnswer(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- int result;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:CoreSession_preAnswer",&obj0)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- result = (int)(arg1)->preAnswer();
-
- {
- resultobj = SWIG_From_int((int)(result));
- }
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_CoreSession_cb_state_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ input_callback_state *arg2 = (input_callback_state *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ void *argp2 = 0 ;
+ int res2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:CoreSession_cb_state_set",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_cb_state_set" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_input_callback_state, 0 | 0 );
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_cb_state_set" "', argument " "2"" of type '" "input_callback_state *""'");
+ }
+ arg2 = reinterpret_cast< input_callback_state * >(argp2);
+ if (arg1) (arg1)->cb_state = *arg2;
+
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_CoreSession_hangup(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- char *arg2 = (char *) 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OO:CoreSession_hangup",&obj0,&obj1)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) {
- SWIG_arg_fail(2);SWIG_fail;
- }
- (arg1)->hangup(arg2);
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_CoreSession_cb_state_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ input_callback_state *result = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_cb_state_get",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_cb_state_get" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ result = (input_callback_state *)& ((arg1)->cb_state);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_input_callback_state, 0 | 0 );
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_CoreSession_setVariable(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_setVariable",&obj0,&obj1,&obj2)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) {
- SWIG_arg_fail(2);SWIG_fail;
- }
- if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) {
- SWIG_arg_fail(3);SWIG_fail;
- }
- (arg1)->setVariable(arg2,arg3);
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_CoreSession_answer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_answer",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_answer" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ result = (int)(arg1)->answer();
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_CoreSession_getVariable(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- char *arg2 = (char *) 0 ;
- char *result;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OO:CoreSession_getVariable",&obj0,&obj1)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) {
- SWIG_arg_fail(2);SWIG_fail;
- }
- result = (char *)(arg1)->getVariable(arg2);
-
- resultobj = SWIG_FromCharPtr(result);
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_CoreSession_preAnswer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_preAnswer",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_preAnswer" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ result = (int)(arg1)->preAnswer();
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_CoreSession_playFile(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
- int result;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_playFile",&obj0,&obj1,&obj2)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) {
- SWIG_arg_fail(2);SWIG_fail;
- }
- if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) {
- SWIG_arg_fail(3);SWIG_fail;
- }
- result = (int)(arg1)->playFile(arg2,arg3);
-
- {
- resultobj = SWIG_From_int((int)(result));
- }
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_CoreSession_hangup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:CoreSession_hangup",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_hangup" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_hangup" "', argument " "2"" of type '" "char *""'");
+ }
+ arg2 = buf2;
+ (arg1)->hangup(arg2);
+ resultobj = SWIG_Py_Void();
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ return NULL;
}
-static PyObject *_wrap_CoreSession_setDTMFCallback(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- switch_input_callback_function_t arg2 ;
- void *arg3 = (void *) 0 ;
- uint32_t arg4 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
- PyObject * obj3 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OOOO:CoreSession_setDTMFCallback",&obj0,&obj1,&obj2,&obj3)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- {
- switch_input_callback_function_t * argp;
- SWIG_Python_ConvertPtr(obj1, (void **)&argp, SWIGTYPE_p_switch_input_callback_function_t, SWIG_POINTER_EXCEPTION);
- if (SWIG_arg_fail(2)) SWIG_fail;
- if (argp == NULL) {
- SWIG_null_ref("switch_input_callback_function_t");
- }
- if (SWIG_arg_fail(2)) SWIG_fail;
- arg2 = *argp;
- }
- {
- if ((SWIG_ConvertPtr(obj2,(void **)(&arg3),0,SWIG_POINTER_EXCEPTION|0))== -1) {
- SWIG_arg_fail(3);SWIG_fail;
- }
- }
- {
- uint32_t * argp;
- SWIG_Python_ConvertPtr(obj3, (void **)&argp, SWIGTYPE_p_uint32_t, SWIG_POINTER_EXCEPTION);
- if (SWIG_arg_fail(4)) SWIG_fail;
- if (argp == NULL) {
- SWIG_null_ref("uint32_t");
- }
- if (SWIG_arg_fail(4)) SWIG_fail;
- arg4 = *argp;
- }
- (arg1)->setDTMFCallback(arg2,arg3,arg4);
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_CoreSession_setVariable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_setVariable",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_setVariable" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_setVariable" "', argument " "2"" of type '" "char *""'");
+ }
+ arg2 = buf2;
+ res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_setVariable" "', argument " "3"" of type '" "char *""'");
+ }
+ arg3 = buf3;
+ (arg1)->setVariable(arg2,arg3);
+ resultobj = SWIG_Py_Void();
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ return NULL;
}
-static PyObject *_wrap_CoreSession_speak(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- char *arg2 = (char *) 0 ;
- int result;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OO:CoreSession_speak",&obj0,&obj1)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) {
- SWIG_arg_fail(2);SWIG_fail;
- }
- result = (int)(arg1)->speak(arg2);
-
- {
- resultobj = SWIG_From_int((int)(result));
- }
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_CoreSession_getVariable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *result = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:CoreSession_getVariable",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_getVariable" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_getVariable" "', argument " "2"" of type '" "char *""'");
+ }
+ arg2 = buf2;
+ result = (char *)(arg1)->getVariable(arg2);
+ resultobj = SWIG_FromCharPtr(result);
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ return NULL;
}
-static PyObject *_wrap_CoreSession_set_tts_parms(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_set_tts_parms",&obj0,&obj1,&obj2)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) {
- SWIG_arg_fail(2);SWIG_fail;
- }
- if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) {
- SWIG_arg_fail(3);SWIG_fail;
- }
- (arg1)->set_tts_parms(arg2,arg3);
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_CoreSession_playFile(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_playFile",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_playFile" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_playFile" "', argument " "2"" of type '" "char *""'");
+ }
+ arg2 = buf2;
+ res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_playFile" "', argument " "3"" of type '" "char *""'");
+ }
+ arg3 = buf3;
+ result = (int)(arg1)->playFile(arg2,arg3);
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ return NULL;
}
-static PyObject *_wrap_CoreSession_getDigits(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- char *arg2 = (char *) 0 ;
- int arg3 ;
- char *arg4 = (char *) 0 ;
- char *arg5 = (char *) 0 ;
- int arg6 ;
- int result;
- char temp2[128+1] ;
- char temp5[8+1] ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
- PyObject * obj3 = 0 ;
- PyObject * obj4 = 0 ;
- PyObject * obj5 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OOOOOO:CoreSession_getDigits",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- {
- char *t = PyString_AsString(obj1);
- if (SWIG_arg_fail(2)) SWIG_fail;
- strncpy(temp2,t,128);
- arg2 = (char *) temp2;
- }
- {
- arg3 = (int)(SWIG_As_int(obj2));
- if (SWIG_arg_fail(3)) SWIG_fail;
- }
- if (!SWIG_AsCharPtr(obj3, (char**)&arg4)) {
- SWIG_arg_fail(4);SWIG_fail;
- }
- {
- char *t = PyString_AsString(obj4);
- if (SWIG_arg_fail(5)) SWIG_fail;
- strncpy(temp5,t,8);
- arg5 = (char *) temp5;
- }
- {
- arg6 = (int)(SWIG_As_int(obj5));
- if (SWIG_arg_fail(6)) SWIG_fail;
- }
- result = (int)(arg1)->getDigits(arg2,arg3,arg4,arg5,arg6);
-
- {
- resultobj = SWIG_From_int((int)(result));
- }
- {
- PyObject *o;
- arg2[128] = 0;
- o = PyString_FromString(arg2);
- resultobj = t_output_helper(resultobj,o);
- }
- {
- PyObject *o;
- arg5[8] = 0;
- o = PyString_FromString(arg5);
- resultobj = t_output_helper(resultobj,o);
+SWIGINTERN PyObject *_wrap_CoreSession_setDTMFCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ switch_input_callback_function_t arg2 ;
+ void *arg3 = (void *) 0 ;
+ uint32_t arg4 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ void *argp2 ;
+ int res2 = 0 ;
+ int res3 ;
+ void *argp4 ;
+ int res4 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOOO:CoreSession_setDTMFCallback",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_setDTMFCallback" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ {
+ res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_switch_input_callback_function_t, 0 | 0);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_setDTMFCallback" "', argument " "2"" of type '" "switch_input_callback_function_t""'");
+ }
+ if (!argp2) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CoreSession_setDTMFCallback" "', argument " "2"" of type '" "switch_input_callback_function_t""'");
+ } else {
+ switch_input_callback_function_t * temp = reinterpret_cast< switch_input_callback_function_t * >(argp2);
+ arg2 = *temp;
+ if (SWIG_IsNewObj(res2)) delete temp;
}
- return resultobj;
- fail:
- return NULL;
+ }
+ res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_setDTMFCallback" "', argument " "3"" of type '" "void *""'");
+ }
+ {
+ res4 = SWIG_ConvertPtr(obj3, &argp4, SWIGTYPE_p_uint32_t, 0 | 0);
+ if (!SWIG_IsOK(res4)) {
+ SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CoreSession_setDTMFCallback" "', argument " "4"" of type '" "uint32_t""'");
+ }
+ if (!argp4) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CoreSession_setDTMFCallback" "', argument " "4"" of type '" "uint32_t""'");
+ } else {
+ uint32_t * temp = reinterpret_cast< uint32_t * >(argp4);
+ arg4 = *temp;
+ if (SWIG_IsNewObj(res4)) delete temp;
+ }
+ }
+ (arg1)->setDTMFCallback(arg2,arg3,arg4);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_CoreSession_transfer(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
- char *arg4 = (char *) 0 ;
- int result;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
- PyObject * obj3 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OOOO:CoreSession_transfer",&obj0,&obj1,&obj2,&obj3)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) {
- SWIG_arg_fail(2);SWIG_fail;
- }
- if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) {
- SWIG_arg_fail(3);SWIG_fail;
- }
- if (!SWIG_AsCharPtr(obj3, (char**)&arg4)) {
- SWIG_arg_fail(4);SWIG_fail;
- }
- result = (int)(arg1)->transfer(arg2,arg3,arg4);
-
- {
- resultobj = SWIG_From_int((int)(result));
- }
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_CoreSession_speak(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:CoreSession_speak",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_speak" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_speak" "', argument " "2"" of type '" "char *""'");
+ }
+ arg2 = buf2;
+ result = (int)(arg1)->speak(arg2);
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ return NULL;
}
-static PyObject *_wrap_CoreSession_playAndGetDigits(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- int arg2 ;
- int arg3 ;
- int arg4 ;
- int arg5 ;
- char *arg6 = (char *) 0 ;
- char *arg7 = (char *) 0 ;
- char *arg8 = (char *) 0 ;
- char *arg9 = (char *) 0 ;
- char *arg10 = (char *) 0 ;
- int result;
- char temp9[128+1] ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
- PyObject * obj3 = 0 ;
- PyObject * obj4 = 0 ;
- PyObject * obj5 = 0 ;
- PyObject * obj6 = 0 ;
- PyObject * obj7 = 0 ;
- PyObject * obj8 = 0 ;
- PyObject * obj9 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:CoreSession_playAndGetDigits",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- {
- arg2 = (int)(SWIG_As_int(obj1));
- if (SWIG_arg_fail(2)) SWIG_fail;
- }
- {
- arg3 = (int)(SWIG_As_int(obj2));
- if (SWIG_arg_fail(3)) SWIG_fail;
- }
- {
- arg4 = (int)(SWIG_As_int(obj3));
- if (SWIG_arg_fail(4)) SWIG_fail;
- }
- {
- arg5 = (int)(SWIG_As_int(obj4));
- if (SWIG_arg_fail(5)) SWIG_fail;
- }
- if (!SWIG_AsCharPtr(obj5, (char**)&arg6)) {
- SWIG_arg_fail(6);SWIG_fail;
- }
- if (!SWIG_AsCharPtr(obj6, (char**)&arg7)) {
- SWIG_arg_fail(7);SWIG_fail;
- }
- if (!SWIG_AsCharPtr(obj7, (char**)&arg8)) {
- SWIG_arg_fail(8);SWIG_fail;
- }
- {
- char *t = PyString_AsString(obj8);
- if (SWIG_arg_fail(9)) SWIG_fail;
- strncpy(temp9,t,128);
- arg9 = (char *) temp9;
- }
- if (!SWIG_AsCharPtr(obj9, (char**)&arg10)) {
- SWIG_arg_fail(10);SWIG_fail;
- }
- result = (int)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
-
- {
- resultobj = SWIG_From_int((int)(result));
- }
- {
- PyObject *o;
- arg9[128] = 0;
- o = PyString_FromString(arg9);
- resultobj = t_output_helper(resultobj,o);
- }
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_CoreSession_set_tts_parms(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_set_tts_parms",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_set_tts_parms" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_set_tts_parms" "', argument " "2"" of type '" "char *""'");
+ }
+ arg2 = buf2;
+ res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_set_tts_parms" "', argument " "3"" of type '" "char *""'");
+ }
+ arg3 = buf3;
+ (arg1)->set_tts_parms(arg2,arg3);
+ resultobj = SWIG_Py_Void();
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ return NULL;
}
-static PyObject *_wrap_CoreSession_streamfile(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- char *arg2 = (char *) 0 ;
- int arg3 ;
- int result;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_streamfile",&obj0,&obj1,&obj2)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) {
- SWIG_arg_fail(2);SWIG_fail;
- }
- {
- arg3 = (int)(SWIG_As_int(obj2));
- if (SWIG_arg_fail(3)) SWIG_fail;
- }
- result = (int)(arg1)->streamfile(arg2,arg3);
-
- {
- resultobj = SWIG_From_int((int)(result));
- }
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_CoreSession_getDigits(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ int arg3 ;
+ char *arg4 = (char *) 0 ;
+ char *arg5 = (char *) 0 ;
+ int arg6 ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char temp2[128+1] ;
+ char *t2 = 0 ;
+ size_t n2 = 0 ;
+ int alloc2 = 0 ;
+ int val3 ;
+ int ecode3 = 0 ;
+ int res4 ;
+ char *buf4 = 0 ;
+ int alloc4 = 0 ;
+ int res5 ;
+ char temp5[8+1] ;
+ char *t5 = 0 ;
+ size_t n5 = 0 ;
+ int alloc5 = 0 ;
+ int val6 ;
+ int ecode6 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+ PyObject * obj4 = 0 ;
+ PyObject * obj5 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOOOOO:CoreSession_getDigits",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_getDigits" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &t2, &n2, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_getDigits" "', argument " "2"" of type '" "char *dtmf_buf""'");
+ }
+ if ( n2 > (size_t) 128 ) n2 = (size_t) 128;
+ memcpy(temp2, t2, sizeof(char)*n2);
+ if (alloc2 == SWIG_NEWOBJ) delete[] t2;
+ temp2[n2 - 1] = 0;
+ arg2 = (char *) temp2;
+ ecode3 = SWIG_AsVal_int(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoreSession_getDigits" "', argument " "3"" of type '" "int""'");
+ }
+ arg3 = static_cast< int >(val3);
+ res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
+ if (!SWIG_IsOK(res4)) {
+ SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CoreSession_getDigits" "', argument " "4"" of type '" "char *""'");
+ }
+ arg4 = buf4;
+ res5 = SWIG_AsCharPtrAndSize(obj4, &t5, &n5, &alloc5);
+ if (!SWIG_IsOK(res5)) {
+ SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CoreSession_getDigits" "', argument " "5"" of type '" "char *terminator""'");
+ }
+ if ( n5 > (size_t) 8 ) n5 = (size_t) 8;
+ memcpy(temp5, t5, sizeof(char)*n5);
+ if (alloc5 == SWIG_NEWOBJ) delete[] t5;
+ temp5[n5 - 1] = 0;
+ arg5 = (char *) temp5;
+ ecode6 = SWIG_AsVal_int(obj5, &val6);
+ if (!SWIG_IsOK(ecode6)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "CoreSession_getDigits" "', argument " "6"" of type '" "int""'");
+ }
+ arg6 = static_cast< int >(val6);
+ result = (int)(arg1)->getDigits(arg2,arg3,arg4,arg5,arg6);
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ arg2[128] = 0;
+ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(arg2));
+ arg5[8] = 0;
+ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(arg5));
+ if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
+ return resultobj;
+fail:
+ if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoreSession_transfer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ char *arg4 = (char *) 0 ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ int res4 ;
+ char *buf4 = 0 ;
+ int alloc4 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOOO:CoreSession_transfer",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_transfer" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_transfer" "', argument " "2"" of type '" "char *""'");
+ }
+ arg2 = buf2;
+ res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_transfer" "', argument " "3"" of type '" "char *""'");
+ }
+ arg3 = buf3;
+ res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
+ if (!SWIG_IsOK(res4)) {
+ SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CoreSession_transfer" "', argument " "4"" of type '" "char *""'");
+ }
+ arg4 = buf4;
+ result = (int)(arg1)->transfer(arg2,arg3,arg4);
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoreSession_playAndGetDigits(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ int arg2 ;
+ int arg3 ;
+ int arg4 ;
+ int arg5 ;
+ char *arg6 = (char *) 0 ;
+ char *arg7 = (char *) 0 ;
+ char *arg8 = (char *) 0 ;
+ char *arg9 = (char *) 0 ;
+ char *arg10 = (char *) 0 ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ int val3 ;
+ int ecode3 = 0 ;
+ int val4 ;
+ int ecode4 = 0 ;
+ int val5 ;
+ int ecode5 = 0 ;
+ int res6 ;
+ char *buf6 = 0 ;
+ int alloc6 = 0 ;
+ int res7 ;
+ char *buf7 = 0 ;
+ int alloc7 = 0 ;
+ int res8 ;
+ char *buf8 = 0 ;
+ int alloc8 = 0 ;
+ int res9 ;
+ char temp9[128+1] ;
+ char *t9 = 0 ;
+ size_t n9 = 0 ;
+ int alloc9 = 0 ;
+ int res10 ;
+ char *buf10 = 0 ;
+ int alloc10 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+ PyObject * obj4 = 0 ;
+ PyObject * obj5 = 0 ;
+ PyObject * obj6 = 0 ;
+ PyObject * obj7 = 0 ;
+ PyObject * obj8 = 0 ;
+ PyObject * obj9 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:CoreSession_playAndGetDigits",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_playAndGetDigits" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoreSession_playAndGetDigits" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = static_cast< int >(val2);
+ ecode3 = SWIG_AsVal_int(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoreSession_playAndGetDigits" "', argument " "3"" of type '" "int""'");
+ }
+ arg3 = static_cast< int >(val3);
+ ecode4 = SWIG_AsVal_int(obj3, &val4);
+ if (!SWIG_IsOK(ecode4)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CoreSession_playAndGetDigits" "', argument " "4"" of type '" "int""'");
+ }
+ arg4 = static_cast< int >(val4);
+ ecode5 = SWIG_AsVal_int(obj4, &val5);
+ if (!SWIG_IsOK(ecode5)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "CoreSession_playAndGetDigits" "', argument " "5"" of type '" "int""'");
+ }
+ arg5 = static_cast< int >(val5);
+ res6 = SWIG_AsCharPtrAndSize(obj5, &buf6, NULL, &alloc6);
+ if (!SWIG_IsOK(res6)) {
+ SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "CoreSession_playAndGetDigits" "', argument " "6"" of type '" "char *""'");
+ }
+ arg6 = buf6;
+ res7 = SWIG_AsCharPtrAndSize(obj6, &buf7, NULL, &alloc7);
+ if (!SWIG_IsOK(res7)) {
+ SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "CoreSession_playAndGetDigits" "', argument " "7"" of type '" "char *""'");
+ }
+ arg7 = buf7;
+ res8 = SWIG_AsCharPtrAndSize(obj7, &buf8, NULL, &alloc8);
+ if (!SWIG_IsOK(res8)) {
+ SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "CoreSession_playAndGetDigits" "', argument " "8"" of type '" "char *""'");
+ }
+ arg8 = buf8;
+ res9 = SWIG_AsCharPtrAndSize(obj8, &t9, &n9, &alloc9);
+ if (!SWIG_IsOK(res9)) {
+ SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "CoreSession_playAndGetDigits" "', argument " "9"" of type '" "char *dtmf_buf""'");
+ }
+ if ( n9 > (size_t) 128 ) n9 = (size_t) 128;
+ memcpy(temp9, t9, sizeof(char)*n9);
+ if (alloc9 == SWIG_NEWOBJ) delete[] t9;
+ temp9[n9 - 1] = 0;
+ arg9 = (char *) temp9;
+ res10 = SWIG_AsCharPtrAndSize(obj9, &buf10, NULL, &alloc10);
+ if (!SWIG_IsOK(res10)) {
+ SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "CoreSession_playAndGetDigits" "', argument " "10"" of type '" "char *""'");
+ }
+ arg10 = buf10;
+ result = (int)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ arg9[128] = 0;
+ resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_FromCharPtr(arg9));
+ if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
+ if (alloc7 == SWIG_NEWOBJ) delete[] buf7;
+ if (alloc8 == SWIG_NEWOBJ) delete[] buf8;
+ if (alloc10 == SWIG_NEWOBJ) delete[] buf10;
+ return resultobj;
+fail:
+ if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
+ if (alloc7 == SWIG_NEWOBJ) delete[] buf7;
+ if (alloc8 == SWIG_NEWOBJ) delete[] buf8;
+ if (alloc10 == SWIG_NEWOBJ) delete[] buf10;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoreSession_streamfile(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ int arg3 ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int val3 ;
+ int ecode3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_streamfile",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_streamfile" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_streamfile" "', argument " "2"" of type '" "char *""'");
+ }
+ arg2 = buf2;
+ ecode3 = SWIG_AsVal_int(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoreSession_streamfile" "', argument " "3"" of type '" "int""'");
+ }
+ arg3 = static_cast< int >(val3);
+ result = (int)(arg1)->streamfile(arg2,arg3);
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ return NULL;
}
-static PyObject *_wrap_CoreSession_ready(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- bool result;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:CoreSession_ready",&obj0)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- result = (bool)(arg1)->ready();
-
- {
- resultobj = SWIG_From_bool((bool)(result));
- }
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_CoreSession_ready(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ bool result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_ready",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_ready" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ result = (bool)(arg1)->ready();
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_CoreSession_execute(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_execute",&obj0,&obj1,&obj2)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) {
- SWIG_arg_fail(2);SWIG_fail;
- }
- if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) {
- SWIG_arg_fail(3);SWIG_fail;
- }
- (arg1)->execute(arg2,arg3);
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_CoreSession_execute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_execute",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_execute" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_execute" "', argument " "2"" of type '" "char *""'");
+ }
+ arg2 = buf2;
+ res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_execute" "', argument " "3"" of type '" "char *""'");
+ }
+ arg3 = buf3;
+ (arg1)->execute(arg2,arg3);
+ resultobj = SWIG_Py_Void();
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ return NULL;
}
-static PyObject *_wrap_CoreSession_begin_allow_threads(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:CoreSession_begin_allow_threads",&obj0)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- (arg1)->begin_allow_threads();
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_CoreSession_begin_allow_threads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_begin_allow_threads",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_begin_allow_threads" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ (arg1)->begin_allow_threads();
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_CoreSession_end_allow_threads(PyObject *, PyObject *args) {
- PyObject *resultobj;
- CoreSession *arg1 = (CoreSession *) 0 ;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:CoreSession_end_allow_threads",&obj0)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_CoreSession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- (arg1)->end_allow_threads();
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_CoreSession_end_allow_threads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_end_allow_threads",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_end_allow_threads" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ (arg1)->end_allow_threads();
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject * CoreSession_swigregister(PyObject *, PyObject *args) {
- PyObject *obj;
- if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL;
- SWIG_TypeClientData(SWIGTYPE_p_CoreSession, obj);
- Py_INCREF(obj);
- return Py_BuildValue((char *)"");
-}
-static PyObject *_wrap_PythonDTMFCallback(PyObject *, PyObject *args) {
- PyObject *resultobj;
- switch_core_session *arg1 = (switch_core_session *) 0 ;
- void *arg2 = (void *) 0 ;
- switch_input_type_t arg3 ;
- void *arg4 = (void *) 0 ;
- unsigned int arg5 ;
- switch_status_t result;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
- PyObject * obj3 = 0 ;
- PyObject * obj4 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OOOOO:PythonDTMFCallback",&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_switch_core_session, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- {
- if ((SWIG_ConvertPtr(obj1,(void **)(&arg2),0,SWIG_POINTER_EXCEPTION|0))== -1) {
- SWIG_arg_fail(2);SWIG_fail;
- }
- }
- {
- switch_input_type_t * argp;
- SWIG_Python_ConvertPtr(obj2, (void **)&argp, SWIGTYPE_p_switch_input_type_t, SWIG_POINTER_EXCEPTION);
- if (SWIG_arg_fail(3)) SWIG_fail;
- if (argp == NULL) {
- SWIG_null_ref("switch_input_type_t");
- }
- if (SWIG_arg_fail(3)) SWIG_fail;
- arg3 = *argp;
- }
- {
- if ((SWIG_ConvertPtr(obj3,(void **)(&arg4),0,SWIG_POINTER_EXCEPTION|0))== -1) {
- SWIG_arg_fail(4);SWIG_fail;
- }
- }
- {
- arg5 = (unsigned int)(SWIG_As_unsigned_SS_int(obj4));
- if (SWIG_arg_fail(5)) SWIG_fail;
- }
- result = PythonDTMFCallback(arg1,arg2,arg3,arg4,arg5);
-
- {
- switch_status_t * resultptr;
- resultptr = new switch_status_t((switch_status_t &)(result));
- resultobj = SWIG_NewPointerObj((void *)(resultptr), SWIGTYPE_p_switch_status_t, 1);
+SWIGINTERN PyObject *CoreSession_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *obj;
+ if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
+ SWIG_TypeNewClientData(SWIGTYPE_p_CoreSession, SWIG_NewClientData(obj));
+ return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_PythonDTMFCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ switch_core_session *arg1 = (switch_core_session *) 0 ;
+ void *arg2 = (void *) 0 ;
+ switch_input_type_t arg3 ;
+ void *arg4 = (void *) 0 ;
+ unsigned int arg5 ;
+ switch_status_t result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ void *argp3 ;
+ int res3 = 0 ;
+ int res4 ;
+ unsigned int val5 ;
+ int ecode5 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+ PyObject * obj4 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOOOO:PythonDTMFCallback",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_switch_core_session, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PythonDTMFCallback" "', argument " "1"" of type '" "switch_core_session *""'");
+ }
+ arg1 = reinterpret_cast< switch_core_session * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PythonDTMFCallback" "', argument " "2"" of type '" "void *""'");
+ }
+ {
+ res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_switch_input_type_t, 0 | 0);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "PythonDTMFCallback" "', argument " "3"" of type '" "switch_input_type_t""'");
+ }
+ if (!argp3) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PythonDTMFCallback" "', argument " "3"" of type '" "switch_input_type_t""'");
+ } else {
+ switch_input_type_t * temp = reinterpret_cast< switch_input_type_t * >(argp3);
+ arg3 = *temp;
+ if (SWIG_IsNewObj(res3)) delete temp;
}
- return resultobj;
- fail:
- return NULL;
+ }
+ res4 = SWIG_ConvertPtr(obj3,SWIG_as_voidptrptr(&arg4), 0, 0);
+ if (!SWIG_IsOK(res4)) {
+ SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "PythonDTMFCallback" "', argument " "4"" of type '" "void *""'");
+ }
+ ecode5 = SWIG_AsVal_unsigned_SS_int(obj4, &val5);
+ if (!SWIG_IsOK(ecode5)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "PythonDTMFCallback" "', argument " "5"" of type '" "unsigned int""'");
+ }
+ arg5 = static_cast< unsigned int >(val5);
+ result = PythonDTMFCallback(arg1,arg2,arg3,arg4,arg5);
+ resultobj = SWIG_NewPointerObj((new switch_status_t(static_cast< const switch_status_t& >(result))), SWIGTYPE_p_switch_status_t, SWIG_POINTER_OWN | 0 );
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_new_PySession__SWIG_0(PyObject *, PyObject *args) {
- PyObject *resultobj;
- char *arg1 = (char *) 0 ;
- PySession *result;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:new_PySession",&obj0)) goto fail;
- if (!SWIG_AsCharPtr(obj0, (char**)&arg1)) {
- SWIG_arg_fail(1);SWIG_fail;
- }
- result = (PySession *)new PySession(arg1);
-
- resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_PySession, 1);
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_new_PySession__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ char *arg1 = (char *) 0 ;
+ PySession *result = 0 ;
+ int res1 ;
+ char *buf1 = 0 ;
+ int alloc1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:new_PySession",&obj0)) SWIG_fail;
+ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_PySession" "', argument " "1"" of type '" "char *""'");
+ }
+ arg1 = buf1;
+ result = (PySession *)new PySession(arg1);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PySession, SWIG_POINTER_NEW | 0 );
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
+ return resultobj;
+fail:
+ if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
+ return NULL;
}
-static PyObject *_wrap_new_PySession__SWIG_1(PyObject *, PyObject *args) {
- PyObject *resultobj;
- switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
- PySession *result;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:new_PySession",&obj0)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_switch_core_session_t, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- result = (PySession *)new PySession(arg1);
-
- resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_PySession, 1);
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_new_PySession__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+ PySession *result = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:new_PySession",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_switch_core_session_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_PySession" "', argument " "1"" of type '" "switch_core_session_t *""'");
+ }
+ arg1 = reinterpret_cast< switch_core_session_t * >(argp1);
+ result = (PySession *)new PySession(arg1);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PySession, SWIG_POINTER_NEW | 0 );
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_new_PySession(PyObject *self, PyObject *args) {
- int argc;
- PyObject *argv[2];
- int ii;
-
- argc = PyObject_Length(args);
- for (ii = 0; (ii < argc) && (ii < 1); ii++) {
- argv[ii] = PyTuple_GetItem(args,ii);
- }
- if (argc == 1) {
- int _v;
- {
- void *ptr;
- if (SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_switch_core_session_t, 0) == -1) {
- _v = 0;
- PyErr_Clear();
- } else {
- _v = 1;
- }
- }
- if (_v) {
- return _wrap_new_PySession__SWIG_1(self,args);
- }
- }
- if (argc == 1) {
- int _v;
- _v = SWIG_AsCharPtr(argv[0], (char **)(0));
- if (_v) {
- return _wrap_new_PySession__SWIG_0(self,args);
- }
+SWIGINTERN PyObject *_wrap_new_PySession(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[2];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 1); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 1) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_switch_core_session_t, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_new_PySession__SWIG_1(self, args);
+ }
+ }
+ if (argc == 1) {
+ int _v;
+ int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_new_PySession__SWIG_0(self, args);
}
-
- PyErr_SetString(PyExc_NotImplementedError,"No matching function for overloaded 'new_PySession'");
- return NULL;
+ }
+
+fail:
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"No matching function for overloaded 'new_PySession'");
+ return NULL;
}
-static PyObject *_wrap_delete_PySession(PyObject *, PyObject *args) {
- PyObject *resultobj;
- PySession *arg1 = (PySession *) 0 ;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:delete_PySession",&obj0)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_PySession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- delete arg1;
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_delete_PySession(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ PySession *arg1 = (PySession *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:delete_PySession",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PySession, SWIG_POINTER_DISOWN | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_PySession" "', argument " "1"" of type '" "PySession *""'");
+ }
+ arg1 = reinterpret_cast< PySession * >(argp1);
+ delete arg1;
+
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_PySession_setDTMFCallback(PyObject *, PyObject *args) {
- PyObject *resultobj;
- PySession *arg1 = (PySession *) 0 ;
- PyObject *arg2 = (PyObject *) 0 ;
- char *arg3 = (char *) 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"OOO:PySession_setDTMFCallback",&obj0,&obj1,&obj2)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_PySession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- arg2 = obj1;
- if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) {
- SWIG_arg_fail(3);SWIG_fail;
- }
- (arg1)->setDTMFCallback(arg2,arg3);
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_PySession_setDTMFCallback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ PySession *arg1 = (PySession *) 0 ;
+ PyObject *arg2 = (PyObject *) 0 ;
+ char *arg3 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:PySession_setDTMFCallback",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PySession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySession_setDTMFCallback" "', argument " "1"" of type '" "PySession *""'");
+ }
+ arg1 = reinterpret_cast< PySession * >(argp1);
+ arg2 = obj1;
+ res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "PySession_setDTMFCallback" "', argument " "3"" of type '" "char *""'");
+ }
+ arg3 = buf3;
+ (arg1)->setDTMFCallback(arg2,arg3);
+ resultobj = SWIG_Py_Void();
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ return resultobj;
+fail:
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ return NULL;
}
-static PyObject *_wrap_PySession_begin_allow_threads(PyObject *, PyObject *args) {
- PyObject *resultobj;
- PySession *arg1 = (PySession *) 0 ;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:PySession_begin_allow_threads",&obj0)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_PySession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- (arg1)->begin_allow_threads();
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_PySession_begin_allow_threads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ PySession *arg1 = (PySession *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:PySession_begin_allow_threads",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PySession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySession_begin_allow_threads" "', argument " "1"" of type '" "PySession *""'");
+ }
+ arg1 = reinterpret_cast< PySession * >(argp1);
+ (arg1)->begin_allow_threads();
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject *_wrap_PySession_end_allow_threads(PyObject *, PyObject *args) {
- PyObject *resultobj;
- PySession *arg1 = (PySession *) 0 ;
- PyObject * obj0 = 0 ;
-
- if(!PyArg_ParseTuple(args,(char *)"O:PySession_end_allow_threads",&obj0)) goto fail;
- SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_PySession, SWIG_POINTER_EXCEPTION | 0);
- if (SWIG_arg_fail(1)) SWIG_fail;
- (arg1)->end_allow_threads();
-
- Py_INCREF(Py_None); resultobj = Py_None;
- return resultobj;
- fail:
- return NULL;
+SWIGINTERN PyObject *_wrap_PySession_end_allow_threads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ PySession *arg1 = (PySession *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:PySession_end_allow_threads",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PySession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySession_end_allow_threads" "', argument " "1"" of type '" "PySession *""'");
+ }
+ arg1 = reinterpret_cast< PySession * >(argp1);
+ (arg1)->end_allow_threads();
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
}
-static PyObject * PySession_swigregister(PyObject *, PyObject *args) {
- PyObject *obj;
- if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL;
- SWIG_TypeClientData(SWIGTYPE_p_PySession, obj);
- Py_INCREF(obj);
- return Py_BuildValue((char *)"");
+SWIGINTERN PyObject *PySession_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *obj;
+ if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
+ SWIG_TypeNewClientData(SWIGTYPE_p_PySession, SWIG_NewClientData(obj));
+ return SWIG_Py_Void();
}
+
static PyMethodDef SwigMethods[] = {
{ (char *)"console_log", _wrap_console_log, METH_VARARGS, NULL},
{ (char *)"console_clean_log", _wrap_console_clean_log, METH_VARARGS, NULL},
@@ -3217,41 +4849,60 @@
static void *_p_PySessionTo_p_CoreSession(void *x) {
return (void *)((CoreSession *) ((PySession *) x));
}
-static swig_type_info _swigt__std__size_t[] = {{"_std__size_t", 0, "std::size_t", 0, 0, 0, 0},{"_std__size_t", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}};
-static swig_type_info _swigt__size_t[] = {{"_size_t", 0, "size_t", 0, 0, 0, 0},{"_size_t", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}};
-static swig_type_info _swigt__p_uint32_t[] = {{"_p_uint32_t", 0, "uint32_t *", 0, 0, 0, 0},{"_p_uint32_t", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}};
-static swig_type_info _swigt__p_switch_core_session_t[] = {{"_p_switch_core_session_t", 0, "switch_core_session_t *", 0, 0, 0, 0},{"_p_switch_core_session_t", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}};
-static swig_type_info _swigt__p_void[] = {{"_p_void", 0, "void *", 0, 0, 0, 0},{"_p_void", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}};
-static swig_type_info _swigt__p_switch_input_callback_function_t[] = {{"_p_switch_input_callback_function_t", 0, "switch_input_callback_function_t *", 0, 0, 0, 0},{"_p_switch_input_callback_function_t", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}};
-static swig_type_info _swigt__p_char[] = {{"_p_char", 0, "char *", 0, 0, 0, 0},{"_p_char", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}};
-static swig_type_info _swigt__p_input_callback_state[] = {{"_p_input_callback_state", 0, "input_callback_state *", 0, 0, 0, 0},{"_p_input_callback_state", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}};
-static swig_type_info _swigt__std__ptrdiff_t[] = {{"_std__ptrdiff_t", 0, "std::ptrdiff_t", 0, 0, 0, 0},{"_std__ptrdiff_t", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}};
-static swig_type_info _swigt__ptrdiff_t[] = {{"_ptrdiff_t", 0, "ptrdiff_t", 0, 0, 0, 0},{"_ptrdiff_t", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}};
-static swig_type_info _swigt__p_switch_status_t[] = {{"_p_switch_status_t", 0, "switch_status_t *", 0, 0, 0, 0},{"_p_switch_status_t", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}};
-static swig_type_info _swigt__p_switch_channel_t[] = {{"_p_switch_channel_t", 0, "switch_channel_t *", 0, 0, 0, 0},{"_p_switch_channel_t", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}};
-static swig_type_info _swigt__p_switch_core_session[] = {{"_p_switch_core_session", 0, "switch_core_session *", 0, 0, 0, 0},{"_p_switch_core_session", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}};
-static swig_type_info _swigt__p_CoreSession[] = {{"_p_CoreSession", 0, "CoreSession *", 0, 0, 0, 0},{"_p_CoreSession", 0, 0, 0, 0, 0, 0},{"_p_PySession", _p_PySessionTo_p_CoreSession, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}};
-static swig_type_info _swigt__p_PySession[] = {{"_p_PySession", 0, "PySession *", 0, 0, 0, 0},{"_p_PySession", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}};
-static swig_type_info _swigt__p_switch_input_type_t[] = {{"_p_switch_input_type_t", 0, "switch_input_type_t *", 0, 0, 0, 0},{"_p_switch_input_type_t", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}};
-
-static swig_type_info *swig_types_initial[] = {
-_swigt__std__size_t,
-_swigt__size_t,
-_swigt__p_uint32_t,
-_swigt__p_switch_core_session_t,
-_swigt__p_void,
-_swigt__p_switch_input_callback_function_t,
-_swigt__p_char,
-_swigt__p_input_callback_state,
-_swigt__std__ptrdiff_t,
-_swigt__ptrdiff_t,
-_swigt__p_switch_status_t,
-_swigt__p_switch_channel_t,
-_swigt__p_switch_core_session,
-_swigt__p_CoreSession,
-_swigt__p_PySession,
-_swigt__p_switch_input_type_t,
-0
+static swig_type_info _swigt__p_CoreSession = {"_p_CoreSession", "CoreSession *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_PySession = {"_p_PySession", "PySession *", 0, 0, (void*)0, 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 *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_switch_channel_t = {"_p_switch_channel_t", "switch_channel_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_switch_core_session = {"_p_switch_core_session", "switch_core_session *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_switch_core_session_t = {"_p_switch_core_session_t", "switch_core_session_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_switch_input_callback_function_t = {"_p_switch_input_callback_function_t", "switch_input_callback_function_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_switch_input_type_t = {"_p_switch_input_type_t", "switch_input_type_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_switch_status_t = {"_p_switch_status_t", "switch_status_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_uint32_t = {"_p_uint32_t", "uint32_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_void = {"_p_void", "void *", 0, 0, (void*)0, 0};
+
+static swig_type_info *swig_type_initial[] = {
+ &_swigt__p_CoreSession,
+ &_swigt__p_PySession,
+ &_swigt__p_char,
+ &_swigt__p_input_callback_state,
+ &_swigt__p_switch_channel_t,
+ &_swigt__p_switch_core_session,
+ &_swigt__p_switch_core_session_t,
+ &_swigt__p_switch_input_callback_function_t,
+ &_swigt__p_switch_input_type_t,
+ &_swigt__p_switch_status_t,
+ &_swigt__p_uint32_t,
+ &_swigt__p_void,
+};
+
+static swig_cast_info _swigc__p_CoreSession[] = { {&_swigt__p_CoreSession, 0, 0, 0}, {&_swigt__p_PySession, _p_PySessionTo_p_CoreSession, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_PySession[] = { {&_swigt__p_PySession, 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}};
+static swig_cast_info _swigc__p_switch_channel_t[] = { {&_swigt__p_switch_channel_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_switch_core_session[] = { {&_swigt__p_switch_core_session, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_switch_core_session_t[] = { {&_swigt__p_switch_core_session_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_switch_input_callback_function_t[] = { {&_swigt__p_switch_input_callback_function_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_switch_input_type_t[] = { {&_swigt__p_switch_input_type_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_switch_status_t[] = { {&_swigt__p_switch_status_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_uint32_t[] = { {&_swigt__p_uint32_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_void[] = { {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}};
+
+static swig_cast_info *swig_cast_initial[] = {
+ _swigc__p_CoreSession,
+ _swigc__p_PySession,
+ _swigc__p_char,
+ _swigc__p_input_callback_state,
+ _swigc__p_switch_channel_t,
+ _swigc__p_switch_core_session,
+ _swigc__p_switch_core_session_t,
+ _swigc__p_switch_input_callback_function_t,
+ _swigc__p_switch_input_type_t,
+ _swigc__p_switch_status_t,
+ _swigc__p_uint32_t,
+ _swigc__p_void,
};
@@ -3263,85 +4914,329 @@
#ifdef __cplusplus
}
#endif
-
+/* -----------------------------------------------------------------------------
+ * Type initialization:
+ * This problem is tough by the requirement that no dynamic
+ * memory is used. Also, since swig_type_info structures store pointers to
+ * swig_cast_info structures and swig_cast_info structures store pointers back
+ * to swig_type_info structures, we need some lookup code at initialization.
+ * The idea is that swig generates all the structures that are needed.
+ * The runtime then collects these partially filled structures.
+ * The SWIG_InitializeModule function takes these initial arrays out of
+ * swig_module, and does all the lookup, filling in the swig_module.types
+ * array with the correct data and linking the correct swig_cast_info
+ * structures together.
+ *
+ * The generated swig_type_info structures are assigned staticly to an initial
+ * array. We just loop though that array, and handle each type individually.
+ * First we lookup if this type has been already loaded, and if so, use the
+ * loaded structure instead of the generated one. Then we have to fill in the
+ * cast linked list. The cast data is initially stored in something like a
+ * two-dimensional array. Each row corresponds to a type (there are the same
+ * number of rows as there are in the swig_type_initial array). Each entry in
+ * a column is one of the swig_cast_info structures for that type.
+ * The cast_initial array is actually an array of arrays, because each row has
+ * a variable number of columns. So to actually build the cast linked list,
+ * we find the array of casts associated with the type, and loop through it
+ * adding the casts to the list. The one last trick we need to do is making
+ * sure the type pointer in the swig_cast_info struct is correct.
+ *
+ * First off, we lookup the cast->type name to see if it is already loaded.
+ * There are three cases to handle:
+ * 1) If the cast->type has already been loaded AND the type we are adding
+ * casting info to has not been loaded (it is in this module), THEN we
+ * replace the cast->type pointer with the type pointer that has already
+ * been loaded.
+ * 2) If BOTH types (the one we are adding casting info to, and the
+ * cast->type) are loaded, THEN the cast info has already been loaded by
+ * the previous module so we just ignore it.
+ * 3) Finally, if cast->type has not already been loaded, then we add that
+ * swig_cast_info to the linked list (because the cast->type) pointer will
+ * be correct.
+ * ----------------------------------------------------------------------------- */
#ifdef __cplusplus
extern "C" {
+#if 0
+} /* c-mode */
+#endif
+#endif
+
+#if 0
+#define SWIGRUNTIME_DEBUG
#endif
+
+SWIGRUNTIME void
+SWIG_InitializeModule(void *clientdata) {
+ size_t i;
+ swig_module_info *module_head;
+ static int init_run = 0;
+
+ clientdata = clientdata;
+
+ if (init_run) return;
+ init_run = 1;
+
+ /* Initialize the swig_module */
+ swig_module.type_initial = swig_type_initial;
+ swig_module.cast_initial = swig_cast_initial;
+
+ /* Try and load any already created modules */
+ module_head = SWIG_GetModule(clientdata);
+ if (module_head) {
+ swig_module.next = module_head->next;
+ module_head->next = &swig_module;
+ } else {
+ /* This is the first module loaded */
+ swig_module.next = &swig_module;
+ SWIG_SetModule(clientdata, &swig_module);
+ }
+
+ /* Now work on filling in swig_module.types */
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+#endif
+ for (i = 0; i < swig_module.size; ++i) {
+ swig_type_info *type = 0;
+ swig_type_info *ret;
+ swig_cast_info *cast;
+
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+#endif
+
+ /* if there is another module already loaded */
+ if (swig_module.next != &swig_module) {
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
+ }
+ if (type) {
+ /* Overwrite clientdata field */
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
+#endif
+ if (swig_module.type_initial[i]->clientdata) {
+ type->clientdata = swig_module.type_initial[i]->clientdata;
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+#endif
+ }
+ } else {
+ type = swig_module.type_initial[i];
+ }
- /* Python-specific SWIG API */
+ /* Insert casting types */
+ cast = swig_module.cast_initial[i];
+ while (cast->type) {
+ /* Don't need to add information already in the list */
+ ret = 0;
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+#endif
+ if (swig_module.next != &swig_module) {
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+#ifdef SWIGRUNTIME_DEBUG
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+#endif
+ }
+ if (ret) {
+ if (type == swig_module.type_initial[i]) {
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+#endif
+ cast->type = ret;
+ ret = 0;
+ } else {
+ /* Check for casting already in the list */
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+#ifdef SWIGRUNTIME_DEBUG
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+#endif
+ if (!ocast) ret = 0;
+ }
+ }
+
+ if (!ret) {
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+#endif
+ if (type->cast) {
+ type->cast->prev = cast;
+ cast->next = type->cast;
+ }
+ type->cast = cast;
+ }
+ cast++;
+ }
+ /* Set entry in modules->types array equal to the type */
+ swig_module.types[i] = type;
+ }
+ swig_module.types[i] = 0;
+
+#ifdef SWIGRUNTIME_DEBUG
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
+ for (i = 0; i < swig_module.size; ++i) {
+ int j = 0;
+ swig_cast_info *cast = swig_module.cast_initial[i];
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+ while (cast->type) {
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+ cast++;
+ ++j;
+ }
+ printf("---- Total casts: %d\n",j);
+ }
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
+#endif
+}
+
+/* This function will propagate the clientdata field of type to
+* any new swig_type_info structures that have been added into the list
+* of equivalent types. It is like calling
+* SWIG_TypeClientData(type, clientdata) a second time.
+*/
+SWIGRUNTIME void
+SWIG_PropagateClientData(void) {
+ size_t i;
+ swig_cast_info *equiv;
+ static int init_run = 0;
+
+ if (init_run) return;
+ init_run = 1;
+
+ for (i = 0; i < swig_module.size; i++) {
+ if (swig_module.types[i]->clientdata) {
+ equiv = swig_module.types[i]->cast;
+ while (equiv) {
+ if (!equiv->converter) {
+ if (equiv->type && !equiv->type->clientdata)
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+ }
+ equiv = equiv->next;
+ }
+ }
+ }
+}
+
+#ifdef __cplusplus
+#if 0
+{
+ /* c-mode */
+#endif
+}
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Python-specific SWIG API */
#define SWIG_newvarlink() SWIG_Python_newvarlink()
#define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr)
#define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants)
-
- /* -----------------------------------------------------------------------------
- * global variable support code.
- * ----------------------------------------------------------------------------- */
-
- typedef struct swig_globalvar {
- char *name; /* Name of global variable */
- PyObject *(*get_attr)(); /* Return the current value */
- int (*set_attr)(PyObject *); /* Set the value */
- struct swig_globalvar *next;
- } swig_globalvar;
-
- typedef struct swig_varlinkobject {
- PyObject_HEAD
- swig_globalvar *vars;
- } swig_varlinkobject;
-
- static PyObject *
- swig_varlink_repr(swig_varlinkobject *v) {
- v = v;
- return PyString_FromString("<Swig global variables>");
+
+ /* -----------------------------------------------------------------------------
+ * global variable support code.
+ * ----------------------------------------------------------------------------- */
+
+ typedef struct swig_globalvar {
+ char *name; /* Name of global variable */
+ PyObject *(*get_attr)(void); /* Return the current value */
+ int (*set_attr)(PyObject *); /* Set the value */
+ struct swig_globalvar *next;
+ } swig_globalvar;
+
+ typedef struct swig_varlinkobject {
+ PyObject_HEAD
+ swig_globalvar *vars;
+ } swig_varlinkobject;
+
+ SWIGINTERN PyObject *
+ swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
+ return PyString_FromString("<Swig global variables>");
+ }
+
+ SWIGINTERN PyObject *
+ swig_varlink_str(swig_varlinkobject *v) {
+ PyObject *str = PyString_FromString("(");
+ swig_globalvar *var;
+ for (var = v->vars; var; var=var->next) {
+ PyString_ConcatAndDel(&str,PyString_FromString(var->name));
+ if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
}
-
- static int
- swig_varlink_print(swig_varlinkobject *v, FILE *fp, int flags) {
- swig_globalvar *var;
- flags = flags;
- fprintf(fp,"Swig global variables { ");
- for (var = v->vars; var; var=var->next) {
- fprintf(fp,"%s", var->name);
- if (var->next) fprintf(fp,", ");
- }
- fprintf(fp," }\n");
- return 0;
+ PyString_ConcatAndDel(&str,PyString_FromString(")"));
+ return str;
+ }
+
+ SWIGINTERN int
+ swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
+ PyObject *str = swig_varlink_str(v);
+ fprintf(fp,"Swig global variables ");
+ fprintf(fp,"%s\n", PyString_AsString(str));
+ Py_DECREF(str);
+ return 0;
+ }
+
+ SWIGINTERN void
+ swig_varlink_dealloc(swig_varlinkobject *v) {
+ swig_globalvar *var = v->vars;
+ while (var) {
+ swig_globalvar *n = var->next;
+ free(var->name);
+ free(var);
+ var = n;
}
-
- static PyObject *
- swig_varlink_getattr(swig_varlinkobject *v, char *n) {
- swig_globalvar *var = v->vars;
- while (var) {
- if (strcmp(var->name,n) == 0) {
- return (*var->get_attr)();
- }
- var = var->next;
- }
- PyErr_SetString(PyExc_NameError,"Unknown C global variable");
- return NULL;
+ }
+
+ SWIGINTERN PyObject *
+ swig_varlink_getattr(swig_varlinkobject *v, char *n) {
+ PyObject *res = NULL;
+ swig_globalvar *var = v->vars;
+ while (var) {
+ if (strcmp(var->name,n) == 0) {
+ res = (*var->get_attr)();
+ break;
+ }
+ var = var->next;
}
-
- static int
- swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
- swig_globalvar *var = v->vars;
- while (var) {
- if (strcmp(var->name,n) == 0) {
- return (*var->set_attr)(p);
- }
- var = var->next;
- }
- PyErr_SetString(PyExc_NameError,"Unknown C global variable");
- return 1;
+ if (res == NULL && !PyErr_Occurred()) {
+ PyErr_SetString(PyExc_NameError,"Unknown C global variable");
}
-
- static PyTypeObject varlinktype = {
- PyObject_HEAD_INIT(0)
+ return res;
+ }
+
+ SWIGINTERN int
+ swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
+ int res = 1;
+ swig_globalvar *var = v->vars;
+ while (var) {
+ if (strcmp(var->name,n) == 0) {
+ res = (*var->set_attr)(p);
+ break;
+ }
+ var = var->next;
+ }
+ if (res == 1 && !PyErr_Occurred()) {
+ PyErr_SetString(PyExc_NameError,"Unknown C global variable");
+ }
+ return res;
+ }
+
+ SWIGINTERN PyTypeObject*
+ swig_varlink_type(void) {
+ static char varlink__doc__[] = "Swig var link object";
+ static PyTypeObject varlink_type;
+ static int type_init = 0;
+ if (!type_init) {
+ const PyTypeObject tmp
+ = {
+ PyObject_HEAD_INIT(NULL)
0, /* Number of items in variable part (ob_size) */
(char *)"swigvarlink", /* Type name (tp_name) */
sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */
0, /* Itemsize (tp_itemsize) */
- 0, /* Deallocator (tp_dealloc) */
+ (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */
(printfunc) swig_varlink_print, /* Print (tp_print) */
(getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */
(setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */
@@ -3352,20 +5247,16 @@
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
- 0, /* tp_str */
+ (reprfunc)swig_varlink_str, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
0, /* tp_flags */
- 0, /* tp_doc */
-#if PY_VERSION_HEX >= 0x02000000
+ varlink__doc__, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
-#endif
-#if PY_VERSION_HEX >= 0x02010000
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
-#endif
#if PY_VERSION_HEX >= 0x02020000
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
#endif
@@ -3375,186 +5266,122 @@
#ifdef COUNT_ALLOCS
0,0,0,0 /* tp_alloc -> tp_next */
#endif
- };
-
- /* Create a variable linking object for use later */
- static PyObject *
- SWIG_Python_newvarlink(void) {
- swig_varlinkobject *result = 0;
- result = PyMem_NEW(swig_varlinkobject,1);
- varlinktype.ob_type = &PyType_Type; /* Patch varlinktype into a PyType */
- result->ob_type = &varlinktype;
- result->vars = 0;
- result->ob_refcnt = 0;
- Py_XINCREF((PyObject *) result);
- return ((PyObject*) result);
+ };
+ varlink_type = tmp;
+ varlink_type.ob_type = &PyType_Type;
+ type_init = 1;
}
-
- static void
- SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
- swig_varlinkobject *v;
- swig_globalvar *gv;
- v= (swig_varlinkobject *) p;
- gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
- gv->name = (char *) malloc(strlen(name)+1);
- strcpy(gv->name,name);
+ return &varlink_type;
+ }
+
+ /* Create a variable linking object for use later */
+ SWIGINTERN PyObject *
+ SWIG_Python_newvarlink(void) {
+ swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
+ if (result) {
+ result->vars = 0;
+ }
+ return ((PyObject*) result);
+ }
+
+ SWIGINTERN void
+ SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
+ swig_varlinkobject *v = (swig_varlinkobject *) p;
+ swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
+ if (gv) {
+ size_t size = strlen(name)+1;
+ gv->name = (char *)malloc(size);
+ if (gv->name) {
+ strncpy(gv->name,name,size);
gv->get_attr = get_attr;
gv->set_attr = set_attr;
gv->next = v->vars;
- v->vars = gv;
+ }
}
-
- /* -----------------------------------------------------------------------------
- * constants/methods manipulation
- * ----------------------------------------------------------------------------- */
-
- /* Install Constants */
- static void
- SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
- PyObject *obj = 0;
- size_t i;
- for (i = 0; constants[i].type; i++) {
- switch(constants[i].type) {
- case SWIG_PY_INT:
- obj = PyInt_FromLong(constants[i].lvalue);
- break;
- case SWIG_PY_FLOAT:
- obj = PyFloat_FromDouble(constants[i].dvalue);
- break;
- case SWIG_PY_STRING:
- if (constants[i].pvalue) {
- obj = PyString_FromString((char *) constants[i].pvalue);
- } else {
- Py_INCREF(Py_None);
- obj = Py_None;
- }
- break;
- case SWIG_PY_POINTER:
- obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
- break;
- case SWIG_PY_BINARY:
- obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
- break;
- default:
- obj = 0;
- break;
- }
- if (obj) {
- PyDict_SetItemString(d,constants[i].name,obj);
- Py_DECREF(obj);
- }
- }
+ v->vars = gv;
+ }
+
+ SWIGINTERN PyObject *
+ SWIG_globals() {
+ static PyObject *_SWIG_globals = 0;
+ if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();
+ return _SWIG_globals;
+ }
+
+ /* -----------------------------------------------------------------------------
+ * constants/methods manipulation
+ * ----------------------------------------------------------------------------- */
+
+ /* Install Constants */
+ SWIGINTERN void
+ SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
+ PyObject *obj = 0;
+ size_t i;
+ for (i = 0; constants[i].type; ++i) {
+ switch(constants[i].type) {
+ case SWIG_PY_POINTER:
+ obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
+ break;
+ case SWIG_PY_BINARY:
+ obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
+ break;
+ default:
+ obj = 0;
+ break;
+ }
+ if (obj) {
+ PyDict_SetItemString(d, constants[i].name, obj);
+ Py_DECREF(obj);
+ }
}
-
- /* -----------------------------------------------------------------------------*/
- /* Fix SwigMethods to carry the callback ptrs when needed */
- /* -----------------------------------------------------------------------------*/
-
- static void
- SWIG_Python_FixMethods(PyMethodDef *methods,
+ }
+
+ /* -----------------------------------------------------------------------------*/
+ /* Fix SwigMethods to carry the callback ptrs when needed */
+ /* -----------------------------------------------------------------------------*/
+
+ SWIGINTERN void
+ SWIG_Python_FixMethods(PyMethodDef *methods,
swig_const_info *const_table,
swig_type_info **types,
swig_type_info **types_initial) {
- size_t i;
- for (i = 0; methods[i].ml_name; ++i) {
- char *c = methods[i].ml_doc;
- if (c && (c = strstr(c, "swig_ptr: "))) {
- int j;
- swig_const_info *ci = 0;
- char *name = c + 10;
- for (j = 0; const_table[j].type; j++) {
- if (strncmp(const_table[j].name, name,
- strlen(const_table[j].name)) == 0) {
- ci = &(const_table[j]);
- break;
- }
- }
- if (ci) {
- size_t shift = (ci->ptype) - types;
- swig_type_info *ty = types_initial[shift];
- size_t ldoc = (c - methods[i].ml_doc);
- size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
- char *ndoc = (char*)malloc(ldoc + lptr + 10);
- char *buff = ndoc;
- void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue: (void *)(ci->lvalue);
- strncpy(buff, methods[i].ml_doc, ldoc);
- buff += ldoc;
- strncpy(buff, "swig_ptr: ", 10);
- buff += 10;
- SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
- methods[i].ml_doc = ndoc;
- }
- }
- }
- }
-
- /* -----------------------------------------------------------------------------*
- * Initialize type list
- * -----------------------------------------------------------------------------*/
-
-#if PY_MAJOR_VERSION < 2
- /* PyModule_AddObject function was introduced in Python 2.0. The following function
- is copied out of Python/modsupport.c in python version 2.3.4 */
- static int
- PyModule_AddObject(PyObject *m, char *name, PyObject *o)
- {
- PyObject *dict;
- if (!PyModule_Check(m)) {
- PyErr_SetString(PyExc_TypeError,
- "PyModule_AddObject() needs module as first arg");
- return -1;
- }
- if (!o) {
- PyErr_SetString(PyExc_TypeError,
- "PyModule_AddObject() needs non-NULL value");
- return -1;
- }
-
- dict = PyModule_GetDict(m);
- if (dict == NULL) {
- /* Internal error -- modules must have a dict! */
- PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
- PyModule_GetName(m));
- return -1;
- }
- if (PyDict_SetItemString(dict, name, o))
- return -1;
- Py_DECREF(o);
- return 0;
- }
-#endif
-
- static swig_type_info **
- SWIG_Python_SetTypeListHandle(swig_type_info **type_list_handle) {
- static PyMethodDef swig_empty_runtime_method_table[] = {
- {
- NULL, NULL, 0, NULL
- }
- };/* Sentinel */
-
- PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
- swig_empty_runtime_method_table);
- PyObject *pointer = PyCObject_FromVoidPtr((void *) type_list_handle, NULL);
- if (pointer && module) {
- PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
+ size_t i;
+ for (i = 0; methods[i].ml_name; ++i) {
+ char *c = methods[i].ml_doc;
+ if (c && (c = strstr(c, "swig_ptr: "))) {
+ int j;
+ swig_const_info *ci = 0;
+ char *name = c + 10;
+ for (j = 0; const_table[j].type; ++j) {
+ if (strncmp(const_table[j].name, name,
+ strlen(const_table[j].name)) == 0) {
+ ci = &(const_table[j]);
+ break;
+ }
}
- return type_list_handle;
- }
-
- static swig_type_info **
- SWIG_Python_LookupTypePointer(swig_type_info **type_list_handle) {
- swig_type_info **type_pointer;
-
- /* first check if module already created */
- type_pointer = SWIG_Python_GetTypeListHandle();
- if (type_pointer) {
- return type_pointer;
- } else {
- /* create a new module and variable */
- return SWIG_Python_SetTypeListHandle(type_list_handle);
+ if (ci) {
+ size_t shift = (ci->ptype) - types;
+ swig_type_info *ty = types_initial[shift];
+ size_t ldoc = (c - methods[i].ml_doc);
+ size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
+ char *ndoc = (char*)malloc(ldoc + lptr + 10);
+ if (ndoc) {
+ char *buff = ndoc;
+ void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
+ if (ptr) {
+ strncpy(buff, methods[i].ml_doc, ldoc);
+ buff += ldoc;
+ strncpy(buff, "swig_ptr: ", 10);
+ buff += 10;
+ SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
+ methods[i].ml_doc = ndoc;
+ }
+ }
}
+ }
}
-
+ }
+
#ifdef __cplusplus
}
#endif
@@ -3563,43 +5390,21 @@
* Partial Init method
* -----------------------------------------------------------------------------*/
-#ifdef SWIG_LINK_RUNTIME
-#ifdef __cplusplus
-extern "C"
-#endif
-SWIGEXPORT(void *) SWIG_ReturnGlobalTypeList(void *);
-#endif
-
#ifdef __cplusplus
extern "C"
#endif
-SWIGEXPORT(void) SWIG_init(void) {
- static PyObject *SWIG_globals = 0;
- static int typeinit = 0;
- PyObject *m, *d;
- int i;
- if (!SWIG_globals) SWIG_globals = SWIG_newvarlink();
-
- /* Fix SwigMethods to carry the callback ptrs when needed */
- SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_types_initial);
-
- m = Py_InitModule((char *) SWIG_name, SwigMethods);
- d = PyModule_GetDict(m);
-
- if (!typeinit) {
-#ifdef SWIG_LINK_RUNTIME
- swig_type_list_handle = (swig_type_info **) SWIG_ReturnGlobalTypeList(swig_type_list_handle);
-#else
-# ifndef SWIG_STATIC_RUNTIME
- swig_type_list_handle = SWIG_Python_LookupTypePointer(swig_type_list_handle);
-# endif
-#endif
- for (i = 0; swig_types_initial[i]; i++) {
- swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]);
- }
- typeinit = 1;
- }
- SWIG_InstallConstants(d,swig_const_table);
-
+SWIGEXPORT void SWIG_init(void) {
+ PyObject *m, *d;
+
+ /* Fix SwigMethods to carry the callback ptrs when needed */
+ SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
+
+ m = Py_InitModule((char *) SWIG_name, SwigMethods);
+ d = PyModule_GetDict(m);
+
+ SWIG_InitializeModule(0);
+ SWIG_InstallConstants(d,swig_const_table);
+
+
}
1
0
Author: sphere
Date: Wed Jun 13 16:10:03 2007
New Revision: 5345
Added:
freeswitch/branches/spditner/
Log:
Creating empty folder for spditner
1
0
Author: shahzad
Date: Wed Jun 13 01:48:35 2007
New Revision: 5335
Removed:
freeswitch/branches/shahzad/trunk/
Log:
deleting old dirs.
1
0