From ce96d95c5e5b29b3bcb69d6e5416f0bc6bfb88f7 Mon Sep 17 00:00:00 2001 From: Russell Treleaven Date: Sun, 31 Aug 2014 20:22:08 -0400 Subject: [PATCH 01/77] add support for cache directory make configs use specific directory variables instead of just base_dir so that one configuration can be used for fhs and legacy installations --- .../autoload_configs/blacklist.conf.xml | 2 +- .../autoload_configs/callcenter.conf.xml | 2 +- .../autoload_configs/cdr_pg_csv.conf.xml | 2 +- .../autoload_configs/erlang_event.conf.xml | 2 +- conf/vanilla/autoload_configs/fax.conf.xml | 2 +- .../autoload_configs/format_cdr.conf.xml | 10 ++++---- conf/vanilla/autoload_configs/httapi.conf.xml | 8 +++---- .../autoload_configs/http_cache.conf.xml | 4 ++-- conf/vanilla/autoload_configs/java.conf.xml | 2 +- conf/vanilla/autoload_configs/lua.conf.xml | 2 +- conf/vanilla/autoload_configs/perl.conf.xml | 2 +- .../vanilla/autoload_configs/spandsp.conf.xml | 2 +- conf/vanilla/autoload_configs/verto.conf.xml | 4 ++-- .../autoload_configs/voicemail.conf.xml | 2 +- .../vanilla/autoload_configs/xml_cdr.conf.xml | 10 ++++---- .../autoload_configs/xml_curl.conf.xml | 8 +++---- conf/vanilla/dialplan/default.xml | 12 +++++----- conf/vanilla/sip_profiles/internal.xml | 2 +- conf/vanilla/vars.xml | 14 ++++++++++- configure.ac | 8 +++++++ src/include/switch_types.h | 1 + src/switch.c | 16 +++++++++++++ src/switch_core.c | 24 +++++++++++++++++++ 23 files changed, 101 insertions(+), 40 deletions(-) diff --git a/conf/vanilla/autoload_configs/blacklist.conf.xml b/conf/vanilla/autoload_configs/blacklist.conf.xml index a981ebbdb0..9995febd83 100644 --- a/conf/vanilla/autoload_configs/blacklist.conf.xml +++ b/conf/vanilla/autoload_configs/blacklist.conf.xml @@ -5,7 +5,7 @@ NOTE: make sure the file exists and is readable by FreeSWITCH. - + --> diff --git a/conf/vanilla/autoload_configs/callcenter.conf.xml b/conf/vanilla/autoload_configs/callcenter.conf.xml index a069413ac6..fbc02c4a10 100644 --- a/conf/vanilla/autoload_configs/callcenter.conf.xml +++ b/conf/vanilla/autoload_configs/callcenter.conf.xml @@ -9,7 +9,7 @@ - + diff --git a/conf/vanilla/autoload_configs/cdr_pg_csv.conf.xml b/conf/vanilla/autoload_configs/cdr_pg_csv.conf.xml index 4fec817b45..9891455f8a 100644 --- a/conf/vanilla/autoload_configs/cdr_pg_csv.conf.xml +++ b/conf/vanilla/autoload_configs/cdr_pg_csv.conf.xml @@ -9,7 +9,7 @@ - + diff --git a/conf/vanilla/autoload_configs/erlang_event.conf.xml b/conf/vanilla/autoload_configs/erlang_event.conf.xml index 62deb84f67..7f627668ef 100644 --- a/conf/vanilla/autoload_configs/erlang_event.conf.xml +++ b/conf/vanilla/autoload_configs/erlang_event.conf.xml @@ -11,7 +11,7 @@ - + diff --git a/conf/vanilla/autoload_configs/fax.conf.xml b/conf/vanilla/autoload_configs/fax.conf.xml index c7d825665e..d6a5ff734b 100644 --- a/conf/vanilla/autoload_configs/fax.conf.xml +++ b/conf/vanilla/autoload_configs/fax.conf.xml @@ -6,7 +6,7 @@ - + diff --git a/conf/vanilla/autoload_configs/format_cdr.conf.xml b/conf/vanilla/autoload_configs/format_cdr.conf.xml index 227bcb4722..0c42e78b40 100644 --- a/conf/vanilla/autoload_configs/format_cdr.conf.xml +++ b/conf/vanilla/autoload_configs/format_cdr.conf.xml @@ -46,7 +46,7 @@ - + @@ -63,21 +63,21 @@ Specify your public key with 'ssl-cert-path' and the private key with 'ssl-key-path'. If your private key has a password, specify it with 'ssl-key-password'. --> - - + + - + - + diff --git a/conf/vanilla/autoload_configs/httapi.conf.xml b/conf/vanilla/autoload_configs/httapi.conf.xml index 50bbe78f40..d0b357d0fe 100644 --- a/conf/vanilla/autoload_configs/httapi.conf.xml +++ b/conf/vanilla/autoload_configs/httapi.conf.xml @@ -100,8 +100,8 @@ Specify your public key with 'ssl-cert-path' and the private key with 'ssl-key-path'. If your private key has a password, specify it with 'ssl-key-password'. --> - - + + @@ -109,14 +109,14 @@ - + - + diff --git a/conf/vanilla/autoload_configs/http_cache.conf.xml b/conf/vanilla/autoload_configs/http_cache.conf.xml index 5d0294c662..cd6ec119b4 100644 --- a/conf/vanilla/autoload_configs/http_cache.conf.xml +++ b/conf/vanilla/autoload_configs/http_cache.conf.xml @@ -3,12 +3,12 @@ - + - + diff --git a/conf/vanilla/autoload_configs/java.conf.xml b/conf/vanilla/autoload_configs/java.conf.xml index 5f71553e30..1da38f487f 100644 --- a/conf/vanilla/autoload_configs/java.conf.xml +++ b/conf/vanilla/autoload_configs/java.conf.xml @@ -1,7 +1,7 @@ - diff --git a/conf/vanilla/autoload_configs/lua.conf.xml b/conf/vanilla/autoload_configs/lua.conf.xml index f50307ea89..fafd336169 100644 --- a/conf/vanilla/autoload_configs/lua.conf.xml +++ b/conf/vanilla/autoload_configs/lua.conf.xml @@ -13,7 +13,7 @@ These entries will be pre-pended to the LUA_PATH environment variable --> - + diff --git a/conf/vanilla/autoload_configs/perl.conf.xml b/conf/vanilla/autoload_configs/perl.conf.xml index b2435000ff..0249119230 100644 --- a/conf/vanilla/autoload_configs/perl.conf.xml +++ b/conf/vanilla/autoload_configs/perl.conf.xml @@ -1,6 +1,6 @@ - + diff --git a/conf/vanilla/autoload_configs/voicemail.conf.xml b/conf/vanilla/autoload_configs/voicemail.conf.xml index 9e5e67ffa3..8052d611f1 100644 --- a/conf/vanilla/autoload_configs/voicemail.conf.xml +++ b/conf/vanilla/autoload_configs/voicemail.conf.xml @@ -64,7 +64,7 @@ - + diff --git a/conf/vanilla/autoload_configs/xml_cdr.conf.xml b/conf/vanilla/autoload_configs/xml_cdr.conf.xml index ac9b1f94d3..d4c4bea8d9 100644 --- a/conf/vanilla/autoload_configs/xml_cdr.conf.xml +++ b/conf/vanilla/autoload_configs/xml_cdr.conf.xml @@ -35,7 +35,7 @@ - + @@ -52,20 +52,20 @@ Specify your public key with 'ssl-cert-path' and the private key with 'ssl-key-path'. If your private key has a password, specify it with 'ssl-key-password'. --> - - + + - + - + diff --git a/conf/vanilla/autoload_configs/xml_curl.conf.xml b/conf/vanilla/autoload_configs/xml_curl.conf.xml index 30951d83c8..de0de0293a 100644 --- a/conf/vanilla/autoload_configs/xml_curl.conf.xml +++ b/conf/vanilla/autoload_configs/xml_curl.conf.xml @@ -24,8 +24,8 @@ Specify your public key with 'ssl-cert-path' and the private key with 'ssl-key-path'. If your private key has a password, specify it with 'ssl-key-password'. --> - - + + @@ -33,14 +33,14 @@ - + - + diff --git a/conf/vanilla/dialplan/default.xml b/conf/vanilla/dialplan/default.xml index 8c4a1f0312..8971939ec2 100644 --- a/conf/vanilla/dialplan/default.xml +++ b/conf/vanilla/dialplan/default.xml @@ -129,7 +129,7 @@ - + @@ -598,14 +598,14 @@ - + - + @@ -675,14 +675,14 @@ - + - + @@ -710,7 +710,7 @@ - + diff --git a/conf/vanilla/sip_profiles/internal.xml b/conf/vanilla/sip_profiles/internal.xml index 583db26db3..9e6a93ae2a 100644 --- a/conf/vanilla/sip_profiles/internal.xml +++ b/conf/vanilla/sip_profiles/internal.xml @@ -307,7 +307,7 @@ - + diff --git a/conf/vanilla/vars.xml b/conf/vanilla/vars.xml index 20016cd85f..0b161854ff 100644 --- a/conf/vanilla/vars.xml +++ b/conf/vanilla/vars.xml @@ -28,6 +28,18 @@ recordings_dir sound_prefix sounds_dir + conf_dir + log_dir + run_dir + db_dir + mod_dir + htdocs_dir + script_dir + temp_dir + grammar_dir + certs_dir + storage + cache_dir core_uuid zrtp_enabled nat_public_addr @@ -117,7 +129,7 @@ false - implies forbidden true - implies mandatory - default if not set is accept SAVP inbound if offered. + default if not set is accept SAVP inbound if offered. rtp_secure_media_inbound | rtp_secure_media_outbound diff --git a/configure.ac b/configure.ac index 8b0a47e478..02b5e7159c 100644 --- a/configure.ac +++ b/configure.ac @@ -84,6 +84,7 @@ default_runtimedir="$rundir" default_scriptdir="$prefix/scripts" default_soundsdir="$prefix/sounds" default_storagedir="$prefix/storage" +default_cachedir="$prefix/cache" if test "$enable_fhs" = yes; then prefix="/usr" exec_prefix="$prefix" @@ -102,6 +103,7 @@ if test "$enable_fhs" = yes; then default_scriptdir="/usr/share/freeswitch/scripts" default_soundsdir="/usr/share/freeswitch/sounds" default_storagedir="/var/lib/freeswitch/storage" + default_cachedir="/var/cache/freeswitch" fi # Where to install the modules @@ -161,6 +163,11 @@ AC_ARG_WITH([storagedir], AC_SUBST(storagedir) AC_DEFINE_UNQUOTED([SWITCH_STORAGE_DIR],"${storagedir}",[where to put storage files]) +AC_ARG_WITH([cachedir], + [AS_HELP_STRING([--with-cachedir=DIR], [Put cache files into this location (default: $prefix/cache)])], [cachedir="$withval"], [cachedir="${default_cachedir}"]) +AC_SUBST(cachedir) +AC_DEFINE_UNQUOTED([SWITCH_CACHE_DIR],"${cachedir}",[where to put cache files]) + if test "$sysconfdir" = "\${prefix}/etc" ; then confdir="$prefix/conf" else @@ -1748,5 +1755,6 @@ echo " runtimedir: ${runtimedir}" echo " scriptdir: ${scriptdir}" echo " soundsdir: ${soundsdir}" echo " storagedir: ${storagedir}" +echo " cachedir: ${cachedir}" echo "" echo "------------------------------------------------------------------------------" diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 55f1bd1614..988cd13e63 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -510,6 +510,7 @@ struct switch_directories { char *htdocs_dir; char *grammar_dir; char *storage_dir; + char *cache_dir; char *recordings_dir; char *sounds_dir; char *lib_dir; diff --git a/src/switch.c b/src/switch.c index c0d3a84f7a..2433535152 100644 --- a/src/switch.c +++ b/src/switch.c @@ -478,6 +478,7 @@ static const char usage[] = "\t-certs [directory] -- alternate directory for certificates\n" "\t-recordings [directory] -- alternate directory for recordings\n" "\t-storage [directory] -- alternate directory for voicemail storage\n" + "\t-cache [directory] -- alternate directory for cache files\n" "\t-sounds [directory] -- alternate directory for sound files\n"; @@ -929,6 +930,21 @@ int main(int argc, char *argv[]) strcpy(SWITCH_GLOBAL_dirs.storage_dir, local_argv[x]); } + else if (!strcmp(local_argv[x], "-cache")) { + x++; + if (switch_strlen_zero(local_argv[x]) || is_option(local_argv[x])) { + fprintf(stderr, "When using -cache you must specify a cache directory\n"); + return 255; + } + + SWITCH_GLOBAL_dirs.cache_dir = (char *) malloc(strlen(local_argv[x]) + 1); + if (!SWITCH_GLOBAL_dirs.cache_dir) { + fprintf(stderr, "Allocation error\n"); + return 255; + } + strcpy(SWITCH_GLOBAL_dirs.cache_dir, local_argv[x]); + } + else if (!strcmp(local_argv[x], "-recordings")) { x++; if (switch_strlen_zero(local_argv[x]) || is_option(local_argv[x])) { diff --git a/src/switch_core.c b/src/switch_core.c index b2b05e8b7a..7d5af36c28 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -726,6 +726,17 @@ SWITCH_DECLARE(void) switch_core_set_globals(void) #endif } + if (!SWITCH_GLOBAL_dirs.cache_dir && (SWITCH_GLOBAL_dirs.cache_dir = (char *) malloc(BUFSIZE))) { + if (SWITCH_GLOBAL_dirs.base_dir) + switch_snprintf(SWITCH_GLOBAL_dirs.cache_dir, BUFSIZE, "%s%scache", SWITCH_GLOBAL_dirs.base_dir, SWITCH_PATH_SEPARATOR); + else +#ifdef SWITCH_CACHE_DIR + switch_snprintf(SWITCH_GLOBAL_dirs.cache_dir, BUFSIZE, "%s", SWITCH_CACHE_DIR); +#else + switch_snprintf(SWITCH_GLOBAL_dirs.cache_dir, BUFSIZE, "%s%scache", base_dir, SWITCH_PATH_SEPARATOR); +#endif + } + if (!SWITCH_GLOBAL_dirs.db_dir && (SWITCH_GLOBAL_dirs.db_dir = (char *) malloc(BUFSIZE))) { if (SWITCH_GLOBAL_dirs.base_dir) switch_snprintf(SWITCH_GLOBAL_dirs.db_dir, BUFSIZE, "%s%sdb", SWITCH_GLOBAL_dirs.base_dir, SWITCH_PATH_SEPARATOR); @@ -1717,6 +1728,18 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc switch_core_set_variable("recordings_dir", SWITCH_GLOBAL_dirs.recordings_dir); switch_core_set_variable("sound_prefix", SWITCH_GLOBAL_dirs.sounds_dir); switch_core_set_variable("sounds_dir", SWITCH_GLOBAL_dirs.sounds_dir); + switch_core_set_variable("conf_dir", SWITCH_GLOBAL_dirs.conf_dir); + switch_core_set_variable("log_dir", SWITCH_GLOBAL_dirs.log_dir); + switch_core_set_variable("run_dir", SWITCH_GLOBAL_dirs.run_dir); + switch_core_set_variable("db_dir", SWITCH_GLOBAL_dirs.db_dir); + switch_core_set_variable("mod_dir", SWITCH_GLOBAL_dirs.mod_dir); + switch_core_set_variable("htdocs_dir", SWITCH_GLOBAL_dirs.htdocs_dir); + switch_core_set_variable("script_dir", SWITCH_GLOBAL_dirs.script_dir); + switch_core_set_variable("temp_dir", SWITCH_GLOBAL_dirs.temp_dir); + switch_core_set_variable("grammar_dir", SWITCH_GLOBAL_dirs.grammar_dir); + switch_core_set_variable("certs_dir", SWITCH_GLOBAL_dirs.certs_dir); + switch_core_set_variable("storage", SWITCH_GLOBAL_dirs.storage_dir); + switch_core_set_variable("cache_dir", SWITCH_GLOBAL_dirs.cache_dir); switch_core_set_serial(); switch_console_init(runtime.memory_pool); @@ -2702,6 +2725,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_destroy(void) switch_safe_free(SWITCH_GLOBAL_dirs.htdocs_dir); switch_safe_free(SWITCH_GLOBAL_dirs.grammar_dir); switch_safe_free(SWITCH_GLOBAL_dirs.storage_dir); + switch_safe_free(SWITCH_GLOBAL_dirs.cache_dir); switch_safe_free(SWITCH_GLOBAL_dirs.recordings_dir); switch_safe_free(SWITCH_GLOBAL_dirs.sounds_dir); switch_safe_free(SWITCH_GLOBAL_dirs.run_dir); From a159b58790cf980df375faa5a55fb713faf257c5 Mon Sep 17 00:00:00 2001 From: Russell Treleaven Date: Mon, 1 Sep 2014 08:50:51 -0400 Subject: [PATCH 02/77] fix missing "/" in path --- conf/vanilla/autoload_configs/java.conf.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/vanilla/autoload_configs/java.conf.xml b/conf/vanilla/autoload_configs/java.conf.xml index 1da38f487f..705114ac4a 100644 --- a/conf/vanilla/autoload_configs/java.conf.xml +++ b/conf/vanilla/autoload_configs/java.conf.xml @@ -1,7 +1,7 @@ - From 6146c5cb6bc9d5382aa67d14e3fb82101e59134a Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Wed, 3 Sep 2014 13:31:34 -0400 Subject: [PATCH 03/77] FS-3867: #resolve add special case for oracle alive query --- src/switch_odbc.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/switch_odbc.c b/src/switch_odbc.c index cf9c2b9d7b..04078c9c5f 100644 --- a/src/switch_odbc.c +++ b/src/switch_odbc.c @@ -56,6 +56,7 @@ struct switch_odbc_handle { switch_odbc_state_t state; char odbc_driver[256]; BOOL is_firebird; + BOOL is_oracle; int affected_rows; int num_retries; }; @@ -220,7 +221,9 @@ static int db_is_up(switch_odbc_handle_t *handle) goto done; } - if (handle->is_firebird) { + if (handle->is_oracle) { + strcpy((char *) sql, "select 1 from dual"); + } else if (handle->is_firebird) { strcpy((char *) sql, "select first 1 * from RDB$RELATIONS"); } else { strcpy((char *) sql, "select 1"); @@ -380,10 +383,15 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_connect(switch_odbc_hand handle->odbc_driver[i] = (char) toupper(handle->odbc_driver[i]); } - if (strstr(handle->odbc_driver, "FIREBIRD") != 0 || strstr(handle->odbc_driver, "FB32") != 0 || strstr(handle->odbc_driver, "FB64") != 0) { + if (strstr(handle->odbc_driver, "SQORA32.DLL") != 0 || strstr(handle->odbc_driver, "SQORA64.DLL") != 0) { + handle->is_firebird = FALSE; + handle->is_oracle = TRUE; + } else if (strstr(handle->odbc_driver, "FIREBIRD") != 0 || strstr(handle->odbc_driver, "FB32") != 0 || strstr(handle->odbc_driver, "FB64") != 0) { handle->is_firebird = TRUE; + handle->is_oracle = FALSE; } else { handle->is_firebird = FALSE; + handle->is_oracle = FALSE; } switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Connected to [%s]\n", handle->dsn); From 8c0a1d17e241622f25b9bd7cc68c575b7892adda Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Wed, 3 Sep 2014 18:11:08 +0000 Subject: [PATCH 04/77] Reintroduce memory leak in mod_hash to avoid crash ref: commit 3e24b3e2c2b28cc672943e75b009377d33f1b01b ref: FS-6783 ref: FS-6775 --- src/mod/applications/mod_hash/mod_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/applications/mod_hash/mod_hash.c b/src/mod/applications/mod_hash/mod_hash.c index 133f05de3e..587a8f20cb 100644 --- a/src/mod/applications/mod_hash/mod_hash.c +++ b/src/mod/applications/mod_hash/mod_hash.c @@ -310,7 +310,7 @@ SWITCH_LIMIT_RELEASE(limit_release_hash) switch_core_hash_delete(pvt->hash, (const char *) key); } - switch_core_hash_destroy(&pvt->hash); + //switch_core_hash_destroy(&pvt->hash); } else { char *hashkey = switch_core_session_sprintf(session, "%s_%s", realm, resource); From 82a28e76e4f8bfd26bd3d7a921d4398325d1b37f Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Wed, 3 Sep 2014 19:41:41 +0000 Subject: [PATCH 05/77] Re-fix memory leak After consideration, this still looks correct. Thanks-to: Anthony Minessale ref: FS-6783 ref: FS-6775 --- src/mod/applications/mod_hash/mod_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/applications/mod_hash/mod_hash.c b/src/mod/applications/mod_hash/mod_hash.c index 587a8f20cb..133f05de3e 100644 --- a/src/mod/applications/mod_hash/mod_hash.c +++ b/src/mod/applications/mod_hash/mod_hash.c @@ -310,7 +310,7 @@ SWITCH_LIMIT_RELEASE(limit_release_hash) switch_core_hash_delete(pvt->hash, (const char *) key); } - //switch_core_hash_destroy(&pvt->hash); + switch_core_hash_destroy(&pvt->hash); } else { char *hashkey = switch_core_session_sprintf(session, "%s_%s", realm, resource); From 7d11e199830cfbb0964f8a9b7936759fe8e5a755 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Wed, 3 Sep 2014 19:42:25 +0000 Subject: [PATCH 06/77] Check for null hash or private while holding lock What if the hash were destroyed by one thread holding the lock while another thread was waiting for the lock? The waiting thread would have already checked that the hash was non-null and would proceed on that assumption after acquiring the lock. With this commit we check only after acquiring the lock. ref: FS-6783 ref: FS-6775 --- src/mod/applications/mod_hash/mod_hash.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_hash/mod_hash.c b/src/mod/applications/mod_hash/mod_hash.c index 133f05de3e..fdc12bee2b 100644 --- a/src/mod/applications/mod_hash/mod_hash.c +++ b/src/mod/applications/mod_hash/mod_hash.c @@ -280,12 +280,13 @@ SWITCH_LIMIT_RELEASE(limit_release_hash) limit_hash_private_t *pvt = switch_channel_get_private(channel, "limit_hash"); limit_hash_item_t *item = NULL; + switch_thread_rwlock_wrlock(globals.limit_hash_rwlock); + if (!pvt || !pvt->hash) { + switch_thread_rwlock_unlock(globals.limit_hash_rwlock); return SWITCH_STATUS_SUCCESS; } - switch_thread_rwlock_wrlock(globals.limit_hash_rwlock); - /* clear for uuid */ if (realm == NULL && resource == NULL) { switch_hash_index_t *hi = NULL; From f0b9407cca6b0436d021c5eb05eab093a8248f1a Mon Sep 17 00:00:00 2001 From: Seven Du Date: Thu, 4 Sep 2014 08:43:51 +0800 Subject: [PATCH 07/77] add http utils --- src/include/switch_utils.h | 33 ++++++++ src/switch_utils.c | 149 +++++++++++++++++++++++++++++++++++++ 2 files changed, 182 insertions(+) diff --git a/src/include/switch_utils.h b/src/include/switch_utils.h index 8e019f1fb3..2c0bac8183 100644 --- a/src/include/switch_utils.h +++ b/src/include/switch_utils.h @@ -1102,6 +1102,39 @@ SWITCH_DECLARE(char *) switch_strerror_r(int errnum, char *buf, switch_size_t bu SWITCH_DECLARE(int) switch_wait_sock(switch_os_socket_t sock, uint32_t ms, switch_poll_t flags); SWITCH_DECLARE(int) switch_wait_socklist(switch_waitlist_t *waitlist, uint32_t len, uint32_t ms); +typedef struct switch_http_request_s { + const char *method; /* GET POST PUT DELETE OPTIONS PATCH HEAD */ + const char *uri; + const char *qs; /* query string*/ + const char *host; + switch_port_t port; + const char *from; + const char *user_agent; + const char *referer; + const char *user; + switch_bool_t keepalive; + switch_event_t *headers; + void *user_data; /* private user data */ + + /* private members used by the parser internally */ + char *_buffer; + const char *_unparsed_data; + switch_size_t _unparsed_len; + switch_bool_t _destroy_headers; +} switch_http_request_t; + +/** + * parse http headers in a buffer + * return status of success or not + * \param[in] buffer the buffer start from the very begining of the http request, e.g. 'GET ' + * \param[in] datalen the buffer length + * \param[out] the http request pointer or null, need destroy later if got non-NULL pointer + * \return SWITCH_STATUS_SUCCESS | SWITCH_STATUS_FALSE + */ +SWITCH_DECLARE(switch_status_t) switch_http_parse_header(char *buffer, uint32_t datalen, switch_http_request_t *request); +SWITCH_DECLARE(void) switch_http_free_request(switch_http_request_t *request); +SWITCH_DECLARE(void) switch_http_dump_request(switch_http_request_t *request); + SWITCH_END_EXTERN_C #endif /* For Emacs: diff --git a/src/switch_utils.c b/src/switch_utils.c index 3028122c92..d5de0a50f5 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -3603,6 +3603,155 @@ SWITCH_DECLARE(char *) switch_strerror_r(int errnum, char *buf, switch_size_t bu #endif } +SWITCH_DECLARE(switch_status_t) switch_http_parse_header(char *buffer, uint32_t datalen, switch_http_request_t *request) +{ + switch_status_t status = SWITCH_STATUS_FALSE; + char *p = buffer; + int i = 10; + char *http = NULL; + int header_count; + char *headers[64] = { 0 }; + int argc; + char *argv[2] = { 0 }; + char *body = NULL; + int header_len = 0; + + if (datalen < 16) return status; /* minimum GET / HTTP/1.1\r\n */ + + while(i--) { // sanity check + if (*p++ == ' ') break; + } + + if (i == 0) return status; + + if ((body = strstr(p, "\r\n\r\n"))) { + *body = '\0'; + header_len = body - buffer + 1; + body += 4; + } else if (( body = strstr(p, "\n\n"))) { + *body = '\0'; + header_len = body - buffer + 1; + body += 2; + } + + request->_buffer = strdup(buffer); + request->method = request->_buffer; + if (body && *body) { + request->_unparsed_data = body; + request->_unparsed_len = datalen - (body - buffer); + switch_assert(request->_unparsed_len > 0); + } + + p = strchr(request->method, ' '); + *p++ = '\0'; + + request->uri = p; + p = strchr(request->uri, ' '); + + if (!p) goto err; + *p++ = '\0'; + + http = p; + p = strchr(http, '\n'); + + if (!p) goto err; + + if (!strncmp(http, "HTTP/1.1", 8)) { + request->keepalive = SWITCH_TRUE; + } else if (strncmp(http, "HTTP/1.0", 8)) { + goto err; + } + + p++; // now the first header + + if (!request->headers) { + if (switch_event_create(&request->headers, SWITCH_EVENT_CHANNEL_DATA) != SWITCH_STATUS_SUCCESS) { + goto err; + } + request->_destroy_headers = SWITCH_TRUE; + } + + header_count = switch_separate_string(p, '\n', headers, sizeof(headers)/ sizeof(headers[0])); + + if (header_count < 2) goto err; /* at least two lines */ + + for (i = 0; i < header_count; i++) { + char *header, *value; + int len; + + argc = switch_separate_string(headers[i], ':', argv, 2); + + if (argc != 2) goto err; + + header = argv[0]; + value = argv[1]; + + if (*value == ' ') value++; + + len = strlen(value); + + if (len && *(value + len - 1) == '\r') *(value + len - 1) = '\0'; + + switch_event_add_header_string(request->headers, SWITCH_STACK_BOTTOM, header, value); + + if (!strncasecmp(header, "User-Agent", 10)) { + request->user_agent = value; + } else if (!strncasecmp(header, "Host", 4)) { + request->host = value; + p = strchr(value, ':'); + + if (p) { + *p++ = '\0'; + + if (*p) request->port = atoi(p); + } + } + } + + return SWITCH_STATUS_SUCCESS; + +err: + switch_http_free_request(request); + return status; +} + +SWITCH_DECLARE(void) switch_http_free_request(switch_http_request_t *request) +{ + if (request->_buffer) free(request->_buffer); + if (request->_destroy_headers && request->headers) { + switch_event_destroy(&request->headers); + } +} + +/* for debugging only */ +SWITCH_DECLARE(void) switch_http_dump_request(switch_http_request_t *request) +{ + switch_assert(request->method); + + printf("method: %s\n", request->method); + + if (request->uri) printf("uri: %s\n", request->uri); + if (request->qs) printf("qs: %s\n", request->qs); + if (request->host) printf("host: %s\n", request->host); + if (request->port) printf("port: %d\n", request->port); + if (request->from) printf("from: %s\n", request->from); + if (request->user_agent) printf("user_agent: %s\n", request->user_agent); + if (request->referer) printf("referer: %s\n", request->referer); + if (request->user) printf("user: %s\n", request->user); + if (request->keepalive) printf("uri: %d\n", request->keepalive); + if (request->_unparsed_data) printf("body: %p\n", request->_unparsed_data); + + { + switch_event_header_t *header = request->headers->headers; + + printf("headers:\n-------------------------\n"); + + while(header) { + printf("%s: %s\n", header->name, header->value); + header = header->next; + } + } +} /* For Emacs: * Local Variables: From 31f78d8cac6c0ebc613e7ec53561ee5753df5010 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Thu, 4 Sep 2014 09:00:38 +0800 Subject: [PATCH 08/77] add ability to read from a stream do not use this unless you understand what you are doing and you want to take the risk, you are warnned --- src/include/switch_cpp.h | 3 +++ src/include/switch_module_interfaces.h | 1 + src/include/switch_types.h | 1 + src/mod/languages/mod_lua/freeswitch.i | 2 ++ src/mod/languages/mod_lua/my_swigable_cpp.h | 2 ++ src/switch_cpp.cpp | 25 +++++++++++++++++++++ 6 files changed, 34 insertions(+) diff --git a/src/include/switch_cpp.h b/src/include/switch_cpp.h index 49f4c116dd..2db54e8627 100644 --- a/src/include/switch_cpp.h +++ b/src/include/switch_cpp.h @@ -3,6 +3,7 @@ #ifdef __cplusplus +#include extern "C" { #endif #ifdef DOH @@ -149,7 +150,9 @@ SWITCH_DECLARE(bool) email(char *to, char *from, char *headers = NULL, char *bod SWITCH_DECLARE_CONSTRUCTOR Stream(void); SWITCH_DECLARE_CONSTRUCTOR Stream(switch_stream_handle_t *); virtual SWITCH_DECLARE_CONSTRUCTOR ~ Stream(); + SWITCH_DECLARE(std::string) read(); SWITCH_DECLARE(void) write(const char *data); + SWITCH_DECLARE(void) raw_write(std::string data); SWITCH_DECLARE(const char *) get_data(void); }; diff --git a/src/include/switch_module_interfaces.h b/src/include/switch_module_interfaces.h index aff702962b..0f4eebf239 100644 --- a/src/include/switch_module_interfaces.h +++ b/src/include/switch_module_interfaces.h @@ -91,6 +91,7 @@ struct switch_state_handler_table { }; struct switch_stream_handle { + switch_stream_handle_read_function_t read_function; switch_stream_handle_write_function_t write_function; switch_stream_handle_raw_write_function_t raw_write_function; void *data; diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 55f1bd1614..de5c959192 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -2152,6 +2152,7 @@ typedef void (*switch_scheduler_func_t) (switch_scheduler_task_t *task); typedef switch_status_t (*switch_state_handler_t) (switch_core_session_t *); typedef struct switch_stream_handle switch_stream_handle_t; +typedef uint8_t * (*switch_stream_handle_read_function_t) (switch_stream_handle_t *handle, int *len); typedef switch_status_t (*switch_stream_handle_write_function_t) (switch_stream_handle_t *handle, const char *fmt, ...); typedef switch_status_t (*switch_stream_handle_raw_write_function_t) (switch_stream_handle_t *handle, uint8_t *data, switch_size_t datalen); diff --git a/src/mod/languages/mod_lua/freeswitch.i b/src/mod/languages/mod_lua/freeswitch.i index d94ce07fb2..4f50313588 100644 --- a/src/mod/languages/mod_lua/freeswitch.i +++ b/src/mod/languages/mod_lua/freeswitch.i @@ -43,6 +43,8 @@ %newobject API::execute; %newobject API::executeString; +%include "std_string.i" + /** * tell swig to grok everything defined in these header files and * build all sorts of c wrappers and lua shadows of the c wrappers. diff --git a/src/mod/languages/mod_lua/my_swigable_cpp.h b/src/mod/languages/mod_lua/my_swigable_cpp.h index ebe597260f..60538b7f91 100644 --- a/src/mod/languages/mod_lua/my_swigable_cpp.h +++ b/src/mod/languages/mod_lua/my_swigable_cpp.h @@ -22,7 +22,9 @@ class Stream { Stream(void); Stream(switch_stream_handle_t *); virtual ~ Stream(); + string read(); void write(const char *data); + void raw_write(void *data, int len); const char *get_data(void); }; diff --git a/src/switch_cpp.cpp b/src/switch_cpp.cpp index 778c53d20e..df45e6a1da 100644 --- a/src/switch_cpp.cpp +++ b/src/switch_cpp.cpp @@ -531,12 +531,37 @@ SWITCH_DECLARE_CONSTRUCTOR Stream::~Stream() } } +/* WARNING!! you are not encouraged to use this unless you understand the risk!!! */ +SWITCH_DECLARE(std::string) Stream::read() +{ + uint8_t *buff; + this_check(std::string("")); + int len = 0; + + this_check(std::string()); + + if (!stream_p->read_function) return std::string(); + + buff = stream_p->read_function(stream_p, &len); + + if (!buff) return std::string(); + if (len < 0) return std::string(); + + return std::string((const char *)buff, len); +} + SWITCH_DECLARE(void) Stream::write(const char *data) { this_check_void(); stream_p->write_function(stream_p, "%s", data); } +SWITCH_DECLARE(void) Stream::raw_write(std::string data) +{ + this_check_void(); + stream_p->raw_write_function(stream_p, (uint8_t *)data.c_str(), data.length()); +} + SWITCH_DECLARE(const char *)Stream::get_data() { this_check(""); From 1f2671233092c00dd9bbbc52de3a5eceb60625f4 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Thu, 4 Sep 2014 10:13:45 +0800 Subject: [PATCH 09/77] swig hack --- src/mod/languages/mod_lua/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mod/languages/mod_lua/Makefile.am b/src/mod/languages/mod_lua/Makefile.am index 2a0b51e933..d727bf88b6 100644 --- a/src/mod/languages/mod_lua/Makefile.am +++ b/src/mod/languages/mod_lua/Makefile.am @@ -33,4 +33,5 @@ lua_wrap: mod_lua_extra.c swig -lua -c++ -I../../../../src/include -oh mod_lua_wrap.h -o mod_lua_wrap.cpp freeswitch.i echo "#include \"mod_lua_extra.c\"" >> mod_lua_wrap.cpp patch -s -p0 -i hack.diff + sed -i -e 's/lua_strlen/lua_rawlen/' mod_lua_wrap.cpp From 602e82d4836944bb5a80bceb8724007524a79f27 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Thu, 4 Sep 2014 10:21:22 +0800 Subject: [PATCH 10/77] add param to let the socket stay open even if not websockt, thanks Anthony --- src/mod/endpoints/mod_verto/ws.c | 15 ++++++++------- src/mod/endpoints/mod_verto/ws.h | 3 ++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/mod/endpoints/mod_verto/ws.c b/src/mod/endpoints/mod_verto/ws.c index 2153855b08..70c91fb59c 100644 --- a/src/mod/endpoints/mod_verto/ws.c +++ b/src/mod/endpoints/mod_verto/ws.c @@ -312,15 +312,15 @@ int ws_handshake(wsh_t *wsh) err: - snprintf(respond, sizeof(respond), "HTTP/1.1 400 Bad Request\r\n" - "Sec-WebSocket-Version: 13\r\n\r\n"); + if (!wsh->stay_open) { - //printf("ERR:\n%s\n", respond); + snprintf(respond, sizeof(respond), "HTTP/1.1 400 Bad Request\r\n" + "Sec-WebSocket-Version: 13\r\n\r\n"); + ws_raw_write(wsh, respond, strlen(respond)); - ws_raw_write(wsh, respond, strlen(respond)); - - ws_close(wsh, WS_NONE); + ws_close(wsh, WS_NONE); + } return -1; @@ -538,7 +538,7 @@ static int establish_logical_layer(wsh_t *wsh) } -int ws_init(wsh_t *wsh, ws_socket_t sock, SSL_CTX *ssl_ctx, int close_sock, int block) +int ws_init(wsh_t *wsh, ws_socket_t sock, SSL_CTX *ssl_ctx, int close_sock, int block, int stay_open) { memset(wsh, 0, sizeof(*wsh)); @@ -546,6 +546,7 @@ int ws_init(wsh_t *wsh, ws_socket_t sock, SSL_CTX *ssl_ctx, int close_sock, int wsh->block = block; wsh->sanity = 5000; wsh->ssl_ctx = ssl_ctx; + wsh->stay_open = stay_open; if (!ssl_ctx) { ssl_ctx = ws_globals.ssl_ctx; diff --git a/src/mod/endpoints/mod_verto/ws.h b/src/mod/endpoints/mod_verto/ws.h index b4d30b47f2..37a3b9e401 100644 --- a/src/mod/endpoints/mod_verto/ws.h +++ b/src/mod/endpoints/mod_verto/ws.h @@ -88,6 +88,7 @@ typedef struct wsh_s { int sanity; int secure_established; int logical_established; + int stay_open; int x; void *write_buffer; size_t write_buffer_len; @@ -101,7 +102,7 @@ ssize_t ws_raw_read(wsh_t *wsh, void *data, size_t bytes, int block); ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes); ssize_t ws_read_frame(wsh_t *wsh, ws_opcode_t *oc, uint8_t **data); ssize_t ws_write_frame(wsh_t *wsh, ws_opcode_t oc, void *data, size_t bytes); -int ws_init(wsh_t *wsh, ws_socket_t sock, SSL_CTX *ssl_ctx, int close_sock, int block); +int ws_init(wsh_t *wsh, ws_socket_t sock, SSL_CTX *ssl_ctx, int close_sock, int block, int stay_open); ssize_t ws_close(wsh_t *wsh, int16_t reason); void ws_destroy(wsh_t *wsh); void init_ssl(void); From b2554848a11d18727350e7fe4c39e9f2264e696c Mon Sep 17 00:00:00 2001 From: Seven Du Date: Thu, 4 Sep 2014 10:24:19 +0800 Subject: [PATCH 11/77] initial support of http handing in mod_verto --- src/mod/endpoints/mod_verto/mod_verto.c | 173 +++++++++++++++++++++++- src/mod/endpoints/mod_verto/mod_verto.h | 2 +- 2 files changed, 172 insertions(+), 3 deletions(-) diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c index 2782380ba7..66905d3632 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.c +++ b/src/mod/endpoints/mod_verto/mod_verto.c @@ -1279,6 +1279,167 @@ static void jsock_check_event_queue(jsock_t *jsock) switch_mutex_unlock(jsock->write_mutex); } +/* DO NOT use this unless you know what you are doing, you are WARNNED!!! */ +static uint8_t *http_stream_read(switch_stream_handle_t *handle, int *len) +{ + switch_http_request_t *r = (switch_http_request_t *) handle->data; + jsock_t *jsock = r->user_data; + wsh_t *wsh = &jsock->ws; + + *len = r->_unparsed_len; + + if (*len) { // we already read part of the body + r->_unparsed_len = 0; // reset for the next read + return (uint8_t *)r->_unparsed_data; + } + + if ((*len = ws_raw_read(wsh, wsh->buffer, 4096, wsh->block)) < 0) { + return NULL; + } + + return (uint8_t *)wsh->buffer; +} + +static switch_status_t http_stream_raw_write(switch_stream_handle_t *handle, uint8_t *data, switch_size_t datalen) +{ + switch_http_request_t *r = (switch_http_request_t *) handle->data; + jsock_t *jsock = r->user_data; + + return ws_raw_write(&jsock->ws, data, (uint32_t)datalen) ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE; +} + +static switch_status_t http_stream_write(switch_stream_handle_t *handle, const char *fmt, ...) +{ + switch_http_request_t *r = (switch_http_request_t *) handle->data; + jsock_t *jsock = r->user_data; + int ret = 1; + char *data; + va_list ap; + + va_start(ap, fmt); + ret = switch_vasprintf(&data, fmt, ap); + va_end(ap); + + if (data) { + if (ret) { + ret = ws_raw_write(&jsock->ws, data, (uint32_t)strlen(data)); + } + switch_safe_free(data); + } + + return ret ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE; +} + +static void http_static_handler(switch_http_request_t *request) +{ + jsock_t *jsock = request->user_data; + char path[512]; + switch_file_t *fd; + char *ext; + uint8_t chunk[4096]; + const char *mime_type = "text/html", *new_type; + + switch_snprintf(path, sizeof(path), "%s%s", jsock->profile->htdocs, request->uri); + + printf("local path: %s\n", path); + + if (end_of(path) == '/') { + char *data = "HTTP/1.1 500 Internal Error\r\n" + "Connection: close\r\n" + "Content-Type: text/plain\r\n\r\n" + "Directory indexing is UNSUPPORTED!\r\n"; + ws_raw_write(&jsock->ws, data, strlen(data)); + return; + } + + if ((ext = strrchr(path, '.'))) { + ext++; + if ((new_type = switch_core_mime_ext2type(ext))) { + mime_type = new_type; + } + } + + if (switch_file_open(&fd, path, SWITCH_FOPEN_READ, SWITCH_FPROT_UREAD | SWITCH_FPROT_UWRITE, jsock->pool) == SWITCH_STATUS_SUCCESS) { + switch_size_t flen = switch_file_get_size(fd); + switch_snprintf((char *)chunk, sizeof(chunk), + "HTTP/1.1 200 OK\r\n" + "Connection: close\r\n" + "Date: %s\r\n" + "Server: FreeSWITCH-%s-mod_verto\r\n" + "Content-Type: %s\r\n" + "Content-Length: %" SWITCH_SIZE_T_FMT "\r\n\r\n", + switch_event_get_header(request->headers, "Event-Date-GMT"), + switch_version_full(), + mime_type, + flen); + + ws_raw_write(&jsock->ws, chunk, strlen((char *)chunk)); + + for (;;) { + switch_status_t status; + + flen = sizeof(chunk); + status = switch_file_read(fd, chunk, &flen); + + if (status != SWITCH_STATUS_SUCCESS || flen == 0) { + break; + } + + ws_raw_write(&jsock->ws, chunk, flen); + } + switch_file_close(fd); + } else { + char *data = "HTTP/1.1 404 Not Found\r\n" + "Connection: close\r\n\r\n"; + ws_raw_write(&jsock->ws, data, strlen(data)); + } +} + +static void http_run(jsock_t *jsock) +{ + switch_http_request_t request = { 0 }; + switch_stream_handle_t stream = { 0 }; + char *data; + + request.user_data = jsock; + + if (switch_event_create(&stream.param_event, SWITCH_EVENT_CHANNEL_DATA) != SWITCH_STATUS_SUCCESS) { + goto err; + } + + request.headers = stream.param_event; + if (switch_http_parse_header(jsock->ws.buffer, jsock->ws.datalen, &request) != SWITCH_STATUS_SUCCESS) { + switch_event_destroy(&stream.param_event); + goto err; + } + + switch_http_dump_request(&request); + + /* TODO: parse virtual hosts here */ + + stream.data = &request; + stream.read_function = http_stream_read; + stream.write_function = http_stream_write; + stream.raw_write_function = http_stream_raw_write; + + switch_event_add_header_string(request.headers, SWITCH_STACK_BOTTOM, "Request-Method", request.method); + switch_event_add_header_string(request.headers, SWITCH_STACK_BOTTOM, "HTTP-URI", request.uri); + + if (!strncmp(request.uri, "/rest/", 6)) { + switch_api_execute("lua", "__rest_init__.lua", NULL, &stream); + } else { + http_static_handler(&request); + } + + switch_http_free_request(&request); + return; + +err: + data = "HTTP/1.1 500 Internal Server Error\r\n" + "Connection: close\r\n\r\n"; + ws_raw_write(&jsock->ws, data, strlen(data)); +} + static void client_run(jsock_t *jsock) { @@ -1287,8 +1448,14 @@ static void client_run(jsock_t *jsock) jsock->local_addr.sin_port = 0; - if (ws_init(&jsock->ws, jsock->client_socket, (jsock->ptype & PTYPE_CLIENT_SSL) ? jsock->profile->ssl_ctx : NULL, 0, 1) < 0) { - die("%s WS SETUP FAILED", jsock->name); + if (ws_init(&jsock->ws, jsock->client_socket, (jsock->ptype & PTYPE_CLIENT_SSL) ? jsock->profile->ssl_ctx : NULL, 0, 1, !!jsock->profile->htdocs) < 0) { + if (jsock->profile->htdocs) { + http_run(jsock); + ws_close(&jsock->ws, WS_NONE); + goto error; + } else { + die("%s WS SETUP FAILED [%s]", jsock->name, jsock->ws.buffer); + } } while(jsock->profile->running) { @@ -3654,6 +3821,8 @@ static switch_status_t parse_config(const char *cf) } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Max Bindings Reached!\n"); } + } else if (!strcasecmp(var, "htdocs-directory")) { + profile->htdocs = switch_core_strdup(profile->pool, val); } else if (!strcasecmp(var, "secure-combined")) { set_string(profile->cert, val); set_string(profile->key, val); diff --git a/src/mod/endpoints/mod_verto/mod_verto.h b/src/mod/endpoints/mod_verto/mod_verto.h index d372e905d1..a17aff52c4 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.h +++ b/src/mod/endpoints/mod_verto/mod_verto.h @@ -220,7 +220,7 @@ struct verto_profile_s { char *timer_name; char *local_network; - + char *htdocs; struct verto_profile_s *next; }; From a80f1d352434c2aae19f6cc22023e7fd3c74b1ba Mon Sep 17 00:00:00 2001 From: Seven Du Date: Thu, 4 Sep 2014 10:31:23 +0800 Subject: [PATCH 12/77] swig all --- .../src/org/freeswitch/swig/Stream.java | 8 + .../org/freeswitch/swig/freeswitchJNI.java | 2 + .../languages/mod_java/switch_swig_wrap.cpp | 34 ++ src/mod/languages/mod_lua/mod_lua_wrap.cpp | 357 +++++++++++++++++- src/mod/languages/mod_perl/freeswitch.pm | 2 + src/mod/languages/mod_perl/mod_perl_wrap.cpp | 110 +++++- src/mod/languages/mod_python/freeswitch.py | 2 + .../languages/mod_python/mod_python_wrap.cpp | 101 ++++- .../legacy/languages/mod_lua/mod_lua_wrap.cpp | 102 ++++- 9 files changed, 650 insertions(+), 68 deletions(-) diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/Stream.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/Stream.java index 63f8da2647..bd99bbc43b 100644 --- a/src/mod/languages/mod_java/src/org/freeswitch/swig/Stream.java +++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/Stream.java @@ -41,10 +41,18 @@ public class Stream { this(freeswitchJNI.new_Stream__SWIG_1(SWIGTYPE_p_switch_stream_handle_t.getCPtr(arg0)), true); } + public SWIGTYPE_p_std__string read() { + return new SWIGTYPE_p_std__string(freeswitchJNI.Stream_read(swigCPtr, this), true); + } + public void write(String data) { freeswitchJNI.Stream_write(swigCPtr, this, data); } + public void raw_write(SWIGTYPE_p_std__string data) { + freeswitchJNI.Stream_raw_write(swigCPtr, this, SWIGTYPE_p_std__string.getCPtr(data)); + } + public String get_data() { return freeswitchJNI.Stream_get_data(swigCPtr, this); } diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java index 8204194fae..6e8f6aee86 100644 --- a/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java +++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java @@ -47,7 +47,9 @@ class freeswitchJNI { public final static native long new_Stream__SWIG_0(); public final static native long new_Stream__SWIG_1(long jarg1); public final static native void delete_Stream(long jarg1); + public final static native long Stream_read(long jarg1, Stream jarg1_); public final static native void Stream_write(long jarg1, Stream jarg1_, String jarg2); + public final static native void Stream_raw_write(long jarg1, Stream jarg1_, long jarg2); public final static native String Stream_get_data(long jarg1, Stream jarg1_); public final static native void Event_event_set(long jarg1, Event jarg1_, long jarg2); public final static native long Event_event_get(long jarg1, Event jarg1_); diff --git a/src/mod/languages/mod_java/switch_swig_wrap.cpp b/src/mod/languages/mod_java/switch_swig_wrap.cpp index 0c177274b0..115707859e 100644 --- a/src/mod/languages/mod_java/switch_swig_wrap.cpp +++ b/src/mod/languages/mod_java/switch_swig_wrap.cpp @@ -972,6 +972,21 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_delete_1Stream(JN } +SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_Stream_1read(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlong jresult = 0 ; + Stream *arg1 = (Stream *) 0 ; + std::string result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Stream **)&jarg1; + result = (arg1)->read(); + *(std::string **)&jresult = new std::string((std::string &)result); + return jresult; +} + + SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_Stream_1write(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { Stream *arg1 = (Stream *) 0 ; char *arg2 = (char *) 0 ; @@ -990,6 +1005,25 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_Stream_1write(JNI } +SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_Stream_1raw_1write(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { + Stream *arg1 = (Stream *) 0 ; + std::string arg2 ; + std::string *argp2 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(Stream **)&jarg1; + argp2 = *(std::string **)&jarg2; + if (!argp2) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null std::string"); + return ; + } + arg2 = *argp2; + (arg1)->raw_write(arg2); +} + + SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_Stream_1get_1data(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { jstring jresult = 0 ; Stream *arg1 = (Stream *) 0 ; diff --git a/src/mod/languages/mod_lua/mod_lua_wrap.cpp b/src/mod/languages/mod_lua/mod_lua_wrap.cpp index bf06a26019..1c761e892b 100644 --- a/src/mod/languages/mod_lua/mod_lua_wrap.cpp +++ b/src/mod/languages/mod_lua/mod_lua_wrap.cpp @@ -1498,23 +1498,24 @@ SWIG_Lua_dostring(lua_State *L, const char* str) { #define SWIGTYPE_p_lua_State swig_types[11] #define SWIGTYPE_p_p_switch_event_node_t swig_types[12] #define SWIGTYPE_p_session_flag_t swig_types[13] -#define SWIGTYPE_p_switch_call_cause_t swig_types[14] -#define SWIGTYPE_p_switch_channel_state_t swig_types[15] -#define SWIGTYPE_p_switch_channel_t swig_types[16] -#define SWIGTYPE_p_switch_core_session_t swig_types[17] -#define SWIGTYPE_p_switch_event_t swig_types[18] -#define SWIGTYPE_p_switch_event_types_t swig_types[19] -#define SWIGTYPE_p_switch_input_args_t swig_types[20] -#define SWIGTYPE_p_switch_input_type_t swig_types[21] -#define SWIGTYPE_p_switch_priority_t swig_types[22] -#define SWIGTYPE_p_switch_queue_t swig_types[23] -#define SWIGTYPE_p_switch_state_handler_table_t swig_types[24] -#define SWIGTYPE_p_switch_status_t swig_types[25] -#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_p_std__string swig_types[14] +#define SWIGTYPE_p_switch_call_cause_t swig_types[15] +#define SWIGTYPE_p_switch_channel_state_t swig_types[16] +#define SWIGTYPE_p_switch_channel_t swig_types[17] +#define SWIGTYPE_p_switch_core_session_t swig_types[18] +#define SWIGTYPE_p_switch_event_t swig_types[19] +#define SWIGTYPE_p_switch_event_types_t swig_types[20] +#define SWIGTYPE_p_switch_input_args_t swig_types[21] +#define SWIGTYPE_p_switch_input_type_t swig_types[22] +#define SWIGTYPE_p_switch_priority_t swig_types[23] +#define SWIGTYPE_p_switch_queue_t swig_types[24] +#define SWIGTYPE_p_switch_state_handler_table_t swig_types[25] +#define SWIGTYPE_p_switch_status_t swig_types[26] +#define SWIGTYPE_p_switch_stream_handle_t swig_types[27] +#define SWIGTYPE_p_uint32_t swig_types[28] +#define SWIGTYPE_p_void swig_types[29] +static swig_type_info *swig_types[31]; +static swig_module_info swig_module = {swig_types, 30, 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) @@ -1536,9 +1537,273 @@ typedef struct{} LANGUAGE_OBJ; #include "switch_cpp.h" #include "freeswitch_lua.h" + + #include + #ifdef __cplusplus extern "C" { #endif +static int _wrap_new_string__SWIG_0(lua_State* L) { + int SWIG_arg = -1; + std::string *result = 0 ; + + SWIG_check_num_args("std::string",0,0) + result = (std::string *)new std::string(); + SWIG_arg=0; + SWIG_NewPointerObj(L,result,SWIGTYPE_p_std__string,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_string__SWIG_1(lua_State* L) { + int SWIG_arg = -1; + char *arg1 = (char *) 0 ; + std::string *result = 0 ; + + SWIG_check_num_args("std::string",1,1) + if(!lua_isstring(L,1)) SWIG_fail_arg("std::string",1,"char const *"); + arg1 = (char *)lua_tostring(L, 1); + result = (std::string *)new std::string((char const *)arg1); + SWIG_arg=0; + SWIG_NewPointerObj(L,result,SWIGTYPE_p_std__string,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_string(lua_State* L) { + int argc; + int argv[2]={ + 1,2 + }; + + argc = lua_gettop(L); + if (argc == 0) { + return _wrap_new_string__SWIG_0(L); + } + if (argc == 1) { + int _v; + { + _v = lua_isstring(L,argv[0]); + } + if (_v) { + return _wrap_new_string__SWIG_1(L); + } + } + + lua_pushstring(L,"No matching function for overloaded 'new_string'"); + lua_error(L);return 0; +} + + +static int _wrap_string_size(lua_State* L) { + int SWIG_arg = -1; + std::string *arg1 = (std::string *) 0 ; + unsigned int result; + + SWIG_check_num_args("size",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("size",1,"std::string const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_size",1,SWIGTYPE_p_std__string); + } + + result = (unsigned int)((std::string const *)arg1)->size(); + 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; +} + + +static int _wrap_string_length(lua_State* L) { + int SWIG_arg = -1; + std::string *arg1 = (std::string *) 0 ; + unsigned int result; + + SWIG_check_num_args("length",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("length",1,"std::string const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_length",1,SWIGTYPE_p_std__string); + } + + result = (unsigned int)((std::string const *)arg1)->length(); + 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; +} + + +static int _wrap_string_empty(lua_State* L) { + int SWIG_arg = -1; + std::string *arg1 = (std::string *) 0 ; + bool result; + + SWIG_check_num_args("empty",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("empty",1,"std::string const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_empty",1,SWIGTYPE_p_std__string); + } + + result = (bool)((std::string const *)arg1)->empty(); + SWIG_arg=0; + lua_pushboolean(L,(int)(result==true)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_string_c_str(lua_State* L) { + int SWIG_arg = -1; + std::string *arg1 = (std::string *) 0 ; + char *result = 0 ; + + SWIG_check_num_args("c_str",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("c_str",1,"std::string const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_c_str",1,SWIGTYPE_p_std__string); + } + + result = (char *)((std::string const *)arg1)->c_str(); + SWIG_arg=0; + lua_pushstring(L,(const char*)result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_string_data(lua_State* L) { + int SWIG_arg = -1; + std::string *arg1 = (std::string *) 0 ; + char *result = 0 ; + + SWIG_check_num_args("data",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("data",1,"std::string const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_data",1,SWIGTYPE_p_std__string); + } + + result = (char *)((std::string const *)arg1)->data(); + SWIG_arg=0; + lua_pushstring(L,(const char*)result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_string_assign(lua_State* L) { + int SWIG_arg = -1; + std::string *arg1 = (std::string *) 0 ; + char *arg2 = (char *) 0 ; + + SWIG_check_num_args("assign",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("assign",1,"std::string *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("assign",2,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_assign",1,SWIGTYPE_p_std__string); + } + + arg2 = (char *)lua_tostring(L, 2); + (arg1)->assign((char const *)arg2); + SWIG_arg=0; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_delete_string(lua_State* L) { + int SWIG_arg = -1; + std::string *arg1 = (std::string *) 0 ; + + SWIG_check_num_args("std::string::~string",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::~string",1,"std::string *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,SWIG_POINTER_DISOWN))){ + SWIG_fail_ptr("delete_string",1,SWIGTYPE_p_std__string); + } + + delete arg1; + + SWIG_arg=0; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_string(void *obj) { +std::string *arg1 = (std::string *) obj; +delete arg1; +} +static swig_lua_method swig_std_string_methods[] = { + {"size", _wrap_string_size}, + {"length", _wrap_string_length}, + {"empty", _wrap_string_empty}, + {"c_str", _wrap_string_c_str}, + {"data", _wrap_string_data}, + {"assign", _wrap_string_assign}, + {0,0} +}; +static swig_lua_attribute swig_std_string_attributes[] = { + {0,0,0} +}; +static swig_lua_class *swig_std_string_bases[] = {0}; +static const char *swig_std_string_base_names[] = {0}; +static swig_lua_class _wrap_class_std_string = { "string", &SWIGTYPE_p_std__string,_wrap_new_string, swig_delete_string, swig_std_string_methods, swig_std_string_attributes, swig_std_string_bases, swig_std_string_base_names }; + static int _wrap_setGlobalVariable(lua_State* L) { int SWIG_arg = -1; char *arg1 = (char *) 0 ; @@ -2626,6 +2891,31 @@ fail: } +static int _wrap_Stream_read(lua_State* L) { + int SWIG_arg = -1; + Stream *arg1 = (Stream *) 0 ; + std::string result; + + SWIG_check_num_args("read",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("read",1,"Stream *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){ + SWIG_fail_ptr("Stream_read",1,SWIGTYPE_p_Stream); + } + + result = (arg1)->read(); + SWIG_arg=0; + lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + static int _wrap_Stream_write(lua_State* L) { int SWIG_arg = -1; Stream *arg1 = (Stream *) 0 ; @@ -2653,6 +2943,33 @@ fail: } +static int _wrap_Stream_raw_write(lua_State* L) { + int SWIG_arg = -1; + Stream *arg1 = (Stream *) 0 ; + std::string arg2 ; + + SWIG_check_num_args("raw_write",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("raw_write",1,"Stream *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("raw_write",2,"std::string"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){ + SWIG_fail_ptr("Stream_raw_write",1,SWIGTYPE_p_Stream); + } + + (&arg2)->assign(lua_tostring(L,2),lua_rawlen(L,2)); + (arg1)->raw_write(arg2); + SWIG_arg=0; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + static int _wrap_Stream_get_data(lua_State* L) { int SWIG_arg = -1; Stream *arg1 = (Stream *) 0 ; @@ -2683,7 +3000,9 @@ Stream *arg1 = (Stream *) obj; delete arg1; } static swig_lua_method swig_Stream_methods[] = { + {"read", _wrap_Stream_read}, {"write", _wrap_Stream_write}, + {"raw_write", _wrap_Stream_raw_write}, {"get_data", _wrap_Stream_get_data}, {0,0} }; @@ -8067,6 +8386,7 @@ static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state 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}; +static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)&_wrap_class_std_string, 0}; static swig_type_info _swigt__p_switch_call_cause_t = {"_p_switch_call_cause_t", "switch_call_cause_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_state_t = {"_p_switch_channel_state_t", "switch_channel_state_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_t = {"_p_switch_channel_t", "switch_channel_t *", 0, 0, (void*)0, 0}; @@ -8098,6 +8418,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_lua_State, &_swigt__p_p_switch_event_node_t, &_swigt__p_session_flag_t, + &_swigt__p_std__string, &_swigt__p_switch_call_cause_t, &_swigt__p_switch_channel_state_t, &_swigt__p_switch_channel_t, @@ -8129,6 +8450,7 @@ static swig_cast_info _swigc__p_input_callback_state[] = { {&_swigt__p_input_ca static swig_cast_info _swigc__p_lua_State[] = { {&_swigt__p_lua_State, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_switch_event_node_t[] = { {&_swigt__p_p_switch_event_node_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_session_flag_t[] = { {&_swigt__p_session_flag_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__string[] = { {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_call_cause_t[] = { {&_swigt__p_switch_call_cause_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_state_t[] = { {&_swigt__p_switch_channel_state_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_t[] = { {&_swigt__p_switch_channel_t, 0, 0, 0},{0, 0, 0, 0}}; @@ -8160,6 +8482,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_lua_State, _swigc__p_p_switch_event_node_t, _swigc__p_session_flag_t, + _swigc__p_std__string, _swigc__p_switch_call_cause_t, _swigc__p_switch_channel_state_t, _swigc__p_switch_channel_t, diff --git a/src/mod/languages/mod_perl/freeswitch.pm b/src/mod/languages/mod_perl/freeswitch.pm index c8e57832b1..f8b56f02bc 100644 --- a/src/mod/languages/mod_perl/freeswitch.pm +++ b/src/mod/languages/mod_perl/freeswitch.pm @@ -252,7 +252,9 @@ sub DESTROY { } } +*read = *freeswitchc::Stream_read; *write = *freeswitchc::Stream_write; +*raw_write = *freeswitchc::Stream_raw_write; *get_data = *freeswitchc::Stream_get_data; sub DISOWN { my $self = shift; diff --git a/src/mod/languages/mod_perl/mod_perl_wrap.cpp b/src/mod/languages/mod_perl/mod_perl_wrap.cpp index dfaebd8aa7..87885f798d 100644 --- a/src/mod/languages/mod_perl/mod_perl_wrap.cpp +++ b/src/mod/languages/mod_perl/mod_perl_wrap.cpp @@ -1459,23 +1459,24 @@ SWIG_Perl_SetModule(swig_module_info *module) { #define SWIGTYPE_p_input_callback_state swig_types[10] #define SWIGTYPE_p_p_switch_event_node_t swig_types[11] #define SWIGTYPE_p_session_flag_t swig_types[12] -#define SWIGTYPE_p_switch_call_cause_t swig_types[13] -#define SWIGTYPE_p_switch_channel_state_t swig_types[14] -#define SWIGTYPE_p_switch_channel_t swig_types[15] -#define SWIGTYPE_p_switch_core_session_t swig_types[16] -#define SWIGTYPE_p_switch_event_t swig_types[17] -#define SWIGTYPE_p_switch_event_types_t swig_types[18] -#define SWIGTYPE_p_switch_input_args_t swig_types[19] -#define SWIGTYPE_p_switch_input_type_t swig_types[20] -#define SWIGTYPE_p_switch_priority_t swig_types[21] -#define SWIGTYPE_p_switch_queue_t swig_types[22] -#define SWIGTYPE_p_switch_state_handler_table_t swig_types[23] -#define SWIGTYPE_p_switch_status_t swig_types[24] -#define SWIGTYPE_p_switch_stream_handle_t swig_types[25] -#define SWIGTYPE_p_uint32_t swig_types[26] -#define SWIGTYPE_p_void swig_types[27] -static swig_type_info *swig_types[29]; -static swig_module_info swig_module = {swig_types, 28, 0, 0, 0, 0}; +#define SWIGTYPE_p_std__string swig_types[13] +#define SWIGTYPE_p_switch_call_cause_t swig_types[14] +#define SWIGTYPE_p_switch_channel_state_t swig_types[15] +#define SWIGTYPE_p_switch_channel_t swig_types[16] +#define SWIGTYPE_p_switch_core_session_t swig_types[17] +#define SWIGTYPE_p_switch_event_t swig_types[18] +#define SWIGTYPE_p_switch_event_types_t swig_types[19] +#define SWIGTYPE_p_switch_input_args_t swig_types[20] +#define SWIGTYPE_p_switch_input_type_t swig_types[21] +#define SWIGTYPE_p_switch_priority_t swig_types[22] +#define SWIGTYPE_p_switch_queue_t swig_types[23] +#define SWIGTYPE_p_switch_state_handler_table_t swig_types[24] +#define SWIGTYPE_p_switch_status_t swig_types[25] +#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 SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -3399,6 +3400,34 @@ XS(_wrap_delete_Stream) { } +XS(_wrap_Stream_read) { + { + Stream *arg1 = (Stream *) 0 ; + std::string result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: Stream_read(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Stream, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Stream_read" "', argument " "1"" of type '" "Stream *""'"); + } + arg1 = reinterpret_cast< Stream * >(argp1); + result = (arg1)->read(); + ST(argvi) = SWIG_NewPointerObj((new std::string(static_cast< const std::string& >(result))), SWIGTYPE_p_std__string, SWIG_POINTER_OWN | 0); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + XS(_wrap_Stream_write) { { Stream *arg1 = (Stream *) 0 ; @@ -3437,6 +3466,47 @@ XS(_wrap_Stream_write) { } +XS(_wrap_Stream_raw_write) { + { + Stream *arg1 = (Stream *) 0 ; + std::string arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 ; + int res2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: Stream_raw_write(self,data);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Stream, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Stream_raw_write" "', argument " "1"" of type '" "Stream *""'"); + } + arg1 = reinterpret_cast< Stream * >(argp1); + { + res2 = SWIG_ConvertPtr(ST(1), &argp2, SWIGTYPE_p_std__string, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Stream_raw_write" "', argument " "2"" of type '" "std::string""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Stream_raw_write" "', argument " "2"" of type '" "std::string""'"); + } else { + arg2 = *(reinterpret_cast< std::string * >(argp2)); + } + } + (arg1)->raw_write(arg2); + + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + XS(_wrap_Stream_get_data) { { Stream *arg1 = (Stream *) 0 ; @@ -9909,6 +9979,7 @@ static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state", "input_callback_state_t *|input_callback_state *", 0, 0, (void*)"freeswitch::input_callback_state_t", 0}; 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}; +static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_call_cause_t = {"_p_switch_call_cause_t", "switch_call_cause_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_state_t = {"_p_switch_channel_state_t", "switch_channel_state_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_t = {"_p_switch_channel_t", "switch_channel_t *", 0, 0, (void*)0, 0}; @@ -9939,6 +10010,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_input_callback_state, &_swigt__p_p_switch_event_node_t, &_swigt__p_session_flag_t, + &_swigt__p_std__string, &_swigt__p_switch_call_cause_t, &_swigt__p_switch_channel_state_t, &_swigt__p_switch_channel_t, @@ -9969,6 +10041,7 @@ static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 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_p_switch_event_node_t[] = { {&_swigt__p_p_switch_event_node_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_session_flag_t[] = { {&_swigt__p_session_flag_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__string[] = { {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_call_cause_t[] = { {&_swigt__p_switch_call_cause_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_state_t[] = { {&_swigt__p_switch_channel_state_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_t[] = { {&_swigt__p_switch_channel_t, 0, 0, 0},{0, 0, 0, 0}}; @@ -9999,6 +10072,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_input_callback_state, _swigc__p_p_switch_event_node_t, _swigc__p_session_flag_t, + _swigc__p_std__string, _swigc__p_switch_call_cause_t, _swigc__p_switch_channel_state_t, _swigc__p_switch_channel_t, @@ -10063,7 +10137,9 @@ static swig_command_info swig_commands[] = { {"freeswitchc::delete_DTMF", _wrap_delete_DTMF}, {"freeswitchc::new_Stream", _wrap_new_Stream}, {"freeswitchc::delete_Stream", _wrap_delete_Stream}, +{"freeswitchc::Stream_read", _wrap_Stream_read}, {"freeswitchc::Stream_write", _wrap_Stream_write}, +{"freeswitchc::Stream_raw_write", _wrap_Stream_raw_write}, {"freeswitchc::Stream_get_data", _wrap_Stream_get_data}, {"freeswitchc::Event_event_set", _wrap_Event_event_set}, {"freeswitchc::Event_event_get", _wrap_Event_event_get}, diff --git a/src/mod/languages/mod_python/freeswitch.py b/src/mod/languages/mod_python/freeswitch.py index 0420994ea7..e2831b47db 100644 --- a/src/mod/languages/mod_python/freeswitch.py +++ b/src/mod/languages/mod_python/freeswitch.py @@ -153,7 +153,9 @@ class Stream(_object): except: self.this = this __swig_destroy__ = _freeswitch.delete_Stream __del__ = lambda self : None; + def read(*args): return _freeswitch.Stream_read(*args) def write(*args): return _freeswitch.Stream_write(*args) + def raw_write(*args): return _freeswitch.Stream_raw_write(*args) def get_data(*args): return _freeswitch.Stream_get_data(*args) Stream_swigregister = _freeswitch.Stream_swigregister Stream_swigregister(Stream) diff --git a/src/mod/languages/mod_python/mod_python_wrap.cpp b/src/mod/languages/mod_python/mod_python_wrap.cpp index 1386a9814f..3b2198bc2f 100644 --- a/src/mod/languages/mod_python/mod_python_wrap.cpp +++ b/src/mod/languages/mod_python/mod_python_wrap.cpp @@ -2507,23 +2507,24 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) #define SWIGTYPE_p_input_callback_state swig_types[9] #define SWIGTYPE_p_p_switch_event_node_t swig_types[10] #define SWIGTYPE_p_session_flag_t swig_types[11] -#define SWIGTYPE_p_switch_call_cause_t swig_types[12] -#define SWIGTYPE_p_switch_channel_state_t swig_types[13] -#define SWIGTYPE_p_switch_channel_t swig_types[14] -#define SWIGTYPE_p_switch_core_session_t swig_types[15] -#define SWIGTYPE_p_switch_event_t swig_types[16] -#define SWIGTYPE_p_switch_event_types_t swig_types[17] -#define SWIGTYPE_p_switch_input_args_t swig_types[18] -#define SWIGTYPE_p_switch_input_type_t swig_types[19] -#define SWIGTYPE_p_switch_priority_t swig_types[20] -#define SWIGTYPE_p_switch_queue_t swig_types[21] -#define SWIGTYPE_p_switch_state_handler_table_t swig_types[22] -#define SWIGTYPE_p_switch_status_t swig_types[23] -#define SWIGTYPE_p_switch_stream_handle_t swig_types[24] -#define SWIGTYPE_p_uint32_t swig_types[25] -#define SWIGTYPE_p_void swig_types[26] -static swig_type_info *swig_types[28]; -static swig_module_info swig_module = {swig_types, 27, 0, 0, 0, 0}; +#define SWIGTYPE_p_std__string swig_types[12] +#define SWIGTYPE_p_switch_call_cause_t swig_types[13] +#define SWIGTYPE_p_switch_channel_state_t swig_types[14] +#define SWIGTYPE_p_switch_channel_t swig_types[15] +#define SWIGTYPE_p_switch_core_session_t swig_types[16] +#define SWIGTYPE_p_switch_event_t swig_types[17] +#define SWIGTYPE_p_switch_event_types_t swig_types[18] +#define SWIGTYPE_p_switch_input_args_t swig_types[19] +#define SWIGTYPE_p_switch_input_type_t swig_types[20] +#define SWIGTYPE_p_switch_priority_t swig_types[21] +#define SWIGTYPE_p_switch_queue_t swig_types[22] +#define SWIGTYPE_p_switch_state_handler_table_t swig_types[23] +#define SWIGTYPE_p_switch_status_t swig_types[24] +#define SWIGTYPE_p_switch_stream_handle_t swig_types[25] +#define SWIGTYPE_p_uint32_t swig_types[26] +#define SWIGTYPE_p_void swig_types[27] +static swig_type_info *swig_types[29]; +static swig_module_info swig_module = {swig_types, 28, 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) @@ -4332,6 +4333,28 @@ fail: } +SWIGINTERN PyObject *_wrap_Stream_read(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Stream *arg1 = (Stream *) 0 ; + std::string result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Stream_read",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Stream, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Stream_read" "', argument " "1"" of type '" "Stream *""'"); + } + arg1 = reinterpret_cast< Stream * >(argp1); + result = (arg1)->read(); + resultobj = SWIG_NewPointerObj((new std::string(static_cast< const std::string& >(result))), SWIGTYPE_p_std__string, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_Stream_write(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Stream *arg1 = (Stream *) 0 ; @@ -4365,6 +4388,44 @@ fail: } +SWIGINTERN PyObject *_wrap_Stream_raw_write(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Stream *arg1 = (Stream *) 0 ; + std::string arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Stream_raw_write",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Stream, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Stream_raw_write" "', argument " "1"" of type '" "Stream *""'"); + } + arg1 = reinterpret_cast< Stream * >(argp1); + { + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__string, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Stream_raw_write" "', argument " "2"" of type '" "std::string""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Stream_raw_write" "', argument " "2"" of type '" "std::string""'"); + } else { + std::string * temp = reinterpret_cast< std::string * >(argp2); + arg2 = *temp; + if (SWIG_IsNewObj(res2)) delete temp; + } + } + (arg1)->raw_write(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_Stream_get_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Stream *arg1 = (Stream *) 0 ; @@ -9568,7 +9629,9 @@ static PyMethodDef SwigMethods[] = { { (char *)"DTMF_swigregister", DTMF_swigregister, METH_VARARGS, NULL}, { (char *)"new_Stream", _wrap_new_Stream, METH_VARARGS, NULL}, { (char *)"delete_Stream", _wrap_delete_Stream, METH_VARARGS, NULL}, + { (char *)"Stream_read", _wrap_Stream_read, METH_VARARGS, NULL}, { (char *)"Stream_write", _wrap_Stream_write, METH_VARARGS, NULL}, + { (char *)"Stream_raw_write", _wrap_Stream_raw_write, METH_VARARGS, NULL}, { (char *)"Stream_get_data", _wrap_Stream_get_data, METH_VARARGS, NULL}, { (char *)"Stream_swigregister", Stream_swigregister, METH_VARARGS, NULL}, { (char *)"Event_event_set", _wrap_Event_event_set, METH_VARARGS, NULL}, @@ -9732,6 +9795,7 @@ static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state", "input_callback_state_t *|input_callback_state *", 0, 0, (void*)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}; +static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_call_cause_t = {"_p_switch_call_cause_t", "switch_call_cause_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_state_t = {"_p_switch_channel_state_t", "switch_channel_state_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_t = {"_p_switch_channel_t", "switch_channel_t *", 0, 0, (void*)0, 0}; @@ -9761,6 +9825,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_input_callback_state, &_swigt__p_p_switch_event_node_t, &_swigt__p_session_flag_t, + &_swigt__p_std__string, &_swigt__p_switch_call_cause_t, &_swigt__p_switch_channel_state_t, &_swigt__p_switch_channel_t, @@ -9790,6 +9855,7 @@ static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 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_p_switch_event_node_t[] = { {&_swigt__p_p_switch_event_node_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_session_flag_t[] = { {&_swigt__p_session_flag_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__string[] = { {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_call_cause_t[] = { {&_swigt__p_switch_call_cause_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_state_t[] = { {&_swigt__p_switch_channel_state_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_t[] = { {&_swigt__p_switch_channel_t, 0, 0, 0},{0, 0, 0, 0}}; @@ -9819,6 +9885,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_input_callback_state, _swigc__p_p_switch_event_node_t, _swigc__p_session_flag_t, + _swigc__p_std__string, _swigc__p_switch_call_cause_t, _swigc__p_switch_channel_state_t, _swigc__p_switch_channel_t, diff --git a/src/mod/legacy/languages/mod_lua/mod_lua_wrap.cpp b/src/mod/legacy/languages/mod_lua/mod_lua_wrap.cpp index abe8d944ba..e21988d418 100644 --- a/src/mod/legacy/languages/mod_lua/mod_lua_wrap.cpp +++ b/src/mod/legacy/languages/mod_lua/mod_lua_wrap.cpp @@ -1498,23 +1498,24 @@ SWIG_Lua_dostring(lua_State *L, const char* str) { #define SWIGTYPE_p_lua_State swig_types[11] #define SWIGTYPE_p_p_switch_event_node_t swig_types[12] #define SWIGTYPE_p_session_flag_t swig_types[13] -#define SWIGTYPE_p_switch_call_cause_t swig_types[14] -#define SWIGTYPE_p_switch_channel_state_t swig_types[15] -#define SWIGTYPE_p_switch_channel_t swig_types[16] -#define SWIGTYPE_p_switch_core_session_t swig_types[17] -#define SWIGTYPE_p_switch_event_t swig_types[18] -#define SWIGTYPE_p_switch_event_types_t swig_types[19] -#define SWIGTYPE_p_switch_input_args_t swig_types[20] -#define SWIGTYPE_p_switch_input_type_t swig_types[21] -#define SWIGTYPE_p_switch_priority_t swig_types[22] -#define SWIGTYPE_p_switch_queue_t swig_types[23] -#define SWIGTYPE_p_switch_state_handler_table_t swig_types[24] -#define SWIGTYPE_p_switch_status_t swig_types[25] -#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_p_std__string swig_types[14] +#define SWIGTYPE_p_switch_call_cause_t swig_types[15] +#define SWIGTYPE_p_switch_channel_state_t swig_types[16] +#define SWIGTYPE_p_switch_channel_t swig_types[17] +#define SWIGTYPE_p_switch_core_session_t swig_types[18] +#define SWIGTYPE_p_switch_event_t swig_types[19] +#define SWIGTYPE_p_switch_event_types_t swig_types[20] +#define SWIGTYPE_p_switch_input_args_t swig_types[21] +#define SWIGTYPE_p_switch_input_type_t swig_types[22] +#define SWIGTYPE_p_switch_priority_t swig_types[23] +#define SWIGTYPE_p_switch_queue_t swig_types[24] +#define SWIGTYPE_p_switch_state_handler_table_t swig_types[25] +#define SWIGTYPE_p_switch_status_t swig_types[26] +#define SWIGTYPE_p_switch_stream_handle_t swig_types[27] +#define SWIGTYPE_p_uint32_t swig_types[28] +#define SWIGTYPE_p_void swig_types[29] +static swig_type_info *swig_types[31]; +static swig_module_info swig_module = {swig_types, 30, 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) @@ -2626,6 +2627,34 @@ fail: } +static int _wrap_Stream_read(lua_State* L) { + int SWIG_arg = -1; + Stream *arg1 = (Stream *) 0 ; + std::string result; + + SWIG_check_num_args("read",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("read",1,"Stream *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){ + SWIG_fail_ptr("Stream_read",1,SWIGTYPE_p_Stream); + } + + result = (arg1)->read(); + SWIG_arg=0; + { + std::string * resultptr = new std::string((std::string &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_std__string,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + static int _wrap_Stream_write(lua_State* L) { int SWIG_arg = -1; Stream *arg1 = (Stream *) 0 ; @@ -2653,6 +2682,39 @@ fail: } +static int _wrap_Stream_raw_write(lua_State* L) { + int SWIG_arg = -1; + Stream *arg1 = (Stream *) 0 ; + std::string arg2 ; + std::string *argp2 ; + + SWIG_check_num_args("raw_write",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("raw_write",1,"Stream *"); + if(!lua_isuserdata(L,2)) SWIG_fail_arg("raw_write",2,"std::string"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){ + SWIG_fail_ptr("Stream_raw_write",1,SWIGTYPE_p_Stream); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("Stream_raw_write",2,SWIGTYPE_p_std__string); + } + arg2 = *argp2; + + (arg1)->raw_write(arg2); + SWIG_arg=0; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + static int _wrap_Stream_get_data(lua_State* L) { int SWIG_arg = -1; Stream *arg1 = (Stream *) 0 ; @@ -2683,7 +2745,9 @@ Stream *arg1 = (Stream *) obj; delete arg1; } static swig_lua_method swig_Stream_methods[] = { + {"read", _wrap_Stream_read}, {"write", _wrap_Stream_write}, + {"raw_write", _wrap_Stream_raw_write}, {"get_data", _wrap_Stream_get_data}, {0,0} }; @@ -8067,6 +8131,7 @@ static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state 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}; +static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_call_cause_t = {"_p_switch_call_cause_t", "switch_call_cause_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_state_t = {"_p_switch_channel_state_t", "switch_channel_state_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_t = {"_p_switch_channel_t", "switch_channel_t *", 0, 0, (void*)0, 0}; @@ -8098,6 +8163,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_lua_State, &_swigt__p_p_switch_event_node_t, &_swigt__p_session_flag_t, + &_swigt__p_std__string, &_swigt__p_switch_call_cause_t, &_swigt__p_switch_channel_state_t, &_swigt__p_switch_channel_t, @@ -8129,6 +8195,7 @@ static swig_cast_info _swigc__p_input_callback_state[] = { {&_swigt__p_input_ca static swig_cast_info _swigc__p_lua_State[] = { {&_swigt__p_lua_State, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_switch_event_node_t[] = { {&_swigt__p_p_switch_event_node_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_session_flag_t[] = { {&_swigt__p_session_flag_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__string[] = { {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_call_cause_t[] = { {&_swigt__p_switch_call_cause_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_state_t[] = { {&_swigt__p_switch_channel_state_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_t[] = { {&_swigt__p_switch_channel_t, 0, 0, 0},{0, 0, 0, 0}}; @@ -8160,6 +8227,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_lua_State, _swigc__p_p_switch_event_node_t, _swigc__p_session_flag_t, + _swigc__p_std__string, _swigc__p_switch_call_cause_t, _swigc__p_switch_channel_state_t, _swigc__p_switch_channel_t, From a8522ff3c2a7d8c92b3095c28ed5dd3e70ce3f39 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Thu, 4 Sep 2014 10:38:37 +0800 Subject: [PATCH 13/77] remove debug --- src/mod/endpoints/mod_verto/mod_verto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c index 66905d3632..534c78e606 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.c +++ b/src/mod/endpoints/mod_verto/mod_verto.c @@ -1341,7 +1341,7 @@ static void http_static_handler(switch_http_request_t *request) switch_snprintf(path, sizeof(path), "%s%s", jsock->profile->htdocs, request->uri); - printf("local path: %s\n", path); + // printf("local path: %s\n", path); if (end_of(path) == '/') { char *data = "HTTP/1.1 500 Internal Error\r\n" @@ -1413,7 +1413,7 @@ static void http_run(jsock_t *jsock) goto err; } - switch_http_dump_request(&request); + // switch_http_dump_request(&request); /* TODO: parse virtual hosts here */ From e79380c3945ed453bd541a7bb326cbfc434fb8d0 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Thu, 4 Sep 2014 03:20:25 +0000 Subject: [PATCH 14/77] Catch more swig-generated files with gitattributes --- src/mod/languages/mod_java/.gitattributes | 1 + src/mod/languages/mod_perl/.gitattributes | 1 + src/mod/languages/mod_python/.gitattributes | 1 + src/mod/legacy/languages/mod_lua/.gitattributes | 1 + 4 files changed, 4 insertions(+) create mode 100644 src/mod/legacy/languages/mod_lua/.gitattributes diff --git a/src/mod/languages/mod_java/.gitattributes b/src/mod/languages/mod_java/.gitattributes index e6b8d09c08..65f4715533 100644 --- a/src/mod/languages/mod_java/.gitattributes +++ b/src/mod/languages/mod_java/.gitattributes @@ -1 +1,2 @@ switch_swig_wrap.cpp -diff +src/org/freeswitch/swig/* -diff diff --git a/src/mod/languages/mod_perl/.gitattributes b/src/mod/languages/mod_perl/.gitattributes index c53f2c274e..aea1c342bf 100644 --- a/src/mod/languages/mod_perl/.gitattributes +++ b/src/mod/languages/mod_perl/.gitattributes @@ -1 +1,2 @@ mod_perl_wrap.cpp -diff +freeswitch.pm -diff diff --git a/src/mod/languages/mod_python/.gitattributes b/src/mod/languages/mod_python/.gitattributes index 3ce06f18c5..98d05d51d6 100644 --- a/src/mod/languages/mod_python/.gitattributes +++ b/src/mod/languages/mod_python/.gitattributes @@ -1 +1,2 @@ mod_python_wrap.cpp -diff +freeswitch.py -diff diff --git a/src/mod/legacy/languages/mod_lua/.gitattributes b/src/mod/legacy/languages/mod_lua/.gitattributes new file mode 100644 index 0000000000..c0c4890955 --- /dev/null +++ b/src/mod/legacy/languages/mod_lua/.gitattributes @@ -0,0 +1 @@ +mod_lua_wrap.cpp -diff From 5fadb527584bd96776351d0a23282436dd7f463e Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Thu, 4 Sep 2014 03:39:23 +0000 Subject: [PATCH 15/77] Fix build on gcc-4.9 GCC doesn't like when variables that are set but never used. --- src/switch_utils.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/switch_utils.c b/src/switch_utils.c index d5de0a50f5..8e62b97f54 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -3614,7 +3614,6 @@ SWITCH_DECLARE(switch_status_t) switch_http_parse_header(char *buffer, uint32_t int argc; char *argv[2] = { 0 }; char *body = NULL; - int header_len = 0; if (datalen < 16) return status; /* minimum GET / HTTP/1.1\r\n */ @@ -3626,11 +3625,9 @@ SWITCH_DECLARE(switch_status_t) switch_http_parse_header(char *buffer, uint32_t if ((body = strstr(p, "\r\n\r\n"))) { *body = '\0'; - header_len = body - buffer + 1; body += 4; } else if (( body = strstr(p, "\n\n"))) { *body = '\0'; - header_len = body - buffer + 1; body += 2; } From 93bd5833c270b4388d1156cea47ad3642ace7b0b Mon Sep 17 00:00:00 2001 From: Steven Ayre Date: Wed, 3 Sep 2014 21:44:11 +0100 Subject: [PATCH 16/77] Add uptime property to mod_sofia gateways The 'UP' status indicates a gateway is online as determined by registration and/or SIP OPTIONS pinging. The time the gateway has been in the 'UP' status is recorded, and can be monitored using 'sofia status' and 'sofia xmlstatus'. This can be used to detect and graph when there are outages. ref: FS-6772 Reviewed-by: Travis Cross --- 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 | 2 ++ src/mod/endpoints/mod_sofia/sofia_reg.c | 8 ++++++-- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 33f4e0f855..5f656b762c 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -2584,6 +2584,7 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t stream->write_function(stream, "PingState\t%d/%d/%d\n", gp->ping_min, gp->ping_count, gp->ping_max); stream->write_function(stream, "State \t%s\n", sofia_state_names[gp->state]); stream->write_function(stream, "Status \t%s%s\n", status_names[gp->status], gp->pinging ? " (ping)" : ""); + stream->write_function(stream, "Uptime \t%ld\n", gp->status == SOFIA_GATEWAY_UP ? switch_time_now()-gp->uptime : 0); stream->write_function(stream, "CallsIN \t%u\n", gp->ib_calls); stream->write_function(stream, "CallsOUT\t%u\n", gp->ob_calls); stream->write_function(stream, "FailedCallsIN\t%u\n", gp->ib_failed_calls); @@ -2827,6 +2828,7 @@ static void xml_gateway_status(sofia_gateway_t *gp, switch_stream_handle_t *stre stream->write_function(stream, " %d\n", gp->pinging); stream->write_function(stream, " %s\n", sofia_state_names[gp->state]); stream->write_function(stream, " %s\n", status_names[gp->status]); + stream->write_function(stream, " %ld\n", gp->status == SOFIA_GATEWAY_UP ? switch_time_now()-gp->uptime : 0); stream->write_function(stream, " %u\n", gp->ib_calls); stream->write_function(stream, " %u\n", gp->ob_calls); stream->write_function(stream, " %u\n", gp->ib_failed_calls); diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index 577ff07bbc..4be1d9747a 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -488,6 +488,7 @@ struct sofia_gateway { time_t reg_timeout; int pinging; sofia_gateway_status_t status; + switch_time_t uptime; uint32_t ping_freq; int ping_count; int ping_max; diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index edc15cf69b..390a289d94 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -3487,6 +3487,7 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) if (!switch_true(register_str)) { gateway->state = REG_STATE_NOREG; gateway->status = SOFIA_GATEWAY_UP; + gateway->uptime = switch_time_now(); } if (zstr(auth_username)) { @@ -5563,6 +5564,7 @@ static void sofia_handle_sip_r_options(switch_core_session_t *session, int statu if (gateway->ping_count >= gateway->ping_min && gateway->status != SOFIA_GATEWAY_UP) { gateway->status = SOFIA_GATEWAY_UP; + gateway->uptime = switch_time_now(); sofia_reg_fire_custom_gateway_state_event(gateway, status, phrase); } diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index 206b77283b..053ddd9a9e 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -372,8 +372,9 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now) switch (ostate) { case REG_STATE_NOREG: - if (!gateway_ptr->ping && !gateway_ptr->pinging) { + if (!gateway_ptr->ping && !gateway_ptr->pinging && gateway_ptr->status != SOFIA_GATEWAY_UP) { gateway_ptr->status = SOFIA_GATEWAY_UP; + gateway_ptr->uptime = switch_time_now(); } break; case REG_STATE_REGISTER: @@ -396,7 +397,10 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now) gateway_ptr->expires = now + delta; gateway_ptr->state = REG_STATE_REGED; - gateway_ptr->status = SOFIA_GATEWAY_UP; + if (gateway_ptr->status != SOFIA_GATEWAY_UP) { + gateway_ptr->status = SOFIA_GATEWAY_UP; + gateway_ptr->uptime = switch_time_now(); + } break; case REG_STATE_UNREGISTER: From 5c29d8d4faae12bed7709e40e81d2baebf227ac1 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Thu, 4 Sep 2014 05:29:25 +0000 Subject: [PATCH 17/77] Show gateway uptime in seconds In `sofia status gateway ...` let's show the uptime in seconds rather than in microseconds. We'll output the uptime in microseconds in `xmlstatus` and we'll label it as such. --- src/mod/endpoints/mod_sofia/mod_sofia.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 5f656b762c..ff19465fb2 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -2584,7 +2584,7 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t stream->write_function(stream, "PingState\t%d/%d/%d\n", gp->ping_min, gp->ping_count, gp->ping_max); stream->write_function(stream, "State \t%s\n", sofia_state_names[gp->state]); stream->write_function(stream, "Status \t%s%s\n", status_names[gp->status], gp->pinging ? " (ping)" : ""); - stream->write_function(stream, "Uptime \t%ld\n", gp->status == SOFIA_GATEWAY_UP ? switch_time_now()-gp->uptime : 0); + stream->write_function(stream, "Uptime \t%lds\n", gp->status == SOFIA_GATEWAY_UP ? (switch_time_now()-gp->uptime)/1000000 : 0); stream->write_function(stream, "CallsIN \t%u\n", gp->ib_calls); stream->write_function(stream, "CallsOUT\t%u\n", gp->ob_calls); stream->write_function(stream, "FailedCallsIN\t%u\n", gp->ib_failed_calls); @@ -2828,7 +2828,7 @@ static void xml_gateway_status(sofia_gateway_t *gp, switch_stream_handle_t *stre stream->write_function(stream, " %d\n", gp->pinging); stream->write_function(stream, " %s\n", sofia_state_names[gp->state]); stream->write_function(stream, " %s\n", status_names[gp->status]); - stream->write_function(stream, " %ld\n", gp->status == SOFIA_GATEWAY_UP ? switch_time_now()-gp->uptime : 0); + stream->write_function(stream, " %ld\n", gp->status == SOFIA_GATEWAY_UP ? switch_time_now()-gp->uptime : 0); stream->write_function(stream, " %u\n", gp->ib_calls); stream->write_function(stream, " %u\n", gp->ob_calls); stream->write_function(stream, " %u\n", gp->ib_failed_calls); From 56e4afb209952cb88cf4f9b33d2501f0d7f66666 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Thu, 4 Sep 2014 15:56:15 -0400 Subject: [PATCH 18/77] FS-6595: Enable pause_play and file_seek for conference member fnode #resolve --- .../mod_conference/mod_conference.c | 87 ++++++++++++++----- 1 file changed, 63 insertions(+), 24 deletions(-) diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index fbb1cd9036..406aa14b95 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -4633,7 +4633,7 @@ static void member_add_file_data(conference_member_t *member, int16_t *data, swi pool = fnode->pool; fnode = NULL; switch_core_destroy_memory_pool(&pool); - } else { + } else if(!switch_test_flag(member->fnode, NFLAG_PAUSE)) { /* skip this frame until leadin time has expired */ if (member->fnode->leadin) { member->fnode->leadin--; @@ -7145,64 +7145,103 @@ static switch_status_t conf_api_sub_xml_list(conference_obj_t *conference, switc return SWITCH_STATUS_SUCCESS; } +static void switch_fnode_toggle_pause(conference_file_node_t *fnode, switch_stream_handle_t *stream) +{ + if (fnode) { + if (switch_test_flag(fnode, NFLAG_PAUSE)) { + stream->write_function(stream, "+OK Resume\n"); + switch_clear_flag(fnode, NFLAG_PAUSE); + } else { + stream->write_function(stream, "+OK Pause\n"); + switch_set_flag(fnode, NFLAG_PAUSE); + } + } +} + static switch_status_t conf_api_sub_pause_play(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { if (argc == 2) { switch_mutex_lock(conference->mutex); - if (conference->fnode) { - if (switch_test_flag(conference->fnode, NFLAG_PAUSE)) { - stream->write_function(stream, "+OK Resume\n"); - switch_clear_flag(conference->fnode, NFLAG_PAUSE); - } else { - stream->write_function(stream, "+OK Pause\n"); - switch_set_flag(conference->fnode, NFLAG_PAUSE); - } - } + switch_fnode_toggle_pause(conference->fnode, stream); switch_mutex_unlock(conference->mutex); return SWITCH_STATUS_SUCCESS; } + if (argc == 3) { + uint32_t id = atoi(argv[2]); + conference_member_t *member; + + if ((member = conference_member_get(conference, id))) { + switch_mutex_lock(member->fnode_mutex); + switch_fnode_toggle_pause(member->fnode, stream); + switch_mutex_unlock(member->fnode_mutex); + switch_thread_rwlock_unlock(member->rwlock); + return SWITCH_STATUS_SUCCESS; + } else { + stream->write_function(stream, "Member: %u not found.\n", id); + } + } + return SWITCH_STATUS_GENERR; } -static switch_status_t conf_api_sub_file_seek(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +static void switch_fnode_seek(conference_file_node_t *fnode, switch_stream_handle_t *stream, char *arg) { - if (argc == 3) { + if (fnode && fnode->type == NODE_TYPE_FILE) { unsigned int samps = 0; unsigned int pos = 0; - switch_mutex_lock(conference->mutex); - - if (conference->fnode && conference->fnode->type == NODE_TYPE_FILE) { - if (*argv[2] == '+' || *argv[2] == '-') { + if (*arg == '+' || *arg == '-') { int step; int32_t target; - if (!(step = atoi(argv[2]))) { + if (!(step = atoi(arg))) { step = 1000; } - samps = step * (conference->fnode->fh.native_rate / 1000); - target = (int32_t)conference->fnode->fh.pos + samps; + samps = step * (fnode->fh.native_rate / 1000); + target = (int32_t)fnode->fh.pos + samps; if (target < 0) { target = 0; } stream->write_function(stream, "+OK seek to position %d\n", target); - switch_core_file_seek(&conference->fnode->fh, &pos, target, SEEK_SET); + switch_core_file_seek(&fnode->fh, &pos, target, SEEK_SET); } else { - samps = switch_atoui(argv[2]) * (conference->fnode->fh.native_rate / 1000); + samps = switch_atoui(arg) * (fnode->fh.native_rate / 1000); stream->write_function(stream, "+OK seek to position %d\n", samps); - switch_core_file_seek(&conference->fnode->fh, &pos, samps, SEEK_SET); + switch_core_file_seek(&fnode->fh, &pos, samps, SEEK_SET); } } +} + +static switch_status_t conf_api_sub_file_seek(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +{ + if (argc == 3) { + switch_mutex_lock(conference->mutex); + switch_fnode_seek(conference->fnode, stream, argv[2]); switch_mutex_unlock(conference->mutex); return SWITCH_STATUS_SUCCESS; } + if (argc == 4) { + uint32_t id = atoi(argv[3]); + conference_member_t *member = conference_member_get(conference, id); + if (member == NULL) { + stream->write_function(stream, "Member: %u not found.\n", id); + return SWITCH_STATUS_GENERR; + } + + switch_mutex_lock(member->fnode_mutex); + switch_fnode_seek(member->fnode, stream, argv[2]); + switch_mutex_unlock(member->fnode_mutex); + switch_thread_rwlock_unlock(member->rwlock); + return SWITCH_STATUS_SUCCESS; + } + return SWITCH_STATUS_GENERR; } @@ -8108,8 +8147,8 @@ static api_command_t conf_api_sub_commands[] = { {"position", (void_fn_t) & conf_api_sub_position, CONF_API_SUB_MEMBER_TARGET, "position", " ,,"}, {"auto-3d-position", (void_fn_t) & conf_api_sub_auto_position, CONF_API_SUB_ARGS_SPLIT, "auto-3d-position", "[on|off]"}, {"play", (void_fn_t) & conf_api_sub_play, CONF_API_SUB_ARGS_SPLIT, "play", " [async| [nomux]]"}, - {"pause_play", (void_fn_t) & conf_api_sub_pause_play, CONF_API_SUB_ARGS_SPLIT, "pause", ""}, - {"file_seek", (void_fn_t) & conf_api_sub_file_seek, CONF_API_SUB_ARGS_SPLIT, "file_seek", "[+-]"}, + {"pause_play", (void_fn_t) & conf_api_sub_pause_play, CONF_API_SUB_ARGS_SPLIT, "pause", "[]"}, + {"file_seek", (void_fn_t) & conf_api_sub_file_seek, CONF_API_SUB_ARGS_SPLIT, "file_seek", "[+-] []"}, {"say", (void_fn_t) & conf_api_sub_say, CONF_API_SUB_ARGS_AS_ONE, "say", ""}, {"saymember", (void_fn_t) & conf_api_sub_saymember, CONF_API_SUB_ARGS_AS_ONE, "saymember", " "}, {"stop", (void_fn_t) & conf_api_sub_stop, CONF_API_SUB_ARGS_SPLIT, "stop", "<[current|all|async|last]> []"}, From 57bd4eb9bdc54bf853c4e2199fc90b685dab300d Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Thu, 4 Sep 2014 20:40:53 +0000 Subject: [PATCH 19/77] Add `valet_park ... auto out ...` to syntax string FS-5992 #resolve --- src/mod/applications/mod_valet_parking/mod_valet_parking.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/applications/mod_valet_parking/mod_valet_parking.c b/src/mod/applications/mod_valet_parking/mod_valet_parking.c index 90f20233d3..05b8074a02 100644 --- a/src/mod/applications/mod_valet_parking/mod_valet_parking.c +++ b/src/mod/applications/mod_valet_parking/mod_valet_parking.c @@ -397,7 +397,7 @@ static switch_status_t read_frame_callback(switch_core_session_t *session, switc return SWITCH_STATUS_SUCCESS; } -#define VALET_APP_SYNTAX " |[ask [] [] [] []|auto in [min] [max]]" +#define VALET_APP_SYNTAX " |[ask [] [] [] []|auto [in|out] [min] [max]]" SWITCH_STANDARD_APP(valet_parking_function) { char *argv[6], *lbuf; From fddf44426f4033c74c9c17f425563d95dba079a6 Mon Sep 17 00:00:00 2001 From: William King Date: Thu, 4 Sep 2014 13:48:50 -0700 Subject: [PATCH 20/77] Fixing a typo in the radius accounting end condition configuration handling in mod_xml_radius --- src/mod/xml_int/mod_xml_radius/mod_xml_radius.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/xml_int/mod_xml_radius/mod_xml_radius.c b/src/mod/xml_int/mod_xml_radius/mod_xml_radius.c index 4cfa99d39d..1c8a4744e5 100644 --- a/src/mod/xml_int/mod_xml_radius/mod_xml_radius.c +++ b/src/mod/xml_int/mod_xml_radius/mod_xml_radius.c @@ -990,7 +990,7 @@ switch_status_t mod_xml_radius_accounting_end(switch_core_session_t *session){ } /* If there are conditions defined, and none of them pass, then skip this accounting */ - if ((conditions = switch_xml_child(globals.acct_start_configs, "conditions")) != NULL && + if ((conditions = switch_xml_child(globals.acct_end_configs, "conditions")) != NULL && mod_xml_radius_check_conditions(channel, conditions) != SWITCH_STATUS_SUCCESS ) { goto end; } From 27e3b5b705f0680ed1aef1e77099ab5d3fb64424 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Thu, 4 Sep 2014 20:57:28 +0000 Subject: [PATCH 21/77] Name variable `storage_dir` ...rather than `storage`. ref: commit ce96d95c5e5b29b3bcb69d6e5416f0bc6bfb88f7 --- conf/vanilla/autoload_configs/voicemail.conf.xml | 2 +- conf/vanilla/vars.xml | 2 +- src/switch_core.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/vanilla/autoload_configs/voicemail.conf.xml b/conf/vanilla/autoload_configs/voicemail.conf.xml index 8052d611f1..33d5a97760 100644 --- a/conf/vanilla/autoload_configs/voicemail.conf.xml +++ b/conf/vanilla/autoload_configs/voicemail.conf.xml @@ -64,7 +64,7 @@ - + diff --git a/conf/vanilla/vars.xml b/conf/vanilla/vars.xml index 0b161854ff..28a6dc96fb 100644 --- a/conf/vanilla/vars.xml +++ b/conf/vanilla/vars.xml @@ -38,7 +38,7 @@ temp_dir grammar_dir certs_dir - storage + storage_dir cache_dir core_uuid zrtp_enabled diff --git a/src/switch_core.c b/src/switch_core.c index 7d5af36c28..bf07f46451 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -1738,7 +1738,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc switch_core_set_variable("temp_dir", SWITCH_GLOBAL_dirs.temp_dir); switch_core_set_variable("grammar_dir", SWITCH_GLOBAL_dirs.grammar_dir); switch_core_set_variable("certs_dir", SWITCH_GLOBAL_dirs.certs_dir); - switch_core_set_variable("storage", SWITCH_GLOBAL_dirs.storage_dir); + switch_core_set_variable("storage_dir", SWITCH_GLOBAL_dirs.storage_dir); switch_core_set_variable("cache_dir", SWITCH_GLOBAL_dirs.cache_dir); switch_core_set_serial(); From ad9381218d37e66fb0892a9ca4619d51ef443654 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Thu, 4 Sep 2014 21:00:24 +0000 Subject: [PATCH 22/77] Remove stray leading slashes ref: commit ce96d95c5e5b29b3bcb69d6e5416f0bc6bfb88f7 --- conf/vanilla/autoload_configs/httapi.conf.xml | 2 +- conf/vanilla/autoload_configs/xml_curl.conf.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/vanilla/autoload_configs/httapi.conf.xml b/conf/vanilla/autoload_configs/httapi.conf.xml index d0b357d0fe..723a336bc9 100644 --- a/conf/vanilla/autoload_configs/httapi.conf.xml +++ b/conf/vanilla/autoload_configs/httapi.conf.xml @@ -116,7 +116,7 @@ - + diff --git a/conf/vanilla/autoload_configs/xml_curl.conf.xml b/conf/vanilla/autoload_configs/xml_curl.conf.xml index de0de0293a..19214ee065 100644 --- a/conf/vanilla/autoload_configs/xml_curl.conf.xml +++ b/conf/vanilla/autoload_configs/xml_curl.conf.xml @@ -40,7 +40,7 @@ - + From c0ec5522683047e3e87d4dba6ea7dd482cce2d66 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Thu, 4 Sep 2014 21:09:46 +0000 Subject: [PATCH 23/77] Set new `cache_dir` for debian --- debian/rules | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/rules b/debian/rules index 398226139f..eefc3bc277 100755 --- a/debian/rules +++ b/debian/rules @@ -80,6 +80,7 @@ override_dh_auto_clean: --with-htdocsdir=/usr/share/freeswitch/htdocs \ --with-soundsdir=/usr/share/freeswitch/sounds \ --with-storagedir=/var/lib/freeswitch/storage \ + --with-cachedir=/var/cache/freeswitch \ --with-grammardir=/usr/share/freeswitch/grammar \ --with-certsdir=/etc/freeswitch/tls \ --with-scriptdir=/usr/share/freeswitch/scripts \ From 47b7c44db6ef790b920bc23d4d9a7c1adee5c416 Mon Sep 17 00:00:00 2001 From: William King Date: Thu, 4 Sep 2014 14:29:35 -0700 Subject: [PATCH 24/77] Fix a problem where radius channel variables were missing in mod_xml_radius --- src/mod/xml_int/mod_xml_radius/mod_xml_radius.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mod/xml_int/mod_xml_radius/mod_xml_radius.c b/src/mod/xml_int/mod_xml_radius/mod_xml_radius.c index 1c8a4744e5..8075204e77 100644 --- a/src/mod/xml_int/mod_xml_radius/mod_xml_radius.c +++ b/src/mod/xml_int/mod_xml_radius/mod_xml_radius.c @@ -544,7 +544,12 @@ switch_status_t mod_xml_radius_add_params(switch_core_session_t *session, switch goto err; } } else if ( attribute->type == 1 ) { - int number = atoi(switch_channel_get_variable(channel, variable)); + char *data = switch_channel_get_variable(channel, variable); + int number = 0; + + if ( data ) { + number = atoi(data); + } if (rc_avpair_add(handle, send, attr_num, &number, -1, vend_num) == NULL) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, From 5dfea663cddcc5c02fc586020388510986e0ee56 Mon Sep 17 00:00:00 2001 From: William King Date: Thu, 4 Sep 2014 14:57:20 -0700 Subject: [PATCH 25/77] build fix for mod_xml_radius --- src/mod/xml_int/mod_xml_radius/mod_xml_radius.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/xml_int/mod_xml_radius/mod_xml_radius.c b/src/mod/xml_int/mod_xml_radius/mod_xml_radius.c index 8075204e77..bc75843800 100644 --- a/src/mod/xml_int/mod_xml_radius/mod_xml_radius.c +++ b/src/mod/xml_int/mod_xml_radius/mod_xml_radius.c @@ -544,7 +544,7 @@ switch_status_t mod_xml_radius_add_params(switch_core_session_t *session, switch goto err; } } else if ( attribute->type == 1 ) { - char *data = switch_channel_get_variable(channel, variable); + const char *data = switch_channel_get_variable(channel, variable); int number = 0; if ( data ) { From 388e9638de7c14e00272777245dacc87cf09fc1c Mon Sep 17 00:00:00 2001 From: Alexander Haugg Date: Fri, 5 Sep 2014 10:57:01 +0200 Subject: [PATCH 26/77] F-5946 add the patches. if in the sofia gateway config the param pin-monitoring is true, then every ping result raise an sofia::gateway-state event --- src/mod/endpoints/mod_sofia/mod_sofia.h | 1 + src/mod/endpoints/mod_sofia/sofia.c | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index 4be1d9747a..93c8212d43 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -493,6 +493,7 @@ struct sofia_gateway { int ping_count; int ping_max; int ping_min; + switch_bool_t ping_monitoring; uint8_t flags[REG_FLAG_MAX]; int32_t retry_seconds; int32_t reg_timeout_seconds; diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 390a289d94..c2fd9adb2f 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -3274,7 +3274,7 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) if ((gateway = switch_core_alloc(profile->pool, sizeof(*gateway)))) { const char *sipip, *format; switch_uuid_t uuid; - uint32_t ping_freq = 0, extension_in_contact = 0, distinct_to = 0, rfc_5626 = 0; + uint32_t ping_freq = 0, extension_in_contact = 0, ping_monitoring = 0, distinct_to = 0, rfc_5626 = 0; int ping_max = 1, ping_min = 1; char *register_str = "true", *scheme = "Digest", *realm = NULL, @@ -3311,6 +3311,7 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) gateway->ping_max = 0; gateway->ping_min = 0; gateway->ping_count = 0; + gateway->ping_monitoring = SWITCH_FALSE; gateway->ib_calls = 0; gateway->ob_calls = 0; gateway->ib_failed_calls = 0; @@ -3393,6 +3394,8 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) ping_min = atoi(val); } else if (!strcmp(var, "ping-user-agent")) { options_user_agent = val; + } else if (!strcmp(var, "ping-monitoring")) { // if true then every gw ping result will fire a gateway status event + ping_monitoring = switch_true(val); } else if (!strcmp(var, "proxy")) { proxy = val; } else if (!strcmp(var, "context")) { @@ -3570,6 +3573,7 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) gateway->ping_freq = ping_freq; gateway->ping_max = ping_max; gateway->ping_min = ping_min; + gateway->ping_monitoring = ping_monitoring; gateway->ping = switch_epoch_time_now(NULL) + ping_freq; gateway->options_to_uri = switch_core_sprintf(gateway->pool, "", !zstr(from_domain) ? from_domain : proxy); @@ -5543,6 +5547,7 @@ static void sofia_handle_sip_r_options(switch_core_session_t *session, int statu tagi_t tags[]) { sofia_gateway_t *gateway = NULL; + switch_bool_t do_fire_gateway_state_event = SWITCH_FALSE; if (sofia_private && !zstr(sofia_private->gateway_name)) { gateway = sofia_reg_find_gateway(sofia_private->gateway_name); @@ -5565,9 +5570,9 @@ static void sofia_handle_sip_r_options(switch_core_session_t *session, int statu if (gateway->ping_count >= gateway->ping_min && gateway->status != SOFIA_GATEWAY_UP) { gateway->status = SOFIA_GATEWAY_UP; gateway->uptime = switch_time_now(); - sofia_reg_fire_custom_gateway_state_event(gateway, status, phrase); + do_fire_gateway_state_event = SWITCH_TRUE; } - + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Ping succeeded %s with code %d - count %d/%d/%d, state %s\n", gateway->name, status, gateway->ping_min, gateway->ping_count, gateway->ping_max, sofia_gateway_status_name(gateway->status)); @@ -5584,13 +5589,16 @@ static void sofia_handle_sip_r_options(switch_core_session_t *session, int statu if (gateway->ping_count < gateway->ping_min && gateway->status != SOFIA_GATEWAY_DOWN) { gateway->status = SOFIA_GATEWAY_DOWN; - sofia_reg_fire_custom_gateway_state_event(gateway, status, phrase); + do_fire_gateway_state_event = SWITCH_TRUE; } switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Ping failed %s with code %d - count %d/%d/%d, state %s\n", gateway->name, status, gateway->ping_min, gateway->ping_count, gateway->ping_max, sofia_gateway_status_name(gateway->status)); } + if (gateway->ping_monitoring || do_fire_gateway_state_event) { + sofia_reg_fire_custom_gateway_state_event(gateway, status, phrase); + } gateway->ping = switch_epoch_time_now(NULL) + gateway->ping_freq; sofia_reg_release_gateway(gateway); From 9d9feb647a219af467514116824d80ca608fbf4c Mon Sep 17 00:00:00 2001 From: Russell Treleaven Date: Fri, 5 Sep 2014 07:05:20 -0400 Subject: [PATCH 27/77] make the tzfile header check look for "TZif" instead of "TZif2" --- scripts/perl/timezone-gen.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/perl/timezone-gen.pl b/scripts/perl/timezone-gen.pl index 682964d77d..281f88556c 100755 --- a/scripts/perl/timezone-gen.pl +++ b/scripts/perl/timezone-gen.pl @@ -55,7 +55,7 @@ foreach my $name ( sort( keys(%name_to_file) ) ) { my $data = join( "", <$in> ); close($in); - if ( $data !~ /^TZif2/o ) { + if ( $data !~ /^TZif/o ) { $debug && print "Skipped $file\n"; next; } From 9218775a17c1dd8c566fef7a2b6cd1968e51fc34 Mon Sep 17 00:00:00 2001 From: Brian West Date: Fri, 5 Sep 2014 10:54:54 -0500 Subject: [PATCH 28/77] update openssl --- build/Makefile.centos5 | 4 ++-- build/Makefile.openbsd | 10 +++++----- build/Makefile.solaris11 | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build/Makefile.centos5 b/build/Makefile.centos5 index ba3188603b..0ca56fd781 100644 --- a/build/Makefile.centos5 +++ b/build/Makefile.centos5 @@ -8,10 +8,10 @@ # Brian West # FSPREFIX=/usr/local/freeswitch -PREFIX=/opt/fs-libs +PREFIX=/usr/local/freeswitch DOWNLOAD=http://files.freeswitch.org/downloads/libs JPEG=v8d -OPENSSL=1.0.1h +OPENSSL=1.0.1i SQLITE=autoconf-3080403 PCRE=8.35 CURL=7.35.0 diff --git a/build/Makefile.openbsd b/build/Makefile.openbsd index 58b0051720..54bafa5bac 100644 --- a/build/Makefile.openbsd +++ b/build/Makefile.openbsd @@ -10,7 +10,7 @@ PKG=rsync-3.1.0 git automake-1.14.1 autoconf-2.69p1 libtool gmake bzip2 jpeg wget pcre speex libldns PREFIX=/usr/local/freeswitch DOWNLOAD=http://files.freeswitch.org/downloads/libs -LIBRESSL=2.0.3 +OPENSSL=1.0.1i LIBEDIT=20140618-3.1 CURL=7.35.0 @@ -39,11 +39,11 @@ has-git: deps: libedit libressl curl @PKG_PATH=http://openbsd.mirrors.pair.com/`uname -r`/packages/`machine -a`/ pkg_add -r $(PKG) -libressl: libressl-$(LIBRESSL)/Makefile -libressl-$(LIBRESSL)/Makefile: libressl-$(LIBRESSL) -libressl-$(LIBRESSL): +openssl: openssl-$(OPENSSL)/.done +openssl-$(OPENSSL)/.done: openssl-$(OPENSSL) +openssl-$(OPENSSL): (test -d $@) || (wget -4 -O $@.tar.gz $(DOWNLOAD)/$@.tar.gz && tar zxfv $@.tar.gz) - (cd $@ && ./configure --prefix=$(PREFIX) && make && sudo make install) + (cd $@ && ./Configure --prefix=$(PREFIX) linux-x86_64 shared && make && sudo make install && touch .done) libedit: libedit-$(LIBEDIT)/Makefile libedit-$(LIBEDIT)/Makefile: libedit-$(LIBEDIT) diff --git a/build/Makefile.solaris11 b/build/Makefile.solaris11 index c510808e1e..7de640dc20 100644 --- a/build/Makefile.solaris11 +++ b/build/Makefile.solaris11 @@ -10,7 +10,7 @@ FSPREFIX=/usr/local/freeswitch PREFIX=/usr/local/ DOWNLOAD=http://files.freeswitch.org/downloads/libs JP=v8d -SSL=1.0.1h +SSL=1.0.1i SQLITE=autoconf-3080403 PCRE=8.35 CURL=7.35.0 From 3d82b279b62a3627b42a97910bd0e2b57a22d4f6 Mon Sep 17 00:00:00 2001 From: Brian West Date: Fri, 5 Sep 2014 10:57:29 -0500 Subject: [PATCH 29/77] fix copy/paste error --- build/Makefile.openbsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Makefile.openbsd b/build/Makefile.openbsd index 54bafa5bac..aac9acb86a 100644 --- a/build/Makefile.openbsd +++ b/build/Makefile.openbsd @@ -43,7 +43,7 @@ openssl: openssl-$(OPENSSL)/.done openssl-$(OPENSSL)/.done: openssl-$(OPENSSL) openssl-$(OPENSSL): (test -d $@) || (wget -4 -O $@.tar.gz $(DOWNLOAD)/$@.tar.gz && tar zxfv $@.tar.gz) - (cd $@ && ./Configure --prefix=$(PREFIX) linux-x86_64 shared && make && sudo make install && touch .done) + (cd $@ && ./Configure --prefix=$(PREFIX) BSD-generic64 shared && make && sudo make install && touch .done) libedit: libedit-$(LIBEDIT)/Makefile libedit-$(LIBEDIT)/Makefile: libedit-$(LIBEDIT) From 9c83c55493d1a48fb7d6a7c980732cf430b645ac Mon Sep 17 00:00:00 2001 From: Brian West Date: Fri, 5 Sep 2014 11:14:01 -0500 Subject: [PATCH 30/77] wrong platform --- build/Makefile.openbsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Makefile.openbsd b/build/Makefile.openbsd index aac9acb86a..8d72e3e0a0 100644 --- a/build/Makefile.openbsd +++ b/build/Makefile.openbsd @@ -43,7 +43,7 @@ openssl: openssl-$(OPENSSL)/.done openssl-$(OPENSSL)/.done: openssl-$(OPENSSL) openssl-$(OPENSSL): (test -d $@) || (wget -4 -O $@.tar.gz $(DOWNLOAD)/$@.tar.gz && tar zxfv $@.tar.gz) - (cd $@ && ./Configure --prefix=$(PREFIX) BSD-generic64 shared && make && sudo make install && touch .done) + (cd $@ && ./Configure --prefix=$(PREFIX) BSD-x86_64 shared && make && sudo make install && touch .done) libedit: libedit-$(LIBEDIT)/Makefile libedit-$(LIBEDIT)/Makefile: libedit-$(LIBEDIT) From 1a4e6e3093ab6ba20e0bf8da5267ca9f9061f025 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Sat, 6 Sep 2014 07:17:44 +0800 Subject: [PATCH 31/77] FS-6796 #comment avoid use c++ string since it causing troubles --- src/include/switch_cpp.h | 5 ++--- src/mod/languages/mod_lua/Makefile.am | 1 - src/mod/languages/mod_lua/freeswitch.i | 3 ++- src/mod/languages/mod_lua/mod_lua_wrap.cpp | 10 +++++----- src/mod/languages/mod_lua/my_swigable_cpp.h | 5 ++++- src/switch_cpp.cpp | 20 +++++++++----------- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/include/switch_cpp.h b/src/include/switch_cpp.h index 2db54e8627..07c77ec54f 100644 --- a/src/include/switch_cpp.h +++ b/src/include/switch_cpp.h @@ -3,7 +3,6 @@ #ifdef __cplusplus -#include extern "C" { #endif #ifdef DOH @@ -150,9 +149,9 @@ SWITCH_DECLARE(bool) email(char *to, char *from, char *headers = NULL, char *bod SWITCH_DECLARE_CONSTRUCTOR Stream(void); SWITCH_DECLARE_CONSTRUCTOR Stream(switch_stream_handle_t *); virtual SWITCH_DECLARE_CONSTRUCTOR ~ Stream(); - SWITCH_DECLARE(std::string) read(); + SWITCH_DECLARE(const char *) read(int *len); SWITCH_DECLARE(void) write(const char *data); - SWITCH_DECLARE(void) raw_write(std::string data); + SWITCH_DECLARE(void) raw_write(const char *data, int len); SWITCH_DECLARE(const char *) get_data(void); }; diff --git a/src/mod/languages/mod_lua/Makefile.am b/src/mod/languages/mod_lua/Makefile.am index d727bf88b6..2a0b51e933 100644 --- a/src/mod/languages/mod_lua/Makefile.am +++ b/src/mod/languages/mod_lua/Makefile.am @@ -33,5 +33,4 @@ lua_wrap: mod_lua_extra.c swig -lua -c++ -I../../../../src/include -oh mod_lua_wrap.h -o mod_lua_wrap.cpp freeswitch.i echo "#include \"mod_lua_extra.c\"" >> mod_lua_wrap.cpp patch -s -p0 -i hack.diff - sed -i -e 's/lua_strlen/lua_rawlen/' mod_lua_wrap.cpp diff --git a/src/mod/languages/mod_lua/freeswitch.i b/src/mod/languages/mod_lua/freeswitch.i index 4f50313588..a5c9d75a14 100644 --- a/src/mod/languages/mod_lua/freeswitch.i +++ b/src/mod/languages/mod_lua/freeswitch.i @@ -43,7 +43,8 @@ %newobject API::execute; %newobject API::executeString; -%include "std_string.i" +%include "typemaps.i" +%apply int *OUTPUT { int *len }; /** * tell swig to grok everything defined in these header files and diff --git a/src/mod/languages/mod_lua/mod_lua_wrap.cpp b/src/mod/languages/mod_lua/mod_lua_wrap.cpp index 1c761e892b..5c4483a240 100644 --- a/src/mod/languages/mod_lua/mod_lua_wrap.cpp +++ b/src/mod/languages/mod_lua/mod_lua_wrap.cpp @@ -2946,18 +2946,18 @@ fail: static int _wrap_Stream_raw_write(lua_State* L) { int SWIG_arg = -1; Stream *arg1 = (Stream *) 0 ; - std::string arg2 ; - + char *arg2 = (char *) 0 ; + SWIG_check_num_args("raw_write",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("raw_write",1,"Stream *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("raw_write",2,"std::string"); + if(!lua_isstring(L,2)) SWIG_fail_arg("raw_write",2,"char const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){ SWIG_fail_ptr("Stream_raw_write",1,SWIGTYPE_p_Stream); } - (&arg2)->assign(lua_tostring(L,2),lua_rawlen(L,2)); - (arg1)->raw_write(arg2); + arg2 = (char *)lua_tostring(L, 2); + (arg1)->raw_write((char const *)arg2,lua_rawlen(L, 2)); SWIG_arg=0; return SWIG_arg; diff --git a/src/mod/languages/mod_lua/my_swigable_cpp.h b/src/mod/languages/mod_lua/my_swigable_cpp.h index 60538b7f91..80f689e56e 100644 --- a/src/mod/languages/mod_lua/my_swigable_cpp.h +++ b/src/mod/languages/mod_lua/my_swigable_cpp.h @@ -22,7 +22,10 @@ class Stream { Stream(void); Stream(switch_stream_handle_t *); virtual ~ Stream(); - string read(); + +%inline %{ + char *read(int *len); +%} void write(const char *data); void raw_write(void *data, int len); const char *get_data(void); diff --git a/src/switch_cpp.cpp b/src/switch_cpp.cpp index df45e6a1da..2702862027 100644 --- a/src/switch_cpp.cpp +++ b/src/switch_cpp.cpp @@ -532,22 +532,20 @@ SWITCH_DECLARE_CONSTRUCTOR Stream::~Stream() } /* WARNING!! you are not encouraged to use this unless you understand the risk!!! */ -SWITCH_DECLARE(std::string) Stream::read() +SWITCH_DECLARE(const char *) Stream::read(int *len) { uint8_t *buff; - this_check(std::string("")); - int len = 0; - this_check(std::string()); + this_check(NULL); - if (!stream_p->read_function) return std::string(); + if (!stream_p->read_function) return NULL; - buff = stream_p->read_function(stream_p, &len); + buff = stream_p->read_function(stream_p, len); - if (!buff) return std::string(); - if (len < 0) return std::string(); + if (!buff) return NULL; + if (len < 0) return NULL; - return std::string((const char *)buff, len); + return (const char *)buff; } SWITCH_DECLARE(void) Stream::write(const char *data) @@ -556,10 +554,10 @@ SWITCH_DECLARE(void) Stream::write(const char *data) stream_p->write_function(stream_p, "%s", data); } -SWITCH_DECLARE(void) Stream::raw_write(std::string data) +SWITCH_DECLARE(void) Stream::raw_write(const char *data, int len) { this_check_void(); - stream_p->raw_write_function(stream_p, (uint8_t *)data.c_str(), data.length()); + stream_p->raw_write_function(stream_p, (uint8_t *)data, len); } SWITCH_DECLARE(const char *)Stream::get_data() From d8bc5ed7aec8ac9b6a3d66541162ebe5cd6bb9f4 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Sat, 6 Sep 2014 07:18:31 +0800 Subject: [PATCH 32/77] swigall --- .../src/org/freeswitch/swig/Stream.java | 8 +- .../org/freeswitch/swig/freeswitchJNI.java | 4 +- .../languages/mod_java/switch_swig_wrap.cpp | 31 +- src/mod/languages/mod_lua/mod_lua_wrap.cpp | 450 +++++++----------- src/mod/languages/mod_perl/mod_perl_wrap.cpp | 73 +-- .../languages/mod_python/mod_python_wrap.cpp | 69 +-- .../legacy/languages/mod_lua/mod_lua_wrap.cpp | 53 ++- 7 files changed, 310 insertions(+), 378 deletions(-) diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/Stream.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/Stream.java index bd99bbc43b..30350b001e 100644 --- a/src/mod/languages/mod_java/src/org/freeswitch/swig/Stream.java +++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/Stream.java @@ -41,16 +41,16 @@ public class Stream { this(freeswitchJNI.new_Stream__SWIG_1(SWIGTYPE_p_switch_stream_handle_t.getCPtr(arg0)), true); } - public SWIGTYPE_p_std__string read() { - return new SWIGTYPE_p_std__string(freeswitchJNI.Stream_read(swigCPtr, this), true); + public String read(SWIGTYPE_p_int len) { + return freeswitchJNI.Stream_read(swigCPtr, this, SWIGTYPE_p_int.getCPtr(len)); } public void write(String data) { freeswitchJNI.Stream_write(swigCPtr, this, data); } - public void raw_write(SWIGTYPE_p_std__string data) { - freeswitchJNI.Stream_raw_write(swigCPtr, this, SWIGTYPE_p_std__string.getCPtr(data)); + public void raw_write(String data, int len) { + freeswitchJNI.Stream_raw_write(swigCPtr, this, data, len); } public String get_data() { diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java index 6e8f6aee86..359bd8b5bc 100644 --- a/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java +++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java @@ -47,9 +47,9 @@ class freeswitchJNI { public final static native long new_Stream__SWIG_0(); public final static native long new_Stream__SWIG_1(long jarg1); public final static native void delete_Stream(long jarg1); - public final static native long Stream_read(long jarg1, Stream jarg1_); + public final static native String Stream_read(long jarg1, Stream jarg1_, long jarg2); public final static native void Stream_write(long jarg1, Stream jarg1_, String jarg2); - public final static native void Stream_raw_write(long jarg1, Stream jarg1_, long jarg2); + public final static native void Stream_raw_write(long jarg1, Stream jarg1_, String jarg2, int jarg3); public final static native String Stream_get_data(long jarg1, Stream jarg1_); public final static native void Event_event_set(long jarg1, Event jarg1_, long jarg2); public final static native long Event_event_get(long jarg1, Event jarg1_); diff --git a/src/mod/languages/mod_java/switch_swig_wrap.cpp b/src/mod/languages/mod_java/switch_swig_wrap.cpp index 115707859e..a24b28ceaa 100644 --- a/src/mod/languages/mod_java/switch_swig_wrap.cpp +++ b/src/mod/languages/mod_java/switch_swig_wrap.cpp @@ -972,17 +972,19 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_delete_1Stream(JN } -SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_Stream_1read(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; +SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_Stream_1read(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { + jstring jresult = 0 ; Stream *arg1 = (Stream *) 0 ; - std::string result; + int *arg2 = (int *) 0 ; + char *result = 0 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(Stream **)&jarg1; - result = (arg1)->read(); - *(std::string **)&jresult = new std::string((std::string &)result); + arg2 = *(int **)&jarg2; + result = (char *)(arg1)->read(arg2); + if(result) jresult = jenv->NewStringUTF((const char *)result); return jresult; } @@ -1005,22 +1007,23 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_Stream_1write(JNI } -SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_Stream_1raw_1write(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { +SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_Stream_1raw_1write(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3) { Stream *arg1 = (Stream *) 0 ; - std::string arg2 ; - std::string *argp2 ; + char *arg2 = (char *) 0 ; + int arg3 ; (void)jenv; (void)jcls; (void)jarg1_; arg1 = *(Stream **)&jarg1; - argp2 = *(std::string **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null std::string"); - return ; + arg2 = 0; + if (jarg2) { + arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); + if (!arg2) return ; } - arg2 = *argp2; - (arg1)->raw_write(arg2); + arg3 = (int)jarg3; + (arg1)->raw_write((char const *)arg2,arg3); + if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); } diff --git a/src/mod/languages/mod_lua/mod_lua_wrap.cpp b/src/mod/languages/mod_lua/mod_lua_wrap.cpp index 5c4483a240..17af7c5b33 100644 --- a/src/mod/languages/mod_lua/mod_lua_wrap.cpp +++ b/src/mod/languages/mod_lua/mod_lua_wrap.cpp @@ -1495,10 +1495,10 @@ SWIG_Lua_dostring(lua_State *L, const char* str) { #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] -#define SWIGTYPE_p_p_switch_event_node_t swig_types[12] -#define SWIGTYPE_p_session_flag_t swig_types[13] -#define SWIGTYPE_p_std__string swig_types[14] +#define SWIGTYPE_p_int swig_types[11] +#define SWIGTYPE_p_lua_State swig_types[12] +#define SWIGTYPE_p_p_switch_event_node_t swig_types[13] +#define SWIGTYPE_p_session_flag_t swig_types[14] #define SWIGTYPE_p_switch_call_cause_t swig_types[15] #define SWIGTYPE_p_switch_channel_state_t swig_types[16] #define SWIGTYPE_p_switch_channel_t swig_types[17] @@ -1538,272 +1538,163 @@ typedef struct{} LANGUAGE_OBJ; #include "freeswitch_lua.h" - #include +#ifdef __cplusplus /* generic alloc/dealloc fns*/ +#define SWIG_ALLOC_ARRAY(TYPE,LEN) new TYPE[LEN] +#define SWIG_FREE_ARRAY(PTR) delete[] PTR; +#else +#define SWIG_ALLOC_ARRAY(TYPE,LEN) (TYPE *)malloc(LEN*sizeof(TYPE)) +#define SWIG_FREE_ARRAY(PTR) free(PTR); +#endif +/* counting the size of arrays:*/ +int SWIG_itable_size(lua_State* L, int index) +{ + int n=0; + while(1){ + lua_rawgeti(L,index,n+1); + if (lua_isnil(L,-1))break; + ++n; + lua_pop(L,1); + } + lua_pop(L,1); + return n; +} + +int SWIG_table_size(lua_State* L, int index) +{ + int n=0; + lua_pushnil(L); /* first key*/ + while (lua_next(L, index) != 0) { + ++n; + lua_pop(L, 1); /* removes `value'; keeps `key' for next iteration*/ + } + return n; +} + +/* super macro to declare array typemap helper fns */ +#define SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE)\ + int SWIG_read_##NAME##_num_array(lua_State* L,int index,TYPE *array,int size){\ + int i;\ + for (i = 0; i < size; i++) {\ + lua_rawgeti(L,index,i+1);\ + if (lua_isnumber(L,-1)){\ + array[i] = (TYPE)lua_tonumber(L,-1);\ + } else {\ + lua_pop(L,1);\ + return 0;\ + }\ + lua_pop(L,1);\ + }\ + return 1;\ + }\ + static TYPE* SWIG_get_##NAME##_num_array_fixed(lua_State* L, int index, int size){\ + TYPE *array;\ + if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) {\ + lua_pushfstring(L,"expected a table of size %d",size);\ + return 0;\ + }\ + array=SWIG_ALLOC_ARRAY(TYPE,size);\ + if (!SWIG_read_##NAME##_num_array(L,index,array,size)){\ + lua_pushstring(L,"table must contain numbers");\ + SWIG_FREE_ARRAY(array);\ + return 0;\ + }\ + return array;\ + }\ + static TYPE* SWIG_get_##NAME##_num_array_var(lua_State* L, int index, int* size)\ + {\ + TYPE *array;\ + if (!lua_istable(L,index)) {\ + lua_pushstring(L,"expected a table");\ + return 0;\ + }\ + *size=SWIG_itable_size(L,index);\ + if (*size<1){\ + lua_pushstring(L,"table appears to be empty");\ + return 0;\ + }\ + array=SWIG_ALLOC_ARRAY(TYPE,*size);\ + if (!SWIG_read_##NAME##_num_array(L,index,array,*size)){\ + lua_pushstring(L,"table must contain numbers");\ + SWIG_FREE_ARRAY(array);\ + return 0;\ + }\ + return array;\ + }\ + void SWIG_write_##NAME##_num_array(lua_State* L,TYPE *array,int size){\ + int i;\ + lua_newtable(L);\ + for (i = 0; i < size; i++){\ + lua_pushnumber(L,(lua_Number)array[i]);\ + lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/ \ + }\ + } + +SWIG_DECLARE_TYPEMAP_ARR_FN(int,int); +SWIG_DECLARE_TYPEMAP_ARR_FN(uint,unsigned int); +SWIG_DECLARE_TYPEMAP_ARR_FN(short,short); +SWIG_DECLARE_TYPEMAP_ARR_FN(ushort,unsigned short); +SWIG_DECLARE_TYPEMAP_ARR_FN(long,long); +SWIG_DECLARE_TYPEMAP_ARR_FN(ulong,unsigned long); +SWIG_DECLARE_TYPEMAP_ARR_FN(float,float); +SWIG_DECLARE_TYPEMAP_ARR_FN(double,double); + +int SWIG_read_ptr_array(lua_State* L,int index,void **array,int size,swig_type_info *type){ + int i; + for (i = 0; i < size; i++) { + lua_rawgeti(L,index,i+1); + if (!lua_isuserdata(L,-1) || SWIG_ConvertPtr(L,-1,&array[i],type,0)==-1){ + lua_pop(L,1); + return 0; + } + lua_pop(L,1); + } + return 1; +} +static void** SWIG_get_ptr_array_fixed(lua_State* L, int index, int size,swig_type_info *type){ + void **array; + if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) { + lua_pushfstring(L,"expected a table of size %d",size); + return 0; + } + array=SWIG_ALLOC_ARRAY(void*,size); + if (!SWIG_read_ptr_array(L,index,array,size,type)){ + lua_pushfstring(L,"table must contain pointers of type %s",type->name); + SWIG_FREE_ARRAY(array); + return 0; + } + return array; +} +static void** SWIG_get_ptr_array_var(lua_State* L, int index, int* size,swig_type_info *type){ + void **array; + if (!lua_istable(L,index)) { + lua_pushstring(L,"expected a table"); + return 0; + } + *size=SWIG_itable_size(L,index); + if (*size<1){ + lua_pushstring(L,"table appears to be empty"); + return 0; + } + array=SWIG_ALLOC_ARRAY(void*,*size); + if (!SWIG_read_ptr_array(L,index,array,*size,type)){ + lua_pushfstring(L,"table must contain pointers of type %s",type->name); + SWIG_FREE_ARRAY(array); + return 0; + } + return array; +} +void SWIG_write_ptr_array(lua_State* L,void **array,int size,swig_type_info *type,int own){ + int i; + lua_newtable(L); + for (i = 0; i < size; i++){ + SWIG_NewPointerObj(L,array[i],type,own); + lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/ + } +} #ifdef __cplusplus extern "C" { #endif -static int _wrap_new_string__SWIG_0(lua_State* L) { - int SWIG_arg = -1; - std::string *result = 0 ; - - SWIG_check_num_args("std::string",0,0) - result = (std::string *)new std::string(); - SWIG_arg=0; - SWIG_NewPointerObj(L,result,SWIGTYPE_p_std__string,1); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_new_string__SWIG_1(lua_State* L) { - int SWIG_arg = -1; - char *arg1 = (char *) 0 ; - std::string *result = 0 ; - - SWIG_check_num_args("std::string",1,1) - if(!lua_isstring(L,1)) SWIG_fail_arg("std::string",1,"char const *"); - arg1 = (char *)lua_tostring(L, 1); - result = (std::string *)new std::string((char const *)arg1); - SWIG_arg=0; - SWIG_NewPointerObj(L,result,SWIGTYPE_p_std__string,1); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_new_string(lua_State* L) { - int argc; - int argv[2]={ - 1,2 - }; - - argc = lua_gettop(L); - if (argc == 0) { - return _wrap_new_string__SWIG_0(L); - } - if (argc == 1) { - int _v; - { - _v = lua_isstring(L,argv[0]); - } - if (_v) { - return _wrap_new_string__SWIG_1(L); - } - } - - lua_pushstring(L,"No matching function for overloaded 'new_string'"); - lua_error(L);return 0; -} - - -static int _wrap_string_size(lua_State* L) { - int SWIG_arg = -1; - std::string *arg1 = (std::string *) 0 ; - unsigned int result; - - SWIG_check_num_args("size",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("size",1,"std::string const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ - SWIG_fail_ptr("string_size",1,SWIGTYPE_p_std__string); - } - - result = (unsigned int)((std::string const *)arg1)->size(); - 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; -} - - -static int _wrap_string_length(lua_State* L) { - int SWIG_arg = -1; - std::string *arg1 = (std::string *) 0 ; - unsigned int result; - - SWIG_check_num_args("length",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("length",1,"std::string const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ - SWIG_fail_ptr("string_length",1,SWIGTYPE_p_std__string); - } - - result = (unsigned int)((std::string const *)arg1)->length(); - 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; -} - - -static int _wrap_string_empty(lua_State* L) { - int SWIG_arg = -1; - std::string *arg1 = (std::string *) 0 ; - bool result; - - SWIG_check_num_args("empty",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("empty",1,"std::string const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ - SWIG_fail_ptr("string_empty",1,SWIGTYPE_p_std__string); - } - - result = (bool)((std::string const *)arg1)->empty(); - SWIG_arg=0; - lua_pushboolean(L,(int)(result==true)); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_string_c_str(lua_State* L) { - int SWIG_arg = -1; - std::string *arg1 = (std::string *) 0 ; - char *result = 0 ; - - SWIG_check_num_args("c_str",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("c_str",1,"std::string const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ - SWIG_fail_ptr("string_c_str",1,SWIGTYPE_p_std__string); - } - - result = (char *)((std::string const *)arg1)->c_str(); - SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_string_data(lua_State* L) { - int SWIG_arg = -1; - std::string *arg1 = (std::string *) 0 ; - char *result = 0 ; - - SWIG_check_num_args("data",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("data",1,"std::string const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ - SWIG_fail_ptr("string_data",1,SWIGTYPE_p_std__string); - } - - result = (char *)((std::string const *)arg1)->data(); - SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_string_assign(lua_State* L) { - int SWIG_arg = -1; - std::string *arg1 = (std::string *) 0 ; - char *arg2 = (char *) 0 ; - - SWIG_check_num_args("assign",2,2) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("assign",1,"std::string *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("assign",2,"char const *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ - SWIG_fail_ptr("string_assign",1,SWIGTYPE_p_std__string); - } - - arg2 = (char *)lua_tostring(L, 2); - (arg1)->assign((char const *)arg2); - SWIG_arg=0; - - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_delete_string(lua_State* L) { - int SWIG_arg = -1; - std::string *arg1 = (std::string *) 0 ; - - SWIG_check_num_args("std::string::~string",1,1) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::~string",1,"std::string *"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,SWIG_POINTER_DISOWN))){ - SWIG_fail_ptr("delete_string",1,SWIGTYPE_p_std__string); - } - - delete arg1; - - SWIG_arg=0; - - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static void swig_delete_string(void *obj) { -std::string *arg1 = (std::string *) obj; -delete arg1; -} -static swig_lua_method swig_std_string_methods[] = { - {"size", _wrap_string_size}, - {"length", _wrap_string_length}, - {"empty", _wrap_string_empty}, - {"c_str", _wrap_string_c_str}, - {"data", _wrap_string_data}, - {"assign", _wrap_string_assign}, - {0,0} -}; -static swig_lua_attribute swig_std_string_attributes[] = { - {0,0,0} -}; -static swig_lua_class *swig_std_string_bases[] = {0}; -static const char *swig_std_string_base_names[] = {0}; -static swig_lua_class _wrap_class_std_string = { "string", &SWIGTYPE_p_std__string,_wrap_new_string, swig_delete_string, swig_std_string_methods, swig_std_string_attributes, swig_std_string_bases, swig_std_string_base_names }; - static int _wrap_setGlobalVariable(lua_State* L) { int SWIG_arg = -1; char *arg1 = (char *) 0 ; @@ -2894,8 +2785,11 @@ fail: static int _wrap_Stream_read(lua_State* L) { int SWIG_arg = -1; Stream *arg1 = (Stream *) 0 ; - std::string result; + int *arg2 = (int *) 0 ; + char *result = 0 ; + int temp2 ; + arg2 = &temp2; SWIG_check_num_args("read",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("read",1,"Stream *"); @@ -2903,9 +2797,10 @@ static int _wrap_Stream_read(lua_State* L) { SWIG_fail_ptr("Stream_read",1,SWIGTYPE_p_Stream); } - result = (arg1)->read(); + result = (char *)(arg1)->read(arg2); SWIG_arg=0; - lua_pushlstring(L,(&result)->data(),(&result)->size()); SWIG_arg++; + lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -2947,17 +2842,20 @@ static int _wrap_Stream_raw_write(lua_State* L) { int SWIG_arg = -1; Stream *arg1 = (Stream *) 0 ; char *arg2 = (char *) 0 ; - - SWIG_check_num_args("raw_write",2,2) + int arg3 ; + + SWIG_check_num_args("raw_write",3,3) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("raw_write",1,"Stream *"); if(!lua_isstring(L,2)) SWIG_fail_arg("raw_write",2,"char const *"); + if(!lua_isnumber(L,3)) SWIG_fail_arg("raw_write",3,"int"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){ SWIG_fail_ptr("Stream_raw_write",1,SWIGTYPE_p_Stream); } arg2 = (char *)lua_tostring(L, 2); - (arg1)->raw_write((char const *)arg2,lua_rawlen(L, 2)); + arg3 = (int)lua_tonumber(L, 3); + (arg1)->raw_write((char const *)arg2,arg3); SWIG_arg=0; return SWIG_arg; @@ -8383,10 +8281,10 @@ static swig_type_info _swigt__p_LUA__Session = {"_p_LUA__Session", "LUA::Session 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_int = {"_p_int", "int *", 0, 0, (void*)0, 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}; -static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)&_wrap_class_std_string, 0}; static swig_type_info _swigt__p_switch_call_cause_t = {"_p_switch_call_cause_t", "switch_call_cause_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_state_t = {"_p_switch_channel_state_t", "switch_channel_state_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_t = {"_p_switch_channel_t", "switch_channel_t *", 0, 0, (void*)0, 0}; @@ -8415,10 +8313,10 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_SWIGLUA_FN, &_swigt__p_Stream, &_swigt__p_input_callback_state, + &_swigt__p_int, &_swigt__p_lua_State, &_swigt__p_p_switch_event_node_t, &_swigt__p_session_flag_t, - &_swigt__p_std__string, &_swigt__p_switch_call_cause_t, &_swigt__p_switch_channel_state_t, &_swigt__p_switch_channel_t, @@ -8447,10 +8345,10 @@ static swig_cast_info _swigc__p_LUA__Session[] = { {&_swigt__p_LUA__Session, 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_int[] = { {&_swigt__p_int, 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}}; static swig_cast_info _swigc__p_p_switch_event_node_t[] = { {&_swigt__p_p_switch_event_node_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_session_flag_t[] = { {&_swigt__p_session_flag_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__string[] = { {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_call_cause_t[] = { {&_swigt__p_switch_call_cause_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_state_t[] = { {&_swigt__p_switch_channel_state_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_t[] = { {&_swigt__p_switch_channel_t, 0, 0, 0},{0, 0, 0, 0}}; @@ -8479,10 +8377,10 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_SWIGLUA_FN, _swigc__p_Stream, _swigc__p_input_callback_state, + _swigc__p_int, _swigc__p_lua_State, _swigc__p_p_switch_event_node_t, _swigc__p_session_flag_t, - _swigc__p_std__string, _swigc__p_switch_call_cause_t, _swigc__p_switch_channel_state_t, _swigc__p_switch_channel_t, diff --git a/src/mod/languages/mod_perl/mod_perl_wrap.cpp b/src/mod/languages/mod_perl/mod_perl_wrap.cpp index 87885f798d..e581200ba4 100644 --- a/src/mod/languages/mod_perl/mod_perl_wrap.cpp +++ b/src/mod/languages/mod_perl/mod_perl_wrap.cpp @@ -1457,9 +1457,9 @@ SWIG_Perl_SetModule(swig_module_info *module) { #define SWIGTYPE_p_Stream swig_types[8] #define SWIGTYPE_p_char swig_types[9] #define SWIGTYPE_p_input_callback_state swig_types[10] -#define SWIGTYPE_p_p_switch_event_node_t swig_types[11] -#define SWIGTYPE_p_session_flag_t swig_types[12] -#define SWIGTYPE_p_std__string swig_types[13] +#define SWIGTYPE_p_int swig_types[11] +#define SWIGTYPE_p_p_switch_event_node_t swig_types[12] +#define SWIGTYPE_p_session_flag_t swig_types[13] #define SWIGTYPE_p_switch_call_cause_t swig_types[14] #define SWIGTYPE_p_switch_channel_state_t swig_types[15] #define SWIGTYPE_p_switch_channel_t swig_types[16] @@ -3403,26 +3403,36 @@ XS(_wrap_delete_Stream) { XS(_wrap_Stream_read) { { Stream *arg1 = (Stream *) 0 ; - std::string result; + int *arg2 = (int *) 0 ; + char *result = 0 ; void *argp1 = 0 ; int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; int argvi = 0; dXSARGS; - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: Stream_read(self);"); + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: Stream_read(self,len);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Stream, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Stream_read" "', argument " "1"" of type '" "Stream *""'"); } arg1 = reinterpret_cast< Stream * >(argp1); - result = (arg1)->read(); - ST(argvi) = SWIG_NewPointerObj((new std::string(static_cast< const std::string& >(result))), SWIGTYPE_p_std__string, SWIG_POINTER_OWN | 0); argvi++ ; + res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_int, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Stream_read" "', argument " "2"" of type '" "int *""'"); + } + arg2 = reinterpret_cast< int * >(argp2); + result = (char *)(arg1)->read(arg2); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; + XSRETURN(argvi); fail: + SWIG_croak_null(); } } @@ -3469,39 +3479,46 @@ XS(_wrap_Stream_write) { XS(_wrap_Stream_raw_write) { { Stream *arg1 = (Stream *) 0 ; - std::string arg2 ; + char *arg2 = (char *) 0 ; + int arg3 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int val3 ; + int ecode3 = 0 ; int argvi = 0; dXSARGS; - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: Stream_raw_write(self,data);"); + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: Stream_raw_write(self,data,len);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Stream, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Stream_raw_write" "', argument " "1"" of type '" "Stream *""'"); } arg1 = reinterpret_cast< Stream * >(argp1); - { - res2 = SWIG_ConvertPtr(ST(1), &argp2, SWIGTYPE_p_std__string, 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Stream_raw_write" "', argument " "2"" of type '" "std::string""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Stream_raw_write" "', argument " "2"" of type '" "std::string""'"); - } else { - arg2 = *(reinterpret_cast< std::string * >(argp2)); - } + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Stream_raw_write" "', argument " "2"" of type '" "char const *""'"); } - (arg1)->raw_write(arg2); + arg2 = reinterpret_cast< char * >(buf2); + ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Stream_raw_write" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + (arg1)->raw_write((char const *)arg2,arg3); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + XSRETURN(argvi); fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + SWIG_croak_null(); } } @@ -9977,9 +9994,9 @@ static swig_type_info _swigt__p_PerlInterpreter = {"_p_PerlInterpreter", "PerlIn static swig_type_info _swigt__p_Stream = {"_p_Stream", "Stream *", 0, 0, (void*)"freeswitch::Stream", 0}; static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state", "input_callback_state_t *|input_callback_state *", 0, 0, (void*)"freeswitch::input_callback_state_t", 0}; +static swig_type_info _swigt__p_int = {"_p_int", "int *", 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}; -static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_call_cause_t = {"_p_switch_call_cause_t", "switch_call_cause_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_state_t = {"_p_switch_channel_state_t", "switch_channel_state_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_t = {"_p_switch_channel_t", "switch_channel_t *", 0, 0, (void*)0, 0}; @@ -10008,9 +10025,9 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_Stream, &_swigt__p_char, &_swigt__p_input_callback_state, + &_swigt__p_int, &_swigt__p_p_switch_event_node_t, &_swigt__p_session_flag_t, - &_swigt__p_std__string, &_swigt__p_switch_call_cause_t, &_swigt__p_switch_channel_state_t, &_swigt__p_switch_channel_t, @@ -10039,9 +10056,9 @@ static swig_cast_info _swigc__p_PerlInterpreter[] = { {&_swigt__p_PerlInterpret static swig_cast_info _swigc__p_Stream[] = { {&_swigt__p_Stream, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_input_callback_state[] = { {&_swigt__p_input_callback_state, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_switch_event_node_t[] = { {&_swigt__p_p_switch_event_node_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_session_flag_t[] = { {&_swigt__p_session_flag_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__string[] = { {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_call_cause_t[] = { {&_swigt__p_switch_call_cause_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_state_t[] = { {&_swigt__p_switch_channel_state_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_t[] = { {&_swigt__p_switch_channel_t, 0, 0, 0},{0, 0, 0, 0}}; @@ -10070,9 +10087,9 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_Stream, _swigc__p_char, _swigc__p_input_callback_state, + _swigc__p_int, _swigc__p_p_switch_event_node_t, _swigc__p_session_flag_t, - _swigc__p_std__string, _swigc__p_switch_call_cause_t, _swigc__p_switch_channel_state_t, _swigc__p_switch_channel_t, diff --git a/src/mod/languages/mod_python/mod_python_wrap.cpp b/src/mod/languages/mod_python/mod_python_wrap.cpp index 3b2198bc2f..e7afa21ba5 100644 --- a/src/mod/languages/mod_python/mod_python_wrap.cpp +++ b/src/mod/languages/mod_python/mod_python_wrap.cpp @@ -2505,9 +2505,9 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) #define SWIGTYPE_p_Stream swig_types[7] #define SWIGTYPE_p_char swig_types[8] #define SWIGTYPE_p_input_callback_state swig_types[9] -#define SWIGTYPE_p_p_switch_event_node_t swig_types[10] -#define SWIGTYPE_p_session_flag_t swig_types[11] -#define SWIGTYPE_p_std__string swig_types[12] +#define SWIGTYPE_p_int swig_types[10] +#define SWIGTYPE_p_p_switch_event_node_t swig_types[11] +#define SWIGTYPE_p_session_flag_t swig_types[12] #define SWIGTYPE_p_switch_call_cause_t swig_types[13] #define SWIGTYPE_p_switch_channel_state_t swig_types[14] #define SWIGTYPE_p_switch_channel_t swig_types[15] @@ -4336,19 +4336,28 @@ fail: SWIGINTERN PyObject *_wrap_Stream_read(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Stream *arg1 = (Stream *) 0 ; - std::string result; + int *arg2 = (int *) 0 ; + char *result = 0 ; void *argp1 = 0 ; int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"O:Stream_read",&obj0)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OO:Stream_read",&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Stream, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Stream_read" "', argument " "1"" of type '" "Stream *""'"); } arg1 = reinterpret_cast< Stream * >(argp1); - result = (arg1)->read(); - resultobj = SWIG_NewPointerObj((new std::string(static_cast< const std::string& >(result))), SWIGTYPE_p_std__string, SWIG_POINTER_OWN | 0 ); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Stream_read" "', argument " "2"" of type '" "int *""'"); + } + arg2 = reinterpret_cast< int * >(argp2); + result = (char *)(arg1)->read(arg2); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; @@ -4391,37 +4400,41 @@ fail: SWIGINTERN PyObject *_wrap_Stream_raw_write(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; Stream *arg1 = (Stream *) 0 ; - std::string arg2 ; + char *arg2 = (char *) 0 ; + int arg3 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int val3 ; + int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; - if (!PyArg_ParseTuple(args,(char *)"OO:Stream_raw_write",&obj0,&obj1)) SWIG_fail; + if (!PyArg_ParseTuple(args,(char *)"OOO:Stream_raw_write",&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Stream, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Stream_raw_write" "', argument " "1"" of type '" "Stream *""'"); } arg1 = reinterpret_cast< Stream * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__string, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Stream_raw_write" "', argument " "2"" of type '" "std::string""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Stream_raw_write" "', argument " "2"" of type '" "std::string""'"); - } else { - std::string * temp = reinterpret_cast< std::string * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Stream_raw_write" "', argument " "2"" of type '" "char const *""'"); } - (arg1)->raw_write(arg2); + arg2 = reinterpret_cast< char * >(buf2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Stream_raw_write" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + (arg1)->raw_write((char const *)arg2,arg3); resultobj = SWIG_Py_Void(); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; return NULL; } @@ -9793,9 +9806,9 @@ static swig_type_info _swigt__p_PYTHON__Session = {"_p_PYTHON__Session", "PYTHON static swig_type_info _swigt__p_Stream = {"_p_Stream", "Stream *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state", "input_callback_state_t *|input_callback_state *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int = {"_p_int", "int *", 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}; -static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_call_cause_t = {"_p_switch_call_cause_t", "switch_call_cause_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_state_t = {"_p_switch_channel_state_t", "switch_channel_state_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_t = {"_p_switch_channel_t", "switch_channel_t *", 0, 0, (void*)0, 0}; @@ -9823,9 +9836,9 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_Stream, &_swigt__p_char, &_swigt__p_input_callback_state, + &_swigt__p_int, &_swigt__p_p_switch_event_node_t, &_swigt__p_session_flag_t, - &_swigt__p_std__string, &_swigt__p_switch_call_cause_t, &_swigt__p_switch_channel_state_t, &_swigt__p_switch_channel_t, @@ -9853,9 +9866,9 @@ static swig_cast_info _swigc__p_PYTHON__Session[] = { {&_swigt__p_PYTHON__Sessi static swig_cast_info _swigc__p_Stream[] = { {&_swigt__p_Stream, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_input_callback_state[] = { {&_swigt__p_input_callback_state, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_switch_event_node_t[] = { {&_swigt__p_p_switch_event_node_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_session_flag_t[] = { {&_swigt__p_session_flag_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__string[] = { {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_call_cause_t[] = { {&_swigt__p_switch_call_cause_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_state_t[] = { {&_swigt__p_switch_channel_state_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_t[] = { {&_swigt__p_switch_channel_t, 0, 0, 0},{0, 0, 0, 0}}; @@ -9883,9 +9896,9 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_Stream, _swigc__p_char, _swigc__p_input_callback_state, + _swigc__p_int, _swigc__p_p_switch_event_node_t, _swigc__p_session_flag_t, - _swigc__p_std__string, _swigc__p_switch_call_cause_t, _swigc__p_switch_channel_state_t, _swigc__p_switch_channel_t, diff --git a/src/mod/legacy/languages/mod_lua/mod_lua_wrap.cpp b/src/mod/legacy/languages/mod_lua/mod_lua_wrap.cpp index e21988d418..1e2147f31f 100644 --- a/src/mod/legacy/languages/mod_lua/mod_lua_wrap.cpp +++ b/src/mod/legacy/languages/mod_lua/mod_lua_wrap.cpp @@ -1495,10 +1495,10 @@ SWIG_Lua_dostring(lua_State *L, const char* str) { #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] -#define SWIGTYPE_p_p_switch_event_node_t swig_types[12] -#define SWIGTYPE_p_session_flag_t swig_types[13] -#define SWIGTYPE_p_std__string swig_types[14] +#define SWIGTYPE_p_int swig_types[11] +#define SWIGTYPE_p_lua_State swig_types[12] +#define SWIGTYPE_p_p_switch_event_node_t swig_types[13] +#define SWIGTYPE_p_session_flag_t swig_types[14] #define SWIGTYPE_p_switch_call_cause_t swig_types[15] #define SWIGTYPE_p_switch_channel_state_t swig_types[16] #define SWIGTYPE_p_switch_channel_t swig_types[17] @@ -2630,21 +2630,25 @@ fail: static int _wrap_Stream_read(lua_State* L) { int SWIG_arg = -1; Stream *arg1 = (Stream *) 0 ; - std::string result; + int *arg2 = (int *) 0 ; + char *result = 0 ; - SWIG_check_num_args("read",1,1) + SWIG_check_num_args("read",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("read",1,"Stream *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("read",2,"int *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){ SWIG_fail_ptr("Stream_read",1,SWIGTYPE_p_Stream); } - result = (arg1)->read(); - SWIG_arg=0; - { - std::string * resultptr = new std::string((std::string &) result); - SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_std__string,1); SWIG_arg++; + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_int,0))){ + SWIG_fail_ptr("Stream_read",2,SWIGTYPE_p_int); } + + result = (char *)(arg1)->read(arg2); + SWIG_arg=0; + lua_pushstring(L,(const char*)result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; @@ -2685,24 +2689,21 @@ fail: static int _wrap_Stream_raw_write(lua_State* L) { int SWIG_arg = -1; Stream *arg1 = (Stream *) 0 ; - std::string arg2 ; - std::string *argp2 ; + char *arg2 = (char *) 0 ; + int arg3 ; - SWIG_check_num_args("raw_write",2,2) + SWIG_check_num_args("raw_write",3,3) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("raw_write",1,"Stream *"); - if(!lua_isuserdata(L,2)) SWIG_fail_arg("raw_write",2,"std::string"); + if(!lua_isstring(L,2)) SWIG_fail_arg("raw_write",2,"char const *"); + if(!lua_isnumber(L,3)) SWIG_fail_arg("raw_write",3,"int"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Stream,0))){ SWIG_fail_ptr("Stream_raw_write",1,SWIGTYPE_p_Stream); } - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_std__string,0))){ - SWIG_fail_ptr("Stream_raw_write",2,SWIGTYPE_p_std__string); - } - arg2 = *argp2; - - (arg1)->raw_write(arg2); + arg2 = (char *)lua_tostring(L, 2); + arg3 = (int)lua_tonumber(L, 3); + (arg1)->raw_write((char const *)arg2,arg3); SWIG_arg=0; return SWIG_arg; @@ -8128,10 +8129,10 @@ static swig_type_info _swigt__p_LUA__Session = {"_p_LUA__Session", "LUA::Session 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_int = {"_p_int", "int *", 0, 0, (void*)0, 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}; -static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_call_cause_t = {"_p_switch_call_cause_t", "switch_call_cause_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_state_t = {"_p_switch_channel_state_t", "switch_channel_state_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_t = {"_p_switch_channel_t", "switch_channel_t *", 0, 0, (void*)0, 0}; @@ -8160,10 +8161,10 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_SWIGLUA_FN, &_swigt__p_Stream, &_swigt__p_input_callback_state, + &_swigt__p_int, &_swigt__p_lua_State, &_swigt__p_p_switch_event_node_t, &_swigt__p_session_flag_t, - &_swigt__p_std__string, &_swigt__p_switch_call_cause_t, &_swigt__p_switch_channel_state_t, &_swigt__p_switch_channel_t, @@ -8192,10 +8193,10 @@ static swig_cast_info _swigc__p_LUA__Session[] = { {&_swigt__p_LUA__Session, 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_int[] = { {&_swigt__p_int, 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}}; static swig_cast_info _swigc__p_p_switch_event_node_t[] = { {&_swigt__p_p_switch_event_node_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_session_flag_t[] = { {&_swigt__p_session_flag_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_std__string[] = { {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_call_cause_t[] = { {&_swigt__p_switch_call_cause_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_state_t[] = { {&_swigt__p_switch_channel_state_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_t[] = { {&_swigt__p_switch_channel_t, 0, 0, 0},{0, 0, 0, 0}}; @@ -8224,10 +8225,10 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_SWIGLUA_FN, _swigc__p_Stream, _swigc__p_input_callback_state, + _swigc__p_int, _swigc__p_lua_State, _swigc__p_p_switch_event_node_t, _swigc__p_session_flag_t, - _swigc__p_std__string, _swigc__p_switch_call_cause_t, _swigc__p_switch_channel_state_t, _swigc__p_switch_channel_t, From 76b093a09895f9dca490a6f10c1118ba62b23423 Mon Sep 17 00:00:00 2001 From: Jeff Lenk Date: Fri, 5 Sep 2014 22:43:52 -0500 Subject: [PATCH 33/77] fix trivial windows compiler warning for vs2010 --- src/switch_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_utils.c b/src/switch_utils.c index 8e62b97f54..81fe8a192f 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -3700,7 +3700,7 @@ SWITCH_DECLARE(switch_status_t) switch_http_parse_header(char *buffer, uint32_t if (p) { *p++ = '\0'; - if (*p) request->port = atoi(p); + if (*p) request->port = (switch_port_t)atoi(p); } } } From 7f8cc54cfb584d09b11148a5296962a2e468f12e Mon Sep 17 00:00:00 2001 From: Seven Du Date: Sat, 6 Sep 2014 12:06:24 +0800 Subject: [PATCH 34/77] add basic http virtual host support and fix some leaks --- src/mod/endpoints/mod_verto/mod_verto.c | 183 +++++++++++++++++++++--- src/mod/endpoints/mod_verto/mod_verto.h | 17 ++- 2 files changed, 177 insertions(+), 23 deletions(-) diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c index 534c78e606..16b8515af6 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.c +++ b/src/mod/endpoints/mod_verto/mod_verto.c @@ -24,6 +24,7 @@ * Contributor(s): * * Anthony Minessale II + * Seven Du * * mod_verto.c -- HTML5 Verto interface * @@ -1330,7 +1331,7 @@ static switch_status_t http_stream_write(switch_stream_handle_t *handle, const c return ret ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE; } -static void http_static_handler(switch_http_request_t *request) +static void http_static_handler(switch_http_request_t *request, verto_vhost_t *vhost) { jsock_t *jsock = request->user_data; char path[512]; @@ -1339,17 +1340,12 @@ static void http_static_handler(switch_http_request_t *request) uint8_t chunk[4096]; const char *mime_type = "text/html", *new_type; - switch_snprintf(path, sizeof(path), "%s%s", jsock->profile->htdocs, request->uri); + switch_snprintf(path, sizeof(path), "%s%s", vhost->root, request->uri); - // printf("local path: %s\n", path); - - if (end_of(path) == '/') { - char *data = "HTTP/1.1 500 Internal Error\r\n" - "Connection: close\r\n" - "Content-Type: text/plain\r\n\r\n" - "Directory indexing is UNSUPPORTED!\r\n"; - ws_raw_write(&jsock->ws, data, strlen(data)); - return; + if (switch_directory_exists(path, NULL) == SWITCH_STATUS_SUCCESS) { + switch_snprintf(path, sizeof(path), "%s%s%s%s", + vhost->root, request->uri, end_of(path) == '/' ? "" : SWITCH_PATH_SEPARATOR, vhost->index); + // printf("local path: %s\n", path); } if ((ext = strrchr(path, '.'))) { @@ -1359,7 +1355,8 @@ static void http_static_handler(switch_http_request_t *request) } } - if (switch_file_open(&fd, path, SWITCH_FOPEN_READ, SWITCH_FPROT_UREAD | SWITCH_FPROT_UWRITE, jsock->pool) == SWITCH_STATUS_SUCCESS) { + if (switch_file_exists(path, NULL) == SWITCH_STATUS_SUCCESS && + switch_file_open(&fd, path, SWITCH_FOPEN_READ, SWITCH_FPROT_UREAD, jsock->pool) == SWITCH_STATUS_SUCCESS) { switch_size_t flen = switch_file_get_size(fd); switch_snprintf((char *)chunk, sizeof(chunk), "HTTP/1.1 200 OK\r\n" @@ -1400,6 +1397,8 @@ static void http_run(jsock_t *jsock) switch_http_request_t request = { 0 }; switch_stream_handle_t stream = { 0 }; char *data; + char *ext; + verto_vhost_t *vhost; request.user_data = jsock; @@ -1423,12 +1422,50 @@ static void http_run(jsock_t *jsock) stream.raw_write_function = http_stream_raw_write; switch_event_add_header_string(request.headers, SWITCH_STACK_BOTTOM, "Request-Method", request.method); + switch_event_add_header_string(request.headers, SWITCH_STACK_BOTTOM, "HTTP-Request-URI", request.uri); + + if (!jsock->profile->vhosts) goto err; + + /* only one vhost supported for now */ + vhost = jsock->profile->vhosts; + + if (vhost->rewrites) { + switch_event_header_t *rule = vhost->rewrites->headers; + switch_regex_t *re = NULL; + int ovector[30]; + int proceed; + + while(rule) { + char *expression = rule->name; + + if ((proceed = switch_regex_perform(request.uri, expression, &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + "%d request [%s] matched expr [%s]\n", proceed, request.uri, expression); + request.uri = rule->value; + break; + } + + rule = rule->next; + } + } + switch_event_add_header_string(request.headers, SWITCH_STACK_BOTTOM, "HTTP-URI", request.uri); - if (!strncmp(request.uri, "/rest/", 6)) { - switch_api_execute("lua", "__rest_init__.lua", NULL, &stream); + if ((ext = strrchr(request.uri, '.'))) { + char path[1024]; + + if (!strncmp(ext, ".lua", 4)) { + switch_snprintf(path, sizeof(path), "%s%s", vhost->script_root, request.uri); + switch_api_execute("lua", path, NULL, &stream); + } else if (!strncmp(ext, ".js", 3)) { + switch_snprintf(path, sizeof(path), "%s%s", vhost->script_root, request.uri); + switch_api_execute("jsrun", path, NULL, &stream); + } else { + http_static_handler(&request, vhost); + } + } else { - http_static_handler(&request); + http_static_handler(&request, vhost); } switch_http_free_request(&request); @@ -1448,8 +1485,8 @@ static void client_run(jsock_t *jsock) jsock->local_addr.sin_port = 0; - if (ws_init(&jsock->ws, jsock->client_socket, (jsock->ptype & PTYPE_CLIENT_SSL) ? jsock->profile->ssl_ctx : NULL, 0, 1, !!jsock->profile->htdocs) < 0) { - if (jsock->profile->htdocs) { + if (ws_init(&jsock->ws, jsock->client_socket, (jsock->ptype & PTYPE_CLIENT_SSL) ? jsock->profile->ssl_ctx : NULL, 0, 1, !!jsock->profile->vhosts) < 0) { + if (jsock->profile->vhosts) { http_run(jsock); ws_close(&jsock->ws, WS_NONE); goto error; @@ -3603,6 +3640,7 @@ static int runtime(verto_profile_t *profile) static void kill_profile(verto_profile_t *profile) { jsock_t *p; + verto_vhost_t *h; int i; profile->running = 0; @@ -3619,6 +3657,16 @@ static void kill_profile(verto_profile_t *profile) for(p = profile->jsock_head; p; p = p->next) { close_socket(&p->client_socket); } + + h = profile->vhosts; + while(h) { + if (h->rewrites) { + switch_event_destroy(&h->rewrites); + } + + h = h->next; + } + switch_mutex_unlock(profile->mutex); @@ -3768,6 +3816,7 @@ static switch_status_t parse_config(const char *cf) { switch_xml_t cfg, xml, settings, param, xprofile, xprofiles; + switch_xml_t xvhosts, xvhost, rewrites, rule; switch_status_t status = SWITCH_STATUS_SUCCESS; if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) { @@ -3821,8 +3870,6 @@ static switch_status_t parse_config(const char *cf) } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Max Bindings Reached!\n"); } - } else if (!strcasecmp(var, "htdocs-directory")) { - profile->htdocs = switch_core_strdup(profile->pool, val); } else if (!strcasecmp(var, "secure-combined")) { set_string(profile->cert, val); set_string(profile->key, val); @@ -3918,8 +3965,89 @@ static switch_status_t parse_config(const char *cf) profile->name, profile->ip[i].local_ip, profile->ip[i].local_port); } } - } - } + + /* parse vhosts */ + /* WARNNING: Experimental feature, DO NOT use until we remove this warnning!! */ + if ((xvhosts = switch_xml_child(xprofile, "vhosts"))) { + verto_vhost_t *vhost_tail = NULL; + + for (xvhost = switch_xml_child(xvhosts, "vhost"); xvhost; xvhost = xvhost->next) { + verto_vhost_t *vhost; + const char *domain = switch_xml_attr(xvhost, "domain"); + + if (zstr(domain)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Required field domain missing\n"); + continue; + } + + vhost = switch_core_alloc(profile->pool, sizeof(*vhost)); + memset(vhost, 0, sizeof(*vhost)); + vhost->pool = profile->pool; + vhost->domain = switch_core_strdup(profile->pool, domain); + + if (!vhost_tail) { + profile->vhosts = vhost; + } else { + vhost_tail->next = vhost; + } + + vhost_tail = vhost; + + for (param = switch_xml_child(xvhost, "param"); param; param = param->next) { + char *var = NULL; + char *val = NULL; + + var = (char *) switch_xml_attr_soft(param, "name"); + val = (char *) switch_xml_attr_soft(param, "value"); + + if (!strcasecmp(var, "alias")) { + vhost->alias = switch_core_strdup(vhost->pool, val); + } else if (!strcasecmp(var, "root")) { + vhost->root = switch_core_strdup(vhost->pool, val); + } else if (!strcasecmp(var, "script_root")) { + vhost->script_root = switch_core_strdup(vhost->pool, val); + } else if (!strcasecmp(var, "index")) { + vhost->index = switch_core_strdup(vhost->pool, val); + } else if (!strcasecmp(var, "auth-realm")) { + vhost->auth_realm = switch_core_strdup(vhost->pool, val); + } else if (!strcasecmp(var, "auth-user")) { + vhost->auth_user = switch_core_strdup(vhost->pool, val); + } else if (!strcasecmp(var, "auth-pass")) { + vhost->auth_pass = switch_core_strdup(vhost->pool, val); + } + } + + if (zstr(vhost->root)) { + vhost->root = SWITCH_GLOBAL_dirs.htdocs_dir; + } + + if (zstr(vhost->script_root)) { + vhost->root = SWITCH_GLOBAL_dirs.script_dir; + } + + if (zstr(vhost->index)) { + vhost->index = "index.html"; + } + + if ((rewrites = switch_xml_child(xvhost, "rewrites"))) { + if (switch_event_create(&vhost->rewrites, SWITCH_EVENT_CLONE) == SWITCH_STATUS_SUCCESS) { + for (rule = switch_xml_child(rewrites, "rule"); rule; rule = rule->next) { + char *expr = NULL; + char *val = NULL; + + expr = (char *) switch_xml_attr_soft(rule, "expression"); + val = (char *) switch_xml_attr_soft(rule, "value"); + + if (zstr(expr)) continue; + + switch_event_add_header_string(vhost->rewrites, SWITCH_STACK_BOTTOM, expr, val); + } + } + } // rewrites + } // xvhost + } // xvhosts + } // xprofile + } // xprofiles if ((settings = switch_xml_child(cfg, "settings"))) { for (param = switch_xml_child(settings, "param"); param; param = param->next) { @@ -3995,6 +4123,7 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t { verto_profile_t *profile = NULL; jsock_t *jsock; + verto_vhost_t *vhost; int cp = 0; int cc = 0; const char *line = "================================================================================================="; @@ -4007,14 +4136,22 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t for (int i = 0; i < profile->i; i++) { char *tmpurl = switch_mprintf("%s:%s:%d",(profile->ip[i].secure == 1) ? "wss" : "ws", profile->ip[i].local_ip, profile->ip[i].local_port); stream->write_function(stream, "%25s\t%s\t %40s\t%s\n", profile->name, "profile", tmpurl, (profile->running) ? "RUNNING" : "DOWN"); + switch_safe_free(tmpurl); } cp++; switch_mutex_lock(profile->mutex); - for(jsock = profile->jsock_head; jsock; jsock = jsock->next) { + for (vhost = profile->vhosts; vhost; vhost = vhost->next) { + char *tmpname = switch_mprintf("%s::%s", profile->name, vhost->domain); + stream->write_function(stream, "%25s\t%s\t %40s\t%s (%s)\n", tmpname, "vhost", vhost->root, vhost->auth_user ? "AUTH" : "NOAUTH", vhost->auth_user ? vhost->auth_user : ""); + switch_safe_free(tmpname); + } + + for (jsock = profile->jsock_head; jsock; jsock = jsock->next) { char *tmpname = switch_mprintf("%s::%s@%s", profile->name, jsock->id, jsock->domain); stream->write_function(stream, "%25s\t%s\t %40s\t%s (%s)\n", tmpname, "client", jsock->name, (!zstr(jsock->uid)) ? "CONN_REG" : "CONN_NO_REG", (jsock->ptype & PTYPE_CLIENT_SSL) ? "WSS": "WS"); cc++; + switch_safe_free(tmpname); } switch_mutex_unlock(profile->mutex); } @@ -4041,6 +4178,7 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl for (int i = 0; i < profile->i; i++) { char *tmpurl = switch_mprintf("%s:%s:%d",(profile->ip[i].secure == 1) ? "wss" : "ws", profile->ip[i].local_ip, profile->ip[i].local_port); stream->write_function(stream, "\n%s\n%s\n%s\n%s\n\n", profile->name, "profile", tmpurl, (profile->running) ? "RUNNING" : "DOWN"); + switch_safe_free(tmpurl); } cp++; @@ -4050,6 +4188,7 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl stream->write_function(stream, "\n%s\n%s\n%s\n%s\n%s (%s)\n\n", profile->name, tmpname, "client", jsock->name, (!zstr(jsock->uid)) ? "CONN_REG" : "CONN_NO_REG", (jsock->ptype & PTYPE_CLIENT_SSL) ? "WSS": "WS"); cc++; + switch_safe_free(tmpname); } switch_mutex_unlock(profile->mutex); } diff --git a/src/mod/endpoints/mod_verto/mod_verto.h b/src/mod/endpoints/mod_verto/mod_verto.h index a17aff52c4..bafc0184c8 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.h +++ b/src/mod/endpoints/mod_verto/mod_verto.h @@ -24,6 +24,7 @@ * Contributor(s): * * Anthony Minessale II + * Seven Du * * mod_html.h -- HTML 5 interface * @@ -166,6 +167,20 @@ typedef struct verto_pvt_s { struct verto_pvt_s *next; } verto_pvt_t; +typedef struct verto_vhost_s { + char *domain; + char *alias; + char *root; + char *script_root; + char *index; + char *auth_realm; + char *auth_user; + char *auth_pass; + switch_event_t *rewrites; + switch_memory_pool_t *pool; + struct verto_vhost_s *next; +} verto_vhost_t; + struct verto_profile_s { char *name; switch_mutex_t *mutex; @@ -220,7 +235,7 @@ struct verto_profile_s { char *timer_name; char *local_network; - char *htdocs; + verto_vhost_t *vhosts; struct verto_profile_s *next; }; From a9b91550e9a04411d8d75e30967850775d9ab787 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Sat, 6 Sep 2014 14:29:51 +0800 Subject: [PATCH 35/77] add HTTP Basic auth --- src/mod/endpoints/mod_verto/mod_verto.c | 71 +++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 4 deletions(-) diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c index 16b8515af6..3a1c9673c1 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.c +++ b/src/mod/endpoints/mod_verto/mod_verto.c @@ -1396,7 +1396,7 @@ static void http_run(jsock_t *jsock) { switch_http_request_t request = { 0 }; switch_stream_handle_t stream = { 0 }; - char *data; + char *data = NULL; char *ext; verto_vhost_t *vhost; @@ -1429,6 +1429,70 @@ static void http_run(jsock_t *jsock) /* only one vhost supported for now */ vhost = jsock->profile->vhosts; + if (!switch_test_flag(jsock, JPFLAG_AUTHED) && vhost->auth_realm) { + int code = CODE_AUTH_REQUIRED; + char message[128] = "Authentication Required"; + cJSON *params = NULL; + char *www_auth; + char auth_buffer[512]; + char *auth_user = NULL, *auth_pass = NULL; + + www_auth = switch_event_get_header(request.headers, "Authorization"); + + if (zstr(www_auth)) { + switch_snprintf(auth_buffer, sizeof(auth_buffer), + "HTTP/1.1 401 Authentication Required\r\n" + "WWW-Authenticate: Basic realm=\"%s\"\r\n" + "Connection: close\r\n\r\n", + vhost->auth_realm); + ws_raw_write(&jsock->ws, auth_buffer, strlen(auth_buffer)); + goto done; + } + + if (strncasecmp(www_auth, "Basic ", 6)) goto err; + + www_auth += 6; + + switch_b64_decode(www_auth, auth_buffer, sizeof(auth_buffer)); + + auth_user = auth_buffer; + + if ((auth_pass = strchr(auth_user, ':'))) { + *auth_pass++ = '\0'; + } + + if (vhost->auth_user && vhost->auth_pass && + !strcmp(vhost->auth_user, auth_user) && + !strcmp(vhost->auth_pass, auth_pass)) { + goto authed; + } + + if (!(params = cJSON_CreateObject())) { + switch_http_free_request(&request); + goto err; + } + + cJSON_AddItemToObject(params, "login", cJSON_CreateString(auth_user)); + cJSON_AddItemToObject(params, "passwd", cJSON_CreateString(auth_pass)); + + if (!check_auth(jsock, params, &code, message, sizeof(message))) { + switch_snprintf(auth_buffer, sizeof(auth_buffer), + "HTTP/1.1 401 Authentication Required\r\n" + "WWW-Authenticate: Basic realm=\"%s\"\r\n" + "Connection: close\r\n\r\n", + vhost->auth_realm); + ws_raw_write(&jsock->ws, auth_buffer, strlen(auth_buffer)); + cJSON_Delete(params); + goto done; + } else { + cJSON_Delete(params); + } + +authed: + switch_set_flag(jsock, JPFLAG_AUTHED); + switch_event_add_header_string(request.headers, SWITCH_STACK_BOTTOM, "HTTP-USER", auth_user); + } + if (vhost->rewrites) { switch_event_header_t *rule = vhost->rewrites->headers; switch_regex_t *re = NULL; @@ -1457,9 +1521,6 @@ static void http_run(jsock_t *jsock) if (!strncmp(ext, ".lua", 4)) { switch_snprintf(path, sizeof(path), "%s%s", vhost->script_root, request.uri); switch_api_execute("lua", path, NULL, &stream); - } else if (!strncmp(ext, ".js", 3)) { - switch_snprintf(path, sizeof(path), "%s%s", vhost->script_root, request.uri); - switch_api_execute("jsrun", path, NULL, &stream); } else { http_static_handler(&request, vhost); } @@ -1468,6 +1529,8 @@ static void http_run(jsock_t *jsock) http_static_handler(&request, vhost); } +done: + switch_http_free_request(&request); return; From f5c0c1393105fafc510e926c46e36849013bf149 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Sat, 6 Sep 2014 15:35:10 +0800 Subject: [PATCH 36/77] add http query string parsing and improve http header parsing --- src/include/switch_utils.h | 13 ++++++++ src/switch_utils.c | 62 +++++++++++++++++++++++++++++++++++++- 2 files changed, 74 insertions(+), 1 deletion(-) diff --git a/src/include/switch_utils.h b/src/include/switch_utils.h index 2c0bac8183..67fee60c3c 100644 --- a/src/include/switch_utils.h +++ b/src/include/switch_utils.h @@ -24,6 +24,7 @@ * Contributor(s): * * Anthony Minessale II + * Seven Du * * * switch_utils.h -- Compatability and Helper Code @@ -1113,6 +1114,8 @@ typedef struct switch_http_request_s { const char *referer; const char *user; switch_bool_t keepalive; + const char *content_type; + switch_size_t content_length; switch_event_t *headers; void *user_data; /* private user data */ @@ -1134,6 +1137,16 @@ typedef struct switch_http_request_s { SWITCH_DECLARE(switch_status_t) switch_http_parse_header(char *buffer, uint32_t datalen, switch_http_request_t *request); SWITCH_DECLARE(void) switch_http_free_request(switch_http_request_t *request); SWITCH_DECLARE(void) switch_http_dump_request(switch_http_request_t *request); +/** + * parse http query string + * \param[in] request the http request object + * \param[in] qs the query string buffer + * + * qs buffer will be modified, so be sure to dup the qs before passing into this function if you want to keep the original string untouched + * if qs is NULL, the it will parse request->qs, request->qs will be duplicated before parse to avoid being modified + */ + +SWITCH_DECLARE(void) switch_http_parse_qs(switch_http_request_t *request, char *qs); SWITCH_END_EXTERN_C #endif diff --git a/src/switch_utils.c b/src/switch_utils.c index 81fe8a192f..c08b5ff27d 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -25,6 +25,7 @@ * * Anthony Minessale II * Juan Jose Comellas + * Seven Du * * * switch_utils.c -- Compatibility and Helper Code @@ -3603,6 +3604,47 @@ SWITCH_DECLARE(char *) switch_strerror_r(int errnum, char *buf, switch_size_t bu #endif } +SWITCH_DECLARE(void) switch_http_parse_qs(switch_http_request_t *request, char *qs) +{ + char *q; + char *next; + char *name, *val; + + if (qs) { + q = qs; + } else { /*parse our own qs, dup to avoid modify the original string */ + q = strdup(request->qs); + } + + switch_assert(q); + next = q; + + do { + char *p; + + if ((next = strchr(next, '&'))) { + *next++ = '\0'; + } + + for (p = q; p && *p; p++) { + if (*p == '+') *p = ' '; + } + + switch_url_decode(q); + + name = q; + if ((val = strchr(name, '='))) { + *val++ = '\0'; + switch_event_add_header_string(request->headers, SWITCH_STACK_BOTTOM, name, val); + } + q = next; + } while (q); + + if (!qs) { + switch_safe_free(q); + } +} + SWITCH_DECLARE(switch_status_t) switch_http_parse_header(char *buffer, uint32_t datalen, switch_http_request_t *request) { switch_status_t status = SWITCH_STATUS_FALSE; @@ -3646,9 +3688,17 @@ SWITCH_DECLARE(switch_status_t) switch_http_parse_header(char *buffer, uint32_t p = strchr(request->uri, ' '); if (!p) goto err; - *p++ = '\0'; + *p++ = '\0'; http = p; + + p = strchr(request->uri, '?'); + + if (p) { + *p++ = '\0'; + request->qs = p; + } + p = strchr(http, '\n'); if (!p) goto err; @@ -3702,9 +3752,19 @@ SWITCH_DECLARE(switch_status_t) switch_http_parse_header(char *buffer, uint32_t if (*p) request->port = (switch_port_t)atoi(p); } + } else if (!strncasecmp(header, "Content-Type", 12)) { + request->content_type = value; + } else if (!strncasecmp(header, "Content-Length", 14)) { + request->content_length = atoi(value); + } else if (!strncasecmp(header, "Referer", 7)) { + request->referer = value; } } + if (request->qs) { + switch_http_parse_qs(request, NULL); + } + return SWITCH_STATUS_SUCCESS; err: From f3616557b644d53044b25bde3a203dfa16472faf Mon Sep 17 00:00:00 2001 From: Seven Du Date: Sat, 6 Sep 2014 16:59:53 +0800 Subject: [PATCH 37/77] parse x-www-form-urlencoded post body --- src/mod/endpoints/mod_verto/mod_verto.c | 46 +++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c index 3a1c9673c1..bde6f77ad1 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.c +++ b/src/mod/endpoints/mod_verto/mod_verto.c @@ -1412,6 +1412,45 @@ static void http_run(jsock_t *jsock) goto err; } + if (!strncmp(request.method, "POST", 4) && request.content_length && + !strncmp(request.content_type, "application/x-www-form-urlencoded", 33)) { + + char *buffer = NULL; + int len = 0, bytes = 0; + + if (request.content_length > 2 * 1024 * 1024 - 1) { + char *data = "HTTP/1.1 413 Request Entity Too Large\r\n" + "Connection: close\r\n\r\n"; + ws_raw_write(&jsock->ws, data, strlen(data)); + goto done; + } + + if (!(buffer = malloc(2 * 1024 * 1024))) { + goto request_err; + } + + if (request._unparsed_len) { + bytes += request._unparsed_len; + memcpy(buffer, request._unparsed_data, bytes); + } + + while(bytes < request.content_length) { + len = request.content_length - bytes; + + if ((len = ws_raw_read(&jsock->ws, buffer + bytes, len, jsock->ws.block)) < 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Read error %d\n", len); + goto done; + } + + bytes += len; + } + + *(buffer + bytes) = '\0'; + + switch_http_parse_qs(&request, buffer); + free(buffer); + } + // switch_http_dump_request(&request); /* TODO: parse virtual hosts here */ @@ -1468,8 +1507,7 @@ static void http_run(jsock_t *jsock) } if (!(params = cJSON_CreateObject())) { - switch_http_free_request(&request); - goto err; + goto request_err; } cJSON_AddItemToObject(params, "login", cJSON_CreateString(auth_user)); @@ -1534,6 +1572,10 @@ done: switch_http_free_request(&request); return; +request_err: + + switch_http_free_request(&request); + err: data = "HTTP/1.1 500 Internal Server Error\r\n" "Connection: close\r\n\r\n"; From 7be60474abe9a1afebb9c0739b168e2570c013be Mon Sep 17 00:00:00 2001 From: Seven Du Date: Sat, 6 Sep 2014 17:20:58 +0800 Subject: [PATCH 38/77] respond to OPTIONS and only allows GET and HEAD on static resources --- src/mod/endpoints/mod_verto/mod_verto.c | 26 +++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c index bde6f77ad1..1f3ff1bad3 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.c +++ b/src/mod/endpoints/mod_verto/mod_verto.c @@ -1340,6 +1340,13 @@ static void http_static_handler(switch_http_request_t *request, verto_vhost_t *v uint8_t chunk[4096]; const char *mime_type = "text/html", *new_type; + if (strncmp(request->method, "GET", 3) && strncmp(request->method, "HEAD", 4)) { + char *data = "HTTP/1.1 415 Method Not Allowed\r\n" + "Connection: close\r\n\r\n"; + ws_raw_write(&jsock->ws, data, strlen(data)); + return; + } + switch_snprintf(path, sizeof(path), "%s%s", vhost->root, request->uri); if (switch_directory_exists(path, NULL) == SWITCH_STATUS_SUCCESS) { @@ -1357,7 +1364,9 @@ static void http_static_handler(switch_http_request_t *request, verto_vhost_t *v if (switch_file_exists(path, NULL) == SWITCH_STATUS_SUCCESS && switch_file_open(&fd, path, SWITCH_FOPEN_READ, SWITCH_FPROT_UREAD, jsock->pool) == SWITCH_STATUS_SUCCESS) { + switch_size_t flen = switch_file_get_size(fd); + switch_snprintf((char *)chunk, sizeof(chunk), "HTTP/1.1 200 OK\r\n" "Connection: close\r\n" @@ -1412,6 +1421,21 @@ static void http_run(jsock_t *jsock) goto err; } + if (!strncmp(request.method, "OPTIONS", 7)) { + char data[512]; + switch_snprintf(data, sizeof(data), + "HTTP/1.1 200 OK\r\n" + "Connection: close\r\n" + "Date: %s\r\n" + "Allow: HEAD,GET,POST,PUT,DELETE,PATCH,OPTIONS\r\n" + "Server: FreeSWITCH-%s-mod_verto\r\n\r\n", + switch_event_get_header(request.headers, "Event-Date-GMT"), + switch_version_full()); + + ws_raw_write(&jsock->ws, data, strlen(data)); + goto done; + } + if (!strncmp(request.method, "POST", 4) && request.content_length && !strncmp(request.content_type, "application/x-www-form-urlencoded", 33)) { @@ -1453,8 +1477,6 @@ static void http_run(jsock_t *jsock) // switch_http_dump_request(&request); - /* TODO: parse virtual hosts here */ - stream.data = &request; stream.read_function = http_stream_read; stream.write_function = http_stream_write; From aa15994c7f4dc447fe7ca2a60ca32b99e7036e47 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Sat, 6 Sep 2014 18:29:19 +0800 Subject: [PATCH 39/77] fix return value --- src/switch_cpp.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/switch_cpp.cpp b/src/switch_cpp.cpp index 2702862027..16179cfb8a 100644 --- a/src/switch_cpp.cpp +++ b/src/switch_cpp.cpp @@ -542,8 +542,10 @@ SWITCH_DECLARE(const char *) Stream::read(int *len) buff = stream_p->read_function(stream_p, len); - if (!buff) return NULL; - if (len < 0) return NULL; + if (!buff || *len <= 0) { + *len = 0; + return NULL; + } return (const char *)buff; } From c02b2427e8d266c51d246bcb5ed410f3f0ae338f Mon Sep 17 00:00:00 2001 From: Seven Du Date: Sat, 6 Sep 2014 19:35:05 +0800 Subject: [PATCH 40/77] refactor http parsing and prevent read body more than content-length --- src/include/switch_utils.h | 5 +++-- src/mod/endpoints/mod_verto/mod_verto.c | 27 +++++++++++++++++-------- src/switch_utils.c | 11 +++++----- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/src/include/switch_utils.h b/src/include/switch_utils.h index 67fee60c3c..d7c07e7171 100644 --- a/src/include/switch_utils.h +++ b/src/include/switch_utils.h @@ -1116,13 +1116,14 @@ typedef struct switch_http_request_s { switch_bool_t keepalive; const char *content_type; switch_size_t content_length; + switch_size_t bytes_header; + switch_size_t bytes_read; + switch_size_t bytes_buffered; switch_event_t *headers; void *user_data; /* private user data */ /* private members used by the parser internally */ char *_buffer; - const char *_unparsed_data; - switch_size_t _unparsed_len; switch_bool_t _destroy_headers; } switch_http_request_t; diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c index 1f3ff1bad3..2a08473f72 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.c +++ b/src/mod/endpoints/mod_verto/mod_verto.c @@ -1287,17 +1287,29 @@ static uint8_t *http_stream_read(switch_stream_handle_t *handle, int *len) jsock_t *jsock = r->user_data; wsh_t *wsh = &jsock->ws; - *len = r->_unparsed_len; + *len = r->bytes_buffered - r->bytes_read; - if (*len) { // we already read part of the body - r->_unparsed_len = 0; // reset for the next read - return (uint8_t *)r->_unparsed_data; + if (*len > 0) { // we already read part of the body + uint8_t *data = (uint8_t *)wsh->buffer + r->bytes_read; + r->bytes_read = r->bytes_buffered; + return data; } - if ((*len = ws_raw_read(wsh, wsh->buffer, 4096, wsh->block)) < 0) { + if (r->content_length && (r->bytes_read - r->bytes_header) >= r->content_length) { + *len = 0; return NULL; } + *len = r->content_length - (r->bytes_read - r->bytes_header); + *len = *len > sizeof(wsh->buffer) ? sizeof(wsh->buffer) : *len; + + if ((*len = ws_raw_read(wsh, wsh->buffer, *len, wsh->block)) <= 0) { + *len = 0; + return NULL; + } + + r->bytes_read += *len; + return (uint8_t *)wsh->buffer; } @@ -1453,9 +1465,8 @@ static void http_run(jsock_t *jsock) goto request_err; } - if (request._unparsed_len) { - bytes += request._unparsed_len; - memcpy(buffer, request._unparsed_data, bytes); + if ((bytes = request.bytes_buffered - (request.bytes_read - request.bytes_header)) > 0) { + memcpy(buffer, jsock->ws.buffer + request.bytes_read, bytes); } while(bytes < request.content_length) { diff --git a/src/switch_utils.c b/src/switch_utils.c index c08b5ff27d..c3e044bbaf 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -3675,10 +3675,10 @@ SWITCH_DECLARE(switch_status_t) switch_http_parse_header(char *buffer, uint32_t request->_buffer = strdup(buffer); request->method = request->_buffer; - if (body && *body) { - request->_unparsed_data = body; - request->_unparsed_len = datalen - (body - buffer); - switch_assert(request->_unparsed_len > 0); + request->bytes_buffered = datalen; + if (body) { + request->bytes_header = body - buffer; + request->bytes_read = body - buffer; } p = strchr(request->method, ' '); @@ -3796,7 +3796,8 @@ SWITCH_DECLARE(void) switch_http_dump_request(switch_http_request_t *request) if (request->referer) printf("referer: %s\n", request->referer); if (request->user) printf("user: %s\n", request->user); if (request->keepalive) printf("uri: %d\n", request->keepalive); - if (request->_unparsed_data) printf("body: %p\n", request->_unparsed_data); + if (request->content_type) printf("uri: %s\n", request->content_type); + if (request->content_length) printf("uri: %" SWITCH_SIZE_T_FMT "\n", request->content_length); { switch_event_header_t *header = request->headers->headers; From 59cd3c77d84fac242683c5eb0b61c52f10bb2bb5 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Sat, 6 Sep 2014 19:38:40 +0800 Subject: [PATCH 41/77] FS-6796 #resolve hack mod_lua to read correct binary string --- src/mod/languages/mod_lua/hack.diff | 25 +++++++++++++++------- src/mod/languages/mod_lua/mod_lua_wrap.cpp | 2 +- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/mod/languages/mod_lua/hack.diff b/src/mod/languages/mod_lua/hack.diff index 4004459b50..f0ea14dce4 100644 --- a/src/mod/languages/mod_lua/hack.diff +++ b/src/mod/languages/mod_lua/hack.diff @@ -1,6 +1,15 @@ ---- mod_lua_wrap.cpp.orig 2013-11-13 07:48:40.587304736 +0500 -+++ mod_lua_wrap.cpp 2013-11-13 07:43:09.059309154 +0500 -@@ -6427,7 +6427,7 @@ +--- mod_lua_wrap.cpp.orig 2014-09-06 19:25:05.000000000 +0800 ++++ mod_lua_wrap.cpp 2014-09-06 19:27:17.000000000 +0800 +@@ -2799,7 +2799,7 @@ + + result = (char *)(arg1)->read(arg2); + SWIG_arg=0; +- lua_pushstring(L,(const char*)result); SWIG_arg++; ++ lua_pushlstring(L,(const char*)result, (*arg2)); SWIG_arg++; + lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++; + return SWIG_arg; + +@@ -6750,7 +6750,7 @@ SWIG_check_num_args("LUA::Session",0,0) result = (LUA::Session *)new LUA::Session(); SWIG_arg=0; @@ -9,7 +18,7 @@ return SWIG_arg; if(0) SWIG_fail; -@@ -6455,7 +6455,7 @@ +@@ -6778,7 +6778,7 @@ result = (LUA::Session *)new LUA::Session(arg1,arg2); SWIG_arg=0; @@ -18,7 +27,7 @@ return SWIG_arg; if(0) SWIG_fail; -@@ -6476,7 +6476,7 @@ +@@ -6799,7 +6799,7 @@ arg1 = (char *)lua_tostring(L, 1); result = (LUA::Session *)new LUA::Session(arg1); SWIG_arg=0; @@ -27,7 +36,7 @@ return SWIG_arg; if(0) SWIG_fail; -@@ -6501,7 +6501,7 @@ +@@ -6824,7 +6824,7 @@ result = (LUA::Session *)new LUA::Session(arg1); SWIG_arg=0; @@ -36,7 +45,7 @@ return SWIG_arg; if(0) SWIG_fail; -@@ -7913,7 +7913,7 @@ +@@ -8236,7 +8236,7 @@ } #endif @@ -45,7 +54,7 @@ { "setGlobalVariable", _wrap_setGlobalVariable}, { "getGlobalVariable", _wrap_getGlobalVariable}, { "consoleLog", _wrap_consoleLog}, -@@ -8325,7 +8325,7 @@ +@@ -8654,7 +8654,7 @@ { int i; /* start with global table */ diff --git a/src/mod/languages/mod_lua/mod_lua_wrap.cpp b/src/mod/languages/mod_lua/mod_lua_wrap.cpp index 17af7c5b33..256f86b98b 100644 --- a/src/mod/languages/mod_lua/mod_lua_wrap.cpp +++ b/src/mod/languages/mod_lua/mod_lua_wrap.cpp @@ -2799,7 +2799,7 @@ static int _wrap_Stream_read(lua_State* L) { result = (char *)(arg1)->read(arg2); SWIG_arg=0; - lua_pushstring(L,(const char*)result); SWIG_arg++; + lua_pushlstring(L,(const char*)result, (*arg2)); SWIG_arg++; lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++; return SWIG_arg; From 4e07845f2d57f7e633ae4097f3eae55d363a723f Mon Sep 17 00:00:00 2001 From: Seven Du Date: Sun, 7 Sep 2014 11:45:12 +0800 Subject: [PATCH 42/77] fix incorrect string termination if read multi times when waiting for a slow client, then bytes is much shorter than datalen so it could incorrectly terminate the string and data could be lost --- src/mod/endpoints/mod_verto/ws.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_verto/ws.c b/src/mod/endpoints/mod_verto/ws.c index 70c91fb59c..6e91ff6493 100644 --- a/src/mod/endpoints/mod_verto/ws.c +++ b/src/mod/endpoints/mod_verto/ws.c @@ -264,7 +264,7 @@ int ws_handshake(wsh_t *wsh) goto err; } - *(wsh->buffer+bytes) = '\0'; + *(wsh->buffer + wsh->datalen) = '\0'; if (strncasecmp(wsh->buffer, "GET ", 4)) { goto err; From 023f6e148a3b04a86cb59f0ffd689cc9454c4835 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Sun, 7 Sep 2014 11:47:38 +0800 Subject: [PATCH 43/77] fix http header parsing, now it accepts short header --- src/switch_utils.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/switch_utils.c b/src/switch_utils.c index c3e044bbaf..a336502806 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -3665,12 +3665,14 @@ SWITCH_DECLARE(switch_status_t) switch_http_parse_header(char *buffer, uint32_t if (i == 0) return status; - if ((body = strstr(p, "\r\n\r\n"))) { + if ((body = strstr(buffer, "\r\n\r\n"))) { *body = '\0'; body += 4; - } else if (( body = strstr(p, "\n\n"))) { + } else if (( body = strstr(buffer, "\n\n"))) { *body = '\0'; body += 2; + } else { + return status; } request->_buffer = strdup(buffer); @@ -3682,6 +3684,9 @@ SWITCH_DECLARE(switch_status_t) switch_http_parse_header(char *buffer, uint32_t } p = strchr(request->method, ' '); + + if (!p) goto err; + *p++ = '\0'; request->uri = p; @@ -3699,18 +3704,12 @@ SWITCH_DECLARE(switch_status_t) switch_http_parse_header(char *buffer, uint32_t request->qs = p; } - p = strchr(http, '\n'); - - if (!p) goto err; - if (!strncmp(http, "HTTP/1.1", 8)) { request->keepalive = SWITCH_TRUE; } else if (strncmp(http, "HTTP/1.0", 8)) { goto err; } - p++; // now the first header - if (!request->headers) { if (switch_event_create(&request->headers, SWITCH_EVENT_CHANNEL_DATA) != SWITCH_STATUS_SUCCESS) { goto err; @@ -3718,9 +3717,17 @@ SWITCH_DECLARE(switch_status_t) switch_http_parse_header(char *buffer, uint32_t request->_destroy_headers = SWITCH_TRUE; } + p = strchr(http, '\n'); + + if (p) { + *p++ = '\0'; // now the first header + } else { + goto noheader; + } + header_count = switch_separate_string(p, '\n', headers, sizeof(headers)/ sizeof(headers[0])); - if (header_count < 2) goto err; /* at least two lines */ + if (header_count < 1) goto err; for (i = 0; i < header_count; i++) { char *header, *value; @@ -3761,6 +3768,8 @@ SWITCH_DECLARE(switch_status_t) switch_http_parse_header(char *buffer, uint32_t } } +noheader: + if (request->qs) { switch_http_parse_qs(request, NULL); } From a845755ea8fad4a8c4cefde03bb95d4e7bb4325d Mon Sep 17 00:00:00 2001 From: Seven Du Date: Sun, 7 Sep 2014 11:48:27 +0800 Subject: [PATCH 44/77] http 1.1 keepalive support --- src/mod/endpoints/mod_verto/mod_verto.c | 70 +++++++++++++++++++++---- 1 file changed, 60 insertions(+), 10 deletions(-) diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c index 2a08473f72..f15f291ad9 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.c +++ b/src/mod/endpoints/mod_verto/mod_verto.c @@ -1287,6 +1287,11 @@ static uint8_t *http_stream_read(switch_stream_handle_t *handle, int *len) jsock_t *jsock = r->user_data; wsh_t *wsh = &jsock->ws; + if (!jsock->profile->running) { + *len = 0; + return NULL; + } + *len = r->bytes_buffered - r->bytes_read; if (*len > 0) { // we already read part of the body @@ -1303,7 +1308,7 @@ static uint8_t *http_stream_read(switch_stream_handle_t *handle, int *len) *len = r->content_length - (r->bytes_read - r->bytes_header); *len = *len > sizeof(wsh->buffer) ? sizeof(wsh->buffer) : *len; - if ((*len = ws_raw_read(wsh, wsh->buffer, *len, wsh->block)) <= 0) { + if ((*len = ws_raw_read(wsh, wsh->buffer, *len, wsh->block)) < 0) { *len = 0; return NULL; } @@ -1354,7 +1359,7 @@ static void http_static_handler(switch_http_request_t *request, verto_vhost_t *v if (strncmp(request->method, "GET", 3) && strncmp(request->method, "HEAD", 4)) { char *data = "HTTP/1.1 415 Method Not Allowed\r\n" - "Connection: close\r\n\r\n"; + "Content-Length: 0\r\n\r\n"; ws_raw_write(&jsock->ws, data, strlen(data)); return; } @@ -1381,7 +1386,6 @@ static void http_static_handler(switch_http_request_t *request, verto_vhost_t *v switch_snprintf((char *)chunk, sizeof(chunk), "HTTP/1.1 200 OK\r\n" - "Connection: close\r\n" "Date: %s\r\n" "Server: FreeSWITCH-%s-mod_verto\r\n" "Content-Type: %s\r\n" @@ -1408,7 +1412,7 @@ static void http_static_handler(switch_http_request_t *request, verto_vhost_t *v switch_file_close(fd); } else { char *data = "HTTP/1.1 404 Not Found\r\n" - "Connection: close\r\n\r\n"; + "Content-Length: 0\r\n\r\n"; ws_raw_write(&jsock->ws, data, strlen(data)); } } @@ -1420,6 +1424,9 @@ static void http_run(jsock_t *jsock) char *data = NULL; char *ext; verto_vhost_t *vhost; + switch_bool_t keepalive; + +new_req: request.user_data = jsock; @@ -1433,11 +1440,13 @@ static void http_run(jsock_t *jsock) goto err; } + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s [%4" SWITCH_SIZE_T_FMT "] %s\n", jsock->name, jsock->ws.datalen, request.uri); + if (!strncmp(request.method, "OPTIONS", 7)) { char data[512]; switch_snprintf(data, sizeof(data), "HTTP/1.1 200 OK\r\n" - "Connection: close\r\n" + "Content-Length: 0\r\n" "Date: %s\r\n" "Allow: HEAD,GET,POST,PUT,DELETE,PATCH,OPTIONS\r\n" "Server: FreeSWITCH-%s-mod_verto\r\n\r\n", @@ -1456,7 +1465,7 @@ static void http_run(jsock_t *jsock) if (request.content_length > 2 * 1024 * 1024 - 1) { char *data = "HTTP/1.1 413 Request Entity Too Large\r\n" - "Connection: close\r\n\r\n"; + "Content-Length: 0\r\n\r\n"; ws_raw_write(&jsock->ws, data, strlen(data)); goto done; } @@ -1515,7 +1524,7 @@ static void http_run(jsock_t *jsock) switch_snprintf(auth_buffer, sizeof(auth_buffer), "HTTP/1.1 401 Authentication Required\r\n" "WWW-Authenticate: Basic realm=\"%s\"\r\n" - "Connection: close\r\n\r\n", + "Content-Length: 0\r\n\r\n", vhost->auth_realm); ws_raw_write(&jsock->ws, auth_buffer, strlen(auth_buffer)); goto done; @@ -1550,7 +1559,7 @@ static void http_run(jsock_t *jsock) switch_snprintf(auth_buffer, sizeof(auth_buffer), "HTTP/1.1 401 Authentication Required\r\n" "WWW-Authenticate: Basic realm=\"%s\"\r\n" - "Connection: close\r\n\r\n", + "Content-Length: 0\r\n\r\n", vhost->auth_realm); ws_raw_write(&jsock->ws, auth_buffer, strlen(auth_buffer)); cJSON_Delete(params); @@ -1602,17 +1611,58 @@ authed: done: + keepalive = request.keepalive; switch_http_free_request(&request); + + if (keepalive) { + wsh_t *wsh = &jsock->ws; + + memset(&request, 0, sizeof(request)); + wsh->datalen = 0; + *wsh->buffer = '\0'; + + while(jsock->profile->running) { + int pflags = switch_wait_sock(jsock->client_socket, 3000, SWITCH_POLL_READ | SWITCH_POLL_ERROR | SWITCH_POLL_HUP); + + if (jsock->drop) { die("%s Dropping Connection\n", jsock->name); } + if (pflags < 0 && (errno != EINTR)) { die("%s POLL FAILED\n", jsock->name); } + if (pflags & SWITCH_POLL_ERROR) { die("%s POLL ERROR\n", jsock->name); } + if (pflags & SWITCH_POLL_HUP) { die("%s POLL HANGUP DETECTED\n", jsock->name); } + if (pflags & SWITCH_POLL_INVALID) { die("%s POLL INVALID SOCKET\n", jsock->name); } + if (pflags & SWITCH_POLL_READ) { + ssize_t bytes; + + bytes = ws_raw_read(wsh, wsh->buffer + wsh->datalen, wsh->buflen - wsh->datalen, wsh->block); + + if (bytes < 0) { + die("BAD READ %" SWITCH_SIZE_T_FMT "\n", bytes); + break; + } + + wsh->datalen += bytes; + + if (strstr(wsh->buffer, "\r\n\r\n") || strstr(wsh->buffer, "\n\n")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "socket %s is going to handle a new request\n", jsock->name); + goto new_req; + } + } else { + break; + } + } + } + return; request_err: - switch_http_free_request(&request); err: data = "HTTP/1.1 500 Internal Server Error\r\n" - "Connection: close\r\n\r\n"; + "Content-Length: 0\r\n\r\n"; ws_raw_write(&jsock->ws, data, strlen(data)); + +error: + return; } static void client_run(jsock_t *jsock) From 2eed5ecf07f9a3e035f77638ce77463e6dba924a Mon Sep 17 00:00:00 2001 From: Seven Du Date: Mon, 8 Sep 2014 07:46:10 +0800 Subject: [PATCH 45/77] clean the uri to protect us from uri vulnerability attack like request /../../../../etc/passwd --- src/switch_utils.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/switch_utils.c b/src/switch_utils.c index a336502806..2568a4f50b 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -3645,6 +3645,43 @@ SWITCH_DECLARE(void) switch_http_parse_qs(switch_http_request_t *request, char * } } +/* clean the uri to protect us from vulnerability attack */ +switch_status_t clean_uri(char *uri) +{ + int argc; + char *argv[64]; + int last, i, len, uri_len = 0; + + argc = switch_separate_string(uri, '/', argv, sizeof(argv) / sizeof(argv[0])); + + if (argc == sizeof(argv)) { /* too deep */ + return SWITCH_STATUS_FALSE; + } + + last = 1; + for(i = 1; i < argc; i++) { + if (*argv[i] == '\0' || !strcmp(argv[i], ".")) { + /* ignore //// or /././././ */ + } else if (!strcmp(argv[i], "..")) { + /* got /../, go up one level */ + if (last > 1) last--; + } else { + argv[last++] = argv[i]; + } + } + + *uri++ = '/'; + *uri-- = '\0'; + + for(i = 1; i < last; i++) { + len = strlen(argv[i]); + sprintf(uri + uri_len, "/%s", argv[i]); + uri_len += (len + 1); + } + + return SWITCH_STATUS_SUCCESS; +} + SWITCH_DECLARE(switch_status_t) switch_http_parse_header(char *buffer, uint32_t datalen, switch_http_request_t *request) { switch_status_t status = SWITCH_STATUS_FALSE; @@ -3689,6 +3726,8 @@ SWITCH_DECLARE(switch_status_t) switch_http_parse_header(char *buffer, uint32_t *p++ = '\0'; + if (*p != '/') goto err; /* must start from '/' */ + request->uri = p; p = strchr(request->uri, ' '); @@ -3704,6 +3743,10 @@ SWITCH_DECLARE(switch_status_t) switch_http_parse_header(char *buffer, uint32_t request->qs = p; } + if (clean_uri((char *)request->uri) != SWITCH_STATUS_SUCCESS) { + goto err; + } + if (!strncmp(http, "HTTP/1.1", 8)) { request->keepalive = SWITCH_TRUE; } else if (strncmp(http, "HTTP/1.0", 8)) { From 9215c9382714e04c5dfae40aaad2f0dfef259dfc Mon Sep 17 00:00:00 2001 From: Giacomo Vacca Date: Mon, 8 Sep 2014 14:26:58 +0000 Subject: [PATCH 46/77] FS-6785 - pass and use sample rate in switch_core_session_get_payload_code() --- src/include/switch_core_media.h | 1 + src/switch_core_media.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/include/switch_core_media.h b/src/include/switch_core_media.h index 1dfc4688c9..59e1b02b34 100644 --- a/src/include/switch_core_media.h +++ b/src/include/switch_core_media.h @@ -255,6 +255,7 @@ SWITCH_DECLARE(void) switch_core_session_clear_crypto(switch_core_session_t *ses SWITCH_DECLARE(switch_status_t) switch_core_session_get_payload_code(switch_core_session_t *session, switch_media_type_t type, const char *iananame, + uint32_t rate, switch_payload_t *ptP, switch_payload_t *recv_ptP, char **fmtpP); diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 505f024c3e..e09b8108c9 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -516,6 +516,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_process_t38_passthru(switch_co SWITCH_DECLARE(switch_status_t) switch_core_session_get_payload_code(switch_core_session_t *session, switch_media_type_t type, const char *iananame, + uint32_t rate, switch_payload_t *ptP, switch_payload_t *recv_ptP, char **fmtpP) @@ -540,7 +541,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_get_payload_code(switch_core if (!pmap->allocated) continue; - if (!strcasecmp(pmap->iananame, iananame)) { + if (!strcasecmp(pmap->iananame, iananame) && (!rate || (rate == pmap->rate))) { pt = pmap->pt; recv_pt = pmap->recv_pt; fmtp = pmap->rm_fmtp; @@ -6229,7 +6230,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess if (orig_session && switch_core_session_get_payload_code(orig_session, imp->codec_type == SWITCH_CODEC_TYPE_AUDIO ? SWITCH_MEDIA_TYPE_AUDIO : SWITCH_MEDIA_TYPE_VIDEO, - imp->iananame, &orig_pt, NULL, &orig_fmtp) == SWITCH_STATUS_SUCCESS) { + imp->iananame, imp->samples_per_second, &orig_pt, NULL, &orig_fmtp) == SWITCH_STATUS_SUCCESS) { smh->ianacodes[i] = orig_pt; if (orig_fmtp) { From f63ad553f7d7e68f10aa75e7931e69975b198506 Mon Sep 17 00:00:00 2001 From: Jeff Lenk Date: Mon, 8 Sep 2014 10:18:23 -0500 Subject: [PATCH 47/77] vs2010 reswig --- .../mod_managed/freeswitch_wrap.2010.cxx | 707 ++++++++++++++++++ .../mod_managed/managed/swig.2010.cs | 575 ++++++++++++++ .../mod_managed/mod_managed.2010.vcxproj | 7 +- .../mod_managed/mod_managed.2012.vcxproj | 9 +- 4 files changed, 1295 insertions(+), 3 deletions(-) diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx index d8c9843b36..9079a210d5 100644 --- a/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx +++ b/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx @@ -2720,6 +2720,36 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_directories_storage_dir_get(void * j } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_directories_cache_dir_set(void * jarg1, char * jarg2) { + switch_directories *arg1 = (switch_directories *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_directories *)jarg1; + arg2 = (char *)jarg2; + { + if (arg1->cache_dir) delete [] arg1->cache_dir; + if (arg2) { + arg1->cache_dir = (char *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->cache_dir, (const char *)arg2); + } else { + arg1->cache_dir = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_directories_cache_dir_get(void * jarg1) { + char * jresult ; + switch_directories *arg1 = (switch_directories *) 0 ; + char *result = 0 ; + + arg1 = (switch_directories *)jarg1; + result = (char *) ((arg1)->cache_dir); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_directories_recordings_dir_set(void * jarg1, char * jarg2) { switch_directories *arg1 = (switch_directories *) 0 ; char *arg2 = (char *) 0 ; @@ -4890,6 +4920,16 @@ SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_MEDIA_TYPE_TOTAL_get() { } +SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_SOCK_INVALID_get() { + int jresult ; + int result; + + result = (int)(-1); + jresult = result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_console_callback_match_node_val_set(void * jarg1, char * jarg2) { switch_console_callback_match_node *arg1 = (switch_console_callback_match_node *) 0 ; char *arg2 = (char *) 0 ; @@ -6230,6 +6270,90 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_payload_map_t(void * jarg1) { } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_waitlist_t_sock_set(void * jarg1, int jarg2) { + switch_waitlist_t *arg1 = (switch_waitlist_t *) 0 ; + switch_os_socket_t arg2 ; + + arg1 = (switch_waitlist_t *)jarg1; + arg2 = (switch_os_socket_t)jarg2; + if (arg1) (arg1)->sock = arg2; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_waitlist_t_sock_get(void * jarg1) { + int jresult ; + switch_waitlist_t *arg1 = (switch_waitlist_t *) 0 ; + switch_os_socket_t result; + + arg1 = (switch_waitlist_t *)jarg1; + result = (switch_os_socket_t) ((arg1)->sock); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_waitlist_t_events_set(void * jarg1, unsigned long jarg2) { + switch_waitlist_t *arg1 = (switch_waitlist_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_waitlist_t *)jarg1; + arg2 = (uint32_t)jarg2; + if (arg1) (arg1)->events = arg2; +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_waitlist_t_events_get(void * jarg1) { + unsigned long jresult ; + switch_waitlist_t *arg1 = (switch_waitlist_t *) 0 ; + uint32_t result; + + arg1 = (switch_waitlist_t *)jarg1; + result = (uint32_t) ((arg1)->events); + jresult = (unsigned long)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_waitlist_t_revents_set(void * jarg1, unsigned long jarg2) { + switch_waitlist_t *arg1 = (switch_waitlist_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_waitlist_t *)jarg1; + arg2 = (uint32_t)jarg2; + if (arg1) (arg1)->revents = arg2; +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_waitlist_t_revents_get(void * jarg1) { + unsigned long jresult ; + switch_waitlist_t *arg1 = (switch_waitlist_t *) 0 ; + uint32_t result; + + arg1 = (switch_waitlist_t *)jarg1; + result = (uint32_t) ((arg1)->revents); + jresult = (unsigned long)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_waitlist_t() { + void * jresult ; + switch_waitlist_t *result = 0 ; + + result = (switch_waitlist_t *)new switch_waitlist_t(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_waitlist_t(void * jarg1) { + switch_waitlist_t *arg1 = (switch_waitlist_t *) 0 ; + + arg1 = (switch_waitlist_t *)jarg1; + delete arg1; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_db_close(void * jarg1) { int jresult ; switch_core_db_t *arg1 = (switch_core_db_t *) 0 ; @@ -18102,6 +18226,18 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_find_end_paren(char * jarg1, char ja } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_separate_file_params(char * jarg1, void * jarg2, void * jarg3) { + char *arg1 = (char *) 0 ; + char **arg2 = (char **) 0 ; + char **arg3 = (char **) 0 ; + + arg1 = (char *)jarg1; + arg2 = (char **)jarg2; + arg3 = (char **)jarg3; + switch_separate_file_params((char const *)arg1,arg2,arg3); +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_is_file_path(char * jarg1) { int jresult ; char *arg1 = (char *) 0 ; @@ -18426,6 +18562,517 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_strerror_r(int jarg1, char * jarg2, } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_wait_sock(int jarg1, unsigned long jarg2, int jarg3) { + int jresult ; + switch_os_socket_t arg1 ; + uint32_t arg2 ; + switch_poll_t arg3 ; + int result; + + arg1 = (switch_os_socket_t)jarg1; + arg2 = (uint32_t)jarg2; + arg3 = (switch_poll_t)jarg3; + result = (int)switch_wait_sock(arg1,arg2,arg3); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_wait_socklist(void * jarg1, unsigned long jarg2, unsigned long jarg3) { + int jresult ; + switch_waitlist_t *arg1 = (switch_waitlist_t *) 0 ; + uint32_t arg2 ; + uint32_t arg3 ; + int result; + + arg1 = (switch_waitlist_t *)jarg1; + arg2 = (uint32_t)jarg2; + arg3 = (uint32_t)jarg3; + result = (int)switch_wait_socklist(arg1,arg2,arg3); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_method_set(void * jarg1, char * jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_t *)jarg1; + arg2 = (char *)jarg2; + { + if (arg2) { + arg1->method = (char const *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->method, (const char *)arg2); + } else { + arg1->method = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t_method_get(void * jarg1) { + char * jresult ; + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *result = 0 ; + + arg1 = (switch_http_request_t *)jarg1; + result = (char *) ((arg1)->method); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_uri_set(void * jarg1, char * jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_t *)jarg1; + arg2 = (char *)jarg2; + { + if (arg2) { + arg1->uri = (char const *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->uri, (const char *)arg2); + } else { + arg1->uri = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t_uri_get(void * jarg1) { + char * jresult ; + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *result = 0 ; + + arg1 = (switch_http_request_t *)jarg1; + result = (char *) ((arg1)->uri); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_qs_set(void * jarg1, char * jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_t *)jarg1; + arg2 = (char *)jarg2; + { + if (arg2) { + arg1->qs = (char const *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->qs, (const char *)arg2); + } else { + arg1->qs = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t_qs_get(void * jarg1) { + char * jresult ; + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *result = 0 ; + + arg1 = (switch_http_request_t *)jarg1; + result = (char *) ((arg1)->qs); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_host_set(void * jarg1, char * jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_t *)jarg1; + arg2 = (char *)jarg2; + { + if (arg2) { + arg1->host = (char const *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->host, (const char *)arg2); + } else { + arg1->host = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t_host_get(void * jarg1) { + char * jresult ; + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *result = 0 ; + + arg1 = (switch_http_request_t *)jarg1; + result = (char *) ((arg1)->host); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_port_set(void * jarg1, unsigned short jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + switch_port_t arg2 ; + + arg1 = (switch_http_request_t *)jarg1; + arg2 = (switch_port_t)jarg2; + if (arg1) (arg1)->port = arg2; +} + + +SWIGEXPORT unsigned short SWIGSTDCALL CSharp_switch_http_request_t_port_get(void * jarg1) { + unsigned short jresult ; + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + switch_port_t result; + + arg1 = (switch_http_request_t *)jarg1; + result = (switch_port_t) ((arg1)->port); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_from_set(void * jarg1, char * jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_t *)jarg1; + arg2 = (char *)jarg2; + { + if (arg2) { + arg1->from = (char const *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->from, (const char *)arg2); + } else { + arg1->from = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t_from_get(void * jarg1) { + char * jresult ; + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *result = 0 ; + + arg1 = (switch_http_request_t *)jarg1; + result = (char *) ((arg1)->from); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_user_agent_set(void * jarg1, char * jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_t *)jarg1; + arg2 = (char *)jarg2; + { + if (arg2) { + arg1->user_agent = (char const *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->user_agent, (const char *)arg2); + } else { + arg1->user_agent = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t_user_agent_get(void * jarg1) { + char * jresult ; + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *result = 0 ; + + arg1 = (switch_http_request_t *)jarg1; + result = (char *) ((arg1)->user_agent); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_referer_set(void * jarg1, char * jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_t *)jarg1; + arg2 = (char *)jarg2; + { + if (arg2) { + arg1->referer = (char const *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->referer, (const char *)arg2); + } else { + arg1->referer = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t_referer_get(void * jarg1) { + char * jresult ; + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *result = 0 ; + + arg1 = (switch_http_request_t *)jarg1; + result = (char *) ((arg1)->referer); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_user_set(void * jarg1, char * jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_t *)jarg1; + arg2 = (char *)jarg2; + { + if (arg2) { + arg1->user = (char const *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->user, (const char *)arg2); + } else { + arg1->user = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t_user_get(void * jarg1) { + char * jresult ; + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *result = 0 ; + + arg1 = (switch_http_request_t *)jarg1; + result = (char *) ((arg1)->user); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_keepalive_set(void * jarg1, int jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + switch_bool_t arg2 ; + + arg1 = (switch_http_request_t *)jarg1; + arg2 = (switch_bool_t)jarg2; + if (arg1) (arg1)->keepalive = arg2; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_http_request_t_keepalive_get(void * jarg1) { + int jresult ; + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + switch_bool_t result; + + arg1 = (switch_http_request_t *)jarg1; + result = (switch_bool_t) ((arg1)->keepalive); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_headers_set(void * jarg1, void * jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + switch_event_t *arg2 = (switch_event_t *) 0 ; + + arg1 = (switch_http_request_t *)jarg1; + arg2 = (switch_event_t *)jarg2; + if (arg1) (arg1)->headers = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_http_request_t_headers_get(void * jarg1) { + void * jresult ; + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + switch_event_t *result = 0 ; + + arg1 = (switch_http_request_t *)jarg1; + result = (switch_event_t *) ((arg1)->headers); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_user_data_set(void * jarg1, void * jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + void *arg2 = (void *) 0 ; + + arg1 = (switch_http_request_t *)jarg1; + arg2 = (void *)jarg2; + if (arg1) (arg1)->user_data = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_http_request_t_user_data_get(void * jarg1) { + void * jresult ; + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + void *result = 0 ; + + arg1 = (switch_http_request_t *)jarg1; + result = (void *) ((arg1)->user_data); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t__buffer_set(void * jarg1, char * jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_t *)jarg1; + arg2 = (char *)jarg2; + { + if (arg1->_buffer) delete [] arg1->_buffer; + if (arg2) { + arg1->_buffer = (char *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->_buffer, (const char *)arg2); + } else { + arg1->_buffer = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t__buffer_get(void * jarg1) { + char * jresult ; + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *result = 0 ; + + arg1 = (switch_http_request_t *)jarg1; + result = (char *) ((arg1)->_buffer); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t__unparsed_data_set(void * jarg1, char * jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_t *)jarg1; + arg2 = (char *)jarg2; + { + if (arg2) { + arg1->_unparsed_data = (char const *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->_unparsed_data, (const char *)arg2); + } else { + arg1->_unparsed_data = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t__unparsed_data_get(void * jarg1) { + char * jresult ; + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *result = 0 ; + + arg1 = (switch_http_request_t *)jarg1; + result = (char *) ((arg1)->_unparsed_data); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t__unparsed_len_set(void * jarg1, void * jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + switch_size_t arg2 ; + switch_size_t *argp2 ; + + arg1 = (switch_http_request_t *)jarg1; + argp2 = (switch_size_t *)jarg2; + if (!argp2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_size_t", 0); + return ; + } + arg2 = *argp2; + if (arg1) (arg1)->_unparsed_len = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_http_request_t__unparsed_len_get(void * jarg1) { + void * jresult ; + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + switch_size_t result; + + arg1 = (switch_http_request_t *)jarg1; + result = ((arg1)->_unparsed_len); + jresult = new switch_size_t((const switch_size_t &)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t__destroy_headers_set(void * jarg1, int jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + switch_bool_t arg2 ; + + arg1 = (switch_http_request_t *)jarg1; + arg2 = (switch_bool_t)jarg2; + if (arg1) (arg1)->_destroy_headers = arg2; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_http_request_t__destroy_headers_get(void * jarg1) { + int jresult ; + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + switch_bool_t result; + + arg1 = (switch_http_request_t *)jarg1; + result = (switch_bool_t) ((arg1)->_destroy_headers); + jresult = result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_http_request_t() { + void * jresult ; + switch_http_request_t *result = 0 ; + + result = (switch_http_request_t *)new switch_http_request_t(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_http_request_t(void * jarg1) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + + arg1 = (switch_http_request_t *)jarg1; + delete arg1; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_http_parse_header(char * jarg1, unsigned long jarg2, void * jarg3) { + int jresult ; + char *arg1 = (char *) 0 ; + uint32_t arg2 ; + switch_http_request_t *arg3 = (switch_http_request_t *) 0 ; + switch_status_t result; + + arg1 = (char *)jarg1; + arg2 = (uint32_t)jarg2; + arg3 = (switch_http_request_t *)jarg3; + result = (switch_status_t)switch_http_parse_header(arg1,arg2,arg3); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_free_request(void * jarg1) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + + arg1 = (switch_http_request_t *)jarg1; + switch_http_free_request(arg1); +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_dump_request(void * jarg1) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + + arg1 = (switch_http_request_t *)jarg1; + switch_http_dump_request(arg1); +} + + SWIGEXPORT void SWIGSTDCALL CSharp_profile_node_t_var_set(void * jarg1, char * jarg2) { profile_node_t *arg1 = (profile_node_t *) 0 ; char *arg2 = (char *) 0 ; @@ -20859,6 +21506,28 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_state_handler_table(void * jarg } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_stream_handle_read_function_set(void * jarg1, void * jarg2) { + switch_stream_handle *arg1 = (switch_stream_handle *) 0 ; + switch_stream_handle_read_function_t arg2 = (switch_stream_handle_read_function_t) 0 ; + + arg1 = (switch_stream_handle *)jarg1; + arg2 = (switch_stream_handle_read_function_t)jarg2; + if (arg1) (arg1)->read_function = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_stream_handle_read_function_get(void * jarg1) { + void * jresult ; + switch_stream_handle *arg1 = (switch_stream_handle *) 0 ; + switch_stream_handle_read_function_t result; + + arg1 = (switch_stream_handle *)jarg1; + result = (switch_stream_handle_read_function_t) ((arg1)->read_function); + jresult = (void *)result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_stream_handle_write_function_set(void * jarg1, void * jarg2) { switch_stream_handle *arg1 = (switch_stream_handle *) 0 ; switch_stream_handle_write_function_t arg2 = (switch_stream_handle_write_function_t) 0 ; @@ -36232,6 +36901,18 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_uuid_force_exists(char * jarg1) { } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_dmachine_is_parsing(void * jarg1) { + int jresult ; + switch_ivr_dmachine_t *arg1 = (switch_ivr_dmachine_t *) 0 ; + switch_bool_t result; + + arg1 = (switch_ivr_dmachine_t *)jarg1; + result = (switch_bool_t)switch_ivr_dmachine_is_parsing(arg1); + jresult = result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_dmachine_last_ping(void * jarg1) { int jresult ; switch_ivr_dmachine_t *arg1 = (switch_ivr_dmachine_t *) 0 ; @@ -42238,6 +42919,20 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_Stream(void * jarg1) { } +SWIGEXPORT char * SWIGSTDCALL CSharp_Stream_read(void * jarg1, void * jarg2) { + char * jresult ; + Stream *arg1 = (Stream *) 0 ; + int *arg2 = (int *) 0 ; + char *result = 0 ; + + arg1 = (Stream *)jarg1; + arg2 = (int *)jarg2; + result = (char *)(arg1)->read(arg2); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_Stream_Write(void * jarg1, char * jarg2) { Stream *arg1 = (Stream *) 0 ; char *arg2 = (char *) 0 ; @@ -42248,6 +42943,18 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Stream_Write(void * jarg1, char * jarg2) { } +SWIGEXPORT void SWIGSTDCALL CSharp_Stream_raw_write(void * jarg1, char * jarg2, int jarg3) { + Stream *arg1 = (Stream *) 0 ; + char *arg2 = (char *) 0 ; + int arg3 ; + + arg1 = (Stream *)jarg1; + arg2 = (char *)jarg2; + arg3 = (int)jarg3; + (arg1)->raw_write((char const *)arg2,arg3); +} + + SWIGEXPORT char * SWIGSTDCALL CSharp_Stream_get_data(void * jarg1) { char * jresult ; Stream *arg1 = (Stream *) 0 ; diff --git a/src/mod/languages/mod_managed/managed/swig.2010.cs b/src/mod/languages/mod_managed/managed/swig.2010.cs index 85c1924b63..b6b58a34c1 100644 --- a/src/mod/languages/mod_managed/managed/swig.2010.cs +++ b/src/mod/languages/mod_managed/managed/swig.2010.cs @@ -3948,6 +3948,10 @@ public class freeswitch { return ret; } + public static void switch_separate_file_params(string file, ref string file_portion, ref string params_portion) { + freeswitchPINVOKE.switch_separate_file_params(file, ref file_portion, ref params_portion); + } + public static switch_bool_t switch_is_file_path(string file) { switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_is_file_path(file); return ret; @@ -4054,6 +4058,29 @@ public class freeswitch { return ret; } + public static int switch_wait_sock(int sock, uint ms, switch_poll_t flags) { + int ret = freeswitchPINVOKE.switch_wait_sock(sock, ms, (int)flags); + return ret; + } + + public static int switch_wait_socklist(switch_waitlist_t waitlist, uint len, uint ms) { + int ret = freeswitchPINVOKE.switch_wait_socklist(switch_waitlist_t.getCPtr(waitlist), len, ms); + return ret; + } + + public static switch_status_t switch_http_parse_header(string buffer, uint datalen, switch_http_request_t request) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_http_parse_header(buffer, datalen, switch_http_request_t.getCPtr(request)); + return ret; + } + + public static void switch_http_free_request(switch_http_request_t request) { + freeswitchPINVOKE.switch_http_free_request(switch_http_request_t.getCPtr(request)); + } + + public static void switch_http_dump_request(switch_http_request_t request) { + freeswitchPINVOKE.switch_http_dump_request(switch_http_request_t.getCPtr(request)); + } + public static switch_caller_extension switch_caller_extension_new(SWIGTYPE_p_switch_core_session session, string extension_name, string extension_number) { IntPtr cPtr = freeswitchPINVOKE.switch_caller_extension_new(SWIGTYPE_p_switch_core_session.getCPtr(session), extension_name, extension_number); switch_caller_extension ret = (cPtr == IntPtr.Zero) ? null : new switch_caller_extension(cPtr, false); @@ -5894,6 +5921,11 @@ public class freeswitch { return ret; } + public static switch_bool_t switch_ivr_dmachine_is_parsing(SWIGTYPE_p_switch_ivr_dmachine dmachine) { + switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_ivr_dmachine_is_parsing(SWIGTYPE_p_switch_ivr_dmachine.getCPtr(dmachine)); + return ret; + } + public static switch_status_t switch_ivr_dmachine_last_ping(SWIGTYPE_p_switch_ivr_dmachine dmachine) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_dmachine_last_ping(SWIGTYPE_p_switch_ivr_dmachine.getCPtr(dmachine)); return ret; @@ -7093,6 +7125,7 @@ public class freeswitch { public static readonly int SWITCH_MAX_MANAGEMENT_BUFFER_LEN = freeswitchPINVOKE.SWITCH_MAX_MANAGEMENT_BUFFER_LEN_get(); public static readonly int SWITCH_RTP_CNG_PAYLOAD = freeswitchPINVOKE.SWITCH_RTP_CNG_PAYLOAD_get(); public static readonly int SWITCH_MEDIA_TYPE_TOTAL = freeswitchPINVOKE.SWITCH_MEDIA_TYPE_TOTAL_get(); + public static readonly int SWITCH_SOCK_INVALID = freeswitchPINVOKE.SWITCH_SOCK_INVALID_get(); public static readonly int DMACHINE_MAX_DIGIT_LEN = freeswitchPINVOKE.DMACHINE_MAX_DIGIT_LEN_get(); public static readonly int MAX_ARG_RECURSION = freeswitchPINVOKE.MAX_ARG_RECURSION_get(); public static readonly int SWITCH_API_VERSION = freeswitchPINVOKE.SWITCH_API_VERSION_get(); @@ -8021,6 +8054,12 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_directories_storage_dir_get")] public static extern string switch_directories_storage_dir_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_directories_cache_dir_set")] + public static extern void switch_directories_cache_dir_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_directories_cache_dir_get")] + public static extern string switch_directories_cache_dir_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_directories_recordings_dir_set")] public static extern void switch_directories_recordings_dir_set(HandleRef jarg1, string jarg2); @@ -8585,6 +8624,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_MEDIA_TYPE_TOTAL_get")] public static extern int SWITCH_MEDIA_TYPE_TOTAL_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_SOCK_INVALID_get")] + public static extern int SWITCH_SOCK_INVALID_get(); + [DllImport("mod_managed", EntryPoint="CSharp_switch_console_callback_match_node_val_set")] public static extern void switch_console_callback_match_node_val_set(HandleRef jarg1, string jarg2); @@ -8942,6 +8984,30 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_delete_payload_map_t")] public static extern void delete_payload_map_t(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_waitlist_t_sock_set")] + public static extern void switch_waitlist_t_sock_set(HandleRef jarg1, int jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_waitlist_t_sock_get")] + public static extern int switch_waitlist_t_sock_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_waitlist_t_events_set")] + public static extern void switch_waitlist_t_events_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_waitlist_t_events_get")] + public static extern uint switch_waitlist_t_events_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_waitlist_t_revents_set")] + public static extern void switch_waitlist_t_revents_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_waitlist_t_revents_get")] + public static extern uint switch_waitlist_t_revents_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_new_switch_waitlist_t")] + public static extern IntPtr new_switch_waitlist_t(); + + [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_waitlist_t")] + public static extern void delete_switch_waitlist_t(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_db_close")] public static extern int switch_core_db_close(HandleRef jarg1); @@ -11711,6 +11777,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_find_end_paren")] public static extern string switch_find_end_paren(string jarg1, char jarg2, char jarg3); + [DllImport("mod_managed", EntryPoint="CSharp_switch_separate_file_params")] + public static extern void switch_separate_file_params(string jarg1, ref string jarg2, ref string jarg3); + [DllImport("mod_managed", EntryPoint="CSharp_switch_is_file_path")] public static extern int switch_is_file_path(string jarg1); @@ -11774,6 +11843,123 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_strerror_r")] public static extern string switch_strerror_r(int jarg1, string jarg2, HandleRef jarg3); + [DllImport("mod_managed", EntryPoint="CSharp_switch_wait_sock")] + public static extern int switch_wait_sock(int jarg1, uint jarg2, int jarg3); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_wait_socklist")] + public static extern int switch_wait_socklist(HandleRef jarg1, uint jarg2, uint jarg3); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_method_set")] + public static extern void switch_http_request_t_method_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_method_get")] + public static extern string switch_http_request_t_method_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_uri_set")] + public static extern void switch_http_request_t_uri_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_uri_get")] + public static extern string switch_http_request_t_uri_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_qs_set")] + public static extern void switch_http_request_t_qs_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_qs_get")] + public static extern string switch_http_request_t_qs_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_host_set")] + public static extern void switch_http_request_t_host_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_host_get")] + public static extern string switch_http_request_t_host_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_port_set")] + public static extern void switch_http_request_t_port_set(HandleRef jarg1, ushort jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_port_get")] + public static extern ushort switch_http_request_t_port_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_from_set")] + public static extern void switch_http_request_t_from_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_from_get")] + public static extern string switch_http_request_t_from_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_user_agent_set")] + public static extern void switch_http_request_t_user_agent_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_user_agent_get")] + public static extern string switch_http_request_t_user_agent_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_referer_set")] + public static extern void switch_http_request_t_referer_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_referer_get")] + public static extern string switch_http_request_t_referer_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_user_set")] + public static extern void switch_http_request_t_user_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_user_get")] + public static extern string switch_http_request_t_user_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_keepalive_set")] + public static extern void switch_http_request_t_keepalive_set(HandleRef jarg1, int jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_keepalive_get")] + public static extern int switch_http_request_t_keepalive_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_headers_set")] + public static extern void switch_http_request_t_headers_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_headers_get")] + public static extern IntPtr switch_http_request_t_headers_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_user_data_set")] + public static extern void switch_http_request_t_user_data_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_user_data_get")] + public static extern IntPtr switch_http_request_t_user_data_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t__buffer_set")] + public static extern void switch_http_request_t__buffer_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t__buffer_get")] + public static extern string switch_http_request_t__buffer_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t__unparsed_data_set")] + public static extern void switch_http_request_t__unparsed_data_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t__unparsed_data_get")] + public static extern string switch_http_request_t__unparsed_data_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t__unparsed_len_set")] + public static extern void switch_http_request_t__unparsed_len_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t__unparsed_len_get")] + public static extern IntPtr switch_http_request_t__unparsed_len_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t__destroy_headers_set")] + public static extern void switch_http_request_t__destroy_headers_set(HandleRef jarg1, int jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t__destroy_headers_get")] + public static extern int switch_http_request_t__destroy_headers_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_new_switch_http_request_t")] + public static extern IntPtr new_switch_http_request_t(); + + [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_http_request_t")] + public static extern void delete_switch_http_request_t(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_parse_header")] + public static extern int switch_http_parse_header(string jarg1, uint jarg2, HandleRef jarg3); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_free_request")] + public static extern void switch_http_free_request(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_dump_request")] + public static extern void switch_http_dump_request(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_profile_node_t_var_set")] public static extern void profile_node_t_var_set(HandleRef jarg1, string jarg2); @@ -12371,6 +12557,12 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_state_handler_table")] public static extern void delete_switch_state_handler_table(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_stream_handle_read_function_set")] + public static extern void switch_stream_handle_read_function_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_stream_handle_read_function_get")] + public static extern IntPtr switch_stream_handle_read_function_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_stream_handle_write_function_set")] public static extern void switch_stream_handle_write_function_set(HandleRef jarg1, HandleRef jarg2); @@ -16070,6 +16262,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_uuid_force_exists")] public static extern int switch_ivr_uuid_force_exists(string jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_dmachine_is_parsing")] + public static extern int switch_ivr_dmachine_is_parsing(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_dmachine_last_ping")] public static extern int switch_ivr_dmachine_last_ping(HandleRef jarg1); @@ -17504,9 +17699,15 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_delete_Stream")] public static extern void delete_Stream(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_Stream_read")] + public static extern string Stream_read(HandleRef jarg1, HandleRef jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_Stream_Write")] public static extern void Stream_Write(HandleRef jarg1, string jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_Stream_raw_write")] + public static extern void Stream_raw_write(HandleRef jarg1, string jarg2, int jarg3); + [DllImport("mod_managed", EntryPoint="CSharp_Stream_get_data")] public static extern string Stream_get_data(HandleRef jarg1); @@ -18865,10 +19066,19 @@ public partial class Stream : IDisposable { public Stream(switch_stream_handle arg0) : this(freeswitchPINVOKE.new_Stream__SWIG_1(switch_stream_handle.getCPtr(arg0)), true) { } + public string read(SWIGTYPE_p_int len) { + string ret = freeswitchPINVOKE.Stream_read(swigCPtr, SWIGTYPE_p_int.getCPtr(len)); + return ret; + } + public void Write(string data) { freeswitchPINVOKE.Stream_Write(swigCPtr, data); } + public void raw_write(string data, int len) { + freeswitchPINVOKE.Stream_raw_write(swigCPtr, data, len); + } + public string get_data() { string ret = freeswitchPINVOKE.Stream_get_data(swigCPtr); return ret; @@ -21440,6 +21650,36 @@ namespace FreeSWITCH.Native { using System; using System.Runtime.InteropServices; +public class SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char { + private HandleRef swigCPtr; + + internal SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char(IntPtr cPtr, bool futureUse) { + swigCPtr = new HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char() { + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + + internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char 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.1 + * + * 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_switch_stream_handle_p_q_const__char_v_______switch_status_t { private HandleRef swigCPtr; @@ -30726,6 +30966,16 @@ public class switch_directories : IDisposable { } } + public string cache_dir { + set { + freeswitchPINVOKE.switch_directories_cache_dir_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_directories_cache_dir_get(swigCPtr); + return ret; + } + } + public string recordings_dir { set { freeswitchPINVOKE.switch_directories_recordings_dir_set(swigCPtr, value); @@ -32963,6 +33213,219 @@ public class switch_hold_record_t : IDisposable { namespace FreeSWITCH.Native { +using System; +using System.Runtime.InteropServices; + +public class switch_http_request_t : IDisposable { + private HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal switch_http_request_t(IntPtr cPtr, bool cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = new HandleRef(this, cPtr); + } + + internal static HandleRef getCPtr(switch_http_request_t obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } + + ~switch_http_request_t() { + Dispose(); + } + + public virtual void Dispose() { + lock(this) { + if (swigCPtr.Handle != IntPtr.Zero) { + if (swigCMemOwn) { + swigCMemOwn = false; + freeswitchPINVOKE.delete_switch_http_request_t(swigCPtr); + } + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + GC.SuppressFinalize(this); + } + } + + public string method { + set { + freeswitchPINVOKE.switch_http_request_t_method_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_http_request_t_method_get(swigCPtr); + return ret; + } + } + + public string uri { + set { + freeswitchPINVOKE.switch_http_request_t_uri_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_http_request_t_uri_get(swigCPtr); + return ret; + } + } + + public string qs { + set { + freeswitchPINVOKE.switch_http_request_t_qs_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_http_request_t_qs_get(swigCPtr); + return ret; + } + } + + public string host { + set { + freeswitchPINVOKE.switch_http_request_t_host_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_http_request_t_host_get(swigCPtr); + return ret; + } + } + + public ushort port { + set { + freeswitchPINVOKE.switch_http_request_t_port_set(swigCPtr, value); + } + get { + ushort ret = freeswitchPINVOKE.switch_http_request_t_port_get(swigCPtr); + return ret; + } + } + + public string from { + set { + freeswitchPINVOKE.switch_http_request_t_from_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_http_request_t_from_get(swigCPtr); + return ret; + } + } + + public string user_agent { + set { + freeswitchPINVOKE.switch_http_request_t_user_agent_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_http_request_t_user_agent_get(swigCPtr); + return ret; + } + } + + public string referer { + set { + freeswitchPINVOKE.switch_http_request_t_referer_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_http_request_t_referer_get(swigCPtr); + return ret; + } + } + + public string user { + set { + freeswitchPINVOKE.switch_http_request_t_user_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_http_request_t_user_get(swigCPtr); + return ret; + } + } + + public switch_bool_t keepalive { + set { + freeswitchPINVOKE.switch_http_request_t_keepalive_set(swigCPtr, (int)value); + } + get { + switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_http_request_t_keepalive_get(swigCPtr); + return ret; + } + } + + public switch_event headers { + set { + freeswitchPINVOKE.switch_http_request_t_headers_set(swigCPtr, switch_event.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_http_request_t_headers_get(swigCPtr); + switch_event ret = (cPtr == IntPtr.Zero) ? null : new switch_event(cPtr, false); + return ret; + } + } + + public SWIGTYPE_p_void user_data { + set { + freeswitchPINVOKE.switch_http_request_t_user_data_set(swigCPtr, SWIGTYPE_p_void.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_http_request_t_user_data_get(swigCPtr); + SWIGTYPE_p_void ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_void(cPtr, false); + return ret; + } + } + + public string _buffer { + set { + freeswitchPINVOKE.switch_http_request_t__buffer_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_http_request_t__buffer_get(swigCPtr); + return ret; + } + } + + public string _unparsed_data { + set { + freeswitchPINVOKE.switch_http_request_t__unparsed_data_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_http_request_t__unparsed_data_get(swigCPtr); + return ret; + } + } + + public SWIGTYPE_p_switch_size_t _unparsed_len { + set { + freeswitchPINVOKE.switch_http_request_t__unparsed_len_set(swigCPtr, SWIGTYPE_p_switch_size_t.getCPtr(value)); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + } + get { + SWIGTYPE_p_switch_size_t ret = new SWIGTYPE_p_switch_size_t(freeswitchPINVOKE.switch_http_request_t__unparsed_len_get(swigCPtr), true); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public switch_bool_t _destroy_headers { + set { + freeswitchPINVOKE.switch_http_request_t__destroy_headers_set(swigCPtr, (int)value); + } + get { + switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_http_request_t__destroy_headers_get(swigCPtr); + return ret; + } + } + + public switch_http_request_t() : this(freeswitchPINVOKE.new_switch_http_request_t(), true) { + } + +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.1 + * + * 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_hup_type_t { SHT_NONE = 0, SHT_UNANSWERED = (1 << 0), @@ -35701,6 +36164,28 @@ namespace FreeSWITCH.Native { namespace FreeSWITCH.Native { +public enum switch_poll_t { + SWITCH_POLL_READ = (1 << 0), + SWITCH_POLL_WRITE = (1 << 1), + SWITCH_POLL_ERROR = (1 << 2), + SWITCH_POLL_HUP = (1 << 3), + SWITCH_POLL_RDNORM = (1 << 4), + SWITCH_POLL_RDBAND = (1 << 5), + SWITCH_POLL_PRI = (1 << 6), + SWITCH_POLL_INVALID = (1 << 7) +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.1 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + [System.Flags] public enum switch_port_flag_enum_t { SPF_NONE = 0, SPF_ODD = (1 << 0), @@ -38554,6 +39039,17 @@ public class switch_stream_handle : IDisposable { } } + public SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char read_function { + set { + freeswitchPINVOKE.switch_stream_handle_read_function_set(swigCPtr, SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_stream_handle_read_function_get(swigCPtr); + SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char(cPtr, false); + return ret; + } + } + public SWIGTYPE_p_f_p_switch_stream_handle_p_q_const__char_v_______switch_status_t write_function { set { freeswitchPINVOKE.switch_stream_handle_write_function_set(swigCPtr, SWIGTYPE_p_f_p_switch_stream_handle_p_q_const__char_v_______switch_status_t.getCPtr(value)); @@ -39634,6 +40130,85 @@ namespace FreeSWITCH.Native { using System; using System.Runtime.InteropServices; +public class switch_waitlist_t : IDisposable { + private HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal switch_waitlist_t(IntPtr cPtr, bool cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = new HandleRef(this, cPtr); + } + + internal static HandleRef getCPtr(switch_waitlist_t obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } + + ~switch_waitlist_t() { + Dispose(); + } + + public virtual void Dispose() { + lock(this) { + if (swigCPtr.Handle != IntPtr.Zero) { + if (swigCMemOwn) { + swigCMemOwn = false; + freeswitchPINVOKE.delete_switch_waitlist_t(swigCPtr); + } + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + GC.SuppressFinalize(this); + } + } + + public int sock { + set { + freeswitchPINVOKE.switch_waitlist_t_sock_set(swigCPtr, value); + } + get { + int ret = freeswitchPINVOKE.switch_waitlist_t_sock_get(swigCPtr); + return ret; + } + } + + public uint events { + set { + freeswitchPINVOKE.switch_waitlist_t_events_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_waitlist_t_events_get(swigCPtr); + return ret; + } + } + + public uint revents { + set { + freeswitchPINVOKE.switch_waitlist_t_revents_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_waitlist_t_revents_get(swigCPtr); + return ret; + } + } + + public switch_waitlist_t() : this(freeswitchPINVOKE.new_switch_waitlist_t(), true) { + } + +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.1 + * + * 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 switch_xml : IDisposable { private HandleRef swigCPtr; protected bool swigCMemOwn; diff --git a/src/mod/languages/mod_managed/mod_managed.2010.vcxproj b/src/mod/languages/mod_managed/mod_managed.2010.vcxproj index ee1f7d7e96..4bd631a6f4 100644 --- a/src/mod/languages/mod_managed/mod_managed.2010.vcxproj +++ b/src/mod/languages/mod_managed/mod_managed.2010.vcxproj @@ -306,7 +306,12 @@ - + + 4505;4244;%(DisableSpecificWarnings) + 4505;4244;%(DisableSpecificWarnings) + 4505;4244;%(DisableSpecificWarnings) + 4505;4244;%(DisableSpecificWarnings) + diff --git a/src/mod/languages/mod_managed/mod_managed.2012.vcxproj b/src/mod/languages/mod_managed/mod_managed.2012.vcxproj index 9d35cafdab..30d2d5ac1a 100644 --- a/src/mod/languages/mod_managed/mod_managed.2012.vcxproj +++ b/src/mod/languages/mod_managed/mod_managed.2012.vcxproj @@ -322,7 +322,12 @@ - + + 4505;4244;%(DisableSpecificWarnings) + 4505;4244;%(DisableSpecificWarnings) + 4505;4244;%(DisableSpecificWarnings) + 4505;4244;%(DisableSpecificWarnings) + @@ -343,4 +348,4 @@ - + \ No newline at end of file From f230eb2a982b638270275215609bf0a34c4a354d Mon Sep 17 00:00:00 2001 From: Jeff Lenk Date: Mon, 8 Sep 2014 10:32:35 -0500 Subject: [PATCH 48/77] vs2010 reswig again --- .../mod_managed/freeswitch_wrap.2010.cxx | 208 +++++++++++++----- .../mod_managed/managed/swig.2010.cs | 129 ++++++++--- 2 files changed, 246 insertions(+), 91 deletions(-) diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx index 9079a210d5..6edc41deb3 100644 --- a/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx +++ b/src/mod/languages/mod_managed/freeswitch_wrap.2010.cxx @@ -18870,6 +18870,147 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_http_request_t_keepalive_get(void * jar } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_content_type_set(void * jarg1, char * jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_t *)jarg1; + arg2 = (char *)jarg2; + { + if (arg2) { + arg1->content_type = (char const *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->content_type, (const char *)arg2); + } else { + arg1->content_type = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t_content_type_get(void * jarg1) { + char * jresult ; + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *result = 0 ; + + arg1 = (switch_http_request_t *)jarg1; + result = (char *) ((arg1)->content_type); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_content_length_set(void * jarg1, void * jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + switch_size_t arg2 ; + switch_size_t *argp2 ; + + arg1 = (switch_http_request_t *)jarg1; + argp2 = (switch_size_t *)jarg2; + if (!argp2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_size_t", 0); + return ; + } + arg2 = *argp2; + if (arg1) (arg1)->content_length = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_http_request_t_content_length_get(void * jarg1) { + void * jresult ; + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + switch_size_t result; + + arg1 = (switch_http_request_t *)jarg1; + result = ((arg1)->content_length); + jresult = new switch_size_t((const switch_size_t &)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_bytes_header_set(void * jarg1, void * jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + switch_size_t arg2 ; + switch_size_t *argp2 ; + + arg1 = (switch_http_request_t *)jarg1; + argp2 = (switch_size_t *)jarg2; + if (!argp2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_size_t", 0); + return ; + } + arg2 = *argp2; + if (arg1) (arg1)->bytes_header = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_http_request_t_bytes_header_get(void * jarg1) { + void * jresult ; + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + switch_size_t result; + + arg1 = (switch_http_request_t *)jarg1; + result = ((arg1)->bytes_header); + jresult = new switch_size_t((const switch_size_t &)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_bytes_read_set(void * jarg1, void * jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + switch_size_t arg2 ; + switch_size_t *argp2 ; + + arg1 = (switch_http_request_t *)jarg1; + argp2 = (switch_size_t *)jarg2; + if (!argp2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_size_t", 0); + return ; + } + arg2 = *argp2; + if (arg1) (arg1)->bytes_read = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_http_request_t_bytes_read_get(void * jarg1) { + void * jresult ; + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + switch_size_t result; + + arg1 = (switch_http_request_t *)jarg1; + result = ((arg1)->bytes_read); + jresult = new switch_size_t((const switch_size_t &)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_bytes_buffered_set(void * jarg1, void * jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + switch_size_t arg2 ; + switch_size_t *argp2 ; + + arg1 = (switch_http_request_t *)jarg1; + argp2 = (switch_size_t *)jarg2; + if (!argp2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_size_t", 0); + return ; + } + arg2 = *argp2; + if (arg1) (arg1)->bytes_buffered = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_http_request_t_bytes_buffered_get(void * jarg1) { + void * jresult ; + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + switch_size_t result; + + arg1 = (switch_http_request_t *)jarg1; + result = ((arg1)->bytes_buffered); + jresult = new switch_size_t((const switch_size_t &)result); + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_headers_set(void * jarg1, void * jarg2) { switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; switch_event_t *arg2 = (switch_event_t *) 0 ; @@ -18944,63 +19085,6 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t__buffer_get(void * ja } -SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t__unparsed_data_set(void * jarg1, char * jarg2) { - switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; - char *arg2 = (char *) 0 ; - - arg1 = (switch_http_request_t *)jarg1; - arg2 = (char *)jarg2; - { - if (arg2) { - arg1->_unparsed_data = (char const *) (new char[strlen((const char *)arg2)+1]); - strcpy((char *)arg1->_unparsed_data, (const char *)arg2); - } else { - arg1->_unparsed_data = 0; - } - } -} - - -SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t__unparsed_data_get(void * jarg1) { - char * jresult ; - switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; - char *result = 0 ; - - arg1 = (switch_http_request_t *)jarg1; - result = (char *) ((arg1)->_unparsed_data); - jresult = SWIG_csharp_string_callback((const char *)result); - return jresult; -} - - -SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t__unparsed_len_set(void * jarg1, void * jarg2) { - switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; - switch_size_t arg2 ; - switch_size_t *argp2 ; - - arg1 = (switch_http_request_t *)jarg1; - argp2 = (switch_size_t *)jarg2; - if (!argp2) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_size_t", 0); - return ; - } - arg2 = *argp2; - if (arg1) (arg1)->_unparsed_len = arg2; -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_switch_http_request_t__unparsed_len_get(void * jarg1) { - void * jresult ; - switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; - switch_size_t result; - - arg1 = (switch_http_request_t *)jarg1; - result = ((arg1)->_unparsed_len); - jresult = new switch_size_t((const switch_size_t &)result); - return jresult; -} - - SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t__destroy_headers_set(void * jarg1, int jarg2) { switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; switch_bool_t arg2 ; @@ -19073,6 +19157,16 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_dump_request(void * jarg1) { } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_parse_qs(void * jarg1, char * jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_t *)jarg1; + arg2 = (char *)jarg2; + switch_http_parse_qs(arg1,arg2); +} + + SWIGEXPORT void SWIGSTDCALL CSharp_profile_node_t_var_set(void * jarg1, char * jarg2) { profile_node_t *arg1 = (profile_node_t *) 0 ; char *arg2 = (char *) 0 ; diff --git a/src/mod/languages/mod_managed/managed/swig.2010.cs b/src/mod/languages/mod_managed/managed/swig.2010.cs index b6b58a34c1..3b9815e11e 100644 --- a/src/mod/languages/mod_managed/managed/swig.2010.cs +++ b/src/mod/languages/mod_managed/managed/swig.2010.cs @@ -4081,6 +4081,10 @@ public class freeswitch { freeswitchPINVOKE.switch_http_dump_request(switch_http_request_t.getCPtr(request)); } + public static void switch_http_parse_qs(switch_http_request_t request, string qs) { + freeswitchPINVOKE.switch_http_parse_qs(switch_http_request_t.getCPtr(request), qs); + } + public static switch_caller_extension switch_caller_extension_new(SWIGTYPE_p_switch_core_session session, string extension_name, string extension_number) { IntPtr cPtr = freeswitchPINVOKE.switch_caller_extension_new(SWIGTYPE_p_switch_core_session.getCPtr(session), extension_name, extension_number); switch_caller_extension ret = (cPtr == IntPtr.Zero) ? null : new switch_caller_extension(cPtr, false); @@ -11909,6 +11913,36 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_keepalive_get")] public static extern int switch_http_request_t_keepalive_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_content_type_set")] + public static extern void switch_http_request_t_content_type_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_content_type_get")] + public static extern string switch_http_request_t_content_type_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_content_length_set")] + public static extern void switch_http_request_t_content_length_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_content_length_get")] + public static extern IntPtr switch_http_request_t_content_length_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_bytes_header_set")] + public static extern void switch_http_request_t_bytes_header_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_bytes_header_get")] + public static extern IntPtr switch_http_request_t_bytes_header_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_bytes_read_set")] + public static extern void switch_http_request_t_bytes_read_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_bytes_read_get")] + public static extern IntPtr switch_http_request_t_bytes_read_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_bytes_buffered_set")] + public static extern void switch_http_request_t_bytes_buffered_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_bytes_buffered_get")] + public static extern IntPtr switch_http_request_t_bytes_buffered_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_headers_set")] public static extern void switch_http_request_t_headers_set(HandleRef jarg1, HandleRef jarg2); @@ -11927,18 +11961,6 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t__buffer_get")] public static extern string switch_http_request_t__buffer_get(HandleRef jarg1); - [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t__unparsed_data_set")] - public static extern void switch_http_request_t__unparsed_data_set(HandleRef jarg1, string jarg2); - - [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t__unparsed_data_get")] - public static extern string switch_http_request_t__unparsed_data_get(HandleRef jarg1); - - [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t__unparsed_len_set")] - public static extern void switch_http_request_t__unparsed_len_set(HandleRef jarg1, HandleRef jarg2); - - [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t__unparsed_len_get")] - public static extern IntPtr switch_http_request_t__unparsed_len_get(HandleRef jarg1); - [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t__destroy_headers_set")] public static extern void switch_http_request_t__destroy_headers_set(HandleRef jarg1, int jarg2); @@ -11960,6 +11982,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_http_dump_request")] public static extern void switch_http_dump_request(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_parse_qs")] + public static extern void switch_http_parse_qs(HandleRef jarg1, string jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_profile_node_t_var_set")] public static extern void profile_node_t_var_set(HandleRef jarg1, string jarg2); @@ -33346,6 +33371,64 @@ public class switch_http_request_t : IDisposable { } } + public string content_type { + set { + freeswitchPINVOKE.switch_http_request_t_content_type_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_http_request_t_content_type_get(swigCPtr); + return ret; + } + } + + public SWIGTYPE_p_switch_size_t content_length { + set { + freeswitchPINVOKE.switch_http_request_t_content_length_set(swigCPtr, SWIGTYPE_p_switch_size_t.getCPtr(value)); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + } + get { + SWIGTYPE_p_switch_size_t ret = new SWIGTYPE_p_switch_size_t(freeswitchPINVOKE.switch_http_request_t_content_length_get(swigCPtr), true); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public SWIGTYPE_p_switch_size_t bytes_header { + set { + freeswitchPINVOKE.switch_http_request_t_bytes_header_set(swigCPtr, SWIGTYPE_p_switch_size_t.getCPtr(value)); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + } + get { + SWIGTYPE_p_switch_size_t ret = new SWIGTYPE_p_switch_size_t(freeswitchPINVOKE.switch_http_request_t_bytes_header_get(swigCPtr), true); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public SWIGTYPE_p_switch_size_t bytes_read { + set { + freeswitchPINVOKE.switch_http_request_t_bytes_read_set(swigCPtr, SWIGTYPE_p_switch_size_t.getCPtr(value)); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + } + get { + SWIGTYPE_p_switch_size_t ret = new SWIGTYPE_p_switch_size_t(freeswitchPINVOKE.switch_http_request_t_bytes_read_get(swigCPtr), true); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public SWIGTYPE_p_switch_size_t bytes_buffered { + set { + freeswitchPINVOKE.switch_http_request_t_bytes_buffered_set(swigCPtr, SWIGTYPE_p_switch_size_t.getCPtr(value)); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + } + get { + SWIGTYPE_p_switch_size_t ret = new SWIGTYPE_p_switch_size_t(freeswitchPINVOKE.switch_http_request_t_bytes_buffered_get(swigCPtr), true); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + public switch_event headers { set { freeswitchPINVOKE.switch_http_request_t_headers_set(swigCPtr, switch_event.getCPtr(value)); @@ -33378,28 +33461,6 @@ public class switch_http_request_t : IDisposable { } } - public string _unparsed_data { - set { - freeswitchPINVOKE.switch_http_request_t__unparsed_data_set(swigCPtr, value); - } - get { - string ret = freeswitchPINVOKE.switch_http_request_t__unparsed_data_get(swigCPtr); - return ret; - } - } - - public SWIGTYPE_p_switch_size_t _unparsed_len { - set { - freeswitchPINVOKE.switch_http_request_t__unparsed_len_set(swigCPtr, SWIGTYPE_p_switch_size_t.getCPtr(value)); - if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); - } - get { - SWIGTYPE_p_switch_size_t ret = new SWIGTYPE_p_switch_size_t(freeswitchPINVOKE.switch_http_request_t__unparsed_len_get(swigCPtr), true); - if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - public switch_bool_t _destroy_headers { set { freeswitchPINVOKE.switch_http_request_t__destroy_headers_set(swigCPtr, (int)value); From bb8e4bd1bbf728cac4baed5878ec671934c2ca8f Mon Sep 17 00:00:00 2001 From: Brian West Date: Mon, 8 Sep 2014 11:25:48 -0500 Subject: [PATCH 49/77] FS-6803 #resolve --- .../mod_translate/mod_translate.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/mod/applications/mod_translate/mod_translate.c b/src/mod/applications/mod_translate/mod_translate.c index ae6dcab9ac..d8ce96adc2 100644 --- a/src/mod/applications/mod_translate/mod_translate.c +++ b/src/mod/applications/mod_translate/mod_translate.c @@ -117,9 +117,9 @@ static void translate_number(char *number, char *profile, char **translated, swi translate_rule_t *hi = NULL; translate_rule_t *rule = NULL; switch_regex_t *re = NULL; - int proceed = 0, ovector[30]; - char *substituted = NULL; - uint32_t len = 0; + int proceed = 0, ovector[30], subbedlen = 0; + char *substituted = NULL, *subbed = NULL, *session_malloc = NULL; + uint32_t len = 1024; if (!profile) { profile = "US"; @@ -137,7 +137,7 @@ static void translate_number(char *number, char *profile, char **translated, swi switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s =~ /%s/\n", number, rule->regex); if ((proceed = switch_regex_perform(number, rule->regex, &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s matched %s, replacing with %s\n", number, rule->regex, rule->replace); - if (!(substituted = malloc(len))) { + if (!(substituted = switch_core_session_alloc(session, len))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n"); switch_regex_safe_free(re); goto end; @@ -153,6 +153,17 @@ static void translate_number(char *number, char *profile, char **translated, swi } else if (event) { substituted = switch_event_expand_headers(event, substituted); } + + subbedlen = strlen(subbed) + 1; + session_malloc = (char *)switch_core_session_alloc(session, subbedlen); + memset(session_malloc, 0, subbedlen); + strncpy(session_malloc, subbed, subbedlen); + if (subbed != substituted) + { + switch_safe_free(subbed); + } + + substituted = session_malloc; } break; From 678dc3dcdeed9f96b8494c047e6638f175586f5c Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 4 Sep 2014 03:25:08 +0500 Subject: [PATCH 50/77] remove alert --- html5/verto/demo/verto.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/html5/verto/demo/verto.js b/html5/verto/demo/verto.js index 3935854ffb..4325d56ecc 100644 --- a/html5/verto/demo/verto.js +++ b/html5/verto/demo/verto.js @@ -461,8 +461,6 @@ function init() { if (verto) { verto.iceServers(tmp); } - - alert(tmp); }); verto = new $.verto({ From 6753ccf65d9ea8b0334fe6a0cfdb4390bf56fcc2 Mon Sep 17 00:00:00 2001 From: Andrew Cassidy Date: Mon, 8 Sep 2014 19:18:43 +0100 Subject: [PATCH 51/77] Missed one of the variable changes! --- src/mod/applications/mod_translate/mod_translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_translate/mod_translate.c b/src/mod/applications/mod_translate/mod_translate.c index d8ce96adc2..7180ea1d6b 100644 --- a/src/mod/applications/mod_translate/mod_translate.c +++ b/src/mod/applications/mod_translate/mod_translate.c @@ -149,9 +149,9 @@ static void translate_number(char *number, char *profile, char **translated, swi if ((switch_string_var_check_const(substituted) || switch_string_has_escaped_data(substituted))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "perform variable expansion\n"); if (session) { - substituted = switch_channel_expand_variables(switch_core_session_get_channel(session), substituted); + subbed = switch_channel_expand_variables(switch_core_session_get_channel(session), substituted); } else if (event) { - substituted = switch_event_expand_headers(event, substituted); + subbed = switch_event_expand_headers(event, substituted); } subbedlen = strlen(subbed) + 1; From a73583b5f37a61062834a8c2a5986bf39163abbf Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 9 Sep 2014 00:09:31 +0500 Subject: [PATCH 52/77] FS-6806 #resolve --- src/mod/endpoints/mod_sofia/mod_sofia.c | 7 ---- src/mod/endpoints/mod_sofia/mod_sofia.h | 1 + src/mod/endpoints/mod_sofia/sofia_presence.c | 35 +++++++++++++++++--- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index ff19465fb2..aff86a6331 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -5563,8 +5563,6 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load) switch_management_interface_t *management_interface; switch_application_interface_t *app_interface; struct in_addr in; - struct tm tm = {0}; - time_t now; memset(&mod_sofia_globals, 0, sizeof(mod_sofia_globals)); mod_sofia_globals.destroy_private.destroy_nh = 1; @@ -5573,11 +5571,6 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load) mod_sofia_globals.pool = pool; switch_mutex_init(&mod_sofia_globals.mutex, SWITCH_MUTEX_NESTED, mod_sofia_globals.pool); - now = switch_epoch_time_now(NULL); - tm = *(localtime(&now)); - - mod_sofia_globals.presence_epoch = now - (tm.tm_yday * 86400) - (tm.tm_hour * 60 * 60) - (tm.tm_min * 60) - tm.tm_sec; - switch_find_local_ip(mod_sofia_globals.guess_ip, sizeof(mod_sofia_globals.guess_ip), &mod_sofia_globals.guess_mask, AF_INET); in.s_addr = mod_sofia_globals.guess_mask; switch_set_string(mod_sofia_globals.guess_mask_str, inet_ntoa(in)); diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index 4be1d9747a..bd51868547 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -369,6 +369,7 @@ struct mod_sofia_globals { switch_thread_t *presence_thread; uint32_t max_reg_threads; time_t presence_epoch; + int presence_year; }; extern struct mod_sofia_globals mod_sofia_globals; diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index 0d318b4282..a48e00fcbd 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -2105,17 +2105,44 @@ static int sofia_dialog_probe_callback(void *pArg, int argc, char **argv, char * return 0; } +#define SOFIA_PRESENCE_COLLISION_DELTA 50 +#define SOFIA_PRESENCE_ROLLOVER_YEAR (86400 * 365 * SOFIA_PRESENCE_COLLISION_DELTA) +static uint32_t check_presence_epoch(void) +{ + struct tm tm = {0}; + time_t now = switch_epoch_time_now(NULL); + uint32_t callsequence = (now - mod_sofia_globals.presence_epoch) * SOFIA_PRESENCE_COLLISION_DELTA; + + if (!mod_sofia_globals.presence_year || callsequence >= SOFIA_PRESENCE_ROLLOVER_YEAR) { + switch_mutex_lock(mod_sofia_globals.mutex); + tm = *(localtime(&now)); + + if (tm.tm_year != mod_sofia_globals.presence_year) { + mod_sofia_globals.presence_epoch = (uint32_t)now - (tm.tm_yday * 86400) - (tm.tm_hour * 60 * 60) - (tm.tm_min * 60) - tm.tm_sec; + mod_sofia_globals.presence_year = tm.tm_year; + callsequence = ((uint32_t)now - mod_sofia_globals.presence_epoch) * SOFIA_PRESENCE_COLLISION_DELTA; + } + + switch_mutex_unlock(mod_sofia_globals.mutex); + } + + return callsequence; +} + uint32_t sofia_presence_get_cseq(sofia_profile_t *profile) { uint32_t callsequence; - uint32_t now = (uint32_t) switch_epoch_time_now(NULL); + int diff = 0; switch_mutex_lock(profile->ireg_mutex); - callsequence = (now - mod_sofia_globals.presence_epoch) * 100; + callsequence = check_presence_epoch(); - if (profile->last_cseq && callsequence <= profile->last_cseq) { - callsequence = ++profile->last_cseq; + if (profile->last_cseq) { + diff = callsequence - profile->last_cseq; + if (diff < 0 && diff > -100000) { + callsequence = ++profile->last_cseq; + } } profile->last_cseq = callsequence; From 3c7e7c757a3188018c2c8a4534992e2ba52f4470 Mon Sep 17 00:00:00 2001 From: Nathan Neulinger Date: Mon, 8 Sep 2014 17:35:30 -0500 Subject: [PATCH 53/77] mod_skinny: more logging during transfer operations --- src/mod/endpoints/mod_skinny/skinny_server.c | 38 ++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_skinny/skinny_server.c b/src/mod/endpoints/mod_skinny/skinny_server.c index 18b10e584d..66cc8e6292 100644 --- a/src/mod/endpoints/mod_skinny/skinny_server.c +++ b/src/mod/endpoints/mod_skinny/skinny_server.c @@ -896,7 +896,11 @@ switch_status_t skinny_session_transfer(switch_core_session_t *session, listener switch_status_t status = SWITCH_STATUS_SUCCESS; private_t *tech_pvt = NULL; switch_channel_t *channel = NULL; + switch_channel_t *channel2 = NULL; + const char *local_uuid = NULL; + const char *local_uuid2 = NULL; const char *remote_uuid = NULL; + const char *remote_uuid2 = NULL; switch_core_session_t *session2 = NULL; private_t *tech_pvt2 = NULL; @@ -906,30 +910,60 @@ switch_status_t skinny_session_transfer(switch_core_session_t *session, listener tech_pvt = switch_core_session_get_private(session); channel = switch_core_session_get_channel(session); + local_uuid = switch_channel_get_uuid(channel); remote_uuid = switch_channel_get_partner_uuid(channel); + skinny_log_l(listener, SWITCH_LOG_INFO, "SST: local_uuid=%s remote_uuid=%s\n", local_uuid, remote_uuid); + if (tech_pvt->transfer_from_call_id) { + skinny_log_l_msg(listener, SWITCH_LOG_INFO, "SST: transfer_from_call_id\n"); + if((session2 = skinny_profile_find_session(listener->profile, listener, &line_instance, tech_pvt->transfer_from_call_id))) { - switch_channel_t *channel2 = switch_core_session_get_channel(session2); - const char *remote_uuid2 = switch_channel_get_partner_uuid(channel2); + channel2 = switch_core_session_get_channel(session2); + local_uuid2 = switch_channel_get_uuid(channel2); + remote_uuid2 = switch_channel_get_partner_uuid(channel2); + skinny_log_ls(listener, session2, SWITCH_LOG_INFO, "SST: tx from session - local_uuid=%s remote_uuid=%s local_uuid2=%s remote_uuid2=%s\n", + local_uuid, remote_uuid, local_uuid2, remote_uuid2); + + skinny_log_ls(listener, session2, SWITCH_LOG_INFO, "SST: attempting ivr bridge from (%s) to (%s)\n", remote_uuid, remote_uuid2); + if (switch_ivr_uuid_bridge(remote_uuid, remote_uuid2) == SWITCH_STATUS_SUCCESS) { + skinny_log_ls_msg(listener, session2, SWITCH_LOG_INFO, "SST: success on uuid bridge\n"); + switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); switch_channel_hangup(channel2, SWITCH_CAUSE_NORMAL_CLEARING); } else { + skinny_log_ls_msg(listener, session2, SWITCH_LOG_INFO, "SST: failure on uuid bridge\n"); /* TODO: How to inform the user that the bridge is not possible? */ } switch_core_session_rwunlock(session2); } } else { + skinny_log_l_msg(listener, SWITCH_LOG_INFO, "SST: !transfer_from_call_id\n"); + if(remote_uuid) { + skinny_log_ls_msg(listener, session2, SWITCH_LOG_INFO, "SST: found remote_uuid\n"); + /* TODO CallSelectStat */ + skinny_log_ls_msg(listener, session2, SWITCH_LOG_INFO, "SST: creating incoming session\n"); status = skinny_create_incoming_session(listener, &line_instance, &session2); tech_pvt2 = switch_core_session_get_private(session2); tech_pvt2->transfer_from_call_id = tech_pvt->call_id; tech_pvt->transfer_to_call_id = tech_pvt2->call_id; + skinny_log_ls(listener, session2, SWITCH_LOG_INFO, "SST: transfer_to_call_id=%d transfer_from_call_id=%d\n", tech_pvt2->call_id, + tech_pvt->call_id); + skinny_log_ls_msg(listener, session2, SWITCH_LOG_INFO, "SST: triggering dial on incoming session\n"); skinny_session_process_dest(session2, listener, line_instance, NULL, '\0', 0); + + channel2 = switch_core_session_get_channel(session2); + local_uuid2 = switch_channel_get_uuid(channel2); + remote_uuid2 = switch_channel_get_partner_uuid(channel2); + skinny_log_ls(listener, session2, SWITCH_LOG_INFO, "SST: new session - local_uuid2=%s remote_uuid2=%s\n", local_uuid2, remote_uuid2); + switch_core_session_rwunlock(session2); } else { + skinny_log_ls_msg(listener, session2, SWITCH_LOG_INFO, "SST: could not find remote_uuid\n"); + /* TODO: How to inform the user that the bridge is not possible? */ } } From 590382f4a6782359877160d24562714228494af5 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Tue, 9 Sep 2014 11:51:26 +0800 Subject: [PATCH 54/77] fix url parsing --- src/switch_utils.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/switch_utils.c b/src/switch_utils.c index 2568a4f50b..399442be71 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -3670,9 +3670,6 @@ switch_status_t clean_uri(char *uri) } } - *uri++ = '/'; - *uri-- = '\0'; - for(i = 1; i < last; i++) { len = strlen(argv[i]); sprintf(uri + uri_len, "/%s", argv[i]); From fa3a1a0bdd38a42aa5a1e8b9f3a65d535d20dd3f Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Sun, 4 Aug 2013 23:49:33 -0400 Subject: [PATCH 55/77] Added mod_bert module --- build/modules.conf.in | 1 + configure.ac | 1 + src/mod/applications/mod_bert/Makefile.am | 8 ++ src/mod/applications/mod_bert/mod_bert.c | 143 ++++++++++++++++++++++ 4 files changed, 153 insertions(+) create mode 100644 src/mod/applications/mod_bert/Makefile.am create mode 100644 src/mod/applications/mod_bert/mod_bert.c diff --git a/build/modules.conf.in b/build/modules.conf.in index 44b386f151..71ece983ef 100644 --- a/build/modules.conf.in +++ b/build/modules.conf.in @@ -1,5 +1,6 @@ #applications/mod_abstraction #applications/mod_avmd +#applications/mod_bert #applications/mod_blacklist #applications/mod_callcenter #applications/mod_cidlookup diff --git a/configure.ac b/configure.ac index 02b5e7159c..e8f9efade0 100644 --- a/configure.ac +++ b/configure.ac @@ -1455,6 +1455,7 @@ AC_CONFIG_FILES([Makefile src/mod/Makefile src/mod/applications/mod_abstraction/Makefile src/mod/applications/mod_avmd/Makefile + src/mod/applications/mod_bert/Makefile src/mod/applications/mod_blacklist/Makefile src/mod/applications/mod_callcenter/Makefile src/mod/applications/mod_cidlookup/Makefile diff --git a/src/mod/applications/mod_bert/Makefile.am b/src/mod/applications/mod_bert/Makefile.am new file mode 100644 index 0000000000..97fefcce10 --- /dev/null +++ b/src/mod/applications/mod_bert/Makefile.am @@ -0,0 +1,8 @@ +include $(top_srcdir)/build/modmake.rulesam +MODNAME=mod_bert + +mod_LTLIBRARIES = mod_bert.la +mod_bert_la_SOURCES = mod_bert.c +mod_bert_la_CFLAGS = $(AM_CFLAGS) +mod_bert_la_LIBADD = $(switch_builddir)/libfreeswitch.la +mod_bert_la_LDFLAGS = -avoid-version -module -no-undefined -shared diff --git a/src/mod/applications/mod_bert/mod_bert.c b/src/mod/applications/mod_bert/mod_bert.c new file mode 100644 index 0000000000..db3ac1efff --- /dev/null +++ b/src/mod/applications/mod_bert/mod_bert.c @@ -0,0 +1,143 @@ +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2005-2011, 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 / Oreka Recording Module + * + * The Initial Developer of the Original Code is + * Moises Silva + * Portions created by the Initial Developer are Copyright (C) + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Moises Silva + * + * mod_g711_bert -- Naive BERT tester + * + */ + +#include + +SWITCH_MODULE_LOAD_FUNCTION(mod_bert_load); +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_bert_shutdown); +SWITCH_MODULE_DEFINITION(mod_bert, mod_bert_load, mod_bert_shutdown, NULL); + +SWITCH_STANDARD_APP(g711_bert_function) +{ + switch_status_t status; + switch_frame_t *read_frame = NULL, write_frame = { 0 }; + switch_codec_implementation_t read_impl = { 0 }; + switch_channel_t *channel = NULL; + int i = 0; + uint32_t interval = 0; + uint32_t ts = 0; + struct { + uint64_t sync; + uint32_t bytes_since_sync; + uint32_t min_sync_samples; + uint32_t max_sync_err; + uint32_t sync_err; + int16_t tx_sample; + int16_t test_data; + } bert; + + memset(&bert, 0, sizeof(bert)); + channel = switch_core_session_get_channel(session); + + switch_channel_answer(channel); + + switch_core_session_get_read_impl(session, &read_impl); + + interval = read_impl.microseconds_per_packet / 1000; + + write_frame.codec = switch_core_session_get_read_codec(session); + write_frame.data = switch_core_session_alloc(session, SWITCH_RECOMMENDED_BUFFER_SIZE); + write_frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE; + + bert.min_sync_samples = (read_impl.samples_per_packet * 40); + bert.max_sync_err = (read_impl.samples_per_packet * 20); + while (switch_channel_ready(channel)) { + int16_t *read_samples = NULL; + int16_t *write_samples = NULL; + status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0); + if (!SWITCH_READ_ACCEPTABLE(status)) { + break; + } + /* BERT Sync */ + read_samples = read_frame->data; + write_samples = write_frame.data; + for (i = 0; i < (read_frame->datalen / 2); i++) { + if (bert.sync < bert.min_sync_samples) { + if (bert.test_data == read_samples[i]) { + bert.sync++; + } + } else { + if (bert.sync == bert.min_sync_samples) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "G.711 synced (%lu)\n", bert.sync); + bert.bytes_since_sync = 0; + bert.sync_err = 0; + } + bert.bytes_since_sync++; + if (bert.test_data != read_samples[i]) { + bert.sync_err++; + if (bert.sync_err >= bert.max_sync_err) { + bert.sync = 0; + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "G.711 sync lost (%u)\n", bert.bytes_since_sync); + } + } else { + bert.sync++; + } + } + bert.test_data = (read_samples[i] + 1); + + write_samples[i] = bert.tx_sample++; + } + + write_frame.datalen = read_frame->datalen; + write_frame.samples = i; + write_frame.timestamp = ts; + status = switch_core_session_write_frame(session, &write_frame, SWITCH_IO_FLAG_NONE, 0); + if (!SWITCH_READ_ACCEPTABLE(status)) { + break; + } + ts += read_impl.samples_per_packet; + } +} + +SWITCH_MODULE_LOAD_FUNCTION(mod_bert_load) +{ + switch_application_interface_t *app_interface = NULL; + + *module_interface = switch_loadable_module_create_module_interface(pool, modname); + + SWITCH_ADD_APP(app_interface, "bert_test", "Start BERT Test", "Start BERT Test", g711_bert_function, "", SAF_NONE); + return SWITCH_STATUS_SUCCESS; +} + +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_bert_shutdown) +{ + return SWITCH_STATUS_UNLOAD; +} + +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:nil + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4: + */ From 66a9e12aa8c5e7b75711790442d55eba30da9cbf Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Mon, 5 Aug 2013 01:30:44 -0400 Subject: [PATCH 56/77] Improvements to mod_bert * Calculate sampling error rate over a time window * Create the following variables to control bert testing behavior: bert_timeout_ms - Milliseconds to wait for bert sync before timing out bert_window_ms - Window of time to calculate sampling error rate percentage bert_max_err - Max percentage of error tolerated before going out of sync bert_hangup_on_error - Hangup when error occurs (Timeout or going out of sync) --- src/mod/applications/mod_bert/mod_bert.c | 138 +++++++++++++++++------ 1 file changed, 102 insertions(+), 36 deletions(-) diff --git a/src/mod/applications/mod_bert/mod_bert.c b/src/mod/applications/mod_bert/mod_bert.c index db3ac1efff..917edc4cc4 100644 --- a/src/mod/applications/mod_bert/mod_bert.c +++ b/src/mod/applications/mod_bert/mod_bert.c @@ -24,7 +24,7 @@ * Contributor(s): * Moises Silva * - * mod_g711_bert -- Naive BERT tester + * mod_bert -- Naive BERT tester * */ @@ -34,40 +34,84 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_bert_load); SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_bert_shutdown); SWITCH_MODULE_DEFINITION(mod_bert, mod_bert_load, mod_bert_shutdown, NULL); -SWITCH_STANDARD_APP(g711_bert_function) +#define BERT_DEFAULT_WINDOW_MS 1000 +#define BERT_DEFAULT_MAX_ERR 10.0 +#define BERT_DEFAULT_TIMEOUT_MS 10000 +SWITCH_STANDARD_APP(bert_test_function) { switch_status_t status; switch_frame_t *read_frame = NULL, write_frame = { 0 }; switch_codec_implementation_t read_impl = { 0 }; switch_channel_t *channel = NULL; + const char *var = NULL; int i = 0; - uint32_t interval = 0; + int synced = 0; uint32_t ts = 0; + int32_t timeout_ms = 0; struct { - uint64_t sync; - uint32_t bytes_since_sync; - uint32_t min_sync_samples; - uint32_t max_sync_err; - uint32_t sync_err; - int16_t tx_sample; - int16_t test_data; + uint32_t processed_samples; + uint32_t err_samples; + uint32_t window_ms; + uint32_t window_samples; + int16_t sequence_sample; + int16_t predicted_sample; + float max_err; + float max_err_hit; + float max_err_ever; + uint8_t in_sync; + uint8_t hangup_on_error; + switch_time_t timeout; } bert; - memset(&bert, 0, sizeof(bert)); channel = switch_core_session_get_channel(session); switch_channel_answer(channel); switch_core_session_get_read_impl(session, &read_impl); - interval = read_impl.microseconds_per_packet / 1000; + memset(&bert, 0, sizeof(bert)); + bert.window_ms = BERT_DEFAULT_WINDOW_MS; + bert.window_samples = switch_samples_per_packet(read_impl.samples_per_second, bert.window_ms); + bert.max_err = BERT_DEFAULT_MAX_ERR; + timeout_ms = BERT_DEFAULT_TIMEOUT_MS; + + /* check if there are user-defined overrides */ + if ((var = switch_channel_get_variable(channel, "bert_window_ms"))) { + int tmp = atoi(var); + if (tmp > 0) { + bert.window_ms = tmp; + bert.window_samples = switch_samples_per_packet(read_impl.samples_per_second, bert.window_ms); + } + } + if ((var = switch_channel_get_variable(channel, "bert_timeout_ms"))) { + int tmp = atoi(var); + if (tmp > 0) { + timeout_ms = tmp; + } + } + if ((var = switch_channel_get_variable(channel, "bert_max_err"))) { + double tmp = atoi(var); + if (tmp > 0) { + bert.max_err = (float)tmp; + } + } + if ((var = switch_channel_get_variable(channel, "bert_hangup_on_error"))) { + if (switch_true(var)) { + bert.hangup_on_error = 1; + } + } + + bert.timeout = (switch_micro_time_now() + (timeout_ms * 1000)); write_frame.codec = switch_core_session_get_read_codec(session); write_frame.data = switch_core_session_alloc(session, SWITCH_RECOMMENDED_BUFFER_SIZE); write_frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE; - bert.min_sync_samples = (read_impl.samples_per_packet * 40); - bert.max_sync_err = (read_impl.samples_per_packet * 20); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "BERT Test Window=%ums/%u MaxErr=%f%%\n", bert.window_ms, bert.window_samples, bert.max_err); + if (bert.window_samples <= 0) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Failed to compute BERT window samples!\n"); + goto done; + } while (switch_channel_ready(channel)) { int16_t *read_samples = NULL; int16_t *write_samples = NULL; @@ -79,30 +123,48 @@ SWITCH_STANDARD_APP(g711_bert_function) read_samples = read_frame->data; write_samples = write_frame.data; for (i = 0; i < (read_frame->datalen / 2); i++) { - if (bert.sync < bert.min_sync_samples) { - if (bert.test_data == read_samples[i]) { - bert.sync++; - } - } else { - if (bert.sync == bert.min_sync_samples) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "G.711 synced (%lu)\n", bert.sync); - bert.bytes_since_sync = 0; - bert.sync_err = 0; - } - bert.bytes_since_sync++; - if (bert.test_data != read_samples[i]) { - bert.sync_err++; - if (bert.sync_err >= bert.max_sync_err) { - bert.sync = 0; - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "G.711 sync lost (%u)\n", bert.bytes_since_sync); + if (bert.window_samples == bert.processed_samples) { + /* Calculate error rate */ + float err = ((float)((float)bert.err_samples / (float)bert.processed_samples) * 100.0); + if (err > bert.max_err) { + if (bert.in_sync) { + bert.in_sync = 0; + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "BERT Sync Lost: %f%% loss\n", err); + if (bert.hangup_on_error) { + switch_channel_hangup(channel, SWITCH_CAUSE_MEDIA_TIMEOUT); + } + } + } else if (!bert.in_sync) { + bert.in_sync = 1; + synced = 1; + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "BERT Sync\n"); + bert.timeout = 0; + } + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG10, "Err=%f%% (%u/%u)\n", err, bert.err_samples, bert.processed_samples); + if (synced && err > bert.max_err_hit) { + bert.max_err_hit = err; + } + if (err > bert.max_err_ever) { + bert.max_err_ever = err; + } + bert.processed_samples = 0; + bert.err_samples = 0; + if (bert.timeout && !synced) { + switch_time_t now = switch_micro_time_now(); + if (now >= bert.timeout) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "BERT Timeout\n"); + if (bert.hangup_on_error) { + switch_channel_hangup(channel, SWITCH_CAUSE_MEDIA_TIMEOUT); + } } - } else { - bert.sync++; } } - bert.test_data = (read_samples[i] + 1); - - write_samples[i] = bert.tx_sample++; + if (bert.predicted_sample != read_samples[i]) { + bert.err_samples++; + } + bert.predicted_sample = (read_samples[i] + 1); + write_samples[i] = bert.sequence_sample++; + bert.processed_samples++; } write_frame.datalen = read_frame->datalen; @@ -114,6 +176,10 @@ SWITCH_STANDARD_APP(g711_bert_function) } ts += read_impl.samples_per_packet; } + +done: + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "BERT Test Completed. MaxErr=%f%%\n", synced ? bert.max_err_hit : bert.max_err_ever); + } SWITCH_MODULE_LOAD_FUNCTION(mod_bert_load) @@ -122,7 +188,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_bert_load) *module_interface = switch_loadable_module_create_module_interface(pool, modname); - SWITCH_ADD_APP(app_interface, "bert_test", "Start BERT Test", "Start BERT Test", g711_bert_function, "", SAF_NONE); + SWITCH_ADD_APP(app_interface, "bert_test", "Start BERT Test", "Start BERT Test", bert_test_function, "", SAF_NONE); return SWITCH_STATUS_SUCCESS; } From a60876b165012dcc8ac333661e24ce3a119b5e2f Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Tue, 6 Aug 2013 12:29:26 -0400 Subject: [PATCH 57/77] Use a triangle wave in mod_bert --- src/mod/applications/mod_bert/mod_bert.c | 30 +++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/src/mod/applications/mod_bert/mod_bert.c b/src/mod/applications/mod_bert/mod_bert.c index 917edc4cc4..45f911bf4b 100644 --- a/src/mod/applications/mod_bert/mod_bert.c +++ b/src/mod/applications/mod_bert/mod_bert.c @@ -34,6 +34,19 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_bert_load); SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_bert_shutdown); SWITCH_MODULE_DEFINITION(mod_bert, mod_bert_load, mod_bert_shutdown, NULL); +static int16_t bert_next_sample(int16_t sample, uint8_t *going_up) +{ + if (sample == INT16_MAX || !(*going_up)) { + *going_up = 0; + return --sample; + } + if (sample == INT16_MIN || *going_up) { + *going_up = 1; + return ++sample; + } + switch_assert(0); +} + #define BERT_DEFAULT_WINDOW_MS 1000 #define BERT_DEFAULT_MAX_ERR 10.0 #define BERT_DEFAULT_TIMEOUT_MS 10000 @@ -55,11 +68,14 @@ SWITCH_STANDARD_APP(bert_test_function) uint32_t window_samples; int16_t sequence_sample; int16_t predicted_sample; + int16_t previous_sample; float max_err; float max_err_hit; float max_err_ever; uint8_t in_sync; uint8_t hangup_on_error; + uint8_t sequence_going_up; + uint8_t prediction_going_up; switch_time_t timeout; } bert; @@ -73,6 +89,7 @@ SWITCH_STANDARD_APP(bert_test_function) bert.window_ms = BERT_DEFAULT_WINDOW_MS; bert.window_samples = switch_samples_per_packet(read_impl.samples_per_second, bert.window_ms); bert.max_err = BERT_DEFAULT_MAX_ERR; + bert.sequence_going_up = 1; timeout_ms = BERT_DEFAULT_TIMEOUT_MS; /* check if there are user-defined overrides */ @@ -137,7 +154,7 @@ SWITCH_STANDARD_APP(bert_test_function) } else if (!bert.in_sync) { bert.in_sync = 1; synced = 1; - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "BERT Sync\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "BERT Sync Success\n"); bert.timeout = 0; } switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG10, "Err=%f%% (%u/%u)\n", err, bert.err_samples, bert.processed_samples); @@ -162,8 +179,15 @@ SWITCH_STANDARD_APP(bert_test_function) if (bert.predicted_sample != read_samples[i]) { bert.err_samples++; } - bert.predicted_sample = (read_samples[i] + 1); - write_samples[i] = bert.sequence_sample++; + if (bert.previous_sample > read_samples[i]) { + bert.prediction_going_up = 0; + } else { + bert.prediction_going_up = 1; + } + bert.predicted_sample = bert_next_sample(read_samples[i], &bert.prediction_going_up); + bert.sequence_sample = bert_next_sample(bert.sequence_sample, &bert.sequence_going_up); + write_samples[i] = bert.sequence_sample; + bert.previous_sample = read_samples[i]; bert.processed_samples++; } From d3b214a67244d8968005420783654bca91b805c9 Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Tue, 13 Aug 2013 17:35:35 -0400 Subject: [PATCH 58/77] Improvements to mod_bert * Use digital milliwatt as the test sequence pattern * Add debug IO files (enabled using bert_debug_io_file variable) --- src/mod/applications/mod_bert/mod_bert.c | 170 +++++++++++++++-------- 1 file changed, 113 insertions(+), 57 deletions(-) diff --git a/src/mod/applications/mod_bert/mod_bert.c b/src/mod/applications/mod_bert/mod_bert.c index 45f911bf4b..921d8bb821 100644 --- a/src/mod/applications/mod_bert/mod_bert.c +++ b/src/mod/applications/mod_bert/mod_bert.c @@ -34,18 +34,36 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_bert_load); SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_bert_shutdown); SWITCH_MODULE_DEFINITION(mod_bert, mod_bert_load, mod_bert_shutdown, NULL); -static int16_t bert_next_sample(int16_t sample, uint8_t *going_up) -{ - if (sample == INT16_MAX || !(*going_up)) { - *going_up = 0; - return --sample; - } - if (sample == INT16_MIN || *going_up) { - *going_up = 1; - return ++sample; - } - switch_assert(0); -} +/* http://en.wikipedia.org/wiki/Digital_milliwatt */ +unsigned char ulaw_digital_milliwatt[8] = { 0x1e, 0x0b, 0x0b, 0x1e, 0x9e, 0x8b, 0x8b, 0x9e }; + +typedef struct { + uint32_t processed_samples; + uint32_t err_samples; + uint32_t window_ms; + uint32_t window_samples; + uint8_t sequence_sample; + uint8_t predicted_sample; + float max_err; + float max_err_hit; + float max_err_ever; + uint8_t in_sync; + uint8_t hangup_on_error; + uint8_t milliwatt_index; + uint8_t milliwatt_prediction_index; + switch_time_t timeout; + FILE *input_debug_f; + FILE *output_debug_f; +} bert_t; + +#define bert_increase_milliwatt_index(index) \ + do { \ + if ((index) == (switch_arraylen(ulaw_digital_milliwatt)-1)) { \ + (index) = 0; \ + } else { \ + (index) = ((index) + 1); \ + } \ + } while (0); #define BERT_DEFAULT_WINDOW_MS 1000 #define BERT_DEFAULT_MAX_ERR 10.0 @@ -59,25 +77,11 @@ SWITCH_STANDARD_APP(bert_test_function) const char *var = NULL; int i = 0; int synced = 0; - uint32_t ts = 0; + uint32_t write_ts = 0; int32_t timeout_ms = 0; - struct { - uint32_t processed_samples; - uint32_t err_samples; - uint32_t window_ms; - uint32_t window_samples; - int16_t sequence_sample; - int16_t predicted_sample; - int16_t previous_sample; - float max_err; - float max_err_hit; - float max_err_ever; - uint8_t in_sync; - uint8_t hangup_on_error; - uint8_t sequence_going_up; - uint8_t prediction_going_up; - switch_time_t timeout; - } bert; + bert_t bert = { 0 }; + + memset(&bert, 0, sizeof(bert)); channel = switch_core_session_get_channel(session); @@ -85,11 +89,14 @@ SWITCH_STANDARD_APP(bert_test_function) switch_core_session_get_read_impl(session, &read_impl); - memset(&bert, 0, sizeof(bert)); + if (read_impl.ianacode != 0) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "This application only works when using ulaw codec\n"); + goto done; + } + bert.window_ms = BERT_DEFAULT_WINDOW_MS; bert.window_samples = switch_samples_per_packet(read_impl.samples_per_second, bert.window_ms); bert.max_err = BERT_DEFAULT_MAX_ERR; - bert.sequence_going_up = 1; timeout_ms = BERT_DEFAULT_TIMEOUT_MS; /* check if there are user-defined overrides */ @@ -117,6 +124,19 @@ SWITCH_STANDARD_APP(bert_test_function) bert.hangup_on_error = 1; } } + if ((var = switch_channel_get_variable(channel, "bert_debug_io_file"))) { + char debug_file[1024]; + snprintf(debug_file, sizeof(debug_file), "%s.in", var); + bert.input_debug_f = fopen(debug_file, "w"); + if (!bert.input_debug_f) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Failed to open input debug file %s\n", debug_file); + } + snprintf(debug_file, sizeof(debug_file), "%s.out", var); + bert.output_debug_f = fopen(debug_file, "w"); + if (!bert.output_debug_f) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Failed to open output debug file %s\n", debug_file); + } + } bert.timeout = (switch_micro_time_now() + (timeout_ms * 1000)); @@ -124,22 +144,50 @@ SWITCH_STANDARD_APP(bert_test_function) write_frame.data = switch_core_session_alloc(session, SWITCH_RECOMMENDED_BUFFER_SIZE); write_frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE; - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "BERT Test Window=%ums/%u MaxErr=%f%%\n", bert.window_ms, bert.window_samples, bert.max_err); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "BERT Test Window=%ums/%u, MaxErr=%f%%, Timeout=%dms\n", bert.window_ms, bert.window_samples, bert.max_err, timeout_ms); if (bert.window_samples <= 0) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Failed to compute BERT window samples!\n"); goto done; } while (switch_channel_ready(channel)) { - int16_t *read_samples = NULL; - int16_t *write_samples = NULL; + uint8_t *read_samples = NULL; + uint8_t *write_samples = NULL; + status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0); if (!SWITCH_READ_ACCEPTABLE(status)) { break; } - /* BERT Sync */ + + if (bert.timeout && !synced) { + switch_time_t now = switch_micro_time_now(); + if (now >= bert.timeout) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "BERT Timeout (read_samples=%d, read_bytes=%d, expected_samples=%d, %s)\n", + read_frame->samples, read_frame->datalen, read_impl.samples_per_packet, switch_core_session_get_uuid(session)); + if (bert.hangup_on_error) { + switch_channel_hangup(channel, SWITCH_CAUSE_MEDIA_TIMEOUT); + } + } + } + + if (!read_frame->datalen) { + continue; + } + + if (read_frame->samples != read_impl.samples_per_packet) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Only read %d samples, expected %d!\n", read_frame->samples, read_impl.samples_per_packet); + continue; + } + read_samples = read_frame->data; write_samples = write_frame.data; - for (i = 0; i < (read_frame->datalen / 2); i++) { + if (read_frame->samples) { + if (bert.input_debug_f) { + fwrite(read_frame->data, read_frame->datalen, 1, bert.input_debug_f); + } + } + + /* BERT Sync Loop */ + for (i = 0; i < read_frame->samples; i++) { if (bert.window_samples == bert.processed_samples) { /* Calculate error rate */ float err = ((float)((float)bert.err_samples / (float)bert.processed_samples) * 100.0); @@ -166,44 +214,52 @@ SWITCH_STANDARD_APP(bert_test_function) } bert.processed_samples = 0; bert.err_samples = 0; - if (bert.timeout && !synced) { - switch_time_t now = switch_micro_time_now(); - if (now >= bert.timeout) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "BERT Timeout\n"); - if (bert.hangup_on_error) { - switch_channel_hangup(channel, SWITCH_CAUSE_MEDIA_TIMEOUT); - } - } - } } + if (bert.predicted_sample != read_samples[i]) { bert.err_samples++; + if (!bert.in_sync) { + /* If we're not in sync, we must reset the index on error to start the pattern detection again */ + bert.milliwatt_prediction_index = 0; + } } - if (bert.previous_sample > read_samples[i]) { - bert.prediction_going_up = 0; - } else { - bert.prediction_going_up = 1; - } - bert.predicted_sample = bert_next_sample(read_samples[i], &bert.prediction_going_up); - bert.sequence_sample = bert_next_sample(bert.sequence_sample, &bert.sequence_going_up); + + /* Calculate our next sequence sample to write */ + bert.sequence_sample = ulaw_digital_milliwatt[bert.milliwatt_index]; + //switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "[%d] 0x%X\n", bert.milliwatt_index, bert.sequence_sample); + bert_increase_milliwatt_index(bert.milliwatt_index); + //switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "[%d] 0x%X\n", bert.milliwatt_index, bert.sequence_sample); write_samples[i] = bert.sequence_sample; - bert.previous_sample = read_samples[i]; + + /* Try to guess what the next sample will be in the milliwatt sequence */ + bert.predicted_sample = ulaw_digital_milliwatt[bert.milliwatt_prediction_index]; + bert_increase_milliwatt_index(bert.milliwatt_prediction_index); + bert.processed_samples++; } write_frame.datalen = read_frame->datalen; write_frame.samples = i; - write_frame.timestamp = ts; + write_frame.timestamp = write_ts; + if (bert.output_debug_f) { + fwrite(write_frame.data, write_frame.datalen, 1, bert.output_debug_f); + } status = switch_core_session_write_frame(session, &write_frame, SWITCH_IO_FLAG_NONE, 0); if (!SWITCH_READ_ACCEPTABLE(status)) { break; } - ts += read_impl.samples_per_packet; + + write_ts += read_impl.samples_per_packet; } done: + if (bert.input_debug_f) { + fclose(bert.input_debug_f); + } + if (bert.output_debug_f) { + fclose(bert.output_debug_f); + } switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "BERT Test Completed. MaxErr=%f%%\n", synced ? bert.max_err_hit : bert.max_err_ever); - } SWITCH_MODULE_LOAD_FUNCTION(mod_bert_load) From a84ce1dd3c68f4b57824f6aa286bdf6fdd08cabb Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Fri, 16 Aug 2013 16:30:10 -0400 Subject: [PATCH 59/77] Improvements to mod_bert * Improve bert input debug * Check for SFF_CNG and ignore those frames --- src/mod/applications/mod_bert/mod_bert.c | 43 +++++++++++++++++------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/src/mod/applications/mod_bert/mod_bert.c b/src/mod/applications/mod_bert/mod_bert.c index 921d8bb821..cd1b5b12de 100644 --- a/src/mod/applications/mod_bert/mod_bert.c +++ b/src/mod/applications/mod_bert/mod_bert.c @@ -65,6 +65,25 @@ typedef struct { } \ } while (0); +#define bert_close_debug_streams(bert, session) \ + do { \ + int rc = 0; \ + if (bert.input_debug_f) { \ + rc = fclose(bert.input_debug_f); \ + if (rc) { \ + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Failed to close BERT input debug file!\n"); \ + } \ + bert.input_debug_f = NULL; \ + } \ + if (bert.output_debug_f) { \ + rc = fclose(bert.output_debug_f); \ + if (rc) { \ + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Failed to close BERT output debug file!\n"); \ + } \ + bert.output_debug_f = NULL; \ + } \ + } while (0); + #define BERT_DEFAULT_WINDOW_MS 1000 #define BERT_DEFAULT_MAX_ERR 10.0 #define BERT_DEFAULT_TIMEOUT_MS 10000 @@ -161,7 +180,7 @@ SWITCH_STANDARD_APP(bert_test_function) if (bert.timeout && !synced) { switch_time_t now = switch_micro_time_now(); if (now >= bert.timeout) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "BERT Timeout (read_samples=%d, read_bytes=%d, expected_samples=%d, %s)\n", + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "BERT Timeout (read_samples=%d, read_bytes=%d, expected_samples=%d, session=%s)\n", read_frame->samples, read_frame->datalen, read_impl.samples_per_packet, switch_core_session_get_uuid(session)); if (bert.hangup_on_error) { switch_channel_hangup(channel, SWITCH_CAUSE_MEDIA_TIMEOUT); @@ -169,20 +188,22 @@ SWITCH_STANDARD_APP(bert_test_function) } } - if (!read_frame->datalen) { + /* Ignore confort noise, TODO: we should probably deal with this and treat it as a full frame of silence?? */ + if (switch_test_flag(read_frame, SFF_CNG) || !read_frame->datalen) { continue; } if (read_frame->samples != read_impl.samples_per_packet) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Only read %d samples, expected %d!\n", read_frame->samples, read_impl.samples_per_packet); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Only read %d samples, expected %d!\n", read_frame->samples, read_impl.samples_per_packet); continue; } read_samples = read_frame->data; write_samples = write_frame.data; - if (read_frame->samples) { - if (bert.input_debug_f) { - fwrite(read_frame->data, read_frame->datalen, 1, bert.input_debug_f); + if (bert.input_debug_f) { + size_t ret = fwrite(read_frame->data, read_frame->datalen, 1, bert.input_debug_f); + if (ret != 1) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Failed to write to BERT input debug file!\n"); } } @@ -194,9 +215,10 @@ SWITCH_STANDARD_APP(bert_test_function) if (err > bert.max_err) { if (bert.in_sync) { bert.in_sync = 0; - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "BERT Sync Lost: %f%% loss\n", err); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "BERT Sync Lost: %f%% loss (err_samples=%u, session=%s)\n", err, bert.err_samples, switch_core_session_get_uuid(session)); if (bert.hangup_on_error) { switch_channel_hangup(channel, SWITCH_CAUSE_MEDIA_TIMEOUT); + bert_close_debug_streams(bert, session); } } } else if (!bert.in_sync) { @@ -253,12 +275,7 @@ SWITCH_STANDARD_APP(bert_test_function) } done: - if (bert.input_debug_f) { - fclose(bert.input_debug_f); - } - if (bert.output_debug_f) { - fclose(bert.output_debug_f); - } + bert_close_debug_streams(bert, session); switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "BERT Test Completed. MaxErr=%f%%\n", synced ? bert.max_err_hit : bert.max_err_ever); } From ef694513df394c684dfc0878c1a6c4194234108c Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Fri, 16 Aug 2013 17:39:18 -0400 Subject: [PATCH 60/77] Improvements to mod_bert * Added BERT stats channel variables * Check if the channel is going down when out of sync to avoid flagging it as out of sync, if the channel is going down it is expected to have some errors --- src/mod/applications/mod_bert/mod_bert.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_bert/mod_bert.c b/src/mod/applications/mod_bert/mod_bert.c index cd1b5b12de..2f546f5cdf 100644 --- a/src/mod/applications/mod_bert/mod_bert.c +++ b/src/mod/applications/mod_bert/mod_bert.c @@ -42,6 +42,7 @@ typedef struct { uint32_t err_samples; uint32_t window_ms; uint32_t window_samples; + uint32_t stats_sync_lost_cnt; uint8_t sequence_sample; uint8_t predicted_sample; float max_err; @@ -84,6 +85,9 @@ typedef struct { } \ } while (0); +#define BERT_STATS_VAR_SYNC_LOST "bert_stats_sync_lost" +#define BERT_STATS_VAR_SYNC_LOST_CNT "bert_stats_sync_lost_count" + #define BERT_DEFAULT_WINDOW_MS 1000 #define BERT_DEFAULT_MAX_ERR 10.0 #define BERT_DEFAULT_TIMEOUT_MS 10000 @@ -168,6 +172,8 @@ SWITCH_STANDARD_APP(bert_test_function) switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Failed to compute BERT window samples!\n"); goto done; } + switch_channel_set_variable(channel, BERT_STATS_VAR_SYNC_LOST_CNT, "0"); + switch_channel_set_variable(channel, BERT_STATS_VAR_SYNC_LOST, "false"); while (switch_channel_ready(channel)) { uint8_t *read_samples = NULL; uint8_t *write_samples = NULL; @@ -210,12 +216,22 @@ SWITCH_STANDARD_APP(bert_test_function) /* BERT Sync Loop */ for (i = 0; i < read_frame->samples; i++) { if (bert.window_samples == bert.processed_samples) { + float err = 0.0; + /* If the channel is going down, then it is expected we'll have errors, ignore them and bail out */ + if (!switch_channel_ready(channel)) { + bert_close_debug_streams(bert, session); + break; + } /* Calculate error rate */ - float err = ((float)((float)bert.err_samples / (float)bert.processed_samples) * 100.0); + err = ((float)((float)bert.err_samples / (float)bert.processed_samples) * 100.0); if (err > bert.max_err) { if (bert.in_sync) { bert.in_sync = 0; - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "BERT Sync Lost: %f%% loss (err_samples=%u, session=%s)\n", err, bert.err_samples, switch_core_session_get_uuid(session)); + bert.stats_sync_lost_cnt++; + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "BERT Sync Lost: %f%% loss (count=%u, err_samples=%u, session=%s)\n", + err, bert.stats_sync_lost_cnt, bert.err_samples, switch_core_session_get_uuid(session)); + switch_channel_set_variable_printf(channel, BERT_STATS_VAR_SYNC_LOST_CNT, "%u", bert.stats_sync_lost_cnt); + switch_channel_set_variable(channel, BERT_STATS_VAR_SYNC_LOST, "true"); if (bert.hangup_on_error) { switch_channel_hangup(channel, SWITCH_CAUSE_MEDIA_TIMEOUT); bert_close_debug_streams(bert, session); From 3248e06b914628d0973386a2bd9b998b795e4d79 Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Mon, 19 Aug 2013 15:43:26 -0400 Subject: [PATCH 61/77] Add timer to mod_bert to avoid relying on remote RTP for timing --- src/mod/applications/mod_bert/mod_bert.c | 69 +++++++++++++++--------- 1 file changed, 44 insertions(+), 25 deletions(-) diff --git a/src/mod/applications/mod_bert/mod_bert.c b/src/mod/applications/mod_bert/mod_bert.c index 2f546f5cdf..686a0293c5 100644 --- a/src/mod/applications/mod_bert/mod_bert.c +++ b/src/mod/applications/mod_bert/mod_bert.c @@ -55,6 +55,7 @@ typedef struct { switch_time_t timeout; FILE *input_debug_f; FILE *output_debug_f; + switch_timer_t timer; } bert_t; #define bert_increase_milliwatt_index(index) \ @@ -100,8 +101,11 @@ SWITCH_STANDARD_APP(bert_test_function) const char *var = NULL; int i = 0; int synced = 0; - uint32_t write_ts = 0; int32_t timeout_ms = 0; + int32_t interval = 20; + int32_t samples = 0; + uint8_t *write_samples = NULL; + uint8_t *read_samples = NULL; bert_t bert = { 0 }; memset(&bert, 0, sizeof(bert)); @@ -161,6 +165,16 @@ SWITCH_STANDARD_APP(bert_test_function) } } + /* Setup the timer, so we can send audio at correct time frames even if we do not receive audio */ + interval = read_impl.microseconds_per_packet / 1000; + samples = switch_samples_per_packet(read_impl.samples_per_second, interval); + if (switch_core_timer_init(&bert.timer, "soft", interval, samples, switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Setup timer success interval: %u samples: %u\n", interval, samples); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Timer Setup Failed. BERT cannot start!\n"); + goto done; + } + bert.timeout = (switch_micro_time_now() + (timeout_ms * 1000)); write_frame.codec = switch_core_session_get_read_codec(session); @@ -174,10 +188,32 @@ SWITCH_STANDARD_APP(bert_test_function) } switch_channel_set_variable(channel, BERT_STATS_VAR_SYNC_LOST_CNT, "0"); switch_channel_set_variable(channel, BERT_STATS_VAR_SYNC_LOST, "false"); + write_samples = write_frame.data; while (switch_channel_ready(channel)) { - uint8_t *read_samples = NULL; - uint8_t *write_samples = NULL; + switch_core_timer_next(&bert.timer); + /* Write our frame before anything else happens */ + for (i = 0; i < read_impl.samples_per_packet; i++) { + /* Calculate our next sequence sample to write */ + bert.sequence_sample = ulaw_digital_milliwatt[bert.milliwatt_index]; + //switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "[%d] 0x%X\n", bert.milliwatt_index, bert.sequence_sample); + bert_increase_milliwatt_index(bert.milliwatt_index); + //switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "[%d] 0x%X\n", bert.milliwatt_index, bert.sequence_sample); + write_samples[i] = bert.sequence_sample; + } + + write_frame.datalen = read_impl.samples_per_packet; + write_frame.samples = read_impl.samples_per_packet; + write_frame.timestamp = bert.timer.samplecount; + if (bert.output_debug_f) { + fwrite(write_frame.data, write_frame.datalen, 1, bert.output_debug_f); + } + status = switch_core_session_write_frame(session, &write_frame, SWITCH_IO_FLAG_NONE, 0); + if (!SWITCH_READ_ACCEPTABLE(status)) { + break; + } + + /* Proceed to read and process the readed frame ... */ status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0); if (!SWITCH_READ_ACCEPTABLE(status)) { break; @@ -191,6 +227,7 @@ SWITCH_STANDARD_APP(bert_test_function) if (bert.hangup_on_error) { switch_channel_hangup(channel, SWITCH_CAUSE_MEDIA_TIMEOUT); } + bert.timeout = 0; } } @@ -200,12 +237,11 @@ SWITCH_STANDARD_APP(bert_test_function) } if (read_frame->samples != read_impl.samples_per_packet) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Only read %d samples, expected %d!\n", read_frame->samples, read_impl.samples_per_packet); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Read %d samples, expected %d!\n", read_frame->samples, read_impl.samples_per_packet); continue; } read_samples = read_frame->data; - write_samples = write_frame.data; if (bert.input_debug_f) { size_t ret = fwrite(read_frame->data, read_frame->datalen, 1, bert.input_debug_f); if (ret != 1) { @@ -262,36 +298,19 @@ SWITCH_STANDARD_APP(bert_test_function) } } - /* Calculate our next sequence sample to write */ - bert.sequence_sample = ulaw_digital_milliwatt[bert.milliwatt_index]; - //switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "[%d] 0x%X\n", bert.milliwatt_index, bert.sequence_sample); - bert_increase_milliwatt_index(bert.milliwatt_index); - //switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "[%d] 0x%X\n", bert.milliwatt_index, bert.sequence_sample); - write_samples[i] = bert.sequence_sample; - /* Try to guess what the next sample will be in the milliwatt sequence */ bert.predicted_sample = ulaw_digital_milliwatt[bert.milliwatt_prediction_index]; bert_increase_milliwatt_index(bert.milliwatt_prediction_index); bert.processed_samples++; } - - write_frame.datalen = read_frame->datalen; - write_frame.samples = i; - write_frame.timestamp = write_ts; - if (bert.output_debug_f) { - fwrite(write_frame.data, write_frame.datalen, 1, bert.output_debug_f); - } - status = switch_core_session_write_frame(session, &write_frame, SWITCH_IO_FLAG_NONE, 0); - if (!SWITCH_READ_ACCEPTABLE(status)) { - break; - } - - write_ts += read_impl.samples_per_packet; } done: bert_close_debug_streams(bert, session); + if (bert.timer.interval) { + switch_core_timer_destroy(&bert.timer); + } switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "BERT Test Completed. MaxErr=%f%%\n", synced ? bert.max_err_hit : bert.max_err_ever); } From cf2fd15211124274525c8e3885b701e289097544 Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Tue, 27 Aug 2013 21:07:13 -0400 Subject: [PATCH 62/77] Add BERT events for timeout and out of sync in mod_bert --- src/mod/applications/mod_bert/mod_bert.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_bert/mod_bert.c b/src/mod/applications/mod_bert/mod_bert.c index 686a0293c5..df254c0f82 100644 --- a/src/mod/applications/mod_bert/mod_bert.c +++ b/src/mod/applications/mod_bert/mod_bert.c @@ -89,6 +89,9 @@ typedef struct { #define BERT_STATS_VAR_SYNC_LOST "bert_stats_sync_lost" #define BERT_STATS_VAR_SYNC_LOST_CNT "bert_stats_sync_lost_count" +#define BERT_EVENT_TIMEOUT "mod_bert::timeout" +#define BERT_EVENT_LOST_SYNC "mod_bert::lost_sync" + #define BERT_DEFAULT_WINDOW_MS 1000 #define BERT_DEFAULT_MAX_ERR 10.0 #define BERT_DEFAULT_TIMEOUT_MS 10000 @@ -98,6 +101,7 @@ SWITCH_STANDARD_APP(bert_test_function) switch_frame_t *read_frame = NULL, write_frame = { 0 }; switch_codec_implementation_t read_impl = { 0 }; switch_channel_t *channel = NULL; + switch_event_t *event = NULL; const char *var = NULL; int i = 0; int synced = 0; @@ -222,12 +226,16 @@ SWITCH_STANDARD_APP(bert_test_function) if (bert.timeout && !synced) { switch_time_t now = switch_micro_time_now(); if (now >= bert.timeout) { + bert.timeout = 0; switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "BERT Timeout (read_samples=%d, read_bytes=%d, expected_samples=%d, session=%s)\n", read_frame->samples, read_frame->datalen, read_impl.samples_per_packet, switch_core_session_get_uuid(session)); + if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, BERT_EVENT_TIMEOUT) == SWITCH_STATUS_SUCCESS) { + switch_channel_event_set_basic_data(channel, event); + switch_event_fire(&event); + } if (bert.hangup_on_error) { switch_channel_hangup(channel, SWITCH_CAUSE_MEDIA_TIMEOUT); } - bert.timeout = 0; } } @@ -268,6 +276,10 @@ SWITCH_STANDARD_APP(bert_test_function) err, bert.stats_sync_lost_cnt, bert.err_samples, switch_core_session_get_uuid(session)); switch_channel_set_variable_printf(channel, BERT_STATS_VAR_SYNC_LOST_CNT, "%u", bert.stats_sync_lost_cnt); switch_channel_set_variable(channel, BERT_STATS_VAR_SYNC_LOST, "true"); + if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, BERT_EVENT_LOST_SYNC) == SWITCH_STATUS_SUCCESS) { + switch_channel_event_set_basic_data(channel, event); + switch_event_fire(&event); + } if (bert.hangup_on_error) { switch_channel_hangup(channel, SWITCH_CAUSE_MEDIA_TIMEOUT); bert_close_debug_streams(bert, session); From 58e47748ca621fd3cafcb6f5e8b528fb1279d79d Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Tue, 3 Sep 2013 09:41:51 -0400 Subject: [PATCH 63/77] Only use a timer if bert_timer_name is specified, otherwise time based on input --- src/mod/applications/mod_bert/mod_bert.c | 46 ++++++++++++++++++------ 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/src/mod/applications/mod_bert/mod_bert.c b/src/mod/applications/mod_bert/mod_bert.c index df254c0f82..62d7e319c3 100644 --- a/src/mod/applications/mod_bert/mod_bert.c +++ b/src/mod/applications/mod_bert/mod_bert.c @@ -110,6 +110,7 @@ SWITCH_STANDARD_APP(bert_test_function) int32_t samples = 0; uint8_t *write_samples = NULL; uint8_t *read_samples = NULL; + const char *timer_name = NULL; bert_t bert = { 0 }; memset(&bert, 0, sizeof(bert)); @@ -168,15 +169,21 @@ SWITCH_STANDARD_APP(bert_test_function) switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Failed to open output debug file %s\n", debug_file); } } + if ((var = switch_channel_get_variable(channel, "bert_timer_name"))) { + timer_name = var; + } /* Setup the timer, so we can send audio at correct time frames even if we do not receive audio */ - interval = read_impl.microseconds_per_packet / 1000; - samples = switch_samples_per_packet(read_impl.samples_per_second, interval); - if (switch_core_timer_init(&bert.timer, "soft", interval, samples, switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Setup timer success interval: %u samples: %u\n", interval, samples); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Timer Setup Failed. BERT cannot start!\n"); - goto done; + if (timer_name) { + interval = read_impl.microseconds_per_packet / 1000; + samples = switch_samples_per_packet(read_impl.samples_per_second, interval); + if (switch_core_timer_init(&bert.timer, "soft", interval, samples, switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Setup timer success interval: %u samples: %u\n", interval, samples); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Timer Setup Failed. BERT cannot start!\n"); + goto done; + } + switch_core_timer_sync(&bert.timer); } bert.timeout = (switch_micro_time_now() + (timeout_ms * 1000)); @@ -193,8 +200,20 @@ SWITCH_STANDARD_APP(bert_test_function) switch_channel_set_variable(channel, BERT_STATS_VAR_SYNC_LOST_CNT, "0"); switch_channel_set_variable(channel, BERT_STATS_VAR_SYNC_LOST, "false"); write_samples = write_frame.data; - while (switch_channel_ready(channel)) { - switch_core_timer_next(&bert.timer); + for (;;) { + + if (!switch_channel_ready(channel)) { + break; + } + + switch_ivr_parse_all_events(session); + + if (timer_name) { + if (switch_core_timer_next(&bert.timer) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Failed to step on timer!\n"); + break; + } + } /* Write our frame before anything else happens */ for (i = 0; i < read_impl.samples_per_packet; i++) { @@ -208,7 +227,11 @@ SWITCH_STANDARD_APP(bert_test_function) write_frame.datalen = read_impl.samples_per_packet; write_frame.samples = read_impl.samples_per_packet; - write_frame.timestamp = bert.timer.samplecount; + if (timer_name) { + write_frame.timestamp = bert.timer.samplecount; + } else { + /* playback() does not set write_frame.timestamp unless a timer is used, what's the catch? */ + } if (bert.output_debug_f) { fwrite(write_frame.data, write_frame.datalen, 1, bert.output_debug_f); } @@ -217,7 +240,8 @@ SWITCH_STANDARD_APP(bert_test_function) break; } - /* Proceed to read and process the readed frame ... */ + /* Proceed to read and process the read frame ... + * Note core_session_read_frame is a blocking operation, we should probably do reathing in another thread like playback() does using switch_core_service_session() */ status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0); if (!SWITCH_READ_ACCEPTABLE(status)) { break; From 557a4a85808cf6c8736295bbfe84b68625a71a9c Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Mon, 14 Apr 2014 01:28:38 -0400 Subject: [PATCH 64/77] Treat CNG as a silent frame in mod_bert --- src/mod/applications/mod_bert/mod_bert.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mod/applications/mod_bert/mod_bert.c b/src/mod/applications/mod_bert/mod_bert.c index 62d7e319c3..0829786de0 100644 --- a/src/mod/applications/mod_bert/mod_bert.c +++ b/src/mod/applications/mod_bert/mod_bert.c @@ -34,6 +34,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_bert_load); SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_bert_shutdown); SWITCH_MODULE_DEFINITION(mod_bert, mod_bert_load, mod_bert_shutdown, NULL); +#define G711_ULAW_IDLE_OCTET 0xFF + /* http://en.wikipedia.org/wiki/Digital_milliwatt */ unsigned char ulaw_digital_milliwatt[8] = { 0x1e, 0x0b, 0x0b, 0x1e, 0x9e, 0x8b, 0x8b, 0x9e }; @@ -263,12 +265,14 @@ SWITCH_STANDARD_APP(bert_test_function) } } - /* Ignore confort noise, TODO: we should probably deal with this and treat it as a full frame of silence?? */ - if (switch_test_flag(read_frame, SFF_CNG) || !read_frame->datalen) { - continue; + /* Treat CNG as silence */ + if (switch_test_flag(read_frame, SFF_CNG)) { + read_frame->samples = read_impl.samples_per_packet; + read_frame->datalen = read_impl.samples_per_packet; + memset(read_frame->data, G711_ULAW_IDLE_OCTET, read_frame->datalen); } - if (read_frame->samples != read_impl.samples_per_packet) { + if (read_frame->samples != read_impl.samples_per_packet || !read_frame->datalen) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Read %d samples, expected %d!\n", read_frame->samples, read_impl.samples_per_packet); continue; } From 25c6276feaf369f5c5580add6b681ff09f9d3e61 Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Mon, 14 Apr 2014 16:23:05 -0400 Subject: [PATCH 65/77] Added cng counter to the bert test app --- src/mod/applications/mod_bert/mod_bert.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_bert/mod_bert.c b/src/mod/applications/mod_bert/mod_bert.c index 0829786de0..d033c80f20 100644 --- a/src/mod/applications/mod_bert/mod_bert.c +++ b/src/mod/applications/mod_bert/mod_bert.c @@ -45,6 +45,7 @@ typedef struct { uint32_t window_ms; uint32_t window_samples; uint32_t stats_sync_lost_cnt; + uint32_t stats_cng_cnt; uint8_t sequence_sample; uint8_t predicted_sample; float max_err; @@ -270,6 +271,7 @@ SWITCH_STANDARD_APP(bert_test_function) read_frame->samples = read_impl.samples_per_packet; read_frame->datalen = read_impl.samples_per_packet; memset(read_frame->data, G711_ULAW_IDLE_OCTET, read_frame->datalen); + bert.stats_cng_cnt++; } if (read_frame->samples != read_impl.samples_per_packet || !read_frame->datalen) { @@ -300,8 +302,8 @@ SWITCH_STANDARD_APP(bert_test_function) if (bert.in_sync) { bert.in_sync = 0; bert.stats_sync_lost_cnt++; - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "BERT Sync Lost: %f%% loss (count=%u, err_samples=%u, session=%s)\n", - err, bert.stats_sync_lost_cnt, bert.err_samples, switch_core_session_get_uuid(session)); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "BERT Sync Lost: %f%% loss (count=%u, cng_count=%d, err_samples=%u, session=%s)\n", + err, bert.stats_sync_lost_cnt, bert.stats_cng_cnt, bert.err_samples, switch_core_session_get_uuid(session)); switch_channel_set_variable_printf(channel, BERT_STATS_VAR_SYNC_LOST_CNT, "%u", bert.stats_sync_lost_cnt); switch_channel_set_variable(channel, BERT_STATS_VAR_SYNC_LOST, "true"); if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, BERT_EVENT_LOST_SYNC) == SWITCH_STATUS_SUCCESS) { @@ -317,6 +319,7 @@ SWITCH_STANDARD_APP(bert_test_function) bert.in_sync = 1; synced = 1; switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "BERT Sync Success\n"); + bert.stats_cng_cnt = 0; bert.timeout = 0; } switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG10, "Err=%f%% (%u/%u)\n", err, bert.err_samples, bert.processed_samples); From 89e8e14a9fdb18a2c5fd21dcf24f660374b75f4b Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Mon, 14 Apr 2014 17:18:08 -0400 Subject: [PATCH 66/77] Improvements to mod_bert * Honor the timer name variable * Added mod_bert::in_sync event when the stream is in sync --- src/mod/applications/mod_bert/mod_bert.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_bert/mod_bert.c b/src/mod/applications/mod_bert/mod_bert.c index d033c80f20..0988ffdbb9 100644 --- a/src/mod/applications/mod_bert/mod_bert.c +++ b/src/mod/applications/mod_bert/mod_bert.c @@ -94,6 +94,7 @@ typedef struct { #define BERT_EVENT_TIMEOUT "mod_bert::timeout" #define BERT_EVENT_LOST_SYNC "mod_bert::lost_sync" +#define BERT_EVENT_IN_SYNC "mod_bert::in_sync" #define BERT_DEFAULT_WINDOW_MS 1000 #define BERT_DEFAULT_MAX_ERR 10.0 @@ -180,7 +181,7 @@ SWITCH_STANDARD_APP(bert_test_function) if (timer_name) { interval = read_impl.microseconds_per_packet / 1000; samples = switch_samples_per_packet(read_impl.samples_per_second, interval); - if (switch_core_timer_init(&bert.timer, "soft", interval, samples, switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) { + if (switch_core_timer_init(&bert.timer, timer_name, interval, samples, switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Setup timer success interval: %u samples: %u\n", interval, samples); } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Timer Setup Failed. BERT cannot start!\n"); @@ -321,6 +322,10 @@ SWITCH_STANDARD_APP(bert_test_function) switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "BERT Sync Success\n"); bert.stats_cng_cnt = 0; bert.timeout = 0; + if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, BERT_EVENT_IN_SYNC) == SWITCH_STATUS_SUCCESS) { + switch_channel_event_set_basic_data(channel, event); + switch_event_fire(&event); + } } switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG10, "Err=%f%% (%u/%u)\n", err, bert.err_samples, bert.processed_samples); if (synced && err > bert.max_err_hit) { From 8973ffcc356968c2c893637e340c33cfe17bbd54 Mon Sep 17 00:00:00 2001 From: Nathan Neulinger Date: Tue, 9 Sep 2014 08:30:46 -0500 Subject: [PATCH 67/77] mod_skinny: improvements to error handling/detection --- src/mod/endpoints/mod_skinny/skinny_server.c | 47 +++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_skinny/skinny_server.c b/src/mod/endpoints/mod_skinny/skinny_server.c index 66cc8e6292..7a241231a7 100644 --- a/src/mod/endpoints/mod_skinny/skinny_server.c +++ b/src/mod/endpoints/mod_skinny/skinny_server.c @@ -191,6 +191,7 @@ switch_status_t skinny_create_incoming_session(listener_t *listener, uint32_t *l goto done; error: + skinny_log_l(listener, SWITCH_LOG_CRIT, "Failed to create incoming session for line instance %d", *line_instance_p); if (nsession) { switch_core_session_destroy(&nsession); } @@ -947,6 +948,10 @@ switch_status_t skinny_session_transfer(switch_core_session_t *session, listener /* TODO CallSelectStat */ skinny_log_ls_msg(listener, session2, SWITCH_LOG_INFO, "SST: creating incoming session\n"); status = skinny_create_incoming_session(listener, &line_instance, &session2); + if ( ! session2 ) { + skinny_log_l_msg(listener, SWITCH_LOG_CRIT, "SST: Unable to create incoming session for transfer.\n"); + return SWITCH_STATUS_FALSE; + } tech_pvt2 = switch_core_session_get_private(session2); tech_pvt2->transfer_from_call_id = tech_pvt->call_id; tech_pvt->transfer_to_call_id = tech_pvt2->call_id; @@ -1421,6 +1426,10 @@ switch_status_t skinny_handle_stimulus_message(listener_t *listener, skinny_mess switch(request->data.stimulus.instance_type) { case SKINNY_BUTTON_LAST_NUMBER_REDIAL: skinny_create_incoming_session(listener, &line_instance, &session); + if ( ! session ) { + skinny_log_l_msg(listener, SWITCH_LOG_CRIT, "Unable to handle last number redial stimulus message, couldn't create incoming session.\n"); + return SWITCH_STATUS_FALSE; + } skinny_session_process_dest(session, listener, line_instance, empty_null2(listener->ext_redial,listener->profile->ext_redial), '\0', 0); break; @@ -1429,9 +1438,13 @@ switch_status_t skinny_handle_stimulus_message(listener_t *listener, skinny_mess session = skinny_profile_find_session(listener->profile, listener, &line_instance, 0); if(strlen(button_speed_dial->line) > 0) { - if (!session) { + if ( !session ) { skinny_create_incoming_session(listener, &line_instance, &session); } + if ( !session ) { + skinny_log_l_msg(listener, SWITCH_LOG_CRIT, "Unable to handle speed dial stimulus message, couldn't create incoming session.\n"); + return SWITCH_STATUS_FALSE; + } skinny_session_process_dest(session, listener, line_instance, button_speed_dial->line, '\0', 0); } break; @@ -1451,6 +1464,10 @@ switch_status_t skinny_handle_stimulus_message(listener_t *listener, skinny_mess break; case SKINNY_BUTTON_VOICEMAIL: skinny_create_incoming_session(listener, &line_instance, &session); + if ( ! session ) { + skinny_log_l_msg(listener, SWITCH_LOG_CRIT, "Unable to handle stimulus message, couldn't create incoming session.\n"); + return SWITCH_STATUS_FALSE; + } skinny_session_process_dest(session, listener, line_instance, empty_null2(listener->ext_voicemail, listener->profile->ext_voicemail), '\0', 0); break; @@ -1485,6 +1502,10 @@ switch_status_t skinny_handle_stimulus_message(listener_t *listener, skinny_mess } skinny_create_incoming_session(listener, &line_instance, &session); + if ( ! session ) { + skinny_log_l_msg(listener, SWITCH_LOG_CRIT, "Unable to handle stimulus message, couldn't create incoming session.\n"); + return SWITCH_STATUS_FALSE; + } skinny_session_process_dest(session, listener, line_instance, NULL, '\0', 0); } break; @@ -1523,6 +1544,10 @@ switch_status_t skinny_handle_off_hook_message(listener_t *listener, skinny_mess skinny_session_answer(session, listener, line_instance); } else { /* start a new call */ skinny_create_incoming_session(listener, &line_instance, &session); + if ( ! session ) { + skinny_log_l_msg(listener, SWITCH_LOG_CRIT, "Unable to handle off hook message, could not create session.\n"); + return SWITCH_STATUS_FALSE; + } tech_pvt = switch_core_session_get_private(session); assert(tech_pvt != NULL); @@ -2037,11 +2062,19 @@ switch_status_t skinny_handle_soft_key_event_message(listener_t *listener, skinn switch(request->data.soft_key_event.event) { case SOFTKEY_REDIAL: status = skinny_create_incoming_session(listener, &line_instance, &session); + if ( ! session ) { + skinny_log_l_msg(listener, SWITCH_LOG_CRIT, "Unable to handle soft key event, could not create incoming session.\n"); + return SWITCH_STATUS_FALSE; + } skinny_session_process_dest(session, listener, line_instance, empty_null2(listener->ext_redial,listener->profile->ext_redial), '\0', 0); break; case SOFTKEY_NEWCALL: status = skinny_create_incoming_session(listener, &line_instance, &session); + if ( ! session ) { + skinny_log_l_msg(listener, SWITCH_LOG_CRIT, "Unable to handle soft key event, could not create incoming session.\n"); + return SWITCH_STATUS_FALSE; + } skinny_session_process_dest(session, listener, line_instance, NULL, '\0', 0); break; case SOFTKEY_HOLD: @@ -2098,17 +2131,29 @@ switch_status_t skinny_handle_soft_key_event_message(listener_t *listener, skinn break; case SOFTKEY_MEETME: skinny_create_incoming_session(listener, &line_instance, &session); + if ( ! session ) { + skinny_log_l_msg(listener, SWITCH_LOG_CRIT, "Unable to handle soft key event, could not create incoming session.\n"); + return SWITCH_STATUS_FALSE; + } skinny_session_process_dest(session, listener, line_instance, empty_null2(listener->ext_meetme, listener->profile->ext_meetme), '\0', 0); break; case SOFTKEY_CALLPICKUP: case SOFTKEY_GRPCALLPICKUP: skinny_create_incoming_session(listener, &line_instance, &session); + if ( ! session ) { + skinny_log_l_msg(listener, SWITCH_LOG_CRIT, "Unable to handle soft key event, could not create incoming session.\n"); + return SWITCH_STATUS_FALSE; + } skinny_session_process_dest(session, listener, line_instance, empty_null2(listener->ext_pickup, listener->profile->ext_pickup), '\0', 0); break; case SOFTKEY_CFWDALL: skinny_create_incoming_session(listener, &line_instance, &session); + if ( ! session ) { + skinny_log_l_msg(listener, SWITCH_LOG_CRIT, "Unable to handle soft key event, could not create incoming session.\n"); + return SWITCH_STATUS_FALSE; + } skinny_session_process_dest(session, listener, line_instance, empty_null2(listener->ext_cfwdall, listener->profile->ext_cfwdall), '\0', 0); break; From 3382b805a5da9c94c39ee2c5934335e6627d0de9 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Tue, 9 Sep 2014 14:25:11 +0000 Subject: [PATCH 68/77] Add mod_bert to debian packaging --- debian/control-modules | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/debian/control-modules b/debian/control-modules index 57b62dd6d1..9246317117 100644 --- a/debian/control-modules +++ b/debian/control-modules @@ -13,6 +13,10 @@ Description: Advanced voicemail detection This module attempts to determine when a voicemail system has answered the call. +Module: applications/mod_bert +Description: Line testing tool + This module provides a tool to test a line. + Module: applications/mod_blacklist Description: Blacklist helper This module provides tools to blacklist callers. From eb7200bbe596515cbede50018c34c5b374b16cf0 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Tue, 9 Sep 2014 16:25:17 +0000 Subject: [PATCH 69/77] Avoid mod_java on Debian wheezy We're already avoiding it on sid and jessie; now we're hitting build failures with it on wheezy. ref: FS-6811 --- debian/bootstrap.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/bootstrap.sh b/debian/bootstrap.sh index b71ab98265..e9b77825a0 100755 --- a/debian/bootstrap.sh +++ b/debian/bootstrap.sh @@ -41,6 +41,7 @@ avoid_mods_jessie=( languages/mod_java ) avoid_mods_wheezy=( + languages/mod_java ) avoid_mods_squeeze=( formats/mod_vlc From 151440b7e178b80d618e0f4ee227058b342f0b76 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 9 Sep 2014 21:35:47 +0500 Subject: [PATCH 70/77] fix race caused by consecutive stun packets --- src/switch_rtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 161f46f782..a2264d2e15 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -1127,7 +1127,7 @@ static void handle_ice(switch_rtp_t *rtp_session, switch_rtp_ice_t *ice, void *d if (!strcmp(ice->ice_params->cands[i][ice->proto].con_addr, host) && !strcmp(ice->ice_params->cands[i][ice->proto].cand_type, "relay")) { - if (elapsed != 0 && elapsed < 5000) { + if (rtp_session->last_stun && elapsed < 5000) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_WARNING, "Skiping RELAY stun/%s/dtls port change from %s:%u to %s:%u\n", is_rtcp ? "rtcp" : "rtp", host2, port2, From 574d19e56ee2a624696364b6893be896615877a2 Mon Sep 17 00:00:00 2001 From: Nathan Neulinger Date: Tue, 9 Sep 2014 15:58:56 -0500 Subject: [PATCH 71/77] mod_skinny: fix behavior of transfer when target extension falls through to voicemail - keep bridge from dropping out during that operation --- src/mod/endpoints/mod_skinny/skinny_server.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_skinny/skinny_server.c b/src/mod/endpoints/mod_skinny/skinny_server.c index 7a241231a7..f54224640f 100644 --- a/src/mod/endpoints/mod_skinny/skinny_server.c +++ b/src/mod/endpoints/mod_skinny/skinny_server.c @@ -903,6 +903,7 @@ switch_status_t skinny_session_transfer(switch_core_session_t *session, listener const char *remote_uuid = NULL; const char *remote_uuid2 = NULL; switch_core_session_t *session2 = NULL; + switch_core_session_t *rsession = NULL; private_t *tech_pvt2 = NULL; switch_assert(session); @@ -914,6 +915,17 @@ switch_status_t skinny_session_transfer(switch_core_session_t *session, listener local_uuid = switch_channel_get_uuid(channel); remote_uuid = switch_channel_get_partner_uuid(channel); + if ( switch_core_session_get_partner(session, &rsession) == SWITCH_STATUS_SUCCESS ) + { + switch_channel_t *rchannel = NULL; + rchannel = switch_core_session_get_channel(rsession); + + skinny_log_l_msg(listener, SWITCH_LOG_INFO, "SST: setting uuid bridge continue flag on remote channel\n"); + + switch_channel_set_variable(rchannel, "uuid_bridge_continue_on_cancel", "true"); + switch_core_session_rwunlock(rsession); + } + skinny_log_l(listener, SWITCH_LOG_INFO, "SST: local_uuid=%s remote_uuid=%s\n", local_uuid, remote_uuid); if (tech_pvt->transfer_from_call_id) { @@ -928,7 +940,7 @@ switch_status_t skinny_session_transfer(switch_core_session_t *session, listener skinny_log_ls(listener, session2, SWITCH_LOG_INFO, "SST: attempting ivr bridge from (%s) to (%s)\n", remote_uuid, remote_uuid2); - if (switch_ivr_uuid_bridge(remote_uuid, remote_uuid2) == SWITCH_STATUS_SUCCESS) { + if (switch_ivr_uuid_bridge(remote_uuid2, remote_uuid) == SWITCH_STATUS_SUCCESS) { skinny_log_ls_msg(listener, session2, SWITCH_LOG_INFO, "SST: success on uuid bridge\n"); switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); From 66302cac896d04a942c2728a96cb3dd084619d73 Mon Sep 17 00:00:00 2001 From: Brian West Date: Tue, 9 Sep 2014 17:59:25 -0500 Subject: [PATCH 72/77] FS-6811 #resolve --- .../org/freeswitch/swig/SWIGTYPE_p_int.java | 26 + .../languages/mod_managed/freeswitch_wrap.cxx | 823 +++++++++- src/mod/languages/mod_managed/managed/swig.cs | 1414 ++++++++++++----- src/mod/languages/mod_perl/mod_perl_wrap.cpp | 6 +- 4 files changed, 1866 insertions(+), 403 deletions(-) create mode 100644 src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_int.java diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_int.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_int.java new file mode 100644 index 0000000000..bb712a806b --- /dev/null +++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_int.java @@ -0,0 +1,26 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 1.3.35 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package org.freeswitch.swig; + +public class SWIGTYPE_p_int { + private long swigCPtr; + + protected SWIGTYPE_p_int(long cPtr, boolean futureUse) { + swigCPtr = cPtr; + } + + protected SWIGTYPE_p_int() { + swigCPtr = 0; + } + + protected static long getCPtr(SWIGTYPE_p_int obj) { + return (obj == null) ? 0 : obj.swigCPtr; + } +} + diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.cxx index a444a30749..83a87bcf94 100644 --- a/src/mod/languages/mod_managed/freeswitch_wrap.cxx +++ b/src/mod/languages/mod_managed/freeswitch_wrap.cxx @@ -1,11 +1,11 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 - * - * This file is not intended to be easily readable and contains a number of + * Version 2.0.7 + * + * 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 - * changes to this file unless you know what you are doing--modify the SWIG - * interface file instead. + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. * ----------------------------------------------------------------------------- */ #define SWIGCSHARP @@ -65,28 +65,28 @@ template T SwigValueInit() { #ifndef SWIGUNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define SWIGUNUSED __attribute__ ((__unused__)) +# define SWIGUNUSED __attribute__ ((__unused__)) # else # define SWIGUNUSED # endif # elif defined(__ICC) -# define SWIGUNUSED __attribute__ ((__unused__)) +# define SWIGUNUSED __attribute__ ((__unused__)) # else -# define SWIGUNUSED +# define SWIGUNUSED # endif #endif #ifndef SWIG_MSC_UNSUPPRESS_4505 # if defined(_MSC_VER) # pragma warning(disable : 4505) /* unreferenced local function has been removed */ -# endif +# endif #endif #ifndef SWIGUNUSEDPARM # ifdef __cplusplus # define SWIGUNUSEDPARM(p) # else -# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# define SWIGUNUSEDPARM(p) p SWIGUNUSED # endif #endif @@ -129,7 +129,7 @@ template T SwigValueInit() { # define SWIGSTDCALL __stdcall # else # define SWIGSTDCALL -# endif +# endif #endif /* Deal with Microsoft's attempt at deprecating C standard runtime functions */ @@ -2720,6 +2720,36 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_directories_storage_dir_get(void * j } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_directories_cache_dir_set(void * jarg1, char * jarg2) { + switch_directories *arg1 = (switch_directories *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_directories *)jarg1; + arg2 = (char *)jarg2; + { + delete [] arg1->cache_dir; + if (arg2) { + arg1->cache_dir = (char *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->cache_dir, (const char *)arg2); + } else { + arg1->cache_dir = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_directories_cache_dir_get(void * jarg1) { + char * jresult ; + switch_directories *arg1 = (switch_directories *) 0 ; + char *result = 0 ; + + arg1 = (switch_directories *)jarg1; + result = (char *) ((arg1)->cache_dir); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_directories_recordings_dir_set(void * jarg1, char * jarg2) { switch_directories *arg1 = (switch_directories *) 0 ; char *arg2 = (char *) 0 ; @@ -4890,6 +4920,16 @@ SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_MEDIA_TYPE_TOTAL_get() { } +SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_SOCK_INVALID_get() { + int jresult ; + int result; + + result = (int)(-1); + jresult = result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_console_callback_match_node_val_set(void * jarg1, char * jarg2) { switch_console_callback_match_node *arg1 = (switch_console_callback_match_node *) 0 ; char *arg2 = (char *) 0 ; @@ -6230,6 +6270,90 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_payload_map_t(void * jarg1) { } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_waitlist_t_sock_set(void * jarg1, int jarg2) { + switch_waitlist_s *arg1 = (switch_waitlist_s *) 0 ; + switch_os_socket_t arg2 ; + + arg1 = (switch_waitlist_s *)jarg1; + arg2 = (switch_os_socket_t)jarg2; + if (arg1) (arg1)->sock = arg2; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_waitlist_t_sock_get(void * jarg1) { + int jresult ; + switch_waitlist_s *arg1 = (switch_waitlist_s *) 0 ; + switch_os_socket_t result; + + arg1 = (switch_waitlist_s *)jarg1; + result = (switch_os_socket_t) ((arg1)->sock); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_waitlist_t_events_set(void * jarg1, unsigned long jarg2) { + switch_waitlist_s *arg1 = (switch_waitlist_s *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_waitlist_s *)jarg1; + arg2 = (uint32_t)jarg2; + if (arg1) (arg1)->events = arg2; +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_waitlist_t_events_get(void * jarg1) { + unsigned long jresult ; + switch_waitlist_s *arg1 = (switch_waitlist_s *) 0 ; + uint32_t result; + + arg1 = (switch_waitlist_s *)jarg1; + result = (uint32_t) ((arg1)->events); + jresult = (unsigned long)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_waitlist_t_revents_set(void * jarg1, unsigned long jarg2) { + switch_waitlist_s *arg1 = (switch_waitlist_s *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_waitlist_s *)jarg1; + arg2 = (uint32_t)jarg2; + if (arg1) (arg1)->revents = arg2; +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_waitlist_t_revents_get(void * jarg1) { + unsigned long jresult ; + switch_waitlist_s *arg1 = (switch_waitlist_s *) 0 ; + uint32_t result; + + arg1 = (switch_waitlist_s *)jarg1; + result = (uint32_t) ((arg1)->revents); + jresult = (unsigned long)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_waitlist_t() { + void * jresult ; + switch_waitlist_s *result = 0 ; + + result = (switch_waitlist_s *)new switch_waitlist_s(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_waitlist_t(void * jarg1) { + switch_waitlist_s *arg1 = (switch_waitlist_s *) 0 ; + + arg1 = (switch_waitlist_s *)jarg1; + delete arg1; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_db_close(void * jarg1) { int jresult ; switch_core_db_t *arg1 = (switch_core_db_t *) 0 ; @@ -18102,6 +18226,18 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_find_end_paren(char * jarg1, char ja } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_separate_file_params(char * jarg1, void * jarg2, void * jarg3) { + char *arg1 = (char *) 0 ; + char **arg2 = (char **) 0 ; + char **arg3 = (char **) 0 ; + + arg1 = (char *)jarg1; + arg2 = (char **)jarg2; + arg3 = (char **)jarg3; + switch_separate_file_params((char const *)arg1,arg2,arg3); +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_is_file_path(char * jarg1) { int jresult ; char *arg1 = (char *) 0 ; @@ -18426,6 +18562,611 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_strerror_r(int jarg1, char * jarg2, } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_wait_sock(int jarg1, unsigned long jarg2, int jarg3) { + int jresult ; + switch_os_socket_t arg1 ; + uint32_t arg2 ; + switch_poll_t arg3 ; + int result; + + arg1 = (switch_os_socket_t)jarg1; + arg2 = (uint32_t)jarg2; + arg3 = (switch_poll_t)jarg3; + result = (int)switch_wait_sock(arg1,arg2,arg3); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_wait_socklist(void * jarg1, unsigned long jarg2, unsigned long jarg3) { + int jresult ; + switch_waitlist_t *arg1 = (switch_waitlist_t *) 0 ; + uint32_t arg2 ; + uint32_t arg3 ; + int result; + + arg1 = (switch_waitlist_t *)jarg1; + arg2 = (uint32_t)jarg2; + arg3 = (uint32_t)jarg3; + result = (int)switch_wait_socklist(arg1,arg2,arg3); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_method_set(void * jarg1, char * jarg2) { + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_s *)jarg1; + arg2 = (char *)jarg2; + { + if (arg2) { + arg1->method = (char const *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->method, (const char *)arg2); + } else { + arg1->method = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t_method_get(void * jarg1) { + char * jresult ; + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + char *result = 0 ; + + arg1 = (switch_http_request_s *)jarg1; + result = (char *) ((arg1)->method); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_uri_set(void * jarg1, char * jarg2) { + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_s *)jarg1; + arg2 = (char *)jarg2; + { + if (arg2) { + arg1->uri = (char const *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->uri, (const char *)arg2); + } else { + arg1->uri = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t_uri_get(void * jarg1) { + char * jresult ; + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + char *result = 0 ; + + arg1 = (switch_http_request_s *)jarg1; + result = (char *) ((arg1)->uri); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_qs_set(void * jarg1, char * jarg2) { + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_s *)jarg1; + arg2 = (char *)jarg2; + { + if (arg2) { + arg1->qs = (char const *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->qs, (const char *)arg2); + } else { + arg1->qs = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t_qs_get(void * jarg1) { + char * jresult ; + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + char *result = 0 ; + + arg1 = (switch_http_request_s *)jarg1; + result = (char *) ((arg1)->qs); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_host_set(void * jarg1, char * jarg2) { + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_s *)jarg1; + arg2 = (char *)jarg2; + { + if (arg2) { + arg1->host = (char const *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->host, (const char *)arg2); + } else { + arg1->host = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t_host_get(void * jarg1) { + char * jresult ; + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + char *result = 0 ; + + arg1 = (switch_http_request_s *)jarg1; + result = (char *) ((arg1)->host); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_port_set(void * jarg1, unsigned short jarg2) { + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + switch_port_t arg2 ; + + arg1 = (switch_http_request_s *)jarg1; + arg2 = (switch_port_t)jarg2; + if (arg1) (arg1)->port = arg2; +} + + +SWIGEXPORT unsigned short SWIGSTDCALL CSharp_switch_http_request_t_port_get(void * jarg1) { + unsigned short jresult ; + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + switch_port_t result; + + arg1 = (switch_http_request_s *)jarg1; + result = (switch_port_t) ((arg1)->port); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_from_set(void * jarg1, char * jarg2) { + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_s *)jarg1; + arg2 = (char *)jarg2; + { + if (arg2) { + arg1->from = (char const *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->from, (const char *)arg2); + } else { + arg1->from = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t_from_get(void * jarg1) { + char * jresult ; + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + char *result = 0 ; + + arg1 = (switch_http_request_s *)jarg1; + result = (char *) ((arg1)->from); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_user_agent_set(void * jarg1, char * jarg2) { + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_s *)jarg1; + arg2 = (char *)jarg2; + { + if (arg2) { + arg1->user_agent = (char const *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->user_agent, (const char *)arg2); + } else { + arg1->user_agent = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t_user_agent_get(void * jarg1) { + char * jresult ; + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + char *result = 0 ; + + arg1 = (switch_http_request_s *)jarg1; + result = (char *) ((arg1)->user_agent); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_referer_set(void * jarg1, char * jarg2) { + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_s *)jarg1; + arg2 = (char *)jarg2; + { + if (arg2) { + arg1->referer = (char const *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->referer, (const char *)arg2); + } else { + arg1->referer = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t_referer_get(void * jarg1) { + char * jresult ; + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + char *result = 0 ; + + arg1 = (switch_http_request_s *)jarg1; + result = (char *) ((arg1)->referer); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_user_set(void * jarg1, char * jarg2) { + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_s *)jarg1; + arg2 = (char *)jarg2; + { + if (arg2) { + arg1->user = (char const *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->user, (const char *)arg2); + } else { + arg1->user = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t_user_get(void * jarg1) { + char * jresult ; + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + char *result = 0 ; + + arg1 = (switch_http_request_s *)jarg1; + result = (char *) ((arg1)->user); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_keepalive_set(void * jarg1, int jarg2) { + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + switch_bool_t arg2 ; + + arg1 = (switch_http_request_s *)jarg1; + arg2 = (switch_bool_t)jarg2; + if (arg1) (arg1)->keepalive = arg2; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_http_request_t_keepalive_get(void * jarg1) { + int jresult ; + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + switch_bool_t result; + + arg1 = (switch_http_request_s *)jarg1; + result = (switch_bool_t) ((arg1)->keepalive); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_content_type_set(void * jarg1, char * jarg2) { + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_s *)jarg1; + arg2 = (char *)jarg2; + { + if (arg2) { + arg1->content_type = (char const *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->content_type, (const char *)arg2); + } else { + arg1->content_type = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t_content_type_get(void * jarg1) { + char * jresult ; + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + char *result = 0 ; + + arg1 = (switch_http_request_s *)jarg1; + result = (char *) ((arg1)->content_type); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_content_length_set(void * jarg1, void * jarg2) { + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + switch_size_t arg2 ; + switch_size_t *argp2 ; + + arg1 = (switch_http_request_s *)jarg1; + argp2 = (switch_size_t *)jarg2; + if (!argp2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_size_t", 0); + return ; + } + arg2 = *argp2; + if (arg1) (arg1)->content_length = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_http_request_t_content_length_get(void * jarg1) { + void * jresult ; + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + switch_size_t result; + + arg1 = (switch_http_request_s *)jarg1; + result = ((arg1)->content_length); + jresult = new switch_size_t((const switch_size_t &)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_bytes_header_set(void * jarg1, void * jarg2) { + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + switch_size_t arg2 ; + switch_size_t *argp2 ; + + arg1 = (switch_http_request_s *)jarg1; + argp2 = (switch_size_t *)jarg2; + if (!argp2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_size_t", 0); + return ; + } + arg2 = *argp2; + if (arg1) (arg1)->bytes_header = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_http_request_t_bytes_header_get(void * jarg1) { + void * jresult ; + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + switch_size_t result; + + arg1 = (switch_http_request_s *)jarg1; + result = ((arg1)->bytes_header); + jresult = new switch_size_t((const switch_size_t &)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_bytes_read_set(void * jarg1, void * jarg2) { + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + switch_size_t arg2 ; + switch_size_t *argp2 ; + + arg1 = (switch_http_request_s *)jarg1; + argp2 = (switch_size_t *)jarg2; + if (!argp2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_size_t", 0); + return ; + } + arg2 = *argp2; + if (arg1) (arg1)->bytes_read = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_http_request_t_bytes_read_get(void * jarg1) { + void * jresult ; + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + switch_size_t result; + + arg1 = (switch_http_request_s *)jarg1; + result = ((arg1)->bytes_read); + jresult = new switch_size_t((const switch_size_t &)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_bytes_buffered_set(void * jarg1, void * jarg2) { + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + switch_size_t arg2 ; + switch_size_t *argp2 ; + + arg1 = (switch_http_request_s *)jarg1; + argp2 = (switch_size_t *)jarg2; + if (!argp2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_size_t", 0); + return ; + } + arg2 = *argp2; + if (arg1) (arg1)->bytes_buffered = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_http_request_t_bytes_buffered_get(void * jarg1) { + void * jresult ; + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + switch_size_t result; + + arg1 = (switch_http_request_s *)jarg1; + result = ((arg1)->bytes_buffered); + jresult = new switch_size_t((const switch_size_t &)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_headers_set(void * jarg1, void * jarg2) { + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + switch_event_t *arg2 = (switch_event_t *) 0 ; + + arg1 = (switch_http_request_s *)jarg1; + arg2 = (switch_event_t *)jarg2; + if (arg1) (arg1)->headers = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_http_request_t_headers_get(void * jarg1) { + void * jresult ; + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + switch_event_t *result = 0 ; + + arg1 = (switch_http_request_s *)jarg1; + result = (switch_event_t *) ((arg1)->headers); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t_user_data_set(void * jarg1, void * jarg2) { + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + void *arg2 = (void *) 0 ; + + arg1 = (switch_http_request_s *)jarg1; + arg2 = (void *)jarg2; + if (arg1) (arg1)->user_data = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_http_request_t_user_data_get(void * jarg1) { + void * jresult ; + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + void *result = 0 ; + + arg1 = (switch_http_request_s *)jarg1; + result = (void *) ((arg1)->user_data); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t__buffer_set(void * jarg1, char * jarg2) { + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_s *)jarg1; + arg2 = (char *)jarg2; + { + delete [] arg1->_buffer; + if (arg2) { + arg1->_buffer = (char *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->_buffer, (const char *)arg2); + } else { + arg1->_buffer = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_http_request_t__buffer_get(void * jarg1) { + char * jresult ; + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + char *result = 0 ; + + arg1 = (switch_http_request_s *)jarg1; + result = (char *) ((arg1)->_buffer); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_request_t__destroy_headers_set(void * jarg1, int jarg2) { + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + switch_bool_t arg2 ; + + arg1 = (switch_http_request_s *)jarg1; + arg2 = (switch_bool_t)jarg2; + if (arg1) (arg1)->_destroy_headers = arg2; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_http_request_t__destroy_headers_get(void * jarg1) { + int jresult ; + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + switch_bool_t result; + + arg1 = (switch_http_request_s *)jarg1; + result = (switch_bool_t) ((arg1)->_destroy_headers); + jresult = result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_http_request_t() { + void * jresult ; + switch_http_request_s *result = 0 ; + + result = (switch_http_request_s *)new switch_http_request_s(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_http_request_t(void * jarg1) { + switch_http_request_s *arg1 = (switch_http_request_s *) 0 ; + + arg1 = (switch_http_request_s *)jarg1; + delete arg1; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_http_parse_header(char * jarg1, unsigned long jarg2, void * jarg3) { + int jresult ; + char *arg1 = (char *) 0 ; + uint32_t arg2 ; + switch_http_request_t *arg3 = (switch_http_request_t *) 0 ; + switch_status_t result; + + arg1 = (char *)jarg1; + arg2 = (uint32_t)jarg2; + arg3 = (switch_http_request_t *)jarg3; + result = (switch_status_t)switch_http_parse_header(arg1,arg2,arg3); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_free_request(void * jarg1) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + + arg1 = (switch_http_request_t *)jarg1; + switch_http_free_request(arg1); +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_dump_request(void * jarg1) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + + arg1 = (switch_http_request_t *)jarg1; + switch_http_dump_request(arg1); +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_http_parse_qs(void * jarg1, char * jarg2) { + switch_http_request_t *arg1 = (switch_http_request_t *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_http_request_t *)jarg1; + arg2 = (char *)jarg2; + switch_http_parse_qs(arg1,arg2); +} + + SWIGEXPORT void SWIGSTDCALL CSharp_profile_node_t_var_set(void * jarg1, char * jarg2) { profile_node_s *arg1 = (profile_node_s *) 0 ; char *arg2 = (char *) 0 ; @@ -20859,6 +21600,28 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_state_handler_table(void * jarg } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_stream_handle_read_function_set(void * jarg1, void * jarg2) { + switch_stream_handle *arg1 = (switch_stream_handle *) 0 ; + switch_stream_handle_read_function_t arg2 = (switch_stream_handle_read_function_t) 0 ; + + arg1 = (switch_stream_handle *)jarg1; + arg2 = (switch_stream_handle_read_function_t)jarg2; + if (arg1) (arg1)->read_function = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_stream_handle_read_function_get(void * jarg1) { + void * jresult ; + switch_stream_handle *arg1 = (switch_stream_handle *) 0 ; + switch_stream_handle_read_function_t result; + + arg1 = (switch_stream_handle *)jarg1; + result = (switch_stream_handle_read_function_t) ((arg1)->read_function); + jresult = (void *)result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_stream_handle_write_function_set(void * jarg1, void * jarg2) { switch_stream_handle *arg1 = (switch_stream_handle *) 0 ; switch_stream_handle_write_function_t arg2 = (switch_stream_handle_write_function_t) 0 ; @@ -36232,6 +36995,18 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_uuid_force_exists(char * jarg1) { } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_dmachine_is_parsing(void * jarg1) { + int jresult ; + switch_ivr_dmachine_t *arg1 = (switch_ivr_dmachine_t *) 0 ; + switch_bool_t result; + + arg1 = (switch_ivr_dmachine_t *)jarg1; + result = (switch_bool_t)switch_ivr_dmachine_is_parsing(arg1); + jresult = result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_dmachine_last_ping(void * jarg1) { int jresult ; switch_ivr_dmachine_t *arg1 = (switch_ivr_dmachine_t *) 0 ; @@ -42238,6 +43013,20 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_Stream(void * jarg1) { } +SWIGEXPORT char * SWIGSTDCALL CSharp_Stream_read(void * jarg1, void * jarg2) { + char * jresult ; + Stream *arg1 = (Stream *) 0 ; + int *arg2 = (int *) 0 ; + char *result = 0 ; + + arg1 = (Stream *)jarg1; + arg2 = (int *)jarg2; + result = (char *)(arg1)->read(arg2); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_Stream_Write(void * jarg1, char * jarg2) { Stream *arg1 = (Stream *) 0 ; char *arg2 = (char *) 0 ; @@ -42248,6 +43037,18 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Stream_Write(void * jarg1, char * jarg2) { } +SWIGEXPORT void SWIGSTDCALL CSharp_Stream_raw_write(void * jarg1, char * jarg2, int jarg3) { + Stream *arg1 = (Stream *) 0 ; + char *arg2 = (char *) 0 ; + int arg3 ; + + arg1 = (Stream *)jarg1; + arg2 = (char *)jarg2; + arg3 = (int)jarg3; + (arg1)->raw_write((char const *)arg2,arg3); +} + + SWIGEXPORT char * SWIGSTDCALL CSharp_Stream_get_data(void * jarg1) { char * jresult ; Stream *arg1 = (Stream *) 0 ; diff --git a/src/mod/languages/mod_managed/managed/swig.cs b/src/mod/languages/mod_managed/managed/swig.cs index 6225771afa..2329ca5861 100644 --- a/src/mod/languages/mod_managed/managed/swig.cs +++ b/src/mod/languages/mod_managed/managed/swig.cs @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -64,7 +64,7 @@ public class Api : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -133,7 +133,7 @@ public class audio_buffer_header_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -149,7 +149,7 @@ public enum cache_db_flag_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -518,7 +518,7 @@ public class CoreSession : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -534,7 +534,7 @@ public enum dm_match_type_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -624,7 +624,7 @@ public class dtls_fingerprint_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -643,7 +643,7 @@ public enum dtls_state_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -661,7 +661,7 @@ public enum dtls_type_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -730,7 +730,7 @@ public class DTMF : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -746,7 +746,7 @@ public enum dtmf_flag_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -882,7 +882,7 @@ public class EventConsumer : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -1020,7 +1020,7 @@ public partial class Event : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -3948,6 +3948,10 @@ public class freeswitch { return ret; } + public static void switch_separate_file_params(string file, ref string file_portion, ref string params_portion) { + freeswitchPINVOKE.switch_separate_file_params(file, ref file_portion, ref params_portion); + } + public static switch_bool_t switch_is_file_path(string file) { switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_is_file_path(file); return ret; @@ -4054,6 +4058,33 @@ public class freeswitch { return ret; } + public static int switch_wait_sock(int sock, uint ms, switch_poll_t flags) { + int ret = freeswitchPINVOKE.switch_wait_sock(sock, ms, (int)flags); + return ret; + } + + public static int switch_wait_socklist(switch_waitlist_t waitlist, uint len, uint ms) { + int ret = freeswitchPINVOKE.switch_wait_socklist(switch_waitlist_t.getCPtr(waitlist), len, ms); + return ret; + } + + public static switch_status_t switch_http_parse_header(string buffer, uint datalen, switch_http_request_t request) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_http_parse_header(buffer, datalen, switch_http_request_t.getCPtr(request)); + return ret; + } + + public static void switch_http_free_request(switch_http_request_t request) { + freeswitchPINVOKE.switch_http_free_request(switch_http_request_t.getCPtr(request)); + } + + public static void switch_http_dump_request(switch_http_request_t request) { + freeswitchPINVOKE.switch_http_dump_request(switch_http_request_t.getCPtr(request)); + } + + public static void switch_http_parse_qs(switch_http_request_t request, string qs) { + freeswitchPINVOKE.switch_http_parse_qs(switch_http_request_t.getCPtr(request), qs); + } + public static switch_caller_extension switch_caller_extension_new(SWIGTYPE_p_switch_core_session session, string extension_name, string extension_number) { IntPtr cPtr = freeswitchPINVOKE.switch_caller_extension_new(SWIGTYPE_p_switch_core_session.getCPtr(session), extension_name, extension_number); switch_caller_extension ret = (cPtr == IntPtr.Zero) ? null : new switch_caller_extension(cPtr, false); @@ -5894,6 +5925,11 @@ public class freeswitch { return ret; } + public static switch_bool_t switch_ivr_dmachine_is_parsing(SWIGTYPE_p_switch_ivr_dmachine dmachine) { + switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_ivr_dmachine_is_parsing(SWIGTYPE_p_switch_ivr_dmachine.getCPtr(dmachine)); + return ret; + } + public static switch_status_t switch_ivr_dmachine_last_ping(SWIGTYPE_p_switch_ivr_dmachine dmachine) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_dmachine_last_ping(SWIGTYPE_p_switch_ivr_dmachine.getCPtr(dmachine)); return ret; @@ -7093,6 +7129,7 @@ public class freeswitch { public static readonly int SWITCH_MAX_MANAGEMENT_BUFFER_LEN = freeswitchPINVOKE.SWITCH_MAX_MANAGEMENT_BUFFER_LEN_get(); public static readonly int SWITCH_RTP_CNG_PAYLOAD = freeswitchPINVOKE.SWITCH_RTP_CNG_PAYLOAD_get(); public static readonly int SWITCH_MEDIA_TYPE_TOTAL = freeswitchPINVOKE.SWITCH_MEDIA_TYPE_TOTAL_get(); + public static readonly int SWITCH_SOCK_INVALID = freeswitchPINVOKE.SWITCH_SOCK_INVALID_get(); public static readonly int DMACHINE_MAX_DIGIT_LEN = freeswitchPINVOKE.DMACHINE_MAX_DIGIT_LEN_get(); public static readonly int MAX_ARG_RECURSION = freeswitchPINVOKE.MAX_ARG_RECURSION_get(); public static readonly int SWITCH_API_VERSION = freeswitchPINVOKE.SWITCH_API_VERSION_get(); @@ -7150,7 +7187,7 @@ public class freeswitch { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -8021,6 +8058,12 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_directories_storage_dir_get")] public static extern string switch_directories_storage_dir_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_directories_cache_dir_set")] + public static extern void switch_directories_cache_dir_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_directories_cache_dir_get")] + public static extern string switch_directories_cache_dir_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_directories_recordings_dir_set")] public static extern void switch_directories_recordings_dir_set(HandleRef jarg1, string jarg2); @@ -8585,6 +8628,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_MEDIA_TYPE_TOTAL_get")] public static extern int SWITCH_MEDIA_TYPE_TOTAL_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_SOCK_INVALID_get")] + public static extern int SWITCH_SOCK_INVALID_get(); + [DllImport("mod_managed", EntryPoint="CSharp_switch_console_callback_match_node_val_set")] public static extern void switch_console_callback_match_node_val_set(HandleRef jarg1, string jarg2); @@ -8942,6 +8988,30 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_delete_payload_map_t")] public static extern void delete_payload_map_t(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_waitlist_t_sock_set")] + public static extern void switch_waitlist_t_sock_set(HandleRef jarg1, int jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_waitlist_t_sock_get")] + public static extern int switch_waitlist_t_sock_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_waitlist_t_events_set")] + public static extern void switch_waitlist_t_events_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_waitlist_t_events_get")] + public static extern uint switch_waitlist_t_events_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_waitlist_t_revents_set")] + public static extern void switch_waitlist_t_revents_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_waitlist_t_revents_get")] + public static extern uint switch_waitlist_t_revents_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_new_switch_waitlist_t")] + public static extern IntPtr new_switch_waitlist_t(); + + [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_waitlist_t")] + public static extern void delete_switch_waitlist_t(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_db_close")] public static extern int switch_core_db_close(HandleRef jarg1); @@ -11711,6 +11781,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_find_end_paren")] public static extern string switch_find_end_paren(string jarg1, char jarg2, char jarg3); + [DllImport("mod_managed", EntryPoint="CSharp_switch_separate_file_params")] + public static extern void switch_separate_file_params(string jarg1, ref string jarg2, ref string jarg3); + [DllImport("mod_managed", EntryPoint="CSharp_switch_is_file_path")] public static extern int switch_is_file_path(string jarg1); @@ -11774,6 +11847,144 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_strerror_r")] public static extern string switch_strerror_r(int jarg1, string jarg2, HandleRef jarg3); + [DllImport("mod_managed", EntryPoint="CSharp_switch_wait_sock")] + public static extern int switch_wait_sock(int jarg1, uint jarg2, int jarg3); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_wait_socklist")] + public static extern int switch_wait_socklist(HandleRef jarg1, uint jarg2, uint jarg3); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_method_set")] + public static extern void switch_http_request_t_method_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_method_get")] + public static extern string switch_http_request_t_method_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_uri_set")] + public static extern void switch_http_request_t_uri_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_uri_get")] + public static extern string switch_http_request_t_uri_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_qs_set")] + public static extern void switch_http_request_t_qs_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_qs_get")] + public static extern string switch_http_request_t_qs_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_host_set")] + public static extern void switch_http_request_t_host_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_host_get")] + public static extern string switch_http_request_t_host_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_port_set")] + public static extern void switch_http_request_t_port_set(HandleRef jarg1, ushort jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_port_get")] + public static extern ushort switch_http_request_t_port_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_from_set")] + public static extern void switch_http_request_t_from_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_from_get")] + public static extern string switch_http_request_t_from_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_user_agent_set")] + public static extern void switch_http_request_t_user_agent_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_user_agent_get")] + public static extern string switch_http_request_t_user_agent_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_referer_set")] + public static extern void switch_http_request_t_referer_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_referer_get")] + public static extern string switch_http_request_t_referer_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_user_set")] + public static extern void switch_http_request_t_user_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_user_get")] + public static extern string switch_http_request_t_user_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_keepalive_set")] + public static extern void switch_http_request_t_keepalive_set(HandleRef jarg1, int jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_keepalive_get")] + public static extern int switch_http_request_t_keepalive_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_content_type_set")] + public static extern void switch_http_request_t_content_type_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_content_type_get")] + public static extern string switch_http_request_t_content_type_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_content_length_set")] + public static extern void switch_http_request_t_content_length_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_content_length_get")] + public static extern IntPtr switch_http_request_t_content_length_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_bytes_header_set")] + public static extern void switch_http_request_t_bytes_header_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_bytes_header_get")] + public static extern IntPtr switch_http_request_t_bytes_header_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_bytes_read_set")] + public static extern void switch_http_request_t_bytes_read_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_bytes_read_get")] + public static extern IntPtr switch_http_request_t_bytes_read_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_bytes_buffered_set")] + public static extern void switch_http_request_t_bytes_buffered_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_bytes_buffered_get")] + public static extern IntPtr switch_http_request_t_bytes_buffered_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_headers_set")] + public static extern void switch_http_request_t_headers_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_headers_get")] + public static extern IntPtr switch_http_request_t_headers_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_user_data_set")] + public static extern void switch_http_request_t_user_data_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t_user_data_get")] + public static extern IntPtr switch_http_request_t_user_data_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t__buffer_set")] + public static extern void switch_http_request_t__buffer_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t__buffer_get")] + public static extern string switch_http_request_t__buffer_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t__destroy_headers_set")] + public static extern void switch_http_request_t__destroy_headers_set(HandleRef jarg1, int jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_request_t__destroy_headers_get")] + public static extern int switch_http_request_t__destroy_headers_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_new_switch_http_request_t")] + public static extern IntPtr new_switch_http_request_t(); + + [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_http_request_t")] + public static extern void delete_switch_http_request_t(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_parse_header")] + public static extern int switch_http_parse_header(string jarg1, uint jarg2, HandleRef jarg3); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_free_request")] + public static extern void switch_http_free_request(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_dump_request")] + public static extern void switch_http_dump_request(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_http_parse_qs")] + public static extern void switch_http_parse_qs(HandleRef jarg1, string jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_profile_node_t_var_set")] public static extern void profile_node_t_var_set(HandleRef jarg1, string jarg2); @@ -12371,6 +12582,12 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_state_handler_table")] public static extern void delete_switch_state_handler_table(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_stream_handle_read_function_set")] + public static extern void switch_stream_handle_read_function_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_stream_handle_read_function_get")] + public static extern IntPtr switch_stream_handle_read_function_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_stream_handle_write_function_set")] public static extern void switch_stream_handle_write_function_set(HandleRef jarg1, HandleRef jarg2); @@ -16070,6 +16287,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_uuid_force_exists")] public static extern int switch_ivr_uuid_force_exists(string jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_dmachine_is_parsing")] + public static extern int switch_ivr_dmachine_is_parsing(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_dmachine_last_ping")] public static extern int switch_ivr_dmachine_last_ping(HandleRef jarg1); @@ -17504,9 +17724,15 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_delete_Stream")] public static extern void delete_Stream(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_Stream_read")] + public static extern string Stream_read(HandleRef jarg1, HandleRef jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_Stream_Write")] public static extern void Stream_Write(HandleRef jarg1, string jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_Stream_raw_write")] + public static extern void Stream_raw_write(HandleRef jarg1, string jarg2, int jarg3); + [DllImport("mod_managed", EntryPoint="CSharp_Stream_get_data")] public static extern string Stream_get_data(HandleRef jarg1); @@ -17871,7 +18097,7 @@ class freeswitchPINVOKE { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -18030,7 +18256,7 @@ public class icand_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -18046,7 +18272,7 @@ public enum ice_proto_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -18157,7 +18383,7 @@ public class ice_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -18249,7 +18475,7 @@ public class input_callback_state_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -18320,7 +18546,7 @@ public class ip_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -18377,7 +18603,7 @@ public class IvrMenu : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -18431,7 +18657,7 @@ public partial class ManagedSession : CoreSession { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -18721,7 +18947,7 @@ public class payload_map_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -18801,7 +19027,7 @@ public class profile_node_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -18818,7 +19044,7 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -18865,10 +19091,19 @@ public partial class Stream : IDisposable { public Stream(switch_stream_handle arg0) : this(freeswitchPINVOKE.new_Stream__SWIG_1(switch_stream_handle.getCPtr(arg0)), true) { } + public string read(SWIGTYPE_p_int len) { + string ret = freeswitchPINVOKE.Stream_read(swigCPtr, SWIGTYPE_p_int.getCPtr(len)); + return ret; + } + public void Write(string data) { freeswitchPINVOKE.Stream_Write(swigCPtr, data); } + public void raw_write(string data, int len) { + freeswitchPINVOKE.Stream_raw_write(swigCPtr, data, len); + } + public string get_data() { string ret = freeswitchPINVOKE.Stream_get_data(swigCPtr); return ret; @@ -18879,7 +19114,7 @@ public partial class Stream : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -18909,7 +19144,7 @@ public class SWIGTYPE_p_a_2__icand_s { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -18939,7 +19174,7 @@ public class SWIGTYPE_p_apr_pool_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -18969,7 +19204,7 @@ public class SWIGTYPE_p_cJSON { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -18999,7 +19234,7 @@ public class SWIGTYPE_p_FILE { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19029,7 +19264,7 @@ public class SWIGTYPE_p_float { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19059,7 +19294,7 @@ public class SWIGTYPE_p_f_p_char_enum_switch_management_action_t_p_char_switch_s } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19089,7 +19324,7 @@ public class SWIGTYPE_p_f_p_p_switch_loadable_module_interface_p_apr_pool_t__swi } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19119,7 +19354,7 @@ public class SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long_ } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19149,7 +19384,7 @@ public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_p_switch_console_cal } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19179,7 +19414,7 @@ public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_q_const__char_p_q_co } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19209,7 +19444,7 @@ public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_unsigned_long__int { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19239,7 +19474,7 @@ public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_void__void { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19269,7 +19504,7 @@ public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char__switch_status_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19299,7 +19534,7 @@ public class SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19329,7 +19564,7 @@ public class SWIGTYPE_p_f_p_q_const__char_p_switch_core_session_p_switch_stream_ } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19359,7 +19594,7 @@ public class SWIGTYPE_p_f_p_q_const__cJSON_p_switch_core_session_p_p_cJSON__swit } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19389,7 +19624,7 @@ public class SWIGTYPE_p_f_p_q_const__switch_log_node_t_enum_switch_log_level_t__ } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19419,7 +19654,7 @@ public class SWIGTYPE_p_f_p_q_const__void_p_q_const__void_p_void__switch_bool_t } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19449,7 +19684,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle_p_char_double__void { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19479,7 +19714,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle_p_char_int__void { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19509,7 +19744,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle_p_char_p_q_const__char__void { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19539,7 +19774,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle_p_p_char_p_unsigned_long__switch_s } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19569,7 +19804,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle_p_p_switch_event_p_unsigned_long__ } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19599,7 +19834,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_int_p_q_const__cha } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19629,7 +19864,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_p_q_const__char__s } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19659,7 +19894,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19689,7 +19924,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigne } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19719,7 +19954,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19749,7 +19984,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle_p_void_unsigned_int_p_unsigned_lon } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19779,7 +20014,7 @@ public class SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19809,7 +20044,7 @@ public class SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_uns } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19839,7 +20074,7 @@ public class SWIGTYPE_p_f_p_switch_codec__switch_status_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19869,7 +20104,7 @@ public class SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_s } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19899,7 +20134,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_enum_switch_channel_callstate_t_ } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19929,7 +20164,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_enum_switch_media_type_t__p_stfu } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19959,7 +20194,7 @@ public class SWIGTYPE_p_f_p_switch_core_session__int { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -19989,7 +20224,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20019,7 +20254,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_p_c } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20049,7 +20284,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_swi } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20079,7 +20314,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_p_switch_frame_unsigned_long_i } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20109,7 +20344,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char_ } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20139,7 +20374,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char_ } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20169,7 +20404,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char_ } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20199,7 +20434,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char__void { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20229,7 +20464,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t_enum_sw } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20259,7 +20494,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t__switch } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20289,7 +20524,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_switch_core_session_message__s } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20319,7 +20554,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_p } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20349,7 +20584,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_p } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20379,7 +20614,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_switch_event__switch_status_t } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20409,7 +20644,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_p_void__switch_st } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20439,7 +20674,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_unsigned_long_int } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20469,7 +20704,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_void_enum_switch_input_type_t_ } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20499,7 +20734,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_p_void__p_void { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20529,7 +20764,7 @@ public class SWIGTYPE_p_f_p_switch_core_session__switch_status_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20559,7 +20794,7 @@ public class SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20589,7 +20824,7 @@ public class SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char_p_char__switch } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20619,7 +20854,7 @@ public class SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char__switch_status } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20649,7 +20884,7 @@ public class SWIGTYPE_p_f_p_switch_directory_handle_p_p_char_p_p_char__switch_st } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20679,7 +20914,7 @@ public class SWIGTYPE_p_f_p_switch_directory_handle__switch_status_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20709,7 +20944,7 @@ public class SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20739,7 +20974,7 @@ public class SWIGTYPE_p_f_p_switch_event__switch_status_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20769,7 +21004,7 @@ public class SWIGTYPE_p_f_p_switch_event__void { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20799,7 +21034,7 @@ public class SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_p_q_con } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20829,7 +21064,7 @@ public class SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_q_const } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20859,7 +21094,7 @@ public class SWIGTYPE_p_f_p_switch_file_handle_long_long__switch_status_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20889,7 +21124,7 @@ public class SWIGTYPE_p_f_p_switch_file_handle_p_q_const__char__switch_status_t } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20919,7 +21154,7 @@ public class SWIGTYPE_p_f_p_switch_file_handle_p_unsigned_int_long_long_int__swi } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20949,7 +21184,7 @@ public class SWIGTYPE_p_f_p_switch_file_handle_p_void_p_switch_size_t__switch_st } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -20979,7 +21214,7 @@ public class SWIGTYPE_p_f_p_switch_file_handle__switch_status_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21009,7 +21244,7 @@ public class SWIGTYPE_p_f_p_switch_ivr_dmachine_match__switch_status_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21039,7 +21274,7 @@ public class SWIGTYPE_p_f_p_switch_ivr_menu_p_char_p_char_size_t_p_void__switch_ } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21069,7 +21304,7 @@ public class SWIGTYPE_p_f_p_switch_live_array_s_p_q_const__char_p_q_const__char_ } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21099,7 +21334,7 @@ public class SWIGTYPE_p_f_p_switch_media_bug_p_void_enum_switch_abc_type_t__swit } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21129,7 +21364,7 @@ public class SWIGTYPE_p_f_p_switch_media_bug_p_void__void { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21159,7 +21394,7 @@ public class SWIGTYPE_p_f_p_switch_rtp_p_switch_socket_t_p_void_switch_size_t_p_ } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21189,7 +21424,7 @@ public class SWIGTYPE_p_f_p_switch_scheduler_task__void { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21219,7 +21454,7 @@ public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_double__void { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21249,7 +21484,7 @@ public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_int__void { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21279,7 +21514,7 @@ public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_q_const__char__void { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21309,7 +21544,7 @@ public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_unsigned_long__switch_ } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21339,7 +21574,7 @@ public class SWIGTYPE_p_f_p_switch_speech_handle_p_q_const__char_int_int_p_unsig } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21369,7 +21604,7 @@ public class SWIGTYPE_p_f_p_switch_speech_handle_p_unsigned_long__switch_status_ } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21399,7 +21634,7 @@ public class SWIGTYPE_p_f_p_switch_speech_handle_p_void_p_switch_size_t_p_unsign } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21429,7 +21664,37 @@ public class SWIGTYPE_p_f_p_switch_speech_handle__void { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 + * + * 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_switch_stream_handle_p_int__p_unsigned_char { + private HandleRef swigCPtr; + + internal SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char(IntPtr cPtr, bool futureUse) { + swigCPtr = new HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char() { + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + + internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char 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.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21459,7 +21724,7 @@ public class SWIGTYPE_p_f_p_switch_stream_handle_p_q_const__char_v_______switch_ } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21489,7 +21754,7 @@ public class SWIGTYPE_p_f_p_switch_stream_handle_p_unsigned_char_switch_size_t__ } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21519,7 +21784,7 @@ public class SWIGTYPE_p_f_p_switch_thread_t_p_void__p_void { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21549,7 +21814,7 @@ public class SWIGTYPE_p_f_p_switch_timer_enum_switch_bool_t__switch_status_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21579,7 +21844,7 @@ public class SWIGTYPE_p_f_p_switch_timer__switch_status_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21609,7 +21874,7 @@ public class SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21639,7 +21904,7 @@ public class SWIGTYPE_p_f_p_void_p_q_const__char__int { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21669,7 +21934,7 @@ public class SWIGTYPE_p_f_p_void_p_switch_event__int { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21699,7 +21964,7 @@ public class SWIGTYPE_p_f_p_void__void { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21729,7 +21994,7 @@ public class SWIGTYPE_p_f_uint8_t_p_p_q_const__char_p_void__p_switch_xml { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21759,7 +22024,7 @@ public class SWIGTYPE_p_f_void__p_char { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21789,7 +22054,7 @@ public class SWIGTYPE_p_f_void__switch_status_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21819,7 +22084,7 @@ public class SWIGTYPE_p_in6_addr { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21849,7 +22114,7 @@ public class SWIGTYPE_p_int { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21879,7 +22144,7 @@ public class SWIGTYPE_p_p_apr_pool_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21909,7 +22174,7 @@ public class SWIGTYPE_p_p_char { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21939,7 +22204,7 @@ public class SWIGTYPE_p_p_cJSON { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21969,7 +22234,7 @@ public class SWIGTYPE_p_pid_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -21999,7 +22264,7 @@ public class SWIGTYPE_p_p_payload_map_s { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22029,7 +22294,7 @@ public class SWIGTYPE_p_p_p_char { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22059,7 +22324,7 @@ public class SWIGTYPE_p_p_real_pcre { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22089,7 +22354,7 @@ public class SWIGTYPE_p_p_sqlite3 { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22119,7 +22384,7 @@ public class SWIGTYPE_p_p_sqlite3_stmt { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22149,7 +22414,7 @@ public class SWIGTYPE_p_p_switch_audio_resampler_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22179,7 +22444,7 @@ public class SWIGTYPE_p_p_switch_buffer { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22209,7 +22474,7 @@ public class SWIGTYPE_p_p_switch_cache_db_handle { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22239,7 +22504,7 @@ public class SWIGTYPE_p_p_switch_caller_extension { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22269,7 +22534,7 @@ public class SWIGTYPE_p_p_switch_channel { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22299,7 +22564,7 @@ public class SWIGTYPE_p_p_switch_codec_implementation { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22329,7 +22594,7 @@ public class SWIGTYPE_p_p_switch_console_callback_match { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22359,7 +22624,7 @@ public class SWIGTYPE_p_p_switch_core_port_allocator { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22389,7 +22654,7 @@ public class SWIGTYPE_p_p_switch_core_session { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22419,7 +22684,7 @@ public class SWIGTYPE_p_p_switch_core_session_message { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22449,7 +22714,7 @@ public class SWIGTYPE_p_p_switch_device_record_s { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22479,7 +22744,7 @@ public class SWIGTYPE_p_p_switch_event { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22509,7 +22774,7 @@ public class SWIGTYPE_p_p_switch_event_node { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22539,7 +22804,7 @@ public class SWIGTYPE_p_p_switch_file_handle { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22569,7 +22834,7 @@ public class SWIGTYPE_p_p_switch_frame { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22599,7 +22864,7 @@ public class SWIGTYPE_p_p_switch_hashtable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22629,7 +22894,7 @@ public class SWIGTYPE_p_p_switch_hashtable_iterator { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22659,7 +22924,7 @@ public class SWIGTYPE_p_p_switch_ivr_digit_stream { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22689,7 +22954,7 @@ public class SWIGTYPE_p_p_switch_ivr_digit_stream_parser { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22719,7 +22984,7 @@ public class SWIGTYPE_p_p_switch_ivr_dmachine { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22749,7 +23014,7 @@ public class SWIGTYPE_p_p_switch_ivr_dmachine_match { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22779,7 +23044,7 @@ public class SWIGTYPE_p_p_switch_ivr_menu { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22809,7 +23074,7 @@ public class SWIGTYPE_p_p_switch_ivr_menu_xml_ctx { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22839,7 +23104,7 @@ public class SWIGTYPE_p_p_switch_live_array_s { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22869,7 +23134,7 @@ public class SWIGTYPE_p_p_switch_log_node_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22899,7 +23164,7 @@ public class SWIGTYPE_p_p_switch_media_bug { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22929,7 +23194,7 @@ public class SWIGTYPE_p_p_switch_network_list { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22959,7 +23224,7 @@ public class SWIGTYPE_p_p_switch_rtp { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -22989,7 +23254,7 @@ public class SWIGTYPE_p_p_switch_say_file_handle { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23019,7 +23284,7 @@ public class SWIGTYPE_p_p_switch_sql_queue_manager { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23049,7 +23314,7 @@ public class SWIGTYPE_p_p_switch_thread_data_s { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23079,7 +23344,7 @@ public class SWIGTYPE_p_p_switch_xml_binding { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23109,7 +23374,7 @@ public class SWIGTYPE_p_p_switch_xml { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23139,7 +23404,7 @@ public class SWIGTYPE_p_p_void { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23169,7 +23434,7 @@ public class SWIGTYPE_p_real_pcre { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23199,7 +23464,7 @@ public class SWIGTYPE_p_short { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23229,7 +23494,7 @@ public class SWIGTYPE_p_sockaddr { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23259,7 +23524,7 @@ public class SWIGTYPE_p_sockaddr_in6 { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23289,7 +23554,7 @@ public class SWIGTYPE_p_socklen_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23319,7 +23584,7 @@ public class SWIGTYPE_p_sqlite3 { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23349,7 +23614,7 @@ public class SWIGTYPE_p_sqlite3_stmt { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23379,7 +23644,7 @@ public class SWIGTYPE_p_stfu_instance_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23409,7 +23674,7 @@ public class SWIGTYPE_p_switch_buffer { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23439,7 +23704,7 @@ public class SWIGTYPE_p_switch_cache_db_handle { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23469,7 +23734,7 @@ public class SWIGTYPE_p_switch_call_cause_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23499,7 +23764,7 @@ public class SWIGTYPE_p_switch_channel { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23529,7 +23794,7 @@ public class SWIGTYPE_p_switch_core_port_allocator { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23559,7 +23824,7 @@ public class SWIGTYPE_p_switch_core_session { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23589,7 +23854,7 @@ public class SWIGTYPE_p_switch_event_types_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23619,7 +23884,7 @@ public class SWIGTYPE_p_switch_file_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23649,7 +23914,7 @@ public class SWIGTYPE_p_switch_hashtable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23679,7 +23944,7 @@ public class SWIGTYPE_p_switch_hashtable_iterator { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23709,7 +23974,7 @@ public class SWIGTYPE_p_switch_interval_time_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23739,7 +24004,7 @@ public class SWIGTYPE_p_switch_ivr_action_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23769,7 +24034,7 @@ public class SWIGTYPE_p_switch_ivr_digit_stream { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23799,7 +24064,7 @@ public class SWIGTYPE_p_switch_ivr_digit_stream_parser { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23829,7 +24094,7 @@ public class SWIGTYPE_p_switch_ivr_dmachine { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23859,7 +24124,7 @@ public class SWIGTYPE_p_switch_ivr_menu { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23889,7 +24154,7 @@ public class SWIGTYPE_p_switch_ivr_menu_xml_ctx { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23919,7 +24184,7 @@ public class SWIGTYPE_p_switch_live_array_s { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23949,7 +24214,7 @@ public class SWIGTYPE_p_switch_media_bug { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -23979,7 +24244,7 @@ public class SWIGTYPE_p_switch_mutex_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24009,7 +24274,7 @@ public class SWIGTYPE_p_switch_network_list { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24039,7 +24304,7 @@ public class SWIGTYPE_p_switch_odbc_handle { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24069,7 +24334,7 @@ public class SWIGTYPE_p_switch_pgsql_handle { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24099,7 +24364,7 @@ public class SWIGTYPE_p_switch_pollfd_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24129,7 +24394,7 @@ public class SWIGTYPE_p_switch_queue_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24159,7 +24424,7 @@ public class SWIGTYPE_p_switch_rtcp_frame { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24189,7 +24454,7 @@ public class SWIGTYPE_p_switch_rtp { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24219,7 +24484,7 @@ public class SWIGTYPE_p_switch_rtp_flag_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24249,7 +24514,7 @@ public class SWIGTYPE_p_switch_say_file_handle { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24279,7 +24544,7 @@ public class SWIGTYPE_p_switch_size_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24309,7 +24574,7 @@ public class SWIGTYPE_p_switch_sockaddr_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24339,7 +24604,7 @@ public class SWIGTYPE_p_switch_socket_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24369,7 +24634,7 @@ public class SWIGTYPE_p_switch_sql_queue_manager { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24399,7 +24664,7 @@ public class SWIGTYPE_p_switch_ssize_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24429,7 +24694,7 @@ public class SWIGTYPE_p_switch_thread_rwlock_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24459,7 +24724,7 @@ public class SWIGTYPE_p_switch_thread_start_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24489,7 +24754,7 @@ public class SWIGTYPE_p_switch_time_exp_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24519,7 +24784,7 @@ public class SWIGTYPE_p_switch_time_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24549,7 +24814,7 @@ public class SWIGTYPE_p_switch_xml_binding { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24579,7 +24844,7 @@ public class SWIGTYPE_p_time_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24609,7 +24874,7 @@ public class SWIGTYPE_p_unsigned_char { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24639,7 +24904,7 @@ public class SWIGTYPE_p_unsigned_int { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24669,7 +24934,7 @@ public class SWIGTYPE_p_unsigned_long { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24699,7 +24964,7 @@ public class SWIGTYPE_p_unsigned_short { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24729,7 +24994,7 @@ public class SWIGTYPE_p_void { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24752,7 +25017,7 @@ public enum switch_abc_type_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24896,7 +25161,7 @@ public class switch_api_interface : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -24916,7 +25181,7 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -25080,7 +25345,7 @@ public class switch_application_interface : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -25172,7 +25437,7 @@ public class switch_app_log : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -25192,7 +25457,7 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -25399,7 +25664,7 @@ public class switch_asr_handle : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -25710,7 +25975,7 @@ public class switch_asr_interface : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -25730,7 +25995,7 @@ public enum switch_audio_col_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -25871,7 +26136,7 @@ public class switch_audio_resampler_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -25893,7 +26158,7 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -25909,7 +26174,7 @@ public enum switch_bitpack_mode_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -26090,7 +26355,7 @@ public class switch_bitpack_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -26106,7 +26371,7 @@ public enum switch_bool_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -26188,7 +26453,7 @@ public class switch_cache_db_connection_options_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -26247,7 +26512,7 @@ public class switch_cache_db_core_db_options_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -26264,7 +26529,7 @@ public enum switch_cache_db_handle_type_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -26346,7 +26611,7 @@ public class switch_cache_db_native_handle_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -26425,7 +26690,7 @@ public class switch_cache_db_odbc_options_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -26484,7 +26749,7 @@ public class switch_cache_db_pgsql_options_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -26568,7 +26833,7 @@ public enum switch_call_cause_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -26584,7 +26849,7 @@ public enum switch_call_direction_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -26675,7 +26940,7 @@ public class switch_caller_application : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -26799,7 +27064,7 @@ public class switch_caller_extension : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -27278,7 +27543,7 @@ public class switch_caller_profile : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -27296,7 +27561,7 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -27315,7 +27580,7 @@ public enum switch_channel_app_flag_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -27338,7 +27603,7 @@ public enum switch_channel_callstate_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -27359,7 +27624,7 @@ public enum switch_channel_cap_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -27496,7 +27761,7 @@ public enum switch_channel_flag_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -27524,7 +27789,7 @@ public enum switch_channel_state_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -27716,7 +27981,7 @@ public class switch_channel_timetable : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -27731,7 +27996,7 @@ public enum switch_chat_application_flag_enum_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -27895,7 +28160,7 @@ public class switch_chat_application_interface : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -28019,7 +28284,7 @@ public class switch_chat_interface : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -28196,7 +28461,7 @@ public class switch_codec : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -28219,7 +28484,7 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -28319,7 +28584,7 @@ public class switch_codec_fmtp : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -28573,7 +28838,7 @@ public class switch_codec_implementation : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -28718,7 +28983,7 @@ public class switch_codec_interface : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -28777,7 +29042,7 @@ public class switch_codec_settings : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -28795,7 +29060,7 @@ public enum switch_codec_type_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -28935,7 +29200,7 @@ public class switch_config : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -29026,7 +29291,7 @@ public class switch_console_callback_match : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -29096,7 +29361,7 @@ public class switch_console_callback_match_node : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -29136,7 +29401,7 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -29153,7 +29418,7 @@ public enum switch_core_media_ice_type_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -29395,7 +29660,7 @@ public class switch_core_session_message : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -29412,7 +29677,7 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -29475,7 +29740,7 @@ public enum switch_core_session_message_types_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -29578,7 +29843,7 @@ public class switch_core_thread_session : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -29697,7 +29962,7 @@ public class switch_core_time_duration : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -29842,7 +30107,7 @@ public class switch_device_node_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -30114,7 +30379,7 @@ public class switch_device_record_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -30135,7 +30400,7 @@ public enum switch_device_state_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -30434,7 +30699,7 @@ public class switch_device_stats_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -30558,7 +30823,7 @@ public class switch_dialplan_interface : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -30575,7 +30840,7 @@ public enum switch_digit_action_target_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -30726,6 +30991,16 @@ public class switch_directories : IDisposable { } } + public string cache_dir { + set { + freeswitchPINVOKE.switch_directories_cache_dir_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_directories_cache_dir_get(swigCPtr); + return ret; + } + } + public string recordings_dir { set { freeswitchPINVOKE.switch_directories_recordings_dir_set(swigCPtr, value); @@ -30774,7 +31049,7 @@ public class switch_directories : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -30789,7 +31064,7 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -30881,7 +31156,7 @@ public class switch_directory_handle : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -31049,7 +31324,7 @@ public class switch_directory_interface : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -31065,7 +31340,7 @@ public enum switch_dtmf_direction_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -31084,7 +31359,7 @@ public enum switch_dtmf_source_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -31173,7 +31448,7 @@ public class switch_dtmf_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -31192,7 +31467,7 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -31349,7 +31624,7 @@ public class switch_endpoint_interface : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -31523,7 +31798,7 @@ public class switch_event : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -31540,7 +31815,7 @@ public enum switch_event_flag_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -31649,7 +31924,7 @@ public class switch_event_header : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -31753,7 +32028,7 @@ public enum switch_event_types_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -31786,7 +32061,7 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -32297,7 +32572,7 @@ public class switch_file_handle : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -32529,7 +32804,7 @@ public class switch_file_interface : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -32588,7 +32863,7 @@ public class switch_filenames : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -32835,7 +33110,7 @@ public class switch_frame : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -32861,7 +33136,7 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -32955,7 +33230,256 @@ public class switch_hold_record_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 + * + * 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 switch_http_request_t : IDisposable { + private HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal switch_http_request_t(IntPtr cPtr, bool cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = new HandleRef(this, cPtr); + } + + internal static HandleRef getCPtr(switch_http_request_t obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } + + ~switch_http_request_t() { + Dispose(); + } + + public virtual void Dispose() { + lock(this) { + if (swigCPtr.Handle != IntPtr.Zero) { + if (swigCMemOwn) { + swigCMemOwn = false; + freeswitchPINVOKE.delete_switch_http_request_t(swigCPtr); + } + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + GC.SuppressFinalize(this); + } + } + + public string method { + set { + freeswitchPINVOKE.switch_http_request_t_method_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_http_request_t_method_get(swigCPtr); + return ret; + } + } + + public string uri { + set { + freeswitchPINVOKE.switch_http_request_t_uri_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_http_request_t_uri_get(swigCPtr); + return ret; + } + } + + public string qs { + set { + freeswitchPINVOKE.switch_http_request_t_qs_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_http_request_t_qs_get(swigCPtr); + return ret; + } + } + + public string host { + set { + freeswitchPINVOKE.switch_http_request_t_host_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_http_request_t_host_get(swigCPtr); + return ret; + } + } + + public ushort port { + set { + freeswitchPINVOKE.switch_http_request_t_port_set(swigCPtr, value); + } + get { + ushort ret = freeswitchPINVOKE.switch_http_request_t_port_get(swigCPtr); + return ret; + } + } + + public string from { + set { + freeswitchPINVOKE.switch_http_request_t_from_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_http_request_t_from_get(swigCPtr); + return ret; + } + } + + public string user_agent { + set { + freeswitchPINVOKE.switch_http_request_t_user_agent_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_http_request_t_user_agent_get(swigCPtr); + return ret; + } + } + + public string referer { + set { + freeswitchPINVOKE.switch_http_request_t_referer_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_http_request_t_referer_get(swigCPtr); + return ret; + } + } + + public string user { + set { + freeswitchPINVOKE.switch_http_request_t_user_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_http_request_t_user_get(swigCPtr); + return ret; + } + } + + public switch_bool_t keepalive { + set { + freeswitchPINVOKE.switch_http_request_t_keepalive_set(swigCPtr, (int)value); + } + get { + switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_http_request_t_keepalive_get(swigCPtr); + return ret; + } + } + + public string content_type { + set { + freeswitchPINVOKE.switch_http_request_t_content_type_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_http_request_t_content_type_get(swigCPtr); + return ret; + } + } + + public SWIGTYPE_p_switch_size_t content_length { + set { + freeswitchPINVOKE.switch_http_request_t_content_length_set(swigCPtr, SWIGTYPE_p_switch_size_t.getCPtr(value)); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + } + get { + SWIGTYPE_p_switch_size_t ret = new SWIGTYPE_p_switch_size_t(freeswitchPINVOKE.switch_http_request_t_content_length_get(swigCPtr), true); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public SWIGTYPE_p_switch_size_t bytes_header { + set { + freeswitchPINVOKE.switch_http_request_t_bytes_header_set(swigCPtr, SWIGTYPE_p_switch_size_t.getCPtr(value)); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + } + get { + SWIGTYPE_p_switch_size_t ret = new SWIGTYPE_p_switch_size_t(freeswitchPINVOKE.switch_http_request_t_bytes_header_get(swigCPtr), true); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public SWIGTYPE_p_switch_size_t bytes_read { + set { + freeswitchPINVOKE.switch_http_request_t_bytes_read_set(swigCPtr, SWIGTYPE_p_switch_size_t.getCPtr(value)); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + } + get { + SWIGTYPE_p_switch_size_t ret = new SWIGTYPE_p_switch_size_t(freeswitchPINVOKE.switch_http_request_t_bytes_read_get(swigCPtr), true); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public SWIGTYPE_p_switch_size_t bytes_buffered { + set { + freeswitchPINVOKE.switch_http_request_t_bytes_buffered_set(swigCPtr, SWIGTYPE_p_switch_size_t.getCPtr(value)); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + } + get { + SWIGTYPE_p_switch_size_t ret = new SWIGTYPE_p_switch_size_t(freeswitchPINVOKE.switch_http_request_t_bytes_buffered_get(swigCPtr), true); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public switch_event headers { + set { + freeswitchPINVOKE.switch_http_request_t_headers_set(swigCPtr, switch_event.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_http_request_t_headers_get(swigCPtr); + switch_event ret = (cPtr == IntPtr.Zero) ? null : new switch_event(cPtr, false); + return ret; + } + } + + public SWIGTYPE_p_void user_data { + set { + freeswitchPINVOKE.switch_http_request_t_user_data_set(swigCPtr, SWIGTYPE_p_void.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_http_request_t_user_data_get(swigCPtr); + SWIGTYPE_p_void ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_void(cPtr, false); + return ret; + } + } + + public string _buffer { + set { + freeswitchPINVOKE.switch_http_request_t__buffer_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_http_request_t__buffer_get(swigCPtr); + return ret; + } + } + + public switch_bool_t _destroy_headers { + set { + freeswitchPINVOKE.switch_http_request_t__destroy_headers_set(swigCPtr, (int)value); + } + get { + switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_http_request_t__destroy_headers_get(swigCPtr); + return ret; + } + } + + public switch_http_request_t() : this(freeswitchPINVOKE.new_switch_http_request_t(), true) { + } + +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -32972,7 +33496,7 @@ public enum switch_hup_type_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -33096,7 +33620,7 @@ public class switch_input_args_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -33112,7 +33636,7 @@ public enum switch_input_type_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -33183,7 +33707,7 @@ public class switch_io_event_hook_kill_channel : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -33254,7 +33778,7 @@ public class switch_io_event_hook_outgoing_channel : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -33325,7 +33849,7 @@ public class switch_io_event_hook_read_frame : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -33396,7 +33920,7 @@ public class switch_io_event_hook_receive_event : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -33467,7 +33991,7 @@ public class switch_io_event_hook_receive_message : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -33538,7 +34062,7 @@ public class switch_io_event_hook_recv_dtmf : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -33719,7 +34243,7 @@ public class switch_io_event_hooks : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -33790,7 +34314,7 @@ public class switch_io_event_hook_send_dtmf : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -33861,7 +34385,7 @@ public class switch_io_event_hook_state_change : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -33932,7 +34456,7 @@ public class switch_io_event_hook_state_run : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -34003,7 +34527,7 @@ public class switch_io_event_hook_video_read_frame : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -34074,7 +34598,7 @@ public class switch_io_event_hook_video_write_frame : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -34145,7 +34669,7 @@ public class switch_io_event_hook_write_frame : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -34162,7 +34686,7 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -34187,7 +34711,7 @@ public enum switch_io_routine_name_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -34379,7 +34903,7 @@ public class switch_io_routines : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -34400,7 +34924,7 @@ public enum switch_ivr_action_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -34501,7 +35025,7 @@ public class switch_ivr_dmachine_match : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -34518,7 +35042,7 @@ public enum switch_ivr_menu_flags { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -34535,7 +35059,7 @@ public enum switch_ivr_option_enum_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -34679,7 +35203,7 @@ public class switch_json_api_interface : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -34858,7 +35382,7 @@ public class switch_limit_interface : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -34960,7 +35484,7 @@ public class switch_loadable_module_function_table_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -35227,7 +35751,7 @@ public class switch_loadable_module_interface : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -35261,7 +35785,7 @@ public enum switch_log_level_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -35412,7 +35936,7 @@ public class switch_log_node_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -35429,7 +35953,7 @@ public enum switch_management_action_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -35553,7 +36077,7 @@ public class switch_management_interface : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -35585,7 +36109,7 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -35609,7 +36133,7 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -35625,7 +36149,7 @@ public enum switch_media_type_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -35641,7 +36165,7 @@ public enum switch_module_flag_enum_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -35671,7 +36195,7 @@ public enum switch_module_interface_name_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -35693,7 +36217,29 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 + * + * 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_poll_t { + SWITCH_POLL_READ = (1 << 0), + SWITCH_POLL_WRITE = (1 << 1), + SWITCH_POLL_ERROR = (1 << 2), + SWITCH_POLL_HUP = (1 << 3), + SWITCH_POLL_RDNORM = (1 << 4), + SWITCH_POLL_RDBAND = (1 << 5), + SWITCH_POLL_PRI = (1 << 6), + SWITCH_POLL_INVALID = (1 << 7) +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -35712,7 +36258,7 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -35729,7 +36275,7 @@ public enum switch_priority_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -35745,7 +36291,7 @@ public enum switch_pvt_class_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -35762,7 +36308,7 @@ public enum switch_ring_ready_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -35861,7 +36407,7 @@ public class switch_rtcp_hdr_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -35940,7 +36486,7 @@ public class switch_rtcp_numbers_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -35967,7 +36513,7 @@ public enum switch_rtp_bug_flag_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -35986,7 +36532,7 @@ public enum switch_rtp_crypto_direction_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -36089,7 +36635,7 @@ public class switch_rtp_crypto_key : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -36113,7 +36659,7 @@ public enum switch_rtp_crypto_key_type_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -36167,7 +36713,7 @@ public enum switch_rtp_flag_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -36184,7 +36730,7 @@ public enum switch_rtp_flush_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -36253,7 +36799,7 @@ public class switch_rtp_hdr_ext_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -36392,7 +36938,7 @@ public class switch_rtp_hdr_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -36768,7 +37314,7 @@ public class switch_rtp_numbers_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -36860,7 +37406,7 @@ public class switch_rtp_stats_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -36949,7 +37495,7 @@ public class switch_say_args_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -36967,7 +37513,7 @@ public enum switch_say_gender_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -37102,7 +37648,7 @@ public class switch_say_interface : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -37121,7 +37667,7 @@ public enum switch_say_method_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -37154,7 +37700,7 @@ public enum switch_say_type_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -37172,7 +37718,7 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -37302,7 +37848,7 @@ public class switch_scheduler_task : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -37318,7 +37864,7 @@ public enum switch_sdp_type_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -37387,7 +37933,7 @@ public class switch_serial_event_header_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -37496,7 +38042,7 @@ public class switch_serial_event_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -37553,7 +38099,7 @@ public enum switch_session_ctl_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -37571,7 +38117,7 @@ public enum switch_signal_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -37663,7 +38209,7 @@ public class switch_slin_data : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -37685,7 +38231,7 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -37932,7 +38478,7 @@ public class switch_speech_handle : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -38133,7 +38679,7 @@ public class switch_speech_interface : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -38212,7 +38758,7 @@ public class switch_srtp_crypto_suite_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -38231,7 +38777,7 @@ public enum switch_stack_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -38246,7 +38792,7 @@ public enum switch_state_handler_flag_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -38272,7 +38818,7 @@ public enum switch_state_handler_name_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -38474,7 +39020,7 @@ public class switch_state_handler_table : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -38513,7 +39059,7 @@ public enum switch_status_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -38554,6 +39100,17 @@ public class switch_stream_handle : IDisposable { } } + public SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char read_function { + set { + freeswitchPINVOKE.switch_stream_handle_read_function_set(swigCPtr, SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_stream_handle_read_function_get(swigCPtr); + SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char(cPtr, false); + return ret; + } + } + public SWIGTYPE_p_f_p_switch_stream_handle_p_q_const__char_v_______switch_status_t write_function { set { freeswitchPINVOKE.switch_stream_handle_write_function_set(swigCPtr, SWIGTYPE_p_f_p_switch_stream_handle_p_q_const__char_v_______switch_status_t.getCPtr(value)); @@ -38665,7 +39222,7 @@ public class switch_stream_handle : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -38864,7 +39421,7 @@ public class switch_t38_options_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -38882,7 +39439,7 @@ public enum switch_text_channel_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -38975,7 +39532,7 @@ public class switch_thread_data_t : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -38993,7 +39550,7 @@ public enum switch_thread_priority_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -39139,7 +39696,7 @@ public class switch_timer : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -39154,7 +39711,7 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -39174,7 +39731,7 @@ public enum switch_timer_func_name_t { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -39353,7 +39910,7 @@ public class switch_timer_interface : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -39570,7 +40127,7 @@ public class switch_unicast_conninfo : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -39588,7 +40145,7 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -39605,7 +40162,7 @@ public enum switch_uri_flags { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -39623,7 +40180,86 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 + * + * 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 switch_waitlist_t : IDisposable { + private HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal switch_waitlist_t(IntPtr cPtr, bool cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = new HandleRef(this, cPtr); + } + + internal static HandleRef getCPtr(switch_waitlist_t obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } + + ~switch_waitlist_t() { + Dispose(); + } + + public virtual void Dispose() { + lock(this) { + if (swigCPtr.Handle != IntPtr.Zero) { + if (swigCMemOwn) { + swigCMemOwn = false; + freeswitchPINVOKE.delete_switch_waitlist_t(swigCPtr); + } + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + GC.SuppressFinalize(this); + } + } + + public int sock { + set { + freeswitchPINVOKE.switch_waitlist_t_sock_set(swigCPtr, value); + } + get { + int ret = freeswitchPINVOKE.switch_waitlist_t_sock_get(swigCPtr); + return ret; + } + } + + public uint events { + set { + freeswitchPINVOKE.switch_waitlist_t_events_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_waitlist_t_events_get(swigCPtr); + return ret; + } + } + + public uint revents { + set { + freeswitchPINVOKE.switch_waitlist_t_revents_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_waitlist_t_revents_get(swigCPtr); + return ret; + } + } + + public switch_waitlist_t() : this(freeswitchPINVOKE.new_switch_waitlist_t(), true) { + } + +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -39808,7 +40444,7 @@ public class switch_xml : IDisposable { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. @@ -39826,7 +40462,7 @@ namespace FreeSWITCH.Native { } /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). - * Version 2.0.12 + * Version 2.0.7 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. diff --git a/src/mod/languages/mod_perl/mod_perl_wrap.cpp b/src/mod/languages/mod_perl/mod_perl_wrap.cpp index e581200ba4..8784ad7060 100644 --- a/src/mod/languages/mod_perl/mod_perl_wrap.cpp +++ b/src/mod/languages/mod_perl/mod_perl_wrap.cpp @@ -10593,17 +10593,17 @@ XS(SWIG_init) { SWIG_TypeClientData(SWIGTYPE_p_IVRMenu, (void*) "freeswitch::IVRMenu"); SWIG_TypeClientData(SWIGTYPE_p_API, (void*) "freeswitch::API"); SWIG_TypeClientData(SWIGTYPE_p_input_callback_state, (void*) "freeswitch::input_callback_state_t"); - /*@SWIG:/usr/local/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + /*@SWIG://share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "S_HUP", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_HUP))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/local/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + /*@SWIG://share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "S_FREE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_FREE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/local/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + /*@SWIG://share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "S_RDLOCK", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_RDLOCK))); SvREADONLY_on(sv); From 37d7fb7888140aa2a6be66b0c5987da3ba201b9f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 10 Sep 2014 04:16:56 +0500 Subject: [PATCH 73/77] calculate jitter percentage in jitterbuffer to factor into conditions for reducing the size when in adaptave mode --- src/include/switch_stfu.h | 2 + src/switch_rtp.c | 8 ++-- src/switch_stfu.c | 91 +++++++++++++++++++++++++++++---------- 3 files changed, 76 insertions(+), 25 deletions(-) diff --git a/src/include/switch_stfu.h b/src/include/switch_stfu.h index 1af6b23010..7bc2c766dc 100644 --- a/src/include/switch_stfu.h +++ b/src/include/switch_stfu.h @@ -172,6 +172,8 @@ typedef struct { uint32_t clean_count; uint32_t consecutive_good_count; uint32_t consecutive_bad_count; + double period_jitter_percent; + double period_missing_percent; } stfu_report_t; typedef void (*stfu_n_call_me_t)(stfu_instance_t *i, void *); diff --git a/src/switch_rtp.c b/src/switch_rtp.c index a2264d2e15..eb9e7de49c 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -3585,13 +3585,15 @@ static void jb_callback(stfu_instance_t *i, void *udata) stfu_n_report(i, &r); switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG8, - "%s JB REPORT:\nlen: %u\nin: %u\nclean: %u\ngood: %u\nbad: %u\n", + "%s JB REPORT:\nlen: %u\nin: %u\nclean: %u\ngood: %u\nbad: %u\njitter percent %0.2f\nmissing percent %0.2f\n\n", switch_core_session_get_name(session), r.qlen, r.packet_in_count, r.clean_count, r.consecutive_good_count, - r.consecutive_bad_count + r.consecutive_bad_count, + r.period_jitter_percent, + r.period_missing_percent ); } @@ -3646,7 +3648,7 @@ static void jb_logger(const char *file, const char *func, int line, int level, c va_start(ap, fmt); ret = switch_vasprintf(&data, fmt, ap); if (ret != -1) { - switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_CONSOLE, "%s", data); + switch_log_printf(SWITCH_CHANNEL_ID_LOG_CLEAN, file, func, line, NULL, SWITCH_LOG_CONSOLE, "%d: %s", line, data); free(data); } diff --git a/src/switch_stfu.c b/src/switch_stfu.c index 5bb5f50afe..169deda326 100644 --- a/src/switch_stfu.c +++ b/src/switch_stfu.c @@ -48,6 +48,9 @@ #define least1(_z) (_z ? _z : 1) +#define PERIOD_SECONDS 20 +#define PERIOD_JITTER_TOLERANCE 5.0f + static int stfu_log_level = 7; struct stfu_queue { @@ -74,6 +77,7 @@ struct stfu_instance { uint16_t cur_seq; uint32_t last_wr_ts; uint32_t last_rd_ts; + uint32_t ms_per_packet; uint32_t samples_per_packet; uint32_t samples_per_second; uint32_t miss_count; @@ -93,7 +97,9 @@ struct stfu_instance { uint32_t period_need_range; uint32_t period_need_range_avg; uint32_t period_clean_count; - + uint32_t period_jitter_count; + double period_jitter_percent; + double period_missing_percent; uint32_t session_clean_count; uint32_t session_missing_count; @@ -114,7 +120,6 @@ struct stfu_instance { int32_t same_ts; uint32_t period_time; - uint32_t decrement_time; uint32_t plc_len; uint32_t plc_pt; @@ -123,6 +128,8 @@ struct stfu_instance { uint8_t ready; uint8_t debug; + switch_time_t last_clock_ts; + char *name; stfu_n_call_me_t callback; void *udata; @@ -239,6 +246,8 @@ void stfu_n_report(stfu_instance_t *i, stfu_report_t *r) r->clean_count = i->period_clean_count; r->consecutive_good_count = i->consecutive_good_count; r->consecutive_bad_count = i->consecutive_bad_count; + r->period_jitter_percent = i->period_jitter_percent; + r->period_missing_percent = i->period_missing_percent; } stfu_status_t stfu_n_resize(stfu_instance_t *i, uint32_t qlen) @@ -248,7 +257,7 @@ stfu_status_t stfu_n_resize(stfu_instance_t *i, uint32_t qlen) if (i->qlen == i->max_qlen) { return STFU_IT_FAILED; } - + if (i->max_qlen && qlen > i->max_qlen) { if (i->qlen < i->max_qlen) { qlen = i->max_qlen; @@ -304,8 +313,7 @@ stfu_instance_t *stfu_n_init(uint32_t qlen, uint32_t max_qlen, uint32_t samples_ i->samples_per_second = samples_per_second ? samples_per_second : 8000; - i->period_time = ((i->samples_per_second * 20) / i->samples_per_packet); - i->decrement_time = ((i->samples_per_second * 15) / i->samples_per_packet); + i->period_time = ((i->samples_per_second * PERIOD_SECONDS) / i->samples_per_packet); return i; } @@ -316,6 +324,8 @@ static void stfu_n_reset_counters(stfu_instance_t *i) stfu_log(STFU_LOG_EMERG, "%s COUNTER RESET........\n", i->name); } + + if (i->callback) { i->callback(i, i->udata); } @@ -328,6 +338,7 @@ static void stfu_n_reset_counters(stfu_instance_t *i) i->period_packet_in_count = 0; i->period_packet_out_count = 0; i->period_missing_count = 0; + i->period_jitter_count = 0; i->period_need_range = 0; i->period_need_range_avg = 0; @@ -408,6 +419,9 @@ stfu_status_t stfu_n_add_data(stfu_instance_t *i, uint32_t ts, uint16_t seq, uin stfu_frame_t *frame; size_t cplen = 0; int good_ts = 0; + int32_t diff; + switch_time_t now; + if (!i->samples_per_packet && ts && i->last_rd_ts) { i->ts_diff = ts - i->last_rd_ts; @@ -430,7 +444,25 @@ stfu_status_t stfu_n_add_data(stfu_instance_t *i, uint32_t ts, uint16_t seq, uin return STFU_IT_FAILED; } } - + + if (!i->ms_per_packet) { + i->ms_per_packet = 1000 / (i->samples_per_second / i->samples_per_packet); + } + + now = switch_micro_time_now(); + + if (i->last_clock_ts) { + diff = (uint32_t) ((now - i->last_clock_ts) / 1000); + } else { + diff = 0; + } + + i->last_clock_ts = now; + + if (abs(diff - i->ms_per_packet) > 1) { + i->period_jitter_count++; + } + if (timer_ts) { if (ts && !i->ts_offset) { i->ts_offset = timer_ts - ts; @@ -448,7 +480,8 @@ stfu_status_t stfu_n_add_data(stfu_instance_t *i, uint32_t ts, uint16_t seq, uin if (i->ts_drift < i->max_drift) { if (++i->drift_dropped_packets < i->drift_max_dropped) { stfu_log(STFU_LOG_EMERG, "%s TOO LATE !!! %u \n\n\n", i->name, ts); - stfu_n_sync(i, 1); + stfu_n_reset(i); + //stfu_n_sync(i, 1); //return STFU_ITS_TOO_LATE; } } else { @@ -489,16 +522,10 @@ stfu_status_t stfu_n_add_data(stfu_instance_t *i, uint32_t ts, uint16_t seq, uin if (i->period_missing_count > i->qlen * 2) { if (stfu_log != null_logger && i->debug) { - stfu_log(STFU_LOG_EMERG, "%s resize %u %u\n", i->name, i->qlen, i->qlen + 1); + stfu_log(STFU_LOG_EMERG, "%s resize up %u %u\n", i->name, i->qlen, i->qlen + 1); } stfu_n_resize(i, i->qlen + 1); stfu_n_reset_counters(i); - } else { - if (i->qlen > i->orig_qlen && (i->consecutive_good_count > i->decrement_time || i->period_clean_count > i->decrement_time)) { - stfu_n_resize(i, i->qlen - 1); - stfu_n_reset_counters(i); - stfu_n_sync(i, i->qlen); - } } @@ -514,10 +541,20 @@ stfu_status_t stfu_n_add_data(stfu_instance_t *i, uint32_t ts, uint16_t seq, uin i->diff_total += i->diff; - if ((i->period_packet_in_count > i->period_time)) { + if ((i->period_packet_in_count >= i->period_time)) { + i->period_jitter_percent = (double)(((double)i->period_jitter_count / (double)i->period_time) * 100.0f); + i->period_missing_percent = (double)(((double)i->period_missing_count / (double)i->period_time) * 100.0f); + i->period_packet_in_count = 0; - if (i->period_missing_count == 0 && i->qlen > i->orig_qlen) { + if (stfu_log != null_logger && i->debug) { + stfu_log(STFU_LOG_EMERG, "PERIOD %f jitter missing:%f q:%d/%d\n", i->period_jitter_percent, i->period_missing_percent, i->qlen, i->orig_qlen); + } + + if (i->qlen > i->orig_qlen && i->period_jitter_percent < PERIOD_JITTER_TOLERANCE && i->period_missing_percent < PERIOD_JITTER_TOLERANCE) { + if (stfu_log != null_logger && i->debug) { + stfu_log(STFU_LOG_EMERG, "%s resize down %u %u\n", i->name, i->qlen, i->qlen - 1); + } stfu_n_resize(i, i->qlen - 1); stfu_n_sync(i, i->qlen); } @@ -526,12 +563,22 @@ stfu_status_t stfu_n_add_data(stfu_instance_t *i, uint32_t ts, uint16_t seq, uin } if (stfu_log != null_logger && i->debug) { - stfu_log(STFU_LOG_EMERG, "I: %s %u/%u i=%u/%u - g:%u/%u c:%u/%u b:%u - %u:%u - %u %d %u %u %d %d %d/%d\n", i->name, - i->qlen, i->max_qlen, i->period_packet_in_count, i->period_time, i->consecutive_good_count, - i->decrement_time, i->period_clean_count, i->decrement_time, i->consecutive_bad_count, + double jitter_percent = (double)(((double)i->period_jitter_count / (double)i->period_packet_in_count) * 100.0f); + double missing_percent = (double)(((double)i->period_missing_count / (double)i->period_packet_in_count) * 100.0f); + + stfu_log(STFU_LOG_EMERG, "I: %s len:%u/%u i=%u/%u - g:%u c:%u b:%u - ts:%u/%u/%u - m:%u(%f%%) j:%f%% dr:%d/%d\n", + i->name, + i->qlen, i->max_qlen, + i->period_packet_in_count, i->period_time, + i->consecutive_good_count, + i->period_clean_count, + i->consecutive_bad_count, ts, ts / i->samples_per_packet, - i->period_missing_count, i->period_need_range_avg, - i->last_wr_ts, ts, i->diff, i->diff_total / least1(i->period_packet_in_count), i->ts_drift, i->max_drift); + i->last_wr_ts, + i->period_missing_count, + missing_percent, + jitter_percent, + i->ts_drift, i->max_drift); } if (last || i->in_queue->array_len == i->in_queue->array_size) { @@ -763,7 +810,7 @@ stfu_frame_t *stfu_n_read_a_frame(stfu_instance_t *i) if (stfu_log != null_logger && i->debug) { if (found) { - stfu_log(STFU_LOG_EMERG, "%s O: %u:%u %u\n", i->name, rframe->ts, rframe->ts / i->samples_per_packet, rframe->plc); + stfu_log(STFU_LOG_EMERG, "%s OUT: %u:%u %u\n", i->name, rframe->ts, rframe->ts / i->samples_per_packet, rframe->plc); } } From 77c99b630697f53c7ccb5a8cf024155678c90c60 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 10 Sep 2014 20:32:36 +0500 Subject: [PATCH 74/77] FS-6806 #resolve #comment off by 1 error in last fix --- src/mod/endpoints/mod_sofia/sofia_presence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index a48e00fcbd..a7e4e6f78f 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -2140,7 +2140,7 @@ uint32_t sofia_presence_get_cseq(sofia_profile_t *profile) if (profile->last_cseq) { diff = callsequence - profile->last_cseq; - if (diff < 0 && diff > -100000) { + if (diff <= 0 && diff > -100000) { callsequence = ++profile->last_cseq; } } From 7b390eece7af860a0d4f70640a3652015176d94f Mon Sep 17 00:00:00 2001 From: Brian West Date: Wed, 10 Sep 2014 12:35:30 -0500 Subject: [PATCH 75/77] jitteron for testing --- support-d/.bashrc | 1 + 1 file changed, 1 insertion(+) diff --git a/support-d/.bashrc b/support-d/.bashrc index ce221896bf..0a2e679c37 100644 --- a/support-d/.bashrc +++ b/support-d/.bashrc @@ -64,4 +64,5 @@ alias fstop='top -p `cat /usr/local/freeswitch/run/freeswitch.pid`' alias fsgdb='gdb /usr/local/freeswitch/bin/freeswitch `cat /usr/local/freeswitch/run/freeswitch.pid`' alias fscore='gdb /usr/local/freeswitch/bin/freeswitch `ls -rt core.* | tail -n1`' alias emacs='emacs -nw' +alias jitteron='tc qdisc add dev eth0 root handle 1: netem delay 40ms 20ms ; tc qdisc add dev eth0 parent 1:1 pfifo limit 1000' # End of file From 6752c00860668924a553457645aa7912a65cd8d7 Mon Sep 17 00:00:00 2001 From: Brian West Date: Wed, 10 Sep 2014 12:48:16 -0500 Subject: [PATCH 76/77] jitteroff --- support-d/.bashrc | 1 + 1 file changed, 1 insertion(+) diff --git a/support-d/.bashrc b/support-d/.bashrc index 0a2e679c37..727f26b652 100644 --- a/support-d/.bashrc +++ b/support-d/.bashrc @@ -65,4 +65,5 @@ alias fsgdb='gdb /usr/local/freeswitch/bin/freeswitch `cat /usr/local/freeswitch alias fscore='gdb /usr/local/freeswitch/bin/freeswitch `ls -rt core.* | tail -n1`' alias emacs='emacs -nw' alias jitteron='tc qdisc add dev eth0 root handle 1: netem delay 40ms 20ms ; tc qdisc add dev eth0 parent 1:1 pfifo limit 1000' +alias jitteroff='tc qdisc del dev eth0 root netem' # End of file From 908dd26559852ab91d96f2291b136c29f6110ead Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 10 Sep 2014 14:09:32 -0400 Subject: [PATCH 77/77] FS-6815 #comment force 1600hz for native g722 --- src/mod/formats/mod_native_file/mod_native_file.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mod/formats/mod_native_file/mod_native_file.c b/src/mod/formats/mod_native_file/mod_native_file.c index b875e82c22..d2db2b1b52 100644 --- a/src/mod/formats/mod_native_file/mod_native_file.c +++ b/src/mod/formats/mod_native_file/mod_native_file.c @@ -83,6 +83,13 @@ static switch_status_t native_file_file_open(switch_file_handle_t *handle, const handle->samples = 0; handle->samplerate = 8000; + + if (ext) { + if (!strcasecmp(ext, "G722")) { + handle->samplerate = 16000; + } + } + handle->channels = 1; handle->format = 0; handle->sections = 0;