From 4526ba30c6ec71e56cefb798c16d3867197f2989 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 8 Sep 2010 15:32:34 -0500 Subject: [PATCH 01/63] improve sofia recover in some nat cases --- src/mod/endpoints/mod_sofia/mod_sofia.c | 4 +++ src/mod/endpoints/mod_sofia/mod_sofia.h | 1 + src/mod/endpoints/mod_sofia/sofia.c | 39 +++++++++++------------- src/mod/endpoints/mod_sofia/sofia_glue.c | 4 ++- 4 files changed, 26 insertions(+), 22 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 19a44f43e1..799cf4f2af 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -85,6 +85,10 @@ static switch_status_t sofia_on_init(switch_core_session_t *session) sofia_glue_tech_absorb_sdp(tech_pvt); } + if (sofia_test_flag(tech_pvt, TFLAG_RECOVERING) || sofia_test_flag(tech_pvt, TFLAG_RECOVERING_BRIDGE)) { + sofia_set_flag(tech_pvt, TFLAG_RECOVERED); + } + if (sofia_test_flag(tech_pvt, TFLAG_OUTBOUND) || sofia_test_flag(tech_pvt, TFLAG_RECOVERING)) { const char *var; diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index aa2149503a..4cdb1a2912 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -275,6 +275,7 @@ typedef enum { TFLAG_RECOVERING, TFLAG_RECOVERING_BRIDGE, TFLAG_T38_PASSTHRU, + TFLAG_RECOVERED, /* No new flags below this line */ TFLAG_MAX } TFLAGS; diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 14d05fd977..258be0ed59 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -1225,7 +1225,7 @@ static void sofia_perform_profile_start_failure(sofia_profile_t *profile, char * #define sofia_profile_start_failure(p, xp) sofia_perform_profile_start_failure(p, xp, __FILE__, __LINE__) -#define SQLLEN 1024 * 64 +#define SQLLEN 1024 * 32 void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread, void *obj) { sofia_profile_t *profile = (sofia_profile_t *) obj; @@ -1236,7 +1236,8 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread void *pop; int loop_count = 0; switch_size_t sql_len = SQLLEN; - char *tmp, *sqlbuf = NULL; + char *sqlbuf = NULL; + char *sql = NULL; if (sofia_test_pflag(profile, PFLAG_SQL_IN_TRANS)) { sqlbuf = (char *) malloc(sql_len); @@ -1253,7 +1254,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread while ((mod_sofia_globals.running == 1 && sofia_test_pflag(profile, PFLAG_RUNNING)) || qsize) { if (sofia_test_pflag(profile, PFLAG_SQL_IN_TRANS)) { - if (qsize > 0 && (qsize >= 1024 || ++loop_count >= profile->trans_timeout)) { + if ((qsize > 0 && (qsize >= 1024 || ++loop_count >= profile->trans_timeout)) || sql) { switch_size_t newlen; uint32_t itterations = 0; switch_size_t len = 0; @@ -1262,28 +1263,24 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread //sofia_glue_actually_execute_sql(profile, "begin;\n", NULL); - while (switch_queue_trypop(profile->sql_queue, &pop) == SWITCH_STATUS_SUCCESS && pop) { - char *sql = (char *) pop; - + while (sql || (switch_queue_trypop(profile->sql_queue, &pop) == SWITCH_STATUS_SUCCESS && pop)) { + + if (!sql) { + sql = (char *) pop; + } + newlen = strlen(sql) + 2; - - if (newlen + 10 < SQLLEN) { - itterations++; - if (len + newlen + 10 > sql_len) { - sql_len = len + 10 + SQLLEN; - if (!(tmp = realloc(sqlbuf, sql_len))) { - abort(); - break; - } - sqlbuf = tmp; - } + itterations++; + + if (len + newlen + 10 < sql_len) { sprintf(sqlbuf + len, "%s;\n", sql); len += newlen; + switch_safe_free(sql); + } else { + break; } - - free(pop); } - + //printf("TRANS:\n%s\n", sqlbuf); sofia_glue_actually_execute_sql_trans(profile, sqlbuf, NULL); //sofia_glue_actually_execute_sql(profile, "commit;\n", NULL); @@ -2860,7 +2857,7 @@ switch_status_t config_sofia(int reload, char *profile_name) goto done; } - profile->trans_timeout = 500; + profile->trans_timeout = 100; profile->auto_rtp_bugs = RTP_BUG_CISCO_SKIP_MARK_BIT_2833;// | RTP_BUG_SONUS_SEND_INVALID_TIMESTAMP_2833; diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 82b933c981..45364cdac2 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -2059,6 +2059,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) nua_invite(tech_pvt->nh, NUTAG_AUTOANSWER(0), NUTAG_SESSION_TIMER(session_timeout), + TAG_IF(sofia_test_flag(tech_pvt, TFLAG_RECOVERED), NUTAG_INVITE_TIMER(UINT_MAX)), TAG_IF(invite_full_from, SIPTAG_FROM_STR(invite_full_from)), TAG_IF(invite_full_to, SIPTAG_TO_STR(invite_full_to)), TAG_IF(tech_pvt->redirected, NUTAG_URL(tech_pvt->redirected)), @@ -2087,6 +2088,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) nua_invite(tech_pvt->nh, NUTAG_AUTOANSWER(0), NUTAG_SESSION_TIMER(session_timeout), + TAG_IF(sofia_test_flag(tech_pvt, TFLAG_RECOVERED), NUTAG_INVITE_TIMER(UINT_MAX)), TAG_IF(invite_full_from, SIPTAG_FROM_STR(invite_full_from)), TAG_IF(invite_full_to, SIPTAG_TO_STR(invite_full_to)), TAG_IF(tech_pvt->redirected, NUTAG_URL(tech_pvt->redirected)), @@ -4644,7 +4646,7 @@ void sofia_glue_tech_untrack(sofia_profile_t *profile, switch_core_session_t *se } } - sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); + sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE); sofia_clear_flag(tech_pvt, TFLAG_TRACKED); switch_safe_free(sql); From fcdc147e0489a8524b927d093f5016758b651e07 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 8 Sep 2010 15:36:30 -0500 Subject: [PATCH 02/63] doh --- src/mod/endpoints/mod_sofia/sofia_reg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index c78ed90fe3..452abdf9e2 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -674,7 +674,7 @@ void sofia_reg_check_expire(sofia_profile_t *profile, time_t now, int reboot) switch_snprintf(sql, sizeof(sql), "select call_id,sip_user,sip_host,contact,status,rpid," "expires,user_agent,server_user,server_host,profile_name" " from sip_registrations where (status like '%%NAT%%' " - "or contact like '%%fs_nat=true%%') and hostname='%s'", mod_sofia_globals.hostname); + "or contact like '%%fs_nat=yes%%') and hostname='%s'", mod_sofia_globals.hostname); sofia_glue_execute_sql_callback(profile, NULL, sql, sofia_reg_nat_callback, profile); } From f777b36e4f9f0864ce475becea8d2b590184eb42 Mon Sep 17 00:00:00 2001 From: Brian West Date: Wed, 8 Sep 2010 15:57:05 -0500 Subject: [PATCH 03/63] swigall --- .../languages/mod_managed/freeswitch_wrap.cxx | 45 +++++++++++++++++++ src/mod/languages/mod_managed/managed/swig.cs | 33 ++++++++++++++ 2 files changed, 78 insertions(+) diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.cxx index 1b13352918..55d78c3583 100644 --- a/src/mod/languages/mod_managed/freeswitch_wrap.cxx +++ b/src/mod/languages/mod_managed/freeswitch_wrap.cxx @@ -12514,6 +12514,29 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_caller_profile_originatee_caller_pro } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_caller_profile_origination_caller_profile_set(void * jarg1, void * jarg2) { + switch_caller_profile *arg1 = (switch_caller_profile *) 0 ; + switch_caller_profile *arg2 = (switch_caller_profile *) 0 ; + + arg1 = (switch_caller_profile *)jarg1; + arg2 = (switch_caller_profile *)jarg2; + if (arg1) (arg1)->origination_caller_profile = arg2; + +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_caller_profile_origination_caller_profile_get(void * jarg1) { + void * jresult ; + switch_caller_profile *arg1 = (switch_caller_profile *) 0 ; + switch_caller_profile *result = 0 ; + + arg1 = (switch_caller_profile *)jarg1; + result = (switch_caller_profile *) ((arg1)->origination_caller_profile); + jresult = (void *)result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_caller_profile_hunt_caller_profile_set(void * jarg1, void * jarg2) { switch_caller_profile *arg1 = (switch_caller_profile *) 0 ; switch_caller_profile *arg2 = (switch_caller_profile *) 0 ; @@ -22015,6 +22038,28 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_channel_get_originatee_caller_profil } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_set_origination_caller_profile(void * jarg1, void * jarg2) { + switch_channel_t *arg1 = (switch_channel_t *) 0 ; + switch_caller_profile_t *arg2 = (switch_caller_profile_t *) 0 ; + + arg1 = (switch_channel_t *)jarg1; + arg2 = (switch_caller_profile_t *)jarg2; + switch_channel_set_origination_caller_profile(arg1,arg2); +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_channel_get_origination_caller_profile(void * jarg1) { + void * jresult ; + switch_channel_t *arg1 = (switch_channel_t *) 0 ; + switch_caller_profile_t *result = 0 ; + + arg1 = (switch_channel_t *)jarg1; + result = (switch_caller_profile_t *)switch_channel_get_origination_caller_profile(arg1); + jresult = (void *)result; + return jresult; +} + + SWIGEXPORT char * SWIGSTDCALL CSharp_switch_channel_get_uuid(void * jarg1) { char * jresult ; switch_channel_t *arg1 = (switch_channel_t *) 0 ; diff --git a/src/mod/languages/mod_managed/managed/swig.cs b/src/mod/languages/mod_managed/managed/swig.cs index 30859377c5..1794978165 100644 --- a/src/mod/languages/mod_managed/managed/swig.cs +++ b/src/mod/languages/mod_managed/managed/swig.cs @@ -2938,6 +2938,16 @@ public class freeswitch { return ret; } + public static void switch_channel_set_origination_caller_profile(SWIGTYPE_p_switch_channel channel, switch_caller_profile caller_profile) { + freeswitchPINVOKE.switch_channel_set_origination_caller_profile(SWIGTYPE_p_switch_channel.getCPtr(channel), switch_caller_profile.getCPtr(caller_profile)); + } + + public static switch_caller_profile switch_channel_get_origination_caller_profile(SWIGTYPE_p_switch_channel channel) { + IntPtr cPtr = freeswitchPINVOKE.switch_channel_get_origination_caller_profile(SWIGTYPE_p_switch_channel.getCPtr(channel)); + switch_caller_profile ret = (cPtr == IntPtr.Zero) ? null : new switch_caller_profile(cPtr, false); + return ret; + } + public static string switch_channel_get_uuid(SWIGTYPE_p_switch_channel channel) { string ret = freeswitchPINVOKE.switch_channel_get_uuid(SWIGTYPE_p_switch_channel.getCPtr(channel)); return ret; @@ -8146,6 +8156,12 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_caller_profile_originatee_caller_profile_get")] public static extern IntPtr switch_caller_profile_originatee_caller_profile_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_caller_profile_origination_caller_profile_set")] + public static extern void switch_caller_profile_origination_caller_profile_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_caller_profile_origination_caller_profile_get")] + public static extern IntPtr switch_caller_profile_origination_caller_profile_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_caller_profile_hunt_caller_profile_set")] public static extern void switch_caller_profile_hunt_caller_profile_set(HandleRef jarg1, HandleRef jarg2); @@ -10528,6 +10544,12 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_get_originatee_caller_profile")] public static extern IntPtr switch_channel_get_originatee_caller_profile(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_set_origination_caller_profile")] + public static extern void switch_channel_set_origination_caller_profile(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_get_origination_caller_profile")] + public static extern IntPtr switch_channel_get_origination_caller_profile(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_get_uuid")] public static extern string switch_channel_get_uuid(HandleRef jarg1); @@ -20148,6 +20170,17 @@ public class switch_caller_profile : IDisposable { } } + public switch_caller_profile origination_caller_profile { + set { + freeswitchPINVOKE.switch_caller_profile_origination_caller_profile_set(swigCPtr, switch_caller_profile.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_caller_profile_origination_caller_profile_get(swigCPtr); + switch_caller_profile ret = (cPtr == IntPtr.Zero) ? null : new switch_caller_profile(cPtr, false); + return ret; + } + } + public switch_caller_profile hunt_caller_profile { set { freeswitchPINVOKE.switch_caller_profile_hunt_caller_profile_set(swigCPtr, switch_caller_profile.getCPtr(value)); From 20ec962a066533e6e0169d4ad4254c5d2c1bc8a7 Mon Sep 17 00:00:00 2001 From: Brian West Date: Wed, 8 Sep 2010 16:33:45 -0500 Subject: [PATCH 04/63] Adding att_xfer example to default dialplan --- conf/dialplan/default.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/dialplan/default.xml b/conf/dialplan/default.xml index 8abb8d8348..dec163efa9 100644 --- a/conf/dialplan/default.xml +++ b/conf/dialplan/default.xml @@ -250,6 +250,7 @@ + From 6875a9718d701ef9f312c677e85bd4675eb2abfd Mon Sep 17 00:00:00 2001 From: Brian West Date: Wed, 8 Sep 2010 16:33:50 -0500 Subject: [PATCH 05/63] Adding att_xfer example to default dialplan --- conf/dialplan/features.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/conf/dialplan/features.xml b/conf/dialplan/features.xml index 901b3091b7..b85cadc5f7 100644 --- a/conf/dialplan/features.xml +++ b/conf/dialplan/features.xml @@ -11,6 +11,14 @@ + + + + + + + + From 77671c049bca64a54c82917bf3bf7b093ff30655 Mon Sep 17 00:00:00 2001 From: Steve Underwood Date: Thu, 9 Sep 2010 08:25:18 +0800 Subject: [PATCH 06/63] I messed up the last spandsp update, by missing 2 header files. This should fix things. --- libs/spandsp/src/spandsp/private/t30.h | 15 ++------------- libs/spandsp/src/spandsp/t30.h | 4 ++++ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/libs/spandsp/src/spandsp/private/t30.h b/libs/spandsp/src/spandsp/private/t30.h index e56753e07d..b8a2e8be1c 100644 --- a/libs/spandsp/src/spandsp/private/t30.h +++ b/libs/spandsp/src/spandsp/private/t30.h @@ -60,10 +60,8 @@ struct t30_state_s int supported_t30_features; /*! \brief TRUE is ECM mode handling is enabled. */ int ecm_allowed; -#if 0 /*! \brief TRUE if we are capable of retransmitting pages */ int retransmit_capable; -#endif /*! \brief The received DCS, formatted as an ASCII string, for inclusion in the TIFF file. */ @@ -71,12 +69,12 @@ struct t30_state_s /*! \brief The text which will be used in FAX page header. No text results in no header line. */ char header_info[T30_MAX_PAGE_HEADER_INFO + 1]; -#if 0 /*! \brief TRUE for FAX page headers to overlay (i.e. replace) the beginning of the page image. FALSE for FAX page headers to add to the overall length of the page. */ int header_overlays_image; -#endif + /*! \brief TRUE if remote T.30 procedural interrupts are allowed. */ + int remote_interrupts_allowed; /*! \brief The information fields received. */ t30_exchanged_info_t rx_info; @@ -207,13 +205,6 @@ struct t30_state_s /*! \brief This is only used in full duplex (e.g. ISDN) modes. */ int timer_t8; - /* These fields are guessed based on compiler error forensics, I added them to fix the build -anthm */ - int remote_interrupts_allowed; - int rtp_events; - int rtn_events; - int retransmit_capable; - /* end guessed fields */ - /*! \brief TRUE once the far end FAX entity has been detected. */ int far_end_detected; @@ -283,12 +274,10 @@ struct t30_state_s /*! \brief The current completion status. */ int current_status; -#if 0 /*! \brief The number of RTP events */ int rtp_events; /*! \brief The number of RTN events */ int rtn_events; -#endif /*! \brief the FCF2 field of the last PPS message we received. */ uint8_t last_pps_fcf2; diff --git a/libs/spandsp/src/spandsp/t30.h b/libs/spandsp/src/spandsp/t30.h index 9df7321abd..a2fff2d28c 100644 --- a/libs/spandsp/src/spandsp/t30.h +++ b/libs/spandsp/src/spandsp/t30.h @@ -682,6 +682,10 @@ SPAN_DECLARE(void) t30_get_transfer_statistics(t30_state_t *s, t30_stats_t *t); \param state TRUE to enable interrupt request, else FALSE. */ SPAN_DECLARE(void) t30_local_interrupt_request(t30_state_t *s, int state); +/*! Allow remote interrupts of FAX exchange. + \brief Allow remote interrupts of FAX exchange. + \param s The T.30 context. + \param state TRUE to allow interruptd, else FALSE. */ SPAN_DECLARE(void) t30_remote_interrupts_allowed(t30_state_t *s, int state); #if defined(__cplusplus) From 2befa393a63df5fa35af1f089eab7c404a4d6490 Mon Sep 17 00:00:00 2001 From: Jeff Lenk Date: Wed, 8 Sep 2010 22:47:28 -0500 Subject: [PATCH 07/63] FSBUILD-302 Fix Windows build error - uninitialized variable --- src/switch_core_sqldb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c index 3a5e0bb6e2..51e7661761 100644 --- a/src/switch_core_sqldb.c +++ b/src/switch_core_sqldb.c @@ -850,7 +850,7 @@ SWITCH_DECLARE(switch_bool_t) switch_cache_db_test_reactive(switch_cache_db_hand static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread, void *obj) { - void *pop; + void *pop = NULL; uint32_t itterations = 0; uint8_t trans = 0, nothing_in_queue = 0; uint32_t target = 100000; From 646a5609a19416a4d0203a0e2d8395ed128b8dfc Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 8 Sep 2010 22:53:57 -0500 Subject: [PATCH 08/63] edge cases for sofia recover --- src/mod/endpoints/mod_sofia/mod_sofia.c | 2 ++ src/mod/endpoints/mod_sofia/mod_sofia.h | 1 + src/mod/endpoints/mod_sofia/sofia.c | 35 +++++++++++++++++++++++- src/mod/endpoints/mod_sofia/sofia_glue.c | 6 ++++ 4 files changed, 43 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 799cf4f2af..3d330dab55 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -721,6 +721,7 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session) TAG_IF(sticky, NUTAG_PROXY(tech_pvt->record_route)), TAG_IF(cid, SIPTAG_HEADER_STR(cid)), NUTAG_SESSION_TIMER(session_timeout), + TAG_IF(session_timeout, NUTAG_SESSION_REFRESHER(nua_remote_refresher)), SIPTAG_CONTACT_STR(tech_pvt->reply_contact), SIPTAG_CALL_INFO_STR(switch_channel_get_variable(tech_pvt->channel, SOFIA_SIP_HEADER_PREFIX "call_info")), SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), @@ -736,6 +737,7 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session) TAG_IF(sticky, NUTAG_PROXY(tech_pvt->record_route)), TAG_IF(cid, SIPTAG_HEADER_STR(cid)), NUTAG_SESSION_TIMER(session_timeout), + TAG_IF(session_timeout, NUTAG_SESSION_REFRESHER(nua_remote_refresher)), SIPTAG_CONTACT_STR(tech_pvt->reply_contact), SIPTAG_CALL_INFO_STR(switch_channel_get_variable(tech_pvt->channel, SOFIA_SIP_HEADER_PREFIX "call_info")), SIPTAG_CONTENT_TYPE_STR("application/sdp"), diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index 4cdb1a2912..4d51e4b573 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -106,6 +106,7 @@ typedef struct private_object private_object_t; #define SOFIA_CRYPTO_MANDATORY_VARIABLE "sip_crypto_mandatory" #define FREESWITCH_SUPPORT "update_display" +#include #include #include #include diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 258be0ed59..4d9ce9eea5 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -4518,7 +4518,20 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, } break; case nua_callstate_completing: - nua_ack(nh, TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)), TAG_END()); + { + if (sofia_test_pflag(profile, PFLAG_TRACK_CALLS)) { + const char *invite_full_via = switch_channel_get_variable(tech_pvt->channel, "sip_invite_full_via"); + const char *invite_route_uri = switch_channel_get_variable(tech_pvt->channel, "sip_invite_route_uri"); + + nua_ack(nh, + TAG_IF(!zstr(invite_full_via), SIPTAG_VIA_STR(invite_full_via)), + TAG_IF(!zstr(invite_route_uri), SIPTAG_ROUTE_STR(invite_route_uri)), + TAG_END()); + + } else { + nua_ack(nh, TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)), TAG_END()); + } + } goto done; case nua_callstate_received: if (!sofia_test_flag(tech_pvt, TFLAG_SDP)) { @@ -5898,6 +5911,26 @@ void sofia_handle_sip_i_reinvite(switch_core_session_t *session, { char *call_info = NULL; + if (session && profile && sip && sofia_test_pflag(profile, PFLAG_TRACK_CALLS)) { + switch_channel_t *channel = switch_core_session_get_channel(session); + private_object_t *tech_pvt = (private_object_t *) switch_core_session_get_private(session); + char network_ip[80]; + int network_port = 0; + char via_space[2048]; + char branch[16] = ""; + + sofia_glue_get_addr(nua_current_request(nua), network_ip, sizeof(network_ip), &network_port); + switch_stun_random_string(branch, sizeof(branch) - 1, "0123456789abcdef"); + + switch_snprintf(via_space, sizeof(via_space), "SIP/2.0/UDP %s;rport=%d;branch=%s", network_ip, network_port, branch); + switch_channel_set_variable(channel, "sip_full_via", via_space); + switch_channel_set_variable_printf(channel, "sip_network_port", "%d", network_port); + switch_channel_set_variable_printf(channel, "sip_recieved_port", "%d", network_port); + switch_channel_set_variable_printf(channel, "sip_via_rport", "%d", network_port); + + sofia_glue_tech_track(tech_pvt->profile, session); + } + if (sofia_test_pflag(profile, PFLAG_MANAGE_SHARED_APPEARANCE)) { switch_channel_t *channel = switch_core_session_get_channel(session); if (channel && sip->sip_call_info) { diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 45364cdac2..473dfb9aca 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -2055,10 +2055,15 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA); } + if (sofia_test_flag(tech_pvt, TFLAG_RECOVERED)) { + session_timeout = 0; + } + if (sofia_use_soa(tech_pvt)) { nua_invite(tech_pvt->nh, NUTAG_AUTOANSWER(0), NUTAG_SESSION_TIMER(session_timeout), + TAG_IF(session_timeout, NUTAG_SESSION_REFRESHER(nua_remote_refresher)), TAG_IF(sofia_test_flag(tech_pvt, TFLAG_RECOVERED), NUTAG_INVITE_TIMER(UINT_MAX)), TAG_IF(invite_full_from, SIPTAG_FROM_STR(invite_full_from)), TAG_IF(invite_full_to, SIPTAG_TO_STR(invite_full_to)), @@ -2088,6 +2093,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) nua_invite(tech_pvt->nh, NUTAG_AUTOANSWER(0), NUTAG_SESSION_TIMER(session_timeout), + TAG_IF(session_timeout, NUTAG_SESSION_REFRESHER(nua_remote_refresher)), TAG_IF(sofia_test_flag(tech_pvt, TFLAG_RECOVERED), NUTAG_INVITE_TIMER(UINT_MAX)), TAG_IF(invite_full_from, SIPTAG_FROM_STR(invite_full_from)), TAG_IF(invite_full_to, SIPTAG_TO_STR(invite_full_to)), From 28046a89de50f8cc87159d4824aeb946e64dfaf9 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 9 Sep 2010 09:27:17 -0500 Subject: [PATCH 09/63] downgrade log message to debug and add more details --- src/switch_core_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_core_file.c b/src/switch_core_file.c index c995b229a6..7d5df8882a 100644 --- a/src/switch_core_file.c +++ b/src/switch_core_file.c @@ -173,7 +173,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file, } if (fh->samplerate && rate && fh->samplerate != rate) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Sample rate doesn't match\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "File %s sample rate %d doesn't match requested rate %d\n", file_path, fh->samplerate, rate); if ((flags & SWITCH_FILE_FLAG_READ)) { fh->samplerate = rate; } From eaeabc7b04b09a38d0df17576b551d94aa6485dd Mon Sep 17 00:00:00 2001 From: Rupa Schomaker Date: Thu, 9 Sep 2010 11:07:11 -0500 Subject: [PATCH 10/63] MODAPP-454 - mod_lcr: don't count twice --- src/mod/applications/mod_lcr/mod_lcr.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mod/applications/mod_lcr/mod_lcr.c b/src/mod/applications/mod_lcr/mod_lcr.c index bbf7bb568d..105576ce14 100644 --- a/src/mod/applications/mod_lcr/mod_lcr.c +++ b/src/mod/applications/mod_lcr/mod_lcr.c @@ -1571,7 +1571,6 @@ SWITCH_STANDARD_APP(lcr_app_function) switch_channel_set_variable(channel, vbuf, cur_route->carrier_name); switch_snprintf(vbuf, sizeof(vbuf), "lcr_codec_%d", cnt); switch_channel_set_variable(channel, vbuf, cur_route->codec); - cnt++; if (cur_route->next) { if (routes.profile->enable_sip_redir) { dig_stream.write_function(&dig_stream, "%s,", cur_route->dialstring); From 5a6f0f5c37939b29ae40f6a9c3e454639d4e8dfc Mon Sep 17 00:00:00 2001 From: Marc Olivier Chouinard Date: Thu, 9 Sep 2010 15:37:41 -0400 Subject: [PATCH 11/63] mod_sofia: Correct the order what param and variables are overriding them self in user/group/domain --- src/mod/endpoints/mod_sofia/sofia_reg.c | 148 ++++++++++++------------ 1 file changed, 72 insertions(+), 76 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index 452abdf9e2..32d380d271 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -2292,9 +2292,9 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, switch_event_add_header_string(*v_event, SWITCH_STACK_BOTTOM, "mwi-account", mwi_account); } - if ((uparams = switch_xml_child(user, "params"))) { + if ((dparams = switch_xml_child(domain, "params"))) { xparams_type[i] = 0; - xparams[i++] = uparams; + xparams[i++] = dparams; } if (group && (gparams = switch_xml_child(group, "params"))) { @@ -2302,102 +2302,98 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, xparams[i++] = gparams; } - if ((dparams = switch_xml_child(domain, "params"))) { + if ((uparams = switch_xml_child(user, "params"))) { xparams_type[i] = 0; - xparams[i++] = dparams; - } - - if ((uparams = switch_xml_child(user, "variables"))) { - xparams_type[i] = 1; xparams[i++] = uparams; } - if (group && (gparams = switch_xml_child(group, "variables"))) { - xparams_type[i] = 1; - xparams[i++] = gparams; - } - if ((dparams = switch_xml_child(domain, "variables"))) { xparams_type[i] = 1; xparams[i++] = dparams; } + if (group && (gparams = switch_xml_child(group, "variables"))) { + xparams_type[i] = 1; + xparams[i++] = gparams; + } + + if ((uparams = switch_xml_child(user, "variables"))) { + xparams_type[i] = 1; + xparams[i++] = uparams; + } + if (i <= 6) { int j = 0; + const char *gw_val = NULL; for (j = 0; j < i; j++) { for (param = switch_xml_child(xparams[j], (xparams_type[j] ? "variable" : "param")); param; param = param->next) { const char *var = switch_xml_attr_soft(param, "name"); const char *val = switch_xml_attr_soft(param, "value"); - sofia_gateway_t *gateway_ptr = NULL; if (!zstr(var) && !zstr(val) && (xparams_type[j] == 1 || !strncasecmp(var, "sip-", 4) || !strcasecmp(var, "register-gateway"))) { - if (!switch_event_get_header(*v_event, var)) { - if (profile->debug) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "event_add_header -> '%s' = '%s'\n", var, val); - } - switch_event_add_header_string(*v_event, SWITCH_STACK_BOTTOM, var, val); - } else { - continue; + if (profile->debug) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "event_add_header -> '%s' = '%s'\n", var, val); } - - if (!strcasecmp(var, "register-gateway")) { - if (!strcasecmp(val, "all")) { - switch_xml_t gateways_tag, gateway_tag; - if ((gateways_tag = switch_xml_child(user, "gateways"))) { - for (gateway_tag = switch_xml_child(gateways_tag, "gateway"); gateway_tag; gateway_tag = gateway_tag->next) { - char *name = (char *) switch_xml_attr_soft(gateway_tag, "name"); - if (zstr(name)) { - name = "anonymous"; - } - - if ((gateway_ptr = sofia_reg_find_gateway(name))) { - reg_state_t ostate = gateway_ptr->state; - gateway_ptr->retry = 0; - if (exptime) { - gateway_ptr->state = REG_STATE_UNREGED; - } else { - gateway_ptr->state = REG_STATE_UNREGISTER; - } - if (ostate != gateway_ptr->state) { - sofia_reg_fire_custom_gateway_state_event(gateway_ptr, 0, NULL); - } - sofia_reg_release_gateway(gateway_ptr); - } - - } - } - } else { - int x, argc; - char *mydata, *argv[50]; - - mydata = strdup(val); - switch_assert(mydata != NULL); - - argc = switch_separate_string(mydata, ',', argv, (sizeof(argv) / sizeof(argv[0]))); - - for (x = 0; x < argc; x++) { - if ((gateway_ptr = sofia_reg_find_gateway((char *) argv[x]))) { - reg_state_t ostate = gateway_ptr->state; - gateway_ptr->retry = 0; - if (exptime) { - gateway_ptr->state = REG_STATE_UNREGED; - } else { - gateway_ptr->state = REG_STATE_UNREGISTER; - } - if (ostate != gateway_ptr->state) { - sofia_reg_fire_custom_gateway_state_event(gateway_ptr, 0, NULL); - } - sofia_reg_release_gateway(gateway_ptr); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Gateway '%s' not found.\n", argv[x]); - } - } - - free(mydata); + switch_event_add_header_string(*v_event, SWITCH_STACK_BOTTOM, var, val); + } + } + } + if ((gw_val = switch_event_get_header(*v_event, "register-gateway"))) { + sofia_gateway_t *gateway_ptr = NULL; + if (!strcasecmp(gw_val, "all")) { + switch_xml_t gateways_tag, gateway_tag; + if ((gateways_tag = switch_xml_child(user, "gateways"))) { + for (gateway_tag = switch_xml_child(gateways_tag, "gateway"); gateway_tag; gateway_tag = gateway_tag->next) { + char *name = (char *) switch_xml_attr_soft(gateway_tag, "name"); + if (zstr(name)) { + name = "anonymous"; } + + if ((gateway_ptr = sofia_reg_find_gateway(name))) { + reg_state_t ostate = gateway_ptr->state; + gateway_ptr->retry = 0; + if (exptime) { + gateway_ptr->state = REG_STATE_UNREGED; + } else { + gateway_ptr->state = REG_STATE_UNREGISTER; + } + if (ostate != gateway_ptr->state) { + sofia_reg_fire_custom_gateway_state_event(gateway_ptr, 0, NULL); + } + sofia_reg_release_gateway(gateway_ptr); + } + } } + } else { + int x, argc; + char *mydata, *argv[50]; + + mydata = strdup(gw_val); + switch_assert(mydata != NULL); + + argc = switch_separate_string(mydata, ',', argv, (sizeof(argv) / sizeof(argv[0]))); + + for (x = 0; x < argc; x++) { + if ((gateway_ptr = sofia_reg_find_gateway((char *) argv[x]))) { + reg_state_t ostate = gateway_ptr->state; + gateway_ptr->retry = 0; + if (exptime) { + gateway_ptr->state = REG_STATE_UNREGED; + } else { + gateway_ptr->state = REG_STATE_UNREGISTER; + } + if (ostate != gateway_ptr->state) { + sofia_reg_fire_custom_gateway_state_event(gateway_ptr, 0, NULL); + } + sofia_reg_release_gateway(gateway_ptr); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Gateway '%s' not found.\n", argv[x]); + } + } + + free(mydata); } } } From 87db11afe02ebaaa898f3b4b76258ca8ff6f60f3 Mon Sep 17 00:00:00 2001 From: Leon de Rooij Date: Fri, 10 Sep 2010 01:36:27 +0200 Subject: [PATCH 12/63] Made 2nd arg to freeswitch.Dbh:query (cb func) optional --- src/mod/languages/mod_lua/freeswitch.i | 11 +- src/mod/languages/mod_lua/freeswitch_lua.cpp | 11 +- src/mod/languages/mod_lua/mod_lua_wrap.cpp | 4189 +++++++----------- 3 files changed, 1508 insertions(+), 2703 deletions(-) diff --git a/src/mod/languages/mod_lua/freeswitch.i b/src/mod/languages/mod_lua/freeswitch.i index 383580103f..54bdb7bdc9 100644 --- a/src/mod/languages/mod_lua/freeswitch.i +++ b/src/mod/languages/mod_lua/freeswitch.i @@ -19,8 +19,15 @@ /* Lua function typemap */ -%typemap(in,checkfn="lua_isfunction") SWIGLUA_FN -%{ $1.L=L; $1.idx=$input; %} +%typemap(in, checkfn = "lua_isfunction") SWIGLUA_FN { + $1.L = L; + $1.idx = $input; +} + +%typemap(default) SWIGLUA_FN { + SWIGLUA_FN default_swiglua_fn = { 0 }; + $1 = default_swiglua_fn; +} %ignore SwitchToMempool; diff --git a/src/mod/languages/mod_lua/freeswitch_lua.cpp b/src/mod/languages/mod_lua/freeswitch_lua.cpp index 17d12bc1cb..8321f87e2f 100644 --- a/src/mod/languages/mod_lua/freeswitch_lua.cpp +++ b/src/mod/languages/mod_lua/freeswitch_lua.cpp @@ -367,10 +367,15 @@ int Dbh::query_callback(void *pArg, int argc, char **argv, char **cargv) bool Dbh::query(char *sql, SWIGLUA_FN lua_fun) { if (connected) { - if (switch_cache_db_execute_sql_callback(dbh, sql, query_callback, &lua_fun, NULL) == SWITCH_STATUS_SUCCESS) { - return true; + if (lua_fun.L && lua_fun.idx != 0) { + if (switch_cache_db_execute_sql_callback(dbh, sql, query_callback, &lua_fun, NULL) == SWITCH_STATUS_SUCCESS) { + return true; + } + } else { /* if no lua_fun arg is passed from Lua, an empty initialized struct will be sent - see freeswitch.i */ + if (switch_cache_db_execute_sql(dbh, sql, NULL) == SWITCH_STATUS_SUCCESS) { + return true; + } } } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "no workie workie :(\n"); return false; } diff --git a/src/mod/languages/mod_lua/mod_lua_wrap.cpp b/src/mod/languages/mod_lua/mod_lua_wrap.cpp index 991b667a62..962ebe3eca 100644 --- a/src/mod/languages/mod_lua/mod_lua_wrap.cpp +++ b/src/mod/languages/mod_lua/mod_lua_wrap.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.35 + * 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 @@ -10,7 +10,7 @@ #ifdef __cplusplus -template class SwigValueWrapper { +template class SwigValueWrapper { T *tt; public: SwigValueWrapper() : tt(0) { } @@ -23,10 +23,6 @@ public: private: SwigValueWrapper& operator=(const SwigValueWrapper& rhs); }; - -template T SwigValueInit() { - return T(); -} #endif /* ----------------------------------------------------------------------------- @@ -36,14 +32,14 @@ template T SwigValueInit() { /* template workaround for compilers that cannot correctly implement the C++ standard */ #ifndef SWIGTEMPLATEDISAMBIGUATOR -# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) -# define SWIGTEMPLATEDISAMBIGUATOR template -# elif defined(__HP_aCC) -/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ -/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ -# define SWIGTEMPLATEDISAMBIGUATOR template +# if defined(__SUNPRO_CC) +# if (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif # else -# define SWIGTEMPLATEDISAMBIGUATOR +# define SWIGTEMPLATEDISAMBIGUATOR # endif #endif @@ -122,16 +118,10 @@ template T SwigValueInit() { #endif /* Deal with Microsoft's attempt at deprecating C standard runtime functions */ -#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) # define _CRT_SECURE_NO_DEPRECATE #endif -/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ -#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) -# define _SCL_SECURE_NO_DEPRECATE -#endif - - /* ----------------------------------------------------------------------------- * swigrun.swg * @@ -141,7 +131,7 @@ template T SwigValueInit() { /* 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 "4" +#define SWIG_RUNTIME_VERSION "2" /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ #ifdef SWIG_TYPE_TABLE @@ -176,7 +166,6 @@ template T SwigValueInit() { /* Flags for pointer conversions */ #define SWIG_POINTER_DISOWN 0x1 -#define SWIG_CAST_NEW_MEMORY 0x2 /* Flags for new pointer objects */ #define SWIG_POINTER_OWN 0x1 @@ -317,10 +306,10 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) { extern "C" { #endif -typedef void *(*swig_converter_func)(void *, int *); +typedef void *(*swig_converter_func)(void *); typedef struct swig_type_info *(*swig_dycast_func)(void **); -/* Structure to store information on one type */ +/* Structure to store inforomation on one type */ typedef struct swig_type_info { const char *name; /* mangled name of this type */ const char *str; /* human readable name of this type */ @@ -365,7 +354,7 @@ SWIG_TypeNameComp(const char *f1, const char *l1, while ((*f2 == ' ') && (f2 != l2)) ++f2; if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; } - return (int)((l1 - f1) - (l2 - f2)); + return (l1 - f1) - (l2 - f2); } /* @@ -447,8 +436,8 @@ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { Cast a pointer up an inheritance hierarchy */ SWIGRUNTIMEINLINE void * -SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { - return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); +SWIG_TypeCast(swig_cast_info *ty, void *ptr) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr); } /* @@ -719,8 +708,7 @@ extern "C" { #include "lua.h" #include "lauxlib.h" -#include /* for malloc */ -#include /* for a few sanity tests */ +#include /* for a few sanity tests */ /* ----------------------------------------------------------------------------- * global swig types @@ -731,7 +719,12 @@ extern "C" { #define SWIG_LUA_STRING 3 #define SWIG_LUA_POINTER 4 #define SWIG_LUA_BINARY 5 -#define SWIG_LUA_CHAR 6 + +/* Structure for command table (replaced by luaLib's luaL_reg) */ +/*typedef struct { + const char *name; + lua_CFunction wrapper; +} swig_lua_command_info;*/ /* Structure for variable linking table */ typedef struct { @@ -762,42 +755,29 @@ typedef struct { } swig_lua_attribute; typedef struct swig_lua_class { - const char *name; + const char *name; swig_type_info **type; - lua_CFunction constructor; - void (*destructor)(void *); - swig_lua_method *methods; + lua_CFunction constructor; + void (*destructor)(void *); + swig_lua_method *methods; swig_lua_attribute *attributes; struct swig_lua_class **bases; - const char **base_names; } swig_lua_class; -/* this is the struct for wrappering all pointers in SwigLua -*/ typedef struct { + void *ptr; swig_type_info *type; - int own; /* 1 if owned & must be destroyed */ - void *ptr; + int own; /* 1 if owned & must be destroyed */ } swig_lua_userdata; -/* this is the struct for wrapping arbitary packed binary data -(currently it is only used for member function pointers) -the data ordering is similar to swig_lua_userdata, but it is currently not possible -to tell the two structures apart within Swig, other than by looking at the type -*/ -typedef struct { - swig_type_info *type; - int own; /* 1 if owned & must be destroyed */ - char data[1]; /* arbitary amount of data */ -} swig_lua_rawdata; /* Common SWIG API */ -#define SWIG_NewPointerObj(L, ptr, type, owner) SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner) -#define SWIG_ConvertPtr(L,idx, ptr, type, flags) SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags) -#define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname) -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(L, idx, ptr, sz, ty) SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty) -#define SWIG_NewMemberObj(L, ptr, sz, type) SWIG_Lua_NewPackedObj(L, ptr, sz, type) +#define SWIG_NewPointerObj(L, ptr, type, owner) \ + SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner) +#define SWIG_ConvertPtr(L,idx, ptr, type, flags) \ + SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags) +#define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) \ + SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname) /* Runtime API */ #define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata)) @@ -808,193 +788,141 @@ typedef struct { #define SWIG_contract_assert(expr, msg) \ if (!(expr)) { lua_pushstring(L, (char *) msg); goto fail; } else + + /* helper #defines */ #define SWIG_fail {goto fail;} -#define SWIG_fail_arg(func_name,argnum,type) \ - {lua_pushfstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\ - func_name,argnum,type,SWIG_Lua_typename(L,argnum));\ - goto fail;} -#define SWIG_fail_ptr(func_name,argnum,type) \ - SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*") -#define SWIG_check_num_args(func_name,a,b) \ - if (lua_gettop(L)b) \ - {lua_pushfstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\ - goto fail;} - +#define SWIG_fail_arg(I) {lua_pushfstring(L,"argument %d incorrect/missing",I);goto fail;} #define SWIG_Lua_get_table(L,n) \ - (lua_pushstring(L, n), lua_rawget(L,-2)) + (lua_pushstring(L, n), lua_rawget(L,-2)) #define SWIG_Lua_add_function(L,n,f) \ - (lua_pushstring(L, n), \ - lua_pushcfunction(L, f), \ - lua_rawset(L,-3)) - -/* special helper for allowing 'nil' for usertypes */ -#define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I)) - -#ifdef __cplusplus -/* Special helper for member function pointers -it gets the address, casts it, then dereferences it */ -//#define SWIG_mem_fn_as_voidptr(a) (*((char**)&(a))) -#endif - -/* storing/access of swig_module_info */ -SWIGRUNTIME swig_module_info * -SWIG_Lua_GetModule(lua_State* L) { - swig_module_info *ret = 0; - lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); - lua_rawget(L,LUA_REGISTRYINDEX); - if (lua_islightuserdata(L,-1)) - ret=(swig_module_info*)lua_touserdata(L,-1); - lua_pop(L,1); /* tidy */ - return ret; -} - -SWIGRUNTIME void -SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) { - /* add this all into the Lua registry: */ - lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); - lua_pushlightuserdata(L,(void*)module); - lua_rawset(L,LUA_REGISTRYINDEX); -} + (lua_pushstring(L, n), \ + lua_pushcfunction(L, f), \ + lua_rawset(L,-3)) /* ----------------------------------------------------------------------------- * global variable support code: modules * ----------------------------------------------------------------------------- */ -/* this function is called when trying to set an immutable. -default value is to print an error. -This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */ -SWIGINTERN int SWIG_Lua_set_immutable(lua_State* L) -{ -/* there should be 1 param passed in: the new value */ -#ifndef SWIGLUA_IGNORE_SET_IMMUTABLE - lua_pop(L,1); /* remove it */ - lua_pushstring(L,"This variable is immutable"); - lua_error(L); -#endif - return 0; /* should not return anything */ -} - /* the module.get method used for getting linked data */ SWIGINTERN int SWIG_Lua_module_get(lua_State* L) { -/* there should be 2 params passed in - (1) table (not the meta table) - (2) string name of the attribute - printf("SWIG_Lua_module_get %p(%s) '%s'\n", - lua_topointer(L,1),lua_typename(L,lua_type(L,1)), - lua_tostring(L,2)); +/* there should be 2 params passed in + (1) table (not the meta table) + (2) string name of the attribute + printf("SWIG_Lua_module_get %p(%s) '%s'\n", + lua_topointer(L,1),lua_typename(L,lua_type(L,1)), + lua_tostring(L,2)); */ - /* get the metatable */ - assert(lua_istable(L,1)); /* just in case */ - lua_getmetatable(L,1); /* get the metatable */ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_get_table(L,".get"); /* get the .get table */ - lua_remove(L,3); /* remove metatable */ - if (lua_istable(L,-1)) - { - /* look for the key in the .get table */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); - lua_remove(L,3); /* remove .get */ - if (lua_iscfunction(L,-1)) - { /* found it so call the fn & return its value */ - lua_call(L,0,1); - return 1; - } - lua_pop(L,1); /* remove the top */ - } - lua_pop(L,1); /* remove the .get */ - lua_pushnil(L); /* return a nil */ + /* get the metatable */ + assert(lua_istable(L,1)); /* just in case */ + lua_getmetatable(L,1); /* get the metatable */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_get_table(L,".get"); /* get the .get table */ + lua_remove(L,3); /* remove metatable */ + if (lua_istable(L,-1)) + { + /* look for the key in the .get table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + lua_remove(L,3); /* remove .get */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_call(L,0,1); + return 1; + } + lua_pop(L,1); /* remove the top */ + } + lua_pop(L,1); /* remove the .get */ + lua_pushnil(L); /* return a nil */ return 1; } /* the module.set method used for setting linked data */ SWIGINTERN int SWIG_Lua_module_set(lua_State* L) { -/* there should be 3 params passed in - (1) table (not the meta table) - (2) string name of the attribute - (3) any for the new value +/* there should be 3 params passed in + (1) table (not the meta table) + (2) string name of the attribute + (3) any for the new value */ - /* get the metatable */ - assert(lua_istable(L,1)); /* just in case */ - lua_getmetatable(L,1); /* get the metatable */ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_get_table(L,".set"); /* get the .set table */ - lua_remove(L,4); /* remove metatable */ - if (lua_istable(L,-1)) - { - /* look for the key in the .set table */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); - lua_remove(L,4); /* remove .set */ - if (lua_iscfunction(L,-1)) - { /* found it so call the fn & return its value */ - lua_pushvalue(L,3); /* value */ - lua_call(L,1,0); - return 0; - } - } - lua_settop(L,3); /* reset back to start */ - /* we now have the table, key & new value, so just set directly */ - lua_rawset(L,1); /* add direct */ - return 0; + /* get the metatable */ + assert(lua_istable(L,1)); /* just in case */ + lua_getmetatable(L,1); /* get the metatable */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_get_table(L,".set"); /* get the .set table */ + lua_remove(L,4); /* remove metatable */ + if (lua_istable(L,-1)) + { + /* look for the key in the .set table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + lua_remove(L,4); /* remove .set */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,3); /* value */ + lua_call(L,1,0); + return 0; + } + lua_pop(L,1); /* remove the top */ + } + lua_pop(L,1); /* remove the .set */ + return 0; } /* registering a module in lua */ SWIGINTERN void SWIG_Lua_module_begin(lua_State* L,const char* name) { - assert(lua_istable(L,-1)); /* just in case */ - lua_pushstring(L,name); - lua_newtable(L); /* the table */ - /* add meta table */ - lua_newtable(L); /* the meta table */ - SWIG_Lua_add_function(L,"__index",SWIG_Lua_module_get); - SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_module_set); - lua_pushstring(L,".get"); - lua_newtable(L); /* the .get table */ - lua_rawset(L,-3); /* add .get into metatable */ - lua_pushstring(L,".set"); - lua_newtable(L); /* the .set table */ - lua_rawset(L,-3); /* add .set into metatable */ - lua_setmetatable(L,-2); /* sets meta table in module */ - lua_rawset(L,-3); /* add module into parent */ - SWIG_Lua_get_table(L,name); /* get the table back out */ + assert(lua_istable(L,-1)); /* just in case */ + lua_pushstring(L,name); + lua_newtable(L); /* the table */ + /* add meta table */ + lua_newtable(L); /* the meta table */ + SWIG_Lua_add_function(L,"__index",SWIG_Lua_module_get); + SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_module_set); + lua_pushstring(L,".get"); + lua_newtable(L); /* the .get table */ + lua_rawset(L,-3); /* add .get into metatable */ + lua_pushstring(L,".set"); + lua_newtable(L); /* the .set table */ + lua_rawset(L,-3); /* add .set into metatable */ + lua_setmetatable(L,-2); /* sets meta table in module */ + lua_rawset(L,-3); /* add module into parent */ + SWIG_Lua_get_table(L,name); /* get the table back out */ } /* ending the register */ SWIGINTERN void SWIG_Lua_module_end(lua_State* L) { - lua_pop(L,1); /* tidy stack (remove module) */ + lua_pop(L,1); /* tidy stack (remove module) */ } /* adding a linked variable to the module */ SWIGINTERN void SWIG_Lua_module_add_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn) { - assert(lua_istable(L,-1)); /* just in case */ - lua_getmetatable(L,-1); /* get the metatable */ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_get_table(L,".get"); /* find the .get table */ - assert(lua_istable(L,-1)); /* should be a table: */ - SWIG_Lua_add_function(L,name,getFn); - lua_pop(L,1); /* tidy stack (remove table) */ - if (setFn) /* if there is a set fn */ - { - SWIG_Lua_get_table(L,".set"); /* find the .set table */ - assert(lua_istable(L,-1)); /* should be a table: */ - SWIG_Lua_add_function(L,name,setFn); - lua_pop(L,1); /* tidy stack (remove table) */ - } - lua_pop(L,1); /* tidy stack (remove meta) */ + assert(lua_istable(L,-1)); /* just in case */ + lua_getmetatable(L,-1); /* get the metatable */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); /* should be a table: */ + SWIG_Lua_add_function(L,name,getFn); + lua_pop(L,1); /* tidy stack (remove table) */ + if (setFn) /* if there is a set fn */ + { + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + assert(lua_istable(L,-1)); /* should be a table: */ + SWIG_Lua_add_function(L,name,setFn); + lua_pop(L,1); /* tidy stack (remove table) */ + } + lua_pop(L,1); /* tidy stack (remove meta) */ } /* adding a function module */ SWIGINTERN void SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_CFunction fn) { - SWIG_Lua_add_function(L,name,fn); + SWIG_Lua_add_function(L,name,fn); } /* ----------------------------------------------------------------------------- @@ -1004,383 +932,307 @@ SWIGINTERN void SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_ /* the class.get method, performs the lookup of class attributes */ SWIGINTERN int SWIG_Lua_class_get(lua_State* L) { -/* there should be 2 params passed in - (1) userdata (not the meta table) - (2) string name of the attribute +/* there should be 2 params passed in + (1) userdata (not the meta table) + (2) string name of the attribute */ - assert(lua_isuserdata(L,-2)); /* just in case */ - lua_getmetatable(L,-2); /* get the meta table */ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_get_table(L,".get"); /* find the .get table */ - assert(lua_istable(L,-1)); /* just in case */ - /* look for the key in the .get table */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); - lua_remove(L,-2); /* stack tidy, remove .get table */ - if (lua_iscfunction(L,-1)) - { /* found it so call the fn & return its value */ - lua_pushvalue(L,1); /* the userdata */ - lua_call(L,1,1); /* 1 value in (userdata),1 out (result) */ - lua_remove(L,-2); /* stack tidy, remove metatable */ - return 1; - } - lua_pop(L,1); /* remove whatever was there */ - /* ok, so try the .fn table */ - SWIG_Lua_get_table(L,".fn"); /* find the .get table */ - assert(lua_istable(L,-1)); /* just in case */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); /* look for the fn */ - lua_remove(L,-2); /* stack tidy, remove .fn table */ - if (lua_isfunction(L,-1)) /* note: if its a C function or lua function */ - { /* found it so return the fn & let lua call it */ - lua_remove(L,-2); /* stack tidy, remove metatable */ - return 1; - } - lua_pop(L,1); /* remove whatever was there */ - /* NEW: looks for the __getitem() fn - this is a user provided get fn */ - SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */ - if (lua_iscfunction(L,-1)) /* if its there */ - { /* found it so call the fn & return its value */ - lua_pushvalue(L,1); /* the userdata */ - lua_pushvalue(L,2); /* the parameter */ - lua_call(L,2,1); /* 2 value in (userdata),1 out (result) */ - lua_remove(L,-2); /* stack tidy, remove metatable */ - return 1; - } - return 0; /* sorry not known */ + assert(lua_isuserdata(L,-2)); /* just in case */ + lua_getmetatable(L,-2); /* get the meta table */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + /* look for the key in the .get table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + lua_remove(L,-2); /* stack tidy, remove .get table */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,1); /* the userdata */ + lua_call(L,1,1); /* 1 value in (userdata),1 out (result) */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + lua_pop(L,1); /* remove whatever was there */ + /* ok, so try the .fn table */ + SWIG_Lua_get_table(L,".fn"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); /* look for the fn */ + lua_remove(L,-2); /* stack tidy, remove .fn table */ + if (lua_iscfunction(L,-1)) + { /* found it so return the fn & let lua call it */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + lua_pop(L,1); /* remove whatever was there */ + /* NEW: looks for the __getitem() fn + this is a user provided get fn */ + SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */ + if (lua_iscfunction(L,-1)) /* if its there */ + { /* found it so call the fn & return its value */ + lua_pushvalue(L,1); /* the userdata */ + lua_pushvalue(L,2); /* the parameter */ + lua_call(L,2,1); /* 2 value in (userdata),1 out (result) */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + return 0; /* sorry not known */ } /* the class.set method, performs the lookup of class attributes */ SWIGINTERN int SWIG_Lua_class_set(lua_State* L) { -/* there should be 3 params passed in - (1) table (not the meta table) - (2) string name of the attribute - (3) any for the new value +/* there should be 3 params passed in + (1) table (not the meta table) + (2) string name of the attribute + (3) any for the new value printf("SWIG_Lua_class_set %p(%s) '%s' %p(%s)\n", - lua_topointer(L,1),lua_typename(L,lua_type(L,1)), - lua_tostring(L,2), - lua_topointer(L,3),lua_typename(L,lua_type(L,3)));*/ + lua_topointer(L,1),lua_typename(L,lua_type(L,1)), + lua_tostring(L,2), + lua_topointer(L,3),lua_typename(L,lua_type(L,3)));*/ - assert(lua_isuserdata(L,1)); /* just in case */ - lua_getmetatable(L,1); /* get the meta table */ - assert(lua_istable(L,-1)); /* just in case */ + assert(lua_isuserdata(L,1)); /* just in case */ + lua_getmetatable(L,1); /* get the meta table */ + assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_get_table(L,".set"); /* find the .set table */ - if (lua_istable(L,-1)) - { - /* look for the key in the .set table */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); - if (lua_iscfunction(L,-1)) - { /* found it so call the fn & return its value */ - lua_pushvalue(L,1); /* userdata */ - lua_pushvalue(L,3); /* value */ - lua_call(L,2,0); - return 0; - } - lua_pop(L,1); /* remove the value */ - } - lua_pop(L,1); /* remove the value .set table */ - /* NEW: looks for the __setitem() fn - this is a user provided set fn */ - SWIG_Lua_get_table(L,"__setitem"); /* find the fn */ - if (lua_iscfunction(L,-1)) /* if its there */ - { /* found it so call the fn & return its value */ - lua_pushvalue(L,1); /* the userdata */ - lua_pushvalue(L,2); /* the parameter */ - lua_pushvalue(L,3); /* the value */ - lua_call(L,3,0); /* 3 values in ,0 out */ - lua_remove(L,-2); /* stack tidy, remove metatable */ - return 1; - } - return 0; + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + if (lua_istable(L,-1)) + { + /* look for the key in the .set table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,1); /* userdata */ + lua_pushvalue(L,3); /* value */ + lua_call(L,2,0); + return 0; + } + lua_pop(L,1); /* remove the value */ + } + lua_pop(L,1); /* remove the value .set table */ + /* NEW: looks for the __setitem() fn + this is a user provided set fn */ + SWIG_Lua_get_table(L,"__setitem"); /* find the fn */ + if (lua_iscfunction(L,-1)) /* if its there */ + { /* found it so call the fn & return its value */ + lua_pushvalue(L,1); /* the userdata */ + lua_pushvalue(L,2); /* the parameter */ + lua_pushvalue(L,3); /* the value */ + lua_call(L,3,0); /* 3 values in ,0 out */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + return 0; } /* the class.destruct method called by the interpreter */ SWIGINTERN int SWIG_Lua_class_destruct(lua_State* L) { -/* there should be 1 params passed in - (1) userdata (not the meta table) */ - swig_lua_userdata* usr; - swig_lua_class* clss; - assert(lua_isuserdata(L,-1)); /* just in case */ - usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ - /* if must be destroyed & has a destructor */ - if (usr->own) /* if must be destroyed */ - { - clss=(swig_lua_class*)usr->type->clientdata; /* get the class */ - if (clss && clss->destructor) /* there is a destroy fn */ - { - clss->destructor(usr->ptr); /* bye bye */ - } - } - return 0; +/* there should be 1 params passed in + (1) userdata (not the meta table) */ + swig_lua_userdata* usr; + swig_lua_class* clss; + assert(lua_isuserdata(L,-1)); /* just in case */ + usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ + /* if must be destroyed & has a destructor */ + if (usr->own) /* if must be destroyed */ + { + clss=(swig_lua_class*)usr->type->clientdata; /* get the class */ + if (clss && clss->destructor) /* there is a destroy fn */ + { + clss->destructor(usr->ptr); /* bye bye */ + } + } + return 0; } /* gets the swig class registry (or creates it) */ SWIGINTERN void SWIG_Lua_get_class_registry(lua_State* L) { - /* add this all into the swig registry: */ - lua_pushstring(L,"SWIG"); - lua_rawget(L,LUA_REGISTRYINDEX); /* get the registry */ - if (!lua_istable(L,-1)) /* not there */ - { /* must be first time, so add it */ - lua_pop(L,1); /* remove the result */ - lua_pushstring(L,"SWIG"); - lua_newtable(L); - lua_rawset(L,LUA_REGISTRYINDEX); - /* then get it */ - lua_pushstring(L,"SWIG"); - lua_rawget(L,LUA_REGISTRYINDEX); - } + /* add this all into the swig registry: */ + lua_pushstring(L,"SWIG"); + lua_rawget(L,LUA_REGISTRYINDEX); /* get the registry */ + if (!lua_istable(L,-1)) /* not there */ + { /* must be first time, so add it */ + lua_pop(L,1); /* remove the result */ + lua_pushstring(L,"SWIG"); + lua_newtable(L); + lua_rawset(L,LUA_REGISTRYINDEX); + /* then get it */ + lua_pushstring(L,"SWIG"); + lua_rawget(L,LUA_REGISTRYINDEX); + } } /* helper fn to get the classes metatable from the register */ SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State* L,const char* cname) { - SWIG_Lua_get_class_registry(L); /* get the registry */ - lua_pushstring(L,cname); /* get the name */ - lua_rawget(L,-2); /* get it */ - lua_remove(L,-2); /* tidy up (remove registry) */ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,cname); /* get the name */ + lua_rawget(L,-2); /* get it */ + lua_remove(L,-2); /* tidy up (remove registry) */ } /* helper add a variable to a registered class */ SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn) { - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_get_table(L,".get"); /* find the .get table */ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_add_function(L,name,getFn); - lua_pop(L,1); /* tidy stack (remove table) */ - if (setFn) - { - SWIG_Lua_get_table(L,".set"); /* find the .set table */ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_add_function(L,name,setFn); - lua_pop(L,1); /* tidy stack (remove table) */ - } + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_function(L,name,getFn); + lua_pop(L,1); /* tidy stack (remove table) */ + if (setFn) + { + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_function(L,name,setFn); + lua_pop(L,1); /* tidy stack (remove table) */ + } } /* helper to recursively add class details (attributes & operations) */ SWIGINTERN void SWIG_Lua_add_class_details(lua_State* L,swig_lua_class* clss) { - int i; - /* call all the base classes first: we can then override these later: */ - for(i=0;clss->bases[i];i++) - { - SWIG_Lua_add_class_details(L,clss->bases[i]); - } - /* add fns */ - for(i=0;clss->attributes[i].name;i++){ - SWIG_Lua_add_class_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod); - } - /* add methods to the metatable */ - SWIG_Lua_get_table(L,".fn"); /* find the .fn table */ - assert(lua_istable(L,-1)); /* just in case */ - for(i=0;clss->methods[i].name;i++){ - SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method); - } - lua_pop(L,1); /* tidy stack (remove table) */ - /* add operator overloads - these look ANY method which start with "__" and assume they - are operator overloads & add them to the metatable - (this might mess up is someone defines a method __gc (the destructor)*/ - for(i=0;clss->methods[i].name;i++){ - if (clss->methods[i].name[0]=='_' && clss->methods[i].name[1]=='_'){ - SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method); - } - } -} - -/* set up the base classes pointers. -Each class structure has a list of pointers to the base class structures. -This function fills them. -It cannot be done at compile time, as this will not work with hireachies -spread over more than one swig file. -Therefore it must be done at runtime, querying the SWIG type system. -*/ -SWIGINTERN void SWIG_Lua_init_base_class(lua_State* L,swig_lua_class* clss) -{ - int i=0; - swig_module_info* module=SWIG_GetModule(L); - for(i=0;clss->base_names[i];i++) - { - if (clss->bases[i]==0) /* not found yet */ - { - /* lookup and cache the base class */ - swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]); - if (info) clss->bases[i] = (swig_lua_class *) info->clientdata; - } - } + int i; + /* call all the base classes first: we can then override these later: */ + for(i=0;clss->bases[i];i++) + { + SWIG_Lua_add_class_details(L,clss->bases[i]); + } + /* add fns */ + for(i=0;clss->attributes[i].name;i++){ + SWIG_Lua_add_class_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod); + } + /* add methods to the metatable */ + SWIG_Lua_get_table(L,".fn"); /* find the .fn table */ + assert(lua_istable(L,-1)); /* just in case */ + for(i=0;clss->methods[i].name;i++){ + SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method); + } + lua_pop(L,1); /* tidy stack (remove table) */ + /* add operator overloads + these look ANY method which start with "__" and assume they + are operator overloads & add them to the metatable + (this might mess up is someone defines a method __gc (the destructor)*/ + for(i=0;clss->methods[i].name;i++){ + if (clss->methods[i].name[0]=='_' && clss->methods[i].name[1]=='_'){ + SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method); + } + } } /* performs the entire class registration process */ SWIGINTERN void SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss) { - /* add its constructor to module with the name of the class - so you can do MyClass(...) as well as new_MyClass(...) - BUT only if a constructor is defined - (this overcomes the problem of pure virtual classes without constructors)*/ - if (clss->constructor) - SWIG_Lua_add_function(L,clss->name,clss->constructor); +/* add its constructor to module with the name of the class + so you can do MyClass(...) as well as new_MyClass(...) + BUT only if a constructor is defined + (this overcomes the problem of pure virtual classes without constructors)*/ + if (clss->constructor) + SWIG_Lua_add_function(L,clss->name,clss->constructor); - SWIG_Lua_get_class_registry(L); /* get the registry */ - lua_pushstring(L,clss->name); /* get the name */ - lua_newtable(L); /* create the metatable */ - /* add string of class name called ".type" */ - lua_pushstring(L,".type"); - lua_pushstring(L,clss->name); - lua_rawset(L,-3); - /* add a table called ".get" */ - lua_pushstring(L,".get"); - lua_newtable(L); - lua_rawset(L,-3); - /* add a table called ".set" */ - lua_pushstring(L,".set"); - lua_newtable(L); - lua_rawset(L,-3); - /* add a table called ".fn" */ - lua_pushstring(L,".fn"); - lua_newtable(L); - lua_rawset(L,-3); - /* add accessor fns for using the .get,.set&.fn */ - SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get); - SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set); - SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct); - /* add it */ - lua_rawset(L,-3); /* metatable into registry */ - lua_pop(L,1); /* tidy stack (remove registry) */ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,clss->name); /* get the name */ + lua_newtable(L); /* create the metatable */ + /* add string of class name called ".type" */ + lua_pushstring(L,".type"); + lua_pushstring(L,clss->name); + lua_rawset(L,-3); + /* add a table called ".get" */ + lua_pushstring(L,".get"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".set" */ + lua_pushstring(L,".set"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".fn" */ + lua_pushstring(L,".fn"); + lua_newtable(L); + lua_rawset(L,-3); + /* add accessor fns for using the .get,.set&.fn */ + SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get); + SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set); + SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct); + /* add it */ + lua_rawset(L,-3); /* metatable into registry */ + lua_pop(L,1); /* tidy stack (remove registry) */ - SWIG_Lua_get_class_metatable(L,clss->name); - SWIG_Lua_add_class_details(L,clss); /* recursive adding of details (atts & ops) */ - lua_pop(L,1); /* tidy stack (remove class metatable) */ + SWIG_Lua_get_class_metatable(L,clss->name); + SWIG_Lua_add_class_details(L,clss); /* recursive adding of details (atts & ops) */ + lua_pop(L,1); /* tidy stack (remove class metatable) */ } /* ----------------------------------------------------------------------------- * Class/structure conversion fns * ----------------------------------------------------------------------------- */ -/* helper to add metatable to new lua object */ -SWIGINTERN void _SWIG_Lua_AddMetatable(lua_State* L,swig_type_info *type) -{ - if (type->clientdata) /* there is clientdata: so add the metatable */ - { - SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->name); - if (lua_istable(L,-1)) - { - lua_setmetatable(L,-2); - } - else - { - lua_pop(L,1); - } - } -} - /* pushes a new object into the lua stack */ SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State* L,void* ptr,swig_type_info *type, int own) { - swig_lua_userdata* usr; - if (!ptr){ - lua_pushnil(L); - return; - } - usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata)); /* get data */ - usr->ptr=ptr; /* set the ptr */ - usr->type=type; - usr->own=own; - _SWIG_Lua_AddMetatable(L,type); /* add metatable */ + swig_lua_userdata* usr; + if (!ptr){ + lua_pushnil(L); + return; + } + usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata)); /* get data */ + usr->ptr=ptr; /* set the ptr */ + usr->type=type; + usr->own=own; + if (type->clientdata) /* there is clientdata: so add the metatable */ + { + SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->name); + if (lua_istable(L,-1)) + { + lua_setmetatable(L,-2); + } + else + { + lua_pop(L,1); + } + } } /* takes a object from the lua stack & converts it into an object of the correct type (if possible) */ SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State* L,int index,void** ptr,swig_type_info *type,int flags) { - swig_lua_userdata* usr; - swig_cast_info *cast; - if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;} /* special case: lua nil => NULL pointer */ - usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */ - if (usr) - { - if (flags & SWIG_POINTER_DISOWN) /* must disown the object */ - { - usr->own=0; - } - if (!type) /* special cast void*, no casting fn */ - { - *ptr=usr->ptr; - return SWIG_OK; /* ok */ - } - cast=SWIG_TypeCheckStruct(usr->type,type); /* performs normal type checking */ - if (cast) - { - int newmemory = 0; - *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory); - assert(!newmemory); /* newmemory handling not yet implemented */ - return SWIG_OK; /* ok */ - } - } - return SWIG_ERROR; /* error */ + swig_lua_userdata* usr; + swig_cast_info *cast; + usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */ + if (usr) + { + cast=SWIG_TypeCheckStruct(usr->type,type); + if (cast) + { + *ptr=SWIG_TypeCast(cast,usr->ptr); + return 0; /* ok */ + } + } + return 1; /* error */ } SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State* L,int index,swig_type_info *type,int flags, - int argnum,const char* func_name){ - void* result; - if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){ - lua_pushfstring(L,"Error in %s, expected a %s at argument number %d\n", - func_name,(type && type->str)?type->str:"void*",argnum); - lua_error(L); - } - return result; -} - -/* pushes a packed userdata. user for member fn pointers only */ -SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State* L,void* ptr,size_t size,swig_type_info *type) -{ - swig_lua_rawdata* raw; - assert(ptr); /* not acceptable to pass in a NULL value */ - raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size); /* alloc data */ - raw->type=type; - raw->own=0; - memcpy(raw->data,ptr,size); /* copy the data */ - _SWIG_Lua_AddMetatable(L,type); /* add metatable */ -} - -/* converts a packed userdata. user for member fn pointers only */ -SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State* L,int index,void* ptr,size_t size,swig_type_info *type) -{ - swig_lua_rawdata* raw; - raw=(swig_lua_rawdata*)lua_touserdata(L,index); /* get data */ - if (!raw) return SWIG_ERROR; /* error */ - if (type==0 || type==raw->type) /* void* or identical type */ - { - memcpy(ptr,raw->data,size); /* copy it */ - return SWIG_OK; /* ok */ - } - return SWIG_ERROR; /* error */ -} - -/* a function to get the typestring of a piece of data */ -SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp) -{ - swig_lua_userdata* usr; - if (lua_isuserdata(L,tp)) - { - usr=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ - if (usr && usr->type && usr->type->str) - return usr->type->str; - return "userdata (unknown type)"; - } - return lua_typename(L,lua_type(L,tp)); + int argnum,const char* func_name){ + void* result; + if (SWIG_ConvertPtr(L,index,&result,type,flags)){ + lua_pushfstring(L,"Error in %s, expected a %s at argument number %d\n", + func_name,(type && type->str)?type->str:"void*",argnum); + lua_error(L); + } + return result; } /* lua callable function to get the userdata's type */ SWIGRUNTIME int SWIG_Lua_type(lua_State* L) { - lua_pushstring(L,SWIG_Lua_typename(L,1)); - return 1; + swig_lua_userdata* usr; + if (!lua_isuserdata(L,1)) /* just in case */ + return 0; /* nil reply */ + usr=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ + lua_pushstring(L,usr->type->name); + return 1; } /* lua callable function to compare userdata's value @@ -1388,18 +1240,18 @@ the issue is that two userdata may point to the same thing but to lua, they are different objects */ SWIGRUNTIME int SWIG_Lua_equal(lua_State* L) { - int result; - swig_lua_userdata *usr1,*usr2; - if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */ - return 0; /* nil reply */ - usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ - usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */ - /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/ - result=(usr1->ptr==usr2->ptr); - lua_pushboolean(L,result); - return 1; + int result; + swig_lua_userdata *usr1,*usr2; + if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */ + return 0; /* nil reply */ + usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ + usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */ + result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); + lua_pushboolean(L,result); + return 1; } + /* ----------------------------------------------------------------------------- * global variable support code: class/struct typemap functions * ----------------------------------------------------------------------------- */ @@ -1412,17 +1264,12 @@ SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) { switch(constants[i].type) { case SWIG_LUA_INT: lua_pushstring(L,constants[i].name); - lua_pushnumber(L,(lua_Number)constants[i].lvalue); + lua_pushnumber(L,(double)constants[i].lvalue); lua_rawset(L,-3); break; case SWIG_LUA_FLOAT: lua_pushstring(L,constants[i].name); - lua_pushnumber(L,(lua_Number)constants[i].dvalue); - lua_rawset(L,-3); - break; - case SWIG_LUA_CHAR: - lua_pushstring(L,constants[i].name); - lua_pushfstring(L,"%c",(char)constants[i].lvalue); + lua_pushnumber(L,(double)constants[i].dvalue); lua_rawset(L,-3); break; case SWIG_LUA_STRING: @@ -1436,9 +1283,8 @@ SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) { lua_rawset(L,-3); break; case SWIG_LUA_BINARY: - lua_pushstring(L,constants[i].name); - SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype); - lua_rawset(L,-3); + /* TODO?? */ +/* obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); */ break; default: break; @@ -1446,34 +1292,25 @@ SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) { } } -/* ----------------------------------------------------------------------------- - * executing lua code from within the wrapper - * ----------------------------------------------------------------------------- */ +/* storing/access of swig_module_info */ +SWIGRUNTIME swig_module_info * +SWIG_Lua_GetModule(lua_State* L) { + swig_module_info *ret = 0; + lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); + lua_rawget(L,LUA_REGISTRYINDEX); + if (lua_islightuserdata(L,-1)) + ret=(swig_module_info*)lua_touserdata(L,-1); + lua_pop(L,1); /* tidy */ + return ret; +} -#ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */ -#define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S) -#endif -/* Executes a C string in Lua a really simple way of calling lua from C -Unfortunately lua keeps changing its API's, so we need a conditional compile -In lua 5.0.X its lua_dostring() -In lua 5.1.X its luaL_dostring() -*/ -SWIGINTERN int -SWIG_Lua_dostring(lua_State *L, const char* str) { - int ok,top; - if (str==0 || str[0]==0) return 0; /* nothing to do */ - top=lua_gettop(L); /* save stack */ -#if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501)) - ok=luaL_dostring(L,str); /* looks like this is lua 5.1.X or later, good */ -#else - ok=lua_dostring(L,str); /* might be lua 5.0.x, using lua_dostring */ -#endif - if (ok!=0) { - SWIG_DOSTRING_FAIL(lua_tostring(L,-1)); - } - lua_settop(L,top); /* restore the stack */ - return ok; -} +SWIGRUNTIME void +SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) { + /* add this all into the Lua registry: */ + lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); + lua_pushlightuserdata(L,(void*)module); + lua_rawset(L,LUA_REGISTRYINDEX); +} #ifdef __cplusplus } @@ -1484,15 +1321,15 @@ SWIG_Lua_dostring(lua_State *L, const char* str) { /* -------- TYPES TABLE (BEGIN) -------- */ -#define SWIGTYPE_p_API swig_types[0] -#define SWIGTYPE_p_CoreSession swig_types[1] -#define SWIGTYPE_p_DTMF swig_types[2] -#define SWIGTYPE_p_Event swig_types[3] -#define SWIGTYPE_p_EventConsumer swig_types[4] -#define SWIGTYPE_p_IVRMenu swig_types[5] -#define SWIGTYPE_p_LUA__Dbh swig_types[6] -#define SWIGTYPE_p_LUA__Session swig_types[7] -#define SWIGTYPE_p_SWIGLUA_FN swig_types[8] +#define SWIGTYPE_SWIGLUA_FN swig_types[0] +#define SWIGTYPE_p_API swig_types[1] +#define SWIGTYPE_p_CoreSession swig_types[2] +#define SWIGTYPE_p_DTMF swig_types[3] +#define SWIGTYPE_p_Event swig_types[4] +#define SWIGTYPE_p_EventConsumer swig_types[5] +#define SWIGTYPE_p_IVRMenu swig_types[6] +#define SWIGTYPE_p_LUA__Dbh swig_types[7] +#define SWIGTYPE_p_LUA__Session swig_types[8] #define SWIGTYPE_p_Stream swig_types[9] #define SWIGTYPE_p_input_callback_state swig_types[10] #define SWIGTYPE_p_lua_State swig_types[11] @@ -1513,23 +1350,22 @@ SWIG_Lua_dostring(lua_State *L, const char* str) { #define SWIGTYPE_p_switch_stream_handle_t swig_types[26] #define SWIGTYPE_p_uint32_t swig_types[27] #define SWIGTYPE_p_void swig_types[28] -static swig_type_info *swig_types[30]; -static swig_module_info swig_module = {swig_types, 29, 0, 0, 0, 0}; +#define SWIGTYPE_switch_call_cause_t swig_types[29] +#define SWIGTYPE_switch_channel_state_t swig_types[30] +#define SWIGTYPE_switch_event_types_t swig_types[31] +#define SWIGTYPE_switch_input_type_t swig_types[32] +#define SWIGTYPE_switch_priority_t swig_types[33] +#define SWIGTYPE_uint32_t swig_types[34] +static swig_type_info *swig_types[36]; +static swig_module_info swig_module = {swig_types, 35, 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) -------- */ -#define SWIG_name "freeswitch" -#define SWIG_init luaopen_freeswitch -#define SWIG_init_user luaopen_freeswitch_user - -#define SWIG_LUACODE luaopen_freeswitch_luacode - - -namespace swig { -typedef struct{} LANGUAGE_OBJ; -} +#define SWIG_init Freeswitch_Init +#define SWIG_name "freeswitch" +#define SWIG_import luaopen_freeswitch #include "switch.h" @@ -1544,18 +1380,15 @@ static int _wrap_consoleLog(lua_State* L) { char *arg1 = (char *) 0 ; char *arg2 = (char *) 0 ; - SWIG_check_num_args("consoleLog",2,2) - if(!lua_isstring(L,1)) SWIG_fail_arg("consoleLog",1,"char *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("consoleLog",2,"char *"); - arg1 = (char *)lua_tostring(L, 1); - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isstring(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1 = (char*)lua_tostring(L, 1); + arg2 = (char*)lua_tostring(L, 2); consoleLog(arg1,arg2); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -1566,16 +1399,13 @@ static int _wrap_consoleCleanLog(lua_State* L) { int SWIG_arg = -1; char *arg1 = (char *) 0 ; - SWIG_check_num_args("consoleCleanLog",1,1) - if(!lua_isstring(L,1)) SWIG_fail_arg("consoleCleanLog",1,"char *"); - arg1 = (char *)lua_tostring(L, 1); + if(!lua_isstring(L,1)) SWIG_fail_arg(1); + arg1 = (char*)lua_tostring(L, 1); consoleCleanLog(arg1); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -1602,37 +1432,32 @@ static int _wrap_new_IVRMenu(lua_State* L) { int arg16 ; IVRMenu *result = 0 ; - SWIG_check_num_args("IVRMenu",16,16) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("IVRMenu",1,"IVRMenu *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("IVRMenu",2,"char const *"); - if(!lua_isstring(L,3)) SWIG_fail_arg("IVRMenu",3,"char const *"); - if(!lua_isstring(L,4)) SWIG_fail_arg("IVRMenu",4,"char const *"); - if(!lua_isstring(L,5)) SWIG_fail_arg("IVRMenu",5,"char const *"); - if(!lua_isstring(L,6)) SWIG_fail_arg("IVRMenu",6,"char const *"); - if(!lua_isstring(L,7)) SWIG_fail_arg("IVRMenu",7,"char const *"); - if(!lua_isstring(L,8)) SWIG_fail_arg("IVRMenu",8,"char const *"); - if(!lua_isstring(L,9)) SWIG_fail_arg("IVRMenu",9,"char const *"); - if(!lua_isstring(L,10)) SWIG_fail_arg("IVRMenu",10,"char const *"); - if(!lua_isnumber(L,11)) SWIG_fail_arg("IVRMenu",11,"int"); - if(!lua_isnumber(L,12)) SWIG_fail_arg("IVRMenu",12,"int"); - if(!lua_isnumber(L,13)) SWIG_fail_arg("IVRMenu",13,"int"); - if(!lua_isnumber(L,14)) SWIG_fail_arg("IVRMenu",14,"int"); - if(!lua_isnumber(L,15)) SWIG_fail_arg("IVRMenu",15,"int"); - if(!lua_isnumber(L,16)) SWIG_fail_arg("IVRMenu",16,"int"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_IVRMenu,0))){ - SWIG_fail_ptr("new_IVRMenu",1,SWIGTYPE_p_IVRMenu); - } - - arg2 = (char *)lua_tostring(L, 2); - arg3 = (char *)lua_tostring(L, 3); - arg4 = (char *)lua_tostring(L, 4); - arg5 = (char *)lua_tostring(L, 5); - arg6 = (char *)lua_tostring(L, 6); - arg7 = (char *)lua_tostring(L, 7); - arg8 = (char *)lua_tostring(L, 8); - arg9 = (char *)lua_tostring(L, 9); - arg10 = (char *)lua_tostring(L, 10); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + if(!lua_isstring(L,3)) SWIG_fail_arg(3); + if(!lua_isstring(L,4)) SWIG_fail_arg(4); + if(!lua_isstring(L,5)) SWIG_fail_arg(5); + if(!lua_isstring(L,6)) SWIG_fail_arg(6); + if(!lua_isstring(L,7)) SWIG_fail_arg(7); + if(!lua_isstring(L,8)) SWIG_fail_arg(8); + if(!lua_isstring(L,9)) SWIG_fail_arg(9); + if(!lua_isstring(L,10)) SWIG_fail_arg(10); + if(!lua_isnumber(L,11)) SWIG_fail_arg(11); + if(!lua_isnumber(L,12)) SWIG_fail_arg(12); + if(!lua_isnumber(L,13)) SWIG_fail_arg(13); + if(!lua_isnumber(L,14)) SWIG_fail_arg(14); + if(!lua_isnumber(L,15)) SWIG_fail_arg(15); + if(!lua_isnumber(L,16)) SWIG_fail_arg(16); + arg1=(IVRMenu *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_IVRMenu,0,1,"new_IVRMenu"); + arg2 = (char*)lua_tostring(L, 2); + arg3 = (char*)lua_tostring(L, 3); + arg4 = (char*)lua_tostring(L, 4); + arg5 = (char*)lua_tostring(L, 5); + arg6 = (char*)lua_tostring(L, 6); + arg7 = (char*)lua_tostring(L, 7); + arg8 = (char*)lua_tostring(L, 8); + arg9 = (char*)lua_tostring(L, 9); + arg10 = (char*)lua_tostring(L, 10); arg11 = (int)lua_tonumber(L, 11); arg12 = (int)lua_tonumber(L, 12); arg13 = (int)lua_tonumber(L, 13); @@ -1644,8 +1469,6 @@ static int _wrap_new_IVRMenu(lua_State* L) { SWIG_NewPointerObj(L,result,SWIGTYPE_p_IVRMenu,1); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -1656,21 +1479,14 @@ static int _wrap_delete_IVRMenu(lua_State* L) { int SWIG_arg = -1; IVRMenu *arg1 = (IVRMenu *) 0 ; - SWIG_check_num_args("IVRMenu",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("IVRMenu",1,"IVRMenu *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_IVRMenu,SWIG_POINTER_DISOWN))){ - SWIG_fail_ptr("delete_IVRMenu",1,SWIGTYPE_p_IVRMenu); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(IVRMenu *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_IVRMenu,0,1,"delete_IVRMenu"); delete arg1; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -1684,26 +1500,19 @@ static int _wrap_IVRMenu_bindAction(lua_State* L) { char *arg3 = (char *) 0 ; char *arg4 = (char *) 0 ; - SWIG_check_num_args("bindAction",4,4) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("bindAction",1,"IVRMenu *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("bindAction",2,"char *"); - if(!lua_isstring(L,3)) SWIG_fail_arg("bindAction",3,"char const *"); - if(!lua_isstring(L,4)) SWIG_fail_arg("bindAction",4,"char const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_IVRMenu,0))){ - SWIG_fail_ptr("IVRMenu_bindAction",1,SWIGTYPE_p_IVRMenu); - } - - arg2 = (char *)lua_tostring(L, 2); - arg3 = (char *)lua_tostring(L, 3); - arg4 = (char *)lua_tostring(L, 4); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + if(!lua_isstring(L,3)) SWIG_fail_arg(3); + if(!lua_isstring(L,4)) SWIG_fail_arg(4); + arg1=(IVRMenu *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_IVRMenu,0,1,"IVRMenu_bindAction"); + arg2 = (char*)lua_tostring(L, 2); + arg3 = (char*)lua_tostring(L, 3); + arg4 = (char*)lua_tostring(L, 4); (arg1)->bindAction(arg2,(char const *)arg3,(char const *)arg4); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -1716,28 +1525,17 @@ static int _wrap_IVRMenu_execute(lua_State* L) { CoreSession *arg2 = (CoreSession *) 0 ; char *arg3 = (char *) 0 ; - SWIG_check_num_args("execute",3,3) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("execute",1,"IVRMenu *"); - if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("execute",2,"CoreSession *"); - if(!lua_isstring(L,3)) SWIG_fail_arg("execute",3,"char const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_IVRMenu,0))){ - SWIG_fail_ptr("IVRMenu_execute",1,SWIGTYPE_p_IVRMenu); - } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("IVRMenu_execute",2,SWIGTYPE_p_CoreSession); - } - - arg3 = (char *)lua_tostring(L, 3); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + if(!lua_isstring(L,3)) SWIG_fail_arg(3); + arg1=(IVRMenu *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_IVRMenu,0,1,"IVRMenu_execute"); + arg2=(CoreSession *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_CoreSession,0,2,"IVRMenu_execute"); + arg3 = (char*)lua_tostring(L, 3); (arg1)->execute(arg2,(char const *)arg3); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -1757,21 +1555,17 @@ static swig_lua_attribute swig_IVRMenu_attributes[] = { {0,0,0} }; static swig_lua_class *swig_IVRMenu_bases[] = {0}; -static const char *swig_IVRMenu_base_names[] = {0}; -static swig_lua_class _wrap_class_IVRMenu = { "IVRMenu", &SWIGTYPE_p_IVRMenu,_wrap_new_IVRMenu, swig_delete_IVRMenu, swig_IVRMenu_methods, swig_IVRMenu_attributes, swig_IVRMenu_bases, swig_IVRMenu_base_names }; +swig_lua_class _wrap_class_IVRMenu = { "IVRMenu", &SWIGTYPE_p_IVRMenu,_wrap_new_IVRMenu, swig_delete_IVRMenu, swig_IVRMenu_methods, swig_IVRMenu_attributes, swig_IVRMenu_bases }; static int _wrap_new_API(lua_State* L) { int SWIG_arg = -1; API *result = 0 ; - SWIG_check_num_args("API",0,0) result = (API *)new API(); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_API,1); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -1782,21 +1576,14 @@ static int _wrap_delete_API(lua_State* L) { int SWIG_arg = -1; API *arg1 = (API *) 0 ; - SWIG_check_num_args("API",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("API",1,"API *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_API,SWIG_POINTER_DISOWN))){ - SWIG_fail_ptr("delete_API",1,SWIGTYPE_p_API); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(API *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_API,0,1,"delete_API"); delete arg1; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -1810,26 +1597,19 @@ static int _wrap_API_execute(lua_State* L) { char *arg3 = (char *) NULL ; char *result = 0 ; - SWIG_check_num_args("execute",2,3) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("execute",1,"API *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("execute",2,"char const *"); - if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("execute",3,"char const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_API,0))){ - SWIG_fail_ptr("API_execute",1,SWIGTYPE_p_API); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg(3); + arg1=(API *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_API,0,1,"API_execute"); + arg2 = (char*)lua_tostring(L, 2); if(lua_gettop(L)>=3){ - arg3 = (char *)lua_tostring(L, 3); + arg3 = (char*)lua_tostring(L, 3); } result = (char *)(arg1)->execute((char const *)arg2,(char const *)arg3); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -1842,22 +1622,15 @@ static int _wrap_API_executeString(lua_State* L) { char *arg2 = (char *) 0 ; char *result = 0 ; - SWIG_check_num_args("executeString",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("executeString",1,"API *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("executeString",2,"char const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_API,0))){ - SWIG_fail_ptr("API_executeString",1,SWIGTYPE_p_API); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(API *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_API,0,1,"API_executeString"); + arg2 = (char*)lua_tostring(L, 2); result = (char *)(arg1)->executeString((char const *)arg2); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -1869,20 +1642,13 @@ static int _wrap_API_getTime(lua_State* L) { API *arg1 = (API *) 0 ; char *result = 0 ; - SWIG_check_num_args("getTime",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getTime",1,"API *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_API,0))){ - SWIG_fail_ptr("API_getTime",1,SWIGTYPE_p_API); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(API *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_API,0,1,"API_getTime"); result = (char *)(arg1)->getTime(); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -1903,31 +1669,23 @@ static swig_lua_attribute swig_API_attributes[] = { {0,0,0} }; static swig_lua_class *swig_API_bases[] = {0}; -static const char *swig_API_base_names[] = {0}; -static swig_lua_class _wrap_class_API = { "API", &SWIGTYPE_p_API,_wrap_new_API, swig_delete_API, swig_API_methods, swig_API_attributes, swig_API_bases, swig_API_base_names }; +swig_lua_class _wrap_class_API = { "API", &SWIGTYPE_p_API,_wrap_new_API, swig_delete_API, swig_API_methods, swig_API_attributes, swig_API_bases }; static int _wrap_input_callback_state_t_function_set(lua_State* L) { int SWIG_arg = -1; input_callback_state_t *arg1 = (input_callback_state_t *) 0 ; void *arg2 = (void *) 0 ; - SWIG_check_num_args("function",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("function",1,"input_callback_state_t *"); - if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("function",2,"void *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){ - SWIG_fail_ptr("input_callback_state_t_function_set",1,SWIGTYPE_p_input_callback_state); - } - - arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"input_callback_state_t_function_set"); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1=(input_callback_state_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_input_callback_state,0,1,"input_callback_state_t_function_set"); + arg2=((swig_lua_userdata*)(lua_touserdata(L,2)))->ptr; if (arg1) (arg1)->function = arg2; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -1939,20 +1697,13 @@ static int _wrap_input_callback_state_t_function_get(lua_State* L) { input_callback_state_t *arg1 = (input_callback_state_t *) 0 ; void *result = 0 ; - SWIG_check_num_args("function",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("function",1,"input_callback_state_t *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){ - SWIG_fail_ptr("input_callback_state_t_function_get",1,SWIGTYPE_p_input_callback_state); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(input_callback_state_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_input_callback_state,0,1,"input_callback_state_t_function_get"); result = (void *) ((arg1)->function); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -1964,23 +1715,16 @@ static int _wrap_input_callback_state_t_threadState_set(lua_State* L) { input_callback_state_t *arg1 = (input_callback_state_t *) 0 ; void *arg2 = (void *) 0 ; - SWIG_check_num_args("threadState",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("threadState",1,"input_callback_state_t *"); - if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("threadState",2,"void *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){ - SWIG_fail_ptr("input_callback_state_t_threadState_set",1,SWIGTYPE_p_input_callback_state); - } - - arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"input_callback_state_t_threadState_set"); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1=(input_callback_state_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_input_callback_state,0,1,"input_callback_state_t_threadState_set"); + arg2=((swig_lua_userdata*)(lua_touserdata(L,2)))->ptr; if (arg1) (arg1)->threadState = arg2; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -1992,20 +1736,13 @@ static int _wrap_input_callback_state_t_threadState_get(lua_State* L) { input_callback_state_t *arg1 = (input_callback_state_t *) 0 ; void *result = 0 ; - SWIG_check_num_args("threadState",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("threadState",1,"input_callback_state_t *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){ - SWIG_fail_ptr("input_callback_state_t_threadState_get",1,SWIGTYPE_p_input_callback_state); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(input_callback_state_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_input_callback_state,0,1,"input_callback_state_t_threadState_get"); result = (void *) ((arg1)->threadState); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2017,23 +1754,16 @@ static int _wrap_input_callback_state_t_extra_set(lua_State* L) { input_callback_state_t *arg1 = (input_callback_state_t *) 0 ; void *arg2 = (void *) 0 ; - SWIG_check_num_args("extra",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("extra",1,"input_callback_state_t *"); - if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("extra",2,"void *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){ - SWIG_fail_ptr("input_callback_state_t_extra_set",1,SWIGTYPE_p_input_callback_state); - } - - arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"input_callback_state_t_extra_set"); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1=(input_callback_state_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_input_callback_state,0,1,"input_callback_state_t_extra_set"); + arg2=((swig_lua_userdata*)(lua_touserdata(L,2)))->ptr; if (arg1) (arg1)->extra = arg2; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2045,20 +1775,13 @@ static int _wrap_input_callback_state_t_extra_get(lua_State* L) { input_callback_state_t *arg1 = (input_callback_state_t *) 0 ; void *result = 0 ; - SWIG_check_num_args("extra",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("extra",1,"input_callback_state_t *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){ - SWIG_fail_ptr("input_callback_state_t_extra_get",1,SWIGTYPE_p_input_callback_state); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(input_callback_state_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_input_callback_state,0,1,"input_callback_state_t_extra_get"); result = (void *) ((arg1)->extra); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2070,20 +1793,15 @@ static int _wrap_input_callback_state_t_funcargs_set(lua_State* L) { input_callback_state_t *arg1 = (input_callback_state_t *) 0 ; char *arg2 = (char *) 0 ; - SWIG_check_num_args("funcargs",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("funcargs",1,"input_callback_state_t *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("funcargs",2,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){ - SWIG_fail_ptr("input_callback_state_t_funcargs_set",1,SWIGTYPE_p_input_callback_state); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(input_callback_state_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_input_callback_state,0,1,"input_callback_state_t_funcargs_set"); + arg2 = (char*)lua_tostring(L, 2); { if (arg1->funcargs) delete [] arg1->funcargs; if (arg2) { - arg1->funcargs = (char *) (new char[strlen((const char *)arg2)+1]); - strcpy((char *)arg1->funcargs, (const char *)arg2); + arg1->funcargs = (char *) (new char[strlen(arg2)+1]); + strcpy((char *) arg1->funcargs,arg2); } else { arg1->funcargs = 0; } @@ -2092,8 +1810,6 @@ static int _wrap_input_callback_state_t_funcargs_set(lua_State* L) { return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2105,20 +1821,13 @@ static int _wrap_input_callback_state_t_funcargs_get(lua_State* L) { input_callback_state_t *arg1 = (input_callback_state_t *) 0 ; char *result = 0 ; - SWIG_check_num_args("funcargs",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("funcargs",1,"input_callback_state_t *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){ - SWIG_fail_ptr("input_callback_state_t_funcargs_get",1,SWIGTYPE_p_input_callback_state); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(input_callback_state_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_input_callback_state,0,1,"input_callback_state_t_funcargs_get"); result = (char *) ((arg1)->funcargs); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2129,14 +1838,11 @@ static int _wrap_new_input_callback_state_t(lua_State* L) { int SWIG_arg = -1; input_callback_state_t *result = 0 ; - SWIG_check_num_args("input_callback_state_t::input_callback_state_t",0,0) result = (input_callback_state_t *)new input_callback_state_t(); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_input_callback_state,1); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2147,21 +1853,14 @@ static int _wrap_delete_input_callback_state_t(lua_State* L) { int SWIG_arg = -1; input_callback_state_t *arg1 = (input_callback_state_t *) 0 ; - SWIG_check_num_args("input_callback_state_t::~input_callback_state_t",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("input_callback_state_t::~input_callback_state_t",1,"input_callback_state_t *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,SWIG_POINTER_DISOWN))){ - SWIG_fail_ptr("delete_input_callback_state_t",1,SWIGTYPE_p_input_callback_state); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(input_callback_state_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_input_callback_state,0,1,"delete_input_callback_state_t"); delete arg1; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2176,38 +1875,30 @@ static swig_lua_method swig_input_callback_state_t_methods[] = { {0,0} }; static swig_lua_attribute swig_input_callback_state_t_attributes[] = { - { "function", _wrap_input_callback_state_t_function_get, _wrap_input_callback_state_t_function_set}, - { "threadState", _wrap_input_callback_state_t_threadState_get, _wrap_input_callback_state_t_threadState_set}, - { "extra", _wrap_input_callback_state_t_extra_get, _wrap_input_callback_state_t_extra_set}, - { "funcargs", _wrap_input_callback_state_t_funcargs_get, _wrap_input_callback_state_t_funcargs_set}, + { "function",_wrap_input_callback_state_t_function_get, _wrap_input_callback_state_t_function_set}, + { "threadState",_wrap_input_callback_state_t_threadState_get, _wrap_input_callback_state_t_threadState_set}, + { "extra",_wrap_input_callback_state_t_extra_get, _wrap_input_callback_state_t_extra_set}, + { "funcargs",_wrap_input_callback_state_t_funcargs_get, _wrap_input_callback_state_t_funcargs_set}, {0,0,0} }; static swig_lua_class *swig_input_callback_state_t_bases[] = {0}; -static const char *swig_input_callback_state_t_base_names[] = {0}; -static swig_lua_class _wrap_class_input_callback_state_t = { "input_callback_state_t", &SWIGTYPE_p_input_callback_state,_wrap_new_input_callback_state_t, swig_delete_input_callback_state_t, swig_input_callback_state_t_methods, swig_input_callback_state_t_attributes, swig_input_callback_state_t_bases, swig_input_callback_state_t_base_names }; +swig_lua_class _wrap_class_input_callback_state_t = { "input_callback_state_t", &SWIGTYPE_p_input_callback_state,_wrap_new_input_callback_state_t, swig_delete_input_callback_state_t, swig_input_callback_state_t_methods, swig_input_callback_state_t_attributes, swig_input_callback_state_t_bases }; static int _wrap_DTMF_digit_set(lua_State* L) { int SWIG_arg = -1; DTMF *arg1 = (DTMF *) 0 ; char arg2 ; - SWIG_check_num_args("digit",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("digit",1,"DTMF *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("digit",2,"char"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_DTMF,0))){ - SWIG_fail_ptr("DTMF_digit_set",1,SWIGTYPE_p_DTMF); - } - - arg2 = (lua_tostring(L, 2))[0]; + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(DTMF *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_DTMF,0,1,"DTMF_digit_set"); + arg2 = ((char*)lua_tostring(L, 2))[0]; if (arg1) (arg1)->digit = arg2; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2219,20 +1910,13 @@ static int _wrap_DTMF_digit_get(lua_State* L) { DTMF *arg1 = (DTMF *) 0 ; char result; - SWIG_check_num_args("digit",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("digit",1,"DTMF *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_DTMF,0))){ - SWIG_fail_ptr("DTMF_digit_get",1,SWIGTYPE_p_DTMF); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(DTMF *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_DTMF,0,1,"DTMF_digit_get"); result = (char) ((arg1)->digit); SWIG_arg=0; lua_pushfstring(L,"%c",result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2243,30 +1927,21 @@ static int _wrap_DTMF_duration_set(lua_State* L) { int SWIG_arg = -1; DTMF *arg1 = (DTMF *) 0 ; uint32_t arg2 ; - uint32_t *argp2 ; - SWIG_check_num_args("duration",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("duration",1,"DTMF *"); - if(!lua_isuserdata(L,2)) SWIG_fail_arg("duration",2,"uint32_t"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_DTMF,0))){ - SWIG_fail_ptr("DTMF_duration_set",1,SWIGTYPE_p_DTMF); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1=(DTMF *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_DTMF,0,1,"DTMF_duration_set"); + { + uint32_t * argp; + if(SWIG_ConvertPtr(L,2,(void**)(&argp),SWIGTYPE_p_uint32_t,0)) SWIG_fail; + arg2 = *argp; } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_uint32_t,0))){ - SWIG_fail_ptr("DTMF_duration_set",2,SWIGTYPE_p_uint32_t); - } - arg2 = *argp2; - if (arg1) (arg1)->duration = arg2; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2278,23 +1953,17 @@ static int _wrap_DTMF_duration_get(lua_State* L) { DTMF *arg1 = (DTMF *) 0 ; uint32_t result; - SWIG_check_num_args("duration",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("duration",1,"DTMF *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_DTMF,0))){ - SWIG_fail_ptr("DTMF_duration_get",1,SWIGTYPE_p_DTMF); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(DTMF *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_DTMF,0,1,"DTMF_duration_get"); result = ((arg1)->duration); SWIG_arg=0; { - uint32_t * resultptr = new uint32_t((uint32_t &) result); + uint32_t * resultptr; + resultptr = new uint32_t((uint32_t &) result); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_uint32_t,1); SWIG_arg++; } return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2306,25 +1975,22 @@ static int _wrap_new_DTMF(lua_State* L) { char arg1 ; uint32_t arg2 = (uint32_t) SWITCH_DEFAULT_DTMF_DURATION ; DTMF *result = 0 ; - uint32_t *argp2 ; - SWIG_check_num_args("DTMF",1,2) - if(!lua_isstring(L,1)) SWIG_fail_arg("DTMF",1,"char"); - if(lua_gettop(L)>=2 && !lua_isuserdata(L,2)) SWIG_fail_arg("DTMF",2,"uint32_t"); - arg1 = (lua_tostring(L, 1))[0]; + if(!lua_isstring(L,1)) SWIG_fail_arg(1); + if(lua_gettop(L)>=2 && !lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1 = ((char*)lua_tostring(L, 1))[0]; if(lua_gettop(L)>=2){ - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_uint32_t,0))){ - SWIG_fail_ptr("new_DTMF",2,SWIGTYPE_p_uint32_t); + { + uint32_t * argp; + if(SWIG_ConvertPtr(L,2,(void**)(&argp),SWIGTYPE_p_uint32_t,0)) SWIG_fail; + arg2 = *argp; } - arg2 = *argp2; } result = (DTMF *)new DTMF(arg1,arg2); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_DTMF,1); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2335,21 +2001,14 @@ static int _wrap_delete_DTMF(lua_State* L) { int SWIG_arg = -1; DTMF *arg1 = (DTMF *) 0 ; - SWIG_check_num_args("DTMF",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("DTMF",1,"DTMF *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_DTMF,SWIG_POINTER_DISOWN))){ - SWIG_fail_ptr("delete_DTMF",1,SWIGTYPE_p_DTMF); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(DTMF *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_DTMF,0,1,"delete_DTMF"); delete arg1; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2364,26 +2023,22 @@ static swig_lua_method swig_DTMF_methods[] = { {0,0} }; static swig_lua_attribute swig_DTMF_attributes[] = { - { "digit", _wrap_DTMF_digit_get, _wrap_DTMF_digit_set}, - { "duration", _wrap_DTMF_duration_get, _wrap_DTMF_duration_set}, + { "digit",_wrap_DTMF_digit_get, _wrap_DTMF_digit_set}, + { "duration",_wrap_DTMF_duration_get, _wrap_DTMF_duration_set}, {0,0,0} }; static swig_lua_class *swig_DTMF_bases[] = {0}; -static const char *swig_DTMF_base_names[] = {0}; -static swig_lua_class _wrap_class_DTMF = { "DTMF", &SWIGTYPE_p_DTMF,_wrap_new_DTMF, swig_delete_DTMF, swig_DTMF_methods, swig_DTMF_attributes, swig_DTMF_bases, swig_DTMF_base_names }; +swig_lua_class _wrap_class_DTMF = { "DTMF", &SWIGTYPE_p_DTMF,_wrap_new_DTMF, swig_delete_DTMF, swig_DTMF_methods, swig_DTMF_attributes, swig_DTMF_bases }; static int _wrap_new_Stream__SWIG_0(lua_State* L) { int SWIG_arg = -1; Stream *result = 0 ; - SWIG_check_num_args("Stream",0,0) result = (Stream *)new Stream(); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_Stream,1); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2395,20 +2050,13 @@ static int _wrap_new_Stream__SWIG_1(lua_State* L) { switch_stream_handle_t *arg1 = (switch_stream_handle_t *) 0 ; Stream *result = 0 ; - SWIG_check_num_args("Stream",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Stream",1,"switch_stream_handle_t *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_switch_stream_handle_t,0))){ - SWIG_fail_ptr("new_Stream",1,SWIGTYPE_p_switch_stream_handle_t); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(switch_stream_handle_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_switch_stream_handle_t,0,1,"new_Stream"); result = (Stream *)new Stream(arg1); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_Stream,1); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2429,7 +2077,7 @@ static int _wrap_new_Stream(lua_State* L) { int _v; { void *ptr; - if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_switch_stream_handle_t, 0)) { + if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_switch_stream_handle_t, 0)) { _v = 0; } else { _v = 1; @@ -2449,21 +2097,14 @@ static int _wrap_delete_Stream(lua_State* L) { int SWIG_arg = -1; Stream *arg1 = (Stream *) 0 ; - SWIG_check_num_args("Stream",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Stream",1,"Stream *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,SWIG_POINTER_DISOWN))){ - SWIG_fail_ptr("delete_Stream",1,SWIGTYPE_p_Stream); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(Stream *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Stream,0,1,"delete_Stream"); delete arg1; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2475,22 +2116,15 @@ static int _wrap_Stream_write(lua_State* L) { Stream *arg1 = (Stream *) 0 ; char *arg2 = (char *) 0 ; - SWIG_check_num_args("write",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("write",1,"Stream *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("write",2,"char const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){ - SWIG_fail_ptr("Stream_write",1,SWIGTYPE_p_Stream); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(Stream *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Stream,0,1,"Stream_write"); + arg2 = (char*)lua_tostring(L, 2); (arg1)->write((char const *)arg2); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2502,20 +2136,13 @@ static int _wrap_Stream_get_data(lua_State* L) { Stream *arg1 = (Stream *) 0 ; char *result = 0 ; - SWIG_check_num_args("get_data",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("get_data",1,"Stream *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){ - SWIG_fail_ptr("Stream_get_data",1,SWIGTYPE_p_Stream); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(Stream *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Stream,0,1,"Stream_get_data"); result = (char *)(arg1)->get_data(); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2535,35 +2162,23 @@ static swig_lua_attribute swig_Stream_attributes[] = { {0,0,0} }; static swig_lua_class *swig_Stream_bases[] = {0}; -static const char *swig_Stream_base_names[] = {0}; -static swig_lua_class _wrap_class_Stream = { "Stream", &SWIGTYPE_p_Stream,_wrap_new_Stream, swig_delete_Stream, swig_Stream_methods, swig_Stream_attributes, swig_Stream_bases, swig_Stream_base_names }; +swig_lua_class _wrap_class_Stream = { "Stream", &SWIGTYPE_p_Stream,_wrap_new_Stream, swig_delete_Stream, swig_Stream_methods, swig_Stream_attributes, swig_Stream_bases }; static int _wrap_Event_event_set(lua_State* L) { int SWIG_arg = -1; Event *arg1 = (Event *) 0 ; switch_event_t *arg2 = (switch_event_t *) 0 ; - SWIG_check_num_args("event",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("event",1,"Event *"); - if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("event",2,"switch_event_t *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ - SWIG_fail_ptr("Event_event_set",1,SWIGTYPE_p_Event); - } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_switch_event_t,SWIG_POINTER_DISOWN))){ - SWIG_fail_ptr("Event_event_set",2,SWIGTYPE_p_switch_event_t); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_event_set"); + arg2=(switch_event_t *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_switch_event_t,0,2,"Event_event_set"); if (arg1) (arg1)->event = arg2; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2575,20 +2190,13 @@ static int _wrap_Event_event_get(lua_State* L) { Event *arg1 = (Event *) 0 ; switch_event_t *result = 0 ; - SWIG_check_num_args("event",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("event",1,"Event *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ - SWIG_fail_ptr("Event_event_get",1,SWIGTYPE_p_Event); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_event_get"); result = (switch_event_t *) ((arg1)->event); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_switch_event_t,0); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2600,20 +2208,15 @@ static int _wrap_Event_serialized_string_set(lua_State* L) { Event *arg1 = (Event *) 0 ; char *arg2 = (char *) 0 ; - SWIG_check_num_args("serialized_string",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("serialized_string",1,"Event *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("serialized_string",2,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ - SWIG_fail_ptr("Event_serialized_string_set",1,SWIGTYPE_p_Event); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_serialized_string_set"); + arg2 = (char*)lua_tostring(L, 2); { if (arg1->serialized_string) delete [] arg1->serialized_string; if (arg2) { - arg1->serialized_string = (char *) (new char[strlen((const char *)arg2)+1]); - strcpy((char *)arg1->serialized_string, (const char *)arg2); + arg1->serialized_string = (char *) (new char[strlen(arg2)+1]); + strcpy((char *) arg1->serialized_string,arg2); } else { arg1->serialized_string = 0; } @@ -2622,8 +2225,6 @@ static int _wrap_Event_serialized_string_set(lua_State* L) { return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2635,20 +2236,13 @@ static int _wrap_Event_serialized_string_get(lua_State* L) { Event *arg1 = (Event *) 0 ; char *result = 0 ; - SWIG_check_num_args("serialized_string",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("serialized_string",1,"Event *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ - SWIG_fail_ptr("Event_serialized_string_get",1,SWIGTYPE_p_Event); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_serialized_string_get"); result = (char *) ((arg1)->serialized_string); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2660,14 +2254,9 @@ static int _wrap_Event_mine_set(lua_State* L) { Event *arg1 = (Event *) 0 ; int arg2 ; - SWIG_check_num_args("mine",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("mine",1,"Event *"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("mine",2,"int"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ - SWIG_fail_ptr("Event_mine_set",1,SWIGTYPE_p_Event); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isnumber(L,2)) SWIG_fail_arg(2); + arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_mine_set"); arg2 = (int)lua_tonumber(L, 2); if (arg1) (arg1)->mine = arg2; @@ -2675,8 +2264,6 @@ static int _wrap_Event_mine_set(lua_State* L) { return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2688,20 +2275,13 @@ static int _wrap_Event_mine_get(lua_State* L) { Event *arg1 = (Event *) 0 ; int result; - SWIG_check_num_args("mine",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("mine",1,"Event *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ - SWIG_fail_ptr("Event_mine_get",1,SWIGTYPE_p_Event); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_mine_get"); result = (int) ((arg1)->mine); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2714,20 +2294,17 @@ static int _wrap_new_Event__SWIG_0(lua_State* L) { char *arg2 = (char *) NULL ; Event *result = 0 ; - SWIG_check_num_args("Event",1,2) - if(!lua_isstring(L,1)) SWIG_fail_arg("Event",1,"char const *"); - if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("Event",2,"char const *"); - arg1 = (char *)lua_tostring(L, 1); + if(!lua_isstring(L,1)) SWIG_fail_arg(1); + if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg(2); + arg1 = (char*)lua_tostring(L, 1); if(lua_gettop(L)>=2){ - arg2 = (char *)lua_tostring(L, 2); + arg2 = (char*)lua_tostring(L, 2); } result = (Event *)new Event((char const *)arg1,(char const *)arg2); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_Event,1); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2740,14 +2317,9 @@ static int _wrap_new_Event__SWIG_1(lua_State* L) { int arg2 = (int) 0 ; Event *result = 0 ; - SWIG_check_num_args("Event",1,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event",1,"switch_event_t *"); - if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("Event",2,"int"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_switch_event_t,0))){ - SWIG_fail_ptr("new_Event",1,SWIGTYPE_p_switch_event_t); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg(2); + arg1=(switch_event_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_switch_event_t,0,1,"new_Event"); if(lua_gettop(L)>=2){ arg2 = (int)lua_tonumber(L, 2); } @@ -2756,8 +2328,6 @@ static int _wrap_new_Event__SWIG_1(lua_State* L) { SWIG_NewPointerObj(L,result,SWIGTYPE_p_Event,1); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2775,7 +2345,7 @@ static int _wrap_new_Event(lua_State* L) { int _v; { void *ptr; - if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_switch_event_t, 0)) { + if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_switch_event_t, 0)) { _v = 0; } else { _v = 1; @@ -2820,21 +2390,14 @@ static int _wrap_delete_Event(lua_State* L) { int SWIG_arg = -1; Event *arg1 = (Event *) 0 ; - SWIG_check_num_args("Event",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event",1,"Event *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,SWIG_POINTER_DISOWN))){ - SWIG_fail_ptr("delete_Event",1,SWIGTYPE_p_Event); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"delete_Event"); delete arg1; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2847,24 +2410,17 @@ static int _wrap_Event_serialize(lua_State* L) { char *arg2 = (char *) NULL ; char *result = 0 ; - SWIG_check_num_args("serialize",1,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("serialize",1,"Event *"); - if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("serialize",2,"char const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ - SWIG_fail_ptr("Event_serialize",1,SWIGTYPE_p_Event); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_serialize"); if(lua_gettop(L)>=2){ - arg2 = (char *)lua_tostring(L, 2); + arg2 = (char*)lua_tostring(L, 2); } result = (char *)(arg1)->serialize((char const *)arg2); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2876,29 +2432,22 @@ static int _wrap_Event_setPriority(lua_State* L) { Event *arg1 = (Event *) 0 ; switch_priority_t arg2 = (switch_priority_t) SWITCH_PRIORITY_NORMAL ; bool result; - switch_priority_t *argp2 ; - - SWIG_check_num_args("setPriority",1,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setPriority",1,"Event *"); - if(lua_gettop(L)>=2 && !lua_isuserdata(L,2)) SWIG_fail_arg("setPriority",2,"switch_priority_t"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ - SWIG_fail_ptr("Event_setPriority",1,SWIGTYPE_p_Event); - } + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(lua_gettop(L)>=2 && !lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_setPriority"); if(lua_gettop(L)>=2){ - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_switch_priority_t,0))){ - SWIG_fail_ptr("Event_setPriority",2,SWIGTYPE_p_switch_priority_t); + { + switch_priority_t * argp; + if(SWIG_ConvertPtr(L,2,(void**)(&argp),SWIGTYPE_p_switch_priority_t,0)) SWIG_fail; + arg2 = *argp; } - arg2 = *argp2; } result = (bool)(arg1)->setPriority(arg2); SWIG_arg=0; - lua_pushboolean(L,(int)(result==true)); SWIG_arg++; + lua_pushboolean(L,(int)result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2911,22 +2460,15 @@ static int _wrap_Event_getHeader(lua_State* L) { char *arg2 = (char *) 0 ; char *result = 0 ; - SWIG_check_num_args("getHeader",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getHeader",1,"Event *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("getHeader",2,"char const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ - SWIG_fail_ptr("Event_getHeader",1,SWIGTYPE_p_Event); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_getHeader"); + arg2 = (char*)lua_tostring(L, 2); result = (char *)(arg1)->getHeader((char const *)arg2); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2938,20 +2480,13 @@ static int _wrap_Event_getBody(lua_State* L) { Event *arg1 = (Event *) 0 ; char *result = 0 ; - SWIG_check_num_args("getBody",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getBody",1,"Event *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ - SWIG_fail_ptr("Event_getBody",1,SWIGTYPE_p_Event); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_getBody"); result = (char *)(arg1)->getBody(); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2963,20 +2498,13 @@ static int _wrap_Event_getType(lua_State* L) { Event *arg1 = (Event *) 0 ; char *result = 0 ; - SWIG_check_num_args("getType",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getType",1,"Event *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ - SWIG_fail_ptr("Event_getType",1,SWIGTYPE_p_Event); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_getType"); result = (char *)(arg1)->getType(); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -2989,22 +2517,15 @@ static int _wrap_Event_addBody(lua_State* L) { char *arg2 = (char *) 0 ; bool result; - SWIG_check_num_args("addBody",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("addBody",1,"Event *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("addBody",2,"char const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ - SWIG_fail_ptr("Event_addBody",1,SWIGTYPE_p_Event); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_addBody"); + arg2 = (char*)lua_tostring(L, 2); result = (bool)(arg1)->addBody((char const *)arg2); SWIG_arg=0; - lua_pushboolean(L,(int)(result==true)); SWIG_arg++; + lua_pushboolean(L,(int)result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3018,24 +2539,17 @@ static int _wrap_Event_addHeader(lua_State* L) { char *arg3 = (char *) 0 ; bool result; - SWIG_check_num_args("addHeader",3,3) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("addHeader",1,"Event *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("addHeader",2,"char const *"); - if(!lua_isstring(L,3)) SWIG_fail_arg("addHeader",3,"char const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ - SWIG_fail_ptr("Event_addHeader",1,SWIGTYPE_p_Event); - } - - arg2 = (char *)lua_tostring(L, 2); - arg3 = (char *)lua_tostring(L, 3); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + if(!lua_isstring(L,3)) SWIG_fail_arg(3); + arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_addHeader"); + arg2 = (char*)lua_tostring(L, 2); + arg3 = (char*)lua_tostring(L, 3); result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3); SWIG_arg=0; - lua_pushboolean(L,(int)(result==true)); SWIG_arg++; + lua_pushboolean(L,(int)result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3048,22 +2562,15 @@ static int _wrap_Event_delHeader(lua_State* L) { char *arg2 = (char *) 0 ; bool result; - SWIG_check_num_args("delHeader",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("delHeader",1,"Event *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("delHeader",2,"char const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ - SWIG_fail_ptr("Event_delHeader",1,SWIGTYPE_p_Event); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_delHeader"); + arg2 = (char*)lua_tostring(L, 2); result = (bool)(arg1)->delHeader((char const *)arg2); SWIG_arg=0; - lua_pushboolean(L,(int)(result==true)); SWIG_arg++; + lua_pushboolean(L,(int)result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3075,20 +2582,13 @@ static int _wrap_Event_fire(lua_State* L) { Event *arg1 = (Event *) 0 ; bool result; - SWIG_check_num_args("fire",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("fire",1,"Event *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ - SWIG_fail_ptr("Event_fire",1,SWIGTYPE_p_Event); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_fire"); result = (bool)(arg1)->fire(); SWIG_arg=0; - lua_pushboolean(L,(int)(result==true)); SWIG_arg++; + lua_pushboolean(L,(int)result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3112,41 +2612,29 @@ static swig_lua_method swig_Event_methods[] = { {0,0} }; static swig_lua_attribute swig_Event_attributes[] = { - { "event", _wrap_Event_event_get, _wrap_Event_event_set}, - { "serialized_string", _wrap_Event_serialized_string_get, _wrap_Event_serialized_string_set}, - { "mine", _wrap_Event_mine_get, _wrap_Event_mine_set}, + { "event",_wrap_Event_event_get, _wrap_Event_event_set}, + { "serialized_string",_wrap_Event_serialized_string_get, _wrap_Event_serialized_string_set}, + { "mine",_wrap_Event_mine_get, _wrap_Event_mine_set}, {0,0,0} }; static swig_lua_class *swig_Event_bases[] = {0}; -static const char *swig_Event_base_names[] = {0}; -static swig_lua_class _wrap_class_Event = { "Event", &SWIGTYPE_p_Event,_wrap_new_Event, swig_delete_Event, swig_Event_methods, swig_Event_attributes, swig_Event_bases, swig_Event_base_names }; +swig_lua_class _wrap_class_Event = { "Event", &SWIGTYPE_p_Event,_wrap_new_Event, swig_delete_Event, swig_Event_methods, swig_Event_attributes, swig_Event_bases }; static int _wrap_EventConsumer_events_set(lua_State* L) { int SWIG_arg = -1; EventConsumer *arg1 = (EventConsumer *) 0 ; switch_queue_t *arg2 = (switch_queue_t *) 0 ; - SWIG_check_num_args("events",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("events",1,"EventConsumer *"); - if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("events",2,"switch_queue_t *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ - SWIG_fail_ptr("EventConsumer_events_set",1,SWIGTYPE_p_EventConsumer); - } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_switch_queue_t,SWIG_POINTER_DISOWN))){ - SWIG_fail_ptr("EventConsumer_events_set",2,SWIGTYPE_p_switch_queue_t); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_events_set"); + arg2=(switch_queue_t *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_switch_queue_t,0,2,"EventConsumer_events_set"); if (arg1) (arg1)->events = arg2; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3158,20 +2646,13 @@ static int _wrap_EventConsumer_events_get(lua_State* L) { EventConsumer *arg1 = (EventConsumer *) 0 ; switch_queue_t *result = 0 ; - SWIG_check_num_args("events",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("events",1,"EventConsumer *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ - SWIG_fail_ptr("EventConsumer_events_get",1,SWIGTYPE_p_EventConsumer); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_events_get"); result = (switch_queue_t *) ((arg1)->events); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_switch_queue_t,0); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3182,30 +2663,21 @@ static int _wrap_EventConsumer_e_event_id_set(lua_State* L) { int SWIG_arg = -1; EventConsumer *arg1 = (EventConsumer *) 0 ; switch_event_types_t arg2 ; - switch_event_types_t *argp2 ; - SWIG_check_num_args("e_event_id",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_event_id",1,"EventConsumer *"); - if(!lua_isuserdata(L,2)) SWIG_fail_arg("e_event_id",2,"switch_event_types_t"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ - SWIG_fail_ptr("EventConsumer_e_event_id_set",1,SWIGTYPE_p_EventConsumer); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_e_event_id_set"); + { + switch_event_types_t * argp; + if(SWIG_ConvertPtr(L,2,(void**)(&argp),SWIGTYPE_p_switch_event_types_t,0)) SWIG_fail; + arg2 = *argp; } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_switch_event_types_t,0))){ - SWIG_fail_ptr("EventConsumer_e_event_id_set",2,SWIGTYPE_p_switch_event_types_t); - } - arg2 = *argp2; - if (arg1) (arg1)->e_event_id = arg2; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3217,23 +2689,17 @@ static int _wrap_EventConsumer_e_event_id_get(lua_State* L) { EventConsumer *arg1 = (EventConsumer *) 0 ; switch_event_types_t result; - SWIG_check_num_args("e_event_id",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_event_id",1,"EventConsumer *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ - SWIG_fail_ptr("EventConsumer_e_event_id_get",1,SWIGTYPE_p_EventConsumer); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_e_event_id_get"); result = ((arg1)->e_event_id); SWIG_arg=0; { - switch_event_types_t * resultptr = new switch_event_types_t((switch_event_types_t &) result); + switch_event_types_t * resultptr; + resultptr = new switch_event_types_t((switch_event_types_t &) result); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_event_types_t,1); SWIG_arg++; } return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3245,20 +2711,15 @@ static int _wrap_EventConsumer_e_callback_set(lua_State* L) { EventConsumer *arg1 = (EventConsumer *) 0 ; char *arg2 = (char *) 0 ; - SWIG_check_num_args("e_callback",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_callback",1,"EventConsumer *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("e_callback",2,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ - SWIG_fail_ptr("EventConsumer_e_callback_set",1,SWIGTYPE_p_EventConsumer); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_e_callback_set"); + arg2 = (char*)lua_tostring(L, 2); { if (arg1->e_callback) delete [] arg1->e_callback; if (arg2) { - arg1->e_callback = (char *) (new char[strlen((const char *)arg2)+1]); - strcpy((char *)arg1->e_callback, (const char *)arg2); + arg1->e_callback = (char *) (new char[strlen(arg2)+1]); + strcpy((char *) arg1->e_callback,arg2); } else { arg1->e_callback = 0; } @@ -3267,8 +2728,6 @@ static int _wrap_EventConsumer_e_callback_set(lua_State* L) { return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3280,20 +2739,13 @@ static int _wrap_EventConsumer_e_callback_get(lua_State* L) { EventConsumer *arg1 = (EventConsumer *) 0 ; char *result = 0 ; - SWIG_check_num_args("e_callback",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_callback",1,"EventConsumer *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ - SWIG_fail_ptr("EventConsumer_e_callback_get",1,SWIGTYPE_p_EventConsumer); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_e_callback_get"); result = (char *) ((arg1)->e_callback); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3305,20 +2757,15 @@ static int _wrap_EventConsumer_e_subclass_name_set(lua_State* L) { EventConsumer *arg1 = (EventConsumer *) 0 ; char *arg2 = (char *) 0 ; - SWIG_check_num_args("e_subclass_name",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_subclass_name",1,"EventConsumer *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("e_subclass_name",2,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ - SWIG_fail_ptr("EventConsumer_e_subclass_name_set",1,SWIGTYPE_p_EventConsumer); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_e_subclass_name_set"); + arg2 = (char*)lua_tostring(L, 2); { if (arg1->e_subclass_name) delete [] arg1->e_subclass_name; if (arg2) { - arg1->e_subclass_name = (char *) (new char[strlen((const char *)arg2)+1]); - strcpy((char *)arg1->e_subclass_name, (const char *)arg2); + arg1->e_subclass_name = (char *) (new char[strlen(arg2)+1]); + strcpy((char *) arg1->e_subclass_name,arg2); } else { arg1->e_subclass_name = 0; } @@ -3327,8 +2774,6 @@ static int _wrap_EventConsumer_e_subclass_name_set(lua_State* L) { return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3340,20 +2785,13 @@ static int _wrap_EventConsumer_e_subclass_name_get(lua_State* L) { EventConsumer *arg1 = (EventConsumer *) 0 ; char *result = 0 ; - SWIG_check_num_args("e_subclass_name",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_subclass_name",1,"EventConsumer *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ - SWIG_fail_ptr("EventConsumer_e_subclass_name_get",1,SWIGTYPE_p_EventConsumer); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_e_subclass_name_get"); result = (char *) ((arg1)->e_subclass_name); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3365,20 +2803,15 @@ static int _wrap_EventConsumer_e_cb_arg_set(lua_State* L) { EventConsumer *arg1 = (EventConsumer *) 0 ; char *arg2 = (char *) 0 ; - SWIG_check_num_args("e_cb_arg",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_cb_arg",1,"EventConsumer *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("e_cb_arg",2,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ - SWIG_fail_ptr("EventConsumer_e_cb_arg_set",1,SWIGTYPE_p_EventConsumer); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_e_cb_arg_set"); + arg2 = (char*)lua_tostring(L, 2); { if (arg1->e_cb_arg) delete [] arg1->e_cb_arg; if (arg2) { - arg1->e_cb_arg = (char *) (new char[strlen((const char *)arg2)+1]); - strcpy((char *)arg1->e_cb_arg, (const char *)arg2); + arg1->e_cb_arg = (char *) (new char[strlen(arg2)+1]); + strcpy((char *) arg1->e_cb_arg,arg2); } else { arg1->e_cb_arg = 0; } @@ -3387,8 +2820,6 @@ static int _wrap_EventConsumer_e_cb_arg_set(lua_State* L) { return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3400,20 +2831,13 @@ static int _wrap_EventConsumer_e_cb_arg_get(lua_State* L) { EventConsumer *arg1 = (EventConsumer *) 0 ; char *result = 0 ; - SWIG_check_num_args("e_cb_arg",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_cb_arg",1,"EventConsumer *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ - SWIG_fail_ptr("EventConsumer_e_cb_arg_get",1,SWIGTYPE_p_EventConsumer); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_e_cb_arg_get"); result = (char *) ((arg1)->e_cb_arg); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3425,19 +2849,10 @@ static int _wrap_EventConsumer_enodes_set(lua_State* L) { EventConsumer *arg1 = (EventConsumer *) 0 ; switch_event_node_t **arg2 ; - SWIG_check_num_args("enodes",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("enodes",1,"EventConsumer *"); - if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("enodes",2,"switch_event_node_t *[SWITCH_EVENT_ALL+1]"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ - SWIG_fail_ptr("EventConsumer_enodes_set",1,SWIGTYPE_p_EventConsumer); - } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_p_switch_event_node_t,0))){ - SWIG_fail_ptr("EventConsumer_enodes_set",2,SWIGTYPE_p_p_switch_event_node_t); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_enodes_set"); + arg2=(switch_event_node_t **)SWIG_MustGetPtr(L,2,SWIGTYPE_p_p_switch_event_node_t,0,2,"EventConsumer_enodes_set"); { size_t ii; switch_event_node_t * *b = (switch_event_node_t * *) arg1->enodes; @@ -3447,8 +2862,6 @@ static int _wrap_EventConsumer_enodes_set(lua_State* L) { return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3460,20 +2873,13 @@ static int _wrap_EventConsumer_enodes_get(lua_State* L) { EventConsumer *arg1 = (EventConsumer *) 0 ; switch_event_node_t **result = 0 ; - SWIG_check_num_args("enodes",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("enodes",1,"EventConsumer *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ - SWIG_fail_ptr("EventConsumer_enodes_get",1,SWIGTYPE_p_EventConsumer); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_enodes_get"); result = (switch_event_node_t **)(switch_event_node_t **) ((arg1)->enodes); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_p_switch_event_node_t,0); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3484,30 +2890,21 @@ static int _wrap_EventConsumer_node_index_set(lua_State* L) { int SWIG_arg = -1; EventConsumer *arg1 = (EventConsumer *) 0 ; uint32_t arg2 ; - uint32_t *argp2 ; - SWIG_check_num_args("node_index",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("node_index",1,"EventConsumer *"); - if(!lua_isuserdata(L,2)) SWIG_fail_arg("node_index",2,"uint32_t"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ - SWIG_fail_ptr("EventConsumer_node_index_set",1,SWIGTYPE_p_EventConsumer); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_node_index_set"); + { + uint32_t * argp; + if(SWIG_ConvertPtr(L,2,(void**)(&argp),SWIGTYPE_p_uint32_t,0)) SWIG_fail; + arg2 = *argp; } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_uint32_t,0))){ - SWIG_fail_ptr("EventConsumer_node_index_set",2,SWIGTYPE_p_uint32_t); - } - arg2 = *argp2; - if (arg1) (arg1)->node_index = arg2; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3519,23 +2916,17 @@ static int _wrap_EventConsumer_node_index_get(lua_State* L) { EventConsumer *arg1 = (EventConsumer *) 0 ; uint32_t result; - SWIG_check_num_args("node_index",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("node_index",1,"EventConsumer *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ - SWIG_fail_ptr("EventConsumer_node_index_get",1,SWIGTYPE_p_EventConsumer); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_node_index_get"); result = ((arg1)->node_index); SWIG_arg=0; { - uint32_t * resultptr = new uint32_t((uint32_t &) result); + uint32_t * resultptr; + resultptr = new uint32_t((uint32_t &) result); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_uint32_t,1); SWIG_arg++; } return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3548,22 +2939,19 @@ static int _wrap_new_EventConsumer(lua_State* L) { char *arg2 = (char *) "" ; EventConsumer *result = 0 ; - SWIG_check_num_args("EventConsumer",0,2) - if(lua_gettop(L)>=1 && !lua_isstring(L,1)) SWIG_fail_arg("EventConsumer",1,"char const *"); - if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("EventConsumer",2,"char const *"); + if(lua_gettop(L)>=1 && !lua_isstring(L,1)) SWIG_fail_arg(1); + if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg(2); if(lua_gettop(L)>=1){ - arg1 = (char *)lua_tostring(L, 1); + arg1 = (char*)lua_tostring(L, 1); } if(lua_gettop(L)>=2){ - arg2 = (char *)lua_tostring(L, 2); + arg2 = (char*)lua_tostring(L, 2); } result = (EventConsumer *)new EventConsumer((char const *)arg1,(char const *)arg2); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_EventConsumer,1); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3574,21 +2962,14 @@ static int _wrap_delete_EventConsumer(lua_State* L) { int SWIG_arg = -1; EventConsumer *arg1 = (EventConsumer *) 0 ; - SWIG_check_num_args("EventConsumer",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer",1,"EventConsumer *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,SWIG_POINTER_DISOWN))){ - SWIG_fail_ptr("delete_EventConsumer",1,SWIGTYPE_p_EventConsumer); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"delete_EventConsumer"); delete arg1; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3602,26 +2983,19 @@ static int _wrap_EventConsumer_bind(lua_State* L) { char *arg3 = (char *) "" ; int result; - SWIG_check_num_args("bind",2,3) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("bind",1,"EventConsumer *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("bind",2,"char const *"); - if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("bind",3,"char const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ - SWIG_fail_ptr("EventConsumer_bind",1,SWIGTYPE_p_EventConsumer); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg(3); + arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_bind"); + arg2 = (char*)lua_tostring(L, 2); if(lua_gettop(L)>=3){ - arg3 = (char *)lua_tostring(L, 3); + arg3 = (char*)lua_tostring(L, 3); } result = (int)(arg1)->bind((char const *)arg2,(char const *)arg3); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3634,14 +3008,9 @@ static int _wrap_EventConsumer_pop(lua_State* L) { int arg2 = (int) 0 ; Event *result = 0 ; - SWIG_check_num_args("pop",1,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("pop",1,"EventConsumer *"); - if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("pop",2,"int"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ - SWIG_fail_ptr("EventConsumer_pop",1,SWIGTYPE_p_EventConsumer); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg(2); + arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_pop"); if(lua_gettop(L)>=2){ arg2 = (int)lua_tonumber(L, 2); } @@ -3650,8 +3019,6 @@ static int _wrap_EventConsumer_pop(lua_State* L) { SWIG_NewPointerObj(L,result,SWIGTYPE_p_Event,1); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3668,38 +3035,30 @@ static swig_lua_method swig_EventConsumer_methods[] = { {0,0} }; static swig_lua_attribute swig_EventConsumer_attributes[] = { - { "events", _wrap_EventConsumer_events_get, _wrap_EventConsumer_events_set}, - { "e_event_id", _wrap_EventConsumer_e_event_id_get, _wrap_EventConsumer_e_event_id_set}, - { "e_callback", _wrap_EventConsumer_e_callback_get, _wrap_EventConsumer_e_callback_set}, - { "e_subclass_name", _wrap_EventConsumer_e_subclass_name_get, _wrap_EventConsumer_e_subclass_name_set}, - { "e_cb_arg", _wrap_EventConsumer_e_cb_arg_get, _wrap_EventConsumer_e_cb_arg_set}, - { "enodes", _wrap_EventConsumer_enodes_get, _wrap_EventConsumer_enodes_set}, - { "node_index", _wrap_EventConsumer_node_index_get, _wrap_EventConsumer_node_index_set}, + { "events",_wrap_EventConsumer_events_get, _wrap_EventConsumer_events_set}, + { "e_event_id",_wrap_EventConsumer_e_event_id_get, _wrap_EventConsumer_e_event_id_set}, + { "e_callback",_wrap_EventConsumer_e_callback_get, _wrap_EventConsumer_e_callback_set}, + { "e_subclass_name",_wrap_EventConsumer_e_subclass_name_get, _wrap_EventConsumer_e_subclass_name_set}, + { "e_cb_arg",_wrap_EventConsumer_e_cb_arg_get, _wrap_EventConsumer_e_cb_arg_set}, + { "enodes",_wrap_EventConsumer_enodes_get, _wrap_EventConsumer_enodes_set}, + { "node_index",_wrap_EventConsumer_node_index_get, _wrap_EventConsumer_node_index_set}, {0,0,0} }; static swig_lua_class *swig_EventConsumer_bases[] = {0}; -static const char *swig_EventConsumer_base_names[] = {0}; -static swig_lua_class _wrap_class_EventConsumer = { "EventConsumer", &SWIGTYPE_p_EventConsumer,_wrap_new_EventConsumer, swig_delete_EventConsumer, swig_EventConsumer_methods, swig_EventConsumer_attributes, swig_EventConsumer_bases, swig_EventConsumer_base_names }; +swig_lua_class _wrap_class_EventConsumer = { "EventConsumer", &SWIGTYPE_p_EventConsumer,_wrap_new_EventConsumer, swig_delete_EventConsumer, swig_EventConsumer_methods, swig_EventConsumer_attributes, swig_EventConsumer_bases }; static int _wrap_delete_CoreSession(lua_State* L) { int SWIG_arg = -1; CoreSession *arg1 = (CoreSession *) 0 ; - SWIG_check_num_args("CoreSession",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,SWIG_POINTER_DISOWN))){ - SWIG_fail_ptr("delete_CoreSession",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"delete_CoreSession"); delete arg1; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3711,27 +3070,16 @@ static int _wrap_CoreSession_session_set(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; switch_core_session_t *arg2 = (switch_core_session_t *) 0 ; - SWIG_check_num_args("session",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("session",1,"CoreSession *"); - if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("session",2,"switch_core_session_t *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_session_set",1,SWIGTYPE_p_CoreSession); - } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_switch_core_session_t,SWIG_POINTER_DISOWN))){ - SWIG_fail_ptr("CoreSession_session_set",2,SWIGTYPE_p_switch_core_session_t); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_session_set"); + arg2=(switch_core_session_t *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_switch_core_session_t,0,2,"CoreSession_session_set"); if (arg1) (arg1)->session = arg2; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3743,20 +3091,13 @@ static int _wrap_CoreSession_session_get(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; switch_core_session_t *result = 0 ; - SWIG_check_num_args("session",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("session",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_session_get",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_session_get"); result = (switch_core_session_t *) ((arg1)->session); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_switch_core_session_t,0); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3768,27 +3109,16 @@ static int _wrap_CoreSession_channel_set(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; switch_channel_t *arg2 = (switch_channel_t *) 0 ; - SWIG_check_num_args("channel",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("channel",1,"CoreSession *"); - if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("channel",2,"switch_channel_t *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_channel_set",1,SWIGTYPE_p_CoreSession); - } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_switch_channel_t,SWIG_POINTER_DISOWN))){ - SWIG_fail_ptr("CoreSession_channel_set",2,SWIGTYPE_p_switch_channel_t); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_channel_set"); + arg2=(switch_channel_t *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_switch_channel_t,0,2,"CoreSession_channel_set"); if (arg1) (arg1)->channel = arg2; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3800,20 +3130,13 @@ static int _wrap_CoreSession_channel_get(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; switch_channel_t *result = 0 ; - SWIG_check_num_args("channel",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("channel",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_channel_get",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_channel_get"); result = (switch_channel_t *) ((arg1)->channel); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_switch_channel_t,0); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3825,14 +3148,9 @@ static int _wrap_CoreSession_flags_set(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; unsigned int arg2 ; - SWIG_check_num_args("flags",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("flags",1,"CoreSession *"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("flags",2,"unsigned int"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_flags_set",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isnumber(L,2)) SWIG_fail_arg(2); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_flags_set"); arg2 = (unsigned int)lua_tonumber(L, 2); if (arg1) (arg1)->flags = arg2; @@ -3840,8 +3158,6 @@ static int _wrap_CoreSession_flags_set(lua_State* L) { return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3853,20 +3169,13 @@ static int _wrap_CoreSession_flags_get(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; unsigned int result; - SWIG_check_num_args("flags",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("flags",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_flags_get",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_flags_get"); result = (unsigned int) ((arg1)->flags); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3878,14 +3187,9 @@ static int _wrap_CoreSession_allocated_set(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; int arg2 ; - SWIG_check_num_args("allocated",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("allocated",1,"CoreSession *"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("allocated",2,"int"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_allocated_set",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isnumber(L,2)) SWIG_fail_arg(2); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_allocated_set"); arg2 = (int)lua_tonumber(L, 2); if (arg1) (arg1)->allocated = arg2; @@ -3893,8 +3197,6 @@ static int _wrap_CoreSession_allocated_set(lua_State* L) { return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3906,20 +3208,13 @@ static int _wrap_CoreSession_allocated_get(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; int result; - SWIG_check_num_args("allocated",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("allocated",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_allocated_get",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_allocated_get"); result = (int) ((arg1)->allocated); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3931,27 +3226,16 @@ static int _wrap_CoreSession_cb_state_set(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; input_callback_state *arg2 = (input_callback_state *) 0 ; - SWIG_check_num_args("cb_state",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_state",1,"CoreSession *"); - if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("cb_state",2,"input_callback_state *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_cb_state_set",1,SWIGTYPE_p_CoreSession); - } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_input_callback_state,0))){ - SWIG_fail_ptr("CoreSession_cb_state_set",2,SWIGTYPE_p_input_callback_state); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_cb_state_set"); + arg2=(input_callback_state *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_input_callback_state,0,2,"CoreSession_cb_state_set"); if (arg1) (arg1)->cb_state = *arg2; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3963,20 +3247,13 @@ static int _wrap_CoreSession_cb_state_get(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; input_callback_state *result = 0 ; - SWIG_check_num_args("cb_state",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_state",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_cb_state_get",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_cb_state_get"); result = (input_callback_state *)& ((arg1)->cb_state); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_input_callback_state,0); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -3987,30 +3264,21 @@ static int _wrap_CoreSession_hook_state_set(lua_State* L) { int SWIG_arg = -1; CoreSession *arg1 = (CoreSession *) 0 ; switch_channel_state_t arg2 ; - switch_channel_state_t *argp2 ; - SWIG_check_num_args("hook_state",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hook_state",1,"CoreSession *"); - if(!lua_isuserdata(L,2)) SWIG_fail_arg("hook_state",2,"switch_channel_state_t"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_hook_state_set",1,SWIGTYPE_p_CoreSession); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_hook_state_set"); + { + switch_channel_state_t * argp; + if(SWIG_ConvertPtr(L,2,(void**)(&argp),SWIGTYPE_p_switch_channel_state_t,0)) SWIG_fail; + arg2 = *argp; } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_switch_channel_state_t,0))){ - SWIG_fail_ptr("CoreSession_hook_state_set",2,SWIGTYPE_p_switch_channel_state_t); - } - arg2 = *argp2; - if (arg1) (arg1)->hook_state = arg2; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4022,23 +3290,17 @@ static int _wrap_CoreSession_hook_state_get(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; switch_channel_state_t result; - SWIG_check_num_args("hook_state",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hook_state",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_hook_state_get",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_hook_state_get"); result = ((arg1)->hook_state); SWIG_arg=0; { - switch_channel_state_t * resultptr = new switch_channel_state_t((switch_channel_state_t &) result); + switch_channel_state_t * resultptr; + resultptr = new switch_channel_state_t((switch_channel_state_t &) result); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_channel_state_t,1); SWIG_arg++; } return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4049,30 +3311,21 @@ static int _wrap_CoreSession_cause_set(lua_State* L) { int SWIG_arg = -1; CoreSession *arg1 = (CoreSession *) 0 ; switch_call_cause_t arg2 ; - switch_call_cause_t *argp2 ; - SWIG_check_num_args("cause",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cause",1,"CoreSession *"); - if(!lua_isuserdata(L,2)) SWIG_fail_arg("cause",2,"switch_call_cause_t"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_cause_set",1,SWIGTYPE_p_CoreSession); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_cause_set"); + { + switch_call_cause_t * argp; + if(SWIG_ConvertPtr(L,2,(void**)(&argp),SWIGTYPE_p_switch_call_cause_t,0)) SWIG_fail; + arg2 = *argp; } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_switch_call_cause_t,0))){ - SWIG_fail_ptr("CoreSession_cause_set",2,SWIGTYPE_p_switch_call_cause_t); - } - arg2 = *argp2; - if (arg1) (arg1)->cause = arg2; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4084,23 +3337,17 @@ static int _wrap_CoreSession_cause_get(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; switch_call_cause_t result; - SWIG_check_num_args("cause",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cause",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_cause_get",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_cause_get"); result = ((arg1)->cause); SWIG_arg=0; { - switch_call_cause_t * resultptr = new switch_call_cause_t((switch_call_cause_t &) result); + switch_call_cause_t * resultptr; + resultptr = new switch_call_cause_t((switch_call_cause_t &) result); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_call_cause_t,1); SWIG_arg++; } return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4112,20 +3359,15 @@ static int _wrap_CoreSession_uuid_set(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; char *arg2 = (char *) 0 ; - SWIG_check_num_args("uuid",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uuid",1,"CoreSession *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("uuid",2,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_uuid_set",1,SWIGTYPE_p_CoreSession); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_uuid_set"); + arg2 = (char*)lua_tostring(L, 2); { if (arg1->uuid) delete [] arg1->uuid; if (arg2) { - arg1->uuid = (char *) (new char[strlen((const char *)arg2)+1]); - strcpy((char *)arg1->uuid, (const char *)arg2); + arg1->uuid = (char *) (new char[strlen(arg2)+1]); + strcpy((char *) arg1->uuid,arg2); } else { arg1->uuid = 0; } @@ -4134,8 +3376,6 @@ static int _wrap_CoreSession_uuid_set(lua_State* L) { return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4147,20 +3387,13 @@ static int _wrap_CoreSession_uuid_get(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; char *result = 0 ; - SWIG_check_num_args("uuid",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uuid",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_uuid_get",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_uuid_get"); result = (char *) ((arg1)->uuid); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4172,20 +3405,15 @@ static int _wrap_CoreSession_tts_name_set(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; char *arg2 = (char *) 0 ; - SWIG_check_num_args("tts_name",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("tts_name",1,"CoreSession *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("tts_name",2,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_tts_name_set",1,SWIGTYPE_p_CoreSession); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_tts_name_set"); + arg2 = (char*)lua_tostring(L, 2); { if (arg1->tts_name) delete [] arg1->tts_name; if (arg2) { - arg1->tts_name = (char *) (new char[strlen((const char *)arg2)+1]); - strcpy((char *)arg1->tts_name, (const char *)arg2); + arg1->tts_name = (char *) (new char[strlen(arg2)+1]); + strcpy((char *) arg1->tts_name,arg2); } else { arg1->tts_name = 0; } @@ -4194,8 +3422,6 @@ static int _wrap_CoreSession_tts_name_set(lua_State* L) { return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4207,20 +3433,13 @@ static int _wrap_CoreSession_tts_name_get(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; char *result = 0 ; - SWIG_check_num_args("tts_name",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("tts_name",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_tts_name_get",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_tts_name_get"); result = (char *) ((arg1)->tts_name); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4232,20 +3451,15 @@ static int _wrap_CoreSession_voice_name_set(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; char *arg2 = (char *) 0 ; - SWIG_check_num_args("voice_name",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("voice_name",1,"CoreSession *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("voice_name",2,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_voice_name_set",1,SWIGTYPE_p_CoreSession); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_voice_name_set"); + arg2 = (char*)lua_tostring(L, 2); { if (arg1->voice_name) delete [] arg1->voice_name; if (arg2) { - arg1->voice_name = (char *) (new char[strlen((const char *)arg2)+1]); - strcpy((char *)arg1->voice_name, (const char *)arg2); + arg1->voice_name = (char *) (new char[strlen(arg2)+1]); + strcpy((char *) arg1->voice_name,arg2); } else { arg1->voice_name = 0; } @@ -4254,8 +3468,6 @@ static int _wrap_CoreSession_voice_name_set(lua_State* L) { return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4267,20 +3479,13 @@ static int _wrap_CoreSession_voice_name_get(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; char *result = 0 ; - SWIG_check_num_args("voice_name",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("voice_name",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_voice_name_get",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_voice_name_get"); result = (char *) ((arg1)->voice_name); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4292,20 +3497,13 @@ static int _wrap_CoreSession_answer(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; int result; - SWIG_check_num_args("answer",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("answer",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_answer",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_answer"); result = (int)(arg1)->answer(); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4317,20 +3515,13 @@ static int _wrap_CoreSession_preAnswer(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; int result; - SWIG_check_num_args("preAnswer",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("preAnswer",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_preAnswer",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_preAnswer"); result = (int)(arg1)->preAnswer(); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4342,24 +3533,17 @@ static int _wrap_CoreSession_hangup(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; char *arg2 = (char *) "normal_clearing" ; - SWIG_check_num_args("hangup",1,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup",1,"CoreSession *"); - if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("hangup",2,"char const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_hangup",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_hangup"); if(lua_gettop(L)>=2){ - arg2 = (char *)lua_tostring(L, 2); + arg2 = (char*)lua_tostring(L, 2); } (arg1)->hangup((char const *)arg2); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4370,20 +3554,13 @@ static int _wrap_CoreSession_hangupState(lua_State* L) { int SWIG_arg = -1; CoreSession *arg1 = (CoreSession *) 0 ; - SWIG_check_num_args("hangupState",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangupState",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_hangupState",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_hangupState"); (arg1)->hangupState(); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4396,24 +3573,17 @@ static int _wrap_CoreSession_setVariable(lua_State* L) { char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; - SWIG_check_num_args("setVariable",3,3) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setVariable",1,"CoreSession *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("setVariable",2,"char *"); - if(!lua_isstring(L,3)) SWIG_fail_arg("setVariable",3,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_setVariable",1,SWIGTYPE_p_CoreSession); - } - - arg2 = (char *)lua_tostring(L, 2); - arg3 = (char *)lua_tostring(L, 3); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + if(!lua_isstring(L,3)) SWIG_fail_arg(3); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_setVariable"); + arg2 = (char*)lua_tostring(L, 2); + arg3 = (char*)lua_tostring(L, 3); (arg1)->setVariable(arg2,arg3); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4426,24 +3596,17 @@ static int _wrap_CoreSession_setPrivate(lua_State* L) { char *arg2 = (char *) 0 ; void *arg3 = (void *) 0 ; - SWIG_check_num_args("setPrivate",3,3) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setPrivate",1,"CoreSession *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("setPrivate",2,"char *"); - if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("setPrivate",3,"void *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_setPrivate",1,SWIGTYPE_p_CoreSession); - } - - arg2 = (char *)lua_tostring(L, 2); - arg3=(void *)SWIG_MustGetPtr(L,3,0,0,3,"CoreSession_setPrivate"); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + if(!lua_isuserdata(L,3)) SWIG_fail_arg(3); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_setPrivate"); + arg2 = (char*)lua_tostring(L, 2); + arg3=((swig_lua_userdata*)(lua_touserdata(L,3)))->ptr; (arg1)->setPrivate(arg2,arg3); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4456,22 +3619,15 @@ static int _wrap_CoreSession_getPrivate(lua_State* L) { char *arg2 = (char *) 0 ; void *result = 0 ; - SWIG_check_num_args("getPrivate",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getPrivate",1,"CoreSession *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("getPrivate",2,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_getPrivate",1,SWIGTYPE_p_CoreSession); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_getPrivate"); + arg2 = (char*)lua_tostring(L, 2); result = (void *)(arg1)->getPrivate(arg2); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4484,22 +3640,15 @@ static int _wrap_CoreSession_getVariable(lua_State* L) { char *arg2 = (char *) 0 ; char *result = 0 ; - SWIG_check_num_args("getVariable",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getVariable",1,"CoreSession *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("getVariable",2,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_getVariable",1,SWIGTYPE_p_CoreSession); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_getVariable"); + arg2 = (char*)lua_tostring(L, 2); result = (char *)(arg1)->getVariable(arg2); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4512,25 +3661,19 @@ static int _wrap_CoreSession_process_callback_result(lua_State* L) { char *arg2 = (char *) 0 ; switch_status_t result; - SWIG_check_num_args("process_callback_result",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("process_callback_result",1,"CoreSession *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("process_callback_result",2,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_process_callback_result",1,SWIGTYPE_p_CoreSession); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_process_callback_result"); + arg2 = (char*)lua_tostring(L, 2); result = (arg1)->process_callback_result(arg2); SWIG_arg=0; { - switch_status_t * resultptr = new switch_status_t((switch_status_t &) result); + switch_status_t * resultptr; + resultptr = new switch_status_t((switch_status_t &) result); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_status_t,1); SWIG_arg++; } return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4546,32 +3689,25 @@ static int _wrap_CoreSession_say(lua_State* L) { char *arg5 = (char *) 0 ; char *arg6 = (char *) NULL ; - SWIG_check_num_args("say",5,6) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("say",1,"CoreSession *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("say",2,"char const *"); - if(!lua_isstring(L,3)) SWIG_fail_arg("say",3,"char const *"); - if(!lua_isstring(L,4)) SWIG_fail_arg("say",4,"char const *"); - if(!lua_isstring(L,5)) SWIG_fail_arg("say",5,"char const *"); - if(lua_gettop(L)>=6 && !lua_isstring(L,6)) SWIG_fail_arg("say",6,"char const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_say",1,SWIGTYPE_p_CoreSession); - } - - arg2 = (char *)lua_tostring(L, 2); - arg3 = (char *)lua_tostring(L, 3); - arg4 = (char *)lua_tostring(L, 4); - arg5 = (char *)lua_tostring(L, 5); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + if(!lua_isstring(L,3)) SWIG_fail_arg(3); + if(!lua_isstring(L,4)) SWIG_fail_arg(4); + if(!lua_isstring(L,5)) SWIG_fail_arg(5); + if(lua_gettop(L)>=6 && !lua_isstring(L,6)) SWIG_fail_arg(6); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_say"); + arg2 = (char*)lua_tostring(L, 2); + arg3 = (char*)lua_tostring(L, 3); + arg4 = (char*)lua_tostring(L, 4); + arg5 = (char*)lua_tostring(L, 5); if(lua_gettop(L)>=6){ - arg6 = (char *)lua_tostring(L, 6); + arg6 = (char*)lua_tostring(L, 6); } (arg1)->say((char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5,(char const *)arg6); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4585,30 +3721,23 @@ static int _wrap_CoreSession_sayPhrase(lua_State* L) { char *arg3 = (char *) "" ; char *arg4 = (char *) NULL ; - SWIG_check_num_args("sayPhrase",2,4) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sayPhrase",1,"CoreSession *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("sayPhrase",2,"char const *"); - if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("sayPhrase",3,"char const *"); - if(lua_gettop(L)>=4 && !lua_isstring(L,4)) SWIG_fail_arg("sayPhrase",4,"char const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_sayPhrase",1,SWIGTYPE_p_CoreSession); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg(3); + if(lua_gettop(L)>=4 && !lua_isstring(L,4)) SWIG_fail_arg(4); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_sayPhrase"); + arg2 = (char*)lua_tostring(L, 2); if(lua_gettop(L)>=3){ - arg3 = (char *)lua_tostring(L, 3); + arg3 = (char*)lua_tostring(L, 3); } if(lua_gettop(L)>=4){ - arg4 = (char *)lua_tostring(L, 4); + arg4 = (char*)lua_tostring(L, 4); } (arg1)->sayPhrase((char const *)arg2,(char const *)arg3,(char const *)arg4); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4620,20 +3749,13 @@ static int _wrap_CoreSession_hangupCause(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; char *result = 0 ; - SWIG_check_num_args("hangupCause",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangupCause",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_hangupCause",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_hangupCause"); result = (char *)(arg1)->hangupCause(); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4645,20 +3767,13 @@ static int _wrap_CoreSession_getState(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; char *result = 0 ; - SWIG_check_num_args("getState",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getState",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_getState",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_getState"); result = (char *)(arg1)->getState(); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4674,18 +3789,13 @@ static int _wrap_CoreSession_recordFile(lua_State* L) { int arg5 = (int) 0 ; int result; - SWIG_check_num_args("recordFile",2,5) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("recordFile",1,"CoreSession *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("recordFile",2,"char *"); - if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("recordFile",3,"int"); - if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("recordFile",4,"int"); - if(lua_gettop(L)>=5 && !lua_isnumber(L,5)) SWIG_fail_arg("recordFile",5,"int"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_recordFile",1,SWIGTYPE_p_CoreSession); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg(3); + if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg(4); + if(lua_gettop(L)>=5 && !lua_isnumber(L,5)) SWIG_fail_arg(5); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_recordFile"); + arg2 = (char*)lua_tostring(L, 2); if(lua_gettop(L)>=3){ arg3 = (int)lua_tonumber(L, 3); } @@ -4700,8 +3810,6 @@ static int _wrap_CoreSession_recordFile(lua_State* L) { lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4717,38 +3825,25 @@ static int _wrap_CoreSession_originate(lua_State* L) { switch_state_handler_table_t *arg5 = (switch_state_handler_table_t *) NULL ; int result; - SWIG_check_num_args("originate",3,5) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("originate",1,"CoreSession *"); - if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("originate",2,"CoreSession *"); - if(!lua_isstring(L,3)) SWIG_fail_arg("originate",3,"char *"); - if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("originate",4,"int"); - if(lua_gettop(L)>=5 && !SWIG_isptrtype(L,5)) SWIG_fail_arg("originate",5,"switch_state_handler_table_t *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_originate",1,SWIGTYPE_p_CoreSession); - } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_originate",2,SWIGTYPE_p_CoreSession); - } - - arg3 = (char *)lua_tostring(L, 3); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + if(!lua_isstring(L,3)) SWIG_fail_arg(3); + if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg(4); + if(lua_gettop(L)>=5 && !lua_isuserdata(L,5)) SWIG_fail_arg(5); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_originate"); + arg2=(CoreSession *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_CoreSession,0,2,"CoreSession_originate"); + arg3 = (char*)lua_tostring(L, 3); if(lua_gettop(L)>=4){ arg4 = (int)lua_tonumber(L, 4); } if(lua_gettop(L)>=5){ - if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_switch_state_handler_table_t,0))){ - SWIG_fail_ptr("CoreSession_originate",5,SWIGTYPE_p_switch_state_handler_table_t); - } + arg5=(switch_state_handler_table_t *)SWIG_MustGetPtr(L,5,SWIGTYPE_p_switch_state_handler_table_t,0,5,"CoreSession_originate"); } result = (int)(arg1)->originate(arg2,arg3,arg4,arg5); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4759,20 +3854,13 @@ static int _wrap_CoreSession_destroy(lua_State* L) { int SWIG_arg = -1; CoreSession *arg1 = (CoreSession *) 0 ; - SWIG_check_num_args("destroy",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("destroy",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_destroy",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_destroy"); (arg1)->destroy(); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4785,24 +3873,17 @@ static int _wrap_CoreSession_setDTMFCallback(lua_State* L) { void *arg2 = (void *) 0 ; char *arg3 = (char *) 0 ; - SWIG_check_num_args("setDTMFCallback",3,3) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setDTMFCallback",1,"CoreSession *"); - if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("setDTMFCallback",2,"void *"); - if(!lua_isstring(L,3)) SWIG_fail_arg("setDTMFCallback",3,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_setDTMFCallback",1,SWIGTYPE_p_CoreSession); - } - - arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"CoreSession_setDTMFCallback"); - arg3 = (char *)lua_tostring(L, 3); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + if(!lua_isstring(L,3)) SWIG_fail_arg(3); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_setDTMFCallback"); + arg2=((swig_lua_userdata*)(lua_touserdata(L,2)))->ptr; + arg3 = (char*)lua_tostring(L, 3); (arg1)->setDTMFCallback(arg2,arg3); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4815,22 +3896,15 @@ static int _wrap_CoreSession_speak(lua_State* L) { char *arg2 = (char *) 0 ; int result; - SWIG_check_num_args("speak",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("speak",1,"CoreSession *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("speak",2,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_speak",1,SWIGTYPE_p_CoreSession); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_speak"); + arg2 = (char*)lua_tostring(L, 2); result = (int)(arg1)->speak(arg2); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4843,24 +3917,17 @@ static int _wrap_CoreSession_set_tts_parms(lua_State* L) { char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; - SWIG_check_num_args("set_tts_parms",3,3) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("set_tts_parms",1,"CoreSession *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("set_tts_parms",2,"char *"); - if(!lua_isstring(L,3)) SWIG_fail_arg("set_tts_parms",3,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_set_tts_parms",1,SWIGTYPE_p_CoreSession); - } - - arg2 = (char *)lua_tostring(L, 2); - arg3 = (char *)lua_tostring(L, 3); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + if(!lua_isstring(L,3)) SWIG_fail_arg(3); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_set_tts_parms"); + arg2 = (char*)lua_tostring(L, 2); + arg3 = (char*)lua_tostring(L, 3); (arg1)->set_tts_parms(arg2,arg3); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4873,22 +3940,15 @@ static int _wrap_CoreSession_collectDigits__SWIG_0(lua_State* L) { int arg2 ; int result; - SWIG_check_num_args("collectDigits",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("collectDigits",1,"CoreSession *"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("collectDigits",2,"int"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_collectDigits",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isnumber(L,2)) SWIG_fail_arg(2); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_collectDigits"); arg2 = (int)lua_tonumber(L, 2); result = (int)(arg1)->collectDigits(arg2); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4902,15 +3962,10 @@ static int _wrap_CoreSession_collectDigits__SWIG_1(lua_State* L) { int arg3 ; int result; - SWIG_check_num_args("collectDigits",3,3) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("collectDigits",1,"CoreSession *"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("collectDigits",2,"int"); - if(!lua_isnumber(L,3)) SWIG_fail_arg("collectDigits",3,"int"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_collectDigits",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isnumber(L,2)) SWIG_fail_arg(2); + if(!lua_isnumber(L,3)) SWIG_fail_arg(3); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_collectDigits"); arg2 = (int)lua_tonumber(L, 2); arg3 = (int)lua_tonumber(L, 3); result = (int)(arg1)->collectDigits(arg2,arg3); @@ -4918,8 +3973,6 @@ static int _wrap_CoreSession_collectDigits__SWIG_1(lua_State* L) { lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -4937,7 +3990,7 @@ static int _wrap_CoreSession_collectDigits(lua_State* L) { int _v; { void *ptr; - if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { + if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { _v = 0; } else { _v = 1; @@ -4956,7 +4009,7 @@ static int _wrap_CoreSession_collectDigits(lua_State* L) { int _v; { void *ptr; - if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { + if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { _v = 0; } else { _v = 1; @@ -4990,26 +4043,19 @@ static int _wrap_CoreSession_getDigits__SWIG_0(lua_State* L) { int arg4 ; char *result = 0 ; - SWIG_check_num_args("getDigits",4,4) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getDigits",1,"CoreSession *"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("getDigits",2,"int"); - if(!lua_isstring(L,3)) SWIG_fail_arg("getDigits",3,"char *"); - if(!lua_isnumber(L,4)) SWIG_fail_arg("getDigits",4,"int"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_getDigits",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isnumber(L,2)) SWIG_fail_arg(2); + if(!lua_isstring(L,3)) SWIG_fail_arg(3); + if(!lua_isnumber(L,4)) SWIG_fail_arg(4); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_getDigits"); arg2 = (int)lua_tonumber(L, 2); - arg3 = (char *)lua_tostring(L, 3); + arg3 = (char*)lua_tostring(L, 3); arg4 = (int)lua_tonumber(L, 4); result = (char *)(arg1)->getDigits(arg2,arg3,arg4); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5025,28 +4071,21 @@ static int _wrap_CoreSession_getDigits__SWIG_1(lua_State* L) { int arg5 ; char *result = 0 ; - SWIG_check_num_args("getDigits",5,5) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getDigits",1,"CoreSession *"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("getDigits",2,"int"); - if(!lua_isstring(L,3)) SWIG_fail_arg("getDigits",3,"char *"); - if(!lua_isnumber(L,4)) SWIG_fail_arg("getDigits",4,"int"); - if(!lua_isnumber(L,5)) SWIG_fail_arg("getDigits",5,"int"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_getDigits",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isnumber(L,2)) SWIG_fail_arg(2); + if(!lua_isstring(L,3)) SWIG_fail_arg(3); + if(!lua_isnumber(L,4)) SWIG_fail_arg(4); + if(!lua_isnumber(L,5)) SWIG_fail_arg(5); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_getDigits"); arg2 = (int)lua_tonumber(L, 2); - arg3 = (char *)lua_tostring(L, 3); + arg3 = (char*)lua_tostring(L, 3); arg4 = (int)lua_tonumber(L, 4); arg5 = (int)lua_tonumber(L, 5); result = (char *)(arg1)->getDigits(arg2,arg3,arg4,arg5); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5064,7 +4103,7 @@ static int _wrap_CoreSession_getDigits(lua_State* L) { int _v; { void *ptr; - if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { + if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { _v = 0; } else { _v = 1; @@ -5093,7 +4132,7 @@ static int _wrap_CoreSession_getDigits(lua_State* L) { int _v; { void *ptr; - if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { + if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { _v = 0; } else { _v = 1; @@ -5137,30 +4176,23 @@ static int _wrap_CoreSession_transfer(lua_State* L) { char *arg4 = (char *) NULL ; int result; - SWIG_check_num_args("transfer",2,4) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("transfer",1,"CoreSession *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("transfer",2,"char *"); - if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("transfer",3,"char *"); - if(lua_gettop(L)>=4 && !lua_isstring(L,4)) SWIG_fail_arg("transfer",4,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_transfer",1,SWIGTYPE_p_CoreSession); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg(3); + if(lua_gettop(L)>=4 && !lua_isstring(L,4)) SWIG_fail_arg(4); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_transfer"); + arg2 = (char*)lua_tostring(L, 2); if(lua_gettop(L)>=3){ - arg3 = (char *)lua_tostring(L, 3); + arg3 = (char*)lua_tostring(L, 3); } if(lua_gettop(L)>=4){ - arg4 = (char *)lua_tostring(L, 4); + arg4 = (char*)lua_tostring(L, 4); } result = (int)(arg1)->transfer(arg2,arg3,arg4); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5177,30 +4209,23 @@ static int _wrap_CoreSession_read(lua_State* L) { char *arg6 = (char *) 0 ; char *result = 0 ; - SWIG_check_num_args("read",6,6) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("read",1,"CoreSession *"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("read",2,"int"); - if(!lua_isnumber(L,3)) SWIG_fail_arg("read",3,"int"); - if(!lua_isstring(L,4)) SWIG_fail_arg("read",4,"char const *"); - if(!lua_isnumber(L,5)) SWIG_fail_arg("read",5,"int"); - if(!lua_isstring(L,6)) SWIG_fail_arg("read",6,"char const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_read",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isnumber(L,2)) SWIG_fail_arg(2); + if(!lua_isnumber(L,3)) SWIG_fail_arg(3); + if(!lua_isstring(L,4)) SWIG_fail_arg(4); + if(!lua_isnumber(L,5)) SWIG_fail_arg(5); + if(!lua_isstring(L,6)) SWIG_fail_arg(6); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_read"); arg2 = (int)lua_tonumber(L, 2); arg3 = (int)lua_tonumber(L, 3); - arg4 = (char *)lua_tostring(L, 4); + arg4 = (char*)lua_tostring(L, 4); arg5 = (int)lua_tonumber(L, 5); - arg6 = (char *)lua_tostring(L, 6); + arg6 = (char*)lua_tostring(L, 6); result = (char *)(arg1)->read(arg2,arg3,(char const *)arg4,arg5,(char const *)arg6); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5221,40 +4246,33 @@ static int _wrap_CoreSession_playAndGetDigits(lua_State* L) { char *arg10 = (char *) NULL ; char *result = 0 ; - SWIG_check_num_args("playAndGetDigits",9,10) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("playAndGetDigits",1,"CoreSession *"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("playAndGetDigits",2,"int"); - if(!lua_isnumber(L,3)) SWIG_fail_arg("playAndGetDigits",3,"int"); - if(!lua_isnumber(L,4)) SWIG_fail_arg("playAndGetDigits",4,"int"); - if(!lua_isnumber(L,5)) SWIG_fail_arg("playAndGetDigits",5,"int"); - if(!lua_isstring(L,6)) SWIG_fail_arg("playAndGetDigits",6,"char *"); - if(!lua_isstring(L,7)) SWIG_fail_arg("playAndGetDigits",7,"char *"); - if(!lua_isstring(L,8)) SWIG_fail_arg("playAndGetDigits",8,"char *"); - if(!lua_isstring(L,9)) SWIG_fail_arg("playAndGetDigits",9,"char *"); - if(lua_gettop(L)>=10 && !lua_isstring(L,10)) SWIG_fail_arg("playAndGetDigits",10,"char const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_playAndGetDigits",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isnumber(L,2)) SWIG_fail_arg(2); + if(!lua_isnumber(L,3)) SWIG_fail_arg(3); + if(!lua_isnumber(L,4)) SWIG_fail_arg(4); + if(!lua_isnumber(L,5)) SWIG_fail_arg(5); + if(!lua_isstring(L,6)) SWIG_fail_arg(6); + if(!lua_isstring(L,7)) SWIG_fail_arg(7); + if(!lua_isstring(L,8)) SWIG_fail_arg(8); + if(!lua_isstring(L,9)) SWIG_fail_arg(9); + if(lua_gettop(L)>=10 && !lua_isstring(L,10)) SWIG_fail_arg(10); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_playAndGetDigits"); arg2 = (int)lua_tonumber(L, 2); arg3 = (int)lua_tonumber(L, 3); arg4 = (int)lua_tonumber(L, 4); arg5 = (int)lua_tonumber(L, 5); - arg6 = (char *)lua_tostring(L, 6); - arg7 = (char *)lua_tostring(L, 7); - arg8 = (char *)lua_tostring(L, 8); - arg9 = (char *)lua_tostring(L, 9); + arg6 = (char*)lua_tostring(L, 6); + arg7 = (char*)lua_tostring(L, 7); + arg8 = (char*)lua_tostring(L, 8); + arg9 = (char*)lua_tostring(L, 9); if(lua_gettop(L)>=10){ - arg10 = (char *)lua_tostring(L, 10); + arg10 = (char*)lua_tostring(L, 10); } result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(char const *)arg10); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5268,16 +4286,11 @@ static int _wrap_CoreSession_streamFile(lua_State* L) { int arg3 = (int) 0 ; int result; - SWIG_check_num_args("streamFile",2,3) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("streamFile",1,"CoreSession *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("streamFile",2,"char *"); - if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("streamFile",3,"int"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_streamFile",1,SWIGTYPE_p_CoreSession); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg(3); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_streamFile"); + arg2 = (char*)lua_tostring(L, 2); if(lua_gettop(L)>=3){ arg3 = (int)lua_tonumber(L, 3); } @@ -5286,8 +4299,6 @@ static int _wrap_CoreSession_streamFile(lua_State* L) { lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5301,15 +4312,10 @@ static int _wrap_CoreSession_sleep(lua_State* L) { int arg3 = (int) 0 ; int result; - SWIG_check_num_args("sleep",2,3) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sleep",1,"CoreSession *"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("sleep",2,"int"); - if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("sleep",3,"int"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_sleep",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isnumber(L,2)) SWIG_fail_arg(2); + if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg(3); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_sleep"); arg2 = (int)lua_tonumber(L, 2); if(lua_gettop(L)>=3){ arg3 = (int)lua_tonumber(L, 3); @@ -5319,8 +4325,6 @@ static int _wrap_CoreSession_sleep(lua_State* L) { lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5332,20 +4336,13 @@ static int _wrap_CoreSession_flushEvents(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; int result; - SWIG_check_num_args("flushEvents",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("flushEvents",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_flushEvents",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_flushEvents"); result = (int)(arg1)->flushEvents(); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5357,20 +4354,13 @@ static int _wrap_CoreSession_flushDigits(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; int result; - SWIG_check_num_args("flushDigits",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("flushDigits",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_flushDigits",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_flushDigits"); result = (int)(arg1)->flushDigits(); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5383,22 +4373,15 @@ static int _wrap_CoreSession_setAutoHangup(lua_State* L) { bool arg2 ; int result; - SWIG_check_num_args("setAutoHangup",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setAutoHangup",1,"CoreSession *"); - if(!lua_isboolean(L,2)) SWIG_fail_arg("setAutoHangup",2,"bool"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_setAutoHangup",1,SWIGTYPE_p_CoreSession); - } - - arg2 = (lua_toboolean(L, 2)!=0); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isboolean(L,2)) SWIG_fail_arg(2); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_setAutoHangup"); + arg2 = (bool)lua_toboolean(L, 2); result = (int)(arg1)->setAutoHangup(arg2); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5410,22 +4393,15 @@ static int _wrap_CoreSession_setHangupHook(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; void *arg2 = (void *) 0 ; - SWIG_check_num_args("setHangupHook",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setHangupHook",1,"CoreSession *"); - if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("setHangupHook",2,"void *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_setHangupHook",1,SWIGTYPE_p_CoreSession); - } - - arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"CoreSession_setHangupHook"); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_setHangupHook"); + arg2=((swig_lua_userdata*)(lua_touserdata(L,2)))->ptr; (arg1)->setHangupHook(arg2); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5437,20 +4413,13 @@ static int _wrap_CoreSession_ready(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; bool result; - SWIG_check_num_args("ready",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ready",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_ready",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_ready"); result = (bool)(arg1)->ready(); SWIG_arg=0; - lua_pushboolean(L,(int)(result==true)); SWIG_arg++; + lua_pushboolean(L,(int)result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5462,20 +4431,13 @@ static int _wrap_CoreSession_bridged(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; bool result; - SWIG_check_num_args("bridged",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("bridged",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_bridged",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_bridged"); result = (bool)(arg1)->bridged(); SWIG_arg=0; - lua_pushboolean(L,(int)(result==true)); SWIG_arg++; + lua_pushboolean(L,(int)result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5487,20 +4449,13 @@ static int _wrap_CoreSession_answered(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; bool result; - SWIG_check_num_args("answered",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("answered",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_answered",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_answered"); result = (bool)(arg1)->answered(); SWIG_arg=0; - lua_pushboolean(L,(int)(result==true)); SWIG_arg++; + lua_pushboolean(L,(int)result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5512,20 +4467,13 @@ static int _wrap_CoreSession_mediaReady(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; bool result; - SWIG_check_num_args("mediaReady",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("mediaReady",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_mediaReady",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_mediaReady"); result = (bool)(arg1)->mediaReady(); SWIG_arg=0; - lua_pushboolean(L,(int)(result==true)); SWIG_arg++; + lua_pushboolean(L,(int)result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5537,26 +4485,15 @@ static int _wrap_CoreSession_waitForAnswer(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; CoreSession *arg2 = (CoreSession *) 0 ; - SWIG_check_num_args("waitForAnswer",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("waitForAnswer",1,"CoreSession *"); - if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("waitForAnswer",2,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_waitForAnswer",1,SWIGTYPE_p_CoreSession); - } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_waitForAnswer",2,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_waitForAnswer"); + arg2=(CoreSession *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_CoreSession,0,2,"CoreSession_waitForAnswer"); (arg1)->waitForAnswer(arg2); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5569,26 +4506,19 @@ static int _wrap_CoreSession_execute(lua_State* L) { char *arg2 = (char *) 0 ; char *arg3 = (char *) NULL ; - SWIG_check_num_args("execute",2,3) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("execute",1,"CoreSession *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("execute",2,"char const *"); - if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("execute",3,"char const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_execute",1,SWIGTYPE_p_CoreSession); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg(3); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_execute"); + arg2 = (char*)lua_tostring(L, 2); if(lua_gettop(L)>=3){ - arg3 = (char *)lua_tostring(L, 3); + arg3 = (char*)lua_tostring(L, 3); } (arg1)->execute((char const *)arg2,(char const *)arg3); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5600,26 +4530,15 @@ static int _wrap_CoreSession_sendEvent(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; Event *arg2 = (Event *) 0 ; - SWIG_check_num_args("sendEvent",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sendEvent",1,"CoreSession *"); - if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("sendEvent",2,"Event *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_sendEvent",1,SWIGTYPE_p_CoreSession); - } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Event,0))){ - SWIG_fail_ptr("CoreSession_sendEvent",2,SWIGTYPE_p_Event); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_sendEvent"); + arg2=(Event *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_Event,0,2,"CoreSession_sendEvent"); (arg1)->sendEvent(arg2); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5631,26 +4550,15 @@ static int _wrap_CoreSession_setEventData(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; Event *arg2 = (Event *) 0 ; - SWIG_check_num_args("setEventData",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setEventData",1,"CoreSession *"); - if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("setEventData",2,"Event *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_setEventData",1,SWIGTYPE_p_CoreSession); - } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Event,0))){ - SWIG_fail_ptr("CoreSession_setEventData",2,SWIGTYPE_p_Event); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_setEventData"); + arg2=(Event *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_Event,0,2,"CoreSession_setEventData"); (arg1)->setEventData(arg2); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5662,20 +4570,13 @@ static int _wrap_CoreSession_getXMLCDR(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; char *result = 0 ; - SWIG_check_num_args("getXMLCDR",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getXMLCDR",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_getXMLCDR",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_getXMLCDR"); result = (char *)(arg1)->getXMLCDR(); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5687,20 +4588,13 @@ static int _wrap_CoreSession_begin_allow_threads(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; bool result; - SWIG_check_num_args("begin_allow_threads",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("begin_allow_threads",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_begin_allow_threads",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_begin_allow_threads"); result = (bool)(arg1)->begin_allow_threads(); SWIG_arg=0; - lua_pushboolean(L,(int)(result==true)); SWIG_arg++; + lua_pushboolean(L,(int)result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5712,20 +4606,13 @@ static int _wrap_CoreSession_end_allow_threads(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; bool result; - SWIG_check_num_args("end_allow_threads",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("end_allow_threads",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_end_allow_threads",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_end_allow_threads"); result = (bool)(arg1)->end_allow_threads(); SWIG_arg=0; - lua_pushboolean(L,(int)(result==true)); SWIG_arg++; + lua_pushboolean(L,(int)result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5737,20 +4624,13 @@ static int _wrap_CoreSession_get_uuid(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; char *result = 0 ; - SWIG_check_num_args("get_uuid",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("get_uuid",1,"CoreSession const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_get_uuid",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_get_uuid"); result = (char *)((CoreSession const *)arg1)->get_uuid(); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5762,13 +4642,8 @@ static int _wrap_CoreSession_get_cb_args(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; switch_input_args_t *result = 0 ; - SWIG_check_num_args("get_cb_args",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("get_cb_args",1,"CoreSession const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_get_cb_args",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_get_cb_args"); { switch_input_args_t const &_result_ref = ((CoreSession const *)arg1)->get_cb_args(); result = (switch_input_args_t *) &_result_ref; @@ -5777,8 +4652,6 @@ static int _wrap_CoreSession_get_cb_args(lua_State* L) { SWIG_NewPointerObj(L,result,SWIGTYPE_p_switch_input_args_t,0); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5789,20 +4662,13 @@ static int _wrap_CoreSession_check_hangup_hook(lua_State* L) { int SWIG_arg = -1; CoreSession *arg1 = (CoreSession *) 0 ; - SWIG_check_num_args("check_hangup_hook",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("check_hangup_hook",1,"CoreSession *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_check_hangup_hook",1,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_check_hangup_hook"); (arg1)->check_hangup_hook(); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5815,34 +4681,26 @@ static int _wrap_CoreSession_run_dtmf_callback(lua_State* L) { void *arg2 = (void *) 0 ; switch_input_type_t arg3 ; switch_status_t result; - switch_input_type_t *argp3 ; - SWIG_check_num_args("run_dtmf_callback",3,3) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("run_dtmf_callback",1,"CoreSession *"); - if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("run_dtmf_callback",2,"void *"); - if(!lua_isuserdata(L,3)) SWIG_fail_arg("run_dtmf_callback",3,"switch_input_type_t"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_run_dtmf_callback",1,SWIGTYPE_p_CoreSession); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + if(!lua_isuserdata(L,3)) SWIG_fail_arg(3); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_run_dtmf_callback"); + arg2=((swig_lua_userdata*)(lua_touserdata(L,2)))->ptr; + { + switch_input_type_t * argp; + if(SWIG_ConvertPtr(L,3,(void**)(&argp),SWIGTYPE_p_switch_input_type_t,0)) SWIG_fail; + arg3 = *argp; } - - arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"CoreSession_run_dtmf_callback"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&argp3,SWIGTYPE_p_switch_input_type_t,0))){ - SWIG_fail_ptr("CoreSession_run_dtmf_callback",3,SWIGTYPE_p_switch_input_type_t); - } - arg3 = *argp3; - result = (arg1)->run_dtmf_callback(arg2,arg3); SWIG_arg=0; { - switch_status_t * resultptr = new switch_status_t((switch_status_t &) result); + switch_status_t * resultptr; + resultptr = new switch_status_t((switch_status_t &) result); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_status_t,1); SWIG_arg++; } return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5902,39 +4760,35 @@ static swig_lua_method swig_CoreSession_methods[] = { {0,0} }; static swig_lua_attribute swig_CoreSession_attributes[] = { - { "session", _wrap_CoreSession_session_get, _wrap_CoreSession_session_set}, - { "channel", _wrap_CoreSession_channel_get, _wrap_CoreSession_channel_set}, - { "flags", _wrap_CoreSession_flags_get, _wrap_CoreSession_flags_set}, - { "allocated", _wrap_CoreSession_allocated_get, _wrap_CoreSession_allocated_set}, - { "cb_state", _wrap_CoreSession_cb_state_get, _wrap_CoreSession_cb_state_set}, - { "hook_state", _wrap_CoreSession_hook_state_get, _wrap_CoreSession_hook_state_set}, - { "cause", _wrap_CoreSession_cause_get, _wrap_CoreSession_cause_set}, - { "uuid", _wrap_CoreSession_uuid_get, _wrap_CoreSession_uuid_set}, - { "tts_name", _wrap_CoreSession_tts_name_get, _wrap_CoreSession_tts_name_set}, - { "voice_name", _wrap_CoreSession_voice_name_get, _wrap_CoreSession_voice_name_set}, + { "session",_wrap_CoreSession_session_get, _wrap_CoreSession_session_set}, + { "channel",_wrap_CoreSession_channel_get, _wrap_CoreSession_channel_set}, + { "flags",_wrap_CoreSession_flags_get, _wrap_CoreSession_flags_set}, + { "allocated",_wrap_CoreSession_allocated_get, _wrap_CoreSession_allocated_set}, + { "cb_state",_wrap_CoreSession_cb_state_get, _wrap_CoreSession_cb_state_set}, + { "hook_state",_wrap_CoreSession_hook_state_get, _wrap_CoreSession_hook_state_set}, + { "cause",_wrap_CoreSession_cause_get, _wrap_CoreSession_cause_set}, + { "uuid",_wrap_CoreSession_uuid_get, _wrap_CoreSession_uuid_set}, + { "tts_name",_wrap_CoreSession_tts_name_get, _wrap_CoreSession_tts_name_set}, + { "voice_name",_wrap_CoreSession_voice_name_get, _wrap_CoreSession_voice_name_set}, {0,0,0} }; static swig_lua_class *swig_CoreSession_bases[] = {0}; -static const char *swig_CoreSession_base_names[] = {0}; -static swig_lua_class _wrap_class_CoreSession = { "CoreSession", &SWIGTYPE_p_CoreSession,0, swig_delete_CoreSession, swig_CoreSession_methods, swig_CoreSession_attributes, swig_CoreSession_bases, swig_CoreSession_base_names }; +swig_lua_class _wrap_class_CoreSession = { "CoreSession", &SWIGTYPE_p_CoreSession,0, swig_delete_CoreSession, swig_CoreSession_methods, swig_CoreSession_attributes, swig_CoreSession_bases }; static int _wrap_console_log(lua_State* L) { int SWIG_arg = -1; char *arg1 = (char *) 0 ; char *arg2 = (char *) 0 ; - SWIG_check_num_args("console_log",2,2) - if(!lua_isstring(L,1)) SWIG_fail_arg("console_log",1,"char *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("console_log",2,"char *"); - arg1 = (char *)lua_tostring(L, 1); - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isstring(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1 = (char*)lua_tostring(L, 1); + arg2 = (char*)lua_tostring(L, 2); console_log(arg1,arg2); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5945,16 +4799,13 @@ static int _wrap_console_clean_log(lua_State* L) { int SWIG_arg = -1; char *arg1 = (char *) 0 ; - SWIG_check_num_args("console_clean_log",1,1) - if(!lua_isstring(L,1)) SWIG_fail_arg("console_clean_log",1,"char *"); - arg1 = (char *)lua_tostring(L, 1); + if(!lua_isstring(L,1)) SWIG_fail_arg(1); + arg1 = (char*)lua_tostring(L, 1); console_clean_log(arg1); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5965,16 +4816,13 @@ static int _wrap_msleep(lua_State* L) { int SWIG_arg = -1; unsigned int arg1 ; - SWIG_check_num_args("msleep",1,1) - if(!lua_isnumber(L,1)) SWIG_fail_arg("msleep",1,"unsigned int"); + if(!lua_isnumber(L,1)) SWIG_fail_arg(1); arg1 = (unsigned int)lua_tonumber(L, 1); msleep(arg1); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -5986,26 +4834,15 @@ static int _wrap_bridge(lua_State* L) { CoreSession *arg1 = 0 ; CoreSession *arg2 = 0 ; - SWIG_check_num_args("bridge",2,2) - if(!lua_isuserdata(L,1)) SWIG_fail_arg("bridge",1,"CoreSession &"); - if(!lua_isuserdata(L,2)) SWIG_fail_arg("bridge",2,"CoreSession &"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("bridge",1,SWIGTYPE_p_CoreSession); - } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("bridge",2,SWIGTYPE_p_CoreSession); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"bridge"); + arg2=(CoreSession *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_CoreSession,0,2,"bridge"); bridge(*arg1,*arg2); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6017,23 +4854,17 @@ static int _wrap_hanguphook(lua_State* L) { switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; switch_status_t result; - SWIG_check_num_args("hanguphook",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hanguphook",1,"switch_core_session_t *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_switch_core_session_t,0))){ - SWIG_fail_ptr("hanguphook",1,SWIGTYPE_p_switch_core_session_t); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(switch_core_session_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_switch_core_session_t,0,1,"hanguphook"); result = hanguphook(arg1); SWIG_arg=0; { - switch_status_t * resultptr = new switch_status_t((switch_status_t &) result); + switch_status_t * resultptr; + resultptr = new switch_status_t((switch_status_t &) result); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_status_t,1); SWIG_arg++; } return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6048,38 +4879,30 @@ static int _wrap_dtmf_callback(lua_State* L) { void *arg4 = (void *) 0 ; unsigned int arg5 ; switch_status_t result; - switch_input_type_t *argp3 ; - SWIG_check_num_args("dtmf_callback",5,5) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("dtmf_callback",1,"switch_core_session_t *"); - if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("dtmf_callback",2,"void *"); - if(!lua_isuserdata(L,3)) SWIG_fail_arg("dtmf_callback",3,"switch_input_type_t"); - if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("dtmf_callback",4,"void *"); - if(!lua_isnumber(L,5)) SWIG_fail_arg("dtmf_callback",5,"unsigned int"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_switch_core_session_t,0))){ - SWIG_fail_ptr("dtmf_callback",1,SWIGTYPE_p_switch_core_session_t); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + if(!lua_isuserdata(L,3)) SWIG_fail_arg(3); + if(!lua_isuserdata(L,4)) SWIG_fail_arg(4); + if(!lua_isnumber(L,5)) SWIG_fail_arg(5); + arg1=(switch_core_session_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_switch_core_session_t,0,1,"dtmf_callback"); + arg2=((swig_lua_userdata*)(lua_touserdata(L,2)))->ptr; + { + switch_input_type_t * argp; + if(SWIG_ConvertPtr(L,3,(void**)(&argp),SWIGTYPE_p_switch_input_type_t,0)) SWIG_fail; + arg3 = *argp; } - - arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"dtmf_callback"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&argp3,SWIGTYPE_p_switch_input_type_t,0))){ - SWIG_fail_ptr("dtmf_callback",3,SWIGTYPE_p_switch_input_type_t); - } - arg3 = *argp3; - - arg4=(void *)SWIG_MustGetPtr(L,4,0,0,4,"dtmf_callback"); + arg4=((swig_lua_userdata*)(lua_touserdata(L,4)))->ptr; arg5 = (unsigned int)lua_tonumber(L, 5); result = dtmf_callback(arg1,arg2,arg3,arg4,arg5); SWIG_arg=0; { - switch_status_t * resultptr = new switch_status_t((switch_status_t &) result); + switch_status_t * resultptr; + resultptr = new switch_status_t((switch_status_t &) result); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_status_t,1); SWIG_arg++; } return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6090,14 +4913,11 @@ static int _wrap_new_Session__SWIG_0(lua_State* L) { int SWIG_arg = -1; LUA::Session *result = 0 ; - SWIG_check_num_args("LUA::Session",0,0) result = (LUA::Session *)new LUA::Session(); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L); return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6110,22 +4930,15 @@ static int _wrap_new_Session__SWIG_1(lua_State* L) { CoreSession *arg2 = (CoreSession *) 0 ; LUA::Session *result = 0 ; - SWIG_check_num_args("LUA::Session",2,2) - if(!lua_isstring(L,1)) SWIG_fail_arg("LUA::Session",1,"char *"); - if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("LUA::Session",2,"CoreSession *"); - arg1 = (char *)lua_tostring(L, 1); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("new_Session",2,SWIGTYPE_p_CoreSession); - } - + if(!lua_isstring(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1 = (char*)lua_tostring(L, 1); + arg2=(CoreSession *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_CoreSession,0,2,"new_Session"); result = (LUA::Session *)new LUA::Session(arg1,arg2); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L); return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6137,16 +4950,13 @@ static int _wrap_new_Session__SWIG_2(lua_State* L) { char *arg1 = (char *) 0 ; LUA::Session *result = 0 ; - SWIG_check_num_args("LUA::Session",1,1) - if(!lua_isstring(L,1)) SWIG_fail_arg("LUA::Session",1,"char *"); - arg1 = (char *)lua_tostring(L, 1); + if(!lua_isstring(L,1)) SWIG_fail_arg(1); + arg1 = (char*)lua_tostring(L, 1); result = (LUA::Session *)new LUA::Session(arg1); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L); return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6158,20 +4968,13 @@ static int _wrap_new_Session__SWIG_3(lua_State* L) { switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; LUA::Session *result = 0 ; - SWIG_check_num_args("LUA::Session",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session",1,"switch_core_session_t *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_switch_core_session_t,0))){ - SWIG_fail_ptr("new_Session",1,SWIGTYPE_p_switch_core_session_t); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(switch_core_session_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_switch_core_session_t,0,1,"new_Session"); result = (LUA::Session *)new LUA::Session(arg1); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L); return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6192,7 +4995,7 @@ static int _wrap_new_Session(lua_State* L) { int _v; { void *ptr; - if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_switch_core_session_t, 0)) { + if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_switch_core_session_t, 0)) { _v = 0; } else { _v = 1; @@ -6219,7 +5022,7 @@ static int _wrap_new_Session(lua_State* L) { if (_v) { { void *ptr; - if (SWIG_isptrtype(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { + if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { _v = 0; } else { _v = 1; @@ -6240,21 +5043,14 @@ static int _wrap_delete_Session(lua_State* L) { int SWIG_arg = -1; LUA::Session *arg1 = (LUA::Session *) 0 ; - SWIG_check_num_args("LUA::~Session",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::~Session",1,"LUA::Session *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,SWIG_POINTER_DISOWN))){ - SWIG_fail_ptr("delete_Session",1,SWIGTYPE_p_LUA__Session); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"delete_Session"); delete arg1; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6265,20 +5061,13 @@ static int _wrap_Session_destroy(lua_State* L) { int SWIG_arg = -1; LUA::Session *arg1 = (LUA::Session *) 0 ; - SWIG_check_num_args("destroy",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("destroy",1,"LUA::Session *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ - SWIG_fail_ptr("Session_destroy",1,SWIGTYPE_p_LUA__Session); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_destroy"); (arg1)->destroy(); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6290,20 +5079,13 @@ static int _wrap_Session_begin_allow_threads(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; bool result; - SWIG_check_num_args("begin_allow_threads",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("begin_allow_threads",1,"LUA::Session *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ - SWIG_fail_ptr("Session_begin_allow_threads",1,SWIGTYPE_p_LUA__Session); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_begin_allow_threads"); result = (bool)(arg1)->begin_allow_threads(); SWIG_arg=0; - lua_pushboolean(L,(int)(result==true)); SWIG_arg++; + lua_pushboolean(L,(int)result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6315,20 +5097,13 @@ static int _wrap_Session_end_allow_threads(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; bool result; - SWIG_check_num_args("end_allow_threads",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("end_allow_threads",1,"LUA::Session *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ - SWIG_fail_ptr("Session_end_allow_threads",1,SWIGTYPE_p_LUA__Session); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_end_allow_threads"); result = (bool)(arg1)->end_allow_threads(); SWIG_arg=0; - lua_pushboolean(L,(int)(result==true)); SWIG_arg++; + lua_pushboolean(L,(int)result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6339,20 +5114,13 @@ static int _wrap_Session_check_hangup_hook(lua_State* L) { int SWIG_arg = -1; LUA::Session *arg1 = (LUA::Session *) 0 ; - SWIG_check_num_args("check_hangup_hook",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("check_hangup_hook",1,"LUA::Session *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ - SWIG_fail_ptr("Session_check_hangup_hook",1,SWIGTYPE_p_LUA__Session); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_check_hangup_hook"); (arg1)->check_hangup_hook(); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6365,34 +5133,26 @@ static int _wrap_Session_run_dtmf_callback(lua_State* L) { void *arg2 = (void *) 0 ; switch_input_type_t arg3 ; switch_status_t result; - switch_input_type_t *argp3 ; - SWIG_check_num_args("run_dtmf_callback",3,3) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("run_dtmf_callback",1,"LUA::Session *"); - if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("run_dtmf_callback",2,"void *"); - if(!lua_isuserdata(L,3)) SWIG_fail_arg("run_dtmf_callback",3,"switch_input_type_t"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ - SWIG_fail_ptr("Session_run_dtmf_callback",1,SWIGTYPE_p_LUA__Session); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + if(!lua_isuserdata(L,3)) SWIG_fail_arg(3); + arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_run_dtmf_callback"); + arg2=((swig_lua_userdata*)(lua_touserdata(L,2)))->ptr; + { + switch_input_type_t * argp; + if(SWIG_ConvertPtr(L,3,(void**)(&argp),SWIGTYPE_p_switch_input_type_t,0)) SWIG_fail; + arg3 = *argp; } - - arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"Session_run_dtmf_callback"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&argp3,SWIGTYPE_p_switch_input_type_t,0))){ - SWIG_fail_ptr("Session_run_dtmf_callback",3,SWIGTYPE_p_switch_input_type_t); - } - arg3 = *argp3; - result = (arg1)->run_dtmf_callback(arg2,arg3); SWIG_arg=0; { - switch_status_t * resultptr = new switch_status_t((switch_status_t &) result); + switch_status_t * resultptr; + resultptr = new switch_status_t((switch_status_t &) result); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_status_t,1); SWIG_arg++; } return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6403,20 +5163,13 @@ static int _wrap_Session_unsetInputCallback(lua_State* L) { int SWIG_arg = -1; LUA::Session *arg1 = (LUA::Session *) 0 ; - SWIG_check_num_args("unsetInputCallback",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("unsetInputCallback",1,"LUA::Session *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ - SWIG_fail_ptr("Session_unsetInputCallback",1,SWIGTYPE_p_LUA__Session); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_unsetInputCallback"); (arg1)->unsetInputCallback(); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6429,24 +5182,17 @@ static int _wrap_Session_setInputCallback__SWIG_0(lua_State* L) { char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; - SWIG_check_num_args("setInputCallback",3,3) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setInputCallback",1,"LUA::Session *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("setInputCallback",2,"char *"); - if(!lua_isstring(L,3)) SWIG_fail_arg("setInputCallback",3,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ - SWIG_fail_ptr("Session_setInputCallback",1,SWIGTYPE_p_LUA__Session); - } - - arg2 = (char *)lua_tostring(L, 2); - arg3 = (char *)lua_tostring(L, 3); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + if(!lua_isstring(L,3)) SWIG_fail_arg(3); + arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_setInputCallback"); + arg2 = (char*)lua_tostring(L, 2); + arg3 = (char*)lua_tostring(L, 3); (arg1)->setInputCallback(arg2,arg3); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6458,22 +5204,15 @@ static int _wrap_Session_setInputCallback__SWIG_1(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; char *arg2 = (char *) 0 ; - SWIG_check_num_args("setInputCallback",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setInputCallback",1,"LUA::Session *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("setInputCallback",2,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ - SWIG_fail_ptr("Session_setInputCallback",1,SWIGTYPE_p_LUA__Session); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_setInputCallback"); + arg2 = (char*)lua_tostring(L, 2); (arg1)->setInputCallback(arg2); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6491,7 +5230,7 @@ static int _wrap_Session_setInputCallback(lua_State* L) { int _v; { void *ptr; - if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_LUA__Session, 0)) { + if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_LUA__Session, 0)) { _v = 0; } else { _v = 1; @@ -6510,7 +5249,7 @@ static int _wrap_Session_setInputCallback(lua_State* L) { int _v; { void *ptr; - if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_LUA__Session, 0)) { + if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_LUA__Session, 0)) { _v = 0; } else { _v = 1; @@ -6542,24 +5281,17 @@ static int _wrap_Session_setHangupHook__SWIG_0(lua_State* L) { char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; - SWIG_check_num_args("setHangupHook",3,3) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setHangupHook",1,"LUA::Session *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("setHangupHook",2,"char *"); - if(!lua_isstring(L,3)) SWIG_fail_arg("setHangupHook",3,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ - SWIG_fail_ptr("Session_setHangupHook",1,SWIGTYPE_p_LUA__Session); - } - - arg2 = (char *)lua_tostring(L, 2); - arg3 = (char *)lua_tostring(L, 3); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + if(!lua_isstring(L,3)) SWIG_fail_arg(3); + arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_setHangupHook"); + arg2 = (char*)lua_tostring(L, 2); + arg3 = (char*)lua_tostring(L, 3); (arg1)->setHangupHook(arg2,arg3); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6571,22 +5303,15 @@ static int _wrap_Session_setHangupHook__SWIG_1(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; char *arg2 = (char *) 0 ; - SWIG_check_num_args("setHangupHook",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setHangupHook",1,"LUA::Session *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("setHangupHook",2,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ - SWIG_fail_ptr("Session_setHangupHook",1,SWIGTYPE_p_LUA__Session); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_setHangupHook"); + arg2 = (char*)lua_tostring(L, 2); (arg1)->setHangupHook(arg2); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6604,7 +5329,7 @@ static int _wrap_Session_setHangupHook(lua_State* L) { int _v; { void *ptr; - if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_LUA__Session, 0)) { + if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_LUA__Session, 0)) { _v = 0; } else { _v = 1; @@ -6623,7 +5348,7 @@ static int _wrap_Session_setHangupHook(lua_State* L) { int _v; { void *ptr; - if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_LUA__Session, 0)) { + if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_LUA__Session, 0)) { _v = 0; } else { _v = 1; @@ -6654,20 +5379,13 @@ static int _wrap_Session_ready(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; bool result; - SWIG_check_num_args("ready",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ready",1,"LUA::Session *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ - SWIG_fail_ptr("Session_ready",1,SWIGTYPE_p_LUA__Session); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_ready"); result = (bool)(arg1)->ready(); SWIG_arg=0; - lua_pushboolean(L,(int)(result==true)); SWIG_arg++; + lua_pushboolean(L,(int)result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6682,30 +5400,19 @@ static int _wrap_Session_originate(lua_State* L) { int arg4 ; int result; - SWIG_check_num_args("originate",4,4) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("originate",1,"LUA::Session *"); - if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("originate",2,"CoreSession *"); - if(!lua_isstring(L,3)) SWIG_fail_arg("originate",3,"char *"); - if(!lua_isnumber(L,4)) SWIG_fail_arg("originate",4,"int"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ - SWIG_fail_ptr("Session_originate",1,SWIGTYPE_p_LUA__Session); - } - - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("Session_originate",2,SWIGTYPE_p_CoreSession); - } - - arg3 = (char *)lua_tostring(L, 3); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + if(!lua_isstring(L,3)) SWIG_fail_arg(3); + if(!lua_isnumber(L,4)) SWIG_fail_arg(4); + arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_originate"); + arg2=(CoreSession *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_CoreSession,0,2,"Session_originate"); + arg3 = (char*)lua_tostring(L, 3); arg4 = (int)lua_tonumber(L, 4); result = (int)(arg1)->originate(arg2,arg3,arg4); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6717,20 +5424,15 @@ static int _wrap_Session_cb_function_set(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; char *arg2 = (char *) 0 ; - SWIG_check_num_args("cb_function",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_function",1,"LUA::Session *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("cb_function",2,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ - SWIG_fail_ptr("Session_cb_function_set",1,SWIGTYPE_p_LUA__Session); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_cb_function_set"); + arg2 = (char*)lua_tostring(L, 2); { if (arg1->cb_function) delete [] arg1->cb_function; if (arg2) { - arg1->cb_function = (char *) (new char[strlen((const char *)arg2)+1]); - strcpy((char *)arg1->cb_function, (const char *)arg2); + arg1->cb_function = (char *) (new char[strlen(arg2)+1]); + strcpy((char *) arg1->cb_function,arg2); } else { arg1->cb_function = 0; } @@ -6739,8 +5441,6 @@ static int _wrap_Session_cb_function_set(lua_State* L) { return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6752,20 +5452,13 @@ static int _wrap_Session_cb_function_get(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; char *result = 0 ; - SWIG_check_num_args("cb_function",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_function",1,"LUA::Session *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ - SWIG_fail_ptr("Session_cb_function_get",1,SWIGTYPE_p_LUA__Session); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_cb_function_get"); result = (char *) ((arg1)->cb_function); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6777,20 +5470,15 @@ static int _wrap_Session_cb_arg_set(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; char *arg2 = (char *) 0 ; - SWIG_check_num_args("cb_arg",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_arg",1,"LUA::Session *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("cb_arg",2,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ - SWIG_fail_ptr("Session_cb_arg_set",1,SWIGTYPE_p_LUA__Session); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_cb_arg_set"); + arg2 = (char*)lua_tostring(L, 2); { if (arg1->cb_arg) delete [] arg1->cb_arg; if (arg2) { - arg1->cb_arg = (char *) (new char[strlen((const char *)arg2)+1]); - strcpy((char *)arg1->cb_arg, (const char *)arg2); + arg1->cb_arg = (char *) (new char[strlen(arg2)+1]); + strcpy((char *) arg1->cb_arg,arg2); } else { arg1->cb_arg = 0; } @@ -6799,8 +5487,6 @@ static int _wrap_Session_cb_arg_set(lua_State* L) { return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6812,20 +5498,13 @@ static int _wrap_Session_cb_arg_get(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; char *result = 0 ; - SWIG_check_num_args("cb_arg",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_arg",1,"LUA::Session *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ - SWIG_fail_ptr("Session_cb_arg_get",1,SWIGTYPE_p_LUA__Session); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_cb_arg_get"); result = (char *) ((arg1)->cb_arg); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6837,20 +5516,15 @@ static int _wrap_Session_hangup_func_str_set(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; char *arg2 = (char *) 0 ; - SWIG_check_num_args("hangup_func_str",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_str",1,"LUA::Session *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("hangup_func_str",2,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ - SWIG_fail_ptr("Session_hangup_func_str_set",1,SWIGTYPE_p_LUA__Session); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_hangup_func_str_set"); + arg2 = (char*)lua_tostring(L, 2); { if (arg1->hangup_func_str) delete [] arg1->hangup_func_str; if (arg2) { - arg1->hangup_func_str = (char *) (new char[strlen((const char *)arg2)+1]); - strcpy((char *)arg1->hangup_func_str, (const char *)arg2); + arg1->hangup_func_str = (char *) (new char[strlen(arg2)+1]); + strcpy((char *) arg1->hangup_func_str,arg2); } else { arg1->hangup_func_str = 0; } @@ -6859,8 +5533,6 @@ static int _wrap_Session_hangup_func_str_set(lua_State* L) { return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6872,20 +5544,13 @@ static int _wrap_Session_hangup_func_str_get(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; char *result = 0 ; - SWIG_check_num_args("hangup_func_str",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_str",1,"LUA::Session *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ - SWIG_fail_ptr("Session_hangup_func_str_get",1,SWIGTYPE_p_LUA__Session); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_hangup_func_str_get"); result = (char *) ((arg1)->hangup_func_str); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6897,20 +5562,15 @@ static int _wrap_Session_hangup_func_arg_set(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; char *arg2 = (char *) 0 ; - SWIG_check_num_args("hangup_func_arg",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_arg",1,"LUA::Session *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("hangup_func_arg",2,"char *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ - SWIG_fail_ptr("Session_hangup_func_arg_set",1,SWIGTYPE_p_LUA__Session); - } - - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_hangup_func_arg_set"); + arg2 = (char*)lua_tostring(L, 2); { if (arg1->hangup_func_arg) delete [] arg1->hangup_func_arg; if (arg2) { - arg1->hangup_func_arg = (char *) (new char[strlen((const char *)arg2)+1]); - strcpy((char *)arg1->hangup_func_arg, (const char *)arg2); + arg1->hangup_func_arg = (char *) (new char[strlen(arg2)+1]); + strcpy((char *) arg1->hangup_func_arg,arg2); } else { arg1->hangup_func_arg = 0; } @@ -6919,8 +5579,6 @@ static int _wrap_Session_hangup_func_arg_set(lua_State* L) { return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6932,20 +5590,13 @@ static int _wrap_Session_hangup_func_arg_get(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; char *result = 0 ; - SWIG_check_num_args("hangup_func_arg",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_arg",1,"LUA::Session *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ - SWIG_fail_ptr("Session_hangup_func_arg_get",1,SWIGTYPE_p_LUA__Session); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_hangup_func_arg_get"); result = (char *) ((arg1)->hangup_func_arg); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushstring(L,result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6957,21 +5608,15 @@ static int _wrap_Session_setLUA(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; lua_State *arg2 = (lua_State *) 0 ; - arg2 = L; - SWIG_check_num_args("setLUA",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setLUA",1,"LUA::Session *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ - SWIG_fail_ptr("Session_setLUA",1,SWIGTYPE_p_LUA__Session); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); + arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_setLUA"); + arg2=(lua_State *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_lua_State,0,2,"Session_setLUA"); (arg1)->setLUA(arg2); SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -6997,15 +5642,14 @@ static swig_lua_method swig_LUA_Session_methods[] = { {0,0} }; static swig_lua_attribute swig_LUA_Session_attributes[] = { - { "cb_function", _wrap_Session_cb_function_get, _wrap_Session_cb_function_set}, - { "cb_arg", _wrap_Session_cb_arg_get, _wrap_Session_cb_arg_set}, - { "hangup_func_str", _wrap_Session_hangup_func_str_get, _wrap_Session_hangup_func_str_set}, - { "hangup_func_arg", _wrap_Session_hangup_func_arg_get, _wrap_Session_hangup_func_arg_set}, + { "cb_function",_wrap_Session_cb_function_get, _wrap_Session_cb_function_set}, + { "cb_arg",_wrap_Session_cb_arg_get, _wrap_Session_cb_arg_set}, + { "hangup_func_str",_wrap_Session_hangup_func_str_get, _wrap_Session_hangup_func_str_set}, + { "hangup_func_arg",_wrap_Session_hangup_func_arg_get, _wrap_Session_hangup_func_arg_set}, {0,0,0} }; -static swig_lua_class *swig_LUA_Session_bases[] = {0,0}; -static const char *swig_LUA_Session_base_names[] = {"CoreSession *",0}; -static swig_lua_class _wrap_class_LUA_Session = { "Session", &SWIGTYPE_p_LUA__Session,_wrap_new_Session, swig_delete_Session, swig_LUA_Session_methods, swig_LUA_Session_attributes, swig_LUA_Session_bases, swig_LUA_Session_base_names }; +static swig_lua_class *swig_LUA_Session_bases[] = {&_wrap_class_CoreSession,0}; +swig_lua_class _wrap_class_LUA_Session = { "Session", &SWIGTYPE_p_LUA__Session,_wrap_new_Session, swig_delete_Session, swig_LUA_Session_methods, swig_LUA_Session_attributes, swig_LUA_Session_bases }; static int _wrap_new_Dbh__SWIG_0(lua_State* L) { int SWIG_arg = -1; @@ -7014,20 +5658,17 @@ static int _wrap_new_Dbh__SWIG_0(lua_State* L) { char *arg3 = (char *) 0 ; LUA::Dbh *result = 0 ; - SWIG_check_num_args("LUA::Dbh",3,3) - if(!lua_isstring(L,1)) SWIG_fail_arg("LUA::Dbh",1,"char *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("LUA::Dbh",2,"char *"); - if(!lua_isstring(L,3)) SWIG_fail_arg("LUA::Dbh",3,"char *"); - arg1 = (char *)lua_tostring(L, 1); - arg2 = (char *)lua_tostring(L, 2); - arg3 = (char *)lua_tostring(L, 3); + if(!lua_isstring(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + if(!lua_isstring(L,3)) SWIG_fail_arg(3); + arg1 = (char*)lua_tostring(L, 1); + arg2 = (char*)lua_tostring(L, 2); + arg3 = (char*)lua_tostring(L, 3); result = (LUA::Dbh *)new LUA::Dbh(arg1,arg2,arg3); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Dbh,1); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -7040,18 +5681,15 @@ static int _wrap_new_Dbh__SWIG_1(lua_State* L) { char *arg2 = (char *) 0 ; LUA::Dbh *result = 0 ; - SWIG_check_num_args("LUA::Dbh",2,2) - if(!lua_isstring(L,1)) SWIG_fail_arg("LUA::Dbh",1,"char *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("LUA::Dbh",2,"char *"); - arg1 = (char *)lua_tostring(L, 1); - arg2 = (char *)lua_tostring(L, 2); + if(!lua_isstring(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + arg1 = (char*)lua_tostring(L, 1); + arg2 = (char*)lua_tostring(L, 2); result = (LUA::Dbh *)new LUA::Dbh(arg1,arg2); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Dbh,1); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -7063,16 +5701,13 @@ static int _wrap_new_Dbh__SWIG_2(lua_State* L) { char *arg1 = (char *) 0 ; LUA::Dbh *result = 0 ; - SWIG_check_num_args("LUA::Dbh",1,1) - if(!lua_isstring(L,1)) SWIG_fail_arg("LUA::Dbh",1,"char *"); - arg1 = (char *)lua_tostring(L, 1); + if(!lua_isstring(L,1)) SWIG_fail_arg(1); + arg1 = (char*)lua_tostring(L, 1); result = (LUA::Dbh *)new LUA::Dbh(arg1); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Dbh,1); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -7138,21 +5773,14 @@ static int _wrap_delete_Dbh(lua_State* L) { int SWIG_arg = -1; LUA::Dbh *arg1 = (LUA::Dbh *) 0 ; - SWIG_check_num_args("LUA::~Dbh",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::~Dbh",1,"LUA::Dbh *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,SWIG_POINTER_DISOWN))){ - SWIG_fail_ptr("delete_Dbh",1,SWIGTYPE_p_LUA__Dbh); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(LUA::Dbh *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Dbh,0,1,"delete_Dbh"); delete arg1; SWIG_arg=0; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -7164,20 +5792,13 @@ static int _wrap_Dbh_release(lua_State* L) { LUA::Dbh *arg1 = (LUA::Dbh *) 0 ; bool result; - SWIG_check_num_args("release",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("release",1,"LUA::Dbh *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){ - SWIG_fail_ptr("Dbh_release",1,SWIGTYPE_p_LUA__Dbh); - } - + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + arg1=(LUA::Dbh *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Dbh,0,1,"Dbh_release"); result = (bool)(arg1)->release(); SWIG_arg=0; - lua_pushboolean(L,(int)(result==true)); SWIG_arg++; + lua_pushboolean(L,(int)result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -7191,24 +5812,28 @@ static int _wrap_Dbh_query(lua_State* L) { SWIGLUA_FN arg3 ; bool result; - SWIG_check_num_args("query",3,3) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("query",1,"LUA::Dbh *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("query",2,"char *"); - if(!lua_isfunction(L,3)) SWIG_fail_arg("query",3,"SWIGLUA_FN"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){ - SWIG_fail_ptr("Dbh_query",1,SWIGTYPE_p_LUA__Dbh); + { + SWIGLUA_FN default_swiglua_fn = { + 0 + }; + arg3 = default_swiglua_fn; + } + if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); + if(!lua_isstring(L,2)) SWIG_fail_arg(2); + if(lua_gettop(L)>=3 && !lua_isfunction(L,3)) SWIG_fail_arg(3); + arg1=(LUA::Dbh *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Dbh,0,1,"Dbh_query"); + arg2 = (char*)lua_tostring(L, 2); + if(lua_gettop(L)>=3){ + { + (&arg3)->L = L; + (&arg3)->idx = 3; + } } - - arg2 = (char *)lua_tostring(L, 2); - (&arg3)->L=L; (&arg3)->idx=3; result = (bool)(arg1)->query(arg2,arg3); SWIG_arg=0; - lua_pushboolean(L,(int)(result==true)); SWIG_arg++; + lua_pushboolean(L,(int)result); SWIG_arg++; return SWIG_arg; - if(0) SWIG_fail; - fail: lua_error(L); return SWIG_arg; @@ -7228,8 +5853,7 @@ static swig_lua_attribute swig_LUA_Dbh_attributes[] = { {0,0,0} }; static swig_lua_class *swig_LUA_Dbh_bases[] = {0}; -static const char *swig_LUA_Dbh_base_names[] = {0}; -static swig_lua_class _wrap_class_LUA_Dbh = { "Dbh", &SWIGTYPE_p_LUA__Dbh,_wrap_new_Dbh, swig_delete_Dbh, swig_LUA_Dbh_methods, swig_LUA_Dbh_attributes, swig_LUA_Dbh_bases, swig_LUA_Dbh_base_names }; +swig_lua_class _wrap_class_LUA_Dbh = { "Dbh", &SWIGTYPE_p_LUA__Dbh,_wrap_new_Dbh, swig_delete_Dbh, swig_LUA_Dbh_methods, swig_LUA_Dbh_attributes, swig_LUA_Dbh_bases }; #ifdef __cplusplus } @@ -7238,12 +5862,167 @@ static swig_lua_class _wrap_class_LUA_Dbh = { "Dbh", &SWIGTYPE_p_LUA__Dbh,_wrap_ static const struct luaL_reg swig_commands[] = { { "consoleLog", _wrap_consoleLog}, { "consoleCleanLog", _wrap_consoleCleanLog}, + { "new_IVRMenu", _wrap_new_IVRMenu}, + { "delete_IVRMenu", _wrap_delete_IVRMenu}, + { "IVRMenu_bindAction", _wrap_IVRMenu_bindAction}, + { "IVRMenu_execute", _wrap_IVRMenu_execute}, + { "new_API", _wrap_new_API}, + { "delete_API", _wrap_delete_API}, + { "API_execute", _wrap_API_execute}, + { "API_executeString", _wrap_API_executeString}, + { "API_getTime", _wrap_API_getTime}, + { "input_callback_state_t_function_set", _wrap_input_callback_state_t_function_set}, + { "input_callback_state_t_function_get", _wrap_input_callback_state_t_function_get}, + { "input_callback_state_t_threadState_set", _wrap_input_callback_state_t_threadState_set}, + { "input_callback_state_t_threadState_get", _wrap_input_callback_state_t_threadState_get}, + { "input_callback_state_t_extra_set", _wrap_input_callback_state_t_extra_set}, + { "input_callback_state_t_extra_get", _wrap_input_callback_state_t_extra_get}, + { "input_callback_state_t_funcargs_set", _wrap_input_callback_state_t_funcargs_set}, + { "input_callback_state_t_funcargs_get", _wrap_input_callback_state_t_funcargs_get}, + { "new_input_callback_state_t", _wrap_new_input_callback_state_t}, + { "delete_input_callback_state_t", _wrap_delete_input_callback_state_t}, + { "DTMF_digit_set", _wrap_DTMF_digit_set}, + { "DTMF_digit_get", _wrap_DTMF_digit_get}, + { "DTMF_duration_set", _wrap_DTMF_duration_set}, + { "DTMF_duration_get", _wrap_DTMF_duration_get}, + { "new_DTMF", _wrap_new_DTMF}, + { "delete_DTMF", _wrap_delete_DTMF}, + { "new_Stream",_wrap_new_Stream}, + { "delete_Stream", _wrap_delete_Stream}, + { "Stream_write", _wrap_Stream_write}, + { "Stream_get_data", _wrap_Stream_get_data}, + { "Event_event_set", _wrap_Event_event_set}, + { "Event_event_get", _wrap_Event_event_get}, + { "Event_serialized_string_set", _wrap_Event_serialized_string_set}, + { "Event_serialized_string_get", _wrap_Event_serialized_string_get}, + { "Event_mine_set", _wrap_Event_mine_set}, + { "Event_mine_get", _wrap_Event_mine_get}, + { "new_Event",_wrap_new_Event}, + { "delete_Event", _wrap_delete_Event}, + { "Event_serialize", _wrap_Event_serialize}, + { "Event_setPriority", _wrap_Event_setPriority}, + { "Event_getHeader", _wrap_Event_getHeader}, + { "Event_getBody", _wrap_Event_getBody}, + { "Event_getType", _wrap_Event_getType}, + { "Event_addBody", _wrap_Event_addBody}, + { "Event_addHeader", _wrap_Event_addHeader}, + { "Event_delHeader", _wrap_Event_delHeader}, + { "Event_fire", _wrap_Event_fire}, + { "EventConsumer_events_set", _wrap_EventConsumer_events_set}, + { "EventConsumer_events_get", _wrap_EventConsumer_events_get}, + { "EventConsumer_e_event_id_set", _wrap_EventConsumer_e_event_id_set}, + { "EventConsumer_e_event_id_get", _wrap_EventConsumer_e_event_id_get}, + { "EventConsumer_e_callback_set", _wrap_EventConsumer_e_callback_set}, + { "EventConsumer_e_callback_get", _wrap_EventConsumer_e_callback_get}, + { "EventConsumer_e_subclass_name_set", _wrap_EventConsumer_e_subclass_name_set}, + { "EventConsumer_e_subclass_name_get", _wrap_EventConsumer_e_subclass_name_get}, + { "EventConsumer_e_cb_arg_set", _wrap_EventConsumer_e_cb_arg_set}, + { "EventConsumer_e_cb_arg_get", _wrap_EventConsumer_e_cb_arg_get}, + { "EventConsumer_enodes_set", _wrap_EventConsumer_enodes_set}, + { "EventConsumer_enodes_get", _wrap_EventConsumer_enodes_get}, + { "EventConsumer_node_index_set", _wrap_EventConsumer_node_index_set}, + { "EventConsumer_node_index_get", _wrap_EventConsumer_node_index_get}, + { "new_EventConsumer", _wrap_new_EventConsumer}, + { "delete_EventConsumer", _wrap_delete_EventConsumer}, + { "EventConsumer_bind", _wrap_EventConsumer_bind}, + { "EventConsumer_pop", _wrap_EventConsumer_pop}, + { "delete_CoreSession", _wrap_delete_CoreSession}, + { "CoreSession_session_set", _wrap_CoreSession_session_set}, + { "CoreSession_session_get", _wrap_CoreSession_session_get}, + { "CoreSession_channel_set", _wrap_CoreSession_channel_set}, + { "CoreSession_channel_get", _wrap_CoreSession_channel_get}, + { "CoreSession_flags_set", _wrap_CoreSession_flags_set}, + { "CoreSession_flags_get", _wrap_CoreSession_flags_get}, + { "CoreSession_allocated_set", _wrap_CoreSession_allocated_set}, + { "CoreSession_allocated_get", _wrap_CoreSession_allocated_get}, + { "CoreSession_cb_state_set", _wrap_CoreSession_cb_state_set}, + { "CoreSession_cb_state_get", _wrap_CoreSession_cb_state_get}, + { "CoreSession_hook_state_set", _wrap_CoreSession_hook_state_set}, + { "CoreSession_hook_state_get", _wrap_CoreSession_hook_state_get}, + { "CoreSession_cause_set", _wrap_CoreSession_cause_set}, + { "CoreSession_cause_get", _wrap_CoreSession_cause_get}, + { "CoreSession_uuid_set", _wrap_CoreSession_uuid_set}, + { "CoreSession_uuid_get", _wrap_CoreSession_uuid_get}, + { "CoreSession_tts_name_set", _wrap_CoreSession_tts_name_set}, + { "CoreSession_tts_name_get", _wrap_CoreSession_tts_name_get}, + { "CoreSession_voice_name_set", _wrap_CoreSession_voice_name_set}, + { "CoreSession_voice_name_get", _wrap_CoreSession_voice_name_get}, + { "CoreSession_answer", _wrap_CoreSession_answer}, + { "CoreSession_preAnswer", _wrap_CoreSession_preAnswer}, + { "CoreSession_hangup", _wrap_CoreSession_hangup}, + { "CoreSession_hangupState", _wrap_CoreSession_hangupState}, + { "CoreSession_setVariable", _wrap_CoreSession_setVariable}, + { "CoreSession_setPrivate", _wrap_CoreSession_setPrivate}, + { "CoreSession_getPrivate", _wrap_CoreSession_getPrivate}, + { "CoreSession_getVariable", _wrap_CoreSession_getVariable}, + { "CoreSession_process_callback_result", _wrap_CoreSession_process_callback_result}, + { "CoreSession_say", _wrap_CoreSession_say}, + { "CoreSession_sayPhrase", _wrap_CoreSession_sayPhrase}, + { "CoreSession_hangupCause", _wrap_CoreSession_hangupCause}, + { "CoreSession_getState", _wrap_CoreSession_getState}, + { "CoreSession_recordFile", _wrap_CoreSession_recordFile}, + { "CoreSession_originate", _wrap_CoreSession_originate}, + { "CoreSession_destroy", _wrap_CoreSession_destroy}, + { "CoreSession_setDTMFCallback", _wrap_CoreSession_setDTMFCallback}, + { "CoreSession_speak", _wrap_CoreSession_speak}, + { "CoreSession_set_tts_parms", _wrap_CoreSession_set_tts_parms}, + { "CoreSession_collectDigits",_wrap_CoreSession_collectDigits}, + { "CoreSession_getDigits",_wrap_CoreSession_getDigits}, + { "CoreSession_transfer", _wrap_CoreSession_transfer}, + { "CoreSession_read", _wrap_CoreSession_read}, + { "CoreSession_playAndGetDigits", _wrap_CoreSession_playAndGetDigits}, + { "CoreSession_streamFile", _wrap_CoreSession_streamFile}, + { "CoreSession_sleep", _wrap_CoreSession_sleep}, + { "CoreSession_flushEvents", _wrap_CoreSession_flushEvents}, + { "CoreSession_flushDigits", _wrap_CoreSession_flushDigits}, + { "CoreSession_setAutoHangup", _wrap_CoreSession_setAutoHangup}, + { "CoreSession_setHangupHook", _wrap_CoreSession_setHangupHook}, + { "CoreSession_ready", _wrap_CoreSession_ready}, + { "CoreSession_bridged", _wrap_CoreSession_bridged}, + { "CoreSession_answered", _wrap_CoreSession_answered}, + { "CoreSession_mediaReady", _wrap_CoreSession_mediaReady}, + { "CoreSession_waitForAnswer", _wrap_CoreSession_waitForAnswer}, + { "CoreSession_execute", _wrap_CoreSession_execute}, + { "CoreSession_sendEvent", _wrap_CoreSession_sendEvent}, + { "CoreSession_setEventData", _wrap_CoreSession_setEventData}, + { "CoreSession_getXMLCDR", _wrap_CoreSession_getXMLCDR}, + { "CoreSession_begin_allow_threads", _wrap_CoreSession_begin_allow_threads}, + { "CoreSession_end_allow_threads", _wrap_CoreSession_end_allow_threads}, + { "CoreSession_get_uuid", _wrap_CoreSession_get_uuid}, + { "CoreSession_get_cb_args", _wrap_CoreSession_get_cb_args}, + { "CoreSession_check_hangup_hook", _wrap_CoreSession_check_hangup_hook}, + { "CoreSession_run_dtmf_callback", _wrap_CoreSession_run_dtmf_callback}, { "console_log", _wrap_console_log}, { "console_clean_log", _wrap_console_clean_log}, { "msleep", _wrap_msleep}, { "bridge", _wrap_bridge}, { "hanguphook", _wrap_hanguphook}, { "dtmf_callback", _wrap_dtmf_callback}, + { "new_Session",_wrap_new_Session}, + { "delete_Session", _wrap_delete_Session}, + { "Session_destroy", _wrap_Session_destroy}, + { "Session_begin_allow_threads", _wrap_Session_begin_allow_threads}, + { "Session_end_allow_threads", _wrap_Session_end_allow_threads}, + { "Session_check_hangup_hook", _wrap_Session_check_hangup_hook}, + { "Session_run_dtmf_callback", _wrap_Session_run_dtmf_callback}, + { "Session_unsetInputCallback", _wrap_Session_unsetInputCallback}, + { "Session_setInputCallback",_wrap_Session_setInputCallback}, + { "Session_setHangupHook",_wrap_Session_setHangupHook}, + { "Session_ready", _wrap_Session_ready}, + { "Session_originate", _wrap_Session_originate}, + { "Session_cb_function_set", _wrap_Session_cb_function_set}, + { "Session_cb_function_get", _wrap_Session_cb_function_get}, + { "Session_cb_arg_set", _wrap_Session_cb_arg_set}, + { "Session_cb_arg_get", _wrap_Session_cb_arg_get}, + { "Session_hangup_func_str_set", _wrap_Session_hangup_func_str_set}, + { "Session_hangup_func_str_get", _wrap_Session_hangup_func_str_get}, + { "Session_hangup_func_arg_set", _wrap_Session_hangup_func_arg_set}, + { "Session_hangup_func_arg_get", _wrap_Session_hangup_func_arg_get}, + { "Session_setLUA", _wrap_Session_setLUA}, + { "new_Dbh",_wrap_new_Dbh}, + { "delete_Dbh", _wrap_delete_Dbh}, + { "Dbh_release", _wrap_Dbh_release}, + { "Dbh_query", _wrap_Dbh_query}, {0,0} }; @@ -7260,9 +6039,10 @@ static swig_lua_const_info swig_constants[] = { /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ -static void *_p_LUA__SessionTo_p_CoreSession(void *x, int *newmemory) { +static void *_p_LUA__SessionTo_p_CoreSession(void *x) { return (void *)((CoreSession *) ((LUA::Session *) x)); } +static swig_type_info _swigt__SWIGLUA_FN = {"_SWIGLUA_FN", "SWIGLUA_FN", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_API = {"_p_API", "API *", 0, 0, (void*)&_wrap_class_API, 0}; static swig_type_info _swigt__p_CoreSession = {"_p_CoreSession", "CoreSession *", 0, 0, (void*)&_wrap_class_CoreSession, 0}; static swig_type_info _swigt__p_DTMF = {"_p_DTMF", "DTMF *", 0, 0, (void*)&_wrap_class_DTMF, 0}; @@ -7271,9 +6051,8 @@ static swig_type_info _swigt__p_EventConsumer = {"_p_EventConsumer", "EventConsu static swig_type_info _swigt__p_IVRMenu = {"_p_IVRMenu", "IVRMenu *", 0, 0, (void*)&_wrap_class_IVRMenu, 0}; static swig_type_info _swigt__p_LUA__Dbh = {"_p_LUA__Dbh", "LUA::Dbh *", 0, 0, (void*)&_wrap_class_LUA_Dbh, 0}; static swig_type_info _swigt__p_LUA__Session = {"_p_LUA__Session", "LUA::Session *", 0, 0, (void*)&_wrap_class_LUA_Session, 0}; -static swig_type_info _swigt__p_SWIGLUA_FN = {"_p_SWIGLUA_FN", "SWIGLUA_FN *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Stream = {"_p_Stream", "Stream *", 0, 0, (void*)&_wrap_class_Stream, 0}; -static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state", "input_callback_state_t *|input_callback_state *", 0, 0, (void*)&_wrap_class_input_callback_state_t, 0}; +static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state", "input_callback_state *", 0, 0, (void*)&_wrap_class_input_callback_state_t, 0}; static swig_type_info _swigt__p_lua_State = {"_p_lua_State", "lua_State *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_switch_event_node_t = {"_p_p_switch_event_node_t", "switch_event_node_t **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_session_flag_t = {"_p_session_flag_t", "enum session_flag_t *|session_flag_t *", 0, 0, (void*)0, 0}; @@ -7292,8 +6071,15 @@ static swig_type_info _swigt__p_switch_status_t = {"_p_switch_status_t", "switch static swig_type_info _swigt__p_switch_stream_handle_t = {"_p_switch_stream_handle_t", "switch_stream_handle_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 _swigt__switch_call_cause_t = {"_switch_call_cause_t", "switch_call_cause_t", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__switch_channel_state_t = {"_switch_channel_state_t", "switch_channel_state_t", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__switch_event_types_t = {"_switch_event_types_t", "switch_event_types_t", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__switch_input_type_t = {"_switch_input_type_t", "switch_input_type_t", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__switch_priority_t = {"_switch_priority_t", "switch_priority_t", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__uint32_t = {"_uint32_t", "uint32_t", 0, 0, (void*)0, 0}; static swig_type_info *swig_type_initial[] = { + &_swigt__SWIGLUA_FN, &_swigt__p_API, &_swigt__p_CoreSession, &_swigt__p_DTMF, @@ -7302,7 +6088,6 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_IVRMenu, &_swigt__p_LUA__Dbh, &_swigt__p_LUA__Session, - &_swigt__p_SWIGLUA_FN, &_swigt__p_Stream, &_swigt__p_input_callback_state, &_swigt__p_lua_State, @@ -7323,8 +6108,15 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_switch_stream_handle_t, &_swigt__p_uint32_t, &_swigt__p_void, + &_swigt__switch_call_cause_t, + &_swigt__switch_channel_state_t, + &_swigt__switch_event_types_t, + &_swigt__switch_input_type_t, + &_swigt__switch_priority_t, + &_swigt__uint32_t, }; +static swig_cast_info _swigc__SWIGLUA_FN[] = { {&_swigt__SWIGLUA_FN, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_API[] = { {&_swigt__p_API, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_CoreSession[] = { {&_swigt__p_CoreSession, 0, 0, 0}, {&_swigt__p_LUA__Session, _p_LUA__SessionTo_p_CoreSession, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_DTMF[] = { {&_swigt__p_DTMF, 0, 0, 0},{0, 0, 0, 0}}; @@ -7333,7 +6125,6 @@ static swig_cast_info _swigc__p_EventConsumer[] = { {&_swigt__p_EventConsumer, static swig_cast_info _swigc__p_IVRMenu[] = { {&_swigt__p_IVRMenu, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_LUA__Dbh[] = { {&_swigt__p_LUA__Dbh, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_LUA__Session[] = { {&_swigt__p_LUA__Session, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_SWIGLUA_FN[] = { {&_swigt__p_SWIGLUA_FN, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Stream[] = { {&_swigt__p_Stream, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_input_callback_state[] = { {&_swigt__p_input_callback_state, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_lua_State[] = { {&_swigt__p_lua_State, 0, 0, 0},{0, 0, 0, 0}}; @@ -7354,8 +6145,15 @@ static swig_cast_info _swigc__p_switch_status_t[] = { {&_swigt__p_switch_status static swig_cast_info _swigc__p_switch_stream_handle_t[] = { {&_swigt__p_switch_stream_handle_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 _swigc__switch_call_cause_t[] = { {&_swigt__switch_call_cause_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__switch_channel_state_t[] = { {&_swigt__switch_channel_state_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__switch_event_types_t[] = { {&_swigt__switch_event_types_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__switch_input_type_t[] = { {&_swigt__switch_input_type_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__switch_priority_t[] = { {&_swigt__switch_priority_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__uint32_t[] = { {&_swigt__uint32_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info *swig_cast_initial[] = { + _swigc__SWIGLUA_FN, _swigc__p_API, _swigc__p_CoreSession, _swigc__p_DTMF, @@ -7364,7 +6162,6 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_IVRMenu, _swigc__p_LUA__Dbh, _swigc__p_LUA__Session, - _swigc__p_SWIGLUA_FN, _swigc__p_Stream, _swigc__p_input_callback_state, _swigc__p_lua_State, @@ -7385,6 +6182,12 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_switch_stream_handle_t, _swigc__p_uint32_t, _swigc__p_void, + _swigc__switch_call_cause_t, + _swigc__switch_channel_state_t, + _swigc__switch_event_types_t, + _swigc__switch_input_type_t, + _swigc__switch_priority_t, + _swigc__uint32_t, }; @@ -7404,7 +6207,7 @@ static swig_cast_info *swig_cast_initial[] = { * structures together. * * The generated swig_type_info structures are assigned staticly to an initial - * array. We just loop through that array, and handle each type individually. + * 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 @@ -7442,58 +6245,32 @@ extern "C" { #define SWIGRUNTIME_DEBUG #endif - SWIGRUNTIME void SWIG_InitializeModule(void *clientdata) { size_t i; - swig_module_info *module_head, *iter; - int found, init; + swig_module_info *module_head; + static int init_run = 0; clientdata = clientdata; - /* 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; - init = 1; - } else { - init = 0; - } + 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) { - /* 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 */ + 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); } - - /* When multiple interpeters are used, a module could have already been initialized in - a different interpreter, but not yet have a pointer in this interpreter. - In this case, we do not want to continue adding types... everything should be - set up already */ - if (init == 0) return; - + /* Now work on filling in swig_module.types */ #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: size %d\n", swig_module.size); @@ -7630,56 +6407,73 @@ SWIG_PropagateClientData(void) { /* Forward declaration of where the user's %init{} gets inserted */ -void SWIG_init_user(lua_State* L ); - #ifdef __cplusplus extern "C" { #endif +void SWIG_init_user(lua_State* L ); + /* this is the initialization function - added at the very end of the code - the function is always called SWIG_init, but an eariler #define will rename it + added at the very end of the code + the function is always called SWIG_init, but an eariler #define will rename it */ SWIGEXPORT int SWIG_init(lua_State* L) { - int i; - /* start with global table */ - lua_pushvalue(L,LUA_GLOBALSINDEX); - /* SWIG's internal initalisation */ - SWIG_InitializeModule((void*)L); - SWIG_PropagateClientData(); - /* add a global fn */ - SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type); - SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal); - /* begin the module (its a table with the same name as the module) */ - SWIG_Lua_module_begin(L,SWIG_name); - /* add commands/functions */ - for (i = 0; swig_commands[i].name; i++){ - SWIG_Lua_module_add_function(L,swig_commands[i].name,swig_commands[i].func); - } - /* add variables */ - for (i = 0; swig_variables[i].name; i++){ - SWIG_Lua_module_add_variable(L,swig_variables[i].name,swig_variables[i].get,swig_variables[i].set); - } - /* set up base class pointers (the hierachy) */ - for (i = 0; swig_types[i]; i++){ - if (swig_types[i]->clientdata){ - SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata)); - } - } - /* additional registration structs & classes in lua */ - for (i = 0; swig_types[i]; i++){ - if (swig_types[i]->clientdata){ - SWIG_Lua_class_register(L,(swig_lua_class*)(swig_types[i]->clientdata)); - } - } - /* constants */ - SWIG_Lua_InstallConstants(L,swig_constants); - /* invoke user-specific initialization */ - SWIG_init_user(L); - /* end module */ - lua_pop(L,1); /* tidy stack (remove module table)*/ - lua_pop(L,1); /* tidy stack (remove global table)*/ - return 1; + int i; + + /* start with global table */ + lua_pushvalue(L,LUA_GLOBALSINDEX); + + SWIG_InitializeModule((void*)L); + SWIG_PropagateClientData(); + + /* invoke user-specific initialization */ + SWIG_init_user(L); + + /* add a global fn */ + SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type); + SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal); + + /* begin the module (its a table with the same name as the module) */ + SWIG_Lua_module_begin(L,SWIG_name); + /* add commands/functions */ + for (i = 0; swig_commands[i].name; i++){ + SWIG_Lua_module_add_function(L,swig_commands[i].name,swig_commands[i].func); + } + /*luaL_openlib(L,NULL,swig_commands,0);*/ + /* all in one */ + /*luaL_openlib(L,SWIG_name,swig_commands,0);*/ + /* add variables */ + for (i = 0; swig_variables[i].name; i++){ + SWIG_Lua_module_add_variable(L,swig_variables[i].name,swig_variables[i].get,swig_variables[i].set); + } + + /* additional registration structs & classes in lua: */ + for (i = 0; swig_types[i]; i++){ + if (swig_types[i]->clientdata){ + SWIG_Lua_class_register(L,(swig_lua_class*)(swig_types[i]->clientdata)); + } + } + + /* constants */ + SWIG_Lua_InstallConstants(L,swig_constants); + + /* end module */ + /*SWIG_Lua_module_end(L);*/ + lua_pop(L,1); /* tidy stack (remove module table)*/ + lua_pop(L,1); /* tidy stack (remove global table)*/ + + return 1; +} + +/* Lua 5.1 has a different name for importing libraries +luaopen_XXX, where XXX is the name of the module (not capitalised) +this function will allow Lua 5.1 to import correctly. +There is a #define in the wrapper to rename 'SWIG_import' to the correct name +*/ + +SWIGEXPORT int SWIG_import(lua_State* L) +{ + return SWIG_init(L); } #ifdef __cplusplus @@ -7687,13 +6481,12 @@ SWIGEXPORT int SWIG_init(lua_State* L) #endif -const char* SWIG_LUACODE= - ""; - +#ifdef __cplusplus +extern "C" +#endif void SWIG_init_user(lua_State* L) { - /* exec Lua code if applicable */ - SWIG_Lua_dostring(L,SWIG_LUACODE); + } #include "mod_lua_extra.c" From 402f2391dc15152f96619c9bfb21809b13ccc46d Mon Sep 17 00:00:00 2001 From: Marc Olivier Chouinard Date: Thu, 9 Sep 2010 20:03:36 -0400 Subject: [PATCH 13/63] mod_commands: Fix user_data returning the first value found instead of the last. Also add support to get variable from the group. --- .../applications/mod_commands/mod_commands.c | 49 ++++++++++++------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index e1eb2a6b6a..e308a0004f 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -605,11 +605,12 @@ SWITCH_STANDARD_API(in_group_function) SWITCH_STANDARD_API(user_data_function) { - switch_xml_t x_domain, xml = NULL, x_user = NULL, x_param, x_params; + switch_xml_t x_domain, xml = NULL, x_user = NULL, x_group = NULL, x_param, x_params; int argc; char *mydata = NULL, *argv[3], *key = NULL, *type = NULL, *user, *domain; char delim = ' '; const char *container = "params", *elem = "param"; + const char *result = NULL; switch_event_t *params = NULL; if (zstr(cmd) || !(mydata = strdup(cmd))) { @@ -637,10 +638,10 @@ SWITCH_STANDARD_API(user_data_function) switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "domain", domain); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "type", type); - if (key && type && switch_xml_locate_user("id", user, domain, NULL, &xml, &x_domain, &x_user, NULL, params) == SWITCH_STATUS_SUCCESS) { + if (key && type && switch_xml_locate_user("id", user, domain, NULL, &xml, &x_domain, &x_user, &x_group, params) == SWITCH_STATUS_SUCCESS) { if (!strcmp(type, "attr")) { const char *attr = switch_xml_attr_soft(x_user, key); - stream->write_function(stream, "%s", attr); + result = attr; goto end; } @@ -649,33 +650,45 @@ SWITCH_STANDARD_API(user_data_function) elem = "variable"; } - if ((x_params = switch_xml_child(x_user, container))) { - for (x_param = switch_xml_child(x_params, elem); x_param; x_param = x_param->next) { - const char *var = switch_xml_attr(x_param, "name"); - const char *val = switch_xml_attr(x_param, "value"); - - if (var && val && !strcasecmp(var, key)) { - stream->write_function(stream, "%s", val); - goto end; - } - - } - } - if ((x_params = switch_xml_child(x_domain, container))) { for (x_param = switch_xml_child(x_params, elem); x_param; x_param = x_param->next) { const char *var = switch_xml_attr(x_param, "name"); const char *val = switch_xml_attr(x_param, "value"); if (var && val && !strcasecmp(var, key)) { - stream->write_function(stream, "%s", val); - goto end; + result = val; + } + + } + } + + if (x_group && (x_params = switch_xml_child(x_group, container))) { + for (x_param = switch_xml_child(x_params, elem); x_param; x_param = x_param->next) { + const char *var = switch_xml_attr(x_param, "name"); + const char *val = switch_xml_attr(x_param, "value"); + + if (var && val && !strcasecmp(var, key)) { + result = val; + } + } + } + + if ((x_params = switch_xml_child(x_user, container))) { + for (x_param = switch_xml_child(x_params, elem); x_param; x_param = x_param->next) { + const char *var = switch_xml_attr(x_param, "name"); + const char *val = switch_xml_attr(x_param, "value"); + + if (var && val && !strcasecmp(var, key)) { + result = val; } } } } end: + if (result) { + stream->write_function(stream, "%s", result); + } switch_xml_free(xml); switch_safe_free(mydata); switch_event_destroy(¶ms); From 7eae2b629e43a6ddf48657286895588689057494 Mon Sep 17 00:00:00 2001 From: Leon de Rooij Date: Fri, 10 Sep 2010 02:58:37 +0200 Subject: [PATCH 14/63] mod_lua: cannot assume idx != 0 if cb_fun is provided --- src/mod/languages/mod_lua/freeswitch_lua.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/languages/mod_lua/freeswitch_lua.cpp b/src/mod/languages/mod_lua/freeswitch_lua.cpp index 8321f87e2f..d60ae737a8 100644 --- a/src/mod/languages/mod_lua/freeswitch_lua.cpp +++ b/src/mod/languages/mod_lua/freeswitch_lua.cpp @@ -367,7 +367,7 @@ int Dbh::query_callback(void *pArg, int argc, char **argv, char **cargv) bool Dbh::query(char *sql, SWIGLUA_FN lua_fun) { if (connected) { - if (lua_fun.L && lua_fun.idx != 0) { + if (lua_fun.L) { if (switch_cache_db_execute_sql_callback(dbh, sql, query_callback, &lua_fun, NULL) == SWITCH_STATUS_SUCCESS) { return true; } From 163ca31f2c0e7bb4f3e71806fac8147f3c426fc4 Mon Sep 17 00:00:00 2001 From: Marc Olivier Chouinard Date: Thu, 9 Sep 2010 22:43:27 -0400 Subject: [PATCH 15/63] mod_directory: Add variable directory_search_order to allow to search by first name by default is set to "first_name" --- src/mod/applications/mod_directory/mod_directory.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/mod/applications/mod_directory/mod_directory.c b/src/mod/applications/mod_directory/mod_directory.c index d3389ab3b1..bfad1a68f6 100644 --- a/src/mod/applications/mod_directory/mod_directory.c +++ b/src/mod/applications/mod_directory/mod_directory.c @@ -884,6 +884,18 @@ SWITCH_STANDARD_APP(directory_function) if (strcasecmp(profile->search_order, "last_name")) { s_param.search_by_last_name = 0; } + + { + const char *var_search_order = switch_channel_get_variable(channel, "directory_search_order"); + if (var_search_order) { + if (!strcasecmp(var_search_order, "first_name")) { + s_param.search_by_last_name = 0; + } else { + s_param.search_by_last_name = 1; + } + } + } + attempts = profile->max_menu_attempt; s_param.try_again = 1; while (switch_channel_ready(channel) && (s_param.try_again && attempts-- > 0)) { From 1a75821df8477cb3a7d959034f3d550076ffcbca Mon Sep 17 00:00:00 2001 From: Marc Olivier Chouinard Date: Thu, 9 Sep 2010 23:25:35 -0400 Subject: [PATCH 16/63] switch_loadable_module: Add attribute "path" to autoload_configs/modules.conf.xml entry. Useful for module made outside of fs source tree like mod_com_g729. When you delete your lib bin mod folder after a clean install, you don't have to remember to recopy mod_com_g729 if located in mod_com folder. --- src/switch_loadable_module.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/switch_loadable_module.c b/src/switch_loadable_module.c index 67325648b2..bf636dd4c2 100644 --- a/src/switch_loadable_module.c +++ b/src/switch_loadable_module.c @@ -1277,6 +1277,7 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_init() for (ld = switch_xml_child(mods, "load"); ld; ld = ld->next) { switch_bool_t global = SWITCH_FALSE; const char *val = switch_xml_attr_soft(ld, "module"); + const char *path = switch_xml_attr_soft(ld, "path"); const char *critical = switch_xml_attr_soft(ld, "critical"); const char *sglobal = switch_xml_attr_soft(ld, "global"); if (zstr(val) || (strchr(val, '.') && !strstr(val, ext) && !strstr(val, EXT))) { @@ -1285,7 +1286,10 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_init() } global = switch_true(sglobal); - if (switch_loadable_module_load_module_ex((char *) SWITCH_GLOBAL_dirs.mod_dir, (char *) val, SWITCH_FALSE, global, &err) == SWITCH_STATUS_FALSE) { + if (path && zstr(path)) { + path = SWITCH_GLOBAL_dirs.mod_dir; + } + if (switch_loadable_module_load_module_ex((char *) path, (char *) val, SWITCH_FALSE, global, &err) == SWITCH_STATUS_FALSE) { if (critical && switch_true(critical)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Failed to load critical module '%s', abort()\n", val); abort(); @@ -1307,13 +1311,18 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_init() for (ld = switch_xml_child(mods, "load"); ld; ld = ld->next) { switch_bool_t global = SWITCH_FALSE; const char *val = switch_xml_attr_soft(ld, "module"); + const char *path = switch_xml_attr_soft(ld, "path"); const char *sglobal = switch_xml_attr_soft(ld, "global"); if (zstr(val) || (strchr(val, '.') && !strstr(val, ext) && !strstr(val, EXT))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Invalid extension for %s\n", val); continue; } global = switch_true(sglobal); - switch_loadable_module_load_module_ex((char *) SWITCH_GLOBAL_dirs.mod_dir, (char *) val, SWITCH_FALSE, global, &err); + + if (path && zstr(path)) { + path = SWITCH_GLOBAL_dirs.mod_dir; + } + switch_loadable_module_load_module_ex((char *) path, (char *) val, SWITCH_FALSE, global, &err); count++; } } From 83aeda7956943bff4556202dc182d59b8e96a83a Mon Sep 17 00:00:00 2001 From: Marc Olivier Chouinard Date: Thu, 9 Sep 2010 23:40:14 -0400 Subject: [PATCH 17/63] mod_voicemail: Allow to forward a message or send it via email key during the playback of the recording, not just when the menu is playing. --- src/mod/applications/mod_voicemail/mod_voicemail.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index c683712922..e89bda47f1 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -824,7 +824,8 @@ static switch_status_t control_playback(switch_core_session_t *session, void *in if (!cc->noexit && (dtmf->digit == *cc->profile->delete_file_key || dtmf->digit == *cc->profile->save_file_key || dtmf->digit == *cc->profile->prev_msg_key || dtmf->digit == *cc->profile->next_msg_key - || dtmf->digit == *cc->profile->terminator_key || dtmf->digit == *cc->profile->skip_info_key)) { + || dtmf->digit == *cc->profile->terminator_key || dtmf->digit == *cc->profile->skip_info_key + || dtmf->digit == *cc->profile->email_key || dtmf->digit == *cc->profile->forward_key)) { *cc->buf = dtmf->digit; return SWITCH_STATUS_BREAK; } From 5bb007889c0713eb42cc93050995b50fa8bd7c6f Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Fri, 10 Sep 2010 12:15:34 -0400 Subject: [PATCH 18/63] update sangoma codec XML sample configuration file --- conf/autoload_configs/sangoma_codec.conf.xml | 25 +++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/conf/autoload_configs/sangoma_codec.conf.xml b/conf/autoload_configs/sangoma_codec.conf.xml index da4b8ed643..14fae63a6b 100644 --- a/conf/autoload_configs/sangoma_codec.conf.xml +++ b/conf/autoload_configs/sangoma_codec.conf.xml @@ -8,25 +8,22 @@ --> - + + - - - - - - - - - - - - - From d5ff3e04ab34475a66b75363db921b6100b6c257 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 10 Sep 2010 11:59:47 -0500 Subject: [PATCH 19/63] include accumulated stats from rtcp into vars --- src/include/switch_types.h | 7 +++++++ src/mod/endpoints/mod_sofia/sofia_glue.c | 3 +++ src/switch_rtp.c | 3 +++ 3 files changed, 13 insertions(+) diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 5a88cd5751..c3b649cb68 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -479,9 +479,16 @@ typedef struct { switch_size_t flush_packet_count; } switch_rtp_numbers_t; + +typedef struct { + uint32_t packet_count; + uint32_t octet_count; +} switch_rtcp_numbers_t; + typedef struct { switch_rtp_numbers_t inbound; switch_rtp_numbers_t outbound; + switch_rtcp_numbers_t rtcp; } switch_rtp_stats_t; typedef enum { diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 473dfb9aca..8054c8df73 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -2238,6 +2238,9 @@ static void set_stats(switch_rtp_t *rtp_session, private_object_t *tech_pvt, con add_stat(stats->outbound.dtmf_packet_count, "out_dtmf_packet_count"); add_stat(stats->outbound.cng_packet_count, "out_cng_packet_count"); + add_stat(stats->rtcp.packet_count, "rtcp_packet_count"); + add_stat(stats->rtcp.octet_count, "rtcp_octet_count"); + } } diff --git a/src/switch_rtp.c b/src/switch_rtp.c index c9f9bfa3cf..710415afdb 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -2191,6 +2191,9 @@ static switch_status_t read_rtcp_packet(switch_rtp_t *rtp_session, switch_size_t rtp_session->rtcp_fresh_frame = 1; + rtp_session->stats.rtcp.packet_count += sr->pc; + rtp_session->stats.rtcp.octet_count += sr->oc; + /* sender report */ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10,"Received a SR with %d report blocks, " \ "length in words = %d, " \ From fb48d5ca9d2a1266a1ddd1714285d4c0b61db77e Mon Sep 17 00:00:00 2001 From: Brian West Date: Fri, 10 Sep 2010 12:35:40 -0500 Subject: [PATCH 20/63] swigall --- src/mod/languages/mod_lua/mod_lua_wrap.cpp | 4178 +++++++++++++------- 1 file changed, 2698 insertions(+), 1480 deletions(-) diff --git a/src/mod/languages/mod_lua/mod_lua_wrap.cpp b/src/mod/languages/mod_lua/mod_lua_wrap.cpp index 962ebe3eca..4bf4b67154 100644 --- a/src/mod/languages/mod_lua/mod_lua_wrap.cpp +++ b/src/mod/languages/mod_lua/mod_lua_wrap.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.29 + * Version 1.3.35 * * 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 @@ -10,7 +10,7 @@ #ifdef __cplusplus -template class SwigValueWrapper { +template class SwigValueWrapper { T *tt; public: SwigValueWrapper() : tt(0) { } @@ -23,6 +23,10 @@ public: private: SwigValueWrapper& operator=(const SwigValueWrapper& rhs); }; + +template T SwigValueInit() { + return T(); +} #endif /* ----------------------------------------------------------------------------- @@ -32,14 +36,14 @@ private: /* 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 +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template # else -# define SWIGTEMPLATEDISAMBIGUATOR +# define SWIGTEMPLATEDISAMBIGUATOR # endif #endif @@ -118,10 +122,16 @@ private: #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 +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + + /* ----------------------------------------------------------------------------- * swigrun.swg * @@ -131,7 +141,7 @@ private: /* 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 "4" /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ #ifdef SWIG_TYPE_TABLE @@ -166,6 +176,7 @@ private: /* Flags for pointer conversions */ #define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 /* Flags for new pointer objects */ #define SWIG_POINTER_OWN 0x1 @@ -306,10 +317,10 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) { extern "C" { #endif -typedef void *(*swig_converter_func)(void *); +typedef void *(*swig_converter_func)(void *, int *); typedef struct swig_type_info *(*swig_dycast_func)(void **); -/* Structure to store inforomation on one type */ +/* Structure to store information on one type */ typedef struct swig_type_info { const char *name; /* mangled name of this type */ const char *str; /* human readable name of this type */ @@ -354,7 +365,7 @@ SWIG_TypeNameComp(const char *f1, const char *l1, while ((*f2 == ' ') && (f2 != l2)) ++f2; if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; } - return (l1 - f1) - (l2 - f2); + return (int)((l1 - f1) - (l2 - f2)); } /* @@ -436,8 +447,8 @@ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { Cast a pointer up an inheritance hierarchy */ SWIGRUNTIMEINLINE void * -SWIG_TypeCast(swig_cast_info *ty, void *ptr) { - return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr); +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); } /* @@ -708,7 +719,8 @@ extern "C" { #include "lua.h" #include "lauxlib.h" -#include /* for a few sanity tests */ +#include /* for malloc */ +#include /* for a few sanity tests */ /* ----------------------------------------------------------------------------- * global swig types @@ -719,12 +731,7 @@ extern "C" { #define SWIG_LUA_STRING 3 #define SWIG_LUA_POINTER 4 #define SWIG_LUA_BINARY 5 - -/* Structure for command table (replaced by luaLib's luaL_reg) */ -/*typedef struct { - const char *name; - lua_CFunction wrapper; -} swig_lua_command_info;*/ +#define SWIG_LUA_CHAR 6 /* Structure for variable linking table */ typedef struct { @@ -755,29 +762,42 @@ typedef struct { } swig_lua_attribute; typedef struct swig_lua_class { - const char *name; + const char *name; swig_type_info **type; - lua_CFunction constructor; - void (*destructor)(void *); - swig_lua_method *methods; + lua_CFunction constructor; + void (*destructor)(void *); + swig_lua_method *methods; swig_lua_attribute *attributes; struct swig_lua_class **bases; + const char **base_names; } swig_lua_class; +/* this is the struct for wrappering all pointers in SwigLua +*/ typedef struct { - void *ptr; swig_type_info *type; - int own; /* 1 if owned & must be destroyed */ + int own; /* 1 if owned & must be destroyed */ + void *ptr; } swig_lua_userdata; +/* this is the struct for wrapping arbitary packed binary data +(currently it is only used for member function pointers) +the data ordering is similar to swig_lua_userdata, but it is currently not possible +to tell the two structures apart within Swig, other than by looking at the type +*/ +typedef struct { + swig_type_info *type; + int own; /* 1 if owned & must be destroyed */ + char data[1]; /* arbitary amount of data */ +} swig_lua_rawdata; /* Common SWIG API */ -#define SWIG_NewPointerObj(L, ptr, type, owner) \ - SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner) -#define SWIG_ConvertPtr(L,idx, ptr, type, flags) \ - SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags) -#define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) \ - SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname) +#define SWIG_NewPointerObj(L, ptr, type, owner) SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner) +#define SWIG_ConvertPtr(L,idx, ptr, type, flags) SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags) +#define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname) +/* for C++ member pointers, ie, member methods */ +#define SWIG_ConvertMember(L, idx, ptr, sz, ty) SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty) +#define SWIG_NewMemberObj(L, ptr, sz, type) SWIG_Lua_NewPackedObj(L, ptr, sz, type) /* Runtime API */ #define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata)) @@ -788,141 +808,193 @@ typedef struct { #define SWIG_contract_assert(expr, msg) \ if (!(expr)) { lua_pushstring(L, (char *) msg); goto fail; } else - - /* helper #defines */ #define SWIG_fail {goto fail;} -#define SWIG_fail_arg(I) {lua_pushfstring(L,"argument %d incorrect/missing",I);goto fail;} +#define SWIG_fail_arg(func_name,argnum,type) \ + {lua_pushfstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\ + func_name,argnum,type,SWIG_Lua_typename(L,argnum));\ + goto fail;} +#define SWIG_fail_ptr(func_name,argnum,type) \ + SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*") +#define SWIG_check_num_args(func_name,a,b) \ + if (lua_gettop(L)b) \ + {lua_pushfstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\ + goto fail;} + #define SWIG_Lua_get_table(L,n) \ - (lua_pushstring(L, n), lua_rawget(L,-2)) + (lua_pushstring(L, n), lua_rawget(L,-2)) #define SWIG_Lua_add_function(L,n,f) \ - (lua_pushstring(L, n), \ - lua_pushcfunction(L, f), \ - lua_rawset(L,-3)) + (lua_pushstring(L, n), \ + lua_pushcfunction(L, f), \ + lua_rawset(L,-3)) + +/* special helper for allowing 'nil' for usertypes */ +#define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I)) + +#ifdef __cplusplus +/* Special helper for member function pointers +it gets the address, casts it, then dereferences it */ +//#define SWIG_mem_fn_as_voidptr(a) (*((char**)&(a))) +#endif + +/* storing/access of swig_module_info */ +SWIGRUNTIME swig_module_info * +SWIG_Lua_GetModule(lua_State* L) { + swig_module_info *ret = 0; + lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); + lua_rawget(L,LUA_REGISTRYINDEX); + if (lua_islightuserdata(L,-1)) + ret=(swig_module_info*)lua_touserdata(L,-1); + lua_pop(L,1); /* tidy */ + return ret; +} + +SWIGRUNTIME void +SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) { + /* add this all into the Lua registry: */ + lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); + lua_pushlightuserdata(L,(void*)module); + lua_rawset(L,LUA_REGISTRYINDEX); +} /* ----------------------------------------------------------------------------- * global variable support code: modules * ----------------------------------------------------------------------------- */ +/* this function is called when trying to set an immutable. +default value is to print an error. +This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */ +SWIGINTERN int SWIG_Lua_set_immutable(lua_State* L) +{ +/* there should be 1 param passed in: the new value */ +#ifndef SWIGLUA_IGNORE_SET_IMMUTABLE + lua_pop(L,1); /* remove it */ + lua_pushstring(L,"This variable is immutable"); + lua_error(L); +#endif + return 0; /* should not return anything */ +} + /* the module.get method used for getting linked data */ SWIGINTERN int SWIG_Lua_module_get(lua_State* L) { -/* there should be 2 params passed in - (1) table (not the meta table) - (2) string name of the attribute - printf("SWIG_Lua_module_get %p(%s) '%s'\n", - lua_topointer(L,1),lua_typename(L,lua_type(L,1)), - lua_tostring(L,2)); +/* there should be 2 params passed in + (1) table (not the meta table) + (2) string name of the attribute + printf("SWIG_Lua_module_get %p(%s) '%s'\n", + lua_topointer(L,1),lua_typename(L,lua_type(L,1)), + lua_tostring(L,2)); */ - /* get the metatable */ - assert(lua_istable(L,1)); /* just in case */ - lua_getmetatable(L,1); /* get the metatable */ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_get_table(L,".get"); /* get the .get table */ - lua_remove(L,3); /* remove metatable */ - if (lua_istable(L,-1)) - { - /* look for the key in the .get table */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); - lua_remove(L,3); /* remove .get */ - if (lua_iscfunction(L,-1)) - { /* found it so call the fn & return its value */ - lua_call(L,0,1); - return 1; - } - lua_pop(L,1); /* remove the top */ - } - lua_pop(L,1); /* remove the .get */ - lua_pushnil(L); /* return a nil */ + /* get the metatable */ + assert(lua_istable(L,1)); /* just in case */ + lua_getmetatable(L,1); /* get the metatable */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_get_table(L,".get"); /* get the .get table */ + lua_remove(L,3); /* remove metatable */ + if (lua_istable(L,-1)) + { + /* look for the key in the .get table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + lua_remove(L,3); /* remove .get */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_call(L,0,1); + return 1; + } + lua_pop(L,1); /* remove the top */ + } + lua_pop(L,1); /* remove the .get */ + lua_pushnil(L); /* return a nil */ return 1; } /* the module.set method used for setting linked data */ SWIGINTERN int SWIG_Lua_module_set(lua_State* L) { -/* there should be 3 params passed in - (1) table (not the meta table) - (2) string name of the attribute - (3) any for the new value +/* there should be 3 params passed in + (1) table (not the meta table) + (2) string name of the attribute + (3) any for the new value */ - /* get the metatable */ - assert(lua_istable(L,1)); /* just in case */ - lua_getmetatable(L,1); /* get the metatable */ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_get_table(L,".set"); /* get the .set table */ - lua_remove(L,4); /* remove metatable */ - if (lua_istable(L,-1)) - { - /* look for the key in the .set table */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); - lua_remove(L,4); /* remove .set */ - if (lua_iscfunction(L,-1)) - { /* found it so call the fn & return its value */ - lua_pushvalue(L,3); /* value */ - lua_call(L,1,0); - return 0; - } - lua_pop(L,1); /* remove the top */ - } - lua_pop(L,1); /* remove the .set */ - return 0; + /* get the metatable */ + assert(lua_istable(L,1)); /* just in case */ + lua_getmetatable(L,1); /* get the metatable */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_get_table(L,".set"); /* get the .set table */ + lua_remove(L,4); /* remove metatable */ + if (lua_istable(L,-1)) + { + /* look for the key in the .set table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + lua_remove(L,4); /* remove .set */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,3); /* value */ + lua_call(L,1,0); + return 0; + } + } + lua_settop(L,3); /* reset back to start */ + /* we now have the table, key & new value, so just set directly */ + lua_rawset(L,1); /* add direct */ + return 0; } /* registering a module in lua */ SWIGINTERN void SWIG_Lua_module_begin(lua_State* L,const char* name) { - assert(lua_istable(L,-1)); /* just in case */ - lua_pushstring(L,name); - lua_newtable(L); /* the table */ - /* add meta table */ - lua_newtable(L); /* the meta table */ - SWIG_Lua_add_function(L,"__index",SWIG_Lua_module_get); - SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_module_set); - lua_pushstring(L,".get"); - lua_newtable(L); /* the .get table */ - lua_rawset(L,-3); /* add .get into metatable */ - lua_pushstring(L,".set"); - lua_newtable(L); /* the .set table */ - lua_rawset(L,-3); /* add .set into metatable */ - lua_setmetatable(L,-2); /* sets meta table in module */ - lua_rawset(L,-3); /* add module into parent */ - SWIG_Lua_get_table(L,name); /* get the table back out */ + assert(lua_istable(L,-1)); /* just in case */ + lua_pushstring(L,name); + lua_newtable(L); /* the table */ + /* add meta table */ + lua_newtable(L); /* the meta table */ + SWIG_Lua_add_function(L,"__index",SWIG_Lua_module_get); + SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_module_set); + lua_pushstring(L,".get"); + lua_newtable(L); /* the .get table */ + lua_rawset(L,-3); /* add .get into metatable */ + lua_pushstring(L,".set"); + lua_newtable(L); /* the .set table */ + lua_rawset(L,-3); /* add .set into metatable */ + lua_setmetatable(L,-2); /* sets meta table in module */ + lua_rawset(L,-3); /* add module into parent */ + SWIG_Lua_get_table(L,name); /* get the table back out */ } /* ending the register */ SWIGINTERN void SWIG_Lua_module_end(lua_State* L) { - lua_pop(L,1); /* tidy stack (remove module) */ + lua_pop(L,1); /* tidy stack (remove module) */ } /* adding a linked variable to the module */ SWIGINTERN void SWIG_Lua_module_add_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn) { - assert(lua_istable(L,-1)); /* just in case */ - lua_getmetatable(L,-1); /* get the metatable */ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_get_table(L,".get"); /* find the .get table */ - assert(lua_istable(L,-1)); /* should be a table: */ - SWIG_Lua_add_function(L,name,getFn); - lua_pop(L,1); /* tidy stack (remove table) */ - if (setFn) /* if there is a set fn */ - { - SWIG_Lua_get_table(L,".set"); /* find the .set table */ - assert(lua_istable(L,-1)); /* should be a table: */ - SWIG_Lua_add_function(L,name,setFn); - lua_pop(L,1); /* tidy stack (remove table) */ - } - lua_pop(L,1); /* tidy stack (remove meta) */ + assert(lua_istable(L,-1)); /* just in case */ + lua_getmetatable(L,-1); /* get the metatable */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); /* should be a table: */ + SWIG_Lua_add_function(L,name,getFn); + lua_pop(L,1); /* tidy stack (remove table) */ + if (setFn) /* if there is a set fn */ + { + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + assert(lua_istable(L,-1)); /* should be a table: */ + SWIG_Lua_add_function(L,name,setFn); + lua_pop(L,1); /* tidy stack (remove table) */ + } + lua_pop(L,1); /* tidy stack (remove meta) */ } /* adding a function module */ SWIGINTERN void SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_CFunction fn) { - SWIG_Lua_add_function(L,name,fn); + SWIG_Lua_add_function(L,name,fn); } /* ----------------------------------------------------------------------------- @@ -932,307 +1004,383 @@ SWIGINTERN void SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_ /* the class.get method, performs the lookup of class attributes */ SWIGINTERN int SWIG_Lua_class_get(lua_State* L) { -/* there should be 2 params passed in - (1) userdata (not the meta table) - (2) string name of the attribute +/* there should be 2 params passed in + (1) userdata (not the meta table) + (2) string name of the attribute */ - assert(lua_isuserdata(L,-2)); /* just in case */ - lua_getmetatable(L,-2); /* get the meta table */ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_get_table(L,".get"); /* find the .get table */ - assert(lua_istable(L,-1)); /* just in case */ - /* look for the key in the .get table */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); - lua_remove(L,-2); /* stack tidy, remove .get table */ - if (lua_iscfunction(L,-1)) - { /* found it so call the fn & return its value */ - lua_pushvalue(L,1); /* the userdata */ - lua_call(L,1,1); /* 1 value in (userdata),1 out (result) */ - lua_remove(L,-2); /* stack tidy, remove metatable */ - return 1; - } - lua_pop(L,1); /* remove whatever was there */ - /* ok, so try the .fn table */ - SWIG_Lua_get_table(L,".fn"); /* find the .get table */ - assert(lua_istable(L,-1)); /* just in case */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); /* look for the fn */ - lua_remove(L,-2); /* stack tidy, remove .fn table */ - if (lua_iscfunction(L,-1)) - { /* found it so return the fn & let lua call it */ - lua_remove(L,-2); /* stack tidy, remove metatable */ - return 1; - } - lua_pop(L,1); /* remove whatever was there */ - /* NEW: looks for the __getitem() fn - this is a user provided get fn */ - SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */ - if (lua_iscfunction(L,-1)) /* if its there */ - { /* found it so call the fn & return its value */ - lua_pushvalue(L,1); /* the userdata */ - lua_pushvalue(L,2); /* the parameter */ - lua_call(L,2,1); /* 2 value in (userdata),1 out (result) */ - lua_remove(L,-2); /* stack tidy, remove metatable */ - return 1; - } - return 0; /* sorry not known */ + assert(lua_isuserdata(L,-2)); /* just in case */ + lua_getmetatable(L,-2); /* get the meta table */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + /* look for the key in the .get table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + lua_remove(L,-2); /* stack tidy, remove .get table */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,1); /* the userdata */ + lua_call(L,1,1); /* 1 value in (userdata),1 out (result) */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + lua_pop(L,1); /* remove whatever was there */ + /* ok, so try the .fn table */ + SWIG_Lua_get_table(L,".fn"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); /* look for the fn */ + lua_remove(L,-2); /* stack tidy, remove .fn table */ + if (lua_isfunction(L,-1)) /* note: if its a C function or lua function */ + { /* found it so return the fn & let lua call it */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + lua_pop(L,1); /* remove whatever was there */ + /* NEW: looks for the __getitem() fn + this is a user provided get fn */ + SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */ + if (lua_iscfunction(L,-1)) /* if its there */ + { /* found it so call the fn & return its value */ + lua_pushvalue(L,1); /* the userdata */ + lua_pushvalue(L,2); /* the parameter */ + lua_call(L,2,1); /* 2 value in (userdata),1 out (result) */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + return 0; /* sorry not known */ } /* the class.set method, performs the lookup of class attributes */ SWIGINTERN int SWIG_Lua_class_set(lua_State* L) { -/* there should be 3 params passed in - (1) table (not the meta table) - (2) string name of the attribute - (3) any for the new value +/* there should be 3 params passed in + (1) table (not the meta table) + (2) string name of the attribute + (3) any for the new value printf("SWIG_Lua_class_set %p(%s) '%s' %p(%s)\n", - lua_topointer(L,1),lua_typename(L,lua_type(L,1)), - lua_tostring(L,2), - lua_topointer(L,3),lua_typename(L,lua_type(L,3)));*/ + lua_topointer(L,1),lua_typename(L,lua_type(L,1)), + lua_tostring(L,2), + lua_topointer(L,3),lua_typename(L,lua_type(L,3)));*/ - assert(lua_isuserdata(L,1)); /* just in case */ - lua_getmetatable(L,1); /* get the meta table */ - assert(lua_istable(L,-1)); /* just in case */ + assert(lua_isuserdata(L,1)); /* just in case */ + lua_getmetatable(L,1); /* get the meta table */ + assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_get_table(L,".set"); /* find the .set table */ - if (lua_istable(L,-1)) - { - /* look for the key in the .set table */ - lua_pushvalue(L,2); /* key */ - lua_rawget(L,-2); - if (lua_iscfunction(L,-1)) - { /* found it so call the fn & return its value */ - lua_pushvalue(L,1); /* userdata */ - lua_pushvalue(L,3); /* value */ - lua_call(L,2,0); - return 0; - } - lua_pop(L,1); /* remove the value */ - } - lua_pop(L,1); /* remove the value .set table */ - /* NEW: looks for the __setitem() fn - this is a user provided set fn */ - SWIG_Lua_get_table(L,"__setitem"); /* find the fn */ - if (lua_iscfunction(L,-1)) /* if its there */ - { /* found it so call the fn & return its value */ - lua_pushvalue(L,1); /* the userdata */ - lua_pushvalue(L,2); /* the parameter */ - lua_pushvalue(L,3); /* the value */ - lua_call(L,3,0); /* 3 values in ,0 out */ - lua_remove(L,-2); /* stack tidy, remove metatable */ - return 1; - } - return 0; + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + if (lua_istable(L,-1)) + { + /* look for the key in the .set table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,1); /* userdata */ + lua_pushvalue(L,3); /* value */ + lua_call(L,2,0); + return 0; + } + lua_pop(L,1); /* remove the value */ + } + lua_pop(L,1); /* remove the value .set table */ + /* NEW: looks for the __setitem() fn + this is a user provided set fn */ + SWIG_Lua_get_table(L,"__setitem"); /* find the fn */ + if (lua_iscfunction(L,-1)) /* if its there */ + { /* found it so call the fn & return its value */ + lua_pushvalue(L,1); /* the userdata */ + lua_pushvalue(L,2); /* the parameter */ + lua_pushvalue(L,3); /* the value */ + lua_call(L,3,0); /* 3 values in ,0 out */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + return 0; } /* the class.destruct method called by the interpreter */ SWIGINTERN int SWIG_Lua_class_destruct(lua_State* L) { -/* there should be 1 params passed in - (1) userdata (not the meta table) */ - swig_lua_userdata* usr; - swig_lua_class* clss; - assert(lua_isuserdata(L,-1)); /* just in case */ - usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ - /* if must be destroyed & has a destructor */ - if (usr->own) /* if must be destroyed */ - { - clss=(swig_lua_class*)usr->type->clientdata; /* get the class */ - if (clss && clss->destructor) /* there is a destroy fn */ - { - clss->destructor(usr->ptr); /* bye bye */ - } - } - return 0; +/* there should be 1 params passed in + (1) userdata (not the meta table) */ + swig_lua_userdata* usr; + swig_lua_class* clss; + assert(lua_isuserdata(L,-1)); /* just in case */ + usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ + /* if must be destroyed & has a destructor */ + if (usr->own) /* if must be destroyed */ + { + clss=(swig_lua_class*)usr->type->clientdata; /* get the class */ + if (clss && clss->destructor) /* there is a destroy fn */ + { + clss->destructor(usr->ptr); /* bye bye */ + } + } + return 0; } /* gets the swig class registry (or creates it) */ SWIGINTERN void SWIG_Lua_get_class_registry(lua_State* L) { - /* add this all into the swig registry: */ - lua_pushstring(L,"SWIG"); - lua_rawget(L,LUA_REGISTRYINDEX); /* get the registry */ - if (!lua_istable(L,-1)) /* not there */ - { /* must be first time, so add it */ - lua_pop(L,1); /* remove the result */ - lua_pushstring(L,"SWIG"); - lua_newtable(L); - lua_rawset(L,LUA_REGISTRYINDEX); - /* then get it */ - lua_pushstring(L,"SWIG"); - lua_rawget(L,LUA_REGISTRYINDEX); - } + /* add this all into the swig registry: */ + lua_pushstring(L,"SWIG"); + lua_rawget(L,LUA_REGISTRYINDEX); /* get the registry */ + if (!lua_istable(L,-1)) /* not there */ + { /* must be first time, so add it */ + lua_pop(L,1); /* remove the result */ + lua_pushstring(L,"SWIG"); + lua_newtable(L); + lua_rawset(L,LUA_REGISTRYINDEX); + /* then get it */ + lua_pushstring(L,"SWIG"); + lua_rawget(L,LUA_REGISTRYINDEX); + } } /* helper fn to get the classes metatable from the register */ SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State* L,const char* cname) { - SWIG_Lua_get_class_registry(L); /* get the registry */ - lua_pushstring(L,cname); /* get the name */ - lua_rawget(L,-2); /* get it */ - lua_remove(L,-2); /* tidy up (remove registry) */ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,cname); /* get the name */ + lua_rawget(L,-2); /* get it */ + lua_remove(L,-2); /* tidy up (remove registry) */ } /* helper add a variable to a registered class */ SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn) { - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_get_table(L,".get"); /* find the .get table */ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_add_function(L,name,getFn); - lua_pop(L,1); /* tidy stack (remove table) */ - if (setFn) - { - SWIG_Lua_get_table(L,".set"); /* find the .set table */ - assert(lua_istable(L,-1)); /* just in case */ - SWIG_Lua_add_function(L,name,setFn); - lua_pop(L,1); /* tidy stack (remove table) */ - } + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_function(L,name,getFn); + lua_pop(L,1); /* tidy stack (remove table) */ + if (setFn) + { + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_function(L,name,setFn); + lua_pop(L,1); /* tidy stack (remove table) */ + } } /* helper to recursively add class details (attributes & operations) */ SWIGINTERN void SWIG_Lua_add_class_details(lua_State* L,swig_lua_class* clss) { - int i; - /* call all the base classes first: we can then override these later: */ - for(i=0;clss->bases[i];i++) - { - SWIG_Lua_add_class_details(L,clss->bases[i]); - } - /* add fns */ - for(i=0;clss->attributes[i].name;i++){ - SWIG_Lua_add_class_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod); - } - /* add methods to the metatable */ - SWIG_Lua_get_table(L,".fn"); /* find the .fn table */ - assert(lua_istable(L,-1)); /* just in case */ - for(i=0;clss->methods[i].name;i++){ - SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method); - } - lua_pop(L,1); /* tidy stack (remove table) */ - /* add operator overloads - these look ANY method which start with "__" and assume they - are operator overloads & add them to the metatable - (this might mess up is someone defines a method __gc (the destructor)*/ - for(i=0;clss->methods[i].name;i++){ - if (clss->methods[i].name[0]=='_' && clss->methods[i].name[1]=='_'){ - SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method); - } - } + int i; + /* call all the base classes first: we can then override these later: */ + for(i=0;clss->bases[i];i++) + { + SWIG_Lua_add_class_details(L,clss->bases[i]); + } + /* add fns */ + for(i=0;clss->attributes[i].name;i++){ + SWIG_Lua_add_class_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod); + } + /* add methods to the metatable */ + SWIG_Lua_get_table(L,".fn"); /* find the .fn table */ + assert(lua_istable(L,-1)); /* just in case */ + for(i=0;clss->methods[i].name;i++){ + SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method); + } + lua_pop(L,1); /* tidy stack (remove table) */ + /* add operator overloads + these look ANY method which start with "__" and assume they + are operator overloads & add them to the metatable + (this might mess up is someone defines a method __gc (the destructor)*/ + for(i=0;clss->methods[i].name;i++){ + if (clss->methods[i].name[0]=='_' && clss->methods[i].name[1]=='_'){ + SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method); + } + } +} + +/* set up the base classes pointers. +Each class structure has a list of pointers to the base class structures. +This function fills them. +It cannot be done at compile time, as this will not work with hireachies +spread over more than one swig file. +Therefore it must be done at runtime, querying the SWIG type system. +*/ +SWIGINTERN void SWIG_Lua_init_base_class(lua_State* L,swig_lua_class* clss) +{ + int i=0; + swig_module_info* module=SWIG_GetModule(L); + for(i=0;clss->base_names[i];i++) + { + if (clss->bases[i]==0) /* not found yet */ + { + /* lookup and cache the base class */ + swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]); + if (info) clss->bases[i] = (swig_lua_class *) info->clientdata; + } + } } /* performs the entire class registration process */ SWIGINTERN void SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss) { -/* add its constructor to module with the name of the class - so you can do MyClass(...) as well as new_MyClass(...) - BUT only if a constructor is defined - (this overcomes the problem of pure virtual classes without constructors)*/ - if (clss->constructor) - SWIG_Lua_add_function(L,clss->name,clss->constructor); + /* add its constructor to module with the name of the class + so you can do MyClass(...) as well as new_MyClass(...) + BUT only if a constructor is defined + (this overcomes the problem of pure virtual classes without constructors)*/ + if (clss->constructor) + SWIG_Lua_add_function(L,clss->name,clss->constructor); - SWIG_Lua_get_class_registry(L); /* get the registry */ - lua_pushstring(L,clss->name); /* get the name */ - lua_newtable(L); /* create the metatable */ - /* add string of class name called ".type" */ - lua_pushstring(L,".type"); - lua_pushstring(L,clss->name); - lua_rawset(L,-3); - /* add a table called ".get" */ - lua_pushstring(L,".get"); - lua_newtable(L); - lua_rawset(L,-3); - /* add a table called ".set" */ - lua_pushstring(L,".set"); - lua_newtable(L); - lua_rawset(L,-3); - /* add a table called ".fn" */ - lua_pushstring(L,".fn"); - lua_newtable(L); - lua_rawset(L,-3); - /* add accessor fns for using the .get,.set&.fn */ - SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get); - SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set); - SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct); - /* add it */ - lua_rawset(L,-3); /* metatable into registry */ - lua_pop(L,1); /* tidy stack (remove registry) */ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,clss->name); /* get the name */ + lua_newtable(L); /* create the metatable */ + /* add string of class name called ".type" */ + lua_pushstring(L,".type"); + lua_pushstring(L,clss->name); + lua_rawset(L,-3); + /* add a table called ".get" */ + lua_pushstring(L,".get"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".set" */ + lua_pushstring(L,".set"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".fn" */ + lua_pushstring(L,".fn"); + lua_newtable(L); + lua_rawset(L,-3); + /* add accessor fns for using the .get,.set&.fn */ + SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get); + SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set); + SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct); + /* add it */ + lua_rawset(L,-3); /* metatable into registry */ + lua_pop(L,1); /* tidy stack (remove registry) */ - SWIG_Lua_get_class_metatable(L,clss->name); - SWIG_Lua_add_class_details(L,clss); /* recursive adding of details (atts & ops) */ - lua_pop(L,1); /* tidy stack (remove class metatable) */ + SWIG_Lua_get_class_metatable(L,clss->name); + SWIG_Lua_add_class_details(L,clss); /* recursive adding of details (atts & ops) */ + lua_pop(L,1); /* tidy stack (remove class metatable) */ } /* ----------------------------------------------------------------------------- * Class/structure conversion fns * ----------------------------------------------------------------------------- */ +/* helper to add metatable to new lua object */ +SWIGINTERN void _SWIG_Lua_AddMetatable(lua_State* L,swig_type_info *type) +{ + if (type->clientdata) /* there is clientdata: so add the metatable */ + { + SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->name); + if (lua_istable(L,-1)) + { + lua_setmetatable(L,-2); + } + else + { + lua_pop(L,1); + } + } +} + /* pushes a new object into the lua stack */ SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State* L,void* ptr,swig_type_info *type, int own) { - swig_lua_userdata* usr; - if (!ptr){ - lua_pushnil(L); - return; - } - usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata)); /* get data */ - usr->ptr=ptr; /* set the ptr */ - usr->type=type; - usr->own=own; - if (type->clientdata) /* there is clientdata: so add the metatable */ - { - SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->name); - if (lua_istable(L,-1)) - { - lua_setmetatable(L,-2); - } - else - { - lua_pop(L,1); - } - } + swig_lua_userdata* usr; + if (!ptr){ + lua_pushnil(L); + return; + } + usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata)); /* get data */ + usr->ptr=ptr; /* set the ptr */ + usr->type=type; + usr->own=own; + _SWIG_Lua_AddMetatable(L,type); /* add metatable */ } /* takes a object from the lua stack & converts it into an object of the correct type (if possible) */ SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State* L,int index,void** ptr,swig_type_info *type,int flags) { - swig_lua_userdata* usr; - swig_cast_info *cast; - usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */ - if (usr) - { - cast=SWIG_TypeCheckStruct(usr->type,type); - if (cast) - { - *ptr=SWIG_TypeCast(cast,usr->ptr); - return 0; /* ok */ - } - } - return 1; /* error */ + swig_lua_userdata* usr; + swig_cast_info *cast; + if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;} /* special case: lua nil => NULL pointer */ + usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */ + if (usr) + { + if (flags & SWIG_POINTER_DISOWN) /* must disown the object */ + { + usr->own=0; + } + if (!type) /* special cast void*, no casting fn */ + { + *ptr=usr->ptr; + return SWIG_OK; /* ok */ + } + cast=SWIG_TypeCheckStruct(usr->type,type); /* performs normal type checking */ + if (cast) + { + int newmemory = 0; + *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + return SWIG_OK; /* ok */ + } + } + return SWIG_ERROR; /* error */ } SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State* L,int index,swig_type_info *type,int flags, - int argnum,const char* func_name){ - void* result; - if (SWIG_ConvertPtr(L,index,&result,type,flags)){ - lua_pushfstring(L,"Error in %s, expected a %s at argument number %d\n", - func_name,(type && type->str)?type->str:"void*",argnum); - lua_error(L); - } - return result; + int argnum,const char* func_name){ + void* result; + if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){ + lua_pushfstring(L,"Error in %s, expected a %s at argument number %d\n", + func_name,(type && type->str)?type->str:"void*",argnum); + lua_error(L); + } + return result; +} + +/* pushes a packed userdata. user for member fn pointers only */ +SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State* L,void* ptr,size_t size,swig_type_info *type) +{ + swig_lua_rawdata* raw; + assert(ptr); /* not acceptable to pass in a NULL value */ + raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size); /* alloc data */ + raw->type=type; + raw->own=0; + memcpy(raw->data,ptr,size); /* copy the data */ + _SWIG_Lua_AddMetatable(L,type); /* add metatable */ +} + +/* converts a packed userdata. user for member fn pointers only */ +SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State* L,int index,void* ptr,size_t size,swig_type_info *type) +{ + swig_lua_rawdata* raw; + raw=(swig_lua_rawdata*)lua_touserdata(L,index); /* get data */ + if (!raw) return SWIG_ERROR; /* error */ + if (type==0 || type==raw->type) /* void* or identical type */ + { + memcpy(ptr,raw->data,size); /* copy it */ + return SWIG_OK; /* ok */ + } + return SWIG_ERROR; /* error */ +} + +/* a function to get the typestring of a piece of data */ +SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp) +{ + swig_lua_userdata* usr; + if (lua_isuserdata(L,tp)) + { + usr=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ + if (usr && usr->type && usr->type->str) + return usr->type->str; + return "userdata (unknown type)"; + } + return lua_typename(L,lua_type(L,tp)); } /* lua callable function to get the userdata's type */ SWIGRUNTIME int SWIG_Lua_type(lua_State* L) { - swig_lua_userdata* usr; - if (!lua_isuserdata(L,1)) /* just in case */ - return 0; /* nil reply */ - usr=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ - lua_pushstring(L,usr->type->name); - return 1; + lua_pushstring(L,SWIG_Lua_typename(L,1)); + return 1; } /* lua callable function to compare userdata's value @@ -1240,18 +1388,18 @@ the issue is that two userdata may point to the same thing but to lua, they are different objects */ SWIGRUNTIME int SWIG_Lua_equal(lua_State* L) { - int result; - swig_lua_userdata *usr1,*usr2; - if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */ - return 0; /* nil reply */ - usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ - usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */ - result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); - lua_pushboolean(L,result); - return 1; + int result; + swig_lua_userdata *usr1,*usr2; + if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */ + return 0; /* nil reply */ + usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ + usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */ + /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/ + result=(usr1->ptr==usr2->ptr); + lua_pushboolean(L,result); + return 1; } - /* ----------------------------------------------------------------------------- * global variable support code: class/struct typemap functions * ----------------------------------------------------------------------------- */ @@ -1264,12 +1412,17 @@ SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) { switch(constants[i].type) { case SWIG_LUA_INT: lua_pushstring(L,constants[i].name); - lua_pushnumber(L,(double)constants[i].lvalue); + lua_pushnumber(L,(lua_Number)constants[i].lvalue); lua_rawset(L,-3); break; case SWIG_LUA_FLOAT: lua_pushstring(L,constants[i].name); - lua_pushnumber(L,(double)constants[i].dvalue); + lua_pushnumber(L,(lua_Number)constants[i].dvalue); + lua_rawset(L,-3); + break; + case SWIG_LUA_CHAR: + lua_pushstring(L,constants[i].name); + lua_pushfstring(L,"%c",(char)constants[i].lvalue); lua_rawset(L,-3); break; case SWIG_LUA_STRING: @@ -1283,8 +1436,9 @@ SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) { lua_rawset(L,-3); break; case SWIG_LUA_BINARY: - /* TODO?? */ -/* obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); */ + lua_pushstring(L,constants[i].name); + SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype); + lua_rawset(L,-3); break; default: break; @@ -1292,25 +1446,34 @@ SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) { } } -/* storing/access of swig_module_info */ -SWIGRUNTIME swig_module_info * -SWIG_Lua_GetModule(lua_State* L) { - swig_module_info *ret = 0; - lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); - lua_rawget(L,LUA_REGISTRYINDEX); - if (lua_islightuserdata(L,-1)) - ret=(swig_module_info*)lua_touserdata(L,-1); - lua_pop(L,1); /* tidy */ - return ret; -} +/* ----------------------------------------------------------------------------- + * executing lua code from within the wrapper + * ----------------------------------------------------------------------------- */ -SWIGRUNTIME void -SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) { - /* add this all into the Lua registry: */ - lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); - lua_pushlightuserdata(L,(void*)module); - lua_rawset(L,LUA_REGISTRYINDEX); -} +#ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */ +#define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S) +#endif +/* Executes a C string in Lua a really simple way of calling lua from C +Unfortunately lua keeps changing its API's, so we need a conditional compile +In lua 5.0.X its lua_dostring() +In lua 5.1.X its luaL_dostring() +*/ +SWIGINTERN int +SWIG_Lua_dostring(lua_State *L, const char* str) { + int ok,top; + if (str==0 || str[0]==0) return 0; /* nothing to do */ + top=lua_gettop(L); /* save stack */ +#if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501)) + ok=luaL_dostring(L,str); /* looks like this is lua 5.1.X or later, good */ +#else + ok=lua_dostring(L,str); /* might be lua 5.0.x, using lua_dostring */ +#endif + if (ok!=0) { + SWIG_DOSTRING_FAIL(lua_tostring(L,-1)); + } + lua_settop(L,top); /* restore the stack */ + return ok; +} #ifdef __cplusplus } @@ -1321,15 +1484,15 @@ SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) { /* -------- TYPES TABLE (BEGIN) -------- */ -#define SWIGTYPE_SWIGLUA_FN swig_types[0] -#define SWIGTYPE_p_API swig_types[1] -#define SWIGTYPE_p_CoreSession swig_types[2] -#define SWIGTYPE_p_DTMF swig_types[3] -#define SWIGTYPE_p_Event swig_types[4] -#define SWIGTYPE_p_EventConsumer swig_types[5] -#define SWIGTYPE_p_IVRMenu swig_types[6] -#define SWIGTYPE_p_LUA__Dbh swig_types[7] -#define SWIGTYPE_p_LUA__Session swig_types[8] +#define SWIGTYPE_p_API swig_types[0] +#define SWIGTYPE_p_CoreSession swig_types[1] +#define SWIGTYPE_p_DTMF swig_types[2] +#define SWIGTYPE_p_Event swig_types[3] +#define SWIGTYPE_p_EventConsumer swig_types[4] +#define SWIGTYPE_p_IVRMenu swig_types[5] +#define SWIGTYPE_p_LUA__Dbh swig_types[6] +#define SWIGTYPE_p_LUA__Session swig_types[7] +#define SWIGTYPE_p_SWIGLUA_FN swig_types[8] #define SWIGTYPE_p_Stream swig_types[9] #define SWIGTYPE_p_input_callback_state swig_types[10] #define SWIGTYPE_p_lua_State swig_types[11] @@ -1350,22 +1513,23 @@ SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) { #define SWIGTYPE_p_switch_stream_handle_t swig_types[26] #define SWIGTYPE_p_uint32_t swig_types[27] #define SWIGTYPE_p_void swig_types[28] -#define SWIGTYPE_switch_call_cause_t swig_types[29] -#define SWIGTYPE_switch_channel_state_t swig_types[30] -#define SWIGTYPE_switch_event_types_t swig_types[31] -#define SWIGTYPE_switch_input_type_t swig_types[32] -#define SWIGTYPE_switch_priority_t swig_types[33] -#define SWIGTYPE_uint32_t swig_types[34] -static swig_type_info *swig_types[36]; -static swig_module_info swig_module = {swig_types, 35, 0, 0, 0, 0}; +static swig_type_info *swig_types[30]; +static swig_module_info swig_module = {swig_types, 29, 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) -------- */ -#define SWIG_init Freeswitch_Init -#define SWIG_name "freeswitch" -#define SWIG_import luaopen_freeswitch +#define SWIG_name "freeswitch" +#define SWIG_init luaopen_freeswitch +#define SWIG_init_user luaopen_freeswitch_user + +#define SWIG_LUACODE luaopen_freeswitch_luacode + + +namespace swig { +typedef struct{} LANGUAGE_OBJ; +} #include "switch.h" @@ -1380,15 +1544,18 @@ static int _wrap_consoleLog(lua_State* L) { char *arg1 = (char *) 0 ; char *arg2 = (char *) 0 ; - if(!lua_isstring(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1 = (char*)lua_tostring(L, 1); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("consoleLog",2,2) + if(!lua_isstring(L,1)) SWIG_fail_arg("consoleLog",1,"char *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("consoleLog",2,"char *"); + arg1 = (char *)lua_tostring(L, 1); + arg2 = (char *)lua_tostring(L, 2); consoleLog(arg1,arg2); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1399,13 +1566,16 @@ static int _wrap_consoleCleanLog(lua_State* L) { int SWIG_arg = -1; char *arg1 = (char *) 0 ; - if(!lua_isstring(L,1)) SWIG_fail_arg(1); - arg1 = (char*)lua_tostring(L, 1); + SWIG_check_num_args("consoleCleanLog",1,1) + if(!lua_isstring(L,1)) SWIG_fail_arg("consoleCleanLog",1,"char *"); + arg1 = (char *)lua_tostring(L, 1); consoleCleanLog(arg1); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1432,32 +1602,37 @@ static int _wrap_new_IVRMenu(lua_State* L) { int arg16 ; IVRMenu *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - if(!lua_isstring(L,3)) SWIG_fail_arg(3); - if(!lua_isstring(L,4)) SWIG_fail_arg(4); - if(!lua_isstring(L,5)) SWIG_fail_arg(5); - if(!lua_isstring(L,6)) SWIG_fail_arg(6); - if(!lua_isstring(L,7)) SWIG_fail_arg(7); - if(!lua_isstring(L,8)) SWIG_fail_arg(8); - if(!lua_isstring(L,9)) SWIG_fail_arg(9); - if(!lua_isstring(L,10)) SWIG_fail_arg(10); - if(!lua_isnumber(L,11)) SWIG_fail_arg(11); - if(!lua_isnumber(L,12)) SWIG_fail_arg(12); - if(!lua_isnumber(L,13)) SWIG_fail_arg(13); - if(!lua_isnumber(L,14)) SWIG_fail_arg(14); - if(!lua_isnumber(L,15)) SWIG_fail_arg(15); - if(!lua_isnumber(L,16)) SWIG_fail_arg(16); - arg1=(IVRMenu *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_IVRMenu,0,1,"new_IVRMenu"); - arg2 = (char*)lua_tostring(L, 2); - arg3 = (char*)lua_tostring(L, 3); - arg4 = (char*)lua_tostring(L, 4); - arg5 = (char*)lua_tostring(L, 5); - arg6 = (char*)lua_tostring(L, 6); - arg7 = (char*)lua_tostring(L, 7); - arg8 = (char*)lua_tostring(L, 8); - arg9 = (char*)lua_tostring(L, 9); - arg10 = (char*)lua_tostring(L, 10); + SWIG_check_num_args("IVRMenu",16,16) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("IVRMenu",1,"IVRMenu *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("IVRMenu",2,"char const *"); + if(!lua_isstring(L,3)) SWIG_fail_arg("IVRMenu",3,"char const *"); + if(!lua_isstring(L,4)) SWIG_fail_arg("IVRMenu",4,"char const *"); + if(!lua_isstring(L,5)) SWIG_fail_arg("IVRMenu",5,"char const *"); + if(!lua_isstring(L,6)) SWIG_fail_arg("IVRMenu",6,"char const *"); + if(!lua_isstring(L,7)) SWIG_fail_arg("IVRMenu",7,"char const *"); + if(!lua_isstring(L,8)) SWIG_fail_arg("IVRMenu",8,"char const *"); + if(!lua_isstring(L,9)) SWIG_fail_arg("IVRMenu",9,"char const *"); + if(!lua_isstring(L,10)) SWIG_fail_arg("IVRMenu",10,"char const *"); + if(!lua_isnumber(L,11)) SWIG_fail_arg("IVRMenu",11,"int"); + if(!lua_isnumber(L,12)) SWIG_fail_arg("IVRMenu",12,"int"); + if(!lua_isnumber(L,13)) SWIG_fail_arg("IVRMenu",13,"int"); + if(!lua_isnumber(L,14)) SWIG_fail_arg("IVRMenu",14,"int"); + if(!lua_isnumber(L,15)) SWIG_fail_arg("IVRMenu",15,"int"); + if(!lua_isnumber(L,16)) SWIG_fail_arg("IVRMenu",16,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_IVRMenu,0))){ + SWIG_fail_ptr("new_IVRMenu",1,SWIGTYPE_p_IVRMenu); + } + + arg2 = (char *)lua_tostring(L, 2); + arg3 = (char *)lua_tostring(L, 3); + arg4 = (char *)lua_tostring(L, 4); + arg5 = (char *)lua_tostring(L, 5); + arg6 = (char *)lua_tostring(L, 6); + arg7 = (char *)lua_tostring(L, 7); + arg8 = (char *)lua_tostring(L, 8); + arg9 = (char *)lua_tostring(L, 9); + arg10 = (char *)lua_tostring(L, 10); arg11 = (int)lua_tonumber(L, 11); arg12 = (int)lua_tonumber(L, 12); arg13 = (int)lua_tonumber(L, 13); @@ -1469,6 +1644,8 @@ static int _wrap_new_IVRMenu(lua_State* L) { SWIG_NewPointerObj(L,result,SWIGTYPE_p_IVRMenu,1); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1479,14 +1656,21 @@ static int _wrap_delete_IVRMenu(lua_State* L) { int SWIG_arg = -1; IVRMenu *arg1 = (IVRMenu *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(IVRMenu *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_IVRMenu,0,1,"delete_IVRMenu"); + SWIG_check_num_args("IVRMenu",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("IVRMenu",1,"IVRMenu *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_IVRMenu,SWIG_POINTER_DISOWN))){ + SWIG_fail_ptr("delete_IVRMenu",1,SWIGTYPE_p_IVRMenu); + } + delete arg1; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1500,19 +1684,26 @@ static int _wrap_IVRMenu_bindAction(lua_State* L) { char *arg3 = (char *) 0 ; char *arg4 = (char *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - if(!lua_isstring(L,3)) SWIG_fail_arg(3); - if(!lua_isstring(L,4)) SWIG_fail_arg(4); - arg1=(IVRMenu *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_IVRMenu,0,1,"IVRMenu_bindAction"); - arg2 = (char*)lua_tostring(L, 2); - arg3 = (char*)lua_tostring(L, 3); - arg4 = (char*)lua_tostring(L, 4); + SWIG_check_num_args("bindAction",4,4) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("bindAction",1,"IVRMenu *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("bindAction",2,"char *"); + if(!lua_isstring(L,3)) SWIG_fail_arg("bindAction",3,"char const *"); + if(!lua_isstring(L,4)) SWIG_fail_arg("bindAction",4,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_IVRMenu,0))){ + SWIG_fail_ptr("IVRMenu_bindAction",1,SWIGTYPE_p_IVRMenu); + } + + arg2 = (char *)lua_tostring(L, 2); + arg3 = (char *)lua_tostring(L, 3); + arg4 = (char *)lua_tostring(L, 4); (arg1)->bindAction(arg2,(char const *)arg3,(char const *)arg4); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1525,17 +1716,28 @@ static int _wrap_IVRMenu_execute(lua_State* L) { CoreSession *arg2 = (CoreSession *) 0 ; char *arg3 = (char *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - if(!lua_isstring(L,3)) SWIG_fail_arg(3); - arg1=(IVRMenu *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_IVRMenu,0,1,"IVRMenu_execute"); - arg2=(CoreSession *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_CoreSession,0,2,"IVRMenu_execute"); - arg3 = (char*)lua_tostring(L, 3); + SWIG_check_num_args("execute",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("execute",1,"IVRMenu *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("execute",2,"CoreSession *"); + if(!lua_isstring(L,3)) SWIG_fail_arg("execute",3,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_IVRMenu,0))){ + SWIG_fail_ptr("IVRMenu_execute",1,SWIGTYPE_p_IVRMenu); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("IVRMenu_execute",2,SWIGTYPE_p_CoreSession); + } + + arg3 = (char *)lua_tostring(L, 3); (arg1)->execute(arg2,(char const *)arg3); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1555,17 +1757,21 @@ static swig_lua_attribute swig_IVRMenu_attributes[] = { {0,0,0} }; static swig_lua_class *swig_IVRMenu_bases[] = {0}; -swig_lua_class _wrap_class_IVRMenu = { "IVRMenu", &SWIGTYPE_p_IVRMenu,_wrap_new_IVRMenu, swig_delete_IVRMenu, swig_IVRMenu_methods, swig_IVRMenu_attributes, swig_IVRMenu_bases }; +static const char *swig_IVRMenu_base_names[] = {0}; +static swig_lua_class _wrap_class_IVRMenu = { "IVRMenu", &SWIGTYPE_p_IVRMenu,_wrap_new_IVRMenu, swig_delete_IVRMenu, swig_IVRMenu_methods, swig_IVRMenu_attributes, swig_IVRMenu_bases, swig_IVRMenu_base_names }; static int _wrap_new_API(lua_State* L) { int SWIG_arg = -1; API *result = 0 ; + SWIG_check_num_args("API",0,0) result = (API *)new API(); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_API,1); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1576,14 +1782,21 @@ static int _wrap_delete_API(lua_State* L) { int SWIG_arg = -1; API *arg1 = (API *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(API *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_API,0,1,"delete_API"); + SWIG_check_num_args("API",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("API",1,"API *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_API,SWIG_POINTER_DISOWN))){ + SWIG_fail_ptr("delete_API",1,SWIGTYPE_p_API); + } + delete arg1; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1597,19 +1810,26 @@ static int _wrap_API_execute(lua_State* L) { char *arg3 = (char *) NULL ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg(3); - arg1=(API *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_API,0,1,"API_execute"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("execute",2,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("execute",1,"API *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("execute",2,"char const *"); + if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("execute",3,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_API,0))){ + SWIG_fail_ptr("API_execute",1,SWIGTYPE_p_API); + } + + arg2 = (char *)lua_tostring(L, 2); if(lua_gettop(L)>=3){ - arg3 = (char*)lua_tostring(L, 3); + arg3 = (char *)lua_tostring(L, 3); } result = (char *)(arg1)->execute((char const *)arg2,(char const *)arg3); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1622,15 +1842,22 @@ static int _wrap_API_executeString(lua_State* L) { char *arg2 = (char *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(API *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_API,0,1,"API_executeString"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("executeString",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("executeString",1,"API *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("executeString",2,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_API,0))){ + SWIG_fail_ptr("API_executeString",1,SWIGTYPE_p_API); + } + + arg2 = (char *)lua_tostring(L, 2); result = (char *)(arg1)->executeString((char const *)arg2); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1642,13 +1869,20 @@ static int _wrap_API_getTime(lua_State* L) { API *arg1 = (API *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(API *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_API,0,1,"API_getTime"); + SWIG_check_num_args("getTime",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getTime",1,"API *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_API,0))){ + SWIG_fail_ptr("API_getTime",1,SWIGTYPE_p_API); + } + result = (char *)(arg1)->getTime(); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1669,23 +1903,31 @@ static swig_lua_attribute swig_API_attributes[] = { {0,0,0} }; static swig_lua_class *swig_API_bases[] = {0}; -swig_lua_class _wrap_class_API = { "API", &SWIGTYPE_p_API,_wrap_new_API, swig_delete_API, swig_API_methods, swig_API_attributes, swig_API_bases }; +static const char *swig_API_base_names[] = {0}; +static swig_lua_class _wrap_class_API = { "API", &SWIGTYPE_p_API,_wrap_new_API, swig_delete_API, swig_API_methods, swig_API_attributes, swig_API_bases, swig_API_base_names }; static int _wrap_input_callback_state_t_function_set(lua_State* L) { int SWIG_arg = -1; input_callback_state_t *arg1 = (input_callback_state_t *) 0 ; void *arg2 = (void *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1=(input_callback_state_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_input_callback_state,0,1,"input_callback_state_t_function_set"); - arg2=((swig_lua_userdata*)(lua_touserdata(L,2)))->ptr; + SWIG_check_num_args("function",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("function",1,"input_callback_state_t *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("function",2,"void *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){ + SWIG_fail_ptr("input_callback_state_t_function_set",1,SWIGTYPE_p_input_callback_state); + } + + arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"input_callback_state_t_function_set"); if (arg1) (arg1)->function = arg2; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1697,13 +1939,20 @@ static int _wrap_input_callback_state_t_function_get(lua_State* L) { input_callback_state_t *arg1 = (input_callback_state_t *) 0 ; void *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(input_callback_state_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_input_callback_state,0,1,"input_callback_state_t_function_get"); + SWIG_check_num_args("function",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("function",1,"input_callback_state_t *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){ + SWIG_fail_ptr("input_callback_state_t_function_get",1,SWIGTYPE_p_input_callback_state); + } + result = (void *) ((arg1)->function); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1715,16 +1964,23 @@ static int _wrap_input_callback_state_t_threadState_set(lua_State* L) { input_callback_state_t *arg1 = (input_callback_state_t *) 0 ; void *arg2 = (void *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1=(input_callback_state_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_input_callback_state,0,1,"input_callback_state_t_threadState_set"); - arg2=((swig_lua_userdata*)(lua_touserdata(L,2)))->ptr; + SWIG_check_num_args("threadState",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("threadState",1,"input_callback_state_t *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("threadState",2,"void *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){ + SWIG_fail_ptr("input_callback_state_t_threadState_set",1,SWIGTYPE_p_input_callback_state); + } + + arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"input_callback_state_t_threadState_set"); if (arg1) (arg1)->threadState = arg2; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1736,13 +1992,20 @@ static int _wrap_input_callback_state_t_threadState_get(lua_State* L) { input_callback_state_t *arg1 = (input_callback_state_t *) 0 ; void *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(input_callback_state_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_input_callback_state,0,1,"input_callback_state_t_threadState_get"); + SWIG_check_num_args("threadState",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("threadState",1,"input_callback_state_t *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){ + SWIG_fail_ptr("input_callback_state_t_threadState_get",1,SWIGTYPE_p_input_callback_state); + } + result = (void *) ((arg1)->threadState); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1754,16 +2017,23 @@ static int _wrap_input_callback_state_t_extra_set(lua_State* L) { input_callback_state_t *arg1 = (input_callback_state_t *) 0 ; void *arg2 = (void *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1=(input_callback_state_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_input_callback_state,0,1,"input_callback_state_t_extra_set"); - arg2=((swig_lua_userdata*)(lua_touserdata(L,2)))->ptr; + SWIG_check_num_args("extra",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("extra",1,"input_callback_state_t *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("extra",2,"void *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){ + SWIG_fail_ptr("input_callback_state_t_extra_set",1,SWIGTYPE_p_input_callback_state); + } + + arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"input_callback_state_t_extra_set"); if (arg1) (arg1)->extra = arg2; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1775,13 +2045,20 @@ static int _wrap_input_callback_state_t_extra_get(lua_State* L) { input_callback_state_t *arg1 = (input_callback_state_t *) 0 ; void *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(input_callback_state_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_input_callback_state,0,1,"input_callback_state_t_extra_get"); + SWIG_check_num_args("extra",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("extra",1,"input_callback_state_t *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){ + SWIG_fail_ptr("input_callback_state_t_extra_get",1,SWIGTYPE_p_input_callback_state); + } + result = (void *) ((arg1)->extra); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1793,15 +2070,20 @@ static int _wrap_input_callback_state_t_funcargs_set(lua_State* L) { input_callback_state_t *arg1 = (input_callback_state_t *) 0 ; char *arg2 = (char *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(input_callback_state_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_input_callback_state,0,1,"input_callback_state_t_funcargs_set"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("funcargs",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("funcargs",1,"input_callback_state_t *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("funcargs",2,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){ + SWIG_fail_ptr("input_callback_state_t_funcargs_set",1,SWIGTYPE_p_input_callback_state); + } + + arg2 = (char *)lua_tostring(L, 2); { if (arg1->funcargs) delete [] arg1->funcargs; if (arg2) { - arg1->funcargs = (char *) (new char[strlen(arg2)+1]); - strcpy((char *) arg1->funcargs,arg2); + arg1->funcargs = (char *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->funcargs, (const char *)arg2); } else { arg1->funcargs = 0; } @@ -1810,6 +2092,8 @@ static int _wrap_input_callback_state_t_funcargs_set(lua_State* L) { return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1821,13 +2105,20 @@ static int _wrap_input_callback_state_t_funcargs_get(lua_State* L) { input_callback_state_t *arg1 = (input_callback_state_t *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(input_callback_state_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_input_callback_state,0,1,"input_callback_state_t_funcargs_get"); + SWIG_check_num_args("funcargs",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("funcargs",1,"input_callback_state_t *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,0))){ + SWIG_fail_ptr("input_callback_state_t_funcargs_get",1,SWIGTYPE_p_input_callback_state); + } + result = (char *) ((arg1)->funcargs); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1838,11 +2129,14 @@ static int _wrap_new_input_callback_state_t(lua_State* L) { int SWIG_arg = -1; input_callback_state_t *result = 0 ; + SWIG_check_num_args("input_callback_state_t::input_callback_state_t",0,0) result = (input_callback_state_t *)new input_callback_state_t(); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_input_callback_state,1); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1853,14 +2147,21 @@ static int _wrap_delete_input_callback_state_t(lua_State* L) { int SWIG_arg = -1; input_callback_state_t *arg1 = (input_callback_state_t *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(input_callback_state_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_input_callback_state,0,1,"delete_input_callback_state_t"); + SWIG_check_num_args("input_callback_state_t::~input_callback_state_t",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("input_callback_state_t::~input_callback_state_t",1,"input_callback_state_t *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_input_callback_state,SWIG_POINTER_DISOWN))){ + SWIG_fail_ptr("delete_input_callback_state_t",1,SWIGTYPE_p_input_callback_state); + } + delete arg1; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1875,30 +2176,38 @@ static swig_lua_method swig_input_callback_state_t_methods[] = { {0,0} }; static swig_lua_attribute swig_input_callback_state_t_attributes[] = { - { "function",_wrap_input_callback_state_t_function_get, _wrap_input_callback_state_t_function_set}, - { "threadState",_wrap_input_callback_state_t_threadState_get, _wrap_input_callback_state_t_threadState_set}, - { "extra",_wrap_input_callback_state_t_extra_get, _wrap_input_callback_state_t_extra_set}, - { "funcargs",_wrap_input_callback_state_t_funcargs_get, _wrap_input_callback_state_t_funcargs_set}, + { "function", _wrap_input_callback_state_t_function_get, _wrap_input_callback_state_t_function_set}, + { "threadState", _wrap_input_callback_state_t_threadState_get, _wrap_input_callback_state_t_threadState_set}, + { "extra", _wrap_input_callback_state_t_extra_get, _wrap_input_callback_state_t_extra_set}, + { "funcargs", _wrap_input_callback_state_t_funcargs_get, _wrap_input_callback_state_t_funcargs_set}, {0,0,0} }; static swig_lua_class *swig_input_callback_state_t_bases[] = {0}; -swig_lua_class _wrap_class_input_callback_state_t = { "input_callback_state_t", &SWIGTYPE_p_input_callback_state,_wrap_new_input_callback_state_t, swig_delete_input_callback_state_t, swig_input_callback_state_t_methods, swig_input_callback_state_t_attributes, swig_input_callback_state_t_bases }; +static const char *swig_input_callback_state_t_base_names[] = {0}; +static swig_lua_class _wrap_class_input_callback_state_t = { "input_callback_state_t", &SWIGTYPE_p_input_callback_state,_wrap_new_input_callback_state_t, swig_delete_input_callback_state_t, swig_input_callback_state_t_methods, swig_input_callback_state_t_attributes, swig_input_callback_state_t_bases, swig_input_callback_state_t_base_names }; static int _wrap_DTMF_digit_set(lua_State* L) { int SWIG_arg = -1; DTMF *arg1 = (DTMF *) 0 ; char arg2 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(DTMF *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_DTMF,0,1,"DTMF_digit_set"); - arg2 = ((char*)lua_tostring(L, 2))[0]; + SWIG_check_num_args("digit",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("digit",1,"DTMF *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("digit",2,"char"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_DTMF,0))){ + SWIG_fail_ptr("DTMF_digit_set",1,SWIGTYPE_p_DTMF); + } + + arg2 = (lua_tostring(L, 2))[0]; if (arg1) (arg1)->digit = arg2; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1910,13 +2219,20 @@ static int _wrap_DTMF_digit_get(lua_State* L) { DTMF *arg1 = (DTMF *) 0 ; char result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(DTMF *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_DTMF,0,1,"DTMF_digit_get"); + SWIG_check_num_args("digit",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("digit",1,"DTMF *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_DTMF,0))){ + SWIG_fail_ptr("DTMF_digit_get",1,SWIGTYPE_p_DTMF); + } + result = (char) ((arg1)->digit); SWIG_arg=0; lua_pushfstring(L,"%c",result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1927,21 +2243,30 @@ static int _wrap_DTMF_duration_set(lua_State* L) { int SWIG_arg = -1; DTMF *arg1 = (DTMF *) 0 ; uint32_t arg2 ; + uint32_t *argp2 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1=(DTMF *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_DTMF,0,1,"DTMF_duration_set"); - { - uint32_t * argp; - if(SWIG_ConvertPtr(L,2,(void**)(&argp),SWIGTYPE_p_uint32_t,0)) SWIG_fail; - arg2 = *argp; + SWIG_check_num_args("duration",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("duration",1,"DTMF *"); + if(!lua_isuserdata(L,2)) SWIG_fail_arg("duration",2,"uint32_t"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_DTMF,0))){ + SWIG_fail_ptr("DTMF_duration_set",1,SWIGTYPE_p_DTMF); } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_uint32_t,0))){ + SWIG_fail_ptr("DTMF_duration_set",2,SWIGTYPE_p_uint32_t); + } + arg2 = *argp2; + if (arg1) (arg1)->duration = arg2; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1953,17 +2278,23 @@ static int _wrap_DTMF_duration_get(lua_State* L) { DTMF *arg1 = (DTMF *) 0 ; uint32_t result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(DTMF *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_DTMF,0,1,"DTMF_duration_get"); + SWIG_check_num_args("duration",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("duration",1,"DTMF *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_DTMF,0))){ + SWIG_fail_ptr("DTMF_duration_get",1,SWIGTYPE_p_DTMF); + } + result = ((arg1)->duration); SWIG_arg=0; { - uint32_t * resultptr; - resultptr = new uint32_t((uint32_t &) result); + uint32_t * resultptr = new uint32_t((uint32_t &) result); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_uint32_t,1); SWIG_arg++; } return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -1975,22 +2306,25 @@ static int _wrap_new_DTMF(lua_State* L) { char arg1 ; uint32_t arg2 = (uint32_t) SWITCH_DEFAULT_DTMF_DURATION ; DTMF *result = 0 ; + uint32_t *argp2 ; - if(!lua_isstring(L,1)) SWIG_fail_arg(1); - if(lua_gettop(L)>=2 && !lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1 = ((char*)lua_tostring(L, 1))[0]; + SWIG_check_num_args("DTMF",1,2) + if(!lua_isstring(L,1)) SWIG_fail_arg("DTMF",1,"char"); + if(lua_gettop(L)>=2 && !lua_isuserdata(L,2)) SWIG_fail_arg("DTMF",2,"uint32_t"); + arg1 = (lua_tostring(L, 1))[0]; if(lua_gettop(L)>=2){ - { - uint32_t * argp; - if(SWIG_ConvertPtr(L,2,(void**)(&argp),SWIGTYPE_p_uint32_t,0)) SWIG_fail; - arg2 = *argp; + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_uint32_t,0))){ + SWIG_fail_ptr("new_DTMF",2,SWIGTYPE_p_uint32_t); } + arg2 = *argp2; } result = (DTMF *)new DTMF(arg1,arg2); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_DTMF,1); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2001,14 +2335,21 @@ static int _wrap_delete_DTMF(lua_State* L) { int SWIG_arg = -1; DTMF *arg1 = (DTMF *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(DTMF *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_DTMF,0,1,"delete_DTMF"); + SWIG_check_num_args("DTMF",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("DTMF",1,"DTMF *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_DTMF,SWIG_POINTER_DISOWN))){ + SWIG_fail_ptr("delete_DTMF",1,SWIGTYPE_p_DTMF); + } + delete arg1; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2023,22 +2364,26 @@ static swig_lua_method swig_DTMF_methods[] = { {0,0} }; static swig_lua_attribute swig_DTMF_attributes[] = { - { "digit",_wrap_DTMF_digit_get, _wrap_DTMF_digit_set}, - { "duration",_wrap_DTMF_duration_get, _wrap_DTMF_duration_set}, + { "digit", _wrap_DTMF_digit_get, _wrap_DTMF_digit_set}, + { "duration", _wrap_DTMF_duration_get, _wrap_DTMF_duration_set}, {0,0,0} }; static swig_lua_class *swig_DTMF_bases[] = {0}; -swig_lua_class _wrap_class_DTMF = { "DTMF", &SWIGTYPE_p_DTMF,_wrap_new_DTMF, swig_delete_DTMF, swig_DTMF_methods, swig_DTMF_attributes, swig_DTMF_bases }; +static const char *swig_DTMF_base_names[] = {0}; +static swig_lua_class _wrap_class_DTMF = { "DTMF", &SWIGTYPE_p_DTMF,_wrap_new_DTMF, swig_delete_DTMF, swig_DTMF_methods, swig_DTMF_attributes, swig_DTMF_bases, swig_DTMF_base_names }; static int _wrap_new_Stream__SWIG_0(lua_State* L) { int SWIG_arg = -1; Stream *result = 0 ; + SWIG_check_num_args("Stream",0,0) result = (Stream *)new Stream(); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_Stream,1); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2050,13 +2395,20 @@ static int _wrap_new_Stream__SWIG_1(lua_State* L) { switch_stream_handle_t *arg1 = (switch_stream_handle_t *) 0 ; Stream *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(switch_stream_handle_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_switch_stream_handle_t,0,1,"new_Stream"); + SWIG_check_num_args("Stream",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Stream",1,"switch_stream_handle_t *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_switch_stream_handle_t,0))){ + SWIG_fail_ptr("new_Stream",1,SWIGTYPE_p_switch_stream_handle_t); + } + result = (Stream *)new Stream(arg1); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_Stream,1); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2077,7 +2429,7 @@ static int _wrap_new_Stream(lua_State* L) { int _v; { void *ptr; - if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_switch_stream_handle_t, 0)) { + if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_switch_stream_handle_t, 0)) { _v = 0; } else { _v = 1; @@ -2097,14 +2449,21 @@ static int _wrap_delete_Stream(lua_State* L) { int SWIG_arg = -1; Stream *arg1 = (Stream *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(Stream *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Stream,0,1,"delete_Stream"); + SWIG_check_num_args("Stream",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Stream",1,"Stream *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,SWIG_POINTER_DISOWN))){ + SWIG_fail_ptr("delete_Stream",1,SWIGTYPE_p_Stream); + } + delete arg1; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2116,15 +2475,22 @@ static int _wrap_Stream_write(lua_State* L) { Stream *arg1 = (Stream *) 0 ; char *arg2 = (char *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(Stream *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Stream,0,1,"Stream_write"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("write",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("write",1,"Stream *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("write",2,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){ + SWIG_fail_ptr("Stream_write",1,SWIGTYPE_p_Stream); + } + + arg2 = (char *)lua_tostring(L, 2); (arg1)->write((char const *)arg2); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2136,13 +2502,20 @@ static int _wrap_Stream_get_data(lua_State* L) { Stream *arg1 = (Stream *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(Stream *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Stream,0,1,"Stream_get_data"); + SWIG_check_num_args("get_data",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("get_data",1,"Stream *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){ + SWIG_fail_ptr("Stream_get_data",1,SWIGTYPE_p_Stream); + } + result = (char *)(arg1)->get_data(); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2162,23 +2535,35 @@ static swig_lua_attribute swig_Stream_attributes[] = { {0,0,0} }; static swig_lua_class *swig_Stream_bases[] = {0}; -swig_lua_class _wrap_class_Stream = { "Stream", &SWIGTYPE_p_Stream,_wrap_new_Stream, swig_delete_Stream, swig_Stream_methods, swig_Stream_attributes, swig_Stream_bases }; +static const char *swig_Stream_base_names[] = {0}; +static swig_lua_class _wrap_class_Stream = { "Stream", &SWIGTYPE_p_Stream,_wrap_new_Stream, swig_delete_Stream, swig_Stream_methods, swig_Stream_attributes, swig_Stream_bases, swig_Stream_base_names }; static int _wrap_Event_event_set(lua_State* L) { int SWIG_arg = -1; Event *arg1 = (Event *) 0 ; switch_event_t *arg2 = (switch_event_t *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_event_set"); - arg2=(switch_event_t *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_switch_event_t,0,2,"Event_event_set"); + SWIG_check_num_args("event",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("event",1,"Event *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("event",2,"switch_event_t *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ + SWIG_fail_ptr("Event_event_set",1,SWIGTYPE_p_Event); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_switch_event_t,SWIG_POINTER_DISOWN))){ + SWIG_fail_ptr("Event_event_set",2,SWIGTYPE_p_switch_event_t); + } + if (arg1) (arg1)->event = arg2; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2190,13 +2575,20 @@ static int _wrap_Event_event_get(lua_State* L) { Event *arg1 = (Event *) 0 ; switch_event_t *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_event_get"); + SWIG_check_num_args("event",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("event",1,"Event *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ + SWIG_fail_ptr("Event_event_get",1,SWIGTYPE_p_Event); + } + result = (switch_event_t *) ((arg1)->event); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_switch_event_t,0); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2208,15 +2600,20 @@ static int _wrap_Event_serialized_string_set(lua_State* L) { Event *arg1 = (Event *) 0 ; char *arg2 = (char *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_serialized_string_set"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("serialized_string",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("serialized_string",1,"Event *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("serialized_string",2,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ + SWIG_fail_ptr("Event_serialized_string_set",1,SWIGTYPE_p_Event); + } + + arg2 = (char *)lua_tostring(L, 2); { if (arg1->serialized_string) delete [] arg1->serialized_string; if (arg2) { - arg1->serialized_string = (char *) (new char[strlen(arg2)+1]); - strcpy((char *) arg1->serialized_string,arg2); + arg1->serialized_string = (char *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->serialized_string, (const char *)arg2); } else { arg1->serialized_string = 0; } @@ -2225,6 +2622,8 @@ static int _wrap_Event_serialized_string_set(lua_State* L) { return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2236,13 +2635,20 @@ static int _wrap_Event_serialized_string_get(lua_State* L) { Event *arg1 = (Event *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_serialized_string_get"); + SWIG_check_num_args("serialized_string",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("serialized_string",1,"Event *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ + SWIG_fail_ptr("Event_serialized_string_get",1,SWIGTYPE_p_Event); + } + result = (char *) ((arg1)->serialized_string); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2254,9 +2660,14 @@ static int _wrap_Event_mine_set(lua_State* L) { Event *arg1 = (Event *) 0 ; int arg2 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isnumber(L,2)) SWIG_fail_arg(2); - arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_mine_set"); + SWIG_check_num_args("mine",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("mine",1,"Event *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("mine",2,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ + SWIG_fail_ptr("Event_mine_set",1,SWIGTYPE_p_Event); + } + arg2 = (int)lua_tonumber(L, 2); if (arg1) (arg1)->mine = arg2; @@ -2264,6 +2675,8 @@ static int _wrap_Event_mine_set(lua_State* L) { return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2275,13 +2688,20 @@ static int _wrap_Event_mine_get(lua_State* L) { Event *arg1 = (Event *) 0 ; int result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_mine_get"); + SWIG_check_num_args("mine",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("mine",1,"Event *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ + SWIG_fail_ptr("Event_mine_get",1,SWIGTYPE_p_Event); + } + result = (int) ((arg1)->mine); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2294,17 +2714,20 @@ static int _wrap_new_Event__SWIG_0(lua_State* L) { char *arg2 = (char *) NULL ; Event *result = 0 ; - if(!lua_isstring(L,1)) SWIG_fail_arg(1); - if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg(2); - arg1 = (char*)lua_tostring(L, 1); + SWIG_check_num_args("Event",1,2) + if(!lua_isstring(L,1)) SWIG_fail_arg("Event",1,"char const *"); + if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("Event",2,"char const *"); + arg1 = (char *)lua_tostring(L, 1); if(lua_gettop(L)>=2){ - arg2 = (char*)lua_tostring(L, 2); + arg2 = (char *)lua_tostring(L, 2); } result = (Event *)new Event((char const *)arg1,(char const *)arg2); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_Event,1); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2317,9 +2740,14 @@ static int _wrap_new_Event__SWIG_1(lua_State* L) { int arg2 = (int) 0 ; Event *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg(2); - arg1=(switch_event_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_switch_event_t,0,1,"new_Event"); + SWIG_check_num_args("Event",1,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event",1,"switch_event_t *"); + if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("Event",2,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_switch_event_t,0))){ + SWIG_fail_ptr("new_Event",1,SWIGTYPE_p_switch_event_t); + } + if(lua_gettop(L)>=2){ arg2 = (int)lua_tonumber(L, 2); } @@ -2328,6 +2756,8 @@ static int _wrap_new_Event__SWIG_1(lua_State* L) { SWIG_NewPointerObj(L,result,SWIGTYPE_p_Event,1); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2345,7 +2775,7 @@ static int _wrap_new_Event(lua_State* L) { int _v; { void *ptr; - if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_switch_event_t, 0)) { + if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_switch_event_t, 0)) { _v = 0; } else { _v = 1; @@ -2390,14 +2820,21 @@ static int _wrap_delete_Event(lua_State* L) { int SWIG_arg = -1; Event *arg1 = (Event *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"delete_Event"); + SWIG_check_num_args("Event",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Event",1,"Event *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,SWIG_POINTER_DISOWN))){ + SWIG_fail_ptr("delete_Event",1,SWIGTYPE_p_Event); + } + delete arg1; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2410,17 +2847,24 @@ static int _wrap_Event_serialize(lua_State* L) { char *arg2 = (char *) NULL ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_serialize"); + SWIG_check_num_args("serialize",1,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("serialize",1,"Event *"); + if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("serialize",2,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ + SWIG_fail_ptr("Event_serialize",1,SWIGTYPE_p_Event); + } + if(lua_gettop(L)>=2){ - arg2 = (char*)lua_tostring(L, 2); + arg2 = (char *)lua_tostring(L, 2); } result = (char *)(arg1)->serialize((char const *)arg2); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2432,22 +2876,29 @@ static int _wrap_Event_setPriority(lua_State* L) { Event *arg1 = (Event *) 0 ; switch_priority_t arg2 = (switch_priority_t) SWITCH_PRIORITY_NORMAL ; bool result; + switch_priority_t *argp2 ; + + SWIG_check_num_args("setPriority",1,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setPriority",1,"Event *"); + if(lua_gettop(L)>=2 && !lua_isuserdata(L,2)) SWIG_fail_arg("setPriority",2,"switch_priority_t"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ + SWIG_fail_ptr("Event_setPriority",1,SWIGTYPE_p_Event); + } - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(lua_gettop(L)>=2 && !lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_setPriority"); if(lua_gettop(L)>=2){ - { - switch_priority_t * argp; - if(SWIG_ConvertPtr(L,2,(void**)(&argp),SWIGTYPE_p_switch_priority_t,0)) SWIG_fail; - arg2 = *argp; + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_switch_priority_t,0))){ + SWIG_fail_ptr("Event_setPriority",2,SWIGTYPE_p_switch_priority_t); } + arg2 = *argp2; } result = (bool)(arg1)->setPriority(arg2); SWIG_arg=0; - lua_pushboolean(L,(int)result); SWIG_arg++; + lua_pushboolean(L,(int)(result==true)); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2460,15 +2911,22 @@ static int _wrap_Event_getHeader(lua_State* L) { char *arg2 = (char *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_getHeader"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("getHeader",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getHeader",1,"Event *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("getHeader",2,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ + SWIG_fail_ptr("Event_getHeader",1,SWIGTYPE_p_Event); + } + + arg2 = (char *)lua_tostring(L, 2); result = (char *)(arg1)->getHeader((char const *)arg2); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2480,13 +2938,20 @@ static int _wrap_Event_getBody(lua_State* L) { Event *arg1 = (Event *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_getBody"); + SWIG_check_num_args("getBody",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getBody",1,"Event *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ + SWIG_fail_ptr("Event_getBody",1,SWIGTYPE_p_Event); + } + result = (char *)(arg1)->getBody(); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2498,13 +2963,20 @@ static int _wrap_Event_getType(lua_State* L) { Event *arg1 = (Event *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_getType"); + SWIG_check_num_args("getType",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getType",1,"Event *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ + SWIG_fail_ptr("Event_getType",1,SWIGTYPE_p_Event); + } + result = (char *)(arg1)->getType(); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2517,15 +2989,22 @@ static int _wrap_Event_addBody(lua_State* L) { char *arg2 = (char *) 0 ; bool result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_addBody"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("addBody",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("addBody",1,"Event *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("addBody",2,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ + SWIG_fail_ptr("Event_addBody",1,SWIGTYPE_p_Event); + } + + arg2 = (char *)lua_tostring(L, 2); result = (bool)(arg1)->addBody((char const *)arg2); SWIG_arg=0; - lua_pushboolean(L,(int)result); SWIG_arg++; + lua_pushboolean(L,(int)(result==true)); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2539,17 +3018,24 @@ static int _wrap_Event_addHeader(lua_State* L) { char *arg3 = (char *) 0 ; bool result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - if(!lua_isstring(L,3)) SWIG_fail_arg(3); - arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_addHeader"); - arg2 = (char*)lua_tostring(L, 2); - arg3 = (char*)lua_tostring(L, 3); + SWIG_check_num_args("addHeader",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("addHeader",1,"Event *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("addHeader",2,"char const *"); + if(!lua_isstring(L,3)) SWIG_fail_arg("addHeader",3,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ + SWIG_fail_ptr("Event_addHeader",1,SWIGTYPE_p_Event); + } + + arg2 = (char *)lua_tostring(L, 2); + arg3 = (char *)lua_tostring(L, 3); result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3); SWIG_arg=0; - lua_pushboolean(L,(int)result); SWIG_arg++; + lua_pushboolean(L,(int)(result==true)); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2562,15 +3048,22 @@ static int _wrap_Event_delHeader(lua_State* L) { char *arg2 = (char *) 0 ; bool result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_delHeader"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("delHeader",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("delHeader",1,"Event *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("delHeader",2,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ + SWIG_fail_ptr("Event_delHeader",1,SWIGTYPE_p_Event); + } + + arg2 = (char *)lua_tostring(L, 2); result = (bool)(arg1)->delHeader((char const *)arg2); SWIG_arg=0; - lua_pushboolean(L,(int)result); SWIG_arg++; + lua_pushboolean(L,(int)(result==true)); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2582,13 +3075,20 @@ static int _wrap_Event_fire(lua_State* L) { Event *arg1 = (Event *) 0 ; bool result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(Event *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_Event,0,1,"Event_fire"); + SWIG_check_num_args("fire",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("fire",1,"Event *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){ + SWIG_fail_ptr("Event_fire",1,SWIGTYPE_p_Event); + } + result = (bool)(arg1)->fire(); SWIG_arg=0; - lua_pushboolean(L,(int)result); SWIG_arg++; + lua_pushboolean(L,(int)(result==true)); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2612,29 +3112,41 @@ static swig_lua_method swig_Event_methods[] = { {0,0} }; static swig_lua_attribute swig_Event_attributes[] = { - { "event",_wrap_Event_event_get, _wrap_Event_event_set}, - { "serialized_string",_wrap_Event_serialized_string_get, _wrap_Event_serialized_string_set}, - { "mine",_wrap_Event_mine_get, _wrap_Event_mine_set}, + { "event", _wrap_Event_event_get, _wrap_Event_event_set}, + { "serialized_string", _wrap_Event_serialized_string_get, _wrap_Event_serialized_string_set}, + { "mine", _wrap_Event_mine_get, _wrap_Event_mine_set}, {0,0,0} }; static swig_lua_class *swig_Event_bases[] = {0}; -swig_lua_class _wrap_class_Event = { "Event", &SWIGTYPE_p_Event,_wrap_new_Event, swig_delete_Event, swig_Event_methods, swig_Event_attributes, swig_Event_bases }; +static const char *swig_Event_base_names[] = {0}; +static swig_lua_class _wrap_class_Event = { "Event", &SWIGTYPE_p_Event,_wrap_new_Event, swig_delete_Event, swig_Event_methods, swig_Event_attributes, swig_Event_bases, swig_Event_base_names }; static int _wrap_EventConsumer_events_set(lua_State* L) { int SWIG_arg = -1; EventConsumer *arg1 = (EventConsumer *) 0 ; switch_queue_t *arg2 = (switch_queue_t *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_events_set"); - arg2=(switch_queue_t *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_switch_queue_t,0,2,"EventConsumer_events_set"); + SWIG_check_num_args("events",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("events",1,"EventConsumer *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("events",2,"switch_queue_t *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ + SWIG_fail_ptr("EventConsumer_events_set",1,SWIGTYPE_p_EventConsumer); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_switch_queue_t,SWIG_POINTER_DISOWN))){ + SWIG_fail_ptr("EventConsumer_events_set",2,SWIGTYPE_p_switch_queue_t); + } + if (arg1) (arg1)->events = arg2; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2646,13 +3158,20 @@ static int _wrap_EventConsumer_events_get(lua_State* L) { EventConsumer *arg1 = (EventConsumer *) 0 ; switch_queue_t *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_events_get"); + SWIG_check_num_args("events",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("events",1,"EventConsumer *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ + SWIG_fail_ptr("EventConsumer_events_get",1,SWIGTYPE_p_EventConsumer); + } + result = (switch_queue_t *) ((arg1)->events); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_switch_queue_t,0); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2663,21 +3182,30 @@ static int _wrap_EventConsumer_e_event_id_set(lua_State* L) { int SWIG_arg = -1; EventConsumer *arg1 = (EventConsumer *) 0 ; switch_event_types_t arg2 ; + switch_event_types_t *argp2 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_e_event_id_set"); - { - switch_event_types_t * argp; - if(SWIG_ConvertPtr(L,2,(void**)(&argp),SWIGTYPE_p_switch_event_types_t,0)) SWIG_fail; - arg2 = *argp; + SWIG_check_num_args("e_event_id",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_event_id",1,"EventConsumer *"); + if(!lua_isuserdata(L,2)) SWIG_fail_arg("e_event_id",2,"switch_event_types_t"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ + SWIG_fail_ptr("EventConsumer_e_event_id_set",1,SWIGTYPE_p_EventConsumer); } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_switch_event_types_t,0))){ + SWIG_fail_ptr("EventConsumer_e_event_id_set",2,SWIGTYPE_p_switch_event_types_t); + } + arg2 = *argp2; + if (arg1) (arg1)->e_event_id = arg2; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2689,17 +3217,23 @@ static int _wrap_EventConsumer_e_event_id_get(lua_State* L) { EventConsumer *arg1 = (EventConsumer *) 0 ; switch_event_types_t result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_e_event_id_get"); + SWIG_check_num_args("e_event_id",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_event_id",1,"EventConsumer *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ + SWIG_fail_ptr("EventConsumer_e_event_id_get",1,SWIGTYPE_p_EventConsumer); + } + result = ((arg1)->e_event_id); SWIG_arg=0; { - switch_event_types_t * resultptr; - resultptr = new switch_event_types_t((switch_event_types_t &) result); + switch_event_types_t * resultptr = new switch_event_types_t((switch_event_types_t &) result); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_event_types_t,1); SWIG_arg++; } return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2711,15 +3245,20 @@ static int _wrap_EventConsumer_e_callback_set(lua_State* L) { EventConsumer *arg1 = (EventConsumer *) 0 ; char *arg2 = (char *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_e_callback_set"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("e_callback",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_callback",1,"EventConsumer *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("e_callback",2,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ + SWIG_fail_ptr("EventConsumer_e_callback_set",1,SWIGTYPE_p_EventConsumer); + } + + arg2 = (char *)lua_tostring(L, 2); { if (arg1->e_callback) delete [] arg1->e_callback; if (arg2) { - arg1->e_callback = (char *) (new char[strlen(arg2)+1]); - strcpy((char *) arg1->e_callback,arg2); + arg1->e_callback = (char *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->e_callback, (const char *)arg2); } else { arg1->e_callback = 0; } @@ -2728,6 +3267,8 @@ static int _wrap_EventConsumer_e_callback_set(lua_State* L) { return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2739,13 +3280,20 @@ static int _wrap_EventConsumer_e_callback_get(lua_State* L) { EventConsumer *arg1 = (EventConsumer *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_e_callback_get"); + SWIG_check_num_args("e_callback",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_callback",1,"EventConsumer *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ + SWIG_fail_ptr("EventConsumer_e_callback_get",1,SWIGTYPE_p_EventConsumer); + } + result = (char *) ((arg1)->e_callback); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2757,15 +3305,20 @@ static int _wrap_EventConsumer_e_subclass_name_set(lua_State* L) { EventConsumer *arg1 = (EventConsumer *) 0 ; char *arg2 = (char *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_e_subclass_name_set"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("e_subclass_name",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_subclass_name",1,"EventConsumer *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("e_subclass_name",2,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ + SWIG_fail_ptr("EventConsumer_e_subclass_name_set",1,SWIGTYPE_p_EventConsumer); + } + + arg2 = (char *)lua_tostring(L, 2); { if (arg1->e_subclass_name) delete [] arg1->e_subclass_name; if (arg2) { - arg1->e_subclass_name = (char *) (new char[strlen(arg2)+1]); - strcpy((char *) arg1->e_subclass_name,arg2); + arg1->e_subclass_name = (char *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->e_subclass_name, (const char *)arg2); } else { arg1->e_subclass_name = 0; } @@ -2774,6 +3327,8 @@ static int _wrap_EventConsumer_e_subclass_name_set(lua_State* L) { return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2785,13 +3340,20 @@ static int _wrap_EventConsumer_e_subclass_name_get(lua_State* L) { EventConsumer *arg1 = (EventConsumer *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_e_subclass_name_get"); + SWIG_check_num_args("e_subclass_name",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_subclass_name",1,"EventConsumer *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ + SWIG_fail_ptr("EventConsumer_e_subclass_name_get",1,SWIGTYPE_p_EventConsumer); + } + result = (char *) ((arg1)->e_subclass_name); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2803,15 +3365,20 @@ static int _wrap_EventConsumer_e_cb_arg_set(lua_State* L) { EventConsumer *arg1 = (EventConsumer *) 0 ; char *arg2 = (char *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_e_cb_arg_set"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("e_cb_arg",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_cb_arg",1,"EventConsumer *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("e_cb_arg",2,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ + SWIG_fail_ptr("EventConsumer_e_cb_arg_set",1,SWIGTYPE_p_EventConsumer); + } + + arg2 = (char *)lua_tostring(L, 2); { if (arg1->e_cb_arg) delete [] arg1->e_cb_arg; if (arg2) { - arg1->e_cb_arg = (char *) (new char[strlen(arg2)+1]); - strcpy((char *) arg1->e_cb_arg,arg2); + arg1->e_cb_arg = (char *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->e_cb_arg, (const char *)arg2); } else { arg1->e_cb_arg = 0; } @@ -2820,6 +3387,8 @@ static int _wrap_EventConsumer_e_cb_arg_set(lua_State* L) { return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2831,13 +3400,20 @@ static int _wrap_EventConsumer_e_cb_arg_get(lua_State* L) { EventConsumer *arg1 = (EventConsumer *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_e_cb_arg_get"); + SWIG_check_num_args("e_cb_arg",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("e_cb_arg",1,"EventConsumer *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ + SWIG_fail_ptr("EventConsumer_e_cb_arg_get",1,SWIGTYPE_p_EventConsumer); + } + result = (char *) ((arg1)->e_cb_arg); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2849,10 +3425,19 @@ static int _wrap_EventConsumer_enodes_set(lua_State* L) { EventConsumer *arg1 = (EventConsumer *) 0 ; switch_event_node_t **arg2 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_enodes_set"); - arg2=(switch_event_node_t **)SWIG_MustGetPtr(L,2,SWIGTYPE_p_p_switch_event_node_t,0,2,"EventConsumer_enodes_set"); + SWIG_check_num_args("enodes",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("enodes",1,"EventConsumer *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("enodes",2,"switch_event_node_t *[SWITCH_EVENT_ALL+1]"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ + SWIG_fail_ptr("EventConsumer_enodes_set",1,SWIGTYPE_p_EventConsumer); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_p_switch_event_node_t,0))){ + SWIG_fail_ptr("EventConsumer_enodes_set",2,SWIGTYPE_p_p_switch_event_node_t); + } + { size_t ii; switch_event_node_t * *b = (switch_event_node_t * *) arg1->enodes; @@ -2862,6 +3447,8 @@ static int _wrap_EventConsumer_enodes_set(lua_State* L) { return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2873,13 +3460,20 @@ static int _wrap_EventConsumer_enodes_get(lua_State* L) { EventConsumer *arg1 = (EventConsumer *) 0 ; switch_event_node_t **result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_enodes_get"); + SWIG_check_num_args("enodes",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("enodes",1,"EventConsumer *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ + SWIG_fail_ptr("EventConsumer_enodes_get",1,SWIGTYPE_p_EventConsumer); + } + result = (switch_event_node_t **)(switch_event_node_t **) ((arg1)->enodes); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_p_switch_event_node_t,0); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2890,21 +3484,30 @@ static int _wrap_EventConsumer_node_index_set(lua_State* L) { int SWIG_arg = -1; EventConsumer *arg1 = (EventConsumer *) 0 ; uint32_t arg2 ; + uint32_t *argp2 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_node_index_set"); - { - uint32_t * argp; - if(SWIG_ConvertPtr(L,2,(void**)(&argp),SWIGTYPE_p_uint32_t,0)) SWIG_fail; - arg2 = *argp; + SWIG_check_num_args("node_index",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("node_index",1,"EventConsumer *"); + if(!lua_isuserdata(L,2)) SWIG_fail_arg("node_index",2,"uint32_t"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ + SWIG_fail_ptr("EventConsumer_node_index_set",1,SWIGTYPE_p_EventConsumer); } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_uint32_t,0))){ + SWIG_fail_ptr("EventConsumer_node_index_set",2,SWIGTYPE_p_uint32_t); + } + arg2 = *argp2; + if (arg1) (arg1)->node_index = arg2; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2916,17 +3519,23 @@ static int _wrap_EventConsumer_node_index_get(lua_State* L) { EventConsumer *arg1 = (EventConsumer *) 0 ; uint32_t result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_node_index_get"); + SWIG_check_num_args("node_index",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("node_index",1,"EventConsumer *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ + SWIG_fail_ptr("EventConsumer_node_index_get",1,SWIGTYPE_p_EventConsumer); + } + result = ((arg1)->node_index); SWIG_arg=0; { - uint32_t * resultptr; - resultptr = new uint32_t((uint32_t &) result); + uint32_t * resultptr = new uint32_t((uint32_t &) result); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_uint32_t,1); SWIG_arg++; } return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2939,19 +3548,22 @@ static int _wrap_new_EventConsumer(lua_State* L) { char *arg2 = (char *) "" ; EventConsumer *result = 0 ; - if(lua_gettop(L)>=1 && !lua_isstring(L,1)) SWIG_fail_arg(1); - if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg(2); + SWIG_check_num_args("EventConsumer",0,2) + if(lua_gettop(L)>=1 && !lua_isstring(L,1)) SWIG_fail_arg("EventConsumer",1,"char const *"); + if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("EventConsumer",2,"char const *"); if(lua_gettop(L)>=1){ - arg1 = (char*)lua_tostring(L, 1); + arg1 = (char *)lua_tostring(L, 1); } if(lua_gettop(L)>=2){ - arg2 = (char*)lua_tostring(L, 2); + arg2 = (char *)lua_tostring(L, 2); } result = (EventConsumer *)new EventConsumer((char const *)arg1,(char const *)arg2); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_EventConsumer,1); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2962,14 +3574,21 @@ static int _wrap_delete_EventConsumer(lua_State* L) { int SWIG_arg = -1; EventConsumer *arg1 = (EventConsumer *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"delete_EventConsumer"); + SWIG_check_num_args("EventConsumer",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("EventConsumer",1,"EventConsumer *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,SWIG_POINTER_DISOWN))){ + SWIG_fail_ptr("delete_EventConsumer",1,SWIGTYPE_p_EventConsumer); + } + delete arg1; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -2983,19 +3602,26 @@ static int _wrap_EventConsumer_bind(lua_State* L) { char *arg3 = (char *) "" ; int result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg(3); - arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_bind"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("bind",2,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("bind",1,"EventConsumer *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("bind",2,"char const *"); + if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("bind",3,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ + SWIG_fail_ptr("EventConsumer_bind",1,SWIGTYPE_p_EventConsumer); + } + + arg2 = (char *)lua_tostring(L, 2); if(lua_gettop(L)>=3){ - arg3 = (char*)lua_tostring(L, 3); + arg3 = (char *)lua_tostring(L, 3); } result = (int)(arg1)->bind((char const *)arg2,(char const *)arg3); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3008,9 +3634,14 @@ static int _wrap_EventConsumer_pop(lua_State* L) { int arg2 = (int) 0 ; Event *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg(2); - arg1=(EventConsumer *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_EventConsumer,0,1,"EventConsumer_pop"); + SWIG_check_num_args("pop",1,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("pop",1,"EventConsumer *"); + if(lua_gettop(L)>=2 && !lua_isnumber(L,2)) SWIG_fail_arg("pop",2,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_EventConsumer,0))){ + SWIG_fail_ptr("EventConsumer_pop",1,SWIGTYPE_p_EventConsumer); + } + if(lua_gettop(L)>=2){ arg2 = (int)lua_tonumber(L, 2); } @@ -3019,6 +3650,8 @@ static int _wrap_EventConsumer_pop(lua_State* L) { SWIG_NewPointerObj(L,result,SWIGTYPE_p_Event,1); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3035,30 +3668,38 @@ static swig_lua_method swig_EventConsumer_methods[] = { {0,0} }; static swig_lua_attribute swig_EventConsumer_attributes[] = { - { "events",_wrap_EventConsumer_events_get, _wrap_EventConsumer_events_set}, - { "e_event_id",_wrap_EventConsumer_e_event_id_get, _wrap_EventConsumer_e_event_id_set}, - { "e_callback",_wrap_EventConsumer_e_callback_get, _wrap_EventConsumer_e_callback_set}, - { "e_subclass_name",_wrap_EventConsumer_e_subclass_name_get, _wrap_EventConsumer_e_subclass_name_set}, - { "e_cb_arg",_wrap_EventConsumer_e_cb_arg_get, _wrap_EventConsumer_e_cb_arg_set}, - { "enodes",_wrap_EventConsumer_enodes_get, _wrap_EventConsumer_enodes_set}, - { "node_index",_wrap_EventConsumer_node_index_get, _wrap_EventConsumer_node_index_set}, + { "events", _wrap_EventConsumer_events_get, _wrap_EventConsumer_events_set}, + { "e_event_id", _wrap_EventConsumer_e_event_id_get, _wrap_EventConsumer_e_event_id_set}, + { "e_callback", _wrap_EventConsumer_e_callback_get, _wrap_EventConsumer_e_callback_set}, + { "e_subclass_name", _wrap_EventConsumer_e_subclass_name_get, _wrap_EventConsumer_e_subclass_name_set}, + { "e_cb_arg", _wrap_EventConsumer_e_cb_arg_get, _wrap_EventConsumer_e_cb_arg_set}, + { "enodes", _wrap_EventConsumer_enodes_get, _wrap_EventConsumer_enodes_set}, + { "node_index", _wrap_EventConsumer_node_index_get, _wrap_EventConsumer_node_index_set}, {0,0,0} }; static swig_lua_class *swig_EventConsumer_bases[] = {0}; -swig_lua_class _wrap_class_EventConsumer = { "EventConsumer", &SWIGTYPE_p_EventConsumer,_wrap_new_EventConsumer, swig_delete_EventConsumer, swig_EventConsumer_methods, swig_EventConsumer_attributes, swig_EventConsumer_bases }; +static const char *swig_EventConsumer_base_names[] = {0}; +static swig_lua_class _wrap_class_EventConsumer = { "EventConsumer", &SWIGTYPE_p_EventConsumer,_wrap_new_EventConsumer, swig_delete_EventConsumer, swig_EventConsumer_methods, swig_EventConsumer_attributes, swig_EventConsumer_bases, swig_EventConsumer_base_names }; static int _wrap_delete_CoreSession(lua_State* L) { int SWIG_arg = -1; CoreSession *arg1 = (CoreSession *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"delete_CoreSession"); + SWIG_check_num_args("CoreSession",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,SWIG_POINTER_DISOWN))){ + SWIG_fail_ptr("delete_CoreSession",1,SWIGTYPE_p_CoreSession); + } + delete arg1; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3070,16 +3711,27 @@ static int _wrap_CoreSession_session_set(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; switch_core_session_t *arg2 = (switch_core_session_t *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_session_set"); - arg2=(switch_core_session_t *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_switch_core_session_t,0,2,"CoreSession_session_set"); + SWIG_check_num_args("session",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("session",1,"CoreSession *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("session",2,"switch_core_session_t *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_session_set",1,SWIGTYPE_p_CoreSession); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_switch_core_session_t,SWIG_POINTER_DISOWN))){ + SWIG_fail_ptr("CoreSession_session_set",2,SWIGTYPE_p_switch_core_session_t); + } + if (arg1) (arg1)->session = arg2; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3091,13 +3743,20 @@ static int _wrap_CoreSession_session_get(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; switch_core_session_t *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_session_get"); + SWIG_check_num_args("session",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("session",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_session_get",1,SWIGTYPE_p_CoreSession); + } + result = (switch_core_session_t *) ((arg1)->session); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_switch_core_session_t,0); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3109,16 +3768,27 @@ static int _wrap_CoreSession_channel_set(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; switch_channel_t *arg2 = (switch_channel_t *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_channel_set"); - arg2=(switch_channel_t *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_switch_channel_t,0,2,"CoreSession_channel_set"); + SWIG_check_num_args("channel",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("channel",1,"CoreSession *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("channel",2,"switch_channel_t *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_channel_set",1,SWIGTYPE_p_CoreSession); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_switch_channel_t,SWIG_POINTER_DISOWN))){ + SWIG_fail_ptr("CoreSession_channel_set",2,SWIGTYPE_p_switch_channel_t); + } + if (arg1) (arg1)->channel = arg2; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3130,13 +3800,20 @@ static int _wrap_CoreSession_channel_get(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; switch_channel_t *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_channel_get"); + SWIG_check_num_args("channel",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("channel",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_channel_get",1,SWIGTYPE_p_CoreSession); + } + result = (switch_channel_t *) ((arg1)->channel); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_switch_channel_t,0); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3148,9 +3825,14 @@ static int _wrap_CoreSession_flags_set(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; unsigned int arg2 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isnumber(L,2)) SWIG_fail_arg(2); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_flags_set"); + SWIG_check_num_args("flags",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("flags",1,"CoreSession *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("flags",2,"unsigned int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_flags_set",1,SWIGTYPE_p_CoreSession); + } + arg2 = (unsigned int)lua_tonumber(L, 2); if (arg1) (arg1)->flags = arg2; @@ -3158,6 +3840,8 @@ static int _wrap_CoreSession_flags_set(lua_State* L) { return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3169,13 +3853,20 @@ static int _wrap_CoreSession_flags_get(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; unsigned int result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_flags_get"); + SWIG_check_num_args("flags",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("flags",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_flags_get",1,SWIGTYPE_p_CoreSession); + } + result = (unsigned int) ((arg1)->flags); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3187,9 +3878,14 @@ static int _wrap_CoreSession_allocated_set(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; int arg2 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isnumber(L,2)) SWIG_fail_arg(2); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_allocated_set"); + SWIG_check_num_args("allocated",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("allocated",1,"CoreSession *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("allocated",2,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_allocated_set",1,SWIGTYPE_p_CoreSession); + } + arg2 = (int)lua_tonumber(L, 2); if (arg1) (arg1)->allocated = arg2; @@ -3197,6 +3893,8 @@ static int _wrap_CoreSession_allocated_set(lua_State* L) { return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3208,13 +3906,20 @@ static int _wrap_CoreSession_allocated_get(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; int result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_allocated_get"); + SWIG_check_num_args("allocated",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("allocated",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_allocated_get",1,SWIGTYPE_p_CoreSession); + } + result = (int) ((arg1)->allocated); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3226,16 +3931,27 @@ static int _wrap_CoreSession_cb_state_set(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; input_callback_state *arg2 = (input_callback_state *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_cb_state_set"); - arg2=(input_callback_state *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_input_callback_state,0,2,"CoreSession_cb_state_set"); + SWIG_check_num_args("cb_state",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_state",1,"CoreSession *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("cb_state",2,"input_callback_state *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_cb_state_set",1,SWIGTYPE_p_CoreSession); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_input_callback_state,0))){ + SWIG_fail_ptr("CoreSession_cb_state_set",2,SWIGTYPE_p_input_callback_state); + } + if (arg1) (arg1)->cb_state = *arg2; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3247,13 +3963,20 @@ static int _wrap_CoreSession_cb_state_get(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; input_callback_state *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_cb_state_get"); + SWIG_check_num_args("cb_state",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_state",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_cb_state_get",1,SWIGTYPE_p_CoreSession); + } + result = (input_callback_state *)& ((arg1)->cb_state); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_input_callback_state,0); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3264,21 +3987,30 @@ static int _wrap_CoreSession_hook_state_set(lua_State* L) { int SWIG_arg = -1; CoreSession *arg1 = (CoreSession *) 0 ; switch_channel_state_t arg2 ; + switch_channel_state_t *argp2 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_hook_state_set"); - { - switch_channel_state_t * argp; - if(SWIG_ConvertPtr(L,2,(void**)(&argp),SWIGTYPE_p_switch_channel_state_t,0)) SWIG_fail; - arg2 = *argp; + SWIG_check_num_args("hook_state",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hook_state",1,"CoreSession *"); + if(!lua_isuserdata(L,2)) SWIG_fail_arg("hook_state",2,"switch_channel_state_t"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_hook_state_set",1,SWIGTYPE_p_CoreSession); } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_switch_channel_state_t,0))){ + SWIG_fail_ptr("CoreSession_hook_state_set",2,SWIGTYPE_p_switch_channel_state_t); + } + arg2 = *argp2; + if (arg1) (arg1)->hook_state = arg2; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3290,17 +4022,23 @@ static int _wrap_CoreSession_hook_state_get(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; switch_channel_state_t result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_hook_state_get"); + SWIG_check_num_args("hook_state",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hook_state",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_hook_state_get",1,SWIGTYPE_p_CoreSession); + } + result = ((arg1)->hook_state); SWIG_arg=0; { - switch_channel_state_t * resultptr; - resultptr = new switch_channel_state_t((switch_channel_state_t &) result); + switch_channel_state_t * resultptr = new switch_channel_state_t((switch_channel_state_t &) result); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_channel_state_t,1); SWIG_arg++; } return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3311,21 +4049,30 @@ static int _wrap_CoreSession_cause_set(lua_State* L) { int SWIG_arg = -1; CoreSession *arg1 = (CoreSession *) 0 ; switch_call_cause_t arg2 ; + switch_call_cause_t *argp2 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_cause_set"); - { - switch_call_cause_t * argp; - if(SWIG_ConvertPtr(L,2,(void**)(&argp),SWIGTYPE_p_switch_call_cause_t,0)) SWIG_fail; - arg2 = *argp; + SWIG_check_num_args("cause",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cause",1,"CoreSession *"); + if(!lua_isuserdata(L,2)) SWIG_fail_arg("cause",2,"switch_call_cause_t"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_cause_set",1,SWIGTYPE_p_CoreSession); } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_switch_call_cause_t,0))){ + SWIG_fail_ptr("CoreSession_cause_set",2,SWIGTYPE_p_switch_call_cause_t); + } + arg2 = *argp2; + if (arg1) (arg1)->cause = arg2; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3337,17 +4084,23 @@ static int _wrap_CoreSession_cause_get(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; switch_call_cause_t result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_cause_get"); + SWIG_check_num_args("cause",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cause",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_cause_get",1,SWIGTYPE_p_CoreSession); + } + result = ((arg1)->cause); SWIG_arg=0; { - switch_call_cause_t * resultptr; - resultptr = new switch_call_cause_t((switch_call_cause_t &) result); + switch_call_cause_t * resultptr = new switch_call_cause_t((switch_call_cause_t &) result); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_call_cause_t,1); SWIG_arg++; } return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3359,15 +4112,20 @@ static int _wrap_CoreSession_uuid_set(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; char *arg2 = (char *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_uuid_set"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("uuid",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uuid",1,"CoreSession *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("uuid",2,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_uuid_set",1,SWIGTYPE_p_CoreSession); + } + + arg2 = (char *)lua_tostring(L, 2); { if (arg1->uuid) delete [] arg1->uuid; if (arg2) { - arg1->uuid = (char *) (new char[strlen(arg2)+1]); - strcpy((char *) arg1->uuid,arg2); + arg1->uuid = (char *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->uuid, (const char *)arg2); } else { arg1->uuid = 0; } @@ -3376,6 +4134,8 @@ static int _wrap_CoreSession_uuid_set(lua_State* L) { return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3387,13 +4147,20 @@ static int _wrap_CoreSession_uuid_get(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_uuid_get"); + SWIG_check_num_args("uuid",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uuid",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_uuid_get",1,SWIGTYPE_p_CoreSession); + } + result = (char *) ((arg1)->uuid); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3405,15 +4172,20 @@ static int _wrap_CoreSession_tts_name_set(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; char *arg2 = (char *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_tts_name_set"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("tts_name",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("tts_name",1,"CoreSession *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("tts_name",2,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_tts_name_set",1,SWIGTYPE_p_CoreSession); + } + + arg2 = (char *)lua_tostring(L, 2); { if (arg1->tts_name) delete [] arg1->tts_name; if (arg2) { - arg1->tts_name = (char *) (new char[strlen(arg2)+1]); - strcpy((char *) arg1->tts_name,arg2); + arg1->tts_name = (char *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->tts_name, (const char *)arg2); } else { arg1->tts_name = 0; } @@ -3422,6 +4194,8 @@ static int _wrap_CoreSession_tts_name_set(lua_State* L) { return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3433,13 +4207,20 @@ static int _wrap_CoreSession_tts_name_get(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_tts_name_get"); + SWIG_check_num_args("tts_name",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("tts_name",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_tts_name_get",1,SWIGTYPE_p_CoreSession); + } + result = (char *) ((arg1)->tts_name); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3451,15 +4232,20 @@ static int _wrap_CoreSession_voice_name_set(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; char *arg2 = (char *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_voice_name_set"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("voice_name",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("voice_name",1,"CoreSession *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("voice_name",2,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_voice_name_set",1,SWIGTYPE_p_CoreSession); + } + + arg2 = (char *)lua_tostring(L, 2); { if (arg1->voice_name) delete [] arg1->voice_name; if (arg2) { - arg1->voice_name = (char *) (new char[strlen(arg2)+1]); - strcpy((char *) arg1->voice_name,arg2); + arg1->voice_name = (char *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->voice_name, (const char *)arg2); } else { arg1->voice_name = 0; } @@ -3468,6 +4254,8 @@ static int _wrap_CoreSession_voice_name_set(lua_State* L) { return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3479,13 +4267,20 @@ static int _wrap_CoreSession_voice_name_get(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_voice_name_get"); + SWIG_check_num_args("voice_name",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("voice_name",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_voice_name_get",1,SWIGTYPE_p_CoreSession); + } + result = (char *) ((arg1)->voice_name); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3497,13 +4292,20 @@ static int _wrap_CoreSession_answer(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; int result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_answer"); + SWIG_check_num_args("answer",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("answer",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_answer",1,SWIGTYPE_p_CoreSession); + } + result = (int)(arg1)->answer(); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3515,13 +4317,20 @@ static int _wrap_CoreSession_preAnswer(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; int result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_preAnswer"); + SWIG_check_num_args("preAnswer",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("preAnswer",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_preAnswer",1,SWIGTYPE_p_CoreSession); + } + result = (int)(arg1)->preAnswer(); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3533,17 +4342,24 @@ static int _wrap_CoreSession_hangup(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; char *arg2 = (char *) "normal_clearing" ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_hangup"); + SWIG_check_num_args("hangup",1,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup",1,"CoreSession *"); + if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("hangup",2,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_hangup",1,SWIGTYPE_p_CoreSession); + } + if(lua_gettop(L)>=2){ - arg2 = (char*)lua_tostring(L, 2); + arg2 = (char *)lua_tostring(L, 2); } (arg1)->hangup((char const *)arg2); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3554,13 +4370,20 @@ static int _wrap_CoreSession_hangupState(lua_State* L) { int SWIG_arg = -1; CoreSession *arg1 = (CoreSession *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_hangupState"); + SWIG_check_num_args("hangupState",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangupState",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_hangupState",1,SWIGTYPE_p_CoreSession); + } + (arg1)->hangupState(); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3573,17 +4396,24 @@ static int _wrap_CoreSession_setVariable(lua_State* L) { char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - if(!lua_isstring(L,3)) SWIG_fail_arg(3); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_setVariable"); - arg2 = (char*)lua_tostring(L, 2); - arg3 = (char*)lua_tostring(L, 3); + SWIG_check_num_args("setVariable",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setVariable",1,"CoreSession *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("setVariable",2,"char *"); + if(!lua_isstring(L,3)) SWIG_fail_arg("setVariable",3,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_setVariable",1,SWIGTYPE_p_CoreSession); + } + + arg2 = (char *)lua_tostring(L, 2); + arg3 = (char *)lua_tostring(L, 3); (arg1)->setVariable(arg2,arg3); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3596,17 +4426,24 @@ static int _wrap_CoreSession_setPrivate(lua_State* L) { char *arg2 = (char *) 0 ; void *arg3 = (void *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - if(!lua_isuserdata(L,3)) SWIG_fail_arg(3); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_setPrivate"); - arg2 = (char*)lua_tostring(L, 2); - arg3=((swig_lua_userdata*)(lua_touserdata(L,3)))->ptr; + SWIG_check_num_args("setPrivate",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setPrivate",1,"CoreSession *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("setPrivate",2,"char *"); + if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("setPrivate",3,"void *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_setPrivate",1,SWIGTYPE_p_CoreSession); + } + + arg2 = (char *)lua_tostring(L, 2); + arg3=(void *)SWIG_MustGetPtr(L,3,0,0,3,"CoreSession_setPrivate"); (arg1)->setPrivate(arg2,arg3); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3619,15 +4456,22 @@ static int _wrap_CoreSession_getPrivate(lua_State* L) { char *arg2 = (char *) 0 ; void *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_getPrivate"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("getPrivate",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getPrivate",1,"CoreSession *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("getPrivate",2,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_getPrivate",1,SWIGTYPE_p_CoreSession); + } + + arg2 = (char *)lua_tostring(L, 2); result = (void *)(arg1)->getPrivate(arg2); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3640,15 +4484,22 @@ static int _wrap_CoreSession_getVariable(lua_State* L) { char *arg2 = (char *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_getVariable"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("getVariable",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getVariable",1,"CoreSession *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("getVariable",2,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_getVariable",1,SWIGTYPE_p_CoreSession); + } + + arg2 = (char *)lua_tostring(L, 2); result = (char *)(arg1)->getVariable(arg2); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3661,19 +4512,25 @@ static int _wrap_CoreSession_process_callback_result(lua_State* L) { char *arg2 = (char *) 0 ; switch_status_t result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_process_callback_result"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("process_callback_result",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("process_callback_result",1,"CoreSession *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("process_callback_result",2,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_process_callback_result",1,SWIGTYPE_p_CoreSession); + } + + arg2 = (char *)lua_tostring(L, 2); result = (arg1)->process_callback_result(arg2); SWIG_arg=0; { - switch_status_t * resultptr; - resultptr = new switch_status_t((switch_status_t &) result); + switch_status_t * resultptr = new switch_status_t((switch_status_t &) result); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_status_t,1); SWIG_arg++; } return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3689,25 +4546,32 @@ static int _wrap_CoreSession_say(lua_State* L) { char *arg5 = (char *) 0 ; char *arg6 = (char *) NULL ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - if(!lua_isstring(L,3)) SWIG_fail_arg(3); - if(!lua_isstring(L,4)) SWIG_fail_arg(4); - if(!lua_isstring(L,5)) SWIG_fail_arg(5); - if(lua_gettop(L)>=6 && !lua_isstring(L,6)) SWIG_fail_arg(6); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_say"); - arg2 = (char*)lua_tostring(L, 2); - arg3 = (char*)lua_tostring(L, 3); - arg4 = (char*)lua_tostring(L, 4); - arg5 = (char*)lua_tostring(L, 5); + SWIG_check_num_args("say",5,6) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("say",1,"CoreSession *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("say",2,"char const *"); + if(!lua_isstring(L,3)) SWIG_fail_arg("say",3,"char const *"); + if(!lua_isstring(L,4)) SWIG_fail_arg("say",4,"char const *"); + if(!lua_isstring(L,5)) SWIG_fail_arg("say",5,"char const *"); + if(lua_gettop(L)>=6 && !lua_isstring(L,6)) SWIG_fail_arg("say",6,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_say",1,SWIGTYPE_p_CoreSession); + } + + arg2 = (char *)lua_tostring(L, 2); + arg3 = (char *)lua_tostring(L, 3); + arg4 = (char *)lua_tostring(L, 4); + arg5 = (char *)lua_tostring(L, 5); if(lua_gettop(L)>=6){ - arg6 = (char*)lua_tostring(L, 6); + arg6 = (char *)lua_tostring(L, 6); } (arg1)->say((char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5,(char const *)arg6); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3721,23 +4585,30 @@ static int _wrap_CoreSession_sayPhrase(lua_State* L) { char *arg3 = (char *) "" ; char *arg4 = (char *) NULL ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg(3); - if(lua_gettop(L)>=4 && !lua_isstring(L,4)) SWIG_fail_arg(4); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_sayPhrase"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("sayPhrase",2,4) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sayPhrase",1,"CoreSession *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("sayPhrase",2,"char const *"); + if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("sayPhrase",3,"char const *"); + if(lua_gettop(L)>=4 && !lua_isstring(L,4)) SWIG_fail_arg("sayPhrase",4,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_sayPhrase",1,SWIGTYPE_p_CoreSession); + } + + arg2 = (char *)lua_tostring(L, 2); if(lua_gettop(L)>=3){ - arg3 = (char*)lua_tostring(L, 3); + arg3 = (char *)lua_tostring(L, 3); } if(lua_gettop(L)>=4){ - arg4 = (char*)lua_tostring(L, 4); + arg4 = (char *)lua_tostring(L, 4); } (arg1)->sayPhrase((char const *)arg2,(char const *)arg3,(char const *)arg4); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3749,13 +4620,20 @@ static int _wrap_CoreSession_hangupCause(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_hangupCause"); + SWIG_check_num_args("hangupCause",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangupCause",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_hangupCause",1,SWIGTYPE_p_CoreSession); + } + result = (char *)(arg1)->hangupCause(); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3767,13 +4645,20 @@ static int _wrap_CoreSession_getState(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_getState"); + SWIG_check_num_args("getState",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getState",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_getState",1,SWIGTYPE_p_CoreSession); + } + result = (char *)(arg1)->getState(); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3789,13 +4674,18 @@ static int _wrap_CoreSession_recordFile(lua_State* L) { int arg5 = (int) 0 ; int result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg(3); - if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg(4); - if(lua_gettop(L)>=5 && !lua_isnumber(L,5)) SWIG_fail_arg(5); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_recordFile"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("recordFile",2,5) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("recordFile",1,"CoreSession *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("recordFile",2,"char *"); + if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("recordFile",3,"int"); + if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("recordFile",4,"int"); + if(lua_gettop(L)>=5 && !lua_isnumber(L,5)) SWIG_fail_arg("recordFile",5,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_recordFile",1,SWIGTYPE_p_CoreSession); + } + + arg2 = (char *)lua_tostring(L, 2); if(lua_gettop(L)>=3){ arg3 = (int)lua_tonumber(L, 3); } @@ -3810,6 +4700,8 @@ static int _wrap_CoreSession_recordFile(lua_State* L) { lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3825,25 +4717,38 @@ static int _wrap_CoreSession_originate(lua_State* L) { switch_state_handler_table_t *arg5 = (switch_state_handler_table_t *) NULL ; int result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - if(!lua_isstring(L,3)) SWIG_fail_arg(3); - if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg(4); - if(lua_gettop(L)>=5 && !lua_isuserdata(L,5)) SWIG_fail_arg(5); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_originate"); - arg2=(CoreSession *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_CoreSession,0,2,"CoreSession_originate"); - arg3 = (char*)lua_tostring(L, 3); + SWIG_check_num_args("originate",3,5) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("originate",1,"CoreSession *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("originate",2,"CoreSession *"); + if(!lua_isstring(L,3)) SWIG_fail_arg("originate",3,"char *"); + if(lua_gettop(L)>=4 && !lua_isnumber(L,4)) SWIG_fail_arg("originate",4,"int"); + if(lua_gettop(L)>=5 && !SWIG_isptrtype(L,5)) SWIG_fail_arg("originate",5,"switch_state_handler_table_t *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_originate",1,SWIGTYPE_p_CoreSession); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_originate",2,SWIGTYPE_p_CoreSession); + } + + arg3 = (char *)lua_tostring(L, 3); if(lua_gettop(L)>=4){ arg4 = (int)lua_tonumber(L, 4); } if(lua_gettop(L)>=5){ - arg5=(switch_state_handler_table_t *)SWIG_MustGetPtr(L,5,SWIGTYPE_p_switch_state_handler_table_t,0,5,"CoreSession_originate"); + if (!SWIG_IsOK(SWIG_ConvertPtr(L,5,(void**)&arg5,SWIGTYPE_p_switch_state_handler_table_t,0))){ + SWIG_fail_ptr("CoreSession_originate",5,SWIGTYPE_p_switch_state_handler_table_t); + } } result = (int)(arg1)->originate(arg2,arg3,arg4,arg5); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3854,13 +4759,20 @@ static int _wrap_CoreSession_destroy(lua_State* L) { int SWIG_arg = -1; CoreSession *arg1 = (CoreSession *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_destroy"); + SWIG_check_num_args("destroy",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("destroy",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_destroy",1,SWIGTYPE_p_CoreSession); + } + (arg1)->destroy(); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3873,17 +4785,24 @@ static int _wrap_CoreSession_setDTMFCallback(lua_State* L) { void *arg2 = (void *) 0 ; char *arg3 = (char *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - if(!lua_isstring(L,3)) SWIG_fail_arg(3); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_setDTMFCallback"); - arg2=((swig_lua_userdata*)(lua_touserdata(L,2)))->ptr; - arg3 = (char*)lua_tostring(L, 3); + SWIG_check_num_args("setDTMFCallback",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setDTMFCallback",1,"CoreSession *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("setDTMFCallback",2,"void *"); + if(!lua_isstring(L,3)) SWIG_fail_arg("setDTMFCallback",3,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_setDTMFCallback",1,SWIGTYPE_p_CoreSession); + } + + arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"CoreSession_setDTMFCallback"); + arg3 = (char *)lua_tostring(L, 3); (arg1)->setDTMFCallback(arg2,arg3); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3896,15 +4815,22 @@ static int _wrap_CoreSession_speak(lua_State* L) { char *arg2 = (char *) 0 ; int result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_speak"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("speak",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("speak",1,"CoreSession *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("speak",2,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_speak",1,SWIGTYPE_p_CoreSession); + } + + arg2 = (char *)lua_tostring(L, 2); result = (int)(arg1)->speak(arg2); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3917,17 +4843,24 @@ static int _wrap_CoreSession_set_tts_parms(lua_State* L) { char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - if(!lua_isstring(L,3)) SWIG_fail_arg(3); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_set_tts_parms"); - arg2 = (char*)lua_tostring(L, 2); - arg3 = (char*)lua_tostring(L, 3); + SWIG_check_num_args("set_tts_parms",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("set_tts_parms",1,"CoreSession *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("set_tts_parms",2,"char *"); + if(!lua_isstring(L,3)) SWIG_fail_arg("set_tts_parms",3,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_set_tts_parms",1,SWIGTYPE_p_CoreSession); + } + + arg2 = (char *)lua_tostring(L, 2); + arg3 = (char *)lua_tostring(L, 3); (arg1)->set_tts_parms(arg2,arg3); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3940,15 +4873,22 @@ static int _wrap_CoreSession_collectDigits__SWIG_0(lua_State* L) { int arg2 ; int result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isnumber(L,2)) SWIG_fail_arg(2); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_collectDigits"); + SWIG_check_num_args("collectDigits",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("collectDigits",1,"CoreSession *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("collectDigits",2,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_collectDigits",1,SWIGTYPE_p_CoreSession); + } + arg2 = (int)lua_tonumber(L, 2); result = (int)(arg1)->collectDigits(arg2); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3962,10 +4902,15 @@ static int _wrap_CoreSession_collectDigits__SWIG_1(lua_State* L) { int arg3 ; int result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isnumber(L,2)) SWIG_fail_arg(2); - if(!lua_isnumber(L,3)) SWIG_fail_arg(3); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_collectDigits"); + SWIG_check_num_args("collectDigits",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("collectDigits",1,"CoreSession *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("collectDigits",2,"int"); + if(!lua_isnumber(L,3)) SWIG_fail_arg("collectDigits",3,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_collectDigits",1,SWIGTYPE_p_CoreSession); + } + arg2 = (int)lua_tonumber(L, 2); arg3 = (int)lua_tonumber(L, 3); result = (int)(arg1)->collectDigits(arg2,arg3); @@ -3973,6 +4918,8 @@ static int _wrap_CoreSession_collectDigits__SWIG_1(lua_State* L) { lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -3990,7 +4937,7 @@ static int _wrap_CoreSession_collectDigits(lua_State* L) { int _v; { void *ptr; - if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { + if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { _v = 0; } else { _v = 1; @@ -4009,7 +4956,7 @@ static int _wrap_CoreSession_collectDigits(lua_State* L) { int _v; { void *ptr; - if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { + if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { _v = 0; } else { _v = 1; @@ -4043,19 +4990,26 @@ static int _wrap_CoreSession_getDigits__SWIG_0(lua_State* L) { int arg4 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isnumber(L,2)) SWIG_fail_arg(2); - if(!lua_isstring(L,3)) SWIG_fail_arg(3); - if(!lua_isnumber(L,4)) SWIG_fail_arg(4); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_getDigits"); + SWIG_check_num_args("getDigits",4,4) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getDigits",1,"CoreSession *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("getDigits",2,"int"); + if(!lua_isstring(L,3)) SWIG_fail_arg("getDigits",3,"char *"); + if(!lua_isnumber(L,4)) SWIG_fail_arg("getDigits",4,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_getDigits",1,SWIGTYPE_p_CoreSession); + } + arg2 = (int)lua_tonumber(L, 2); - arg3 = (char*)lua_tostring(L, 3); + arg3 = (char *)lua_tostring(L, 3); arg4 = (int)lua_tonumber(L, 4); result = (char *)(arg1)->getDigits(arg2,arg3,arg4); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4071,21 +5025,28 @@ static int _wrap_CoreSession_getDigits__SWIG_1(lua_State* L) { int arg5 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isnumber(L,2)) SWIG_fail_arg(2); - if(!lua_isstring(L,3)) SWIG_fail_arg(3); - if(!lua_isnumber(L,4)) SWIG_fail_arg(4); - if(!lua_isnumber(L,5)) SWIG_fail_arg(5); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_getDigits"); + SWIG_check_num_args("getDigits",5,5) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getDigits",1,"CoreSession *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("getDigits",2,"int"); + if(!lua_isstring(L,3)) SWIG_fail_arg("getDigits",3,"char *"); + if(!lua_isnumber(L,4)) SWIG_fail_arg("getDigits",4,"int"); + if(!lua_isnumber(L,5)) SWIG_fail_arg("getDigits",5,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_getDigits",1,SWIGTYPE_p_CoreSession); + } + arg2 = (int)lua_tonumber(L, 2); - arg3 = (char*)lua_tostring(L, 3); + arg3 = (char *)lua_tostring(L, 3); arg4 = (int)lua_tonumber(L, 4); arg5 = (int)lua_tonumber(L, 5); result = (char *)(arg1)->getDigits(arg2,arg3,arg4,arg5); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4103,7 +5064,7 @@ static int _wrap_CoreSession_getDigits(lua_State* L) { int _v; { void *ptr; - if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { + if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { _v = 0; } else { _v = 1; @@ -4132,7 +5093,7 @@ static int _wrap_CoreSession_getDigits(lua_State* L) { int _v; { void *ptr; - if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { + if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { _v = 0; } else { _v = 1; @@ -4176,23 +5137,30 @@ static int _wrap_CoreSession_transfer(lua_State* L) { char *arg4 = (char *) NULL ; int result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg(3); - if(lua_gettop(L)>=4 && !lua_isstring(L,4)) SWIG_fail_arg(4); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_transfer"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("transfer",2,4) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("transfer",1,"CoreSession *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("transfer",2,"char *"); + if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("transfer",3,"char *"); + if(lua_gettop(L)>=4 && !lua_isstring(L,4)) SWIG_fail_arg("transfer",4,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_transfer",1,SWIGTYPE_p_CoreSession); + } + + arg2 = (char *)lua_tostring(L, 2); if(lua_gettop(L)>=3){ - arg3 = (char*)lua_tostring(L, 3); + arg3 = (char *)lua_tostring(L, 3); } if(lua_gettop(L)>=4){ - arg4 = (char*)lua_tostring(L, 4); + arg4 = (char *)lua_tostring(L, 4); } result = (int)(arg1)->transfer(arg2,arg3,arg4); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4209,23 +5177,30 @@ static int _wrap_CoreSession_read(lua_State* L) { char *arg6 = (char *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isnumber(L,2)) SWIG_fail_arg(2); - if(!lua_isnumber(L,3)) SWIG_fail_arg(3); - if(!lua_isstring(L,4)) SWIG_fail_arg(4); - if(!lua_isnumber(L,5)) SWIG_fail_arg(5); - if(!lua_isstring(L,6)) SWIG_fail_arg(6); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_read"); + SWIG_check_num_args("read",6,6) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("read",1,"CoreSession *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("read",2,"int"); + if(!lua_isnumber(L,3)) SWIG_fail_arg("read",3,"int"); + if(!lua_isstring(L,4)) SWIG_fail_arg("read",4,"char const *"); + if(!lua_isnumber(L,5)) SWIG_fail_arg("read",5,"int"); + if(!lua_isstring(L,6)) SWIG_fail_arg("read",6,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_read",1,SWIGTYPE_p_CoreSession); + } + arg2 = (int)lua_tonumber(L, 2); arg3 = (int)lua_tonumber(L, 3); - arg4 = (char*)lua_tostring(L, 4); + arg4 = (char *)lua_tostring(L, 4); arg5 = (int)lua_tonumber(L, 5); - arg6 = (char*)lua_tostring(L, 6); + arg6 = (char *)lua_tostring(L, 6); result = (char *)(arg1)->read(arg2,arg3,(char const *)arg4,arg5,(char const *)arg6); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4246,33 +5221,40 @@ static int _wrap_CoreSession_playAndGetDigits(lua_State* L) { char *arg10 = (char *) NULL ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isnumber(L,2)) SWIG_fail_arg(2); - if(!lua_isnumber(L,3)) SWIG_fail_arg(3); - if(!lua_isnumber(L,4)) SWIG_fail_arg(4); - if(!lua_isnumber(L,5)) SWIG_fail_arg(5); - if(!lua_isstring(L,6)) SWIG_fail_arg(6); - if(!lua_isstring(L,7)) SWIG_fail_arg(7); - if(!lua_isstring(L,8)) SWIG_fail_arg(8); - if(!lua_isstring(L,9)) SWIG_fail_arg(9); - if(lua_gettop(L)>=10 && !lua_isstring(L,10)) SWIG_fail_arg(10); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_playAndGetDigits"); + SWIG_check_num_args("playAndGetDigits",9,10) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("playAndGetDigits",1,"CoreSession *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("playAndGetDigits",2,"int"); + if(!lua_isnumber(L,3)) SWIG_fail_arg("playAndGetDigits",3,"int"); + if(!lua_isnumber(L,4)) SWIG_fail_arg("playAndGetDigits",4,"int"); + if(!lua_isnumber(L,5)) SWIG_fail_arg("playAndGetDigits",5,"int"); + if(!lua_isstring(L,6)) SWIG_fail_arg("playAndGetDigits",6,"char *"); + if(!lua_isstring(L,7)) SWIG_fail_arg("playAndGetDigits",7,"char *"); + if(!lua_isstring(L,8)) SWIG_fail_arg("playAndGetDigits",8,"char *"); + if(!lua_isstring(L,9)) SWIG_fail_arg("playAndGetDigits",9,"char *"); + if(lua_gettop(L)>=10 && !lua_isstring(L,10)) SWIG_fail_arg("playAndGetDigits",10,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_playAndGetDigits",1,SWIGTYPE_p_CoreSession); + } + arg2 = (int)lua_tonumber(L, 2); arg3 = (int)lua_tonumber(L, 3); arg4 = (int)lua_tonumber(L, 4); arg5 = (int)lua_tonumber(L, 5); - arg6 = (char*)lua_tostring(L, 6); - arg7 = (char*)lua_tostring(L, 7); - arg8 = (char*)lua_tostring(L, 8); - arg9 = (char*)lua_tostring(L, 9); + arg6 = (char *)lua_tostring(L, 6); + arg7 = (char *)lua_tostring(L, 7); + arg8 = (char *)lua_tostring(L, 8); + arg9 = (char *)lua_tostring(L, 9); if(lua_gettop(L)>=10){ - arg10 = (char*)lua_tostring(L, 10); + arg10 = (char *)lua_tostring(L, 10); } result = (char *)(arg1)->playAndGetDigits(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(char const *)arg10); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4286,11 +5268,16 @@ static int _wrap_CoreSession_streamFile(lua_State* L) { int arg3 = (int) 0 ; int result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg(3); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_streamFile"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("streamFile",2,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("streamFile",1,"CoreSession *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("streamFile",2,"char *"); + if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("streamFile",3,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_streamFile",1,SWIGTYPE_p_CoreSession); + } + + arg2 = (char *)lua_tostring(L, 2); if(lua_gettop(L)>=3){ arg3 = (int)lua_tonumber(L, 3); } @@ -4299,6 +5286,8 @@ static int _wrap_CoreSession_streamFile(lua_State* L) { lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4312,10 +5301,15 @@ static int _wrap_CoreSession_sleep(lua_State* L) { int arg3 = (int) 0 ; int result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isnumber(L,2)) SWIG_fail_arg(2); - if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg(3); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_sleep"); + SWIG_check_num_args("sleep",2,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sleep",1,"CoreSession *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("sleep",2,"int"); + if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("sleep",3,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_sleep",1,SWIGTYPE_p_CoreSession); + } + arg2 = (int)lua_tonumber(L, 2); if(lua_gettop(L)>=3){ arg3 = (int)lua_tonumber(L, 3); @@ -4325,6 +5319,8 @@ static int _wrap_CoreSession_sleep(lua_State* L) { lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4336,13 +5332,20 @@ static int _wrap_CoreSession_flushEvents(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; int result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_flushEvents"); + SWIG_check_num_args("flushEvents",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("flushEvents",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_flushEvents",1,SWIGTYPE_p_CoreSession); + } + result = (int)(arg1)->flushEvents(); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4354,13 +5357,20 @@ static int _wrap_CoreSession_flushDigits(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; int result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_flushDigits"); + SWIG_check_num_args("flushDigits",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("flushDigits",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_flushDigits",1,SWIGTYPE_p_CoreSession); + } + result = (int)(arg1)->flushDigits(); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4373,15 +5383,22 @@ static int _wrap_CoreSession_setAutoHangup(lua_State* L) { bool arg2 ; int result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isboolean(L,2)) SWIG_fail_arg(2); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_setAutoHangup"); - arg2 = (bool)lua_toboolean(L, 2); + SWIG_check_num_args("setAutoHangup",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setAutoHangup",1,"CoreSession *"); + if(!lua_isboolean(L,2)) SWIG_fail_arg("setAutoHangup",2,"bool"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_setAutoHangup",1,SWIGTYPE_p_CoreSession); + } + + arg2 = (lua_toboolean(L, 2)!=0); result = (int)(arg1)->setAutoHangup(arg2); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4393,15 +5410,22 @@ static int _wrap_CoreSession_setHangupHook(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; void *arg2 = (void *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_setHangupHook"); - arg2=((swig_lua_userdata*)(lua_touserdata(L,2)))->ptr; + SWIG_check_num_args("setHangupHook",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setHangupHook",1,"CoreSession *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("setHangupHook",2,"void *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_setHangupHook",1,SWIGTYPE_p_CoreSession); + } + + arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"CoreSession_setHangupHook"); (arg1)->setHangupHook(arg2); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4413,13 +5437,20 @@ static int _wrap_CoreSession_ready(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; bool result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_ready"); + SWIG_check_num_args("ready",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ready",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_ready",1,SWIGTYPE_p_CoreSession); + } + result = (bool)(arg1)->ready(); SWIG_arg=0; - lua_pushboolean(L,(int)result); SWIG_arg++; + lua_pushboolean(L,(int)(result==true)); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4431,13 +5462,20 @@ static int _wrap_CoreSession_bridged(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; bool result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_bridged"); + SWIG_check_num_args("bridged",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("bridged",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_bridged",1,SWIGTYPE_p_CoreSession); + } + result = (bool)(arg1)->bridged(); SWIG_arg=0; - lua_pushboolean(L,(int)result); SWIG_arg++; + lua_pushboolean(L,(int)(result==true)); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4449,13 +5487,20 @@ static int _wrap_CoreSession_answered(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; bool result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_answered"); + SWIG_check_num_args("answered",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("answered",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_answered",1,SWIGTYPE_p_CoreSession); + } + result = (bool)(arg1)->answered(); SWIG_arg=0; - lua_pushboolean(L,(int)result); SWIG_arg++; + lua_pushboolean(L,(int)(result==true)); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4467,13 +5512,20 @@ static int _wrap_CoreSession_mediaReady(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; bool result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_mediaReady"); + SWIG_check_num_args("mediaReady",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("mediaReady",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_mediaReady",1,SWIGTYPE_p_CoreSession); + } + result = (bool)(arg1)->mediaReady(); SWIG_arg=0; - lua_pushboolean(L,(int)result); SWIG_arg++; + lua_pushboolean(L,(int)(result==true)); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4485,15 +5537,26 @@ static int _wrap_CoreSession_waitForAnswer(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; CoreSession *arg2 = (CoreSession *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_waitForAnswer"); - arg2=(CoreSession *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_CoreSession,0,2,"CoreSession_waitForAnswer"); + SWIG_check_num_args("waitForAnswer",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("waitForAnswer",1,"CoreSession *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("waitForAnswer",2,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_waitForAnswer",1,SWIGTYPE_p_CoreSession); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_waitForAnswer",2,SWIGTYPE_p_CoreSession); + } + (arg1)->waitForAnswer(arg2); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4506,19 +5569,26 @@ static int _wrap_CoreSession_execute(lua_State* L) { char *arg2 = (char *) 0 ; char *arg3 = (char *) NULL ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg(3); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_execute"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("execute",2,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("execute",1,"CoreSession *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("execute",2,"char const *"); + if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("execute",3,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_execute",1,SWIGTYPE_p_CoreSession); + } + + arg2 = (char *)lua_tostring(L, 2); if(lua_gettop(L)>=3){ - arg3 = (char*)lua_tostring(L, 3); + arg3 = (char *)lua_tostring(L, 3); } (arg1)->execute((char const *)arg2,(char const *)arg3); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4530,15 +5600,26 @@ static int _wrap_CoreSession_sendEvent(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; Event *arg2 = (Event *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_sendEvent"); - arg2=(Event *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_Event,0,2,"CoreSession_sendEvent"); + SWIG_check_num_args("sendEvent",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sendEvent",1,"CoreSession *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("sendEvent",2,"Event *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_sendEvent",1,SWIGTYPE_p_CoreSession); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Event,0))){ + SWIG_fail_ptr("CoreSession_sendEvent",2,SWIGTYPE_p_Event); + } + (arg1)->sendEvent(arg2); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4550,15 +5631,26 @@ static int _wrap_CoreSession_setEventData(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; Event *arg2 = (Event *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_setEventData"); - arg2=(Event *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_Event,0,2,"CoreSession_setEventData"); + SWIG_check_num_args("setEventData",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setEventData",1,"CoreSession *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("setEventData",2,"Event *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_setEventData",1,SWIGTYPE_p_CoreSession); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Event,0))){ + SWIG_fail_ptr("CoreSession_setEventData",2,SWIGTYPE_p_Event); + } + (arg1)->setEventData(arg2); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4570,13 +5662,20 @@ static int _wrap_CoreSession_getXMLCDR(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_getXMLCDR"); + SWIG_check_num_args("getXMLCDR",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getXMLCDR",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_getXMLCDR",1,SWIGTYPE_p_CoreSession); + } + result = (char *)(arg1)->getXMLCDR(); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4588,13 +5687,20 @@ static int _wrap_CoreSession_begin_allow_threads(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; bool result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_begin_allow_threads"); + SWIG_check_num_args("begin_allow_threads",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("begin_allow_threads",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_begin_allow_threads",1,SWIGTYPE_p_CoreSession); + } + result = (bool)(arg1)->begin_allow_threads(); SWIG_arg=0; - lua_pushboolean(L,(int)result); SWIG_arg++; + lua_pushboolean(L,(int)(result==true)); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4606,13 +5712,20 @@ static int _wrap_CoreSession_end_allow_threads(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; bool result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_end_allow_threads"); + SWIG_check_num_args("end_allow_threads",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("end_allow_threads",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_end_allow_threads",1,SWIGTYPE_p_CoreSession); + } + result = (bool)(arg1)->end_allow_threads(); SWIG_arg=0; - lua_pushboolean(L,(int)result); SWIG_arg++; + lua_pushboolean(L,(int)(result==true)); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4624,13 +5737,20 @@ static int _wrap_CoreSession_get_uuid(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_get_uuid"); + SWIG_check_num_args("get_uuid",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("get_uuid",1,"CoreSession const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_get_uuid",1,SWIGTYPE_p_CoreSession); + } + result = (char *)((CoreSession const *)arg1)->get_uuid(); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4642,8 +5762,13 @@ static int _wrap_CoreSession_get_cb_args(lua_State* L) { CoreSession *arg1 = (CoreSession *) 0 ; switch_input_args_t *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_get_cb_args"); + SWIG_check_num_args("get_cb_args",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("get_cb_args",1,"CoreSession const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_get_cb_args",1,SWIGTYPE_p_CoreSession); + } + { switch_input_args_t const &_result_ref = ((CoreSession const *)arg1)->get_cb_args(); result = (switch_input_args_t *) &_result_ref; @@ -4652,6 +5777,8 @@ static int _wrap_CoreSession_get_cb_args(lua_State* L) { SWIG_NewPointerObj(L,result,SWIGTYPE_p_switch_input_args_t,0); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4662,13 +5789,20 @@ static int _wrap_CoreSession_check_hangup_hook(lua_State* L) { int SWIG_arg = -1; CoreSession *arg1 = (CoreSession *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_check_hangup_hook"); + SWIG_check_num_args("check_hangup_hook",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("check_hangup_hook",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_check_hangup_hook",1,SWIGTYPE_p_CoreSession); + } + (arg1)->check_hangup_hook(); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4681,26 +5815,34 @@ static int _wrap_CoreSession_run_dtmf_callback(lua_State* L) { void *arg2 = (void *) 0 ; switch_input_type_t arg3 ; switch_status_t result; + switch_input_type_t *argp3 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - if(!lua_isuserdata(L,3)) SWIG_fail_arg(3); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"CoreSession_run_dtmf_callback"); - arg2=((swig_lua_userdata*)(lua_touserdata(L,2)))->ptr; - { - switch_input_type_t * argp; - if(SWIG_ConvertPtr(L,3,(void**)(&argp),SWIGTYPE_p_switch_input_type_t,0)) SWIG_fail; - arg3 = *argp; + SWIG_check_num_args("run_dtmf_callback",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("run_dtmf_callback",1,"CoreSession *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("run_dtmf_callback",2,"void *"); + if(!lua_isuserdata(L,3)) SWIG_fail_arg("run_dtmf_callback",3,"switch_input_type_t"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_run_dtmf_callback",1,SWIGTYPE_p_CoreSession); } + + arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"CoreSession_run_dtmf_callback"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&argp3,SWIGTYPE_p_switch_input_type_t,0))){ + SWIG_fail_ptr("CoreSession_run_dtmf_callback",3,SWIGTYPE_p_switch_input_type_t); + } + arg3 = *argp3; + result = (arg1)->run_dtmf_callback(arg2,arg3); SWIG_arg=0; { - switch_status_t * resultptr; - resultptr = new switch_status_t((switch_status_t &) result); + switch_status_t * resultptr = new switch_status_t((switch_status_t &) result); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_status_t,1); SWIG_arg++; } return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4760,35 +5902,39 @@ static swig_lua_method swig_CoreSession_methods[] = { {0,0} }; static swig_lua_attribute swig_CoreSession_attributes[] = { - { "session",_wrap_CoreSession_session_get, _wrap_CoreSession_session_set}, - { "channel",_wrap_CoreSession_channel_get, _wrap_CoreSession_channel_set}, - { "flags",_wrap_CoreSession_flags_get, _wrap_CoreSession_flags_set}, - { "allocated",_wrap_CoreSession_allocated_get, _wrap_CoreSession_allocated_set}, - { "cb_state",_wrap_CoreSession_cb_state_get, _wrap_CoreSession_cb_state_set}, - { "hook_state",_wrap_CoreSession_hook_state_get, _wrap_CoreSession_hook_state_set}, - { "cause",_wrap_CoreSession_cause_get, _wrap_CoreSession_cause_set}, - { "uuid",_wrap_CoreSession_uuid_get, _wrap_CoreSession_uuid_set}, - { "tts_name",_wrap_CoreSession_tts_name_get, _wrap_CoreSession_tts_name_set}, - { "voice_name",_wrap_CoreSession_voice_name_get, _wrap_CoreSession_voice_name_set}, + { "session", _wrap_CoreSession_session_get, _wrap_CoreSession_session_set}, + { "channel", _wrap_CoreSession_channel_get, _wrap_CoreSession_channel_set}, + { "flags", _wrap_CoreSession_flags_get, _wrap_CoreSession_flags_set}, + { "allocated", _wrap_CoreSession_allocated_get, _wrap_CoreSession_allocated_set}, + { "cb_state", _wrap_CoreSession_cb_state_get, _wrap_CoreSession_cb_state_set}, + { "hook_state", _wrap_CoreSession_hook_state_get, _wrap_CoreSession_hook_state_set}, + { "cause", _wrap_CoreSession_cause_get, _wrap_CoreSession_cause_set}, + { "uuid", _wrap_CoreSession_uuid_get, _wrap_CoreSession_uuid_set}, + { "tts_name", _wrap_CoreSession_tts_name_get, _wrap_CoreSession_tts_name_set}, + { "voice_name", _wrap_CoreSession_voice_name_get, _wrap_CoreSession_voice_name_set}, {0,0,0} }; static swig_lua_class *swig_CoreSession_bases[] = {0}; -swig_lua_class _wrap_class_CoreSession = { "CoreSession", &SWIGTYPE_p_CoreSession,0, swig_delete_CoreSession, swig_CoreSession_methods, swig_CoreSession_attributes, swig_CoreSession_bases }; +static const char *swig_CoreSession_base_names[] = {0}; +static swig_lua_class _wrap_class_CoreSession = { "CoreSession", &SWIGTYPE_p_CoreSession,0, swig_delete_CoreSession, swig_CoreSession_methods, swig_CoreSession_attributes, swig_CoreSession_bases, swig_CoreSession_base_names }; static int _wrap_console_log(lua_State* L) { int SWIG_arg = -1; char *arg1 = (char *) 0 ; char *arg2 = (char *) 0 ; - if(!lua_isstring(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1 = (char*)lua_tostring(L, 1); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("console_log",2,2) + if(!lua_isstring(L,1)) SWIG_fail_arg("console_log",1,"char *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("console_log",2,"char *"); + arg1 = (char *)lua_tostring(L, 1); + arg2 = (char *)lua_tostring(L, 2); console_log(arg1,arg2); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4799,13 +5945,16 @@ static int _wrap_console_clean_log(lua_State* L) { int SWIG_arg = -1; char *arg1 = (char *) 0 ; - if(!lua_isstring(L,1)) SWIG_fail_arg(1); - arg1 = (char*)lua_tostring(L, 1); + SWIG_check_num_args("console_clean_log",1,1) + if(!lua_isstring(L,1)) SWIG_fail_arg("console_clean_log",1,"char *"); + arg1 = (char *)lua_tostring(L, 1); console_clean_log(arg1); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4816,13 +5965,16 @@ static int _wrap_msleep(lua_State* L) { int SWIG_arg = -1; unsigned int arg1 ; - if(!lua_isnumber(L,1)) SWIG_fail_arg(1); + SWIG_check_num_args("msleep",1,1) + if(!lua_isnumber(L,1)) SWIG_fail_arg("msleep",1,"unsigned int"); arg1 = (unsigned int)lua_tonumber(L, 1); msleep(arg1); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4834,15 +5986,26 @@ static int _wrap_bridge(lua_State* L) { CoreSession *arg1 = 0 ; CoreSession *arg2 = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1=(CoreSession *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_CoreSession,0,1,"bridge"); - arg2=(CoreSession *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_CoreSession,0,2,"bridge"); + SWIG_check_num_args("bridge",2,2) + if(!lua_isuserdata(L,1)) SWIG_fail_arg("bridge",1,"CoreSession &"); + if(!lua_isuserdata(L,2)) SWIG_fail_arg("bridge",2,"CoreSession &"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("bridge",1,SWIGTYPE_p_CoreSession); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("bridge",2,SWIGTYPE_p_CoreSession); + } + bridge(*arg1,*arg2); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4854,17 +6017,23 @@ static int _wrap_hanguphook(lua_State* L) { switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; switch_status_t result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(switch_core_session_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_switch_core_session_t,0,1,"hanguphook"); + SWIG_check_num_args("hanguphook",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hanguphook",1,"switch_core_session_t *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_switch_core_session_t,0))){ + SWIG_fail_ptr("hanguphook",1,SWIGTYPE_p_switch_core_session_t); + } + result = hanguphook(arg1); SWIG_arg=0; { - switch_status_t * resultptr; - resultptr = new switch_status_t((switch_status_t &) result); + switch_status_t * resultptr = new switch_status_t((switch_status_t &) result); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_status_t,1); SWIG_arg++; } return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4879,30 +6048,38 @@ static int _wrap_dtmf_callback(lua_State* L) { void *arg4 = (void *) 0 ; unsigned int arg5 ; switch_status_t result; + switch_input_type_t *argp3 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - if(!lua_isuserdata(L,3)) SWIG_fail_arg(3); - if(!lua_isuserdata(L,4)) SWIG_fail_arg(4); - if(!lua_isnumber(L,5)) SWIG_fail_arg(5); - arg1=(switch_core_session_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_switch_core_session_t,0,1,"dtmf_callback"); - arg2=((swig_lua_userdata*)(lua_touserdata(L,2)))->ptr; - { - switch_input_type_t * argp; - if(SWIG_ConvertPtr(L,3,(void**)(&argp),SWIGTYPE_p_switch_input_type_t,0)) SWIG_fail; - arg3 = *argp; + SWIG_check_num_args("dtmf_callback",5,5) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("dtmf_callback",1,"switch_core_session_t *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("dtmf_callback",2,"void *"); + if(!lua_isuserdata(L,3)) SWIG_fail_arg("dtmf_callback",3,"switch_input_type_t"); + if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("dtmf_callback",4,"void *"); + if(!lua_isnumber(L,5)) SWIG_fail_arg("dtmf_callback",5,"unsigned int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_switch_core_session_t,0))){ + SWIG_fail_ptr("dtmf_callback",1,SWIGTYPE_p_switch_core_session_t); } - arg4=((swig_lua_userdata*)(lua_touserdata(L,4)))->ptr; + + arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"dtmf_callback"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&argp3,SWIGTYPE_p_switch_input_type_t,0))){ + SWIG_fail_ptr("dtmf_callback",3,SWIGTYPE_p_switch_input_type_t); + } + arg3 = *argp3; + + arg4=(void *)SWIG_MustGetPtr(L,4,0,0,4,"dtmf_callback"); arg5 = (unsigned int)lua_tonumber(L, 5); result = dtmf_callback(arg1,arg2,arg3,arg4,arg5); SWIG_arg=0; { - switch_status_t * resultptr; - resultptr = new switch_status_t((switch_status_t &) result); + switch_status_t * resultptr = new switch_status_t((switch_status_t &) result); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_status_t,1); SWIG_arg++; } return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4913,11 +6090,14 @@ static int _wrap_new_Session__SWIG_0(lua_State* L) { int SWIG_arg = -1; LUA::Session *result = 0 ; + SWIG_check_num_args("LUA::Session",0,0) result = (LUA::Session *)new LUA::Session(); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L); return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4930,15 +6110,22 @@ static int _wrap_new_Session__SWIG_1(lua_State* L) { CoreSession *arg2 = (CoreSession *) 0 ; LUA::Session *result = 0 ; - if(!lua_isstring(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1 = (char*)lua_tostring(L, 1); - arg2=(CoreSession *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_CoreSession,0,2,"new_Session"); + SWIG_check_num_args("LUA::Session",2,2) + if(!lua_isstring(L,1)) SWIG_fail_arg("LUA::Session",1,"char *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("LUA::Session",2,"CoreSession *"); + arg1 = (char *)lua_tostring(L, 1); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("new_Session",2,SWIGTYPE_p_CoreSession); + } + result = (LUA::Session *)new LUA::Session(arg1,arg2); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L); return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4950,13 +6137,16 @@ static int _wrap_new_Session__SWIG_2(lua_State* L) { char *arg1 = (char *) 0 ; LUA::Session *result = 0 ; - if(!lua_isstring(L,1)) SWIG_fail_arg(1); - arg1 = (char*)lua_tostring(L, 1); + SWIG_check_num_args("LUA::Session",1,1) + if(!lua_isstring(L,1)) SWIG_fail_arg("LUA::Session",1,"char *"); + arg1 = (char *)lua_tostring(L, 1); result = (LUA::Session *)new LUA::Session(arg1); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L); return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4968,13 +6158,20 @@ static int _wrap_new_Session__SWIG_3(lua_State* L) { switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; LUA::Session *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(switch_core_session_t *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_switch_core_session_t,0,1,"new_Session"); + SWIG_check_num_args("LUA::Session",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::Session",1,"switch_core_session_t *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_switch_core_session_t,0))){ + SWIG_fail_ptr("new_Session",1,SWIGTYPE_p_switch_core_session_t); + } + result = (LUA::Session *)new LUA::Session(arg1); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Session,1); SWIG_arg++; result->setLUA(L); return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -4995,7 +6192,7 @@ static int _wrap_new_Session(lua_State* L) { int _v; { void *ptr; - if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_switch_core_session_t, 0)) { + if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_switch_core_session_t, 0)) { _v = 0; } else { _v = 1; @@ -5022,7 +6219,7 @@ static int _wrap_new_Session(lua_State* L) { if (_v) { { void *ptr; - if (lua_isuserdata(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { + if (SWIG_isptrtype(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { _v = 0; } else { _v = 1; @@ -5043,14 +6240,21 @@ static int _wrap_delete_Session(lua_State* L) { int SWIG_arg = -1; LUA::Session *arg1 = (LUA::Session *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"delete_Session"); + SWIG_check_num_args("LUA::~Session",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::~Session",1,"LUA::Session *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,SWIG_POINTER_DISOWN))){ + SWIG_fail_ptr("delete_Session",1,SWIGTYPE_p_LUA__Session); + } + delete arg1; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5061,13 +6265,20 @@ static int _wrap_Session_destroy(lua_State* L) { int SWIG_arg = -1; LUA::Session *arg1 = (LUA::Session *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_destroy"); + SWIG_check_num_args("destroy",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("destroy",1,"LUA::Session *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ + SWIG_fail_ptr("Session_destroy",1,SWIGTYPE_p_LUA__Session); + } + (arg1)->destroy(); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5079,13 +6290,20 @@ static int _wrap_Session_begin_allow_threads(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; bool result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_begin_allow_threads"); + SWIG_check_num_args("begin_allow_threads",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("begin_allow_threads",1,"LUA::Session *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ + SWIG_fail_ptr("Session_begin_allow_threads",1,SWIGTYPE_p_LUA__Session); + } + result = (bool)(arg1)->begin_allow_threads(); SWIG_arg=0; - lua_pushboolean(L,(int)result); SWIG_arg++; + lua_pushboolean(L,(int)(result==true)); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5097,13 +6315,20 @@ static int _wrap_Session_end_allow_threads(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; bool result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_end_allow_threads"); + SWIG_check_num_args("end_allow_threads",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("end_allow_threads",1,"LUA::Session *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ + SWIG_fail_ptr("Session_end_allow_threads",1,SWIGTYPE_p_LUA__Session); + } + result = (bool)(arg1)->end_allow_threads(); SWIG_arg=0; - lua_pushboolean(L,(int)result); SWIG_arg++; + lua_pushboolean(L,(int)(result==true)); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5114,13 +6339,20 @@ static int _wrap_Session_check_hangup_hook(lua_State* L) { int SWIG_arg = -1; LUA::Session *arg1 = (LUA::Session *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_check_hangup_hook"); + SWIG_check_num_args("check_hangup_hook",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("check_hangup_hook",1,"LUA::Session *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ + SWIG_fail_ptr("Session_check_hangup_hook",1,SWIGTYPE_p_LUA__Session); + } + (arg1)->check_hangup_hook(); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5133,26 +6365,34 @@ static int _wrap_Session_run_dtmf_callback(lua_State* L) { void *arg2 = (void *) 0 ; switch_input_type_t arg3 ; switch_status_t result; + switch_input_type_t *argp3 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - if(!lua_isuserdata(L,3)) SWIG_fail_arg(3); - arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_run_dtmf_callback"); - arg2=((swig_lua_userdata*)(lua_touserdata(L,2)))->ptr; - { - switch_input_type_t * argp; - if(SWIG_ConvertPtr(L,3,(void**)(&argp),SWIGTYPE_p_switch_input_type_t,0)) SWIG_fail; - arg3 = *argp; + SWIG_check_num_args("run_dtmf_callback",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("run_dtmf_callback",1,"LUA::Session *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("run_dtmf_callback",2,"void *"); + if(!lua_isuserdata(L,3)) SWIG_fail_arg("run_dtmf_callback",3,"switch_input_type_t"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ + SWIG_fail_ptr("Session_run_dtmf_callback",1,SWIGTYPE_p_LUA__Session); } + + arg2=(void *)SWIG_MustGetPtr(L,2,0,0,2,"Session_run_dtmf_callback"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&argp3,SWIGTYPE_p_switch_input_type_t,0))){ + SWIG_fail_ptr("Session_run_dtmf_callback",3,SWIGTYPE_p_switch_input_type_t); + } + arg3 = *argp3; + result = (arg1)->run_dtmf_callback(arg2,arg3); SWIG_arg=0; { - switch_status_t * resultptr; - resultptr = new switch_status_t((switch_status_t &) result); + switch_status_t * resultptr = new switch_status_t((switch_status_t &) result); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_status_t,1); SWIG_arg++; } return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5163,13 +6403,20 @@ static int _wrap_Session_unsetInputCallback(lua_State* L) { int SWIG_arg = -1; LUA::Session *arg1 = (LUA::Session *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_unsetInputCallback"); + SWIG_check_num_args("unsetInputCallback",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("unsetInputCallback",1,"LUA::Session *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ + SWIG_fail_ptr("Session_unsetInputCallback",1,SWIGTYPE_p_LUA__Session); + } + (arg1)->unsetInputCallback(); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5182,17 +6429,24 @@ static int _wrap_Session_setInputCallback__SWIG_0(lua_State* L) { char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - if(!lua_isstring(L,3)) SWIG_fail_arg(3); - arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_setInputCallback"); - arg2 = (char*)lua_tostring(L, 2); - arg3 = (char*)lua_tostring(L, 3); + SWIG_check_num_args("setInputCallback",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setInputCallback",1,"LUA::Session *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("setInputCallback",2,"char *"); + if(!lua_isstring(L,3)) SWIG_fail_arg("setInputCallback",3,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ + SWIG_fail_ptr("Session_setInputCallback",1,SWIGTYPE_p_LUA__Session); + } + + arg2 = (char *)lua_tostring(L, 2); + arg3 = (char *)lua_tostring(L, 3); (arg1)->setInputCallback(arg2,arg3); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5204,15 +6458,22 @@ static int _wrap_Session_setInputCallback__SWIG_1(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; char *arg2 = (char *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_setInputCallback"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("setInputCallback",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setInputCallback",1,"LUA::Session *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("setInputCallback",2,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ + SWIG_fail_ptr("Session_setInputCallback",1,SWIGTYPE_p_LUA__Session); + } + + arg2 = (char *)lua_tostring(L, 2); (arg1)->setInputCallback(arg2); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5230,7 +6491,7 @@ static int _wrap_Session_setInputCallback(lua_State* L) { int _v; { void *ptr; - if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_LUA__Session, 0)) { + if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_LUA__Session, 0)) { _v = 0; } else { _v = 1; @@ -5249,7 +6510,7 @@ static int _wrap_Session_setInputCallback(lua_State* L) { int _v; { void *ptr; - if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_LUA__Session, 0)) { + if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_LUA__Session, 0)) { _v = 0; } else { _v = 1; @@ -5281,17 +6542,24 @@ static int _wrap_Session_setHangupHook__SWIG_0(lua_State* L) { char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - if(!lua_isstring(L,3)) SWIG_fail_arg(3); - arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_setHangupHook"); - arg2 = (char*)lua_tostring(L, 2); - arg3 = (char*)lua_tostring(L, 3); + SWIG_check_num_args("setHangupHook",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setHangupHook",1,"LUA::Session *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("setHangupHook",2,"char *"); + if(!lua_isstring(L,3)) SWIG_fail_arg("setHangupHook",3,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ + SWIG_fail_ptr("Session_setHangupHook",1,SWIGTYPE_p_LUA__Session); + } + + arg2 = (char *)lua_tostring(L, 2); + arg3 = (char *)lua_tostring(L, 3); (arg1)->setHangupHook(arg2,arg3); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5303,15 +6571,22 @@ static int _wrap_Session_setHangupHook__SWIG_1(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; char *arg2 = (char *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_setHangupHook"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("setHangupHook",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setHangupHook",1,"LUA::Session *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("setHangupHook",2,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ + SWIG_fail_ptr("Session_setHangupHook",1,SWIGTYPE_p_LUA__Session); + } + + arg2 = (char *)lua_tostring(L, 2); (arg1)->setHangupHook(arg2); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5329,7 +6604,7 @@ static int _wrap_Session_setHangupHook(lua_State* L) { int _v; { void *ptr; - if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_LUA__Session, 0)) { + if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_LUA__Session, 0)) { _v = 0; } else { _v = 1; @@ -5348,7 +6623,7 @@ static int _wrap_Session_setHangupHook(lua_State* L) { int _v; { void *ptr; - if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_LUA__Session, 0)) { + if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_LUA__Session, 0)) { _v = 0; } else { _v = 1; @@ -5379,13 +6654,20 @@ static int _wrap_Session_ready(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; bool result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_ready"); + SWIG_check_num_args("ready",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("ready",1,"LUA::Session *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ + SWIG_fail_ptr("Session_ready",1,SWIGTYPE_p_LUA__Session); + } + result = (bool)(arg1)->ready(); SWIG_arg=0; - lua_pushboolean(L,(int)result); SWIG_arg++; + lua_pushboolean(L,(int)(result==true)); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5400,19 +6682,30 @@ static int _wrap_Session_originate(lua_State* L) { int arg4 ; int result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - if(!lua_isstring(L,3)) SWIG_fail_arg(3); - if(!lua_isnumber(L,4)) SWIG_fail_arg(4); - arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_originate"); - arg2=(CoreSession *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_CoreSession,0,2,"Session_originate"); - arg3 = (char*)lua_tostring(L, 3); + SWIG_check_num_args("originate",4,4) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("originate",1,"LUA::Session *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("originate",2,"CoreSession *"); + if(!lua_isstring(L,3)) SWIG_fail_arg("originate",3,"char *"); + if(!lua_isnumber(L,4)) SWIG_fail_arg("originate",4,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ + SWIG_fail_ptr("Session_originate",1,SWIGTYPE_p_LUA__Session); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("Session_originate",2,SWIGTYPE_p_CoreSession); + } + + arg3 = (char *)lua_tostring(L, 3); arg4 = (int)lua_tonumber(L, 4); result = (int)(arg1)->originate(arg2,arg3,arg4); SWIG_arg=0; lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5424,15 +6717,20 @@ static int _wrap_Session_cb_function_set(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; char *arg2 = (char *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_cb_function_set"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("cb_function",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_function",1,"LUA::Session *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("cb_function",2,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ + SWIG_fail_ptr("Session_cb_function_set",1,SWIGTYPE_p_LUA__Session); + } + + arg2 = (char *)lua_tostring(L, 2); { if (arg1->cb_function) delete [] arg1->cb_function; if (arg2) { - arg1->cb_function = (char *) (new char[strlen(arg2)+1]); - strcpy((char *) arg1->cb_function,arg2); + arg1->cb_function = (char *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->cb_function, (const char *)arg2); } else { arg1->cb_function = 0; } @@ -5441,6 +6739,8 @@ static int _wrap_Session_cb_function_set(lua_State* L) { return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5452,13 +6752,20 @@ static int _wrap_Session_cb_function_get(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_cb_function_get"); + SWIG_check_num_args("cb_function",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_function",1,"LUA::Session *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ + SWIG_fail_ptr("Session_cb_function_get",1,SWIGTYPE_p_LUA__Session); + } + result = (char *) ((arg1)->cb_function); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5470,15 +6777,20 @@ static int _wrap_Session_cb_arg_set(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; char *arg2 = (char *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_cb_arg_set"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("cb_arg",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_arg",1,"LUA::Session *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("cb_arg",2,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ + SWIG_fail_ptr("Session_cb_arg_set",1,SWIGTYPE_p_LUA__Session); + } + + arg2 = (char *)lua_tostring(L, 2); { if (arg1->cb_arg) delete [] arg1->cb_arg; if (arg2) { - arg1->cb_arg = (char *) (new char[strlen(arg2)+1]); - strcpy((char *) arg1->cb_arg,arg2); + arg1->cb_arg = (char *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->cb_arg, (const char *)arg2); } else { arg1->cb_arg = 0; } @@ -5487,6 +6799,8 @@ static int _wrap_Session_cb_arg_set(lua_State* L) { return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5498,13 +6812,20 @@ static int _wrap_Session_cb_arg_get(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_cb_arg_get"); + SWIG_check_num_args("cb_arg",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cb_arg",1,"LUA::Session *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ + SWIG_fail_ptr("Session_cb_arg_get",1,SWIGTYPE_p_LUA__Session); + } + result = (char *) ((arg1)->cb_arg); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5516,15 +6837,20 @@ static int _wrap_Session_hangup_func_str_set(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; char *arg2 = (char *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_hangup_func_str_set"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("hangup_func_str",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_str",1,"LUA::Session *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("hangup_func_str",2,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ + SWIG_fail_ptr("Session_hangup_func_str_set",1,SWIGTYPE_p_LUA__Session); + } + + arg2 = (char *)lua_tostring(L, 2); { if (arg1->hangup_func_str) delete [] arg1->hangup_func_str; if (arg2) { - arg1->hangup_func_str = (char *) (new char[strlen(arg2)+1]); - strcpy((char *) arg1->hangup_func_str,arg2); + arg1->hangup_func_str = (char *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->hangup_func_str, (const char *)arg2); } else { arg1->hangup_func_str = 0; } @@ -5533,6 +6859,8 @@ static int _wrap_Session_hangup_func_str_set(lua_State* L) { return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5544,13 +6872,20 @@ static int _wrap_Session_hangup_func_str_get(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_hangup_func_str_get"); + SWIG_check_num_args("hangup_func_str",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_str",1,"LUA::Session *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ + SWIG_fail_ptr("Session_hangup_func_str_get",1,SWIGTYPE_p_LUA__Session); + } + result = (char *) ((arg1)->hangup_func_str); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5562,15 +6897,20 @@ static int _wrap_Session_hangup_func_arg_set(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; char *arg2 = (char *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_hangup_func_arg_set"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("hangup_func_arg",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_arg",1,"LUA::Session *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("hangup_func_arg",2,"char *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ + SWIG_fail_ptr("Session_hangup_func_arg_set",1,SWIGTYPE_p_LUA__Session); + } + + arg2 = (char *)lua_tostring(L, 2); { if (arg1->hangup_func_arg) delete [] arg1->hangup_func_arg; if (arg2) { - arg1->hangup_func_arg = (char *) (new char[strlen(arg2)+1]); - strcpy((char *) arg1->hangup_func_arg,arg2); + arg1->hangup_func_arg = (char *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->hangup_func_arg, (const char *)arg2); } else { arg1->hangup_func_arg = 0; } @@ -5579,6 +6919,8 @@ static int _wrap_Session_hangup_func_arg_set(lua_State* L) { return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5590,13 +6932,20 @@ static int _wrap_Session_hangup_func_arg_get(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; char *result = 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_hangup_func_arg_get"); + SWIG_check_num_args("hangup_func_arg",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup_func_arg",1,"LUA::Session *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ + SWIG_fail_ptr("Session_hangup_func_arg_get",1,SWIGTYPE_p_LUA__Session); + } + result = (char *) ((arg1)->hangup_func_arg); SWIG_arg=0; - lua_pushstring(L,result); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5608,15 +6957,21 @@ static int _wrap_Session_setLUA(lua_State* L) { LUA::Session *arg1 = (LUA::Session *) 0 ; lua_State *arg2 = (lua_State *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isuserdata(L,2)) SWIG_fail_arg(2); - arg1=(LUA::Session *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Session,0,1,"Session_setLUA"); - arg2=(lua_State *)SWIG_MustGetPtr(L,2,SWIGTYPE_p_lua_State,0,2,"Session_setLUA"); + arg2 = L; + SWIG_check_num_args("setLUA",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setLUA",1,"LUA::Session *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){ + SWIG_fail_ptr("Session_setLUA",1,SWIGTYPE_p_LUA__Session); + } + (arg1)->setLUA(arg2); SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5642,14 +6997,15 @@ static swig_lua_method swig_LUA_Session_methods[] = { {0,0} }; static swig_lua_attribute swig_LUA_Session_attributes[] = { - { "cb_function",_wrap_Session_cb_function_get, _wrap_Session_cb_function_set}, - { "cb_arg",_wrap_Session_cb_arg_get, _wrap_Session_cb_arg_set}, - { "hangup_func_str",_wrap_Session_hangup_func_str_get, _wrap_Session_hangup_func_str_set}, - { "hangup_func_arg",_wrap_Session_hangup_func_arg_get, _wrap_Session_hangup_func_arg_set}, + { "cb_function", _wrap_Session_cb_function_get, _wrap_Session_cb_function_set}, + { "cb_arg", _wrap_Session_cb_arg_get, _wrap_Session_cb_arg_set}, + { "hangup_func_str", _wrap_Session_hangup_func_str_get, _wrap_Session_hangup_func_str_set}, + { "hangup_func_arg", _wrap_Session_hangup_func_arg_get, _wrap_Session_hangup_func_arg_set}, {0,0,0} }; -static swig_lua_class *swig_LUA_Session_bases[] = {&_wrap_class_CoreSession,0}; -swig_lua_class _wrap_class_LUA_Session = { "Session", &SWIGTYPE_p_LUA__Session,_wrap_new_Session, swig_delete_Session, swig_LUA_Session_methods, swig_LUA_Session_attributes, swig_LUA_Session_bases }; +static swig_lua_class *swig_LUA_Session_bases[] = {0,0}; +static const char *swig_LUA_Session_base_names[] = {"CoreSession *",0}; +static swig_lua_class _wrap_class_LUA_Session = { "Session", &SWIGTYPE_p_LUA__Session,_wrap_new_Session, swig_delete_Session, swig_LUA_Session_methods, swig_LUA_Session_attributes, swig_LUA_Session_bases, swig_LUA_Session_base_names }; static int _wrap_new_Dbh__SWIG_0(lua_State* L) { int SWIG_arg = -1; @@ -5658,17 +7014,20 @@ static int _wrap_new_Dbh__SWIG_0(lua_State* L) { char *arg3 = (char *) 0 ; LUA::Dbh *result = 0 ; - if(!lua_isstring(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - if(!lua_isstring(L,3)) SWIG_fail_arg(3); - arg1 = (char*)lua_tostring(L, 1); - arg2 = (char*)lua_tostring(L, 2); - arg3 = (char*)lua_tostring(L, 3); + SWIG_check_num_args("LUA::Dbh",3,3) + if(!lua_isstring(L,1)) SWIG_fail_arg("LUA::Dbh",1,"char *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("LUA::Dbh",2,"char *"); + if(!lua_isstring(L,3)) SWIG_fail_arg("LUA::Dbh",3,"char *"); + arg1 = (char *)lua_tostring(L, 1); + arg2 = (char *)lua_tostring(L, 2); + arg3 = (char *)lua_tostring(L, 3); result = (LUA::Dbh *)new LUA::Dbh(arg1,arg2,arg3); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Dbh,1); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5681,15 +7040,18 @@ static int _wrap_new_Dbh__SWIG_1(lua_State* L) { char *arg2 = (char *) 0 ; LUA::Dbh *result = 0 ; - if(!lua_isstring(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - arg1 = (char*)lua_tostring(L, 1); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("LUA::Dbh",2,2) + if(!lua_isstring(L,1)) SWIG_fail_arg("LUA::Dbh",1,"char *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("LUA::Dbh",2,"char *"); + arg1 = (char *)lua_tostring(L, 1); + arg2 = (char *)lua_tostring(L, 2); result = (LUA::Dbh *)new LUA::Dbh(arg1,arg2); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Dbh,1); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5701,13 +7063,16 @@ static int _wrap_new_Dbh__SWIG_2(lua_State* L) { char *arg1 = (char *) 0 ; LUA::Dbh *result = 0 ; - if(!lua_isstring(L,1)) SWIG_fail_arg(1); - arg1 = (char*)lua_tostring(L, 1); + SWIG_check_num_args("LUA::Dbh",1,1) + if(!lua_isstring(L,1)) SWIG_fail_arg("LUA::Dbh",1,"char *"); + arg1 = (char *)lua_tostring(L, 1); result = (LUA::Dbh *)new LUA::Dbh(arg1); SWIG_arg=0; SWIG_NewPointerObj(L,result,SWIGTYPE_p_LUA__Dbh,1); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5773,14 +7138,21 @@ static int _wrap_delete_Dbh(lua_State* L) { int SWIG_arg = -1; LUA::Dbh *arg1 = (LUA::Dbh *) 0 ; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(LUA::Dbh *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Dbh,0,1,"delete_Dbh"); + SWIG_check_num_args("LUA::~Dbh",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("LUA::~Dbh",1,"LUA::Dbh *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,SWIG_POINTER_DISOWN))){ + SWIG_fail_ptr("delete_Dbh",1,SWIGTYPE_p_LUA__Dbh); + } + delete arg1; SWIG_arg=0; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5792,13 +7164,20 @@ static int _wrap_Dbh_release(lua_State* L) { LUA::Dbh *arg1 = (LUA::Dbh *) 0 ; bool result; - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - arg1=(LUA::Dbh *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Dbh,0,1,"Dbh_release"); + SWIG_check_num_args("release",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("release",1,"LUA::Dbh *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){ + SWIG_fail_ptr("Dbh_release",1,SWIGTYPE_p_LUA__Dbh); + } + result = (bool)(arg1)->release(); SWIG_arg=0; - lua_pushboolean(L,(int)result); SWIG_arg++; + lua_pushboolean(L,(int)(result==true)); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5818,11 +7197,16 @@ static int _wrap_Dbh_query(lua_State* L) { }; arg3 = default_swiglua_fn; } - if(!lua_isuserdata(L,1)) SWIG_fail_arg(1); - if(!lua_isstring(L,2)) SWIG_fail_arg(2); - if(lua_gettop(L)>=3 && !lua_isfunction(L,3)) SWIG_fail_arg(3); - arg1=(LUA::Dbh *)SWIG_MustGetPtr(L,1,SWIGTYPE_p_LUA__Dbh,0,1,"Dbh_query"); - arg2 = (char*)lua_tostring(L, 2); + SWIG_check_num_args("query",2,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("query",1,"LUA::Dbh *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("query",2,"char *"); + if(lua_gettop(L)>=3 && !lua_isfunction(L,3)) SWIG_fail_arg("query",3,"SWIGLUA_FN"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Dbh,0))){ + SWIG_fail_ptr("Dbh_query",1,SWIGTYPE_p_LUA__Dbh); + } + + arg2 = (char *)lua_tostring(L, 2); if(lua_gettop(L)>=3){ { (&arg3)->L = L; @@ -5831,9 +7215,11 @@ static int _wrap_Dbh_query(lua_State* L) { } result = (bool)(arg1)->query(arg2,arg3); SWIG_arg=0; - lua_pushboolean(L,(int)result); SWIG_arg++; + lua_pushboolean(L,(int)(result==true)); SWIG_arg++; return SWIG_arg; + if(0) SWIG_fail; + fail: lua_error(L); return SWIG_arg; @@ -5853,7 +7239,8 @@ static swig_lua_attribute swig_LUA_Dbh_attributes[] = { {0,0,0} }; static swig_lua_class *swig_LUA_Dbh_bases[] = {0}; -swig_lua_class _wrap_class_LUA_Dbh = { "Dbh", &SWIGTYPE_p_LUA__Dbh,_wrap_new_Dbh, swig_delete_Dbh, swig_LUA_Dbh_methods, swig_LUA_Dbh_attributes, swig_LUA_Dbh_bases }; +static const char *swig_LUA_Dbh_base_names[] = {0}; +static swig_lua_class _wrap_class_LUA_Dbh = { "Dbh", &SWIGTYPE_p_LUA__Dbh,_wrap_new_Dbh, swig_delete_Dbh, swig_LUA_Dbh_methods, swig_LUA_Dbh_attributes, swig_LUA_Dbh_bases, swig_LUA_Dbh_base_names }; #ifdef __cplusplus } @@ -5862,167 +7249,12 @@ swig_lua_class _wrap_class_LUA_Dbh = { "Dbh", &SWIGTYPE_p_LUA__Dbh,_wrap_new_Dbh static const struct luaL_reg swig_commands[] = { { "consoleLog", _wrap_consoleLog}, { "consoleCleanLog", _wrap_consoleCleanLog}, - { "new_IVRMenu", _wrap_new_IVRMenu}, - { "delete_IVRMenu", _wrap_delete_IVRMenu}, - { "IVRMenu_bindAction", _wrap_IVRMenu_bindAction}, - { "IVRMenu_execute", _wrap_IVRMenu_execute}, - { "new_API", _wrap_new_API}, - { "delete_API", _wrap_delete_API}, - { "API_execute", _wrap_API_execute}, - { "API_executeString", _wrap_API_executeString}, - { "API_getTime", _wrap_API_getTime}, - { "input_callback_state_t_function_set", _wrap_input_callback_state_t_function_set}, - { "input_callback_state_t_function_get", _wrap_input_callback_state_t_function_get}, - { "input_callback_state_t_threadState_set", _wrap_input_callback_state_t_threadState_set}, - { "input_callback_state_t_threadState_get", _wrap_input_callback_state_t_threadState_get}, - { "input_callback_state_t_extra_set", _wrap_input_callback_state_t_extra_set}, - { "input_callback_state_t_extra_get", _wrap_input_callback_state_t_extra_get}, - { "input_callback_state_t_funcargs_set", _wrap_input_callback_state_t_funcargs_set}, - { "input_callback_state_t_funcargs_get", _wrap_input_callback_state_t_funcargs_get}, - { "new_input_callback_state_t", _wrap_new_input_callback_state_t}, - { "delete_input_callback_state_t", _wrap_delete_input_callback_state_t}, - { "DTMF_digit_set", _wrap_DTMF_digit_set}, - { "DTMF_digit_get", _wrap_DTMF_digit_get}, - { "DTMF_duration_set", _wrap_DTMF_duration_set}, - { "DTMF_duration_get", _wrap_DTMF_duration_get}, - { "new_DTMF", _wrap_new_DTMF}, - { "delete_DTMF", _wrap_delete_DTMF}, - { "new_Stream",_wrap_new_Stream}, - { "delete_Stream", _wrap_delete_Stream}, - { "Stream_write", _wrap_Stream_write}, - { "Stream_get_data", _wrap_Stream_get_data}, - { "Event_event_set", _wrap_Event_event_set}, - { "Event_event_get", _wrap_Event_event_get}, - { "Event_serialized_string_set", _wrap_Event_serialized_string_set}, - { "Event_serialized_string_get", _wrap_Event_serialized_string_get}, - { "Event_mine_set", _wrap_Event_mine_set}, - { "Event_mine_get", _wrap_Event_mine_get}, - { "new_Event",_wrap_new_Event}, - { "delete_Event", _wrap_delete_Event}, - { "Event_serialize", _wrap_Event_serialize}, - { "Event_setPriority", _wrap_Event_setPriority}, - { "Event_getHeader", _wrap_Event_getHeader}, - { "Event_getBody", _wrap_Event_getBody}, - { "Event_getType", _wrap_Event_getType}, - { "Event_addBody", _wrap_Event_addBody}, - { "Event_addHeader", _wrap_Event_addHeader}, - { "Event_delHeader", _wrap_Event_delHeader}, - { "Event_fire", _wrap_Event_fire}, - { "EventConsumer_events_set", _wrap_EventConsumer_events_set}, - { "EventConsumer_events_get", _wrap_EventConsumer_events_get}, - { "EventConsumer_e_event_id_set", _wrap_EventConsumer_e_event_id_set}, - { "EventConsumer_e_event_id_get", _wrap_EventConsumer_e_event_id_get}, - { "EventConsumer_e_callback_set", _wrap_EventConsumer_e_callback_set}, - { "EventConsumer_e_callback_get", _wrap_EventConsumer_e_callback_get}, - { "EventConsumer_e_subclass_name_set", _wrap_EventConsumer_e_subclass_name_set}, - { "EventConsumer_e_subclass_name_get", _wrap_EventConsumer_e_subclass_name_get}, - { "EventConsumer_e_cb_arg_set", _wrap_EventConsumer_e_cb_arg_set}, - { "EventConsumer_e_cb_arg_get", _wrap_EventConsumer_e_cb_arg_get}, - { "EventConsumer_enodes_set", _wrap_EventConsumer_enodes_set}, - { "EventConsumer_enodes_get", _wrap_EventConsumer_enodes_get}, - { "EventConsumer_node_index_set", _wrap_EventConsumer_node_index_set}, - { "EventConsumer_node_index_get", _wrap_EventConsumer_node_index_get}, - { "new_EventConsumer", _wrap_new_EventConsumer}, - { "delete_EventConsumer", _wrap_delete_EventConsumer}, - { "EventConsumer_bind", _wrap_EventConsumer_bind}, - { "EventConsumer_pop", _wrap_EventConsumer_pop}, - { "delete_CoreSession", _wrap_delete_CoreSession}, - { "CoreSession_session_set", _wrap_CoreSession_session_set}, - { "CoreSession_session_get", _wrap_CoreSession_session_get}, - { "CoreSession_channel_set", _wrap_CoreSession_channel_set}, - { "CoreSession_channel_get", _wrap_CoreSession_channel_get}, - { "CoreSession_flags_set", _wrap_CoreSession_flags_set}, - { "CoreSession_flags_get", _wrap_CoreSession_flags_get}, - { "CoreSession_allocated_set", _wrap_CoreSession_allocated_set}, - { "CoreSession_allocated_get", _wrap_CoreSession_allocated_get}, - { "CoreSession_cb_state_set", _wrap_CoreSession_cb_state_set}, - { "CoreSession_cb_state_get", _wrap_CoreSession_cb_state_get}, - { "CoreSession_hook_state_set", _wrap_CoreSession_hook_state_set}, - { "CoreSession_hook_state_get", _wrap_CoreSession_hook_state_get}, - { "CoreSession_cause_set", _wrap_CoreSession_cause_set}, - { "CoreSession_cause_get", _wrap_CoreSession_cause_get}, - { "CoreSession_uuid_set", _wrap_CoreSession_uuid_set}, - { "CoreSession_uuid_get", _wrap_CoreSession_uuid_get}, - { "CoreSession_tts_name_set", _wrap_CoreSession_tts_name_set}, - { "CoreSession_tts_name_get", _wrap_CoreSession_tts_name_get}, - { "CoreSession_voice_name_set", _wrap_CoreSession_voice_name_set}, - { "CoreSession_voice_name_get", _wrap_CoreSession_voice_name_get}, - { "CoreSession_answer", _wrap_CoreSession_answer}, - { "CoreSession_preAnswer", _wrap_CoreSession_preAnswer}, - { "CoreSession_hangup", _wrap_CoreSession_hangup}, - { "CoreSession_hangupState", _wrap_CoreSession_hangupState}, - { "CoreSession_setVariable", _wrap_CoreSession_setVariable}, - { "CoreSession_setPrivate", _wrap_CoreSession_setPrivate}, - { "CoreSession_getPrivate", _wrap_CoreSession_getPrivate}, - { "CoreSession_getVariable", _wrap_CoreSession_getVariable}, - { "CoreSession_process_callback_result", _wrap_CoreSession_process_callback_result}, - { "CoreSession_say", _wrap_CoreSession_say}, - { "CoreSession_sayPhrase", _wrap_CoreSession_sayPhrase}, - { "CoreSession_hangupCause", _wrap_CoreSession_hangupCause}, - { "CoreSession_getState", _wrap_CoreSession_getState}, - { "CoreSession_recordFile", _wrap_CoreSession_recordFile}, - { "CoreSession_originate", _wrap_CoreSession_originate}, - { "CoreSession_destroy", _wrap_CoreSession_destroy}, - { "CoreSession_setDTMFCallback", _wrap_CoreSession_setDTMFCallback}, - { "CoreSession_speak", _wrap_CoreSession_speak}, - { "CoreSession_set_tts_parms", _wrap_CoreSession_set_tts_parms}, - { "CoreSession_collectDigits",_wrap_CoreSession_collectDigits}, - { "CoreSession_getDigits",_wrap_CoreSession_getDigits}, - { "CoreSession_transfer", _wrap_CoreSession_transfer}, - { "CoreSession_read", _wrap_CoreSession_read}, - { "CoreSession_playAndGetDigits", _wrap_CoreSession_playAndGetDigits}, - { "CoreSession_streamFile", _wrap_CoreSession_streamFile}, - { "CoreSession_sleep", _wrap_CoreSession_sleep}, - { "CoreSession_flushEvents", _wrap_CoreSession_flushEvents}, - { "CoreSession_flushDigits", _wrap_CoreSession_flushDigits}, - { "CoreSession_setAutoHangup", _wrap_CoreSession_setAutoHangup}, - { "CoreSession_setHangupHook", _wrap_CoreSession_setHangupHook}, - { "CoreSession_ready", _wrap_CoreSession_ready}, - { "CoreSession_bridged", _wrap_CoreSession_bridged}, - { "CoreSession_answered", _wrap_CoreSession_answered}, - { "CoreSession_mediaReady", _wrap_CoreSession_mediaReady}, - { "CoreSession_waitForAnswer", _wrap_CoreSession_waitForAnswer}, - { "CoreSession_execute", _wrap_CoreSession_execute}, - { "CoreSession_sendEvent", _wrap_CoreSession_sendEvent}, - { "CoreSession_setEventData", _wrap_CoreSession_setEventData}, - { "CoreSession_getXMLCDR", _wrap_CoreSession_getXMLCDR}, - { "CoreSession_begin_allow_threads", _wrap_CoreSession_begin_allow_threads}, - { "CoreSession_end_allow_threads", _wrap_CoreSession_end_allow_threads}, - { "CoreSession_get_uuid", _wrap_CoreSession_get_uuid}, - { "CoreSession_get_cb_args", _wrap_CoreSession_get_cb_args}, - { "CoreSession_check_hangup_hook", _wrap_CoreSession_check_hangup_hook}, - { "CoreSession_run_dtmf_callback", _wrap_CoreSession_run_dtmf_callback}, { "console_log", _wrap_console_log}, { "console_clean_log", _wrap_console_clean_log}, { "msleep", _wrap_msleep}, { "bridge", _wrap_bridge}, { "hanguphook", _wrap_hanguphook}, { "dtmf_callback", _wrap_dtmf_callback}, - { "new_Session",_wrap_new_Session}, - { "delete_Session", _wrap_delete_Session}, - { "Session_destroy", _wrap_Session_destroy}, - { "Session_begin_allow_threads", _wrap_Session_begin_allow_threads}, - { "Session_end_allow_threads", _wrap_Session_end_allow_threads}, - { "Session_check_hangup_hook", _wrap_Session_check_hangup_hook}, - { "Session_run_dtmf_callback", _wrap_Session_run_dtmf_callback}, - { "Session_unsetInputCallback", _wrap_Session_unsetInputCallback}, - { "Session_setInputCallback",_wrap_Session_setInputCallback}, - { "Session_setHangupHook",_wrap_Session_setHangupHook}, - { "Session_ready", _wrap_Session_ready}, - { "Session_originate", _wrap_Session_originate}, - { "Session_cb_function_set", _wrap_Session_cb_function_set}, - { "Session_cb_function_get", _wrap_Session_cb_function_get}, - { "Session_cb_arg_set", _wrap_Session_cb_arg_set}, - { "Session_cb_arg_get", _wrap_Session_cb_arg_get}, - { "Session_hangup_func_str_set", _wrap_Session_hangup_func_str_set}, - { "Session_hangup_func_str_get", _wrap_Session_hangup_func_str_get}, - { "Session_hangup_func_arg_set", _wrap_Session_hangup_func_arg_set}, - { "Session_hangup_func_arg_get", _wrap_Session_hangup_func_arg_get}, - { "Session_setLUA", _wrap_Session_setLUA}, - { "new_Dbh",_wrap_new_Dbh}, - { "delete_Dbh", _wrap_delete_Dbh}, - { "Dbh_release", _wrap_Dbh_release}, - { "Dbh_query", _wrap_Dbh_query}, {0,0} }; @@ -6039,10 +7271,9 @@ static swig_lua_const_info swig_constants[] = { /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ -static void *_p_LUA__SessionTo_p_CoreSession(void *x) { +static void *_p_LUA__SessionTo_p_CoreSession(void *x, int *newmemory) { return (void *)((CoreSession *) ((LUA::Session *) x)); } -static swig_type_info _swigt__SWIGLUA_FN = {"_SWIGLUA_FN", "SWIGLUA_FN", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_API = {"_p_API", "API *", 0, 0, (void*)&_wrap_class_API, 0}; static swig_type_info _swigt__p_CoreSession = {"_p_CoreSession", "CoreSession *", 0, 0, (void*)&_wrap_class_CoreSession, 0}; static swig_type_info _swigt__p_DTMF = {"_p_DTMF", "DTMF *", 0, 0, (void*)&_wrap_class_DTMF, 0}; @@ -6051,8 +7282,9 @@ static swig_type_info _swigt__p_EventConsumer = {"_p_EventConsumer", "EventConsu static swig_type_info _swigt__p_IVRMenu = {"_p_IVRMenu", "IVRMenu *", 0, 0, (void*)&_wrap_class_IVRMenu, 0}; static swig_type_info _swigt__p_LUA__Dbh = {"_p_LUA__Dbh", "LUA::Dbh *", 0, 0, (void*)&_wrap_class_LUA_Dbh, 0}; static swig_type_info _swigt__p_LUA__Session = {"_p_LUA__Session", "LUA::Session *", 0, 0, (void*)&_wrap_class_LUA_Session, 0}; +static swig_type_info _swigt__p_SWIGLUA_FN = {"_p_SWIGLUA_FN", "SWIGLUA_FN *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Stream = {"_p_Stream", "Stream *", 0, 0, (void*)&_wrap_class_Stream, 0}; -static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state", "input_callback_state *", 0, 0, (void*)&_wrap_class_input_callback_state_t, 0}; +static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state", "input_callback_state_t *|input_callback_state *", 0, 0, (void*)&_wrap_class_input_callback_state_t, 0}; static swig_type_info _swigt__p_lua_State = {"_p_lua_State", "lua_State *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_switch_event_node_t = {"_p_p_switch_event_node_t", "switch_event_node_t **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_session_flag_t = {"_p_session_flag_t", "enum session_flag_t *|session_flag_t *", 0, 0, (void*)0, 0}; @@ -6071,15 +7303,8 @@ static swig_type_info _swigt__p_switch_status_t = {"_p_switch_status_t", "switch static swig_type_info _swigt__p_switch_stream_handle_t = {"_p_switch_stream_handle_t", "switch_stream_handle_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 _swigt__switch_call_cause_t = {"_switch_call_cause_t", "switch_call_cause_t", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__switch_channel_state_t = {"_switch_channel_state_t", "switch_channel_state_t", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__switch_event_types_t = {"_switch_event_types_t", "switch_event_types_t", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__switch_input_type_t = {"_switch_input_type_t", "switch_input_type_t", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__switch_priority_t = {"_switch_priority_t", "switch_priority_t", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__uint32_t = {"_uint32_t", "uint32_t", 0, 0, (void*)0, 0}; static swig_type_info *swig_type_initial[] = { - &_swigt__SWIGLUA_FN, &_swigt__p_API, &_swigt__p_CoreSession, &_swigt__p_DTMF, @@ -6088,6 +7313,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_IVRMenu, &_swigt__p_LUA__Dbh, &_swigt__p_LUA__Session, + &_swigt__p_SWIGLUA_FN, &_swigt__p_Stream, &_swigt__p_input_callback_state, &_swigt__p_lua_State, @@ -6108,15 +7334,8 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_switch_stream_handle_t, &_swigt__p_uint32_t, &_swigt__p_void, - &_swigt__switch_call_cause_t, - &_swigt__switch_channel_state_t, - &_swigt__switch_event_types_t, - &_swigt__switch_input_type_t, - &_swigt__switch_priority_t, - &_swigt__uint32_t, }; -static swig_cast_info _swigc__SWIGLUA_FN[] = { {&_swigt__SWIGLUA_FN, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_API[] = { {&_swigt__p_API, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_CoreSession[] = { {&_swigt__p_CoreSession, 0, 0, 0}, {&_swigt__p_LUA__Session, _p_LUA__SessionTo_p_CoreSession, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_DTMF[] = { {&_swigt__p_DTMF, 0, 0, 0},{0, 0, 0, 0}}; @@ -6125,6 +7344,7 @@ static swig_cast_info _swigc__p_EventConsumer[] = { {&_swigt__p_EventConsumer, static swig_cast_info _swigc__p_IVRMenu[] = { {&_swigt__p_IVRMenu, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_LUA__Dbh[] = { {&_swigt__p_LUA__Dbh, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_LUA__Session[] = { {&_swigt__p_LUA__Session, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_SWIGLUA_FN[] = { {&_swigt__p_SWIGLUA_FN, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Stream[] = { {&_swigt__p_Stream, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_input_callback_state[] = { {&_swigt__p_input_callback_state, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_lua_State[] = { {&_swigt__p_lua_State, 0, 0, 0},{0, 0, 0, 0}}; @@ -6145,15 +7365,8 @@ static swig_cast_info _swigc__p_switch_status_t[] = { {&_swigt__p_switch_status static swig_cast_info _swigc__p_switch_stream_handle_t[] = { {&_swigt__p_switch_stream_handle_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 _swigc__switch_call_cause_t[] = { {&_swigt__switch_call_cause_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__switch_channel_state_t[] = { {&_swigt__switch_channel_state_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__switch_event_types_t[] = { {&_swigt__switch_event_types_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__switch_input_type_t[] = { {&_swigt__switch_input_type_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__switch_priority_t[] = { {&_swigt__switch_priority_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__uint32_t[] = { {&_swigt__uint32_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info *swig_cast_initial[] = { - _swigc__SWIGLUA_FN, _swigc__p_API, _swigc__p_CoreSession, _swigc__p_DTMF, @@ -6162,6 +7375,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_IVRMenu, _swigc__p_LUA__Dbh, _swigc__p_LUA__Session, + _swigc__p_SWIGLUA_FN, _swigc__p_Stream, _swigc__p_input_callback_state, _swigc__p_lua_State, @@ -6182,12 +7396,6 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_switch_stream_handle_t, _swigc__p_uint32_t, _swigc__p_void, - _swigc__switch_call_cause_t, - _swigc__switch_channel_state_t, - _swigc__switch_event_types_t, - _swigc__switch_input_type_t, - _swigc__switch_priority_t, - _swigc__uint32_t, }; @@ -6207,7 +7415,7 @@ static swig_cast_info *swig_cast_initial[] = { * 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 @@ -6245,32 +7453,58 @@ extern "C" { #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, init; 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; + init = 1; + } else { + init = 0; + } /* 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); } - + + /* When multiple interpeters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) return; + /* Now work on filling in swig_module.types */ #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: size %d\n", swig_module.size); @@ -6407,73 +7641,56 @@ SWIG_PropagateClientData(void) { /* Forward declaration of where the user's %init{} gets inserted */ +void SWIG_init_user(lua_State* L ); + #ifdef __cplusplus extern "C" { #endif -void SWIG_init_user(lua_State* L ); - /* this is the initialization function - added at the very end of the code - the function is always called SWIG_init, but an eariler #define will rename it + added at the very end of the code + the function is always called SWIG_init, but an eariler #define will rename it */ SWIGEXPORT int SWIG_init(lua_State* L) { - int i; - - /* start with global table */ - lua_pushvalue(L,LUA_GLOBALSINDEX); - - SWIG_InitializeModule((void*)L); - SWIG_PropagateClientData(); - - /* invoke user-specific initialization */ - SWIG_init_user(L); - - /* add a global fn */ - SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type); - SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal); - - /* begin the module (its a table with the same name as the module) */ - SWIG_Lua_module_begin(L,SWIG_name); - /* add commands/functions */ - for (i = 0; swig_commands[i].name; i++){ - SWIG_Lua_module_add_function(L,swig_commands[i].name,swig_commands[i].func); - } - /*luaL_openlib(L,NULL,swig_commands,0);*/ - /* all in one */ - /*luaL_openlib(L,SWIG_name,swig_commands,0);*/ - /* add variables */ - for (i = 0; swig_variables[i].name; i++){ - SWIG_Lua_module_add_variable(L,swig_variables[i].name,swig_variables[i].get,swig_variables[i].set); - } - - /* additional registration structs & classes in lua: */ - for (i = 0; swig_types[i]; i++){ - if (swig_types[i]->clientdata){ - SWIG_Lua_class_register(L,(swig_lua_class*)(swig_types[i]->clientdata)); - } - } - - /* constants */ - SWIG_Lua_InstallConstants(L,swig_constants); - - /* end module */ - /*SWIG_Lua_module_end(L);*/ - lua_pop(L,1); /* tidy stack (remove module table)*/ - lua_pop(L,1); /* tidy stack (remove global table)*/ - - return 1; -} - -/* Lua 5.1 has a different name for importing libraries -luaopen_XXX, where XXX is the name of the module (not capitalised) -this function will allow Lua 5.1 to import correctly. -There is a #define in the wrapper to rename 'SWIG_import' to the correct name -*/ - -SWIGEXPORT int SWIG_import(lua_State* L) -{ - return SWIG_init(L); + int i; + /* start with global table */ + lua_pushvalue(L,LUA_GLOBALSINDEX); + /* SWIG's internal initalisation */ + SWIG_InitializeModule((void*)L); + SWIG_PropagateClientData(); + /* add a global fn */ + SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type); + SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal); + /* begin the module (its a table with the same name as the module) */ + SWIG_Lua_module_begin(L,SWIG_name); + /* add commands/functions */ + for (i = 0; swig_commands[i].name; i++){ + SWIG_Lua_module_add_function(L,swig_commands[i].name,swig_commands[i].func); + } + /* add variables */ + for (i = 0; swig_variables[i].name; i++){ + SWIG_Lua_module_add_variable(L,swig_variables[i].name,swig_variables[i].get,swig_variables[i].set); + } + /* set up base class pointers (the hierachy) */ + for (i = 0; swig_types[i]; i++){ + if (swig_types[i]->clientdata){ + SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata)); + } + } + /* additional registration structs & classes in lua */ + for (i = 0; swig_types[i]; i++){ + if (swig_types[i]->clientdata){ + SWIG_Lua_class_register(L,(swig_lua_class*)(swig_types[i]->clientdata)); + } + } + /* constants */ + SWIG_Lua_InstallConstants(L,swig_constants); + /* invoke user-specific initialization */ + SWIG_init_user(L); + /* end module */ + lua_pop(L,1); /* tidy stack (remove module table)*/ + lua_pop(L,1); /* tidy stack (remove global table)*/ + return 1; } #ifdef __cplusplus @@ -6481,12 +7698,13 @@ SWIGEXPORT int SWIG_import(lua_State* L) #endif -#ifdef __cplusplus -extern "C" -#endif +const char* SWIG_LUACODE= + ""; + void SWIG_init_user(lua_State* L) { - + /* exec Lua code if applicable */ + SWIG_Lua_dostring(L,SWIG_LUACODE); } #include "mod_lua_extra.c" From f30a1cc6882e9e9d1c83c69f0866ec728e406e3b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 10 Sep 2010 12:55:50 -0500 Subject: [PATCH 21/63] fix vm_inject to a group and change syntax for sending to a whole domain to domain= for clarity sake --- .../mod_voicemail/mod_voicemail.c | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index e89bda47f1..732059aff4 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -2687,23 +2687,29 @@ static switch_status_t voicemail_inject(const char *data, switch_core_session_t if ((domain = strchr(user, '@'))) { *domain++ = '\0'; - } else { - domain = user; - } - if ((profile_name = strchr(domain, '@'))) { - *profile_name++ = '\0'; - } else { - profile_name = domain; + if ((profile_name = strchr(domain, '@'))) { + *profile_name++ = '\0'; + } else { + profile_name = domain; + } } if (switch_stristr("group=", user)) { user += 6; isgroup++; - } else if (user == domain) { + } else if (switch_stristr("domain=", user)) { + user += 7; + domain = user; + profile_name = domain; isall++; } + if (zstr(domain)) { + domain = switch_core_get_variable("domain"); + profile_name = domain; + } + if (!(user && domain)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid syntax [%s][%s]\n", switch_str_nil(user), switch_str_nil(domain)); status = SWITCH_STATUS_FALSE; @@ -2747,6 +2753,7 @@ static switch_status_t voicemail_inject(const char *data, switch_core_session_t switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot locate domain %s\n", domain); status = SWITCH_STATUS_FALSE; switch_event_destroy(&my_params); + profile_rwunlock(profile); goto end; } @@ -3962,7 +3969,7 @@ static void do_web(vm_profile_t *profile, const char *user_in, const char *domai } } -#define VM_INJECT_USAGE "[group=] [] []" +#define VM_INJECT_USAGE "[group=[@domain]|domain=|[@]] [] []" SWITCH_STANDARD_API(voicemail_inject_api_function) { if (voicemail_inject(cmd, session) == SWITCH_STATUS_SUCCESS) { From bddec41f438352063e33c70f13899b978584d627 Mon Sep 17 00:00:00 2001 From: Jeff Lenk Date: Sun, 12 Sep 2010 15:38:58 -0500 Subject: [PATCH 22/63] FSCORE-670 --- src/switch_ivr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/switch_ivr.c b/src/switch_ivr.c index c1dc33651c..543e472a13 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -2175,6 +2175,7 @@ SWITCH_DECLARE(void) switch_ivr_delay_echo(switch_core_session_t *session, uint3 if ((jb_frame = stfu_n_read_a_frame(jb))) { write_frame.data = jb_frame->data; write_frame.datalen = (uint32_t) jb_frame->dlen; + write_frame.buflen = (uint32_t) jb_frame->dlen; status = switch_core_session_write_frame(session, &write_frame, SWITCH_IO_FLAG_NONE, 0); if (!SWITCH_READ_ACCEPTABLE(status)) { break; From d47d32e035bc9036c32d3497c96cfe2e4f098584 Mon Sep 17 00:00:00 2001 From: Marc Olivier Chouinard Date: Sun, 12 Sep 2010 20:01:43 -0400 Subject: [PATCH 23/63] mod_callcenter: Fix Initial ODBC support --- src/mod/applications/mod_callcenter/mod_callcenter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/applications/mod_callcenter/mod_callcenter.c b/src/mod/applications/mod_callcenter/mod_callcenter.c index e08757ba38..874c6156fd 100644 --- a/src/mod/applications/mod_callcenter/mod_callcenter.c +++ b/src/mod/applications/mod_callcenter/mod_callcenter.c @@ -1259,7 +1259,7 @@ static switch_status_t load_config(void) if (!strcasecmp(var, "debug")) { globals.debug = atoi(val); } else if (!strcasecmp(var, "odbc-dsn")) { - globals.odbc_dsn = strdup(switch_xml_attr(param, "odbc-dsn")); + globals.odbc_dsn = strdup(val); if (!zstr(globals.odbc_dsn)) { if ((globals.odbc_user = strchr(globals.odbc_dsn, ':'))) { From a2e5f07c4d6d8fa947bda216c7f1940acb7fa12b Mon Sep 17 00:00:00 2001 From: Marc Olivier Chouinard Date: Sun, 12 Sep 2010 20:06:20 -0400 Subject: [PATCH 24/63] mod_callcenter: Fix initial ODBC Support (SEGV) --- src/mod/applications/mod_callcenter/mod_callcenter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/applications/mod_callcenter/mod_callcenter.c b/src/mod/applications/mod_callcenter/mod_callcenter.c index e08757ba38..874c6156fd 100644 --- a/src/mod/applications/mod_callcenter/mod_callcenter.c +++ b/src/mod/applications/mod_callcenter/mod_callcenter.c @@ -1259,7 +1259,7 @@ static switch_status_t load_config(void) if (!strcasecmp(var, "debug")) { globals.debug = atoi(val); } else if (!strcasecmp(var, "odbc-dsn")) { - globals.odbc_dsn = strdup(switch_xml_attr(param, "odbc-dsn")); + globals.odbc_dsn = strdup(val); if (!zstr(globals.odbc_dsn)) { if ((globals.odbc_user = strchr(globals.odbc_dsn, ':'))) { From 5be58aac1b545e191b4e27e4b0cec7b7ea5c0585 Mon Sep 17 00:00:00 2001 From: Jeff Lenk Date: Mon, 13 Sep 2010 09:40:03 -0500 Subject: [PATCH 25/63] mod_managed - add some additional support --- src/mod/languages/mod_managed/freeswitch.i | 5 +- .../mod_managed/freeswitch_wrap.2010.cxx | 832 ++++++++++++++++++ .../mod_managed/managed/swig.2010.cs | 785 +++++++++++++++-- 3 files changed, 1545 insertions(+), 77 deletions(-) diff --git a/src/mod/languages/mod_managed/freeswitch.i b/src/mod/languages/mod_managed/freeswitch.i index 969839722a..ffbdf9be0f 100644 --- a/src/mod/languages/mod_managed/freeswitch.i +++ b/src/mod/languages/mod_managed/freeswitch.i @@ -193,7 +193,10 @@ char * SWIG_csharp_string_callback(const char * str) { %include switch_core_db.h %include switch_regex.h %include switch_core.h -//%include switch_loadable_module.h // todo: Sort out some linking issues +%ignore switch_module_runtime; +%ignore switch_module_load; +%ignore switch_module_shutdown; +%include switch_loadable_module.h // note: Above three ignore lines sort out some linking issues %include switch_console.h // Has unsupported varargs functions %include switch_utils.h %include switch_caller.h diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx index 908a851e5a..4b0a1df8c3 100644 --- a/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx +++ b/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx @@ -10097,6 +10097,838 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_session_in_thread(void * jarg1) { } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_module_name_set(void * jarg1, char * jarg2) { + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + arg2 = (char *)jarg2; + { + if (arg2) { + arg1->module_name = (char const *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->module_name, (const char *)arg2); + } else { + arg1->module_name = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_loadable_module_interface_module_name_get(void * jarg1) { + char * jresult ; + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + char *result = 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + result = (char *) ((arg1)->module_name); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_endpoint_interface_set(void * jarg1, void * jarg2) { + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_endpoint_interface_t *arg2 = (switch_endpoint_interface_t *) 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + arg2 = (switch_endpoint_interface_t *)jarg2; + if (arg1) (arg1)->endpoint_interface = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_endpoint_interface_get(void * jarg1) { + void * jresult ; + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_endpoint_interface_t *result = 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + result = (switch_endpoint_interface_t *) ((arg1)->endpoint_interface); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_timer_interface_set(void * jarg1, void * jarg2) { + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_timer_interface_t *arg2 = (switch_timer_interface_t *) 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + arg2 = (switch_timer_interface_t *)jarg2; + if (arg1) (arg1)->timer_interface = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_timer_interface_get(void * jarg1) { + void * jresult ; + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_timer_interface_t *result = 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + result = (switch_timer_interface_t *) ((arg1)->timer_interface); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_dialplan_interface_set(void * jarg1, void * jarg2) { + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_dialplan_interface_t *arg2 = (switch_dialplan_interface_t *) 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + arg2 = (switch_dialplan_interface_t *)jarg2; + if (arg1) (arg1)->dialplan_interface = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_dialplan_interface_get(void * jarg1) { + void * jresult ; + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_dialplan_interface_t *result = 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + result = (switch_dialplan_interface_t *) ((arg1)->dialplan_interface); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_codec_interface_set(void * jarg1, void * jarg2) { + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_codec_interface_t *arg2 = (switch_codec_interface_t *) 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + arg2 = (switch_codec_interface_t *)jarg2; + if (arg1) (arg1)->codec_interface = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_codec_interface_get(void * jarg1) { + void * jresult ; + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_codec_interface_t *result = 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + result = (switch_codec_interface_t *) ((arg1)->codec_interface); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_application_interface_set(void * jarg1, void * jarg2) { + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_application_interface_t *arg2 = (switch_application_interface_t *) 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + arg2 = (switch_application_interface_t *)jarg2; + if (arg1) (arg1)->application_interface = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_application_interface_get(void * jarg1) { + void * jresult ; + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_application_interface_t *result = 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + result = (switch_application_interface_t *) ((arg1)->application_interface); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_api_interface_set(void * jarg1, void * jarg2) { + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_api_interface_t *arg2 = (switch_api_interface_t *) 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + arg2 = (switch_api_interface_t *)jarg2; + if (arg1) (arg1)->api_interface = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_api_interface_get(void * jarg1) { + void * jresult ; + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_api_interface_t *result = 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + result = (switch_api_interface_t *) ((arg1)->api_interface); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_file_interface_set(void * jarg1, void * jarg2) { + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_file_interface_t *arg2 = (switch_file_interface_t *) 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + arg2 = (switch_file_interface_t *)jarg2; + if (arg1) (arg1)->file_interface = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_file_interface_get(void * jarg1) { + void * jresult ; + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_file_interface_t *result = 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + result = (switch_file_interface_t *) ((arg1)->file_interface); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_speech_interface_set(void * jarg1, void * jarg2) { + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_speech_interface_t *arg2 = (switch_speech_interface_t *) 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + arg2 = (switch_speech_interface_t *)jarg2; + if (arg1) (arg1)->speech_interface = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_speech_interface_get(void * jarg1) { + void * jresult ; + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_speech_interface_t *result = 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + result = (switch_speech_interface_t *) ((arg1)->speech_interface); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_directory_interface_set(void * jarg1, void * jarg2) { + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_directory_interface_t *arg2 = (switch_directory_interface_t *) 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + arg2 = (switch_directory_interface_t *)jarg2; + if (arg1) (arg1)->directory_interface = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_directory_interface_get(void * jarg1) { + void * jresult ; + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_directory_interface_t *result = 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + result = (switch_directory_interface_t *) ((arg1)->directory_interface); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_chat_interface_set(void * jarg1, void * jarg2) { + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_chat_interface_t *arg2 = (switch_chat_interface_t *) 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + arg2 = (switch_chat_interface_t *)jarg2; + if (arg1) (arg1)->chat_interface = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_chat_interface_get(void * jarg1) { + void * jresult ; + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_chat_interface_t *result = 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + result = (switch_chat_interface_t *) ((arg1)->chat_interface); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_say_interface_set(void * jarg1, void * jarg2) { + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_say_interface_t *arg2 = (switch_say_interface_t *) 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + arg2 = (switch_say_interface_t *)jarg2; + if (arg1) (arg1)->say_interface = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_say_interface_get(void * jarg1) { + void * jresult ; + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_say_interface_t *result = 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + result = (switch_say_interface_t *) ((arg1)->say_interface); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_asr_interface_set(void * jarg1, void * jarg2) { + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_asr_interface_t *arg2 = (switch_asr_interface_t *) 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + arg2 = (switch_asr_interface_t *)jarg2; + if (arg1) (arg1)->asr_interface = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_asr_interface_get(void * jarg1) { + void * jresult ; + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_asr_interface_t *result = 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + result = (switch_asr_interface_t *) ((arg1)->asr_interface); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_management_interface_set(void * jarg1, void * jarg2) { + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_management_interface_t *arg2 = (switch_management_interface_t *) 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + arg2 = (switch_management_interface_t *)jarg2; + if (arg1) (arg1)->management_interface = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_management_interface_get(void * jarg1) { + void * jresult ; + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_management_interface_t *result = 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + result = (switch_management_interface_t *) ((arg1)->management_interface); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_limit_interface_set(void * jarg1, void * jarg2) { + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_limit_interface_t *arg2 = (switch_limit_interface_t *) 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + arg2 = (switch_limit_interface_t *)jarg2; + if (arg1) (arg1)->limit_interface = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_limit_interface_get(void * jarg1) { + void * jresult ; + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_limit_interface_t *result = 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + result = (switch_limit_interface_t *) ((arg1)->limit_interface); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_rwlock_set(void * jarg1, void * jarg2) { + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_thread_rwlock_t *arg2 = (switch_thread_rwlock_t *) 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + arg2 = (switch_thread_rwlock_t *)jarg2; + if (arg1) (arg1)->rwlock = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_rwlock_get(void * jarg1) { + void * jresult ; + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_thread_rwlock_t *result = 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + result = (switch_thread_rwlock_t *) ((arg1)->rwlock); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_refs_set(void * jarg1, int jarg2) { + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + int arg2 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + arg2 = (int)jarg2; + if (arg1) (arg1)->refs = arg2; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_loadable_module_interface_refs_get(void * jarg1) { + int jresult ; + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + int result; + + arg1 = (switch_loadable_module_interface *)jarg1; + result = (int) ((arg1)->refs); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_pool_set(void * jarg1, void * jarg2) { + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_memory_pool_t *arg2 = (switch_memory_pool_t *) 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + arg2 = (switch_memory_pool_t *)jarg2; + if (arg1) (arg1)->pool = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_pool_get(void * jarg1) { + void * jresult ; + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + switch_memory_pool_t *result = 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + result = (switch_memory_pool_t *) ((arg1)->pool); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_loadable_module_interface() { + void * jresult ; + switch_loadable_module_interface *result = 0 ; + + result = (switch_loadable_module_interface *)new switch_loadable_module_interface(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_loadable_module_interface(void * jarg1) { + switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; + + arg1 = (switch_loadable_module_interface *)jarg1; + delete arg1; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_loadable_module_init() { + int jresult ; + switch_status_t result; + + result = (switch_status_t)switch_loadable_module_init(); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_shutdown() { + switch_loadable_module_shutdown(); +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_endpoint_interface(char * jarg1) { + void * jresult ; + char *arg1 = (char *) 0 ; + switch_endpoint_interface_t *result = 0 ; + + arg1 = (char *)jarg1; + result = (switch_endpoint_interface_t *)switch_loadable_module_get_endpoint_interface((char const *)arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_codec_interface(char * jarg1) { + void * jresult ; + char *arg1 = (char *) 0 ; + switch_codec_interface_t *result = 0 ; + + arg1 = (char *)jarg1; + result = (switch_codec_interface_t *)switch_loadable_module_get_codec_interface((char const *)arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_dialplan_interface(char * jarg1) { + void * jresult ; + char *arg1 = (char *) 0 ; + switch_dialplan_interface_t *result = 0 ; + + arg1 = (char *)jarg1; + result = (switch_dialplan_interface_t *)switch_loadable_module_get_dialplan_interface((char const *)arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_loadable_module_enumerate_available(char * jarg1, void * jarg2, void * jarg3) { + int jresult ; + char *arg1 = (char *) 0 ; + switch_modulename_callback_func_t arg2 = (switch_modulename_callback_func_t) 0 ; + void *arg3 = (void *) 0 ; + switch_status_t result; + + arg1 = (char *)jarg1; + arg2 = (switch_modulename_callback_func_t)jarg2; + arg3 = (void *)jarg3; + result = (switch_status_t)switch_loadable_module_enumerate_available((char const *)arg1,arg2,arg3); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_loadable_module_enumerate_loaded(void * jarg1, void * jarg2) { + int jresult ; + switch_modulename_callback_func_t arg1 = (switch_modulename_callback_func_t) 0 ; + void *arg2 = (void *) 0 ; + switch_status_t result; + + arg1 = (switch_modulename_callback_func_t)jarg1; + arg2 = (void *)jarg2; + result = (switch_status_t)switch_loadable_module_enumerate_loaded(arg1,arg2); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_loadable_module_build_dynamic(char * jarg1, void * jarg2, void * jarg3, void * jarg4, int jarg5) { + int jresult ; + char *arg1 = (char *) 0 ; + switch_module_load_t arg2 = (switch_module_load_t) 0 ; + switch_module_runtime_t arg3 = (switch_module_runtime_t) 0 ; + switch_module_shutdown_t arg4 = (switch_module_shutdown_t) 0 ; + switch_bool_t arg5 ; + switch_status_t result; + + arg1 = (char *)jarg1; + arg2 = (switch_module_load_t)jarg2; + arg3 = (switch_module_runtime_t)jarg3; + arg4 = (switch_module_shutdown_t)jarg4; + arg5 = (switch_bool_t)jarg5; + result = (switch_status_t)switch_loadable_module_build_dynamic(arg1,arg2,arg3,arg4,arg5); + jresult = result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_timer_interface(char * jarg1) { + void * jresult ; + char *arg1 = (char *) 0 ; + switch_timer_interface_t *result = 0 ; + + arg1 = (char *)jarg1; + result = (switch_timer_interface_t *)switch_loadable_module_get_timer_interface((char const *)arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_application_interface(char * jarg1) { + void * jresult ; + char *arg1 = (char *) 0 ; + switch_application_interface_t *result = 0 ; + + arg1 = (char *)jarg1; + result = (switch_application_interface_t *)switch_loadable_module_get_application_interface((char const *)arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_api_interface(char * jarg1) { + void * jresult ; + char *arg1 = (char *) 0 ; + switch_api_interface_t *result = 0 ; + + arg1 = (char *)jarg1; + result = (switch_api_interface_t *)switch_loadable_module_get_api_interface((char const *)arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_file_interface(char * jarg1) { + void * jresult ; + char *arg1 = (char *) 0 ; + switch_file_interface_t *result = 0 ; + + arg1 = (char *)jarg1; + result = (switch_file_interface_t *)switch_loadable_module_get_file_interface((char const *)arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_speech_interface(char * jarg1) { + void * jresult ; + char *arg1 = (char *) 0 ; + switch_speech_interface_t *result = 0 ; + + arg1 = (char *)jarg1; + result = (switch_speech_interface_t *)switch_loadable_module_get_speech_interface((char const *)arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_asr_interface(char * jarg1) { + void * jresult ; + char *arg1 = (char *) 0 ; + switch_asr_interface_t *result = 0 ; + + arg1 = (char *)jarg1; + result = (switch_asr_interface_t *)switch_loadable_module_get_asr_interface((char const *)arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_directory_interface(char * jarg1) { + void * jresult ; + char *arg1 = (char *) 0 ; + switch_directory_interface_t *result = 0 ; + + arg1 = (char *)jarg1; + result = (switch_directory_interface_t *)switch_loadable_module_get_directory_interface((char const *)arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_chat_interface(char * jarg1) { + void * jresult ; + char *arg1 = (char *) 0 ; + switch_chat_interface_t *result = 0 ; + + arg1 = (char *)jarg1; + result = (switch_chat_interface_t *)switch_loadable_module_get_chat_interface((char const *)arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_say_interface(char * jarg1) { + void * jresult ; + char *arg1 = (char *) 0 ; + switch_say_interface_t *result = 0 ; + + arg1 = (char *)jarg1; + result = (switch_say_interface_t *)switch_loadable_module_get_say_interface((char const *)arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_management_interface(char * jarg1) { + void * jresult ; + char *arg1 = (char *) 0 ; + switch_management_interface_t *result = 0 ; + + arg1 = (char *)jarg1; + result = (switch_management_interface_t *)switch_loadable_module_get_management_interface((char const *)arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_limit_interface(char * jarg1) { + void * jresult ; + char *arg1 = (char *) 0 ; + switch_limit_interface_t *result = 0 ; + + arg1 = (char *)jarg1; + result = (switch_limit_interface_t *)switch_loadable_module_get_limit_interface((char const *)arg1); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_loadable_module_get_codecs(void * jarg1, int jarg2) { + int jresult ; + switch_codec_implementation_t **arg1 = (switch_codec_implementation_t **) 0 ; + int arg2 ; + int result; + + arg1 = (switch_codec_implementation_t **)jarg1; + arg2 = (int)jarg2; + result = (int)switch_loadable_module_get_codecs((switch_codec_implementation const **)arg1,arg2); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_loadable_module_get_codecs_sorted(void * jarg1, int jarg2, void * jarg3, int jarg4) { + int jresult ; + switch_codec_implementation_t **arg1 = (switch_codec_implementation_t **) 0 ; + int arg2 ; + char **arg3 = (char **) 0 ; + int arg4 ; + int result; + + arg1 = (switch_codec_implementation_t **)jarg1; + arg2 = (int)jarg2; + arg3 = (char **)jarg3; + arg4 = (int)jarg4; + result = (int)switch_loadable_module_get_codecs_sorted((switch_codec_implementation const **)arg1,arg2,arg3,arg4); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_api_execute(char * jarg1, char * jarg2, void * jarg3, void * jarg4) { + int jresult ; + char *arg1 = (char *) 0 ; + char *arg2 = (char *) 0 ; + switch_core_session_t *arg3 = (switch_core_session_t *) 0 ; + switch_stream_handle_t *arg4 = (switch_stream_handle_t *) 0 ; + switch_status_t result; + + arg1 = (char *)jarg1; + arg2 = (char *)jarg2; + arg3 = (switch_core_session_t *)jarg3; + arg4 = (switch_stream_handle_t *)jarg4; + result = (switch_status_t)switch_api_execute((char const *)arg1,(char const *)arg2,arg3,arg4); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_loadable_module_load_module(char * jarg1, char * jarg2, int jarg3, void * jarg4) { + int jresult ; + char *arg1 = (char *) 0 ; + char *arg2 = (char *) 0 ; + switch_bool_t arg3 ; + char **arg4 = (char **) 0 ; + switch_status_t result; + + arg1 = (char *)jarg1; + arg2 = (char *)jarg2; + arg3 = (switch_bool_t)jarg3; + arg4 = (char **)jarg4; + result = (switch_status_t)switch_loadable_module_load_module(arg1,arg2,arg3,(char const **)arg4); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_loadable_module_exists(char * jarg1) { + int jresult ; + char *arg1 = (char *) 0 ; + switch_status_t result; + + arg1 = (char *)jarg1; + result = (switch_status_t)switch_loadable_module_exists((char const *)arg1); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_loadable_module_unload_module(char * jarg1, char * jarg2, int jarg3, void * jarg4) { + int jresult ; + char *arg1 = (char *) 0 ; + char *arg2 = (char *) 0 ; + switch_bool_t arg3 ; + char **arg4 = (char **) 0 ; + switch_status_t result; + + arg1 = (char *)jarg1; + arg2 = (char *)jarg2; + arg3 = (switch_bool_t)jarg3; + arg4 = (char **)jarg4; + result = (switch_status_t)switch_loadable_module_unload_module(arg1,arg2,arg3,(char const **)arg4); + jresult = result; + return jresult; +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_core_codec_next_id() { + unsigned long jresult ; + uint32_t result; + + result = (uint32_t)switch_core_codec_next_id(); + jresult = (unsigned long)result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_check_interval(unsigned long jarg1, unsigned long jarg2) { + int jresult ; + uint32_t arg1 ; + uint32_t arg2 ; + int result; + + arg1 = (uint32_t)jarg1; + arg2 = (uint32_t)jarg2; + result = (int)switch_check_interval(arg1,arg2); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_codec_add_implementation(void * jarg1, void * jarg2, int jarg3, unsigned char jarg4, char * jarg5, char * jarg6, unsigned long jarg7, unsigned long jarg8, int jarg9, int jarg10, unsigned long jarg11, unsigned long jarg12, unsigned long jarg13, unsigned char jarg14, int jarg15, void * jarg16, void * jarg17, void * jarg18, void * jarg19) { + switch_memory_pool_t *arg1 = (switch_memory_pool_t *) 0 ; + switch_codec_interface_t *arg2 = (switch_codec_interface_t *) 0 ; + switch_codec_type_t arg3 ; + switch_payload_t arg4 ; + char *arg5 = (char *) 0 ; + char *arg6 = (char *) 0 ; + uint32_t arg7 ; + uint32_t arg8 ; + int arg9 ; + int arg10 ; + uint32_t arg11 ; + uint32_t arg12 ; + uint32_t arg13 ; + uint8_t arg14 ; + int arg15 ; + switch_core_codec_init_func_t arg16 = (switch_core_codec_init_func_t) 0 ; + switch_core_codec_encode_func_t arg17 = (switch_core_codec_encode_func_t) 0 ; + switch_core_codec_decode_func_t arg18 = (switch_core_codec_decode_func_t) 0 ; + switch_core_codec_destroy_func_t arg19 = (switch_core_codec_destroy_func_t) 0 ; + + arg1 = (switch_memory_pool_t *)jarg1; + arg2 = (switch_codec_interface_t *)jarg2; + arg3 = (switch_codec_type_t)jarg3; + arg4 = (switch_payload_t)jarg4; + arg5 = (char *)jarg5; + arg6 = (char *)jarg6; + arg7 = (uint32_t)jarg7; + arg8 = (uint32_t)jarg8; + arg9 = (int)jarg9; + arg10 = (int)jarg10; + arg11 = (uint32_t)jarg11; + arg12 = (uint32_t)jarg12; + arg13 = (uint32_t)jarg13; + arg14 = (uint8_t)jarg14; + arg15 = (int)jarg15; + arg16 = (switch_core_codec_init_func_t)jarg16; + arg17 = (switch_core_codec_encode_func_t)jarg17; + arg18 = (switch_core_codec_decode_func_t)jarg18; + arg19 = (switch_core_codec_destroy_func_t)jarg19; + switch_core_codec_add_implementation(arg1,arg2,arg3,arg4,(char const *)arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19); +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_codec_ready(void * jarg1) { + int jresult ; + switch_codec_t *arg1 = (switch_codec_t *) 0 ; + switch_bool_t result; + + arg1 = (switch_codec_t *)jarg1; + result = (switch_bool_t)switch_core_codec_ready(arg1); + jresult = result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_CMD_CHUNK_LEN_get() { int jresult ; int result; diff --git a/src/mod/languages/mod_managed/managed/swig.2010.cs b/src/mod/languages/mod_managed/managed/swig.2010.cs index 268187547f..a76e35c5e8 100644 --- a/src/mod/languages/mod_managed/managed/swig.2010.cs +++ b/src/mod/languages/mod_managed/managed/swig.2010.cs @@ -2078,14 +2078,14 @@ public class freeswitch { return ret; } - public static SWIGTYPE_p_switch_loadable_module_interface switch_loadable_module_create_module_interface(SWIGTYPE_p_apr_pool_t pool, string name) { + public static switch_loadable_module_interface switch_loadable_module_create_module_interface(SWIGTYPE_p_apr_pool_t pool, string name) { IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_create_module_interface(SWIGTYPE_p_apr_pool_t.getCPtr(pool), name); - SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false); + switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false); return ret; } - public static SWIGTYPE_p_void switch_loadable_module_create_interface(SWIGTYPE_p_switch_loadable_module_interface mod, switch_module_interface_name_t iname) { - IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_create_interface(SWIGTYPE_p_switch_loadable_module_interface.getCPtr(mod), (int)iname); + public static SWIGTYPE_p_void switch_loadable_module_create_interface(switch_loadable_module_interface mod, switch_module_interface_name_t iname) { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_create_interface(switch_loadable_module_interface.getCPtr(mod), (int)iname); SWIGTYPE_p_void ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_void(cPtr, false); return ret; } @@ -2309,6 +2309,163 @@ public class freeswitch { return ret; } + public static switch_status_t switch_loadable_module_init() { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_loadable_module_init(); + return ret; + } + + public static void switch_loadable_module_shutdown() { + freeswitchPINVOKE.switch_loadable_module_shutdown(); + } + + public static switch_endpoint_interface switch_loadable_module_get_endpoint_interface(string name) { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_endpoint_interface(name); + switch_endpoint_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_endpoint_interface(cPtr, false); + return ret; + } + + public static switch_codec_interface switch_loadable_module_get_codec_interface(string name) { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_codec_interface(name); + switch_codec_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_codec_interface(cPtr, false); + return ret; + } + + public static switch_dialplan_interface switch_loadable_module_get_dialplan_interface(string name) { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_dialplan_interface(name); + switch_dialplan_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_dialplan_interface(cPtr, false); + return ret; + } + + public static switch_status_t switch_loadable_module_enumerate_available(string dir_path, SWIGTYPE_p_f_p_void_p_q_const__char__int callback, SWIGTYPE_p_void user_data) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_loadable_module_enumerate_available(dir_path, SWIGTYPE_p_f_p_void_p_q_const__char__int.getCPtr(callback), SWIGTYPE_p_void.getCPtr(user_data)); + return ret; + } + + public static switch_status_t switch_loadable_module_enumerate_loaded(SWIGTYPE_p_f_p_void_p_q_const__char__int callback, SWIGTYPE_p_void user_data) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_loadable_module_enumerate_loaded(SWIGTYPE_p_f_p_void_p_q_const__char__int.getCPtr(callback), SWIGTYPE_p_void.getCPtr(user_data)); + return ret; + } + + public static switch_status_t switch_loadable_module_build_dynamic(string filename, SWIGTYPE_p_f_p_p_switch_loadable_module_interface_p_apr_pool_t__switch_status_t switch_module_load, SWIGTYPE_p_f_void__switch_status_t switch_module_runtime, SWIGTYPE_p_f_void__switch_status_t switch_module_shutdown, switch_bool_t runtime) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_loadable_module_build_dynamic(filename, SWIGTYPE_p_f_p_p_switch_loadable_module_interface_p_apr_pool_t__switch_status_t.getCPtr(switch_module_load), SWIGTYPE_p_f_void__switch_status_t.getCPtr(switch_module_runtime), SWIGTYPE_p_f_void__switch_status_t.getCPtr(switch_module_shutdown), (int)runtime); + return ret; + } + + public static switch_timer_interface switch_loadable_module_get_timer_interface(string name) { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_timer_interface(name); + switch_timer_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_timer_interface(cPtr, false); + return ret; + } + + public static switch_application_interface switch_loadable_module_get_application_interface(string name) { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_application_interface(name); + switch_application_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_application_interface(cPtr, false); + return ret; + } + + public static switch_api_interface switch_loadable_module_get_api_interface(string name) { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_api_interface(name); + switch_api_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_api_interface(cPtr, false); + return ret; + } + + public static switch_file_interface switch_loadable_module_get_file_interface(string name) { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_file_interface(name); + switch_file_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_file_interface(cPtr, false); + return ret; + } + + public static switch_speech_interface switch_loadable_module_get_speech_interface(string name) { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_speech_interface(name); + switch_speech_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_speech_interface(cPtr, false); + return ret; + } + + public static switch_asr_interface switch_loadable_module_get_asr_interface(string name) { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_asr_interface(name); + switch_asr_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_asr_interface(cPtr, false); + return ret; + } + + public static switch_directory_interface switch_loadable_module_get_directory_interface(string name) { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_directory_interface(name); + switch_directory_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_directory_interface(cPtr, false); + return ret; + } + + public static switch_chat_interface switch_loadable_module_get_chat_interface(string name) { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_chat_interface(name); + switch_chat_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_chat_interface(cPtr, false); + return ret; + } + + public static switch_say_interface switch_loadable_module_get_say_interface(string name) { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_say_interface(name); + switch_say_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_say_interface(cPtr, false); + return ret; + } + + public static switch_management_interface switch_loadable_module_get_management_interface(string relative_oid) { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_management_interface(relative_oid); + switch_management_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_management_interface(cPtr, false); + return ret; + } + + public static switch_limit_interface switch_loadable_module_get_limit_interface(string name) { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_limit_interface(name); + switch_limit_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_limit_interface(cPtr, false); + return ret; + } + + public static int switch_loadable_module_get_codecs(SWIGTYPE_p_p_switch_codec_implementation array, int arraylen) { + int ret = freeswitchPINVOKE.switch_loadable_module_get_codecs(SWIGTYPE_p_p_switch_codec_implementation.getCPtr(array), arraylen); + return ret; + } + + public static int switch_loadable_module_get_codecs_sorted(SWIGTYPE_p_p_switch_codec_implementation array, int arraylen, ref string prefs, int preflen) { + int ret = freeswitchPINVOKE.switch_loadable_module_get_codecs_sorted(SWIGTYPE_p_p_switch_codec_implementation.getCPtr(array), arraylen, ref prefs, preflen); + return ret; + } + + public static switch_status_t switch_api_execute(string cmd, string arg, SWIGTYPE_p_switch_core_session session, switch_stream_handle stream) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_api_execute(cmd, arg, SWIGTYPE_p_switch_core_session.getCPtr(session), switch_stream_handle.getCPtr(stream)); + return ret; + } + + public static switch_status_t switch_loadable_module_load_module(string dir, string fname, switch_bool_t runtime, ref string err) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_loadable_module_load_module(dir, fname, (int)runtime, ref err); + return ret; + } + + public static switch_status_t switch_loadable_module_exists(string mod) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_loadable_module_exists(mod); + return ret; + } + + public static switch_status_t switch_loadable_module_unload_module(string dir, string fname, switch_bool_t force, ref string err) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_loadable_module_unload_module(dir, fname, (int)force, ref err); + return ret; + } + + public static uint switch_core_codec_next_id() { + uint ret = freeswitchPINVOKE.switch_core_codec_next_id(); + return ret; + } + + public static int switch_check_interval(uint rate, uint ptime) { + int ret = freeswitchPINVOKE.switch_check_interval(rate, ptime); + return ret; + } + + public static void switch_core_codec_add_implementation(SWIGTYPE_p_apr_pool_t pool, switch_codec_interface codec_interface, switch_codec_type_t codec_type, byte ianacode, string iananame, string fmtp, uint samples_per_second, uint actual_samples_per_second, int bits_per_second, int microseconds_per_packet, uint samples_per_packet, uint decoded_bytes_per_packet, uint encoded_bytes_per_packet, byte number_of_channels, int codec_frames_per_packet, SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t init, SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t encode, SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t decode, SWIGTYPE_p_f_p_switch_codec__switch_status_t destroy) { + freeswitchPINVOKE.switch_core_codec_add_implementation(SWIGTYPE_p_apr_pool_t.getCPtr(pool), switch_codec_interface.getCPtr(codec_interface), (int)codec_type, ianacode, iananame, fmtp, samples_per_second, actual_samples_per_second, bits_per_second, microseconds_per_packet, samples_per_packet, decoded_bytes_per_packet, encoded_bytes_per_packet, number_of_channels, codec_frames_per_packet, SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t.getCPtr(init), SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t.getCPtr(encode), SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t.getCPtr(decode), SWIGTYPE_p_f_p_switch_codec__switch_status_t.getCPtr(destroy)); + } + + public static switch_bool_t switch_core_codec_ready(switch_codec codec) { + switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_core_codec_ready(switch_codec.getCPtr(codec)); + return ret; + } + public static void switch_console_loop() { freeswitchPINVOKE.switch_console_loop(); } @@ -7710,6 +7867,207 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_in_thread")] public static extern int switch_core_session_in_thread(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_module_name_set")] + public static extern void switch_loadable_module_interface_module_name_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_module_name_get")] + public static extern string switch_loadable_module_interface_module_name_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_endpoint_interface_set")] + public static extern void switch_loadable_module_interface_endpoint_interface_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_endpoint_interface_get")] + public static extern IntPtr switch_loadable_module_interface_endpoint_interface_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_timer_interface_set")] + public static extern void switch_loadable_module_interface_timer_interface_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_timer_interface_get")] + public static extern IntPtr switch_loadable_module_interface_timer_interface_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_dialplan_interface_set")] + public static extern void switch_loadable_module_interface_dialplan_interface_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_dialplan_interface_get")] + public static extern IntPtr switch_loadable_module_interface_dialplan_interface_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_codec_interface_set")] + public static extern void switch_loadable_module_interface_codec_interface_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_codec_interface_get")] + public static extern IntPtr switch_loadable_module_interface_codec_interface_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_application_interface_set")] + public static extern void switch_loadable_module_interface_application_interface_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_application_interface_get")] + public static extern IntPtr switch_loadable_module_interface_application_interface_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_api_interface_set")] + public static extern void switch_loadable_module_interface_api_interface_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_api_interface_get")] + public static extern IntPtr switch_loadable_module_interface_api_interface_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_file_interface_set")] + public static extern void switch_loadable_module_interface_file_interface_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_file_interface_get")] + public static extern IntPtr switch_loadable_module_interface_file_interface_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_speech_interface_set")] + public static extern void switch_loadable_module_interface_speech_interface_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_speech_interface_get")] + public static extern IntPtr switch_loadable_module_interface_speech_interface_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_directory_interface_set")] + public static extern void switch_loadable_module_interface_directory_interface_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_directory_interface_get")] + public static extern IntPtr switch_loadable_module_interface_directory_interface_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_chat_interface_set")] + public static extern void switch_loadable_module_interface_chat_interface_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_chat_interface_get")] + public static extern IntPtr switch_loadable_module_interface_chat_interface_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_say_interface_set")] + public static extern void switch_loadable_module_interface_say_interface_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_say_interface_get")] + public static extern IntPtr switch_loadable_module_interface_say_interface_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_asr_interface_set")] + public static extern void switch_loadable_module_interface_asr_interface_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_asr_interface_get")] + public static extern IntPtr switch_loadable_module_interface_asr_interface_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_management_interface_set")] + public static extern void switch_loadable_module_interface_management_interface_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_management_interface_get")] + public static extern IntPtr switch_loadable_module_interface_management_interface_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_limit_interface_set")] + public static extern void switch_loadable_module_interface_limit_interface_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_limit_interface_get")] + public static extern IntPtr switch_loadable_module_interface_limit_interface_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_rwlock_set")] + public static extern void switch_loadable_module_interface_rwlock_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_rwlock_get")] + public static extern IntPtr switch_loadable_module_interface_rwlock_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_refs_set")] + public static extern void switch_loadable_module_interface_refs_set(HandleRef jarg1, int jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_refs_get")] + public static extern int switch_loadable_module_interface_refs_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_pool_set")] + public static extern void switch_loadable_module_interface_pool_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_pool_get")] + public static extern IntPtr switch_loadable_module_interface_pool_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_new_switch_loadable_module_interface")] + public static extern IntPtr new_switch_loadable_module_interface(); + + [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_loadable_module_interface")] + public static extern void delete_switch_loadable_module_interface(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_init")] + public static extern int switch_loadable_module_init(); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_shutdown")] + public static extern void switch_loadable_module_shutdown(); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_endpoint_interface")] + public static extern IntPtr switch_loadable_module_get_endpoint_interface(string jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_codec_interface")] + public static extern IntPtr switch_loadable_module_get_codec_interface(string jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_dialplan_interface")] + public static extern IntPtr switch_loadable_module_get_dialplan_interface(string jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_enumerate_available")] + public static extern int switch_loadable_module_enumerate_available(string jarg1, HandleRef jarg2, HandleRef jarg3); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_enumerate_loaded")] + public static extern int switch_loadable_module_enumerate_loaded(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_build_dynamic")] + public static extern int switch_loadable_module_build_dynamic(string jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4, int jarg5); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_timer_interface")] + public static extern IntPtr switch_loadable_module_get_timer_interface(string jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_application_interface")] + public static extern IntPtr switch_loadable_module_get_application_interface(string jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_api_interface")] + public static extern IntPtr switch_loadable_module_get_api_interface(string jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_file_interface")] + public static extern IntPtr switch_loadable_module_get_file_interface(string jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_speech_interface")] + public static extern IntPtr switch_loadable_module_get_speech_interface(string jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_asr_interface")] + public static extern IntPtr switch_loadable_module_get_asr_interface(string jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_directory_interface")] + public static extern IntPtr switch_loadable_module_get_directory_interface(string jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_chat_interface")] + public static extern IntPtr switch_loadable_module_get_chat_interface(string jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_say_interface")] + public static extern IntPtr switch_loadable_module_get_say_interface(string jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_management_interface")] + public static extern IntPtr switch_loadable_module_get_management_interface(string jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_limit_interface")] + public static extern IntPtr switch_loadable_module_get_limit_interface(string jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_codecs")] + public static extern int switch_loadable_module_get_codecs(HandleRef jarg1, int jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_codecs_sorted")] + public static extern int switch_loadable_module_get_codecs_sorted(HandleRef jarg1, int jarg2, ref string jarg3, int jarg4); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_api_execute")] + public static extern int switch_api_execute(string jarg1, string jarg2, HandleRef jarg3, HandleRef jarg4); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_load_module")] + public static extern int switch_loadable_module_load_module(string jarg1, string jarg2, int jarg3, ref string jarg4); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_exists")] + public static extern int switch_loadable_module_exists(string jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_unload_module")] + public static extern int switch_loadable_module_unload_module(string jarg1, string jarg2, int jarg3, ref string jarg4); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_codec_next_id")] + public static extern uint switch_core_codec_next_id(); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_check_interval")] + public static extern int switch_check_interval(uint jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_codec_add_implementation")] + public static extern void switch_core_codec_add_implementation(HandleRef jarg1, HandleRef jarg2, int jarg3, byte jarg4, string jarg5, string jarg6, uint jarg7, uint jarg8, int jarg9, int jarg10, uint jarg11, uint jarg12, uint jarg13, byte jarg14, int jarg15, HandleRef jarg16, HandleRef jarg17, HandleRef jarg18, HandleRef jarg19); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_codec_ready")] + public static extern int switch_core_codec_ready(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_CMD_CHUNK_LEN_get")] public static extern int SWITCH_CMD_CHUNK_LEN_get(); @@ -15527,6 +15885,36 @@ namespace FreeSWITCH.Native { using System; using System.Runtime.InteropServices; +public class SWIGTYPE_p_f_p_void_p_q_const__char__int { + private HandleRef swigCPtr; + + internal SWIGTYPE_p_f_p_void_p_q_const__char__int(IntPtr cPtr, bool futureUse) { + swigCPtr = new HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_f_p_void_p_q_const__char__int() { + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + + internal static HandleRef getCPtr(SWIGTYPE_p_f_p_void_p_q_const__char__int obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.0 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + +using System; +using System.Runtime.InteropServices; + public class SWIGTYPE_p_f_p_void__void { private HandleRef swigCPtr; @@ -16007,6 +16395,36 @@ namespace FreeSWITCH.Native { using System; using System.Runtime.InteropServices; +public class SWIGTYPE_p_p_switch_codec_implementation { + private HandleRef swigCPtr; + + internal SWIGTYPE_p_p_switch_codec_implementation(IntPtr cPtr, bool futureUse) { + swigCPtr = new HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_p_switch_codec_implementation() { + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + + internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_codec_implementation obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.0 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + +using System; +using System.Runtime.InteropServices; + public class SWIGTYPE_p_p_switch_console_callback_match { private HandleRef swigCPtr; @@ -17207,36 +17625,6 @@ namespace FreeSWITCH.Native { using System; using System.Runtime.InteropServices; -public class SWIGTYPE_p_switch_loadable_module_interface { - private HandleRef swigCPtr; - - internal SWIGTYPE_p_switch_loadable_module_interface(IntPtr cPtr, bool futureUse) { - swigCPtr = new HandleRef(this, cPtr); - } - - protected SWIGTYPE_p_switch_loadable_module_interface() { - swigCPtr = new HandleRef(null, IntPtr.Zero); - } - - internal static HandleRef getCPtr(SWIGTYPE_p_switch_loadable_module_interface obj) { - return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; - } -} - -} -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.0 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -namespace FreeSWITCH.Native { - -using System; -using System.Runtime.InteropServices; - public class SWIGTYPE_p_switch_media_bug { private HandleRef swigCPtr; @@ -18021,13 +18409,13 @@ public class switch_api_interface : IDisposable { } } - public SWIGTYPE_p_switch_loadable_module_interface parent { + public switch_loadable_module_interface parent { set { - freeswitchPINVOKE.switch_api_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value)); + freeswitchPINVOKE.switch_api_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value)); } get { IntPtr cPtr = freeswitchPINVOKE.switch_api_interface_parent_get(swigCPtr); - SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false); + switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false); return ret; } } @@ -18203,13 +18591,13 @@ public class switch_application_interface : IDisposable { } } - public SWIGTYPE_p_switch_loadable_module_interface parent { + public switch_loadable_module_interface parent { set { - freeswitchPINVOKE.switch_application_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value)); + freeswitchPINVOKE.switch_application_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value)); } get { IntPtr cPtr = freeswitchPINVOKE.switch_application_interface_parent_get(swigCPtr); - SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false); + switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false); return ret; } } @@ -18701,13 +19089,13 @@ public class switch_asr_interface : IDisposable { } } - public SWIGTYPE_p_switch_loadable_module_interface parent { + public switch_loadable_module_interface parent { set { - freeswitchPINVOKE.switch_asr_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value)); + freeswitchPINVOKE.switch_asr_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value)); } get { IntPtr cPtr = freeswitchPINVOKE.switch_asr_interface_parent_get(swigCPtr); - SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false); + switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false); return ret; } } @@ -20691,13 +21079,13 @@ public class switch_chat_interface : IDisposable { } } - public SWIGTYPE_p_switch_loadable_module_interface parent { + public switch_loadable_module_interface parent { set { - freeswitchPINVOKE.switch_chat_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value)); + freeswitchPINVOKE.switch_chat_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value)); } get { IntPtr cPtr = freeswitchPINVOKE.switch_chat_interface_parent_get(swigCPtr); - SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false); + switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false); return ret; } } @@ -21268,13 +21656,13 @@ public class switch_codec_interface : IDisposable { } } - public SWIGTYPE_p_switch_loadable_module_interface parent { + public switch_loadable_module_interface parent { set { - freeswitchPINVOKE.switch_codec_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value)); + freeswitchPINVOKE.switch_codec_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value)); } get { IntPtr cPtr = freeswitchPINVOKE.switch_codec_interface_parent_get(swigCPtr); - SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false); + switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false); return ret; } } @@ -22477,13 +22865,13 @@ public class switch_dialplan_interface : IDisposable { } } - public SWIGTYPE_p_switch_loadable_module_interface parent { + public switch_loadable_module_interface parent { set { - freeswitchPINVOKE.switch_dialplan_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value)); + freeswitchPINVOKE.switch_dialplan_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value)); } get { IntPtr cPtr = freeswitchPINVOKE.switch_dialplan_interface_parent_get(swigCPtr); - SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false); + switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false); return ret; } } @@ -22931,13 +23319,13 @@ public class switch_directory_interface : IDisposable { } } - public SWIGTYPE_p_switch_loadable_module_interface parent { + public switch_loadable_module_interface parent { set { - freeswitchPINVOKE.switch_directory_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value)); + freeswitchPINVOKE.switch_directory_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value)); } get { IntPtr cPtr = freeswitchPINVOKE.switch_directory_interface_parent_get(swigCPtr); - SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false); + switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false); return ret; } } @@ -23180,13 +23568,13 @@ public class switch_endpoint_interface : IDisposable { } } - public SWIGTYPE_p_switch_loadable_module_interface parent { + public switch_loadable_module_interface parent { set { - freeswitchPINVOKE.switch_endpoint_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value)); + freeswitchPINVOKE.switch_endpoint_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value)); } get { IntPtr cPtr = freeswitchPINVOKE.switch_endpoint_interface_parent_get(swigCPtr); - SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false); + switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false); return ret; } } @@ -24253,13 +24641,13 @@ public class switch_file_interface : IDisposable { } } - public SWIGTYPE_p_switch_loadable_module_interface parent { + public switch_loadable_module_interface parent { set { - freeswitchPINVOKE.switch_file_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value)); + freeswitchPINVOKE.switch_file_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value)); } get { IntPtr cPtr = freeswitchPINVOKE.switch_file_interface_parent_get(swigCPtr); - SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false); + switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false); return ret; } } @@ -26101,13 +26489,13 @@ public class switch_limit_interface : IDisposable { } } - public SWIGTYPE_p_switch_loadable_module_interface parent { + public switch_loadable_module_interface parent { set { - freeswitchPINVOKE.switch_limit_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value)); + freeswitchPINVOKE.switch_limit_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value)); } get { IntPtr cPtr = freeswitchPINVOKE.switch_limit_interface_parent_get(swigCPtr); - SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false); + switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false); return ret; } } @@ -26241,6 +26629,251 @@ public class switch_loadable_module_function_table_t : IDisposable { namespace FreeSWITCH.Native { +using System; +using System.Runtime.InteropServices; + +public class switch_loadable_module_interface : IDisposable { + private HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal switch_loadable_module_interface(IntPtr cPtr, bool cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = new HandleRef(this, cPtr); + } + + internal static HandleRef getCPtr(switch_loadable_module_interface obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } + + ~switch_loadable_module_interface() { + Dispose(); + } + + public virtual void Dispose() { + lock(this) { + if (swigCPtr.Handle != IntPtr.Zero) { + if (swigCMemOwn) { + swigCMemOwn = false; + freeswitchPINVOKE.delete_switch_loadable_module_interface(swigCPtr); + } + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + GC.SuppressFinalize(this); + } + } + + public string module_name { + set { + freeswitchPINVOKE.switch_loadable_module_interface_module_name_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_loadable_module_interface_module_name_get(swigCPtr); + return ret; + } + } + + public switch_endpoint_interface endpoint_interface { + set { + freeswitchPINVOKE.switch_loadable_module_interface_endpoint_interface_set(swigCPtr, switch_endpoint_interface.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_endpoint_interface_get(swigCPtr); + switch_endpoint_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_endpoint_interface(cPtr, false); + return ret; + } + } + + public switch_timer_interface timer_interface { + set { + freeswitchPINVOKE.switch_loadable_module_interface_timer_interface_set(swigCPtr, switch_timer_interface.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_timer_interface_get(swigCPtr); + switch_timer_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_timer_interface(cPtr, false); + return ret; + } + } + + public switch_dialplan_interface dialplan_interface { + set { + freeswitchPINVOKE.switch_loadable_module_interface_dialplan_interface_set(swigCPtr, switch_dialplan_interface.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_dialplan_interface_get(swigCPtr); + switch_dialplan_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_dialplan_interface(cPtr, false); + return ret; + } + } + + public switch_codec_interface codec_interface { + set { + freeswitchPINVOKE.switch_loadable_module_interface_codec_interface_set(swigCPtr, switch_codec_interface.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_codec_interface_get(swigCPtr); + switch_codec_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_codec_interface(cPtr, false); + return ret; + } + } + + public switch_application_interface application_interface { + set { + freeswitchPINVOKE.switch_loadable_module_interface_application_interface_set(swigCPtr, switch_application_interface.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_application_interface_get(swigCPtr); + switch_application_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_application_interface(cPtr, false); + return ret; + } + } + + public switch_api_interface api_interface { + set { + freeswitchPINVOKE.switch_loadable_module_interface_api_interface_set(swigCPtr, switch_api_interface.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_api_interface_get(swigCPtr); + switch_api_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_api_interface(cPtr, false); + return ret; + } + } + + public switch_file_interface file_interface { + set { + freeswitchPINVOKE.switch_loadable_module_interface_file_interface_set(swigCPtr, switch_file_interface.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_file_interface_get(swigCPtr); + switch_file_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_file_interface(cPtr, false); + return ret; + } + } + + public switch_speech_interface speech_interface { + set { + freeswitchPINVOKE.switch_loadable_module_interface_speech_interface_set(swigCPtr, switch_speech_interface.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_speech_interface_get(swigCPtr); + switch_speech_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_speech_interface(cPtr, false); + return ret; + } + } + + public switch_directory_interface directory_interface { + set { + freeswitchPINVOKE.switch_loadable_module_interface_directory_interface_set(swigCPtr, switch_directory_interface.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_directory_interface_get(swigCPtr); + switch_directory_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_directory_interface(cPtr, false); + return ret; + } + } + + public switch_chat_interface chat_interface { + set { + freeswitchPINVOKE.switch_loadable_module_interface_chat_interface_set(swigCPtr, switch_chat_interface.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_chat_interface_get(swigCPtr); + switch_chat_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_chat_interface(cPtr, false); + return ret; + } + } + + public switch_say_interface say_interface { + set { + freeswitchPINVOKE.switch_loadable_module_interface_say_interface_set(swigCPtr, switch_say_interface.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_say_interface_get(swigCPtr); + switch_say_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_say_interface(cPtr, false); + return ret; + } + } + + public switch_asr_interface asr_interface { + set { + freeswitchPINVOKE.switch_loadable_module_interface_asr_interface_set(swigCPtr, switch_asr_interface.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_asr_interface_get(swigCPtr); + switch_asr_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_asr_interface(cPtr, false); + return ret; + } + } + + public switch_management_interface management_interface { + set { + freeswitchPINVOKE.switch_loadable_module_interface_management_interface_set(swigCPtr, switch_management_interface.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_management_interface_get(swigCPtr); + switch_management_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_management_interface(cPtr, false); + return ret; + } + } + + public switch_limit_interface limit_interface { + set { + freeswitchPINVOKE.switch_loadable_module_interface_limit_interface_set(swigCPtr, switch_limit_interface.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_limit_interface_get(swigCPtr); + switch_limit_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_limit_interface(cPtr, false); + return ret; + } + } + + public SWIGTYPE_p_switch_thread_rwlock_t rwlock { + set { + freeswitchPINVOKE.switch_loadable_module_interface_rwlock_set(swigCPtr, SWIGTYPE_p_switch_thread_rwlock_t.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_rwlock_get(swigCPtr); + SWIGTYPE_p_switch_thread_rwlock_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_thread_rwlock_t(cPtr, false); + return ret; + } + } + + public int refs { + set { + freeswitchPINVOKE.switch_loadable_module_interface_refs_set(swigCPtr, value); + } + get { + int ret = freeswitchPINVOKE.switch_loadable_module_interface_refs_get(swigCPtr); + return ret; + } + } + + public SWIGTYPE_p_apr_pool_t pool { + set { + freeswitchPINVOKE.switch_loadable_module_interface_pool_set(swigCPtr, SWIGTYPE_p_apr_pool_t.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_pool_get(swigCPtr); + SWIGTYPE_p_apr_pool_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_apr_pool_t(cPtr, false); + return ret; + } + } + + public switch_loadable_module_interface() : this(freeswitchPINVOKE.new_switch_loadable_module_interface(), true) { + } + +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.0 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + public enum switch_log_level_t { SWITCH_LOG_DEBUG10 = 110, SWITCH_LOG_DEBUG9 = 109, @@ -26518,13 +27151,13 @@ public class switch_management_interface : IDisposable { } } - public SWIGTYPE_p_switch_loadable_module_interface parent { + public switch_loadable_module_interface parent { set { - freeswitchPINVOKE.switch_management_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value)); + freeswitchPINVOKE.switch_management_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value)); } get { IntPtr cPtr = freeswitchPINVOKE.switch_management_interface_parent_get(swigCPtr); - SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false); + switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false); return ret; } } @@ -27586,13 +28219,13 @@ public class switch_say_interface : IDisposable { } } - public SWIGTYPE_p_switch_loadable_module_interface parent { + public switch_loadable_module_interface parent { set { - freeswitchPINVOKE.switch_say_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value)); + freeswitchPINVOKE.switch_say_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value)); } get { IntPtr cPtr = freeswitchPINVOKE.switch_say_interface_parent_get(swigCPtr); - SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false); + switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false); return ret; } } @@ -28273,13 +28906,13 @@ public class switch_speech_interface : IDisposable { } } - public SWIGTYPE_p_switch_loadable_module_interface parent { + public switch_loadable_module_interface parent { set { - freeswitchPINVOKE.switch_speech_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value)); + freeswitchPINVOKE.switch_speech_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value)); } get { IntPtr cPtr = freeswitchPINVOKE.switch_speech_interface_parent_get(swigCPtr); - SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false); + switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false); return ret; } } @@ -29286,13 +29919,13 @@ public class switch_timer_interface : IDisposable { } } - public SWIGTYPE_p_switch_loadable_module_interface parent { + public switch_loadable_module_interface parent { set { - freeswitchPINVOKE.switch_timer_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value)); + freeswitchPINVOKE.switch_timer_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value)); } get { IntPtr cPtr = freeswitchPINVOKE.switch_timer_interface_parent_get(swigCPtr); - SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false); + switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false); return ret; } } From 5f012813efd18fe7e46a359fe80d2c5287a6c6da Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 13 Sep 2010 10:41:27 -0500 Subject: [PATCH 26/63] add quotes to vm_cc command generated internally to escape spaces in the caller id name --- src/mod/applications/mod_voicemail/mod_voicemail.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index 732059aff4..069cfd8d9f 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -3172,7 +3172,7 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p switch_event_destroy(&vars); if (status == SWITCH_STATUS_SUCCESS) { if ((vm_cc = switch_channel_get_variable(channel, "vm_cc"))) { - char *cmd = switch_core_session_sprintf(session, "%s %s %s %s %s@%s %s", + char *cmd = switch_core_session_sprintf(session, "%s %s %s '%s' %s@%s %s", vm_cc, file_path, caller_id_number, caller_id_name, id, domain_name, read_flags); if (voicemail_inject(cmd, session) == SWITCH_STATUS_SUCCESS) { From 403bf6af1c4f0a86424a2f433592f920e3b1c033 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 13 Sep 2010 10:57:52 -0500 Subject: [PATCH 27/63] make sure hold-related code is skipped 100% with disable-hold set --- src/mod/endpoints/mod_sofia/sofia_glue.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 8054c8df73..3dd830937a 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -3590,11 +3590,12 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s if (sofia_test_pflag(tech_pvt->profile, PFLAG_DISABLE_HOLD) || ((val = switch_channel_get_variable(tech_pvt->channel, "sip_disable_hold")) && switch_true(val))) { sendonly = 0; - } + } else { - if (!tech_pvt->hold_laps) { - tech_pvt->hold_laps++; - sofia_glue_toggle_hold(tech_pvt, sendonly); + if (!tech_pvt->hold_laps) { + tech_pvt->hold_laps++; + sofia_glue_toggle_hold(tech_pvt, sendonly); + } } for (m = sdp->sdp_media; m; m = m->m_next) { From a53933eddb2ef33af0b7e4b972744b862eaaeaf4 Mon Sep 17 00:00:00 2001 From: Rupa Schomaker Date: Mon, 13 Sep 2010 12:12:04 -0500 Subject: [PATCH 28/63] NAT refresh in own thread --- src/switch_nat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_nat.c b/src/switch_nat.c index 66d75e8210..536baeedff 100644 --- a/src/switch_nat.c +++ b/src/switch_nat.c @@ -690,7 +690,7 @@ SWITCH_DECLARE(void) switch_nat_late_init(void) { if (nat_globals_perm.running == 1) { switch_scheduler_add_task(switch_epoch_time_now(NULL) + NAT_REFRESH_INTERVAL, switch_nat_republish_sched, "nat_republish", "core", 0, NULL, - SSHF_NONE); + SSHF_OWN_THREAD); } } From 66cec884baae60692f041aab6f73806b4a906a3d Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 13 Sep 2010 12:51:30 -0500 Subject: [PATCH 29/63] fix small presence status bug --- src/mod/endpoints/mod_sofia/sofia_presence.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index 73d930314b..f88920294c 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -1442,7 +1442,7 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * op = switch_event_get_header(helper->event, "Caller-Callee-ID-Number"); } - if (!op) { + if (zstr(op)) { op = switch_event_get_header(helper->event, "Caller-Destination-Number"); } @@ -1452,7 +1452,7 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * if (!strcmp(astate, "early")) { if (zstr(op)) { - switch_snprintf(status_line, sizeof(status_line), "%s %s", what, status); + switch_snprintf(status_line, sizeof(status_line), "%sing", what); } else { switch_snprintf(status_line, sizeof(status_line), "%s %s", what, op); } From 0279261b0bf468f6d36bec6fa5bb359d2c3f17c2 Mon Sep 17 00:00:00 2001 From: Brian West Date: Mon, 13 Sep 2010 13:04:46 -0500 Subject: [PATCH 30/63] default example to resolve some issues with SCA in cases where host and ip are mixed causing the phone to be confused. --- conf/dialplan/default.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/dialplan/default.xml b/conf/dialplan/default.xml index dec163efa9..b143280fba 100644 --- a/conf/dialplan/default.xml +++ b/conf/dialplan/default.xml @@ -263,7 +263,7 @@ - + From b77518685cffcf59a4a26ae3bcde9b0d7a5cb75b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 13 Sep 2010 15:27:10 -0500 Subject: [PATCH 31/63] make fore-subscription-expires only work on nonzero expire deltas, 0 means unscubscribe --- src/mod/endpoints/mod_sofia/sofia_presence.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index f88920294c..5eb71b37e9 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -2043,7 +2043,11 @@ void sofia_presence_handle_sip_i_subscribe(int status, from_host = "n/a"; } - exp_delta = profile->force_subscription_expires ? profile->force_subscription_expires : (sip->sip_expires ? sip->sip_expires->ex_delta : 3600); + if ((exp_delta = sip->sip_expires ? sip->sip_expires->ex_delta : 3600)) { + if (profile->force_subscription_expires) { + exp_delta = profile->force_subscription_expires; + } + } if (exp_delta) { exp_abs = (long) switch_epoch_time_now(NULL) + exp_delta; From 6f2c455f929946c1eb5310e8f0df3b8cffd911ac Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 14 Sep 2010 11:48:43 -0500 Subject: [PATCH 32/63] add tone2wav --- Makefile.am | 10 +- libs/freetdm/src/libteletone_generate.c | 20 +- libs/libteletone/src/libteletone_generate.c | 12 +- src/include/switch_loadable_module.h | 2 +- src/include/switch_types.h | 3 +- src/switch_core.c | 5 +- src/switch_loadable_module.c | 4 +- src/switch_rtp.c | 4 + src/tone2wav.c | 193 ++++++++++++++++++++ 9 files changed, 232 insertions(+), 21 deletions(-) create mode 100644 src/tone2wav.c diff --git a/Makefile.am b/Makefile.am index a26346277a..077dfeccdf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -267,7 +267,7 @@ src/include/switch_swigable_cpp.h: $(switch_srcdir)/src/include/switch_cpp.h ## ## Applications ## -bin_PROGRAMS = freeswitch fs_cli fs_ivrd +bin_PROGRAMS = freeswitch fs_cli fs_ivrd tone2wav ## ## fs_cli () @@ -281,6 +281,14 @@ fs_cli_CFLAGS += -DHAVE_EDITLINE -I$(switch_srcdir)/libs/libedit/src fs_cli_LDADD = libs/libedit/src/.libs/libedit.a endif +## +## tone2wav () +## +tone2wav_SOURCES = src/tone2wav.c +tone2wav_CFLAGS = $(AM_CFLAGS) +tone2wav_LDFLAGS = $(AM_LDFLAGS) -lm +tone2wav_LDADD = libfreeswitch.la + ## ## fs_ivrd () ## diff --git a/libs/freetdm/src/libteletone_generate.c b/libs/freetdm/src/libteletone_generate.c index 089268bc7b..3abbebba2e 100644 --- a/libs/freetdm/src/libteletone_generate.c +++ b/libs/freetdm/src/libteletone_generate.c @@ -244,7 +244,7 @@ TELETONE_API(int) teletone_mux_tones(teletone_generation_session_t *ts, teletone if (ts->debug && ts->debug_stream) { if (map->freqs[0] <= 0) { - fprintf(ts->debug_stream, "wait %d (%dms)\n", wait, wait / (ts->rate / 1000)); + fprintf(ts->debug_stream, "wait %d (%dms)\n", wait, wait / (ts->rate / 1000 / ts->channels ? ts->channels : 1)); } else { fprintf(ts->debug_stream, "Generate: ("); @@ -256,14 +256,14 @@ TELETONE_API(int) teletone_mux_tones(teletone_generation_session_t *ts, teletone ") [volume %0.2fdB; samples %d(%dms) x %d channel%s; wait %d(%dms); decay_factor %0.2fdB; decay_step %d(%dms); wrote %d bytes]\n", ts->volume, duration, - duration / (ts->rate / 1000), + duration / (ts->rate / 1000 / ts->channels ? ts->channels : 1), ts->channels, ts->channels == 1 ? "" : "s", wait, - wait / (ts->rate / 1000), + wait / (ts->rate / 1000 / ts->channels ? ts->channels : 1), ts->decay_factor, ts->decay_step, - ts->decay_step / (ts->rate / 1000), + ts->decay_step / (ts->rate / 1000 / ts->channels ? ts->channels : 1), ts->samples * 2); } } @@ -307,7 +307,7 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm ts->rate = atoi(cur + 2); break; case 'd': - ts->duration = atoi(cur + 2) * (ts->rate / 1000); + ts->duration = atoi(cur + 2) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); break; case 'v': { @@ -318,18 +318,18 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm } break; case '>': - ts->decay_step = atoi(cur + 2) * (ts->rate / 1000); + ts->decay_step = atoi(cur + 2) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); ts->decay_direction = -1; break; case '<': - ts->decay_step = atoi(cur + 2) * (ts->rate / 1000); + ts->decay_step = atoi(cur + 2) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); ts->decay_direction = 1; break; case '+': ts->decay_factor = (float)atof(cur + 2); break; case 'w': - ts->wait = atoi(cur + 2) * (ts->rate / 1000); + ts->wait = atoi(cur + 2) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); break; case 'l': ts->loops = atoi(cur + 2); @@ -369,10 +369,10 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm *next++ = '\0'; } if (i == 0) { - ts->tmp_duration = atoi(p) * (ts->rate / 1000); + ts->tmp_duration = atoi(p) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); i++; } else if (i == 1) { - ts->tmp_wait = atoi(p) * (ts->rate / 1000); + ts->tmp_wait = atoi(p) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); i++; } else { mymap.freqs[i++ - 2] = atof(p); diff --git a/libs/libteletone/src/libteletone_generate.c b/libs/libteletone/src/libteletone_generate.c index 911e3c2797..1608f47bb7 100644 --- a/libs/libteletone/src/libteletone_generate.c +++ b/libs/libteletone/src/libteletone_generate.c @@ -355,7 +355,7 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm ts->rate = atoi(cur + 2); break; case 'd': - ts->duration = atoi(cur + 2) * (ts->rate / 1000); + ts->duration = atoi(cur + 2) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); break; case 'v': { @@ -366,18 +366,18 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm } break; case '>': - ts->decay_step = atoi(cur + 2) * (ts->rate / 1000); + ts->decay_step = atoi(cur + 2) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); ts->decay_direction = -1; break; case '<': - ts->decay_step = atoi(cur + 2) * (ts->rate / 1000); + ts->decay_step = atoi(cur + 2) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); ts->decay_direction = 1; break; case '+': ts->decay_factor = (float)atof(cur + 2); break; case 'w': - ts->wait = atoi(cur + 2) * (ts->rate / 1000); + ts->wait = atoi(cur + 2) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); break; case 'l': ts->loops = atoi(cur + 2); @@ -417,10 +417,10 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm *next++ = '\0'; } if (i == 0) { - ts->tmp_duration = atoi(p) * (ts->rate / 1000); + ts->tmp_duration = atoi(p) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); i++; } else if (i == 1) { - ts->tmp_wait = atoi(p) * (ts->rate / 1000); + ts->tmp_wait = atoi(p) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); i++; } else { mymap.freqs[i++ - 2] = atof(p); diff --git a/src/include/switch_loadable_module.h b/src/include/switch_loadable_module.h index 68719062b7..37c752bd3e 100644 --- a/src/include/switch_loadable_module.h +++ b/src/include/switch_loadable_module.h @@ -92,7 +92,7 @@ SWITCH_BEGIN_EXTERN_C \brief Initilize the module backend and load all the modules \return SWITCH_STATUS_SUCCESS when complete */ -SWITCH_DECLARE(switch_status_t) switch_loadable_module_init(void); +SWITCH_DECLARE(switch_status_t) switch_loadable_module_init(switch_bool_t autoload); /*! \brief Shutdown the module backend and call the shutdown routine in all loaded modules diff --git a/src/include/switch_types.h b/src/include/switch_types.h index c3b649cb68..b0395bafdc 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -255,7 +255,8 @@ typedef enum { SCF_USE_CLOCK_RT = (1 << 10), SCF_VERBOSE_EVENTS = (1 << 11), SCF_USE_WIN32_MONOTONIC = (1 << 12), - SCF_AUTO_SCHEMAS = (1 << 13) + SCF_AUTO_SCHEMAS = (1 << 13), + SCF_MINIMAL = (1 << 14) } switch_core_flag_enum_t; typedef uint32_t switch_core_flag_t; diff --git a/src/switch_core.c b/src/switch_core.c index 4bfc02e655..0a45723870 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -1315,6 +1315,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc switch_log_init(runtime.memory_pool, runtime.colorize_console); + if (flags & SCF_MINIMAL) return SWITCH_STATUS_SUCCESS; + runtime.tipping_point = 5000; runtime.timer_affinity = -1; @@ -1594,7 +1596,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(switch_core_flag_t switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Bringing up environment.\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Loading Modules.\n"); - if (switch_loadable_module_init() != SWITCH_STATUS_SUCCESS) { + if (switch_loadable_module_init(SWITCH_TRUE) != SWITCH_STATUS_SUCCESS) { *err = "Cannot load modules"; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Error: %s\n", *err); return SWITCH_STATUS_GENERR; @@ -1902,6 +1904,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_destroy(void) switch_scheduler_task_thread_stop(); switch_rtp_shutdown(); + if (switch_test_flag((&runtime), SCF_USE_AUTO_NAT)) { switch_nat_shutdown(); } diff --git a/src/switch_loadable_module.c b/src/switch_loadable_module.c index bf636dd4c2..d23b4226e3 100644 --- a/src/switch_loadable_module.c +++ b/src/switch_loadable_module.c @@ -1218,7 +1218,7 @@ static void switch_loadable_module_path_init() } #endif -SWITCH_DECLARE(switch_status_t) switch_loadable_module_init() +SWITCH_DECLARE(switch_status_t) switch_loadable_module_init(switch_bool_t autoload) { apr_finfo_t finfo = { 0 }; @@ -1268,6 +1268,8 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_init() switch_core_hash_init_nocase(&loadable_modules.dialplan_hash, loadable_modules.pool); switch_mutex_init(&loadable_modules.mutex, SWITCH_MUTEX_NESTED, loadable_modules.pool); + if (!autoload) return SWITCH_STATUS_SUCCESS; + switch_loadable_module_load_module("", "CORE_SOFTTIMER_MODULE", SWITCH_FALSE, &err); switch_loadable_module_load_module("", "CORE_PCM_MODULE", SWITCH_FALSE, &err); diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 710415afdb..969309ec89 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -662,6 +662,10 @@ SWITCH_DECLARE(void) switch_rtp_shutdown(void) const void *var; void *val; + if (!global_init) { + return; + } + switch_mutex_lock(port_lock); for (hi = switch_hash_first(NULL, alloc_hash); hi; hi = switch_hash_next(hi)) { diff --git a/src/tone2wav.c b/src/tone2wav.c new file mode 100644 index 0000000000..bf51e3a566 --- /dev/null +++ b/src/tone2wav.c @@ -0,0 +1,193 @@ +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2005-2010, Anthony Minessale II + * + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * + * The Initial Developer of the Original Code is + * Anthony Minessale II + * Portions created by the Initial Developer are Copyright (C) + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Anthony Minessale II + * Michael Jerris + * Pawel Pierscionek + * Bret McDanel + * + * + * tone2wav.c -- Generate a .wav from teletone spec + * + */ + +#ifndef _XOPEN_SOURCE +#define _XOPEN_SOURCE 600 +#endif + +#ifndef WIN32 +#ifdef HAVE_SETRLIMIT +#include +#endif +#endif + +#include +#include + + + +/* Picky compiler */ +#ifdef __ICC +#pragma warning (disable:167) +#endif + + +static int teletone_handler(teletone_generation_session_t *ts, teletone_tone_map_t *map) +{ + switch_file_handle_t *fh = (switch_file_handle_t *) ts->user_data; + int wrote; + switch_size_t len; + + wrote = teletone_mux_tones(ts, map); + + len = wrote; + if (switch_core_file_write(fh, ts->buffer, &len) != SWITCH_STATUS_SUCCESS) { + return -1; + } + + return 0; +} + +#define fail() r = 255; goto end + +/* the main application entry point */ +int main(int argc, char *argv[]) +{ + teletone_generation_session_t ts; + int file_flags = SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT; + int r = 0; + int rate = 8000; + char *file = NULL, *script = NULL; + switch_file_handle_t fh = { 0 }; + const char *err = NULL; + switch_bool_t verbose = SWITCH_FALSE; + int i = 0, c = 1, help = 0; + + for(i = 1; i < argc; i++) { + if (!strstr(argv[i], "-")) break; + + if (!strcmp(argv[i], "-v")) { + verbose = SWITCH_TRUE; + } + + if (!strcmp(argv[i], "-s")) { + c = 2; + } + + if (!strcmp(argv[i], "-h")) { + help = 1; + } + + if (!strncmp(argv[i], "-R", 2)) { + char *p = argv[i] + 2; + + if (p) { + int tmp = atoi(p); + if (tmp > 0) { + rate = tmp; + } + } + } + } + + if (argc - i != 2 || help) { + char *app = NULL; + + if (!help) printf("Invalid input!\n"); + + if ((app = strrchr(argv[0], '/'))) { + app++; + } else { + app = argv[0]; + } + + + printf("USAGE: %s [options] \n", app); + printf("================================================================================\n"); + printf("Options:\n" + "-s\t\tStereo\n" + "-h\t\tHelp\n" + "-R\tSet Rate (8000,16000,32000,48000) etc.\n" + "-v\t\tVerbose Logging\n" + "\t\tAny file supported by libsndfile\n" + "\t\tA valid teletone script http://wiki.freeswitch.org/wiki/TGML" + "\n\n\n" + ); + return 255; + } + + file = argv[i]; + script = argv[i+1]; + + if (switch_core_init(SCF_MINIMAL, verbose, &err) != SWITCH_STATUS_SUCCESS) { + printf("Cannot init core [%s]\n", err); + fail(); + } + + switch_loadable_module_init(SWITCH_FALSE); + + if (switch_loadable_module_load_module((char *) SWITCH_GLOBAL_dirs.mod_dir, (char *) "mod_sndfile", SWITCH_TRUE, &err) != SWITCH_STATUS_SUCCESS) { + printf("Cannot init mod_sndfile [%s]\n", err); + fail(); + } + + if (switch_core_file_open(&fh, file, c, rate, file_flags, NULL) != SWITCH_STATUS_SUCCESS) { + printf("Cannot open file %s\n", file); + fail(); + } + + teletone_init_session(&ts, 0, teletone_handler, &fh); + ts.rate = rate; + ts.channels = c; + ts.duration = 250 * (rate / 1000 / c); + ts.wait = 50 * (rate / 1000 / c); + if (verbose) { + ts.debug = 10; + ts.debug_stream = stdout; + } + teletone_run(&ts, script); + teletone_destroy_session(&ts); + switch_core_file_close(&fh); + + printf("File: %s generated.....\nPlease support:\n\nFreeSWITCH http://www.freeswitch.org\nClueCon http://www.cluecon.com\n", file); + + end: + + switch_core_destroy(); + + return r; + +} + +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:t + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4: + */ From 74430cb3c6e298d07b43ad152ffaeee56a722312 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 14 Sep 2010 12:00:46 -0500 Subject: [PATCH 33/63] doh --- libs/freetdm/src/libteletone_generate.c | 20 ++++++++++---------- libs/libteletone/src/libteletone_generate.c | 12 ++++++------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/libs/freetdm/src/libteletone_generate.c b/libs/freetdm/src/libteletone_generate.c index 3abbebba2e..089268bc7b 100644 --- a/libs/freetdm/src/libteletone_generate.c +++ b/libs/freetdm/src/libteletone_generate.c @@ -244,7 +244,7 @@ TELETONE_API(int) teletone_mux_tones(teletone_generation_session_t *ts, teletone if (ts->debug && ts->debug_stream) { if (map->freqs[0] <= 0) { - fprintf(ts->debug_stream, "wait %d (%dms)\n", wait, wait / (ts->rate / 1000 / ts->channels ? ts->channels : 1)); + fprintf(ts->debug_stream, "wait %d (%dms)\n", wait, wait / (ts->rate / 1000)); } else { fprintf(ts->debug_stream, "Generate: ("); @@ -256,14 +256,14 @@ TELETONE_API(int) teletone_mux_tones(teletone_generation_session_t *ts, teletone ") [volume %0.2fdB; samples %d(%dms) x %d channel%s; wait %d(%dms); decay_factor %0.2fdB; decay_step %d(%dms); wrote %d bytes]\n", ts->volume, duration, - duration / (ts->rate / 1000 / ts->channels ? ts->channels : 1), + duration / (ts->rate / 1000), ts->channels, ts->channels == 1 ? "" : "s", wait, - wait / (ts->rate / 1000 / ts->channels ? ts->channels : 1), + wait / (ts->rate / 1000), ts->decay_factor, ts->decay_step, - ts->decay_step / (ts->rate / 1000 / ts->channels ? ts->channels : 1), + ts->decay_step / (ts->rate / 1000), ts->samples * 2); } } @@ -307,7 +307,7 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm ts->rate = atoi(cur + 2); break; case 'd': - ts->duration = atoi(cur + 2) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); + ts->duration = atoi(cur + 2) * (ts->rate / 1000); break; case 'v': { @@ -318,18 +318,18 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm } break; case '>': - ts->decay_step = atoi(cur + 2) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); + ts->decay_step = atoi(cur + 2) * (ts->rate / 1000); ts->decay_direction = -1; break; case '<': - ts->decay_step = atoi(cur + 2) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); + ts->decay_step = atoi(cur + 2) * (ts->rate / 1000); ts->decay_direction = 1; break; case '+': ts->decay_factor = (float)atof(cur + 2); break; case 'w': - ts->wait = atoi(cur + 2) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); + ts->wait = atoi(cur + 2) * (ts->rate / 1000); break; case 'l': ts->loops = atoi(cur + 2); @@ -369,10 +369,10 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm *next++ = '\0'; } if (i == 0) { - ts->tmp_duration = atoi(p) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); + ts->tmp_duration = atoi(p) * (ts->rate / 1000); i++; } else if (i == 1) { - ts->tmp_wait = atoi(p) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); + ts->tmp_wait = atoi(p) * (ts->rate / 1000); i++; } else { mymap.freqs[i++ - 2] = atof(p); diff --git a/libs/libteletone/src/libteletone_generate.c b/libs/libteletone/src/libteletone_generate.c index 1608f47bb7..911e3c2797 100644 --- a/libs/libteletone/src/libteletone_generate.c +++ b/libs/libteletone/src/libteletone_generate.c @@ -355,7 +355,7 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm ts->rate = atoi(cur + 2); break; case 'd': - ts->duration = atoi(cur + 2) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); + ts->duration = atoi(cur + 2) * (ts->rate / 1000); break; case 'v': { @@ -366,18 +366,18 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm } break; case '>': - ts->decay_step = atoi(cur + 2) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); + ts->decay_step = atoi(cur + 2) * (ts->rate / 1000); ts->decay_direction = -1; break; case '<': - ts->decay_step = atoi(cur + 2) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); + ts->decay_step = atoi(cur + 2) * (ts->rate / 1000); ts->decay_direction = 1; break; case '+': ts->decay_factor = (float)atof(cur + 2); break; case 'w': - ts->wait = atoi(cur + 2) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); + ts->wait = atoi(cur + 2) * (ts->rate / 1000); break; case 'l': ts->loops = atoi(cur + 2); @@ -417,10 +417,10 @@ TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cm *next++ = '\0'; } if (i == 0) { - ts->tmp_duration = atoi(p) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); + ts->tmp_duration = atoi(p) * (ts->rate / 1000); i++; } else if (i == 1) { - ts->tmp_wait = atoi(p) * (ts->rate / 1000 / ts->channels ? ts->channels : 1); + ts->tmp_wait = atoi(p) * (ts->rate / 1000); i++; } else { mymap.freqs[i++ - 2] = atof(p); From d31c24dcb3f4ebbdcaaa2744657f61680fa8d02d Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 14 Sep 2010 12:16:14 -0500 Subject: [PATCH 34/63] thats better --- libs/freetdm/src/libteletone_generate.c | 2 +- libs/libteletone/src/libteletone_generate.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/freetdm/src/libteletone_generate.c b/libs/freetdm/src/libteletone_generate.c index 089268bc7b..7f37b7a258 100644 --- a/libs/freetdm/src/libteletone_generate.c +++ b/libs/freetdm/src/libteletone_generate.c @@ -267,7 +267,7 @@ TELETONE_API(int) teletone_mux_tones(teletone_generation_session_t *ts, teletone ts->samples * 2); } } - return ts->samples; + return ts->samples / ts->channels; } TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cmd) diff --git a/libs/libteletone/src/libteletone_generate.c b/libs/libteletone/src/libteletone_generate.c index 911e3c2797..8098e3605c 100644 --- a/libs/libteletone/src/libteletone_generate.c +++ b/libs/libteletone/src/libteletone_generate.c @@ -302,7 +302,7 @@ TELETONE_API(int) teletone_mux_tones(teletone_generation_session_t *ts, teletone ts->samples * 2); } } - return ts->samples; + return ts->samples / ts->channels; } /* don't ask */ From 8ea90fb17aa89af353e7ddf16b908436780f2322 Mon Sep 17 00:00:00 2001 From: Marc Olivier Chouinard Date: Tue, 14 Sep 2010 15:30:36 -0400 Subject: [PATCH 35/63] switch_core_sqldb: Simple spelling correction of log output --- src/switch_core_sqldb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c index 51e7661761..b1815b0f22 100644 --- a/src/switch_core_sqldb.c +++ b/src/switch_core_sqldb.c @@ -346,7 +346,7 @@ SWITCH_DECLARE(switch_status_t) _switch_cache_db_get_db_handle(switch_cache_db_h { if (!switch_odbc_available()) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Failure! OBDC NOT AVAILABLE!\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Failure! ODBC NOT AVAILABLE!\n"); goto end; } From ef79535c45fde4a01e6df7e7ca28633649949c7b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 14 Sep 2010 16:19:03 -0500 Subject: [PATCH 36/63] add nitrus boost to sql thread --- src/include/private/switch_core_pvt.h | 2 + src/mod/endpoints/mod_sofia/sofia.c | 50 +++++++++------ src/switch_core.c | 34 ++++++++++- src/switch_core_sqldb.c | 88 ++++++++++++++++----------- 4 files changed, 116 insertions(+), 58 deletions(-) diff --git a/src/include/private/switch_core_pvt.h b/src/include/private/switch_core_pvt.h index 50dde95dc7..e77d5f74ef 100644 --- a/src/include/private/switch_core_pvt.h +++ b/src/include/private/switch_core_pvt.h @@ -233,6 +233,8 @@ struct switch_runtime { switch_profile_timer_t *profile_timer; double profile_time; double min_idle_time; + int sql_buffer_len; + int max_sql_buffer_len; }; extern struct switch_runtime runtime; diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 4d9ce9eea5..2ae5048b06 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -1225,7 +1225,7 @@ static void sofia_perform_profile_start_failure(sofia_profile_t *profile, char * #define sofia_profile_start_failure(p, xp) sofia_perform_profile_start_failure(p, xp, __FILE__, __LINE__) -#define SQLLEN 1024 * 32 +#define SQLLEN 1024 * 1024 void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread, void *obj) { sofia_profile_t *profile = (sofia_profile_t *) obj; @@ -1235,10 +1235,10 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread uint32_t qsize; void *pop; int loop_count = 0; - switch_size_t sql_len = SQLLEN; - char *sqlbuf = NULL; + switch_size_t sql_len = 1024 * 32; + char *tmp, *sqlbuf = NULL; char *sql = NULL; - + if (sofia_test_pflag(profile, PFLAG_SQL_IN_TRANS)) { sqlbuf = (char *) malloc(sql_len); } @@ -1254,33 +1254,43 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread while ((mod_sofia_globals.running == 1 && sofia_test_pflag(profile, PFLAG_RUNNING)) || qsize) { if (sofia_test_pflag(profile, PFLAG_SQL_IN_TRANS)) { - if ((qsize > 0 && (qsize >= 1024 || ++loop_count >= profile->trans_timeout)) || sql) { + if (qsize > 0 && (qsize >= 1024 || ++loop_count >= profile->trans_timeout)) { switch_size_t newlen; uint32_t itterations = 0; switch_size_t len = 0; switch_mutex_lock(profile->ireg_mutex); - //sofia_glue_actually_execute_sql(profile, "begin;\n", NULL); - while (sql || (switch_queue_trypop(profile->sql_queue, &pop) == SWITCH_STATUS_SUCCESS && pop)) { - - if (!sql) { - sql = (char *) pop; - } - + if (!sql) sql = (char *) pop; + newlen = strlen(sql) + 2; itterations++; - - if (len + newlen + 10 < sql_len) { - sprintf(sqlbuf + len, "%s;\n", sql); - len += newlen; - switch_safe_free(sql); - } else { - break; + + if (len + newlen + 10 > sql_len) { + int new_mlen = len + newlen + 10 + 10240; + + if (new_mlen < SQLLEN) { + sql_len = new_mlen; + + if (!(tmp = realloc(sqlbuf, sql_len))) { + abort(); + break; + } + sqlbuf = tmp; + } else { + goto skip; + } } + + sprintf(sqlbuf + len, "%s;\n", sql); + len += newlen; + free(sql); + sql = NULL; } - + + skip: + //printf("TRANS:\n%s\n", sqlbuf); sofia_glue_actually_execute_sql_trans(profile, sqlbuf, NULL); //sofia_glue_actually_execute_sql(profile, "commit;\n", NULL); diff --git a/src/switch_core.c b/src/switch_core.c index 0a45723870..2c33b341de 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -1222,7 +1222,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc } runtime.runlevel++; - + runtime.sql_buffer_len = 1024 * 32; + runtime.max_sql_buffer_len = 1024 * 1024; runtime.dummy_cng_frame.data = runtime.dummy_data; runtime.dummy_cng_frame.datalen = sizeof(runtime.dummy_data); runtime.dummy_cng_frame.buflen = sizeof(runtime.dummy_data); @@ -1440,6 +1441,37 @@ static void switch_load_core_config(const char *file) if (tmp > -1 && tmp < 11) { switch_core_session_ctl(SCSC_DEBUG_LEVEL, &tmp); } + } else if (!strcasecmp(var, "sql-buffer-len")) { + int tmp = atoi(val); + + if (end_of(val) == 'k') { + tmp *= 1024; + } else if (end_of(val) == 'm') { + tmp *= (1024 * 1024); + } + + if (tmp >= 32000 && tmp < 10500000) { + runtime.sql_buffer_len = tmp; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "sql-buffer-len: Value is not within rage 32k to 10m\n"); + } + } else if (!strcasecmp(var, "max-sql-buffer-len")) { + int tmp = atoi(val); + + if (end_of(val) == 'k') { + tmp *= 1024; + } else if (end_of(val) == 'm') { + tmp *= (1024 * 1024); + } + + if (tmp < runtime.sql_buffer_len) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Value is not larger than sql-buffer-len\n"); + } else if (tmp >= 32000 && tmp < 10500000) { + runtime.sql_buffer_len = tmp; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "max-sql-buffer-len: Value is not within rage 32k to 10m\n"); + } + } else if (!strcasecmp(var, "auto-create-schemas")) { if (switch_true(val)) { switch_set_flag((&runtime), SCF_AUTO_SCHEMAS); diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c index b1815b0f22..dfb4134b9b 100644 --- a/src/switch_core_sqldb.c +++ b/src/switch_core_sqldb.c @@ -35,8 +35,6 @@ #include #include "private/switch_core_pvt.h" -#define SQLLEN 32768 - static struct { switch_cache_db_handle_t *event_db; switch_queue_t *sql_queue[2]; @@ -48,6 +46,8 @@ static struct { switch_mutex_t *io_mutex; switch_mutex_t *dbh_mutex; switch_hash_t *dbh_hash; + switch_thread_cond_t *cond; + switch_mutex_t *cond_mutex; } sql_manager; @@ -539,7 +539,7 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_execute_sql(switch_cache_db_hand switch (dbh->type) { default: { - status = switch_cache_db_execute_sql_chunked(dbh, (char *) sql, SQLLEN, err); + status = switch_cache_db_execute_sql_chunked(dbh, (char *) sql, 32768, err); } break; } @@ -850,19 +850,18 @@ SWITCH_DECLARE(switch_bool_t) switch_cache_db_test_reactive(switch_cache_db_hand static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread, void *obj) { - void *pop = NULL; + void *pop; uint32_t itterations = 0; - uint8_t trans = 0, nothing_in_queue = 0; - uint32_t target = 100000; - switch_size_t len = 0, sql_len = SQLLEN; - char *sqlbuf = (char *) malloc(sql_len); + uint8_t trans = 0; + uint32_t target = 20000; + switch_size_t len = 0, sql_len = runtime.sql_buffer_len; + char *tmp, *sqlbuf = (char *) malloc(sql_len); char *sql = NULL; switch_size_t newlen; int lc = 0; uint32_t loops = 0, sec = 0; uint32_t l1 = 1000; uint32_t sanity = 120; - int item_remained = 0; switch_assert(sqlbuf); @@ -887,6 +886,9 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread, sql_manager.thread_running = 1; while (sql_manager.thread_running == 1) { + + switch_mutex_lock(sql_manager.cond_mutex); + if (++loops == l1) { if (++sec == SQL_CACHE_TIMEOUT) { sql_close(switch_epoch_time_now(NULL)); @@ -900,17 +902,11 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread, continue; } - //printf("SIZE %d %d\n", switch_queue_size(sql_manager.sql_queue[0]), switch_queue_size(sql_manager.sql_queue[1])); - - if (item_remained || switch_queue_trypop(sql_manager.sql_queue[0], &pop) == SWITCH_STATUS_SUCCESS || + if (sql || switch_queue_trypop(sql_manager.sql_queue[0], &pop) == SWITCH_STATUS_SUCCESS || switch_queue_trypop(sql_manager.sql_queue[1], &pop) == SWITCH_STATUS_SUCCESS) { - if (item_remained) { - item_remained = 0; - } else { - sql = (char *) pop; - } - + if (!sql) sql = (char *) pop; + if (sql) { newlen = strlen(sql) + 2; @@ -918,45 +914,59 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread, trans = 1; } - /* ignore abnormally large strings sql strings as potential buffer overflow */ - if (newlen < SQLLEN) { - itterations++; + if (len + newlen > sql_len) { + int new_mlen = len + newlen + 10240; - if (len + newlen < sql_len) { - sprintf(sqlbuf + len, "%s;\n", sql); - len += newlen; + if (new_mlen < runtime.max_sql_buffer_len) { + sql_len = new_mlen; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, + "REALLOC %ld %d %d\n", sql_len, switch_queue_size(sql_manager.sql_queue[0]), + switch_queue_size(sql_manager.sql_queue[1])); + if (!(tmp = realloc(sqlbuf, sql_len))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "SQL thread ending on mem err\n"); + abort(); + break; + } + sqlbuf = tmp; } else { - item_remained = 1; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, + "SAVE %d %d\n", switch_queue_size(sql_manager.sql_queue[0]), switch_queue_size(sql_manager.sql_queue[1])); + goto skip; } } - - if (!item_remained) { - free(sql); - } + + itterations++; + sprintf(sqlbuf + len, "%s;\n", sql); + len += newlen; + free(sql); + sql = NULL; } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "SQL thread ending\n"); break; } - } else { - nothing_in_queue = 1; } - - if ((item_remained || (trans && ((itterations == target) || (nothing_in_queue && ++lc >= 500)))) && - (sql_manager.event_db->native_handle.core_db_dbh)) { + skip: + + lc = sql ? 1 : 0 + switch_queue_size(sql_manager.sql_queue[0]) + switch_queue_size(sql_manager.sql_queue[1]); + + if (trans && itterations && (itterations > target || !lc)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, + "RUN %d %d %d\n", switch_queue_size(sql_manager.sql_queue[0]), switch_queue_size(sql_manager.sql_queue[1]), itterations); if (switch_cache_db_persistant_execute_trans(sql_manager.event_db, sqlbuf, 1) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "SQL thread unable to commit transaction, records lost!\n"); } + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "DONE\n"); itterations = 0; trans = 0; - nothing_in_queue = 0; len = 0; *sqlbuf = '\0'; lc = 0; + switch_yield(400000); } - if (nothing_in_queue) { - switch_cond_next(); + if (!lc) { + switch_thread_cond_wait(sql_manager.cond, sql_manager.cond_mutex); } } @@ -1389,6 +1399,7 @@ static void core_event_handler(switch_event_t *event) switch_queue_push(sql_manager.sql_queue[0], sql[i]); } sql[i] = NULL; + switch_thread_cond_broadcast(sql_manager.cond); } } } @@ -1511,6 +1522,9 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_ switch_mutex_init(&sql_manager.dbh_mutex, SWITCH_MUTEX_NESTED, sql_manager.memory_pool); switch_mutex_init(&sql_manager.io_mutex, SWITCH_MUTEX_NESTED, sql_manager.memory_pool); + switch_mutex_init(&sql_manager.cond_mutex, SWITCH_MUTEX_NESTED, sql_manager.memory_pool); + + switch_thread_cond_create(&sql_manager.cond, sql_manager.memory_pool); switch_core_hash_init(&sql_manager.dbh_hash, sql_manager.memory_pool); From 6e23f3bef611c974433ed98348affde23f732b2b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 14 Sep 2010 16:22:21 -0500 Subject: [PATCH 37/63] fix spelling err --- src/mod/endpoints/mod_sofia/sofia.c | 4 ++-- src/switch_core_sqldb.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 2ae5048b06..dd376981ab 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -1256,7 +1256,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread if (sofia_test_pflag(profile, PFLAG_SQL_IN_TRANS)) { if (qsize > 0 && (qsize >= 1024 || ++loop_count >= profile->trans_timeout)) { switch_size_t newlen; - uint32_t itterations = 0; + uint32_t iterations = 0; switch_size_t len = 0; switch_mutex_lock(profile->ireg_mutex); @@ -1265,7 +1265,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread if (!sql) sql = (char *) pop; newlen = strlen(sql) + 2; - itterations++; + iterations++; if (len + newlen + 10 > sql_len) { int new_mlen = len + newlen + 10 + 10240; diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c index dfb4134b9b..5772e9f94d 100644 --- a/src/switch_core_sqldb.c +++ b/src/switch_core_sqldb.c @@ -851,7 +851,7 @@ SWITCH_DECLARE(switch_bool_t) switch_cache_db_test_reactive(switch_cache_db_hand static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread, void *obj) { void *pop; - uint32_t itterations = 0; + uint32_t iterations = 0; uint8_t trans = 0; uint32_t target = 20000; switch_size_t len = 0, sql_len = runtime.sql_buffer_len; @@ -910,7 +910,7 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread, if (sql) { newlen = strlen(sql) + 2; - if (itterations == 0) { + if (iterations == 0) { trans = 1; } @@ -935,7 +935,7 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread, } } - itterations++; + iterations++; sprintf(sqlbuf + len, "%s;\n", sql); len += newlen; free(sql); @@ -950,14 +950,14 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread, lc = sql ? 1 : 0 + switch_queue_size(sql_manager.sql_queue[0]) + switch_queue_size(sql_manager.sql_queue[1]); - if (trans && itterations && (itterations > target || !lc)) { + if (trans && iterations && (iterations > target || !lc)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, - "RUN %d %d %d\n", switch_queue_size(sql_manager.sql_queue[0]), switch_queue_size(sql_manager.sql_queue[1]), itterations); + "RUN %d %d %d\n", switch_queue_size(sql_manager.sql_queue[0]), switch_queue_size(sql_manager.sql_queue[1]), iterations); if (switch_cache_db_persistant_execute_trans(sql_manager.event_db, sqlbuf, 1) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "SQL thread unable to commit transaction, records lost!\n"); } switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "DONE\n"); - itterations = 0; + iterations = 0; trans = 0; len = 0; *sqlbuf = '\0'; From 54ba998f6c6564c9ea9efb8832c0bcbd61e834e4 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 14 Sep 2010 16:23:31 -0500 Subject: [PATCH 38/63] formating --- src/tone2wav.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tone2wav.c b/src/tone2wav.c index bf51e3a566..4415860802 100644 --- a/src/tone2wav.c +++ b/src/tone2wav.c @@ -171,7 +171,7 @@ int main(int argc, char *argv[]) teletone_destroy_session(&ts); switch_core_file_close(&fh); - printf("File: %s generated.....\nPlease support:\n\nFreeSWITCH http://www.freeswitch.org\nClueCon http://www.cluecon.com\n", file); + printf("File: %s generated.....\n\nPlease support:\nFreeSWITCH http://www.freeswitch.org\nClueCon http://www.cluecon.com\n", file); end: From 4d29df1fe49fbcd8226b0b492831b1e6b22ee16c Mon Sep 17 00:00:00 2001 From: Michael S Collins Date: Tue, 14 Sep 2010 17:14:53 -0700 Subject: [PATCH 39/63] Update .gitignore --- libs/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/.gitignore b/libs/.gitignore index 24e32c1954..cc42ba4fa4 100644 --- a/libs/.gitignore +++ b/libs/.gitignore @@ -355,6 +355,7 @@ /libsndfile/Cfg/missing /libsndfile/M4/Makefile /libsndfile/M4/Makefile.in +/libsndfile/M4/lt~obsolete.m4 /libsndfile/Makefile /libsndfile/Makefile.in /libsndfile/Octave/Makefile From 283b7a85b825febf2bda0d650505d400816ab178 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Wed, 15 Sep 2010 02:57:31 -0400 Subject: [PATCH 40/63] FSBUILD-304: Fix compile error due to incorrect format specifier --- src/switch_core_sqldb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c index 5772e9f94d..b5b2ef29dc 100644 --- a/src/switch_core_sqldb.c +++ b/src/switch_core_sqldb.c @@ -920,7 +920,7 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread, if (new_mlen < runtime.max_sql_buffer_len) { sql_len = new_mlen; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, - "REALLOC %ld %d %d\n", sql_len, switch_queue_size(sql_manager.sql_queue[0]), + "REALLOC %ld %d %d\n", (long int)sql_len, switch_queue_size(sql_manager.sql_queue[0]), switch_queue_size(sql_manager.sql_queue[1])); if (!(tmp = realloc(sqlbuf, sql_len))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "SQL thread ending on mem err\n"); From 9835395c73ed58957ffe3170bfed85d8a6aa2382 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 15 Sep 2010 10:58:12 -0500 Subject: [PATCH 41/63] MDXMLINT-57 --- src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c index 34873f78d7..2e9a1a3a1a 100644 --- a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c +++ b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c @@ -275,7 +275,6 @@ static abyss_bool is_authorized(const TSession * r, const char *command) err = 686; - status = "EXECUTION OF SPECIFIED API COMMAND NOT PERMITTED IN USER ACCOUNT"; if (!user_attributes(user, domain_name, NULL, NULL, NULL, &allowed_commands)) { goto end; @@ -305,11 +304,6 @@ static abyss_bool is_authorized(const TSession * r, const char *command) if (!ok) { ResponseStatus(r, err); - if (status) { - ResponseError2(r, status); - } else { - ResponseError(r); - } } From 9c22b0d0f44cfc62c64fdbd60d1d0c1672ceab22 Mon Sep 17 00:00:00 2001 From: Brian West Date: Wed, 15 Sep 2010 11:02:12 -0500 Subject: [PATCH 42/63] MODENDP-327 --- src/mod/endpoints/mod_sofia/sofia_reg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index 32d380d271..67b63a1e9b 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -1135,7 +1135,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand } if (exptime) { - const char *agent = "dunno"; + const char *agent = "unknown"; char guess_ip4[256]; const char *username = "unknown"; const char *realm = reg_host; From 486dcc631aeaac7b8f36acc4269531ab21be5ace Mon Sep 17 00:00:00 2001 From: Brian West Date: Wed, 15 Sep 2010 15:39:52 -0500 Subject: [PATCH 43/63] improve defaults to cover more strange scenarios --- conf/sip_profiles/internal.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/sip_profiles/internal.xml b/conf/sip_profiles/internal.xml index e4af5cc772..1c2ef1216c 100644 --- a/conf/sip_profiles/internal.xml +++ b/conf/sip_profiles/internal.xml @@ -116,7 +116,7 @@ - + From 04b52156465f4b0199adcee6181a613303749073 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 15 Sep 2010 15:38:25 -0500 Subject: [PATCH 44/63] presence tweaks and addition of all-reg-options-ping which is like nat-options-ping only for every registered host --- src/mod/endpoints/mod_sofia/mod_sofia.h | 1 + src/mod/endpoints/mod_sofia/sofia.c | 12 +++ src/mod/endpoints/mod_sofia/sofia_reg.c | 102 ++++++++++++++---------- 3 files changed, 72 insertions(+), 43 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index 4d51e4b573..96acbcd9ed 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -200,6 +200,7 @@ typedef enum { PFLAG_DISABLE_NAPTR, PFLAG_AUTOFLUSH, PFLAG_NAT_OPTIONS_PING, + PFLAG_ALL_REG_OPTIONS_PING, PFLAG_AUTOFIX_TIMING, PFLAG_MESSAGE_QUERY_ON_REGISTER, PFLAG_MESSAGE_QUERY_ON_FIRST_REGISTER, diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index dd376981ab..9fa52fae50 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -2556,6 +2556,12 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile) } else { sofia_clear_pflag(profile, PFLAG_NAT_OPTIONS_PING); } + } else if (!strcasecmp(var, "all-reg-options-ping")) { + if (switch_true(val)) { + sofia_set_pflag(profile, PFLAG_ALL_REG_OPTIONS_PING); + } else { + sofia_clear_pflag(profile, PFLAG_ALL_REG_OPTIONS_PING); + } } else if (!strcasecmp(var, "inbound-codec-negotiation")) { if (!strcasecmp(val, "greedy")) { sofia_set_pflag(profile, PFLAG_GREEDY); @@ -3310,6 +3316,12 @@ switch_status_t config_sofia(int reload, char *profile_name) } else { sofia_clear_pflag(profile, PFLAG_NAT_OPTIONS_PING); } + } else if (!strcasecmp(var, "all-options-ping")) { + if (switch_true(val)) { + sofia_set_pflag(profile, PFLAG_ALL_REG_OPTIONS_PING); + } else { + sofia_clear_pflag(profile, PFLAG_ALL_REG_OPTIONS_PING); + } } else if (!strcasecmp(var, "inbound-codec-negotiation")) { if (!strcasecmp(val, "greedy")) { sofia_set_pflag(profile, PFLAG_GREEDY); diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index 67b63a1e9b..3ffbc26c33 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -438,11 +438,14 @@ int sofia_reg_nat_callback(void *pArg, int argc, char **argv, char **columnNames switch_snprintf(to, sizeof(to), "sip:%s@%s", argv[1], argv[2]); dst = sofia_glue_get_destination(argv[3]); switch_assert(dst); - + nh = nua_handle(profile->nua, NULL, SIPTAG_FROM_STR(profile->url), SIPTAG_TO_STR(to), NUTAG_URL(dst->contact), SIPTAG_CONTACT_STR(profile->url), TAG_END()); nua_handle_bind(nh, &mod_sofia_globals.destroy_private); - nua_options(nh, TAG_IF(dst->route_uri, NUTAG_PROXY(dst->route_uri)), TAG_IF(dst->route, SIPTAG_ROUTE_STR(dst->route)), TAG_END()); + nua_options(nh, + NTATAG_SIP_T2(5000), + NTATAG_SIP_T4(10000), + TAG_IF(dst->route_uri, NUTAG_PROXY(dst->route_uri)), TAG_IF(dst->route, SIPTAG_ROUTE_STR(dst->route)), TAG_END()); sofia_glue_free_destination(dst); @@ -514,7 +517,7 @@ int sofia_reg_del_callback(void *pArg, int argc, char **argv, char **columnNames switch_event_fire(&s_event); } - if (switch_event_create(&s_event, SWITCH_EVENT_PRESENCE_OUT) == SWITCH_STATUS_SUCCESS) { + if (switch_event_create(&s_event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) { switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO); switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "rpid", "away"); switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "login", profile->url); @@ -637,15 +640,14 @@ void sofia_reg_check_expire(sofia_profile_t *profile, time_t now, int reboot) } sofia_glue_actually_execute_sql(profile, sql, NULL); - - - + if (now) { switch_snprintf(sql, sizeof(sql), "select call_id from sip_subscriptions where (expires = -1 or (expires > 0 and expires <= %ld)) and hostname='%s'", (long) now, mod_sofia_globals.hostname); } else { - switch_snprintf(sql, sizeof(sql), "select call_id from sip_subscriptions where expires >= -1 and hostname='%s'", mod_sofia_globals.hostname); + switch_snprintf(sql, sizeof(sql), "select sub_to_user,sub_to_host,call_id from sip_subscriptions where expires >= -1 and hostname='%s'", + mod_sofia_globals.hostname); } sofia_glue_execute_sql_callback(profile, NULL, sql, sofia_sub_del_callback, profile); @@ -670,13 +672,21 @@ void sofia_reg_check_expire(sofia_profile_t *profile, time_t now, int reboot) sofia_glue_actually_execute_sql(profile, sql, NULL); - if (now && sofia_test_pflag(profile, PFLAG_NAT_OPTIONS_PING)) { - switch_snprintf(sql, sizeof(sql), "select call_id,sip_user,sip_host,contact,status,rpid," - "expires,user_agent,server_user,server_host,profile_name" - " from sip_registrations where (status like '%%NAT%%' " - "or contact like '%%fs_nat=yes%%') and hostname='%s'", mod_sofia_globals.hostname); - - sofia_glue_execute_sql_callback(profile, NULL, sql, sofia_reg_nat_callback, profile); + if (now) { + if (sofia_test_pflag(profile, PFLAG_ALL_REG_OPTIONS_PING)) { + switch_snprintf(sql, sizeof(sql), "select call_id,sip_user,sip_host,contact,status,rpid," + "expires,user_agent,server_user,server_host,profile_name" + " from sip_registrations where hostname='%s'", mod_sofia_globals.hostname); + + sofia_glue_execute_sql_callback(profile, NULL, sql, sofia_reg_nat_callback, profile); + } else if (sofia_test_pflag(profile, PFLAG_NAT_OPTIONS_PING)) { + switch_snprintf(sql, sizeof(sql), "select call_id,sip_user,sip_host,contact,status,rpid," + "expires,user_agent,server_user,server_host,profile_name" + " from sip_registrations where (status like '%%NAT%%' " + "or contact like '%%fs_nat=yes%%') and hostname='%s'", mod_sofia_globals.hostname); + + sofia_glue_execute_sql_callback(profile, NULL, sql, sofia_reg_nat_callback, profile); + } } switch_mutex_unlock(profile->ireg_mutex); @@ -810,6 +820,9 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand switch_event_t *auth_params = NULL; int r = 0; long reg_count = 0; + int delete_subs = 1; + const char *agent = "unknown"; + /* all callers must confirm that sip, sip->sip_request and sip->sip_contact are not NULL */ switch_assert(sip != NULL && sip->sip_contact != NULL && sip->sip_request != NULL); @@ -826,6 +839,14 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand to = sip->sip_to; from = sip->sip_from; + if (sip->sip_user_agent) { + agent = sip->sip_user_agent->g_string; + + if (switch_stristr("snom", agent)) { + delete_subs = 0; + } + } + if (from) { from_user = from->a_url->url_user; from_host = from->a_url->url_host; @@ -1135,7 +1156,6 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand } if (exptime) { - const char *agent = "unknown"; char guess_ip4[256]; const char *username = "unknown"; const char *realm = reg_host; @@ -1145,19 +1165,15 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand realm = switch_event_get_header(auth_params, "sip_auth_realm"); } - if (sip->sip_user_agent) { - agent = sip->sip_user_agent->g_string; - } - if (multi_reg) { -#ifdef DEL_SUBS - if (reg_count == 1) { - sql = switch_mprintf("delete from sip_subscriptions where sip_user='%q' and sip_host='%q' and contact='%q'", - to_user, sub_host, contact_str); - sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); + if (delete_subs) { + if (reg_count == 1) { + sql = switch_mprintf("delete from sip_subscriptions where sip_user='%q' and sip_host='%q' and contact='%q'", + to_user, sub_host, contact_str); + sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); + } } -#endif if (multi_reg_contact) { @@ -1167,10 +1183,10 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand sql = switch_mprintf("delete from sip_registrations where call_id='%q'", call_id); } } else { -#ifdef DEL_SUBS - sql = switch_mprintf("delete from sip_subscriptions where sip_user='%q' and sip_host='%q'", to_user, sub_host); - sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); -#endif + if (delete_subs) { + sql = switch_mprintf("delete from sip_subscriptions where sip_user='%q' and sip_host='%q'", to_user, sub_host); + sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); + } sql = switch_mprintf("delete from sip_registrations where sip_user='%q' and sip_host='%q'", to_user, reg_host); } switch_mutex_lock(profile->ireg_mutex); @@ -1185,7 +1201,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand "mwi_user,mwi_host, orig_server_host, orig_hostname) " "values ('%q','%q', '%q','%q','%q','%q', '%q', %ld, '%q', '%q', '%q', '%q', '%q', '%q', '%q','%q','%q','%q','%q','%q','%q')", call_id, to_user, reg_host, profile->presence_hosts ? profile->presence_hosts : reg_host, - contact_str, reg_desc, rpid, (long) switch_epoch_time_now(NULL) + (long) exptime * 2, + contact_str, reg_desc, rpid, (long) switch_epoch_time_now(NULL) + (long) exptime + 60, agent, from_user, guess_ip4, profile->name, mod_sofia_globals.hostname, network_ip, network_port_c, username, realm, mwi_user, mwi_host, guess_ip4, mod_sofia_globals.hostname); @@ -1290,16 +1306,16 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand if ((p = strchr(icontact + 4, ':'))) { *p = '\0'; } -#ifdef DEL_SUBS - if (multi_reg_contact) { - sql = - switch_mprintf("delete from sip_subscriptions where sip_user='%q' and sip_host='%q' and contact='%q'", to_user, sub_host, contact_str); - } else { - sql = switch_mprintf("delete from sip_subscriptions where call_id='%q'", call_id); - } + if (delete_subs) { + if (multi_reg_contact) { + sql = + switch_mprintf("delete from sip_subscriptions where sip_user='%q' and sip_host='%q' and contact='%q'", to_user, sub_host, contact_str); + } else { + sql = switch_mprintf("delete from sip_subscriptions where call_id='%q'", call_id); + } - sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); -#endif + sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); + } if (multi_reg_contact) { sql = @@ -1312,11 +1328,11 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand switch_safe_free(icontact); } else { -#ifdef DEL_SUBS - if ((sql = switch_mprintf("delete from sip_subscriptions where sip_user='%q' and sip_host='%q'", to_user, sub_host))) { - sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); + if (delete_subs) { + if ((sql = switch_mprintf("delete from sip_subscriptions where sip_user='%q' and sip_host='%q'", to_user, sub_host))) { + sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); + } } -#endif if ((sql = switch_mprintf("delete from sip_registrations where sip_user='%q' and sip_host='%q'", to_user, reg_host))) { sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE); } From 6a0f7f4ae8d0005cb9fdc3286537b9b60b50a592 Mon Sep 17 00:00:00 2001 From: Jeff Lenk Date: Wed, 15 Sep 2010 16:21:10 -0500 Subject: [PATCH 45/63] build tweak + vs2010 swig --- src/mod/endpoints/mod_sofia/sofia.c | 4 +- .../mod_managed/freeswitch_wrap.2010.cxx | 134 +++++++++++++++- .../mod_managed/managed/swig.2010.cs | 146 +++++++++++++++++- src/switch_core_sqldb.c | 2 +- 4 files changed, 277 insertions(+), 9 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 9fa52fae50..e76a56a4aa 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -1233,7 +1233,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread uint32_t gateway_loops = 0; int loops = 0; uint32_t qsize; - void *pop; + void *pop = NULL; int loop_count = 0; switch_size_t sql_len = 1024 * 32; char *tmp, *sqlbuf = NULL; @@ -1254,7 +1254,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread while ((mod_sofia_globals.running == 1 && sofia_test_pflag(profile, PFLAG_RUNNING)) || qsize) { if (sofia_test_pflag(profile, PFLAG_SQL_IN_TRANS)) { - if (qsize > 0 && (qsize >= 1024 || ++loop_count >= profile->trans_timeout)) { + if (qsize > 0 && (qsize >= 1024 || ++loop_count >= (int)profile->trans_timeout)) { switch_size_t newlen; uint32_t iterations = 0; switch_size_t len = 0; diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx index 4b0a1df8c3..04a2f3f967 100644 --- a/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx +++ b/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx @@ -2813,6 +2813,68 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_rtp_numbers_t(void * jarg1) { } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtcp_numbers_t_packet_count_set(void * jarg1, unsigned long jarg2) { + switch_rtcp_numbers_t *arg1 = (switch_rtcp_numbers_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_rtcp_numbers_t *)jarg1; + arg2 = (uint32_t)jarg2; + if (arg1) (arg1)->packet_count = arg2; +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_rtcp_numbers_t_packet_count_get(void * jarg1) { + unsigned long jresult ; + switch_rtcp_numbers_t *arg1 = (switch_rtcp_numbers_t *) 0 ; + uint32_t result; + + arg1 = (switch_rtcp_numbers_t *)jarg1; + result = (uint32_t) ((arg1)->packet_count); + jresult = (unsigned long)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtcp_numbers_t_octet_count_set(void * jarg1, unsigned long jarg2) { + switch_rtcp_numbers_t *arg1 = (switch_rtcp_numbers_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_rtcp_numbers_t *)jarg1; + arg2 = (uint32_t)jarg2; + if (arg1) (arg1)->octet_count = arg2; +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_rtcp_numbers_t_octet_count_get(void * jarg1) { + unsigned long jresult ; + switch_rtcp_numbers_t *arg1 = (switch_rtcp_numbers_t *) 0 ; + uint32_t result; + + arg1 = (switch_rtcp_numbers_t *)jarg1; + result = (uint32_t) ((arg1)->octet_count); + jresult = (unsigned long)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_rtcp_numbers_t() { + void * jresult ; + switch_rtcp_numbers_t *result = 0 ; + + result = (switch_rtcp_numbers_t *)new switch_rtcp_numbers_t(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_rtcp_numbers_t(void * jarg1) { + switch_rtcp_numbers_t *arg1 = (switch_rtcp_numbers_t *) 0 ; + + arg1 = (switch_rtcp_numbers_t *)jarg1; + delete arg1; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_stats_t_inbound_set(void * jarg1, void * jarg2) { switch_rtp_stats_t *arg1 = (switch_rtp_stats_t *) 0 ; switch_rtp_numbers_t *arg2 = (switch_rtp_numbers_t *) 0 ; @@ -2857,6 +2919,28 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_rtp_stats_t_outbound_get(void * jarg } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_stats_t_rtcp_set(void * jarg1, void * jarg2) { + switch_rtp_stats_t *arg1 = (switch_rtp_stats_t *) 0 ; + switch_rtcp_numbers_t *arg2 = (switch_rtcp_numbers_t *) 0 ; + + arg1 = (switch_rtp_stats_t *)jarg1; + arg2 = (switch_rtcp_numbers_t *)jarg2; + if (arg1) (arg1)->rtcp = *arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_rtp_stats_t_rtcp_get(void * jarg1) { + void * jresult ; + switch_rtp_stats_t *arg1 = (switch_rtp_stats_t *) 0 ; + switch_rtcp_numbers_t *result = 0 ; + + arg1 = (switch_rtp_stats_t *)jarg1; + result = (switch_rtcp_numbers_t *)& ((arg1)->rtcp); + jresult = (void *)result; + return jresult; +} + + SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_rtp_stats_t() { void * jresult ; switch_rtp_stats_t *result = 0 ; @@ -10518,11 +10602,13 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_loadable_module_interface(void } -SWIGEXPORT int SWIGSTDCALL CSharp_switch_loadable_module_init() { +SWIGEXPORT int SWIGSTDCALL CSharp_switch_loadable_module_init(int jarg1) { int jresult ; + switch_bool_t arg1 ; switch_status_t result; - result = (switch_status_t)switch_loadable_module_init(); + arg1 = (switch_bool_t)jarg1; + result = (switch_status_t)switch_loadable_module_init(arg1); jresult = result; return jresult; } @@ -13050,6 +13136,28 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_caller_profile_originatee_caller_pro } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_caller_profile_origination_caller_profile_set(void * jarg1, void * jarg2) { + switch_caller_profile *arg1 = (switch_caller_profile *) 0 ; + switch_caller_profile *arg2 = (switch_caller_profile *) 0 ; + + arg1 = (switch_caller_profile *)jarg1; + arg2 = (switch_caller_profile *)jarg2; + if (arg1) (arg1)->origination_caller_profile = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_caller_profile_origination_caller_profile_get(void * jarg1) { + void * jresult ; + switch_caller_profile *arg1 = (switch_caller_profile *) 0 ; + switch_caller_profile *result = 0 ; + + arg1 = (switch_caller_profile *)jarg1; + result = (switch_caller_profile *) ((arg1)->origination_caller_profile); + jresult = (void *)result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_caller_profile_hunt_caller_profile_set(void * jarg1, void * jarg2) { switch_caller_profile *arg1 = (switch_caller_profile *) 0 ; switch_caller_profile *arg2 = (switch_caller_profile *) 0 ; @@ -22219,6 +22327,28 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_channel_get_originatee_caller_profil } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_set_origination_caller_profile(void * jarg1, void * jarg2) { + switch_channel_t *arg1 = (switch_channel_t *) 0 ; + switch_caller_profile_t *arg2 = (switch_caller_profile_t *) 0 ; + + arg1 = (switch_channel_t *)jarg1; + arg2 = (switch_caller_profile_t *)jarg2; + switch_channel_set_origination_caller_profile(arg1,arg2); +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_channel_get_origination_caller_profile(void * jarg1) { + void * jresult ; + switch_channel_t *arg1 = (switch_channel_t *) 0 ; + switch_caller_profile_t *result = 0 ; + + arg1 = (switch_channel_t *)jarg1; + result = (switch_caller_profile_t *)switch_channel_get_origination_caller_profile(arg1); + jresult = (void *)result; + return jresult; +} + + SWIGEXPORT char * SWIGSTDCALL CSharp_switch_channel_get_uuid(void * jarg1) { char * jresult ; switch_channel_t *arg1 = (switch_channel_t *) 0 ; diff --git a/src/mod/languages/mod_managed/managed/swig.2010.cs b/src/mod/languages/mod_managed/managed/swig.2010.cs index a76e35c5e8..8bf2c6c38d 100644 --- a/src/mod/languages/mod_managed/managed/swig.2010.cs +++ b/src/mod/languages/mod_managed/managed/swig.2010.cs @@ -2309,8 +2309,8 @@ public class freeswitch { return ret; } - public static switch_status_t switch_loadable_module_init() { - switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_loadable_module_init(); + public static switch_status_t switch_loadable_module_init(switch_bool_t autoload) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_loadable_module_init((int)autoload); return ret; } @@ -3105,6 +3105,16 @@ public class freeswitch { return ret; } + public static void switch_channel_set_origination_caller_profile(SWIGTYPE_p_switch_channel channel, switch_caller_profile caller_profile) { + freeswitchPINVOKE.switch_channel_set_origination_caller_profile(SWIGTYPE_p_switch_channel.getCPtr(channel), switch_caller_profile.getCPtr(caller_profile)); + } + + public static switch_caller_profile switch_channel_get_origination_caller_profile(SWIGTYPE_p_switch_channel channel) { + IntPtr cPtr = freeswitchPINVOKE.switch_channel_get_origination_caller_profile(SWIGTYPE_p_switch_channel.getCPtr(channel)); + switch_caller_profile ret = (cPtr == IntPtr.Zero) ? null : new switch_caller_profile(cPtr, false); + return ret; + } + public static string switch_channel_get_uuid(SWIGTYPE_p_switch_channel channel) { string ret = freeswitchPINVOKE.switch_channel_get_uuid(SWIGTYPE_p_switch_channel.getCPtr(channel)); return ret; @@ -6115,6 +6125,24 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_rtp_numbers_t")] public static extern void delete_switch_rtp_numbers_t(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtcp_numbers_t_packet_count_set")] + public static extern void switch_rtcp_numbers_t_packet_count_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtcp_numbers_t_packet_count_get")] + public static extern uint switch_rtcp_numbers_t_packet_count_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtcp_numbers_t_octet_count_set")] + public static extern void switch_rtcp_numbers_t_octet_count_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtcp_numbers_t_octet_count_get")] + public static extern uint switch_rtcp_numbers_t_octet_count_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_new_switch_rtcp_numbers_t")] + public static extern IntPtr new_switch_rtcp_numbers_t(); + + [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_rtcp_numbers_t")] + public static extern void delete_switch_rtcp_numbers_t(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_stats_t_inbound_set")] public static extern void switch_rtp_stats_t_inbound_set(HandleRef jarg1, HandleRef jarg2); @@ -6127,6 +6155,12 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_stats_t_outbound_get")] public static extern IntPtr switch_rtp_stats_t_outbound_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_stats_t_rtcp_set")] + public static extern void switch_rtp_stats_t_rtcp_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_stats_t_rtcp_get")] + public static extern IntPtr switch_rtp_stats_t_rtcp_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_new_switch_rtp_stats_t")] public static extern IntPtr new_switch_rtp_stats_t(); @@ -7982,7 +8016,7 @@ class freeswitchPINVOKE { public static extern void delete_switch_loadable_module_interface(HandleRef jarg1); [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_init")] - public static extern int switch_loadable_module_init(); + public static extern int switch_loadable_module_init(int jarg1); [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_shutdown")] public static extern void switch_loadable_module_shutdown(); @@ -8518,6 +8552,12 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_caller_profile_originatee_caller_profile_get")] public static extern IntPtr switch_caller_profile_originatee_caller_profile_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_caller_profile_origination_caller_profile_set")] + public static extern void switch_caller_profile_origination_caller_profile_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_caller_profile_origination_caller_profile_get")] + public static extern IntPtr switch_caller_profile_origination_caller_profile_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_caller_profile_hunt_caller_profile_set")] public static extern void switch_caller_profile_hunt_caller_profile_set(HandleRef jarg1, HandleRef jarg2); @@ -10900,6 +10940,12 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_get_originatee_caller_profile")] public static extern IntPtr switch_channel_get_originatee_caller_profile(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_set_origination_caller_profile")] + public static extern void switch_channel_set_origination_caller_profile(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_get_origination_caller_profile")] + public static extern IntPtr switch_channel_get_origination_caller_profile(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_get_uuid")] public static extern string switch_channel_get_uuid(HandleRef jarg1); @@ -20494,6 +20540,17 @@ public class switch_caller_profile : IDisposable { } } + public switch_caller_profile origination_caller_profile { + set { + freeswitchPINVOKE.switch_caller_profile_origination_caller_profile_set(swigCPtr, switch_caller_profile.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_caller_profile_origination_caller_profile_get(swigCPtr); + switch_caller_profile ret = (cPtr == IntPtr.Zero) ? null : new switch_caller_profile(cPtr, false); + return ret; + } + } + public switch_caller_profile hunt_caller_profile { set { freeswitchPINVOKE.switch_caller_profile_hunt_caller_profile_set(swigCPtr, switch_caller_profile.getCPtr(value)); @@ -22237,7 +22294,8 @@ namespace FreeSWITCH.Native { SCF_USE_CLOCK_RT = (1 << 10), SCF_VERBOSE_EVENTS = (1 << 11), SCF_USE_WIN32_MONOTONIC = (1 << 12), - SCF_AUTO_SCHEMAS = (1 << 13) + SCF_AUTO_SCHEMAS = (1 << 13), + SCF_MINIMAL = (1 << 14) } } @@ -27451,6 +27509,75 @@ public class switch_rtcp_hdr_t : IDisposable { namespace FreeSWITCH.Native { +using System; +using System.Runtime.InteropServices; + +public class switch_rtcp_numbers_t : IDisposable { + private HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal switch_rtcp_numbers_t(IntPtr cPtr, bool cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = new HandleRef(this, cPtr); + } + + internal static HandleRef getCPtr(switch_rtcp_numbers_t obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } + + ~switch_rtcp_numbers_t() { + Dispose(); + } + + public virtual void Dispose() { + lock(this) { + if (swigCPtr.Handle != IntPtr.Zero) { + if (swigCMemOwn) { + swigCMemOwn = false; + freeswitchPINVOKE.delete_switch_rtcp_numbers_t(swigCPtr); + } + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + GC.SuppressFinalize(this); + } + } + + public uint packet_count { + set { + freeswitchPINVOKE.switch_rtcp_numbers_t_packet_count_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_rtcp_numbers_t_packet_count_get(swigCPtr); + return ret; + } + } + + public uint octet_count { + set { + freeswitchPINVOKE.switch_rtcp_numbers_t_octet_count_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_rtcp_numbers_t_octet_count_get(swigCPtr); + return ret; + } + } + + public switch_rtcp_numbers_t() : this(freeswitchPINVOKE.new_switch_rtcp_numbers_t(), true) { + } + +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.0 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + public enum switch_rtp_bug_flag_t { RTP_BUG_NONE = 0, RTP_BUG_CISCO_SKIP_MARK_BIT_2833 = (1 << 0), @@ -28021,6 +28148,17 @@ public class switch_rtp_stats_t : IDisposable { } } + public switch_rtcp_numbers_t rtcp { + set { + freeswitchPINVOKE.switch_rtp_stats_t_rtcp_set(swigCPtr, switch_rtcp_numbers_t.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_rtp_stats_t_rtcp_get(swigCPtr); + switch_rtcp_numbers_t ret = (cPtr == IntPtr.Zero) ? null : new switch_rtcp_numbers_t(cPtr, false); + return ret; + } + } + public switch_rtp_stats_t() : this(freeswitchPINVOKE.new_switch_rtp_stats_t(), true) { } diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c index b5b2ef29dc..d5a06f8aeb 100644 --- a/src/switch_core_sqldb.c +++ b/src/switch_core_sqldb.c @@ -850,7 +850,7 @@ SWITCH_DECLARE(switch_bool_t) switch_cache_db_test_reactive(switch_cache_db_hand static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread, void *obj) { - void *pop; + void *pop = NULL; uint32_t iterations = 0; uint8_t trans = 0; uint32_t target = 20000; From 3eb35a57bf702f9289dca66d913b285888c1aabe Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 15 Sep 2010 17:04:43 -0500 Subject: [PATCH 46/63] forgot a spot to call conditional broadcast on shutdown --- src/switch_core_sqldb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c index d5a06f8aeb..4a53c8d1fd 100644 --- a/src/switch_core_sqldb.c +++ b/src/switch_core_sqldb.c @@ -1673,6 +1673,7 @@ void switch_core_sqldb_stop(void) switch_queue_push(sql_manager.sql_queue[0], NULL); switch_queue_push(sql_manager.sql_queue[1], NULL); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Waiting for unfinished SQL transactions\n"); + switch_thread_cond_broadcast(sql_manager.cond); } sql_manager.thread_running = -1; From 4e567a28a209a2037d88af51c04b75cdec1214cc Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 15 Sep 2010 18:57:54 -0500 Subject: [PATCH 47/63] fix logic in app flags --- src/switch_channel.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/switch_channel.c b/src/switch_channel.c index e3d77d7239..ba5560129b 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -1291,19 +1291,24 @@ SWITCH_DECLARE(int) switch_channel_test_private_flag(switch_channel_t *channel, SWITCH_DECLARE(void) switch_channel_set_app_flag_key(const char *key, switch_channel_t *channel, uint32_t flags) { uint32_t *flagp = NULL; - + switch_byte_t new = 0; + switch_assert(channel != NULL); switch_mutex_lock(channel->flag_mutex); - - if (channel->app_flag_hash) { - flagp = switch_core_hash_find(channel->app_flag_hash, key); - } else { + + if (!channel->app_flag_hash) { switch_core_hash_init(&channel->app_flag_hash, switch_core_session_get_pool(channel->session)); + new++; + } + + if (new || !(flagp = switch_core_hash_find(channel->app_flag_hash, key))) { flagp = switch_core_session_alloc(channel->session, sizeof(uint32_t)); switch_core_hash_insert(channel->app_flag_hash, key, flagp); } - if (flagp) *flagp |= flags; + switch_assert(flagp); + *flagp |= flags; + switch_mutex_unlock(channel->flag_mutex); } From 0d0b4b4383fcd24a3339f8d5c647cc1aee46e8f7 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 15 Sep 2010 19:11:47 -0500 Subject: [PATCH 48/63] move app flag into 'T38' namespace for the sake of housekeeping --- src/mod/applications/mod_spandsp/mod_spandsp_fax.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c index 7ff106aceb..52ba941d43 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c @@ -1659,8 +1659,8 @@ static switch_status_t t38_gateway_on_reset(switch_core_session_t *session) switch_channel_clear_flag(channel, CF_REDIRECT); - if (switch_channel_test_app_flag(channel, CF_APP_TAGGED)) { - switch_channel_clear_app_flag(channel, CF_APP_TAGGED); + if (switch_channel_test_app_flag_key("T38", channel, CF_APP_TAGGED)) { + switch_channel_clear_app_flag_key("T38", channel, CF_APP_TAGGED); switch_channel_set_state(channel, CS_CONSUME_MEDIA); } else { switch_channel_set_state(channel, CS_SOFT_EXECUTE); @@ -1697,6 +1697,9 @@ switch_bool_t t38_gateway_start(switch_core_session_t *session, const char *app, switch_channel_set_variable(channel, "t38_peer", switch_core_session_get_uuid(other_session)); switch_channel_set_variable(other_channel, "t38_peer", switch_core_session_get_uuid(session)); + switch_channel_set_variable(peer ? other_channel : channel, "t38_gateway_format", "audio"); + switch_channel_set_variable(peer ? channel : other_channel, "t38_gateway_format", "udptl"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s starting gateway mode to %s\n", switch_channel_get_name(peer ? channel : other_channel), @@ -1709,8 +1712,8 @@ switch_bool_t t38_gateway_start(switch_core_session_t *session, const char *app, switch_channel_add_state_handler(channel, &t38_gateway_state_handlers); switch_channel_add_state_handler(other_channel, &t38_gateway_state_handlers); - switch_channel_set_app_flag(peer ? channel : other_channel, CF_APP_TAGGED); - switch_channel_clear_app_flag(peer ? other_channel : channel, CF_APP_TAGGED); + switch_channel_set_app_flag_key("T38", peer ? channel : other_channel, CF_APP_TAGGED); + switch_channel_clear_app_flag_key("T38", peer ? other_channel : channel, CF_APP_TAGGED); switch_channel_set_flag(channel, CF_REDIRECT); switch_channel_set_state(channel, CS_RESET); From 8726104aa3ffa9f542d0b64b4fb43e6acdcaff77 Mon Sep 17 00:00:00 2001 From: Brian West Date: Wed, 15 Sep 2010 19:46:15 -0500 Subject: [PATCH 49/63] If sip_invite_domain is used lets use it for rpid_domain no matter what because I know best if I set it --- src/mod/endpoints/mod_sofia/sofia_glue.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 3dd830937a..d17981c9d0 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -1658,7 +1658,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) sofia_private_t *sofia_private; char *invite_contact = NULL, *to_str, *use_from_str, *from_str; const char *t_var; - char *rpid_domain = "cluecon.com", *p; + char *rpid_domain = NULL, *p; const char *priv = "off"; const char *screen = "no"; const char *invite_params = switch_channel_get_variable(tech_pvt->channel, "sip_invite_params"); @@ -1670,6 +1670,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) const char *from_var = switch_channel_get_variable(tech_pvt->channel, "sip_from_uri"); const char *from_display = switch_channel_get_variable(tech_pvt->channel, "sip_from_display"); const char *invite_req_uri = switch_channel_get_variable(tech_pvt->channel, "sip_invite_req_uri"); + const char *invite_domain = switch_channel_get_variable(tech_pvt->channel, "sip_invite_domain"); const char *use_name, *use_number; if (zstr(tech_pvt->dest)) { @@ -1688,7 +1689,6 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) if (!tech_pvt->from_str) { const char *sipip; const char *format; - const char *alt = NULL; sipip = tech_pvt->profile->sipip; @@ -1698,8 +1698,8 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) format = strchr(sipip, ':') ? "\"%s\" " : "\"%s\" "; - if ((alt = switch_channel_get_variable(channel, "sip_invite_domain"))) { - sipip = alt; + if (!zstr(invite_domain)) { + sipip = invite_domain; } tech_pvt->from_str = switch_core_session_sprintf(tech_pvt->session, format, cid_name, cid_num, !zstr(cid_num) ? "@" : "", sipip); @@ -1739,6 +1739,10 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) } } + if (!zstr(invite_domain)) { + rpid_domain = (char *)invite_domain; + } + if (zstr(rpid_domain)) { rpid_domain = "cluecon.com"; } From 7d5ca1c08601694be0effa41965d9f2d8299a8ec Mon Sep 17 00:00:00 2001 From: Leon de Rooij Date: Thu, 16 Sep 2010 14:02:12 +0200 Subject: [PATCH 50/63] Added SAF_ROUTING_EXEC flag to lua app, so it can be run inline --- src/mod/languages/mod_lua/mod_lua.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/languages/mod_lua/mod_lua.cpp b/src/mod/languages/mod_lua/mod_lua.cpp index 3ccbef5aaa..cf9b373ce0 100644 --- a/src/mod/languages/mod_lua/mod_lua.cpp +++ b/src/mod/languages/mod_lua/mod_lua.cpp @@ -588,7 +588,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_lua_load) SWITCH_ADD_API(api_interface, "luarun", "run a script", luarun_api_function, "