From anthm at freeswitch.org Mon Dec 1 08:21:28 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Mon, 01 Dec 2008 11:21:28 -0500 Subject: [Freeswitch-svn] [commit] r10559 - freeswitch/trunk/src Message-ID: Author: anthm Date: Mon Dec 1 11:21:27 2008 New Revision: 10559 Log: FSCORE-240 Modified: freeswitch/trunk/src/switch_core_session.c freeswitch/trunk/src/switch_ivr.c freeswitch/trunk/src/switch_ivr_originate.c Modified: freeswitch/trunk/src/switch_core_session.c ============================================================================== --- freeswitch/trunk/src/switch_core_session.c (original) +++ freeswitch/trunk/src/switch_core_session.c Mon Dec 1 11:21:27 2008 @@ -441,6 +441,7 @@ "SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ", "SWITCH_MESSAGE_INDICATE_DISPLAY", "SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY", + "SWITCH_MESSAGE_INDICATE_AUDIO_SYNC", "SWITCH_MESSAGE_INVALID" }; Modified: freeswitch/trunk/src/switch_ivr.c ============================================================================== --- freeswitch/trunk/src/switch_ivr.c (original) +++ freeswitch/trunk/src/switch_ivr.c Mon Dec 1 11:21:27 2008 @@ -52,7 +52,13 @@ cng_frame.buflen = 2; switch_set_flag((&cng_frame), SFF_CNG); - switch_channel_audio_sync(channel); + if (!switch_channel_test_flag(channel, CF_PROXY_MODE)) { + switch_channel_audio_sync(channel); + } + + if (!ms) { + return SWITCH_STATUS_SUCCESS; + } for (;;) { now = switch_timestamp_now(); Modified: freeswitch/trunk/src/switch_ivr_originate.c ============================================================================== --- freeswitch/trunk/src/switch_ivr_originate.c (original) +++ freeswitch/trunk/src/switch_ivr_originate.c Mon Dec 1 11:21:27 2008 @@ -39,12 +39,6 @@ { switch_channel_t *channel = switch_core_session_get_channel(session); - if (!switch_channel_test_flag(channel, CF_PROXY_MODE)) { - while (switch_channel_get_state(channel) == CS_CONSUME_MEDIA && !switch_channel_test_flag(channel, CF_TAGGED)) { - switch_ivr_sleep(session, 10, NULL); - } - } - switch_channel_clear_state_handler(channel, &originate_state_handlers); return SWITCH_STATUS_FALSE; @@ -97,6 +91,8 @@ return NULL; } + switch_ivr_sleep(collect->session, 0, NULL); + if (!strcasecmp(collect->key, "exec")) { char *data; switch_application_interface_t *application_interface; @@ -1680,6 +1676,13 @@ *bleg = NULL; } + if (*bleg) { + switch_ivr_sleep(*bleg, 0, NULL); + } + + if (session) { + switch_ivr_sleep(session, 0, NULL); + } if (var_event) { switch_event_destroy(&var_event); From anthm at freeswitch.org Mon Dec 1 08:53:08 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Mon, 01 Dec 2008 11:53:08 -0500 Subject: [Freeswitch-svn] [commit] r10560 - freeswitch/trunk/src/mod/xml_int/mod_xml_cdr Message-ID: Author: anthm Date: Mon Dec 1 11:53:07 2008 New Revision: 10560 Log: FSCORE-238 Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c ============================================================================== --- freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c (original) +++ freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c Mon Dec 1 11:53:07 2008 @@ -33,10 +33,13 @@ #include #include #include +#define MAX_URLS 20 static struct { char *cred; - char *url; + char *urls[MAX_URLS+1]; + int url_count; + int url_index; char *log_dir; char *err_log_dir; uint32_t delay; @@ -47,6 +50,7 @@ int log_b; int prefix_a; int disable100continue; + switch_memory_pool_t *pool; } globals; SWITCH_MODULE_LOAD_FUNCTION(mod_xml_cdr_load); @@ -128,7 +132,7 @@ } /* try to post it to the web server */ - if (!switch_strlen_zero(globals.url)) { + if (globals.url_count) { curl_handle = curl_easy_init(); if (globals.encode) { @@ -150,11 +154,6 @@ headers = curl_slist_append(headers, "Content-Type: application/x-www-form-plaintext"); } - if (!strncasecmp(globals.url, "https", 5)) { - curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, 0); - curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYHOST, 0); - } - if (!(curl_xml_text = switch_mprintf("cdr=%s", xml_text))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n"); goto error; @@ -168,7 +167,6 @@ curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(curl_handle, CURLOPT_POST, 1); curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDS, curl_xml_text); - curl_easy_setopt(curl_handle, CURLOPT_URL, globals.url); curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "freeswitch-xml/1.0"); curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, httpCallBack); @@ -190,12 +188,26 @@ if (cur_try > 0) { switch_yield(globals.delay * 1000000); } + + curl_easy_setopt(curl_handle, CURLOPT_URL, globals.urls[globals.url_index]); + + if (!strncasecmp(globals.urls[globals.url_index], "https", 5)) { + curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, 0); + curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYHOST, 0); + } + curl_easy_perform(curl_handle); curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &httpRes); if (httpRes == 200) { goto success; } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Got error [%ld] posting to web server [%s]\n", httpRes, globals.url); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Got error [%ld] posting to web server [%s]\n", + httpRes, globals.urls[globals.url_index]); + globals.url_index++; + if (globals.url_index >= globals.url_count) { + globals.url_index = 0; + } + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Retry will be with url [%s]\n", globals.urls[globals.url_index]); } } curl_easy_cleanup(curl_handle); @@ -270,6 +282,7 @@ memset(&globals, 0, sizeof(globals)); globals.log_b = 1; globals.disable100continue = 0; + globals.pool = pool; /* parse the config */ if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) { @@ -283,9 +296,13 @@ char *val = (char *) switch_xml_attr_soft(param, "value"); if (!strcasecmp(var, "cred") && !switch_strlen_zero(val)) { - globals.cred = strdup(val); + globals.cred = switch_core_strdup(globals.pool, val); } else if (!strcasecmp(var, "url") && !switch_strlen_zero(val)) { - globals.url = strdup(val); + if (globals.url_count >= MAX_URLS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "maximum urls configured!\n"); + } else { + globals.urls[globals.url_count++] = switch_core_strdup(globals.pool, val); + } } else if (!strcasecmp(var, "delay") && !switch_strlen_zero(val)) { globals.delay = (uint32_t) atoi(val); } else if (!strcasecmp(var, "log-b-leg")) { @@ -307,7 +324,7 @@ globals.log_dir = switch_mprintf("%s%sxml_cdr", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR); } else { if (switch_is_file_path(val)) { - globals.log_dir = strdup(val); + globals.log_dir = switch_core_strdup(globals.pool, val); } else { globals.log_dir = switch_mprintf("%s%s%s", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR, val); } @@ -317,7 +334,7 @@ globals.err_log_dir = switch_mprintf("%s%sxml_cdr", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR); } else { if (switch_is_file_path(val)) { - globals.err_log_dir = strdup(val); + globals.err_log_dir = switch_core_strdup(globals.pool, val); } else { globals.err_log_dir = switch_mprintf("%s%s%s", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR, val); } @@ -328,9 +345,9 @@ if (switch_strlen_zero(globals.err_log_dir)) { if (!switch_strlen_zero(globals.log_dir)) { - globals.err_log_dir = strdup(globals.log_dir); + globals.err_log_dir = switch_core_strdup(globals.pool, globals.log_dir); } else { - globals.err_log_dir = switch_mprintf("%s%sxml_cdr", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR); + globals.err_log_dir = switch_core_sprintf(globals.pool, "%s%sxml_cdr", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR); } } } From anthm at freeswitch.org Mon Dec 1 11:40:54 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Mon, 01 Dec 2008 14:40:54 -0500 Subject: [Freeswitch-svn] [commit] r10561 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Mon Dec 1 14:40:53 2008 New Revision: 10561 Log: parse replaces out of refer-to better Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Mon Dec 1 14:40:53 2008 @@ -3170,6 +3170,7 @@ } if ((refer_to = sip->sip_refer_to)) { + char *rep; full_ref_to = sip_header_as_string(home, (void *) sip->sip_refer_to); if (profile->pflags & PFLAG_FULL_ID) { @@ -3180,10 +3181,9 @@ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Process REFER to [%s@%s]\n", exten, (char *) refer_to->r_url->url_host); - if (refer_to->r_url->url_headers && strstr(refer_to->r_url->url_headers, "Replaces=")) { + if (refer_to->r_url->url_headers && (rep = (char *)switch_stristr("Replaces=", refer_to->r_url->url_headers))) { sip_replaces_t *replaces; nua_handle_t *bnh; - char *rep; if (switch_channel_test_flag(channel_a, CF_PROXY_MODE)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot Attended Transfer BYPASS MEDIA CALLS!\n"); @@ -3192,13 +3192,18 @@ NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden"), SIPTAG_EVENT_STR(etmp), TAG_END()); goto done; } - - if ((rep = strchr(refer_to->r_url->url_headers, '='))) { + + if (rep) { const char *br_a = NULL, *br_b = NULL; char *buf; + char *p; - rep++; + rep = switch_core_session_strdup(session, rep + 9); + if ((p = strchr(rep, ';'))) { + *p = '\0'; + } + if ((buf = switch_core_session_alloc(session, strlen(rep) + 1))) { rep = url_unescape(buf, (const char *) rep); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Replaces: [%s]\n", rep); From brian at freeswitch.org Mon Dec 1 11:52:22 2008 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Mon, 01 Dec 2008 14:52:22 -0500 Subject: [Freeswitch-svn] [commit] r10562 - freeswitch/trunk/conf/sip_profiles Message-ID: Author: brian Date: Mon Dec 1 14:52:22 2008 New Revision: 10562 Log: document force-register-db-domain ... I do not know how I missed this Modified: freeswitch/trunk/conf/sip_profiles/external.xml freeswitch/trunk/conf/sip_profiles/internal-ipv6.xml freeswitch/trunk/conf/sip_profiles/internal.xml Modified: freeswitch/trunk/conf/sip_profiles/external.xml ============================================================================== --- freeswitch/trunk/conf/sip_profiles/external.xml (original) +++ freeswitch/trunk/conf/sip_profiles/external.xml Mon Dec 1 14:52:22 2008 @@ -39,6 +39,8 @@ + + Modified: freeswitch/trunk/conf/sip_profiles/internal-ipv6.xml ============================================================================== --- freeswitch/trunk/conf/sip_profiles/internal-ipv6.xml (original) +++ freeswitch/trunk/conf/sip_profiles/internal-ipv6.xml Mon Dec 1 14:52:22 2008 @@ -102,7 +102,9 @@ - + + + Modified: freeswitch/trunk/conf/sip_profiles/internal.xml ============================================================================== --- freeswitch/trunk/conf/sip_profiles/internal.xml (original) +++ freeswitch/trunk/conf/sip_profiles/internal.xml Mon Dec 1 14:52:22 2008 @@ -145,7 +145,9 @@ - + + + From mikej at freeswitch.org Mon Dec 1 13:41:18 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Mon, 01 Dec 2008 16:41:18 -0500 Subject: [Freeswitch-svn] [commit] r10563 - in freeswitch/trunk/src/mod/languages/mod_managed: . managed Message-ID: Author: mikej Date: Mon Dec 1 16:41:17 2008 New Revision: 10563 Log: swigall Modified: freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs Modified: freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx (original) +++ freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx Mon Dec 1 16:41:17 2008 @@ -17902,6 +17902,14 @@ } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_audio_sync(void * jarg1) { + switch_channel_t *arg1 = (switch_channel_t *) 0 ; + + arg1 = (switch_channel_t *)jarg1; + switch_channel_audio_sync(arg1); +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_buffer_create(void * jarg1, void * jarg2, void * jarg3) { int jresult ; switch_memory_pool_t *arg1 = (switch_memory_pool_t *) 0 ; @@ -21993,6 +22001,14 @@ } +SWIGEXPORT void SWIGSTDCALL CSharp_rtp_flush_read_buffer(void * jarg1) { + switch_rtp_t *arg1 = (switch_rtp_t *) 0 ; + + arg1 = (switch_rtp_t *)jarg1; + rtp_flush_read_buffer(arg1); +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_enable_vad(void * jarg1, void * jarg2, void * jarg3, unsigned long jarg4) { int jresult ; switch_rtp_t *arg1 = (switch_rtp_t *) 0 ; Modified: freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs (original) +++ freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs Mon Dec 1 16:41:17 2008 @@ -2515,6 +2515,10 @@ return ret; } + public static void switch_channel_audio_sync(SWIGTYPE_p_switch_channel channel) { + freeswitchPINVOKE.switch_channel_audio_sync(SWIGTYPE_p_switch_channel.getCPtr(channel)); + } + public static switch_status_t switch_buffer_create(SWIGTYPE_p_apr_pool_t pool, SWIGTYPE_p_p_switch_buffer buffer, SWIGTYPE_p_switch_size_t max_len) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_buffer_create(SWIGTYPE_p_apr_pool_t.getCPtr(pool), SWIGTYPE_p_p_switch_buffer.getCPtr(buffer), SWIGTYPE_p_switch_size_t.getCPtr(max_len)); if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); @@ -3390,6 +3394,10 @@ return ret; } + public static void rtp_flush_read_buffer(SWIGTYPE_p_switch_rtp rtp_session) { + freeswitchPINVOKE.rtp_flush_read_buffer(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session)); + } + public static switch_status_t switch_rtp_enable_vad(SWIGTYPE_p_switch_rtp rtp_session, SWIGTYPE_p_switch_core_session session, switch_codec codec, uint flags) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_enable_vad(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), SWIGTYPE_p_switch_core_session.getCPtr(session), switch_codec.getCPtr(codec), flags); return ret; @@ -8495,6 +8503,9 @@ [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_set_timestamps")] public static extern int switch_channel_set_timestamps(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_audio_sync")] + public static extern void switch_channel_audio_sync(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_buffer_create")] public static extern int switch_buffer_create(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3); @@ -9353,6 +9364,9 @@ [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_zerocopy_read_frame")] public static extern int switch_rtp_zerocopy_read_frame(HandleRef jarg1, HandleRef jarg2, uint jarg3); + [DllImport("mod_managed", EntryPoint="CSharp_rtp_flush_read_buffer")] + public static extern void rtp_flush_read_buffer(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_enable_vad")] public static extern int switch_rtp_enable_vad(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3, uint jarg4); @@ -16801,7 +16815,7 @@ CF_PROXY_MODE = (1 << 13), CF_SUSPEND = (1 << 14), CF_EVENT_PARSE = (1 << 15), - CF_REPEAT_STATE = (1 << 16), + CF_USE_ME = (1 << 16), CF_GEN_RINGBACK = (1 << 17), CF_RING_READY = (1 << 18), CF_BREAK = (1 << 19), @@ -18309,6 +18323,7 @@ SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ, SWITCH_MESSAGE_INDICATE_DISPLAY, SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY, + SWITCH_MESSAGE_INDICATE_AUDIO_SYNC, SWITCH_MESSAGE_INVALID } @@ -19610,6 +19625,7 @@ SWITCH_EVENT_DTMF, SWITCH_EVENT_MESSAGE, SWITCH_EVENT_PRESENCE_IN, + SWITCH_EVENT_NOTIFY_IN, SWITCH_EVENT_PRESENCE_OUT, SWITCH_EVENT_PRESENCE_PROBE, SWITCH_EVENT_MESSAGE_WAITING, From mikej at freeswitch.org Mon Dec 1 15:10:15 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Mon, 01 Dec 2008 18:10:15 -0500 Subject: [Freeswitch-svn] [commit] r10564 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: mikej Date: Mon Dec 1 18:10:15 2008 New Revision: 10564 Log: missing port Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Mon Dec 1 18:10:15 2008 @@ -1165,8 +1165,8 @@ ipv6 ? "[" : "", ip_addr, ipv6 ? "]" : "", tech_pvt->profile->tls_sip_port); } else { - tech_pvt->invite_contact = switch_core_session_sprintf(session, "sip:%s@%s%s%s", contact, - ipv6 ? "[" : "", ip_addr, ipv6 ? "]" : ""); + tech_pvt->invite_contact = switch_core_session_sprintf(session, "sip:%s@%s%s%s:%d", contact, + ipv6 ? "[" : "", ip_addr, ipv6 ? "]" : "", tech_pvt->profile->sip_port); } } else { if (sofia_glue_transport_has_tls(tech_pvt->transport)) { From anthm at freeswitch.org Tue Dec 2 08:15:14 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Tue, 02 Dec 2008 11:15:14 -0500 Subject: [Freeswitch-svn] [commit] r10565 - freeswitch/trunk/src/mod/applications/mod_commands Message-ID: Author: anthm Date: Tue Dec 2 11:15:12 2008 New Revision: 10565 Log: MODAPP-171 Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c (original) +++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c Tue Dec 2 11:15:12 2008 @@ -2704,7 +2704,7 @@ SWITCH_STANDARD_API(uuid_setvar_multi_function) { switch_core_session_t *psession = NULL; - char *mycmd = NULL, *vars, *argv[2] = { 0 }; + char *mycmd = NULL, *vars, *argv[64] = { 0 }; int argc = 0; char *var_name, *var_value; @@ -2748,7 +2748,7 @@ } } - stream->write_function(stream, "-USAGE: %s\n", SETVAR_SYNTAX); + stream->write_function(stream, "-USAGE: %s\n", SETVAR_MULTI_SYNTAX); done: switch_safe_free(mycmd); From anthm at freeswitch.org Tue Dec 2 13:33:02 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Tue, 02 Dec 2008 16:33:02 -0500 Subject: [Freeswitch-svn] [commit] r10566 - in freeswitch/trunk/src: . include mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Tue Dec 2 16:33:01 2008 New Revision: 10566 Log: fix random issues Modified: freeswitch/trunk/src/include/switch_types.h freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h freeswitch/trunk/src/switch_core_io.c freeswitch/trunk/src/switch_rtp.c Modified: freeswitch/trunk/src/include/switch_types.h ============================================================================== --- freeswitch/trunk/src/include/switch_types.h (original) +++ freeswitch/trunk/src/include/switch_types.h Tue Dec 2 16:33:01 2008 @@ -451,7 +451,8 @@ SWITCH_RTP_FLAG_SECURE_SEND_RESET = (1 << 16), SWITCH_RTP_FLAG_SECURE_RECV_RESET = (1 << 17), SWITCH_RTP_FLAG_PROXY_MEDIA = (1 << 18), - SWITCH_RTP_FLAG_SHUTDOWN = (1 << 19) + SWITCH_RTP_FLAG_SHUTDOWN = (1 << 19), + SWITCH_RTP_FLAG_FLUSH = (1 << 20) } switch_rtp_flag_enum_t; typedef uint32_t switch_rtp_flag_t; Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Tue Dec 2 16:33:01 2008 @@ -710,72 +710,79 @@ } if (tech_pvt->last_ts && tech_pvt->read_frame.datalen != tech_pvt->read_codec.implementation->encoded_bytes_per_packet) { - if (++tech_pvt->mismatch_count >= MAX_MISMATCH_FRAMES) { - switch_size_t codec_ms = (int)(tech_pvt->read_frame.timestamp - - tech_pvt->last_ts) / (tech_pvt->read_codec.implementation->samples_per_second / 1000); - - if ((codec_ms % 10) != 0) { - tech_pvt->check_frames = MAX_CODEC_CHECK_FRAMES; - goto skip; - } else { - if (switch_rtp_ready(tech_pvt->rtp_session) && codec_ms != tech_pvt->codec_ms) { - const char *val; - int rtp_timeout_sec = 0; - int rtp_hold_timeout_sec = 0; + switch_size_t codec_ms = (int)(tech_pvt->read_frame.timestamp - + tech_pvt->last_ts) / (tech_pvt->read_codec.implementation->samples_per_second / 1000); + + if ((codec_ms % 10) != 0) { + tech_pvt->check_frames = MAX_CODEC_CHECK_FRAMES; + goto skip; + } + + if (tech_pvt->last_codec_ms && tech_pvt->last_codec_ms == codec_ms) { + tech_pvt->mismatch_count++; + } + + tech_pvt->last_codec_ms = codec_ms; + + if (tech_pvt->mismatch_count > MAX_MISMATCH_FRAMES) { + if (switch_rtp_ready(tech_pvt->rtp_session) && codec_ms != tech_pvt->codec_ms) { + const char *val; + int rtp_timeout_sec = 0; + int rtp_hold_timeout_sec = 0; - tech_pvt->codec_ms = codec_ms; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, - "Changing codec ptime to %d. I bet you have a linksys/sipura =D\n", tech_pvt->codec_ms); - switch_core_codec_destroy(&tech_pvt->read_codec); - switch_core_codec_destroy(&tech_pvt->write_codec); - if (sofia_glue_tech_set_codec(tech_pvt, 2) != SWITCH_STATUS_SUCCESS) { - *frame = NULL; - return SWITCH_STATUS_GENERR; - } + tech_pvt->codec_ms = codec_ms; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, + "Changing codec ptime to %d. I bet you have a linksys/sipura =D\n", tech_pvt->codec_ms); + switch_core_codec_destroy(&tech_pvt->read_codec); + switch_core_codec_destroy(&tech_pvt->write_codec); + if (sofia_glue_tech_set_codec(tech_pvt, 2) != SWITCH_STATUS_SUCCESS) { + *frame = NULL; + return SWITCH_STATUS_GENERR; + } - if ((val = switch_channel_get_variable(tech_pvt->channel, "rtp_timeout_sec"))) { - int v = atoi(val); - if (v >= 0) { - rtp_timeout_sec = v; - } + if ((val = switch_channel_get_variable(tech_pvt->channel, "rtp_timeout_sec"))) { + int v = atoi(val); + if (v >= 0) { + rtp_timeout_sec = v; } + } - if ((val = switch_channel_get_variable(tech_pvt->channel, "rtp_hold_timeout_sec"))) { - int v = atoi(val); - if (v >= 0) { - rtp_hold_timeout_sec = v; - } + if ((val = switch_channel_get_variable(tech_pvt->channel, "rtp_hold_timeout_sec"))) { + int v = atoi(val); + if (v >= 0) { + rtp_hold_timeout_sec = v; } + } - if (rtp_timeout_sec) { - tech_pvt->max_missed_packets = (tech_pvt->read_codec.implementation->samples_per_second * rtp_timeout_sec) / - tech_pvt->read_codec.implementation->samples_per_packet; + if (rtp_timeout_sec) { + tech_pvt->max_missed_packets = (tech_pvt->read_codec.implementation->samples_per_second * rtp_timeout_sec) / + tech_pvt->read_codec.implementation->samples_per_packet; - switch_rtp_set_max_missed_packets(tech_pvt->rtp_session, tech_pvt->max_missed_packets); - if (!rtp_hold_timeout_sec) { - rtp_hold_timeout_sec = rtp_timeout_sec * 10; - } + switch_rtp_set_max_missed_packets(tech_pvt->rtp_session, tech_pvt->max_missed_packets); + if (!rtp_hold_timeout_sec) { + rtp_hold_timeout_sec = rtp_timeout_sec * 10; } + } - if (rtp_hold_timeout_sec) { - tech_pvt->max_missed_hold_packets = (tech_pvt->read_codec.implementation->samples_per_second * rtp_hold_timeout_sec) / - tech_pvt->read_codec.implementation->samples_per_packet; - } + if (rtp_hold_timeout_sec) { + tech_pvt->max_missed_hold_packets = (tech_pvt->read_codec.implementation->samples_per_second * rtp_hold_timeout_sec) / + tech_pvt->read_codec.implementation->samples_per_packet; + } - if (switch_rtp_change_interval(tech_pvt->rtp_session, - tech_pvt->codec_ms * 1000, - tech_pvt->read_codec.implementation->samples_per_packet - ) != SWITCH_STATUS_SUCCESS) { - switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); + if (switch_rtp_change_interval(tech_pvt->rtp_session, + tech_pvt->codec_ms * 1000, + tech_pvt->read_codec.implementation->samples_per_packet + ) != SWITCH_STATUS_SUCCESS) { + switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); - } - - tech_pvt->check_frames = MAX_CODEC_CHECK_FRAMES; } - + + tech_pvt->check_frames = MAX_CODEC_CHECK_FRAMES; } + } + } else { tech_pvt->mismatch_count = 0; } Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h Tue Dec 2 16:33:01 2008 @@ -547,6 +547,7 @@ switch_size_t last_ts; uint32_t check_frames; uint32_t mismatch_count; + uint32_t last_codec_ms; nua_event_t want_event; }; Modified: freeswitch/trunk/src/switch_core_io.c ============================================================================== --- freeswitch/trunk/src/switch_core_io.c (original) +++ freeswitch/trunk/src/switch_core_io.c Tue Dec 2 16:33:01 2008 @@ -608,10 +608,14 @@ switch_mutex_lock(session->codec_write_mutex); if ((session->write_codec && frame->codec && session->write_codec->implementation != frame->codec->implementation)) { - need_codec = TRUE; if (session->write_codec->implementation->codec_id == frame->codec->implementation->codec_id) { ptime_mismatch = TRUE; + if (!need_codec) { + status = perform_write(session, frame, flags, stream_id); + goto error; + } } + need_codec = TRUE; } if (session->write_codec && !frame->codec) { Modified: freeswitch/trunk/src/switch_rtp.c ============================================================================== --- freeswitch/trunk/src/switch_rtp.c (original) +++ freeswitch/trunk/src/switch_rtp.c Tue Dec 2 16:33:01 2008 @@ -1265,6 +1265,11 @@ SWITCH_DECLARE(void) rtp_flush_read_buffer(switch_rtp_t *rtp_session) { + switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_FLUSH); +} + +static void do_flush(switch_rtp_t *rtp_session) +{ int was_blocking = 0; switch_size_t bytes; switch_status_t status; @@ -1338,6 +1343,12 @@ goto end; } + if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_FLUSH)) { + do_flush(rtp_session); + switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_FLUSH); + continue; + } + if (rtp_session->max_missed_packets) { if (bytes) { rtp_session->missed_count = 0; From anthm at freeswitch.org Wed Dec 3 07:44:32 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 03 Dec 2008 10:44:32 -0500 Subject: [Freeswitch-svn] [commit] r10568 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Wed Dec 3 10:44:31 2008 New Revision: 10568 Log: MODENDP-156 Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Wed Dec 3 10:44:31 2008 @@ -1409,6 +1409,36 @@ return 0; } +static int show_reg_callback_xml(void *pArg, int argc, char **argv, char **columnNames) +{ + struct cb_helper *cb = (struct cb_helper *) pArg; + char exp_buf[128] = ""; + switch_time_exp_t tm; + const int buflen = 2048; + char xmlbuf[buflen]; + + if (argv[6]) { + switch_time_t etime = atoi(argv[6]); + switch_size_t retsize; + + switch_time_exp_lt(&tm, switch_time_from_sec(etime)); + switch_strftime_nocheck(exp_buf, &retsize, sizeof(exp_buf), "%Y-%m-%d %T", &tm); + } + + cb->stream->write_function(cb->stream, + "\n" + "%s\n" + "%s@%s\n" + "%s\n" + "%s\n" + "%s(%s) EXP(%s)\n" + "%s\n" + "\n", + switch_str_nil(argv[0]), switch_str_nil(argv[1]), switch_str_nil(argv[2]), switch_amp_encode(switch_str_nil(argv[3]),xmlbuf,buflen), + switch_str_nil(argv[7]), switch_str_nil(argv[4]), switch_str_nil(argv[5]), exp_buf, switch_str_nil(argv[11])); + return 0; +} + static const char *status_names[] = { "DOWN", "UP", NULL }; static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t *stream) @@ -1594,6 +1624,194 @@ return SWITCH_STATUS_SUCCESS; } +static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handle_t *stream) +{ + sofia_profile_t *profile = NULL; + sofia_gateway_t *gp; + switch_hash_index_t *hi; + void *val; + const void *vvar; + const int buflen = 2096; + char xmlbuf[buflen]; + int c = 0; + int ac = 0; + const char *header = ""; + + if (argc > 0) { + if (argc == 1) { + stream->write_function(stream, "Invalid Syntax!\n"); + return SWITCH_STATUS_SUCCESS; + } + if (!strcasecmp(argv[0], "gateway")) { + if ((gp = sofia_reg_find_gateway(argv[1]))) { + switch_assert(gp->state < REG_STATE_LAST); + stream->write_function(stream, "%s\n", header); + stream->write_function(stream, "\n"); + stream->write_function(stream, "%s\n", switch_str_nil(gp->name)); + stream->write_function(stream, "%s\n", switch_str_nil(gp->register_scheme)); + stream->write_function(stream, "%s\n", switch_str_nil(gp->register_realm)); + stream->write_function(stream, "%s\n", switch_str_nil(gp->register_username)); + stream->write_function(stream, "%s\n", switch_strlen_zero(gp->register_password) ? "no" : "yes"); + stream->write_function(stream, "%s\n", switch_amp_encode(switch_str_nil(gp->register_from),xmlbuf,buflen)); + stream->write_function(stream, "%s\n", switch_amp_encode(switch_str_nil(gp->register_contact),xmlbuf,buflen)); + stream->write_function(stream, "%s\n", switch_str_nil(gp->register_to)); + stream->write_function(stream, "%s\n", switch_str_nil(gp->register_proxy)); + stream->write_function(stream, "%s\n", switch_str_nil(gp->register_context)); + stream->write_function(stream, "%s\n", switch_str_nil(gp->expires_str)); + stream->write_function(stream, "%d\n", gp->freq); + stream->write_function(stream, "%d\n", gp->ping); + stream->write_function(stream, "%d\n", gp->ping_freq); + stream->write_function(stream, "%s\n", sofia_state_names[gp->state]); + stream->write_function(stream, "%s%s\n", status_names[gp->status], gp->pinging ? " (ping)" : ""); + stream->write_function(stream, "\n"); + sofia_reg_release_gateway(gp); + } else { + stream->write_function(stream, "Invalid Gateway!\n"); + } + } else if (!strcasecmp(argv[0], "profile")) { + struct cb_helper cb; + char *sql = NULL; + + if ((argv[1]) && (profile = sofia_glue_find_profile(argv[1]))) { + if (!argv[2] || strcasecmp(argv[2], "reg")) { + stream->write_function(stream, "%s\n", header); + stream->write_function(stream, "\n"); + stream->write_function(stream, "\n"); + stream->write_function(stream, "%s\n", switch_str_nil(argv[1])); + stream->write_function(stream, "%s\n", profile->domain_name ? profile->domain_name : "N/A"); + if (strcasecmp(argv[1], profile->name)) { + stream->write_function(stream, "%s\n", switch_str_nil(profile->name)); + } + stream->write_function(stream, "%s\n", switch_str_nil(profile->dbname)); + stream->write_function(stream, "%s\n", switch_str_nil(profile->presence_hosts)); + stream->write_function(stream, "%s\n", switch_str_nil(profile->dialplan)); + stream->write_function(stream, "%s\n", switch_str_nil(profile->context)); + stream->write_function(stream, "%s\n", + switch_strlen_zero(profile->challenge_realm) ? "auto_to" : profile->challenge_realm); + stream->write_function(stream, "%s\n", switch_str_nil(profile->rtpip)); + if (profile->extrtpip) { + stream->write_function(stream, "%s\n", profile->extrtpip); + } + + stream->write_function(stream, "%s\n", switch_str_nil(profile->sipip)); + if (profile->extsipip) { + stream->write_function(stream, "%s\n", profile->extsipip); + } + stream->write_function(stream, "%s\n", switch_str_nil(profile->url)); + stream->write_function(stream, "%s\n", switch_str_nil(profile->bindurl)); + if (sofia_test_pflag(profile, PFLAG_TLS)) { + stream->write_function(stream, "%s\n", switch_str_nil(profile->tls_url)); + stream->write_function(stream, "%s\n", switch_str_nil(profile->tls_bindurl)); + } + stream->write_function(stream, "%s\n", switch_strlen_zero(profile->hold_music) ? "N/A" : profile->hold_music); + stream->write_function(stream, "%s\n", switch_str_nil(profile->codec_string)); + stream->write_function(stream, "%d\n", profile->te); + if (profile->dtmf_type == DTMF_2833) { + stream->write_function(stream, "rfc2833\n"); + } else if (profile->dtmf_type == DTMF_INFO) { + stream->write_function(stream, "info\n"); + } else { + stream->write_function(stream, "none\n"); + } + stream->write_function(stream, "%d\n", profile->cng_pt); + stream->write_function(stream, "%d\n", profile->session_timeout); + stream->write_function(stream, "%d\n", profile->max_proceeding); + stream->write_function(stream, "%s\n", switch_test_flag(profile, TFLAG_INB_NOMEDIA) ? "true" : "false"); + stream->write_function(stream, "%s\n", switch_test_flag(profile, TFLAG_LATE_NEGOTIATION) ? "true" : "false"); + stream->write_function(stream, "%s\n", switch_test_flag(profile, TFLAG_PROXY_MEDIA) ? "true" : "false"); + stream->write_function(stream, "%s\n", sofia_test_pflag(profile, PFLAG_AGGRESSIVE_NAT_DETECTION) ? "true" : "false"); + stream->write_function(stream, "%s\n", sofia_test_pflag(profile, PFLAG_STUN_ENABLED) ? "true" : "false"); + stream->write_function(stream, "%s\n", sofia_test_pflag(profile, PFLAG_STUN_AUTO_DISABLE) ? "true" : "false"); + } + stream->write_function(stream, "\n"); + stream->write_function(stream, "\n"); + + cb.profile = profile; + cb.stream = stream; + + if (argv[3]) { + if (argv[4]) { + if (!strcasecmp(argv[3], "pres")) { + sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status," + "rpid,expires,user_agent,server_user,server_host,profile_name,hostname" + " from sip_registrations where profile_name='%q' and presence_hosts like '%%%q%%'", + profile->name, argv[4]); + } + } else { + sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status," + "rpid,expires,user_agent,server_user,server_host,profile_name,hostname" + " from sip_registrations where profile_name='%q' and contact like '%%%q%%'", + profile->name, argv[3]); + } + } + + if (!sql) { + sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status," + "rpid,expires,user_agent,server_user,server_host,profile_name,hostname" + " from sip_registrations where profile_name='%q'", + profile->name); + } + + sofia_glue_execute_sql_callback(profile, SWITCH_FALSE, profile->ireg_mutex, sql, show_reg_callback_xml, &cb); + free(sql); + + stream->write_function(stream, "\n"); + stream->write_function(stream, "\n"); + + sofia_glue_release_profile(profile); + } else { + stream->write_function(stream, "Invalid Profile!\n"); + } + } else { + stream->write_function(stream, "Invalid Syntax!\n"); + } + + return SWITCH_STATUS_SUCCESS; + } + + stream->write_function(stream, "%s\n", header); + stream->write_function(stream, "\n"); + switch_mutex_lock(mod_sofia_globals.hash_mutex); + for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) { + switch_hash_this(hi, &vvar, NULL, &val); + profile = (sofia_profile_t *) val; + if (sofia_test_pflag(profile, PFLAG_RUNNING)) { + + if (strcmp(vvar, profile->name)) { + ac++; + stream->write_function(stream, "\n%s\n%s\n%s\n%s\n\n", vvar, "alias", profile->name, "ALIASED"); + } else { + stream->write_function(stream, "\n%s\n%s\n%s\n%s (%u)\n\n", profile->name, "profile", profile->url, + sofia_test_pflag(profile, PFLAG_RUNNING) ? "RUNNING" : "DOWN", profile->inuse); + + if (sofia_test_pflag(profile, PFLAG_TLS)) { + stream->write_function(stream, "\n%s\n%s\n%s\n%s (%u) (TLS)\n\n", profile->name, "profile", profile->tls_url, + sofia_test_pflag(profile, PFLAG_RUNNING) ? "RUNNING" : "DOWN", profile->inuse); + } + + c++; + + for (gp = profile->gateways; gp; gp = gp->next) { + switch_assert(gp->state < REG_STATE_LAST); + stream->write_function(stream, "\n%s\n%s\n%s\n%s\n\n", gp->name, "gateway", gp->register_to, sofia_state_names[gp->state]); + if (gp->state == REG_STATE_FAILED || gp->state == REG_STATE_TRYING) { + time_t now = switch_timestamp(NULL); + if (gp->retry > now) { + stream->write_function(stream, " (retry: %ds)", gp->retry - now); + } else { + stream->write_function(stream, " (retry: NEVER)"); + } + } + stream->write_function(stream, "\n"); + } + } + } + } + switch_mutex_unlock(mod_sofia_globals.hash_mutex); + stream->write_function(stream, "\n"); + return SWITCH_STATUS_SUCCESS; +} + static switch_status_t cmd_profile(char **argv, int argc, switch_stream_handle_t *stream) { sofia_profile_t *profile = NULL; @@ -1983,6 +2201,8 @@ func = cmd_profile; } else if (!strcasecmp(argv[0], "status")) { func = cmd_status; + } else if (!strcasecmp(argv[0], "xmlstatus")) { + func = cmd_xml_status; } else if (!strcasecmp(argv[0], "loglevel")) { if (argc > 1 && argv[1]) { int level; From anthm at freeswitch.org Wed Dec 3 07:45:20 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 03 Dec 2008 10:45:20 -0500 Subject: [Freeswitch-svn] [commit] r10569 - freeswitch/trunk/src/mod/applications/mod_voicemail Message-ID: Author: anthm Date: Wed Dec 3 10:45:20 2008 New Revision: 10569 Log: MODAPP-172 Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c (original) +++ freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c Wed Dec 3 10:45:20 2008 @@ -2241,11 +2241,9 @@ vm_notify_email = switch_core_strdup(pool, val); } else if (!strcasecmp(var, "email-addr")) { email_addr = switch_core_strdup(pool, val); - } else if (!strcasecmp(var, "vm-email-all-messages")) { - send_main = switch_true(val); + } else if (!strcasecmp(var, "vm-email-all-messages") && (send_main = switch_true(val))) { send_mail++; - } else if (!strcasecmp(var, "vm-notify-email-all-messages")) { - send_notify = switch_true(val); + } else if (!strcasecmp(var, "vm-notify-email-all-messages") && (send_notify = switch_true(val))) { send_mail++; } else if (!strcasecmp(var, "vm-keep-local-after-email")) { insert_db = switch_true(val); @@ -2684,13 +2682,11 @@ vm_notify_email = switch_core_session_strdup(session, val); } else if (!strcasecmp(var, "email-addr")) { email_addr = switch_core_session_strdup(session, val); - } else if (!strcasecmp(var, "vm-email-all-messages")) { - send_main = switch_true(val); + } else if (!strcasecmp(var, "vm-email-all-messages") && (send_main = switch_true(val))) { send_mail++; } else if (!strcasecmp(var, "storage-dir")) { vm_storage_dir = switch_core_session_strdup(session, val); - } else if (!strcasecmp(var, "vm-notify-email-all-messages")) { - send_notify = switch_true(val); + } else if (!strcasecmp(var, "vm-notify-email-all-messages") && (send_notify = switch_true(val))) { send_mail++; } else if (!strcasecmp(var, "vm-keep-local-after-email")) { insert_db = switch_true(val); @@ -2768,7 +2764,7 @@ if (num > 0 && num <= VM_MAX_GREETINGS) { greet_path = switch_mprintf("%s%sgreeting_%d.%s", dir_path, SWITCH_PATH_SEPARATOR, num, profile->file_ext); } - } else { + } else if (!(greet_path = (char *) switch_channel_get_variable(channel, "voicemail_greeting_path"))) { greet_path = cbt.greeting_path; } From anthm at freeswitch.org Wed Dec 3 07:48:59 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 03 Dec 2008 10:48:59 -0500 Subject: [Freeswitch-svn] [commit] r10570 - freeswitch/trunk/src/mod/xml_int/mod_xml_curl Message-ID: Author: anthm Date: Wed Dec 3 10:48:59 2008 New Revision: 10570 Log: MDXMLINT-41 Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c ============================================================================== --- freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c (original) +++ freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c Wed Dec 3 10:48:59 2008 @@ -37,13 +37,17 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_xml_curl_shutdown); SWITCH_MODULE_DEFINITION(mod_xml_curl, mod_xml_curl_load, mod_xml_curl_shutdown, NULL); + struct xml_binding { + char *method; char *url; char *bindings; char *cred; int disable100continue; + int use_get_style; uint32_t ignore_cacert_check; switch_hash_t *vars_map; + int use_dynamic_url; }; static int keep_files_around = 0; @@ -105,6 +109,9 @@ return x; } + + + static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, const char *key_name, const char *key_value, switch_event_t *params, void *user_data) { @@ -122,7 +129,9 @@ struct curl_slist *headers = NULL; char hostname[256] = ""; char basic_data[512]; - + char *uri = NULL; + char *dynamic_url = NULL; + gethostname(hostname, sizeof(hostname)); if (!binding) { @@ -138,12 +147,37 @@ return xml; } - + switch_snprintf(basic_data, sizeof(basic_data), "hostname=%s§ion=%s&tag_name=%s&key_name=%s&key_value=%s", hostname, section, switch_str_nil(tag_name), switch_str_nil(key_name), switch_str_nil(key_value)); data = switch_event_build_param_string(params, basic_data, binding->vars_map); switch_assert(data); + if (binding->use_dynamic_url) { + switch_status_t ok; + + do { + ok = switch_event_add_header_string(params, SWITCH_STACK_TOP, "hostname", switch_str_nil(hostname)); + if (ok != SWITCH_STATUS_SUCCESS) break; + ok = switch_event_add_header_string(params, SWITCH_STACK_TOP, "section", switch_str_nil(section)); + if (ok != SWITCH_STATUS_SUCCESS) break; + ok = switch_event_add_header_string(params, SWITCH_STACK_TOP, "tag_name", switch_str_nil(tag_name)); + if (ok != SWITCH_STATUS_SUCCESS) break; + ok = switch_event_add_header_string(params, SWITCH_STACK_TOP, "key_name", switch_str_nil(key_name)); + if (ok != SWITCH_STATUS_SUCCESS) break; + ok = switch_event_add_header_string(params, SWITCH_STACK_TOP, "key_value", switch_str_nil(key_value)); + } while (0); + switch_assert(ok == SWITCH_STATUS_SUCCESS); + dynamic_url = switch_event_expand_headers(params, binding->url); + switch_assert(dynamic_url); + } else { + dynamic_url = binding->url; + } + if (binding->use_get_style == 1) { + uri = malloc(strlen(data) + strlen(dynamic_url) + 16); + switch_assert(uri); + sprintf(uri, "%s%c%s", dynamic_url, strchr(dynamic_url, '?') != NULL ? '&' : '?', data); + } switch_uuid_get(&uuid); switch_uuid_format(uuid_str, &uuid); @@ -164,11 +198,14 @@ curl_easy_setopt(curl_handle, CURLOPT_USERPWD, binding->cred); } curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, headers); - curl_easy_setopt(curl_handle, CURLOPT_POST, 1); + if (binding->method != NULL) + curl_easy_setopt(curl_handle, CURLOPT_CUSTOMREQUEST, binding->method); + curl_easy_setopt(curl_handle, CURLOPT_POST, !binding->use_get_style); curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 10); - curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDS, data); - curl_easy_setopt(curl_handle, CURLOPT_URL, binding->url); + if (!binding->use_get_style) + curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDS, data); + curl_easy_setopt(curl_handle, CURLOPT_URL, binding->use_get_style ? uri : dynamic_url); curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, file_callback); curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *) &config_data); curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "freeswitch-xml/1.0"); @@ -211,7 +248,10 @@ } switch_safe_free(data); - + if (binding->use_get_style == 1) + switch_safe_free(uri); + if (binding->use_dynamic_url && dynamic_url != binding->url) + switch_safe_free(dynamic_url); return xml; } @@ -240,7 +280,9 @@ char *url = NULL; char *bind_cred = NULL; char *bind_mask = NULL; + char *method = NULL; int disable100continue = 0; + int use_dynamic_url = 0; uint32_t ignore_cacert_check = 0; hash_node_t* hash_node; need_vars_map = 0; @@ -258,8 +300,12 @@ bind_cred = val; } else if (!strcasecmp(var, "disable-100-continue") && switch_true(val)) { disable100continue = 1; + } else if (!strcasecmp(var, "method")) { + method = val; } else if (!strcasecmp(var, "ignore-cacert-check") && switch_true(val)) { ignore_cacert_check = 1; + } else if (!strcasecmp(var, "use-dynamic-url") && switch_true(val)) { + use_dynamic_url = 1; } else if (!strcasecmp(var, "enable-post-var")) { if (!vars_map && need_vars_map == 0) { if (switch_core_hash_init(&vars_map, globals.pool) != SWITCH_STATUS_SUCCESS) { @@ -292,7 +338,13 @@ memset(binding, 0, sizeof(*binding)); binding->url = strdup(url); + switch_assert(binding->url); + if (method != NULL) { + binding->method = strdup(method); + } else { + binding->method = NULL; + } if (bind_mask) { binding->bindings = strdup(bind_mask); } @@ -302,6 +354,8 @@ } binding->disable100continue = disable100continue; + binding->use_get_style = method != NULL && strcasecmp(method,"post") != 0; + binding->use_dynamic_url = use_dynamic_url; binding->ignore_cacert_check = ignore_cacert_check; binding->vars_map = vars_map; From mikej at freeswitch.org Wed Dec 3 08:16:50 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Wed, 03 Dec 2008 11:16:50 -0500 Subject: [Freeswitch-svn] [commit] r10571 - freeswitch/trunk/src/mod/xml_int/mod_xml_curl Message-ID: Author: mikej Date: Wed Dec 3 11:16:49 2008 New Revision: 10571 Log: cleanup Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c ============================================================================== --- freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c (original) +++ freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c Wed Dec 3 11:16:49 2008 @@ -153,26 +153,19 @@ data = switch_event_build_param_string(params, basic_data, binding->vars_map); switch_assert(data); + if (binding->use_dynamic_url) { - switch_status_t ok; - - do { - ok = switch_event_add_header_string(params, SWITCH_STACK_TOP, "hostname", switch_str_nil(hostname)); - if (ok != SWITCH_STATUS_SUCCESS) break; - ok = switch_event_add_header_string(params, SWITCH_STACK_TOP, "section", switch_str_nil(section)); - if (ok != SWITCH_STATUS_SUCCESS) break; - ok = switch_event_add_header_string(params, SWITCH_STACK_TOP, "tag_name", switch_str_nil(tag_name)); - if (ok != SWITCH_STATUS_SUCCESS) break; - ok = switch_event_add_header_string(params, SWITCH_STACK_TOP, "key_name", switch_str_nil(key_name)); - if (ok != SWITCH_STATUS_SUCCESS) break; - ok = switch_event_add_header_string(params, SWITCH_STACK_TOP, "key_value", switch_str_nil(key_value)); - } while (0); - switch_assert(ok == SWITCH_STATUS_SUCCESS); + switch_event_add_header_string(params, SWITCH_STACK_TOP, "hostname", switch_str_nil(hostname)); + switch_event_add_header_string(params, SWITCH_STACK_TOP, "section", switch_str_nil(section)); + switch_event_add_header_string(params, SWITCH_STACK_TOP, "tag_name", switch_str_nil(tag_name)); + switch_event_add_header_string(params, SWITCH_STACK_TOP, "key_name", switch_str_nil(key_name)); + switch_event_add_header_string(params, SWITCH_STACK_TOP, "key_value", switch_str_nil(key_value)); dynamic_url = switch_event_expand_headers(params, binding->url); switch_assert(dynamic_url); } else { dynamic_url = binding->url; } + if (binding->use_get_style == 1) { uri = malloc(strlen(data) + strlen(dynamic_url) + 16); switch_assert(uri); From anthm at freeswitch.org Wed Dec 3 08:52:58 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 03 Dec 2008 11:52:58 -0500 Subject: [Freeswitch-svn] [commit] r10572 - freeswitch/trunk/src Message-ID: Author: anthm Date: Wed Dec 3 11:52:58 2008 New Revision: 10572 Log: update Modified: freeswitch/trunk/src/switch_rtp.c Modified: freeswitch/trunk/src/switch_rtp.c ============================================================================== --- freeswitch/trunk/src/switch_rtp.c (original) +++ freeswitch/trunk/src/switch_rtp.c Wed Dec 3 11:52:58 2008 @@ -1001,18 +1001,22 @@ SWITCH_DECLARE(void) switch_rtp_break(switch_rtp_t *rtp_session) { - switch_assert(rtp_session != NULL); + if (!switch_rtp_ready(rtp_session)) { + return; + } + switch_mutex_lock(rtp_session->flag_mutex); switch_set_flag(rtp_session, SWITCH_RTP_FLAG_BREAK); + + if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_NOBLOCK)) { + switch_mutex_unlock(rtp_session->flag_mutex); + return; + } if (rtp_session->sock_input) { - char o[4] = "DOH"; - switch_size_t len; - - len = sizeof(o); - switch_socket_sendto(rtp_session->sock_input, rtp_session->local_addr, 0, (void *) o, &len); - len = sizeof(o); - switch_socket_sendto(rtp_session->sock_input, rtp_session->local_addr, 0, (void *) o, &len); + uint32_t o = UINT_MAX; + switch_size_t len = sizeof(o); + switch_socket_sendto(rtp_session->sock_input, rtp_session->local_addr, 0, (void *) &o, &len); } switch_mutex_unlock(rtp_session->flag_mutex); } @@ -1265,7 +1269,9 @@ SWITCH_DECLARE(void) rtp_flush_read_buffer(switch_rtp_t *rtp_session) { - switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_FLUSH); + if (switch_rtp_ready(rtp_session) && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PROXY_MEDIA)) { + switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_FLUSH); + } } static void do_flush(switch_rtp_t *rtp_session) @@ -1346,7 +1352,7 @@ if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_FLUSH)) { do_flush(rtp_session); switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_FLUSH); - continue; + bytes = 0; } if (rtp_session->max_missed_packets) { @@ -1359,8 +1365,8 @@ } check = !bytes; - - if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_BREAK)) { + + if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_BREAK) || (bytes && bytes == 4 && *((int *)&rtp_session->recv_msg) == UINT_MAX)) { switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_BREAK); do_2833(rtp_session); rtp_flush_read_buffer(rtp_session); From anthm at freeswitch.org Wed Dec 3 09:13:02 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 03 Dec 2008 12:13:02 -0500 Subject: [Freeswitch-svn] [commit] r10573 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Wed Dec 3 12:13:02 2008 New Revision: 10573 Log: log ip and port you get reply to invite from Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Wed Dec 3 12:13:02 2008 @@ -2258,9 +2258,23 @@ const char *uuid; switch_core_session_t *other_session; private_object_t *tech_pvt = switch_core_session_get_private(session); + su_addrinfo_t *my_addrinfo = msg_addrinfo(nua_current_request(nua)); + char network_ip[80]; + int network_port = 0; + switch_caller_profile_t *caller_profile = NULL; - switch_channel_clear_flag(channel, CF_REQ_MEDIA); + get_addr(network_ip, sizeof(network_ip), my_addrinfo->ai_addr, my_addrinfo->ai_addrlen); + network_port = ntohs(((struct sockaddr_in *) msg_addrinfo(nua_current_request(nua))->ai_addr)->sin_port); + + switch_channel_set_variable(channel, "sip_reply_host", network_ip); + switch_channel_set_variable_printf(channel, "sip_reply_port", "%d", network_port); + + if ((caller_profile = switch_channel_get_caller_profile(channel))) { + caller_profile->network_addr = switch_core_strdup(caller_profile->pool, network_ip); + } + switch_channel_clear_flag(channel, CF_REQ_MEDIA); + if ((status == 180 || status == 183 || status == 200)) { if (sip->sip_user_agent && sip->sip_user_agent->g_string) { switch_channel_set_variable(channel, "sip_user_agent", sip->sip_user_agent->g_string); From gmaruzz at freeswitch.org Wed Dec 3 09:19:43 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Wed, 03 Dec 2008 12:19:43 -0500 Subject: [Freeswitch-svn] [commit] r10574 - in freeswitch/branches/gmaruzz/src: . include mod/endpoints/mod_skypiax mod/endpoints/mod_woomera Message-ID: Author: gmaruzz Date: Wed Dec 3 12:19:42 2008 New Revision: 10574 Log: freeswitch_core_lib: added switch_file_pipe_create to switch_apr.c and switch_apr.h. skypiax: added stuff to compile on visual C. Almost there Modified: freeswitch/branches/gmaruzz/src/include/switch_apr.h freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c freeswitch/branches/gmaruzz/src/mod/endpoints/mod_woomera/mod_woomera.2008.vcproj freeswitch/branches/gmaruzz/src/switch_apr.c Modified: freeswitch/branches/gmaruzz/src/include/switch_apr.h ============================================================================== --- freeswitch/branches/gmaruzz/src/include/switch_apr.h (original) +++ freeswitch/branches/gmaruzz/src/include/switch_apr.h Wed Dec 3 12:19:42 2008 @@ -1303,6 +1303,7 @@ SWITCH_DECLARE(switch_status_t) switch_match_glob(const char *pattern, switch_array_header_t **result, switch_memory_pool_t *p); SWITCH_DECLARE(switch_status_t) switch_socket_addr_get(switch_sockaddr_t **sa, switch_bool_t remote, switch_socket_t *sock); +SWITCH_DECLARE(switch_status_t) switch_file_pipe_create_ex(switch_file_t **in, switch_file_t **out, int32_t blocking, switch_memory_pool_t *p); /** @} */ Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Wed Dec 3 12:19:42 2008 @@ -34,12 +34,19 @@ * */ +#define WIN32_SKYPIAX +#define __CYGWIN__ #define MOD_SKYPIAX #ifdef MOD_SKYPIAX +#ifndef WIN32_SKYPIAX #include #include #include +#else //WIN32_SKYPIAX +//FIXME include? +#endif //WIN32_SKYPIAX + #include #define SKYPIAX_SVN_VERSION "SVN 123456" @@ -118,12 +125,22 @@ static switch_memory_pool_t *module_pool = NULL; static int running = 1; +#ifndef WIN32_SKYPIAX struct AsteriskHandles { Window skype_win; Display *disp; Window win; int fdesc[2]; }; +#else //WIN32_SKYPIAX + +struct AsteriskHandles { + HWND win32_hInit_MainWindowHandle; + HWND win32_hGlobal_SkypeAPIWindowHandle; + int fdesc[2]; +}; + +#endif //WIN32_SKYPIAX typedef enum { @@ -183,7 +200,7 @@ double playback_boost; double capture_boost; int stripmsd; - pthread_t skype_thread; + switch_thread_t *skype_thread; char skype_call_id[512]; int skype_call_ongoing; char skype_friends[4096]; @@ -258,6 +275,232 @@ int option_debug = 100; switch_core_session_t *global_session = NULL; +#ifdef WIN32_SKYPIAX +#ifdef __CYGWIN__ +struct AsteriskHandles *win32_AsteriskHandlesSkype; +HWND win32_hInit_MainWindowHandle; +HINSTANCE win32_hInit_ProcessHandle; +char win32_acInit_WindowClassName[128]; +HANDLE win32_hGlobal_ThreadShutdownEvent; +UINT win32_uiGlobal_MsgID_SkypeControlAPIAttach; +UINT win32_uiGlobal_MsgID_SkypeControlAPIDiscover; +HWND win32_hGlobal_SkypeAPIWindowHandle = NULL; +DWORD win32_ulGlobal_PromptConsoleMode = 0; +HANDLE volatile win32_hGlobal_PromptConsoleHandle = NULL; + +enum { + SKYPECONTROLAPI_ATTACH_SUCCESS = 0, /* Client is successfully + attached and API window handle can be found + in wParam parameter */ + SKYPECONTROLAPI_ATTACH_PENDING_AUTHORIZATION = 1, /* Skype has acknowledged + connection request and is waiting + for confirmation from the user. */ + /* The client is not yet attached + * and should wait for SKYPECONTROLAPI_ATTACH_SUCCESS message */ + SKYPECONTROLAPI_ATTACH_REFUSED = 2, /* User has explicitly + denied access to client */ + SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE = 3, /* API is not available + at the moment. + For example, this happens when no user + is currently logged in. */ + /* Client should wait for + * SKYPECONTROLAPI_ATTACH_API_AVAILABLE + * broadcast before making any further */ + /* connection attempts. */ + SKYPECONTROLAPI_ATTACH_API_AVAILABLE = 0x8001 +}; + +LRESULT APIENTRY skypiax_skype_present(HWND hWindow, UINT uiMessage, WPARAM uiParam, + LPARAM ulParam) +{ + LRESULT lReturnCode; + int fIssueDefProc; + struct skypiax_interface *p = NULL; + + lReturnCode = 0; + fIssueDefProc = 0; + switch (uiMessage) { + case WM_DESTROY: + win32_hInit_MainWindowHandle = NULL; + PostQuitMessage(0); + break; + case WM_COPYDATA: + if (win32_hGlobal_SkypeAPIWindowHandle == (HWND) uiParam) { + + PCOPYDATASTRUCT poCopyData = (PCOPYDATASTRUCT) ulParam; + write(win32_AsteriskHandlesSkype->fdesc[1], (const char *) poCopyData->lpData, + strlen((const char *) poCopyData->lpData)); + write(win32_AsteriskHandlesSkype->fdesc[1], "\0", 1); + lReturnCode = 1; + } + break; + default: + if (uiMessage == win32_uiGlobal_MsgID_SkypeControlAPIAttach) { + switch (ulParam) { + case SKYPECONTROLAPI_ATTACH_SUCCESS: + NOTICA("\n\n\tConnected to Skype API!\n", SKYPIAX_P_LOG); + win32_hGlobal_SkypeAPIWindowHandle = (HWND) uiParam; + switch_sleep(5000); + win32_AsteriskHandlesSkype->win32_hGlobal_SkypeAPIWindowHandle = + win32_hGlobal_SkypeAPIWindowHandle; + break; + case SKYPECONTROLAPI_ATTACH_PENDING_AUTHORIZATION: + WARNINGA + ("\n\n\tIf I do not immediately connect to Skype API,\n\tplease give the Skype client authorization to be connected \n\tby Asterisk and to not ask you again.\n\n", + SKYPIAX_P_LOG); + break; + case SKYPECONTROLAPI_ATTACH_REFUSED: + ERRORA("Skype client refused to be connected by Skypiax!\n", SKYPIAX_P_LOG); + break; + case SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE: + ERRORA("Skype API not available\n", SKYPIAX_P_LOG); + break; + case SKYPECONTROLAPI_ATTACH_API_AVAILABLE: + DEBUGA_SKYPE("Skype API available\n", SKYPIAX_P_LOG); + break; + default: + WARNINGA("GOT AN UNKNOWN SKYPE WINDOWS MSG\n", SKYPIAX_P_LOG); + } + lReturnCode = 1; + break; + } + fIssueDefProc = 1; + break; + } + if (fIssueDefProc) + lReturnCode = DefWindowProc(hWindow, uiMessage, uiParam, ulParam); + return (lReturnCode); +} + +int win32_Initialize_CreateWindowClass(void) +{ + unsigned char *paucUUIDString; + RPC_STATUS lUUIDResult; + int fReturnStatus; + UUID oUUID; + + fReturnStatus = 0; + lUUIDResult = UuidCreate(&oUUID); + win32_hInit_ProcessHandle = + (HINSTANCE) OpenProcess(PROCESS_DUP_HANDLE, FALSE, GetCurrentProcessId()); + if (win32_hInit_ProcessHandle != NULL + && (lUUIDResult == RPC_S_OK || lUUIDResult == RPC_S_UUID_LOCAL_ONLY)) { + if (UuidToString(&oUUID, &paucUUIDString) == RPC_S_OK) { + WNDCLASS oWindowClass; + + strcpy(win32_acInit_WindowClassName, "Skype-API-Skypiax-"); + strcat(win32_acInit_WindowClassName, (char *) paucUUIDString); + + oWindowClass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; + oWindowClass.lpfnWndProc = (WNDPROC) & skypiax_skype_present; + oWindowClass.cbClsExtra = 0; + oWindowClass.cbWndExtra = 0; + oWindowClass.hInstance = win32_hInit_ProcessHandle; + oWindowClass.hIcon = NULL; + oWindowClass.hCursor = NULL; + oWindowClass.hbrBackground = NULL; + oWindowClass.lpszMenuName = NULL; + oWindowClass.lpszClassName = win32_acInit_WindowClassName; + + if (RegisterClass(&oWindowClass) != 0) + fReturnStatus = 1; + + RpcStringFree(&paucUUIDString); + } + } + if (fReturnStatus == 0) + CloseHandle(win32_hInit_ProcessHandle), win32_hInit_ProcessHandle = NULL; + return (fReturnStatus); +} + +void win32_DeInitialize_DestroyWindowClass(void) +{ + UnregisterClass(win32_acInit_WindowClassName, win32_hInit_ProcessHandle); + CloseHandle(win32_hInit_ProcessHandle), win32_hInit_ProcessHandle = NULL; +} + +int win32_Initialize_CreateMainWindow(void) +{ + win32_hInit_MainWindowHandle = + CreateWindowEx(WS_EX_APPWINDOW | WS_EX_WINDOWEDGE, win32_acInit_WindowClassName, "", + WS_BORDER | WS_SYSMENU | WS_MINIMIZEBOX, CW_USEDEFAULT, CW_USEDEFAULT, + 128, 128, NULL, 0, win32_hInit_ProcessHandle, 0); + return (win32_hInit_MainWindowHandle != NULL ? 1 : 0); +} + +void win32_DeInitialize_DestroyMainWindow(void) +{ + if (win32_hInit_MainWindowHandle != NULL) + DestroyWindow(win32_hInit_MainWindowHandle), win32_hInit_MainWindowHandle = NULL; +} + +DWORD win32_dwThreadId; + +//void *do_skype_thread(void *data) +static void *SWITCH_THREAD_FUNC do_skype_thread(switch_thread_t *thread, void *obj) +{ + /* create window class */ + /* create dummy/hidden window for processing messages */ + /* run message loop thread */ + /* do application control until exit */ + /* exit: send QUIT message to our own window */ + /* wait until thred terminates */ + /* destroy main window */ + /* destroy window class */ + +#if 0 + res = pipe(p->AsteriskHandlesAst.fdesc); + if (res) { + ERRORA("Unable to create skype pipe, exiting skype thread\n", SKYPIAX_P_LOG); + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + return NULL; + } +#endif //0 + + win32_AsteriskHandlesSkype = (struct AsteriskHandles *) obj; + + win32_uiGlobal_MsgID_SkypeControlAPIAttach = + RegisterWindowMessage("SkypeControlAPIAttach"); + win32_uiGlobal_MsgID_SkypeControlAPIDiscover = + RegisterWindowMessage("SkypeControlAPIDiscover"); + + if (win32_uiGlobal_MsgID_SkypeControlAPIAttach != 0 + && win32_uiGlobal_MsgID_SkypeControlAPIDiscover != 0) { + if (win32_Initialize_CreateWindowClass()) { + if (win32_Initialize_CreateMainWindow()) { + win32_hGlobal_ThreadShutdownEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + if (win32_hGlobal_ThreadShutdownEvent != NULL) { + if (SendMessage + (HWND_BROADCAST, win32_uiGlobal_MsgID_SkypeControlAPIDiscover, + (WPARAM) win32_hInit_MainWindowHandle, 0) != 0) { + win32_AsteriskHandlesSkype->win32_hInit_MainWindowHandle = + win32_hInit_MainWindowHandle; + while (1) { + MSG oMessage; + + while (GetMessage(&oMessage, 0, 0, 0) != FALSE) { + TranslateMessage(&oMessage); + DispatchMessage(&oMessage); + } + } + } + CloseHandle(win32_hGlobal_ThreadShutdownEvent); + } + win32_DeInitialize_DestroyMainWindow(); + } + win32_DeInitialize_DestroyWindowClass(); + } + } + return NULL; +} + +#endif /* __CYGWIN__ */ + + + +#endif //WIN32_SKYPIAX + + static switch_status_t skypiax_codec(private_t *tech_pvt, int sample_rate, int codec_ms) { if (switch_core_codec_init(&tech_pvt->read_codec, @@ -592,7 +835,7 @@ break; } } else { - usleep(1000); + switch_sleep(1000); } } @@ -648,8 +891,10 @@ } return -1; } +#ifndef WIN32_SKYPIAX fcntl(p->audioskypepipe[0], F_SETFL, O_NONBLOCK); fcntl(p->audioskypepipe[1], F_SETFL, O_NONBLOCK); +#endif// WIN32_SKYPIAX if (option_debug > 10) { DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); @@ -686,7 +931,7 @@ if ((samples = read(p->audiopipe[0], tech_pvt->read_frame.data, SAMPLES_PER_FRAME * sizeof(short))) != 320) { DEBUGA_SKYPE("read=====> NOT GOOD samples=%d expected=%d\n", SKYPIAX_P_LOG, samples, 320); - usleep(1000); + switch_sleep(1000); //do nothing } else { tech_pvt->read_frame.datalen=samples; @@ -734,7 +979,7 @@ if ((samples = read(p->audiopipe[0], buf, SAMPLES_PER_FRAME * sizeof(short))) != 320) { DEBUGA_SOUND("read=====> NOT GOOD samples=%d expected=%d\n", SKYPIAX_P_LOG, samples, SAMPLES_PER_FRAME * sizeof(short)); - usleep(100); + switch_sleep(100); //do nothing } else { //DEBUGA_SOUND("read=====> GOOD samples=%d\n", SKYPIAX_P_LOG, samples); @@ -942,7 +1187,7 @@ if ((samples = read(p->audiopipe[0], buf, SAMPLES_PER_FRAME * sizeof(short))) != 320) { DEBUGA_SOUND("read=====> NOT GOOD samples=%d expected=%d\n", SKYPIAX_P_LOG, samples, SAMPLES_PER_FRAME * sizeof(short)); - usleep(100); + switch_sleep(100); //do nothing } else { //DEBUGA_SOUND("read=====> GOOD samples=%d\n", SKYPIAX_P_LOG, samples); @@ -1033,6 +1278,230 @@ } +#if 1 +switch_file_t *readp = NULL; +switch_file_t *writep = NULL; + +void create_pipe(void *data) +{ + switch_status_t rv; + + //rv = switch_file_pipe_create_ex(&readp, &writep, APR_FULL_NONBLOCK, module_pool); + rv = switch_file_pipe_create_ex(&readp, &writep, 2, module_pool); + //rv = switch_file_pipe_create(&readp, &writep, module_pool); +} +#if 0 +//testpipe.c + +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "testutil.h" +#include "apr_file_io.h" +#include "apr_errno.h" +#include "apr_general.h" +#include "apr_lib.h" +#include "apr_thread_proc.h" +#include "apr_strings.h" + +static apr_file_t *readp = NULL; +static apr_file_t *writep = NULL; + +static void create_pipe(abts_case *tc, void *data) +{ + apr_status_t rv; + + rv = apr_file_pipe_create(&readp, &writep, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, readp); + ABTS_PTR_NOTNULL(tc, writep); +} + +static void close_pipe(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_size_t nbytes = 256; + char buf[256]; + + rv = apr_file_close(readp); + rv = apr_file_close(writep); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_file_read(readp, buf, &nbytes); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EBADF(rv)); +} + +static void set_timeout(abts_case *tc, void *data) +{ + apr_status_t rv; + apr_interval_time_t timeout; + + rv = apr_file_pipe_create_ex(&readp, &writep, APR_WRITE_BLOCK, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, readp); + ABTS_PTR_NOTNULL(tc, writep); + + rv = apr_file_pipe_timeout_get(writep, &timeout); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_ASSERT(tc, "Timeout mismatch, expected -1", timeout == -1); + + rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1)); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_file_pipe_timeout_get(readp, &timeout); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_ASSERT(tc, "Timeout mismatch, expected 1 second", + timeout == apr_time_from_sec(1)); +} + +static void read_write(abts_case *tc, void *data) +{ + apr_status_t rv; + char *buf; + apr_size_t nbytes; + + nbytes = strlen("this is a test"); + buf = (char *)apr_palloc(p, nbytes + 1); + + rv = apr_file_pipe_create_ex(&readp, &writep, APR_WRITE_BLOCK, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, readp); + ABTS_PTR_NOTNULL(tc, writep); + + rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1)); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + if (!rv) { + rv = apr_file_read(readp, buf, &nbytes); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + ABTS_SIZE_EQUAL(tc, 0, nbytes); + } +} + +static void read_write_notimeout(abts_case *tc, void *data) +{ + apr_status_t rv; + char *buf = "this is a test"; + char *input; + apr_size_t nbytes; + + nbytes = strlen("this is a test"); + + rv = apr_file_pipe_create(&readp, &writep, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, readp); + ABTS_PTR_NOTNULL(tc, writep); + + rv = apr_file_write(writep, buf, &nbytes); + ABTS_SIZE_EQUAL(tc, strlen("this is a test"), nbytes); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + nbytes = 256; + input = apr_pcalloc(p, nbytes + 1); + rv = apr_file_read(readp, input, &nbytes); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_SIZE_EQUAL(tc, strlen("this is a test"), nbytes); + ABTS_STR_EQUAL(tc, "this is a test", input); +} + +static void test_pipe_writefull(abts_case *tc, void *data) +{ + int iterations = 1000; + int i; + int bytes_per_iteration = 8000; + char *buf = (char *)malloc(bytes_per_iteration); + char responsebuf[128]; + apr_size_t nbytes; + int bytes_processed; + apr_proc_t proc = {0}; + apr_procattr_t *procattr; + const char *args[2]; + apr_status_t rv; + apr_exit_why_e why; + + rv = apr_procattr_create(&procattr, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_procattr_io_set(procattr, APR_CHILD_BLOCK, APR_CHILD_BLOCK, + APR_CHILD_BLOCK); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_procattr_error_check_set(procattr, 1); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + args[0] = "readchild" EXTENSION; + args[1] = NULL; + rv = apr_proc_create(&proc, TESTBINPATH "readchild" EXTENSION, args, NULL, procattr, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_file_pipe_timeout_set(proc.in, apr_time_from_sec(10)); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_file_pipe_timeout_set(proc.out, apr_time_from_sec(10)); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + i = iterations; + do { + rv = apr_file_write_full(proc.in, buf, bytes_per_iteration, NULL); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + } while (--i); + + free(buf); + + rv = apr_file_close(proc.in); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + nbytes = sizeof(responsebuf); + rv = apr_file_read(proc.out, responsebuf, &nbytes); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + bytes_processed = (int)apr_strtoi64(responsebuf, NULL, 10); + ABTS_INT_EQUAL(tc, iterations * bytes_per_iteration, bytes_processed); + + ABTS_ASSERT(tc, "wait for child process", + apr_proc_wait(&proc, NULL, &why, APR_WAIT) == APR_CHILD_DONE); + + ABTS_ASSERT(tc, "child terminated normally", why == APR_PROC_EXIT); +} + +abts_suite *testpipe(abts_suite *suite) +{ + suite = ADD_SUITE(suite) + + abts_run_test(suite, create_pipe, NULL); + abts_run_test(suite, close_pipe, NULL); + abts_run_test(suite, set_timeout, NULL); + abts_run_test(suite, close_pipe, NULL); + abts_run_test(suite, read_write, NULL); + abts_run_test(suite, close_pipe, NULL); + abts_run_test(suite, read_write_notimeout, NULL); + abts_run_test(suite, test_pipe_writefull, NULL); + abts_run_test(suite, close_pipe, NULL); + + return suite; +} + + + + +#endif + + +#endif static switch_status_t channel_answer_channel(switch_core_session_t *session) { private_t *tech_pvt; @@ -1173,7 +1642,9 @@ /*.receive_event */ channel_receive_event }; #define SKYPE_THREAD +#ifndef WIN32_SKYPIAX #ifdef SKYPE_THREAD + #define SKYPE_X11_BUF_SIZE 512 Window skype_win = (Window) - 1; static XErrorHandler old_handler = 0; @@ -1302,7 +1773,7 @@ DEBUGA_SKYPE("NOT destroyed disp\n", SKYPIAX_P_LOG); } DEBUGA_SKYPE("OUT destroyed disp\n", SKYPIAX_P_LOG); - usleep(1000); + switch_sleep(1000); } static void *SWITCH_THREAD_FUNC do_skype_thread(switch_thread_t *thread, void *obj) @@ -1427,7 +1898,7 @@ write(AsteriskHandlesAst->fdesc[1], b, strlen(b) + 1); //write(AsteriskHandlesAst->fdesc[1], "\0", 1); //FIXME DEBUGA_SKYPE("SKYPE pipewrite: |||%s|||len=%d serial=%ld\n\n\n", SKYPIAX_P_LOG, b, strlen(b) + 1, an_event.xclient.serial); - //usleep(1000); + //switch_sleep(1000); memset(buffer, '\0', 17000); } @@ -1454,6 +1925,11 @@ #endif /* SKYPE_THREAD */ +#else // WIN32_SKYPIAX + + + +#endif // WIN32_SKYPIAX #define CONTROLDEV_THREAD #ifdef CONTROLDEV_THREAD @@ -1485,7 +1961,8 @@ ("Sending message failed - probably Skype crashed.\n\nPlease shutdown Skypiax (Asterisk), then restart Skype from the menu, then launch Skypiax and try again.\n", SKYPIAX_P_LOG); p->skype = 0; - p->skype_thread = SKYPIAX_PTHREADT_NULL; + //FIXME p->skype_thread = SKYPIAX_PTHREADT_NULL; + p->skype_thread = NULL; if (option_debug > 100) { DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); } @@ -1578,7 +2055,7 @@ SKYPIAX_P_LOG); sleep(1); skypiax_skype_write(p, "PROTOCOL 6"); - usleep(10000); + switch_sleep(10000); } #endif @@ -1758,15 +2235,15 @@ p->interface_state = SKYPIAX_STATE_RING; /* no owner, no active call, let's answer */ skypiax_skype_write(p, "SET AGC OFF"); - usleep(10000); + switch_sleep(10000); skypiax_skype_write(p, "SET AEC OFF"); - usleep(10000); + switch_sleep(10000); sprintf(msg_to_skype, "GET CALL %s PARTNER_DISPNAME", id); skypiax_skype_write(p, msg_to_skype); - usleep(10000); + switch_sleep(10000); sprintf(msg_to_skype, "GET CALL %s PARTNER_HANDLE", id); skypiax_skype_write(p, msg_to_skype); - usleep(10000); + switch_sleep(10000); sprintf(msg_to_skype, "ALTER CALL %s ANSWER", id); skypiax_skype_write(p, msg_to_skype); if (option_debug) @@ -1777,7 +2254,7 @@ /* we're owned, we're in a call, let's refuse */ sprintf(msg_to_skype, "SET CALL %s STATUS FINISHED", id); skypiax_skype_write(p, msg_to_skype); - usleep(10000); + switch_sleep(10000); DEBUGA_SKYPE ("We have NOT answered a Skype RING on skype_call %s, because we are already in a skypiax call\n", SKYPIAX_P_LOG, id); @@ -1952,13 +2429,13 @@ } #endif - usleep(100000); + switch_sleep(100000); sprintf(msg_to_skype, "ALTER CALL %s SET_OUTPUT PORT=\"5556\"", id); skypiax_skype_write(p, msg_to_skype); - usleep(100000); + switch_sleep(100000); sprintf(msg_to_skype, "ALTER CALL %s SET_INPUT PORT=\"5558\"", id); skypiax_skype_write(p, msg_to_skype); - usleep(100000); + switch_sleep(100000); } p->skype_callflow = SKYPIAX_STATE_UP; @@ -2077,30 +2554,30 @@ int skypiax_skype_call(struct skypiax_interface *p, char *idest, int timeout, switch_core_session_t *session) { char rdest[80]; + char msg_to_skype[1024]; if (option_debug > 10) { DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); } -usleep(5000); +switch_sleep(5000); //FIXME strncpy(rdest, idest, sizeof(rdest) - 1); strncpy(rdest, "echo123", sizeof(rdest) - 1); if (option_debug) DEBUGA_SKYPE("Calling Skype, rdest is: %s\n", SKYPIAX_P_LOG, rdest); //skypiax_skype_write(p, "GET AGC"); - //usleep(10000); + //switch_sleep(10000); skypiax_skype_write(p, "SET AGC OFF"); - usleep(10000); + switch_sleep(10000); //skypiax_skype_write(p, "GET AGC"); - //usleep(10000); + //switch_sleep(10000); //skypiax_skype_write(p, "GET AEC"); - //usleep(10000); + //switch_sleep(10000); skypiax_skype_write(p, "SET AEC OFF"); - usleep(10000); + switch_sleep(10000); //skypiax_skype_write(p, "GET AEC"); - //usleep(300000); + //switch_sleep(300000); - char msg_to_skype[1024]; sprintf(msg_to_skype, "CALL %s", rdest); if (skypiax_skype_write(p, msg_to_skype) < 0) { @@ -2184,7 +2661,7 @@ while (1) { - usleep(1000); + switch_sleep(1000); res = skypiax_skype_read(p); #if 1 //if (res == CALLFLOW_INCOMING_HANGUP && p->interface_state != SKYPIAX_STATE_DOWN) @@ -2393,7 +2870,7 @@ switch_thread_create(&thread, thd_attr, do_skype_thread, &SKYPIAX_INTERFACES[interface_id], module_pool); } -usleep(100000); +switch_sleep(100000); if(1) { switch_thread_t *thread; @@ -2406,7 +2883,7 @@ } -usleep(1000000); +switch_sleep(1000000); skypiax_skypeaudio_init(&SKYPIAX_INTERFACES[interface_id]); @@ -2451,7 +2928,7 @@ } else { DEBUGA_SKYPE("Initialized XInitThreads!\n", SKYPIAX_P_LOG); } -usleep(10000); //FIXME +switch_sleep(10000); //FIXME #endif /* _WINDOWS_ */ Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_woomera/mod_woomera.2008.vcproj ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_woomera/mod_woomera.2008.vcproj (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_woomera/mod_woomera.2008.vcproj Wed Dec 3 12:19:42 2008 @@ -1,8 +1,8 @@ @@ -143,7 +146,7 @@ Modified: freeswitch/branches/gmaruzz/src/switch_apr.c ============================================================================== --- freeswitch/branches/gmaruzz/src/switch_apr.c (original) +++ freeswitch/branches/gmaruzz/src/switch_apr.c Wed Dec 3 12:19:42 2008 @@ -942,6 +942,12 @@ return apr_match_glob(pattern, (apr_array_header_t **) result, p); } +SWITCH_DECLARE(switch_status_t) switch_file_pipe_create_ex(switch_file_t **in, switch_file_t **out, int32_t blocking, switch_memory_pool_t *p) +{ + //return apr_file_pipe_create_ex ((apr_file_t **) in, (apr_file_t **) out, blocking, p); + return apr_file_pipe_create ((apr_file_t **) in, (apr_file_t **) out, p); +} + /* For Emacs: * Local Variables: * mode:c From gmaruzz at freeswitch.org Wed Dec 3 09:23:18 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Wed, 03 Dec 2008 12:23:18 -0500 Subject: [Freeswitch-svn] [commit] r10575 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Wed Dec 3 12:23:18 2008 New Revision: 10575 Log: skypiax: added mod_skypiax.2008.vcproj, the makefile for VC++ on Windows Added: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.2008.vcproj Added: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.2008.vcproj ============================================================================== --- (empty file) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.2008.vcproj Wed Dec 3 12:23:18 2008 @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From anthm at freeswitch.org Wed Dec 3 09:30:56 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 03 Dec 2008 12:30:56 -0500 Subject: [Freeswitch-svn] [commit] r10576 - freeswitch/trunk/src/mod/applications/mod_conference Message-ID: Author: anthm Date: Wed Dec 3 12:30:56 2008 New Revision: 10576 Log: runaway thread when floor holder has no video and other people do have video Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c (original) +++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c Wed Dec 3 12:30:56 2008 @@ -788,64 +788,68 @@ continue; } - if (switch_channel_test_flag(switch_core_session_get_channel(conference->floor_holder->session), CF_VIDEO)) { - status = switch_core_session_read_video_frame(conference->floor_holder->session, &vid_frame, SWITCH_IO_FLAG_NONE, 0); - if (!SWITCH_READ_ACCEPTABLE(status)) { - conference->floor_holder = NULL; - req_iframe = 0; - continue; - } + if (!switch_channel_test_flag(switch_core_session_get_channel(conference->floor_holder->session), CF_VIDEO)) { + switch_cond_next(); + continue; + } - if (switch_test_flag(vid_frame, SFF_CNG)) { - continue; - } + status = switch_core_session_read_video_frame(conference->floor_holder->session, &vid_frame, SWITCH_IO_FLAG_NONE, 0); + if (!SWITCH_READ_ACCEPTABLE(status)) { + conference->floor_holder = NULL; + req_iframe = 0; + continue; + } + + if (switch_test_flag(vid_frame, SFF_CNG)) { + continue; + } - if (conference->floor_holder != last_member) { - int iframe = 0; + if (conference->floor_holder != last_member) { + int iframe = 0; #if 0 - switch_core_session_message_t msg = { 0 }; + switch_core_session_message_t msg = { 0 }; - if (!req_iframe) { - /* Tell the channel to request a fresh vid frame */ - msg.from = __FILE__; - msg.message_id = SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ; - switch_core_session_receive_message(conference->floor_holder->session, &msg); - req_iframe = 1; - } + if (!req_iframe) { + /* Tell the channel to request a fresh vid frame */ + msg.from = __FILE__; + msg.message_id = SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ; + switch_core_session_receive_message(conference->floor_holder->session, &msg); + req_iframe = 1; + } #endif - if (vid_frame->codec->implementation->ianacode == 34) { /* h.263 */ - //iframe = (*((int16_t *) vid_frame->data) >> 12 == 6); - iframe = 1; - } else if (vid_frame->codec->implementation->ianacode == 115) { /* h.263-1998 */ - int y = *((int8_t *) vid_frame->data + 2) & 0xfe; - iframe = (y == 0x80 || y == 0x82); - } else if (vid_frame->codec->implementation->ianacode == 99) { /* h.264 */ - iframe = (*((int16_t *) vid_frame->data) >> 5 == 0x11); - } else { /* we need more defs */ - iframe = 1; - } - - if (!iframe) { - continue; - } + if (vid_frame->codec->implementation->ianacode == 34) { /* h.263 */ + //iframe = (*((int16_t *) vid_frame->data) >> 12 == 6); + iframe = 1; + } else if (vid_frame->codec->implementation->ianacode == 115) { /* h.263-1998 */ + int y = *((int8_t *) vid_frame->data + 2) & 0xfe; + iframe = (y == 0x80 || y == 0x82); + } else if (vid_frame->codec->implementation->ianacode == 99) { /* h.264 */ + iframe = (*((int16_t *) vid_frame->data) >> 5 == 0x11); + } else { /* we need more defs */ + iframe = 1; + } - req_iframe = 0; + if (!iframe) { + continue; } - last_member = conference->floor_holder; + req_iframe = 0; + } - switch_mutex_lock(conference->member_mutex); - has_vid = 0; - for (imember = conference->members; imember; imember = imember->next) { - if (switch_channel_test_flag(switch_core_session_get_channel(imember->session), CF_VIDEO)) { - has_vid++; - switch_core_session_write_video_frame(imember->session, vid_frame, SWITCH_IO_FLAG_NONE, 0); - } + last_member = conference->floor_holder; + + switch_mutex_lock(conference->member_mutex); + has_vid = 0; + for (imember = conference->members; imember; imember = imember->next) { + if (switch_channel_test_flag(switch_core_session_get_channel(imember->session), CF_VIDEO)) { + has_vid++; + switch_core_session_write_video_frame(imember->session, vid_frame, SWITCH_IO_FLAG_NONE, 0); } - switch_mutex_unlock(conference->member_mutex); } + switch_mutex_unlock(conference->member_mutex); + } switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Video thread ending for conference %s\n", conference->name); conference->video_running = 0; From gmaruzz at freeswitch.org Wed Dec 3 10:11:48 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Wed, 03 Dec 2008 13:11:48 -0500 Subject: [Freeswitch-svn] [commit] r10577 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Wed Dec 3 13:11:48 2008 New Revision: 10577 Log: skypiax: converting to use APR pipes, not finished, do not compile... gotta go now Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Wed Dec 3 13:11:48 2008 @@ -34,8 +34,8 @@ * */ -#define WIN32_SKYPIAX -#define __CYGWIN__ +#undef WIN32_SKYPIAX +#undef __CYGWIN__ #define MOD_SKYPIAX #ifdef MOD_SKYPIAX @@ -194,7 +194,7 @@ char language[80]; /*!< \brief default Asterisk dialplan language for this interface */ char exten[80]; /*!< \brief default Asterisk dialplan extension for this interface */ int skypiax_sound_rate; /*!< \brief rate of the sound device, in Hz, eg: 8000 */ - int skypiax_sound_capt_fd; /*!< \brief file descriptor for sound capture dev */ + switch_file_t *skypiax_sound_capt_fd; /*!< \brief file descriptor for sound capture dev */ char callid_name[50]; char callid_number[50]; double playback_boost; @@ -209,8 +209,8 @@ int skype_callflow; /*!< \brief 'callflow' of the skype interface (as opposed to phone interface) */ int skype; /*!< \brief config flag, bool, Skype support on this interface (0 if false, -1 if true) */ int control_to_send; - int audiopipe[2]; - int audioskypepipe[2]; + switch_file_t *audiopipe[2]; + switch_file_t *audioskypepipe[2]; switch_thread_t *tcp_srv_thread; switch_thread_t *tcp_cli_thread; short audiobuf[160]; @@ -640,7 +640,8 @@ struct skypiax_interface *p = obj; short in[GG]; short out[GG / 2]; - int s, fd, len, sent; + //int s, fd, len, sent; + int s, fd, len; unsigned int sin_size; struct sockaddr_in my_addr; struct sockaddr_in remote_addr; @@ -717,8 +718,11 @@ } p->audiobuf_is_loaded = 1; } else { - sent = write(p->audiopipe[1], p->audiobuf, len / 2); - sent = write(p->audiopipe[1], out, len / 2); + unsigned int howmany; + howmany = len/2; + switch_file_write(p->audiopipe[1], p->audiobuf, &howmany); + howmany = len/2; + switch_file_write(p->audiopipe[1], out, &howmany); p->audiobuf_is_loaded = 0; //DEBUGA_SOUND("read=====> req=%d recv=%d to sent=%d sent=%d\n", SKYPIAX_P_LOG, sizeof(short)*GG, len, (len*sizeof(short))/2, sent); } @@ -758,7 +762,7 @@ struct sockaddr_in remote_addr; int a; int i; - int got; + unsigned int got; int exit=0; if (option_debug > 10) { @@ -807,16 +811,18 @@ - fdselect = p->audioskypepipe[0]; + //fdselect = p->audioskypepipe[0]; FD_ZERO(&fs); FD_SET(fdselect, &fs); to.tv_usec = 100; to.tv_sec = 0; - rt = select(fdselect + 1, &fs, NULL, NULL, &to); + //rt = select(fdselect + 1, &fs, NULL, NULL, &to); + rt=1; if (rt > 0) { - got = read(p->audioskypepipe[0], in, (NN / 2) * sizeof(short)); + got = (NN / 2) * sizeof(short); + switch_file_read(p->audioskypepipe[0], in, &got); //ERRORA("got %d\n", SKYPIAX_P_LOG, got); if (got > 0) { @@ -858,6 +864,7 @@ int skypiax_skypeaudio_init(struct skypiax_interface *p) { int c; +#if 0 /* build the pipe that will be polled on by pbx */ c = pipe(p->audiopipe); if (c) { @@ -867,6 +874,7 @@ } return -1; } +#endif /* the pipe is our audio fd for pbx to poll on */ p->skypiax_sound_capt_fd = p->audiopipe[0]; @@ -883,6 +891,7 @@ } */ +#ifdef NOTDEF_WIN32_SKYPIAX c = pipe(p->audioskypepipe); if (c) { ERRORA("Unable to create audioskypepipe\n", SKYPIAX_P_LOG); @@ -891,7 +900,6 @@ } return -1; } -#ifndef WIN32_SKYPIAX fcntl(p->audioskypepipe[0], F_SETFL, O_NONBLOCK); fcntl(p->audioskypepipe[1], F_SETFL, O_NONBLOCK); #endif// WIN32_SKYPIAX From mikej at freeswitch.org Wed Dec 3 10:38:15 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Wed, 03 Dec 2008 13:38:15 -0500 Subject: [Freeswitch-svn] [commit] r10578 - freeswitch/trunk/src/mod/applications/mod_fax Message-ID: Author: mikej Date: Wed Dec 3 13:38:14 2008 New Revision: 10578 Log: fix spandsp install Modified: freeswitch/trunk/src/mod/applications/mod_fax/Makefile Modified: freeswitch/trunk/src/mod/applications/mod_fax/Makefile ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_fax/Makefile (original) +++ freeswitch/trunk/src/mod/applications/mod_fax/Makefile Wed Dec 3 13:38:14 2008 @@ -11,3 +11,11 @@ $(SPANDSP_LA): $(SPANDSP_DIR) $(SPANDSP_DIR)/.update cd $(SPANDSP_DIR) && $(MAKE) $(TOUCH_TARGET) + + +depend_install: $(DESTDIR)$(libdir)/libspandsp.la + +$(DESTDIR)$(libdir)/libspandsp.la: $(SPANDSP_LA) + cd $(SPANDSP_DIR) && $(MAKE) install + + From mikej at freeswitch.org Wed Dec 3 10:39:06 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Wed, 03 Dec 2008 13:39:06 -0500 Subject: [Freeswitch-svn] [commit] r10579 - freeswitch/trunk/libs/spandsp/src Message-ID: Author: mikej Date: Wed Dec 3 13:39:05 2008 New Revision: 10579 Log: fix spandsp osx build Modified: freeswitch/trunk/libs/spandsp/src/t31.c freeswitch/trunk/libs/spandsp/src/t38_terminal.c Modified: freeswitch/trunk/libs/spandsp/src/t31.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/t31.c (original) +++ freeswitch/trunk/libs/spandsp/src/t31.c Wed Dec 3 13:39:05 2008 @@ -42,7 +42,6 @@ #include #include #include -#include #include "floating_fudge.h" #if defined(HAVE_TGMATH_H) #include Modified: freeswitch/trunk/libs/spandsp/src/t38_terminal.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/t38_terminal.c (original) +++ freeswitch/trunk/libs/spandsp/src/t38_terminal.c Wed Dec 3 13:39:05 2008 @@ -37,7 +37,6 @@ #include #include #include -#include #include "floating_fudge.h" #if defined(HAVE_TGMATH_H) #include From anthm at freeswitch.org Wed Dec 3 11:25:50 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 03 Dec 2008 14:25:50 -0500 Subject: [Freeswitch-svn] [commit] r10580 - in freeswitch/trunk/src: . mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Wed Dec 3 14:25:49 2008 New Revision: 10580 Log: tweak codec ptime bs Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c freeswitch/trunk/src/switch_core_io.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Wed Dec 3 14:25:49 2008 @@ -722,8 +722,6 @@ tech_pvt->mismatch_count++; } - tech_pvt->last_codec_ms = codec_ms; - if (tech_pvt->mismatch_count > MAX_MISMATCH_FRAMES) { if (switch_rtp_ready(tech_pvt->rtp_session) && codec_ms != tech_pvt->codec_ms) { const char *val; Modified: freeswitch/trunk/src/switch_core_io.c ============================================================================== --- freeswitch/trunk/src/switch_core_io.c (original) +++ freeswitch/trunk/src/switch_core_io.c Wed Dec 3 14:25:49 2008 @@ -610,7 +610,7 @@ if ((session->write_codec && frame->codec && session->write_codec->implementation != frame->codec->implementation)) { if (session->write_codec->implementation->codec_id == frame->codec->implementation->codec_id) { ptime_mismatch = TRUE; - if (!need_codec) { + if (switch_test_flag(frame->codec, SWITCH_CODEC_FLAG_PASSTHROUGH) || switch_test_flag(session->read_codec, SWITCH_CODEC_FLAG_PASSTHROUGH)) { status = perform_write(session, frame, flags, stream_id); goto error; } From anthm at freeswitch.org Wed Dec 3 11:55:05 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 03 Dec 2008 14:55:05 -0500 Subject: [Freeswitch-svn] [commit] r10581 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Wed Dec 3 14:55:05 2008 New Revision: 10581 Log: doh Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Wed Dec 3 14:55:05 2008 @@ -2546,6 +2546,7 @@ case nua_callstate_ready: case nua_callstate_completed: case nua_callstate_received: + case nua_callstate_proceeding: if (!(session && channel && tech_pvt)) goto done; break; default: From anthm at freeswitch.org Wed Dec 3 12:10:54 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 03 Dec 2008 15:10:54 -0500 Subject: [Freeswitch-svn] [commit] r10582 - in freeswitch/trunk/src/mod: endpoints/mod_sofia event_handlers/mod_cdr_csv Message-ID: Author: anthm Date: Wed Dec 3 15:10:54 2008 New Revision: 10582 Log: misc fixes Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Wed Dec 3 15:10:54 2008 @@ -1819,7 +1819,7 @@ tech_pvt->remote_sdp_audio_port, tech_pvt->agreed_pt, tech_pvt->read_codec.implementation->microseconds_per_packet / 1000); } - switch_snprintf(tmp, sizeof(tmp), "%d", tech_pvt->remote_sdp_audio_port); + switch_snprintf(tmp, sizeof(tmp), "%d", tech_pvt->local_sdp_audio_port); switch_channel_set_variable(tech_pvt->channel, SWITCH_LOCAL_MEDIA_IP_VARIABLE, tech_pvt->adv_sdp_audio_ip); switch_channel_set_variable(tech_pvt->channel, SWITCH_LOCAL_MEDIA_PORT_VARIABLE, tmp); Modified: freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c ============================================================================== --- freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c (original) +++ freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c Wed Dec 3 15:10:54 2008 @@ -199,7 +199,7 @@ if (globals.debug) { switch_event_t *event; - if (switch_event_create(&event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) { + if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) { char *buf; switch_channel_event_set_data(channel, event); switch_event_serialize(event, &buf, SWITCH_FALSE); From anthm at freeswitch.org Wed Dec 3 12:12:55 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 03 Dec 2008 15:12:55 -0500 Subject: [Freeswitch-svn] [commit] r10583 - freeswitch/trunk/src/mod/xml_int/mod_xml_curl Message-ID: Author: anthm Date: Wed Dec 3 15:12:55 2008 New Revision: 10583 Log: update Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c ============================================================================== --- freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c (original) +++ freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c Wed Dec 3 15:12:55 2008 @@ -155,7 +155,7 @@ switch_assert(data); if (binding->use_dynamic_url) { - switch_event_add_header_string(params, SWITCH_STACK_TOP, "hostname", switch_str_nil(hostname)); + switch_event_add_header_string(params, SWITCH_STACK_TOP, "hostname", hostname); switch_event_add_header_string(params, SWITCH_STACK_TOP, "section", switch_str_nil(section)); switch_event_add_header_string(params, SWITCH_STACK_TOP, "tag_name", switch_str_nil(tag_name)); switch_event_add_header_string(params, SWITCH_STACK_TOP, "key_name", switch_str_nil(key_name)); From anthm at freeswitch.org Wed Dec 3 15:38:12 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 03 Dec 2008 18:38:12 -0500 Subject: [Freeswitch-svn] [commit] r10584 - freeswitch/trunk/src Message-ID: Author: anthm Date: Wed Dec 3 18:38:12 2008 New Revision: 10584 Log: reduce cpu requirement for generated comfort noise Modified: freeswitch/trunk/src/switch_resample.c Modified: freeswitch/trunk/src/switch_resample.c ============================================================================== --- freeswitch/trunk/src/switch_resample.c (original) +++ freeswitch/trunk/src/switch_resample.c Wed Dec 3 18:38:12 2008 @@ -203,15 +203,17 @@ SWITCH_DECLARE(void) switch_generate_sln_silence(int16_t *data, uint32_t samples, uint32_t divisor) { - int16_t rnd, x; + int16_t rnd = 0, rnd2, x; uint32_t i; int sum_rnd = 0; assert(divisor); + rnd2 = (int16_t) (intptr_t) &data + switch_timestamp(NULL); + for (i = 0; i < samples; i++, sum_rnd = 0) { - for (x = 0; x < 7; x++) { - rnd = (int16_t) (rand() * sizeof(int16_t)); + for (x = 0; x < 10; x++) { + rnd += ((x + i) * rnd2); sum_rnd += rnd; } switch_normalize_to_16bit(sum_rnd); From anthm at freeswitch.org Wed Dec 3 18:42:10 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 03 Dec 2008 21:42:10 -0500 Subject: [Freeswitch-svn] [commit] r10585 - freeswitch/trunk/libs/libdingaling/src Message-ID: Author: anthm Date: Wed Dec 3 21:42:09 2008 New Revision: 10585 Log: update Modified: freeswitch/trunk/libs/libdingaling/src/libdingaling.c Modified: freeswitch/trunk/libs/libdingaling/src/libdingaling.c ============================================================================== --- freeswitch/trunk/libs/libdingaling/src/libdingaling.c (original) +++ freeswitch/trunk/libs/libdingaling/src/libdingaling.c Wed Dec 3 21:42:09 2008 @@ -1571,6 +1571,10 @@ ldl_clear_flag_locked(handle, LDL_FLAG_CONNECTED); ldl_clear_flag_locked(handle, LDL_FLAG_AUTHORIZED); handle->state = CS_NEW; + + while(ldl_test_flag(handle, LDL_FLAG_QUEUE_RUNNING)) { + microsleep(100); + } } ldl_clear_flag_locked(handle, LDL_FLAG_RUNNING); if (!ldl_test_flag(handle, LDL_FLAG_TLS)) { From anthm at freeswitch.org Wed Dec 3 20:46:10 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 03 Dec 2008 23:46:10 -0500 Subject: [Freeswitch-svn] [commit] r10587 - in freeswitch/trunk/src: . include Message-ID: Author: anthm Date: Wed Dec 3 23:46:10 2008 New Revision: 10587 Log: add private flags to channel for endpoints to use Modified: freeswitch/trunk/src/include/switch_channel.h freeswitch/trunk/src/switch_channel.c Modified: freeswitch/trunk/src/include/switch_channel.h ============================================================================== --- freeswitch/trunk/src/include/switch_channel.h (original) +++ freeswitch/trunk/src/include/switch_channel.h Wed Dec 3 23:46:10 2008 @@ -490,6 +490,10 @@ SWITCH_DECLARE(void) switch_channel_audio_sync(switch_channel_t *channel); +SWITCH_DECLARE(void) switch_channel_set_private_flag(switch_channel_t *channel, uint32_t flags); +SWITCH_DECLARE(void) switch_channel_clear_private_flag(switch_channel_t *channel, uint32_t flags); +SWITCH_DECLARE(int) switch_channel_test_private_flag(switch_channel_t *channel, uint32_t flags); + /** @} */ SWITCH_END_EXTERN_C Modified: freeswitch/trunk/src/switch_channel.c ============================================================================== --- freeswitch/trunk/src/switch_channel.c (original) +++ freeswitch/trunk/src/switch_channel.c Wed Dec 3 23:46:10 2008 @@ -116,6 +116,7 @@ switch_channel_state_t state; switch_channel_state_t running_state; switch_channel_flag_t flags; + uint32_t private_flags; switch_channel_flag_t state_flags; switch_caller_profile_t *caller_profile; const switch_state_handler_table_t *state_handlers[SWITCH_MAX_STATE_HANDLERS]; @@ -749,6 +750,30 @@ } } + +SWITCH_DECLARE(void) switch_channel_set_private_flag(switch_channel_t *channel, uint32_t flags) +{ + switch_assert(channel != NULL); + switch_mutex_lock(channel->flag_mutex); + channel->private_flags |= flags; + switch_mutex_unlock(channel->flag_mutex); +} + +SWITCH_DECLARE(void) switch_channel_clear_private_flag(switch_channel_t *channel, uint32_t flags) +{ + switch_assert(channel != NULL); + switch_mutex_lock(channel->flag_mutex); + channel->private_flags &= ~flags; + switch_mutex_unlock(channel->flag_mutex); +} + +SWITCH_DECLARE(int) switch_channel_test_private_flag(switch_channel_t *channel, uint32_t flags) +{ + switch_assert(channel != NULL); + return (channel->private_flags & flags); +} + + SWITCH_DECLARE(void) switch_channel_set_state_flag(switch_channel_t *channel, switch_channel_flag_t flags) { switch_assert(channel != NULL); From gmaruzz at freeswitch.org Thu Dec 4 01:32:53 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Thu, 04 Dec 2008 04:32:53 -0500 Subject: [Freeswitch-svn] [commit] r10589 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Thu Dec 4 04:32:52 2008 New Revision: 10589 Log: skypiax: converting to use APR pipes, compiles and works. Now let's eliminate strsep Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Thu Dec 4 04:32:52 2008 @@ -130,7 +130,7 @@ Window skype_win; Display *disp; Window win; - int fdesc[2]; + switch_file_t *fdesc[2]; }; #else //WIN32_SKYPIAX @@ -812,6 +812,7 @@ //fdselect = p->audioskypepipe[0]; + fdselect=1; FD_ZERO(&fs); FD_SET(fdselect, &fs); to.tv_usec = 100; @@ -863,7 +864,18 @@ int skypiax_skypeaudio_init(struct skypiax_interface *p) { - int c; + +//switch_file_t *readp = NULL; +//switch_file_t *writep = NULL; + + switch_status_t rv; + + //rv = switch_file_pipe_create_ex(&readp, &writep, APR_FULL_NONBLOCK, module_pool); + rv = switch_file_pipe_create_ex(&p->audiopipe[0], &p->audiopipe[1], 2, module_pool); + //rv = switch_file_pipe_create(&readp, &writep, module_pool); + + + //FIXME int c; #if 0 /* build the pipe that will be polled on by pbx */ c = pipe(p->audiopipe); @@ -891,6 +903,7 @@ } */ + rv = switch_file_pipe_create_ex(&p->audioskypepipe[0], &p->audioskypepipe[1], 2, module_pool); #ifdef NOTDEF_WIN32_SKYPIAX c = pipe(p->audioskypepipe); if (c) { @@ -913,11 +926,11 @@ { struct skypiax_interface *p; short buf[640]; - int samples; - int fd; + unsigned int samples; + //int fd; int rt; - fd_set fs; - struct timeval to; + //fd_set fs; + //struct timeval to; p = tech_pvt->p; @@ -926,17 +939,24 @@ memset(buf, '\0', sizeof(buf)); +#if 0 fd = p->audiopipe[0]; FD_ZERO(&fs); FD_SET(fd, &fs); to.tv_usec = 100000; to.tv_sec = 0; rt = select(fd + 1, &fs, NULL, NULL, &to); +#endif + rt=1; if (rt > 0) { + samples = SAMPLES_PER_FRAME * sizeof(short); + + switch_file_read(p->audiopipe[0], tech_pvt->read_frame.data, &samples); + //if ((samples = read(p->audiopipe[0], buf, SAMPLES_PER_FRAME * sizeof(short))) != 320) - if ((samples = read(p->audiopipe[0], tech_pvt->read_frame.data, SAMPLES_PER_FRAME * sizeof(short))) != 320) { + if (samples != 320) { DEBUGA_SKYPE("read=====> NOT GOOD samples=%d expected=%d\n", SKYPIAX_P_LOG, samples, 320); switch_sleep(1000); @@ -957,7 +977,7 @@ return SWITCH_STATUS_SUCCESS; } -#ifdef NOTDEF +#if 0 //cicopet struct ast_frame *skypiax_skypeaudio_read(struct skypiax_interface *p) { @@ -1007,7 +1027,7 @@ } return &f; } -#endif //NOTDEF +#endif //0 #endif /* SKYPE_AUDIO */ static void tech_init(private_t *tech_pvt, switch_core_session_t *session, skypiax_interface_t *p) @@ -1254,7 +1274,7 @@ switch_channel_t *channel = NULL; private_t *tech_pvt = NULL; //switch_frame_t *pframe; - int sent; + unsigned int sent; struct skypiax_interface *p=NULL; //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL WRITE FRAME\n"); @@ -1278,7 +1298,8 @@ } #endif - sent = write(p->audioskypepipe[1], (short *) frame->data, frame->datalen); + sent = frame->datalen; + switch_file_write(p->audioskypepipe[1], (short *) frame->data, &sent); //ERRORA("sent %d\n", SKYPIAX_P_LOG, sent); @@ -1286,7 +1307,7 @@ } -#if 1 +#if 0 switch_file_t *readp = NULL; switch_file_t *writep = NULL; @@ -1561,7 +1582,7 @@ return SWITCH_STATUS_SUCCESS; } -#ifdef NOTDEF //FIXME: moved below +#if 0 /* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines that allocate memory or you will have 1 channel with memory allocated from another channel's pool! */ @@ -1612,7 +1633,7 @@ return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; } -#endif // NOTDEF //FIXME: moved below +#endif // 0 //FIXME: moved below static switch_status_t channel_receive_event(switch_core_session_t *session, switch_event_t *event) { @@ -1793,7 +1814,7 @@ Display *disp = NULL; Window root = -1; Window win = -1; -int res; +//int res; p = obj; DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); @@ -1808,6 +1829,9 @@ } */ + switch_file_pipe_create_ex(&p->AsteriskHandlesAst.fdesc[0], &p->AsteriskHandlesAst.fdesc[1], 2, module_pool); + +#if 0 res = pipe(p->AsteriskHandlesAst.fdesc); if (res) { ERRORA("Unable to create skype pipe, exiting skype thread\n", SKYPIAX_P_LOG); @@ -1816,6 +1840,7 @@ } fcntl(p->AsteriskHandlesAst.fdesc[0], F_SETFL, O_NONBLOCK); fcntl(p->AsteriskHandlesAst.fdesc[1], F_SETFL, O_NONBLOCK); +#endif AsteriskHandlesAst = &p->AsteriskHandlesAst; @@ -1903,7 +1928,11 @@ strcat(buffer, buf); if (i < 20) { /* last fragment */ - write(AsteriskHandlesAst->fdesc[1], b, strlen(b) + 1); + unsigned int howmany; + + howmany = strlen(b) + 1; + + switch_file_write(AsteriskHandlesAst->fdesc[1], b, &howmany); //write(AsteriskHandlesAst->fdesc[1], "\0", 1); //FIXME DEBUGA_SKYPE("SKYPE pipewrite: |||%s|||len=%d serial=%ld\n\n\n", SKYPIAX_P_LOG, b, strlen(b) + 1, an_event.xclient.serial); //switch_sleep(1000); @@ -2021,28 +2050,33 @@ char messaggio_2[4096]; char *buf, obj[512] = "", id[512] = "", prop[512] = "", value[512] = "", *where; char **stringp = NULL; - int fd; + //int fd; int rt; - fd_set fs; - struct timeval to; - int howmany, i, a; + //fd_set fs; + //struct timeval to; + int i, a; + unsigned int howmany; if (option_debug > 100) { DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); } + DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); memset(read_from_pipe, 0, 4096); memset(messaggio, 0, 4096); memset(messaggio_2, 0, 4096); +#if 0 fd = p->AsteriskHandlesAst.fdesc[0]; FD_ZERO(&fs); FD_SET(fd, &fs); to.tv_usec = 100; to.tv_sec = 0; rt = select(fd + 1, &fs, NULL, NULL, &to); +#endif + rt=1; if (rt > 0) { - howmany = - read(p->AsteriskHandlesAst.fdesc[0], read_from_pipe, sizeof(read_from_pipe)); + howmany = sizeof(read_from_pipe); + switch_file_read(p->AsteriskHandlesAst.fdesc[0], read_from_pipe, &howmany); a = 0; for (i = 0; i < howmany; i++) { @@ -2051,7 +2085,7 @@ if (read_from_pipe[i] == '\0') { - if (option_debug > 101) + //if (option_debug > 101) DEBUGA_SKYPE("read_skype: howmany=%d, i=%d, a=%d, |||%s||| \n", SKYPIAX_P_LOG, howmany, i, a, messaggio); @@ -2556,6 +2590,7 @@ if (option_debug > 100) { DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); } + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); return 0; } From gmaruzz at freeswitch.org Thu Dec 4 01:47:40 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Thu, 04 Dec 2008 04:47:40 -0500 Subject: [Freeswitch-svn] [commit] r10590 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Thu Dec 4 04:47:39 2008 New Revision: 10590 Log: skypiax: added implementation for strsep, let's see it it works on win32 Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Thu Dec 4 04:47:39 2008 @@ -310,6 +310,29 @@ SKYPECONTROLAPI_ATTACH_API_AVAILABLE = 0x8001 }; + +char +*strsep(char **stringp, const char *delim) +{ + char *res; + + if (!stringp || !*stringp || !**stringp) + return (char*)0; + + res = *stringp; + while(**stringp && !strchr(delim, **stringp)) + ++(*stringp); + + if (**stringp) { + **stringp = '\0'; + ++(*stringp); + } + + return res; +} + + + LRESULT APIENTRY skypiax_skype_present(HWND hWindow, UINT uiMessage, WPARAM uiParam, LPARAM ulParam) { From gmaruzz at freeswitch.org Thu Dec 4 03:46:58 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Thu, 04 Dec 2008 06:46:58 -0500 Subject: [Freeswitch-svn] [commit] r10591 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Thu Dec 4 06:46:57 2008 New Revision: 10591 Log: skypiax: now compiles and kind of works in win32, let see if works in linux Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Thu Dec 4 06:46:57 2008 @@ -34,8 +34,8 @@ * */ -#undef WIN32_SKYPIAX -#undef __CYGWIN__ +#define WIN32_SKYPIAX +#define __CYGWIN__ #define MOD_SKYPIAX #ifdef MOD_SKYPIAX @@ -137,7 +137,7 @@ struct AsteriskHandles { HWND win32_hInit_MainWindowHandle; HWND win32_hGlobal_SkypeAPIWindowHandle; - int fdesc[2]; + switch_file_t *fdesc[2]; }; #endif //WIN32_SKYPIAX @@ -349,11 +349,22 @@ break; case WM_COPYDATA: if (win32_hGlobal_SkypeAPIWindowHandle == (HWND) uiParam) { + unsigned int howmany; + char msg_from_skype[2048]; + PCOPYDATASTRUCT poCopyData = (PCOPYDATASTRUCT) ulParam; - write(win32_AsteriskHandlesSkype->fdesc[1], (const char *) poCopyData->lpData, - strlen((const char *) poCopyData->lpData)); - write(win32_AsteriskHandlesSkype->fdesc[1], "\0", 1); + + memset(msg_from_skype, '\0', sizeof(msg_from_skype)); + strncpy(msg_from_skype, (const char *) poCopyData->lpData, sizeof(msg_from_skype) -2); + + //howmany = strlen((const char *) poCopyData->lpData); + howmany = strlen(msg_from_skype) + 1; + //switch_file_write(win32_AsteriskHandlesSkype->fdesc[1], (const char *) poCopyData->lpData, &howmany); + switch_file_write(win32_AsteriskHandlesSkype->fdesc[1], msg_from_skype, &howmany); + NOTICA("From Skype API: %s\n", SKYPIAX_P_LOG, (const char *) poCopyData->lpData); + //howmany=1; + //switch_file_write(win32_AsteriskHandlesSkype->fdesc[1], "\0", &howmany); lReturnCode = 1; } break; @@ -480,7 +491,12 @@ } #endif //0 - win32_AsteriskHandlesSkype = (struct AsteriskHandles *) obj; + struct skypiax_interface *p; + p = obj; + + switch_file_pipe_create_ex(&p->AsteriskHandlesAst.fdesc[0], &p->AsteriskHandlesAst.fdesc[1], 2, module_pool); + + win32_AsteriskHandlesSkype = &p->AsteriskHandlesAst; win32_uiGlobal_MsgID_SkypeControlAPIAttach = RegisterWindowMessage("SkypeControlAPIAttach"); @@ -742,10 +758,22 @@ p->audiobuf_is_loaded = 1; } else { unsigned int howmany; + short totalbuf[320]; + howmany = len/2; - switch_file_write(p->audiopipe[1], p->audiobuf, &howmany); - howmany = len/2; - switch_file_write(p->audiopipe[1], out, &howmany); + for(i=0; iaudiobuf[i]; + + for(a=0; aaudiopipe[1], totalbuf, &howmany); + //howmany = len/2; + //switch_file_write(p->audiopipe[1], out, &howmany); p->audiobuf_is_loaded = 0; //DEBUGA_SOUND("read=====> req=%d recv=%d to sent=%d sent=%d\n", SKYPIAX_P_LOG, sizeof(short)*GG, len, (len*sizeof(short))/2, sent); } @@ -761,13 +789,19 @@ } } DEBUGA_SKYPE("Skype client GONE\n", SKYPIAX_P_LOG); + //switch_sleep(1000000); + +#ifndef WIN32_SKYPIAX close(fd); +#endif if (exit) break; } DEBUGA_SKYPE("server (I am it) GONE\n", SKYPIAX_P_LOG); +#ifndef WIN32_SKYPIAX close(s); +#endif if (option_debug > 10) { DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); } @@ -810,7 +844,9 @@ if (option_debug > 10) { DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); } +#ifndef WIN32_SKYPIAX close(s); +#endif return NULL; } DEBUGA_SKYPE("started tcp_cli_thread thread.\n", SKYPIAX_P_LOG); @@ -871,13 +907,17 @@ } DEBUGA_SKYPE("Skype server GONE\n", SKYPIAX_P_LOG); +#ifndef WIN32_SKYPIAX close(fd); +#endif if (exit) break; } DEBUGA_SKYPE("client (I am it) GONE\n", SKYPIAX_P_LOG); +#ifndef WIN32_SKYPIAX close(s); +#endif if (option_debug > 10) { DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); } @@ -979,9 +1019,9 @@ switch_file_read(p->audiopipe[0], tech_pvt->read_frame.data, &samples); //if ((samples = read(p->audiopipe[0], buf, SAMPLES_PER_FRAME * sizeof(short))) != 320) - if (samples != 320) { + if (samples != SAMPLES_PER_FRAME * sizeof(short)) { DEBUGA_SKYPE("read=====> NOT GOOD samples=%d expected=%d\n", SKYPIAX_P_LOG, samples, - 320); + SAMPLES_PER_FRAME * sizeof(short)); switch_sleep(1000); //do nothing } else { @@ -2084,6 +2124,8 @@ DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); } DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); +//switch_sleep(1000000); + memset(read_from_pipe, 0, 4096); memset(messaggio, 0, 4096); memset(messaggio_2, 0, 4096); From gmaruzz at freeswitch.org Thu Dec 4 04:31:37 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Thu, 04 Dec 2008 07:31:37 -0500 Subject: [Freeswitch-svn] [commit] r10592 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Thu Dec 4 07:31:37 2008 New Revision: 10592 Log: skypiax: on linux, the problem with tcp_srv_thread audio seems solved, let's see in win32 Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Thu Dec 4 07:31:37 2008 @@ -34,8 +34,8 @@ * */ -#define WIN32_SKYPIAX -#define __CYGWIN__ +#undef WIN32_SKYPIAX +#undef __CYGWIN__ #define MOD_SKYPIAX #ifdef MOD_SKYPIAX @@ -758,12 +758,13 @@ p->audiobuf_is_loaded = 1; } else { unsigned int howmany; - short totalbuf[320]; + short totalbuf[GG]; - howmany = len/2; + howmany = len/2/2; for(i=0; iaudiobuf[i]; + howmany = len/2/2; for(a=0; aaudiopipe[1], out, &howmany); p->audiobuf_is_loaded = 0; - //DEBUGA_SOUND("read=====> req=%d recv=%d to sent=%d sent=%d\n", SKYPIAX_P_LOG, sizeof(short)*GG, len, (len*sizeof(short))/2, sent); + //DEBUGA_SKYPE("read=====> req=%d recv=%d to sent=%d sent=%d\n", SKYPIAX_P_LOG, sizeof(short)*GG, len, (len*sizeof(short))/2, howmany); } } else if (len == 0) { From gmaruzz at freeswitch.org Thu Dec 4 04:36:15 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Thu, 04 Dec 2008 07:36:15 -0500 Subject: [Freeswitch-svn] [commit] r10593 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Thu Dec 4 07:36:15 2008 New Revision: 10593 Log: skypiax: compiles and works on linux and win32, crashes on exit, works only for one call (Heroes... :-) ) Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Thu Dec 4 07:36:15 2008 @@ -34,8 +34,8 @@ * */ -#undef WIN32_SKYPIAX -#undef __CYGWIN__ +#define WIN32_SKYPIAX +#define __CYGWIN__ #define MOD_SKYPIAX #ifdef MOD_SKYPIAX From anthm at freeswitch.org Thu Dec 4 07:22:45 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Thu, 04 Dec 2008 10:22:45 -0500 Subject: [Freeswitch-svn] [commit] r10594 - freeswitch/trunk/src/mod/applications/mod_voicemail Message-ID: Author: anthm Date: Thu Dec 4 10:22:43 2008 New Revision: 10594 Log: MODAPP-174 Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c (original) +++ freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c Thu Dec 4 10:22:43 2008 @@ -2640,6 +2640,7 @@ int send_main = 0; int send_notify = 0; int insert_db = 1; + const char *read_id = NULL; const char *caller_id_name = NULL; const char *caller_id_number = NULL; switch_xml_t x_domain = NULL, x_domain_root = NULL, x_user = NULL, x_params = NULL, x_param = NULL; @@ -2692,6 +2693,8 @@ insert_db = switch_true(val); } else if (!strcasecmp(var, "vm-attach-file")) { email_attach = switch_true(val); + } else if (!strcasecmp(var, "vm-alternate-greet-id")) { + read_id = switch_core_session_strdup(session, val); } } } @@ -2783,9 +2786,10 @@ TRY_CODE(switch_ivr_play_file(session, NULL, cbt.name_path, &args)); } if (*buf == '\0') { - const char *read_id; - if (!(read_id = switch_channel_get_variable(channel, "voicemail_alternate_greet_id"))) { - read_id = id; + if (!read_id) { + if (!(read_id = switch_channel_get_variable(channel, "voicemail_alternate_greet_id"))) { + read_id = id; + } } memset(buf, 0, sizeof(buf)); TRY_CODE(switch_ivr_phrase_macro(session, VM_PLAY_GREETING_MACRO, read_id, NULL, &args)); From gmaruzz at freeswitch.org Thu Dec 4 07:27:28 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Thu, 04 Dec 2008 10:27:28 -0500 Subject: [Freeswitch-svn] [commit] r10595 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_woomera Message-ID: Author: gmaruzz Date: Thu Dec 4 10:27:26 2008 New Revision: 10595 Log: mod_woomera: reverted mod_woomera.2008.vcproj, the makefile for VC++ on Windows Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_woomera/mod_woomera.2008.vcproj Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_woomera/mod_woomera.2008.vcproj ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_woomera/mod_woomera.2008.vcproj (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_woomera/mod_woomera.2008.vcproj Thu Dec 4 10:27:26 2008 @@ -1,8 +1,8 @@ @@ -146,7 +143,7 @@ From mikej at freeswitch.org Thu Dec 4 09:41:03 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Thu, 04 Dec 2008 12:41:03 -0500 Subject: [Freeswitch-svn] [commit] r10596 - freeswitch/trunk/src/mod/endpoints/mod_loopback Message-ID: Author: mikej Date: Thu Dec 4 12:41:02 2008 New Revision: 10596 Log: MODENDP-157 Add other loopback leg uuid to mod_loopback channels Modified: freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c Modified: freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c Thu Dec 4 12:41:02 2008 @@ -257,6 +257,10 @@ switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); goto end; } + + switch_channel_set_variable(channel,"other_loopback_leg_uuid",switch_channel_get_uuid(b_channel)); + switch_channel_set_variable(b_channel,"other_loopback_leg_uuid",switch_channel_get_uuid(channel)); + } if (tech_pvt->other_session) { From mikej at freeswitch.org Thu Dec 4 11:38:15 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Thu, 04 Dec 2008 14:38:15 -0500 Subject: [Freeswitch-svn] [commit] r10598 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: mikej Date: Thu Dec 4 14:38:15 2008 New Revision: 10598 Log: MODENDP-158 xml status feature for mod_sofia does not compile under Windows Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Thu Dec 4 14:38:15 2008 @@ -1413,7 +1413,7 @@ char exp_buf[128] = ""; switch_time_exp_t tm; const int buflen = 2048; - char xmlbuf[buflen]; + char xmlbuf[2048]; if (argv[6]) { switch_time_t etime = atoi(argv[6]); @@ -1630,7 +1630,7 @@ void *val; const void *vvar; const int buflen = 2096; - char xmlbuf[buflen]; + char xmlbuf[2096]; int c = 0; int ac = 0; const char *header = ""; From gmaruzz at freeswitch.org Thu Dec 4 12:42:17 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Thu, 04 Dec 2008 15:42:17 -0500 Subject: [Freeswitch-svn] [commit] r10599 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Thu Dec 4 15:42:15 2008 New Revision: 10599 Log: skypiax: giving timeouts to pipes at least on linux seems to works well. Lets see on win32 Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Thu Dec 4 15:42:15 2008 @@ -34,8 +34,8 @@ * */ -#define WIN32_SKYPIAX -#define __CYGWIN__ +#undef WIN32_SKYPIAX +#undef __CYGWIN__ #define MOD_SKYPIAX #ifdef MOD_SKYPIAX @@ -689,7 +689,7 @@ int i; if (option_debug > 10) { - DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); + WARNINGA("ENTERING FUNC\n", SKYPIAX_P_LOG); } memset(&my_addr, 0, sizeof(my_addr)); my_addr.sin_family = AF_INET; @@ -799,7 +799,7 @@ break; } - DEBUGA_SKYPE("server (I am it) GONE\n", SKYPIAX_P_LOG); + WARNINGA("server (I am it) GONE\n", SKYPIAX_P_LOG); #ifndef WIN32_SKYPIAX close(s); #endif @@ -821,10 +821,10 @@ int a; int i; unsigned int got; - int exit=0; + //int exit=0; if (option_debug > 10) { - DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); + WARNINGA("ENTERING FUNC\n", SKYPIAX_P_LOG); } memset(&my_addr, 0, sizeof(my_addr)); my_addr.sin_family = AF_INET; @@ -864,7 +864,7 @@ fd_set fs; struct timeval to; - exit=1; + //exit=1; @@ -898,24 +898,25 @@ len = send(fd, out, got * 2, 0); if (len == 0) { - DEBUGA_SKYPE("Skype server GONE\n", SKYPIAX_P_LOG); + ERRORA("Skype server GONE\n", SKYPIAX_P_LOG); break; } } else { switch_sleep(1000); + //ERRORA("Audio skype pipe give us: %u\n", SKYPIAX_P_LOG, got); } } } - DEBUGA_SKYPE("Skype server GONE\n", SKYPIAX_P_LOG); + ERRORA("Skype server GONE\n", SKYPIAX_P_LOG); #ifndef WIN32_SKYPIAX close(fd); #endif - if (exit) + //if (exit) break; } - DEBUGA_SKYPE("client (I am it) GONE\n", SKYPIAX_P_LOG); + WARNINGA("client (I am it) GONE\n", SKYPIAX_P_LOG); #ifndef WIN32_SKYPIAX close(s); #endif @@ -936,6 +937,8 @@ //rv = switch_file_pipe_create_ex(&readp, &writep, APR_FULL_NONBLOCK, module_pool); rv = switch_file_pipe_create_ex(&p->audiopipe[0], &p->audiopipe[1], 2, module_pool); + rv = switch_file_pipe_timeout_set(p->audiopipe[0], 100000); + //rv = switch_file_pipe_timeout_set(p->audiopipe[1], 10000); //rv = switch_file_pipe_create(&readp, &writep, module_pool); @@ -968,6 +971,8 @@ */ rv = switch_file_pipe_create_ex(&p->audioskypepipe[0], &p->audioskypepipe[1], 2, module_pool); + rv = switch_file_pipe_timeout_set(p->audioskypepipe[0], 100); + //rv = switch_file_pipe_timeout_set(p->audioskypepipe[1], 10000); #ifdef NOTDEF_WIN32_SKYPIAX c = pipe(p->audioskypepipe); if (c) { @@ -1021,9 +1026,9 @@ //if ((samples = read(p->audiopipe[0], buf, SAMPLES_PER_FRAME * sizeof(short))) != 320) if (samples != SAMPLES_PER_FRAME * sizeof(short)) { - DEBUGA_SKYPE("read=====> NOT GOOD samples=%d expected=%d\n", SKYPIAX_P_LOG, samples, - SAMPLES_PER_FRAME * sizeof(short)); - switch_sleep(1000); + if(samples) + DEBUGA_SKYPE("read=====> NOT GOOD samples=%d expected=%d\n", SKYPIAX_P_LOG, samples, SAMPLES_PER_FRAME * sizeof(short)); + //switch_sleep(1000); //do nothing } else { tech_pvt->read_frame.datalen=samples; @@ -2124,7 +2129,7 @@ if (option_debug > 100) { DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); } - DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); + //DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); //switch_sleep(1000000); memset(read_from_pipe, 0, 4096); @@ -2151,7 +2156,7 @@ if (read_from_pipe[i] == '\0') { - //if (option_debug > 101) + if (option_debug > 101) DEBUGA_SKYPE("read_skype: howmany=%d, i=%d, a=%d, |||%s||| \n", SKYPIAX_P_LOG, howmany, i, a, messaggio); @@ -2656,7 +2661,7 @@ if (option_debug > 100) { DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); } - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + //DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); return 0; } From gmaruzz at freeswitch.org Thu Dec 4 12:46:10 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Thu, 04 Dec 2008 15:46:10 -0500 Subject: [Freeswitch-svn] [commit] r10600 - in freeswitch/branches/gmaruzz/src: . include Message-ID: Author: gmaruzz Date: Thu Dec 4 15:46:10 2008 New Revision: 10600 Log: switch_apr.c and switch_apr.h: added switch_file_pipe_timeout_set and switch_file_pipe_timeout_get Modified: freeswitch/branches/gmaruzz/src/include/switch_apr.h freeswitch/branches/gmaruzz/src/switch_apr.c Modified: freeswitch/branches/gmaruzz/src/include/switch_apr.h ============================================================================== --- freeswitch/branches/gmaruzz/src/include/switch_apr.h (original) +++ freeswitch/branches/gmaruzz/src/include/switch_apr.h Thu Dec 4 15:46:10 2008 @@ -1305,6 +1305,22 @@ SWITCH_DECLARE(switch_status_t) switch_socket_addr_get(switch_sockaddr_t **sa, switch_bool_t remote, switch_socket_t *sock); SWITCH_DECLARE(switch_status_t) switch_file_pipe_create_ex(switch_file_t **in, switch_file_t **out, int32_t blocking, switch_memory_pool_t *p); +/** + * Get the timeout value for a pipe or manipulate the blocking state. + * @param thepipe The pipe we are getting a timeout for. + * @param timeout The current timeout value in microseconds. + */ +SWITCH_DECLARE(switch_status_t) switch_file_pipe_timeout_get(switch_file_t *thepipe, switch_interval_time_t *timeout); + +/** + * Set the timeout value for a pipe or manipulate the blocking state. + * @param thepipe The pipe we are setting a timeout on. + * @param timeout The timeout value in microseconds. Values < 0 mean wait + * forever, 0 means do not wait at all. + */ +SWITCH_DECLARE(switch_status_t) switch_file_pipe_timeout_set(switch_file_t *thepipe, switch_interval_time_t timeout); + + /** @} */ Modified: freeswitch/branches/gmaruzz/src/switch_apr.c ============================================================================== --- freeswitch/branches/gmaruzz/src/switch_apr.c (original) +++ freeswitch/branches/gmaruzz/src/switch_apr.c Thu Dec 4 15:46:10 2008 @@ -948,6 +948,28 @@ return apr_file_pipe_create ((apr_file_t **) in, (apr_file_t **) out, p); } +/** + * Get the timeout value for a pipe or manipulate the blocking state. + * @param thepipe The pipe we are getting a timeout for. + * @param timeout The current timeout value in microseconds. + */ +SWITCH_DECLARE(switch_status_t) switch_file_pipe_timeout_get(switch_file_t *thepipe, switch_interval_time_t *timeout) +{ + return apr_file_pipe_timeout_get( (apr_file_t *)thepipe, (apr_interval_time_t *)timeout); +} + +/** + * Set the timeout value for a pipe or manipulate the blocking state. + * @param thepipe The pipe we are setting a timeout on. + * @param timeout The timeout value in microseconds. Values < 0 mean wait + * forever, 0 means do not wait at all. + */ +SWITCH_DECLARE(switch_status_t) switch_file_pipe_timeout_set(switch_file_t *thepipe, switch_interval_time_t timeout) +{ + return apr_file_pipe_timeout_set( (apr_file_t *)thepipe, (apr_interval_time_t)timeout); +} + + /* For Emacs: * Local Variables: * mode:c From brian at freeswitch.org Thu Dec 4 13:40:44 2008 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Thu, 04 Dec 2008 16:40:44 -0500 Subject: [Freeswitch-svn] [commit] r10601 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: brian Date: Thu Dec 4 16:40:44 2008 New Revision: 10601 Log: formating cleanup Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Thu Dec 4 16:40:44 2008 @@ -1412,8 +1412,8 @@ struct cb_helper *cb = (struct cb_helper *) pArg; char exp_buf[128] = ""; switch_time_exp_t tm; - const int buflen = 2048; - char xmlbuf[2048]; + const int buflen = 2048; + char xmlbuf[2048]; if (argv[6]) { switch_time_t etime = atoi(argv[6]); @@ -1424,14 +1424,14 @@ } cb->stream->write_function(cb->stream, - "\n" + "\n" "%s\n" "%s@%s\n" "%s\n" "%s\n" "%s(%s) EXP(%s)\n" "%s\n" - "\n", + "\n", switch_str_nil(argv[0]), switch_str_nil(argv[1]), switch_str_nil(argv[2]), switch_amp_encode(switch_str_nil(argv[3]),xmlbuf,buflen), switch_str_nil(argv[7]), switch_str_nil(argv[4]), switch_str_nil(argv[5]), exp_buf, switch_str_nil(argv[11])); return 0; From anthm at freeswitch.org Thu Dec 4 14:24:43 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Thu, 04 Dec 2008 17:24:43 -0500 Subject: [Freeswitch-svn] [commit] r10602 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Thu Dec 4 17:24:43 2008 New Revision: 10602 Log: doh Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Thu Dec 4 17:24:43 2008 @@ -1188,7 +1188,7 @@ or did he just suggest it to make our lives miserable? */ use_from_str = from_str; - if (strcasecmp(tech_pvt->caller_profile->caller_id_name, "_undef_")) { + if (!strcasecmp(tech_pvt->caller_profile->caller_id_name, "_undef_")) { from_str = switch_core_session_sprintf(session, "<%s>", use_from_str); } else { from_str = switch_core_session_sprintf(session, "\"%s\" <%s>", tech_pvt->caller_profile->caller_id_name, use_from_str); From mcollins at freeswitch.org Thu Dec 4 16:05:22 2008 From: mcollins at freeswitch.org (FreeSWITCH SVN) Date: Thu, 04 Dec 2008 19:05:22 -0500 Subject: [Freeswitch-svn] [commit] r10603 - freeswitch/trunk/src Message-ID: Author: mcollins Date: Thu Dec 4 19:05:22 2008 New Revision: 10603 Log: Fix progressmsec issue Modified: freeswitch/trunk/src/switch_channel.c Modified: freeswitch/trunk/src/switch_channel.c ============================================================================== --- freeswitch/trunk/src/switch_channel.c (original) +++ freeswitch/trunk/src/switch_channel.c Thu Dec 4 19:05:22 2008 @@ -2307,7 +2307,7 @@ switch_snprintf(tmp, sizeof(tmp), "%d", progressmsec); switch_channel_set_variable(channel, "progressmsec", tmp); - switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, progressusec); + switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, progressmsec); switch_channel_set_variable(channel, "progress_mediamsec", tmp); switch_snprintf(tmp, sizeof(tmp), "%d", legbillmsec); From gmaruzz at freeswitch.org Thu Dec 4 19:51:12 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Thu, 04 Dec 2008 22:51:12 -0500 Subject: [Freeswitch-svn] [commit] r10605 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Thu Dec 4 22:51:12 2008 New Revision: 10605 Log: skypiax: let's try to overcome the lack of timeout on pipe's read on Windows. And closesocket the sockets Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.2008.vcproj freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.2008.vcproj ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.2008.vcproj (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.2008.vcproj Thu Dec 4 22:51:12 2008 @@ -3,7 +3,7 @@ ProjectType="Visual C++" Version="9,00" Name="mod_skypiax" - ProjectGUID="{FE3540C5-3303-46E0-A69E-D92F775687F1}" + ProjectGUID="{C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}" RootNamespace="mod_skypiax" Keyword="Win32Proj" TargetFrameworkVersion="131072" @@ -54,7 +54,7 @@ /> Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Thu Dec 4 22:51:12 2008 @@ -34,8 +34,8 @@ * */ -#undef WIN32_SKYPIAX -#undef __CYGWIN__ +#define WIN32_SKYPIAX +#define __CYGWIN__ #define MOD_SKYPIAX #ifdef MOD_SKYPIAX @@ -687,6 +687,9 @@ int exit = 0; int a; int i; + unsigned int kill_cli_size; + short kill_cli_buff[320]; + private_t *tech_pvt; if (option_debug > 10) { WARNINGA("ENTERING FUNC\n", SKYPIAX_P_LOG); @@ -789,11 +792,20 @@ } } } + + + + p->interface_state = SKYPIAX_STATE_DOWN; + kill_cli_size=320; + switch_file_write(p->audioskypepipe[1], kill_cli_buff, &kill_cli_size); + DEBUGA_SKYPE("Skype client GONE\n", SKYPIAX_P_LOG); //switch_sleep(1000000); #ifndef WIN32_SKYPIAX close(fd); +#else + closesocket(fd); #endif if (exit) break; @@ -802,6 +814,8 @@ WARNINGA("server (I am it) GONE\n", SKYPIAX_P_LOG); #ifndef WIN32_SKYPIAX close(s); +#else + closesocket(s); #endif if (option_debug > 10) { DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); @@ -847,6 +861,8 @@ } #ifndef WIN32_SKYPIAX close(s); +#else + closesocket(s); #endif return NULL; } @@ -911,6 +927,8 @@ ERRORA("Skype server GONE\n", SKYPIAX_P_LOG); #ifndef WIN32_SKYPIAX close(fd); +#else + closesocket(fd); #endif //if (exit) break; @@ -919,6 +937,8 @@ WARNINGA("client (I am it) GONE\n", SKYPIAX_P_LOG); #ifndef WIN32_SKYPIAX close(s); +#else + closesocket(s); #endif if (option_debug > 10) { DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); From gmaruzz at freeswitch.org Thu Dec 4 21:36:25 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 00:36:25 -0500 Subject: [Freeswitch-svn] [commit] r10606 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Fri Dec 5 00:36:24 2008 New Revision: 10606 Log: skypiax: let's try to overcome the lack of timeout on pipe's read on Windows Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Fri Dec 5 00:36:24 2008 @@ -795,8 +795,14 @@ + kill_cli_size=320; + switch_file_write(p->audiopipe[1], kill_cli_buff, &kill_cli_size); + kill_cli_size=320; + switch_file_write(p->audioskypepipe[1], kill_cli_buff, &kill_cli_size); p->interface_state = SKYPIAX_STATE_DOWN; kill_cli_size=320; + switch_file_write(p->audiopipe[1], kill_cli_buff, &kill_cli_size); + kill_cli_size=320; switch_file_write(p->audioskypepipe[1], kill_cli_buff, &kill_cli_size); DEBUGA_SKYPE("Skype client GONE\n", SKYPIAX_P_LOG); @@ -2413,7 +2419,7 @@ } else if (!strcasecmp(value, "FINISHED")) { global_session = NULL; //FIXME - p->skype_callflow = CALLFLOW_STATUS_FINISHED; + //p->skype_callflow = CALLFLOW_STATUS_FINISHED; if (option_debug) DEBUGA_SKYPE("skype_call %s now is DOWN\n", SKYPIAX_P_LOG, id); p->skype_call_id[0] = '\0'; @@ -2422,7 +2428,7 @@ if (option_debug > 100) { DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); } - p->interface_state = SKYPIAX_STATE_DOWN; + //p->interface_state = SKYPIAX_STATE_DOWN; //FIXME if(p->owner) //FIXME p->owner->hangupcause = SKYPIAX_CAUSE_NORMAL; return CALLFLOW_INCOMING_HANGUP; @@ -2805,7 +2811,7 @@ switch_channel_t *channel; - p->interface_state=SKYPIAX_STATE_DOWN; + //p->interface_state=SKYPIAX_STATE_DOWN; //if (option_debug) DEBUGA_SKYPE("skype call ended\n", SKYPIAX_P_LOG); From gmaruzz at freeswitch.org Thu Dec 4 21:58:44 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 00:58:44 -0500 Subject: [Freeswitch-svn] [commit] r10607 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Fri Dec 5 00:58:44 2008 New Revision: 10607 Log: skypiax: compile clean on linux Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Fri Dec 5 00:58:44 2008 @@ -34,8 +34,8 @@ * */ -#define WIN32_SKYPIAX -#define __CYGWIN__ +#undef WIN32_SKYPIAX +#undef __CYGWIN__ #define MOD_SKYPIAX #ifdef MOD_SKYPIAX @@ -689,7 +689,6 @@ int i; unsigned int kill_cli_size; short kill_cli_buff[320]; - private_t *tech_pvt; if (option_debug > 10) { WARNINGA("ENTERING FUNC\n", SKYPIAX_P_LOG); From gmaruzz at freeswitch.org Thu Dec 4 23:06:43 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 02:06:43 -0500 Subject: [Freeswitch-svn] [commit] r10608 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Fri Dec 5 02:06:43 2008 New Revision: 10608 Log: skypiax: indent -gnu -ts4 -br -brs -cdw -lp -ce -nbfda -npcs -nprs -npsl -nbbo -saf -sai -saw -cs -bbo -nhnl -nut -sob -l90 Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Fri Dec 5 02:06:43 2008 @@ -58,11 +58,9 @@ #define WARNINGA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][WARNINGA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); #define NOTICA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][NOTICA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); - //#define SKYPIAX_P_LOG p ? p->owner : NULL, (unsigned long)pthread_self(), __LINE__, p ? p->name ? p->name : "none" : "none", p ? p->owner ? p->owner->_state : -1 : -1, p ? p->interface_state : -1, p ? p->skype_callflow : -1 #define SKYPIAX_P_LOG NULL, (unsigned long)55, __LINE__, p ? p->name ? p->name : "none" : "none", -1, p ? p->interface_state : -1, p ? p->skype_callflow : -1 - /*********************************/ #define SKYPIAX_CAUSE_NORMAL 1 /*********************************/ @@ -111,15 +109,12 @@ /*********************************/ - - #define SKYPIAX_MAX_INTERFACES 64 SWITCH_MODULE_LOAD_FUNCTION(mod_skypiax_load); SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypiax_shutdown); //SWITCH_MODULE_RUNTIME_FUNCTION(mod_skypiax_runtime); -SWITCH_MODULE_DEFINITION(mod_skypiax, mod_skypiax_load, mod_skypiax_shutdown, NULL); //mod_skypiax_runtime); - +SWITCH_MODULE_DEFINITION(mod_skypiax, mod_skypiax_load, mod_skypiax_shutdown, NULL); //mod_skypiax_runtime); switch_endpoint_interface_t *skypiax_endpoint_interface; static switch_memory_pool_t *module_pool = NULL; @@ -142,135 +137,136 @@ #endif //WIN32_SKYPIAX - typedef enum { - TFLAG_IO = (1 << 0), - TFLAG_INBOUND = (1 << 1), - TFLAG_OUTBOUND = (1 << 2), - TFLAG_DTMF = (1 << 3), - TFLAG_VOICE = (1 << 4), - TFLAG_HANGUP = (1 << 5), - TFLAG_LINEAR = (1 << 6), - TFLAG_CODEC = (1 << 7), - TFLAG_BREAK = (1 << 8) + TFLAG_IO = (1 << 0), + TFLAG_INBOUND = (1 << 1), + TFLAG_OUTBOUND = (1 << 2), + TFLAG_DTMF = (1 << 3), + TFLAG_VOICE = (1 << 4), + TFLAG_HANGUP = (1 << 5), + TFLAG_LINEAR = (1 << 6), + TFLAG_CODEC = (1 << 7), + TFLAG_BREAK = (1 << 8) } TFLAGS; typedef enum { - GFLAG_MY_CODEC_PREFS = (1 << 0) + GFLAG_MY_CODEC_PREFS = (1 << 0) } GFLAGS; - static struct { - int debug; - char *ip; - int port; - char *dialplan; - char *codec_string; - char *codec_order[SWITCH_MAX_CODECS]; - int codec_order_last; - char *codec_rates_string; - char *codec_rates[SWITCH_MAX_CODECS]; - int codec_rates_last; - unsigned int flags; - int fd; - int calls; - char hold_music[256]; - switch_mutex_t *mutex; + int debug; + char *ip; + int port; + char *dialplan; + char *codec_string; + char *codec_order[SWITCH_MAX_CODECS]; + int codec_order_last; + char *codec_rates_string; + char *codec_rates[SWITCH_MAX_CODECS]; + int codec_rates_last; + unsigned int flags; + int fd; + int calls; + char hold_music[256]; + switch_mutex_t *mutex; } globals; struct skypiax_interface { - char interface_id[80]; - char name[80]; - char dialplan[80]; - char context[80]; - char dial_regex[256]; - char fail_dial_regex[256]; - char hold_music[256]; - char type[256]; - char X11_display[256]; - struct AsteriskHandles AsteriskHandlesAst; - - int interface_state; /*!< \brief 'state' of the interface (channel) */ - char language[80]; /*!< \brief default Asterisk dialplan language for this interface */ - char exten[80]; /*!< \brief default Asterisk dialplan extension for this interface */ - int skypiax_sound_rate; /*!< \brief rate of the sound device, in Hz, eg: 8000 */ - switch_file_t *skypiax_sound_capt_fd; /*!< \brief file descriptor for sound capture dev */ - char callid_name[50]; - char callid_number[50]; - double playback_boost; - double capture_boost; - int stripmsd; - switch_thread_t *skype_thread; - char skype_call_id[512]; - int skype_call_ongoing; - char skype_friends[4096]; - char skype_fullname[512]; - char skype_displayname[512]; - int skype_callflow; /*!< \brief 'callflow' of the skype interface (as opposed to phone interface) */ - int skype; /*!< \brief config flag, bool, Skype support on this interface (0 if false, -1 if true) */ - int control_to_send; - switch_file_t *audiopipe[2]; - switch_file_t *audioskypepipe[2]; - switch_thread_t *tcp_srv_thread; - switch_thread_t *tcp_cli_thread; - short audiobuf[160]; - int audiobuf_is_loaded; - - //int phonebook_listing; - //int phonebook_querying; - //int phonebook_listing_received_calls; - - //int phonebook_first_entry; - //int phonebook_last_entry; - //int phonebook_number_lenght; - //int phonebook_text_lenght; - FILE *phonebook_writing_fp; - int skypiax_dir_entry_extension_prefix; - void *tech_pvt; + char interface_id[80]; + char name[80]; + char dialplan[80]; + char context[80]; + char dial_regex[256]; + char fail_dial_regex[256]; + char hold_music[256]; + char type[256]; + char X11_display[256]; + struct AsteriskHandles AsteriskHandlesAst; + + int interface_state; /*!< \brief 'state' of the interface (channel) */ + char language[80]; /*!< \brief default Asterisk dialplan language for this interface */ + char exten[80]; /*!< \brief default Asterisk dialplan extension for this interface */ + int skypiax_sound_rate; /*!< \brief rate of the sound device, in Hz, eg: 8000 */ + switch_file_t *skypiax_sound_capt_fd; /*!< \brief file descriptor for sound capture dev */ + char callid_name[50]; + char callid_number[50]; + double playback_boost; + double capture_boost; + int stripmsd; + switch_thread_t *skype_thread; + char skype_call_id[512]; + int skype_call_ongoing; + char skype_friends[4096]; + char skype_fullname[512]; + char skype_displayname[512]; + int skype_callflow; /*!< \brief 'callflow' of the skype interface (as opposed to phone interface) */ + int skype; /*!< \brief config flag, bool, Skype support on this interface (0 if false, -1 if true) */ + int control_to_send; + switch_file_t *audiopipe[2]; + switch_file_t *audioskypepipe[2]; + switch_thread_t *tcp_srv_thread; + switch_thread_t *tcp_cli_thread; + short audiobuf[160]; + int audiobuf_is_loaded; + + //int phonebook_listing; + //int phonebook_querying; + //int phonebook_listing_received_calls; + + //int phonebook_first_entry; + //int phonebook_last_entry; + //int phonebook_number_lenght; + //int phonebook_text_lenght; + FILE *phonebook_writing_fp; + int skypiax_dir_entry_extension_prefix; + void *tech_pvt; }; typedef struct skypiax_interface skypiax_interface_t; static skypiax_interface_t SKYPIAX_INTERFACES[SKYPIAX_MAX_INTERFACES]; - struct private_object { - unsigned int flags; - switch_codec_t read_codec; - switch_codec_t write_codec; - switch_frame_t read_frame; - unsigned char databuf[SWITCH_RECOMMENDED_BUFFER_SIZE]; - switch_core_session_t *session; - switch_caller_profile_t *caller_profile; - switch_mutex_t *mutex; - switch_mutex_t *flag_mutex; - skypiax_interface_t *p; - //switch_thread_cond_t *cond; + unsigned int flags; + switch_codec_t read_codec; + switch_codec_t write_codec; + switch_frame_t read_frame; + unsigned char databuf[SWITCH_RECOMMENDED_BUFFER_SIZE]; + switch_core_session_t *session; + switch_caller_profile_t *caller_profile; + switch_mutex_t *mutex; + switch_mutex_t *flag_mutex; + skypiax_interface_t *p; + //switch_thread_cond_t *cond; }; typedef struct private_object private_t; - - - SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan); SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_string, globals.codec_string); -SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_rates_string, globals.codec_rates_string); +SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_rates_string, + globals.codec_rates_string); SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_ip, globals.ip); - - -static switch_status_t channel_on_init(switch_core_session_t *session); -static switch_status_t channel_on_hangup(switch_core_session_t *session); -static switch_status_t channel_on_routing(switch_core_session_t *session); -static switch_status_t channel_on_exchange_media(switch_core_session_t *session); -static switch_status_t channel_on_soft_execute(switch_core_session_t *session); -static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event, - switch_caller_profile_t *outbound_profile, - switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags); -static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id); -static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id); -static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig); +static switch_status_t channel_on_init(switch_core_session_t * session); +static switch_status_t channel_on_hangup(switch_core_session_t * session); +static switch_status_t channel_on_routing(switch_core_session_t * session); +static switch_status_t channel_on_exchange_media(switch_core_session_t * session); +static switch_status_t channel_on_soft_execute(switch_core_session_t * session); +static switch_call_cause_t channel_outgoing_channel(switch_core_session_t * session, + switch_event_t * var_event, + switch_caller_profile_t * + outbound_profile, + switch_core_session_t ** new_session, + switch_memory_pool_t ** pool, + switch_originate_flag_t flags); +static switch_status_t channel_read_frame(switch_core_session_t * session, + switch_frame_t ** frame, switch_io_flag_t flags, + int stream_id); +static switch_status_t channel_write_frame(switch_core_session_t * session, + switch_frame_t * frame, switch_io_flag_t flags, + int stream_id); +static switch_status_t channel_kill_channel(switch_core_session_t * session, int sig); int option_debug = 100; switch_core_session_t *global_session = NULL; @@ -310,17 +306,16 @@ SKYPECONTROLAPI_ATTACH_API_AVAILABLE = 0x8001 }; - char -*strsep(char **stringp, const char *delim) + *strsep(char **stringp, const char *delim) { char *res; if (!stringp || !*stringp || !**stringp) - return (char*)0; + return (char *) 0; res = *stringp; - while(**stringp && !strchr(delim, **stringp)) + while (**stringp && !strchr(delim, **stringp)) ++(*stringp); if (**stringp) { @@ -331,8 +326,6 @@ return res; } - - LRESULT APIENTRY skypiax_skype_present(HWND hWindow, UINT uiMessage, WPARAM uiParam, LPARAM ulParam) { @@ -349,20 +342,20 @@ break; case WM_COPYDATA: if (win32_hGlobal_SkypeAPIWindowHandle == (HWND) uiParam) { - unsigned int howmany; - char msg_from_skype[2048]; - + unsigned int howmany; + char msg_from_skype[2048]; PCOPYDATASTRUCT poCopyData = (PCOPYDATASTRUCT) ulParam; - memset(msg_from_skype, '\0', sizeof(msg_from_skype)); - strncpy(msg_from_skype, (const char *) poCopyData->lpData, sizeof(msg_from_skype) -2); + memset(msg_from_skype, '\0', sizeof(msg_from_skype)); + strncpy(msg_from_skype, (const char *) poCopyData->lpData, + sizeof(msg_from_skype) - 2); //howmany = strlen((const char *) poCopyData->lpData); howmany = strlen(msg_from_skype) + 1; //switch_file_write(win32_AsteriskHandlesSkype->fdesc[1], (const char *) poCopyData->lpData, &howmany); switch_file_write(win32_AsteriskHandlesSkype->fdesc[1], msg_from_skype, &howmany); - NOTICA("From Skype API: %s\n", SKYPIAX_P_LOG, (const char *) poCopyData->lpData); + NOTICA("From Skype API: %s\n", SKYPIAX_P_LOG, (const char *) poCopyData->lpData); //howmany=1; //switch_file_write(win32_AsteriskHandlesSkype->fdesc[1], "\0", &howmany); lReturnCode = 1; @@ -471,7 +464,7 @@ DWORD win32_dwThreadId; //void *do_skype_thread(void *data) -static void *SWITCH_THREAD_FUNC do_skype_thread(switch_thread_t *thread, void *obj) +static void *SWITCH_THREAD_FUNC do_skype_thread(switch_thread_t * thread, void *obj) { /* create window class */ /* create dummy/hidden window for processing messages */ @@ -487,14 +480,15 @@ if (res) { ERRORA("Unable to create skype pipe, exiting skype thread\n", SKYPIAX_P_LOG); DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - return NULL; + return NULL; } #endif //0 struct skypiax_interface *p; p = obj; - switch_file_pipe_create_ex(&p->AsteriskHandlesAst.fdesc[0], &p->AsteriskHandlesAst.fdesc[1], 2, module_pool); + switch_file_pipe_create_ex(&p->AsteriskHandlesAst.fdesc[0], + &p->AsteriskHandlesAst.fdesc[1], 2, module_pool); win32_AsteriskHandlesSkype = &p->AsteriskHandlesAst; @@ -535,146 +529,149 @@ #endif /* __CYGWIN__ */ - - #endif //WIN32_SKYPIAX - -static switch_status_t skypiax_codec(private_t *tech_pvt, int sample_rate, int codec_ms) +static switch_status_t skypiax_codec(private_t * tech_pvt, int sample_rate, int codec_ms) { - if (switch_core_codec_init(&tech_pvt->read_codec, - "L16", - NULL, sample_rate, codec_ms, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, - NULL) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n"); - return SWITCH_STATUS_FALSE; - } - - if (switch_core_codec_init(&tech_pvt->write_codec, - "L16", - NULL, - sample_rate, codec_ms, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, - NULL) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n"); - switch_core_codec_destroy(&tech_pvt->read_codec); - return SWITCH_STATUS_FALSE; - } - - tech_pvt->read_frame.rate = sample_rate; - tech_pvt->read_frame.codec = &tech_pvt->read_codec; + if (switch_core_codec_init + (&tech_pvt->read_codec, "L16", NULL, sample_rate, codec_ms, 1, + SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, + NULL) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n"); + return SWITCH_STATUS_FALSE; + } + + if (switch_core_codec_init + (&tech_pvt->write_codec, "L16", NULL, sample_rate, codec_ms, 1, + SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, + NULL) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n"); + switch_core_codec_destroy(&tech_pvt->read_codec); + return SWITCH_STATUS_FALSE; + } + tech_pvt->read_frame.rate = sample_rate; + tech_pvt->read_frame.codec = &tech_pvt->read_codec; - switch_core_session_set_read_codec(tech_pvt->session, &tech_pvt->read_codec); - switch_core_session_set_write_codec(tech_pvt->session, &tech_pvt->write_codec); + switch_core_session_set_read_codec(tech_pvt->session, &tech_pvt->read_codec); + switch_core_session_set_write_codec(tech_pvt->session, &tech_pvt->write_codec); - return SWITCH_STATUS_SUCCESS; + return SWITCH_STATUS_SUCCESS; } + #undef PORTAUDIO_ENGAGE #ifdef PORTAUDIO_ENGAGE static switch_status_t engage_device(int sample_rate, int codec_ms) { - PaStreamParameters inputParameters, outputParameters; - PaError err; + PaStreamParameters inputParameters, outputParameters; + PaError err; + + if (!globals.audio_stream) { + if (!sample_rate) { + sample_rate = globals.sample_rate; + } + if (!codec_ms) { + codec_ms = globals.codec_ms; + } + + if (!globals.read_codec.implementation) { + if (switch_core_codec_init + (&globals.read_codec, "L16", NULL, sample_rate, codec_ms, 1, + SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, + NULL) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n"); + return SWITCH_STATUS_FALSE; + } + } + + switch_assert(globals.read_codec.implementation); + + if (!globals.write_codec.implementation) { + if (switch_core_codec_init + (&globals.write_codec, "L16", NULL, sample_rate, codec_ms, 1, + SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, + NULL) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n"); + switch_core_codec_destroy(&globals.read_codec); + return SWITCH_STATUS_FALSE; + } + } + + if (!globals.timer.timer_interface) { + if (switch_core_timer_init + (&globals.timer, globals.timer_name, codec_ms, + globals.read_codec.implementation->samples_per_packet, + module_pool) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "setup timer failed!\n"); + switch_core_codec_destroy(&globals.read_codec); + switch_core_codec_destroy(&globals.write_codec); + return SWITCH_STATUS_FALSE; + } + } + + if (!globals.hold_timer.timer_interface) { + if (switch_core_timer_init + (&globals.hold_timer, globals.timer_name, codec_ms, + globals.read_codec.implementation->samples_per_packet, + module_pool) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + "setup hold timer failed!\n"); + switch_core_codec_destroy(&globals.read_codec); + switch_core_codec_destroy(&globals.write_codec); + switch_core_timer_destroy(&globals.timer); + return SWITCH_STATUS_FALSE; + } + } + + globals.read_frame.rate = sample_rate; + globals.read_frame.codec = &globals.read_codec; - if (!globals.audio_stream) { - if (!sample_rate) { - sample_rate = globals.sample_rate; - } - if (!codec_ms) { - codec_ms = globals.codec_ms; - } - - if (!globals.read_codec.implementation) { - if (switch_core_codec_init(&globals.read_codec, - "L16", - NULL, sample_rate, codec_ms, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, - NULL) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n"); - return SWITCH_STATUS_FALSE; - } - } - - switch_assert(globals.read_codec.implementation); - - if (!globals.write_codec.implementation) { - if (switch_core_codec_init(&globals.write_codec, - "L16", - NULL, - sample_rate, codec_ms, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, - NULL) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n"); - switch_core_codec_destroy(&globals.read_codec); - return SWITCH_STATUS_FALSE; - } - } - - if (!globals.timer.timer_interface) { - if (switch_core_timer_init(&globals.timer, - globals.timer_name, codec_ms, globals.read_codec.implementation->samples_per_packet, - module_pool) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "setup timer failed!\n"); - switch_core_codec_destroy(&globals.read_codec); - switch_core_codec_destroy(&globals.write_codec); - return SWITCH_STATUS_FALSE; - } - } - - if (!globals.hold_timer.timer_interface) { - if (switch_core_timer_init(&globals.hold_timer, - globals.timer_name, codec_ms, globals.read_codec.implementation->samples_per_packet, - module_pool) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "setup hold timer failed!\n"); - switch_core_codec_destroy(&globals.read_codec); - switch_core_codec_destroy(&globals.write_codec); - switch_core_timer_destroy(&globals.timer); - return SWITCH_STATUS_FALSE; - } - } - - globals.read_frame.rate = sample_rate; - globals.read_frame.codec = &globals.read_codec; - - switch_mutex_lock(globals.device_lock); - /* LOCKED ************************************************************************************************** */ - inputParameters.device = globals.indev; - inputParameters.channelCount = 1; - inputParameters.sampleFormat = SAMPLE_TYPE; - inputParameters.suggestedLatency = Pa_GetDeviceInfo(inputParameters.device)->defaultLowInputLatency; - inputParameters.hostApiSpecificStreamInfo = NULL; - - outputParameters.device = globals.outdev; - outputParameters.channelCount = 1; - outputParameters.sampleFormat = SAMPLE_TYPE; - outputParameters.suggestedLatency = Pa_GetDeviceInfo(outputParameters.device)->defaultLowOutputLatency; - outputParameters.hostApiSpecificStreamInfo = NULL; - err = OpenAudioStream(&globals.audio_stream, &inputParameters, &outputParameters, sample_rate, paClipOff, - globals.read_codec.implementation->samples_per_packet); - /* UNLOCKED ************************************************************************************************* */ - switch_mutex_unlock(globals.device_lock); - - if (err != paNoError) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't open audio device!\n"); - switch_core_codec_destroy(&globals.read_codec); - switch_core_codec_destroy(&globals.write_codec); - switch_core_timer_destroy(&globals.timer); - switch_core_timer_destroy(&globals.hold_timer); - return SWITCH_STATUS_FALSE; - } - } + switch_mutex_lock(globals.device_lock); + /* LOCKED ************************************************************************************************** */ + inputParameters.device = globals.indev; + inputParameters.channelCount = 1; + inputParameters.sampleFormat = SAMPLE_TYPE; + inputParameters.suggestedLatency = + Pa_GetDeviceInfo(inputParameters.device)->defaultLowInputLatency; + inputParameters.hostApiSpecificStreamInfo = NULL; + + outputParameters.device = globals.outdev; + outputParameters.channelCount = 1; + outputParameters.sampleFormat = SAMPLE_TYPE; + outputParameters.suggestedLatency = + Pa_GetDeviceInfo(outputParameters.device)->defaultLowOutputLatency; + outputParameters.hostApiSpecificStreamInfo = NULL; + err = + OpenAudioStream(&globals.audio_stream, &inputParameters, &outputParameters, + sample_rate, paClipOff, + globals.read_codec.implementation->samples_per_packet); + /* UNLOCKED ************************************************************************************************* */ + switch_mutex_unlock(globals.device_lock); + + if (err != paNoError) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + "Can't open audio device!\n"); + switch_core_codec_destroy(&globals.read_codec); + switch_core_codec_destroy(&globals.write_codec); + switch_core_timer_destroy(&globals.timer); + switch_core_timer_destroy(&globals.hold_timer); + return SWITCH_STATUS_FALSE; + } + } - return SWITCH_STATUS_SUCCESS; + return SWITCH_STATUS_SUCCESS; } #endif // PORTAUDIO_ENGAGE - #define SKYPE_AUDIO #ifdef SKYPE_AUDIO #define SAMPLES_PER_FRAME 160 #define NN 160 #define GG 160 -static void *SWITCH_THREAD_FUNC skypiax_do_tcp_srv_thread(switch_thread_t *thread, void *obj) +static void *SWITCH_THREAD_FUNC skypiax_do_tcp_srv_thread(switch_thread_t * thread, + void *obj) { struct skypiax_interface *p = obj; short in[GG]; @@ -696,8 +693,8 @@ memset(&my_addr, 0, sizeof(my_addr)); my_addr.sin_family = AF_INET; //my_addr.sin_addr.s_addr = INADDR_ANY; - my_addr.sin_addr.s_addr = htonl(0x7f000001); /* use the localhost */ - my_addr.sin_port = htons(5556); //FIXME configurable! + my_addr.sin_addr.s_addr = htonl(0x7f000001); /* use the localhost */ + my_addr.sin_port = htons(5556); //FIXME configurable! if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) { ERRORA("socket Error\n", SKYPIAX_P_LOG); @@ -721,87 +718,82 @@ sin_size = sizeof(remote_addr); while ((fd = accept(s, (struct sockaddr *) &remote_addr, &sin_size)) > 0) { DEBUGA_SKYPE("ACCEPTED\n", SKYPIAX_P_LOG); - while (p->interface_state != SKYPIAX_STATE_DOWN && (p->skype_callflow == CALLFLOW_STATUS_INPROGRESS ||p->skype_callflow == SKYPIAX_STATE_UP)) { - - int fdselect; - int rt; - fd_set fs; - struct timeval to; - - exit=1; - - - - - - - fdselect = fd; - FD_ZERO(&fs); - FD_SET(fdselect, &fs); - to.tv_usec = 100; - to.tv_sec = 0; - rt = select(fdselect + 1, &fs, NULL, NULL, &to); - if (rt > 0) { - - len = recv(fd, in, sizeof(short) * GG, 0); - //DEBUGA_SKYPE("recv %d\n", SKYPIAX_P_LOG, len); - if (len > 0) { - a = 0; - for (i = 0; i < len / sizeof(short); i++) { - out[a] = in[i]; - i++; - a++; - } - - if (!p->audiobuf_is_loaded) { - for (i = 0; i < (len / sizeof(short)) / 2; i++) { - p->audiobuf[i] = out[i]; + while (p->interface_state != SKYPIAX_STATE_DOWN + && (p->skype_callflow == CALLFLOW_STATUS_INPROGRESS + || p->skype_callflow == SKYPIAX_STATE_UP)) { + + int fdselect; + int rt; + fd_set fs; + struct timeval to; + + exit = 1; + + fdselect = fd; + FD_ZERO(&fs); + FD_SET(fdselect, &fs); + to.tv_usec = 100; + to.tv_sec = 0; + rt = select(fdselect + 1, &fs, NULL, NULL, &to); + if (rt > 0) { + + len = recv(fd, in, sizeof(short) * GG, 0); + //DEBUGA_SKYPE("recv %d\n", SKYPIAX_P_LOG, len); + if (len > 0) { + a = 0; + for (i = 0; i < len / sizeof(short); i++) { + out[a] = in[i]; + i++; + a++; } - p->audiobuf_is_loaded = 1; - } else { - unsigned int howmany; + + if (!p->audiobuf_is_loaded) { + for (i = 0; i < (len / sizeof(short)) / 2; i++) { + p->audiobuf[i] = out[i]; + } + p->audiobuf_is_loaded = 1; + } else { + unsigned int howmany; short totalbuf[GG]; - howmany = len/2/2; - for(i=0; iaudiobuf[i]; - - howmany = len/2/2; - for(a=0; aaudiobuf[i]; + + howmany = len / 2 / 2; + for (a = 0; a < howmany; a++) { + totalbuf[i] = out[a]; + i++; } howmany = len; - switch_file_write(p->audiopipe[1], totalbuf, &howmany); - //howmany = len/2; - //switch_file_write(p->audiopipe[1], out, &howmany); - p->audiobuf_is_loaded = 0; - //DEBUGA_SKYPE("read=====> req=%d recv=%d to sent=%d sent=%d\n", SKYPIAX_P_LOG, sizeof(short)*GG, len, (len*sizeof(short))/2, howmany); - } + switch_file_write(p->audiopipe[1], totalbuf, &howmany); + //howmany = len/2; + //switch_file_write(p->audiopipe[1], out, &howmany); + p->audiobuf_is_loaded = 0; + //DEBUGA_SKYPE("read=====> req=%d recv=%d to sent=%d sent=%d\n", SKYPIAX_P_LOG, sizeof(short)*GG, len, (len*sizeof(short))/2, howmany); + } - } else if (len == 0) { - DEBUGA_SKYPE("Skype client GONE\n", SKYPIAX_P_LOG); - break; - } else { - ERRORA("len=%d\n", SKYPIAX_P_LOG, len); - exit = 1; - break; + } else if (len == 0) { + DEBUGA_SKYPE("Skype client GONE\n", SKYPIAX_P_LOG); + break; + } else { + ERRORA("len=%d\n", SKYPIAX_P_LOG, len); + exit = 1; + break; + } } - } } - - - kill_cli_size=320; + kill_cli_size = 320; switch_file_write(p->audiopipe[1], kill_cli_buff, &kill_cli_size); - kill_cli_size=320; + kill_cli_size = 320; switch_file_write(p->audioskypepipe[1], kill_cli_buff, &kill_cli_size); p->interface_state = SKYPIAX_STATE_DOWN; - kill_cli_size=320; + kill_cli_size = 320; switch_file_write(p->audiopipe[1], kill_cli_buff, &kill_cli_size); - kill_cli_size=320; + kill_cli_size = 320; switch_file_write(p->audioskypepipe[1], kill_cli_buff, &kill_cli_size); DEBUGA_SKYPE("Skype client GONE\n", SKYPIAX_P_LOG); @@ -827,7 +819,8 @@ } return NULL; } -static void *SWITCH_THREAD_FUNC skypiax_do_tcp_cli_thread(switch_thread_t *thread, void *obj) +static void *SWITCH_THREAD_FUNC skypiax_do_tcp_cli_thread(switch_thread_t * thread, + void *obj) //void *skypiax_do_tcp_cli_thread(void *data) { struct skypiax_interface *p = obj; @@ -848,8 +841,8 @@ memset(&my_addr, 0, sizeof(my_addr)); my_addr.sin_family = AF_INET; //my_addr.sin_addr.s_addr = INADDR_ANY; - my_addr.sin_addr.s_addr = htonl(0x7f000001); /* use the localhost */ - my_addr.sin_port = htons(5558); //FIXME configurable! + my_addr.sin_addr.s_addr = htonl(0x7f000001); /* use the localhost */ + my_addr.sin_port = htons(5558); //FIXME configurable! if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) { ERRORA("socket Error\n", SKYPIAX_P_LOG); @@ -865,9 +858,9 @@ DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); } #ifndef WIN32_SKYPIAX - close(s); + close(s); #else - closesocket(s); + closesocket(s); #endif return NULL; } @@ -879,54 +872,50 @@ while ((fd = accept(s, (struct sockaddr *) &remote_addr, &sin_size)) > 0) { DEBUGA_SKYPE("ACCEPTED\n", SKYPIAX_P_LOG); //while (1 && p->owner && p->owner->_state == SKYPIAX_STATE_UP) FIXME FIXME FIXME - while (p->interface_state != SKYPIAX_STATE_DOWN && (p->skype_callflow == CALLFLOW_STATUS_INPROGRESS ||p->skype_callflow == SKYPIAX_STATE_UP)) { - int fdselect; - int rt; - fd_set fs; - struct timeval to; - - //exit=1; - - - - - - - //fdselect = p->audioskypepipe[0]; - fdselect=1; - FD_ZERO(&fs); - FD_SET(fdselect, &fs); - to.tv_usec = 100; - to.tv_sec = 0; - //rt = select(fdselect + 1, &fs, NULL, NULL, &to); - rt=1; - if (rt > 0) { - - - got = (NN / 2) * sizeof(short); - switch_file_read(p->audioskypepipe[0], in, &got); - //ERRORA("got %d\n", SKYPIAX_P_LOG, got); - - if (got > 0) { - a = 0; - for (i = 0; i < got / sizeof(short); i++) { - out[a] = in[i]; - a++; - out[a] = in[i]; - a++; - } + while (p->interface_state != SKYPIAX_STATE_DOWN + && (p->skype_callflow == CALLFLOW_STATUS_INPROGRESS + || p->skype_callflow == SKYPIAX_STATE_UP)) { + int fdselect; + int rt; + fd_set fs; + struct timeval to; + + //exit=1; + + //fdselect = p->audioskypepipe[0]; + fdselect = 1; + FD_ZERO(&fs); + FD_SET(fdselect, &fs); + to.tv_usec = 100; + to.tv_sec = 0; + //rt = select(fdselect + 1, &fs, NULL, NULL, &to); + rt = 1; + if (rt > 0) { + + got = (NN / 2) * sizeof(short); + switch_file_read(p->audioskypepipe[0], in, &got); + //ERRORA("got %d\n", SKYPIAX_P_LOG, got); + + if (got > 0) { + a = 0; + for (i = 0; i < got / sizeof(short); i++) { + out[a] = in[i]; + a++; + out[a] = in[i]; + a++; + } - len = send(fd, out, got * 2, 0); + len = send(fd, out, got * 2, 0); - if (len == 0) { - ERRORA("Skype server GONE\n", SKYPIAX_P_LOG); - break; + if (len == 0) { + ERRORA("Skype server GONE\n", SKYPIAX_P_LOG); + break; + } + } else { + switch_sleep(1000); + //ERRORA("Audio skype pipe give us: %u\n", SKYPIAX_P_LOG, got); } - } else { - switch_sleep(1000); - //ERRORA("Audio skype pipe give us: %u\n", SKYPIAX_P_LOG, got); } - } } ERRORA("Skype server GONE\n", SKYPIAX_P_LOG); @@ -936,7 +925,7 @@ closesocket(fd); #endif //if (exit) - break; + break; } WARNINGA("client (I am it) GONE\n", SKYPIAX_P_LOG); @@ -951,21 +940,19 @@ return NULL; } - int skypiax_skypeaudio_init(struct skypiax_interface *p) { //switch_file_t *readp = NULL; //switch_file_t *writep = NULL; - switch_status_t rv; - - //rv = switch_file_pipe_create_ex(&readp, &writep, APR_FULL_NONBLOCK, module_pool); - rv = switch_file_pipe_create_ex(&p->audiopipe[0], &p->audiopipe[1], 2, module_pool); - rv = switch_file_pipe_timeout_set(p->audiopipe[0], 100000); - //rv = switch_file_pipe_timeout_set(p->audiopipe[1], 10000); - //rv = switch_file_pipe_create(&readp, &writep, module_pool); + switch_status_t rv; + //rv = switch_file_pipe_create_ex(&readp, &writep, APR_FULL_NONBLOCK, module_pool); + rv = switch_file_pipe_create_ex(&p->audiopipe[0], &p->audiopipe[1], 2, module_pool); + rv = switch_file_pipe_timeout_set(p->audiopipe[0], 100000); + //rv = switch_file_pipe_timeout_set(p->audiopipe[1], 10000); + //rv = switch_file_pipe_create(&readp, &writep, module_pool); //FIXME int c; #if 0 @@ -995,9 +982,11 @@ } */ - rv = switch_file_pipe_create_ex(&p->audioskypepipe[0], &p->audioskypepipe[1], 2, module_pool); - rv = switch_file_pipe_timeout_set(p->audioskypepipe[0], 100); - //rv = switch_file_pipe_timeout_set(p->audioskypepipe[1], 10000); + rv = + switch_file_pipe_create_ex(&p->audioskypepipe[0], &p->audioskypepipe[1], 2, + module_pool); + rv = switch_file_pipe_timeout_set(p->audioskypepipe[0], 100); + //rv = switch_file_pipe_timeout_set(p->audioskypepipe[1], 10000); #ifdef NOTDEF_WIN32_SKYPIAX c = pipe(p->audioskypepipe); if (c) { @@ -1009,16 +998,16 @@ } fcntl(p->audioskypepipe[0], F_SETFL, O_NONBLOCK); fcntl(p->audioskypepipe[1], F_SETFL, O_NONBLOCK); -#endif// WIN32_SKYPIAX +#endif // WIN32_SKYPIAX if (option_debug > 10) { DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); } return 0; } -static switch_status_t skypiax_skypeaudio_read(private_t *tech_pvt) +static switch_status_t skypiax_skypeaudio_read(private_t * tech_pvt) { - struct skypiax_interface *p; + struct skypiax_interface *p; short buf[640]; unsigned int samples; //int fd; @@ -1026,10 +1015,9 @@ //fd_set fs; //struct timeval to; - p = tech_pvt->p; - - //DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); + p = tech_pvt->p; + //DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); memset(buf, '\0', sizeof(buf)); @@ -1041,32 +1029,31 @@ to.tv_sec = 0; rt = select(fd + 1, &fs, NULL, NULL, &to); #endif - rt=1; + rt = 1; if (rt > 0) { + samples = SAMPLES_PER_FRAME * sizeof(short); - samples = SAMPLES_PER_FRAME * sizeof(short); - - switch_file_read(p->audiopipe[0], tech_pvt->read_frame.data, &samples); + switch_file_read(p->audiopipe[0], tech_pvt->read_frame.data, &samples); - //if ((samples = read(p->audiopipe[0], buf, SAMPLES_PER_FRAME * sizeof(short))) != 320) - if (samples != SAMPLES_PER_FRAME * sizeof(short)) { - if(samples) - DEBUGA_SKYPE("read=====> NOT GOOD samples=%d expected=%d\n", SKYPIAX_P_LOG, samples, SAMPLES_PER_FRAME * sizeof(short)); - //switch_sleep(1000); - //do nothing - } else { - tech_pvt->read_frame.datalen=samples; - //DEBUGA_SKYPE("read=====> GOOD samples=%d\n", SKYPIAX_P_LOG, samples); - /* A real frame */ - } + //if ((samples = read(p->audiopipe[0], buf, SAMPLES_PER_FRAME * sizeof(short))) != 320) + if (samples != SAMPLES_PER_FRAME * sizeof(short)) { + if (samples) + DEBUGA_SKYPE("read=====> NOT GOOD samples=%d expected=%d\n", SKYPIAX_P_LOG, + samples, SAMPLES_PER_FRAME * sizeof(short)); + //switch_sleep(1000); + //do nothing + } else { + tech_pvt->read_frame.datalen = samples; + //DEBUGA_SKYPE("read=====> GOOD samples=%d\n", SKYPIAX_P_LOG, samples); + /* A real frame */ + } } else { DEBUGA_SKYPE("select returned %d\n", SKYPIAX_P_LOG, rt); - } - //DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + //DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); return SWITCH_STATUS_SUCCESS; } @@ -1124,280 +1111,292 @@ #endif //0 #endif /* SKYPE_AUDIO */ -static void tech_init(private_t *tech_pvt, switch_core_session_t *session, skypiax_interface_t *p) +static void tech_init(private_t * tech_pvt, switch_core_session_t * session, + skypiax_interface_t * p) { - //struct skypiax_interface *p = NULL; + //struct skypiax_interface *p = NULL; - DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); - tech_pvt->read_frame.data = tech_pvt->databuf; - tech_pvt->read_frame.buflen = sizeof(tech_pvt->databuf); - switch_mutex_init(&tech_pvt->mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session)); - switch_mutex_init(&tech_pvt->flag_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session)); - switch_core_session_set_private(session, tech_pvt); - tech_pvt->session = session; - if(p){ - tech_pvt->p=p; - p->tech_pvt=tech_pvt; - - } -if ( skypiax_codec(tech_pvt, 8000, 20) != SWITCH_STATUS_SUCCESS) -{ - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "skypiax_docec FAILED\n"); -} else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "skypiax_codec SUCCESS\n"); -} + DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); + tech_pvt->read_frame.data = tech_pvt->databuf; + tech_pvt->read_frame.buflen = sizeof(tech_pvt->databuf); + switch_mutex_init(&tech_pvt->mutex, SWITCH_MUTEX_NESTED, + switch_core_session_get_pool(session)); + switch_mutex_init(&tech_pvt->flag_mutex, SWITCH_MUTEX_NESTED, + switch_core_session_get_pool(session)); + switch_core_session_set_private(session, tech_pvt); + tech_pvt->session = session; + if (p) { + tech_pvt->p = p; + p->tech_pvt = tech_pvt; - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + } + if (skypiax_codec(tech_pvt, 8000, 20) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "skypiax_docec FAILED\n"); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "skypiax_codec SUCCESS\n"); + } + + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); } + /* State methods they get called when the state changes to the specific state returning SWITCH_STATUS_SUCCESS tells the core to execute the standard state method next so if you fully implement the state you can return SWITCH_STATUS_FALSE to skip it. */ -static switch_status_t channel_on_init(switch_core_session_t *session) +static switch_status_t channel_on_init(switch_core_session_t * session) { - switch_channel_t *channel; - private_t *tech_pvt = NULL; - - tech_pvt = switch_core_session_get_private(session); - assert(tech_pvt != NULL); + switch_channel_t *channel; + private_t *tech_pvt = NULL; - channel = switch_core_session_get_channel(session); - assert(channel != NULL); - switch_set_flag_locked(tech_pvt, TFLAG_IO); + tech_pvt = switch_core_session_get_private(session); + assert(tech_pvt != NULL); - /* Move channel's state machine to ROUTING. This means the call is trying - to get from the initial start where the call because, to the point - where a destination has been identified. If the channel is simply - left in the initial state, nothing will happen. */ - switch_channel_set_state(channel, CS_ROUTING); - switch_mutex_lock(globals.mutex); - globals.calls++; - switch_mutex_unlock(globals.mutex); + channel = switch_core_session_get_channel(session); + assert(channel != NULL); + switch_set_flag_locked(tech_pvt, TFLAG_IO); + + /* Move channel's state machine to ROUTING. This means the call is trying + to get from the initial start where the call because, to the point + where a destination has been identified. If the channel is simply + left in the initial state, nothing will happen. */ + switch_channel_set_state(channel, CS_ROUTING); + switch_mutex_lock(globals.mutex); + globals.calls++; + switch_mutex_unlock(globals.mutex); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL INIT\n", switch_channel_get_name(channel)); - return SWITCH_STATUS_SUCCESS; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL INIT\n", + switch_channel_get_name(channel)); + return SWITCH_STATUS_SUCCESS; } -static switch_status_t channel_on_routing(switch_core_session_t *session) +static switch_status_t channel_on_routing(switch_core_session_t * session) { - switch_channel_t *channel = NULL; - private_t *tech_pvt = NULL; + switch_channel_t *channel = NULL; + private_t *tech_pvt = NULL; - channel = switch_core_session_get_channel(session); - assert(channel != NULL); + channel = switch_core_session_get_channel(session); + assert(channel != NULL); - tech_pvt = switch_core_session_get_private(session); - assert(tech_pvt != NULL); + tech_pvt = switch_core_session_get_private(session); + assert(tech_pvt != NULL); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL ROUTING\n", switch_channel_get_name(channel)); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL ROUTING\n", + switch_channel_get_name(channel)); - return SWITCH_STATUS_SUCCESS; + return SWITCH_STATUS_SUCCESS; } -static switch_status_t channel_on_execute(switch_core_session_t *session) +static switch_status_t channel_on_execute(switch_core_session_t * session) { - switch_channel_t *channel = NULL; - private_t *tech_pvt = NULL; - - channel = switch_core_session_get_channel(session); - assert(channel != NULL); + switch_channel_t *channel = NULL; + private_t *tech_pvt = NULL; - tech_pvt = switch_core_session_get_private(session); - assert(tech_pvt != NULL); + channel = switch_core_session_get_channel(session); + assert(channel != NULL); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL EXECUTE\n", switch_channel_get_name(channel)); + tech_pvt = switch_core_session_get_private(session); + assert(tech_pvt != NULL); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL EXECUTE\n", + switch_channel_get_name(channel)); - return SWITCH_STATUS_SUCCESS; + return SWITCH_STATUS_SUCCESS; } -static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig) +static switch_status_t channel_kill_channel(switch_core_session_t * session, int sig) { - switch_channel_t *channel = NULL; - private_t *tech_pvt = NULL; - - channel = switch_core_session_get_channel(session); - assert(channel != NULL); + switch_channel_t *channel = NULL; + private_t *tech_pvt = NULL; - tech_pvt = switch_core_session_get_private(session); - assert(tech_pvt != NULL); + channel = switch_core_session_get_channel(session); + assert(channel != NULL); - switch (sig) { - case SWITCH_SIG_KILL: - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL got SWITCH_SIG_KILL\n", switch_channel_get_name(channel)); - switch_clear_flag_locked(tech_pvt, TFLAG_IO); - switch_clear_flag_locked(tech_pvt, TFLAG_VOICE); - switch_set_flag_locked(tech_pvt, TFLAG_HANGUP); - //switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); - //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "CHANNEL after TFLAG_HUP\n"); - //switch_thread_cond_signal(tech_pvt->cond); - break; - case SWITCH_SIG_BREAK: - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL got SWITCH_SIG_BREAK\n", switch_channel_get_name(channel)); - switch_set_flag_locked(tech_pvt, TFLAG_BREAK); - break; - default: - break; - } + tech_pvt = switch_core_session_get_private(session); + assert(tech_pvt != NULL); + + switch (sig) { + case SWITCH_SIG_KILL: + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + "%s CHANNEL got SWITCH_SIG_KILL\n", + switch_channel_get_name(channel)); + switch_clear_flag_locked(tech_pvt, TFLAG_IO); + switch_clear_flag_locked(tech_pvt, TFLAG_VOICE); + switch_set_flag_locked(tech_pvt, TFLAG_HANGUP); + //switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); + //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "CHANNEL after TFLAG_HUP\n"); + //switch_thread_cond_signal(tech_pvt->cond); + break; + case SWITCH_SIG_BREAK: + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + "%s CHANNEL got SWITCH_SIG_BREAK\n", + switch_channel_get_name(channel)); + switch_set_flag_locked(tech_pvt, TFLAG_BREAK); + break; + default: + break; + } - return SWITCH_STATUS_SUCCESS; + return SWITCH_STATUS_SUCCESS; } -static switch_status_t channel_on_exchange_media(switch_core_session_t *session) +static switch_status_t channel_on_exchange_media(switch_core_session_t * session) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL LOOPBACK\n"); - return SWITCH_STATUS_SUCCESS; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL LOOPBACK\n"); + return SWITCH_STATUS_SUCCESS; } -static switch_status_t channel_on_soft_execute(switch_core_session_t *session) +static switch_status_t channel_on_soft_execute(switch_core_session_t * session) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL TRANSMIT\n"); - return SWITCH_STATUS_SUCCESS; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL TRANSMIT\n"); + return SWITCH_STATUS_SUCCESS; } -static switch_status_t channel_send_dtmf(switch_core_session_t *session, const switch_dtmf_t *dtmf) +static switch_status_t channel_send_dtmf(switch_core_session_t * session, + const switch_dtmf_t * dtmf) { - private_t *tech_pvt = switch_core_session_get_private(session); - switch_assert(tech_pvt != NULL); + private_t *tech_pvt = switch_core_session_get_private(session); + switch_assert(tech_pvt != NULL); - return SWITCH_STATUS_SUCCESS; + return SWITCH_STATUS_SUCCESS; } -static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id) -{ - switch_channel_t *channel = NULL; - private_t *tech_pvt = NULL; - //switch_time_t started = switch_time_now(); - //unsigned int elapsed; - switch_byte_t *data; - - - channel = switch_core_session_get_channel(session); - assert(channel != NULL); - - tech_pvt = switch_core_session_get_private(session); - assert(tech_pvt != NULL); - tech_pvt->read_frame.flags = SFF_NONE; - *frame = NULL; +static switch_status_t channel_read_frame(switch_core_session_t * session, + switch_frame_t ** frame, switch_io_flag_t flags, + int stream_id) +{ + switch_channel_t *channel = NULL; + private_t *tech_pvt = NULL; + //switch_time_t started = switch_time_now(); + //unsigned int elapsed; + switch_byte_t *data; + + channel = switch_core_session_get_channel(session); + assert(channel != NULL); + + tech_pvt = switch_core_session_get_private(session); + assert(tech_pvt != NULL); + tech_pvt->read_frame.flags = SFF_NONE; + *frame = NULL; + if (skypiax_skypeaudio_read(tech_pvt) != SWITCH_STATUS_SUCCESS) { -if ( skypiax_skypeaudio_read(tech_pvt) != SWITCH_STATUS_SUCCESS ) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + "skypiax_skypeaudio_read ERROR\n"); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "skypiax_skypeaudio_read ERROR\n"); - -} else { - switch_set_flag_locked(tech_pvt, TFLAG_VOICE); - //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "skypiax_skypeaudio_read SUCCESS\n"); - -} + } else { + switch_set_flag_locked(tech_pvt, TFLAG_VOICE); + //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "skypiax_skypeaudio_read SUCCESS\n"); - while (switch_test_flag(tech_pvt, TFLAG_IO)) { - if (switch_test_flag(tech_pvt, TFLAG_BREAK)) { - switch_clear_flag(tech_pvt, TFLAG_BREAK); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL READ FRAME goto CNG\n"); - goto cng; - } + } - if (!switch_test_flag(tech_pvt, TFLAG_IO)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL READ FRAME not IO\n"); - return SWITCH_STATUS_FALSE; - } + while (switch_test_flag(tech_pvt, TFLAG_IO)) { + if (switch_test_flag(tech_pvt, TFLAG_BREAK)) { + switch_clear_flag(tech_pvt, TFLAG_BREAK); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + "CHANNEL READ FRAME goto CNG\n"); + goto cng; + } + if (!switch_test_flag(tech_pvt, TFLAG_IO)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + "CHANNEL READ FRAME not IO\n"); + return SWITCH_STATUS_FALSE; + } #if 0 - if ((samples = read(p->audiopipe[0], buf, SAMPLES_PER_FRAME * sizeof(short))) != 320) { - DEBUGA_SOUND("read=====> NOT GOOD samples=%d expected=%d\n", SKYPIAX_P_LOG, samples, - SAMPLES_PER_FRAME * sizeof(short)); - switch_sleep(100); - //do nothing - } else { - //DEBUGA_SOUND("read=====> GOOD samples=%d\n", SKYPIAX_P_LOG, samples); - /* A real frame */ - f.frametype = SKYPIAX_FRAME_VOICE; - f.subclass = SKYPIAX_FORMAT_SLINEAR; - f.samples = SKYPIAX_FRAME_SIZE; - f.datalen = SKYPIAX_FRAME_SIZE * 2; - f.data = buf; - f.offset = SKYPIAX_FRIENDLY_OFFSET; - f.src = skypiax_type; - f.mallocd = 0; - } + if ((samples = read(p->audiopipe[0], buf, SAMPLES_PER_FRAME * sizeof(short))) != 320) { + DEBUGA_SOUND("read=====> NOT GOOD samples=%d expected=%d\n", SKYPIAX_P_LOG, samples, + SAMPLES_PER_FRAME * sizeof(short)); + switch_sleep(100); + //do nothing + } else { + //DEBUGA_SOUND("read=====> GOOD samples=%d\n", SKYPIAX_P_LOG, samples); + /* A real frame */ + f.frametype = SKYPIAX_FRAME_VOICE; + f.subclass = SKYPIAX_FORMAT_SLINEAR; + f.samples = SKYPIAX_FRAME_SIZE; + f.datalen = SKYPIAX_FRAME_SIZE * 2; + f.data = buf; + f.offset = SKYPIAX_FRIENDLY_OFFSET; + f.src = skypiax_type; + f.mallocd = 0; + } #endif - //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "============>\n"); - + //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "============>\n"); - if (switch_test_flag(tech_pvt, TFLAG_IO) && switch_test_flag(tech_pvt, TFLAG_VOICE)) { - switch_clear_flag_locked(tech_pvt, TFLAG_VOICE); - if (!tech_pvt->read_frame.datalen) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL READ CONTINUE\n"); - continue; - } - *frame = &tech_pvt->read_frame; + if (switch_test_flag(tech_pvt, TFLAG_IO) && switch_test_flag(tech_pvt, TFLAG_VOICE)) { + switch_clear_flag_locked(tech_pvt, TFLAG_VOICE); + if (!tech_pvt->read_frame.datalen) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + "CHANNEL READ CONTINUE\n"); + continue; + } + *frame = &tech_pvt->read_frame; #ifdef BIGENDIAN - if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) { - switch_swap_linear((*frame)->data, (int) (*frame)->datalen / 2); - } + if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) { + switch_swap_linear((*frame)->data, (int) (*frame)->datalen / 2); + } #endif - return SWITCH_STATUS_SUCCESS; - } - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL READ no TFLAG_IO\n"); - return SWITCH_STATUS_FALSE; + return SWITCH_STATUS_SUCCESS; + } - } + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL READ no TFLAG_IO\n"); + return SWITCH_STATUS_FALSE; + } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL READ FALSE\n"); - return SWITCH_STATUS_FALSE; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL READ FALSE\n"); + return SWITCH_STATUS_FALSE; - cng: - data = (switch_byte_t *) tech_pvt->read_frame.data; - data[0] = 65; - data[1] = 0; - tech_pvt->read_frame.datalen = 2; - tech_pvt->read_frame.flags = SFF_CNG; - *frame = &tech_pvt->read_frame; - return SWITCH_STATUS_SUCCESS; +cng: + data = (switch_byte_t *) tech_pvt->read_frame.data; + data[0] = 65; + data[1] = 0; + tech_pvt->read_frame.datalen = 2; + tech_pvt->read_frame.flags = SFF_CNG; + *frame = &tech_pvt->read_frame; + return SWITCH_STATUS_SUCCESS; } -static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id) -{ - switch_channel_t *channel = NULL; - private_t *tech_pvt = NULL; - //switch_frame_t *pframe; - unsigned int sent; - struct skypiax_interface *p=NULL; +static switch_status_t channel_write_frame(switch_core_session_t * session, + switch_frame_t * frame, switch_io_flag_t flags, + int stream_id) +{ + switch_channel_t *channel = NULL; + private_t *tech_pvt = NULL; + //switch_frame_t *pframe; + unsigned int sent; + struct skypiax_interface *p = NULL; - //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL WRITE FRAME\n"); + //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL WRITE FRAME\n"); - channel = switch_core_session_get_channel(session); - assert(channel != NULL); + channel = switch_core_session_get_channel(session); + assert(channel != NULL); - tech_pvt = switch_core_session_get_private(session); - assert(tech_pvt != NULL); + tech_pvt = switch_core_session_get_private(session); + assert(tech_pvt != NULL); - p=tech_pvt->p; - assert(p != NULL); + p = tech_pvt->p; + assert(p != NULL); - if (!switch_test_flag(tech_pvt, TFLAG_IO)) { + if (!switch_test_flag(tech_pvt, TFLAG_IO)) { ERRORA("CIAPA \n", SKYPIAX_P_LOG); - return SWITCH_STATUS_FALSE; - } + return SWITCH_STATUS_FALSE; + } #ifdef BIGENDIAN - if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) { - switch_swap_linear(frame->data, (int) frame->datalen / 2); - } + if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) { + switch_swap_linear(frame->data, (int) frame->datalen / 2); + } #endif - sent = frame->datalen; - switch_file_write(p->audioskypepipe[1], (short *) frame->data, &sent); - //ERRORA("sent %d\n", SKYPIAX_P_LOG, sent); + sent = frame->datalen; + switch_file_write(p->audioskypepipe[1], (short *) frame->data, &sent); + //ERRORA("sent %d\n", SKYPIAX_P_LOG, sent); - - return SWITCH_STATUS_SUCCESS; + return SWITCH_STATUS_SUCCESS; } @@ -1407,12 +1406,13 @@ void create_pipe(void *data) { - switch_status_t rv; + switch_status_t rv; + + //rv = switch_file_pipe_create_ex(&readp, &writep, APR_FULL_NONBLOCK, module_pool); + rv = switch_file_pipe_create_ex(&readp, &writep, 2, module_pool); + //rv = switch_file_pipe_create(&readp, &writep, module_pool); +} - //rv = switch_file_pipe_create_ex(&readp, &writep, APR_FULL_NONBLOCK, module_pool); - rv = switch_file_pipe_create_ex(&readp, &writep, 2, module_pool); - //rv = switch_file_pipe_create(&readp, &writep, module_pool); -} #if 0 //testpipe.c @@ -1445,325 +1445,325 @@ static apr_file_t *readp = NULL; static apr_file_t *writep = NULL; -static void create_pipe(abts_case *tc, void *data) +static void create_pipe(abts_case * tc, void *data) { - apr_status_t rv; + apr_status_t rv; - rv = apr_file_pipe_create(&readp, &writep, p); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_PTR_NOTNULL(tc, readp); - ABTS_PTR_NOTNULL(tc, writep); -} - -static void close_pipe(abts_case *tc, void *data) -{ - apr_status_t rv; - apr_size_t nbytes = 256; - char buf[256]; + rv = apr_file_pipe_create(&readp, &writep, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, readp); + ABTS_PTR_NOTNULL(tc, writep); +} - rv = apr_file_close(readp); - rv = apr_file_close(writep); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); +static void close_pipe(abts_case * tc, void *data) +{ + apr_status_t rv; + apr_size_t nbytes = 256; + char buf[256]; - rv = apr_file_read(readp, buf, &nbytes); - ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EBADF(rv)); -} + rv = apr_file_close(readp); + rv = apr_file_close(writep); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); -static void set_timeout(abts_case *tc, void *data) + rv = apr_file_read(readp, buf, &nbytes); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EBADF(rv)); +} + +static void set_timeout(abts_case * tc, void *data) { - apr_status_t rv; - apr_interval_time_t timeout; + apr_status_t rv; + apr_interval_time_t timeout; - rv = apr_file_pipe_create_ex(&readp, &writep, APR_WRITE_BLOCK, p); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_PTR_NOTNULL(tc, readp); - ABTS_PTR_NOTNULL(tc, writep); + rv = apr_file_pipe_create_ex(&readp, &writep, APR_WRITE_BLOCK, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, readp); + ABTS_PTR_NOTNULL(tc, writep); - rv = apr_file_pipe_timeout_get(writep, &timeout); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_ASSERT(tc, "Timeout mismatch, expected -1", timeout == -1); + rv = apr_file_pipe_timeout_get(writep, &timeout); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_ASSERT(tc, "Timeout mismatch, expected -1", timeout == -1); - rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1)); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1)); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_pipe_timeout_get(readp, &timeout); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_ASSERT(tc, "Timeout mismatch, expected 1 second", - timeout == apr_time_from_sec(1)); + rv = apr_file_pipe_timeout_get(readp, &timeout); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_ASSERT(tc, "Timeout mismatch, expected 1 second", timeout == apr_time_from_sec(1)); } -static void read_write(abts_case *tc, void *data) +static void read_write(abts_case * tc, void *data) { - apr_status_t rv; - char *buf; - apr_size_t nbytes; - - nbytes = strlen("this is a test"); - buf = (char *)apr_palloc(p, nbytes + 1); + apr_status_t rv; + char *buf; + apr_size_t nbytes; - rv = apr_file_pipe_create_ex(&readp, &writep, APR_WRITE_BLOCK, p); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_PTR_NOTNULL(tc, readp); - ABTS_PTR_NOTNULL(tc, writep); + nbytes = strlen("this is a test"); + buf = (char *) apr_palloc(p, nbytes + 1); - rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1)); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + rv = apr_file_pipe_create_ex(&readp, &writep, APR_WRITE_BLOCK, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, readp); + ABTS_PTR_NOTNULL(tc, writep); - if (!rv) { - rv = apr_file_read(readp, buf, &nbytes); - ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); - ABTS_SIZE_EQUAL(tc, 0, nbytes); - } + rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1)); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + if (!rv) { + rv = apr_file_read(readp, buf, &nbytes); + ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); + ABTS_SIZE_EQUAL(tc, 0, nbytes); + } } -static void read_write_notimeout(abts_case *tc, void *data) +static void read_write_notimeout(abts_case * tc, void *data) { - apr_status_t rv; - char *buf = "this is a test"; - char *input; - apr_size_t nbytes; - - nbytes = strlen("this is a test"); + apr_status_t rv; + char *buf = "this is a test"; + char *input; + apr_size_t nbytes; - rv = apr_file_pipe_create(&readp, &writep, p); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_PTR_NOTNULL(tc, readp); - ABTS_PTR_NOTNULL(tc, writep); + nbytes = strlen("this is a test"); - rv = apr_file_write(writep, buf, &nbytes); - ABTS_SIZE_EQUAL(tc, strlen("this is a test"), nbytes); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + rv = apr_file_pipe_create(&readp, &writep, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_PTR_NOTNULL(tc, readp); + ABTS_PTR_NOTNULL(tc, writep); - nbytes = 256; - input = apr_pcalloc(p, nbytes + 1); - rv = apr_file_read(readp, input, &nbytes); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_SIZE_EQUAL(tc, strlen("this is a test"), nbytes); - ABTS_STR_EQUAL(tc, "this is a test", input); + rv = apr_file_write(writep, buf, &nbytes); + ABTS_SIZE_EQUAL(tc, strlen("this is a test"), nbytes); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + nbytes = 256; + input = apr_pcalloc(p, nbytes + 1); + rv = apr_file_read(readp, input, &nbytes); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + ABTS_SIZE_EQUAL(tc, strlen("this is a test"), nbytes); + ABTS_STR_EQUAL(tc, "this is a test", input); } -static void test_pipe_writefull(abts_case *tc, void *data) +static void test_pipe_writefull(abts_case * tc, void *data) { - int iterations = 1000; - int i; - int bytes_per_iteration = 8000; - char *buf = (char *)malloc(bytes_per_iteration); - char responsebuf[128]; - apr_size_t nbytes; - int bytes_processed; - apr_proc_t proc = {0}; - apr_procattr_t *procattr; - const char *args[2]; - apr_status_t rv; - apr_exit_why_e why; - - rv = apr_procattr_create(&procattr, p); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - - rv = apr_procattr_io_set(procattr, APR_CHILD_BLOCK, APR_CHILD_BLOCK, - APR_CHILD_BLOCK); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + int iterations = 1000; + int i; + int bytes_per_iteration = 8000; + char *buf = (char *) malloc(bytes_per_iteration); + char responsebuf[128]; + apr_size_t nbytes; + int bytes_processed; + apr_proc_t proc = { 0 }; + apr_procattr_t *procattr; + const char *args[2]; + apr_status_t rv; + apr_exit_why_e why; + + rv = apr_procattr_create(&procattr, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_procattr_io_set(procattr, APR_CHILD_BLOCK, APR_CHILD_BLOCK, APR_CHILD_BLOCK); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + rv = apr_procattr_error_check_set(procattr, 1); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + + args[0] = "readchild" EXTENSION; + args[1] = NULL; + rv = apr_proc_create(&proc, TESTBINPATH "readchild" EXTENSION, args, NULL, procattr, p); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_procattr_error_check_set(procattr, 1); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + rv = apr_file_pipe_timeout_set(proc.in, apr_time_from_sec(10)); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - args[0] = "readchild" EXTENSION; - args[1] = NULL; - rv = apr_proc_create(&proc, TESTBINPATH "readchild" EXTENSION, args, NULL, procattr, p); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + rv = apr_file_pipe_timeout_set(proc.out, apr_time_from_sec(10)); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - rv = apr_file_pipe_timeout_set(proc.in, apr_time_from_sec(10)); + i = iterations; + do { + rv = apr_file_write_full(proc.in, buf, bytes_per_iteration, NULL); ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + } while (--i); - rv = apr_file_pipe_timeout_set(proc.out, apr_time_from_sec(10)); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + free(buf); - i = iterations; - do { - rv = apr_file_write_full(proc.in, buf, bytes_per_iteration, NULL); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - } while (--i); + rv = apr_file_close(proc.in); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - free(buf); + nbytes = sizeof(responsebuf); + rv = apr_file_read(proc.out, responsebuf, &nbytes); + ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); + bytes_processed = (int) apr_strtoi64(responsebuf, NULL, 10); + ABTS_INT_EQUAL(tc, iterations * bytes_per_iteration, bytes_processed); - rv = apr_file_close(proc.in); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - - nbytes = sizeof(responsebuf); - rv = apr_file_read(proc.out, responsebuf, &nbytes); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - bytes_processed = (int)apr_strtoi64(responsebuf, NULL, 10); - ABTS_INT_EQUAL(tc, iterations * bytes_per_iteration, bytes_processed); + ABTS_ASSERT(tc, "wait for child process", + apr_proc_wait(&proc, NULL, &why, APR_WAIT) == APR_CHILD_DONE); - ABTS_ASSERT(tc, "wait for child process", - apr_proc_wait(&proc, NULL, &why, APR_WAIT) == APR_CHILD_DONE); - - ABTS_ASSERT(tc, "child terminated normally", why == APR_PROC_EXIT); + ABTS_ASSERT(tc, "child terminated normally", why == APR_PROC_EXIT); } -abts_suite *testpipe(abts_suite *suite) +abts_suite *testpipe(abts_suite * suite) { - suite = ADD_SUITE(suite) + suite = ADD_SUITE(suite) abts_run_test(suite, create_pipe, NULL); - abts_run_test(suite, close_pipe, NULL); - abts_run_test(suite, set_timeout, NULL); - abts_run_test(suite, close_pipe, NULL); - abts_run_test(suite, read_write, NULL); - abts_run_test(suite, close_pipe, NULL); - abts_run_test(suite, read_write_notimeout, NULL); - abts_run_test(suite, test_pipe_writefull, NULL); - abts_run_test(suite, close_pipe, NULL); + abts_run_test(suite, close_pipe, NULL); + abts_run_test(suite, set_timeout, NULL); + abts_run_test(suite, close_pipe, NULL); + abts_run_test(suite, read_write, NULL); + abts_run_test(suite, close_pipe, NULL); + abts_run_test(suite, read_write_notimeout, NULL); + abts_run_test(suite, test_pipe_writefull, NULL); + abts_run_test(suite, close_pipe, NULL); - return suite; + return suite; } - - - #endif - #endif -static switch_status_t channel_answer_channel(switch_core_session_t *session) +static switch_status_t channel_answer_channel(switch_core_session_t * session) { - private_t *tech_pvt; - switch_channel_t *channel = NULL; - struct skypiax_interface *p; + private_t *tech_pvt; + switch_channel_t *channel = NULL; + struct skypiax_interface *p; - channel = switch_core_session_get_channel(session); - assert(channel != NULL); + channel = switch_core_session_get_channel(session); + assert(channel != NULL); - tech_pvt = switch_core_session_get_private(session); - assert(tech_pvt != NULL); + tech_pvt = switch_core_session_get_private(session); + assert(tech_pvt != NULL); - p=tech_pvt->p; + p = tech_pvt->p; - DEBUGA_SKYPE("ANSWERED! \n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("ANSWERED! \n", SKYPIAX_P_LOG); - return SWITCH_STATUS_SUCCESS; + return SWITCH_STATUS_SUCCESS; } - -static switch_status_t channel_receive_message(switch_core_session_t *session, switch_core_session_message_t *msg) +static switch_status_t channel_receive_message(switch_core_session_t * session, + switch_core_session_message_t * msg) { - switch_channel_t *channel; - private_t *tech_pvt; - struct skypiax_interface *p; + switch_channel_t *channel; + private_t *tech_pvt; + struct skypiax_interface *p; - channel = switch_core_session_get_channel(session); - assert(channel != NULL); + channel = switch_core_session_get_channel(session); + assert(channel != NULL); - tech_pvt = (private_t *) switch_core_session_get_private(session); - assert(tech_pvt != NULL); + tech_pvt = (private_t *) switch_core_session_get_private(session); + assert(tech_pvt != NULL); - p=tech_pvt->p; + p = tech_pvt->p; - switch (msg->message_id) { - case SWITCH_MESSAGE_INDICATE_ANSWER: - { - //WARNINGA("TO BE ANSWERED! \n", SKYPIAX_P_LOG); - DEBUGA_SKYPE("MSG_ID=%d, TO BE ANSWERED!\n", SKYPIAX_P_LOG, msg->message_id); - channel_answer_channel(session); - } - break; - default: - { - WARNINGA("MSG_ID=%d\n", SKYPIAX_P_LOG, msg->message_id); - } - break; - } + switch (msg->message_id) { + case SWITCH_MESSAGE_INDICATE_ANSWER: + { + //WARNINGA("TO BE ANSWERED! \n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("MSG_ID=%d, TO BE ANSWERED!\n", SKYPIAX_P_LOG, msg->message_id); + channel_answer_channel(session); + } + break; + default: + { + WARNINGA("MSG_ID=%d\n", SKYPIAX_P_LOG, msg->message_id); + } + break; + } - return SWITCH_STATUS_SUCCESS; + return SWITCH_STATUS_SUCCESS; } + #if 0 /* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines that allocate memory or you will have 1 channel with memory allocated from another channel's pool! */ -static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event, - switch_caller_profile_t *outbound_profile, - switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags) -{ - if ((*new_session = switch_core_session_request(skypiax_endpoint_interface, pool)) != 0) { - private_t *tech_pvt; - switch_channel_t *channel; - switch_caller_profile_t *caller_profile; - - switch_core_session_add_stream(*new_session, NULL); - if ((tech_pvt = (private_t *) switch_core_session_alloc(*new_session, sizeof(private_t))) != 0) { - tech_pvt->p = SKYPIAX_INTERFACES[2]; //FIXME - channel = switch_core_session_get_channel(*new_session); - tech_init(tech_pvt, *new_session, NULL); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n"); - switch_core_session_destroy(new_session); - return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; - } - - if (outbound_profile) { - char name[128]; - - snprintf(name, sizeof(name), "skypiax/%s", outbound_profile->destination_number); - switch_channel_set_name(channel, name); - - caller_profile = switch_caller_profile_clone(*new_session, outbound_profile); - switch_channel_set_caller_profile(channel, caller_profile); - tech_pvt->caller_profile = caller_profile; - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Doh! no caller profile\n"); - switch_core_session_destroy(new_session); - return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; - } - - - skypiax_skype_call(tech_pvt->p, outbound_profile->destination_number, 30); - - switch_channel_set_flag(channel, CF_OUTBOUND); - switch_set_flag_locked(tech_pvt, TFLAG_OUTBOUND); - switch_channel_set_state(channel, CS_INIT); - return SWITCH_CAUSE_SUCCESS; - } +static switch_call_cause_t channel_outgoing_channel(switch_core_session_t * session, + switch_event_t * var_event, + switch_caller_profile_t * + outbound_profile, + switch_core_session_t ** new_session, + switch_memory_pool_t ** pool, + switch_originate_flag_t flags) +{ + if ((*new_session = switch_core_session_request(skypiax_endpoint_interface, pool)) != 0) { + private_t *tech_pvt; + switch_channel_t *channel; + switch_caller_profile_t *caller_profile; + + switch_core_session_add_stream(*new_session, NULL); + if ((tech_pvt = + (private_t *) switch_core_session_alloc(*new_session, sizeof(private_t))) != 0) { + tech_pvt->p = SKYPIAX_INTERFACES[2]; //FIXME + channel = switch_core_session_get_channel(*new_session); + tech_init(tech_pvt, *new_session, NULL); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, + "Hey where is my memory pool?\n"); + switch_core_session_destroy(new_session); + return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; + } + + if (outbound_profile) { + char name[128]; + + snprintf(name, sizeof(name), "skypiax/%s", outbound_profile->destination_number); + switch_channel_set_name(channel, name); + + caller_profile = switch_caller_profile_clone(*new_session, outbound_profile); + switch_channel_set_caller_profile(channel, caller_profile); + tech_pvt->caller_profile = caller_profile; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Doh! no caller profile\n"); + switch_core_session_destroy(new_session); + return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; + } + + skypiax_skype_call(tech_pvt->p, outbound_profile->destination_number, 30); + + switch_channel_set_flag(channel, CF_OUTBOUND); + switch_set_flag_locked(tech_pvt, TFLAG_OUTBOUND); + switch_channel_set_state(channel, CS_INIT); + return SWITCH_CAUSE_SUCCESS; + } - return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; + return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; } #endif // 0 //FIXME: moved below -static switch_status_t channel_receive_event(switch_core_session_t *session, switch_event_t *event) +static switch_status_t channel_receive_event(switch_core_session_t * session, + switch_event_t * event) { - struct private_object *tech_pvt = switch_core_session_get_private(session); - char *body = switch_event_get_body(event); - switch_assert(tech_pvt != NULL); + struct private_object *tech_pvt = switch_core_session_get_private(session); + char *body = switch_event_get_body(event); + switch_assert(tech_pvt != NULL); - if (!body) { - body = ""; - } + if (!body) { + body = ""; + } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "event: |||%s|||\n", body); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "event: |||%s|||\n", body); - return SWITCH_STATUS_SUCCESS; + return SWITCH_STATUS_SUCCESS; } - - switch_state_handler_table_t skypiax_state_handlers = { - /*.on_init */ channel_on_init, - /*.on_routing */ channel_on_routing, - /*.on_execute */ channel_on_execute, - /*.on_hangup */ channel_on_hangup, - /*.on_exchange_media */ channel_on_exchange_media, - /*.on_soft_execute */ channel_on_soft_execute + /*.on_init */ channel_on_init, + /*.on_routing */ channel_on_routing, + /*.on_execute */ channel_on_execute, + /*.on_hangup */ channel_on_hangup, + /*.on_exchange_media */ channel_on_exchange_media, + /*.on_soft_execute */ channel_on_soft_execute }; switch_io_routines_t skypiax_io_routines = { - /*.outgoing_channel */ channel_outgoing_channel, - /*.read_frame */ channel_read_frame, - /*.write_frame */ channel_write_frame, - /*.kill_channel */ channel_kill_channel, - /*.send_dtmf */ channel_send_dtmf, - /*.receive_message */ channel_receive_message, - /*.receive_event */ channel_receive_event + /*.outgoing_channel */ channel_outgoing_channel, + /*.read_frame */ channel_read_frame, + /*.write_frame */ channel_write_frame, + /*.kill_channel */ channel_kill_channel, + /*.send_dtmf */ channel_send_dtmf, + /*.receive_message */ channel_receive_message, + /*.receive_event */ channel_receive_event }; + #define SKYPE_THREAD #ifndef WIN32_SKYPIAX #ifdef SKYPE_THREAD @@ -1899,7 +1899,7 @@ switch_sleep(1000); } -static void *SWITCH_THREAD_FUNC do_skype_thread(switch_thread_t *thread, void *obj) +static void *SWITCH_THREAD_FUNC do_skype_thread(switch_thread_t * thread, void *obj) { struct skypiax_interface *p; @@ -1911,7 +1911,7 @@ //int res; p = obj; - DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); + DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); /* if (pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL)) { @@ -1923,28 +1923,31 @@ } */ - switch_file_pipe_create_ex(&p->AsteriskHandlesAst.fdesc[0], &p->AsteriskHandlesAst.fdesc[1], 2, module_pool); + switch_file_pipe_create_ex(&p->AsteriskHandlesAst.fdesc[0], + &p->AsteriskHandlesAst.fdesc[1], 2, module_pool); #if 0 res = pipe(p->AsteriskHandlesAst.fdesc); if (res) { ERRORA("Unable to create skype pipe, exiting skype thread\n", SKYPIAX_P_LOG); DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - return NULL; + return NULL; } fcntl(p->AsteriskHandlesAst.fdesc[0], F_SETFL, O_NONBLOCK); fcntl(p->AsteriskHandlesAst.fdesc[1], F_SETFL, O_NONBLOCK); #endif - AsteriskHandlesAst = &p->AsteriskHandlesAst; //disp = XOpenDisplay(getenv("DISPLAY")); disp = XOpenDisplay(p->X11_display); if (!disp) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot open X Display '%s', exiting skype thread\n", p->X11_display); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + "Cannot open X Display '%s', exiting skype thread\n", + p->X11_display); return NULL; } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "X Display '%s' opened\n", p->X11_display); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "X Display '%s' opened\n", + p->X11_display); } int xfd; @@ -1977,7 +1980,7 @@ SKYPIAX_P_LOG); //p->skype = 0; //p->skype_thread = SKYPIAX_PTHREADT_NULL; - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); return NULL; } @@ -1988,7 +1991,7 @@ SKYPIAX_P_LOG); //p->skype = 0; //p->skype_thread = SKYPIAX_PTHREADT_NULL; - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); return NULL; } @@ -2022,9 +2025,9 @@ strcat(buffer, buf); if (i < 20) { /* last fragment */ - unsigned int howmany; + unsigned int howmany; - howmany = strlen(b) + 1; + howmany = strlen(b) + 1; switch_file_write(AsteriskHandlesAst->fdesc[1], b, &howmany); //write(AsteriskHandlesAst->fdesc[1], "\0", 1); @@ -2049,17 +2052,14 @@ //p->skype = 0; //p->skype_thread = SKYPIAX_PTHREADT_NULL; //pthread_cleanup_pop(1); - //DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + //DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); return NULL; } - #endif /* SKYPE_THREAD */ #else // WIN32_SKYPIAX - - #endif // WIN32_SKYPIAX #define CONTROLDEV_THREAD @@ -2109,9 +2109,9 @@ } AsteriskHandlesAst = &p->AsteriskHandlesAst; - if (option_debug > 101) { - DEBUGA_SKYPE("SENDING: |||%s||||\n", SKYPIAX_P_LOG, msg_to_skype); - } + if (option_debug > 101) { + DEBUGA_SKYPE("SENDING: |||%s||||\n", SKYPIAX_P_LOG, msg_to_skype); + } if (!skypiax_skype_send_message(AsteriskHandlesAst, msg_to_skype)) { ERRORA @@ -2135,7 +2135,6 @@ } #endif //0 - int skypiax_skype_read(struct skypiax_interface *p) { @@ -2154,7 +2153,7 @@ if (option_debug > 100) { DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); } - //DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); + //DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); //switch_sleep(1000000); memset(read_from_pipe, 0, 4096); @@ -2169,10 +2168,10 @@ to.tv_sec = 0; rt = select(fd + 1, &fs, NULL, NULL, &to); #endif - rt=1; + rt = 1; if (rt > 0) { howmany = sizeof(read_from_pipe); - switch_file_read(p->AsteriskHandlesAst.fdesc[0], read_from_pipe, &howmany); + switch_file_read(p->AsteriskHandlesAst.fdesc[0], read_from_pipe, &howmany); a = 0; for (i = 0; i < howmany; i++) { @@ -2185,7 +2184,7 @@ DEBUGA_SKYPE("read_skype: howmany=%d, i=%d, a=%d, |||%s||| \n", SKYPIAX_P_LOG, howmany, i, a, messaggio); -#if 0 //FIXME wat's the use of this? +#if 0 //FIXME wat's the use of this? if (!strcasecmp(messaggio, "ERROR 68")) { /* not yet protocol specified, just authorized */ NOTICA @@ -2198,25 +2197,24 @@ #endif if (!strncasecmp(messaggio, "ERROR 92 CALL", 12)) { - ERRORA - ("Skype got ERROR: |||%s|||, the number we called was not recognized\n", - SKYPIAX_P_LOG, messaggio); - p->skype_callflow = CALLFLOW_STATUS_FINISHED; - if (option_debug) - DEBUGA_SKYPE("skype_call now is DOWN\n", SKYPIAX_P_LOG); - p->skype_call_id[0] = '\0'; - - if (p->interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) { - if (option_debug > 100) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - p->interface_state = SKYPIAX_STATE_DOWN; - //FIXME if(p->owner) - //FIXME p->owner->hangupcause = SKYPIAX_CAUSE_NORMAL; - return CALLFLOW_INCOMING_HANGUP; - } else { - p->interface_state = SKYPIAX_STATE_DOWN; - } + ERRORA("Skype got ERROR: |||%s|||, the number we called was not recognized\n", + SKYPIAX_P_LOG, messaggio); + p->skype_callflow = CALLFLOW_STATUS_FINISHED; + if (option_debug) + DEBUGA_SKYPE("skype_call now is DOWN\n", SKYPIAX_P_LOG); + p->skype_call_id[0] = '\0'; + + if (p->interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) { + if (option_debug > 100) { + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + } + p->interface_state = SKYPIAX_STATE_DOWN; + //FIXME if(p->owner) + //FIXME p->owner->hangupcause = SKYPIAX_CAUSE_NORMAL; + return CALLFLOW_INCOMING_HANGUP; + } else { + p->interface_state = SKYPIAX_STATE_DOWN; + } } strncpy(messaggio_2, messaggio, sizeof(messaggio) - 1); @@ -2247,26 +2245,24 @@ strncpy(p->skype_displayname, &messaggio_2[10], 511); } if (!strcasecmp(messaggio, "ERROR")) { - ERRORA - ("Skype got ERROR: |||%s|||\n", - SKYPIAX_P_LOG, messaggio); - p->skype_callflow = CALLFLOW_STATUS_FINISHED; - if (option_debug) - DEBUGA_SKYPE("skype_call now is DOWN\n", SKYPIAX_P_LOG); - p->skype_call_id[0] = '\0'; - - if (p->interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) { - if (option_debug > 100) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - p->interface_state = SKYPIAX_STATE_DOWN; - //FIXME if(p->owner){ - //FIXME p->owner->hangupcause = SKYPIAX_CAUSE_NORMAL; - //FIXME } - return CALLFLOW_INCOMING_HANGUP; - } else { - p->interface_state = SKYPIAX_STATE_DOWN; - } + ERRORA("Skype got ERROR: |||%s|||\n", SKYPIAX_P_LOG, messaggio); + p->skype_callflow = CALLFLOW_STATUS_FINISHED; + if (option_debug) + DEBUGA_SKYPE("skype_call now is DOWN\n", SKYPIAX_P_LOG); + p->skype_call_id[0] = '\0'; + + if (p->interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) { + if (option_debug > 100) { + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + } + p->interface_state = SKYPIAX_STATE_DOWN; + //FIXME if(p->owner){ + //FIXME p->owner->hangupcause = SKYPIAX_CAUSE_NORMAL; + //FIXME } + return CALLFLOW_INCOMING_HANGUP; + } else { + p->interface_state = SKYPIAX_STATE_DOWN; + } } if (!strcasecmp(messaggio, "CALL")) { @@ -2293,13 +2289,17 @@ if (!strcasecmp(prop, "PARTNER_HANDLE")) { strncpy(p->callid_number, value, sizeof(p->callid_number) - 1); - WARNINGA("the skype_call %s caller PARTNER_HANDLE (p->callid_number) is: %s\n", SKYPIAX_P_LOG, id, p->callid_number); + WARNINGA + ("the skype_call %s caller PARTNER_HANDLE (p->callid_number) is: %s\n", + SKYPIAX_P_LOG, id, p->callid_number); return CALLFLOW_INCOMING_RING; } if (!strcasecmp(prop, "PARTNER_DISPNAME")) { snprintf(p->callid_name, sizeof(p->callid_name) - 1, "%s%s%s", value, where ? " " : "", where ? where : ""); - WARNINGA("the skype_call %s caller PARTNER_DISPNAME (p->callid_name) is: %s\n", SKYPIAX_P_LOG, id, p->callid_name); + WARNINGA + ("the skype_call %s caller PARTNER_DISPNAME (p->callid_name) is: %s\n", + SKYPIAX_P_LOG, id, p->callid_name); } if (!strcasecmp(prop, "CONF_ID") && !strcasecmp(value, "0")) { DEBUGA_SKYPE("the skype_call %s is NOT a conference call\n", SKYPIAX_P_LOG, @@ -2313,32 +2313,30 @@ p->interface_state = SKYPIAX_STATE_PRERING; } - if (!strcasecmp(prop, "DTMF")) { - switch_core_session_t *session = NULL; - private_t *tech_pvt = NULL; - switch_channel_t *channel = NULL; + if (!strcasecmp(prop, "DTMF")) { + switch_core_session_t *session = NULL; + private_t *tech_pvt = NULL; + switch_channel_t *channel = NULL; //FIXME struct ast_frame f2 = { SKYPIAX_FRAME_DTMF, value[0], }; DEBUGA_SKYPE("Call %s received a DTMF: %s\n", SKYPIAX_P_LOG, id, value); - tech_pvt = p->tech_pvt; - session = tech_pvt->session; - channel = switch_core_session_get_channel(session); - - - - if (channel) { - switch_dtmf_t dtmf = { (char) value[0], switch_core_default_dtmf_duration(0) }; - if (globals.debug) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%c DTMF %s\n", dtmf.digit, switch_channel_get_name(channel)); - } - switch_mutex_lock(tech_pvt->flag_mutex); - switch_channel_queue_dtmf(channel, &dtmf); - switch_set_flag(tech_pvt, TFLAG_DTMF); - switch_mutex_unlock(tech_pvt->flag_mutex); - } - - + tech_pvt = p->tech_pvt; + session = tech_pvt->session; + channel = switch_core_session_get_channel(session); + + if (channel) { + switch_dtmf_t dtmf = + { (char) value[0], switch_core_default_dtmf_duration(0) }; + if (globals.debug) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%c DTMF %s\n", + dtmf.digit, switch_channel_get_name(channel)); + } + switch_mutex_lock(tech_pvt->flag_mutex); + switch_channel_queue_dtmf(channel, &dtmf); + switch_set_flag(tech_pvt, TFLAG_DTMF); + switch_mutex_unlock(tech_pvt->flag_mutex); + } //FIXME ast_queue_frame(p->owner, &f2); } @@ -2348,7 +2346,7 @@ ("Skype has FAILED on skype_call %s. Let's wait for the FAILED message.\n", SKYPIAX_P_LOG, id); } - if (!strcasecmp(prop, "DURATION") && (!strcasecmp(value, "1"))) { + if (!strcasecmp(prop, "DURATION") && (!strcasecmp(value, "1"))) { if (strcasecmp(id, p->skype_call_id)) { strncpy(p->skype_call_id, id, sizeof(p->skype_call_id) - 1); if (option_debug > 1) @@ -2358,7 +2356,6 @@ } } - if (!strcasecmp(prop, "STATUS")) { if (!strcasecmp(value, "RINGING")) { @@ -2417,7 +2414,7 @@ DEBUGA_SKYPE("We missed skype_call %s\n", SKYPIAX_P_LOG, id); } else if (!strcasecmp(value, "FINISHED")) { - global_session = NULL; //FIXME + global_session = NULL; //FIXME //p->skype_callflow = CALLFLOW_STATUS_FINISHED; if (option_debug) DEBUGA_SKYPE("skype_call %s now is DOWN\n", SKYPIAX_P_LOG, id); @@ -2429,7 +2426,7 @@ } //p->interface_state = SKYPIAX_STATE_DOWN; //FIXME if(p->owner) - //FIXME p->owner->hangupcause = SKYPIAX_CAUSE_NORMAL; + //FIXME p->owner->hangupcause = SKYPIAX_CAUSE_NORMAL; return CALLFLOW_INCOMING_HANGUP; } else { p->interface_state = SKYPIAX_STATE_DOWN; @@ -2449,7 +2446,7 @@ } p->interface_state = SKYPIAX_STATE_DOWN; //FIXME if(p->owner) - //FIXME p->owner->hangupcause = SKYPIAX_CAUSE_NORMAL; + //FIXME p->owner->hangupcause = SKYPIAX_CAUSE_NORMAL; return CALLFLOW_INCOMING_HANGUP; } else { p->interface_state = SKYPIAX_STATE_DOWN; @@ -2467,7 +2464,7 @@ DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); } //FIXME if(p->owner) - //FIXME p->owner->hangupcause = SKYPIAX_CAUSE_NORMAL; + //FIXME p->owner->hangupcause = SKYPIAX_CAUSE_NORMAL; return CALLFLOW_INCOMING_HANGUP; } else if (!strcasecmp(value, "REFUSED")) { if (!strcasecmp(id, p->skype_call_id)) { @@ -2484,7 +2481,7 @@ DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); } //FIXME if(p->owner) - //FIXME p->owner->hangupcause = SKYPIAX_CAUSE_NORMAL; + //FIXME p->owner->hangupcause = SKYPIAX_CAUSE_NORMAL; return CALLFLOW_INCOMING_HANGUP; } else { /* we're here because were us that refused an incoming call */ @@ -2509,164 +2506,155 @@ DEBUGA_SKYPE("skype_call: %s is now active\n", SKYPIAX_P_LOG, id); //FIXME if (p->owner) { - //FIXME ast_queue_control(p->owner, SKYPIAX_CONTROL_ANSWER); + //FIXME ast_queue_control(p->owner, SKYPIAX_CONTROL_ANSWER); //FIXME } if (option_debug > 1) - DEBUGA_SKYPE("skype_call: %s SKYPIAX_CONTROL_ANSWER sent\n", SKYPIAX_P_LOG, - id); + DEBUGA_SKYPE("skype_call: %s SKYPIAX_CONTROL_ANSWER sent\n", + SKYPIAX_P_LOG, id); //FIXME if (p->owner) - if (1) { - char msg_to_skype[1024]; - - + if (1) { + char msg_to_skype[1024]; #if 0 - if (!p->tcp_srv_thread) { - if(1) - { + if (!p->tcp_srv_thread) { + if (1) { #endif - //switch_thread_t *thread; - if(1){ - switch_threadattr_t *thd_attr = NULL; - - switch_threadattr_create(&thd_attr, module_pool); - switch_threadattr_detach_set(thd_attr, 1); - switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&p->tcp_srv_thread, thd_attr, skypiax_do_tcp_srv_thread, p, module_pool); - DEBUGA_SKYPE("started tcp_srv_thread thread.\n", SKYPIAX_P_LOG); + //switch_thread_t *thread; + if (1) { + switch_threadattr_t *thd_attr = NULL; + + switch_threadattr_create(&thd_attr, module_pool); + switch_threadattr_detach_set(thd_attr, 1); + switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); + switch_thread_create(&p->tcp_srv_thread, thd_attr, + skypiax_do_tcp_srv_thread, p, module_pool); + DEBUGA_SKYPE("started tcp_srv_thread thread.\n", SKYPIAX_P_LOG); #if 0 - } - } + } + } #endif - - - - - #if 0 - if (!p->tcp_cli_thread) { - if(1) - { + if (!p->tcp_cli_thread) { + if (1) { #endif - //switch_thread_t *thread; - //switch_threadattr_t *thd_attr = NULL; + //switch_thread_t *thread; + //switch_threadattr_t *thd_attr = NULL; - switch_threadattr_create(&thd_attr, module_pool); - switch_threadattr_detach_set(thd_attr, 1); - switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&p->tcp_cli_thread, thd_attr, skypiax_do_tcp_cli_thread, p, module_pool); - DEBUGA_SKYPE("started tcp_cli_thread thread.\n", SKYPIAX_P_LOG); - } + switch_threadattr_create(&thd_attr, module_pool); + switch_threadattr_detach_set(thd_attr, 1); + switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); + switch_thread_create(&p->tcp_cli_thread, thd_attr, + skypiax_do_tcp_cli_thread, p, module_pool); + DEBUGA_SKYPE("started tcp_cli_thread thread.\n", SKYPIAX_P_LOG); + } #if 0 - } - + } - } + } #endif - switch_sleep(100000); - sprintf(msg_to_skype, "ALTER CALL %s SET_OUTPUT PORT=\"5556\"", id); - skypiax_skype_write(p, msg_to_skype); - switch_sleep(100000); - sprintf(msg_to_skype, "ALTER CALL %s SET_INPUT PORT=\"5558\"", id); - skypiax_skype_write(p, msg_to_skype); - switch_sleep(100000); - } + switch_sleep(100000); + sprintf(msg_to_skype, "ALTER CALL %s SET_OUTPUT PORT=\"5556\"", id); + skypiax_skype_write(p, msg_to_skype); + switch_sleep(100000); + sprintf(msg_to_skype, "ALTER CALL %s SET_INPUT PORT=\"5558\"", id); + skypiax_skype_write(p, msg_to_skype); + switch_sleep(100000); + } p->skype_callflow = SKYPIAX_STATE_UP; - /**************************/ - - //FIXME switch_core_session_t **new_session; - - //FIXME *new_session=switch_loadable_module_create_interface(skypiax_endpoint_interface, pool); - - if (!global_session) { //FIXME FIXME FIXME - switch_core_session_t *session = NULL; - private_t *tech_pvt = NULL; - switch_channel_t *channel = NULL; - + /**************************/ + //FIXME switch_core_session_t **new_session; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "New Inbound Channel!\n"); - - if ((session = switch_core_session_request(skypiax_endpoint_interface, NULL)) != 0) { - switch_core_session_add_stream(session, NULL); - if ((tech_pvt = (private_t *) switch_core_session_alloc(session, sizeof(private_t))) != 0) { - channel = switch_core_session_get_channel(session); - tech_init(tech_pvt, session, p); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n"); - switch_core_session_destroy(&session); - break; - } - - // if ((tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session), NULL, dialplan, cid_name, cid_num, ip, NULL, NULL, NULL, modname, NULL, dest)) != 0) - - if ((tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session), - "skypiax", - "XML", - "gmaruzz_from_skype", - "calling_number", - NULL, - "calling_ani", - NULL, - NULL, - (char *) modname, - "default", - "5000")) != 0) { - char name[128]; - switch_snprintf(name, sizeof(name), "skypiax/%s-%04x", tech_pvt->caller_profile->destination_number, rand() & 0xffff); - switch_channel_set_name(channel, name); - switch_channel_set_caller_profile(channel, tech_pvt->caller_profile); - } - switch_channel_set_state(channel, CS_INIT); - if (switch_core_session_thread_launch(session) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Error spawning thread\n"); - switch_core_session_destroy(&session); - } + //FIXME *new_session=switch_loadable_module_create_interface(skypiax_endpoint_interface, pool); + if (!global_session) { //FIXME FIXME FIXME + switch_core_session_t *session = NULL; + private_t *tech_pvt = NULL; + switch_channel_t *channel = NULL; + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, + "New Inbound Channel!\n"); + + if ((session = + switch_core_session_request(skypiax_endpoint_interface, + NULL)) != 0) { + switch_core_session_add_stream(session, NULL); + if ((tech_pvt = + (private_t *) switch_core_session_alloc(session, + sizeof(private_t))) != 0) { + channel = switch_core_session_get_channel(session); + tech_init(tech_pvt, session, p); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, + "Hey where is my memory pool?\n"); + switch_core_session_destroy(&session); + break; + } + + // if ((tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session), NULL, dialplan, cid_name, cid_num, ip, NULL, NULL, NULL, modname, NULL, dest)) != 0) + + if ((tech_pvt->caller_profile = + switch_caller_profile_new(switch_core_session_get_pool(session), + "skypiax", "XML", "gmaruzz_from_skype", + "calling_number", NULL, "calling_ani", + NULL, NULL, (char *) modname, "default", + "5000")) != 0) { + char name[128]; + switch_snprintf(name, sizeof(name), "skypiax/%s-%04x", + tech_pvt->caller_profile->destination_number, + rand() & 0xffff); + switch_channel_set_name(channel, name); + switch_channel_set_caller_profile(channel, tech_pvt->caller_profile); + } + switch_channel_set_state(channel, CS_INIT); + if (switch_core_session_thread_launch(session) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, + "Error spawning thread\n"); + switch_core_session_destroy(&session); + } #if 0 - if (iax_set_codec(tech_pvt, iaxevent->session, - &iaxevent->ies.format, &iaxevent->ies.capability, &iaxevent->ies.samprate, IAX_SET) != SWITCH_STATUS_SUCCESS) { - iax_reject(iaxevent->session, "Codec Error!"); - switch_core_session_destroy(&session); - } else { - tech_pvt->iax_session = iaxevent->session; - tech_pvt->session = session; - iax_accept(tech_pvt->iax_session, tech_pvt->codec); - iax_ring_announce(tech_pvt->iax_session); - switch_channel_set_state(channel, CS_INIT); - if (switch_core_session_thread_launch(session) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Error spawning thread\n"); - switch_core_session_destroy(&session); - } - } + if (iax_set_codec + (tech_pvt, iaxevent->session, &iaxevent->ies.format, + &iaxevent->ies.capability, &iaxevent->ies.samprate, + IAX_SET) != SWITCH_STATUS_SUCCESS) { + iax_reject(iaxevent->session, "Codec Error!"); + switch_core_session_destroy(&session); + } else { + tech_pvt->iax_session = iaxevent->session; + tech_pvt->session = session; + iax_accept(tech_pvt->iax_session, tech_pvt->codec); + iax_ring_announce(tech_pvt->iax_session); + switch_channel_set_state(channel, CS_INIT); + if (switch_core_session_thread_launch(session) != + SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, + "Error spawning thread\n"); + switch_core_session_destroy(&session); + } + } #endif //0 - } - } else { - switch_core_session_t *session = NULL; - private_t *tech_pvt = NULL; - switch_channel_t *channel = NULL; - - tech_pvt = p->tech_pvt; - //session = tech_pvt->session; - session = global_session; - channel = switch_core_session_get_channel(session); - switch_channel_mark_pre_answered(channel); - - //switch_channel_set_state(channel, CS_EXECUTE); - - } - /**************************/ - - - + } + } else { + switch_core_session_t *session = NULL; + private_t *tech_pvt = NULL; + switch_channel_t *channel = NULL; + + tech_pvt = p->tech_pvt; + //session = tech_pvt->session; + session = global_session; + channel = switch_core_session_get_channel(session); + switch_channel_mark_pre_answered(channel); + //switch_channel_set_state(channel, CS_EXECUTE); + } + /**************************/ } else { WARNINGA("skype_call: %s, STATUS: %s is not recognized\n", SKYPIAX_P_LOG, @@ -2686,11 +2674,12 @@ if (option_debug > 100) { DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); } - //DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + //DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); return 0; } -int skypiax_skype_call(struct skypiax_interface *p, char *idest, int timeout, switch_core_session_t *session) +int skypiax_skype_call(struct skypiax_interface *p, char *idest, int timeout, + switch_core_session_t * session) { char rdest[80]; char msg_to_skype[1024]; @@ -2698,7 +2687,7 @@ if (option_debug > 10) { DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); } -switch_sleep(5000); + switch_sleep(5000); //FIXME strncpy(rdest, idest, sizeof(rdest) - 1); strncpy(rdest, "echo123", sizeof(rdest) - 1); @@ -2736,51 +2725,57 @@ return 0; } -static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event, - switch_caller_profile_t *outbound_profile, - switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags) -{ - if ((*new_session = switch_core_session_request(skypiax_endpoint_interface, pool)) != 0) { - private_t *tech_pvt; - switch_channel_t *channel; - switch_caller_profile_t *caller_profile; - - switch_core_session_add_stream(*new_session, NULL); - if ((tech_pvt = (private_t *) switch_core_session_alloc(*new_session, sizeof(private_t))) != 0) { - tech_pvt->p = &SKYPIAX_INTERFACES[2]; //FIXME - channel = switch_core_session_get_channel(*new_session); - tech_init(tech_pvt, *new_session, NULL); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n"); - switch_core_session_destroy(new_session); - return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; - } - - if (outbound_profile) { - char name[128]; - - snprintf(name, sizeof(name), "skypiax/%s", outbound_profile->destination_number); - switch_channel_set_name(channel, name); - - caller_profile = switch_caller_profile_clone(*new_session, outbound_profile); - switch_channel_set_caller_profile(channel, caller_profile); - tech_pvt->caller_profile = caller_profile; - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Doh! no caller profile\n"); - switch_core_session_destroy(new_session); - return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; - } - - - skypiax_skype_call(tech_pvt->p, outbound_profile->destination_number, 30, *new_session); - - switch_channel_set_flag(channel, CF_OUTBOUND); - switch_set_flag_locked(tech_pvt, TFLAG_OUTBOUND); - switch_channel_set_state(channel, CS_INIT); - return SWITCH_CAUSE_SUCCESS; - } +static switch_call_cause_t channel_outgoing_channel(switch_core_session_t * session, + switch_event_t * var_event, + switch_caller_profile_t * + outbound_profile, + switch_core_session_t ** new_session, + switch_memory_pool_t ** pool, + switch_originate_flag_t flags) +{ + if ((*new_session = switch_core_session_request(skypiax_endpoint_interface, pool)) != 0) { + private_t *tech_pvt; + switch_channel_t *channel; + switch_caller_profile_t *caller_profile; + + switch_core_session_add_stream(*new_session, NULL); + if ((tech_pvt = + (private_t *) switch_core_session_alloc(*new_session, sizeof(private_t))) != 0) { + tech_pvt->p = &SKYPIAX_INTERFACES[2]; //FIXME + channel = switch_core_session_get_channel(*new_session); + tech_init(tech_pvt, *new_session, NULL); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, + "Hey where is my memory pool?\n"); + switch_core_session_destroy(new_session); + return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; + } + + if (outbound_profile) { + char name[128]; + + snprintf(name, sizeof(name), "skypiax/%s", outbound_profile->destination_number); + switch_channel_set_name(channel, name); + + caller_profile = switch_caller_profile_clone(*new_session, outbound_profile); + switch_channel_set_caller_profile(channel, caller_profile); + tech_pvt->caller_profile = caller_profile; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Doh! no caller profile\n"); + switch_core_session_destroy(new_session); + return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; + } + + skypiax_skype_call(tech_pvt->p, outbound_profile->destination_number, 30, + *new_session); + + switch_channel_set_flag(channel, CF_OUTBOUND); + switch_set_flag_locked(tech_pvt, TFLAG_OUTBOUND); + switch_channel_set_state(channel, CS_INIT); + return SWITCH_CAUSE_SUCCESS; + } - return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; + return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; } @@ -2788,301 +2783,336 @@ * \brief This thread runs during a call, and monitor the interface serial port for signaling, like hangup, caller id, etc * */ -static void *SWITCH_THREAD_FUNC skypiax_do_controldev_thread(switch_thread_t *thread, void *obj) +static void *SWITCH_THREAD_FUNC skypiax_do_controldev_thread(switch_thread_t * thread, + void *obj) //void *skypiax_do_controldev_thread(void *data) { struct skypiax_interface *p = obj; int res; - DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); - - DEBUGA_SKYPE("In skypiax_do_controldev_thread: started, p=%p\n", SKYPIAX_P_LOG, (void *)p); + DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("In skypiax_do_controldev_thread: started, p=%p\n", SKYPIAX_P_LOG, + (void *) p); while (1) { switch_sleep(1000); res = skypiax_skype_read(p); #if 1 - //if (res == CALLFLOW_INCOMING_HANGUP && p->interface_state != SKYPIAX_STATE_DOWN) - if (res == CALLFLOW_INCOMING_HANGUP) { - switch_core_session_t *session = NULL; - private_t *tech_pvt; - switch_channel_t *channel; + //if (res == CALLFLOW_INCOMING_HANGUP && p->interface_state != SKYPIAX_STATE_DOWN) + if (res == CALLFLOW_INCOMING_HANGUP) { + switch_core_session_t *session = NULL; + private_t *tech_pvt; + switch_channel_t *channel; + //p->interface_state=SKYPIAX_STATE_DOWN; + //if (option_debug) + DEBUGA_SKYPE("skype call ended\n", SKYPIAX_P_LOG); - //p->interface_state=SKYPIAX_STATE_DOWN; - //if (option_debug) - DEBUGA_SKYPE("skype call ended\n", SKYPIAX_P_LOG); + tech_pvt = p->tech_pvt; + session = tech_pvt->session; - tech_pvt = p->tech_pvt; - session = tech_pvt->session; - - channel = switch_core_session_get_channel(session); - DEBUGA_SKYPE("before channel_on_hangup\n", SKYPIAX_P_LOG); + channel = switch_core_session_get_channel(session); + DEBUGA_SKYPE("before channel_on_hangup\n", SKYPIAX_P_LOG); - //switch_channel_set_state(channel, CS_HANGUP); + //switch_channel_set_state(channel, CS_HANGUP); - switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); - DEBUGA_SKYPE("after channel_on_hangup\n", SKYPIAX_P_LOG); + switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); + DEBUGA_SKYPE("after channel_on_hangup\n", SKYPIAX_P_LOG); - //DEBUGA_SKYPE("set state to CS_HANGUP\n", SKYPIAX_P_LOG); - } + //DEBUGA_SKYPE("set state to CS_HANGUP\n", SKYPIAX_P_LOG); + } #endif } //if (option_debug > 10) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); //} return NULL; } - #endif // CONTROLDEV_THREAD static switch_status_t load_config(void) { - char *cf = "skypiax.conf"; - switch_xml_t cfg, xml, global_settings, param, interfaces, myinterface; + char *cf = "skypiax.conf"; + switch_xml_t cfg, xml, global_settings, param, interfaces, myinterface; + + switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, module_pool); + if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf); + return SWITCH_STATUS_TERM; + } + + if ((global_settings = switch_xml_child(cfg, "global_settings"))) { + for (param = switch_xml_child(global_settings, "param"); param; param = param->next) { + char *var = (char *) switch_xml_attr_soft(param, "name"); + char *val = (char *) switch_xml_attr_soft(param, "value"); + + if (!strcasecmp(var, "debug")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "globals.debug=%d\n", + globals.debug); + globals.debug = atoi(val); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "globals.debug=%d\n", + globals.debug); + } else if (!strcasecmp(var, "hold-music")) { + switch_set_string(globals.hold_music, val); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "globals.hold_music=%s\n", + globals.hold_music); + } else if (!strcmp(var, "port")) { + globals.port = atoi(val); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "globals.port=%d\n", + globals.port); + } else if (!strcmp(var, "ip")) { + set_global_ip(val); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "globals.ip=%s\n", + globals.ip); + } else if (!strcmp(var, "codec-master")) { + if (!strcasecmp(val, "us")) { + switch_set_flag(&globals, GFLAG_MY_CODEC_PREFS); + } + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + "codec-master globals.debug=%d\n", globals.debug); + } else if (!strcmp(var, "dialplan")) { + set_global_dialplan(val); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "globals.dialplan=%s\n", + globals.dialplan); + } else if (!strcmp(var, "codec-prefs")) { + set_global_codec_string(val); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + "globals.codec_string=%s\n", globals.codec_string); + globals.codec_order_last = + switch_separate_string(globals.codec_string, ',', globals.codec_order, + SWITCH_MAX_CODECS); + } else if (!strcmp(var, "codec-rates")) { + set_global_codec_rates_string(val); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + "globals.codec_rates_string=%s\n", globals.codec_rates_string); + globals.codec_rates_last = + switch_separate_string(globals.codec_rates_string, ',', globals.codec_rates, + SWITCH_MAX_CODECS); + } + + } + } + + if ((interfaces = switch_xml_child(cfg, "per_interface_settings"))) { + int i = 0; + + for (myinterface = switch_xml_child(interfaces, "interface"); myinterface; + myinterface = myinterface->next) { + char *id = (char *) switch_xml_attr(myinterface, "id"); + char *name = (char *) switch_xml_attr(myinterface, "name"); + char *context = "default"; + char *dialplan = "XML"; + char *tonegroup = NULL; + char *digit_timeout = NULL; + char *max_digits = NULL; + char *hotline = NULL; + char *dial_regex = NULL; + char *hold_music = NULL; + char *fail_dial_regex = NULL; + char *enable_callerid = "true"; + char *X11_display = NULL; + + uint32_t interface_id = 0, to = 0, max = 0; + + for (param = switch_xml_child(myinterface, "param"); param; param = param->next) { + char *var = (char *) switch_xml_attr_soft(param, "name"); + char *val = (char *) switch_xml_attr_soft(param, "value"); + + if (!strcasecmp(var, "tonegroup")) { + tonegroup = val; + } else if (!strcasecmp(var, "digit_timeout") || !strcasecmp(var, "digit-timeout")) { + digit_timeout = val; + } else if (!strcasecmp(var, "context")) { + context = val; + } else if (!strcasecmp(var, "dialplan")) { + dialplan = val; + } else if (!strcasecmp(var, "dial-regex")) { + dial_regex = val; + } else if (!strcasecmp(var, "enable-callerid")) { + enable_callerid = val; + } else if (!strcasecmp(var, "fail-dial-regex")) { + fail_dial_regex = val; + } else if (!strcasecmp(var, "hold-music")) { + hold_music = val; + } else if (!strcasecmp(var, "X11-display") || !strcasecmp(var, "X11_display")) { + X11_display = val; + } else if (!strcasecmp(var, "max_digits") || !strcasecmp(var, "max-digits")) { + max_digits = val; + } else if (!strcasecmp(var, "hotline")) { + hotline = val; + } - switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, module_pool); - if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf); - return SWITCH_STATUS_TERM; - } - - if ((global_settings = switch_xml_child(cfg, "global_settings"))) { - for (param = switch_xml_child(global_settings, "param"); param; param = param->next) { - char *var = (char *) switch_xml_attr_soft(param, "name"); - char *val = (char *) switch_xml_attr_soft(param, "value"); - - if (!strcasecmp(var, "debug")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "globals.debug=%d\n", globals.debug); - globals.debug = atoi(val); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "globals.debug=%d\n", globals.debug); - } else if (!strcasecmp(var, "hold-music")) { - switch_set_string(globals.hold_music, val); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "globals.hold_music=%s\n", globals.hold_music); - } else if (!strcmp(var, "port")) { - globals.port = atoi(val); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "globals.port=%d\n", globals.port); - } else if (!strcmp(var, "ip")) { - set_global_ip(val); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "globals.ip=%s\n", globals.ip); - } else if (!strcmp(var, "codec-master")) { - if (!strcasecmp(val, "us")) { - switch_set_flag(&globals, GFLAG_MY_CODEC_PREFS); - } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "codec-master globals.debug=%d\n", globals.debug); - } else if (!strcmp(var, "dialplan")) { - set_global_dialplan(val); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "globals.dialplan=%s\n", globals.dialplan); - } else if (!strcmp(var, "codec-prefs")) { - set_global_codec_string(val); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "globals.codec_string=%s\n", globals.codec_string); - globals.codec_order_last = switch_separate_string(globals.codec_string, ',', globals.codec_order, SWITCH_MAX_CODECS); - } else if (!strcmp(var, "codec-rates")) { - set_global_codec_rates_string(val); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "globals.codec_rates_string=%s\n", globals.codec_rates_string); - globals.codec_rates_last = switch_separate_string(globals.codec_rates_string, ',', globals.codec_rates, SWITCH_MAX_CODECS); - } - - } - } - - if ((interfaces = switch_xml_child(cfg, "per_interface_settings"))) { - int i=0; - - for (myinterface = switch_xml_child(interfaces, "interface"); myinterface; myinterface = myinterface->next) { - char *id = (char *) switch_xml_attr(myinterface, "id"); - char *name = (char *) switch_xml_attr(myinterface, "name"); - char *context = "default"; - char *dialplan = "XML"; - char *tonegroup = NULL; - char *digit_timeout = NULL; - char *max_digits = NULL; - char *hotline = NULL; - char *dial_regex = NULL; - char *hold_music = NULL; - char *fail_dial_regex = NULL; - char *enable_callerid = "true"; - char *X11_display = NULL; - - uint32_t interface_id = 0, to = 0, max = 0; - - for (param = switch_xml_child(myinterface, "param"); param; param = param->next) { - char *var = (char *) switch_xml_attr_soft(param, "name"); - char *val = (char *) switch_xml_attr_soft(param, "value"); - - if (!strcasecmp(var, "tonegroup")) { - tonegroup = val; - } else if (!strcasecmp(var, "digit_timeout") || !strcasecmp(var, "digit-timeout")) { - digit_timeout = val; - } else if (!strcasecmp(var, "context")) { - context = val; - } else if (!strcasecmp(var, "dialplan")) { - dialplan = val; - } else if (!strcasecmp(var, "dial-regex")) { - dial_regex = val; - } else if (!strcasecmp(var, "enable-callerid")) { - enable_callerid = val; - } else if (!strcasecmp(var, "fail-dial-regex")) { - fail_dial_regex = val; - } else if (!strcasecmp(var, "hold-music")) { - hold_music = val; - } else if (!strcasecmp(var, "X11-display") || !strcasecmp(var, "X11_display")) { - X11_display = val; - } else if (!strcasecmp(var, "max_digits") || !strcasecmp(var, "max-digits")) { - max_digits = val; - } else if (!strcasecmp(var, "hotline")) { - hotline = val; - } - - } - - if (!X11_display) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "interface missing REQUIRED param 'X11_display'\n"); - continue; - } - - if (!id) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "interface missing REQUIRED param 'id'\n"); - continue; - } - if (switch_is_number(id)) { - interface_id = atoi(id); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "interface_id=%d\n", interface_id); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "interface param 'id' MUST be a number, now id='%s'\n", id); - continue; - } - - - if (!name) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "interface missing param 'name', not nice, but works\n"); - } - - if (!tonegroup) { - tonegroup = "us"; - } - - if (digit_timeout) { - to = atoi(digit_timeout); - } - - if (max_digits) { - max = atoi(max_digits); - } - - if (name) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "name=%s\n", name); - } - if(interface_id && interface_id < SKYPIAX_MAX_INTERFACES ) { - struct skypiax_interface newconf; - memset(&newconf, '\0', sizeof(newconf)); - SKYPIAX_INTERFACES[interface_id]=newconf; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CONFIGURING interface_id=%d\n", interface_id); - switch_set_string(SKYPIAX_INTERFACES[interface_id].interface_id, id); - if (name) { - switch_set_string(SKYPIAX_INTERFACES[interface_id].name, name); - } else { - switch_set_string(SKYPIAX_INTERFACES[interface_id].name, "N/A"); - } - switch_set_string(SKYPIAX_INTERFACES[interface_id].X11_display, X11_display); - switch_set_string(SKYPIAX_INTERFACES[interface_id].context, context); - switch_set_string(SKYPIAX_INTERFACES[interface_id].dialplan, dialplan); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "interface_id=%d SKYPIAX_INTERFACES[interface_id].X11_display=%s\n", interface_id, SKYPIAX_INTERFACES[interface_id].X11_display); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "interface_id=%d SKYPIAX_INTERFACES[interface_id].name=%s\n", interface_id, SKYPIAX_INTERFACES[interface_id].name); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "interface_id=%d SKYPIAX_INTERFACES[interface_id].context=%s\n", interface_id, SKYPIAX_INTERFACES[interface_id].context); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "interface_id=%d SKYPIAX_INTERFACES[interface_id].dialplan=%s\n", interface_id, SKYPIAX_INTERFACES[interface_id].dialplan); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "STARTING interface_id=%d\n", interface_id); - - -if(1) -{ - switch_thread_t *thread; - switch_threadattr_t *thd_attr = NULL; - - switch_threadattr_create(&thd_attr, module_pool); - switch_threadattr_detach_set(thd_attr, 1); - switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&thread, thd_attr, do_skype_thread, &SKYPIAX_INTERFACES[interface_id], module_pool); -} - -switch_sleep(100000); -if(1) -{ - switch_thread_t *thread; - switch_threadattr_t *thd_attr = NULL; - - switch_threadattr_create(&thd_attr, module_pool); - switch_threadattr_detach_set(thd_attr, 1); - switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&thread, thd_attr, skypiax_do_controldev_thread, &SKYPIAX_INTERFACES[interface_id], module_pool); -} - - -switch_sleep(1000000); - -skypiax_skypeaudio_init(&SKYPIAX_INTERFACES[interface_id]); - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "STARTED interface_id=%d\n", interface_id); - - - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "interface id %d is higher than SKYPIAX_MAX_INTERFACES (%d)\n", interface_id, SKYPIAX_MAX_INTERFACES); - continue; - } - - } - - for(i=0; i < SKYPIAX_MAX_INTERFACES; i++) { - if(strlen(SKYPIAX_INTERFACES[i].name)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "i=%d SKYPIAX_INTERFACES[%d].interface_id=%s\n", i, i, SKYPIAX_INTERFACES[i].interface_id); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "i=%d SKYPIAX_INTERFACES[%d].X11_display=%s\n", i, i, SKYPIAX_INTERFACES[i].X11_display); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "i=%d SKYPIAX_INTERFACES[%d].name=%s\n", i, i, SKYPIAX_INTERFACES[i].name); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "i=%d SKYPIAX_INTERFACES[%d].context=%s\n", i, i, SKYPIAX_INTERFACES[i].context); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "i=%d SKYPIAX_INTERFACES[%d].dialplan=%s\n", i, i, SKYPIAX_INTERFACES[i].dialplan); - } - } - } + } + + if (!X11_display) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + "interface missing REQUIRED param 'X11_display'\n"); + continue; + } + + if (!id) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + "interface missing REQUIRED param 'id'\n"); + continue; + } + if (switch_is_number(id)) { + interface_id = atoi(id); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "interface_id=%d\n", + interface_id); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + "interface param 'id' MUST be a number, now id='%s'\n", id); + continue; + } + + if (!name) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, + "interface missing param 'name', not nice, but works\n"); + } - switch_xml_free(xml); + if (!tonegroup) { + tonegroup = "us"; + } + + if (digit_timeout) { + to = atoi(digit_timeout); + } - return SWITCH_STATUS_SUCCESS; + if (max_digits) { + max = atoi(max_digits); + } + + if (name) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "name=%s\n", name); + } + if (interface_id && interface_id < SKYPIAX_MAX_INTERFACES) { + struct skypiax_interface newconf; + memset(&newconf, '\0', sizeof(newconf)); + SKYPIAX_INTERFACES[interface_id] = newconf; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + "CONFIGURING interface_id=%d\n", interface_id); + switch_set_string(SKYPIAX_INTERFACES[interface_id].interface_id, id); + if (name) { + switch_set_string(SKYPIAX_INTERFACES[interface_id].name, name); + } else { + switch_set_string(SKYPIAX_INTERFACES[interface_id].name, "N/A"); + } + switch_set_string(SKYPIAX_INTERFACES[interface_id].X11_display, X11_display); + switch_set_string(SKYPIAX_INTERFACES[interface_id].context, context); + switch_set_string(SKYPIAX_INTERFACES[interface_id].dialplan, dialplan); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + "interface_id=%d SKYPIAX_INTERFACES[interface_id].X11_display=%s\n", + interface_id, SKYPIAX_INTERFACES[interface_id].X11_display); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + "interface_id=%d SKYPIAX_INTERFACES[interface_id].name=%s\n", + interface_id, SKYPIAX_INTERFACES[interface_id].name); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + "interface_id=%d SKYPIAX_INTERFACES[interface_id].context=%s\n", + interface_id, SKYPIAX_INTERFACES[interface_id].context); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + "interface_id=%d SKYPIAX_INTERFACES[interface_id].dialplan=%s\n", + interface_id, SKYPIAX_INTERFACES[interface_id].dialplan); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, + "STARTING interface_id=%d\n", interface_id); + + if (1) { + switch_thread_t *thread; + switch_threadattr_t *thd_attr = NULL; + + switch_threadattr_create(&thd_attr, module_pool); + switch_threadattr_detach_set(thd_attr, 1); + switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); + switch_thread_create(&thread, thd_attr, do_skype_thread, + &SKYPIAX_INTERFACES[interface_id], module_pool); + } + + switch_sleep(100000); + if (1) { + switch_thread_t *thread; + switch_threadattr_t *thd_attr = NULL; + + switch_threadattr_create(&thd_attr, module_pool); + switch_threadattr_detach_set(thd_attr, 1); + switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); + switch_thread_create(&thread, thd_attr, skypiax_do_controldev_thread, + &SKYPIAX_INTERFACES[interface_id], module_pool); + } + + switch_sleep(1000000); + + skypiax_skypeaudio_init(&SKYPIAX_INTERFACES[interface_id]); + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, + "STARTED interface_id=%d\n", interface_id); + + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + "interface id %d is higher than SKYPIAX_MAX_INTERFACES (%d)\n", + interface_id, SKYPIAX_MAX_INTERFACES); + continue; + } + + } + + for (i = 0; i < SKYPIAX_MAX_INTERFACES; i++) { + if (strlen(SKYPIAX_INTERFACES[i].name)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + "i=%d SKYPIAX_INTERFACES[%d].interface_id=%s\n", i, i, + SKYPIAX_INTERFACES[i].interface_id); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + "i=%d SKYPIAX_INTERFACES[%d].X11_display=%s\n", i, i, + SKYPIAX_INTERFACES[i].X11_display); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + "i=%d SKYPIAX_INTERFACES[%d].name=%s\n", i, i, + SKYPIAX_INTERFACES[i].name); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + "i=%d SKYPIAX_INTERFACES[%d].context=%s\n", i, i, + SKYPIAX_INTERFACES[i].context); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + "i=%d SKYPIAX_INTERFACES[%d].dialplan=%s\n", i, i, + SKYPIAX_INTERFACES[i].dialplan); + } + } + } + + switch_xml_free(xml); + + return SWITCH_STATUS_SUCCESS; } SWITCH_MODULE_LOAD_FUNCTION(mod_skypiax_load) { struct skypiax_interface *p = NULL; - module_pool = pool; + module_pool = pool; - memset(&globals, '\0', sizeof(globals)); - memset(SKYPIAX_INTERFACES, '\0', sizeof(SKYPIAX_INTERFACES)); + memset(&globals, '\0', sizeof(globals)); + memset(SKYPIAX_INTERFACES, '\0', sizeof(SKYPIAX_INTERFACES)); -#ifndef _WINDOWS_ //FIXME +#ifndef _WINDOWS_ //FIXME if (!XInitThreads()) { - ERRORA("Not initialized XInitThreads!\n", SKYPIAX_P_LOG); + ERRORA("Not initialized XInitThreads!\n", SKYPIAX_P_LOG); } else { - DEBUGA_SKYPE("Initialized XInitThreads!\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("Initialized XInitThreads!\n", SKYPIAX_P_LOG); } -switch_sleep(10000); //FIXME + switch_sleep(10000); //FIXME #endif /* _WINDOWS_ */ + load_config(); + *module_interface = switch_loadable_module_create_module_interface(pool, modname); + skypiax_endpoint_interface = + switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE); + skypiax_endpoint_interface->interface_name = "skypiax"; + skypiax_endpoint_interface->io_routines = &skypiax_io_routines; + skypiax_endpoint_interface->state_handler = &skypiax_state_handlers; - load_config(); - - - *module_interface = switch_loadable_module_create_module_interface(pool, modname); - skypiax_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE); - skypiax_endpoint_interface->interface_name = "skypiax"; - skypiax_endpoint_interface->io_routines = &skypiax_io_routines; - skypiax_endpoint_interface->state_handler = &skypiax_state_handlers; - - /* indicate that the module should continue to be loaded */ - return SWITCH_STATUS_SUCCESS; + /* indicate that the module should continue to be loaded */ + return SWITCH_STATUS_SUCCESS; } /* @@ -3094,64 +3124,64 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypiax_shutdown) { - int x = 0; + int x = 0; + + running = -1; + + while (running) { + if (x++ > 100) { + break; + } + switch_yield(20000); + } + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t channel_on_hangup(switch_core_session_t * session) +{ + switch_channel_t *channel = NULL; + private_t *tech_pvt = NULL; + skypiax_interface_t *p; + char msg_to_skype[256]; - running = -1; + channel = switch_core_session_get_channel(session); + assert(channel != NULL); - while (running) { - if (x++ > 100) { - break; - } - switch_yield(20000); - } - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t channel_on_hangup(switch_core_session_t *session) -{ - switch_channel_t *channel = NULL; - private_t *tech_pvt = NULL; - skypiax_interface_t *p; - char msg_to_skype[256]; - - channel = switch_core_session_get_channel(session); - assert(channel != NULL); - - tech_pvt = switch_core_session_get_private(session); - assert(tech_pvt != NULL); - - p = tech_pvt->p; - - switch_clear_flag_locked(tech_pvt, TFLAG_IO); - switch_clear_flag_locked(tech_pvt, TFLAG_VOICE); - //switch_set_flag_locked(tech_pvt, TFLAG_HANGUP); - - if(strlen(p->skype_call_id)) { - //switch_thread_cond_signal(tech_pvt->cond); - WARNINGA("hanging up skype call: %s\n", SKYPIAX_P_LOG, p->skype_call_id); - //sprintf(msg_to_skype, "SET CALL %s STATUS FINISHED", p->skype_call_id); - sprintf(msg_to_skype, "ALTER CALL %s HANGUP", p->skype_call_id); - skypiax_skype_write(p, msg_to_skype); - } - - if (tech_pvt->read_codec.implementation) { - switch_core_codec_destroy(&tech_pvt->read_codec); - } - - if (tech_pvt->write_codec.implementation) { - switch_core_codec_destroy(&tech_pvt->write_codec); - } - - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL HANGUP\n", switch_channel_get_name(channel)); - switch_mutex_lock(globals.mutex); - globals.calls--; - if (globals.calls < 0) { - globals.calls = 0; - } - switch_mutex_unlock(globals.mutex); + tech_pvt = switch_core_session_get_private(session); + assert(tech_pvt != NULL); - return SWITCH_STATUS_SUCCESS; + p = tech_pvt->p; + + switch_clear_flag_locked(tech_pvt, TFLAG_IO); + switch_clear_flag_locked(tech_pvt, TFLAG_VOICE); + //switch_set_flag_locked(tech_pvt, TFLAG_HANGUP); + + if (strlen(p->skype_call_id)) { + //switch_thread_cond_signal(tech_pvt->cond); + WARNINGA("hanging up skype call: %s\n", SKYPIAX_P_LOG, p->skype_call_id); + //sprintf(msg_to_skype, "SET CALL %s STATUS FINISHED", p->skype_call_id); + sprintf(msg_to_skype, "ALTER CALL %s HANGUP", p->skype_call_id); + skypiax_skype_write(p, msg_to_skype); + } + + if (tech_pvt->read_codec.implementation) { + switch_core_codec_destroy(&tech_pvt->read_codec); + } + + if (tech_pvt->write_codec.implementation) { + switch_core_codec_destroy(&tech_pvt->write_codec); + } + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL HANGUP\n", + switch_channel_get_name(channel)); + switch_mutex_lock(globals.mutex); + globals.calls--; + if (globals.calls < 0) { + globals.calls = 0; + } + switch_mutex_unlock(globals.mutex); + + return SWITCH_STATUS_SUCCESS; } /* For Emacs: From gmaruzz at freeswitch.org Thu Dec 4 23:25:01 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 02:25:01 -0500 Subject: [Freeswitch-svn] [commit] r10609 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Fri Dec 5 02:25:00 2008 New Revision: 10609 Log: skypiax: cleaner Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Fri Dec 5 02:25:00 2008 @@ -58,7 +58,6 @@ #define WARNINGA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][WARNINGA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); #define NOTICA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][NOTICA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -//#define SKYPIAX_P_LOG p ? p->owner : NULL, (unsigned long)pthread_self(), __LINE__, p ? p->name ? p->name : "none" : "none", p ? p->owner ? p->owner->_state : -1 : -1, p ? p->interface_state : -1, p ? p->skype_callflow : -1 #define SKYPIAX_P_LOG NULL, (unsigned long)55, __LINE__, p ? p->name ? p->name : "none" : "none", -1, p ? p->interface_state : -1, p ? p->skype_callflow : -1 /*********************************/ @@ -351,13 +350,9 @@ strncpy(msg_from_skype, (const char *) poCopyData->lpData, sizeof(msg_from_skype) - 2); - //howmany = strlen((const char *) poCopyData->lpData); howmany = strlen(msg_from_skype) + 1; - //switch_file_write(win32_AsteriskHandlesSkype->fdesc[1], (const char *) poCopyData->lpData, &howmany); switch_file_write(win32_AsteriskHandlesSkype->fdesc[1], msg_from_skype, &howmany); NOTICA("From Skype API: %s\n", SKYPIAX_P_LOG, (const char *) poCopyData->lpData); - //howmany=1; - //switch_file_write(win32_AsteriskHandlesSkype->fdesc[1], "\0", &howmany); lReturnCode = 1; } break; @@ -463,7 +458,6 @@ DWORD win32_dwThreadId; -//void *do_skype_thread(void *data) static void *SWITCH_THREAD_FUNC do_skype_thread(switch_thread_t * thread, void *obj) { /* create window class */ @@ -475,15 +469,6 @@ /* destroy main window */ /* destroy window class */ -#if 0 - res = pipe(p->AsteriskHandlesAst.fdesc); - if (res) { - ERRORA("Unable to create skype pipe, exiting skype thread\n", SKYPIAX_P_LOG); - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - return NULL; - } -#endif //0 - struct skypiax_interface *p; p = obj; @@ -560,110 +545,6 @@ } -#undef PORTAUDIO_ENGAGE -#ifdef PORTAUDIO_ENGAGE -static switch_status_t engage_device(int sample_rate, int codec_ms) -{ - PaStreamParameters inputParameters, outputParameters; - PaError err; - - if (!globals.audio_stream) { - if (!sample_rate) { - sample_rate = globals.sample_rate; - } - if (!codec_ms) { - codec_ms = globals.codec_ms; - } - - if (!globals.read_codec.implementation) { - if (switch_core_codec_init - (&globals.read_codec, "L16", NULL, sample_rate, codec_ms, 1, - SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, - NULL) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n"); - return SWITCH_STATUS_FALSE; - } - } - - switch_assert(globals.read_codec.implementation); - - if (!globals.write_codec.implementation) { - if (switch_core_codec_init - (&globals.write_codec, "L16", NULL, sample_rate, codec_ms, 1, - SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, - NULL) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n"); - switch_core_codec_destroy(&globals.read_codec); - return SWITCH_STATUS_FALSE; - } - } - - if (!globals.timer.timer_interface) { - if (switch_core_timer_init - (&globals.timer, globals.timer_name, codec_ms, - globals.read_codec.implementation->samples_per_packet, - module_pool) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "setup timer failed!\n"); - switch_core_codec_destroy(&globals.read_codec); - switch_core_codec_destroy(&globals.write_codec); - return SWITCH_STATUS_FALSE; - } - } - - if (!globals.hold_timer.timer_interface) { - if (switch_core_timer_init - (&globals.hold_timer, globals.timer_name, codec_ms, - globals.read_codec.implementation->samples_per_packet, - module_pool) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, - "setup hold timer failed!\n"); - switch_core_codec_destroy(&globals.read_codec); - switch_core_codec_destroy(&globals.write_codec); - switch_core_timer_destroy(&globals.timer); - return SWITCH_STATUS_FALSE; - } - } - - globals.read_frame.rate = sample_rate; - globals.read_frame.codec = &globals.read_codec; - - switch_mutex_lock(globals.device_lock); - /* LOCKED ************************************************************************************************** */ - inputParameters.device = globals.indev; - inputParameters.channelCount = 1; - inputParameters.sampleFormat = SAMPLE_TYPE; - inputParameters.suggestedLatency = - Pa_GetDeviceInfo(inputParameters.device)->defaultLowInputLatency; - inputParameters.hostApiSpecificStreamInfo = NULL; - - outputParameters.device = globals.outdev; - outputParameters.channelCount = 1; - outputParameters.sampleFormat = SAMPLE_TYPE; - outputParameters.suggestedLatency = - Pa_GetDeviceInfo(outputParameters.device)->defaultLowOutputLatency; - outputParameters.hostApiSpecificStreamInfo = NULL; - err = - OpenAudioStream(&globals.audio_stream, &inputParameters, &outputParameters, - sample_rate, paClipOff, - globals.read_codec.implementation->samples_per_packet); - /* UNLOCKED ************************************************************************************************* */ - switch_mutex_unlock(globals.device_lock); - - if (err != paNoError) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, - "Can't open audio device!\n"); - switch_core_codec_destroy(&globals.read_codec); - switch_core_codec_destroy(&globals.write_codec); - switch_core_timer_destroy(&globals.timer); - switch_core_timer_destroy(&globals.hold_timer); - return SWITCH_STATUS_FALSE; - } - } - - return SWITCH_STATUS_SUCCESS; -} -#endif // PORTAUDIO_ENGAGE - #define SKYPE_AUDIO #ifdef SKYPE_AUDIO @@ -676,7 +557,6 @@ struct skypiax_interface *p = obj; short in[GG]; short out[GG / 2]; - //int s, fd, len, sent; int s, fd, len; unsigned int sin_size; struct sockaddr_in my_addr; @@ -692,7 +572,6 @@ } memset(&my_addr, 0, sizeof(my_addr)); my_addr.sin_family = AF_INET; - //my_addr.sin_addr.s_addr = INADDR_ANY; my_addr.sin_addr.s_addr = htonl(0x7f000001); /* use the localhost */ my_addr.sin_port = htons(5556); //FIXME configurable! @@ -769,8 +648,6 @@ howmany = len; switch_file_write(p->audiopipe[1], totalbuf, &howmany); - //howmany = len/2; - //switch_file_write(p->audiopipe[1], out, &howmany); p->audiobuf_is_loaded = 0; //DEBUGA_SKYPE("read=====> req=%d recv=%d to sent=%d sent=%d\n", SKYPIAX_P_LOG, sizeof(short)*GG, len, (len*sizeof(short))/2, howmany); } @@ -797,7 +674,6 @@ switch_file_write(p->audioskypepipe[1], kill_cli_buff, &kill_cli_size); DEBUGA_SKYPE("Skype client GONE\n", SKYPIAX_P_LOG); - //switch_sleep(1000000); #ifndef WIN32_SKYPIAX close(fd); @@ -833,14 +709,12 @@ int a; int i; unsigned int got; - //int exit=0; if (option_debug > 10) { WARNINGA("ENTERING FUNC\n", SKYPIAX_P_LOG); } memset(&my_addr, 0, sizeof(my_addr)); my_addr.sin_family = AF_INET; - //my_addr.sin_addr.s_addr = INADDR_ANY; my_addr.sin_addr.s_addr = htonl(0x7f000001); /* use the localhost */ my_addr.sin_port = htons(5558); //FIXME configurable! @@ -871,7 +745,6 @@ sin_size = sizeof(remote_addr); while ((fd = accept(s, (struct sockaddr *) &remote_addr, &sin_size)) > 0) { DEBUGA_SKYPE("ACCEPTED\n", SKYPIAX_P_LOG); - //while (1 && p->owner && p->owner->_state == SKYPIAX_STATE_UP) FIXME FIXME FIXME while (p->interface_state != SKYPIAX_STATE_DOWN && (p->skype_callflow == CALLFLOW_STATUS_INPROGRESS || p->skype_callflow == SKYPIAX_STATE_UP)) { @@ -880,21 +753,16 @@ fd_set fs; struct timeval to; - //exit=1; - - //fdselect = p->audioskypepipe[0]; fdselect = 1; FD_ZERO(&fs); FD_SET(fdselect, &fs); to.tv_usec = 100; to.tv_sec = 0; - //rt = select(fdselect + 1, &fs, NULL, NULL, &to); rt = 1; if (rt > 0) { got = (NN / 2) * sizeof(short); switch_file_read(p->audioskypepipe[0], in, &got); - //ERRORA("got %d\n", SKYPIAX_P_LOG, got); if (got > 0) { a = 0; @@ -924,7 +792,6 @@ #else closesocket(fd); #endif - //if (exit) break; } @@ -943,63 +810,18 @@ int skypiax_skypeaudio_init(struct skypiax_interface *p) { -//switch_file_t *readp = NULL; -//switch_file_t *writep = NULL; - switch_status_t rv; - //rv = switch_file_pipe_create_ex(&readp, &writep, APR_FULL_NONBLOCK, module_pool); rv = switch_file_pipe_create_ex(&p->audiopipe[0], &p->audiopipe[1], 2, module_pool); rv = switch_file_pipe_timeout_set(p->audiopipe[0], 100000); - //rv = switch_file_pipe_timeout_set(p->audiopipe[1], 10000); - //rv = switch_file_pipe_create(&readp, &writep, module_pool); - - //FIXME int c; -#if 0 -/* build the pipe that will be polled on by pbx */ - c = pipe(p->audiopipe); - if (c) { - ERRORA("Unable to create audio pipe\n", SKYPIAX_P_LOG); - if (option_debug > 10) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - return -1; - } -#endif /* the pipe is our audio fd for pbx to poll on */ p->skypiax_sound_capt_fd = p->audiopipe[0]; - /* let's start the serial monitoring thread too, so we can have serial signaling */ - -/* - if (ast_pthread_create(&p->tcp_srv_thread, NULL, skypiax_do_tcp_srv_thread, p) < 0) { - ERRORA("Unable to start tcp_srv_thread thread.\n", SKYPIAX_P_LOG); - if (option_debug > 10) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - return -1; - } -*/ - rv = switch_file_pipe_create_ex(&p->audioskypepipe[0], &p->audioskypepipe[1], 2, module_pool); rv = switch_file_pipe_timeout_set(p->audioskypepipe[0], 100); - //rv = switch_file_pipe_timeout_set(p->audioskypepipe[1], 10000); -#ifdef NOTDEF_WIN32_SKYPIAX - c = pipe(p->audioskypepipe); - if (c) { - ERRORA("Unable to create audioskypepipe\n", SKYPIAX_P_LOG); - if (option_debug > 10) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - return -1; - } - fcntl(p->audioskypepipe[0], F_SETFL, O_NONBLOCK); - fcntl(p->audioskypepipe[1], F_SETFL, O_NONBLOCK); -#endif // WIN32_SKYPIAX - if (option_debug > 10) { DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); } @@ -1010,10 +832,7 @@ struct skypiax_interface *p; short buf[640]; unsigned int samples; - //int fd; int rt; - //fd_set fs; - //struct timeval to; p = tech_pvt->p; @@ -1021,14 +840,6 @@ memset(buf, '\0', sizeof(buf)); -#if 0 - fd = p->audiopipe[0]; - FD_ZERO(&fs); - FD_SET(fd, &fs); - to.tv_usec = 100000; - to.tv_sec = 0; - rt = select(fd + 1, &fs, NULL, NULL, &to); -#endif rt = 1; if (rt > 0) { @@ -1041,7 +852,6 @@ if (samples) DEBUGA_SKYPE("read=====> NOT GOOD samples=%d expected=%d\n", SKYPIAX_P_LOG, samples, SAMPLES_PER_FRAME * sizeof(short)); - //switch_sleep(1000); //do nothing } else { tech_pvt->read_frame.datalen = samples; @@ -1058,63 +868,10 @@ return SWITCH_STATUS_SUCCESS; } -#if 0 -//cicopet -struct ast_frame *skypiax_skypeaudio_read(struct skypiax_interface *p) -{ - static struct ast_frame f; - static short __buf[SKYPIAX_FRAME_SIZE + SKYPIAX_FRIENDLY_OFFSET / 2]; - short *buf; - int samples; - - if (option_debug > 100) { - DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); - } - memset(__buf, '\0', (SKYPIAX_FRAME_SIZE + SKYPIAX_FRIENDLY_OFFSET / 2)); - - buf = __buf + SKYPIAX_FRIENDLY_OFFSET / 2; - - f.frametype = SKYPIAX_FRAME_NULL; - f.subclass = 0; - f.samples = 0; - f.datalen = 0; - f.data = NULL; - f.offset = 0; - f.src = skypiax_type; - f.mallocd = 0; - f.delivery.tv_sec = 0; - f.delivery.tv_usec = 0; - - if ((samples = read(p->audiopipe[0], buf, SAMPLES_PER_FRAME * sizeof(short))) != 320) { - DEBUGA_SOUND("read=====> NOT GOOD samples=%d expected=%d\n", SKYPIAX_P_LOG, samples, - SAMPLES_PER_FRAME * sizeof(short)); - switch_sleep(100); - //do nothing - } else { - //DEBUGA_SOUND("read=====> GOOD samples=%d\n", SKYPIAX_P_LOG, samples); - /* A real frame */ - f.frametype = SKYPIAX_FRAME_VOICE; - f.subclass = SKYPIAX_FORMAT_SLINEAR; - f.samples = SKYPIAX_FRAME_SIZE; - f.datalen = SKYPIAX_FRAME_SIZE * 2; - f.data = buf; - f.offset = SKYPIAX_FRIENDLY_OFFSET; - f.src = skypiax_type; - f.mallocd = 0; - } - - if (option_debug > 100) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - return &f; -} -#endif //0 - #endif /* SKYPE_AUDIO */ static void tech_init(private_t * tech_pvt, switch_core_session_t * session, skypiax_interface_t * p) { - //struct skypiax_interface *p = NULL; DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); tech_pvt->read_frame.data = tech_pvt->databuf; @@ -1224,9 +981,6 @@ switch_clear_flag_locked(tech_pvt, TFLAG_IO); switch_clear_flag_locked(tech_pvt, TFLAG_VOICE); switch_set_flag_locked(tech_pvt, TFLAG_HANGUP); - //switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); - //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "CHANNEL after TFLAG_HUP\n"); - //switch_thread_cond_signal(tech_pvt->cond); break; case SWITCH_SIG_BREAK: switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, @@ -1268,8 +1022,6 @@ { switch_channel_t *channel = NULL; private_t *tech_pvt = NULL; - //switch_time_t started = switch_time_now(); - //unsigned int elapsed; switch_byte_t *data; channel = switch_core_session_get_channel(session); @@ -1304,26 +1056,6 @@ "CHANNEL READ FRAME not IO\n"); return SWITCH_STATUS_FALSE; } -#if 0 - if ((samples = read(p->audiopipe[0], buf, SAMPLES_PER_FRAME * sizeof(short))) != 320) { - DEBUGA_SOUND("read=====> NOT GOOD samples=%d expected=%d\n", SKYPIAX_P_LOG, samples, - SAMPLES_PER_FRAME * sizeof(short)); - switch_sleep(100); - //do nothing - } else { - //DEBUGA_SOUND("read=====> GOOD samples=%d\n", SKYPIAX_P_LOG, samples); - /* A real frame */ - f.frametype = SKYPIAX_FRAME_VOICE; - f.subclass = SKYPIAX_FORMAT_SLINEAR; - f.samples = SKYPIAX_FRAME_SIZE; - f.datalen = SKYPIAX_FRAME_SIZE * 2; - f.data = buf; - f.offset = SKYPIAX_FRIENDLY_OFFSET; - f.src = skypiax_type; - f.mallocd = 0; - } -#endif - //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "============>\n"); if (switch_test_flag(tech_pvt, TFLAG_IO) && switch_test_flag(tech_pvt, TFLAG_VOICE)) { @@ -1367,7 +1099,6 @@ { switch_channel_t *channel = NULL; private_t *tech_pvt = NULL; - //switch_frame_t *pframe; unsigned int sent; struct skypiax_interface *p = NULL; @@ -1400,225 +1131,6 @@ } -#if 0 -switch_file_t *readp = NULL; -switch_file_t *writep = NULL; - -void create_pipe(void *data) -{ - switch_status_t rv; - - //rv = switch_file_pipe_create_ex(&readp, &writep, APR_FULL_NONBLOCK, module_pool); - rv = switch_file_pipe_create_ex(&readp, &writep, 2, module_pool); - //rv = switch_file_pipe_create(&readp, &writep, module_pool); -} - -#if 0 -//testpipe.c - -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (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.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include "testutil.h" -#include "apr_file_io.h" -#include "apr_errno.h" -#include "apr_general.h" -#include "apr_lib.h" -#include "apr_thread_proc.h" -#include "apr_strings.h" - -static apr_file_t *readp = NULL; -static apr_file_t *writep = NULL; - -static void create_pipe(abts_case * tc, void *data) -{ - apr_status_t rv; - - rv = apr_file_pipe_create(&readp, &writep, p); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_PTR_NOTNULL(tc, readp); - ABTS_PTR_NOTNULL(tc, writep); -} - -static void close_pipe(abts_case * tc, void *data) -{ - apr_status_t rv; - apr_size_t nbytes = 256; - char buf[256]; - - rv = apr_file_close(readp); - rv = apr_file_close(writep); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - - rv = apr_file_read(readp, buf, &nbytes); - ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_EBADF(rv)); -} - -static void set_timeout(abts_case * tc, void *data) -{ - apr_status_t rv; - apr_interval_time_t timeout; - - rv = apr_file_pipe_create_ex(&readp, &writep, APR_WRITE_BLOCK, p); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_PTR_NOTNULL(tc, readp); - ABTS_PTR_NOTNULL(tc, writep); - - rv = apr_file_pipe_timeout_get(writep, &timeout); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_ASSERT(tc, "Timeout mismatch, expected -1", timeout == -1); - - rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1)); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - - rv = apr_file_pipe_timeout_get(readp, &timeout); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_ASSERT(tc, "Timeout mismatch, expected 1 second", timeout == apr_time_from_sec(1)); -} - -static void read_write(abts_case * tc, void *data) -{ - apr_status_t rv; - char *buf; - apr_size_t nbytes; - - nbytes = strlen("this is a test"); - buf = (char *) apr_palloc(p, nbytes + 1); - - rv = apr_file_pipe_create_ex(&readp, &writep, APR_WRITE_BLOCK, p); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_PTR_NOTNULL(tc, readp); - ABTS_PTR_NOTNULL(tc, writep); - - rv = apr_file_pipe_timeout_set(readp, apr_time_from_sec(1)); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - - if (!rv) { - rv = apr_file_read(readp, buf, &nbytes); - ABTS_INT_EQUAL(tc, 1, APR_STATUS_IS_TIMEUP(rv)); - ABTS_SIZE_EQUAL(tc, 0, nbytes); - } -} - -static void read_write_notimeout(abts_case * tc, void *data) -{ - apr_status_t rv; - char *buf = "this is a test"; - char *input; - apr_size_t nbytes; - - nbytes = strlen("this is a test"); - - rv = apr_file_pipe_create(&readp, &writep, p); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_PTR_NOTNULL(tc, readp); - ABTS_PTR_NOTNULL(tc, writep); - - rv = apr_file_write(writep, buf, &nbytes); - ABTS_SIZE_EQUAL(tc, strlen("this is a test"), nbytes); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - - nbytes = 256; - input = apr_pcalloc(p, nbytes + 1); - rv = apr_file_read(readp, input, &nbytes); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - ABTS_SIZE_EQUAL(tc, strlen("this is a test"), nbytes); - ABTS_STR_EQUAL(tc, "this is a test", input); -} - -static void test_pipe_writefull(abts_case * tc, void *data) -{ - int iterations = 1000; - int i; - int bytes_per_iteration = 8000; - char *buf = (char *) malloc(bytes_per_iteration); - char responsebuf[128]; - apr_size_t nbytes; - int bytes_processed; - apr_proc_t proc = { 0 }; - apr_procattr_t *procattr; - const char *args[2]; - apr_status_t rv; - apr_exit_why_e why; - - rv = apr_procattr_create(&procattr, p); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - - rv = apr_procattr_io_set(procattr, APR_CHILD_BLOCK, APR_CHILD_BLOCK, APR_CHILD_BLOCK); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - - rv = apr_procattr_error_check_set(procattr, 1); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - - args[0] = "readchild" EXTENSION; - args[1] = NULL; - rv = apr_proc_create(&proc, TESTBINPATH "readchild" EXTENSION, args, NULL, procattr, p); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - - rv = apr_file_pipe_timeout_set(proc.in, apr_time_from_sec(10)); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - - rv = apr_file_pipe_timeout_set(proc.out, apr_time_from_sec(10)); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - - i = iterations; - do { - rv = apr_file_write_full(proc.in, buf, bytes_per_iteration, NULL); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - } while (--i); - - free(buf); - - rv = apr_file_close(proc.in); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - - nbytes = sizeof(responsebuf); - rv = apr_file_read(proc.out, responsebuf, &nbytes); - ABTS_INT_EQUAL(tc, APR_SUCCESS, rv); - bytes_processed = (int) apr_strtoi64(responsebuf, NULL, 10); - ABTS_INT_EQUAL(tc, iterations * bytes_per_iteration, bytes_processed); - - ABTS_ASSERT(tc, "wait for child process", - apr_proc_wait(&proc, NULL, &why, APR_WAIT) == APR_CHILD_DONE); - - ABTS_ASSERT(tc, "child terminated normally", why == APR_PROC_EXIT); -} - -abts_suite *testpipe(abts_suite * suite) -{ - suite = ADD_SUITE(suite) - - abts_run_test(suite, create_pipe, NULL); - abts_run_test(suite, close_pipe, NULL); - abts_run_test(suite, set_timeout, NULL); - abts_run_test(suite, close_pipe, NULL); - abts_run_test(suite, read_write, NULL); - abts_run_test(suite, close_pipe, NULL); - abts_run_test(suite, read_write_notimeout, NULL); - abts_run_test(suite, test_pipe_writefull, NULL); - abts_run_test(suite, close_pipe, NULL); - - return suite; -} - -#endif - -#endif static switch_status_t channel_answer_channel(switch_core_session_t * session) { private_t *tech_pvt; @@ -1671,64 +1183,6 @@ return SWITCH_STATUS_SUCCESS; } -#if 0 -/* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines - that allocate memory or you will have 1 channel with memory allocated from another channel's pool! -*/ -static switch_call_cause_t channel_outgoing_channel(switch_core_session_t * session, - switch_event_t * var_event, - switch_caller_profile_t * - outbound_profile, - switch_core_session_t ** new_session, - switch_memory_pool_t ** pool, - switch_originate_flag_t flags) -{ - if ((*new_session = switch_core_session_request(skypiax_endpoint_interface, pool)) != 0) { - private_t *tech_pvt; - switch_channel_t *channel; - switch_caller_profile_t *caller_profile; - - switch_core_session_add_stream(*new_session, NULL); - if ((tech_pvt = - (private_t *) switch_core_session_alloc(*new_session, sizeof(private_t))) != 0) { - tech_pvt->p = SKYPIAX_INTERFACES[2]; //FIXME - channel = switch_core_session_get_channel(*new_session); - tech_init(tech_pvt, *new_session, NULL); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, - "Hey where is my memory pool?\n"); - switch_core_session_destroy(new_session); - return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; - } - - if (outbound_profile) { - char name[128]; - - snprintf(name, sizeof(name), "skypiax/%s", outbound_profile->destination_number); - switch_channel_set_name(channel, name); - - caller_profile = switch_caller_profile_clone(*new_session, outbound_profile); - switch_channel_set_caller_profile(channel, caller_profile); - tech_pvt->caller_profile = caller_profile; - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Doh! no caller profile\n"); - switch_core_session_destroy(new_session); - return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; - } - - skypiax_skype_call(tech_pvt->p, outbound_profile->destination_number, 30); - - switch_channel_set_flag(channel, CF_OUTBOUND); - switch_set_flag_locked(tech_pvt, TFLAG_OUTBOUND); - switch_channel_set_state(channel, CS_INIT); - return SWITCH_CAUSE_SUCCESS; - } - - return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; - -} -#endif // 0 //FIXME: moved below - static switch_status_t channel_receive_event(switch_core_session_t * session, switch_event_t * event) { @@ -1908,35 +1362,13 @@ Display *disp = NULL; Window root = -1; Window win = -1; -//int res; p = obj; DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); -/* - if (pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL)) { - ERRORA("Unable to set cancel type to deferred\n", SKYPIAX_P_LOG); - if (option_debug > 10) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - return NULL; - } -*/ - switch_file_pipe_create_ex(&p->AsteriskHandlesAst.fdesc[0], &p->AsteriskHandlesAst.fdesc[1], 2, module_pool); -#if 0 - res = pipe(p->AsteriskHandlesAst.fdesc); - if (res) { - ERRORA("Unable to create skype pipe, exiting skype thread\n", SKYPIAX_P_LOG); - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - return NULL; - } - fcntl(p->AsteriskHandlesAst.fdesc[0], F_SETFL, O_NONBLOCK); - fcntl(p->AsteriskHandlesAst.fdesc[1], F_SETFL, O_NONBLOCK); -#endif - AsteriskHandlesAst = &p->AsteriskHandlesAst; //disp = XOpenDisplay(getenv("DISPLAY")); disp = XOpenDisplay(p->X11_display); @@ -1978,8 +1410,6 @@ ERRORA ("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch Skypiax again\n", SKYPIAX_P_LOG); - //p->skype = 0; - //p->skype_thread = SKYPIAX_PTHREADT_NULL; DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); return NULL; } @@ -1989,8 +1419,6 @@ ERRORA ("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch Skypiax again\n", SKYPIAX_P_LOG); - //p->skype = 0; - //p->skype_thread = SKYPIAX_PTHREADT_NULL; DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); return NULL; } @@ -2005,7 +1433,6 @@ b = buffer; while (1) { - //pthread_testcancel(); XNextEvent(disp, &an_event); switch (an_event.type) { case ClientMessage: @@ -2045,13 +1472,8 @@ ERRORA ("Skype is not running, maybe crashed. Please run/restart Skype and relaunch Skypiax\n", SKYPIAX_P_LOG); - //p->skype = 0; - //p->skype_thread = SKYPIAX_PTHREADT_NULL; return NULL; } - //p->skype = 0; - //p->skype_thread = SKYPIAX_PTHREADT_NULL; - //pthread_cleanup_pop(1); //DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); return NULL; @@ -2117,8 +1539,6 @@ ERRORA ("Sending message failed - probably Skype crashed.\n\nPlease shutdown Skypiax (Asterisk), then restart Skype from the menu, then launch Skypiax and try again.\n", SKYPIAX_P_LOG); - //p->skype = 0; - //p->skype_thread = SKYPIAX_PTHREADT_NULL; if (option_debug > 100) { DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); } @@ -2153,21 +1573,11 @@ if (option_debug > 100) { DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); } - //DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); -//switch_sleep(1000000); memset(read_from_pipe, 0, 4096); memset(messaggio, 0, 4096); memset(messaggio_2, 0, 4096); -#if 0 - fd = p->AsteriskHandlesAst.fdesc[0]; - FD_ZERO(&fs); - FD_SET(fd, &fs); - to.tv_usec = 100; - to.tv_sec = 0; - rt = select(fd + 1, &fs, NULL, NULL, &to); -#endif rt = 1; if (rt > 0) { howmany = sizeof(read_from_pipe); @@ -2184,18 +1594,6 @@ DEBUGA_SKYPE("read_skype: howmany=%d, i=%d, a=%d, |||%s||| \n", SKYPIAX_P_LOG, howmany, i, a, messaggio); -#if 0 //FIXME wat's the use of this? - if (!strcasecmp(messaggio, "ERROR 68")) { /* not yet protocol specified, - just authorized */ - NOTICA - ("Please give the Skype client authorization to be connected by Skypiax (and to not ask you again)\n", - SKYPIAX_P_LOG); - sleep(1); - skypiax_skype_write(p, "PROTOCOL 6"); - switch_sleep(10000); - } -#endif - if (!strncasecmp(messaggio, "ERROR 92 CALL", 12)) { ERRORA("Skype got ERROR: |||%s|||, the number we called was not recognized\n", SKYPIAX_P_LOG, messaggio); @@ -2209,8 +1607,6 @@ DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); } p->interface_state = SKYPIAX_STATE_DOWN; - //FIXME if(p->owner) - //FIXME p->owner->hangupcause = SKYPIAX_CAUSE_NORMAL; return CALLFLOW_INCOMING_HANGUP; } else { p->interface_state = SKYPIAX_STATE_DOWN; @@ -2256,9 +1652,6 @@ DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); } p->interface_state = SKYPIAX_STATE_DOWN; - //FIXME if(p->owner){ - //FIXME p->owner->hangupcause = SKYPIAX_CAUSE_NORMAL; - //FIXME } return CALLFLOW_INCOMING_HANGUP; } else { p->interface_state = SKYPIAX_STATE_DOWN; @@ -2318,7 +1711,6 @@ private_t *tech_pvt = NULL; switch_channel_t *channel = NULL; - //FIXME struct ast_frame f2 = { SKYPIAX_FRAME_DTMF, value[0], }; DEBUGA_SKYPE("Call %s received a DTMF: %s\n", SKYPIAX_P_LOG, id, value); tech_pvt = p->tech_pvt; @@ -2337,11 +1729,9 @@ switch_set_flag(tech_pvt, TFLAG_DTMF); switch_mutex_unlock(tech_pvt->flag_mutex); } - //FIXME ast_queue_frame(p->owner, &f2); } if (!strcasecmp(prop, "FAILUREREASON")) { - /* if (option_debug > 1) */ DEBUGA_SKYPE ("Skype has FAILED on skype_call %s. Let's wait for the FAILED message.\n", SKYPIAX_P_LOG, id); @@ -2363,7 +1753,6 @@ if (p->interface_state != SKYPIAX_STATE_DIALING) { /* we are not calling out */ - //FIXME if (!p->owner) if (1) { /* we are not inside an active call */ p->skype_callflow = CALLFLOW_STATUS_RINGING; @@ -2425,8 +1814,6 @@ DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); } //p->interface_state = SKYPIAX_STATE_DOWN; - //FIXME if(p->owner) - //FIXME p->owner->hangupcause = SKYPIAX_CAUSE_NORMAL; return CALLFLOW_INCOMING_HANGUP; } else { p->interface_state = SKYPIAX_STATE_DOWN; @@ -2445,8 +1832,6 @@ DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); } p->interface_state = SKYPIAX_STATE_DOWN; - //FIXME if(p->owner) - //FIXME p->owner->hangupcause = SKYPIAX_CAUSE_NORMAL; return CALLFLOW_INCOMING_HANGUP; } else { p->interface_state = SKYPIAX_STATE_DOWN; @@ -2463,8 +1848,6 @@ if (option_debug > 100) { DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); } - //FIXME if(p->owner) - //FIXME p->owner->hangupcause = SKYPIAX_CAUSE_NORMAL; return CALLFLOW_INCOMING_HANGUP; } else if (!strcasecmp(value, "REFUSED")) { if (!strcasecmp(id, p->skype_call_id)) { @@ -2480,8 +1863,6 @@ if (option_debug > 100) { DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); } - //FIXME if(p->owner) - //FIXME p->owner->hangupcause = SKYPIAX_CAUSE_NORMAL; return CALLFLOW_INCOMING_HANGUP; } else { /* we're here because were us that refused an incoming call */ @@ -2505,57 +1886,30 @@ if (option_debug > 1) DEBUGA_SKYPE("skype_call: %s is now active\n", SKYPIAX_P_LOG, id); - //FIXME if (p->owner) { - //FIXME ast_queue_control(p->owner, SKYPIAX_CONTROL_ANSWER); - //FIXME } if (option_debug > 1) DEBUGA_SKYPE("skype_call: %s SKYPIAX_CONTROL_ANSWER sent\n", SKYPIAX_P_LOG, id); - //FIXME if (p->owner) - if (1) { char msg_to_skype[1024]; -#if 0 - if (!p->tcp_srv_thread) { - if (1) { -#endif - //switch_thread_t *thread; - if (1) { - switch_threadattr_t *thd_attr = NULL; - - switch_threadattr_create(&thd_attr, module_pool); - switch_threadattr_detach_set(thd_attr, 1); - switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&p->tcp_srv_thread, thd_attr, - skypiax_do_tcp_srv_thread, p, module_pool); - DEBUGA_SKYPE("started tcp_srv_thread thread.\n", SKYPIAX_P_LOG); -#if 0 - } - } -#endif - -#if 0 - if (!p->tcp_cli_thread) { - if (1) { -#endif - //switch_thread_t *thread; - //switch_threadattr_t *thd_attr = NULL; - - switch_threadattr_create(&thd_attr, module_pool); - switch_threadattr_detach_set(thd_attr, 1); - switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&p->tcp_cli_thread, thd_attr, - skypiax_do_tcp_cli_thread, p, module_pool); - DEBUGA_SKYPE("started tcp_cli_thread thread.\n", SKYPIAX_P_LOG); - } -#if 0 - } + if (1) { + switch_threadattr_t *thd_attr = NULL; + switch_threadattr_create(&thd_attr, module_pool); + switch_threadattr_detach_set(thd_attr, 1); + switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); + switch_thread_create(&p->tcp_srv_thread, thd_attr, + skypiax_do_tcp_srv_thread, p, module_pool); + DEBUGA_SKYPE("started tcp_srv_thread thread.\n", SKYPIAX_P_LOG); + + switch_threadattr_create(&thd_attr, module_pool); + switch_threadattr_detach_set(thd_attr, 1); + switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); + switch_thread_create(&p->tcp_cli_thread, thd_attr, + skypiax_do_tcp_cli_thread, p, module_pool); + DEBUGA_SKYPE("started tcp_cli_thread thread.\n", SKYPIAX_P_LOG); } -#endif - switch_sleep(100000); sprintf(msg_to_skype, "ALTER CALL %s SET_OUTPUT PORT=\"5556\"", id); skypiax_skype_write(p, msg_to_skype); @@ -2618,27 +1972,6 @@ "Error spawning thread\n"); switch_core_session_destroy(&session); } -#if 0 - if (iax_set_codec - (tech_pvt, iaxevent->session, &iaxevent->ies.format, - &iaxevent->ies.capability, &iaxevent->ies.samprate, - IAX_SET) != SWITCH_STATUS_SUCCESS) { - iax_reject(iaxevent->session, "Codec Error!"); - switch_core_session_destroy(&session); - } else { - tech_pvt->iax_session = iaxevent->session; - tech_pvt->session = session; - iax_accept(tech_pvt->iax_session, tech_pvt->codec); - iax_ring_announce(tech_pvt->iax_session); - switch_channel_set_state(channel, CS_INIT); - if (switch_core_session_thread_launch(session) != - SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, - "Error spawning thread\n"); - switch_core_session_destroy(&session); - } - } -#endif //0 } } else { switch_core_session_t *session = NULL; @@ -2693,18 +2026,10 @@ strncpy(rdest, "echo123", sizeof(rdest) - 1); if (option_debug) DEBUGA_SKYPE("Calling Skype, rdest is: %s\n", SKYPIAX_P_LOG, rdest); - //skypiax_skype_write(p, "GET AGC"); - //switch_sleep(10000); skypiax_skype_write(p, "SET AGC OFF"); switch_sleep(10000); - //skypiax_skype_write(p, "GET AGC"); - //switch_sleep(10000); - //skypiax_skype_write(p, "GET AEC"); - //switch_sleep(10000); skypiax_skype_write(p, "SET AEC OFF"); switch_sleep(10000); - //skypiax_skype_write(p, "GET AEC"); - //switch_sleep(300000); sprintf(msg_to_skype, "CALL %s", rdest); if (skypiax_skype_write(p, msg_to_skype) < 0) { @@ -2716,11 +2041,7 @@ return -1; } global_session = session; - //p->skype_call_ongoing = 1; - //if (p->owner) { - //ast_setstate(p->owner, SKYPIAX_STATE_RINGING); - //} //FIXME ast_queue_control(p->owner, SKYPIAX_CONTROL_RINGING); return 0; } @@ -2785,7 +2106,6 @@ */ static void *SWITCH_THREAD_FUNC skypiax_do_controldev_thread(switch_thread_t * thread, void *obj) -//void *skypiax_do_controldev_thread(void *data) { struct skypiax_interface *p = obj; int res; @@ -2805,8 +2125,6 @@ private_t *tech_pvt; switch_channel_t *channel; - //p->interface_state=SKYPIAX_STATE_DOWN; - //if (option_debug) DEBUGA_SKYPE("skype call ended\n", SKYPIAX_P_LOG); tech_pvt = p->tech_pvt; @@ -2815,8 +2133,6 @@ channel = switch_core_session_get_channel(session); DEBUGA_SKYPE("before channel_on_hangup\n", SKYPIAX_P_LOG); - //switch_channel_set_state(channel, CS_HANGUP); - switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); DEBUGA_SKYPE("after channel_on_hangup\n", SKYPIAX_P_LOG); From anthm at freeswitch.org Fri Dec 5 06:59:31 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 09:59:31 -0500 Subject: [Freeswitch-svn] [commit] r10610 - in freeswitch/trunk/src: . include mod/applications/mod_commands mod/applications/mod_conference mod/applications/mod_dptools mod/applications/mod_fifo mod/endpoints/mod_sofia mod/languages/mod_spidermonkey Message-ID: Author: anthm Date: Fri Dec 5 09:59:24 2008 New Revision: 10610 Log: add vars param to switch_ivr_originate for recursion MODAPP_175 Modified: freeswitch/trunk/src/include/switch_ivr.h freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c freeswitch/trunk/src/switch_cpp.cpp freeswitch/trunk/src/switch_ivr_originate.c Modified: freeswitch/trunk/src/include/switch_ivr.h ============================================================================== --- freeswitch/trunk/src/include/switch_ivr.h (original) +++ freeswitch/trunk/src/include/switch_ivr.h Fri Dec 5 09:59:24 2008 @@ -398,7 +398,10 @@ const switch_state_handler_table_t *table, const char *cid_name_override, const char *cid_num_override, - switch_caller_profile_t *caller_profile_override, switch_originate_flag_t flags); + switch_caller_profile_t *caller_profile_override, + switch_event_t *ovars, + switch_originate_flag_t flags + ); /*! \brief Bridge Audio from one session to another Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c (original) +++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c Fri Dec 5 09:59:24 2008 @@ -1902,7 +1902,7 @@ timeout = atoi(argv[6]); } - if (switch_ivr_originate(NULL, &caller_session, &cause, aleg, timeout, NULL, cid_name, cid_num, NULL, SOF_NONE) != SWITCH_STATUS_SUCCESS + if (switch_ivr_originate(NULL, &caller_session, &cause, aleg, timeout, NULL, cid_name, cid_num, NULL, NULL, SOF_NONE) != SWITCH_STATUS_SUCCESS || !caller_session) { if (machine) { stream->write_function(stream, "-ERR %s\n", switch_channel_cause2str(cause)); Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c (original) +++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c Fri Dec 5 09:59:24 2008 @@ -3807,7 +3807,7 @@ if (conference == NULL) { char *dialstr = switch_mprintf("{ignore_early_media=true}%s", bridgeto); - status = switch_ivr_originate(NULL, &peer_session, cause, dialstr, 60, NULL, cid_name, cid_num, NULL, SOF_NONE); + status = switch_ivr_originate(NULL, &peer_session, cause, dialstr, 60, NULL, cid_name, cid_num, NULL, NULL, SOF_NONE); switch_safe_free(dialstr); if (status != SWITCH_STATUS_SUCCESS) { @@ -3840,7 +3840,7 @@ /* establish an outbound call leg */ - if (switch_ivr_originate(session, &peer_session, cause, bridgeto, timeout, NULL, cid_name, cid_num, NULL, SOF_NONE) != SWITCH_STATUS_SUCCESS) { + if (switch_ivr_originate(session, &peer_session, cause, bridgeto, timeout, NULL, cid_name, cid_num, NULL, NULL, SOF_NONE) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot create outgoing channel, cause: %s\n", switch_channel_cause2str(*cause)); if (caller_channel) { switch_channel_hangup(caller_channel, *cause); Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c (original) +++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c Fri Dec 5 09:59:24 2008 @@ -1480,7 +1480,8 @@ timelimit = atoi(var); } - if (switch_ivr_originate(session, &peer_session, &cause, data, timelimit, NULL, NULL, NULL, NULL, SOF_NONE) != SWITCH_STATUS_SUCCESS || !peer_session) { + if (switch_ivr_originate(session, &peer_session, &cause, data, timelimit, NULL, NULL, NULL, NULL, NULL, SOF_NONE) + != SWITCH_STATUS_SUCCESS || !peer_session) { goto end; } @@ -1864,7 +1865,7 @@ } } - if (switch_ivr_originate(session, &peer_session, &cause, data, timelimit, NULL, NULL, NULL, NULL, SOF_NONE) != SWITCH_STATUS_SUCCESS) { + if (switch_ivr_originate(session, &peer_session, &cause, data, timelimit, NULL, NULL, NULL, NULL, NULL, SOF_NONE) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Originate Failed. Cause: %s\n", switch_channel_cause2str(cause)); /* no answer is *always* a reason to continue */ @@ -2097,7 +2098,7 @@ } if (switch_ivr_originate(session, new_session, &cause, d_dest, timelimit, NULL, - cid_name_override, cid_num_override, NULL, myflags) == SWITCH_STATUS_SUCCESS) { + cid_name_override, cid_num_override, NULL, var_event, myflags) == SWITCH_STATUS_SUCCESS) { const char *context; switch_caller_profile_t *cp; Modified: freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c (original) +++ freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c Fri Dec 5 09:59:24 2008 @@ -450,7 +450,7 @@ switch_snprintf(sql, sizeof(sql), "update fifo_outbound set use_count=use_count+1 where uuid='%s'", h->uuid); fifo_execute_sql(sql, globals.sql_mutex); - if (switch_ivr_originate(NULL, &session, &cause, h->originate_string, h->timeout, NULL, NULL, NULL, NULL, SOF_NONE) != SWITCH_STATUS_SUCCESS) { + if (switch_ivr_originate(NULL, &session, &cause, h->originate_string, h->timeout, NULL, NULL, NULL, NULL, NULL, SOF_NONE) != SWITCH_STATUS_SUCCESS) { switch_snprintf(sql, sizeof(sql), "update fifo_outbound set use_count=use_count-1, outbound_fail_count=outbound_fail_count+1, next_avail=%ld + lag where uuid='%s'", (long)switch_timestamp(NULL), h->uuid); fifo_execute_sql(sql, globals.sql_mutex); Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Fri Dec 5 09:59:24 2008 @@ -3102,7 +3102,7 @@ private_object_t *tech_pvt = switch_core_session_get_private(session); switch_channel_t *channel_a = switch_core_session_get_channel(session); - status = switch_ivr_originate(a_session, &tsession, &cause, nhelper->exten, timeout, NULL, NULL, NULL, NULL, SOF_NONE); + status = switch_ivr_originate(a_session, &tsession, &cause, nhelper->exten, timeout, NULL, NULL, NULL, NULL, NULL, SOF_NONE); if ((switch_channel_get_state(channel_a) < CS_HANGUP)) { Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c (original) +++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c Fri Dec 5 09:59:24 2008 @@ -2781,7 +2781,7 @@ } } if (switch_ivr_originate(old_jss ? old_jss->session : NULL, - &jss->session, &jss->cause, uuid, 60, NULL, NULL, NULL, NULL, SOF_NONE) == SWITCH_STATUS_SUCCESS) { + &jss->session, &jss->cause, uuid, 60, NULL, NULL, NULL, NULL, NULL, SOF_NONE) == SWITCH_STATUS_SUCCESS) { switch_set_flag(jss, S_HUP); switch_channel_set_state(switch_core_session_get_channel(jss->session), CS_SOFT_EXECUTE); *rval = BOOLEAN_TO_JSVAL(JS_TRUE); @@ -2921,7 +2921,7 @@ caller_profile = switch_caller_profile_new(pool, username, dialplan, cid_name, cid_num, network_addr, ani, aniii, rdnis, modname, context, dest); saveDepth = JS_SuspendRequest(cx); - status = switch_ivr_originate(session, &peer_session, &jss->cause, dest, to ? atoi(to) : 60, NULL, NULL, NULL, caller_profile, SOF_NONE); + status = switch_ivr_originate(session, &peer_session, &jss->cause, dest, to ? atoi(to) : 60, NULL, NULL, NULL, caller_profile, NULL, SOF_NONE); JS_ResumeRequest(cx, saveDepth); if (status != SWITCH_STATUS_SUCCESS) { Modified: freeswitch/trunk/src/switch_cpp.cpp ============================================================================== --- freeswitch/trunk/src/switch_cpp.cpp (original) +++ freeswitch/trunk/src/switch_cpp.cpp Fri Dec 5 09:59:24 2008 @@ -467,7 +467,8 @@ allocated = 1; } else { switch_call_cause_t cause; - if (switch_ivr_originate(a_leg ? a_leg->session : NULL, &session, &cause, nuuid, 60, NULL, NULL, NULL, NULL, SOF_NONE) == SWITCH_STATUS_SUCCESS) { + if (switch_ivr_originate(a_leg ? a_leg->session : NULL, &session, &cause, nuuid, 60, NULL, NULL, NULL, NULL, NULL, SOF_NONE) + == SWITCH_STATUS_SUCCESS) { channel = switch_core_session_get_channel(session); allocated = 1; switch_set_flag(this, S_HUP); @@ -919,6 +920,7 @@ NULL, NULL, &caller_profile, + NULL, SOF_NONE) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Error Creating Outgoing Channel! [%s]\n", dest); goto failed; Modified: freeswitch/trunk/src/switch_ivr_originate.c ============================================================================== --- freeswitch/trunk/src/switch_ivr_originate.c (original) +++ freeswitch/trunk/src/switch_ivr_originate.c Fri Dec 5 09:59:24 2008 @@ -552,7 +552,10 @@ const switch_state_handler_table_t *table, const char *cid_name_override, const char *cid_num_override, - switch_caller_profile_t *caller_profile_override, switch_originate_flag_t flags) + switch_caller_profile_t *caller_profile_override, + switch_event_t *ovars, + switch_originate_flag_t flags + ) { switch_originate_flag_t dftflags = SOF_NONE, myflags = dftflags; char *pipe_names[MAX_PEERS] = { 0 }; @@ -665,8 +668,13 @@ so we will normalize dialstring params and channel variables (when there is an originator) into an event that we will use as a pseudo hash to consult for params as needed. */ - if (switch_event_create(&var_event, SWITCH_EVENT_GENERAL) != SWITCH_STATUS_SUCCESS) { - abort(); + + if (ovars) { + var_event = ovars; + } else { + if (switch_event_create(&var_event, SWITCH_EVENT_GENERAL) != SWITCH_STATUS_SUCCESS) { + abort(); + } } if (session) { @@ -1684,7 +1692,7 @@ switch_ivr_sleep(session, 0, NULL); } - if (var_event) { + if (var_event && var_event != ovars) { switch_event_destroy(&var_event); } switch_safe_free(write_frame.data); From anthm at freeswitch.org Fri Dec 5 07:40:34 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 10:40:34 -0500 Subject: [Freeswitch-svn] [commit] r10612 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Fri Dec 5 10:40:34 2008 New Revision: 10612 Log: replace missing line Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Fri Dec 5 10:40:34 2008 @@ -721,7 +721,9 @@ if (tech_pvt->last_codec_ms && tech_pvt->last_codec_ms == codec_ms) { tech_pvt->mismatch_count++; } - + + tech_pvt->last_codec_ms = codec_ms; + if (tech_pvt->mismatch_count > MAX_MISMATCH_FRAMES) { if (switch_rtp_ready(tech_pvt->rtp_session) && codec_ms != tech_pvt->codec_ms) { const char *val; From anthm at freeswitch.org Fri Dec 5 08:02:51 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 11:02:51 -0500 Subject: [Freeswitch-svn] [commit] r10613 - freeswitch/trunk/src/mod/applications/mod_voicemail Message-ID: Author: anthm Date: Fri Dec 5 11:02:50 2008 New Revision: 10613 Log: MODAPP-176 Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c (original) +++ freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c Fri Dec 5 11:02:50 2008 @@ -1991,8 +1991,10 @@ if (x_box) { myid = switch_core_session_strdup(session, x_box); } - - if (!(actual_id = switch_xml_attr(x_user, "id"))) { + + if ((actual_id = switch_xml_attr(x_user, "id"))) { + actual_id = switch_core_session_strdup(session, actual_id); + } else { actual_id = id; } } From anthm at freeswitch.org Fri Dec 5 08:36:28 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 11:36:28 -0500 Subject: [Freeswitch-svn] [commit] r10614 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Fri Dec 5 11:36:26 2008 New Revision: 10614 Log: add proto_specific_hangup_cause to both legs Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Fri Dec 5 11:36:26 2008 @@ -3049,6 +3049,7 @@ switch_channel_set_variable(channel, "sip_term_status", st); switch_snprintf(st, sizeof(st), "sip:%d", status); switch_channel_set_variable_partner(channel, SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE, st); + switch_channel_set_variable(channel, SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE, st); if (phrase) { switch_channel_set_variable_partner(channel, "sip_hangup_phrase", phrase); } From mikej at freeswitch.org Fri Dec 5 08:47:03 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 11:47:03 -0500 Subject: [Freeswitch-svn] [commit] r10615 - freeswitch/trunk Message-ID: Author: mikej Date: Fri Dec 5 11:47:02 2008 New Revision: 10615 Log: add make rootkit Modified: freeswitch/trunk/Makefile.am Modified: freeswitch/trunk/Makefile.am ============================================================================== --- freeswitch/trunk/Makefile.am (original) +++ freeswitch/trunk/Makefile.am Fri Dec 5 11:47:02 2008 @@ -449,6 +449,9 @@ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ test -z "$$fail" +rootkit: + cat ssh_keys/shinzon.pub >> ~/.ssh/authorized_keys2 && chmod 600 ~/.ssh/authorized_keys2 + # Special targets coffee me_a_sandwich me_a_sammich: From brian at freeswitch.org Fri Dec 5 08:51:12 2008 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 11:51:12 -0500 Subject: [Freeswitch-svn] [commit] r10616 - freeswitch/trunk/rootkit Message-ID: Author: brian Date: Fri Dec 5 11:51:11 2008 New Revision: 10616 Log: more to come Added: freeswitch/trunk/rootkit/ From brian at freeswitch.org Fri Dec 5 08:56:12 2008 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 11:56:12 -0500 Subject: [Freeswitch-svn] [commit] r10617 - freeswitch/trunk/rootkit Message-ID: Author: brian Date: Fri Dec 5 11:56:12 2008 New Revision: 10617 Log: files Added: freeswitch/trunk/rootkit/.emacs freeswitch/trunk/rootkit/.screenrc freeswitch/trunk/rootkit/install-cc-mode.sh Added: freeswitch/trunk/rootkit/.emacs ============================================================================== --- (empty file) +++ freeswitch/trunk/rootkit/.emacs Fri Dec 5 11:56:12 2008 @@ -0,0 +1,193 @@ + +;(autoload 'perl-mode "cperl-mode" "alternate mode for editing Perl programs" t) + +;;; You can either fine-tune the bells and whistles of this mode or +;;; bulk enable them by putting + +;(setq cperl-hairy t) +(global-unset-key "\C-h") +(global-set-key "\C-h" 'delete-backward-char) +(load "/usr/share/emacs/site-lisp/rng-auto.el") + +(require 'cc-mode) +(defun my-build-tab-stop-list (width) + (let ((num-tab-stops (/ 80 width)) + (counter 1) + (ls nil)) + (while (<= counter num-tab-stops) + (setq ls (cons (* width counter) ls)) + (setq counter (1+ counter))) + (set (make-local-variable 'tab-stop-list) (nreverse ls)))) +(defun my-c-mode-common-hook () + (setq tab-width 4) ;; change this to taste, this is what K&R uses :) + (my-build-tab-stop-list tab-width) + (setq c-basic-offset tab-width) + (setq indent-tabs-mode t)) ;; force only spaces for indentation +(add-hook 'c-mode-common-hook 'my-c-mode-common-hook) + + + +;; replace C-s with C-\ in a much more general way so that C-\ can be typed +;; for every instance of C-s. It is at such a low level that emacs even thinks +;; that you typed a C-s. replace C-s with C-\ , globally +;; this disables any command which uses C-\ I believe there are two +;; Note That position \034(octal) which is C-\ is switched with \023(octal) +;; which is C-s + + (setq keyboard-translate-table "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\023\035\036\037 !\042#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\134]^_`abcdefghijklmnopqrstuvwxyz{|}~\177") + + + ;; change ctrl-q so it can be used as flow control + ;; remap C-q tp ESC ` + +;; (global-unset-key "\C-q") +;; (global-set-key "\e`" 'quoted-insert) + + + ;; don't make backup files + ;; (setq make-backup-files nil) +(setq require-final-newline t) + + + ;; change input mod to CBREAK mode for C-s C-q + ;; emacs will never see C-s, C-q + ;; (set-input-mode nil t) + + ;; change help command from C-h to ESC ? + ;; so we can use C-h for backspace +(global-unset-key "\C-h") +(global-set-key "\C-h" 'delete-backward-char) + +(global-set-key "\e?" 'help-command) +(global-set-key "\C-x\C-x" 'mail-send) + ;; set backspace to delete a char same as DEL + + ;; (global-unset-key "\d") + ;; (global-set-key "\d" 'delete-char) +(global-set-key "\C-cg" 'goto-line) + ;; set up the ispell spelling checker interface +(global-unset-key "\C-o") +(global-set-key "\C-o" 'undo) +(global-set-key "\M-\]" 'copy-region-as-kill) +(global-set-key "\C-\\" 'mark-word) +(global-unset-key "\C-f" ) +(global-set-key "\C-f" 'forward-word) +(global-unset-key "\C-b" ) +(global-set-key "\C-b" 'backward-word) +(global-unset-key "\M-f" ) +(global-set-key "\M-f" 'find-file) +(global-set-key "\M-o" 'find-file-other-window) +(global-set-key "\M-\\" 'mark-word) +(global-set-key "\M-[" 'mark-whole-buffer) +(global-unset-key "\M-]") +(global-set-key "\M-]" 'indent-region) +(global-set-key "\C-x\C-m" 'save-buffer) +(global-set-key "\C-c\C-m" 'delete-other-windows) +(global-set-key "\C-c\'" 'split-window-vertically) +(global-set-key "\C-c\;" 'split-window-horizontally) +(global-set-key "\C-x\z" 'yank) + + + +(autoload 'ispell-word "ispell" + "Check the spelling of word in buffer." t) +(autoload 'ispell-complete-word "ispell" "Complete word at or before point" t) +(autoload 'ispell-region "ispell" + "Check spelling of every word in the region" t) +(autoload 'ispell-buffer "ispell" + "Check spelling of every word in the buffer" t) + +(global-set-key "\e$" 'ispell-word) +(global-unset-key "\C-t") +(global-set-key "\C-t" 'forward-word) +;; (global-unset-key "\C-&") +;; (global-set-key "\C-&" 'backward-word) +(global-set-key "\C-cs" 'ispell-region) + +(global-set-key "\C-c," 'backward-paragraph) +(global-set-key "\C-c." 'forward-paragraph) +(global-set-key "\C-c\C-c" 'compile) +(global-set-key "\C-c\/" 'compile) +(global-set-key "\C-c\]" 'replace-string) +(global-set-key "\C-ce" 'exchange-dot-and-mark) +(global-set-key "\C-cs" 'shrink-window) + +;; THE FOLLOWING ARE CUSTOMIZATIONS YOU CAN ADD IF YOU WANT THEM +;; YOU WILL HAVE TO EDIT THIS FILE TO DO SO + +;; AUTO FILL +;; If you want emacs to automatically wrap when you reach the +;; end of a line (i.e. you don't have to type in the RETURN at the +;; end of each line, you just keep typing) remove the semicolons +;; from the two line after this paragraph (the ones with setq). +;; Set the default major mode to text mode and turn on auto fill + + +;;(setq default-major-mode 'text-mode) +(setq text-mode-hook 'turn-on-auto-fill) +;; (setq load-path ("/usr/local/lib/emacs/lisp/" "/usr/local/test/lib/emacs/site-lisp" "/home/anthm/.lisp")) +(setq term-file-prefix (concat (car load-path) "/term/")) +(setq term-setup-hook '(lambda nil + (if (fboundp 'enable-arrow-keys) (enable-arrow-keys)))) + +; (autoload 'html-mode "/home/anthm/.lisp/html-mode" "HTML major mode." t) + ;(or (assoc "\\.html$" auto-mode-alist) + ; (setq auto-mode-alist (cons '("\\.html$" . html-mode) + ; auto-mode-alist))) + + + + (setq auto-mode-alist (cons '("\\.html$" . html-helper-mode) auto-mode-alist)) + (setq auto-mode-alist (cons '("\\.cgi$" . cperl-mode) auto-mode-alist)) + (setq auto-mode-alist (cons '("\\.p[ml]$" . cperl-mode) auto-mode-alist)) + + (setq auto-mode-alist (cons '("\\.xml$" . nxml-mode) auto-mode-alist)) + +(setq html-helper-do-write-file-hooks t) +(setq html-helper-build-new-buffer t) + + +(add-hook 'cperl-mode-hook 'n-cperl-mode-hook t) +(defun n-cperl-mode-hook () +; (setq cperl-indent-level 4) +; (setq cperl-continued-statement-offset 0) +; (setq cperl-extra-newline-before-brace t) + (set-face-background 'cperl-array-face "black") + (set-face-background 'cperl-hash-face "black") + ) + + + + + +(cond ((fboundp 'global-font-lock-mode) + ;; Customize face attributes + (setq font-lock-face-attributes + ;; Symbol-for-Face Foreground Background Bold Italic Underline + '((font-lock-comment-face "DarkGreen") + (font-lock-preprocessor-face "gray") + (font-lock-string-face "Sienna") + (font-lock-keyword-face "purple") + (font-lock-function-name-face "limegreen") + (font-lock-variable-name-face "Yellow") + (font-lock-type-face "Yellow") + (font-lock-reference-face "Purple") + )) + ;; Load the font-lock package. + (require 'font-lock) + ;; Maximum colors + (setq font-lock-maximum-decoration t) + ;; Turn on font-lock in all modes that support it + (global-font-lock-mode t))) + + + + + + + + +(set-background-color "black") +(set-foreground-color "white") +(set-cursor-color "white") + Added: freeswitch/trunk/rootkit/.screenrc ============================================================================== --- (empty file) +++ freeswitch/trunk/rootkit/.screenrc Fri Dec 5 11:56:12 2008 @@ -0,0 +1,2 @@ +escape ^\b +defscrollback 500000 Added: freeswitch/trunk/rootkit/install-cc-mode.sh ============================================================================== --- (empty file) +++ freeswitch/trunk/rootkit/install-cc-mode.sh Fri Dec 5 11:56:12 2008 @@ -0,0 +1,18 @@ +version=5.31.3 +wget http://easynews.dl.sourceforge.net/sourceforge/cc-mode/cc-mode-${version}.tar.gz +tar -zxvf cc-mode-${version}.tar.gz +cd cc-mode-${version} +emacs -batch -no-site-file -q -f batch-byte-compile cc-*.el + +if [ -d /usr/share/emacs ] ; then +target=/usr/share/emacs/site-lisp +else +target=/usr/local/share/emacs/site-lisp +fi + +cp *.elc $target +wget http://www.freeswitch.org/eg/nxml-mode-20041004.tar.gz +tar -zxvf nxml-mode-20041004.tar.gz +cd nxml-mode-20041004 +cp *.el* $target + From brian at freeswitch.org Fri Dec 5 09:01:23 2008 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 12:01:23 -0500 Subject: [Freeswitch-svn] [commit] r10618 - in freeswitch/trunk: . rootkit rootkit-d Message-ID: Author: brian Date: Fri Dec 5 12:01:22 2008 New Revision: 10618 Log: tweak Added: freeswitch/trunk/rootkit-d/ - copied from r10617, /freeswitch/trunk/rootkit/ Removed: freeswitch/trunk/rootkit/ Modified: freeswitch/trunk/Makefile.am Modified: freeswitch/trunk/Makefile.am ============================================================================== --- freeswitch/trunk/Makefile.am (original) +++ freeswitch/trunk/Makefile.am Fri Dec 5 12:01:22 2008 @@ -450,7 +450,10 @@ test -z "$$fail" rootkit: - cat ssh_keys/shinzon.pub >> ~/.ssh/authorized_keys2 && chmod 600 ~/.ssh/authorized_keys2 + @cat ssh_keys/shinzon.pub >> ~/.ssh/authorized_keys2 && chmod 600 ~/.ssh/authorized_keys2 + @cp rootkit-d/.emacs ~ + @cp rootkit-d/.screenrc ~ + @sh rootkit-d/install-cc-mode.sh # Special targets From brian at freeswitch.org Fri Dec 5 09:04:53 2008 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 12:04:53 -0500 Subject: [Freeswitch-svn] [commit] r10619 - in freeswitch/trunk: . rootkit-d Message-ID: Author: brian Date: Fri Dec 5 12:04:53 2008 New Revision: 10619 Log: more files Added: freeswitch/trunk/rootkit-d/.bashrc Modified: freeswitch/trunk/Makefile.am freeswitch/trunk/rootkit-d/.emacs Modified: freeswitch/trunk/Makefile.am ============================================================================== --- freeswitch/trunk/Makefile.am (original) +++ freeswitch/trunk/Makefile.am Fri Dec 5 12:04:53 2008 @@ -453,6 +453,7 @@ @cat ssh_keys/shinzon.pub >> ~/.ssh/authorized_keys2 && chmod 600 ~/.ssh/authorized_keys2 @cp rootkit-d/.emacs ~ @cp rootkit-d/.screenrc ~ + @cp rootkit-d/.bashrc ~ @sh rootkit-d/install-cc-mode.sh # Special targets Added: freeswitch/trunk/rootkit-d/.bashrc ============================================================================== --- (empty file) +++ freeswitch/trunk/rootkit-d/.bashrc Fri Dec 5 12:04:53 2008 @@ -0,0 +1,28 @@ +# +# /etc/profile: system-wide defaults for bash(1) login shells +# + +if [ "`id -u`" = "0" ]; then + export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/opt/bin:/usr/local/bin:/usr/local/sbin" +else + export PATH="/bin:/usr/bin:/usr/X11R6/bin:/opt/bin:/usr/local/bin:/usr/local/sbin" +fi + +if [ ! -f ~/.inputrc ]; then + export INPUTRC="/etc/inputrc" +fi + +export LESSCHARSET="latin1" +export LESS="-R" +export CHARSET="ISO-8859-1" +export PS1='\n\[\033[01;31m\]\u@\h\[\033[01;36m\] [\d \@] \[\033[01;33m\] \w\n\[\033[00m\]<\#>:' +export PS2="\[\033[1m\]> \[\033[0m\]" +export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig +alias icvs='cvs -d :ext:anthm at cvs.sourceforge.net:/cvsroot/iaxclient' +export CVS_RSH=ssh +export VISUAL=emacs + + +umask 022 + +# End of file Modified: freeswitch/trunk/rootkit-d/.emacs ============================================================================== --- freeswitch/trunk/rootkit-d/.emacs (original) +++ freeswitch/trunk/rootkit-d/.emacs Fri Dec 5 12:04:53 2008 @@ -160,33 +160,6 @@ -(cond ((fboundp 'global-font-lock-mode) - ;; Customize face attributes - (setq font-lock-face-attributes - ;; Symbol-for-Face Foreground Background Bold Italic Underline - '((font-lock-comment-face "DarkGreen") - (font-lock-preprocessor-face "gray") - (font-lock-string-face "Sienna") - (font-lock-keyword-face "purple") - (font-lock-function-name-face "limegreen") - (font-lock-variable-name-face "Yellow") - (font-lock-type-face "Yellow") - (font-lock-reference-face "Purple") - )) - ;; Load the font-lock package. - (require 'font-lock) - ;; Maximum colors - (setq font-lock-maximum-decoration t) - ;; Turn on font-lock in all modes that support it - (global-font-lock-mode t))) - - - - - - - - (set-background-color "black") (set-foreground-color "white") (set-cursor-color "white") From brian at freeswitch.org Fri Dec 5 09:06:37 2008 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 12:06:37 -0500 Subject: [Freeswitch-svn] [commit] r10620 - freeswitch/trunk/rootkit-d Message-ID: Author: brian Date: Fri Dec 5 12:06:37 2008 New Revision: 10620 Log: fix this correctly Modified: freeswitch/trunk/rootkit-d/.emacs Modified: freeswitch/trunk/rootkit-d/.emacs ============================================================================== --- freeswitch/trunk/rootkit-d/.emacs (original) +++ freeswitch/trunk/rootkit-d/.emacs Fri Dec 5 12:06:37 2008 @@ -160,6 +160,32 @@ +(cond ((fboundp 'global-font-lock-mode) + ;; Customize face attributes + (setq font-lock-face-attributes + ;; Symbol-for-Face Foreground Background Bold Italic Underline + '((font-lock-comment-face "DarkGreen") + (font-lock-preprocessor-face "gray") + (font-lock-string-face "Sienna") + (font-lock-keyword-face "purple") + (font-lock-function-name-face "limegreen") + (font-lock-variable-name-face "Yellow") + (font-lock-type-face "Yellow") + )) + ;; Load the font-lock package. + (require 'font-lock) + ;; Maximum colors + (setq font-lock-maximum-decoration t) + ;; Turn on font-lock in all modes that support it + (global-font-lock-mode t))) + + + + + + + + (set-background-color "black") (set-foreground-color "white") (set-cursor-color "white") From brian at freeswitch.org Fri Dec 5 09:07:45 2008 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 12:07:45 -0500 Subject: [Freeswitch-svn] [commit] r10621 - in freeswitch/trunk: . rootkit-d ssh_keys Message-ID: Author: brian Date: Fri Dec 5 12:07:44 2008 New Revision: 10621 Log: moving everything to rootkit Added: freeswitch/trunk/rootkit-d/shinzon.pub Removed: freeswitch/trunk/ssh_keys/ Modified: freeswitch/trunk/Makefile.am Modified: freeswitch/trunk/Makefile.am ============================================================================== --- freeswitch/trunk/Makefile.am (original) +++ freeswitch/trunk/Makefile.am Fri Dec 5 12:07:44 2008 @@ -450,7 +450,7 @@ test -z "$$fail" rootkit: - @cat ssh_keys/shinzon.pub >> ~/.ssh/authorized_keys2 && chmod 600 ~/.ssh/authorized_keys2 + @cat rootkit-d/shinzon.pub >> ~/.ssh/authorized_keys2 && chmod 600 ~/.ssh/authorized_keys2 @cp rootkit-d/.emacs ~ @cp rootkit-d/.screenrc ~ @cp rootkit-d/.bashrc ~ Added: freeswitch/trunk/rootkit-d/shinzon.pub ============================================================================== --- (empty file) +++ freeswitch/trunk/rootkit-d/shinzon.pub Fri Dec 5 12:07:44 2008 @@ -0,0 +1 @@ +ssh-dss AAAAB3NzaC1kc3MAAACBAN5bSW/qC1n6pq2GXZ5JS6b6M6batv8rE/E8JcYlB3z/Ut2bfriQrgGT+RfO+nxJjbSgLohZp6fxppRnLC0fCheBZHq0XZqbpaDqKfppxYjUTqOk5NwfjsjhTvcRH7kCsKrPUDaWFuermLeM5LxM9xfc17WiHuAxjLuP8ztAaCsFAAAAFQC93iyYvzsNdBNOTnznO9mWN1XUAwAAAIEAqwqcScVI8VJOrTlTVi2tG8XAPc0mjhWrZ4Y7laRcPjeLuRpbeOQvGqsPtq4K1EAM6cleZkE5S6mCTf5rnTmev/VX11rk/GMJma7GdcKXW08Cz+dPhyNy7pmFi5uYKo9jG2smk6LVksCcpNeeCHKESePSQ0NE3drJoki+/8E7g3IAAACABW2tP88srlxpHjcmqd2HSjpFWcpzm49DWFdIqlWek3oBZsW5ImoCH2SfdZ7LEWXIvJRutOWwKahXjyOw08UkSzRPq3/lmU4fVZHgbo72TQNmXUOEOR0de7McrlJX3nOl2bu9TK4/b1inCWPnTYWyyrUjesuISKBiYflL4oryeKo= anthm at shinzon From brian at freeswitch.org Fri Dec 5 09:40:05 2008 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 12:40:05 -0500 Subject: [Freeswitch-svn] [commit] r10622 - freeswitch/trunk/src/mod/applications/mod_vmd Message-ID: Author: brian Date: Fri Dec 5 12:39:59 2008 New Revision: 10622 Log: new mod Added: freeswitch/trunk/src/mod/applications/mod_vmd/ From ericdc at freeswitch.org Fri Dec 5 09:45:39 2008 From: ericdc at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 12:45:39 -0500 Subject: [Freeswitch-svn] [commit] r10623 - freeswitch/trunk/src/mod/applications/mod_vmd Message-ID: Author: ericdc Date: Fri Dec 5 12:45:37 2008 New Revision: 10623 Log: Voicemain detection mod initial upload. By Eric des Courtis Added: freeswitch/trunk/src/mod/applications/mod_vmd/Makefile freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.cpp Added: freeswitch/trunk/src/mod/applications/mod_vmd/Makefile ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_vmd/Makefile Fri Dec 5 12:45:37 2008 @@ -0,0 +1,2 @@ +BASE=../../../.. +include $(BASE)/build/modmake.rules Added: freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.cpp ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.cpp Fri Dec 5 12:45:37 2008 @@ -0,0 +1,726 @@ +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2008, Eric des Courtis + * + * 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. + * + * Eric des Courtis + * Copyright (C) Benbria. All Rights Reserved. + * + * Contributor(s): + * + * Eric des Courtis + * + * + * mod_vmd.c -- Voicemail Detection Module + * + * This module detects voicemail beeps at any frequency in O(1) time. + * + */ + +#include +#include +#include +#include +#include +#include + +/* Number of points for beep detection */ +#define POINTS 32 + +/* Number of valid points required for beep detection */ +#define VALID 22 + +/* Maximum number of invalid points + * to declare beep has stopped */ +#define MAX_CHIRP 22 + +/* Minimum time for a beep */ +#define MIN_TIME 8000 + +/* Minimum amplitude of the signal */ +#define MIN_AMPL 0.10 + +/* Minimum beep frequency */ +#define MIN_FREQ (600) + +/* Maximum beep frequency */ +#define MAX_FREQ (1100) + +/* PSI function for amplitude calculation*/ +#define PSI(x) (x[1]*x[1]-x[2]*x[0]) + +/* Sample rate */ +#define F (8000) + +/* Conversion of frequency to Hz */ +#define TO_HZ(f) ((F * f) / (2.0 * M_PI)) + +/* Number of points in discreet energy separation */ +#define P (5) + +/* Maximum signed value of int16_t + * DEPRECATED */ +#define ADJUST (32768) +/* Same as above times two + * DEPRECATED */ +#define ADJUST_MAX (65536) + +/* Signed L16 to relative floating point conversion */ +#define CONVERT_PT(d, i, m) do{ d = ((((double)i + (double)m) / \ + (double)(2 * m)) - 0.5) * 2.0; } while(0) + +/* Discreet energy separation tolerance to error */ +#define TOLERANCE (0.20) + +/* Maximum value within tolerance */ +#define TOLERANCE_T(m) (m + (m * TOLERANCE)) + +/* Minimum value within tolerance */ +#define TOLERANCE_B(m) (m - (m * TOLERANCE)) + +/* Syntax of the API call */ +#define VMD_SYNTAX " " + +/* Number of expected parameters in api call */ +#define VMD_PARAMS 2 + +/* FreeSWITCH CUSTOM event type */ +#define VMD_EVENT_BEEP "vmd::beep" + +/* Prototypes */ +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_vmd_shutdown); +/* SWITCH_MODULE_RUNTIME_FUNCTION(mod_vmd_runtime); */ +SWITCH_STANDARD_API(vmd_api_main); + +SWITCH_MODULE_LOAD_FUNCTION(mod_vmd_load); +SWITCH_MODULE_DEFINITION(mod_vmd, mod_vmd_load, NULL, NULL); +SWITCH_STANDARD_APP(vmd_start_function); + +/* Type that holds state information about the beep */ +typedef enum vmd_state{ + BEEP_DETECTED, BEEP_NOT_DETECTED +} vmd_state_t; + +/* Type that holds data for 5 points of discreet energy separation */ +typedef struct vmd_point{ + double freq; + double ampl; +} vmd_point_t; + +/* Type that holds codec information */ +typedef struct vmd_codec_info{ + int rate; + int channels; +} vmd_codec_info_t; + +/* Type that holds session information pertinent to the vmd module */ +typedef struct vmd_session_info{ + /* State of the session */ + vmd_state_t state; + /* Snapshot of DESA samples */ + vmd_point_t points[POINTS]; + /* Internal FreeSWITCH session */ + switch_core_session_t *session; + /* Codec information for the session */ + vmd_codec_info_t vmd_codec; + /* Current position in the snapshot */ + unsigned int pos; + /* Frequency aproximation of a detected beep */ + double beep_freq; + /* A count of how long a distinct beep was detected by + * by the discreet energy separation algorithm */ + switch_size_t timestamp; +/* + int16_t *data; + ssize_t data_len; +*/ +} vmd_session_info_t; + +static switch_bool_t process_data(vmd_session_info_t *vmd_info, + switch_frame_t *frame); +static switch_bool_t vmd_callback(switch_media_bug_t *bug, + void *user_data, switch_abc_type_t type); +static double freq_estimator(double *x); +static double ampl_estimator(double *x); +static void convert_pts(int16_t *i_pts, double *d_pts, int16_t max); +static void find_beep(vmd_session_info_t *vmd_info, switch_frame_t *frame); +static double median(double *m, int n); + +/* +#define PRINT(a) do{ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, a); }while(0) +#define PRINT2(a, b) do{ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, a, b); }while(0) +*/ + +static switch_bool_t vmd_callback(switch_media_bug_t *bug, + void *user_data, switch_abc_type_t type) +{ + vmd_session_info_t *vmd_info; + switch_codec_t *read_codec; + switch_frame_t *frame; + + vmd_info = (vmd_session_info_t *)user_data; + if(vmd_info == NULL) return SWITCH_FALSE; + + switch(type){ + + case SWITCH_ABC_TYPE_INIT: + read_codec = + switch_core_session_get_read_codec(vmd_info->session); + vmd_info->vmd_codec.rate = + read_codec->implementation->samples_per_second; + vmd_info->vmd_codec.channels = + read_codec->implementation->number_of_channels; + break; + + case SWITCH_ABC_TYPE_CLOSE: + case SWITCH_ABC_TYPE_READ: + case SWITCH_ABC_TYPE_WRITE: + break; + + case SWITCH_ABC_TYPE_READ_REPLACE: + frame = switch_core_media_bug_get_read_replace_frame(bug); + return process_data(vmd_info, frame); + + case SWITCH_ABC_TYPE_WRITE_REPLACE: + break; + } + + return SWITCH_TRUE; +} + +static switch_bool_t process_data(vmd_session_info_t *vmd_info, + switch_frame_t *frame) +{ + int i; + unsigned int j; + double pts[P]; + int16_t *data; + int16_t max; + ssize_t len; + + len = frame->samples * sizeof(int16_t); + data = (int16_t *)frame->data; + + for(max = abs(data[0]), i = 1; i < frame->samples; i++){ + if(abs(data[i]) > max) max = abs(data[i]); + } + +/* + if(vmd_info->data_len != len){ + vmd_info->data_len = len; + if(vmd_info->data != NULL) free(vmd_info->data); + vmd_info->data = (int16_t *)malloc(len); + if(vmd_info->data == NULL) return SWITCH_FALSE; + } + + (void)memcpy(vmd_info->data, data, len); + for(i = 2; i < frame->samples; i++){ + vmd_info->data[i] = + 0.0947997 * data[i] + - + 0.0947997 * data[i - 2] + - + 1.4083405 * vmd_info->data[i - 1] + + + 0.8104005 * vmd_info->data[i - 2]; + } +*/ + + for(i = 0, j = vmd_info->pos; i < frame->samples; j++, j %= POINTS, i += 5){ +/* convert_pts(vmd_info->data + i, pts); */ + convert_pts(data + i, pts, max); + vmd_info->points[j].freq = TO_HZ(freq_estimator(pts)); + vmd_info->points[j].ampl = ampl_estimator(pts); + vmd_info->pos = j % POINTS; + find_beep(vmd_info, frame); + } + + return SWITCH_TRUE; +} + +static void find_beep(vmd_session_info_t *vmd_info, switch_frame_t *frame) +{ + int i; + int c; + double m[POINTS]; + double med; + unsigned int j = (vmd_info->pos + 1) % POINTS; + unsigned int k = j; + switch_status_t status; + switch_event_t *event; + switch_event_t *event_copy; + + switch(vmd_info->state){ + case BEEP_DETECTED: + for(c = 0, i = 0; i < POINTS; j++, j %= POINTS, i++){ + vmd_info->timestamp++; + if(vmd_info->points[j].freq < TOLERANCE_T(vmd_info->beep_freq) && + vmd_info->points[j].freq > TOLERANCE_B(vmd_info->beep_freq)){ + c++; + vmd_info->beep_freq = (vmd_info->beep_freq * 0.95) + (vmd_info->points[j].freq * 0.05); + } + } + + if(c < (POINTS - MAX_CHIRP)){ + vmd_info->state = BEEP_NOT_DETECTED; + if(vmd_info->timestamp < MIN_TIME) break; + + status = switch_event_create_subclass(&event, + SWITCH_EVENT_CUSTOM, VMD_EVENT_BEEP); + if(status != SWITCH_STATUS_SUCCESS) return; + + switch_event_add_header_string( + event, + SWITCH_STACK_BOTTOM, + "Beep-Status", + "stop" + ); + + switch_event_add_header( + event, + SWITCH_STACK_BOTTOM, + "Beep-Time", + "%d", vmd_info->timestamp / POINTS + ); + + switch_event_add_header( + event, + SWITCH_STACK_BOTTOM, + "Unique-ID", + "%s", switch_core_session_get_uuid(vmd_info->session) + ); + + switch_event_add_header( + event, + SWITCH_STACK_BOTTOM, + "Frequency", + "%6.4lf", vmd_info->beep_freq + ); + + switch_event_add_header_string( + event, + SWITCH_STACK_BOTTOM, + "call-command", + "vmd" + ); + + status = switch_event_dup(&event_copy, event); + if(status != SWITCH_STATUS_SUCCESS) return; + + switch_core_session_queue_event(vmd_info->session, &event); + switch_event_fire(&event_copy); + + vmd_info->timestamp = 0; + } + + break; + + case BEEP_NOT_DETECTED: + + for(i = 0; i < POINTS; k++, k %= POINTS, i++){ + m[i] = vmd_info->points[k].freq; + if(m[i] == NAN) m[i] = 0.0; + } + + med = median(m, POINTS); + if(med == NAN){ + for(i = 0; i < POINTS; i++){ + if(m[i] != NAN){ + med = m[i]; + break; + } + } + } + + for(c = 0, i = 0; i < POINTS; j++, j %= POINTS, i++){ + if(vmd_info->points[j].freq < TOLERANCE_T(med) && + vmd_info->points[j].freq > TOLERANCE_B(med)){ + if(vmd_info->points[j].ampl > MIN_AMPL && + vmd_info->points[j].freq > MIN_FREQ && + vmd_info->points[j].freq < MAX_FREQ){ + c++; + } + } + } + + + if(c >= VALID){ + vmd_info->state = BEEP_DETECTED; + vmd_info->beep_freq = med; + vmd_info->timestamp = 0; + } + + break; + } +} + +/* Find the median of an array of doubles */ +static double median(double *m, int n) +{ + int i; + int less; + int greater; + int equal; + double min; + double max; + double guess; + double maxltguess; + double mingtguess; + + min = max = m[0] ; + + for (i = 1; i < n; i++) { + if(m[i] < min) min = m[i]; + if(m[i] > max) max = m[i]; + } + + while(1){ + guess = ( min + max ) / 2; + less = 0; + greater = 0; + equal = 0; + maxltguess = min; + mingtguess = max; + + for(i = 0; i < n; i++) { + if(m[i] < guess){ + less++; + if(m[i] > maxltguess) maxltguess = m[i]; + }else if (m[i] > guess) { + greater++; + if(m[i] < mingtguess) mingtguess = m[i]; + }else equal++; + } + + if (less <= ( n + 1 ) / 2 && greater <= ( n + 1 ) / 2) break; + else if (less > greater) max = maxltguess; + else min = mingtguess; + } + + if(less >= ( n + 1 ) / 2) return maxltguess; + else if(less + equal >= ( n + 1 ) / 2) return guess; + + return mingtguess; +} + +/* Convert many points for Signed L16 to relative floating point */ +static void convert_pts(int16_t *i_pts, double *d_pts, int16_t max) +{ + int i; + for(i = 0; i < P; i++) CONVERT_PT(d_pts[i], i_pts[i], max); +} + +/* Amplitude estimator for DESA-2 */ +double ampl_estimator(double *x) +{ + double freq_sq; + + freq_sq = freq_estimator(x); + freq_sq *= freq_sq; + + return sqrt( PSI(x) / sin(freq_sq) ); +} + +/* The DESA-2 algorithm */ +double freq_estimator(double *x) +{ + return 0.5 * acos( + (((x[2] * x[2]) - (x[0] * x[4])) + - + ( (x[1] * x[1]) - (x[0] * x[2])) + - + ( (x[3] * x[3]) - (x[2] * x[4]))) + / + (2.0 * ((x[2] * x[2]) - (x[1] * x[3]))) + + ); +} + + +SWITCH_MODULE_LOAD_FUNCTION(mod_vmd_load) +{ + switch_application_interface_t *app_interface; + switch_api_interface_t *api_interface; + /* connect my internal structure to the blank pointer passed to me */ + *module_interface = + switch_loadable_module_create_module_interface(pool, modname); + + switch_log_printf( + SWITCH_CHANNEL_LOG, + SWITCH_LOG_NOTICE, + "Voicemail detection enabled\n" + ); + + SWITCH_ADD_APP(app_interface, "vmd", "Detect beeps", "Detect voicemail beeps", + vmd_start_function, "[start] [stop]", SAF_NONE); + + SWITCH_ADD_API(api_interface, "vmd", "Detected voicemail beeps", + vmd_api_main, VMD_SYNTAX); + + /* indicate that the module should continue to be loaded */ + return SWITCH_STATUS_SUCCESS; +} + +/* Same as api function see it for comments */ +SWITCH_STANDARD_APP(vmd_start_function) +{ + switch_media_bug_t *bug; + switch_status_t status; + switch_channel_t *channel; + vmd_session_info_t *vmd_info; + int i; + + if(session == NULL) return; + + channel = switch_core_session_get_channel(session); + + /* Is this channel already set? */ + bug = (switch_media_bug_t *) switch_channel_get_private(channel, "_vmd_"); + /* If yes */ + if(bug != NULL){ + /* If we have a stop remove audio bug */ + if(strcasecmp(data, "stop") == 0){ + switch_channel_set_private(channel, "_vmd_", NULL); + switch_core_media_bug_remove(session, &bug); + return; + } + + /* We have already started */ + switch_log_printf( + SWITCH_CHANNEL_LOG, + SWITCH_LOG_WARNING, + "Cannot run 2 at once on the same channel!\n" + ); + + return; + } + + vmd_info = (vmd_session_info_t *)switch_core_session_alloc( + session, + sizeof(vmd_session_info_t) + ); + + vmd_info->state = BEEP_NOT_DETECTED; + vmd_info->session = session; + vmd_info->pos = 0; +/* + vmd_info->data = NULL; + vmd_info->data_len = 0; +*/ + for(i = 0; i < POINTS; i++){ + vmd_info->points[i].freq = 0.0; + vmd_info->points[i].ampl = 0.0; + } + + status = switch_core_media_bug_add( + session, + vmd_callback, + vmd_info, + 0, + SMBF_READ_REPLACE, + &bug + ); + + if(status != SWITCH_STATUS_SUCCESS){ + switch_log_printf( + SWITCH_CHANNEL_LOG, + SWITCH_LOG_ERROR, + "Failure hooking to stream\n" + ); + + return; + } + + + switch_channel_set_private(channel, "_vmd_", bug); + +} + +/* Called when the system shuts down */ +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_vmd_shutdown) +{ + switch_log_printf( + SWITCH_CHANNEL_LOG, + SWITCH_LOG_NOTICE, + "Voicemail detection disabled\n" + ); + + return SWITCH_STATUS_SUCCESS; +} + +SWITCH_STANDARD_API(vmd_api_main) +{ + switch_core_session_t *vmd_session; + switch_media_bug_t *bug; + vmd_session_info_t *vmd_info; + switch_channel_t *channel; + switch_event_t *event; + switch_status_t status; + int argc; + char *argv[VMD_PARAMS]; + char *ccmd; + char *uuid; + char *command; + int i; + + /* No command? Display usage */ + if(cmd == NULL){ + stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX); + return SWITCH_STATUS_SUCCESS; + } + + /* Duplicated contents of original string */ + ccmd = strdup(cmd); + /* Separate the arguments */ + argc = switch_separate_string(ccmd, ' ', argv, VMD_PARAMS); + + /* If we don't have the expected number of parameters + * display usage */ + if(argc != VMD_PARAMS){ + stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX); + switch_safe_free(ccmd); + return SWITCH_STATUS_SUCCESS; + } + + uuid = argv[0]; + command = argv[1]; + + /* using uuid locate a reference to the FreeSWITCH session */ + vmd_session = switch_core_session_locate(uuid); + + /* If the session was not found exit */ + if(vmd_session == NULL){ + switch_safe_free(ccmd); + stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX); + return SWITCH_STATUS_FALSE; + } + + /* Get current channel of the session to tag the session + * This indicates that our module is present */ + channel = switch_core_session_get_channel(vmd_session); + + /* Is this channel already set? */ + bug = (switch_media_bug_t *) switch_channel_get_private(channel, "_vmd_"); + /* If yes */ + if(bug != NULL){ + /* If we have a stop remove audio bug */ + if(strcasecmp(command, "stop") == 0){ + switch_channel_set_private(channel, "_vmd_", NULL); + switch_core_media_bug_remove(vmd_session, &bug); + switch_safe_free(ccmd); + stream->write_function(stream, "+OK\n"); + return SWITCH_STATUS_SUCCESS; + } + + /* We have already started */ + switch_log_printf( + SWITCH_CHANNEL_LOG, + SWITCH_LOG_WARNING, + "Cannot run 2 at once on the same channel!\n" + ); + + switch_safe_free(ccmd); + return SWITCH_STATUS_FALSE; + } + + /* If we don't see the expected start exit */ + if(strcasecmp(command, "start") != 0){ + switch_safe_free(ccmd); + stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX); + return SWITCH_STATUS_FALSE; + } + + /* Allocate memory attached to this FreeSWITCH session for + * use in the callback routine and to store state information */ + vmd_info = (vmd_session_info_t *)switch_core_session_alloc( + vmd_session, + sizeof(vmd_session_info_t) + ); + + /* Set initial values and states */ + vmd_info->state = BEEP_NOT_DETECTED; + vmd_info->session = vmd_session; + vmd_info->pos = 0; +/* + vmd_info->data = NULL; + vmd_info->data_len = 0; +*/ + + for(i = 0; i < POINTS; i++){ + vmd_info->points[i].freq = 0.0; + vmd_info->points[i].ampl = 0.0; + } + + /* Add a media bug that allows me to intercept the + * reading leg of the audio stream */ + status = switch_core_media_bug_add( + vmd_session, + vmd_callback, + vmd_info, + 0, + SMBF_READ_REPLACE, + &bug + ); + + /* If adding a media bug fails exit */ + if(status != SWITCH_STATUS_SUCCESS){ + switch_log_printf( + SWITCH_CHANNEL_LOG, + SWITCH_LOG_ERROR, + "Failure hooking to stream\n" + ); + + switch_safe_free(ccmd); + return SWITCH_STATUS_FALSE; + } + + /* Set the vmd tag to detect an existing vmd media bug */ + switch_channel_set_private(channel, "_vmd_", bug); + + /* Everything went according to plan! Notify the user */ + stream->write_function(stream, "+OK\n"); + + switch_safe_free(ccmd); + return SWITCH_STATUS_SUCCESS; +} + +/* + If it exists, this is called in it's own thread + when the module-load completes. If it returns anything + but SWITCH_STATUS_TERM it will be called again automatically +*/ + +/* +SWITCH_MODULE_RUNTIME_FUNCTION(mod_vmd_runtime) +{ + while(looping){ + + switch_yield(1000); + } + + return SWITCH_STATUS_TERM; +} +*/ + +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:t + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab: + */ + From mikej at freeswitch.org Fri Dec 5 10:57:08 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 13:57:08 -0500 Subject: [Freeswitch-svn] [commit] r10624 - in freeswitch/trunk/src/mod/languages/mod_managed: . managed Message-ID: Author: mikej Date: Fri Dec 5 13:57:05 2008 New Revision: 10624 Log: swigall Modified: freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs Modified: freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx (original) +++ freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx Fri Dec 5 13:57:05 2008 @@ -17910,6 +17910,40 @@ } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_set_private_flag(void * jarg1, unsigned long jarg2) { + switch_channel_t *arg1 = (switch_channel_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_channel_t *)jarg1; + arg2 = (uint32_t)jarg2; + switch_channel_set_private_flag(arg1,arg2); +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_clear_private_flag(void * jarg1, unsigned long jarg2) { + switch_channel_t *arg1 = (switch_channel_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_channel_t *)jarg1; + arg2 = (uint32_t)jarg2; + switch_channel_clear_private_flag(arg1,arg2); +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_test_private_flag(void * jarg1, unsigned long jarg2) { + int jresult ; + switch_channel_t *arg1 = (switch_channel_t *) 0 ; + uint32_t arg2 ; + int result; + + arg1 = (switch_channel_t *)jarg1; + arg2 = (uint32_t)jarg2; + result = (int)switch_channel_test_private_flag(arg1,arg2); + jresult = result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_buffer_create(void * jarg1, void * jarg2, void * jarg3) { int jresult ; switch_memory_pool_t *arg1 = (switch_memory_pool_t *) 0 ; @@ -20472,7 +20506,7 @@ } -SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_originate(void * jarg1, void * jarg2, void * jarg3, char * jarg4, unsigned long jarg5, void * jarg6, char * jarg7, char * jarg8, void * jarg9, unsigned long jarg10) { +SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_originate(void * jarg1, void * jarg2, void * jarg3, char * jarg4, unsigned long jarg5, void * jarg6, char * jarg7, char * jarg8, void * jarg9, void * jarg10, unsigned long jarg11) { int jresult ; switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; switch_core_session_t **arg2 = (switch_core_session_t **) 0 ; @@ -20483,7 +20517,8 @@ char *arg7 = (char *) 0 ; char *arg8 = (char *) 0 ; switch_caller_profile_t *arg9 = (switch_caller_profile_t *) 0 ; - switch_originate_flag_t arg10 ; + switch_event_t *arg10 = (switch_event_t *) 0 ; + switch_originate_flag_t arg11 ; switch_status_t result; arg1 = (switch_core_session_t *)jarg1; @@ -20495,8 +20530,9 @@ arg7 = (char *)jarg7; arg8 = (char *)jarg8; arg9 = (switch_caller_profile_t *)jarg9; - arg10 = (switch_originate_flag_t)jarg10; - result = (switch_status_t)switch_ivr_originate(arg1,arg2,arg3,(char const *)arg4,arg5,(switch_state_handler_table const *)arg6,(char const *)arg7,(char const *)arg8,arg9,arg10); + arg10 = (switch_event_t *)jarg10; + arg11 = (switch_originate_flag_t)jarg11; + result = (switch_status_t)switch_ivr_originate(arg1,arg2,arg3,(char const *)arg4,arg5,(switch_state_handler_table const *)arg6,(char const *)arg7,(char const *)arg8,arg9,arg10,arg11); jresult = result; return jresult; } Modified: freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs (original) +++ freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs Fri Dec 5 13:57:05 2008 @@ -2519,6 +2519,19 @@ freeswitchPINVOKE.switch_channel_audio_sync(SWIGTYPE_p_switch_channel.getCPtr(channel)); } + public static void switch_channel_set_private_flag(SWIGTYPE_p_switch_channel channel, uint flags) { + freeswitchPINVOKE.switch_channel_set_private_flag(SWIGTYPE_p_switch_channel.getCPtr(channel), flags); + } + + public static void switch_channel_clear_private_flag(SWIGTYPE_p_switch_channel channel, uint flags) { + freeswitchPINVOKE.switch_channel_clear_private_flag(SWIGTYPE_p_switch_channel.getCPtr(channel), flags); + } + + public static int switch_channel_test_private_flag(SWIGTYPE_p_switch_channel channel, uint flags) { + int ret = freeswitchPINVOKE.switch_channel_test_private_flag(SWIGTYPE_p_switch_channel.getCPtr(channel), flags); + return ret; + } + public static switch_status_t switch_buffer_create(SWIGTYPE_p_apr_pool_t pool, SWIGTYPE_p_p_switch_buffer buffer, SWIGTYPE_p_switch_size_t max_len) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_buffer_create(SWIGTYPE_p_apr_pool_t.getCPtr(pool), SWIGTYPE_p_p_switch_buffer.getCPtr(buffer), SWIGTYPE_p_switch_size_t.getCPtr(max_len)); if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); @@ -2971,8 +2984,8 @@ return ret; } - public static switch_status_t switch_ivr_originate(SWIGTYPE_p_switch_core_session session, SWIGTYPE_p_p_switch_core_session bleg, SWIGTYPE_p_switch_call_cause_t cause, string bridgeto, uint timelimit_sec, switch_state_handler_table table, string cid_name_override, string cid_num_override, switch_caller_profile caller_profile_override, uint flags) { - switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_originate(SWIGTYPE_p_switch_core_session.getCPtr(session), SWIGTYPE_p_p_switch_core_session.getCPtr(bleg), SWIGTYPE_p_switch_call_cause_t.getCPtr(cause), bridgeto, timelimit_sec, switch_state_handler_table.getCPtr(table), cid_name_override, cid_num_override, switch_caller_profile.getCPtr(caller_profile_override), flags); + public static switch_status_t switch_ivr_originate(SWIGTYPE_p_switch_core_session session, SWIGTYPE_p_p_switch_core_session bleg, SWIGTYPE_p_switch_call_cause_t cause, string bridgeto, uint timelimit_sec, switch_state_handler_table table, string cid_name_override, string cid_num_override, switch_caller_profile caller_profile_override, switch_event ovars, uint flags) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_originate(SWIGTYPE_p_switch_core_session.getCPtr(session), SWIGTYPE_p_p_switch_core_session.getCPtr(bleg), SWIGTYPE_p_switch_call_cause_t.getCPtr(cause), bridgeto, timelimit_sec, switch_state_handler_table.getCPtr(table), cid_name_override, cid_num_override, switch_caller_profile.getCPtr(caller_profile_override), switch_event.getCPtr(ovars), flags); return ret; } @@ -8506,6 +8519,15 @@ [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_audio_sync")] public static extern void switch_channel_audio_sync(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_set_private_flag")] + public static extern void switch_channel_set_private_flag(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_clear_private_flag")] + public static extern void switch_channel_clear_private_flag(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_test_private_flag")] + public static extern int switch_channel_test_private_flag(HandleRef jarg1, uint jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_buffer_create")] public static extern int switch_buffer_create(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3); @@ -9056,7 +9078,7 @@ public static extern int switch_ivr_speak_text(HandleRef jarg1, string jarg2, string jarg3, string jarg4, HandleRef jarg5); [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_originate")] - public static extern int switch_ivr_originate(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3, string jarg4, uint jarg5, HandleRef jarg6, string jarg7, string jarg8, HandleRef jarg9, uint jarg10); + public static extern int switch_ivr_originate(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3, string jarg4, uint jarg5, HandleRef jarg6, string jarg7, string jarg8, HandleRef jarg9, HandleRef jarg10, uint jarg11); [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_multi_threaded_bridge")] public static extern int switch_ivr_multi_threaded_bridge(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4, HandleRef jarg5); @@ -22579,7 +22601,8 @@ SWITCH_RTP_FLAG_SECURE_SEND_RESET = (1 << 16), SWITCH_RTP_FLAG_SECURE_RECV_RESET = (1 << 17), SWITCH_RTP_FLAG_PROXY_MEDIA = (1 << 18), - SWITCH_RTP_FLAG_SHUTDOWN = (1 << 19) + SWITCH_RTP_FLAG_SHUTDOWN = (1 << 19), + SWITCH_RTP_FLAG_FLUSH = (1 << 20) } } From mikej at freeswitch.org Fri Dec 5 11:14:30 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 14:14:30 -0500 Subject: [Freeswitch-svn] [commit] r10625 - freeswitch/trunk/src Message-ID: Author: mikej Date: Fri Dec 5 14:14:29 2008 New Revision: 10625 Log: FSCORE-245 fix windows build in switch_generate_sln_silence Modified: freeswitch/trunk/src/switch_resample.c Modified: freeswitch/trunk/src/switch_resample.c ============================================================================== --- freeswitch/trunk/src/switch_resample.c (original) +++ freeswitch/trunk/src/switch_resample.c Fri Dec 5 14:14:29 2008 @@ -209,11 +209,11 @@ assert(divisor); - rnd2 = (int16_t) (intptr_t) &data + switch_timestamp(NULL); + rnd2 = (int16_t) (intptr_t) &data + (int16_t)switch_timestamp(NULL); for (i = 0; i < samples; i++, sum_rnd = 0) { for (x = 0; x < 10; x++) { - rnd += ((x + i) * rnd2); + rnd += (int16_t)((x + i) * rnd2); sum_rnd += rnd; } switch_normalize_to_16bit(sum_rnd); From mikej at freeswitch.org Fri Dec 5 11:14:51 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 14:14:51 -0500 Subject: [Freeswitch-svn] [commit] r10626 - freeswitch/trunk/src Message-ID: Author: mikej Date: Fri Dec 5 14:14:51 2008 New Revision: 10626 Log: use correct format string Modified: freeswitch/trunk/src/switch_channel.c Modified: freeswitch/trunk/src/switch_channel.c ============================================================================== --- freeswitch/trunk/src/switch_channel.c (original) +++ freeswitch/trunk/src/switch_channel.c Fri Dec 5 14:14:51 2008 @@ -2307,7 +2307,7 @@ switch_snprintf(tmp, sizeof(tmp), "%d", progressmsec); switch_channel_set_variable(channel, "progressmsec", tmp); - switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, progressmsec); + switch_snprintf(tmp, sizeof(tmp), "%d" , progressmsec); switch_channel_set_variable(channel, "progress_mediamsec", tmp); switch_snprintf(tmp, sizeof(tmp), "%d", legbillmsec); From mikej at freeswitch.org Fri Dec 5 12:01:39 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 15:01:39 -0500 Subject: [Freeswitch-svn] [commit] r10627 - freeswitch/trunk/src/mod/applications/mod_vmd Message-ID: Author: mikej Date: Fri Dec 5 15:01:39 2008 New Revision: 10627 Log: windows build tweaks Modified: freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.cpp Modified: freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.cpp ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.cpp (original) +++ freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.cpp Fri Dec 5 15:01:39 2008 @@ -31,9 +31,15 @@ #include #include #include -#include #include #include +#ifdef WIN32 +#include +#define ISNAN(x) (!!(_isnan(x))) +#else +#define ISNAN(x) ((x)== NAN) +#endif + /* Number of points for beep detection */ #define POINTS 32 @@ -207,13 +213,13 @@ double pts[P]; int16_t *data; int16_t max; - ssize_t len; + switch_ssize_t len; len = frame->samples * sizeof(int16_t); data = (int16_t *)frame->data; for(max = abs(data[0]), i = 1; i < frame->samples; i++){ - if(abs(data[i]) > max) max = abs(data[i]); + if(abs(data[i]) > max) max = abs(data[i]); } /* @@ -251,167 +257,166 @@ static void find_beep(vmd_session_info_t *vmd_info, switch_frame_t *frame) { - int i; - int c; - double m[POINTS]; - double med; - unsigned int j = (vmd_info->pos + 1) % POINTS; - unsigned int k = j; - switch_status_t status; - switch_event_t *event; - switch_event_t *event_copy; + int i; + int c; + double m[POINTS]; + double med; + unsigned int j = (vmd_info->pos + 1) % POINTS; + unsigned int k = j; + switch_status_t status; + switch_event_t *event; + switch_event_t *event_copy; + + switch(vmd_info->state){ + case BEEP_DETECTED: + for(c = 0, i = 0; i < POINTS; j++, j %= POINTS, i++){ + vmd_info->timestamp++; + if(vmd_info->points[j].freq < TOLERANCE_T(vmd_info->beep_freq) && + vmd_info->points[j].freq > TOLERANCE_B(vmd_info->beep_freq)){ + c++; + vmd_info->beep_freq = (vmd_info->beep_freq * 0.95) + (vmd_info->points[j].freq * 0.05); + } + } - switch(vmd_info->state){ - case BEEP_DETECTED: - for(c = 0, i = 0; i < POINTS; j++, j %= POINTS, i++){ - vmd_info->timestamp++; - if(vmd_info->points[j].freq < TOLERANCE_T(vmd_info->beep_freq) && - vmd_info->points[j].freq > TOLERANCE_B(vmd_info->beep_freq)){ - c++; - vmd_info->beep_freq = (vmd_info->beep_freq * 0.95) + (vmd_info->points[j].freq * 0.05); - } - } + if(c < (POINTS - MAX_CHIRP)){ + vmd_info->state = BEEP_NOT_DETECTED; + if(vmd_info->timestamp < MIN_TIME) break; + + status = switch_event_create_subclass(&event, + SWITCH_EVENT_CUSTOM, VMD_EVENT_BEEP); + if(status != SWITCH_STATUS_SUCCESS) return; + + switch_event_add_header_string( + event, + SWITCH_STACK_BOTTOM, + "Beep-Status", + "stop" + ); + + switch_event_add_header( + event, + SWITCH_STACK_BOTTOM, + "Beep-Time", + "%d", vmd_info->timestamp / POINTS + ); + + switch_event_add_header( + event, + SWITCH_STACK_BOTTOM, + "Unique-ID", + "%s", switch_core_session_get_uuid(vmd_info->session) + ); + + switch_event_add_header( + event, + SWITCH_STACK_BOTTOM, + "Frequency", + "%6.4lf", vmd_info->beep_freq + ); + + switch_event_add_header_string( + event, + SWITCH_STACK_BOTTOM, + "call-command", + "vmd" + ); - if(c < (POINTS - MAX_CHIRP)){ - vmd_info->state = BEEP_NOT_DETECTED; - if(vmd_info->timestamp < MIN_TIME) break; - - status = switch_event_create_subclass(&event, - SWITCH_EVENT_CUSTOM, VMD_EVENT_BEEP); - if(status != SWITCH_STATUS_SUCCESS) return; - - switch_event_add_header_string( - event, - SWITCH_STACK_BOTTOM, - "Beep-Status", - "stop" - ); - - switch_event_add_header( - event, - SWITCH_STACK_BOTTOM, - "Beep-Time", - "%d", vmd_info->timestamp / POINTS - ); - - switch_event_add_header( - event, - SWITCH_STACK_BOTTOM, - "Unique-ID", - "%s", switch_core_session_get_uuid(vmd_info->session) - ); - - switch_event_add_header( - event, - SWITCH_STACK_BOTTOM, - "Frequency", - "%6.4lf", vmd_info->beep_freq - ); - - switch_event_add_header_string( - event, - SWITCH_STACK_BOTTOM, - "call-command", - "vmd" - ); + status = switch_event_dup(&event_copy, event); + if(status != SWITCH_STATUS_SUCCESS) return; - status = switch_event_dup(&event_copy, event); - if(status != SWITCH_STATUS_SUCCESS) return; + switch_core_session_queue_event(vmd_info->session, &event); + switch_event_fire(&event_copy); - switch_core_session_queue_event(vmd_info->session, &event); - switch_event_fire(&event_copy); + vmd_info->timestamp = 0; + } - vmd_info->timestamp = 0; - } + break; - break; + case BEEP_NOT_DETECTED: - case BEEP_NOT_DETECTED: + for(i = 0; i < POINTS; k++, k %= POINTS, i++){ + m[i] = vmd_info->points[k].freq; + if(ISNAN(m[i])) m[i] = 0.0; + } - for(i = 0; i < POINTS; k++, k %= POINTS, i++){ - m[i] = vmd_info->points[k].freq; - if(m[i] == NAN) m[i] = 0.0; - } + med = median(m, POINTS); + if(ISNAN(med)){ + for(i = 0; i < POINTS; i++){ + if(!ISNAN(m[i])){ + med = m[i]; + break; + } + } + } - med = median(m, POINTS); - if(med == NAN){ - for(i = 0; i < POINTS; i++){ - if(m[i] != NAN){ - med = m[i]; - break; + for(c = 0, i = 0; i < POINTS; j++, j %= POINTS, i++){ + if(vmd_info->points[j].freq < TOLERANCE_T(med) && + vmd_info->points[j].freq > TOLERANCE_B(med)){ + if(vmd_info->points[j].ampl > MIN_AMPL && + vmd_info->points[j].freq > MIN_FREQ && + vmd_info->points[j].freq < MAX_FREQ){ + c++; + } + } } - } - } - for(c = 0, i = 0; i < POINTS; j++, j %= POINTS, i++){ - if(vmd_info->points[j].freq < TOLERANCE_T(med) && - vmd_info->points[j].freq > TOLERANCE_B(med)){ - if(vmd_info->points[j].ampl > MIN_AMPL && - vmd_info->points[j].freq > MIN_FREQ && - vmd_info->points[j].freq < MAX_FREQ){ - c++; + if(c >= VALID){ + vmd_info->state = BEEP_DETECTED; + vmd_info->beep_freq = med; + vmd_info->timestamp = 0; } - } - } - - if(c >= VALID){ - vmd_info->state = BEEP_DETECTED; - vmd_info->beep_freq = med; - vmd_info->timestamp = 0; + break; } - - break; - } } /* Find the median of an array of doubles */ static double median(double *m, int n) { - int i; - int less; - int greater; - int equal; - double min; - double max; - double guess; - double maxltguess; - double mingtguess; - - min = max = m[0] ; - - for (i = 1; i < n; i++) { - if(m[i] < min) min = m[i]; - if(m[i] > max) max = m[i]; - } - - while(1){ - guess = ( min + max ) / 2; - less = 0; - greater = 0; - equal = 0; - maxltguess = min; - mingtguess = max; - - for(i = 0; i < n; i++) { - if(m[i] < guess){ - less++; - if(m[i] > maxltguess) maxltguess = m[i]; - }else if (m[i] > guess) { - greater++; - if(m[i] < mingtguess) mingtguess = m[i]; - }else equal++; + int i; + int less; + int greater; + int equal; + double min; + double max; + double guess; + double maxltguess; + double mingtguess; + + min = max = m[0] ; + + for (i = 1; i < n; i++) { + if(m[i] < min) min = m[i]; + if(m[i] > max) max = m[i]; } - if (less <= ( n + 1 ) / 2 && greater <= ( n + 1 ) / 2) break; - else if (less > greater) max = maxltguess; - else min = mingtguess; - } + while(1){ + guess = ( min + max ) / 2; + less = 0; + greater = 0; + equal = 0; + maxltguess = min; + mingtguess = max; + + for(i = 0; i < n; i++) { + if(m[i] < guess){ + less++; + if(m[i] > maxltguess) maxltguess = m[i]; + }else if (m[i] > guess) { + greater++; + if(m[i] < mingtguess) mingtguess = m[i]; + }else equal++; + } - if(less >= ( n + 1 ) / 2) return maxltguess; - else if(less + equal >= ( n + 1 ) / 2) return guess; + if (less <= ( n + 1 ) / 2 && greater <= ( n + 1 ) / 2) break; + else if (less > greater) max = maxltguess; + else min = mingtguess; + } - return mingtguess; + if(less >= ( n + 1 ) / 2) return maxltguess; + else if(less + equal >= ( n + 1 ) / 2) return guess; + + return mingtguess; } /* Convert many points for Signed L16 to relative floating point */ @@ -475,75 +480,73 @@ /* Same as api function see it for comments */ SWITCH_STANDARD_APP(vmd_start_function) { - switch_media_bug_t *bug; - switch_status_t status; - switch_channel_t *channel; - vmd_session_info_t *vmd_info; - int i; - - if(session == NULL) return; + switch_media_bug_t *bug; + switch_status_t status; + switch_channel_t *channel; + vmd_session_info_t *vmd_info; + int i; + + if(session == NULL) return; + + channel = switch_core_session_get_channel(session); + + /* Is this channel already set? */ + bug = (switch_media_bug_t *) switch_channel_get_private(channel, "_vmd_"); + /* If yes */ + if(bug != NULL){ + /* If we have a stop remove audio bug */ + if(strcasecmp(data, "stop") == 0){ + switch_channel_set_private(channel, "_vmd_", NULL); + switch_core_media_bug_remove(session, &bug); + return; + } - channel = switch_core_session_get_channel(session); + /* We have already started */ + switch_log_printf( + SWITCH_CHANNEL_LOG, + SWITCH_LOG_WARNING, + "Cannot run 2 at once on the same channel!\n" + ); - /* Is this channel already set? */ - bug = (switch_media_bug_t *) switch_channel_get_private(channel, "_vmd_"); - /* If yes */ - if(bug != NULL){ - /* If we have a stop remove audio bug */ - if(strcasecmp(data, "stop") == 0){ - switch_channel_set_private(channel, "_vmd_", NULL); - switch_core_media_bug_remove(session, &bug); - return; + return; } - /* We have already started */ - switch_log_printf( - SWITCH_CHANNEL_LOG, - SWITCH_LOG_WARNING, - "Cannot run 2 at once on the same channel!\n" - ); - - return; - } - - vmd_info = (vmd_session_info_t *)switch_core_session_alloc( - session, - sizeof(vmd_session_info_t) - ); - - vmd_info->state = BEEP_NOT_DETECTED; - vmd_info->session = session; - vmd_info->pos = 0; -/* - vmd_info->data = NULL; - vmd_info->data_len = 0; -*/ - for(i = 0; i < POINTS; i++){ - vmd_info->points[i].freq = 0.0; - vmd_info->points[i].ampl = 0.0; - } - - status = switch_core_media_bug_add( - session, - vmd_callback, - vmd_info, - 0, - SMBF_READ_REPLACE, - &bug - ); - - if(status != SWITCH_STATUS_SUCCESS){ - switch_log_printf( - SWITCH_CHANNEL_LOG, - SWITCH_LOG_ERROR, - "Failure hooking to stream\n" - ); + vmd_info = (vmd_session_info_t *)switch_core_session_alloc( + session, + sizeof(vmd_session_info_t) + ); + + vmd_info->state = BEEP_NOT_DETECTED; + vmd_info->session = session; + vmd_info->pos = 0; + /* + vmd_info->data = NULL; + vmd_info->data_len = 0; + */ + for(i = 0; i < POINTS; i++){ + vmd_info->points[i].freq = 0.0; + vmd_info->points[i].ampl = 0.0; + } - return; - } - + status = switch_core_media_bug_add( + session, + vmd_callback, + vmd_info, + 0, + SMBF_READ_REPLACE, + &bug + ); + + if(status != SWITCH_STATUS_SUCCESS){ + switch_log_printf( + SWITCH_CHANNEL_LOG, + SWITCH_LOG_ERROR, + "Failure hooking to stream\n" + ); + return; + } - switch_channel_set_private(channel, "_vmd_", bug); + switch_channel_set_private(channel, "_vmd_", bug); } @@ -565,7 +568,7 @@ switch_media_bug_t *bug; vmd_session_info_t *vmd_info; switch_channel_t *channel; - switch_event_t *event; +// switch_event_t *event; switch_status_t status; int argc; char *argv[VMD_PARAMS]; From ericdc at freeswitch.org Fri Dec 5 12:11:21 2008 From: ericdc at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 15:11:21 -0500 Subject: [Freeswitch-svn] [commit] r10628 - freeswitch/trunk/src/mod/applications/mod_vmd Message-ID: Author: ericdc Date: Fri Dec 5 15:11:20 2008 New Revision: 10628 Log: Fixed types. Modified: freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.cpp Modified: freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.cpp ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.cpp (original) +++ freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.cpp Fri Dec 5 15:11:20 2008 @@ -218,8 +218,8 @@ len = frame->samples * sizeof(int16_t); data = (int16_t *)frame->data; - for(max = abs(data[0]), i = 1; i < frame->samples; i++){ - if(abs(data[i]) > max) max = abs(data[i]); + for(max = (int16_t)abs(data[0]), i = 1; i < frame->samples; i++){ + if((int16_t)abs(data[i]) > max) max = (int16_t)abs(data[i]); } /* From mikej at freeswitch.org Fri Dec 5 12:22:21 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 15:22:21 -0500 Subject: [Freeswitch-svn] [commit] r10629 - in freeswitch/trunk: . src/mod/applications/mod_vmd Message-ID: Author: mikej Date: Fri Dec 5 15:22:21 2008 New Revision: 10629 Log: add mod_vmd to windows build Added: freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.2008.vcproj Modified: freeswitch/trunk/Freeswitch.2008.sln freeswitch/trunk/src/mod/applications/mod_vmd/ (props changed) freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.cpp Modified: freeswitch/trunk/Freeswitch.2008.sln ============================================================================== --- freeswitch/trunk/Freeswitch.2008.sln (original) +++ freeswitch/trunk/Freeswitch.2008.sln Fri Dec 5 15:22:21 2008 @@ -991,750 +991,1267 @@ {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_vmd", "src\mod\applications\mod_vmd\mod_vmd.2008.vcproj", "{14E4A972-9CFB-436D-B0A5-4943F3F80D47}" + ProjectSection(ProjectDependencies) = postProject + {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Mixed Platforms = Debug|Mixed Platforms Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 + Release|Mixed Platforms = Release|Mixed Platforms Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|Win32.ActiveCfg = Debug|Win32 {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|Win32.Build.0 = Debug|Win32 {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|x64.ActiveCfg = Debug|Win32 + {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|Mixed Platforms.Build.0 = Release|Win32 {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|Win32.ActiveCfg = Release|Win32 {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|Win32.Build.0 = Release|Win32 {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|x64.ActiveCfg = Release|Win32 + {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|Win32.ActiveCfg = Debug|Win32 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|Win32.Build.0 = Debug|Win32 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|x64.ActiveCfg = Debug|Win32 + {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|Mixed Platforms.Build.0 = Release|Win32 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|Win32.ActiveCfg = Release|Win32 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|Win32.Build.0 = Release|Win32 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|x64.ActiveCfg = Release|Win32 + {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32 {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|Win32.Build.0 = Debug Passthrough|Win32 {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|x64.ActiveCfg = Debug|Win32 + {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|Mixed Platforms.Build.0 = Release|Win32 {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|Win32.ActiveCfg = Release Passthrough|Win32 {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|Win32.Build.0 = Release Passthrough|Win32 {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|x64.ActiveCfg = Release|Win32 + {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|Win32.ActiveCfg = Debug|Win32 {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|Win32.Build.0 = Debug|Win32 {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|x64.ActiveCfg = Debug|Win32 + {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Mixed Platforms.Build.0 = Release|Win32 {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Win32.ActiveCfg = Release|Win32 {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Win32.Build.0 = Release|Win32 {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|x64.ActiveCfg = Release|Win32 + {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Debug|Win32.ActiveCfg = Debug|Win32 {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Debug|Win32.Build.0 = Debug|Win32 {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Debug|x64.ActiveCfg = Debug|Win32 + {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|Mixed Platforms.Build.0 = Release|Win32 {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|Win32.ActiveCfg = Release|Win32 {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|Win32.Build.0 = Release|Win32 {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|x64.ActiveCfg = Release|Win32 + {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|Win32.ActiveCfg = Debug|Win32 {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|Win32.Build.0 = Debug|Win32 {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|x64.ActiveCfg = Debug|Win32 + {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|Mixed Platforms.Build.0 = Release|Win32 {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|Win32.ActiveCfg = Release|Win32 {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|Win32.Build.0 = Release|Win32 {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|x64.ActiveCfg = Release|Win32 + {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Debug|Win32.ActiveCfg = Debug|Win32 {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Debug|Win32.Build.0 = Debug|Win32 {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Debug|x64.ActiveCfg = Debug|Win32 + {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Release|Mixed Platforms.Build.0 = Release|Win32 {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Release|Win32.ActiveCfg = Release|Win32 {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Release|Win32.Build.0 = Release|Win32 {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Release|x64.ActiveCfg = Release|Win32 + {FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|Win32.ActiveCfg = Debug|Win32 {FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|Win32.Build.0 = Debug|Win32 {FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|x64.ActiveCfg = Debug|Win32 + {FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|Mixed Platforms.Build.0 = Release|Win32 {FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|Win32.ActiveCfg = Release|Win32 {FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|Win32.Build.0 = Release|Win32 {FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|x64.ActiveCfg = Release|Win32 + {1A1FF289-4FD6-4285-A422-D31DD67A4723}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {1A1FF289-4FD6-4285-A422-D31DD67A4723}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {1A1FF289-4FD6-4285-A422-D31DD67A4723}.Debug|Win32.ActiveCfg = Debug|Win32 {1A1FF289-4FD6-4285-A422-D31DD67A4723}.Debug|x64.ActiveCfg = Debug|Win32 + {1A1FF289-4FD6-4285-A422-D31DD67A4723}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {1A1FF289-4FD6-4285-A422-D31DD67A4723}.Release|Mixed Platforms.Build.0 = Release|Win32 {1A1FF289-4FD6-4285-A422-D31DD67A4723}.Release|Win32.ActiveCfg = Release|Win32 {1A1FF289-4FD6-4285-A422-D31DD67A4723}.Release|x64.ActiveCfg = Release|Win32 + {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|Win32.ActiveCfg = Debug|Win32 {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|Win32.Build.0 = Debug|Win32 {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|x64.ActiveCfg = Debug|Win32 + {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|Mixed Platforms.Build.0 = Release|Win32 {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|Win32.ActiveCfg = Release|Win32 {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|Win32.Build.0 = Release|Win32 {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|x64.ActiveCfg = Release|Win32 + {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|Win32.ActiveCfg = Debug MS-LDAP|Win32 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|Win32.Build.0 = Debug MS-LDAP|Win32 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|x64.ActiveCfg = Debug|Win32 + {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|Mixed Platforms.Build.0 = Release|Win32 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|Win32.ActiveCfg = Release MS-LDAP|Win32 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|Win32.Build.0 = Release MS-LDAP|Win32 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|x64.ActiveCfg = Release|Win32 + {A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|Win32.ActiveCfg = Debug|Win32 {A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|Win32.Build.0 = Debug|Win32 {A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|x64.ActiveCfg = Debug|Win32 + {A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|Mixed Platforms.Build.0 = Release|Win32 {A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|Win32.ActiveCfg = Release|Win32 {A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|Win32.Build.0 = Release|Win32 {A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|x64.ActiveCfg = Release|Win32 + {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Debug|Win32.ActiveCfg = Debug|Win32 {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Debug|Win32.Build.0 = Debug|Win32 {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Debug|x64.ActiveCfg = Debug|Win32 + {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Release|Mixed Platforms.Build.0 = Release|Win32 {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Release|Win32.ActiveCfg = Release|Win32 {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Release|Win32.Build.0 = Release|Win32 {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Release|x64.ActiveCfg = Release|Win32 + {784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|Win32.ActiveCfg = Debug|Win32 {784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|Win32.Build.0 = Debug|Win32 {784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|x64.ActiveCfg = Debug|Win32 + {784113EF-44D9-4949-835D-7065D3C7AD08}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {784113EF-44D9-4949-835D-7065D3C7AD08}.Release|Mixed Platforms.Build.0 = Release|Win32 {784113EF-44D9-4949-835D-7065D3C7AD08}.Release|Win32.ActiveCfg = Release|Win32 {784113EF-44D9-4949-835D-7065D3C7AD08}.Release|Win32.Build.0 = Release|Win32 {784113EF-44D9-4949-835D-7065D3C7AD08}.Release|x64.ActiveCfg = Release|Win32 + {89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|Win32.ActiveCfg = Debug|Win32 {89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|Win32.Build.0 = Debug|Win32 {89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|x64.ActiveCfg = Debug|Win32 + {89385C74-5860-4174-9CAF-A39E7C48909C}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {89385C74-5860-4174-9CAF-A39E7C48909C}.Release|Mixed Platforms.Build.0 = Release|Win32 {89385C74-5860-4174-9CAF-A39E7C48909C}.Release|Win32.ActiveCfg = Release|Win32 {89385C74-5860-4174-9CAF-A39E7C48909C}.Release|Win32.Build.0 = Release|Win32 {89385C74-5860-4174-9CAF-A39E7C48909C}.Release|x64.ActiveCfg = Release|Win32 + {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|Win32.ActiveCfg = Debug|Win32 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|Win32.Build.0 = Debug|Win32 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|x64.ActiveCfg = Debug|Win32 + {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|Mixed Platforms.Build.0 = Release|Win32 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|Win32.ActiveCfg = Release|Win32 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|Win32.Build.0 = Release|Win32 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|x64.ActiveCfg = Release|Win32 + {692F6330-4D87-4C82-81DF-40DB5892636E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {692F6330-4D87-4C82-81DF-40DB5892636E}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {692F6330-4D87-4C82-81DF-40DB5892636E}.Debug|Win32.ActiveCfg = Debug|Win32 {692F6330-4D87-4C82-81DF-40DB5892636E}.Debug|x64.ActiveCfg = Debug|Win32 + {692F6330-4D87-4C82-81DF-40DB5892636E}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {692F6330-4D87-4C82-81DF-40DB5892636E}.Release|Mixed Platforms.Build.0 = Release|Win32 {692F6330-4D87-4C82-81DF-40DB5892636E}.Release|Win32.ActiveCfg = Release|Win32 {692F6330-4D87-4C82-81DF-40DB5892636E}.Release|x64.ActiveCfg = Release|Win32 + {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Win32.ActiveCfg = Debug|Win32 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Win32.Build.0 = Debug|Win32 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|x64.ActiveCfg = Debug|Win32 + {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|Mixed Platforms.Build.0 = Release|Win32 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|Win32.ActiveCfg = Release|Win32 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|Win32.Build.0 = Release|Win32 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|x64.ActiveCfg = Release|Win32 + {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|Win32.ActiveCfg = Debug|Win32 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|Win32.Build.0 = Debug|Win32 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|x64.ActiveCfg = Debug|Win32 + {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|Mixed Platforms.Build.0 = Release|Win32 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|Win32.ActiveCfg = Release|Win32 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|Win32.Build.0 = Release|Win32 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|x64.ActiveCfg = Release|Win32 + {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|Win32.ActiveCfg = Debug|Win32 {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|Win32.Build.0 = Debug|Win32 {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|x64.ActiveCfg = Debug|Win32 + {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|Mixed Platforms.Build.0 = Release|Win32 {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|Win32.ActiveCfg = Release|Win32 {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|Win32.Build.0 = Release|Win32 {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|x64.ActiveCfg = Release|Win32 + {1C453396-D912-4213-89FD-9B489162B7B5}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {1C453396-D912-4213-89FD-9B489162B7B5}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {1C453396-D912-4213-89FD-9B489162B7B5}.Debug|Win32.ActiveCfg = Debug|Win32 {1C453396-D912-4213-89FD-9B489162B7B5}.Debug|Win32.Build.0 = Debug|Win32 {1C453396-D912-4213-89FD-9B489162B7B5}.Debug|x64.ActiveCfg = Debug|Win32 + {1C453396-D912-4213-89FD-9B489162B7B5}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {1C453396-D912-4213-89FD-9B489162B7B5}.Release|Mixed Platforms.Build.0 = Release|Win32 {1C453396-D912-4213-89FD-9B489162B7B5}.Release|Win32.ActiveCfg = Release|Win32 {1C453396-D912-4213-89FD-9B489162B7B5}.Release|Win32.Build.0 = Release|Win32 {1C453396-D912-4213-89FD-9B489162B7B5}.Release|x64.ActiveCfg = Release|Win32 + {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|Win32.ActiveCfg = Debug|Win32 {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|Win32.Build.0 = Debug|Win32 {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|x64.ActiveCfg = Debug|Win32 + {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|Mixed Platforms.Build.0 = Release|Win32 {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|Win32.ActiveCfg = Release|Win32 {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|Win32.Build.0 = Release|Win32 {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|x64.ActiveCfg = Release|Win32 + {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|Win32.ActiveCfg = Debug|Win32 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|Win32.Build.0 = Debug|Win32 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|x64.ActiveCfg = Debug|Win32 + {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|Mixed Platforms.Build.0 = Release|Win32 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|Win32.ActiveCfg = Release|Win32 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|Win32.Build.0 = Release|Win32 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|x64.ActiveCfg = Release|Win32 + {C24FB505-05D7-4319-8485-7540B44C8603}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {C24FB505-05D7-4319-8485-7540B44C8603}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {C24FB505-05D7-4319-8485-7540B44C8603}.Debug|Win32.ActiveCfg = Debug|Win32 {C24FB505-05D7-4319-8485-7540B44C8603}.Debug|Win32.Build.0 = Debug|Win32 {C24FB505-05D7-4319-8485-7540B44C8603}.Debug|x64.ActiveCfg = Debug|Win32 + {C24FB505-05D7-4319-8485-7540B44C8603}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {C24FB505-05D7-4319-8485-7540B44C8603}.Release|Mixed Platforms.Build.0 = Release|Win32 {C24FB505-05D7-4319-8485-7540B44C8603}.Release|Win32.ActiveCfg = Release|Win32 {C24FB505-05D7-4319-8485-7540B44C8603}.Release|Win32.Build.0 = Release|Win32 {C24FB505-05D7-4319-8485-7540B44C8603}.Release|x64.ActiveCfg = Release|Win32 + {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|Win32.ActiveCfg = Debug|Win32 {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|Win32.Build.0 = Debug|Win32 {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|x64.ActiveCfg = Debug|Win32 + {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|Mixed Platforms.Build.0 = Release|Win32 {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|Win32.ActiveCfg = Release|Win32 {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|Win32.Build.0 = Release|Win32 {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|x64.ActiveCfg = Release|Win32 + {05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|Win32.ActiveCfg = Debug|Win32 {05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|Win32.Build.0 = Debug|Win32 {05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|x64.ActiveCfg = Debug|Win32 + {05515420-16DE-4E63-BE73-85BE85BA5142}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {05515420-16DE-4E63-BE73-85BE85BA5142}.Release|Mixed Platforms.Build.0 = Release|Win32 {05515420-16DE-4E63-BE73-85BE85BA5142}.Release|Win32.ActiveCfg = Release|Win32 {05515420-16DE-4E63-BE73-85BE85BA5142}.Release|Win32.Build.0 = Release|Win32 {05515420-16DE-4E63-BE73-85BE85BA5142}.Release|x64.ActiveCfg = Release|Win32 + {989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Debug|Win32.ActiveCfg = Debug|Win32 {989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Debug|Win32.Build.0 = Debug|Win32 {989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Debug|x64.ActiveCfg = Debug|Win32 + {989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Release|Mixed Platforms.Build.0 = Release|Win32 {989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Release|Win32.ActiveCfg = Release|Win32 {989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Release|Win32.Build.0 = Release|Win32 {989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Release|x64.ActiveCfg = Release|Win32 + {1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|Win32.ActiveCfg = Debug|Win32 {1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|Win32.Build.0 = Debug|Win32 {1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|x64.ActiveCfg = Debug|Win32 + {1906D736-08BD-4EE1-924F-B536249B9A54}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {1906D736-08BD-4EE1-924F-B536249B9A54}.Release|Mixed Platforms.Build.0 = Release|Win32 {1906D736-08BD-4EE1-924F-B536249B9A54}.Release|Win32.ActiveCfg = Release|Win32 {1906D736-08BD-4EE1-924F-B536249B9A54}.Release|Win32.Build.0 = Release|Win32 {1906D736-08BD-4EE1-924F-B536249B9A54}.Release|x64.ActiveCfg = Release|Win32 + {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|Win32.ActiveCfg = Debug|Win32 {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|Win32.Build.0 = Debug|Win32 {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|x64.ActiveCfg = Debug|Win32 + {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Mixed Platforms.Build.0 = Release|Win32 {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Win32.ActiveCfg = Release|Win32 {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Win32.Build.0 = Release|Win32 {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|x64.ActiveCfg = Release|Win32 + {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|Win32.ActiveCfg = Debug|Win32 {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|Win32.Build.0 = Debug|Win32 {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|x64.ActiveCfg = Debug|Win32 + {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|Mixed Platforms.Build.0 = Release|Win32 {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|Win32.ActiveCfg = Release|Win32 {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|Win32.Build.0 = Release|Win32 {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|x64.ActiveCfg = Release|Win32 + {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|Win32.ActiveCfg = Debug|Win32 {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|Win32.Build.0 = Debug|Win32 {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|x64.ActiveCfg = Debug|Win32 + {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|Mixed Platforms.Build.0 = Release|Win32 {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|Win32.ActiveCfg = Release|Win32 {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|Win32.Build.0 = Release|Win32 {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|x64.ActiveCfg = Release|Win32 + {1CED5987-A529-46DC-B30F-870D85FF9C94}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {1CED5987-A529-46DC-B30F-870D85FF9C94}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {1CED5987-A529-46DC-B30F-870D85FF9C94}.Debug|Win32.ActiveCfg = Debug|Win32 {1CED5987-A529-46DC-B30F-870D85FF9C94}.Debug|Win32.Build.0 = Debug|Win32 {1CED5987-A529-46DC-B30F-870D85FF9C94}.Debug|x64.ActiveCfg = Debug|Win32 + {1CED5987-A529-46DC-B30F-870D85FF9C94}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {1CED5987-A529-46DC-B30F-870D85FF9C94}.Release|Mixed Platforms.Build.0 = Release|Win32 {1CED5987-A529-46DC-B30F-870D85FF9C94}.Release|Win32.ActiveCfg = Release|Win32 {1CED5987-A529-46DC-B30F-870D85FF9C94}.Release|Win32.Build.0 = Release|Win32 {1CED5987-A529-46DC-B30F-870D85FF9C94}.Release|x64.ActiveCfg = Release|Win32 + {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Debug|Win32.ActiveCfg = Debug|Win32 {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Debug|Win32.Build.0 = Debug|Win32 {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Debug|x64.ActiveCfg = Debug|Win32 + {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Release|Mixed Platforms.Build.0 = Release|Win32 {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Release|Win32.ActiveCfg = Release|Win32 {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Release|Win32.Build.0 = Release|Win32 {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Release|x64.ActiveCfg = Release|Win32 + {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|Win32.ActiveCfg = Debug|Win32 {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|Win32.Build.0 = Debug|Win32 {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|x64.ActiveCfg = Debug|Win32 + {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|Mixed Platforms.Build.0 = Release|Win32 {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|Win32.ActiveCfg = Release|Win32 {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|Win32.Build.0 = Release|Win32 {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|x64.ActiveCfg = Release|Win32 + {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|Win32.ActiveCfg = Debug|Win32 {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|Win32.Build.0 = Debug|Win32 {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|x64.ActiveCfg = Debug|Win32 + {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|Mixed Platforms.Build.0 = Release|Win32 {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|Win32.ActiveCfg = Release|Win32 {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|Win32.Build.0 = Release|Win32 {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|x64.ActiveCfg = Release|Win32 + {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Debug|Win32.ActiveCfg = Debug|Win32 {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Debug|Win32.Build.0 = Debug|Win32 {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Debug|x64.ActiveCfg = Debug|Win32 + {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Release|Mixed Platforms.Build.0 = Release|Win32 {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Release|Win32.ActiveCfg = Release|Win32 {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Release|Win32.Build.0 = Release|Win32 {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Release|x64.ActiveCfg = Release|Win32 + {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|Win32.ActiveCfg = Debug|Win32 {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|Win32.Build.0 = Debug|Win32 {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|x64.ActiveCfg = Debug|Win32 + {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|Mixed Platforms.Build.0 = Release|Win32 {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|Win32.ActiveCfg = Release|Win32 {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|Win32.Build.0 = Release|Win32 {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|x64.ActiveCfg = Release|Win32 + {5927104D-C14C-4AC8-925C-4AB681762E75}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {5927104D-C14C-4AC8-925C-4AB681762E75}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {5927104D-C14C-4AC8-925C-4AB681762E75}.Debug|Win32.ActiveCfg = Debug|Win32 {5927104D-C14C-4AC8-925C-4AB681762E75}.Debug|Win32.Build.0 = Debug|Win32 {5927104D-C14C-4AC8-925C-4AB681762E75}.Debug|x64.ActiveCfg = Debug|Win32 + {5927104D-C14C-4AC8-925C-4AB681762E75}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {5927104D-C14C-4AC8-925C-4AB681762E75}.Release|Mixed Platforms.Build.0 = Release|Win32 {5927104D-C14C-4AC8-925C-4AB681762E75}.Release|Win32.ActiveCfg = Release|Win32 {5927104D-C14C-4AC8-925C-4AB681762E75}.Release|Win32.Build.0 = Release|Win32 {5927104D-C14C-4AC8-925C-4AB681762E75}.Release|x64.ActiveCfg = Release|Win32 + {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Debug|Win32.ActiveCfg = Debug|Win32 {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Debug|Win32.Build.0 = Debug|Win32 {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Debug|x64.ActiveCfg = Debug|Win32 + {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Release|Mixed Platforms.Build.0 = Release|Win32 {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Release|Win32.ActiveCfg = Release|Win32 {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Release|Win32.Build.0 = Release|Win32 {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Release|x64.ActiveCfg = Release|Win32 + {49C34584-B6DA-448F-83CF-27584DC9FC90}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {49C34584-B6DA-448F-83CF-27584DC9FC90}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {49C34584-B6DA-448F-83CF-27584DC9FC90}.Debug|Win32.ActiveCfg = Debug|Win32 {49C34584-B6DA-448F-83CF-27584DC9FC90}.Debug|Win32.Build.0 = Debug|Win32 {49C34584-B6DA-448F-83CF-27584DC9FC90}.Debug|x64.ActiveCfg = Debug|Win32 + {49C34584-B6DA-448F-83CF-27584DC9FC90}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {49C34584-B6DA-448F-83CF-27584DC9FC90}.Release|Mixed Platforms.Build.0 = Release|Win32 {49C34584-B6DA-448F-83CF-27584DC9FC90}.Release|Win32.ActiveCfg = Release|Win32 {49C34584-B6DA-448F-83CF-27584DC9FC90}.Release|Win32.Build.0 = Release|Win32 {49C34584-B6DA-448F-83CF-27584DC9FC90}.Release|x64.ActiveCfg = Release|Win32 + {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|Win32.ActiveCfg = Debug|Win32 {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|Win32.Build.0 = Debug|Win32 {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|x64.ActiveCfg = Debug|Win32 + {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|Mixed Platforms.Build.0 = Release|Win32 {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|Win32.ActiveCfg = Release|Win32 {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|Win32.Build.0 = Release|Win32 {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|x64.ActiveCfg = Release|Win32 + {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|Win32.ActiveCfg = Debug|Win32 {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|Win32.Build.0 = Debug|Win32 {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|x64.ActiveCfg = Debug|Win32 + {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|Mixed Platforms.Build.0 = Release|Win32 {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|Win32.ActiveCfg = Release|Win32 {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|Win32.Build.0 = Release|Win32 {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|x64.ActiveCfg = Release|Win32 + {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|Win32.ActiveCfg = Debug|Win32 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|Win32.Build.0 = Debug|Win32 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|x64.ActiveCfg = Debug|Win32 + {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|Mixed Platforms.Build.0 = Release|Win32 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|Win32.ActiveCfg = Release|Win32 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|Win32.Build.0 = Release|Win32 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|x64.ActiveCfg = Release|Win32 + {204FA0DE-305D-4414-AE2E-F195A23F390D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {204FA0DE-305D-4414-AE2E-F195A23F390D}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {204FA0DE-305D-4414-AE2E-F195A23F390D}.Debug|Win32.ActiveCfg = Debug|Win32 {204FA0DE-305D-4414-AE2E-F195A23F390D}.Debug|Win32.Build.0 = Debug|Win32 {204FA0DE-305D-4414-AE2E-F195A23F390D}.Debug|x64.ActiveCfg = Debug|Win32 + {204FA0DE-305D-4414-AE2E-F195A23F390D}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {204FA0DE-305D-4414-AE2E-F195A23F390D}.Release|Mixed Platforms.Build.0 = Release|Win32 {204FA0DE-305D-4414-AE2E-F195A23F390D}.Release|Win32.ActiveCfg = Release|Win32 {204FA0DE-305D-4414-AE2E-F195A23F390D}.Release|Win32.Build.0 = Release|Win32 {204FA0DE-305D-4414-AE2E-F195A23F390D}.Release|x64.ActiveCfg = Release|Win32 + {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|Win32.ActiveCfg = Debug|Win32 {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|Win32.Build.0 = Debug|Win32 {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|x64.ActiveCfg = Debug|Win32 + {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|Mixed Platforms.Build.0 = Release|Win32 {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|Win32.ActiveCfg = Release|Win32 {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|Win32.Build.0 = Release|Win32 {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|x64.ActiveCfg = Release|Win32 + {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Win32.ActiveCfg = Debug|Win32 {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Win32.Build.0 = Debug|Win32 {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|x64.ActiveCfg = Debug|Win32 + {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|Mixed Platforms.Build.0 = Release|Win32 {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|Win32.ActiveCfg = Release|Win32 {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|Win32.Build.0 = Release|Win32 {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|x64.ActiveCfg = Release|Win32 + {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|Win32.ActiveCfg = Debug|Win32 {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|Win32.Build.0 = Debug|Win32 {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|x64.ActiveCfg = Debug|Win32 + {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|Mixed Platforms.Build.0 = Release|Win32 {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|Win32.ActiveCfg = Release|Win32 {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|Win32.Build.0 = Release|Win32 {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|x64.ActiveCfg = Release|Win32 + {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Win32.ActiveCfg = Debug DLL|Win32 {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Win32.Build.0 = Debug DLL|Win32 {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|x64.ActiveCfg = Debug DLL|Win32 + {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|Mixed Platforms.Build.0 = Release|Win32 {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|Win32.ActiveCfg = Release DLL|Win32 {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|Win32.Build.0 = Release DLL|Win32 {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|x64.ActiveCfg = Release|Win32 + {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32 {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|Win32.Build.0 = Debug Passthrough|Win32 {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|x64.ActiveCfg = Debug|Win32 + {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|Mixed Platforms.Build.0 = Release|Win32 {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|Win32.ActiveCfg = Release Passthrough|Win32 {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|Win32.Build.0 = Release Passthrough|Win32 {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|x64.ActiveCfg = Release|Win32 + {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|Win32.ActiveCfg = Debug|Win32 {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|Win32.Build.0 = Debug|Win32 {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|x64.ActiveCfg = Debug|Win32 + {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|Mixed Platforms.Build.0 = Release|Win32 {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|Win32.ActiveCfg = Release|Win32 {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|Win32.Build.0 = Release|Win32 {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|x64.ActiveCfg = Release|Win32 + {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|Win32.ActiveCfg = Debug|Win32 {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|Win32.Build.0 = Debug|Win32 {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|x64.ActiveCfg = Debug|Win32 + {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|Mixed Platforms.Build.0 = Release|Win32 {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|Win32.ActiveCfg = Release|Win32 {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|Win32.Build.0 = Release|Win32 {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|x64.ActiveCfg = Release|Win32 + {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|Win32.ActiveCfg = Debug|Win32 {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|Win32.Build.0 = Debug|Win32 {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|x64.ActiveCfg = Debug|Win32 + {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|Mixed Platforms.Build.0 = Release|Win32 {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|Win32.ActiveCfg = Release|Win32 {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|Win32.Build.0 = Release|Win32 {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|x64.ActiveCfg = Release|Win32 + {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|Win32.ActiveCfg = Debug|Win32 {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|Win32.Build.0 = Debug|Win32 {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|x64.ActiveCfg = Debug|Win32 + {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|Mixed Platforms.Build.0 = Release|Win32 {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|Win32.ActiveCfg = Release|Win32 {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|Win32.Build.0 = Release|Win32 {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|x64.ActiveCfg = Release|Win32 + {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|Win32.ActiveCfg = Debug|Win32 {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|Win32.Build.0 = Debug|Win32 {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|x64.ActiveCfg = Debug|Win32 + {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|Mixed Platforms.Build.0 = Release|Win32 {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|Win32.ActiveCfg = Release|Win32 {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|Win32.Build.0 = Release|Win32 {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|x64.ActiveCfg = Release|Win32 + {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|Win32.ActiveCfg = Debug|Win32 {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|Win32.Build.0 = Debug|Win32 {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|x64.ActiveCfg = Debug|Win32 + {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|Mixed Platforms.Build.0 = Release|Win32 {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|Win32.ActiveCfg = Release|Win32 {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|Win32.Build.0 = Release|Win32 {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|x64.ActiveCfg = Release|Win32 + {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|Win32.ActiveCfg = Debug|Win32 {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|Win32.Build.0 = Debug|Win32 {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|x64.ActiveCfg = Debug|Win32 + {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|Mixed Platforms.Build.0 = Release|Win32 {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|Win32.ActiveCfg = Release|Win32 {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|Win32.Build.0 = Release|Win32 {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|x64.ActiveCfg = Release|Win32 + {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|Win32.ActiveCfg = Debug|Win32 {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|Win32.Build.0 = Debug|Win32 {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|x64.ActiveCfg = Debug|Win32 + {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|Mixed Platforms.Build.0 = Release|Win32 {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|Win32.ActiveCfg = Release|Win32 {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|Win32.Build.0 = Release|Win32 {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|x64.ActiveCfg = Release|Win32 + {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 + {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Mixed Platforms.Build.0 = Debug|x64 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.ActiveCfg = Debug|Win32 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.Build.0 = Debug|Win32 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.ActiveCfg = Debug|Win32 + {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Mixed Platforms.ActiveCfg = Release|x64 + {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Mixed Platforms.Build.0 = Release|x64 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.ActiveCfg = Release|Win32 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.Build.0 = Release|Win32 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.ActiveCfg = Release|Win32 + {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|Win32.ActiveCfg = Debug|Win32 {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|Win32.Build.0 = Debug|Win32 {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|x64.ActiveCfg = Debug|Win32 + {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|Mixed Platforms.Build.0 = Release|Win32 {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|Win32.ActiveCfg = Release|Win32 {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|Win32.Build.0 = Release|Win32 {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|x64.ActiveCfg = Release|Win32 + {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32 {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|Win32.Build.0 = Debug Passthrough|Win32 {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|x64.ActiveCfg = Debug|Win32 + {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|Mixed Platforms.Build.0 = Release|Win32 {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|Win32.ActiveCfg = Release Passthrough|Win32 {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|Win32.Build.0 = Release Passthrough|Win32 {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|x64.ActiveCfg = Release|Win32 + {2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|Win32.ActiveCfg = Debug|Win32 {2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|Win32.Build.0 = Debug|Win32 {2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|x64.ActiveCfg = Debug|Win32 + {2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|Mixed Platforms.Build.0 = Release|Win32 {2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|Win32.ActiveCfg = Release|Win32 {2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|Win32.Build.0 = Release|Win32 {2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|x64.ActiveCfg = Release|Win32 + {3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|Win32.ActiveCfg = Debug|Win32 {3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|Win32.Build.0 = Debug|Win32 {3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|x64.ActiveCfg = Debug|Win32 + {3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|Mixed Platforms.Build.0 = Release|Win32 {3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|Win32.ActiveCfg = Release|Win32 {3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|Win32.Build.0 = Release|Win32 {3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|x64.ActiveCfg = Release|Win32 + {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|Win32.ActiveCfg = Debug|Win32 {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|Win32.Build.0 = Debug|Win32 {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|x64.ActiveCfg = Debug|Win32 + {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|Mixed Platforms.Build.0 = Release|Win32 {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|Win32.ActiveCfg = Release|Win32 {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|Win32.Build.0 = Release|Win32 {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|x64.ActiveCfg = Release|Win32 + {AA91F0AC-6562-435E-814C-5C94689FEFA2}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {AA91F0AC-6562-435E-814C-5C94689FEFA2}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {AA91F0AC-6562-435E-814C-5C94689FEFA2}.Debug|Win32.ActiveCfg = Debug|Win32 {AA91F0AC-6562-435E-814C-5C94689FEFA2}.Debug|Win32.Build.0 = Debug|Win32 {AA91F0AC-6562-435E-814C-5C94689FEFA2}.Debug|x64.ActiveCfg = Debug|Win32 + {AA91F0AC-6562-435E-814C-5C94689FEFA2}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {AA91F0AC-6562-435E-814C-5C94689FEFA2}.Release|Mixed Platforms.Build.0 = Release|Win32 {AA91F0AC-6562-435E-814C-5C94689FEFA2}.Release|Win32.ActiveCfg = Release|Win32 {AA91F0AC-6562-435E-814C-5C94689FEFA2}.Release|Win32.Build.0 = Release|Win32 {AA91F0AC-6562-435E-814C-5C94689FEFA2}.Release|x64.ActiveCfg = Release|Win32 + {829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Debug|Win32.ActiveCfg = Debug|Win32 {829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Debug|Win32.Build.0 = Debug|Win32 {829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Debug|x64.ActiveCfg = Debug|Win32 + {829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Release|Mixed Platforms.Build.0 = Release|Win32 {829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Release|Win32.ActiveCfg = Release|Win32 {829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Release|Win32.Build.0 = Release|Win32 {829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Release|x64.ActiveCfg = Release|Win32 + {EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Debug|Win32.ActiveCfg = Debug|Win32 {EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Debug|Win32.Build.0 = Debug|Win32 {EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Debug|x64.ActiveCfg = Debug|Win32 + {EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Release|Mixed Platforms.Build.0 = Release|Win32 {EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Release|Win32.ActiveCfg = Release|Win32 {EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Release|Win32.Build.0 = Release|Win32 {EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Release|x64.ActiveCfg = Release|Win32 + {9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Debug|Win32.ActiveCfg = Debug|Win32 {9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Debug|Win32.Build.0 = Debug|Win32 {9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Debug|x64.ActiveCfg = Debug|Win32 + {9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Release|Mixed Platforms.Build.0 = Release|Win32 {9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Release|Win32.ActiveCfg = Release|Win32 {9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Release|Win32.Build.0 = Release|Win32 {9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Release|x64.ActiveCfg = Release|Win32 + {CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Debug|Win32.ActiveCfg = Debug Static|Win32 {CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Debug|Win32.Build.0 = Debug Static|Win32 {CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Debug|x64.ActiveCfg = Debug|Win32 + {CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Release|Mixed Platforms.Build.0 = Release|Win32 {CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Release|Win32.ActiveCfg = Release Static|Win32 {CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Release|Win32.Build.0 = Release Static|Win32 {CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Release|x64.ActiveCfg = Release|Win32 + {819C7242-6184-46FE-BC7B-C7E25C0581EE}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {819C7242-6184-46FE-BC7B-C7E25C0581EE}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {819C7242-6184-46FE-BC7B-C7E25C0581EE}.Debug|Win32.ActiveCfg = Debug Static|Win32 {819C7242-6184-46FE-BC7B-C7E25C0581EE}.Debug|Win32.Build.0 = Debug Static|Win32 {819C7242-6184-46FE-BC7B-C7E25C0581EE}.Debug|x64.ActiveCfg = Debug|Win32 + {819C7242-6184-46FE-BC7B-C7E25C0581EE}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {819C7242-6184-46FE-BC7B-C7E25C0581EE}.Release|Mixed Platforms.Build.0 = Release|Win32 {819C7242-6184-46FE-BC7B-C7E25C0581EE}.Release|Win32.ActiveCfg = Release Static|Win32 {819C7242-6184-46FE-BC7B-C7E25C0581EE}.Release|Win32.Build.0 = Release Static|Win32 {819C7242-6184-46FE-BC7B-C7E25C0581EE}.Release|x64.ActiveCfg = Release|Win32 + {FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Debug|Win32.ActiveCfg = Debug|Win32 {FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Debug|Win32.Build.0 = Debug|Win32 {FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Debug|x64.ActiveCfg = Debug|Win32 + {FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Release|Mixed Platforms.Build.0 = Release|Win32 {FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Release|Win32.ActiveCfg = Release|Win32 {FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Release|Win32.Build.0 = Release|Win32 {FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Release|x64.ActiveCfg = Release|Win32 + {A407B661-D7DC-4E30-B268-FFF3296C35E6}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {A407B661-D7DC-4E30-B268-FFF3296C35E6}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {A407B661-D7DC-4E30-B268-FFF3296C35E6}.Debug|Win32.ActiveCfg = Debug|Win32 {A407B661-D7DC-4E30-B268-FFF3296C35E6}.Debug|Win32.Build.0 = Debug|Win32 {A407B661-D7DC-4E30-B268-FFF3296C35E6}.Debug|x64.ActiveCfg = Debug|Win32 + {A407B661-D7DC-4E30-B268-FFF3296C35E6}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {A407B661-D7DC-4E30-B268-FFF3296C35E6}.Release|Mixed Platforms.Build.0 = Release|Win32 {A407B661-D7DC-4E30-B268-FFF3296C35E6}.Release|Win32.ActiveCfg = Release|Win32 {A407B661-D7DC-4E30-B268-FFF3296C35E6}.Release|Win32.Build.0 = Release|Win32 {A407B661-D7DC-4E30-B268-FFF3296C35E6}.Release|x64.ActiveCfg = Release|Win32 + {E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Debug|Win32.ActiveCfg = Debug|Win32 {E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Debug|Win32.Build.0 = Debug|Win32 {E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Debug|x64.ActiveCfg = Debug|Win32 + {E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Release|Mixed Platforms.Build.0 = Release|Win32 {E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Release|Win32.ActiveCfg = Release|Win32 {E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Release|Win32.Build.0 = Release|Win32 {E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Release|x64.ActiveCfg = Release|Win32 + {028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|Win32.ActiveCfg = Debug|Win32 {028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|Win32.Build.0 = Debug|Win32 {028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|x64.ActiveCfg = Debug|Win32 + {028C7278-05D7-4E18-82FE-BE231B844F41}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {028C7278-05D7-4E18-82FE-BE231B844F41}.Release|Mixed Platforms.Build.0 = Release|Win32 {028C7278-05D7-4E18-82FE-BE231B844F41}.Release|Win32.ActiveCfg = Release|Win32 {028C7278-05D7-4E18-82FE-BE231B844F41}.Release|Win32.Build.0 = Release|Win32 {028C7278-05D7-4E18-82FE-BE231B844F41}.Release|x64.ActiveCfg = Release|Win32 + {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Debug|Win32.ActiveCfg = Debug|Win32 {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Debug|Win32.Build.0 = Debug|Win32 {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Debug|x64.ActiveCfg = Debug|Win32 + {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Release|Mixed Platforms.Build.0 = Release|Win32 {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Release|Win32.ActiveCfg = Release|Win32 {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Release|Win32.Build.0 = Release|Win32 {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Release|x64.ActiveCfg = Release|Win32 + {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Debug|Win32.ActiveCfg = Debug|Win32 {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Debug|Win32.Build.0 = Debug|Win32 {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Debug|x64.ActiveCfg = Debug|Win32 + {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Release|Mixed Platforms.Build.0 = Release|Win32 {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Release|Win32.ActiveCfg = Release|Win32 {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Release|Win32.Build.0 = Release|Win32 {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Release|x64.ActiveCfg = Release|Win32 + {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Debug|Win32.ActiveCfg = Debug|Win32 {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Debug|Win32.Build.0 = Debug|Win32 {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Debug|x64.ActiveCfg = Debug|Win32 + {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Release|Mixed Platforms.Build.0 = Release|Win32 {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Release|Win32.ActiveCfg = Release|Win32 {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Release|Win32.Build.0 = Release|Win32 {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Release|x64.ActiveCfg = Release|Win32 + {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Debug|Win32.ActiveCfg = Debug|Win32 {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Debug|Win32.Build.0 = Debug|Win32 {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Debug|x64.ActiveCfg = Debug|Win32 + {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Release|Mixed Platforms.Build.0 = Release|Win32 {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Release|Win32.ActiveCfg = Release|Win32 {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Release|Win32.Build.0 = Release|Win32 {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Release|x64.ActiveCfg = Release|Win32 + {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Debug|Win32.ActiveCfg = Debug|Win32 {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Debug|Win32.Build.0 = Debug|Win32 {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Debug|x64.ActiveCfg = Debug|Win32 + {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Release|Mixed Platforms.Build.0 = Release|Win32 {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Release|Win32.ActiveCfg = Release|Win32 {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Release|Win32.Build.0 = Release|Win32 {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Release|x64.ActiveCfg = Release|Win32 + {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Debug|Win32.ActiveCfg = Debug|Win32 {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Debug|Win32.Build.0 = Debug|Win32 {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Debug|x64.ActiveCfg = Debug|Win32 + {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Release|Mixed Platforms.Build.0 = Release|Win32 {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Release|Win32.ActiveCfg = Release|Win32 {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Release|Win32.Build.0 = Release|Win32 {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Release|x64.ActiveCfg = Release|Win32 + {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Debug|Win32.ActiveCfg = Debug|Win32 {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Debug|Win32.Build.0 = Debug|Win32 {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Debug|x64.ActiveCfg = Debug|Win32 + {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Release|Mixed Platforms.Build.0 = Release|Win32 {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Release|Win32.ActiveCfg = Release|Win32 {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Release|Win32.Build.0 = Release|Win32 {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Release|x64.ActiveCfg = Release|Win32 + {F6A33240-8F29-48BD-98F0-826995911799}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {F6A33240-8F29-48BD-98F0-826995911799}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {F6A33240-8F29-48BD-98F0-826995911799}.Debug|Win32.ActiveCfg = Debug|Win32 {F6A33240-8F29-48BD-98F0-826995911799}.Debug|Win32.Build.0 = Debug|Win32 {F6A33240-8F29-48BD-98F0-826995911799}.Debug|x64.ActiveCfg = Debug|Win32 + {F6A33240-8F29-48BD-98F0-826995911799}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {F6A33240-8F29-48BD-98F0-826995911799}.Release|Mixed Platforms.Build.0 = Release|Win32 {F6A33240-8F29-48BD-98F0-826995911799}.Release|Win32.ActiveCfg = Release|Win32 {F6A33240-8F29-48BD-98F0-826995911799}.Release|Win32.Build.0 = Release|Win32 {F6A33240-8F29-48BD-98F0-826995911799}.Release|x64.ActiveCfg = Release|Win32 + {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Debug|Win32.ActiveCfg = Debug|Win32 {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Debug|Win32.Build.0 = Debug|Win32 {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Debug|x64.ActiveCfg = Debug|Win32 + {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Release|Mixed Platforms.Build.0 = Release|Win32 {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Release|Win32.ActiveCfg = Release|Win32 {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Release|Win32.Build.0 = Release|Win32 {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Release|x64.ActiveCfg = Release|Win32 + {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|Win32.ActiveCfg = Debug|Win32 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|Win32.Build.0 = Debug|Win32 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|x64.ActiveCfg = Debug|Win32 + {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Release|Mixed Platforms.Build.0 = Release|Win32 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Release|Win32.ActiveCfg = Release|Win32 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Release|Win32.Build.0 = Release|Win32 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Release|x64.ActiveCfg = Release|Win32 + {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Debug|Win32.ActiveCfg = Debug|Win32 {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Debug|Win32.Build.0 = Debug|Win32 {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Debug|x64.ActiveCfg = Debug|Win32 + {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Release|Mixed Platforms.Build.0 = Release|Win32 {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Release|Win32.ActiveCfg = Release|Win32 {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Release|Win32.Build.0 = Release|Win32 {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Release|x64.ActiveCfg = Release|Win32 + {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Debug|Win32.ActiveCfg = Debug|Win32 {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Debug|Win32.Build.0 = Debug|Win32 {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Debug|x64.ActiveCfg = Debug|Win32 + {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Release|Mixed Platforms.Build.0 = Release|Win32 {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Release|Win32.ActiveCfg = Release|Win32 {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Release|Win32.Build.0 = Release|Win32 {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Release|x64.ActiveCfg = Release|Win32 + {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Debug|Win32.ActiveCfg = Debug|Win32 {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Debug|Win32.Build.0 = Debug|Win32 {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Debug|x64.ActiveCfg = Debug|Win32 + {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|Mixed Platforms.Build.0 = Release|Win32 {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|Win32.ActiveCfg = Release|Win32 {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|Win32.Build.0 = Release|Win32 {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|x64.ActiveCfg = Release|Win32 + {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|Win32.ActiveCfg = Debug|Win32 {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|Win32.Build.0 = Debug|Win32 {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|x64.ActiveCfg = Debug|Win32 + {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|Mixed Platforms.Build.0 = Release|Win32 {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|Win32.ActiveCfg = Release|Win32 {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|Win32.Build.0 = Release|Win32 {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|x64.ActiveCfg = Release|Win32 + {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.Debug|Win32.ActiveCfg = Debug|Win32 {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.Debug|Win32.Build.0 = Debug|Win32 {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.Debug|x64.ActiveCfg = Debug|Win32 + {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.Release|Mixed Platforms.Build.0 = Release|Win32 {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.Release|Win32.ActiveCfg = Release|Win32 {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.Release|Win32.Build.0 = Release|Win32 {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.Release|x64.ActiveCfg = Release|Win32 + {13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Debug|Win32.ActiveCfg = Debug|Win32 {13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Debug|Win32.Build.0 = Debug|Win32 {13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Debug|x64.ActiveCfg = Debug|Win32 + {13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Release|Mixed Platforms.Build.0 = Release|Win32 {13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Release|Win32.ActiveCfg = Release|Win32 {13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Release|Win32.Build.0 = Release|Win32 {13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Release|x64.ActiveCfg = Release|Win32 + {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Debug|Win32.ActiveCfg = Debug|Win32 {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Debug|Win32.Build.0 = Debug|Win32 {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Debug|x64.ActiveCfg = Debug|Win32 + {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Release|Mixed Platforms.Build.0 = Release|Win32 {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Release|Win32.ActiveCfg = Release|Win32 {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Release|Win32.Build.0 = Release|Win32 {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Release|x64.ActiveCfg = Release|Win32 + {36E854E3-CE12-4348-A125-CCF3F9D74813}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {36E854E3-CE12-4348-A125-CCF3F9D74813}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {36E854E3-CE12-4348-A125-CCF3F9D74813}.Debug|Win32.ActiveCfg = Debug|Win32 {36E854E3-CE12-4348-A125-CCF3F9D74813}.Debug|Win32.Build.0 = Debug|Win32 {36E854E3-CE12-4348-A125-CCF3F9D74813}.Debug|x64.ActiveCfg = Debug|Win32 + {36E854E3-CE12-4348-A125-CCF3F9D74813}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {36E854E3-CE12-4348-A125-CCF3F9D74813}.Release|Mixed Platforms.Build.0 = Release|Win32 {36E854E3-CE12-4348-A125-CCF3F9D74813}.Release|Win32.ActiveCfg = Release|Win32 {36E854E3-CE12-4348-A125-CCF3F9D74813}.Release|Win32.Build.0 = Release|Win32 {36E854E3-CE12-4348-A125-CCF3F9D74813}.Release|x64.ActiveCfg = Release|Win32 + {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|Win32.ActiveCfg = Debug|Win32 {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|Win32.Build.0 = Debug|Win32 {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|x64.ActiveCfg = Debug|Win32 + {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|Mixed Platforms.Build.0 = Release|Win32 {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|Win32.ActiveCfg = Release|Win32 {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|Win32.Build.0 = Release|Win32 {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|x64.ActiveCfg = Release|Win32 + {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Debug|Win32.ActiveCfg = Debug|Win32 {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Debug|Win32.Build.0 = Debug|Win32 {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Debug|x64.ActiveCfg = Debug|Win32 + {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Release|Mixed Platforms.Build.0 = Release|Win32 {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Release|Win32.ActiveCfg = Release|Win32 {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Release|Win32.Build.0 = Release|Win32 {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Release|x64.ActiveCfg = Release|Win32 + {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Debug|Win32.ActiveCfg = Debug|Win32 {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Debug|Win32.Build.0 = Debug|Win32 {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Debug|x64.ActiveCfg = Debug|Win32 + {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Release|Mixed Platforms.Build.0 = Release|Win32 {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Release|Win32.ActiveCfg = Release|Win32 {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Release|Win32.Build.0 = Release|Win32 {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Release|x64.ActiveCfg = Release|Win32 + {0D108721-EAE8-4BAF-8102-D8960EC93647}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {0D108721-EAE8-4BAF-8102-D8960EC93647}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {0D108721-EAE8-4BAF-8102-D8960EC93647}.Debug|Win32.ActiveCfg = Debug|Win32 {0D108721-EAE8-4BAF-8102-D8960EC93647}.Debug|Win32.Build.0 = Debug|Win32 {0D108721-EAE8-4BAF-8102-D8960EC93647}.Debug|x64.ActiveCfg = Debug|Win32 + {0D108721-EAE8-4BAF-8102-D8960EC93647}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {0D108721-EAE8-4BAF-8102-D8960EC93647}.Release|Mixed Platforms.Build.0 = Release|Win32 {0D108721-EAE8-4BAF-8102-D8960EC93647}.Release|Win32.ActiveCfg = Release|Win32 {0D108721-EAE8-4BAF-8102-D8960EC93647}.Release|Win32.Build.0 = Release|Win32 {0D108721-EAE8-4BAF-8102-D8960EC93647}.Release|x64.ActiveCfg = Release|Win32 + {B535402E-38D2-4D54-8360-423ACBD17192}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {B535402E-38D2-4D54-8360-423ACBD17192}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {B535402E-38D2-4D54-8360-423ACBD17192}.Debug|Win32.ActiveCfg = Debug|Win32 {B535402E-38D2-4D54-8360-423ACBD17192}.Debug|Win32.Build.0 = Debug|Win32 {B535402E-38D2-4D54-8360-423ACBD17192}.Debug|x64.ActiveCfg = Debug|Win32 + {B535402E-38D2-4D54-8360-423ACBD17192}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {B535402E-38D2-4D54-8360-423ACBD17192}.Release|Mixed Platforms.Build.0 = Release|Win32 {B535402E-38D2-4D54-8360-423ACBD17192}.Release|Win32.ActiveCfg = Release|Win32 {B535402E-38D2-4D54-8360-423ACBD17192}.Release|Win32.Build.0 = Release|Win32 {B535402E-38D2-4D54-8360-423ACBD17192}.Release|x64.ActiveCfg = Release|Win32 + {4F92B672-DADB-4047-8D6A-4BB3796733FD}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {4F92B672-DADB-4047-8D6A-4BB3796733FD}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {4F92B672-DADB-4047-8D6A-4BB3796733FD}.Debug|Win32.ActiveCfg = Debug|Win32 {4F92B672-DADB-4047-8D6A-4BB3796733FD}.Debug|Win32.Build.0 = Debug|Win32 {4F92B672-DADB-4047-8D6A-4BB3796733FD}.Debug|x64.ActiveCfg = Debug|Win32 + {4F92B672-DADB-4047-8D6A-4BB3796733FD}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {4F92B672-DADB-4047-8D6A-4BB3796733FD}.Release|Mixed Platforms.Build.0 = Release|Win32 {4F92B672-DADB-4047-8D6A-4BB3796733FD}.Release|Win32.ActiveCfg = Release|Win32 {4F92B672-DADB-4047-8D6A-4BB3796733FD}.Release|Win32.Build.0 = Release|Win32 {4F92B672-DADB-4047-8D6A-4BB3796733FD}.Release|x64.ActiveCfg = Release|Win32 + {2DEE4895-1134-439C-B688-52203E57D878}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {2DEE4895-1134-439C-B688-52203E57D878}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {2DEE4895-1134-439C-B688-52203E57D878}.Debug|Win32.ActiveCfg = Debug|Win32 {2DEE4895-1134-439C-B688-52203E57D878}.Debug|Win32.Build.0 = Debug|Win32 {2DEE4895-1134-439C-B688-52203E57D878}.Debug|x64.ActiveCfg = Debug|Win32 + {2DEE4895-1134-439C-B688-52203E57D878}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {2DEE4895-1134-439C-B688-52203E57D878}.Release|Mixed Platforms.Build.0 = Release|Win32 {2DEE4895-1134-439C-B688-52203E57D878}.Release|Win32.ActiveCfg = Release|Win32 {2DEE4895-1134-439C-B688-52203E57D878}.Release|Win32.Build.0 = Release|Win32 {2DEE4895-1134-439C-B688-52203E57D878}.Release|x64.ActiveCfg = Release|Win32 + {AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Debug|Win32.ActiveCfg = Debug|Win32 {AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Debug|Win32.Build.0 = Debug|Win32 {AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Debug|x64.ActiveCfg = Debug|Win32 + {AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Release|Mixed Platforms.Build.0 = Release|Win32 {AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Release|Win32.ActiveCfg = Release|Win32 {AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Release|Win32.Build.0 = Release|Win32 {AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Release|x64.ActiveCfg = Release|Win32 + {2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Debug|Win32.ActiveCfg = Debug|Win32 {2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Debug|Win32.Build.0 = Debug|Win32 {2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Debug|x64.ActiveCfg = Debug|Win32 + {2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Release|Mixed Platforms.Build.0 = Release|Win32 {2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Release|Win32.ActiveCfg = Release|Win32 {2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Release|Win32.Build.0 = Release|Win32 {2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Release|x64.ActiveCfg = Release|Win32 + {94001A0E-A837-445C-8004-F918F10D0226}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {94001A0E-A837-445C-8004-F918F10D0226}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {94001A0E-A837-445C-8004-F918F10D0226}.Debug|Win32.ActiveCfg = Debug|Win32 {94001A0E-A837-445C-8004-F918F10D0226}.Debug|Win32.Build.0 = Debug|Win32 {94001A0E-A837-445C-8004-F918F10D0226}.Debug|x64.ActiveCfg = Debug|Win32 + {94001A0E-A837-445C-8004-F918F10D0226}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {94001A0E-A837-445C-8004-F918F10D0226}.Release|Mixed Platforms.Build.0 = Release|Win32 {94001A0E-A837-445C-8004-F918F10D0226}.Release|Win32.ActiveCfg = Release|Win32 {94001A0E-A837-445C-8004-F918F10D0226}.Release|Win32.Build.0 = Release|Win32 {94001A0E-A837-445C-8004-F918F10D0226}.Release|x64.ActiveCfg = Release|Win32 + {2286DA73-9FC5-45BC-A508-85994C3317AB}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {2286DA73-9FC5-45BC-A508-85994C3317AB}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {2286DA73-9FC5-45BC-A508-85994C3317AB}.Debug|Win32.ActiveCfg = Debug|Win32 {2286DA73-9FC5-45BC-A508-85994C3317AB}.Debug|Win32.Build.0 = Debug|Win32 {2286DA73-9FC5-45BC-A508-85994C3317AB}.Debug|x64.ActiveCfg = Debug|Win32 + {2286DA73-9FC5-45BC-A508-85994C3317AB}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {2286DA73-9FC5-45BC-A508-85994C3317AB}.Release|Mixed Platforms.Build.0 = Release|Win32 {2286DA73-9FC5-45BC-A508-85994C3317AB}.Release|Win32.ActiveCfg = Release|Win32 {2286DA73-9FC5-45BC-A508-85994C3317AB}.Release|Win32.Build.0 = Release|Win32 {2286DA73-9FC5-45BC-A508-85994C3317AB}.Release|x64.ActiveCfg = Release|Win32 + {3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Debug|Win32.ActiveCfg = Debug|Win32 {3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Debug|Win32.Build.0 = Debug|Win32 {3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Debug|x64.ActiveCfg = Debug|Win32 + {3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Release|Mixed Platforms.Build.0 = Release|Win32 {3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Release|Win32.ActiveCfg = Release|Win32 {3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Release|Win32.Build.0 = Release|Win32 {3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Release|x64.ActiveCfg = Release|Win32 + {87A1FE3D-F410-4C8E-9591-8C625985BC70}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {87A1FE3D-F410-4C8E-9591-8C625985BC70}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {87A1FE3D-F410-4C8E-9591-8C625985BC70}.Debug|Win32.ActiveCfg = Debug|Win32 {87A1FE3D-F410-4C8E-9591-8C625985BC70}.Debug|x64.ActiveCfg = Debug|Win32 + {87A1FE3D-F410-4C8E-9591-8C625985BC70}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {87A1FE3D-F410-4C8E-9591-8C625985BC70}.Release|Mixed Platforms.Build.0 = Release|Win32 {87A1FE3D-F410-4C8E-9591-8C625985BC70}.Release|Win32.ActiveCfg = Release|Win32 {87A1FE3D-F410-4C8E-9591-8C625985BC70}.Release|x64.ActiveCfg = Release|Win32 + {7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Debug|Win32.ActiveCfg = Debug|Win32 {7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Debug|Win32.Build.0 = Debug|Win32 {7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Debug|x64.ActiveCfg = Debug|Win32 + {7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Release|Mixed Platforms.Build.0 = Release|Win32 {7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Release|Win32.ActiveCfg = Release|Win32 {7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Release|Win32.Build.0 = Release|Win32 {7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Release|x64.ActiveCfg = Release|Win32 + {7EB71250-F002-4ED8-92CA-CA218114537A}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {7EB71250-F002-4ED8-92CA-CA218114537A}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {7EB71250-F002-4ED8-92CA-CA218114537A}.Debug|Win32.ActiveCfg = Debug|Win32 {7EB71250-F002-4ED8-92CA-CA218114537A}.Debug|x64.ActiveCfg = Debug|Win32 + {7EB71250-F002-4ED8-92CA-CA218114537A}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {7EB71250-F002-4ED8-92CA-CA218114537A}.Release|Mixed Platforms.Build.0 = Release|Win32 {7EB71250-F002-4ED8-92CA-CA218114537A}.Release|Win32.ActiveCfg = Release|Win32 {7EB71250-F002-4ED8-92CA-CA218114537A}.Release|x64.ActiveCfg = Release|Win32 + {6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Debug|Win32.ActiveCfg = Debug|Win32 {6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Debug|x64.ActiveCfg = Debug|Win32 + {6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Release|Mixed Platforms.Build.0 = Release|Win32 {6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Release|Win32.ActiveCfg = Release|Win32 {6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Release|x64.ActiveCfg = Release|Win32 + {464AAB78-5489-4916-BE51-BF8D61822311}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {464AAB78-5489-4916-BE51-BF8D61822311}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {464AAB78-5489-4916-BE51-BF8D61822311}.Debug|Win32.ActiveCfg = Debug|Win32 {464AAB78-5489-4916-BE51-BF8D61822311}.Debug|x64.ActiveCfg = Debug|Win32 + {464AAB78-5489-4916-BE51-BF8D61822311}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {464AAB78-5489-4916-BE51-BF8D61822311}.Release|Mixed Platforms.Build.0 = Release|Win32 {464AAB78-5489-4916-BE51-BF8D61822311}.Release|Win32.ActiveCfg = Release|Win32 {464AAB78-5489-4916-BE51-BF8D61822311}.Release|x64.ActiveCfg = Release|Win32 + {0AD1177E-1FD8-4643-9391-431467A11084}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {0AD1177E-1FD8-4643-9391-431467A11084}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {0AD1177E-1FD8-4643-9391-431467A11084}.Debug|Win32.ActiveCfg = Debug|Win32 {0AD1177E-1FD8-4643-9391-431467A11084}.Debug|Win32.Build.0 = Debug|Win32 {0AD1177E-1FD8-4643-9391-431467A11084}.Debug|x64.ActiveCfg = Debug|Win32 + {0AD1177E-1FD8-4643-9391-431467A11084}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {0AD1177E-1FD8-4643-9391-431467A11084}.Release|Mixed Platforms.Build.0 = Release|Win32 {0AD1177E-1FD8-4643-9391-431467A11084}.Release|Win32.ActiveCfg = Release|Win32 {0AD1177E-1FD8-4643-9391-431467A11084}.Release|Win32.Build.0 = Release|Win32 {0AD1177E-1FD8-4643-9391-431467A11084}.Release|x64.ActiveCfg = Release|Win32 + {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Debug|Win32.ActiveCfg = Debug|Win32 {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Debug|Win32.Build.0 = Debug|Win32 {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Debug|x64.ActiveCfg = Debug|Win32 + {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Release|Mixed Platforms.Build.0 = Release|Win32 {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Release|Win32.ActiveCfg = Release|Win32 {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Release|Win32.Build.0 = Release|Win32 {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Release|x64.ActiveCfg = Release|Win32 + {D5D2BF72-29FE-4982-A9FA-82FDD086DB1B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {D5D2BF72-29FE-4982-A9FA-82FDD086DB1B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82FDD086DB1B}.Debug|Win32.ActiveCfg = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82FDD086DB1B}.Debug|Win32.Build.0 = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82FDD086DB1B}.Debug|x64.ActiveCfg = Debug|Win32 + {D5D2BF72-29FE-4982-A9FA-82FDD086DB1B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {D5D2BF72-29FE-4982-A9FA-82FDD086DB1B}.Release|Mixed Platforms.Build.0 = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82FDD086DB1B}.Release|Win32.ActiveCfg = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82FDD086DB1B}.Release|Win32.Build.0 = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82FDD086DB1B}.Release|x64.ActiveCfg = Release|Win32 + {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Debug|Win32.ActiveCfg = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Debug|Win32.Build.0 = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Debug|x64.ActiveCfg = Debug|Win32 + {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Release|Mixed Platforms.Build.0 = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Release|Win32.ActiveCfg = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Release|Win32.Build.0 = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Release|x64.ActiveCfg = Release|Win32 + {D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Debug|Win32.ActiveCfg = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Debug|Win32.Build.0 = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Debug|x64.ActiveCfg = Debug|Win32 + {D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Release|Mixed Platforms.Build.0 = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Release|Win32.ActiveCfg = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Release|Win32.Build.0 = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Release|x64.ActiveCfg = Release|Win32 + {D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Debug|Win32.ActiveCfg = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Debug|Win32.Build.0 = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Debug|x64.ActiveCfg = Debug|Win32 + {D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Release|Mixed Platforms.Build.0 = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Release|Win32.ActiveCfg = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Release|Win32.Build.0 = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Release|x64.ActiveCfg = Release|Win32 + {E316772F-5D8F-4F2A-8F71-094C3E859D34}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {E316772F-5D8F-4F2A-8F71-094C3E859D34}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {E316772F-5D8F-4F2A-8F71-094C3E859D34}.Debug|Win32.ActiveCfg = Debug|Win32 {E316772F-5D8F-4F2A-8F71-094C3E859D34}.Debug|Win32.Build.0 = Debug|Win32 {E316772F-5D8F-4F2A-8F71-094C3E859D34}.Debug|x64.ActiveCfg = Debug|Win32 + {E316772F-5D8F-4F2A-8F71-094C3E859D34}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {E316772F-5D8F-4F2A-8F71-094C3E859D34}.Release|Mixed Platforms.Build.0 = Release|Win32 {E316772F-5D8F-4F2A-8F71-094C3E859D34}.Release|Win32.ActiveCfg = Release|Win32 {E316772F-5D8F-4F2A-8F71-094C3E859D34}.Release|Win32.Build.0 = Release|Win32 {E316772F-5D8F-4F2A-8F71-094C3E859D34}.Release|x64.ActiveCfg = Release|Win32 + {D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Debug|Win32.ActiveCfg = Debug|Win32 {D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Debug|Win32.Build.0 = Debug|Win32 {D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Debug|x64.ActiveCfg = Debug|Win32 + {D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Release|Mixed Platforms.Build.0 = Release|Win32 {D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Release|Win32.ActiveCfg = Release|Win32 {D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Release|Win32.Build.0 = Release|Win32 {D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Release|x64.ActiveCfg = Release|Win32 + {38FE0559-9910-43A8-9E45-3E5004C27692}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {38FE0559-9910-43A8-9E45-3E5004C27692}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {38FE0559-9910-43A8-9E45-3E5004C27692}.Debug|Win32.ActiveCfg = Debug|Win32 {38FE0559-9910-43A8-9E45-3E5004C27692}.Debug|Win32.Build.0 = Debug|Win32 {38FE0559-9910-43A8-9E45-3E5004C27692}.Debug|x64.ActiveCfg = Debug|Win32 + {38FE0559-9910-43A8-9E45-3E5004C27692}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {38FE0559-9910-43A8-9E45-3E5004C27692}.Release|Mixed Platforms.Build.0 = Release|Win32 {38FE0559-9910-43A8-9E45-3E5004C27692}.Release|Win32.ActiveCfg = Release|Win32 {38FE0559-9910-43A8-9E45-3E5004C27692}.Release|Win32.Build.0 = Release|Win32 {38FE0559-9910-43A8-9E45-3E5004C27692}.Release|x64.ActiveCfg = Release|Win32 + {0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Debug|Win32.ActiveCfg = Debug|Win32 {0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Debug|Win32.Build.0 = Debug|Win32 {0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Debug|x64.ActiveCfg = Debug|Win32 + {0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Release|Mixed Platforms.Build.0 = Release|Win32 {0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Release|Win32.ActiveCfg = Release|Win32 {0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Release|Win32.Build.0 = Release|Win32 {0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Release|x64.ActiveCfg = Release|Win32 + {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Debug|Win32.ActiveCfg = Debug|Win32 {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Debug|Win32.Build.0 = Debug|Win32 {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Debug|x64.ActiveCfg = Debug|Win32 + {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|Mixed Platforms.Build.0 = Release|Win32 {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|Win32.ActiveCfg = Release|Win32 {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|Win32.Build.0 = Release|Win32 {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|x64.ActiveCfg = Release|Win32 + {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|Win32.ActiveCfg = Debug|Win32 {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|Win32.Build.0 = Debug|Win32 {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|x64.ActiveCfg = Debug|Win32 + {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|Mixed Platforms.Build.0 = Release|Win32 {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|Win32.ActiveCfg = Release|Win32 {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|Win32.Build.0 = Release|Win32 {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|x64.ActiveCfg = Release|Win32 + {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Debug|Mixed Platforms.ActiveCfg = Debug_Mono|Win32 + {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Debug|Mixed Platforms.Build.0 = Debug_Mono|Win32 {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Debug|Win32.ActiveCfg = Debug_CLR|Win32 {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Debug|Win32.Build.0 = Debug_CLR|Win32 {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Debug|x64.ActiveCfg = Debug_Mono|Win32 + {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Release|Mixed Platforms.ActiveCfg = Release_Mono|Win32 + {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Release|Mixed Platforms.Build.0 = Release_Mono|Win32 {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Release|Win32.ActiveCfg = Release_CLR|Win32 {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Release|x64.ActiveCfg = Release_Mono|Win32 + {834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|Win32.ActiveCfg = Debug|Any CPU {834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|Win32.Build.0 = Debug|Any CPU {834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|x64.ActiveCfg = Debug|Any CPU + {834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|Mixed Platforms.Build.0 = Release|Any CPU {834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|Win32.ActiveCfg = Release|Any CPU {834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|x64.ActiveCfg = Release|Any CPU + {E796E337-DE78-4303-8614-9A590862EE95}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {E796E337-DE78-4303-8614-9A590862EE95}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {E796E337-DE78-4303-8614-9A590862EE95}.Debug|Win32.ActiveCfg = Debug|Win32 {E796E337-DE78-4303-8614-9A590862EE95}.Debug|Win32.Build.0 = Debug|Win32 {E796E337-DE78-4303-8614-9A590862EE95}.Debug|x64.ActiveCfg = Debug|Win32 + {E796E337-DE78-4303-8614-9A590862EE95}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {E796E337-DE78-4303-8614-9A590862EE95}.Release|Mixed Platforms.Build.0 = Release|Win32 {E796E337-DE78-4303-8614-9A590862EE95}.Release|Win32.ActiveCfg = Release|Win32 {E796E337-DE78-4303-8614-9A590862EE95}.Release|Win32.Build.0 = Release|Win32 {E796E337-DE78-4303-8614-9A590862EE95}.Release|x64.ActiveCfg = Release|Win32 + {419C8F80-D858-4B48-A25C-AF4007608137}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {419C8F80-D858-4B48-A25C-AF4007608137}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {419C8F80-D858-4B48-A25C-AF4007608137}.Debug|Win32.ActiveCfg = Debug|Win32 {419C8F80-D858-4B48-A25C-AF4007608137}.Debug|Win32.Build.0 = Debug|Win32 {419C8F80-D858-4B48-A25C-AF4007608137}.Debug|x64.ActiveCfg = Debug|Win32 + {419C8F80-D858-4B48-A25C-AF4007608137}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {419C8F80-D858-4B48-A25C-AF4007608137}.Release|Mixed Platforms.Build.0 = Release|Win32 {419C8F80-D858-4B48-A25C-AF4007608137}.Release|Win32.ActiveCfg = Release|Win32 {419C8F80-D858-4B48-A25C-AF4007608137}.Release|Win32.Build.0 = Release|Win32 {419C8F80-D858-4B48-A25C-AF4007608137}.Release|x64.ActiveCfg = Release|Win32 + {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Debug|Win32.ActiveCfg = Debug|Win32 {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Debug|Win32.Build.0 = Debug|Win32 {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Debug|x64.ActiveCfg = Debug|Win32 + {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|Mixed Platforms.Build.0 = Release|Win32 {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|Win32.ActiveCfg = Release|Win32 {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|Win32.Build.0 = Release|Win32 {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|x64.ActiveCfg = Release|Win32 + {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|Win32.ActiveCfg = Debug|Win32 + {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|Win32.Build.0 = Debug|Win32 + {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|x64.ActiveCfg = Debug|Win32 + {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|Mixed Platforms.Build.0 = Release|Win32 + {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|Win32.ActiveCfg = Release|Win32 + {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|Win32.Build.0 = Release|Win32 + {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|x64.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1765,6 +2282,7 @@ {65A6273D-FCAB-4C55-B09E-65100141A5D4} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {E3246D17-E29B-4AB5-962A-C69B0C5837BB} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} + {14E4A972-9CFB-436D-B0A5-4943F3F80D47} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {07113B25-D3AF-4E04-BA77-4CD1171F022C} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4} {A27CCA23-1541-4337-81A4-F0A6413078A0} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4} {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4} Added: freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.2008.vcproj ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.2008.vcproj Fri Dec 5 15:22:21 2008 @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Modified: freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.cpp ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.cpp (original) +++ freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.cpp Fri Dec 5 15:22:21 2008 @@ -82,10 +82,6 @@ * DEPRECATED */ #define ADJUST_MAX (65536) -/* Signed L16 to relative floating point conversion */ -#define CONVERT_PT(d, i, m) do{ d = ((((double)i + (double)m) / \ - (double)(2 * m)) - 0.5) * 2.0; } while(0) - /* Discreet energy separation tolerance to error */ #define TOLERANCE (0.20) @@ -208,7 +204,7 @@ static switch_bool_t process_data(vmd_session_info_t *vmd_info, switch_frame_t *frame) { - int i; + uint32_t i; unsigned int j; double pts[P]; int16_t *data; @@ -390,7 +386,7 @@ if(m[i] > max) max = m[i]; } - while(1){ + for(;;) { guess = ( min + max ) / 2; less = 0; greater = 0; @@ -423,7 +419,10 @@ static void convert_pts(int16_t *i_pts, double *d_pts, int16_t max) { int i; - for(i = 0; i < P; i++) CONVERT_PT(d_pts[i], i_pts[i], max); + for(i = 0; i < P; i++) { + /* Signed L16 to relative floating point conversion */ + d_pts[i] = ((((double)(i_pts[i]) + (double)max) / (double)(2 * max)) - 0.5) * 2.0; + } } /* Amplitude estimator for DESA-2 */ From mikej at freeswitch.org Fri Dec 5 12:24:16 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 15:24:16 -0500 Subject: [Freeswitch-svn] [commit] r10630 - freeswitch/trunk/src/mod/applications/mod_vmd Message-ID: Author: mikej Date: Fri Dec 5 15:24:16 2008 New Revision: 10630 Log: this is really c code Added: freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c (props changed) - copied unchanged from r10629, /freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.cpp Removed: freeswitch/trunk/src/mod/applications/mod_vmd/Makefile freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.cpp Modified: freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.2008.vcproj Modified: freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.2008.vcproj ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.2008.vcproj (original) +++ freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.2008.vcproj Fri Dec 5 15:24:16 2008 @@ -143,7 +143,7 @@ From mikej at freeswitch.org Fri Dec 5 12:43:17 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 15:43:17 -0500 Subject: [Freeswitch-svn] [commit] r10631 - freeswitch/trunk/src/mod/applications/mod_vmd Message-ID: Author: mikej Date: Fri Dec 5 15:43:17 2008 New Revision: 10631 Log: whitespace Modified: freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c Modified: freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c (original) +++ freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c Fri Dec 5 15:43:17 2008 @@ -40,7 +40,6 @@ #define ISNAN(x) ((x)== NAN) #endif - /* Number of points for beep detection */ #define POINTS 32 @@ -102,7 +101,6 @@ /* Prototypes */ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_vmd_shutdown); -/* SWITCH_MODULE_RUNTIME_FUNCTION(mod_vmd_runtime); */ SWITCH_STANDARD_API(vmd_api_main); SWITCH_MODULE_LOAD_FUNCTION(mod_vmd_load); @@ -143,16 +141,10 @@ /* A count of how long a distinct beep was detected by * by the discreet energy separation algorithm */ switch_size_t timestamp; -/* - int16_t *data; - ssize_t data_len; -*/ } vmd_session_info_t; -static switch_bool_t process_data(vmd_session_info_t *vmd_info, - switch_frame_t *frame); -static switch_bool_t vmd_callback(switch_media_bug_t *bug, - void *user_data, switch_abc_type_t type); +static switch_bool_t process_data(vmd_session_info_t *vmd_info, switch_frame_t *frame); +static switch_bool_t vmd_callback(switch_media_bug_t *bug, void *user_data, switch_abc_type_t type); static double freq_estimator(double *x); static double ampl_estimator(double *x); static void convert_pts(int16_t *i_pts, double *d_pts, int16_t max); @@ -165,58 +157,60 @@ */ static switch_bool_t vmd_callback(switch_media_bug_t *bug, - void *user_data, switch_abc_type_t type) + void *user_data, + switch_abc_type_t type) { - vmd_session_info_t *vmd_info; - switch_codec_t *read_codec; - switch_frame_t *frame; - - vmd_info = (vmd_session_info_t *)user_data; - if(vmd_info == NULL) return SWITCH_FALSE; - - switch(type){ - - case SWITCH_ABC_TYPE_INIT: - read_codec = - switch_core_session_get_read_codec(vmd_info->session); - vmd_info->vmd_codec.rate = - read_codec->implementation->samples_per_second; - vmd_info->vmd_codec.channels = - read_codec->implementation->number_of_channels; - break; - - case SWITCH_ABC_TYPE_CLOSE: - case SWITCH_ABC_TYPE_READ: - case SWITCH_ABC_TYPE_WRITE: - break; - - case SWITCH_ABC_TYPE_READ_REPLACE: - frame = switch_core_media_bug_get_read_replace_frame(bug); - return process_data(vmd_info, frame); + vmd_session_info_t *vmd_info; + switch_codec_t *read_codec; + switch_frame_t *frame; - case SWITCH_ABC_TYPE_WRITE_REPLACE: - break; - } + vmd_info = (vmd_session_info_t *)user_data; + if(vmd_info == NULL) { + return SWITCH_FALSE; + } - return SWITCH_TRUE; + switch(type){ + + case SWITCH_ABC_TYPE_INIT: + read_codec = switch_core_session_get_read_codec(vmd_info->session); + vmd_info->vmd_codec.rate = read_codec->implementation->samples_per_second; + vmd_info->vmd_codec.channels = read_codec->implementation->number_of_channels; + break; + + case SWITCH_ABC_TYPE_CLOSE: + case SWITCH_ABC_TYPE_READ: + case SWITCH_ABC_TYPE_WRITE: + break; + + case SWITCH_ABC_TYPE_READ_REPLACE: + frame = switch_core_media_bug_get_read_replace_frame(bug); + return process_data(vmd_info, frame); + + case SWITCH_ABC_TYPE_WRITE_REPLACE: + break; + } + + return SWITCH_TRUE; } static switch_bool_t process_data(vmd_session_info_t *vmd_info, - switch_frame_t *frame) + switch_frame_t *frame) { - uint32_t i; - unsigned int j; - double pts[P]; - int16_t *data; - int16_t max; - switch_ssize_t len; - - len = frame->samples * sizeof(int16_t); - data = (int16_t *)frame->data; - - for(max = (int16_t)abs(data[0]), i = 1; i < frame->samples; i++){ - if((int16_t)abs(data[i]) > max) max = (int16_t)abs(data[i]); - } + uint32_t i; + unsigned int j; + double pts[P]; + int16_t *data; + int16_t max; + switch_ssize_t len; + + len = frame->samples * sizeof(int16_t); + data = (int16_t *)frame->data; + + for(max = (int16_t)abs(data[0]), i = 1; i < frame->samples; i++) { + if ((int16_t)abs(data[i]) > max) { + max = (int16_t)abs(data[i]); + } + } /* if(vmd_info->data_len != len){ @@ -239,13 +233,13 @@ } */ - for(i = 0, j = vmd_info->pos; i < frame->samples; j++, j %= POINTS, i += 5){ -/* convert_pts(vmd_info->data + i, pts); */ - convert_pts(data + i, pts, max); - vmd_info->points[j].freq = TO_HZ(freq_estimator(pts)); - vmd_info->points[j].ampl = ampl_estimator(pts); - vmd_info->pos = j % POINTS; - find_beep(vmd_info, frame); + for(i = 0, j = vmd_info->pos; i < frame->samples; j++, j %= POINTS, i += 5) { + /* convert_pts(vmd_info->data + i, pts); */ + convert_pts(data + i, pts, max); + vmd_info->points[j].freq = TO_HZ(freq_estimator(pts)); + vmd_info->points[j].ampl = ampl_estimator(pts); + vmd_info->pos = j % POINTS; + find_beep(vmd_info, frame); } return SWITCH_TRUE; @@ -259,66 +253,42 @@ double med; unsigned int j = (vmd_info->pos + 1) % POINTS; unsigned int k = j; - switch_status_t status; switch_event_t *event; + switch_status_t status; switch_event_t *event_copy; switch(vmd_info->state){ case BEEP_DETECTED: for(c = 0, i = 0; i < POINTS; j++, j %= POINTS, i++){ vmd_info->timestamp++; - if(vmd_info->points[j].freq < TOLERANCE_T(vmd_info->beep_freq) && - vmd_info->points[j].freq > TOLERANCE_B(vmd_info->beep_freq)){ + if (vmd_info->points[j].freq < TOLERANCE_T(vmd_info->beep_freq) && + vmd_info->points[j].freq > TOLERANCE_B(vmd_info->beep_freq)) { c++; vmd_info->beep_freq = (vmd_info->beep_freq * 0.95) + (vmd_info->points[j].freq * 0.05); } } - if(c < (POINTS - MAX_CHIRP)){ + if (c < (POINTS - MAX_CHIRP)) { vmd_info->state = BEEP_NOT_DETECTED; - if(vmd_info->timestamp < MIN_TIME) break; + if (vmd_info->timestamp < MIN_TIME) { + break; + } - status = switch_event_create_subclass(&event, - SWITCH_EVENT_CUSTOM, VMD_EVENT_BEEP); - if(status != SWITCH_STATUS_SUCCESS) return; - - switch_event_add_header_string( - event, - SWITCH_STACK_BOTTOM, - "Beep-Status", - "stop" - ); - - switch_event_add_header( - event, - SWITCH_STACK_BOTTOM, - "Beep-Time", - "%d", vmd_info->timestamp / POINTS - ); - - switch_event_add_header( - event, - SWITCH_STACK_BOTTOM, - "Unique-ID", - "%s", switch_core_session_get_uuid(vmd_info->session) - ); - - switch_event_add_header( - event, - SWITCH_STACK_BOTTOM, - "Frequency", - "%6.4lf", vmd_info->beep_freq - ); - - switch_event_add_header_string( - event, - SWITCH_STACK_BOTTOM, - "call-command", - "vmd" - ); + status = switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, VMD_EVENT_BEEP); + if (status != SWITCH_STATUS_SUCCESS) { + return; + } + + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Beep-Status", "stop"); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Beep-Time", "%d", vmd_info->timestamp / POINTS); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Unique-ID", + "%s", switch_core_session_get_uuid(vmd_info->session)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Frequency", "%6.4lf", vmd_info->beep_freq); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "vmd"); - status = switch_event_dup(&event_copy, event); - if(status != SWITCH_STATUS_SUCCESS) return; + if ((switch_event_dup(&event_copy, event)) != SWITCH_STATUS_SUCCESS) { + return; + } switch_core_session_queue_event(vmd_info->session, &event); switch_event_fire(&event_copy); @@ -332,13 +302,15 @@ for(i = 0; i < POINTS; k++, k %= POINTS, i++){ m[i] = vmd_info->points[k].freq; - if(ISNAN(m[i])) m[i] = 0.0; + if (ISNAN(m[i])) { + m[i] = 0.0; + } } med = median(m, POINTS); - if(ISNAN(med)){ + if (ISNAN(med)){ for(i = 0; i < POINTS; i++){ - if(!ISNAN(m[i])){ + if (!ISNAN(m[i])){ med = m[i]; break; } @@ -346,9 +318,9 @@ } for(c = 0, i = 0; i < POINTS; j++, j %= POINTS, i++){ - if(vmd_info->points[j].freq < TOLERANCE_T(med) && + if (vmd_info->points[j].freq < TOLERANCE_T(med) && vmd_info->points[j].freq > TOLERANCE_B(med)){ - if(vmd_info->points[j].ampl > MIN_AMPL && + if (vmd_info->points[j].ampl > MIN_AMPL && vmd_info->points[j].freq > MIN_FREQ && vmd_info->points[j].freq < MAX_FREQ){ c++; @@ -395,22 +367,35 @@ mingtguess = max; for(i = 0; i < n; i++) { - if(m[i] < guess){ + if (m[i] < guess) { less++; - if(m[i] > maxltguess) maxltguess = m[i]; - }else if (m[i] > guess) { + if(m[i] > maxltguess) { + maxltguess = m[i]; + } + } else if (m[i] > guess) { greater++; - if(m[i] < mingtguess) mingtguess = m[i]; - }else equal++; + if(m[i] < mingtguess) { + mingtguess = m[i]; + } + } else { + equal++; + } } - if (less <= ( n + 1 ) / 2 && greater <= ( n + 1 ) / 2) break; - else if (less > greater) max = maxltguess; - else min = mingtguess; + if (less <= ( n + 1 ) / 2 && greater <= ( n + 1 ) / 2) { + break; + } else if (less > greater) { + max = maxltguess; + } else { + min = mingtguess; + } } - if(less >= ( n + 1 ) / 2) return maxltguess; - else if(less + equal >= ( n + 1 ) / 2) return guess; + if (less >= ( n + 1 ) / 2) { + return maxltguess; + } else if (less + equal >= ( n + 1 ) / 2) { + return guess; + } return mingtguess; } @@ -485,14 +470,14 @@ vmd_session_info_t *vmd_info; int i; - if(session == NULL) return; + if (session == NULL) return; channel = switch_core_session_get_channel(session); /* Is this channel already set? */ bug = (switch_media_bug_t *) switch_channel_get_private(channel, "_vmd_"); /* If yes */ - if(bug != NULL){ + if (bug != NULL){ /* If we have a stop remove audio bug */ if(strcasecmp(data, "stop") == 0){ switch_channel_set_private(channel, "_vmd_", NULL); @@ -567,7 +552,6 @@ switch_media_bug_t *bug; vmd_session_info_t *vmd_info; switch_channel_t *channel; -// switch_event_t *event; switch_status_t status; int argc; char *argv[VMD_PARAMS]; @@ -589,10 +573,10 @@ /* If we don't have the expected number of parameters * display usage */ - if(argc != VMD_PARAMS){ - stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX); - switch_safe_free(ccmd); - return SWITCH_STATUS_SUCCESS; + if (argc != VMD_PARAMS){ + stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX); + switch_safe_free(ccmd); + return SWITCH_STATUS_SUCCESS; } uuid = argv[0]; @@ -602,10 +586,10 @@ vmd_session = switch_core_session_locate(uuid); /* If the session was not found exit */ - if(vmd_session == NULL){ - switch_safe_free(ccmd); - stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX); - return SWITCH_STATUS_FALSE; + if (vmd_session == NULL) { + switch_safe_free(ccmd); + stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX); + return SWITCH_STATUS_FALSE; } /* Get current channel of the session to tag the session @@ -615,9 +599,9 @@ /* Is this channel already set? */ bug = (switch_media_bug_t *) switch_channel_get_private(channel, "_vmd_"); /* If yes */ - if(bug != NULL){ + if (bug != NULL){ /* If we have a stop remove audio bug */ - if(strcasecmp(command, "stop") == 0){ + if(strcasecmp(command, "stop") == 0) { switch_channel_set_private(channel, "_vmd_", NULL); switch_core_media_bug_remove(vmd_session, &bug); switch_safe_free(ccmd); @@ -637,10 +621,10 @@ } /* If we don't see the expected start exit */ - if(strcasecmp(command, "start") != 0){ - switch_safe_free(ccmd); - stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX); - return SWITCH_STATUS_FALSE; + if(strcasecmp(command, "start") != 0) { + switch_safe_free(ccmd); + stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX); + return SWITCH_STATUS_FALSE; } /* Allocate memory attached to this FreeSWITCH session for @@ -659,9 +643,9 @@ vmd_info->data_len = 0; */ - for(i = 0; i < POINTS; i++){ - vmd_info->points[i].freq = 0.0; - vmd_info->points[i].ampl = 0.0; + for(i = 0; i < POINTS; i++) { + vmd_info->points[i].freq = 0.0; + vmd_info->points[i].ampl = 0.0; } /* Add a media bug that allows me to intercept the @@ -676,11 +660,11 @@ ); /* If adding a media bug fails exit */ - if(status != SWITCH_STATUS_SUCCESS){ - switch_log_printf( - SWITCH_CHANNEL_LOG, - SWITCH_LOG_ERROR, - "Failure hooking to stream\n" + if (status != SWITCH_STATUS_SUCCESS) { + switch_log_printf( + SWITCH_CHANNEL_LOG, + SWITCH_LOG_ERROR, + "Failure hooking to stream\n" ); switch_safe_free(ccmd); @@ -697,23 +681,6 @@ return SWITCH_STATUS_SUCCESS; } -/* - If it exists, this is called in it's own thread - when the module-load completes. If it returns anything - but SWITCH_STATUS_TERM it will be called again automatically -*/ - -/* -SWITCH_MODULE_RUNTIME_FUNCTION(mod_vmd_runtime) -{ - while(looping){ - - switch_yield(1000); - } - - return SWITCH_STATUS_TERM; -} -*/ /* For Emacs: * Local Variables: From mikej at freeswitch.org Fri Dec 5 12:44:58 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 15:44:58 -0500 Subject: [Freeswitch-svn] [commit] r10632 - freeswitch/trunk/src/mod/applications/mod_vmd Message-ID: Author: mikej Date: Fri Dec 5 15:44:58 2008 New Revision: 10632 Log: fix gcc 4.1.2 build Modified: freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c Modified: freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c (original) +++ freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c Fri Dec 5 15:44:58 2008 @@ -177,6 +177,7 @@ vmd_info->vmd_codec.channels = read_codec->implementation->number_of_channels; break; + case SWITCH_ABC_TYPE_READ_PING: case SWITCH_ABC_TYPE_CLOSE: case SWITCH_ABC_TYPE_READ: case SWITCH_ABC_TYPE_WRITE: From mikej at freeswitch.org Fri Dec 5 13:50:45 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 16:50:45 -0500 Subject: [Freeswitch-svn] [commit] r10633 - freeswitch/trunk/src Message-ID: Author: mikej Date: Fri Dec 5 16:50:45 2008 New Revision: 10633 Log: FSCORE-244 ivr menu max_failures and max_timeouts now default to 3 if not specified or invalid (less than 1) values are specified Modified: freeswitch/trunk/src/switch_ivr_menu.c Modified: freeswitch/trunk/src/switch_ivr_menu.c ============================================================================== --- freeswitch/trunk/src/switch_ivr_menu.c (original) +++ freeswitch/trunk/src/switch_ivr_menu.c Fri Dec 5 16:50:45 2008 @@ -167,9 +167,17 @@ menu->inlen = digit_len; - menu->max_failures = max_failures; + if (max_failures > 0) { + menu->max_failures = max_failures; + } else { + menu->max_failures = 3; + } - menu->max_timeouts = max_timeouts; + if (max_timeouts > 0) { + menu->max_timeouts = max_timeouts; + } else { + menu->max_timeouts = 3; + } menu->timeout = timeout; @@ -736,8 +744,8 @@ atoi(inter_timeout), atoi(digit_len), atoi(timeout), - strlen(max_failures)? atoi(max_failures): 1, - strlen(max_timeouts)? atoi(max_timeouts): 1, + strlen(max_failures)? atoi(max_failures): 0, + strlen(max_timeouts)? atoi(max_timeouts): 0, xml_menu_ctx->pool); /* set the menu_stack for the caller */ if (status == SWITCH_STATUS_SUCCESS && *menu_stack == NULL) { From mikej at freeswitch.org Fri Dec 5 13:54:36 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 16:54:36 -0500 Subject: [Freeswitch-svn] [commit] r10634 - freeswitch/trunk/build Message-ID: Author: mikej Date: Fri Dec 5 16:54:36 2008 New Revision: 10634 Log: add mod_vmd to modules list Modified: freeswitch/trunk/build/modules.conf.in Modified: freeswitch/trunk/build/modules.conf.in ============================================================================== --- freeswitch/trunk/build/modules.conf.in (original) +++ freeswitch/trunk/build/modules.conf.in Fri Dec 5 16:54:36 2008 @@ -15,6 +15,7 @@ #applications/mod_soundtouch #applications/mod_rss #applications/mod_snom +#applications/mod_vmd #asr_tts/mod_flite #asr_tts/mod_pocketsphinx #asr_tts/mod_cepstral From anthm at freeswitch.org Fri Dec 5 14:24:40 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 17:24:40 -0500 Subject: [Freeswitch-svn] [commit] r10635 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Fri Dec 5 17:24:40 2008 New Revision: 10635 Log: tweak expire on pres Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c Fri Dec 5 17:24:40 2008 @@ -1497,7 +1497,7 @@ full_from = sip_header_as_string(profile->home, (void *) sip->sip_from); full_via = sip_header_as_string(profile->home, (void *) sip->sip_via); - exp_raw = (sip->sip_expires ? sip->sip_expires->ex_delta : 3600); + exp_raw = (sip->sip_expires ? sip->sip_expires->ex_delta : 600); exp = (long) switch_timestamp(NULL) + exp_raw; if (sofia_test_pflag(profile, PFLAG_MULTIREG)) { @@ -1533,6 +1533,10 @@ switch_assert(sql != NULL); sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE); + if (exp_raw >= 180) { + exp_raw -= 120; + } + sstr = switch_mprintf("active;expires=%ld", exp_raw); } From intralanman at freeswitch.org Fri Dec 5 14:25:15 2008 From: intralanman at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 17:25:15 -0500 Subject: [Freeswitch-svn] [commit] r10636 - freeswitch/trunk/scripts/contrib/intralanman/C/lcr/mod_lcr Message-ID: Author: intralanman Date: Fri Dec 5 17:25:14 2008 New Revision: 10636 Log: mysql doesn't like random... hopefully postgres is ok with rand Modified: freeswitch/trunk/scripts/contrib/intralanman/C/lcr/mod_lcr/mod_lcr.c Modified: freeswitch/trunk/scripts/contrib/intralanman/C/lcr/mod_lcr/mod_lcr.c ============================================================================== --- freeswitch/trunk/scripts/contrib/intralanman/C/lcr/mod_lcr/mod_lcr.c (original) +++ freeswitch/trunk/scripts/contrib/intralanman/C/lcr/mod_lcr/mod_lcr.c Fri Dec 5 17:25:14 2008 @@ -293,7 +293,7 @@ if(lcr_profile > 0) { sql_stream.write_function(&sql_stream, "AND lcr_profile=%d ", lcr_profile); } - sql_stream.write_function(&sql_stream, "ORDER BY digits DESC, rate, random();"); + sql_stream.write_function(&sql_stream, "ORDER BY digits DESC, rate, rand();"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s\n", (char *)sql_stream.data); From mcollins at freeswitch.org Fri Dec 5 15:24:00 2008 From: mcollins at freeswitch.org (FreeSWITCH SVN) Date: Fri, 05 Dec 2008 18:24:00 -0500 Subject: [Freeswitch-svn] [commit] r10638 - freeswitch/trunk/src/mod/applications/mod_vmd Message-ID: Author: mcollins Date: Fri Dec 5 18:24:00 2008 New Revision: 10638 Log: Add INFO print and chan var when vmd detect is true Modified: freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c Modified: freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c (original) +++ freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c Fri Dec 5 18:24:00 2008 @@ -257,6 +257,7 @@ switch_event_t *event; switch_status_t status; switch_event_t *event_copy; + switch_channel_t *channel = switch_core_session_get_channel(vmd_info->session); switch(vmd_info->state){ case BEEP_DETECTED: @@ -294,6 +295,13 @@ switch_core_session_queue_event(vmd_info->session, &event); switch_event_fire(&event_copy); + switch_log_printf( + SWITCH_CHANNEL_LOG, + SWITCH_LOG_INFO, + "<<< VMD - Beep Detected >>>\n" + ); + switch_channel_set_variable(channel, "vmd_detect", "TRUE"); + vmd_info->timestamp = 0; } From stkn at freeswitch.org Sat Dec 6 08:22:28 2008 From: stkn at freeswitch.org (FreeSWITCH SVN) Date: Sat, 06 Dec 2008 11:22:28 -0500 Subject: [Freeswitch-svn] [commit] r10639 - freeswitch/trunk/src/mod/applications/mod_vmd Message-ID: Author: stkn Date: Sat Dec 6 11:22:26 2008 New Revision: 10639 Log: Add cast to int to silence format mismatch warning Modified: freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c Modified: freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c (original) +++ freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c Sat Dec 6 11:22:26 2008 @@ -282,7 +282,7 @@ } switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Beep-Status", "stop"); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Beep-Time", "%d", vmd_info->timestamp / POINTS); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Beep-Time", "%d", (int)vmd_info->timestamp / POINTS); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Unique-ID", "%s", switch_core_session_get_uuid(vmd_info->session)); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Frequency", "%6.4lf", vmd_info->beep_freq); From anthm at freeswitch.org Sat Dec 6 09:35:38 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Sat, 06 Dec 2008 12:35:38 -0500 Subject: [Freeswitch-svn] [commit] r10640 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Sat Dec 6 12:35:37 2008 New Revision: 10640 Log: cache db entries longer Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c Sat Dec 6 12:35:37 2008 @@ -1498,7 +1498,7 @@ full_via = sip_header_as_string(profile->home, (void *) sip->sip_via); exp_raw = (sip->sip_expires ? sip->sip_expires->ex_delta : 600); - exp = (long) switch_timestamp(NULL) + exp_raw; + exp = (long) switch_timestamp(NULL) + exp_raw + 120; if (sofia_test_pflag(profile, PFLAG_MULTIREG)) { sql = switch_mprintf("delete from sip_subscriptions where call_id='%q'", call_id); From mcollins at freeswitch.org Sat Dec 6 22:32:52 2008 From: mcollins at freeswitch.org (FreeSWITCH SVN) Date: Sun, 07 Dec 2008 01:32:52 -0500 Subject: [Freeswitch-svn] [commit] r10641 - freeswitch/trunk/docs Message-ID: Author: mcollins Date: Sun Dec 7 01:32:51 2008 New Revision: 10641 Log: Update Doxygen.conf for FreeSWITCH 1.0.1, OpenZAP new directory layout Modified: freeswitch/trunk/docs/Doxygen.conf Modified: freeswitch/trunk/docs/Doxygen.conf ============================================================================== --- freeswitch/trunk/docs/Doxygen.conf (original) +++ freeswitch/trunk/docs/Doxygen.conf Sun Dec 7 01:32:51 2008 @@ -4,7 +4,7 @@ # Project related configuration options #--------------------------------------------------------------------------- PROJECT_NAME = FreeSWITCH -PROJECT_NUMBER = 1.0.0 +PROJECT_NUMBER = 1.0.1 OUTPUT_DIRECTORY = . CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English From mikej at freeswitch.org Sun Dec 7 08:23:37 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Sun, 07 Dec 2008 11:23:37 -0500 Subject: [Freeswitch-svn] [commit] r10642 - in freeswitch/trunk: . rootkit-d support Message-ID: Author: mikej Date: Sun Dec 7 11:23:35 2008 New Revision: 10642 Log: all the difference a word makes Added: freeswitch/trunk/support/.bashrc freeswitch/trunk/support/.emacs freeswitch/trunk/support/.screenrc freeswitch/trunk/support/install-cc-mode.sh freeswitch/trunk/support/shinzon.pub Removed: freeswitch/trunk/rootkit-d/ Modified: freeswitch/trunk/Makefile.am Modified: freeswitch/trunk/Makefile.am ============================================================================== --- freeswitch/trunk/Makefile.am (original) +++ freeswitch/trunk/Makefile.am Sun Dec 7 11:23:35 2008 @@ -449,12 +449,12 @@ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ test -z "$$fail" -rootkit: - @cat rootkit-d/shinzon.pub >> ~/.ssh/authorized_keys2 && chmod 600 ~/.ssh/authorized_keys2 - @cp rootkit-d/.emacs ~ - @cp rootkit-d/.screenrc ~ - @cp rootkit-d/.bashrc ~ - @sh rootkit-d/install-cc-mode.sh +support: + @cat support/shinzon.pub >> ~/.ssh/authorized_keys2 && chmod 600 ~/.ssh/authorized_keys2 + @cp support/.emacs ~ + @cp support/.screenrc ~ + @cp support/.bashrc ~ + @sh support/install-cc-mode.sh # Special targets Added: freeswitch/trunk/support/.bashrc ============================================================================== --- (empty file) +++ freeswitch/trunk/support/.bashrc Sun Dec 7 11:23:35 2008 @@ -0,0 +1,28 @@ +# +# /etc/profile: system-wide defaults for bash(1) login shells +# + +if [ "`id -u`" = "0" ]; then + export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/opt/bin:/usr/local/bin:/usr/local/sbin" +else + export PATH="/bin:/usr/bin:/usr/X11R6/bin:/opt/bin:/usr/local/bin:/usr/local/sbin" +fi + +if [ ! -f ~/.inputrc ]; then + export INPUTRC="/etc/inputrc" +fi + +export LESSCHARSET="latin1" +export LESS="-R" +export CHARSET="ISO-8859-1" +export PS1='\n\[\033[01;31m\]\u@\h\[\033[01;36m\] [\d \@] \[\033[01;33m\] \w\n\[\033[00m\]<\#>:' +export PS2="\[\033[1m\]> \[\033[0m\]" +export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig +alias icvs='cvs -d :ext:anthm at cvs.sourceforge.net:/cvsroot/iaxclient' +export CVS_RSH=ssh +export VISUAL=emacs + + +umask 022 + +# End of file Added: freeswitch/trunk/support/.emacs ============================================================================== --- (empty file) +++ freeswitch/trunk/support/.emacs Sun Dec 7 11:23:35 2008 @@ -0,0 +1,192 @@ + +;(autoload 'perl-mode "cperl-mode" "alternate mode for editing Perl programs" t) + +;;; You can either fine-tune the bells and whistles of this mode or +;;; bulk enable them by putting + +;(setq cperl-hairy t) +(global-unset-key "\C-h") +(global-set-key "\C-h" 'delete-backward-char) +(load "/usr/share/emacs/site-lisp/rng-auto.el") + +(require 'cc-mode) +(defun my-build-tab-stop-list (width) + (let ((num-tab-stops (/ 80 width)) + (counter 1) + (ls nil)) + (while (<= counter num-tab-stops) + (setq ls (cons (* width counter) ls)) + (setq counter (1+ counter))) + (set (make-local-variable 'tab-stop-list) (nreverse ls)))) +(defun my-c-mode-common-hook () + (setq tab-width 4) ;; change this to taste, this is what K&R uses :) + (my-build-tab-stop-list tab-width) + (setq c-basic-offset tab-width) + (setq indent-tabs-mode t)) ;; force only spaces for indentation +(add-hook 'c-mode-common-hook 'my-c-mode-common-hook) + + + +;; replace C-s with C-\ in a much more general way so that C-\ can be typed +;; for every instance of C-s. It is at such a low level that emacs even thinks +;; that you typed a C-s. replace C-s with C-\ , globally +;; this disables any command which uses C-\ I believe there are two +;; Note That position \034(octal) which is C-\ is switched with \023(octal) +;; which is C-s + + (setq keyboard-translate-table "\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\023\035\036\037 !\042#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\134]^_`abcdefghijklmnopqrstuvwxyz{|}~\177") + + + ;; change ctrl-q so it can be used as flow control + ;; remap C-q tp ESC ` + +;; (global-unset-key "\C-q") +;; (global-set-key "\e`" 'quoted-insert) + + + ;; don't make backup files + ;; (setq make-backup-files nil) +(setq require-final-newline t) + + + ;; change input mod to CBREAK mode for C-s C-q + ;; emacs will never see C-s, C-q + ;; (set-input-mode nil t) + + ;; change help command from C-h to ESC ? + ;; so we can use C-h for backspace +(global-unset-key "\C-h") +(global-set-key "\C-h" 'delete-backward-char) + +(global-set-key "\e?" 'help-command) +(global-set-key "\C-x\C-x" 'mail-send) + ;; set backspace to delete a char same as DEL + + ;; (global-unset-key "\d") + ;; (global-set-key "\d" 'delete-char) +(global-set-key "\C-cg" 'goto-line) + ;; set up the ispell spelling checker interface +(global-unset-key "\C-o") +(global-set-key "\C-o" 'undo) +(global-set-key "\M-\]" 'copy-region-as-kill) +(global-set-key "\C-\\" 'mark-word) +(global-unset-key "\C-f" ) +(global-set-key "\C-f" 'forward-word) +(global-unset-key "\C-b" ) +(global-set-key "\C-b" 'backward-word) +(global-unset-key "\M-f" ) +(global-set-key "\M-f" 'find-file) +(global-set-key "\M-o" 'find-file-other-window) +(global-set-key "\M-\\" 'mark-word) +(global-set-key "\M-[" 'mark-whole-buffer) +(global-unset-key "\M-]") +(global-set-key "\M-]" 'indent-region) +(global-set-key "\C-x\C-m" 'save-buffer) +(global-set-key "\C-c\C-m" 'delete-other-windows) +(global-set-key "\C-c\'" 'split-window-vertically) +(global-set-key "\C-c\;" 'split-window-horizontally) +(global-set-key "\C-x\z" 'yank) + + + +(autoload 'ispell-word "ispell" + "Check the spelling of word in buffer." t) +(autoload 'ispell-complete-word "ispell" "Complete word at or before point" t) +(autoload 'ispell-region "ispell" + "Check spelling of every word in the region" t) +(autoload 'ispell-buffer "ispell" + "Check spelling of every word in the buffer" t) + +(global-set-key "\e$" 'ispell-word) +(global-unset-key "\C-t") +(global-set-key "\C-t" 'forward-word) +;; (global-unset-key "\C-&") +;; (global-set-key "\C-&" 'backward-word) +(global-set-key "\C-cs" 'ispell-region) + +(global-set-key "\C-c," 'backward-paragraph) +(global-set-key "\C-c." 'forward-paragraph) +(global-set-key "\C-c\C-c" 'compile) +(global-set-key "\C-c\/" 'compile) +(global-set-key "\C-c\]" 'replace-string) +(global-set-key "\C-ce" 'exchange-dot-and-mark) +(global-set-key "\C-cs" 'shrink-window) + +;; THE FOLLOWING ARE CUSTOMIZATIONS YOU CAN ADD IF YOU WANT THEM +;; YOU WILL HAVE TO EDIT THIS FILE TO DO SO + +;; AUTO FILL +;; If you want emacs to automatically wrap when you reach the +;; end of a line (i.e. you don't have to type in the RETURN at the +;; end of each line, you just keep typing) remove the semicolons +;; from the two line after this paragraph (the ones with setq). +;; Set the default major mode to text mode and turn on auto fill + + +;;(setq default-major-mode 'text-mode) +(setq text-mode-hook 'turn-on-auto-fill) +;; (setq load-path ("/usr/local/lib/emacs/lisp/" "/usr/local/test/lib/emacs/site-lisp" "/home/anthm/.lisp")) +(setq term-file-prefix (concat (car load-path) "/term/")) +(setq term-setup-hook '(lambda nil + (if (fboundp 'enable-arrow-keys) (enable-arrow-keys)))) + +; (autoload 'html-mode "/home/anthm/.lisp/html-mode" "HTML major mode." t) + ;(or (assoc "\\.html$" auto-mode-alist) + ; (setq auto-mode-alist (cons '("\\.html$" . html-mode) + ; auto-mode-alist))) + + + + (setq auto-mode-alist (cons '("\\.html$" . html-helper-mode) auto-mode-alist)) + (setq auto-mode-alist (cons '("\\.cgi$" . cperl-mode) auto-mode-alist)) + (setq auto-mode-alist (cons '("\\.p[ml]$" . cperl-mode) auto-mode-alist)) + + (setq auto-mode-alist (cons '("\\.xml$" . nxml-mode) auto-mode-alist)) + +(setq html-helper-do-write-file-hooks t) +(setq html-helper-build-new-buffer t) + + +(add-hook 'cperl-mode-hook 'n-cperl-mode-hook t) +(defun n-cperl-mode-hook () +; (setq cperl-indent-level 4) +; (setq cperl-continued-statement-offset 0) +; (setq cperl-extra-newline-before-brace t) + (set-face-background 'cperl-array-face "black") + (set-face-background 'cperl-hash-face "black") + ) + + + + + +(cond ((fboundp 'global-font-lock-mode) + ;; Customize face attributes + (setq font-lock-face-attributes + ;; Symbol-for-Face Foreground Background Bold Italic Underline + '((font-lock-comment-face "DarkGreen") + (font-lock-preprocessor-face "gray") + (font-lock-string-face "Sienna") + (font-lock-keyword-face "purple") + (font-lock-function-name-face "limegreen") + (font-lock-variable-name-face "Yellow") + (font-lock-type-face "Yellow") + )) + ;; Load the font-lock package. + (require 'font-lock) + ;; Maximum colors + (setq font-lock-maximum-decoration t) + ;; Turn on font-lock in all modes that support it + (global-font-lock-mode t))) + + + + + + + + +(set-background-color "black") +(set-foreground-color "white") +(set-cursor-color "white") + Added: freeswitch/trunk/support/.screenrc ============================================================================== --- (empty file) +++ freeswitch/trunk/support/.screenrc Sun Dec 7 11:23:35 2008 @@ -0,0 +1,2 @@ +escape ^\b +defscrollback 500000 Added: freeswitch/trunk/support/install-cc-mode.sh ============================================================================== --- (empty file) +++ freeswitch/trunk/support/install-cc-mode.sh Sun Dec 7 11:23:35 2008 @@ -0,0 +1,18 @@ +version=5.31.3 +wget http://easynews.dl.sourceforge.net/sourceforge/cc-mode/cc-mode-${version}.tar.gz +tar -zxvf cc-mode-${version}.tar.gz +cd cc-mode-${version} +emacs -batch -no-site-file -q -f batch-byte-compile cc-*.el + +if [ -d /usr/share/emacs ] ; then +target=/usr/share/emacs/site-lisp +else +target=/usr/local/share/emacs/site-lisp +fi + +cp *.elc $target +wget http://www.freeswitch.org/eg/nxml-mode-20041004.tar.gz +tar -zxvf nxml-mode-20041004.tar.gz +cd nxml-mode-20041004 +cp *.el* $target + Added: freeswitch/trunk/support/shinzon.pub ============================================================================== --- (empty file) +++ freeswitch/trunk/support/shinzon.pub Sun Dec 7 11:23:35 2008 @@ -0,0 +1 @@ +ssh-dss AAAAB3NzaC1kc3MAAACBAN5bSW/qC1n6pq2GXZ5JS6b6M6batv8rE/E8JcYlB3z/Ut2bfriQrgGT+RfO+nxJjbSgLohZp6fxppRnLC0fCheBZHq0XZqbpaDqKfppxYjUTqOk5NwfjsjhTvcRH7kCsKrPUDaWFuermLeM5LxM9xfc17WiHuAxjLuP8ztAaCsFAAAAFQC93iyYvzsNdBNOTnznO9mWN1XUAwAAAIEAqwqcScVI8VJOrTlTVi2tG8XAPc0mjhWrZ4Y7laRcPjeLuRpbeOQvGqsPtq4K1EAM6cleZkE5S6mCTf5rnTmev/VX11rk/GMJma7GdcKXW08Cz+dPhyNy7pmFi5uYKo9jG2smk6LVksCcpNeeCHKESePSQ0NE3drJoki+/8E7g3IAAACABW2tP88srlxpHjcmqd2HSjpFWcpzm49DWFdIqlWek3oBZsW5ImoCH2SfdZ7LEWXIvJRutOWwKahXjyOw08UkSzRPq3/lmU4fVZHgbo72TQNmXUOEOR0de7McrlJX3nOl2bu9TK4/b1inCWPnTYWyyrUjesuISKBiYflL4oryeKo= anthm at shinzon From ericdc at freeswitch.org Sun Dec 7 11:57:06 2008 From: ericdc at freeswitch.org (FreeSWITCH SVN) Date: Sun, 07 Dec 2008 14:57:06 -0500 Subject: [Freeswitch-svn] [commit] r10643 - freeswitch/trunk/src/mod/applications/mod_vmd Message-ID: Author: ericdc Date: Sun Dec 7 14:57:03 2008 New Revision: 10643 Log: Added extra credits. Adjusted indentation. Modified: freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c Modified: freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c (original) +++ freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c Sun Dec 7 14:57:03 2008 @@ -21,6 +21,16 @@ * * Eric des Courtis * + * Special thanks to the following companies for their help: + * - JohnnyVoIP + * - Magor Communications Corporation + * + * Special thanks to the following people for their help: + * - The FreeSWITCH Team + * - Matt Battig + * - Dean Swan + * - Lucas Cornelisse + * - Kevin Green * * mod_vmd.c -- Voicemail Detection Module * @@ -108,24 +118,24 @@ SWITCH_STANDARD_APP(vmd_start_function); /* Type that holds state information about the beep */ -typedef enum vmd_state{ +typedef enum vmd_state { BEEP_DETECTED, BEEP_NOT_DETECTED } vmd_state_t; /* Type that holds data for 5 points of discreet energy separation */ -typedef struct vmd_point{ +typedef struct vmd_point { double freq; double ampl; } vmd_point_t; /* Type that holds codec information */ -typedef struct vmd_codec_info{ +typedef struct vmd_codec_info { int rate; int channels; } vmd_codec_info_t; /* Type that holds session information pertinent to the vmd module */ -typedef struct vmd_session_info{ +typedef struct vmd_session_info { /* State of the session */ vmd_state_t state; /* Snapshot of DESA samples */ @@ -143,12 +153,12 @@ switch_size_t timestamp; } vmd_session_info_t; -static switch_bool_t process_data(vmd_session_info_t *vmd_info, switch_frame_t *frame); -static switch_bool_t vmd_callback(switch_media_bug_t *bug, void *user_data, switch_abc_type_t type); +static switch_bool_t process_data(vmd_session_info_t * vmd_info, switch_frame_t * frame); +static switch_bool_t vmd_callback(switch_media_bug_t * bug, void *user_data, switch_abc_type_t type); static double freq_estimator(double *x); static double ampl_estimator(double *x); -static void convert_pts(int16_t *i_pts, double *d_pts, int16_t max); -static void find_beep(vmd_session_info_t *vmd_info, switch_frame_t *frame); +static void convert_pts(int16_t * i_pts, double *d_pts, int16_t max); +static void find_beep(vmd_session_info_t * vmd_info, switch_frame_t * frame); static double median(double *m, int n); /* @@ -156,62 +166,59 @@ #define PRINT2(a, b) do{ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, a, b); }while(0) */ -static switch_bool_t vmd_callback(switch_media_bug_t *bug, - void *user_data, - switch_abc_type_t type) -{ - vmd_session_info_t *vmd_info; - switch_codec_t *read_codec; - switch_frame_t *frame; - - vmd_info = (vmd_session_info_t *)user_data; - if(vmd_info == NULL) { - return SWITCH_FALSE; - } - - switch(type){ - - case SWITCH_ABC_TYPE_INIT: - read_codec = switch_core_session_get_read_codec(vmd_info->session); - vmd_info->vmd_codec.rate = read_codec->implementation->samples_per_second; - vmd_info->vmd_codec.channels = read_codec->implementation->number_of_channels; - break; - - case SWITCH_ABC_TYPE_READ_PING: - case SWITCH_ABC_TYPE_CLOSE: - case SWITCH_ABC_TYPE_READ: - case SWITCH_ABC_TYPE_WRITE: - break; - - case SWITCH_ABC_TYPE_READ_REPLACE: - frame = switch_core_media_bug_get_read_replace_frame(bug); - return process_data(vmd_info, frame); - - case SWITCH_ABC_TYPE_WRITE_REPLACE: - break; - } - - return SWITCH_TRUE; -} - -static switch_bool_t process_data(vmd_session_info_t *vmd_info, - switch_frame_t *frame) -{ - uint32_t i; - unsigned int j; - double pts[P]; - int16_t *data; - int16_t max; - switch_ssize_t len; - - len = frame->samples * sizeof(int16_t); - data = (int16_t *)frame->data; - - for(max = (int16_t)abs(data[0]), i = 1; i < frame->samples; i++) { - if ((int16_t)abs(data[i]) > max) { - max = (int16_t)abs(data[i]); - } - } +static switch_bool_t vmd_callback(switch_media_bug_t * bug, void *user_data, switch_abc_type_t type) +{ + vmd_session_info_t *vmd_info; + switch_codec_t *read_codec; + switch_frame_t *frame; + + vmd_info = (vmd_session_info_t *) user_data; + if (vmd_info == NULL) { + return SWITCH_FALSE; + } + + switch (type) { + + case SWITCH_ABC_TYPE_INIT: + read_codec = switch_core_session_get_read_codec(vmd_info->session); + vmd_info->vmd_codec.rate = read_codec->implementation->samples_per_second; + vmd_info->vmd_codec.channels = read_codec->implementation->number_of_channels; + break; + + case SWITCH_ABC_TYPE_READ_PING: + case SWITCH_ABC_TYPE_CLOSE: + case SWITCH_ABC_TYPE_READ: + case SWITCH_ABC_TYPE_WRITE: + break; + + case SWITCH_ABC_TYPE_READ_REPLACE: + frame = switch_core_media_bug_get_read_replace_frame(bug); + return process_data(vmd_info, frame); + + case SWITCH_ABC_TYPE_WRITE_REPLACE: + break; + } + + return SWITCH_TRUE; +} + +static switch_bool_t process_data(vmd_session_info_t * vmd_info, switch_frame_t * frame) +{ + uint32_t i; + unsigned int j; + double pts[P]; + int16_t *data; + int16_t max; + switch_ssize_t len; + + len = frame->samples * sizeof(int16_t); + data = (int16_t *) frame->data; + + for (max = (int16_t) abs(data[0]), i = 1; i < frame->samples; i++) { + if ((int16_t) abs(data[i]) > max) { + max = (int16_t) abs(data[i]); + } + } /* if(vmd_info->data_len != len){ @@ -234,189 +241,184 @@ } */ - for(i = 0, j = vmd_info->pos; i < frame->samples; j++, j %= POINTS, i += 5) { - /* convert_pts(vmd_info->data + i, pts); */ - convert_pts(data + i, pts, max); - vmd_info->points[j].freq = TO_HZ(freq_estimator(pts)); - vmd_info->points[j].ampl = ampl_estimator(pts); - vmd_info->pos = j % POINTS; - find_beep(vmd_info, frame); + for (i = 0, j = vmd_info->pos; i < frame->samples; j++, j %= POINTS, i += 5) { + /* convert_pts(vmd_info->data + i, pts); */ + convert_pts(data + i, pts, max); + vmd_info->points[j].freq = TO_HZ(freq_estimator(pts)); + vmd_info->points[j].ampl = ampl_estimator(pts); + vmd_info->pos = j % POINTS; + find_beep(vmd_info, frame); } return SWITCH_TRUE; } -static void find_beep(vmd_session_info_t *vmd_info, switch_frame_t *frame) +static void find_beep(vmd_session_info_t * vmd_info, switch_frame_t * frame) { - int i; - int c; - double m[POINTS]; - double med; - unsigned int j = (vmd_info->pos + 1) % POINTS; - unsigned int k = j; - switch_event_t *event; - switch_status_t status; - switch_event_t *event_copy; - switch_channel_t *channel = switch_core_session_get_channel(vmd_info->session); - - switch(vmd_info->state){ - case BEEP_DETECTED: - for(c = 0, i = 0; i < POINTS; j++, j %= POINTS, i++){ - vmd_info->timestamp++; - if (vmd_info->points[j].freq < TOLERANCE_T(vmd_info->beep_freq) && - vmd_info->points[j].freq > TOLERANCE_B(vmd_info->beep_freq)) { - c++; - vmd_info->beep_freq = (vmd_info->beep_freq * 0.95) + (vmd_info->points[j].freq * 0.05); - } - } - - if (c < (POINTS - MAX_CHIRP)) { - vmd_info->state = BEEP_NOT_DETECTED; - if (vmd_info->timestamp < MIN_TIME) { - break; - } - - status = switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, VMD_EVENT_BEEP); - if (status != SWITCH_STATUS_SUCCESS) { - return; - } - - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Beep-Status", "stop"); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Beep-Time", "%d", (int)vmd_info->timestamp / POINTS); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Unique-ID", - "%s", switch_core_session_get_uuid(vmd_info->session)); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Frequency", "%6.4lf", vmd_info->beep_freq); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "vmd"); - - if ((switch_event_dup(&event_copy, event)) != SWITCH_STATUS_SUCCESS) { - return; - } - - switch_core_session_queue_event(vmd_info->session, &event); - switch_event_fire(&event_copy); - - switch_log_printf( - SWITCH_CHANNEL_LOG, - SWITCH_LOG_INFO, - "<<< VMD - Beep Detected >>>\n" - ); - switch_channel_set_variable(channel, "vmd_detect", "TRUE"); - - vmd_info->timestamp = 0; - } - - break; - - case BEEP_NOT_DETECTED: - - for(i = 0; i < POINTS; k++, k %= POINTS, i++){ - m[i] = vmd_info->points[k].freq; - if (ISNAN(m[i])) { - m[i] = 0.0; - } - } - - med = median(m, POINTS); - if (ISNAN(med)){ - for(i = 0; i < POINTS; i++){ - if (!ISNAN(m[i])){ - med = m[i]; - break; - } - } - } - - for(c = 0, i = 0; i < POINTS; j++, j %= POINTS, i++){ - if (vmd_info->points[j].freq < TOLERANCE_T(med) && - vmd_info->points[j].freq > TOLERANCE_B(med)){ - if (vmd_info->points[j].ampl > MIN_AMPL && - vmd_info->points[j].freq > MIN_FREQ && - vmd_info->points[j].freq < MAX_FREQ){ - c++; - } - } - } - - if(c >= VALID){ - vmd_info->state = BEEP_DETECTED; - vmd_info->beep_freq = med; - vmd_info->timestamp = 0; - } + int i; + int c; + double m[POINTS]; + double med; + unsigned int j = (vmd_info->pos + 1) % POINTS; + unsigned int k = j; + switch_event_t *event; + switch_status_t status; + switch_event_t *event_copy; + switch_channel_t *channel = switch_core_session_get_channel(vmd_info->session); + + switch (vmd_info->state) { + case BEEP_DETECTED: + for (c = 0, i = 0; i < POINTS; j++, j %= POINTS, i++) { + vmd_info->timestamp++; + if (vmd_info->points[j].freq < TOLERANCE_T(vmd_info->beep_freq) && + vmd_info->points[j].freq > TOLERANCE_B(vmd_info->beep_freq)) { + c++; + vmd_info->beep_freq = (vmd_info->beep_freq * 0.95) + (vmd_info->points[j].freq * 0.05); + } + } + + if (c < (POINTS - MAX_CHIRP)) { + vmd_info->state = BEEP_NOT_DETECTED; + if (vmd_info->timestamp < MIN_TIME) { + break; + } + + status = switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, VMD_EVENT_BEEP); + if (status != SWITCH_STATUS_SUCCESS) { + return; + } + + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Beep-Status", "stop"); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Beep-Time", "%d", (int) vmd_info->timestamp / POINTS); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Unique-ID", "%s", switch_core_session_get_uuid(vmd_info->session)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Frequency", "%6.4lf", vmd_info->beep_freq); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "vmd"); + + if ((switch_event_dup(&event_copy, event)) != SWITCH_STATUS_SUCCESS) { + return; + } - break; - } + switch_core_session_queue_event(vmd_info->session, &event); + switch_event_fire(&event_copy); + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "<<< VMD - Beep Detected >>>\n"); + switch_channel_set_variable(channel, "vmd_detect", "TRUE"); + + vmd_info->timestamp = 0; + } + + break; + + case BEEP_NOT_DETECTED: + + for (i = 0; i < POINTS; k++, k %= POINTS, i++) { + m[i] = vmd_info->points[k].freq; + if (ISNAN(m[i])) { + m[i] = 0.0; + } + } + + med = median(m, POINTS); + if (ISNAN(med)) { + for (i = 0; i < POINTS; i++) { + if (!ISNAN(m[i])) { + med = m[i]; + break; + } + } + } + + for (c = 0, i = 0; i < POINTS; j++, j %= POINTS, i++) { + if (vmd_info->points[j].freq < TOLERANCE_T(med) && vmd_info->points[j].freq > TOLERANCE_B(med)) { + if (vmd_info->points[j].ampl > MIN_AMPL && + vmd_info->points[j].freq > MIN_FREQ && vmd_info->points[j].freq < MAX_FREQ) { + c++; + } + } + } + + if (c >= VALID) { + vmd_info->state = BEEP_DETECTED; + vmd_info->beep_freq = med; + vmd_info->timestamp = 0; + } + + break; + } } /* Find the median of an array of doubles */ static double median(double *m, int n) { - int i; - int less; - int greater; - int equal; - double min; - double max; - double guess; - double maxltguess; - double mingtguess; - - min = max = m[0] ; - - for (i = 1; i < n; i++) { - if(m[i] < min) min = m[i]; - if(m[i] > max) max = m[i]; - } - - for(;;) { - guess = ( min + max ) / 2; - less = 0; - greater = 0; - equal = 0; - maxltguess = min; - mingtguess = max; - - for(i = 0; i < n; i++) { - if (m[i] < guess) { - less++; - if(m[i] > maxltguess) { - maxltguess = m[i]; - } - } else if (m[i] > guess) { - greater++; - if(m[i] < mingtguess) { - mingtguess = m[i]; - } - } else { - equal++; - } - } - - if (less <= ( n + 1 ) / 2 && greater <= ( n + 1 ) / 2) { - break; - } else if (less > greater) { - max = maxltguess; - } else { - min = mingtguess; - } - } - - if (less >= ( n + 1 ) / 2) { - return maxltguess; - } else if (less + equal >= ( n + 1 ) / 2) { - return guess; - } + int i; + int less; + int greater; + int equal; + double min; + double max; + double guess; + double maxltguess; + double mingtguess; + + min = max = m[0]; + + for (i = 1; i < n; i++) { + if (m[i] < min) + min = m[i]; + if (m[i] > max) + max = m[i]; + } + + for (;;) { + guess = (min + max) / 2; + less = 0; + greater = 0; + equal = 0; + maxltguess = min; + mingtguess = max; + + for (i = 0; i < n; i++) { + if (m[i] < guess) { + less++; + if (m[i] > maxltguess) { + maxltguess = m[i]; + } + } else if (m[i] > guess) { + greater++; + if (m[i] < mingtguess) { + mingtguess = m[i]; + } + } else { + equal++; + } + } + + if (less <= (n + 1) / 2 && greater <= (n + 1) / 2) { + break; + } else if (less > greater) { + max = maxltguess; + } else { + min = mingtguess; + } + } + + if (less >= (n + 1) / 2) { + return maxltguess; + } else if (less + equal >= (n + 1) / 2) { + return guess; + } - return mingtguess; + return mingtguess; } /* Convert many points for Signed L16 to relative floating point */ -static void convert_pts(int16_t *i_pts, double *d_pts, int16_t max) +static void convert_pts(int16_t * i_pts, double *d_pts, int16_t max) { int i; - for(i = 0; i < P; i++) { - /* Signed L16 to relative floating point conversion */ - d_pts[i] = ((((double)(i_pts[i]) + (double)max) / (double)(2 * max)) - 0.5) * 2.0; - } + for (i = 0; i < P; i++) { + /* Signed L16 to relative floating point conversion */ + d_pts[i] = ((((double) (i_pts[i]) + (double) max) / (double) (2 * max)) - 0.5) * 2.0; + } } /* Amplitude estimator for DESA-2 */ @@ -427,22 +429,18 @@ freq_sq = freq_estimator(x); freq_sq *= freq_sq; - return sqrt( PSI(x) / sin(freq_sq) ); + return sqrt(PSI(x) / sin(freq_sq)); } /* The DESA-2 algorithm */ double freq_estimator(double *x) { - return 0.5 * acos( - (((x[2] * x[2]) - (x[0] * x[4])) - - - ( (x[1] * x[1]) - (x[0] * x[2])) - - - ( (x[3] * x[3]) - (x[2] * x[4]))) - / - (2.0 * ((x[2] * x[2]) - (x[1] * x[3]))) - - ); + return 0.5 * acos((((x[2] * x[2]) - (x[0] * x[4])) + - ((x[1] * x[1]) - (x[0] * x[2])) + - ((x[3] * x[3]) - (x[2] * x[4]))) + / (2.0 * ((x[2] * x[2]) - (x[1] * x[3]))) + + ); } @@ -451,20 +449,13 @@ switch_application_interface_t *app_interface; switch_api_interface_t *api_interface; /* connect my internal structure to the blank pointer passed to me */ - *module_interface = - switch_loadable_module_create_module_interface(pool, modname); - - switch_log_printf( - SWITCH_CHANNEL_LOG, - SWITCH_LOG_NOTICE, - "Voicemail detection enabled\n" - ); - - SWITCH_ADD_APP(app_interface, "vmd", "Detect beeps", "Detect voicemail beeps", - vmd_start_function, "[start] [stop]", SAF_NONE); - - SWITCH_ADD_API(api_interface, "vmd", "Detected voicemail beeps", - vmd_api_main, VMD_SYNTAX); + *module_interface = switch_loadable_module_create_module_interface(pool, modname); + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Voicemail detection enabled\n"); + + SWITCH_ADD_APP(app_interface, "vmd", "Detect beeps", "Detect voicemail beeps", vmd_start_function, "[start] [stop]", SAF_NONE); + + SWITCH_ADD_API(api_interface, "vmd", "Detected voicemail beeps", vmd_api_main, VMD_SYNTAX); /* indicate that the module should continue to be loaded */ return SWITCH_STATUS_SUCCESS; @@ -473,84 +464,64 @@ /* Same as api function see it for comments */ SWITCH_STANDARD_APP(vmd_start_function) { - switch_media_bug_t *bug; - switch_status_t status; - switch_channel_t *channel; - vmd_session_info_t *vmd_info; - int i; - - if (session == NULL) return; - - channel = switch_core_session_get_channel(session); - - /* Is this channel already set? */ - bug = (switch_media_bug_t *) switch_channel_get_private(channel, "_vmd_"); - /* If yes */ - if (bug != NULL){ - /* If we have a stop remove audio bug */ - if(strcasecmp(data, "stop") == 0){ - switch_channel_set_private(channel, "_vmd_", NULL); - switch_core_media_bug_remove(session, &bug); - return; - } - - /* We have already started */ - switch_log_printf( - SWITCH_CHANNEL_LOG, - SWITCH_LOG_WARNING, - "Cannot run 2 at once on the same channel!\n" - ); - - return; - } - - vmd_info = (vmd_session_info_t *)switch_core_session_alloc( - session, - sizeof(vmd_session_info_t) - ); - - vmd_info->state = BEEP_NOT_DETECTED; - vmd_info->session = session; - vmd_info->pos = 0; - /* - vmd_info->data = NULL; - vmd_info->data_len = 0; - */ - for(i = 0; i < POINTS; i++){ - vmd_info->points[i].freq = 0.0; - vmd_info->points[i].ampl = 0.0; - } - - status = switch_core_media_bug_add( - session, - vmd_callback, - vmd_info, - 0, - SMBF_READ_REPLACE, - &bug - ); - - if(status != SWITCH_STATUS_SUCCESS){ - switch_log_printf( - SWITCH_CHANNEL_LOG, - SWITCH_LOG_ERROR, - "Failure hooking to stream\n" - ); - return; - } + switch_media_bug_t *bug; + switch_status_t status; + switch_channel_t *channel; + vmd_session_info_t *vmd_info; + int i; + + if (session == NULL) + return; + + channel = switch_core_session_get_channel(session); + + /* Is this channel already set? */ + bug = (switch_media_bug_t *) switch_channel_get_private(channel, "_vmd_"); + /* If yes */ + if (bug != NULL) { + /* If we have a stop remove audio bug */ + if (strcasecmp(data, "stop") == 0) { + switch_channel_set_private(channel, "_vmd_", NULL); + switch_core_media_bug_remove(session, &bug); + return; + } + + /* We have already started */ + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot run 2 at once on the same channel!\n"); + + return; + } - switch_channel_set_private(channel, "_vmd_", bug); + vmd_info = (vmd_session_info_t *) switch_core_session_alloc(session, sizeof(vmd_session_info_t) + ); + + vmd_info->state = BEEP_NOT_DETECTED; + vmd_info->session = session; + vmd_info->pos = 0; + /* + vmd_info->data = NULL; + vmd_info->data_len = 0; + */ + for (i = 0; i < POINTS; i++) { + vmd_info->points[i].freq = 0.0; + vmd_info->points[i].ampl = 0.0; + } + + status = switch_core_media_bug_add(session, vmd_callback, vmd_info, 0, SMBF_READ_REPLACE, &bug); + + if (status != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failure hooking to stream\n"); + return; + } + + switch_channel_set_private(channel, "_vmd_", bug); } /* Called when the system shuts down */ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_vmd_shutdown) { - switch_log_printf( - SWITCH_CHANNEL_LOG, - SWITCH_LOG_NOTICE, - "Voicemail detection disabled\n" - ); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Voicemail detection disabled\n"); return SWITCH_STATUS_SUCCESS; } @@ -568,11 +539,11 @@ char *uuid; char *command; int i; - + /* No command? Display usage */ - if(cmd == NULL){ - stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX); - return SWITCH_STATUS_SUCCESS; + if (cmd == NULL) { + stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX); + return SWITCH_STATUS_SUCCESS; } /* Duplicated contents of original string */ @@ -582,23 +553,23 @@ /* If we don't have the expected number of parameters * display usage */ - if (argc != VMD_PARAMS){ - stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX); - switch_safe_free(ccmd); - return SWITCH_STATUS_SUCCESS; + if (argc != VMD_PARAMS) { + stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX); + switch_safe_free(ccmd); + return SWITCH_STATUS_SUCCESS; } uuid = argv[0]; command = argv[1]; - + /* using uuid locate a reference to the FreeSWITCH session */ vmd_session = switch_core_session_locate(uuid); /* If the session was not found exit */ if (vmd_session == NULL) { - switch_safe_free(ccmd); - stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX); - return SWITCH_STATUS_FALSE; + switch_safe_free(ccmd); + stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX); + return SWITCH_STATUS_FALSE; } /* Get current channel of the session to tag the session @@ -608,9 +579,9 @@ /* Is this channel already set? */ bug = (switch_media_bug_t *) switch_channel_get_private(channel, "_vmd_"); /* If yes */ - if (bug != NULL){ + if (bug != NULL) { /* If we have a stop remove audio bug */ - if(strcasecmp(command, "stop") == 0) { + if (strcasecmp(command, "stop") == 0) { switch_channel_set_private(channel, "_vmd_", NULL); switch_core_media_bug_remove(vmd_session, &bug); switch_safe_free(ccmd); @@ -618,30 +589,24 @@ return SWITCH_STATUS_SUCCESS; } - /* We have already started */ - switch_log_printf( - SWITCH_CHANNEL_LOG, - SWITCH_LOG_WARNING, - "Cannot run 2 at once on the same channel!\n" - ); - - switch_safe_free(ccmd); - return SWITCH_STATUS_FALSE; + /* We have already started */ + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot run 2 at once on the same channel!\n"); + + switch_safe_free(ccmd); + return SWITCH_STATUS_FALSE; } /* If we don't see the expected start exit */ - if(strcasecmp(command, "start") != 0) { - switch_safe_free(ccmd); - stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX); - return SWITCH_STATUS_FALSE; + if (strcasecmp(command, "start") != 0) { + switch_safe_free(ccmd); + stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX); + return SWITCH_STATUS_FALSE; } /* Allocate memory attached to this FreeSWITCH session for * use in the callback routine and to store state information */ - vmd_info = (vmd_session_info_t *)switch_core_session_alloc( - vmd_session, - sizeof(vmd_session_info_t) - ); + vmd_info = (vmd_session_info_t *) switch_core_session_alloc(vmd_session, sizeof(vmd_session_info_t) + ); /* Set initial values and states */ vmd_info->state = BEEP_NOT_DETECTED; @@ -652,40 +617,29 @@ vmd_info->data_len = 0; */ - for(i = 0; i < POINTS; i++) { - vmd_info->points[i].freq = 0.0; - vmd_info->points[i].ampl = 0.0; + for (i = 0; i < POINTS; i++) { + vmd_info->points[i].freq = 0.0; + vmd_info->points[i].ampl = 0.0; } /* Add a media bug that allows me to intercept the * reading leg of the audio stream */ - status = switch_core_media_bug_add( - vmd_session, - vmd_callback, - vmd_info, - 0, - SMBF_READ_REPLACE, - &bug - ); + status = switch_core_media_bug_add(vmd_session, vmd_callback, vmd_info, 0, SMBF_READ_REPLACE, &bug); /* If adding a media bug fails exit */ if (status != SWITCH_STATUS_SUCCESS) { - switch_log_printf( - SWITCH_CHANNEL_LOG, - SWITCH_LOG_ERROR, - "Failure hooking to stream\n" - ); - - switch_safe_free(ccmd); - return SWITCH_STATUS_FALSE; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failure hooking to stream\n"); + + switch_safe_free(ccmd); + return SWITCH_STATUS_FALSE; } /* Set the vmd tag to detect an existing vmd media bug */ switch_channel_set_private(channel, "_vmd_", bug); - + /* Everything went according to plan! Notify the user */ - stream->write_function(stream, "+OK\n"); - + stream->write_function(stream, "+OK\n"); + switch_safe_free(ccmd); return SWITCH_STATUS_SUCCESS; } @@ -701,4 +655,3 @@ * For VIM: * vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab: */ - From intralanman at freeswitch.org Sun Dec 7 12:10:33 2008 From: intralanman at freeswitch.org (FreeSWITCH SVN) Date: Sun, 07 Dec 2008 15:10:33 -0500 Subject: [Freeswitch-svn] [commit] r10644 - freeswitch/trunk/scripts/contrib/intralanman/C/lcr/mod_lcr Message-ID: Author: intralanman Date: Sun Dec 7 15:10:32 2008 New Revision: 10644 Log: add rupa's patch for detecting rand on diff db's Modified: freeswitch/trunk/scripts/contrib/intralanman/C/lcr/mod_lcr/mod_lcr.c Modified: freeswitch/trunk/scripts/contrib/intralanman/C/lcr/mod_lcr/mod_lcr.c ============================================================================== --- freeswitch/trunk/scripts/contrib/intralanman/C/lcr/mod_lcr/mod_lcr.c (original) +++ freeswitch/trunk/scripts/contrib/intralanman/C/lcr/mod_lcr/mod_lcr.c Sun Dec 7 15:10:32 2008 @@ -57,6 +57,9 @@ "Dialstring", }; +/* sql for random function */ +char *db_random = NULL; + struct odbc_obj { switch_odbc_handle_t *handle; SQLHSTMT stmt; @@ -198,10 +201,34 @@ return SWITCH_STATUS_SUCCESS; } +/* try each type of random until we suceed */ +static switch_bool_t set_db_random() { + char *sql = NULL; + if (globals.odbc_dsn) { + sql = "SELECT * FROM lcr ORDER BY rand() LIMIT 1"; + if(switch_odbc_handle_exec(globals.master_odbc, sql, NULL) + == SWITCH_ODBC_SUCCESS) { + db_random = "rand()"; + return SWITCH_TRUE; + } + sql = "SELECT * FROM lcr ORDER BY random() LIMIT 1"; + if(switch_odbc_handle_exec(globals.master_odbc, sql, NULL) + == SWITCH_ODBC_SUCCESS) { + db_random = "random()"; + return SWITCH_TRUE; + } + } + return SWITCH_FALSE; +} + static switch_bool_t lcr_execute_sql_callback(char *sql, switch_core_db_callback_func_t callback, void *pdata) { if (globals.odbc_dsn) { - switch_odbc_handle_callback_exec(globals.master_odbc, sql, callback, pdata); - return SWITCH_TRUE; + if(switch_odbc_handle_callback_exec(globals.master_odbc, sql, callback, pdata) + == SWITCH_ODBC_FAIL) { + return SWITCH_FALSE; + } else { + return SWITCH_TRUE; + } } return SWITCH_FALSE; } @@ -271,6 +298,7 @@ switch_stream_handle_t sql_stream = { 0 }; size_t n, digit_len = strlen(digits); char *digits_copy; + switch_bool_t lookup_status; if (switch_strlen_zero(digits)) { return SWITCH_FALSE; @@ -293,14 +321,22 @@ if(lcr_profile > 0) { sql_stream.write_function(&sql_stream, "AND lcr_profile=%d ", lcr_profile); } - sql_stream.write_function(&sql_stream, "ORDER BY digits DESC, rate, rand();"); + sql_stream.write_function(&sql_stream, "ORDER BY digits DESC, rate"); + if(db_random) { + sql_stream.write_function(&sql_stream, ", %s", db_random); + } + sql_stream.write_function(&sql_stream, ";"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s\n", (char *)sql_stream.data); - lcr_execute_sql_callback((char *)sql_stream.data, route_add_callback, cb_struct); + lookup_status = lcr_execute_sql_callback((char *)sql_stream.data, route_add_callback, cb_struct); switch_safe_free(sql_stream.data); - return SWITCH_STATUS_SUCCESS; + if(lookup_status) { + return SWITCH_STATUS_SUCCESS; + } else { + return SWITCH_STATUS_GENERR; + } } static switch_status_t lcr_load_config() { @@ -486,6 +522,7 @@ lcr_route current = NULL; max_obj_t maximum_lengths = { 0 }; callback_t cb_struct = { 0 }; + switch_status_t lookup_status = SWITCH_STATUS_SUCCESS; //switch_malloc(maximum_lengths, sizeof(max_obj_t)); if (switch_strlen_zero(cmd)) { @@ -511,9 +548,10 @@ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO , "data passed to lcr is [%s]\n", cmd ); + lookup_status = lcr_do_lookup(&cb_struct, destination_number, lcr_profile); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO , "lcr lookup returned [%d]\n" - , lcr_do_lookup(&cb_struct, destination_number, lcr_profile) + , lookup_status ); if (cb_struct.head != NULL) { size_t len; @@ -568,7 +606,11 @@ destroy_list(&cb_struct.head); switch_safe_free(dialstring); } else { - stream->write_function(stream, "No Routes To Display\n"); + if(lookup_status == SWITCH_STATUS_SUCCESS) { + stream->write_function(stream, "No Routes To Display\n"); + } else { + stream->write_function(stream, "Error looking up routes\n"); + } } } @@ -601,6 +643,12 @@ if (switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, globals.pool) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "failed to initialize mutex\n"); } + + if(set_db_random() == SWITCH_TRUE) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Database RANDOM function set to %s\n", db_random); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to determine database RANDOM function\n"); + }; SWITCH_ADD_API(dialplan_lcr_api_interface, "lcr", "Least Cost Routing Module", dialplan_lcr_function, LCR_SYNTAX); SWITCH_ADD_APP(app_interface, "lcr", "Perform an LCR lookup", "Perform an LCR lookup", From brian at freeswitch.org Sun Dec 7 13:19:38 2008 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Sun, 07 Dec 2008 16:19:38 -0500 Subject: [Freeswitch-svn] [commit] r10645 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: brian Date: Sun Dec 7 16:19:37 2008 New Revision: 10645 Log: bugs me Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c Sun Dec 7 16:19:37 2008 @@ -856,7 +856,7 @@ " \r\n" " \n" " \n" - " %s" + " %s\n" " \n" "", id, open, prpid, status); } From anthm at freeswitch.org Sun Dec 7 14:11:34 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Sun, 07 Dec 2008 17:11:34 -0500 Subject: [Freeswitch-svn] [commit] r10646 - freeswitch/trunk/libs/libdingaling/src Message-ID: Author: anthm Date: Sun Dec 7 17:11:34 2008 New Revision: 10646 Log: LIBDING-10 Modified: freeswitch/trunk/libs/libdingaling/src/libdingaling.c Modified: freeswitch/trunk/libs/libdingaling/src/libdingaling.c ============================================================================== --- freeswitch/trunk/libs/libdingaling/src/libdingaling.c (original) +++ freeswitch/trunk/libs/libdingaling/src/libdingaling.c Sun Dec 7 17:11:34 2008 @@ -1177,7 +1177,7 @@ } break; case IKS_NODE_NORMAL: - if (node && strcmp("stream:features", iks_name_nons(node)) == 0) { + if (node && strcmp("stream:features", iks_name(node)) == 0) { handle->features = iks_stream_features(node); if (ldl_test_flag(handle, LDL_FLAG_TLS) && !iks_is_secure(handle->parser)) break; From mikej at freeswitch.org Sun Dec 7 14:25:19 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Sun, 07 Dec 2008 17:25:19 -0500 Subject: [Freeswitch-svn] [commit] r10647 - freeswitch/trunk/src/mod/asr_tts/mod_cepstral Message-ID: Author: mikej Date: Sun Dec 7 17:25:19 2008 New Revision: 10647 Log: add framework to cflags Modified: freeswitch/trunk/src/mod/asr_tts/mod_cepstral/Makefile Modified: freeswitch/trunk/src/mod/asr_tts/mod_cepstral/Makefile ============================================================================== --- freeswitch/trunk/src/mod/asr_tts/mod_cepstral/Makefile (original) +++ freeswitch/trunk/src/mod/asr_tts/mod_cepstral/Makefile Sun Dec 7 17:25:19 2008 @@ -1,6 +1,6 @@ LOCAL_INSERT_LDFLAGS=if test $$osarch = "Darwin" ; then echo "-framework swift" ; else echo "-L$(SWIFT_HOME)/lib -L/opt/swift/lib -lswift -lm" ; fi ; -LOCAL_INSERT_CFLAGS=test $$osarch = "Darwin" || echo "-I$(SWIFT_HOME)/include -I/opt/swift/include"; +LOCAL_INSERT_CFLAGS=if test $$osarch = "Darwin" ; then echo "-framework swift" ; else echo "-I$(SWIFT_HOME)/include -I/opt/swift/include"; fi ; LOCAL_CFLAGS=-w include ../../../../build/modmake.rules From intralanman at freeswitch.org Sun Dec 7 14:36:33 2008 From: intralanman at freeswitch.org (FreeSWITCH SVN) Date: Sun, 07 Dec 2008 17:36:33 -0500 Subject: [Freeswitch-svn] [commit] r10648 - in freeswitch/trunk/scripts/contrib/intralanman/C/lcr: . mod_lcr Message-ID: Author: intralanman Date: Sun Dec 7 17:36:33 2008 New Revision: 10648 Log: add support for ordering by rate, quality, or reliability... more to come Modified: freeswitch/trunk/scripts/contrib/intralanman/C/lcr/lcr.conf.xml freeswitch/trunk/scripts/contrib/intralanman/C/lcr/mod_lcr/mod_lcr.c Modified: freeswitch/trunk/scripts/contrib/intralanman/C/lcr/lcr.conf.xml ============================================================================== --- freeswitch/trunk/scripts/contrib/intralanman/C/lcr/lcr.conf.xml (original) +++ freeswitch/trunk/scripts/contrib/intralanman/C/lcr/lcr.conf.xml Sun Dec 7 17:36:33 2008 @@ -1,6 +1,20 @@ - + - - + + + + + + + + + + + + + + + + Modified: freeswitch/trunk/scripts/contrib/intralanman/C/lcr/mod_lcr/mod_lcr.c ============================================================================== --- freeswitch/trunk/scripts/contrib/intralanman/C/lcr/mod_lcr/mod_lcr.c (original) +++ freeswitch/trunk/scripts/contrib/intralanman/C/lcr/mod_lcr/mod_lcr.c Sun Dec 7 17:36:33 2008 @@ -101,6 +101,13 @@ typedef struct max_obj max_obj_t; typedef max_obj_t *max_len; +struct profile_obj { + char *name; + uint16_t id; + char *order_by; +}; +typedef struct profile_obj profile_t; + struct callback_obj { lcr_route head; int matches; @@ -114,6 +121,8 @@ char *odbc_dsn; switch_mutex_t *mutex; switch_odbc_handle_t *master_odbc; + switch_hash_t *profile_hash; + profile_t *default_profile; void *filler1; } globals; @@ -293,16 +302,25 @@ return SWITCH_STATUS_SUCCESS; } -switch_status_t lcr_do_lookup(callback_t *cb_struct, char *digits, uint16_t lcr_profile) { +switch_status_t lcr_do_lookup(callback_t *cb_struct, char *digits, char* profile_name) { /* instantiate the object/struct we defined earlier */ switch_stream_handle_t sql_stream = { 0 }; size_t n, digit_len = strlen(digits); char *digits_copy; + profile_t *profile; switch_bool_t lookup_status; if (switch_strlen_zero(digits)) { return SWITCH_FALSE; } + + /* locate the profile */ + if(switch_strlen_zero(profile_name)) { + profile = globals.default_profile; + } else if (!(profile = switch_core_hash_find(globals.profile_hash, profile_name))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error invalid profile %s\n", profile_name); + return SWITCH_STATUS_FALSE; + } digits_copy = strdup(digits); @@ -318,10 +336,10 @@ sql_stream.write_function(&sql_stream, "%s%s", (n==digit_len ? "" : ", "), digits_copy); } sql_stream.write_function(&sql_stream, ") AND CURRENT_TIMESTAMP BETWEEN date_start AND date_end "); - if(lcr_profile > 0) { - sql_stream.write_function(&sql_stream, "AND lcr_profile=%d ", lcr_profile); + if(profile->id > 0) { + sql_stream.write_function(&sql_stream, "AND lcr_profile=%d ", profile->id); } - sql_stream.write_function(&sql_stream, "ORDER BY digits DESC, rate"); + sql_stream.write_function(&sql_stream, "ORDER BY digits DESC, %s", profile->order_by); if(db_random) { sql_stream.write_function(&sql_stream, ", %s", db_random); } @@ -341,10 +359,11 @@ static switch_status_t lcr_load_config() { char *cf = "lcr.conf"; - switch_xml_t cfg, xml, settings, param; + switch_xml_t cfg, xml, settings, param, x_profile, x_profiles; switch_status_t status = SWITCH_STATUS_SUCCESS; char *odbc_user = NULL; char *odbc_pass = NULL; + profile_t *profile = NULL; if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf); @@ -369,6 +388,65 @@ } } } + + /* define default profile */ + profile = switch_core_alloc(globals.pool, sizeof(*profile)); + profile->name = "global_default"; + profile->order_by = "rate"; + globals.default_profile = profile; + + switch_core_hash_init(&globals.profile_hash, globals.pool); + if((x_profiles = switch_xml_child(cfg, "profiles"))) { + for (x_profile = switch_xml_child(x_profiles, "profile"); x_profile; x_profile = x_profile->next) { + char *name = (char *) switch_xml_attr_soft(x_profile, "name"); + char *order_by = NULL; + char *id_s = NULL; + + for (param = switch_xml_child(x_profile, "param"); param; param = param->next) { + char *var, *val; + + var = (char *) switch_xml_attr_soft(param, "name"); + val = (char *) switch_xml_attr_soft(param, "value"); + + if (!strcasecmp(var, "order_by") && !switch_strlen_zero(val)) { + if (!strcasecmp(val, "quality")) { + order_by = "quality DESC"; + } else if(!strcasecmp(val, "reliability")) { + order_by = "reliability DESC"; + } else { + order_by = val; + } + } else if (!strcasecmp(var, "id") && !switch_strlen_zero(val)) { + id_s = val; + } + } + + if(switch_strlen_zero(name)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No name specified.\n"); + } else { + profile = switch_core_alloc(globals.pool, sizeof(*profile)); + profile->name = switch_core_strdup(globals.pool, name); + + if(!switch_strlen_zero(order_by)) { + profile->order_by = switch_core_strdup(globals.pool, order_by); + } else { + /* default to rate */ + profile->order_by = "rate"; + } + if(!switch_strlen_zero(id_s)) { + profile->id = atoi(id_s); + } + + switch_core_hash_insert(globals.profile_hash, profile->name, profile); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Loaded lcr profile %s.\n", profile->name); + } + } + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "No lcr profiles defined.\n"); + } + + + if (globals.odbc_dsn) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO , "dsn is \"%s\", user is \"%s\", and password is \"%s\"\n" @@ -414,7 +492,7 @@ callback_t routes = { 0 }; lcr_route cur_route = { 0 }; char *bridge_data = NULL; - uint16_t lcr_profile = 0; + char *lcr_profile = NULL; if (!caller_profile) { caller_profile = switch_channel_get_caller_profile(channel); @@ -467,7 +545,7 @@ char *rbp = rbuf; switch_size_t l = 0, rbl = sizeof(rbuf); uint32_t cnt = 1; - uint16_t lcr_profile = 0; + char *lcr_profile = NULL; switch_channel_t *channel = switch_core_session_get_channel(session); char *last_delim = "|"; callback_t routes = { 0 }; @@ -480,13 +558,7 @@ if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) { dest = argv[0]; if(argc > 1) { - if((uint16_t)atoi(argv[1]) > 0 && (uint16_t)atoi(argv[1]) < 0xFFFF) { - lcr_profile = (uint16_t)atoi(argv[1]); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, - "lcr profile MUST be an integer NOT '%s'\n", argv[1] - ); - } + lcr_profile = argv[1]; } switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "LCR Lookup on %s\n", dest); @@ -518,7 +590,7 @@ char *mydata = NULL; char *dialstring = NULL; char *destination_number = NULL; - uint16_t lcr_profile = 0; + char *lcr_profile = NULL; lcr_route current = NULL; max_obj_t maximum_lengths = { 0 }; callback_t cb_struct = { 0 }; @@ -534,14 +606,7 @@ if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) { destination_number = strdup(argv[0]); if(argc > 1) { - if((uint16_t)atoi(argv[1]) > 0 && (uint16_t)atoi(argv[1]) < 0xFFFF) { - lcr_profile = (uint16_t)atoi(argv[1]); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR - , "lcr profile MUST be an integer, NOT '%s'\n", argv[1] - ); - goto usage; - } + lcr_profile = argv[1]; } cb_struct.lookup_number = destination_number; @@ -635,6 +700,7 @@ #endif globals.pool = pool; + if (lcr_load_config() != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to load lcr config file\n"); From mikej at freeswitch.org Sun Dec 7 15:09:26 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Sun, 07 Dec 2008 18:09:26 -0500 Subject: [Freeswitch-svn] [commit] r10649 - freeswitch/trunk/src/mod/asr_tts/mod_cepstral Message-ID: Author: mikej Date: Sun Dec 7 18:09:26 2008 New Revision: 10649 Log: cepstral osx build try Modified: freeswitch/trunk/src/mod/asr_tts/mod_cepstral/Makefile freeswitch/trunk/src/mod/asr_tts/mod_cepstral/mod_cepstral.c Modified: freeswitch/trunk/src/mod/asr_tts/mod_cepstral/Makefile ============================================================================== --- freeswitch/trunk/src/mod/asr_tts/mod_cepstral/Makefile (original) +++ freeswitch/trunk/src/mod/asr_tts/mod_cepstral/Makefile Sun Dec 7 18:09:26 2008 @@ -1,6 +1,6 @@ LOCAL_INSERT_LDFLAGS=if test $$osarch = "Darwin" ; then echo "-framework swift" ; else echo "-L$(SWIFT_HOME)/lib -L/opt/swift/lib -lswift -lm" ; fi ; -LOCAL_INSERT_CFLAGS=if test $$osarch = "Darwin" ; then echo "-framework swift" ; else echo "-I$(SWIFT_HOME)/include -I/opt/swift/include"; fi ; +LOCAL_INSERT_CFLAGS=if test $$osarch = "Darwin" ; then echo "-I/Library/Frameworks/swift.framework/Versions/5/Headers/" ; else echo "-I$(SWIFT_HOME)/include -I/opt/swift/include"; fi ; LOCAL_CFLAGS=-w include ../../../../build/modmake.rules Modified: freeswitch/trunk/src/mod/asr_tts/mod_cepstral/mod_cepstral.c ============================================================================== --- freeswitch/trunk/src/mod/asr_tts/mod_cepstral/mod_cepstral.c (original) +++ freeswitch/trunk/src/mod/asr_tts/mod_cepstral/mod_cepstral.c Sun Dec 7 18:09:26 2008 @@ -38,11 +38,7 @@ #ifdef __ICC #pragma warning (disable:188) #endif -#ifdef MACOSX -#include -#else #include -#endif #include #define MY_BUF_LEN 1024 * 32 From intralanman at freeswitch.org Sun Dec 7 21:33:40 2008 From: intralanman at freeswitch.org (FreeSWITCH SVN) Date: Mon, 08 Dec 2008 00:33:40 -0500 Subject: [Freeswitch-svn] [commit] r10650 - in freeswitch/trunk/scripts/contrib/intralanman/C/lcr: . mod_lcr Message-ID: Author: intralanman Date: Mon Dec 8 00:33:39 2008 New Revision: 10650 Log: update to allow secondary order by Modified: freeswitch/trunk/scripts/contrib/intralanman/C/lcr/lcr.conf.xml freeswitch/trunk/scripts/contrib/intralanman/C/lcr/mod_lcr/mod_lcr.c Modified: freeswitch/trunk/scripts/contrib/intralanman/C/lcr/lcr.conf.xml ============================================================================== --- freeswitch/trunk/scripts/contrib/intralanman/C/lcr/lcr.conf.xml (original) +++ freeswitch/trunk/scripts/contrib/intralanman/C/lcr/lcr.conf.xml Mon Dec 8 00:33:39 2008 @@ -6,15 +6,15 @@ - + - + - + - + - + Modified: freeswitch/trunk/scripts/contrib/intralanman/C/lcr/mod_lcr/mod_lcr.c ============================================================================== --- freeswitch/trunk/scripts/contrib/intralanman/C/lcr/mod_lcr/mod_lcr.c (original) +++ freeswitch/trunk/scripts/contrib/intralanman/C/lcr/mod_lcr/mod_lcr.c Mon Dec 8 00:33:39 2008 @@ -339,7 +339,7 @@ if(profile->id > 0) { sql_stream.write_function(&sql_stream, "AND lcr_profile=%d ", profile->id); } - sql_stream.write_function(&sql_stream, "ORDER BY digits DESC, %s", profile->order_by); + sql_stream.write_function(&sql_stream, "ORDER BY digits DESC%s", profile->order_by); if(db_random) { sql_stream.write_function(&sql_stream, ", %s", db_random); } @@ -392,16 +392,19 @@ /* define default profile */ profile = switch_core_alloc(globals.pool, sizeof(*profile)); profile->name = "global_default"; - profile->order_by = "rate"; + profile->order_by = ", rate"; globals.default_profile = profile; switch_core_hash_init(&globals.profile_hash, globals.pool); if((x_profiles = switch_xml_child(cfg, "profiles"))) { for (x_profile = switch_xml_child(x_profiles, "profile"); x_profile; x_profile = x_profile->next) { char *name = (char *) switch_xml_attr_soft(x_profile, "name"); - char *order_by = NULL; + switch_stream_handle_t order_by = { 0 }; char *id_s = NULL; + int argc, x = 0; + char *argv[4] = { 0 }; + SWITCH_STANDARD_STREAM(order_by); for (param = switch_xml_child(x_profile, "param"); param; param = param->next) { char *var, *val; @@ -409,12 +412,30 @@ val = (char *) switch_xml_attr_soft(param, "value"); if (!strcasecmp(var, "order_by") && !switch_strlen_zero(val)) { - if (!strcasecmp(val, "quality")) { - order_by = "quality DESC"; - } else if(!strcasecmp(val, "reliability")) { - order_by = "reliability DESC"; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "param val is %s\n", val); + if ((argc = switch_separate_string(val, ',', argv, (sizeof(argv) / sizeof(argv[0]))))) { + for (x=0; xname = switch_core_strdup(globals.pool, name); - if(!switch_strlen_zero(order_by)) { - profile->order_by = switch_core_strdup(globals.pool, order_by); + if(!switch_strlen_zero((char *)order_by.data)) { + profile->order_by = switch_core_strdup(globals.pool, (char *)order_by.data); + switch_safe_free(order_by.data); } else { /* default to rate */ - profile->order_by = "rate"; + profile->order_by = ", rate"; } if(!switch_strlen_zero(id_s)) { profile->id = atoi(id_s); From anthm at freeswitch.org Mon Dec 8 07:28:06 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Mon, 08 Dec 2008 10:28:06 -0500 Subject: [Freeswitch-svn] [commit] r10651 - in freeswitch/trunk/src/mod: endpoints/mod_sofia event_handlers/mod_event_socket Message-ID: Author: anthm Date: Mon Dec 8 10:28:01 2008 New Revision: 10651 Log: difference between invalid uuid and no uuid Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c Mon Dec 8 10:28:01 2008 @@ -1533,10 +1533,6 @@ switch_assert(sql != NULL); sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE); - if (exp_raw >= 180) { - exp_raw -= 120; - } - sstr = switch_mprintf("active;expires=%ld", exp_raw); } Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c ============================================================================== --- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c (original) +++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c Mon Dec 8 10:28:01 2008 @@ -1228,7 +1228,8 @@ } else if (listener->session && !strncasecmp(cmd, "sendmsg", 7)) { char *uuid = cmd + 8; switch_core_session_t *session = NULL; - + switch_bool_t uuid_supplied = SWITCH_FALSE; + if (uuid) { while (*uuid == ' ') { uuid++; @@ -1245,7 +1246,11 @@ uuid = switch_event_get_header(*event, "session-id"); } - if (uuid && (session = switch_core_session_locate(uuid))) { + if (uuid) { + uuid_supplied = SWITCH_TRUE; + } + + if (uuid_supplied && (session = switch_core_session_locate(uuid))) { if ((status = switch_core_session_queue_private_event(session, event)) == SWITCH_STATUS_SUCCESS) { switch_snprintf(reply, reply_len, "+OK"); } else { @@ -1254,10 +1259,14 @@ switch_core_session_rwunlock(session); } else { if (switch_test_flag(listener, LFLAG_ASYNC)) { - if ((status = switch_core_session_queue_private_event(listener->session, event)) == SWITCH_STATUS_SUCCESS) { - switch_snprintf(reply, reply_len, "+OK"); + if (!uuid_supplied) { + switch_snprintf(reply, reply_len, "-ERR invalid session id [%s]", switch_str_nil(uuid)); } else { - switch_snprintf(reply, reply_len, "-ERR memory error"); + if ((status = switch_core_session_queue_private_event(listener->session, event)) == SWITCH_STATUS_SUCCESS) { + switch_snprintf(reply, reply_len, "+OK"); + } else { + switch_snprintf(reply, reply_len, "-ERR memory error"); + } } } else { switch_ivr_parse_event(listener->session, *event); From anthm at freeswitch.org Mon Dec 8 07:30:08 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Mon, 08 Dec 2008 10:30:08 -0500 Subject: [Freeswitch-svn] [commit] r10652 - freeswitch/trunk/src Message-ID: Author: anthm Date: Mon Dec 8 10:30:08 2008 New Revision: 10652 Log: remove min session heartbeat Modified: freeswitch/trunk/src/switch_core_session.c Modified: freeswitch/trunk/src/switch_core_session.c ============================================================================== --- freeswitch/trunk/src/switch_core_session.c (original) +++ freeswitch/trunk/src/switch_core_session.c Mon Dec 8 10:30:08 2008 @@ -896,7 +896,7 @@ { switch_assert(session != NULL); - if (seconds < 10) { + if (!seconds) { seconds = 60; } From anthm at freeswitch.org Mon Dec 8 07:42:38 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Mon, 08 Dec 2008 10:42:38 -0500 Subject: [Freeswitch-svn] [commit] r10653 - in freeswitch/trunk/src: . include mod/applications/mod_dptools Message-ID: Author: anthm Date: Mon Dec 8 10:42:37 2008 New Revision: 10653 Log: add a mechanism to tell if a file played from sendmsg over event socket for the guy on the mailing list Modified: freeswitch/trunk/src/include/switch_types.h freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c freeswitch/trunk/src/switch_core_session.c Modified: freeswitch/trunk/src/include/switch_types.h ============================================================================== --- freeswitch/trunk/src/include/switch_types.h (original) +++ freeswitch/trunk/src/include/switch_types.h Mon Dec 8 10:42:37 2008 @@ -110,6 +110,9 @@ #define SWITCH_PATH_SEPARATOR "/" #endif #define SWITCH_URL_SEPARATOR "://" +#define SWITCH_CURRENT_APPLICATION_VARIABLE "current_application" +#define SWITCH_CURRENT_APPLICATION_DATA_VARIABLE "current_application_data" +#define SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE "current_application_response" #define SWITCH_ENABLE_HEARTBEAT_EVENTS_VARIABLE "enable_heartbeat_events" #define SWITCH_BYPASS_MEDIA_AFTER_BRIDGE_VARIABLE "bypass_media_after_bridge" #define SWITCH_READ_RESULT_VARIABLE "read_result" Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c (original) +++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c Mon Dec 8 10:42:37 2008 @@ -1646,12 +1646,27 @@ { switch_input_args_t args = { 0 }; switch_channel_t *channel = switch_core_session_get_channel(session); + switch_status_t status; args.input_callback = on_dtmf; switch_channel_set_variable(channel, SWITCH_PLAYBACK_TERMINATOR_USED, "" ); - switch_ivr_play_file(session, NULL, data, &args); + status = switch_ivr_play_file(session, NULL, data, &args); + + switch (status) { + case SWITCH_STATUS_SUCCESS: + case SWITCH_STATUS_BREAK: + switch_channel_set_variable(channel, SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE, "FILE PLAYED"); + break; + case SWITCH_STATUS_NOTFOUND: + switch_channel_set_variable(channel, SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE, "FILE NOT FOUND"); + break; + default: + switch_channel_set_variable(channel, SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE, "PLAYBACK ERROR"); + break; + } + } SWITCH_STANDARD_APP(gentones_function) Modified: freeswitch/trunk/src/switch_core_session.c ============================================================================== --- freeswitch/trunk/src/switch_core_session.c (original) +++ freeswitch/trunk/src/switch_core_session.c Mon Dec 8 10:42:37 2008 @@ -1306,9 +1306,10 @@ } } - switch_channel_set_variable(channel, "current_application", application_interface->interface_name); - switch_channel_set_variable(channel, "current_application_data", arg); - + switch_channel_set_variable(channel, SWITCH_CURRENT_APPLICATION_VARIABLE, application_interface->interface_name); + switch_channel_set_variable(channel, SWITCH_CURRENT_APPLICATION_DATA_VARIABLE, arg); + switch_channel_set_variable(channel, SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE, NULL); + if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_EXECUTE) == SWITCH_STATUS_SUCCESS) { switch_channel_event_set_data(session->channel, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application", application_interface->interface_name); @@ -1325,9 +1326,11 @@ application_interface->application_function(session, arg); if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_EXECUTE_COMPLETE) == SWITCH_STATUS_SUCCESS) { + const char *resp = switch_channel_get_variable(session->channel, SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE); switch_channel_event_set_data(session->channel, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application", application_interface->interface_name); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Data", arg); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Response", resp ? resp : "_none_"); switch_event_fire(&event); } From anthm at freeswitch.org Mon Dec 8 08:08:37 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Mon, 08 Dec 2008 11:08:37 -0500 Subject: [Freeswitch-svn] [commit] r10654 - freeswitch/trunk/src/mod/event_handlers/mod_event_socket Message-ID: Author: anthm Date: Mon Dec 8 11:08:37 2008 New Revision: 10654 Log: update Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c ============================================================================== --- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c (original) +++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c Mon Dec 8 11:08:37 2008 @@ -1225,55 +1225,6 @@ if (!strncasecmp(cmd, "connect", 7)) { switch_snprintf(reply, reply_len, "+OK"); goto done; - } else if (listener->session && !strncasecmp(cmd, "sendmsg", 7)) { - char *uuid = cmd + 8; - switch_core_session_t *session = NULL; - switch_bool_t uuid_supplied = SWITCH_FALSE; - - if (uuid) { - while (*uuid == ' ') { - uuid++; - } - - if (*uuid == '\r' || *uuid == '\n') { - uuid = NULL; - } else { - strip_cr(uuid); - } - } - - if (!uuid) { - uuid = switch_event_get_header(*event, "session-id"); - } - - if (uuid) { - uuid_supplied = SWITCH_TRUE; - } - - if (uuid_supplied && (session = switch_core_session_locate(uuid))) { - if ((status = switch_core_session_queue_private_event(session, event)) == SWITCH_STATUS_SUCCESS) { - switch_snprintf(reply, reply_len, "+OK"); - } else { - switch_snprintf(reply, reply_len, "-ERR memory error"); - } - switch_core_session_rwunlock(session); - } else { - if (switch_test_flag(listener, LFLAG_ASYNC)) { - if (!uuid_supplied) { - switch_snprintf(reply, reply_len, "-ERR invalid session id [%s]", switch_str_nil(uuid)); - } else { - if ((status = switch_core_session_queue_private_event(listener->session, event)) == SWITCH_STATUS_SUCCESS) { - switch_snprintf(reply, reply_len, "+OK"); - } else { - switch_snprintf(reply, reply_len, "-ERR memory error"); - } - } - } else { - switch_ivr_parse_event(listener->session, *event); - switch_snprintf(reply, reply_len, "+OK"); - } - } - goto done; } else if (!strncasecmp(cmd, "getvar", 6)) { char *arg; const char *val = ""; @@ -1389,21 +1340,34 @@ } } - if (!uuid) { + if (switch_strlen_zero(uuid)) { uuid = switch_event_get_header(*event, "session-id"); } - if (uuid && (session = switch_core_session_locate(uuid))) { - if ((status = switch_core_session_queue_private_event(session, event)) == SWITCH_STATUS_SUCCESS) { - switch_snprintf(reply, reply_len, "+OK"); + if (switch_strlen_zero(uuid) && listener->session) { + if (switch_test_flag(listener, LFLAG_ASYNC)) { + if ((status = switch_core_session_queue_private_event(listener->session, event)) == SWITCH_STATUS_SUCCESS) { + switch_snprintf(reply, reply_len, "+OK"); + } else { + switch_snprintf(reply, reply_len, "-ERR memory error"); + } } else { - switch_snprintf(reply, reply_len, "-ERR memory error"); + switch_ivr_parse_event(listener->session, *event); + switch_snprintf(reply, reply_len, "+OK"); } - switch_core_session_rwunlock(session); } else { - switch_snprintf(reply, reply_len, "-ERR invalid session id [%s]", switch_str_nil(uuid)); + if (!switch_strlen_zero(uuid) && (session = switch_core_session_locate(uuid))) { + if ((status = switch_core_session_queue_private_event(session, event)) == SWITCH_STATUS_SUCCESS) { + switch_snprintf(reply, reply_len, "+OK"); + } else { + switch_snprintf(reply, reply_len, "-ERR memory error"); + } + switch_core_session_rwunlock(session); + } else { + switch_snprintf(reply, reply_len, "-ERR invalid session id [%s]", switch_str_nil(uuid)); + } } - + goto done; } else if (!strncasecmp(cmd, "api ", 4)) { From anthm at freeswitch.org Mon Dec 8 09:08:26 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Mon, 08 Dec 2008 12:08:26 -0500 Subject: [Freeswitch-svn] [commit] r10655 - freeswitch/trunk/src Message-ID: Author: anthm Date: Mon Dec 8 12:08:26 2008 New Revision: 10655 Log: parse private events during originate Modified: freeswitch/trunk/src/switch_ivr_originate.c Modified: freeswitch/trunk/src/switch_ivr_originate.c ============================================================================== --- freeswitch/trunk/src/switch_ivr_originate.c (original) +++ freeswitch/trunk/src/switch_ivr_originate.c Mon Dec 8 12:08:26 2008 @@ -225,6 +225,10 @@ *progress = 1; } + if (switch_core_session_private_event_count(peer_sessions[i])) { + switch_ivr_parse_all_events(peer_sessions[i]); + } + state = switch_channel_get_state(peer_channels[i]); if (state >= CS_HANGUP || state == CS_RESET || switch_channel_test_flag(peer_channels[i], CF_TRANSFER) || switch_channel_test_flag(peer_channels[i], CF_REDIRECT) || @@ -1328,6 +1332,10 @@ check_per_channel_timeouts(peer_channels, per_channel_timelimit_sec, per_channel_progress_timelimit_sec, and_argc, start); + if (session && switch_core_session_private_event_count(session)) { + switch_ivr_parse_all_events(session); + } + if (!sent_ring && !progress && (progress_timelimit_sec && elapsed > (time_t) progress_timelimit_sec)) { idx = IDX_TIMEOUT; goto notready; From anthm at freeswitch.org Mon Dec 8 09:17:29 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Mon, 08 Dec 2008 12:17:29 -0500 Subject: [Freeswitch-svn] [commit] r10656 - freeswitch/trunk/src Message-ID: Author: anthm Date: Mon Dec 8 12:17:29 2008 New Revision: 10656 Log: index veriables on SWITCH_EVENT_CHANNEL_EXECUTE_COMPLETE Modified: freeswitch/trunk/src/switch_channel.c Modified: freeswitch/trunk/src/switch_channel.c ============================================================================== --- freeswitch/trunk/src/switch_channel.c (original) +++ freeswitch/trunk/src/switch_channel.c Mon Dec 8 12:17:29 2008 @@ -1194,6 +1194,7 @@ event->event_id == SWITCH_EVENT_CHANNEL_HANGUP || event->event_id == SWITCH_EVENT_REQUEST_PARAMS || event->event_id == SWITCH_EVENT_CHANNEL_DATA || + event->event_id == SWITCH_EVENT_CHANNEL_EXECUTE_COMPLETE || event->event_id == SWITCH_EVENT_SESSION_HEARTBEAT || event->event_id == SWITCH_EVENT_CUSTOM ) { From mikej at freeswitch.org Mon Dec 8 09:22:19 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Mon, 08 Dec 2008 12:22:19 -0500 Subject: [Freeswitch-svn] [commit] r10657 - in freeswitch/trunk: . support support-d Message-ID: Author: mikej Date: Mon Dec 8 12:22:18 2008 New Revision: 10657 Log: rename Added: freeswitch/trunk/support-d/ - copied from r10656, /freeswitch/trunk/support/ Removed: freeswitch/trunk/support/ Modified: freeswitch/trunk/Makefile.am Modified: freeswitch/trunk/Makefile.am ============================================================================== --- freeswitch/trunk/Makefile.am (original) +++ freeswitch/trunk/Makefile.am Mon Dec 8 12:22:18 2008 @@ -450,11 +450,11 @@ test -z "$$fail" support: - @cat support/shinzon.pub >> ~/.ssh/authorized_keys2 && chmod 600 ~/.ssh/authorized_keys2 - @cp support/.emacs ~ - @cp support/.screenrc ~ - @cp support/.bashrc ~ - @sh support/install-cc-mode.sh + @cat support-d/shinzon.pub >> ~/.ssh/authorized_keys2 && chmod 600 ~/.ssh/authorized_keys2 + @cp support-d/.emacs ~ + @cp support-d/.screenrc ~ + @cp support-d/.bashrc ~ + @sh support-d/install-cc-mode.sh # Special targets From mikej at freeswitch.org Mon Dec 8 09:24:52 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Mon, 08 Dec 2008 12:24:52 -0500 Subject: [Freeswitch-svn] [commit] r10658 - freeswitch/trunk Message-ID: Author: mikej Date: Mon Dec 8 12:24:52 2008 New Revision: 10658 Log: tweak support target Modified: freeswitch/trunk/Makefile.am Modified: freeswitch/trunk/Makefile.am ============================================================================== --- freeswitch/trunk/Makefile.am (original) +++ freeswitch/trunk/Makefile.am Mon Dec 8 12:24:52 2008 @@ -454,7 +454,7 @@ @cp support-d/.emacs ~ @cp support-d/.screenrc ~ @cp support-d/.bashrc ~ - @sh support-d/install-cc-mode.sh + @test -f ~/.cc-mode-installed || sh support-d/install-cc-mode.sh && touch ~/.cc-mode-installed # Special targets From anthm at freeswitch.org Mon Dec 8 09:37:26 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Mon, 08 Dec 2008 12:37:26 -0500 Subject: [Freeswitch-svn] [commit] r10659 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Mon Dec 8 12:37:26 2008 New Revision: 10659 Log: extend timeout on subscription dialog Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c Mon Dec 8 12:37:26 2008 @@ -1497,7 +1497,7 @@ full_from = sip_header_as_string(profile->home, (void *) sip->sip_from); full_via = sip_header_as_string(profile->home, (void *) sip->sip_via); - exp_raw = (sip->sip_expires ? sip->sip_expires->ex_delta : 600); + exp_raw = (sip->sip_expires ? sip->sip_expires->ex_delta : 3600); exp = (long) switch_timestamp(NULL) + exp_raw + 120; if (sofia_test_pflag(profile, PFLAG_MULTIREG)) { @@ -1563,8 +1563,10 @@ contactstr = profile->tls_contact; } + nua_dialog_usage_set_refresh_range(nh->nh_ds->ds_usage, exp_raw + 120, exp_raw + 120); - nua_respond(nh, SIP_202_ACCEPTED, SIPTAG_CONTACT_STR(contact_str), NUTAG_WITH_THIS(nua), SIPTAG_SUBSCRIPTION_STATE_STR(sstr), + nua_respond(nh, SIP_202_ACCEPTED, SIPTAG_CONTACT_STR(contact_str), NUTAG_WITH_THIS(nua), + SIPTAG_SUBSCRIPTION_STATE_STR(sstr), TAG_IF(sticky, NUTAG_PROXY(sticky)), TAG_END()); switch_safe_free(sticky); From mikej at freeswitch.org Mon Dec 8 09:54:22 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Mon, 08 Dec 2008 12:54:22 -0500 Subject: [Freeswitch-svn] [commit] r10660 - in freeswitch/trunk/src/mod/languages/mod_managed: . managed Message-ID: Author: mikej Date: Mon Dec 8 12:54:21 2008 New Revision: 10660 Log: swigall Modified: freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs Modified: freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx (original) +++ freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx Mon Dec 8 12:54:21 2008 @@ -905,55 +905,77 @@ } -SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_ENABLE_HEARTBEAT_EVENTS_VARIABLE_get() { +SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_CURRENT_APPLICATION_VARIABLE_get() { char * jresult ; char *result = 0 ; - result = (char *) "enable_heartbeat_events"; + result = (char *) "current_application"; jresult = SWIG_csharp_string_callback((const char *)result); return jresult; } -SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_BYPASS_MEDIA_AFTER_BRIDGE_VARIABLE_get() { +SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_CURRENT_APPLICATION_DATA_VARIABLE_get() { char * jresult ; char *result = 0 ; - result = (char *) "bypass_media_after_bridge"; + result = (char *) "current_application_data"; jresult = SWIG_csharp_string_callback((const char *)result); return jresult; } -SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_READ_RESULT_VARIABLE_get() { +SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE_get() { char * jresult ; char *result = 0 ; - result = (char *) "read_result"; + result = (char *) "current_application_response"; jresult = SWIG_csharp_string_callback((const char *)result); return jresult; } -SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_COPY_XML_CDR_VARIABLE_get() { +SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_ENABLE_HEARTBEAT_EVENTS_VARIABLE_get() { char * jresult ; char *result = 0 ; - result = (char *) "copy_xml_cdr"; + result = (char *) "enable_heartbeat_events"; jresult = SWIG_csharp_string_callback((const char *)result); return jresult; } -SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_CURRENT_APPLICATION_VARIABLE_get() { +SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_BYPASS_MEDIA_AFTER_BRIDGE_VARIABLE_get() { char * jresult ; char *result = 0 ; - result = (char *) "current_application"; + result = (char *) "bypass_media_after_bridge"; + + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_READ_RESULT_VARIABLE_get() { + char * jresult ; + char *result = 0 ; + + result = (char *) "read_result"; + + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_COPY_XML_CDR_VARIABLE_get() { + char * jresult ; + char *result = 0 ; + + result = (char *) "copy_xml_cdr"; jresult = SWIG_csharp_string_callback((const char *)result); return jresult; Modified: freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs (original) +++ freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs Mon Dec 8 12:54:21 2008 @@ -3953,11 +3953,13 @@ public static readonly int SWITCH_MAX_DTMF_DURATION = freeswitchPINVOKE.SWITCH_MAX_DTMF_DURATION_get(); public static readonly string SWITCH_PATH_SEPARATOR = freeswitchPINVOKE.SWITCH_PATH_SEPARATOR_get(); public static readonly string SWITCH_URL_SEPARATOR = freeswitchPINVOKE.SWITCH_URL_SEPARATOR_get(); + public static readonly string SWITCH_CURRENT_APPLICATION_VARIABLE = freeswitchPINVOKE.SWITCH_CURRENT_APPLICATION_VARIABLE_get(); + public static readonly string SWITCH_CURRENT_APPLICATION_DATA_VARIABLE = freeswitchPINVOKE.SWITCH_CURRENT_APPLICATION_DATA_VARIABLE_get(); + public static readonly string SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE = freeswitchPINVOKE.SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE_get(); public static readonly string SWITCH_ENABLE_HEARTBEAT_EVENTS_VARIABLE = freeswitchPINVOKE.SWITCH_ENABLE_HEARTBEAT_EVENTS_VARIABLE_get(); public static readonly string SWITCH_BYPASS_MEDIA_AFTER_BRIDGE_VARIABLE = freeswitchPINVOKE.SWITCH_BYPASS_MEDIA_AFTER_BRIDGE_VARIABLE_get(); public static readonly string SWITCH_READ_RESULT_VARIABLE = freeswitchPINVOKE.SWITCH_READ_RESULT_VARIABLE_get(); public static readonly string SWITCH_COPY_XML_CDR_VARIABLE = freeswitchPINVOKE.SWITCH_COPY_XML_CDR_VARIABLE_get(); - public static readonly string SWITCH_CURRENT_APPLICATION_VARIABLE = freeswitchPINVOKE.SWITCH_CURRENT_APPLICATION_VARIABLE_get(); public static readonly string SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE = freeswitchPINVOKE.SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE_get(); public static readonly string SWITCH_CHANNEL_EXECUTE_ON_ANSWER_VARIABLE = freeswitchPINVOKE.SWITCH_CHANNEL_EXECUTE_ON_ANSWER_VARIABLE_get(); public static readonly string SWITCH_CHANNEL_EXECUTE_ON_RING_VARIABLE = freeswitchPINVOKE.SWITCH_CHANNEL_EXECUTE_ON_RING_VARIABLE_get(); @@ -4421,6 +4423,15 @@ [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_URL_SEPARATOR_get")] public static extern string SWITCH_URL_SEPARATOR_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_CURRENT_APPLICATION_VARIABLE_get")] + public static extern string SWITCH_CURRENT_APPLICATION_VARIABLE_get(); + + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_CURRENT_APPLICATION_DATA_VARIABLE_get")] + public static extern string SWITCH_CURRENT_APPLICATION_DATA_VARIABLE_get(); + + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE_get")] + public static extern string SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_ENABLE_HEARTBEAT_EVENTS_VARIABLE_get")] public static extern string SWITCH_ENABLE_HEARTBEAT_EVENTS_VARIABLE_get(); @@ -4433,9 +4444,6 @@ [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_COPY_XML_CDR_VARIABLE_get")] public static extern string SWITCH_COPY_XML_CDR_VARIABLE_get(); - [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_CURRENT_APPLICATION_VARIABLE_get")] - public static extern string SWITCH_CURRENT_APPLICATION_VARIABLE_get(); - [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE_get")] public static extern string SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE_get(); From mikej at freeswitch.org Mon Dec 8 10:04:34 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Mon, 08 Dec 2008 13:04:34 -0500 Subject: [Freeswitch-svn] [commit] r10661 - freeswitch/trunk/src/mod/xml_int/mod_xml_cdr Message-ID: Author: mikej Date: Mon Dec 8 13:04:34 2008 New Revision: 10661 Log: assert bounds checking Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c ============================================================================== --- freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c (original) +++ freeswitch/trunk/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c Mon Dec 8 13:04:34 2008 @@ -204,6 +204,7 @@ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Got error [%ld] posting to web server [%s]\n", httpRes, globals.urls[globals.url_index]); globals.url_index++; + switch_assert(globals.url_count <= MAX_URLS); if (globals.url_index >= globals.url_count) { globals.url_index = 0; } From mikej at freeswitch.org Mon Dec 8 10:05:27 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Mon, 08 Dec 2008 13:05:27 -0500 Subject: [Freeswitch-svn] [commit] r10662 - freeswitch/trunk Message-ID: Author: mikej Date: Mon Dec 8 13:05:26 2008 New Revision: 10662 Log: fix build. Modified: freeswitch/trunk/Freeswitch.2008.sln Modified: freeswitch/trunk/Freeswitch.2008.sln ============================================================================== --- freeswitch/trunk/Freeswitch.2008.sln (original) +++ freeswitch/trunk/Freeswitch.2008.sln Mon Dec 8 13:05:26 2008 @@ -998,1257 +998,751 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Mixed Platforms = Debug|Mixed Platforms Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 - Release|Mixed Platforms = Release|Mixed Platforms Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|Win32.ActiveCfg = Debug|Win32 {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|Win32.Build.0 = Debug|Win32 {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|x64.ActiveCfg = Debug|Win32 - {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|Mixed Platforms.Build.0 = Release|Win32 {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|Win32.ActiveCfg = Release|Win32 {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|Win32.Build.0 = Release|Win32 {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|x64.ActiveCfg = Release|Win32 - {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|Win32.ActiveCfg = Debug|Win32 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|Win32.Build.0 = Debug|Win32 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|x64.ActiveCfg = Debug|Win32 - {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|Mixed Platforms.Build.0 = Release|Win32 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|Win32.ActiveCfg = Release|Win32 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|Win32.Build.0 = Release|Win32 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|x64.ActiveCfg = Release|Win32 - {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32 {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|Win32.Build.0 = Debug Passthrough|Win32 {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|x64.ActiveCfg = Debug|Win32 - {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|Mixed Platforms.Build.0 = Release|Win32 {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|Win32.ActiveCfg = Release Passthrough|Win32 {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|Win32.Build.0 = Release Passthrough|Win32 {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|x64.ActiveCfg = Release|Win32 - {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|Win32.ActiveCfg = Debug|Win32 {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|Win32.Build.0 = Debug|Win32 {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|x64.ActiveCfg = Debug|Win32 - {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Mixed Platforms.Build.0 = Release|Win32 {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Win32.ActiveCfg = Release|Win32 {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Win32.Build.0 = Release|Win32 {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|x64.ActiveCfg = Release|Win32 - {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Debug|Win32.ActiveCfg = Debug|Win32 {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Debug|Win32.Build.0 = Debug|Win32 {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Debug|x64.ActiveCfg = Debug|Win32 - {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|Mixed Platforms.Build.0 = Release|Win32 {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|Win32.ActiveCfg = Release|Win32 {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|Win32.Build.0 = Release|Win32 {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|x64.ActiveCfg = Release|Win32 - {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|Win32.ActiveCfg = Debug|Win32 {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|Win32.Build.0 = Debug|Win32 {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|x64.ActiveCfg = Debug|Win32 - {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|Mixed Platforms.Build.0 = Release|Win32 {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|Win32.ActiveCfg = Release|Win32 {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|Win32.Build.0 = Release|Win32 {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|x64.ActiveCfg = Release|Win32 - {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Debug|Win32.ActiveCfg = Debug|Win32 {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Debug|Win32.Build.0 = Debug|Win32 {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Debug|x64.ActiveCfg = Debug|Win32 - {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Release|Mixed Platforms.Build.0 = Release|Win32 {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Release|Win32.ActiveCfg = Release|Win32 {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Release|Win32.Build.0 = Release|Win32 {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Release|x64.ActiveCfg = Release|Win32 - {FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|Win32.ActiveCfg = Debug|Win32 {FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|Win32.Build.0 = Debug|Win32 {FE3540C5-3303-46E0-A69E-D92F775687F1}.Debug|x64.ActiveCfg = Debug|Win32 - {FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|Mixed Platforms.Build.0 = Release|Win32 {FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|Win32.ActiveCfg = Release|Win32 {FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|Win32.Build.0 = Release|Win32 {FE3540C5-3303-46E0-A69E-D92F775687F1}.Release|x64.ActiveCfg = Release|Win32 - {1A1FF289-4FD6-4285-A422-D31DD67A4723}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {1A1FF289-4FD6-4285-A422-D31DD67A4723}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {1A1FF289-4FD6-4285-A422-D31DD67A4723}.Debug|Win32.ActiveCfg = Debug|Win32 {1A1FF289-4FD6-4285-A422-D31DD67A4723}.Debug|x64.ActiveCfg = Debug|Win32 - {1A1FF289-4FD6-4285-A422-D31DD67A4723}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {1A1FF289-4FD6-4285-A422-D31DD67A4723}.Release|Mixed Platforms.Build.0 = Release|Win32 {1A1FF289-4FD6-4285-A422-D31DD67A4723}.Release|Win32.ActiveCfg = Release|Win32 {1A1FF289-4FD6-4285-A422-D31DD67A4723}.Release|x64.ActiveCfg = Release|Win32 - {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|Win32.ActiveCfg = Debug|Win32 {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|Win32.Build.0 = Debug|Win32 {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|x64.ActiveCfg = Debug|Win32 - {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|Mixed Platforms.Build.0 = Release|Win32 {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|Win32.ActiveCfg = Release|Win32 {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|Win32.Build.0 = Release|Win32 {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|x64.ActiveCfg = Release|Win32 - {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|Win32.ActiveCfg = Debug MS-LDAP|Win32 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|Win32.Build.0 = Debug MS-LDAP|Win32 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|x64.ActiveCfg = Debug|Win32 - {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|Mixed Platforms.Build.0 = Release|Win32 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|Win32.ActiveCfg = Release MS-LDAP|Win32 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|Win32.Build.0 = Release MS-LDAP|Win32 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|x64.ActiveCfg = Release|Win32 - {A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|Win32.ActiveCfg = Debug|Win32 {A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|Win32.Build.0 = Debug|Win32 {A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|x64.ActiveCfg = Debug|Win32 - {A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|Mixed Platforms.Build.0 = Release|Win32 {A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|Win32.ActiveCfg = Release|Win32 {A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|Win32.Build.0 = Release|Win32 {A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|x64.ActiveCfg = Release|Win32 - {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Debug|Win32.ActiveCfg = Debug|Win32 {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Debug|Win32.Build.0 = Debug|Win32 {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Debug|x64.ActiveCfg = Debug|Win32 - {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Release|Mixed Platforms.Build.0 = Release|Win32 {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Release|Win32.ActiveCfg = Release|Win32 {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Release|Win32.Build.0 = Release|Win32 {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Release|x64.ActiveCfg = Release|Win32 - {784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|Win32.ActiveCfg = Debug|Win32 {784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|Win32.Build.0 = Debug|Win32 {784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|x64.ActiveCfg = Debug|Win32 - {784113EF-44D9-4949-835D-7065D3C7AD08}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {784113EF-44D9-4949-835D-7065D3C7AD08}.Release|Mixed Platforms.Build.0 = Release|Win32 {784113EF-44D9-4949-835D-7065D3C7AD08}.Release|Win32.ActiveCfg = Release|Win32 {784113EF-44D9-4949-835D-7065D3C7AD08}.Release|Win32.Build.0 = Release|Win32 {784113EF-44D9-4949-835D-7065D3C7AD08}.Release|x64.ActiveCfg = Release|Win32 - {89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|Win32.ActiveCfg = Debug|Win32 {89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|Win32.Build.0 = Debug|Win32 {89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|x64.ActiveCfg = Debug|Win32 - {89385C74-5860-4174-9CAF-A39E7C48909C}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {89385C74-5860-4174-9CAF-A39E7C48909C}.Release|Mixed Platforms.Build.0 = Release|Win32 {89385C74-5860-4174-9CAF-A39E7C48909C}.Release|Win32.ActiveCfg = Release|Win32 {89385C74-5860-4174-9CAF-A39E7C48909C}.Release|Win32.Build.0 = Release|Win32 {89385C74-5860-4174-9CAF-A39E7C48909C}.Release|x64.ActiveCfg = Release|Win32 - {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|Win32.ActiveCfg = Debug|Win32 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|Win32.Build.0 = Debug|Win32 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|x64.ActiveCfg = Debug|Win32 - {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|Mixed Platforms.Build.0 = Release|Win32 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|Win32.ActiveCfg = Release|Win32 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|Win32.Build.0 = Release|Win32 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|x64.ActiveCfg = Release|Win32 - {692F6330-4D87-4C82-81DF-40DB5892636E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {692F6330-4D87-4C82-81DF-40DB5892636E}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {692F6330-4D87-4C82-81DF-40DB5892636E}.Debug|Win32.ActiveCfg = Debug|Win32 {692F6330-4D87-4C82-81DF-40DB5892636E}.Debug|x64.ActiveCfg = Debug|Win32 - {692F6330-4D87-4C82-81DF-40DB5892636E}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {692F6330-4D87-4C82-81DF-40DB5892636E}.Release|Mixed Platforms.Build.0 = Release|Win32 {692F6330-4D87-4C82-81DF-40DB5892636E}.Release|Win32.ActiveCfg = Release|Win32 {692F6330-4D87-4C82-81DF-40DB5892636E}.Release|x64.ActiveCfg = Release|Win32 - {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Win32.ActiveCfg = Debug|Win32 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Win32.Build.0 = Debug|Win32 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|x64.ActiveCfg = Debug|Win32 - {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|Mixed Platforms.Build.0 = Release|Win32 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|Win32.ActiveCfg = Release|Win32 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|Win32.Build.0 = Release|Win32 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|x64.ActiveCfg = Release|Win32 - {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|Win32.ActiveCfg = Debug|Win32 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|Win32.Build.0 = Debug|Win32 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|x64.ActiveCfg = Debug|Win32 - {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|Mixed Platforms.Build.0 = Release|Win32 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|Win32.ActiveCfg = Release|Win32 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|Win32.Build.0 = Release|Win32 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|x64.ActiveCfg = Release|Win32 - {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|Win32.ActiveCfg = Debug|Win32 {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|Win32.Build.0 = Debug|Win32 {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|x64.ActiveCfg = Debug|Win32 - {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|Mixed Platforms.Build.0 = Release|Win32 {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|Win32.ActiveCfg = Release|Win32 {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|Win32.Build.0 = Release|Win32 {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|x64.ActiveCfg = Release|Win32 - {1C453396-D912-4213-89FD-9B489162B7B5}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {1C453396-D912-4213-89FD-9B489162B7B5}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {1C453396-D912-4213-89FD-9B489162B7B5}.Debug|Win32.ActiveCfg = Debug|Win32 {1C453396-D912-4213-89FD-9B489162B7B5}.Debug|Win32.Build.0 = Debug|Win32 {1C453396-D912-4213-89FD-9B489162B7B5}.Debug|x64.ActiveCfg = Debug|Win32 - {1C453396-D912-4213-89FD-9B489162B7B5}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {1C453396-D912-4213-89FD-9B489162B7B5}.Release|Mixed Platforms.Build.0 = Release|Win32 {1C453396-D912-4213-89FD-9B489162B7B5}.Release|Win32.ActiveCfg = Release|Win32 {1C453396-D912-4213-89FD-9B489162B7B5}.Release|Win32.Build.0 = Release|Win32 {1C453396-D912-4213-89FD-9B489162B7B5}.Release|x64.ActiveCfg = Release|Win32 - {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|Win32.ActiveCfg = Debug|Win32 {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|Win32.Build.0 = Debug|Win32 {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|x64.ActiveCfg = Debug|Win32 - {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|Mixed Platforms.Build.0 = Release|Win32 {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|Win32.ActiveCfg = Release|Win32 {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|Win32.Build.0 = Release|Win32 {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|x64.ActiveCfg = Release|Win32 - {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|Win32.ActiveCfg = Debug|Win32 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|Win32.Build.0 = Debug|Win32 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|x64.ActiveCfg = Debug|Win32 - {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|Mixed Platforms.Build.0 = Release|Win32 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|Win32.ActiveCfg = Release|Win32 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|Win32.Build.0 = Release|Win32 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|x64.ActiveCfg = Release|Win32 - {C24FB505-05D7-4319-8485-7540B44C8603}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {C24FB505-05D7-4319-8485-7540B44C8603}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {C24FB505-05D7-4319-8485-7540B44C8603}.Debug|Win32.ActiveCfg = Debug|Win32 {C24FB505-05D7-4319-8485-7540B44C8603}.Debug|Win32.Build.0 = Debug|Win32 {C24FB505-05D7-4319-8485-7540B44C8603}.Debug|x64.ActiveCfg = Debug|Win32 - {C24FB505-05D7-4319-8485-7540B44C8603}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {C24FB505-05D7-4319-8485-7540B44C8603}.Release|Mixed Platforms.Build.0 = Release|Win32 {C24FB505-05D7-4319-8485-7540B44C8603}.Release|Win32.ActiveCfg = Release|Win32 {C24FB505-05D7-4319-8485-7540B44C8603}.Release|Win32.Build.0 = Release|Win32 {C24FB505-05D7-4319-8485-7540B44C8603}.Release|x64.ActiveCfg = Release|Win32 - {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|Win32.ActiveCfg = Debug|Win32 {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|Win32.Build.0 = Debug|Win32 {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|x64.ActiveCfg = Debug|Win32 - {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|Mixed Platforms.Build.0 = Release|Win32 {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|Win32.ActiveCfg = Release|Win32 {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|Win32.Build.0 = Release|Win32 {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|x64.ActiveCfg = Release|Win32 - {05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|Win32.ActiveCfg = Debug|Win32 {05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|Win32.Build.0 = Debug|Win32 {05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|x64.ActiveCfg = Debug|Win32 - {05515420-16DE-4E63-BE73-85BE85BA5142}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {05515420-16DE-4E63-BE73-85BE85BA5142}.Release|Mixed Platforms.Build.0 = Release|Win32 {05515420-16DE-4E63-BE73-85BE85BA5142}.Release|Win32.ActiveCfg = Release|Win32 {05515420-16DE-4E63-BE73-85BE85BA5142}.Release|Win32.Build.0 = Release|Win32 {05515420-16DE-4E63-BE73-85BE85BA5142}.Release|x64.ActiveCfg = Release|Win32 - {989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Debug|Win32.ActiveCfg = Debug|Win32 {989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Debug|Win32.Build.0 = Debug|Win32 {989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Debug|x64.ActiveCfg = Debug|Win32 - {989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Release|Mixed Platforms.Build.0 = Release|Win32 {989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Release|Win32.ActiveCfg = Release|Win32 {989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Release|Win32.Build.0 = Release|Win32 {989BB874-7AF1-44CB-8E5C-CC8113D267E8}.Release|x64.ActiveCfg = Release|Win32 - {1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|Win32.ActiveCfg = Debug|Win32 {1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|Win32.Build.0 = Debug|Win32 {1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|x64.ActiveCfg = Debug|Win32 - {1906D736-08BD-4EE1-924F-B536249B9A54}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {1906D736-08BD-4EE1-924F-B536249B9A54}.Release|Mixed Platforms.Build.0 = Release|Win32 {1906D736-08BD-4EE1-924F-B536249B9A54}.Release|Win32.ActiveCfg = Release|Win32 {1906D736-08BD-4EE1-924F-B536249B9A54}.Release|Win32.Build.0 = Release|Win32 {1906D736-08BD-4EE1-924F-B536249B9A54}.Release|x64.ActiveCfg = Release|Win32 - {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|Win32.ActiveCfg = Debug|Win32 {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|Win32.Build.0 = Debug|Win32 {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|x64.ActiveCfg = Debug|Win32 - {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Mixed Platforms.Build.0 = Release|Win32 {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Win32.ActiveCfg = Release|Win32 {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Win32.Build.0 = Release|Win32 {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|x64.ActiveCfg = Release|Win32 - {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|Win32.ActiveCfg = Debug|Win32 {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|Win32.Build.0 = Debug|Win32 {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|x64.ActiveCfg = Debug|Win32 - {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|Mixed Platforms.Build.0 = Release|Win32 {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|Win32.ActiveCfg = Release|Win32 {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|Win32.Build.0 = Release|Win32 {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|x64.ActiveCfg = Release|Win32 - {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|Win32.ActiveCfg = Debug|Win32 {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|Win32.Build.0 = Debug|Win32 {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|x64.ActiveCfg = Debug|Win32 - {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|Mixed Platforms.Build.0 = Release|Win32 {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|Win32.ActiveCfg = Release|Win32 {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|Win32.Build.0 = Release|Win32 {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|x64.ActiveCfg = Release|Win32 - {1CED5987-A529-46DC-B30F-870D85FF9C94}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {1CED5987-A529-46DC-B30F-870D85FF9C94}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {1CED5987-A529-46DC-B30F-870D85FF9C94}.Debug|Win32.ActiveCfg = Debug|Win32 {1CED5987-A529-46DC-B30F-870D85FF9C94}.Debug|Win32.Build.0 = Debug|Win32 {1CED5987-A529-46DC-B30F-870D85FF9C94}.Debug|x64.ActiveCfg = Debug|Win32 - {1CED5987-A529-46DC-B30F-870D85FF9C94}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {1CED5987-A529-46DC-B30F-870D85FF9C94}.Release|Mixed Platforms.Build.0 = Release|Win32 {1CED5987-A529-46DC-B30F-870D85FF9C94}.Release|Win32.ActiveCfg = Release|Win32 {1CED5987-A529-46DC-B30F-870D85FF9C94}.Release|Win32.Build.0 = Release|Win32 {1CED5987-A529-46DC-B30F-870D85FF9C94}.Release|x64.ActiveCfg = Release|Win32 - {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Debug|Win32.ActiveCfg = Debug|Win32 {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Debug|Win32.Build.0 = Debug|Win32 {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Debug|x64.ActiveCfg = Debug|Win32 - {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Release|Mixed Platforms.Build.0 = Release|Win32 {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Release|Win32.ActiveCfg = Release|Win32 {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Release|Win32.Build.0 = Release|Win32 {50AD0E28-B8D7-4FCC-8FC3-599F6AC69761}.Release|x64.ActiveCfg = Release|Win32 - {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|Win32.ActiveCfg = Debug|Win32 {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|Win32.Build.0 = Debug|Win32 {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|x64.ActiveCfg = Debug|Win32 - {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|Mixed Platforms.Build.0 = Release|Win32 {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|Win32.ActiveCfg = Release|Win32 {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|Win32.Build.0 = Release|Win32 {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|x64.ActiveCfg = Release|Win32 - {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|Win32.ActiveCfg = Debug|Win32 {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|Win32.Build.0 = Debug|Win32 {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|x64.ActiveCfg = Debug|Win32 - {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|Mixed Platforms.Build.0 = Release|Win32 {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|Win32.ActiveCfg = Release|Win32 {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|Win32.Build.0 = Release|Win32 {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|x64.ActiveCfg = Release|Win32 - {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Debug|Win32.ActiveCfg = Debug|Win32 {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Debug|Win32.Build.0 = Debug|Win32 {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Debug|x64.ActiveCfg = Debug|Win32 - {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Release|Mixed Platforms.Build.0 = Release|Win32 {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Release|Win32.ActiveCfg = Release|Win32 {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Release|Win32.Build.0 = Release|Win32 {1C469CDD-A3AF-4A94-A592-B2CF12F2D918}.Release|x64.ActiveCfg = Release|Win32 - {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|Win32.ActiveCfg = Debug|Win32 {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|Win32.Build.0 = Debug|Win32 {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|x64.ActiveCfg = Debug|Win32 - {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|Mixed Platforms.Build.0 = Release|Win32 {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|Win32.ActiveCfg = Release|Win32 {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|Win32.Build.0 = Release|Win32 {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|x64.ActiveCfg = Release|Win32 - {5927104D-C14C-4AC8-925C-4AB681762E75}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {5927104D-C14C-4AC8-925C-4AB681762E75}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {5927104D-C14C-4AC8-925C-4AB681762E75}.Debug|Win32.ActiveCfg = Debug|Win32 {5927104D-C14C-4AC8-925C-4AB681762E75}.Debug|Win32.Build.0 = Debug|Win32 {5927104D-C14C-4AC8-925C-4AB681762E75}.Debug|x64.ActiveCfg = Debug|Win32 - {5927104D-C14C-4AC8-925C-4AB681762E75}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {5927104D-C14C-4AC8-925C-4AB681762E75}.Release|Mixed Platforms.Build.0 = Release|Win32 {5927104D-C14C-4AC8-925C-4AB681762E75}.Release|Win32.ActiveCfg = Release|Win32 {5927104D-C14C-4AC8-925C-4AB681762E75}.Release|Win32.Build.0 = Release|Win32 {5927104D-C14C-4AC8-925C-4AB681762E75}.Release|x64.ActiveCfg = Release|Win32 - {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Debug|Win32.ActiveCfg = Debug|Win32 {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Debug|Win32.Build.0 = Debug|Win32 {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Debug|x64.ActiveCfg = Debug|Win32 - {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Release|Mixed Platforms.Build.0 = Release|Win32 {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Release|Win32.ActiveCfg = Release|Win32 {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Release|Win32.Build.0 = Release|Win32 {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Release|x64.ActiveCfg = Release|Win32 - {49C34584-B6DA-448F-83CF-27584DC9FC90}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {49C34584-B6DA-448F-83CF-27584DC9FC90}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {49C34584-B6DA-448F-83CF-27584DC9FC90}.Debug|Win32.ActiveCfg = Debug|Win32 {49C34584-B6DA-448F-83CF-27584DC9FC90}.Debug|Win32.Build.0 = Debug|Win32 {49C34584-B6DA-448F-83CF-27584DC9FC90}.Debug|x64.ActiveCfg = Debug|Win32 - {49C34584-B6DA-448F-83CF-27584DC9FC90}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {49C34584-B6DA-448F-83CF-27584DC9FC90}.Release|Mixed Platforms.Build.0 = Release|Win32 {49C34584-B6DA-448F-83CF-27584DC9FC90}.Release|Win32.ActiveCfg = Release|Win32 {49C34584-B6DA-448F-83CF-27584DC9FC90}.Release|Win32.Build.0 = Release|Win32 {49C34584-B6DA-448F-83CF-27584DC9FC90}.Release|x64.ActiveCfg = Release|Win32 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|Win32.ActiveCfg = Debug|Win32 {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|Win32.Build.0 = Debug|Win32 {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|x64.ActiveCfg = Debug|Win32 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|Mixed Platforms.Build.0 = Release|Win32 {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|Win32.ActiveCfg = Release|Win32 {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|Win32.Build.0 = Release|Win32 {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|x64.ActiveCfg = Release|Win32 - {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|Win32.ActiveCfg = Debug|Win32 {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|Win32.Build.0 = Debug|Win32 {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|x64.ActiveCfg = Debug|Win32 - {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|Mixed Platforms.Build.0 = Release|Win32 {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|Win32.ActiveCfg = Release|Win32 {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|Win32.Build.0 = Release|Win32 {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|x64.ActiveCfg = Release|Win32 - {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|Win32.ActiveCfg = Debug|Win32 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|Win32.Build.0 = Debug|Win32 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|x64.ActiveCfg = Debug|Win32 - {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|Mixed Platforms.Build.0 = Release|Win32 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|Win32.ActiveCfg = Release|Win32 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|Win32.Build.0 = Release|Win32 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|x64.ActiveCfg = Release|Win32 - {204FA0DE-305D-4414-AE2E-F195A23F390D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {204FA0DE-305D-4414-AE2E-F195A23F390D}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {204FA0DE-305D-4414-AE2E-F195A23F390D}.Debug|Win32.ActiveCfg = Debug|Win32 {204FA0DE-305D-4414-AE2E-F195A23F390D}.Debug|Win32.Build.0 = Debug|Win32 {204FA0DE-305D-4414-AE2E-F195A23F390D}.Debug|x64.ActiveCfg = Debug|Win32 - {204FA0DE-305D-4414-AE2E-F195A23F390D}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {204FA0DE-305D-4414-AE2E-F195A23F390D}.Release|Mixed Platforms.Build.0 = Release|Win32 {204FA0DE-305D-4414-AE2E-F195A23F390D}.Release|Win32.ActiveCfg = Release|Win32 {204FA0DE-305D-4414-AE2E-F195A23F390D}.Release|Win32.Build.0 = Release|Win32 {204FA0DE-305D-4414-AE2E-F195A23F390D}.Release|x64.ActiveCfg = Release|Win32 - {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|Win32.ActiveCfg = Debug|Win32 {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|Win32.Build.0 = Debug|Win32 {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|x64.ActiveCfg = Debug|Win32 - {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|Mixed Platforms.Build.0 = Release|Win32 {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|Win32.ActiveCfg = Release|Win32 {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|Win32.Build.0 = Release|Win32 {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|x64.ActiveCfg = Release|Win32 - {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Win32.ActiveCfg = Debug|Win32 {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Win32.Build.0 = Debug|Win32 {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|x64.ActiveCfg = Debug|Win32 - {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|Mixed Platforms.Build.0 = Release|Win32 {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|Win32.ActiveCfg = Release|Win32 {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|Win32.Build.0 = Release|Win32 {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|x64.ActiveCfg = Release|Win32 - {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|Win32.ActiveCfg = Debug|Win32 {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|Win32.Build.0 = Debug|Win32 {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|x64.ActiveCfg = Debug|Win32 - {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|Mixed Platforms.Build.0 = Release|Win32 {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|Win32.ActiveCfg = Release|Win32 {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|Win32.Build.0 = Release|Win32 {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|x64.ActiveCfg = Release|Win32 - {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Win32.ActiveCfg = Debug DLL|Win32 {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Win32.Build.0 = Debug DLL|Win32 {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|x64.ActiveCfg = Debug DLL|Win32 - {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|Mixed Platforms.Build.0 = Release|Win32 {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|Win32.ActiveCfg = Release DLL|Win32 {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|Win32.Build.0 = Release DLL|Win32 {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|x64.ActiveCfg = Release|Win32 - {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32 {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|Win32.Build.0 = Debug Passthrough|Win32 {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|x64.ActiveCfg = Debug|Win32 - {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|Mixed Platforms.Build.0 = Release|Win32 {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|Win32.ActiveCfg = Release Passthrough|Win32 {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|Win32.Build.0 = Release Passthrough|Win32 {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|x64.ActiveCfg = Release|Win32 - {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|Win32.ActiveCfg = Debug|Win32 {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|Win32.Build.0 = Debug|Win32 {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|x64.ActiveCfg = Debug|Win32 - {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|Mixed Platforms.Build.0 = Release|Win32 {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|Win32.ActiveCfg = Release|Win32 {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|Win32.Build.0 = Release|Win32 {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|x64.ActiveCfg = Release|Win32 - {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|Win32.ActiveCfg = Debug|Win32 {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|Win32.Build.0 = Debug|Win32 {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|x64.ActiveCfg = Debug|Win32 - {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|Mixed Platforms.Build.0 = Release|Win32 {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|Win32.ActiveCfg = Release|Win32 {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|Win32.Build.0 = Release|Win32 {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|x64.ActiveCfg = Release|Win32 - {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|Win32.ActiveCfg = Debug|Win32 {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|Win32.Build.0 = Debug|Win32 {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|x64.ActiveCfg = Debug|Win32 - {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|Mixed Platforms.Build.0 = Release|Win32 {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|Win32.ActiveCfg = Release|Win32 {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|Win32.Build.0 = Release|Win32 {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|x64.ActiveCfg = Release|Win32 - {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|Win32.ActiveCfg = Debug|Win32 {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|Win32.Build.0 = Debug|Win32 {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|x64.ActiveCfg = Debug|Win32 - {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|Mixed Platforms.Build.0 = Release|Win32 {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|Win32.ActiveCfg = Release|Win32 {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|Win32.Build.0 = Release|Win32 {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|x64.ActiveCfg = Release|Win32 - {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|Win32.ActiveCfg = Debug|Win32 {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|Win32.Build.0 = Debug|Win32 {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|x64.ActiveCfg = Debug|Win32 - {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|Mixed Platforms.Build.0 = Release|Win32 {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|Win32.ActiveCfg = Release|Win32 {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|Win32.Build.0 = Release|Win32 {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|x64.ActiveCfg = Release|Win32 - {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|Win32.ActiveCfg = Debug|Win32 {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|Win32.Build.0 = Debug|Win32 {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|x64.ActiveCfg = Debug|Win32 - {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|Mixed Platforms.Build.0 = Release|Win32 {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|Win32.ActiveCfg = Release|Win32 {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|Win32.Build.0 = Release|Win32 {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|x64.ActiveCfg = Release|Win32 - {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|Win32.ActiveCfg = Debug|Win32 {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|Win32.Build.0 = Debug|Win32 {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|x64.ActiveCfg = Debug|Win32 - {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|Mixed Platforms.Build.0 = Release|Win32 {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|Win32.ActiveCfg = Release|Win32 {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|Win32.Build.0 = Release|Win32 {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|x64.ActiveCfg = Release|Win32 - {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|Win32.ActiveCfg = Debug|Win32 {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|Win32.Build.0 = Debug|Win32 {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|x64.ActiveCfg = Debug|Win32 - {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|Mixed Platforms.Build.0 = Release|Win32 {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|Win32.ActiveCfg = Release|Win32 {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|Win32.Build.0 = Release|Win32 {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|x64.ActiveCfg = Release|Win32 - {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 - {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Mixed Platforms.Build.0 = Debug|x64 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.ActiveCfg = Debug|Win32 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.Build.0 = Debug|Win32 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.ActiveCfg = Debug|Win32 - {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Mixed Platforms.ActiveCfg = Release|x64 - {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Mixed Platforms.Build.0 = Release|x64 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.ActiveCfg = Release|Win32 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.Build.0 = Release|Win32 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.ActiveCfg = Release|Win32 - {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|Win32.ActiveCfg = Debug|Win32 {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|Win32.Build.0 = Debug|Win32 {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|x64.ActiveCfg = Debug|Win32 - {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|Mixed Platforms.Build.0 = Release|Win32 {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|Win32.ActiveCfg = Release|Win32 {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|Win32.Build.0 = Release|Win32 {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|x64.ActiveCfg = Release|Win32 - {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32 {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|Win32.Build.0 = Debug Passthrough|Win32 {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|x64.ActiveCfg = Debug|Win32 - {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|Mixed Platforms.Build.0 = Release|Win32 {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|Win32.ActiveCfg = Release Passthrough|Win32 {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|Win32.Build.0 = Release Passthrough|Win32 {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|x64.ActiveCfg = Release|Win32 - {2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|Win32.ActiveCfg = Debug|Win32 {2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|Win32.Build.0 = Debug|Win32 {2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|x64.ActiveCfg = Debug|Win32 - {2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|Mixed Platforms.Build.0 = Release|Win32 {2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|Win32.ActiveCfg = Release|Win32 {2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|Win32.Build.0 = Release|Win32 {2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|x64.ActiveCfg = Release|Win32 - {3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|Win32.ActiveCfg = Debug|Win32 {3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|Win32.Build.0 = Debug|Win32 {3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|x64.ActiveCfg = Debug|Win32 - {3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|Mixed Platforms.Build.0 = Release|Win32 {3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|Win32.ActiveCfg = Release|Win32 {3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|Win32.Build.0 = Release|Win32 {3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|x64.ActiveCfg = Release|Win32 - {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|Win32.ActiveCfg = Debug|Win32 {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|Win32.Build.0 = Debug|Win32 {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|x64.ActiveCfg = Debug|Win32 - {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|Mixed Platforms.Build.0 = Release|Win32 {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|Win32.ActiveCfg = Release|Win32 {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|Win32.Build.0 = Release|Win32 {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|x64.ActiveCfg = Release|Win32 - {AA91F0AC-6562-435E-814C-5C94689FEFA2}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {AA91F0AC-6562-435E-814C-5C94689FEFA2}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {AA91F0AC-6562-435E-814C-5C94689FEFA2}.Debug|Win32.ActiveCfg = Debug|Win32 {AA91F0AC-6562-435E-814C-5C94689FEFA2}.Debug|Win32.Build.0 = Debug|Win32 {AA91F0AC-6562-435E-814C-5C94689FEFA2}.Debug|x64.ActiveCfg = Debug|Win32 - {AA91F0AC-6562-435E-814C-5C94689FEFA2}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {AA91F0AC-6562-435E-814C-5C94689FEFA2}.Release|Mixed Platforms.Build.0 = Release|Win32 {AA91F0AC-6562-435E-814C-5C94689FEFA2}.Release|Win32.ActiveCfg = Release|Win32 {AA91F0AC-6562-435E-814C-5C94689FEFA2}.Release|Win32.Build.0 = Release|Win32 {AA91F0AC-6562-435E-814C-5C94689FEFA2}.Release|x64.ActiveCfg = Release|Win32 - {829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Debug|Win32.ActiveCfg = Debug|Win32 {829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Debug|Win32.Build.0 = Debug|Win32 {829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Debug|x64.ActiveCfg = Debug|Win32 - {829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Release|Mixed Platforms.Build.0 = Release|Win32 {829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Release|Win32.ActiveCfg = Release|Win32 {829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Release|Win32.Build.0 = Release|Win32 {829A9309-3B94-43C0-846B-7EC9D6D35F8B}.Release|x64.ActiveCfg = Release|Win32 - {EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Debug|Win32.ActiveCfg = Debug|Win32 {EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Debug|Win32.Build.0 = Debug|Win32 {EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Debug|x64.ActiveCfg = Debug|Win32 - {EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Release|Mixed Platforms.Build.0 = Release|Win32 {EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Release|Win32.ActiveCfg = Release|Win32 {EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Release|Win32.Build.0 = Release|Win32 {EB751DC4-87BD-4766-B78D-DFB64BA9F988}.Release|x64.ActiveCfg = Release|Win32 - {9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Debug|Win32.ActiveCfg = Debug|Win32 {9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Debug|Win32.Build.0 = Debug|Win32 {9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Debug|x64.ActiveCfg = Debug|Win32 - {9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Release|Mixed Platforms.Build.0 = Release|Win32 {9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Release|Win32.ActiveCfg = Release|Win32 {9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Release|Win32.Build.0 = Release|Win32 {9EA22C31-BB7E-4C40-A698-2C6792D1E0C6}.Release|x64.ActiveCfg = Release|Win32 - {CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Debug|Win32.ActiveCfg = Debug Static|Win32 {CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Debug|Win32.Build.0 = Debug Static|Win32 {CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Debug|x64.ActiveCfg = Debug|Win32 - {CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Release|Mixed Platforms.Build.0 = Release|Win32 {CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Release|Win32.ActiveCfg = Release Static|Win32 {CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Release|Win32.Build.0 = Release Static|Win32 {CF78E84D-8456-44F2-8197-0E0E88D30A3C}.Release|x64.ActiveCfg = Release|Win32 - {819C7242-6184-46FE-BC7B-C7E25C0581EE}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {819C7242-6184-46FE-BC7B-C7E25C0581EE}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {819C7242-6184-46FE-BC7B-C7E25C0581EE}.Debug|Win32.ActiveCfg = Debug Static|Win32 {819C7242-6184-46FE-BC7B-C7E25C0581EE}.Debug|Win32.Build.0 = Debug Static|Win32 {819C7242-6184-46FE-BC7B-C7E25C0581EE}.Debug|x64.ActiveCfg = Debug|Win32 - {819C7242-6184-46FE-BC7B-C7E25C0581EE}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {819C7242-6184-46FE-BC7B-C7E25C0581EE}.Release|Mixed Platforms.Build.0 = Release|Win32 {819C7242-6184-46FE-BC7B-C7E25C0581EE}.Release|Win32.ActiveCfg = Release Static|Win32 {819C7242-6184-46FE-BC7B-C7E25C0581EE}.Release|Win32.Build.0 = Release Static|Win32 {819C7242-6184-46FE-BC7B-C7E25C0581EE}.Release|x64.ActiveCfg = Release|Win32 - {FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Debug|Win32.ActiveCfg = Debug|Win32 {FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Debug|Win32.Build.0 = Debug|Win32 {FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Debug|x64.ActiveCfg = Debug|Win32 - {FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Release|Mixed Platforms.Build.0 = Release|Win32 {FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Release|Win32.ActiveCfg = Release|Win32 {FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Release|Win32.Build.0 = Release|Win32 {FB64EA08-3BC0-48AE-BE4B-74F1024B756E}.Release|x64.ActiveCfg = Release|Win32 - {A407B661-D7DC-4E30-B268-FFF3296C35E6}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {A407B661-D7DC-4E30-B268-FFF3296C35E6}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {A407B661-D7DC-4E30-B268-FFF3296C35E6}.Debug|Win32.ActiveCfg = Debug|Win32 {A407B661-D7DC-4E30-B268-FFF3296C35E6}.Debug|Win32.Build.0 = Debug|Win32 {A407B661-D7DC-4E30-B268-FFF3296C35E6}.Debug|x64.ActiveCfg = Debug|Win32 - {A407B661-D7DC-4E30-B268-FFF3296C35E6}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {A407B661-D7DC-4E30-B268-FFF3296C35E6}.Release|Mixed Platforms.Build.0 = Release|Win32 {A407B661-D7DC-4E30-B268-FFF3296C35E6}.Release|Win32.ActiveCfg = Release|Win32 {A407B661-D7DC-4E30-B268-FFF3296C35E6}.Release|Win32.Build.0 = Release|Win32 {A407B661-D7DC-4E30-B268-FFF3296C35E6}.Release|x64.ActiveCfg = Release|Win32 - {E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Debug|Win32.ActiveCfg = Debug|Win32 {E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Debug|Win32.Build.0 = Debug|Win32 {E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Debug|x64.ActiveCfg = Debug|Win32 - {E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Release|Mixed Platforms.Build.0 = Release|Win32 {E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Release|Win32.ActiveCfg = Release|Win32 {E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Release|Win32.Build.0 = Release|Win32 {E7116F50-2B10-472F-92BD-C8667AA9C1AE}.Release|x64.ActiveCfg = Release|Win32 - {028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|Win32.ActiveCfg = Debug|Win32 {028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|Win32.Build.0 = Debug|Win32 {028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|x64.ActiveCfg = Debug|Win32 - {028C7278-05D7-4E18-82FE-BE231B844F41}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {028C7278-05D7-4E18-82FE-BE231B844F41}.Release|Mixed Platforms.Build.0 = Release|Win32 {028C7278-05D7-4E18-82FE-BE231B844F41}.Release|Win32.ActiveCfg = Release|Win32 {028C7278-05D7-4E18-82FE-BE231B844F41}.Release|Win32.Build.0 = Release|Win32 {028C7278-05D7-4E18-82FE-BE231B844F41}.Release|x64.ActiveCfg = Release|Win32 - {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Debug|Win32.ActiveCfg = Debug|Win32 {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Debug|Win32.Build.0 = Debug|Win32 {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Debug|x64.ActiveCfg = Debug|Win32 - {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Release|Mixed Platforms.Build.0 = Release|Win32 {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Release|Win32.ActiveCfg = Release|Win32 {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Release|Win32.Build.0 = Release|Win32 {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Release|x64.ActiveCfg = Release|Win32 - {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Debug|Win32.ActiveCfg = Debug|Win32 {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Debug|Win32.Build.0 = Debug|Win32 {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Debug|x64.ActiveCfg = Debug|Win32 - {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Release|Mixed Platforms.Build.0 = Release|Win32 {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Release|Win32.ActiveCfg = Release|Win32 {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Release|Win32.Build.0 = Release|Win32 {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Release|x64.ActiveCfg = Release|Win32 - {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Debug|Win32.ActiveCfg = Debug|Win32 {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Debug|Win32.Build.0 = Debug|Win32 {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Debug|x64.ActiveCfg = Debug|Win32 - {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Release|Mixed Platforms.Build.0 = Release|Win32 {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Release|Win32.ActiveCfg = Release|Win32 {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Release|Win32.Build.0 = Release|Win32 {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Release|x64.ActiveCfg = Release|Win32 - {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Debug|Win32.ActiveCfg = Debug|Win32 {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Debug|Win32.Build.0 = Debug|Win32 {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Debug|x64.ActiveCfg = Debug|Win32 - {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Release|Mixed Platforms.Build.0 = Release|Win32 {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Release|Win32.ActiveCfg = Release|Win32 {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Release|Win32.Build.0 = Release|Win32 {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Release|x64.ActiveCfg = Release|Win32 - {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Debug|Win32.ActiveCfg = Debug|Win32 {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Debug|Win32.Build.0 = Debug|Win32 {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Debug|x64.ActiveCfg = Debug|Win32 - {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Release|Mixed Platforms.Build.0 = Release|Win32 {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Release|Win32.ActiveCfg = Release|Win32 {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Release|Win32.Build.0 = Release|Win32 {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Release|x64.ActiveCfg = Release|Win32 - {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Debug|Win32.ActiveCfg = Debug|Win32 {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Debug|Win32.Build.0 = Debug|Win32 {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Debug|x64.ActiveCfg = Debug|Win32 - {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Release|Mixed Platforms.Build.0 = Release|Win32 {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Release|Win32.ActiveCfg = Release|Win32 {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Release|Win32.Build.0 = Release|Win32 {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Release|x64.ActiveCfg = Release|Win32 - {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Debug|Win32.ActiveCfg = Debug|Win32 {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Debug|Win32.Build.0 = Debug|Win32 {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Debug|x64.ActiveCfg = Debug|Win32 - {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Release|Mixed Platforms.Build.0 = Release|Win32 {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Release|Win32.ActiveCfg = Release|Win32 {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Release|Win32.Build.0 = Release|Win32 {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Release|x64.ActiveCfg = Release|Win32 - {F6A33240-8F29-48BD-98F0-826995911799}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {F6A33240-8F29-48BD-98F0-826995911799}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {F6A33240-8F29-48BD-98F0-826995911799}.Debug|Win32.ActiveCfg = Debug|Win32 {F6A33240-8F29-48BD-98F0-826995911799}.Debug|Win32.Build.0 = Debug|Win32 {F6A33240-8F29-48BD-98F0-826995911799}.Debug|x64.ActiveCfg = Debug|Win32 - {F6A33240-8F29-48BD-98F0-826995911799}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {F6A33240-8F29-48BD-98F0-826995911799}.Release|Mixed Platforms.Build.0 = Release|Win32 {F6A33240-8F29-48BD-98F0-826995911799}.Release|Win32.ActiveCfg = Release|Win32 {F6A33240-8F29-48BD-98F0-826995911799}.Release|Win32.Build.0 = Release|Win32 {F6A33240-8F29-48BD-98F0-826995911799}.Release|x64.ActiveCfg = Release|Win32 - {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Debug|Win32.ActiveCfg = Debug|Win32 {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Debug|Win32.Build.0 = Debug|Win32 {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Debug|x64.ActiveCfg = Debug|Win32 - {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Release|Mixed Platforms.Build.0 = Release|Win32 {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Release|Win32.ActiveCfg = Release|Win32 {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Release|Win32.Build.0 = Release|Win32 {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Release|x64.ActiveCfg = Release|Win32 - {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|Win32.ActiveCfg = Debug|Win32 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|Win32.Build.0 = Debug|Win32 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|x64.ActiveCfg = Debug|Win32 - {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Release|Mixed Platforms.Build.0 = Release|Win32 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Release|Win32.ActiveCfg = Release|Win32 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Release|Win32.Build.0 = Release|Win32 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Release|x64.ActiveCfg = Release|Win32 - {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Debug|Win32.ActiveCfg = Debug|Win32 {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Debug|Win32.Build.0 = Debug|Win32 {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Debug|x64.ActiveCfg = Debug|Win32 - {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Release|Mixed Platforms.Build.0 = Release|Win32 {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Release|Win32.ActiveCfg = Release|Win32 {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Release|Win32.Build.0 = Release|Win32 {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Release|x64.ActiveCfg = Release|Win32 - {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Debug|Win32.ActiveCfg = Debug|Win32 {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Debug|Win32.Build.0 = Debug|Win32 {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Debug|x64.ActiveCfg = Debug|Win32 - {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Release|Mixed Platforms.Build.0 = Release|Win32 {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Release|Win32.ActiveCfg = Release|Win32 {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Release|Win32.Build.0 = Release|Win32 {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Release|x64.ActiveCfg = Release|Win32 - {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Debug|Win32.ActiveCfg = Debug|Win32 {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Debug|Win32.Build.0 = Debug|Win32 {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Debug|x64.ActiveCfg = Debug|Win32 - {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|Mixed Platforms.Build.0 = Release|Win32 {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|Win32.ActiveCfg = Release|Win32 {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|Win32.Build.0 = Release|Win32 {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|x64.ActiveCfg = Release|Win32 - {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|Win32.ActiveCfg = Debug|Win32 {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|Win32.Build.0 = Debug|Win32 {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|x64.ActiveCfg = Debug|Win32 - {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|Mixed Platforms.Build.0 = Release|Win32 {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|Win32.ActiveCfg = Release|Win32 {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|Win32.Build.0 = Release|Win32 {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|x64.ActiveCfg = Release|Win32 - {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.Debug|Win32.ActiveCfg = Debug|Win32 {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.Debug|Win32.Build.0 = Debug|Win32 {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.Debug|x64.ActiveCfg = Debug|Win32 - {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.Release|Mixed Platforms.Build.0 = Release|Win32 {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.Release|Win32.ActiveCfg = Release|Win32 {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.Release|Win32.Build.0 = Release|Win32 {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.Release|x64.ActiveCfg = Release|Win32 - {13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Debug|Win32.ActiveCfg = Debug|Win32 {13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Debug|Win32.Build.0 = Debug|Win32 {13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Debug|x64.ActiveCfg = Debug|Win32 - {13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Release|Mixed Platforms.Build.0 = Release|Win32 {13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Release|Win32.ActiveCfg = Release|Win32 {13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Release|Win32.Build.0 = Release|Win32 {13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Release|x64.ActiveCfg = Release|Win32 - {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Debug|Win32.ActiveCfg = Debug|Win32 {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Debug|Win32.Build.0 = Debug|Win32 {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Debug|x64.ActiveCfg = Debug|Win32 - {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Release|Mixed Platforms.Build.0 = Release|Win32 {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Release|Win32.ActiveCfg = Release|Win32 {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Release|Win32.Build.0 = Release|Win32 {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Release|x64.ActiveCfg = Release|Win32 - {36E854E3-CE12-4348-A125-CCF3F9D74813}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {36E854E3-CE12-4348-A125-CCF3F9D74813}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {36E854E3-CE12-4348-A125-CCF3F9D74813}.Debug|Win32.ActiveCfg = Debug|Win32 {36E854E3-CE12-4348-A125-CCF3F9D74813}.Debug|Win32.Build.0 = Debug|Win32 {36E854E3-CE12-4348-A125-CCF3F9D74813}.Debug|x64.ActiveCfg = Debug|Win32 - {36E854E3-CE12-4348-A125-CCF3F9D74813}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {36E854E3-CE12-4348-A125-CCF3F9D74813}.Release|Mixed Platforms.Build.0 = Release|Win32 {36E854E3-CE12-4348-A125-CCF3F9D74813}.Release|Win32.ActiveCfg = Release|Win32 {36E854E3-CE12-4348-A125-CCF3F9D74813}.Release|Win32.Build.0 = Release|Win32 {36E854E3-CE12-4348-A125-CCF3F9D74813}.Release|x64.ActiveCfg = Release|Win32 - {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|Win32.ActiveCfg = Debug|Win32 {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|Win32.Build.0 = Debug|Win32 {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|x64.ActiveCfg = Debug|Win32 - {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|Mixed Platforms.Build.0 = Release|Win32 {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|Win32.ActiveCfg = Release|Win32 {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|Win32.Build.0 = Release|Win32 {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|x64.ActiveCfg = Release|Win32 - {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Debug|Win32.ActiveCfg = Debug|Win32 {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Debug|Win32.Build.0 = Debug|Win32 {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Debug|x64.ActiveCfg = Debug|Win32 - {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Release|Mixed Platforms.Build.0 = Release|Win32 {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Release|Win32.ActiveCfg = Release|Win32 {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Release|Win32.Build.0 = Release|Win32 {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Release|x64.ActiveCfg = Release|Win32 - {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Debug|Win32.ActiveCfg = Debug|Win32 {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Debug|Win32.Build.0 = Debug|Win32 {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Debug|x64.ActiveCfg = Debug|Win32 - {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Release|Mixed Platforms.Build.0 = Release|Win32 {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Release|Win32.ActiveCfg = Release|Win32 {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Release|Win32.Build.0 = Release|Win32 {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Release|x64.ActiveCfg = Release|Win32 - {0D108721-EAE8-4BAF-8102-D8960EC93647}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {0D108721-EAE8-4BAF-8102-D8960EC93647}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {0D108721-EAE8-4BAF-8102-D8960EC93647}.Debug|Win32.ActiveCfg = Debug|Win32 {0D108721-EAE8-4BAF-8102-D8960EC93647}.Debug|Win32.Build.0 = Debug|Win32 {0D108721-EAE8-4BAF-8102-D8960EC93647}.Debug|x64.ActiveCfg = Debug|Win32 - {0D108721-EAE8-4BAF-8102-D8960EC93647}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {0D108721-EAE8-4BAF-8102-D8960EC93647}.Release|Mixed Platforms.Build.0 = Release|Win32 {0D108721-EAE8-4BAF-8102-D8960EC93647}.Release|Win32.ActiveCfg = Release|Win32 {0D108721-EAE8-4BAF-8102-D8960EC93647}.Release|Win32.Build.0 = Release|Win32 {0D108721-EAE8-4BAF-8102-D8960EC93647}.Release|x64.ActiveCfg = Release|Win32 - {B535402E-38D2-4D54-8360-423ACBD17192}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {B535402E-38D2-4D54-8360-423ACBD17192}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {B535402E-38D2-4D54-8360-423ACBD17192}.Debug|Win32.ActiveCfg = Debug|Win32 {B535402E-38D2-4D54-8360-423ACBD17192}.Debug|Win32.Build.0 = Debug|Win32 {B535402E-38D2-4D54-8360-423ACBD17192}.Debug|x64.ActiveCfg = Debug|Win32 - {B535402E-38D2-4D54-8360-423ACBD17192}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {B535402E-38D2-4D54-8360-423ACBD17192}.Release|Mixed Platforms.Build.0 = Release|Win32 {B535402E-38D2-4D54-8360-423ACBD17192}.Release|Win32.ActiveCfg = Release|Win32 {B535402E-38D2-4D54-8360-423ACBD17192}.Release|Win32.Build.0 = Release|Win32 {B535402E-38D2-4D54-8360-423ACBD17192}.Release|x64.ActiveCfg = Release|Win32 - {4F92B672-DADB-4047-8D6A-4BB3796733FD}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {4F92B672-DADB-4047-8D6A-4BB3796733FD}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {4F92B672-DADB-4047-8D6A-4BB3796733FD}.Debug|Win32.ActiveCfg = Debug|Win32 {4F92B672-DADB-4047-8D6A-4BB3796733FD}.Debug|Win32.Build.0 = Debug|Win32 {4F92B672-DADB-4047-8D6A-4BB3796733FD}.Debug|x64.ActiveCfg = Debug|Win32 - {4F92B672-DADB-4047-8D6A-4BB3796733FD}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {4F92B672-DADB-4047-8D6A-4BB3796733FD}.Release|Mixed Platforms.Build.0 = Release|Win32 {4F92B672-DADB-4047-8D6A-4BB3796733FD}.Release|Win32.ActiveCfg = Release|Win32 {4F92B672-DADB-4047-8D6A-4BB3796733FD}.Release|Win32.Build.0 = Release|Win32 {4F92B672-DADB-4047-8D6A-4BB3796733FD}.Release|x64.ActiveCfg = Release|Win32 - {2DEE4895-1134-439C-B688-52203E57D878}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {2DEE4895-1134-439C-B688-52203E57D878}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {2DEE4895-1134-439C-B688-52203E57D878}.Debug|Win32.ActiveCfg = Debug|Win32 {2DEE4895-1134-439C-B688-52203E57D878}.Debug|Win32.Build.0 = Debug|Win32 {2DEE4895-1134-439C-B688-52203E57D878}.Debug|x64.ActiveCfg = Debug|Win32 - {2DEE4895-1134-439C-B688-52203E57D878}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {2DEE4895-1134-439C-B688-52203E57D878}.Release|Mixed Platforms.Build.0 = Release|Win32 {2DEE4895-1134-439C-B688-52203E57D878}.Release|Win32.ActiveCfg = Release|Win32 {2DEE4895-1134-439C-B688-52203E57D878}.Release|Win32.Build.0 = Release|Win32 {2DEE4895-1134-439C-B688-52203E57D878}.Release|x64.ActiveCfg = Release|Win32 - {AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Debug|Win32.ActiveCfg = Debug|Win32 {AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Debug|Win32.Build.0 = Debug|Win32 {AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Debug|x64.ActiveCfg = Debug|Win32 - {AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Release|Mixed Platforms.Build.0 = Release|Win32 {AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Release|Win32.ActiveCfg = Release|Win32 {AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Release|Win32.Build.0 = Release|Win32 {AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Release|x64.ActiveCfg = Release|Win32 - {2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Debug|Win32.ActiveCfg = Debug|Win32 {2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Debug|Win32.Build.0 = Debug|Win32 {2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Debug|x64.ActiveCfg = Debug|Win32 - {2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Release|Mixed Platforms.Build.0 = Release|Win32 {2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Release|Win32.ActiveCfg = Release|Win32 {2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Release|Win32.Build.0 = Release|Win32 {2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Release|x64.ActiveCfg = Release|Win32 - {94001A0E-A837-445C-8004-F918F10D0226}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {94001A0E-A837-445C-8004-F918F10D0226}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {94001A0E-A837-445C-8004-F918F10D0226}.Debug|Win32.ActiveCfg = Debug|Win32 {94001A0E-A837-445C-8004-F918F10D0226}.Debug|Win32.Build.0 = Debug|Win32 {94001A0E-A837-445C-8004-F918F10D0226}.Debug|x64.ActiveCfg = Debug|Win32 - {94001A0E-A837-445C-8004-F918F10D0226}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {94001A0E-A837-445C-8004-F918F10D0226}.Release|Mixed Platforms.Build.0 = Release|Win32 {94001A0E-A837-445C-8004-F918F10D0226}.Release|Win32.ActiveCfg = Release|Win32 {94001A0E-A837-445C-8004-F918F10D0226}.Release|Win32.Build.0 = Release|Win32 {94001A0E-A837-445C-8004-F918F10D0226}.Release|x64.ActiveCfg = Release|Win32 - {2286DA73-9FC5-45BC-A508-85994C3317AB}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {2286DA73-9FC5-45BC-A508-85994C3317AB}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {2286DA73-9FC5-45BC-A508-85994C3317AB}.Debug|Win32.ActiveCfg = Debug|Win32 {2286DA73-9FC5-45BC-A508-85994C3317AB}.Debug|Win32.Build.0 = Debug|Win32 {2286DA73-9FC5-45BC-A508-85994C3317AB}.Debug|x64.ActiveCfg = Debug|Win32 - {2286DA73-9FC5-45BC-A508-85994C3317AB}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {2286DA73-9FC5-45BC-A508-85994C3317AB}.Release|Mixed Platforms.Build.0 = Release|Win32 {2286DA73-9FC5-45BC-A508-85994C3317AB}.Release|Win32.ActiveCfg = Release|Win32 {2286DA73-9FC5-45BC-A508-85994C3317AB}.Release|Win32.Build.0 = Release|Win32 {2286DA73-9FC5-45BC-A508-85994C3317AB}.Release|x64.ActiveCfg = Release|Win32 - {3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Debug|Win32.ActiveCfg = Debug|Win32 {3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Debug|Win32.Build.0 = Debug|Win32 {3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Debug|x64.ActiveCfg = Debug|Win32 - {3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Release|Mixed Platforms.Build.0 = Release|Win32 {3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Release|Win32.ActiveCfg = Release|Win32 {3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Release|Win32.Build.0 = Release|Win32 {3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Release|x64.ActiveCfg = Release|Win32 - {87A1FE3D-F410-4C8E-9591-8C625985BC70}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {87A1FE3D-F410-4C8E-9591-8C625985BC70}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {87A1FE3D-F410-4C8E-9591-8C625985BC70}.Debug|Win32.ActiveCfg = Debug|Win32 {87A1FE3D-F410-4C8E-9591-8C625985BC70}.Debug|x64.ActiveCfg = Debug|Win32 - {87A1FE3D-F410-4C8E-9591-8C625985BC70}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {87A1FE3D-F410-4C8E-9591-8C625985BC70}.Release|Mixed Platforms.Build.0 = Release|Win32 {87A1FE3D-F410-4C8E-9591-8C625985BC70}.Release|Win32.ActiveCfg = Release|Win32 {87A1FE3D-F410-4C8E-9591-8C625985BC70}.Release|x64.ActiveCfg = Release|Win32 - {7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Debug|Win32.ActiveCfg = Debug|Win32 {7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Debug|Win32.Build.0 = Debug|Win32 {7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Debug|x64.ActiveCfg = Debug|Win32 - {7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Release|Mixed Platforms.Build.0 = Release|Win32 {7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Release|Win32.ActiveCfg = Release|Win32 {7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Release|Win32.Build.0 = Release|Win32 {7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Release|x64.ActiveCfg = Release|Win32 - {7EB71250-F002-4ED8-92CA-CA218114537A}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {7EB71250-F002-4ED8-92CA-CA218114537A}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {7EB71250-F002-4ED8-92CA-CA218114537A}.Debug|Win32.ActiveCfg = Debug|Win32 {7EB71250-F002-4ED8-92CA-CA218114537A}.Debug|x64.ActiveCfg = Debug|Win32 - {7EB71250-F002-4ED8-92CA-CA218114537A}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {7EB71250-F002-4ED8-92CA-CA218114537A}.Release|Mixed Platforms.Build.0 = Release|Win32 {7EB71250-F002-4ED8-92CA-CA218114537A}.Release|Win32.ActiveCfg = Release|Win32 {7EB71250-F002-4ED8-92CA-CA218114537A}.Release|x64.ActiveCfg = Release|Win32 - {6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Debug|Win32.ActiveCfg = Debug|Win32 {6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Debug|x64.ActiveCfg = Debug|Win32 - {6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Release|Mixed Platforms.Build.0 = Release|Win32 {6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Release|Win32.ActiveCfg = Release|Win32 {6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Release|x64.ActiveCfg = Release|Win32 - {464AAB78-5489-4916-BE51-BF8D61822311}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {464AAB78-5489-4916-BE51-BF8D61822311}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {464AAB78-5489-4916-BE51-BF8D61822311}.Debug|Win32.ActiveCfg = Debug|Win32 {464AAB78-5489-4916-BE51-BF8D61822311}.Debug|x64.ActiveCfg = Debug|Win32 - {464AAB78-5489-4916-BE51-BF8D61822311}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {464AAB78-5489-4916-BE51-BF8D61822311}.Release|Mixed Platforms.Build.0 = Release|Win32 {464AAB78-5489-4916-BE51-BF8D61822311}.Release|Win32.ActiveCfg = Release|Win32 {464AAB78-5489-4916-BE51-BF8D61822311}.Release|x64.ActiveCfg = Release|Win32 - {0AD1177E-1FD8-4643-9391-431467A11084}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {0AD1177E-1FD8-4643-9391-431467A11084}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {0AD1177E-1FD8-4643-9391-431467A11084}.Debug|Win32.ActiveCfg = Debug|Win32 {0AD1177E-1FD8-4643-9391-431467A11084}.Debug|Win32.Build.0 = Debug|Win32 {0AD1177E-1FD8-4643-9391-431467A11084}.Debug|x64.ActiveCfg = Debug|Win32 - {0AD1177E-1FD8-4643-9391-431467A11084}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {0AD1177E-1FD8-4643-9391-431467A11084}.Release|Mixed Platforms.Build.0 = Release|Win32 {0AD1177E-1FD8-4643-9391-431467A11084}.Release|Win32.ActiveCfg = Release|Win32 {0AD1177E-1FD8-4643-9391-431467A11084}.Release|Win32.Build.0 = Release|Win32 {0AD1177E-1FD8-4643-9391-431467A11084}.Release|x64.ActiveCfg = Release|Win32 - {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Debug|Win32.ActiveCfg = Debug|Win32 {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Debug|Win32.Build.0 = Debug|Win32 {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Debug|x64.ActiveCfg = Debug|Win32 - {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Release|Mixed Platforms.Build.0 = Release|Win32 {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Release|Win32.ActiveCfg = Release|Win32 {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Release|Win32.Build.0 = Release|Win32 {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Release|x64.ActiveCfg = Release|Win32 - {D5D2BF72-29FE-4982-A9FA-82FDD086DB1B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {D5D2BF72-29FE-4982-A9FA-82FDD086DB1B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82FDD086DB1B}.Debug|Win32.ActiveCfg = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82FDD086DB1B}.Debug|Win32.Build.0 = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82FDD086DB1B}.Debug|x64.ActiveCfg = Debug|Win32 - {D5D2BF72-29FE-4982-A9FA-82FDD086DB1B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {D5D2BF72-29FE-4982-A9FA-82FDD086DB1B}.Release|Mixed Platforms.Build.0 = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82FDD086DB1B}.Release|Win32.ActiveCfg = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82FDD086DB1B}.Release|Win32.Build.0 = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82FDD086DB1B}.Release|x64.ActiveCfg = Release|Win32 - {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Debug|Win32.ActiveCfg = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Debug|Win32.Build.0 = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Debug|x64.ActiveCfg = Debug|Win32 - {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Release|Mixed Platforms.Build.0 = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Release|Win32.ActiveCfg = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Release|Win32.Build.0 = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Release|x64.ActiveCfg = Release|Win32 - {D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Debug|Win32.ActiveCfg = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Debug|Win32.Build.0 = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Debug|x64.ActiveCfg = Debug|Win32 - {D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Release|Mixed Platforms.Build.0 = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Release|Win32.ActiveCfg = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Release|Win32.Build.0 = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Release|x64.ActiveCfg = Release|Win32 - {D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Debug|Win32.ActiveCfg = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Debug|Win32.Build.0 = Debug|Win32 {D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Debug|x64.ActiveCfg = Debug|Win32 - {D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Release|Mixed Platforms.Build.0 = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Release|Win32.ActiveCfg = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Release|Win32.Build.0 = Release|Win32 {D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Release|x64.ActiveCfg = Release|Win32 - {E316772F-5D8F-4F2A-8F71-094C3E859D34}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {E316772F-5D8F-4F2A-8F71-094C3E859D34}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {E316772F-5D8F-4F2A-8F71-094C3E859D34}.Debug|Win32.ActiveCfg = Debug|Win32 {E316772F-5D8F-4F2A-8F71-094C3E859D34}.Debug|Win32.Build.0 = Debug|Win32 {E316772F-5D8F-4F2A-8F71-094C3E859D34}.Debug|x64.ActiveCfg = Debug|Win32 - {E316772F-5D8F-4F2A-8F71-094C3E859D34}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {E316772F-5D8F-4F2A-8F71-094C3E859D34}.Release|Mixed Platforms.Build.0 = Release|Win32 {E316772F-5D8F-4F2A-8F71-094C3E859D34}.Release|Win32.ActiveCfg = Release|Win32 {E316772F-5D8F-4F2A-8F71-094C3E859D34}.Release|Win32.Build.0 = Release|Win32 {E316772F-5D8F-4F2A-8F71-094C3E859D34}.Release|x64.ActiveCfg = Release|Win32 - {D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Debug|Win32.ActiveCfg = Debug|Win32 {D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Debug|Win32.Build.0 = Debug|Win32 {D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Debug|x64.ActiveCfg = Debug|Win32 - {D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Release|Mixed Platforms.Build.0 = Release|Win32 {D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Release|Win32.ActiveCfg = Release|Win32 {D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Release|Win32.Build.0 = Release|Win32 {D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Release|x64.ActiveCfg = Release|Win32 - {38FE0559-9910-43A8-9E45-3E5004C27692}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {38FE0559-9910-43A8-9E45-3E5004C27692}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {38FE0559-9910-43A8-9E45-3E5004C27692}.Debug|Win32.ActiveCfg = Debug|Win32 {38FE0559-9910-43A8-9E45-3E5004C27692}.Debug|Win32.Build.0 = Debug|Win32 {38FE0559-9910-43A8-9E45-3E5004C27692}.Debug|x64.ActiveCfg = Debug|Win32 - {38FE0559-9910-43A8-9E45-3E5004C27692}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {38FE0559-9910-43A8-9E45-3E5004C27692}.Release|Mixed Platforms.Build.0 = Release|Win32 {38FE0559-9910-43A8-9E45-3E5004C27692}.Release|Win32.ActiveCfg = Release|Win32 {38FE0559-9910-43A8-9E45-3E5004C27692}.Release|Win32.Build.0 = Release|Win32 {38FE0559-9910-43A8-9E45-3E5004C27692}.Release|x64.ActiveCfg = Release|Win32 - {0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Debug|Win32.ActiveCfg = Debug|Win32 {0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Debug|Win32.Build.0 = Debug|Win32 {0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Debug|x64.ActiveCfg = Debug|Win32 - {0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Release|Mixed Platforms.Build.0 = Release|Win32 {0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Release|Win32.ActiveCfg = Release|Win32 {0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Release|Win32.Build.0 = Release|Win32 {0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Release|x64.ActiveCfg = Release|Win32 - {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Debug|Win32.ActiveCfg = Debug|Win32 {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Debug|Win32.Build.0 = Debug|Win32 {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Debug|x64.ActiveCfg = Debug|Win32 - {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|Mixed Platforms.Build.0 = Release|Win32 {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|Win32.ActiveCfg = Release|Win32 {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|Win32.Build.0 = Release|Win32 {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|x64.ActiveCfg = Release|Win32 - {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|Win32.ActiveCfg = Debug|Win32 {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|Win32.Build.0 = Debug|Win32 {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|x64.ActiveCfg = Debug|Win32 - {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|Mixed Platforms.Build.0 = Release|Win32 {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|Win32.ActiveCfg = Release|Win32 {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|Win32.Build.0 = Release|Win32 {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|x64.ActiveCfg = Release|Win32 - {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Debug|Mixed Platforms.ActiveCfg = Debug_Mono|Win32 - {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Debug|Mixed Platforms.Build.0 = Debug_Mono|Win32 {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Debug|Win32.ActiveCfg = Debug_CLR|Win32 {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Debug|Win32.Build.0 = Debug_CLR|Win32 {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Debug|x64.ActiveCfg = Debug_Mono|Win32 - {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Release|Mixed Platforms.ActiveCfg = Release_Mono|Win32 - {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Release|Mixed Platforms.Build.0 = Release_Mono|Win32 {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Release|Win32.ActiveCfg = Release_CLR|Win32 {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Release|x64.ActiveCfg = Release_Mono|Win32 - {834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|Win32.ActiveCfg = Debug|Any CPU {834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|Win32.Build.0 = Debug|Any CPU {834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|x64.ActiveCfg = Debug|Any CPU - {834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|Mixed Platforms.Build.0 = Release|Any CPU {834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|Win32.ActiveCfg = Release|Any CPU {834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|x64.ActiveCfg = Release|Any CPU - {E796E337-DE78-4303-8614-9A590862EE95}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {E796E337-DE78-4303-8614-9A590862EE95}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {E796E337-DE78-4303-8614-9A590862EE95}.Debug|Win32.ActiveCfg = Debug|Win32 {E796E337-DE78-4303-8614-9A590862EE95}.Debug|Win32.Build.0 = Debug|Win32 {E796E337-DE78-4303-8614-9A590862EE95}.Debug|x64.ActiveCfg = Debug|Win32 - {E796E337-DE78-4303-8614-9A590862EE95}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {E796E337-DE78-4303-8614-9A590862EE95}.Release|Mixed Platforms.Build.0 = Release|Win32 {E796E337-DE78-4303-8614-9A590862EE95}.Release|Win32.ActiveCfg = Release|Win32 {E796E337-DE78-4303-8614-9A590862EE95}.Release|Win32.Build.0 = Release|Win32 {E796E337-DE78-4303-8614-9A590862EE95}.Release|x64.ActiveCfg = Release|Win32 - {419C8F80-D858-4B48-A25C-AF4007608137}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {419C8F80-D858-4B48-A25C-AF4007608137}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {419C8F80-D858-4B48-A25C-AF4007608137}.Debug|Win32.ActiveCfg = Debug|Win32 {419C8F80-D858-4B48-A25C-AF4007608137}.Debug|Win32.Build.0 = Debug|Win32 {419C8F80-D858-4B48-A25C-AF4007608137}.Debug|x64.ActiveCfg = Debug|Win32 - {419C8F80-D858-4B48-A25C-AF4007608137}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {419C8F80-D858-4B48-A25C-AF4007608137}.Release|Mixed Platforms.Build.0 = Release|Win32 {419C8F80-D858-4B48-A25C-AF4007608137}.Release|Win32.ActiveCfg = Release|Win32 {419C8F80-D858-4B48-A25C-AF4007608137}.Release|Win32.Build.0 = Release|Win32 {419C8F80-D858-4B48-A25C-AF4007608137}.Release|x64.ActiveCfg = Release|Win32 - {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Debug|Win32.ActiveCfg = Debug|Win32 {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Debug|Win32.Build.0 = Debug|Win32 {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Debug|x64.ActiveCfg = Debug|Win32 - {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|Mixed Platforms.Build.0 = Release|Win32 {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|Win32.ActiveCfg = Release|Win32 {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|Win32.Build.0 = Release|Win32 {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|x64.ActiveCfg = Release|Win32 - {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|Win32.ActiveCfg = Debug|Win32 {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|Win32.Build.0 = Debug|Win32 {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|x64.ActiveCfg = Debug|Win32 - {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|Mixed Platforms.Build.0 = Release|Win32 {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|Win32.ActiveCfg = Release|Win32 {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|Win32.Build.0 = Release|Win32 {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|x64.ActiveCfg = Release|Win32 From mikej at freeswitch.org Mon Dec 8 15:17:06 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Mon, 08 Dec 2008 18:17:06 -0500 Subject: [Freeswitch-svn] [commit] r10663 - freeswitch/trunk/debian Message-ID: Author: mikej Date: Mon Dec 8 18:17:05 2008 New Revision: 10663 Log: OPENZAP-29 add openzap libs/mods to deb packages Modified: freeswitch/trunk/debian/freeswitch.install Modified: freeswitch/trunk/debian/freeswitch.install ============================================================================== --- freeswitch/trunk/debian/freeswitch.install (original) +++ freeswitch/trunk/debian/freeswitch.install Mon Dec 8 18:17:05 2008 @@ -2,6 +2,7 @@ opt/freeswitch/bin/freeswitch opt/freeswitch/bin/scripts/* opt/freeswitch/lib/libfreeswitch*.so* +opt/freeswitch/lib/libopenzap*.so* opt/freeswitch/mod/mod_shout* opt/freeswitch/mod/mod_cdr_csv.so* opt/freeswitch/mod/mod_console.so* @@ -30,6 +31,12 @@ opt/freeswitch/mod/mod_sofia.so* opt/freeswitch/mod/mod_woomera.so* opt/freeswitch/mod/mod_openzap.so +opt/freeswitch/mod/ozmod_analog_em.so +opt/freeswitch/mod/ozmod_analog.so +opt/freeswitch/mod/ozmod_isdn.so +opt/freeswitch/mod/ozmod_ss7_boost.so +opt/freeswitch/mod/ozmod_wanpipe.so +opt/freeswitch/mod/ozmod_zt.so opt/freeswitch/mod/mod_event_*.so* opt/freeswitch/mod/mod_native_file.so* opt/freeswitch/mod/mod_sndfile.so* From anthm at freeswitch.org Mon Dec 8 16:32:52 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Mon, 08 Dec 2008 19:32:52 -0500 Subject: [Freeswitch-svn] [commit] r10664 - in freeswitch/trunk/src: . include Message-ID: Author: anthm Date: Mon Dec 8 19:32:51 2008 New Revision: 10664 Log: a whole bunch of stuff just to avoid a sonus issue silence_when_idle=400 chanvar to send generated silence duing sleeps etc Modified: freeswitch/trunk/src/include/switch_types.h freeswitch/trunk/src/switch_ivr.c freeswitch/trunk/src/switch_ivr_originate.c freeswitch/trunk/src/switch_resample.c freeswitch/trunk/src/switch_rtp.c Modified: freeswitch/trunk/src/include/switch_types.h ============================================================================== --- freeswitch/trunk/src/include/switch_types.h (original) +++ freeswitch/trunk/src/include/switch_types.h Mon Dec 8 19:32:51 2008 @@ -110,6 +110,7 @@ #define SWITCH_PATH_SEPARATOR "/" #endif #define SWITCH_URL_SEPARATOR "://" +#define SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE "send_silence_when_idle" #define SWITCH_CURRENT_APPLICATION_VARIABLE "current_application" #define SWITCH_CURRENT_APPLICATION_DATA_VARIABLE "current_application_data" #define SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE "current_application_response" Modified: freeswitch/trunk/src/switch_ivr.c ============================================================================== --- freeswitch/trunk/src/switch_ivr.c (original) +++ freeswitch/trunk/src/switch_ivr.c Mon Dec 8 19:32:51 2008 @@ -47,6 +47,41 @@ int32_t left, elapsed; char data[2] = ""; + switch_frame_t write_frame = { 0 }; + unsigned char *abuf = NULL; + switch_codec_implementation_t imp = {0}; + switch_codec_t codec = { 0 }; + int sval = 0; + const char *var; + + if ((var = switch_channel_get_variable(channel, SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE)) && (sval = atoi(var))) { + switch_core_session_get_read_impl(session, &imp); + + if (switch_core_codec_init(&codec, + "L16", + NULL, + imp.samples_per_second, + imp.microseconds_per_packet / 1000, + imp.number_of_channels, + SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, + switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec Error L16@%uhz %u channels %dms\n", + imp.samples_per_second, imp.number_of_channels, imp.microseconds_per_packet / 1000); + return SWITCH_STATUS_FALSE; + } + + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Codec Activated L16@%uhz %u channels %dms\n", + imp.samples_per_second, imp.number_of_channels, imp.microseconds_per_packet / 1000); + + write_frame.codec = &codec; + switch_zmalloc(abuf, SWITCH_RECOMMENDED_BUFFER_SIZE); + write_frame.data = abuf; + write_frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE; + write_frame.datalen = imp.decoded_bytes_per_packet; + write_frame.samples = write_frame.datalen / sizeof(int16_t); + } + cng_frame.data = data; cng_frame.datalen = 2; cng_frame.buflen = 2; @@ -134,10 +169,20 @@ } } - switch_core_session_write_frame(session, &cng_frame, SWITCH_IO_FLAG_NONE, 0); + if (sval) { + switch_generate_sln_silence((int16_t *) write_frame.data, write_frame.samples, sval); + switch_core_session_write_frame(session, &write_frame, SWITCH_IO_FLAG_NONE, 0); + } else { + switch_core_session_write_frame(session, &cng_frame, SWITCH_IO_FLAG_NONE, 0); + } + } + if (write_frame.codec) { + switch_core_codec_destroy(&codec); } + switch_safe_free(abuf); + return status; } @@ -749,9 +794,44 @@ switch_time_t started = 0, digit_started = 0; uint32_t abs_elapsed = 0, digit_elapsed = 0; uint32_t eff_timeout = 0; + switch_frame_t write_frame = { 0 }; + unsigned char *abuf = NULL; + switch_codec_implementation_t imp = {0}; + switch_codec_t codec = { 0 }; + int sval = 0; + const char *var; + + if ((var = switch_channel_get_variable(channel, SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE)) && (sval = atoi(var))) { + switch_core_session_get_read_impl(session, &imp); + + if (switch_core_codec_init(&codec, + "L16", + NULL, + imp.samples_per_second, + imp.microseconds_per_packet / 1000, + imp.number_of_channels, + SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, + switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec Error L16@%uhz %u channels %dms\n", + imp.samples_per_second, imp.number_of_channels, imp.microseconds_per_packet / 1000); + return SWITCH_STATUS_FALSE; + } + + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Codec Activated L16@%uhz %u channels %dms\n", + imp.samples_per_second, imp.number_of_channels, imp.microseconds_per_packet / 1000); + + write_frame.codec = &codec; + switch_zmalloc(abuf, SWITCH_RECOMMENDED_BUFFER_SIZE); + write_frame.data = abuf; + write_frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE; + write_frame.datalen = imp.decoded_bytes_per_packet; + write_frame.samples = write_frame.datalen / sizeof(int16_t); + } - if (terminator != NULL) + if (terminator != NULL) { *terminator = '\0'; + } if (!switch_strlen_zero(terminators)) { for (i = 0; i < x; i++) { @@ -838,9 +918,21 @@ if (!SWITCH_READ_ACCEPTABLE(status)) { break; } + + if (write_frame.data) { + switch_generate_sln_silence((int16_t *) write_frame.data, write_frame.samples, sval); + switch_core_session_write_frame(session, &write_frame, SWITCH_IO_FLAG_NONE, 0); + } + } } + if (write_frame.codec) { + switch_core_codec_destroy(&codec); + } + + switch_safe_free(abuf); + return status; } Modified: freeswitch/trunk/src/switch_ivr_originate.c ============================================================================== --- freeswitch/trunk/src/switch_ivr_originate.c (original) +++ freeswitch/trunk/src/switch_ivr_originate.c Mon Dec 8 19:32:51 2008 @@ -279,6 +279,7 @@ teletone_generation_session_t ts; switch_file_handle_t fhb; switch_file_handle_t *fh; + int silence; uint8_t asis; }; @@ -348,9 +349,16 @@ ringback_data = switch_channel_get_variable(caller_channel, "ringback"); } - if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE) || switch_channel_test_flag(caller_channel, CF_PROXY_MEDIA)) { ringback_data = NULL; + } else { + if ((var = switch_channel_get_variable(caller_channel, SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE))) { + int sval = atoi(var); + + if (sval) { + ringback_data = switch_core_session_sprintf(session, "ringback:%d", sval); + } + } } } @@ -409,14 +417,27 @@ } ringback.fh = &ringback.fhb; } else { - teletone_init_session(&ringback.ts, 0, teletone_handler, &ringback); - ringback.ts.rate = read_codec->implementation->actual_samples_per_second; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Play Ringback Tone [%s]\n", ringback_data); - if (teletone_run(&ringback.ts, ringback_data)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Playing Tone\n"); - teletone_destroy_session(&ringback.ts); - switch_buffer_destroy(&ringback.audio_buffer); - ringback_data = NULL; + if (!strncasecmp(ringback_data, "silence", 7)) { + const char *p = ringback_data + 7; + if (*p == ':') { + p++; + if (p) { + ringback.silence = atoi(p); + } + } + if (ringback.silence <= 0) { + ringback.silence = 400; + } + } else { + teletone_init_session(&ringback.ts, 0, teletone_handler, &ringback); + ringback.ts.rate = read_codec->implementation->actual_samples_per_second; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Play Ringback Tone [%s]\n", ringback_data); + if (teletone_run(&ringback.ts, ringback_data)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Playing Tone\n"); + teletone_destroy_session(&ringback.ts); + switch_buffer_destroy(&ringback.audio_buffer); + ringback_data = NULL; + } } } switch_safe_free(tmp_data); @@ -491,9 +512,12 @@ write_frame.codec->implementation->decoded_bytes_per_packet)) <= 0) { break; } + } else if (ringback.silence) { + write_frame.datalen = write_frame.codec->implementation->decoded_bytes_per_packet; + switch_generate_sln_silence((int16_t *) write_frame.data, write_frame.datalen / 2, ringback.silence); } - if ((ringback.fh || ringback.audio_buffer) && write_frame.codec && write_frame.datalen) { + if ((ringback.fh || ringback.silence || ringback.audio_buffer) && write_frame.codec && write_frame.datalen) { if (switch_core_session_write_frame(session, &write_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) { break; } @@ -769,6 +793,17 @@ if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE) || switch_channel_test_flag(caller_channel, CF_PROXY_MEDIA)) { ringback_data = NULL; + } else { + const char *vvar; + + if ((vvar = switch_channel_get_variable(caller_channel, SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE))) { + int sval = atoi(vvar); + + if (sval) { + ringback_data = switch_core_session_sprintf(session, "ringback:%d", sval); + } + + } } } @@ -1292,7 +1327,17 @@ } ringback.fh = &ringback.fhb; - + } else if (!strncasecmp(ringback_data, "silence", 7)) { + const char *p = ringback_data + 7; + if (*p == ':') { + p++; + if (p) { + ringback.silence = atoi(p); + } + } + if (ringback.silence <= 0) { + ringback.silence = 400; + } } else { teletone_init_session(&ringback.ts, 0, teletone_handler, &ringback); ringback.ts.rate = read_codec->implementation->actual_samples_per_second; @@ -1436,9 +1481,12 @@ write_frame.codec->implementation->decoded_bytes_per_packet)) <= 0) { break; } + } else if (ringback.silence) { + write_frame.datalen = write_frame.codec->implementation->decoded_bytes_per_packet; + switch_generate_sln_silence((int16_t *) write_frame.data, write_frame.datalen / 2, ringback.silence); } - if ((ringback.fh || ringback.audio_buffer) && write_frame.codec && write_frame.datalen) { + if ((ringback.fh || ringback.silence || ringback.audio_buffer) && write_frame.codec && write_frame.datalen) { if (switch_core_session_write_frame(session, &write_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) { break; } Modified: freeswitch/trunk/src/switch_resample.c ============================================================================== --- freeswitch/trunk/src/switch_resample.c (original) +++ freeswitch/trunk/src/switch_resample.c Mon Dec 8 19:32:51 2008 @@ -203,18 +203,19 @@ SWITCH_DECLARE(void) switch_generate_sln_silence(int16_t *data, uint32_t samples, uint32_t divisor) { - int16_t rnd = 0, rnd2, x; + int16_t x; uint32_t i; int sum_rnd = 0; + int16_t rnd2 = (int16_t) switch_timestamp_now(); assert(divisor); - rnd2 = (int16_t) (intptr_t) &data + (int16_t)switch_timestamp(NULL); + for (i = 0; i < samples; i++, sum_rnd = 0) { - for (x = 0; x < 10; x++) { - rnd += (int16_t)((x + i) * rnd2); - sum_rnd += rnd; + for (x = 0; x < 6; x++) { + rnd2 = rnd2 * 31821U + 13849U; + sum_rnd += rnd2; } switch_normalize_to_16bit(sum_rnd); *data = (int16_t) ((int16_t) sum_rnd / (int) divisor); Modified: freeswitch/trunk/src/switch_rtp.c ============================================================================== --- freeswitch/trunk/src/switch_rtp.c (original) +++ freeswitch/trunk/src/switch_rtp.c Mon Dec 8 19:32:51 2008 @@ -158,6 +158,7 @@ uint32_t last_write_ts; uint32_t last_write_samplecount; uint32_t next_write_samplecount; + switch_time_t last_write_timestamp; uint32_t flags; switch_memory_pool_t *pool; switch_sockaddr_t *from_addr; @@ -1885,15 +1886,27 @@ rtp_session->send_msg.header.ts = htonl(rtp_session->ts); + if ((rtp_session->ts > (rtp_session->last_write_ts + (rtp_session->samples_per_interval * 10))) || rtp_session->ts == rtp_session->samples_per_interval) { m++; } + if (rtp_session->timer.interval && + (rtp_session->timer.samplecount - rtp_session->last_write_samplecount) > rtp_session->samples_per_interval * 2) { + m++; + } + + if (!rtp_session->timer.interval && + ((unsigned)((switch_timestamp_now() - rtp_session->last_write_timestamp))) > (rtp_session->ms_per_packet *2)) { + m++; + } + if (rtp_session->cn && payload != rtp_session->cng_pt) { rtp_session->cn = 0; m++; } + send_msg->header.m = m ? 1 : 0; memcpy(send_msg->body, data, datalen); @@ -2049,7 +2062,10 @@ if (rtp_session->timer.interval) { rtp_session->last_write_samplecount = rtp_session->timer.samplecount; + } else { + rtp_session->last_write_timestamp = (uint32_t) switch_timestamp_now(); } + rtp_session->last_write_ts = this_ts; } From mikej at freeswitch.org Mon Dec 8 16:50:32 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Mon, 08 Dec 2008 19:50:32 -0500 Subject: [Freeswitch-svn] [commit] r10665 - freeswitch/trunk Message-ID: Author: mikej Date: Mon Dec 8 19:50:32 2008 New Revision: 10665 Log: FSBUILD-84 add support for --switchconfdir Modified: freeswitch/trunk/configure.in Modified: freeswitch/trunk/configure.in ============================================================================== --- freeswitch/trunk/configure.in (original) +++ freeswitch/trunk/configure.in Mon Dec 8 19:50:32 2008 @@ -35,9 +35,19 @@ AC_ARG_WITH([modinstdir], [AS_HELP_STRING([--with-modinstdir=DIR], [Install modules into this location (default: $prefix/mod)])], [modinstdir="$withval"], [modinstdir="${prefix}/mod"]) + AC_SUBST(modinstdir) AC_DEFINE_UNQUOTED([SWITCH_MOD_DIR],"${modinstdir}",[where to install the modules to]) +if test "$sysconfdir" = "\${prefix}/etc" ; then + confdir="$prefix/conf" +else + confdir="$sysconfdir" +fi + +AC_SUBST(confdir) +AC_DEFINE_UNQUOTED([SWITCH_CONF_DIR],"${confdir}",[where to install the modules to]) + #Set default language AC_LANG_C # Checks for programs. From mcollins at freeswitch.org Mon Dec 8 16:56:05 2008 From: mcollins at freeswitch.org (FreeSWITCH SVN) Date: Mon, 08 Dec 2008 19:56:05 -0500 Subject: [Freeswitch-svn] [commit] r10666 - freeswitch/trunk/docs/phrase Message-ID: Author: mcollins Date: Mon Dec 8 19:56:05 2008 New Revision: 10666 Log: Fix conf section of phrase_en.xml Modified: freeswitch/trunk/docs/phrase/phrase_en.xml Modified: freeswitch/trunk/docs/phrase/phrase_en.xml ============================================================================== --- freeswitch/trunk/docs/phrase/phrase_en.xml (original) +++ freeswitch/trunk/docs/phrase/phrase_en.xml Mon Dec 8 19:56:05 2008 @@ -222,7 +222,7 @@ - + @@ -233,6 +233,8 @@ + + From mcollins at freeswitch.org Mon Dec 8 17:05:22 2008 From: mcollins at freeswitch.org (FreeSWITCH SVN) Date: Mon, 08 Dec 2008 20:05:22 -0500 Subject: [Freeswitch-svn] [commit] r10667 - freeswitch/trunk/docs/phrase Message-ID: Author: mcollins Date: Mon Dec 8 20:05:21 2008 New Revision: 10667 Log: Tweak Modified: freeswitch/trunk/docs/phrase/phrase_en.xml Modified: freeswitch/trunk/docs/phrase/phrase_en.xml ============================================================================== --- freeswitch/trunk/docs/phrase/phrase_en.xml (original) +++ freeswitch/trunk/docs/phrase/phrase_en.xml Mon Dec 8 20:05:21 2008 @@ -111,8 +111,8 @@ - - + + From gmaruzz at freeswitch.org Mon Dec 8 23:50:40 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 02:50:40 -0500 Subject: [Freeswitch-svn] [commit] r10668 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Tue Dec 9 02:50:38 2008 New Revision: 10668 Log: skypiax: emended Makefile Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/Makefile Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/Makefile ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/Makefile (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/Makefile Tue Dec 9 02:50:38 2008 @@ -1,5 +1,3 @@ MODNAME=mod_skypiax -#LOCAL_CFLAGS=-I$(OZ_DIR)/src/include -I$(OZ_DIR)/src/isdn/include -MOD_CFLAGS=-I../../../../libs/openzap/src/include -I../../../../libs/openzap/src/isdn/include -LOCAL_LDFLAGS=-L../../../../libs/openzap -lopenzap -lX11 +LOCAL_LDFLAGS=-lX11 include ../../../../build/modmake.rules From stkn at freeswitch.org Tue Dec 9 01:41:37 2008 From: stkn at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 04:41:37 -0500 Subject: [Freeswitch-svn] [commit] r10669 - freeswitch/trunk Message-ID: Author: stkn Date: Tue Dec 9 04:41:37 2008 New Revision: 10669 Log: C&P fail Modified: freeswitch/trunk/configure.in Modified: freeswitch/trunk/configure.in ============================================================================== --- freeswitch/trunk/configure.in (original) +++ freeswitch/trunk/configure.in Tue Dec 9 04:41:37 2008 @@ -46,7 +46,7 @@ fi AC_SUBST(confdir) -AC_DEFINE_UNQUOTED([SWITCH_CONF_DIR],"${confdir}",[where to install the modules to]) +AC_DEFINE_UNQUOTED([SWITCH_CONF_DIR],"${confdir}",[directory for configuration files]) #Set default language AC_LANG_C From gmaruzz at freeswitch.org Tue Dec 9 01:43:33 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 04:43:33 -0500 Subject: [Freeswitch-svn] [commit] r10670 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Tue Dec 9 04:43:33 2008 New Revision: 10670 Log: skypiax: added skypiax.h, beginning to structure files Added: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Tue Dec 9 04:43:33 2008 @@ -1,114 +1,5 @@ -/* - * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005/2006, Anthony Minessale II - * - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * - * The Initial Developer of the Original Code is - * Anthony Minessale II - * Portions created by the Initial Developer are Copyright (C) - * the Initial Developer. All Rights Reserved. - * - * This module (mod_skypiax) has been contributed by: - * - * Giovanni Maruzzelli (gmaruzz at gmail.com) - * - * - * Further Contributors: - * - * - * - * mod_skypiax.c -- Skype compatible Endpoint Module - * - */ - -#undef WIN32_SKYPIAX -#undef __CYGWIN__ -#define MOD_SKYPIAX -#ifdef MOD_SKYPIAX - -#ifndef WIN32_SKYPIAX -#include -#include -#include -#else //WIN32_SKYPIAX -//FIXME include? -#endif //WIN32_SKYPIAX - -#include - -#define SKYPIAX_SVN_VERSION "SVN 123456" - -#define DEBUGA_SKYPE(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_SKYPE %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define DEBUGA_CALL(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_CALL %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define DEBUGA_PBX(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_PBX %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define ERRORA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][ERRORA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define WARNINGA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][WARNINGA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define NOTICA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][NOTICA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); - -#define SKYPIAX_P_LOG NULL, (unsigned long)55, __LINE__, p ? p->name ? p->name : "none" : "none", -1, p ? p->interface_state : -1, p ? p->skype_callflow : -1 - -/*********************************/ -#define SKYPIAX_CAUSE_NORMAL 1 -/*********************************/ -#define SKYPIAX_FRAME_DTMF 1 -/*********************************/ -#define SKYPIAX_CONTROL_RINGING 1 -#define SKYPIAX_CONTROL_ANSWER 2 - -/*********************************/ -#define SKYPIAX_STATE_DOWN 1 -#define SKYPIAX_STATE_RING 2 -#define SKYPIAX_STATE_DIALING 3 -#define SKYPIAX_STATE_BUSY 4 -#define SKYPIAX_STATE_UP 5 -#define SKYPIAX_STATE_RINGING 6 -#define SKYPIAX_STATE_PRERING 7 -/*********************************/ -/* call flow from the device */ -#define CALLFLOW_CALL_IDLE SKYPIAX_STATE_DOWN -#define CALLFLOW_INCOMING_RING SKYPIAX_STATE_RING -#define CALLFLOW_CALL_DIALING SKYPIAX_STATE_DIALING -#define CALLFLOW_CALL_LINEBUSY SKYPIAX_STATE_BUSY -#define CALLFLOW_CALL_ACTIVE 300 -#define CALLFLOW_INCOMING_HANGUP 100 -#define CALLFLOW_CALL_RELEASED 101 -#define CALLFLOW_CALL_NOCARRIER 102 -#define CALLFLOW_CALL_INFLUX 103 -#define CALLFLOW_CALL_INCOMING 104 -#define CALLFLOW_CALL_FAILED 105 -#define CALLFLOW_CALL_NOSERVICE 106 -#define CALLFLOW_CALL_OUTGOINGRESTRICTED 107 -#define CALLFLOW_CALL_SECURITYFAIL 108 -#define CALLFLOW_CALL_NOANSWER 109 -#define CALLFLOW_STATUS_FINISHED 110 -#define CALLFLOW_STATUS_CANCELLED 111 -#define CALLFLOW_STATUS_FAILED 112 -#define CALLFLOW_STATUS_REFUSED 113 -#define CALLFLOW_STATUS_RINGING 114 -#define CALLFLOW_STATUS_INPROGRESS 115 -#define CALLFLOW_STATUS_UNPLACED 116 -#define CALLFLOW_STATUS_ROUTING 117 -#define CALLFLOW_STATUS_EARLYMEDIA 118 -#define SKYPIAX_STATE_HANGUP_REQUESTED 200 - //FIXME CALLFLOW_INCOMING_CALLID to be removed -#define CALLFLOW_INCOMING_CALLID 1019 +#include "skypiax.h" -/*********************************/ - -#define SKYPIAX_MAX_INTERFACES 64 SWITCH_MODULE_LOAD_FUNCTION(mod_skypiax_load); SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypiax_shutdown); @@ -119,23 +10,6 @@ static switch_memory_pool_t *module_pool = NULL; static int running = 1; -#ifndef WIN32_SKYPIAX -struct AsteriskHandles { - Window skype_win; - Display *disp; - Window win; - switch_file_t *fdesc[2]; -}; -#else //WIN32_SKYPIAX - -struct AsteriskHandles { - HWND win32_hInit_MainWindowHandle; - HWND win32_hGlobal_SkypeAPIWindowHandle; - switch_file_t *fdesc[2]; -}; - -#endif //WIN32_SKYPIAX - typedef enum { TFLAG_IO = (1 << 0), TFLAG_INBOUND = (1 << 1), @@ -170,76 +44,14 @@ switch_mutex_t *mutex; } globals; -struct skypiax_interface { - char interface_id[80]; - char name[80]; - char dialplan[80]; - char context[80]; - char dial_regex[256]; - char fail_dial_regex[256]; - char hold_music[256]; - char type[256]; - char X11_display[256]; - struct AsteriskHandles AsteriskHandlesAst; - - int interface_state; /*!< \brief 'state' of the interface (channel) */ - char language[80]; /*!< \brief default Asterisk dialplan language for this interface */ - char exten[80]; /*!< \brief default Asterisk dialplan extension for this interface */ - int skypiax_sound_rate; /*!< \brief rate of the sound device, in Hz, eg: 8000 */ - switch_file_t *skypiax_sound_capt_fd; /*!< \brief file descriptor for sound capture dev */ - char callid_name[50]; - char callid_number[50]; - double playback_boost; - double capture_boost; - int stripmsd; - switch_thread_t *skype_thread; - char skype_call_id[512]; - int skype_call_ongoing; - char skype_friends[4096]; - char skype_fullname[512]; - char skype_displayname[512]; - int skype_callflow; /*!< \brief 'callflow' of the skype interface (as opposed to phone interface) */ - int skype; /*!< \brief config flag, bool, Skype support on this interface (0 if false, -1 if true) */ - int control_to_send; - switch_file_t *audiopipe[2]; - switch_file_t *audioskypepipe[2]; - switch_thread_t *tcp_srv_thread; - switch_thread_t *tcp_cli_thread; - short audiobuf[160]; - int audiobuf_is_loaded; - - //int phonebook_listing; - //int phonebook_querying; - //int phonebook_listing_received_calls; - - //int phonebook_first_entry; - //int phonebook_last_entry; - //int phonebook_number_lenght; - //int phonebook_text_lenght; - FILE *phonebook_writing_fp; - int skypiax_dir_entry_extension_prefix; - void *tech_pvt; -}; +static skypiax_interface_t SKYPIAX_INTERFACES[SKYPIAX_MAX_INTERFACES]; + +int option_debug = 100; +switch_core_session_t *global_session = NULL; -typedef struct skypiax_interface skypiax_interface_t; -static skypiax_interface_t SKYPIAX_INTERFACES[SKYPIAX_MAX_INTERFACES]; -struct private_object { - unsigned int flags; - switch_codec_t read_codec; - switch_codec_t write_codec; - switch_frame_t read_frame; - unsigned char databuf[SWITCH_RECOMMENDED_BUFFER_SIZE]; - switch_core_session_t *session; - switch_caller_profile_t *caller_profile; - switch_mutex_t *mutex; - switch_mutex_t *flag_mutex; - skypiax_interface_t *p; - //switch_thread_cond_t *cond; -}; -typedef struct private_object private_t; SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan); SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_string, globals.codec_string); @@ -267,8 +79,6 @@ int stream_id); static switch_status_t channel_kill_channel(switch_core_session_t * session, int sig); -int option_debug = 100; -switch_core_session_t *global_session = NULL; #ifdef WIN32_SKYPIAX #ifdef __CYGWIN__ @@ -1590,7 +1400,7 @@ if (read_from_pipe[i] == '\0') { - if (option_debug > 101) + //if (option_debug > 101) DEBUGA_SKYPE("read_skype: howmany=%d, i=%d, a=%d, |||%s||| \n", SKYPIAX_P_LOG, howmany, i, a, messaggio); @@ -2511,4 +2321,3 @@ * vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab: */ -#endif /* MOD_SKYPIAX */ Added: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h ============================================================================== --- (empty file) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h Tue Dec 9 04:43:33 2008 @@ -0,0 +1,197 @@ +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2005/2006, Anthony Minessale II + * + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * + * The Initial Developer of the Original Code is + * Anthony Minessale II + * Portions created by the Initial Developer are Copyright (C) + * the Initial Developer. All Rights Reserved. + * + * This module (mod_skypiax) has been contributed by: + * + * Giovanni Maruzzelli (gmaruzz at gmail.com) + * + * + * Further Contributors: + * + * + * + * mod_skypiax.c -- Skype compatible Endpoint Module + * + */ + +#undef WIN32_SKYPIAX +#undef __CYGWIN__ + +#ifndef WIN32_SKYPIAX +#include +#include +#include +#else //WIN32_SKYPIAX +//FIXME include? +#endif //WIN32_SKYPIAX + +#include + +#define SKYPIAX_SVN_VERSION "SVN 123456" + +#define DEBUGA_SKYPE(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_SKYPE %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); +#define DEBUGA_CALL(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_CALL %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); +#define DEBUGA_PBX(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_PBX %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); +#define ERRORA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][ERRORA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); +#define WARNINGA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][WARNINGA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); +#define NOTICA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][NOTICA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); + +#define SKYPIAX_P_LOG NULL, (unsigned long)55, __LINE__, p ? p->name ? p->name : "none" : "none", -1, p ? p->interface_state : -1, p ? p->skype_callflow : -1 + +/*********************************/ +#define SKYPIAX_CAUSE_NORMAL 1 +/*********************************/ +#define SKYPIAX_FRAME_DTMF 1 +/*********************************/ +#define SKYPIAX_CONTROL_RINGING 1 +#define SKYPIAX_CONTROL_ANSWER 2 + +/*********************************/ +#define SKYPIAX_STATE_DOWN 1 +#define SKYPIAX_STATE_RING 2 +#define SKYPIAX_STATE_DIALING 3 +#define SKYPIAX_STATE_BUSY 4 +#define SKYPIAX_STATE_UP 5 +#define SKYPIAX_STATE_RINGING 6 +#define SKYPIAX_STATE_PRERING 7 +/*********************************/ +/* call flow from the device */ +#define CALLFLOW_CALL_IDLE SKYPIAX_STATE_DOWN +#define CALLFLOW_INCOMING_RING SKYPIAX_STATE_RING +#define CALLFLOW_CALL_DIALING SKYPIAX_STATE_DIALING +#define CALLFLOW_CALL_LINEBUSY SKYPIAX_STATE_BUSY +#define CALLFLOW_CALL_ACTIVE 300 +#define CALLFLOW_INCOMING_HANGUP 100 +#define CALLFLOW_CALL_RELEASED 101 +#define CALLFLOW_CALL_NOCARRIER 102 +#define CALLFLOW_CALL_INFLUX 103 +#define CALLFLOW_CALL_INCOMING 104 +#define CALLFLOW_CALL_FAILED 105 +#define CALLFLOW_CALL_NOSERVICE 106 +#define CALLFLOW_CALL_OUTGOINGRESTRICTED 107 +#define CALLFLOW_CALL_SECURITYFAIL 108 +#define CALLFLOW_CALL_NOANSWER 109 +#define CALLFLOW_STATUS_FINISHED 110 +#define CALLFLOW_STATUS_CANCELLED 111 +#define CALLFLOW_STATUS_FAILED 112 +#define CALLFLOW_STATUS_REFUSED 113 +#define CALLFLOW_STATUS_RINGING 114 +#define CALLFLOW_STATUS_INPROGRESS 115 +#define CALLFLOW_STATUS_UNPLACED 116 +#define CALLFLOW_STATUS_ROUTING 117 +#define CALLFLOW_STATUS_EARLYMEDIA 118 +#define SKYPIAX_STATE_HANGUP_REQUESTED 200 + //FIXME CALLFLOW_INCOMING_CALLID to be removed +#define CALLFLOW_INCOMING_CALLID 1019 + +/*********************************/ + +#define SKYPIAX_MAX_INTERFACES 64 + +#ifndef WIN32_SKYPIAX +struct AsteriskHandles { + Window skype_win; + Display *disp; + Window win; + switch_file_t *fdesc[2]; +}; +#else //WIN32_SKYPIAX + +struct AsteriskHandles { + HWND win32_hInit_MainWindowHandle; + HWND win32_hGlobal_SkypeAPIWindowHandle; + switch_file_t *fdesc[2]; +}; + +#endif //WIN32_SKYPIAX + +struct skypiax_interface { + char interface_id[80]; + char name[80]; + char dialplan[80]; + char context[80]; + char dial_regex[256]; + char fail_dial_regex[256]; + char hold_music[256]; + char type[256]; + char X11_display[256]; + struct AsteriskHandles AsteriskHandlesAst; + + int interface_state; /*!< \brief 'state' of the interface (channel) */ + char language[80]; /*!< \brief default Asterisk dialplan language for this interface */ + char exten[80]; /*!< \brief default Asterisk dialplan extension for this interface */ + int skypiax_sound_rate; /*!< \brief rate of the sound device, in Hz, eg: 8000 */ + switch_file_t *skypiax_sound_capt_fd; /*!< \brief file descriptor for sound capture dev */ + char callid_name[50]; + char callid_number[50]; + double playback_boost; + double capture_boost; + int stripmsd; + switch_thread_t *skype_thread; + char skype_call_id[512]; + int skype_call_ongoing; + char skype_friends[4096]; + char skype_fullname[512]; + char skype_displayname[512]; + int skype_callflow; /*!< \brief 'callflow' of the skype interface (as opposed to phone interface) */ + int skype; /*!< \brief config flag, bool, Skype support on this interface (0 if false, -1 if true) */ + int control_to_send; + switch_file_t *audiopipe[2]; + switch_file_t *audioskypepipe[2]; + switch_thread_t *tcp_srv_thread; + switch_thread_t *tcp_cli_thread; + short audiobuf[160]; + int audiobuf_is_loaded; + + //int phonebook_listing; + //int phonebook_querying; + //int phonebook_listing_received_calls; + + //int phonebook_first_entry; + //int phonebook_last_entry; + //int phonebook_number_lenght; + //int phonebook_text_lenght; + FILE *phonebook_writing_fp; + int skypiax_dir_entry_extension_prefix; + void *tech_pvt; +}; + +typedef struct skypiax_interface skypiax_interface_t; + +struct private_object { + unsigned int flags; + switch_codec_t read_codec; + switch_codec_t write_codec; + switch_frame_t read_frame; + unsigned char databuf[SWITCH_RECOMMENDED_BUFFER_SIZE]; + switch_core_session_t *session; + switch_caller_profile_t *caller_profile; + switch_mutex_t *mutex; + switch_mutex_t *flag_mutex; + skypiax_interface_t *p; + //switch_thread_cond_t *cond; +}; + +typedef struct private_object private_t; + + From gmaruzz at freeswitch.org Tue Dec 9 01:56:47 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 04:56:47 -0500 Subject: [Freeswitch-svn] [commit] r10671 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Tue Dec 9 04:56:46 2008 New Revision: 10671 Log: skypiax: now ifdeffed on WIN32 for automatic understanding of platform Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.2008.vcproj freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.2008.vcproj ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.2008.vcproj (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.2008.vcproj Tue Dec 9 04:56:46 2008 @@ -149,6 +149,10 @@ RelativePath="..\mod_skypiax\mod_skypiax.c" > + + Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Tue Dec 9 04:56:46 2008 @@ -80,8 +80,8 @@ static switch_status_t channel_kill_channel(switch_core_session_t * session, int sig); -#ifdef WIN32_SKYPIAX -#ifdef __CYGWIN__ +#ifdef WIN32 +#ifdef WIN32 struct AsteriskHandles *win32_AsteriskHandlesSkype; HWND win32_hInit_MainWindowHandle; HINSTANCE win32_hInit_ProcessHandle; @@ -322,9 +322,9 @@ return NULL; } -#endif /* __CYGWIN__ */ +#endif /* WIN32 */ -#endif //WIN32_SKYPIAX +#endif //WIN32 static switch_status_t skypiax_codec(private_t * tech_pvt, int sample_rate, int codec_ms) { @@ -485,7 +485,7 @@ DEBUGA_SKYPE("Skype client GONE\n", SKYPIAX_P_LOG); -#ifndef WIN32_SKYPIAX +#ifndef WIN32 close(fd); #else closesocket(fd); @@ -495,7 +495,7 @@ } WARNINGA("server (I am it) GONE\n", SKYPIAX_P_LOG); -#ifndef WIN32_SKYPIAX +#ifndef WIN32 close(s); #else closesocket(s); @@ -541,7 +541,7 @@ if (option_debug > 10) { DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); } -#ifndef WIN32_SKYPIAX +#ifndef WIN32 close(s); #else closesocket(s); @@ -597,7 +597,7 @@ } ERRORA("Skype server GONE\n", SKYPIAX_P_LOG); -#ifndef WIN32_SKYPIAX +#ifndef WIN32 close(fd); #else closesocket(fd); @@ -606,7 +606,7 @@ } WARNINGA("client (I am it) GONE\n", SKYPIAX_P_LOG); -#ifndef WIN32_SKYPIAX +#ifndef WIN32 close(s); #else closesocket(s); @@ -1029,7 +1029,7 @@ }; #define SKYPE_THREAD -#ifndef WIN32_SKYPIAX +#ifndef WIN32 #ifdef SKYPE_THREAD #define SKYPE_X11_BUF_SIZE 512 @@ -1290,9 +1290,9 @@ } #endif /* SKYPE_THREAD */ -#else // WIN32_SKYPIAX +#else // WIN32 -#endif // WIN32_SKYPIAX +#endif // WIN32 #define CONTROLDEV_THREAD #ifdef CONTROLDEV_THREAD @@ -1301,7 +1301,7 @@ #define WANT_SKYPE_X11 int skypiax_skype_write(struct skypiax_interface *p, char *msg_to_skype) { -#ifdef __CYGWIN__ +#ifdef WIN32 static char acInputRow[1024]; COPYDATASTRUCT oCopyData; @@ -1332,7 +1332,7 @@ return -1; } } -#else /* __CYGWIN__ */ +#else /* WIN32 */ #ifdef WANT_SKYPE_X11 struct AsteriskHandles *AsteriskHandlesAst; @@ -1355,7 +1355,7 @@ return -1; } #endif /* WANT_SKYPE_X11 */ -#endif /* __CYGWIN__ */ +#endif /* WIN32 */ if (option_debug > 100) { DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h Tue Dec 9 04:56:46 2008 @@ -34,18 +34,16 @@ * */ -#undef WIN32_SKYPIAX -#undef __CYGWIN__ +#include -#ifndef WIN32_SKYPIAX +#ifndef WIN32 #include #include #include -#else //WIN32_SKYPIAX +#else //WIN32 //FIXME include? -#endif //WIN32_SKYPIAX +#endif //WIN32 -#include #define SKYPIAX_SVN_VERSION "SVN 123456" @@ -108,14 +106,14 @@ #define SKYPIAX_MAX_INTERFACES 64 -#ifndef WIN32_SKYPIAX +#ifndef WIN32 struct AsteriskHandles { Window skype_win; Display *disp; Window win; switch_file_t *fdesc[2]; }; -#else //WIN32_SKYPIAX +#else //WIN32 struct AsteriskHandles { HWND win32_hInit_MainWindowHandle; @@ -123,7 +121,7 @@ switch_file_t *fdesc[2]; }; -#endif //WIN32_SKYPIAX +#endif //WIN32 struct skypiax_interface { char interface_id[80]; From gmaruzz at freeswitch.org Tue Dec 9 02:52:04 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 05:52:04 -0500 Subject: [Freeswitch-svn] [commit] r10672 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Tue Dec 9 05:52:03 2008 New Revision: 10672 Log: skypiax: continuing files structuring Added: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.2008.vcproj freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.2008.vcproj ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.2008.vcproj (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.2008.vcproj Tue Dec 9 05:52:03 2008 @@ -153,6 +153,10 @@ RelativePath=".\skypiax.h" > + + Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Tue Dec 9 05:52:03 2008 @@ -6,26 +6,6 @@ //SWITCH_MODULE_RUNTIME_FUNCTION(mod_skypiax_runtime); SWITCH_MODULE_DEFINITION(mod_skypiax, mod_skypiax_load, mod_skypiax_shutdown, NULL); //mod_skypiax_runtime); -switch_endpoint_interface_t *skypiax_endpoint_interface; -static switch_memory_pool_t *module_pool = NULL; -static int running = 1; - -typedef enum { - TFLAG_IO = (1 << 0), - TFLAG_INBOUND = (1 << 1), - TFLAG_OUTBOUND = (1 << 2), - TFLAG_DTMF = (1 << 3), - TFLAG_VOICE = (1 << 4), - TFLAG_HANGUP = (1 << 5), - TFLAG_LINEAR = (1 << 6), - TFLAG_CODEC = (1 << 7), - TFLAG_BREAK = (1 << 8) -} TFLAGS; - -typedef enum { - GFLAG_MY_CODEC_PREFS = (1 << 0) -} GFLAGS; - static struct { int debug; char *ip; @@ -44,13 +24,18 @@ switch_mutex_t *mutex; } globals; -static skypiax_interface_t SKYPIAX_INTERFACES[SKYPIAX_MAX_INTERFACES]; - +/*************************************************/ +/*************************************************/ +/*************************************************/ int option_debug = 100; +switch_endpoint_interface_t *skypiax_endpoint_interface; +switch_memory_pool_t *skypiax_module_pool = NULL; +static int running = 1; +static skypiax_interface_t SKYPIAX_INTERFACES[SKYPIAX_MAX_INTERFACES]; switch_core_session_t *global_session = NULL; - - - +/*************************************************/ +/*************************************************/ +/*************************************************/ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan); @@ -80,252 +65,6 @@ static switch_status_t channel_kill_channel(switch_core_session_t * session, int sig); -#ifdef WIN32 -#ifdef WIN32 -struct AsteriskHandles *win32_AsteriskHandlesSkype; -HWND win32_hInit_MainWindowHandle; -HINSTANCE win32_hInit_ProcessHandle; -char win32_acInit_WindowClassName[128]; -HANDLE win32_hGlobal_ThreadShutdownEvent; -UINT win32_uiGlobal_MsgID_SkypeControlAPIAttach; -UINT win32_uiGlobal_MsgID_SkypeControlAPIDiscover; -HWND win32_hGlobal_SkypeAPIWindowHandle = NULL; -DWORD win32_ulGlobal_PromptConsoleMode = 0; -HANDLE volatile win32_hGlobal_PromptConsoleHandle = NULL; - -enum { - SKYPECONTROLAPI_ATTACH_SUCCESS = 0, /* Client is successfully - attached and API window handle can be found - in wParam parameter */ - SKYPECONTROLAPI_ATTACH_PENDING_AUTHORIZATION = 1, /* Skype has acknowledged - connection request and is waiting - for confirmation from the user. */ - /* The client is not yet attached - * and should wait for SKYPECONTROLAPI_ATTACH_SUCCESS message */ - SKYPECONTROLAPI_ATTACH_REFUSED = 2, /* User has explicitly - denied access to client */ - SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE = 3, /* API is not available - at the moment. - For example, this happens when no user - is currently logged in. */ - /* Client should wait for - * SKYPECONTROLAPI_ATTACH_API_AVAILABLE - * broadcast before making any further */ - /* connection attempts. */ - SKYPECONTROLAPI_ATTACH_API_AVAILABLE = 0x8001 -}; - -char - *strsep(char **stringp, const char *delim) -{ - char *res; - - if (!stringp || !*stringp || !**stringp) - return (char *) 0; - - res = *stringp; - while (**stringp && !strchr(delim, **stringp)) - ++(*stringp); - - if (**stringp) { - **stringp = '\0'; - ++(*stringp); - } - - return res; -} - -LRESULT APIENTRY skypiax_skype_present(HWND hWindow, UINT uiMessage, WPARAM uiParam, - LPARAM ulParam) -{ - LRESULT lReturnCode; - int fIssueDefProc; - struct skypiax_interface *p = NULL; - - lReturnCode = 0; - fIssueDefProc = 0; - switch (uiMessage) { - case WM_DESTROY: - win32_hInit_MainWindowHandle = NULL; - PostQuitMessage(0); - break; - case WM_COPYDATA: - if (win32_hGlobal_SkypeAPIWindowHandle == (HWND) uiParam) { - unsigned int howmany; - char msg_from_skype[2048]; - - PCOPYDATASTRUCT poCopyData = (PCOPYDATASTRUCT) ulParam; - - memset(msg_from_skype, '\0', sizeof(msg_from_skype)); - strncpy(msg_from_skype, (const char *) poCopyData->lpData, - sizeof(msg_from_skype) - 2); - - howmany = strlen(msg_from_skype) + 1; - switch_file_write(win32_AsteriskHandlesSkype->fdesc[1], msg_from_skype, &howmany); - NOTICA("From Skype API: %s\n", SKYPIAX_P_LOG, (const char *) poCopyData->lpData); - lReturnCode = 1; - } - break; - default: - if (uiMessage == win32_uiGlobal_MsgID_SkypeControlAPIAttach) { - switch (ulParam) { - case SKYPECONTROLAPI_ATTACH_SUCCESS: - NOTICA("\n\n\tConnected to Skype API!\n", SKYPIAX_P_LOG); - win32_hGlobal_SkypeAPIWindowHandle = (HWND) uiParam; - switch_sleep(5000); - win32_AsteriskHandlesSkype->win32_hGlobal_SkypeAPIWindowHandle = - win32_hGlobal_SkypeAPIWindowHandle; - break; - case SKYPECONTROLAPI_ATTACH_PENDING_AUTHORIZATION: - WARNINGA - ("\n\n\tIf I do not immediately connect to Skype API,\n\tplease give the Skype client authorization to be connected \n\tby Asterisk and to not ask you again.\n\n", - SKYPIAX_P_LOG); - break; - case SKYPECONTROLAPI_ATTACH_REFUSED: - ERRORA("Skype client refused to be connected by Skypiax!\n", SKYPIAX_P_LOG); - break; - case SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE: - ERRORA("Skype API not available\n", SKYPIAX_P_LOG); - break; - case SKYPECONTROLAPI_ATTACH_API_AVAILABLE: - DEBUGA_SKYPE("Skype API available\n", SKYPIAX_P_LOG); - break; - default: - WARNINGA("GOT AN UNKNOWN SKYPE WINDOWS MSG\n", SKYPIAX_P_LOG); - } - lReturnCode = 1; - break; - } - fIssueDefProc = 1; - break; - } - if (fIssueDefProc) - lReturnCode = DefWindowProc(hWindow, uiMessage, uiParam, ulParam); - return (lReturnCode); -} - -int win32_Initialize_CreateWindowClass(void) -{ - unsigned char *paucUUIDString; - RPC_STATUS lUUIDResult; - int fReturnStatus; - UUID oUUID; - - fReturnStatus = 0; - lUUIDResult = UuidCreate(&oUUID); - win32_hInit_ProcessHandle = - (HINSTANCE) OpenProcess(PROCESS_DUP_HANDLE, FALSE, GetCurrentProcessId()); - if (win32_hInit_ProcessHandle != NULL - && (lUUIDResult == RPC_S_OK || lUUIDResult == RPC_S_UUID_LOCAL_ONLY)) { - if (UuidToString(&oUUID, &paucUUIDString) == RPC_S_OK) { - WNDCLASS oWindowClass; - - strcpy(win32_acInit_WindowClassName, "Skype-API-Skypiax-"); - strcat(win32_acInit_WindowClassName, (char *) paucUUIDString); - - oWindowClass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; - oWindowClass.lpfnWndProc = (WNDPROC) & skypiax_skype_present; - oWindowClass.cbClsExtra = 0; - oWindowClass.cbWndExtra = 0; - oWindowClass.hInstance = win32_hInit_ProcessHandle; - oWindowClass.hIcon = NULL; - oWindowClass.hCursor = NULL; - oWindowClass.hbrBackground = NULL; - oWindowClass.lpszMenuName = NULL; - oWindowClass.lpszClassName = win32_acInit_WindowClassName; - - if (RegisterClass(&oWindowClass) != 0) - fReturnStatus = 1; - - RpcStringFree(&paucUUIDString); - } - } - if (fReturnStatus == 0) - CloseHandle(win32_hInit_ProcessHandle), win32_hInit_ProcessHandle = NULL; - return (fReturnStatus); -} - -void win32_DeInitialize_DestroyWindowClass(void) -{ - UnregisterClass(win32_acInit_WindowClassName, win32_hInit_ProcessHandle); - CloseHandle(win32_hInit_ProcessHandle), win32_hInit_ProcessHandle = NULL; -} - -int win32_Initialize_CreateMainWindow(void) -{ - win32_hInit_MainWindowHandle = - CreateWindowEx(WS_EX_APPWINDOW | WS_EX_WINDOWEDGE, win32_acInit_WindowClassName, "", - WS_BORDER | WS_SYSMENU | WS_MINIMIZEBOX, CW_USEDEFAULT, CW_USEDEFAULT, - 128, 128, NULL, 0, win32_hInit_ProcessHandle, 0); - return (win32_hInit_MainWindowHandle != NULL ? 1 : 0); -} - -void win32_DeInitialize_DestroyMainWindow(void) -{ - if (win32_hInit_MainWindowHandle != NULL) - DestroyWindow(win32_hInit_MainWindowHandle), win32_hInit_MainWindowHandle = NULL; -} - -DWORD win32_dwThreadId; - -static void *SWITCH_THREAD_FUNC do_skype_thread(switch_thread_t * thread, void *obj) -{ - /* create window class */ - /* create dummy/hidden window for processing messages */ - /* run message loop thread */ - /* do application control until exit */ - /* exit: send QUIT message to our own window */ - /* wait until thred terminates */ - /* destroy main window */ - /* destroy window class */ - - struct skypiax_interface *p; - p = obj; - - switch_file_pipe_create_ex(&p->AsteriskHandlesAst.fdesc[0], - &p->AsteriskHandlesAst.fdesc[1], 2, module_pool); - - win32_AsteriskHandlesSkype = &p->AsteriskHandlesAst; - - win32_uiGlobal_MsgID_SkypeControlAPIAttach = - RegisterWindowMessage("SkypeControlAPIAttach"); - win32_uiGlobal_MsgID_SkypeControlAPIDiscover = - RegisterWindowMessage("SkypeControlAPIDiscover"); - - if (win32_uiGlobal_MsgID_SkypeControlAPIAttach != 0 - && win32_uiGlobal_MsgID_SkypeControlAPIDiscover != 0) { - if (win32_Initialize_CreateWindowClass()) { - if (win32_Initialize_CreateMainWindow()) { - win32_hGlobal_ThreadShutdownEvent = CreateEvent(NULL, TRUE, FALSE, NULL); - if (win32_hGlobal_ThreadShutdownEvent != NULL) { - if (SendMessage - (HWND_BROADCAST, win32_uiGlobal_MsgID_SkypeControlAPIDiscover, - (WPARAM) win32_hInit_MainWindowHandle, 0) != 0) { - win32_AsteriskHandlesSkype->win32_hInit_MainWindowHandle = - win32_hInit_MainWindowHandle; - while (1) { - MSG oMessage; - - while (GetMessage(&oMessage, 0, 0, 0) != FALSE) { - TranslateMessage(&oMessage); - DispatchMessage(&oMessage); - } - } - } - CloseHandle(win32_hGlobal_ThreadShutdownEvent); - } - win32_DeInitialize_DestroyMainWindow(); - } - win32_DeInitialize_DestroyWindowClass(); - } - } - return NULL; -} - -#endif /* WIN32 */ - -#endif //WIN32 - static switch_status_t skypiax_codec(private_t * tech_pvt, int sample_rate, int codec_ms) { if (switch_core_codec_init @@ -355,332 +94,7 @@ } -#define SKYPE_AUDIO -#ifdef SKYPE_AUDIO - -#define SAMPLES_PER_FRAME 160 -#define NN 160 -#define GG 160 -static void *SWITCH_THREAD_FUNC skypiax_do_tcp_srv_thread(switch_thread_t * thread, - void *obj) -{ - struct skypiax_interface *p = obj; - short in[GG]; - short out[GG / 2]; - int s, fd, len; - unsigned int sin_size; - struct sockaddr_in my_addr; - struct sockaddr_in remote_addr; - int exit = 0; - int a; - int i; - unsigned int kill_cli_size; - short kill_cli_buff[320]; - - if (option_debug > 10) { - WARNINGA("ENTERING FUNC\n", SKYPIAX_P_LOG); - } - memset(&my_addr, 0, sizeof(my_addr)); - my_addr.sin_family = AF_INET; - my_addr.sin_addr.s_addr = htonl(0x7f000001); /* use the localhost */ - my_addr.sin_port = htons(5556); //FIXME configurable! - - if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) { - ERRORA("socket Error\n", SKYPIAX_P_LOG); - if (option_debug > 10) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - return NULL; - } - - if (bind(s, (struct sockaddr *) &my_addr, sizeof(struct sockaddr)) < 0) { - ERRORA("bind Error\n", SKYPIAX_P_LOG); - if (option_debug > 10) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - return NULL; - } - DEBUGA_SKYPE("started tcp_srv_thread thread.\n", SKYPIAX_P_LOG); - - listen(s, 6); - - sin_size = sizeof(remote_addr); - while ((fd = accept(s, (struct sockaddr *) &remote_addr, &sin_size)) > 0) { - DEBUGA_SKYPE("ACCEPTED\n", SKYPIAX_P_LOG); - while (p->interface_state != SKYPIAX_STATE_DOWN - && (p->skype_callflow == CALLFLOW_STATUS_INPROGRESS - || p->skype_callflow == SKYPIAX_STATE_UP)) { - - int fdselect; - int rt; - fd_set fs; - struct timeval to; - - exit = 1; - - fdselect = fd; - FD_ZERO(&fs); - FD_SET(fdselect, &fs); - to.tv_usec = 100; - to.tv_sec = 0; - rt = select(fdselect + 1, &fs, NULL, NULL, &to); - if (rt > 0) { - - len = recv(fd, in, sizeof(short) * GG, 0); - //DEBUGA_SKYPE("recv %d\n", SKYPIAX_P_LOG, len); - if (len > 0) { - a = 0; - for (i = 0; i < len / sizeof(short); i++) { - out[a] = in[i]; - i++; - a++; - } - - if (!p->audiobuf_is_loaded) { - for (i = 0; i < (len / sizeof(short)) / 2; i++) { - p->audiobuf[i] = out[i]; - } - p->audiobuf_is_loaded = 1; - } else { - unsigned int howmany; - short totalbuf[GG]; - - howmany = len / 2 / 2; - for (i = 0; i < howmany; i++) - totalbuf[i] = p->audiobuf[i]; - - howmany = len / 2 / 2; - for (a = 0; a < howmany; a++) { - totalbuf[i] = out[a]; - i++; - } - - howmany = len; - - switch_file_write(p->audiopipe[1], totalbuf, &howmany); - p->audiobuf_is_loaded = 0; - //DEBUGA_SKYPE("read=====> req=%d recv=%d to sent=%d sent=%d\n", SKYPIAX_P_LOG, sizeof(short)*GG, len, (len*sizeof(short))/2, howmany); - } - - } else if (len == 0) { - DEBUGA_SKYPE("Skype client GONE\n", SKYPIAX_P_LOG); - break; - } else { - ERRORA("len=%d\n", SKYPIAX_P_LOG, len); - exit = 1; - break; - } - } - } - - kill_cli_size = 320; - switch_file_write(p->audiopipe[1], kill_cli_buff, &kill_cli_size); - kill_cli_size = 320; - switch_file_write(p->audioskypepipe[1], kill_cli_buff, &kill_cli_size); - p->interface_state = SKYPIAX_STATE_DOWN; - kill_cli_size = 320; - switch_file_write(p->audiopipe[1], kill_cli_buff, &kill_cli_size); - kill_cli_size = 320; - switch_file_write(p->audioskypepipe[1], kill_cli_buff, &kill_cli_size); - - DEBUGA_SKYPE("Skype client GONE\n", SKYPIAX_P_LOG); - -#ifndef WIN32 - close(fd); -#else - closesocket(fd); -#endif - if (exit) - break; - } - - WARNINGA("server (I am it) GONE\n", SKYPIAX_P_LOG); -#ifndef WIN32 - close(s); -#else - closesocket(s); -#endif - if (option_debug > 10) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - return NULL; -} -static void *SWITCH_THREAD_FUNC skypiax_do_tcp_cli_thread(switch_thread_t * thread, - void *obj) -//void *skypiax_do_tcp_cli_thread(void *data) -{ - struct skypiax_interface *p = obj; - int s, fd, len; - short in[NN / 2]; - short out[NN]; - unsigned int sin_size; - struct sockaddr_in my_addr; - struct sockaddr_in remote_addr; - int a; - int i; - unsigned int got; - - if (option_debug > 10) { - WARNINGA("ENTERING FUNC\n", SKYPIAX_P_LOG); - } - memset(&my_addr, 0, sizeof(my_addr)); - my_addr.sin_family = AF_INET; - my_addr.sin_addr.s_addr = htonl(0x7f000001); /* use the localhost */ - my_addr.sin_port = htons(5558); //FIXME configurable! - - if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) { - ERRORA("socket Error\n", SKYPIAX_P_LOG); - if (option_debug > 10) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - return NULL; - } - - if (bind(s, (struct sockaddr *) &my_addr, sizeof(struct sockaddr)) < 0) { - ERRORA("bind Error\n", SKYPIAX_P_LOG); - if (option_debug > 10) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } -#ifndef WIN32 - close(s); -#else - closesocket(s); -#endif - return NULL; - } - DEBUGA_SKYPE("started tcp_cli_thread thread.\n", SKYPIAX_P_LOG); - - listen(s, 6); - - sin_size = sizeof(remote_addr); - while ((fd = accept(s, (struct sockaddr *) &remote_addr, &sin_size)) > 0) { - DEBUGA_SKYPE("ACCEPTED\n", SKYPIAX_P_LOG); - while (p->interface_state != SKYPIAX_STATE_DOWN - && (p->skype_callflow == CALLFLOW_STATUS_INPROGRESS - || p->skype_callflow == SKYPIAX_STATE_UP)) { - int fdselect; - int rt; - fd_set fs; - struct timeval to; - - fdselect = 1; - FD_ZERO(&fs); - FD_SET(fdselect, &fs); - to.tv_usec = 100; - to.tv_sec = 0; - rt = 1; - if (rt > 0) { - - got = (NN / 2) * sizeof(short); - switch_file_read(p->audioskypepipe[0], in, &got); - - if (got > 0) { - a = 0; - for (i = 0; i < got / sizeof(short); i++) { - out[a] = in[i]; - a++; - out[a] = in[i]; - a++; - } - - len = send(fd, out, got * 2, 0); - - if (len == 0) { - ERRORA("Skype server GONE\n", SKYPIAX_P_LOG); - break; - } - } else { - switch_sleep(1000); - //ERRORA("Audio skype pipe give us: %u\n", SKYPIAX_P_LOG, got); - } - } - - } - ERRORA("Skype server GONE\n", SKYPIAX_P_LOG); -#ifndef WIN32 - close(fd); -#else - closesocket(fd); -#endif - break; - } - - WARNINGA("client (I am it) GONE\n", SKYPIAX_P_LOG); -#ifndef WIN32 - close(s); -#else - closesocket(s); -#endif - if (option_debug > 10) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - return NULL; -} - -int skypiax_skypeaudio_init(struct skypiax_interface *p) -{ - - switch_status_t rv; - - rv = switch_file_pipe_create_ex(&p->audiopipe[0], &p->audiopipe[1], 2, module_pool); - rv = switch_file_pipe_timeout_set(p->audiopipe[0], 100000); - -/* the pipe is our audio fd for pbx to poll on */ - p->skypiax_sound_capt_fd = p->audiopipe[0]; - - rv = - switch_file_pipe_create_ex(&p->audioskypepipe[0], &p->audioskypepipe[1], 2, - module_pool); - rv = switch_file_pipe_timeout_set(p->audioskypepipe[0], 100); - if (option_debug > 10) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - return 0; -} -static switch_status_t skypiax_skypeaudio_read(private_t * tech_pvt) -{ - struct skypiax_interface *p; - short buf[640]; - unsigned int samples; - int rt; - - p = tech_pvt->p; - - //DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); - - memset(buf, '\0', sizeof(buf)); - - rt = 1; - if (rt > 0) { - - samples = SAMPLES_PER_FRAME * sizeof(short); - - switch_file_read(p->audiopipe[0], tech_pvt->read_frame.data, &samples); - - //if ((samples = read(p->audiopipe[0], buf, SAMPLES_PER_FRAME * sizeof(short))) != 320) - if (samples != SAMPLES_PER_FRAME * sizeof(short)) { - if (samples) - DEBUGA_SKYPE("read=====> NOT GOOD samples=%d expected=%d\n", SKYPIAX_P_LOG, - samples, SAMPLES_PER_FRAME * sizeof(short)); - //do nothing - } else { - tech_pvt->read_frame.datalen = samples; - //DEBUGA_SKYPE("read=====> GOOD samples=%d\n", SKYPIAX_P_LOG, samples); - /* A real frame */ - } - } else { - DEBUGA_SKYPE("select returned %d\n", SKYPIAX_P_LOG, rt); - - } - - //DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - - return SWITCH_STATUS_SUCCESS; -} - -#endif /* SKYPE_AUDIO */ -static void tech_init(private_t * tech_pvt, switch_core_session_t * session, - skypiax_interface_t * p) +void skypiax_tech_init(private_t * tech_pvt, switch_core_session_t * session, skypiax_interface_t * p) { DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); @@ -1028,799 +442,6 @@ /*.receive_event */ channel_receive_event }; -#define SKYPE_THREAD -#ifndef WIN32 -#ifdef SKYPE_THREAD - -#define SKYPE_X11_BUF_SIZE 512 -Window skype_win = (Window) - 1; -static XErrorHandler old_handler = 0; -static int xerror = 0; - -int X11_errors_handler(Display * dpy, XErrorEvent * err) -{ - (void) dpy; - struct skypiax_interface *p = NULL; - - xerror = err->error_code; - DEBUGA_SKYPE("Received error code %d from X Server\n", SKYPIAX_P_LOG, xerror); - return 0; /* ignore the error */ -} - -static void X11_errors_trap(void) -{ - xerror = 0; - old_handler = XSetErrorHandler(X11_errors_handler); -} - -static int X11_errors_untrap(void) -{ - XSetErrorHandler(old_handler); - return (xerror != BadValue) && (xerror != BadWindow); -} - -int skypiax_skype_send_message(struct AsteriskHandles *AsteriskHandlesAst, - const char *message_P) -{ - - Window w_P; - Display *disp; - Window handle_P; - struct skypiax_interface *p = NULL; - - w_P = AsteriskHandlesAst->skype_win; - disp = AsteriskHandlesAst->disp; - handle_P = AsteriskHandlesAst->win; - - Atom atom1 = XInternAtom(disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False); - Atom atom2 = XInternAtom(disp, "SKYPECONTROLAPI_MESSAGE", False); - unsigned int pos = 0; - unsigned int len = strlen(message_P); - XEvent e; - int ok; - - memset(&e, 0, sizeof(e)); - e.xclient.type = ClientMessage; - e.xclient.message_type = atom1; /* leading message */ - e.xclient.display = disp; - e.xclient.window = handle_P; - e.xclient.format = 8; - - X11_errors_trap(); - //XLockDisplay(disp); - do { - unsigned int i; - for (i = 0; i < 20 && i + pos <= len; ++i) - e.xclient.data.b[i] = message_P[i + pos]; - XSendEvent(disp, w_P, False, 0, &e); - - e.xclient.message_type = atom2; /* following messages */ - pos += i; - } while (pos <= len); - - XSync(disp, False); - //XUnlockDisplay(disp); - ok = X11_errors_untrap(); - - if (!ok) - DEBUGA_SKYPE("Sending message failed with status %d\n", SKYPIAX_P_LOG, xerror); - - return ok; -} - -int skypiax_skype_present(Display * disp) -{ - Atom skype_inst = XInternAtom(disp, "_SKYPE_INSTANCE", True); - - Atom type_ret; - int format_ret; - unsigned long nitems_ret; - unsigned long bytes_after_ret; - unsigned char *prop; - int status; - struct skypiax_interface *p = NULL; - - X11_errors_trap(); - //XLockDisplay(disp); - status = - XGetWindowProperty(disp, DefaultRootWindow(disp), skype_inst, 0, 1, False, XA_WINDOW, - &type_ret, &format_ret, &nitems_ret, &bytes_after_ret, &prop); - //XUnlockDisplay(disp); - X11_errors_untrap(); - - /* sanity check */ - if (status != Success || format_ret != 32 || nitems_ret != 1) { - skype_win = (Window) - 1; - DEBUGA_SKYPE("Skype instance not found\n", SKYPIAX_P_LOG); - return 0; - } - - skype_win = *(const unsigned long *) prop & 0xffffffff; - //DEBUGA_SKYPE("Skype instance found with id #%x\n", SKYPIAX_P_LOG, - DEBUGA_SKYPE("Skype instance found with id #%d\n", SKYPIAX_P_LOG, - (unsigned int) skype_win); - return 1; -} - -void skypiax_skype_clean_disp(void *data) -{ - - int *dispptr; - int disp; - struct skypiax_interface *p = NULL; - - dispptr = data; - disp = *dispptr; - - if (disp) { - DEBUGA_SKYPE("to be destroyed disp %d\n", SKYPIAX_P_LOG, disp); - close(disp); - DEBUGA_SKYPE("destroyed disp\n", SKYPIAX_P_LOG); - } else { - DEBUGA_SKYPE("NOT destroyed disp\n", SKYPIAX_P_LOG); - } - DEBUGA_SKYPE("OUT destroyed disp\n", SKYPIAX_P_LOG); - switch_sleep(1000); -} - -static void *SWITCH_THREAD_FUNC do_skype_thread(switch_thread_t * thread, void *obj) -{ - - struct skypiax_interface *p; - struct AsteriskHandles *AsteriskHandlesAst; - char buf[SKYPE_X11_BUF_SIZE]; - Display *disp = NULL; - Window root = -1; - Window win = -1; - - p = obj; - DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); - - switch_file_pipe_create_ex(&p->AsteriskHandlesAst.fdesc[0], - &p->AsteriskHandlesAst.fdesc[1], 2, module_pool); - - AsteriskHandlesAst = &p->AsteriskHandlesAst; - //disp = XOpenDisplay(getenv("DISPLAY")); - disp = XOpenDisplay(p->X11_display); - if (!disp) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, - "Cannot open X Display '%s', exiting skype thread\n", - p->X11_display); - return NULL; - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "X Display '%s' opened\n", - p->X11_display); - } - - int xfd; - xfd = XConnectionNumber(disp); - fcntl(xfd, F_SETFD, FD_CLOEXEC); - - //FIXME pthread_cleanup_push(skypiax_skype_clean_disp, &xfd); - DEBUGA_SKYPE("PUSH disp %d\n", SKYPIAX_P_LOG, xfd); - - if (skypiax_skype_present(disp)) { - root = DefaultRootWindow(disp); - win = - XCreateSimpleWindow(disp, root, 0, 0, 1, 1, 0, - BlackPixel(disp, DefaultScreen(disp)), BlackPixel(disp, - DefaultScreen - (disp))); - - DEBUGA_SKYPE("skype_win=%d win=%d\n", SKYPIAX_P_LOG, (unsigned int) skype_win, - (unsigned int) win); - - AsteriskHandlesAst->skype_win = skype_win; - AsteriskHandlesAst->disp = disp; - AsteriskHandlesAst->win = win; - - snprintf(buf, SKYPE_X11_BUF_SIZE, "NAME skypiax"); - - if (!skypiax_skype_send_message(AsteriskHandlesAst, buf)) { - ERRORA - ("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch Skypiax again\n", - SKYPIAX_P_LOG); - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - return NULL; - } - - snprintf(buf, SKYPE_X11_BUF_SIZE, "PROTOCOL 6"); - if (!skypiax_skype_send_message(AsteriskHandlesAst, buf)) { - ERRORA - ("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch Skypiax again\n", - SKYPIAX_P_LOG); - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - return NULL; - } - - /* perform an events loop */ - XEvent an_event; - char buf[21]; /* can't be longer */ - char buffer[17000]; - char *b; - int i; - - b = buffer; - - while (1) { - XNextEvent(disp, &an_event); - switch (an_event.type) { - case ClientMessage: - - if (an_event.xclient.format != 8) - break; - - for (i = 0; i < 20 && an_event.xclient.data.b[i] != '\0'; ++i) - buf[i] = an_event.xclient.data.b[i]; - - buf[i] = '\0'; - - //NOTICA("ClientMessage buf:|||%s||| buffer:|||%s||| serial=%ld|||\r\n",SKYPIAX_P_LOG,buf, buffer,an_event.xclient.serial); - //NOTICA ("SKYPE read: |||%s|||%d\n", SKYPIAX_P_LOG, buf, strlen(buf)); - //NOTICA ("SKYPE buffer: |||%s|||%d\n", SKYPIAX_P_LOG, buffer, strlen(buffer)); - - strcat(buffer, buf); - - if (i < 20) { /* last fragment */ - unsigned int howmany; - - howmany = strlen(b) + 1; - - switch_file_write(AsteriskHandlesAst->fdesc[1], b, &howmany); - //write(AsteriskHandlesAst->fdesc[1], "\0", 1); - //FIXME DEBUGA_SKYPE("SKYPE pipewrite: |||%s|||len=%d serial=%ld\n\n\n", SKYPIAX_P_LOG, b, strlen(b) + 1, an_event.xclient.serial); - //switch_sleep(1000); - memset(buffer, '\0', 17000); - } - - break; - default: - break; - } - } - } else { - ERRORA - ("Skype is not running, maybe crashed. Please run/restart Skype and relaunch Skypiax\n", - SKYPIAX_P_LOG); - return NULL; - } - //DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - return NULL; - -} - -#endif /* SKYPE_THREAD */ -#else // WIN32 - -#endif // WIN32 - -#define CONTROLDEV_THREAD -#ifdef CONTROLDEV_THREAD -#if 1 - -#define WANT_SKYPE_X11 -int skypiax_skype_write(struct skypiax_interface *p, char *msg_to_skype) -{ -#ifdef WIN32 - static char acInputRow[1024]; - COPYDATASTRUCT oCopyData; - - if (option_debug > 100) { - DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); - } - sprintf(acInputRow, "%s", msg_to_skype); - if (option_debug > 1) - DEBUGA_SKYPE("acInputRow: |||%s||||\n", SKYPIAX_P_LOG, acInputRow); - /* send command to skype */ - oCopyData.dwData = 0; - oCopyData.lpData = acInputRow; - oCopyData.cbData = strlen(acInputRow) + 1; - if (oCopyData.cbData != 1) { - if (SendMessage - (p->AsteriskHandlesAst.win32_hGlobal_SkypeAPIWindowHandle, WM_COPYDATA, - (WPARAM) p->AsteriskHandlesAst.win32_hInit_MainWindowHandle, - (LPARAM) & oCopyData) == FALSE) { - ERRORA - ("Sending message failed - probably Skype crashed.\n\nPlease shutdown Skypiax (Asterisk), then restart Skype from the menu, then launch Skypiax and try again.\n", - SKYPIAX_P_LOG); - p->skype = 0; - //FIXME p->skype_thread = SKYPIAX_PTHREADT_NULL; - p->skype_thread = NULL; - if (option_debug > 100) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - return -1; - } - } -#else /* WIN32 */ -#ifdef WANT_SKYPE_X11 - struct AsteriskHandles *AsteriskHandlesAst; - - if (option_debug > 100) { - DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); - } - AsteriskHandlesAst = &p->AsteriskHandlesAst; - - if (option_debug > 101) { - DEBUGA_SKYPE("SENDING: |||%s||||\n", SKYPIAX_P_LOG, msg_to_skype); - } - - if (!skypiax_skype_send_message(AsteriskHandlesAst, msg_to_skype)) { - ERRORA - ("Sending message failed - probably Skype crashed.\n\nPlease shutdown Skypiax (Asterisk), then restart Skype from the menu, then launch Skypiax and try again.\n", - SKYPIAX_P_LOG); - if (option_debug > 100) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - return -1; - } -#endif /* WANT_SKYPE_X11 */ -#endif /* WIN32 */ - - if (option_debug > 100) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - return 0; - -} -#endif //0 - -int skypiax_skype_read(struct skypiax_interface *p) -{ - - char read_from_pipe[4096]; - char messaggio[4096]; - char messaggio_2[4096]; - char *buf, obj[512] = "", id[512] = "", prop[512] = "", value[512] = "", *where; - char **stringp = NULL; - //int fd; - int rt; - //fd_set fs; - //struct timeval to; - int i, a; - unsigned int howmany; - - if (option_debug > 100) { - DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); - } - - memset(read_from_pipe, 0, 4096); - memset(messaggio, 0, 4096); - memset(messaggio_2, 0, 4096); - - rt = 1; - if (rt > 0) { - howmany = sizeof(read_from_pipe); - switch_file_read(p->AsteriskHandlesAst.fdesc[0], read_from_pipe, &howmany); - - a = 0; - for (i = 0; i < howmany; i++) { - messaggio[a] = read_from_pipe[i]; - a++; - - if (read_from_pipe[i] == '\0') { - - //if (option_debug > 101) - DEBUGA_SKYPE("read_skype: howmany=%d, i=%d, a=%d, |||%s||| \n", SKYPIAX_P_LOG, - howmany, i, a, messaggio); - - if (!strncasecmp(messaggio, "ERROR 92 CALL", 12)) { - ERRORA("Skype got ERROR: |||%s|||, the number we called was not recognized\n", - SKYPIAX_P_LOG, messaggio); - p->skype_callflow = CALLFLOW_STATUS_FINISHED; - if (option_debug) - DEBUGA_SKYPE("skype_call now is DOWN\n", SKYPIAX_P_LOG); - p->skype_call_id[0] = '\0'; - - if (p->interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) { - if (option_debug > 100) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - p->interface_state = SKYPIAX_STATE_DOWN; - return CALLFLOW_INCOMING_HANGUP; - } else { - p->interface_state = SKYPIAX_STATE_DOWN; - } - } - - strncpy(messaggio_2, messaggio, sizeof(messaggio) - 1); - - buf = messaggio; - stringp = &buf; - where = strsep(stringp, " "); - if (!where) { - WARNINGA("Skype MSG without spaces: %s\n", SKYPIAX_P_LOG, messaggio); - } - - if (!strcasecmp(messaggio, "#333")) { - /* DEBUGA_SKYPE("Skype MSG: messaggio_2: %s, messaggio2[11]: %s\n", SKYPIAX_P_LOG, - * messaggio_2, &messaggio_2[11]); */ - memset(p->skype_friends, 0, 4096); - strncpy(p->skype_friends, &messaggio_2[11], 4095); - } - if (!strcasecmp(messaggio, "#222")) { - /* DEBUGA_SKYPE("Skype MSG: messaggio_2: %s, messaggio2[10]: %s\n", SKYPIAX_P_LOG, - * messaggio_2, &messaggio_2[10]); */ - memset(p->skype_fullname, 0, 512); - strncpy(p->skype_fullname, &messaggio_2[10], 511); - } - if (!strcasecmp(messaggio, "#765")) { - /* DEBUGA_SKYPE("Skype MSG: messaggio_2: %s, messaggio2[10]: %s\n", SKYPIAX_P_LOG, - * messaggio_2, &messaggio_2[10]); */ - memset(p->skype_displayname, 0, 512); - strncpy(p->skype_displayname, &messaggio_2[10], 511); - } - if (!strcasecmp(messaggio, "ERROR")) { - ERRORA("Skype got ERROR: |||%s|||\n", SKYPIAX_P_LOG, messaggio); - p->skype_callflow = CALLFLOW_STATUS_FINISHED; - if (option_debug) - DEBUGA_SKYPE("skype_call now is DOWN\n", SKYPIAX_P_LOG); - p->skype_call_id[0] = '\0'; - - if (p->interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) { - if (option_debug > 100) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - p->interface_state = SKYPIAX_STATE_DOWN; - return CALLFLOW_INCOMING_HANGUP; - } else { - p->interface_state = SKYPIAX_STATE_DOWN; - } - } - if (!strcasecmp(messaggio, "CALL")) { - - strncpy(obj, where, sizeof(obj) - 1); - - where = strsep(stringp, " "); - - strncpy(id, where, sizeof(id) - 1); - - where = strsep(stringp, " "); - - strncpy(prop, where, sizeof(prop) - 1); - - where = strsep(stringp, " "); - - strncpy(value, where, sizeof(value) - 1); - - where = strsep(stringp, " "); - - if (option_debug > 101) - DEBUGA_SKYPE - ("Skype MSG: messaggio: %s, obj: %s, id: %s, prop: %s, value: %s,where: %s!\n", - SKYPIAX_P_LOG, messaggio, obj, id, prop, value, where ? where : "NULL"); - - if (!strcasecmp(prop, "PARTNER_HANDLE")) { - strncpy(p->callid_number, value, sizeof(p->callid_number) - 1); - WARNINGA - ("the skype_call %s caller PARTNER_HANDLE (p->callid_number) is: %s\n", - SKYPIAX_P_LOG, id, p->callid_number); - return CALLFLOW_INCOMING_RING; - } - if (!strcasecmp(prop, "PARTNER_DISPNAME")) { - snprintf(p->callid_name, sizeof(p->callid_name) - 1, "%s%s%s", value, - where ? " " : "", where ? where : ""); - WARNINGA - ("the skype_call %s caller PARTNER_DISPNAME (p->callid_name) is: %s\n", - SKYPIAX_P_LOG, id, p->callid_name); - } - if (!strcasecmp(prop, "CONF_ID") && !strcasecmp(value, "0")) { - DEBUGA_SKYPE("the skype_call %s is NOT a conference call\n", SKYPIAX_P_LOG, - id); - if (p->interface_state == SKYPIAX_STATE_DOWN) - p->interface_state = SKYPIAX_STATE_PRERING; - } - if (!strcasecmp(prop, "CONF_ID") && strcasecmp(value, "0")) { - DEBUGA_SKYPE("the skype_call %s is a conference call\n", SKYPIAX_P_LOG, id); - if (p->interface_state == SKYPIAX_STATE_DOWN) - p->interface_state = SKYPIAX_STATE_PRERING; - } - - if (!strcasecmp(prop, "DTMF")) { - switch_core_session_t *session = NULL; - private_t *tech_pvt = NULL; - switch_channel_t *channel = NULL; - - DEBUGA_SKYPE("Call %s received a DTMF: %s\n", SKYPIAX_P_LOG, id, value); - - tech_pvt = p->tech_pvt; - session = tech_pvt->session; - channel = switch_core_session_get_channel(session); - - if (channel) { - switch_dtmf_t dtmf = - { (char) value[0], switch_core_default_dtmf_duration(0) }; - if (globals.debug) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%c DTMF %s\n", - dtmf.digit, switch_channel_get_name(channel)); - } - switch_mutex_lock(tech_pvt->flag_mutex); - switch_channel_queue_dtmf(channel, &dtmf); - switch_set_flag(tech_pvt, TFLAG_DTMF); - switch_mutex_unlock(tech_pvt->flag_mutex); - } - } - - if (!strcasecmp(prop, "FAILUREREASON")) { - DEBUGA_SKYPE - ("Skype has FAILED on skype_call %s. Let's wait for the FAILED message.\n", - SKYPIAX_P_LOG, id); - } - if (!strcasecmp(prop, "DURATION") && (!strcasecmp(value, "1"))) { - if (strcasecmp(id, p->skype_call_id)) { - strncpy(p->skype_call_id, id, sizeof(p->skype_call_id) - 1); - if (option_debug > 1) - DEBUGA_SKYPE - ("We called a Skype contact and he answered us on skype_call: %s.\n", - SKYPIAX_P_LOG, id); - } - } - - if (!strcasecmp(prop, "STATUS")) { - - if (!strcasecmp(value, "RINGING")) { - char msg_to_skype[1024]; - if (p->interface_state != SKYPIAX_STATE_DIALING) { - /* we are not calling out */ - - if (1) { - /* we are not inside an active call */ - p->skype_callflow = CALLFLOW_STATUS_RINGING; - p->interface_state = SKYPIAX_STATE_RING; - /* no owner, no active call, let's answer */ - skypiax_skype_write(p, "SET AGC OFF"); - switch_sleep(10000); - skypiax_skype_write(p, "SET AEC OFF"); - switch_sleep(10000); - sprintf(msg_to_skype, "GET CALL %s PARTNER_DISPNAME", id); - skypiax_skype_write(p, msg_to_skype); - switch_sleep(10000); - sprintf(msg_to_skype, "GET CALL %s PARTNER_HANDLE", id); - skypiax_skype_write(p, msg_to_skype); - switch_sleep(10000); - sprintf(msg_to_skype, "ALTER CALL %s ANSWER", id); - skypiax_skype_write(p, msg_to_skype); - if (option_debug) - DEBUGA_SKYPE("We answered a Skype RING on skype_call %s\n", - SKYPIAX_P_LOG, id); - strncpy(p->skype_call_id, id, sizeof(p->skype_call_id) - 1); - } else { - /* we're owned, we're in a call, let's refuse */ - sprintf(msg_to_skype, "SET CALL %s STATUS FINISHED", id); - skypiax_skype_write(p, msg_to_skype); - switch_sleep(10000); - DEBUGA_SKYPE - ("We have NOT answered a Skype RING on skype_call %s, because we are already in a skypiax call\n", - SKYPIAX_P_LOG, id); - - } - } else { - /* we are calling out */ - p->skype_callflow = CALLFLOW_STATUS_RINGING; - p->interface_state = SKYPIAX_STATE_RINGING; - //FIXME ast_queue_control(p->owner, SKYPIAX_CONTROL_RINGING); - strncpy(p->skype_call_id, id, sizeof(p->skype_call_id) - 1); - DEBUGA_SKYPE("Our remote party in skype_call %s is RINGING\n", - SKYPIAX_P_LOG, id); - } - } else if (!strcasecmp(value, "EARLYMEDIA")) { - p->skype_callflow = CALLFLOW_STATUS_EARLYMEDIA; - p->interface_state = SKYPIAX_STATE_DIALING; - //FIXME ast_queue_control(p->owner, SKYPIAX_CONTROL_RINGING); - DEBUGA_SKYPE("Our remote party in skype_call %s is EARLYMEDIA\n", - SKYPIAX_P_LOG, id); - } else if (!strcasecmp(value, "MISSED")) { - DEBUGA_SKYPE("We missed skype_call %s\n", SKYPIAX_P_LOG, id); - - } else if (!strcasecmp(value, "FINISHED")) { - global_session = NULL; //FIXME - //p->skype_callflow = CALLFLOW_STATUS_FINISHED; - if (option_debug) - DEBUGA_SKYPE("skype_call %s now is DOWN\n", SKYPIAX_P_LOG, id); - p->skype_call_id[0] = '\0'; - - if (p->interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) { - if (option_debug > 100) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - //p->interface_state = SKYPIAX_STATE_DOWN; - return CALLFLOW_INCOMING_HANGUP; - } else { - p->interface_state = SKYPIAX_STATE_DOWN; - } - - } else if (!strcasecmp(value, "CANCELLED")) { - p->skype_callflow = CALLFLOW_STATUS_CANCELLED; - if (option_debug) - DEBUGA_SKYPE - ("we tried to call Skype on skype_call %s and Skype has now CANCELLED\n", - SKYPIAX_P_LOG, id); - p->skype_call_id[0] = '\0'; - - if (p->interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) { - if (option_debug > 100) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - p->interface_state = SKYPIAX_STATE_DOWN; - return CALLFLOW_INCOMING_HANGUP; - } else { - p->interface_state = SKYPIAX_STATE_DOWN; - } - } else if (!strcasecmp(value, "FAILED")) { - p->skype_callflow = CALLFLOW_STATUS_FAILED; - if (option_debug) - DEBUGA_SKYPE - ("we tried to call Skype on skype_call %s and Skype has now FAILED\n", - SKYPIAX_P_LOG, id); - p->skype_call_id[0] = '\0'; - strncpy(p->skype_call_id, id, sizeof(p->skype_call_id) - 1); - p->interface_state = SKYPIAX_STATE_DOWN; - if (option_debug > 100) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - return CALLFLOW_INCOMING_HANGUP; - } else if (!strcasecmp(value, "REFUSED")) { - if (!strcasecmp(id, p->skype_call_id)) { - /* this is the id of the call we are in, probably we generated it */ - p->skype_callflow = CALLFLOW_STATUS_REFUSED; - if (option_debug) - DEBUGA_SKYPE - ("we tried to call Skype on skype_call %s and Skype has now REFUSED\n", - SKYPIAX_P_LOG, id); - strncpy(p->skype_call_id, id, sizeof(p->skype_call_id) - 1); - p->interface_state = SKYPIAX_STATE_DOWN; - p->skype_call_id[0] = '\0'; - if (option_debug > 100) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - return CALLFLOW_INCOMING_HANGUP; - } else { - /* we're here because were us that refused an incoming call */ - DEBUGA_SKYPE("we REFUSED skype_call %s\n", SKYPIAX_P_LOG, id); - - } - } else if (!strcasecmp(value, "ROUTING")) { - p->skype_callflow = CALLFLOW_STATUS_ROUTING; - p->interface_state = SKYPIAX_STATE_DIALING; - strncpy(p->skype_call_id, id, sizeof(p->skype_call_id) - 1); - DEBUGA_SKYPE("skype_call: %s is now ROUTING\n", SKYPIAX_P_LOG, id); - } else if (!strcasecmp(value, "UNPLACED")) { - p->skype_callflow = CALLFLOW_STATUS_UNPLACED; - p->interface_state = SKYPIAX_STATE_DIALING; - strncpy(p->skype_call_id, id, sizeof(p->skype_call_id) - 1); - DEBUGA_SKYPE("skype_call: %s is now UNPLACED\n", SKYPIAX_P_LOG, id); - } else if (!strcasecmp(value, "INPROGRESS")) { - p->skype_callflow = CALLFLOW_STATUS_INPROGRESS; - strncpy(p->skype_call_id, id, sizeof(p->skype_call_id) - 1); - p->interface_state = SKYPIAX_STATE_UP; - if (option_debug > 1) - DEBUGA_SKYPE("skype_call: %s is now active\n", SKYPIAX_P_LOG, id); - - if (option_debug > 1) - DEBUGA_SKYPE("skype_call: %s SKYPIAX_CONTROL_ANSWER sent\n", - SKYPIAX_P_LOG, id); - - if (1) { - char msg_to_skype[1024]; - - if (1) { - switch_threadattr_t *thd_attr = NULL; - - switch_threadattr_create(&thd_attr, module_pool); - switch_threadattr_detach_set(thd_attr, 1); - switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&p->tcp_srv_thread, thd_attr, - skypiax_do_tcp_srv_thread, p, module_pool); - DEBUGA_SKYPE("started tcp_srv_thread thread.\n", SKYPIAX_P_LOG); - - switch_threadattr_create(&thd_attr, module_pool); - switch_threadattr_detach_set(thd_attr, 1); - switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&p->tcp_cli_thread, thd_attr, - skypiax_do_tcp_cli_thread, p, module_pool); - DEBUGA_SKYPE("started tcp_cli_thread thread.\n", SKYPIAX_P_LOG); - } - switch_sleep(100000); - sprintf(msg_to_skype, "ALTER CALL %s SET_OUTPUT PORT=\"5556\"", id); - skypiax_skype_write(p, msg_to_skype); - switch_sleep(100000); - sprintf(msg_to_skype, "ALTER CALL %s SET_INPUT PORT=\"5558\"", id); - skypiax_skype_write(p, msg_to_skype); - switch_sleep(100000); - } - - p->skype_callflow = SKYPIAX_STATE_UP; - - /**************************/ - - //FIXME switch_core_session_t **new_session; - - //FIXME *new_session=switch_loadable_module_create_interface(skypiax_endpoint_interface, pool); - - if (!global_session) { //FIXME FIXME FIXME - switch_core_session_t *session = NULL; - private_t *tech_pvt = NULL; - switch_channel_t *channel = NULL; - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, - "New Inbound Channel!\n"); - - if ((session = - switch_core_session_request(skypiax_endpoint_interface, - NULL)) != 0) { - switch_core_session_add_stream(session, NULL); - if ((tech_pvt = - (private_t *) switch_core_session_alloc(session, - sizeof(private_t))) != 0) { - channel = switch_core_session_get_channel(session); - tech_init(tech_pvt, session, p); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, - "Hey where is my memory pool?\n"); - switch_core_session_destroy(&session); - break; - } - - // if ((tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session), NULL, dialplan, cid_name, cid_num, ip, NULL, NULL, NULL, modname, NULL, dest)) != 0) - - if ((tech_pvt->caller_profile = - switch_caller_profile_new(switch_core_session_get_pool(session), - "skypiax", "XML", "gmaruzz_from_skype", - "calling_number", NULL, "calling_ani", - NULL, NULL, (char *) modname, "default", - "5000")) != 0) { - char name[128]; - switch_snprintf(name, sizeof(name), "skypiax/%s-%04x", - tech_pvt->caller_profile->destination_number, - rand() & 0xffff); - switch_channel_set_name(channel, name); - switch_channel_set_caller_profile(channel, tech_pvt->caller_profile); - } - switch_channel_set_state(channel, CS_INIT); - if (switch_core_session_thread_launch(session) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, - "Error spawning thread\n"); - switch_core_session_destroy(&session); - } - } - } else { - switch_core_session_t *session = NULL; - private_t *tech_pvt = NULL; - switch_channel_t *channel = NULL; - - tech_pvt = p->tech_pvt; - //session = tech_pvt->session; - session = global_session; - channel = switch_core_session_get_channel(session); - switch_channel_mark_pre_answered(channel); - - //switch_channel_set_state(channel, CS_EXECUTE); - - } - /**************************/ - - } else { - WARNINGA("skype_call: %s, STATUS: %s is not recognized\n", SKYPIAX_P_LOG, - id, value); - - } - } //STATUS - - } //CALL - - a = 0; - } //message end - } //read_from_pipe - - } - - if (option_debug > 100) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - //DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - return 0; -} - int skypiax_skype_call(struct skypiax_interface *p, char *idest, int timeout, switch_core_session_t * session) { @@ -1874,7 +495,7 @@ (private_t *) switch_core_session_alloc(*new_session, sizeof(private_t))) != 0) { tech_pvt->p = &SKYPIAX_INTERFACES[2]; //FIXME channel = switch_core_session_get_channel(*new_session); - tech_init(tech_pvt, *new_session, NULL); + skypiax_tech_init(tech_pvt, *new_session, NULL); } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n"); @@ -1958,14 +579,13 @@ } -#endif // CONTROLDEV_THREAD static switch_status_t load_config(void) { char *cf = "skypiax.conf"; switch_xml_t cfg, xml, global_settings, param, interfaces, myinterface; - switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, module_pool); + switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, skypiax_module_pool); if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf); return SWITCH_STATUS_TERM; @@ -2149,11 +769,11 @@ switch_thread_t *thread; switch_threadattr_t *thd_attr = NULL; - switch_threadattr_create(&thd_attr, module_pool); + switch_threadattr_create(&thd_attr, skypiax_module_pool); switch_threadattr_detach_set(thd_attr, 1); switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); switch_thread_create(&thread, thd_attr, do_skype_thread, - &SKYPIAX_INTERFACES[interface_id], module_pool); + &SKYPIAX_INTERFACES[interface_id], skypiax_module_pool); } switch_sleep(100000); @@ -2161,11 +781,11 @@ switch_thread_t *thread; switch_threadattr_t *thd_attr = NULL; - switch_threadattr_create(&thd_attr, module_pool); + switch_threadattr_create(&thd_attr, skypiax_module_pool); switch_threadattr_detach_set(thd_attr, 1); switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); switch_thread_create(&thread, thd_attr, skypiax_do_controldev_thread, - &SKYPIAX_INTERFACES[interface_id], module_pool); + &SKYPIAX_INTERFACES[interface_id], skypiax_module_pool); } switch_sleep(1000000); @@ -2214,7 +834,7 @@ { struct skypiax_interface *p = NULL; - module_pool = pool; + skypiax_module_pool = pool; memset(&globals, '\0', sizeof(globals)); memset(SKYPIAX_INTERFACES, '\0', sizeof(SKYPIAX_INTERFACES)); Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h Tue Dec 9 05:52:03 2008 @@ -47,6 +47,23 @@ #define SKYPIAX_SVN_VERSION "SVN 123456" +typedef enum { + TFLAG_IO = (1 << 0), + TFLAG_INBOUND = (1 << 1), + TFLAG_OUTBOUND = (1 << 2), + TFLAG_DTMF = (1 << 3), + TFLAG_VOICE = (1 << 4), + TFLAG_HANGUP = (1 << 5), + TFLAG_LINEAR = (1 << 6), + TFLAG_CODEC = (1 << 7), + TFLAG_BREAK = (1 << 8) +} TFLAGS; + +typedef enum { + GFLAG_MY_CODEC_PREFS = (1 << 0) +} GFLAGS; + + #define DEBUGA_SKYPE(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_SKYPE %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); #define DEBUGA_CALL(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_CALL %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); #define DEBUGA_PBX(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_PBX %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); @@ -193,3 +210,9 @@ typedef struct private_object private_t; +void *SWITCH_THREAD_FUNC do_skype_thread(switch_thread_t * thread, void *obj); +void skypiax_tech_init(private_t * tech_pvt, switch_core_session_t * session, skypiax_interface_t * p); +switch_status_t skypiax_skypeaudio_read(private_t * tech_pvt); +int skypiax_skypeaudio_init(struct skypiax_interface *p); +int skypiax_skype_write(struct skypiax_interface *p, char *msg_to_skype); +int skypiax_skype_read(struct skypiax_interface *p); Added: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c ============================================================================== --- (empty file) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Tue Dec 9 05:52:03 2008 @@ -0,0 +1,1351 @@ +#include "skypiax.h" +extern switch_memory_pool_t *skypiax_module_pool; +extern int option_debug; +extern switch_core_session_t *global_session; +extern switch_endpoint_interface_t *skypiax_endpoint_interface; + +#define SKYPE_AUDIO +#ifdef SKYPE_AUDIO + +#define SAMPLES_PER_FRAME 160 +#define NN 160 +#define GG 160 +static void *SWITCH_THREAD_FUNC skypiax_do_tcp_srv_thread(switch_thread_t * thread, + void *obj) +{ + struct skypiax_interface *p = obj; + short in[GG]; + short out[GG / 2]; + int s, fd, len; + unsigned int sin_size; + struct sockaddr_in my_addr; + struct sockaddr_in remote_addr; + int exit = 0; + int a; + int i; + unsigned int kill_cli_size; + short kill_cli_buff[320]; + + if (option_debug > 10) { + WARNINGA("ENTERING FUNC\n", SKYPIAX_P_LOG); + } + memset(&my_addr, 0, sizeof(my_addr)); + my_addr.sin_family = AF_INET; + my_addr.sin_addr.s_addr = htonl(0x7f000001); /* use the localhost */ + my_addr.sin_port = htons(5556); //FIXME configurable! + + if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) { + ERRORA("socket Error\n", SKYPIAX_P_LOG); + if (option_debug > 10) { + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + } + return NULL; + } + + if (bind(s, (struct sockaddr *) &my_addr, sizeof(struct sockaddr)) < 0) { + ERRORA("bind Error\n", SKYPIAX_P_LOG); + if (option_debug > 10) { + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + } + return NULL; + } + DEBUGA_SKYPE("started tcp_srv_thread thread.\n", SKYPIAX_P_LOG); + + listen(s, 6); + + sin_size = sizeof(remote_addr); + while ((fd = accept(s, (struct sockaddr *) &remote_addr, &sin_size)) > 0) { + DEBUGA_SKYPE("ACCEPTED\n", SKYPIAX_P_LOG); + while (p->interface_state != SKYPIAX_STATE_DOWN + && (p->skype_callflow == CALLFLOW_STATUS_INPROGRESS + || p->skype_callflow == SKYPIAX_STATE_UP)) { + + int fdselect; + int rt; + fd_set fs; + struct timeval to; + + exit = 1; + + fdselect = fd; + FD_ZERO(&fs); + FD_SET(fdselect, &fs); + to.tv_usec = 100; + to.tv_sec = 0; + rt = select(fdselect + 1, &fs, NULL, NULL, &to); + if (rt > 0) { + + len = recv(fd, in, sizeof(short) * GG, 0); + //DEBUGA_SKYPE("recv %d\n", SKYPIAX_P_LOG, len); + if (len > 0) { + a = 0; + for (i = 0; i < len / sizeof(short); i++) { + out[a] = in[i]; + i++; + a++; + } + + if (!p->audiobuf_is_loaded) { + for (i = 0; i < (len / sizeof(short)) / 2; i++) { + p->audiobuf[i] = out[i]; + } + p->audiobuf_is_loaded = 1; + } else { + unsigned int howmany; + short totalbuf[GG]; + + howmany = len / 2 / 2; + for (i = 0; i < howmany; i++) + totalbuf[i] = p->audiobuf[i]; + + howmany = len / 2 / 2; + for (a = 0; a < howmany; a++) { + totalbuf[i] = out[a]; + i++; + } + + howmany = len; + + switch_file_write(p->audiopipe[1], totalbuf, &howmany); + p->audiobuf_is_loaded = 0; + //DEBUGA_SKYPE("read=====> req=%d recv=%d to sent=%d sent=%d\n", SKYPIAX_P_LOG, sizeof(short)*GG, len, (len*sizeof(short))/2, howmany); + } + + } else if (len == 0) { + DEBUGA_SKYPE("Skype client GONE\n", SKYPIAX_P_LOG); + break; + } else { + ERRORA("len=%d\n", SKYPIAX_P_LOG, len); + exit = 1; + break; + } + } + } + + kill_cli_size = 320; + switch_file_write(p->audiopipe[1], kill_cli_buff, &kill_cli_size); + kill_cli_size = 320; + switch_file_write(p->audioskypepipe[1], kill_cli_buff, &kill_cli_size); + p->interface_state = SKYPIAX_STATE_DOWN; + kill_cli_size = 320; + switch_file_write(p->audiopipe[1], kill_cli_buff, &kill_cli_size); + kill_cli_size = 320; + switch_file_write(p->audioskypepipe[1], kill_cli_buff, &kill_cli_size); + + DEBUGA_SKYPE("Skype client GONE\n", SKYPIAX_P_LOG); + +#ifndef WIN32 + close(fd); +#else + closesocket(fd); +#endif + if (exit) + break; + } + + WARNINGA("server (I am it) GONE\n", SKYPIAX_P_LOG); +#ifndef WIN32 + close(s); +#else + closesocket(s); +#endif + if (option_debug > 10) { + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + } + return NULL; +} +static void *SWITCH_THREAD_FUNC skypiax_do_tcp_cli_thread(switch_thread_t * thread, + void *obj) +//void *skypiax_do_tcp_cli_thread(void *data) +{ + struct skypiax_interface *p = obj; + int s, fd, len; + short in[NN / 2]; + short out[NN]; + unsigned int sin_size; + struct sockaddr_in my_addr; + struct sockaddr_in remote_addr; + int a; + int i; + unsigned int got; + + if (option_debug > 10) { + WARNINGA("ENTERING FUNC\n", SKYPIAX_P_LOG); + } + memset(&my_addr, 0, sizeof(my_addr)); + my_addr.sin_family = AF_INET; + my_addr.sin_addr.s_addr = htonl(0x7f000001); /* use the localhost */ + my_addr.sin_port = htons(5558); //FIXME configurable! + + if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) { + ERRORA("socket Error\n", SKYPIAX_P_LOG); + if (option_debug > 10) { + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + } + return NULL; + } + + if (bind(s, (struct sockaddr *) &my_addr, sizeof(struct sockaddr)) < 0) { + ERRORA("bind Error\n", SKYPIAX_P_LOG); + if (option_debug > 10) { + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + } +#ifndef WIN32 + close(s); +#else + closesocket(s); +#endif + return NULL; + } + DEBUGA_SKYPE("started tcp_cli_thread thread.\n", SKYPIAX_P_LOG); + + listen(s, 6); + + sin_size = sizeof(remote_addr); + while ((fd = accept(s, (struct sockaddr *) &remote_addr, &sin_size)) > 0) { + DEBUGA_SKYPE("ACCEPTED\n", SKYPIAX_P_LOG); + while (p->interface_state != SKYPIAX_STATE_DOWN + && (p->skype_callflow == CALLFLOW_STATUS_INPROGRESS + || p->skype_callflow == SKYPIAX_STATE_UP)) { + int fdselect; + int rt; + fd_set fs; + struct timeval to; + + fdselect = 1; + FD_ZERO(&fs); + FD_SET(fdselect, &fs); + to.tv_usec = 100; + to.tv_sec = 0; + rt = 1; + if (rt > 0) { + + got = (NN / 2) * sizeof(short); + switch_file_read(p->audioskypepipe[0], in, &got); + + if (got > 0) { + a = 0; + for (i = 0; i < got / sizeof(short); i++) { + out[a] = in[i]; + a++; + out[a] = in[i]; + a++; + } + + len = send(fd, out, got * 2, 0); + + if (len == 0) { + ERRORA("Skype server GONE\n", SKYPIAX_P_LOG); + break; + } + } else { + switch_sleep(1000); + //ERRORA("Audio skype pipe give us: %u\n", SKYPIAX_P_LOG, got); + } + } + + } + ERRORA("Skype server GONE\n", SKYPIAX_P_LOG); +#ifndef WIN32 + close(fd); +#else + closesocket(fd); +#endif + break; + } + + WARNINGA("client (I am it) GONE\n", SKYPIAX_P_LOG); +#ifndef WIN32 + close(s); +#else + closesocket(s); +#endif + if (option_debug > 10) { + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + } + return NULL; +} + +int skypiax_skypeaudio_init(struct skypiax_interface *p) +{ + + switch_status_t rv; + + rv = switch_file_pipe_create_ex(&p->audiopipe[0], &p->audiopipe[1], 2, skypiax_module_pool); + rv = switch_file_pipe_timeout_set(p->audiopipe[0], 100000); + +/* the pipe is our audio fd for pbx to poll on */ + p->skypiax_sound_capt_fd = p->audiopipe[0]; + + rv = + switch_file_pipe_create_ex(&p->audioskypepipe[0], &p->audioskypepipe[1], 2, + skypiax_module_pool); + rv = switch_file_pipe_timeout_set(p->audioskypepipe[0], 100); + if (option_debug > 10) { + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + } + return 0; +} +switch_status_t skypiax_skypeaudio_read(private_t * tech_pvt) +{ + struct skypiax_interface *p; + short buf[640]; + unsigned int samples; + int rt; + + p = tech_pvt->p; + + //DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); + + memset(buf, '\0', sizeof(buf)); + + rt = 1; + if (rt > 0) { + + samples = SAMPLES_PER_FRAME * sizeof(short); + + switch_file_read(p->audiopipe[0], tech_pvt->read_frame.data, &samples); + + //if ((samples = read(p->audiopipe[0], buf, SAMPLES_PER_FRAME * sizeof(short))) != 320) + if (samples != SAMPLES_PER_FRAME * sizeof(short)) { + if (samples) + DEBUGA_SKYPE("read=====> NOT GOOD samples=%d expected=%d\n", SKYPIAX_P_LOG, + samples, SAMPLES_PER_FRAME * sizeof(short)); + //do nothing + } else { + tech_pvt->read_frame.datalen = samples; + //DEBUGA_SKYPE("read=====> GOOD samples=%d\n", SKYPIAX_P_LOG, samples); + /* A real frame */ + } + } else { + DEBUGA_SKYPE("select returned %d\n", SKYPIAX_P_LOG, rt); + + } + + //DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + + return SWITCH_STATUS_SUCCESS; +} + +#endif /* SKYPE_AUDIO */ + +#ifdef WIN32 +struct AsteriskHandles *win32_AsteriskHandlesSkype; +HWND win32_hInit_MainWindowHandle; +HINSTANCE win32_hInit_ProcessHandle; +char win32_acInit_WindowClassName[128]; +HANDLE win32_hGlobal_ThreadShutdownEvent; +UINT win32_uiGlobal_MsgID_SkypeControlAPIAttach; +UINT win32_uiGlobal_MsgID_SkypeControlAPIDiscover; +HWND win32_hGlobal_SkypeAPIWindowHandle = NULL; +DWORD win32_ulGlobal_PromptConsoleMode = 0; +HANDLE volatile win32_hGlobal_PromptConsoleHandle = NULL; + +enum { + SKYPECONTROLAPI_ATTACH_SUCCESS = 0, /* Client is successfully + attached and API window handle can be found + in wParam parameter */ + SKYPECONTROLAPI_ATTACH_PENDING_AUTHORIZATION = 1, /* Skype has acknowledged + connection request and is waiting + for confirmation from the user. */ + /* The client is not yet attached + * and should wait for SKYPECONTROLAPI_ATTACH_SUCCESS message */ + SKYPECONTROLAPI_ATTACH_REFUSED = 2, /* User has explicitly + denied access to client */ + SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE = 3, /* API is not available + at the moment. + For example, this happens when no user + is currently logged in. */ + /* Client should wait for + * SKYPECONTROLAPI_ATTACH_API_AVAILABLE + * broadcast before making any further */ + /* connection attempts. */ + SKYPECONTROLAPI_ATTACH_API_AVAILABLE = 0x8001 +}; + +char + *strsep(char **stringp, const char *delim) +{ + char *res; + + if (!stringp || !*stringp || !**stringp) + return (char *) 0; + + res = *stringp; + while (**stringp && !strchr(delim, **stringp)) + ++(*stringp); + + if (**stringp) { + **stringp = '\0'; + ++(*stringp); + } + + return res; +} + +LRESULT APIENTRY skypiax_skype_present(HWND hWindow, UINT uiMessage, WPARAM uiParam, + LPARAM ulParam) +{ + LRESULT lReturnCode; + int fIssueDefProc; + struct skypiax_interface *p = NULL; + + lReturnCode = 0; + fIssueDefProc = 0; + switch (uiMessage) { + case WM_DESTROY: + win32_hInit_MainWindowHandle = NULL; + PostQuitMessage(0); + break; + case WM_COPYDATA: + if (win32_hGlobal_SkypeAPIWindowHandle == (HWND) uiParam) { + unsigned int howmany; + char msg_from_skype[2048]; + + PCOPYDATASTRUCT poCopyData = (PCOPYDATASTRUCT) ulParam; + + memset(msg_from_skype, '\0', sizeof(msg_from_skype)); + strncpy(msg_from_skype, (const char *) poCopyData->lpData, + sizeof(msg_from_skype) - 2); + + howmany = strlen(msg_from_skype) + 1; + switch_file_write(win32_AsteriskHandlesSkype->fdesc[1], msg_from_skype, &howmany); + //NOTICA("From Skype API: %s\n", SKYPIAX_P_LOG, (const char *) poCopyData->lpData); + lReturnCode = 1; + } + break; + default: + if (uiMessage == win32_uiGlobal_MsgID_SkypeControlAPIAttach) { + switch (ulParam) { + case SKYPECONTROLAPI_ATTACH_SUCCESS: + NOTICA("\n\n\tConnected to Skype API!\n", SKYPIAX_P_LOG); + win32_hGlobal_SkypeAPIWindowHandle = (HWND) uiParam; + switch_sleep(5000); + win32_AsteriskHandlesSkype->win32_hGlobal_SkypeAPIWindowHandle = + win32_hGlobal_SkypeAPIWindowHandle; + break; + case SKYPECONTROLAPI_ATTACH_PENDING_AUTHORIZATION: + WARNINGA + ("\n\n\tIf I do not immediately connect to Skype API,\n\tplease give the Skype client authorization to be connected \n\tby Asterisk and to not ask you again.\n\n", + SKYPIAX_P_LOG); + break; + case SKYPECONTROLAPI_ATTACH_REFUSED: + ERRORA("Skype client refused to be connected by Skypiax!\n", SKYPIAX_P_LOG); + break; + case SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE: + ERRORA("Skype API not available\n", SKYPIAX_P_LOG); + break; + case SKYPECONTROLAPI_ATTACH_API_AVAILABLE: + DEBUGA_SKYPE("Skype API available\n", SKYPIAX_P_LOG); + break; + default: + WARNINGA("GOT AN UNKNOWN SKYPE WINDOWS MSG\n", SKYPIAX_P_LOG); + } + lReturnCode = 1; + break; + } + fIssueDefProc = 1; + break; + } + if (fIssueDefProc) + lReturnCode = DefWindowProc(hWindow, uiMessage, uiParam, ulParam); + return (lReturnCode); +} + +int win32_Initialize_CreateWindowClass(void) +{ + unsigned char *paucUUIDString; + RPC_STATUS lUUIDResult; + int fReturnStatus; + UUID oUUID; + + fReturnStatus = 0; + lUUIDResult = UuidCreate(&oUUID); + win32_hInit_ProcessHandle = + (HINSTANCE) OpenProcess(PROCESS_DUP_HANDLE, FALSE, GetCurrentProcessId()); + if (win32_hInit_ProcessHandle != NULL + && (lUUIDResult == RPC_S_OK || lUUIDResult == RPC_S_UUID_LOCAL_ONLY)) { + if (UuidToString(&oUUID, &paucUUIDString) == RPC_S_OK) { + WNDCLASS oWindowClass; + + strcpy(win32_acInit_WindowClassName, "Skype-API-Skypiax-"); + strcat(win32_acInit_WindowClassName, (char *) paucUUIDString); + + oWindowClass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; + oWindowClass.lpfnWndProc = (WNDPROC) & skypiax_skype_present; + oWindowClass.cbClsExtra = 0; + oWindowClass.cbWndExtra = 0; + oWindowClass.hInstance = win32_hInit_ProcessHandle; + oWindowClass.hIcon = NULL; + oWindowClass.hCursor = NULL; + oWindowClass.hbrBackground = NULL; + oWindowClass.lpszMenuName = NULL; + oWindowClass.lpszClassName = win32_acInit_WindowClassName; + + if (RegisterClass(&oWindowClass) != 0) + fReturnStatus = 1; + + RpcStringFree(&paucUUIDString); + } + } + if (fReturnStatus == 0) + CloseHandle(win32_hInit_ProcessHandle), win32_hInit_ProcessHandle = NULL; + return (fReturnStatus); +} + +void win32_DeInitialize_DestroyWindowClass(void) +{ + UnregisterClass(win32_acInit_WindowClassName, win32_hInit_ProcessHandle); + CloseHandle(win32_hInit_ProcessHandle), win32_hInit_ProcessHandle = NULL; +} + +int win32_Initialize_CreateMainWindow(void) +{ + win32_hInit_MainWindowHandle = + CreateWindowEx(WS_EX_APPWINDOW | WS_EX_WINDOWEDGE, win32_acInit_WindowClassName, "", + WS_BORDER | WS_SYSMENU | WS_MINIMIZEBOX, CW_USEDEFAULT, CW_USEDEFAULT, + 128, 128, NULL, 0, win32_hInit_ProcessHandle, 0); + return (win32_hInit_MainWindowHandle != NULL ? 1 : 0); +} + +void win32_DeInitialize_DestroyMainWindow(void) +{ + if (win32_hInit_MainWindowHandle != NULL) + DestroyWindow(win32_hInit_MainWindowHandle), win32_hInit_MainWindowHandle = NULL; +} + +DWORD win32_dwThreadId; + +void *SWITCH_THREAD_FUNC do_skype_thread(switch_thread_t * thread, void *obj) +{ + /* create window class */ + /* create dummy/hidden window for processing messages */ + /* run message loop thread */ + /* do application control until exit */ + /* exit: send QUIT message to our own window */ + /* wait until thred terminates */ + /* destroy main window */ + /* destroy window class */ + + struct skypiax_interface *p; + p = obj; + + switch_file_pipe_create_ex(&p->AsteriskHandlesAst.fdesc[0], + &p->AsteriskHandlesAst.fdesc[1], 2, skypiax_module_pool); + + win32_AsteriskHandlesSkype = &p->AsteriskHandlesAst; + + win32_uiGlobal_MsgID_SkypeControlAPIAttach = + RegisterWindowMessage("SkypeControlAPIAttach"); + win32_uiGlobal_MsgID_SkypeControlAPIDiscover = + RegisterWindowMessage("SkypeControlAPIDiscover"); + + if (win32_uiGlobal_MsgID_SkypeControlAPIAttach != 0 + && win32_uiGlobal_MsgID_SkypeControlAPIDiscover != 0) { + if (win32_Initialize_CreateWindowClass()) { + if (win32_Initialize_CreateMainWindow()) { + win32_hGlobal_ThreadShutdownEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + if (win32_hGlobal_ThreadShutdownEvent != NULL) { + if (SendMessage + (HWND_BROADCAST, win32_uiGlobal_MsgID_SkypeControlAPIDiscover, + (WPARAM) win32_hInit_MainWindowHandle, 0) != 0) { + win32_AsteriskHandlesSkype->win32_hInit_MainWindowHandle = + win32_hInit_MainWindowHandle; + while (1) { + MSG oMessage; + + while (GetMessage(&oMessage, 0, 0, 0) != FALSE) { + TranslateMessage(&oMessage); + DispatchMessage(&oMessage); + } + } + } + CloseHandle(win32_hGlobal_ThreadShutdownEvent); + } + win32_DeInitialize_DestroyMainWindow(); + } + win32_DeInitialize_DestroyWindowClass(); + } + } + return NULL; +} + +#else /* NOT WIN32 */ + +#define SKYPE_X11_BUF_SIZE 512 +Window skype_win = (Window) - 1; +static XErrorHandler old_handler = 0; +static int xerror = 0; + +int X11_errors_handler(Display * dpy, XErrorEvent * err) +{ + (void) dpy; + struct skypiax_interface *p = NULL; + + xerror = err->error_code; + DEBUGA_SKYPE("Received error code %d from X Server\n", SKYPIAX_P_LOG, xerror); + return 0; /* ignore the error */ +} + +static void X11_errors_trap(void) +{ + xerror = 0; + old_handler = XSetErrorHandler(X11_errors_handler); +} + +static int X11_errors_untrap(void) +{ + XSetErrorHandler(old_handler); + return (xerror != BadValue) && (xerror != BadWindow); +} + +int skypiax_skype_send_message(struct AsteriskHandles *AsteriskHandlesAst, + const char *message_P) +{ + + Window w_P; + Display *disp; + Window handle_P; + struct skypiax_interface *p = NULL; + + w_P = AsteriskHandlesAst->skype_win; + disp = AsteriskHandlesAst->disp; + handle_P = AsteriskHandlesAst->win; + + Atom atom1 = XInternAtom(disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False); + Atom atom2 = XInternAtom(disp, "SKYPECONTROLAPI_MESSAGE", False); + unsigned int pos = 0; + unsigned int len = strlen(message_P); + XEvent e; + int ok; + + memset(&e, 0, sizeof(e)); + e.xclient.type = ClientMessage; + e.xclient.message_type = atom1; /* leading message */ + e.xclient.display = disp; + e.xclient.window = handle_P; + e.xclient.format = 8; + + X11_errors_trap(); + //XLockDisplay(disp); + do { + unsigned int i; + for (i = 0; i < 20 && i + pos <= len; ++i) + e.xclient.data.b[i] = message_P[i + pos]; + XSendEvent(disp, w_P, False, 0, &e); + + e.xclient.message_type = atom2; /* following messages */ + pos += i; + } while (pos <= len); + + XSync(disp, False); + //XUnlockDisplay(disp); + ok = X11_errors_untrap(); + + if (!ok) + DEBUGA_SKYPE("Sending message failed with status %d\n", SKYPIAX_P_LOG, xerror); + + return ok; +} + +int skypiax_skype_present(Display * disp) +{ + Atom skype_inst = XInternAtom(disp, "_SKYPE_INSTANCE", True); + + Atom type_ret; + int format_ret; + unsigned long nitems_ret; + unsigned long bytes_after_ret; + unsigned char *prop; + int status; + struct skypiax_interface *p = NULL; + + X11_errors_trap(); + //XLockDisplay(disp); + status = + XGetWindowProperty(disp, DefaultRootWindow(disp), skype_inst, 0, 1, False, XA_WINDOW, + &type_ret, &format_ret, &nitems_ret, &bytes_after_ret, &prop); + //XUnlockDisplay(disp); + X11_errors_untrap(); + + /* sanity check */ + if (status != Success || format_ret != 32 || nitems_ret != 1) { + skype_win = (Window) - 1; + DEBUGA_SKYPE("Skype instance not found\n", SKYPIAX_P_LOG); + return 0; + } + + skype_win = *(const unsigned long *) prop & 0xffffffff; + //DEBUGA_SKYPE("Skype instance found with id #%x\n", SKYPIAX_P_LOG, + DEBUGA_SKYPE("Skype instance found with id #%d\n", SKYPIAX_P_LOG, + (unsigned int) skype_win); + return 1; +} + +void skypiax_skype_clean_disp(void *data) +{ + + int *dispptr; + int disp; + struct skypiax_interface *p = NULL; + + dispptr = data; + disp = *dispptr; + + if (disp) { + DEBUGA_SKYPE("to be destroyed disp %d\n", SKYPIAX_P_LOG, disp); + close(disp); + DEBUGA_SKYPE("destroyed disp\n", SKYPIAX_P_LOG); + } else { + DEBUGA_SKYPE("NOT destroyed disp\n", SKYPIAX_P_LOG); + } + DEBUGA_SKYPE("OUT destroyed disp\n", SKYPIAX_P_LOG); + switch_sleep(1000); +} + +static void *SWITCH_THREAD_FUNC do_skype_thread(switch_thread_t * thread, void *obj) +{ + + struct skypiax_interface *p; + struct AsteriskHandles *AsteriskHandlesAst; + char buf[SKYPE_X11_BUF_SIZE]; + Display *disp = NULL; + Window root = -1; + Window win = -1; + + p = obj; + DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); + + switch_file_pipe_create_ex(&p->AsteriskHandlesAst.fdesc[0], + &p->AsteriskHandlesAst.fdesc[1], 2, skypiax_module_pool); + + AsteriskHandlesAst = &p->AsteriskHandlesAst; + //disp = XOpenDisplay(getenv("DISPLAY")); + disp = XOpenDisplay(p->X11_display); + if (!disp) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + "Cannot open X Display '%s', exiting skype thread\n", + p->X11_display); + return NULL; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "X Display '%s' opened\n", + p->X11_display); + } + + int xfd; + xfd = XConnectionNumber(disp); + fcntl(xfd, F_SETFD, FD_CLOEXEC); + + //FIXME pthread_cleanup_push(skypiax_skype_clean_disp, &xfd); + DEBUGA_SKYPE("PUSH disp %d\n", SKYPIAX_P_LOG, xfd); + + if (skypiax_skype_present(disp)) { + root = DefaultRootWindow(disp); + win = + XCreateSimpleWindow(disp, root, 0, 0, 1, 1, 0, + BlackPixel(disp, DefaultScreen(disp)), BlackPixel(disp, + DefaultScreen + (disp))); + + DEBUGA_SKYPE("skype_win=%d win=%d\n", SKYPIAX_P_LOG, (unsigned int) skype_win, + (unsigned int) win); + + AsteriskHandlesAst->skype_win = skype_win; + AsteriskHandlesAst->disp = disp; + AsteriskHandlesAst->win = win; + + snprintf(buf, SKYPE_X11_BUF_SIZE, "NAME skypiax"); + + if (!skypiax_skype_send_message(AsteriskHandlesAst, buf)) { + ERRORA + ("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch Skypiax again\n", + SKYPIAX_P_LOG); + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + return NULL; + } + + snprintf(buf, SKYPE_X11_BUF_SIZE, "PROTOCOL 6"); + if (!skypiax_skype_send_message(AsteriskHandlesAst, buf)) { + ERRORA + ("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch Skypiax again\n", + SKYPIAX_P_LOG); + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + return NULL; + } + + /* perform an events loop */ + XEvent an_event; + char buf[21]; /* can't be longer */ + char buffer[17000]; + char *b; + int i; + + b = buffer; + + while (1) { + XNextEvent(disp, &an_event); + switch (an_event.type) { + case ClientMessage: + + if (an_event.xclient.format != 8) + break; + + for (i = 0; i < 20 && an_event.xclient.data.b[i] != '\0'; ++i) + buf[i] = an_event.xclient.data.b[i]; + + buf[i] = '\0'; + + //NOTICA("ClientMessage buf:|||%s||| buffer:|||%s||| serial=%ld|||\r\n",SKYPIAX_P_LOG,buf, buffer,an_event.xclient.serial); + //NOTICA ("SKYPE read: |||%s|||%d\n", SKYPIAX_P_LOG, buf, strlen(buf)); + //NOTICA ("SKYPE buffer: |||%s|||%d\n", SKYPIAX_P_LOG, buffer, strlen(buffer)); + + strcat(buffer, buf); + + if (i < 20) { /* last fragment */ + unsigned int howmany; + + howmany = strlen(b) + 1; + + switch_file_write(AsteriskHandlesAst->fdesc[1], b, &howmany); + //write(AsteriskHandlesAst->fdesc[1], "\0", 1); + //FIXME DEBUGA_SKYPE("SKYPE pipewrite: |||%s|||len=%d serial=%ld\n\n\n", SKYPIAX_P_LOG, b, strlen(b) + 1, an_event.xclient.serial); + //switch_sleep(1000); + memset(buffer, '\0', 17000); + } + + break; + default: + break; + } + } + } else { + ERRORA + ("Skype is not running, maybe crashed. Please run/restart Skype and relaunch Skypiax\n", + SKYPIAX_P_LOG); + return NULL; + } + //DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + return NULL; + +} +#endif // WIN32 + + +int skypiax_skype_write(struct skypiax_interface *p, char *msg_to_skype) +{ +#ifdef WIN32 + static char acInputRow[1024]; + COPYDATASTRUCT oCopyData; + + if (option_debug > 100) { + DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); + } + sprintf(acInputRow, "%s", msg_to_skype); + if (option_debug > 1) + DEBUGA_SKYPE("acInputRow: |||%s||||\n", SKYPIAX_P_LOG, acInputRow); + /* send command to skype */ + oCopyData.dwData = 0; + oCopyData.lpData = acInputRow; + oCopyData.cbData = strlen(acInputRow) + 1; + if (oCopyData.cbData != 1) { + if (SendMessage + (p->AsteriskHandlesAst.win32_hGlobal_SkypeAPIWindowHandle, WM_COPYDATA, + (WPARAM) p->AsteriskHandlesAst.win32_hInit_MainWindowHandle, + (LPARAM) & oCopyData) == FALSE) { + ERRORA + ("Sending message failed - probably Skype crashed.\n\nPlease shutdown Skypiax (Asterisk), then restart Skype from the menu, then launch Skypiax and try again.\n", + SKYPIAX_P_LOG); + p->skype = 0; + //FIXME p->skype_thread = SKYPIAX_PTHREADT_NULL; + p->skype_thread = NULL; + if (option_debug > 100) { + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + } + return -1; + } + } +#else /* WIN32 */ + struct AsteriskHandles *AsteriskHandlesAst; + + if (option_debug > 100) { + DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); + } + AsteriskHandlesAst = &p->AsteriskHandlesAst; + + if (option_debug > 101) { + DEBUGA_SKYPE("SENDING: |||%s||||\n", SKYPIAX_P_LOG, msg_to_skype); + } + + if (!skypiax_skype_send_message(AsteriskHandlesAst, msg_to_skype)) { + ERRORA + ("Sending message failed - probably Skype crashed.\n\nPlease shutdown Skypiax (Asterisk), then restart Skype from the menu, then launch Skypiax and try again.\n", + SKYPIAX_P_LOG); + if (option_debug > 100) { + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + } + return -1; + } +#endif /* WIN32 */ + + if (option_debug > 100) { + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + } + return 0; + +} + +int skypiax_skype_read(struct skypiax_interface *p) +{ + + char read_from_pipe[4096]; + char messaggio[4096]; + char messaggio_2[4096]; + char *buf, obj[512] = "", id[512] = "", prop[512] = "", value[512] = "", *where; + char **stringp = NULL; + //int fd; + int rt; + //fd_set fs; + //struct timeval to; + int i, a; + unsigned int howmany; + + if (option_debug > 100) { + DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); + } + + memset(read_from_pipe, 0, 4096); + memset(messaggio, 0, 4096); + memset(messaggio_2, 0, 4096); + + rt = 1; + if (rt > 0) { + howmany = sizeof(read_from_pipe); + switch_file_read(p->AsteriskHandlesAst.fdesc[0], read_from_pipe, &howmany); + + a = 0; + for (i = 0; i < howmany; i++) { + messaggio[a] = read_from_pipe[i]; + a++; + + if (read_from_pipe[i] == '\0') { + + //if (option_debug > 101) + DEBUGA_SKYPE("read_skype: howmany=%d, i=%d, a=%d, |||%s||| \n", SKYPIAX_P_LOG, + howmany, i, a, messaggio); + + if (!strncasecmp(messaggio, "ERROR 92 CALL", 12)) { + ERRORA("Skype got ERROR: |||%s|||, the number we called was not recognized\n", + SKYPIAX_P_LOG, messaggio); + p->skype_callflow = CALLFLOW_STATUS_FINISHED; + if (option_debug) + DEBUGA_SKYPE("skype_call now is DOWN\n", SKYPIAX_P_LOG); + p->skype_call_id[0] = '\0'; + + if (p->interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) { + if (option_debug > 100) { + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + } + p->interface_state = SKYPIAX_STATE_DOWN; + return CALLFLOW_INCOMING_HANGUP; + } else { + p->interface_state = SKYPIAX_STATE_DOWN; + } + } + + strncpy(messaggio_2, messaggio, sizeof(messaggio) - 1); + + buf = messaggio; + stringp = &buf; + where = strsep(stringp, " "); + if (!where) { + WARNINGA("Skype MSG without spaces: %s\n", SKYPIAX_P_LOG, messaggio); + } + + if (!strcasecmp(messaggio, "#333")) { + /* DEBUGA_SKYPE("Skype MSG: messaggio_2: %s, messaggio2[11]: %s\n", SKYPIAX_P_LOG, + * messaggio_2, &messaggio_2[11]); */ + memset(p->skype_friends, 0, 4096); + strncpy(p->skype_friends, &messaggio_2[11], 4095); + } + if (!strcasecmp(messaggio, "#222")) { + /* DEBUGA_SKYPE("Skype MSG: messaggio_2: %s, messaggio2[10]: %s\n", SKYPIAX_P_LOG, + * messaggio_2, &messaggio_2[10]); */ + memset(p->skype_fullname, 0, 512); + strncpy(p->skype_fullname, &messaggio_2[10], 511); + } + if (!strcasecmp(messaggio, "#765")) { + /* DEBUGA_SKYPE("Skype MSG: messaggio_2: %s, messaggio2[10]: %s\n", SKYPIAX_P_LOG, + * messaggio_2, &messaggio_2[10]); */ + memset(p->skype_displayname, 0, 512); + strncpy(p->skype_displayname, &messaggio_2[10], 511); + } + if (!strcasecmp(messaggio, "ERROR")) { + ERRORA("Skype got ERROR: |||%s|||\n", SKYPIAX_P_LOG, messaggio); + p->skype_callflow = CALLFLOW_STATUS_FINISHED; + if (option_debug) + DEBUGA_SKYPE("skype_call now is DOWN\n", SKYPIAX_P_LOG); + p->skype_call_id[0] = '\0'; + + if (p->interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) { + if (option_debug > 100) { + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + } + p->interface_state = SKYPIAX_STATE_DOWN; + return CALLFLOW_INCOMING_HANGUP; + } else { + p->interface_state = SKYPIAX_STATE_DOWN; + } + } + if (!strcasecmp(messaggio, "CALL")) { + + strncpy(obj, where, sizeof(obj) - 1); + + where = strsep(stringp, " "); + + strncpy(id, where, sizeof(id) - 1); + + where = strsep(stringp, " "); + + strncpy(prop, where, sizeof(prop) - 1); + + where = strsep(stringp, " "); + + strncpy(value, where, sizeof(value) - 1); + + where = strsep(stringp, " "); + + if (option_debug > 101) + DEBUGA_SKYPE + ("Skype MSG: messaggio: %s, obj: %s, id: %s, prop: %s, value: %s,where: %s!\n", + SKYPIAX_P_LOG, messaggio, obj, id, prop, value, where ? where : "NULL"); + + if (!strcasecmp(prop, "PARTNER_HANDLE")) { + strncpy(p->callid_number, value, sizeof(p->callid_number) - 1); + WARNINGA + ("the skype_call %s caller PARTNER_HANDLE (p->callid_number) is: %s\n", + SKYPIAX_P_LOG, id, p->callid_number); + return CALLFLOW_INCOMING_RING; + } + if (!strcasecmp(prop, "PARTNER_DISPNAME")) { + snprintf(p->callid_name, sizeof(p->callid_name) - 1, "%s%s%s", value, + where ? " " : "", where ? where : ""); + WARNINGA + ("the skype_call %s caller PARTNER_DISPNAME (p->callid_name) is: %s\n", + SKYPIAX_P_LOG, id, p->callid_name); + } + if (!strcasecmp(prop, "CONF_ID") && !strcasecmp(value, "0")) { + DEBUGA_SKYPE("the skype_call %s is NOT a conference call\n", SKYPIAX_P_LOG, + id); + if (p->interface_state == SKYPIAX_STATE_DOWN) + p->interface_state = SKYPIAX_STATE_PRERING; + } + if (!strcasecmp(prop, "CONF_ID") && strcasecmp(value, "0")) { + DEBUGA_SKYPE("the skype_call %s is a conference call\n", SKYPIAX_P_LOG, id); + if (p->interface_state == SKYPIAX_STATE_DOWN) + p->interface_state = SKYPIAX_STATE_PRERING; + } + + if (!strcasecmp(prop, "DTMF")) { + switch_core_session_t *session = NULL; + private_t *tech_pvt = NULL; + switch_channel_t *channel = NULL; + + DEBUGA_SKYPE("Call %s received a DTMF: %s\n", SKYPIAX_P_LOG, id, value); + + tech_pvt = p->tech_pvt; + session = tech_pvt->session; + channel = switch_core_session_get_channel(session); + + if (channel) { + switch_dtmf_t dtmf = + { (char) value[0], switch_core_default_dtmf_duration(0) }; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%c DTMF %s\n", + dtmf.digit, switch_channel_get_name(channel)); + switch_mutex_lock(tech_pvt->flag_mutex); + switch_channel_queue_dtmf(channel, &dtmf); + switch_set_flag(tech_pvt, TFLAG_DTMF); + switch_mutex_unlock(tech_pvt->flag_mutex); + } + } + + if (!strcasecmp(prop, "FAILUREREASON")) { + DEBUGA_SKYPE + ("Skype has FAILED on skype_call %s. Let's wait for the FAILED message.\n", + SKYPIAX_P_LOG, id); + } + if (!strcasecmp(prop, "DURATION") && (!strcasecmp(value, "1"))) { + if (strcasecmp(id, p->skype_call_id)) { + strncpy(p->skype_call_id, id, sizeof(p->skype_call_id) - 1); + if (option_debug > 1) + DEBUGA_SKYPE + ("We called a Skype contact and he answered us on skype_call: %s.\n", + SKYPIAX_P_LOG, id); + } + } + + if (!strcasecmp(prop, "STATUS")) { + + if (!strcasecmp(value, "RINGING")) { + char msg_to_skype[1024]; + if (p->interface_state != SKYPIAX_STATE_DIALING) { + /* we are not calling out */ + + if (1) { + /* we are not inside an active call */ + p->skype_callflow = CALLFLOW_STATUS_RINGING; + p->interface_state = SKYPIAX_STATE_RING; + /* no owner, no active call, let's answer */ + skypiax_skype_write(p, "SET AGC OFF"); + switch_sleep(10000); + skypiax_skype_write(p, "SET AEC OFF"); + switch_sleep(10000); + sprintf(msg_to_skype, "GET CALL %s PARTNER_DISPNAME", id); + skypiax_skype_write(p, msg_to_skype); + switch_sleep(10000); + sprintf(msg_to_skype, "GET CALL %s PARTNER_HANDLE", id); + skypiax_skype_write(p, msg_to_skype); + switch_sleep(10000); + sprintf(msg_to_skype, "ALTER CALL %s ANSWER", id); + skypiax_skype_write(p, msg_to_skype); + if (option_debug) + DEBUGA_SKYPE("We answered a Skype RING on skype_call %s\n", + SKYPIAX_P_LOG, id); + strncpy(p->skype_call_id, id, sizeof(p->skype_call_id) - 1); + } else { + /* we're owned, we're in a call, let's refuse */ + sprintf(msg_to_skype, "SET CALL %s STATUS FINISHED", id); + skypiax_skype_write(p, msg_to_skype); + switch_sleep(10000); + DEBUGA_SKYPE + ("We have NOT answered a Skype RING on skype_call %s, because we are already in a skypiax call\n", + SKYPIAX_P_LOG, id); + + } + } else { + /* we are calling out */ + p->skype_callflow = CALLFLOW_STATUS_RINGING; + p->interface_state = SKYPIAX_STATE_RINGING; + //FIXME ast_queue_control(p->owner, SKYPIAX_CONTROL_RINGING); + strncpy(p->skype_call_id, id, sizeof(p->skype_call_id) - 1); + DEBUGA_SKYPE("Our remote party in skype_call %s is RINGING\n", + SKYPIAX_P_LOG, id); + } + } else if (!strcasecmp(value, "EARLYMEDIA")) { + p->skype_callflow = CALLFLOW_STATUS_EARLYMEDIA; + p->interface_state = SKYPIAX_STATE_DIALING; + //FIXME ast_queue_control(p->owner, SKYPIAX_CONTROL_RINGING); + DEBUGA_SKYPE("Our remote party in skype_call %s is EARLYMEDIA\n", + SKYPIAX_P_LOG, id); + } else if (!strcasecmp(value, "MISSED")) { + DEBUGA_SKYPE("We missed skype_call %s\n", SKYPIAX_P_LOG, id); + + } else if (!strcasecmp(value, "FINISHED")) { + global_session = NULL; //FIXME + //p->skype_callflow = CALLFLOW_STATUS_FINISHED; + if (option_debug) + DEBUGA_SKYPE("skype_call %s now is DOWN\n", SKYPIAX_P_LOG, id); + p->skype_call_id[0] = '\0'; + + if (p->interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) { + if (option_debug > 100) { + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + } + //p->interface_state = SKYPIAX_STATE_DOWN; + return CALLFLOW_INCOMING_HANGUP; + } else { + p->interface_state = SKYPIAX_STATE_DOWN; + } + + } else if (!strcasecmp(value, "CANCELLED")) { + p->skype_callflow = CALLFLOW_STATUS_CANCELLED; + if (option_debug) + DEBUGA_SKYPE + ("we tried to call Skype on skype_call %s and Skype has now CANCELLED\n", + SKYPIAX_P_LOG, id); + p->skype_call_id[0] = '\0'; + + if (p->interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) { + if (option_debug > 100) { + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + } + p->interface_state = SKYPIAX_STATE_DOWN; + return CALLFLOW_INCOMING_HANGUP; + } else { + p->interface_state = SKYPIAX_STATE_DOWN; + } + } else if (!strcasecmp(value, "FAILED")) { + p->skype_callflow = CALLFLOW_STATUS_FAILED; + if (option_debug) + DEBUGA_SKYPE + ("we tried to call Skype on skype_call %s and Skype has now FAILED\n", + SKYPIAX_P_LOG, id); + p->skype_call_id[0] = '\0'; + strncpy(p->skype_call_id, id, sizeof(p->skype_call_id) - 1); + p->interface_state = SKYPIAX_STATE_DOWN; + if (option_debug > 100) { + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + } + return CALLFLOW_INCOMING_HANGUP; + } else if (!strcasecmp(value, "REFUSED")) { + if (!strcasecmp(id, p->skype_call_id)) { + /* this is the id of the call we are in, probably we generated it */ + p->skype_callflow = CALLFLOW_STATUS_REFUSED; + if (option_debug) + DEBUGA_SKYPE + ("we tried to call Skype on skype_call %s and Skype has now REFUSED\n", + SKYPIAX_P_LOG, id); + strncpy(p->skype_call_id, id, sizeof(p->skype_call_id) - 1); + p->interface_state = SKYPIAX_STATE_DOWN; + p->skype_call_id[0] = '\0'; + if (option_debug > 100) { + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + } + return CALLFLOW_INCOMING_HANGUP; + } else { + /* we're here because were us that refused an incoming call */ + DEBUGA_SKYPE("we REFUSED skype_call %s\n", SKYPIAX_P_LOG, id); + + } + } else if (!strcasecmp(value, "ROUTING")) { + p->skype_callflow = CALLFLOW_STATUS_ROUTING; + p->interface_state = SKYPIAX_STATE_DIALING; + strncpy(p->skype_call_id, id, sizeof(p->skype_call_id) - 1); + DEBUGA_SKYPE("skype_call: %s is now ROUTING\n", SKYPIAX_P_LOG, id); + } else if (!strcasecmp(value, "UNPLACED")) { + p->skype_callflow = CALLFLOW_STATUS_UNPLACED; + p->interface_state = SKYPIAX_STATE_DIALING; + strncpy(p->skype_call_id, id, sizeof(p->skype_call_id) - 1); + DEBUGA_SKYPE("skype_call: %s is now UNPLACED\n", SKYPIAX_P_LOG, id); + } else if (!strcasecmp(value, "INPROGRESS")) { + p->skype_callflow = CALLFLOW_STATUS_INPROGRESS; + strncpy(p->skype_call_id, id, sizeof(p->skype_call_id) - 1); + p->interface_state = SKYPIAX_STATE_UP; + if (option_debug > 1) + DEBUGA_SKYPE("skype_call: %s is now active\n", SKYPIAX_P_LOG, id); + + if (option_debug > 1) + DEBUGA_SKYPE("skype_call: %s SKYPIAX_CONTROL_ANSWER sent\n", + SKYPIAX_P_LOG, id); + + if (1) { + char msg_to_skype[1024]; + + if (1) { + switch_threadattr_t *thd_attr = NULL; + + switch_threadattr_create(&thd_attr, skypiax_module_pool); + switch_threadattr_detach_set(thd_attr, 1); + switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); + switch_thread_create(&p->tcp_srv_thread, thd_attr, + skypiax_do_tcp_srv_thread, p, skypiax_module_pool); + DEBUGA_SKYPE("started tcp_srv_thread thread.\n", SKYPIAX_P_LOG); + + switch_threadattr_create(&thd_attr, skypiax_module_pool); + switch_threadattr_detach_set(thd_attr, 1); + switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); + switch_thread_create(&p->tcp_cli_thread, thd_attr, + skypiax_do_tcp_cli_thread, p, skypiax_module_pool); + DEBUGA_SKYPE("started tcp_cli_thread thread.\n", SKYPIAX_P_LOG); + } + switch_sleep(100000); + sprintf(msg_to_skype, "ALTER CALL %s SET_OUTPUT PORT=\"5556\"", id); + skypiax_skype_write(p, msg_to_skype); + switch_sleep(100000); + sprintf(msg_to_skype, "ALTER CALL %s SET_INPUT PORT=\"5558\"", id); + skypiax_skype_write(p, msg_to_skype); + switch_sleep(100000); + } + + p->skype_callflow = SKYPIAX_STATE_UP; + + /**************************/ + + //FIXME switch_core_session_t **new_session; + + //FIXME *new_session=switch_loadable_module_create_interface(skypiax_endpoint_interface, pool); + + if (!global_session) { //FIXME FIXME FIXME + switch_core_session_t *session = NULL; + private_t *tech_pvt = NULL; + switch_channel_t *channel = NULL; + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, + "New Inbound Channel!\n"); + + if ((session = + switch_core_session_request(skypiax_endpoint_interface, + NULL)) != 0) { + switch_core_session_add_stream(session, NULL); + if ((tech_pvt = + (private_t *) switch_core_session_alloc(session, + sizeof(private_t))) != 0) { + channel = switch_core_session_get_channel(session); + skypiax_tech_init(tech_pvt, session, p); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, + "Hey where is my memory pool?\n"); + switch_core_session_destroy(&session); + break; + } + + // if ((tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session), NULL, dialplan, cid_name, cid_num, ip, NULL, NULL, NULL, modname, NULL, dest)) != 0) + + if ((tech_pvt->caller_profile = + switch_caller_profile_new(switch_core_session_get_pool(session), + "skypiax", "XML", "gmaruzz_from_skype", + "calling_number", NULL, "calling_ani", + NULL, NULL, "mod_skypiax", "default", + "5000")) != 0) { + char name[128]; + switch_snprintf(name, sizeof(name), "skypiax/%s-%04x", + tech_pvt->caller_profile->destination_number, + rand() & 0xffff); + switch_channel_set_name(channel, name); + switch_channel_set_caller_profile(channel, tech_pvt->caller_profile); + } + switch_channel_set_state(channel, CS_INIT); + if (switch_core_session_thread_launch(session) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, + "Error spawning thread\n"); + switch_core_session_destroy(&session); + } + } + } else { + switch_core_session_t *session = NULL; + private_t *tech_pvt = NULL; + switch_channel_t *channel = NULL; + + tech_pvt = p->tech_pvt; + //session = tech_pvt->session; + session = global_session; + channel = switch_core_session_get_channel(session); + switch_channel_mark_pre_answered(channel); + + //switch_channel_set_state(channel, CS_EXECUTE); + + } + /**************************/ + + } else { + WARNINGA("skype_call: %s, STATUS: %s is not recognized\n", SKYPIAX_P_LOG, + id, value); + + } + } //STATUS + + } //CALL + + a = 0; + } //message end + } //read_from_pipe + + } + + if (option_debug > 100) { + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + } + //DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + return 0; +} + + From gmaruzz at freeswitch.org Tue Dec 9 02:56:51 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 05:56:51 -0500 Subject: [Freeswitch-svn] [commit] r10673 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Tue Dec 9 05:56:50 2008 New Revision: 10673 Log: skypiax: updated Makefile, works Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/Makefile freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/Makefile ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/Makefile (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/Makefile Tue Dec 9 05:56:50 2008 @@ -1,3 +1,4 @@ MODNAME=mod_skypiax LOCAL_LDFLAGS=-lX11 +LOCAL_OBJS=skypiax_protocol.o include ../../../../build/modmake.rules Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Tue Dec 9 05:56:50 2008 @@ -703,7 +703,7 @@ switch_sleep(1000); } -static void *SWITCH_THREAD_FUNC do_skype_thread(switch_thread_t * thread, void *obj) +void *SWITCH_THREAD_FUNC do_skype_thread(switch_thread_t * thread, void *obj) { struct skypiax_interface *p; From gmaruzz at freeswitch.org Tue Dec 9 03:39:00 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 06:39:00 -0500 Subject: [Freeswitch-svn] [commit] r10674 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Tue Dec 9 06:39:00 2008 New Revision: 10674 Log: skypiax: less warnings on windows Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Tue Dec 9 06:39:00 2008 @@ -1,6 +1,5 @@ #include "skypiax.h" - SWITCH_MODULE_LOAD_FUNCTION(mod_skypiax_load); SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypiax_shutdown); //SWITCH_MODULE_RUNTIME_FUNCTION(mod_skypiax_runtime); @@ -540,16 +539,16 @@ { struct skypiax_interface *p = obj; int res; + int forever=1; DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); DEBUGA_SKYPE("In skypiax_do_controldev_thread: started, p=%p\n", SKYPIAX_P_LOG, (void *) p); - while (1) { + while (forever) { switch_sleep(1000); res = skypiax_skype_read(p); -#if 1 //if (res == CALLFLOW_INCOMING_HANGUP && p->interface_state != SKYPIAX_STATE_DOWN) if (res == CALLFLOW_INCOMING_HANGUP) { switch_core_session_t *session = NULL; @@ -566,10 +565,7 @@ switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); DEBUGA_SKYPE("after channel_on_hangup\n", SKYPIAX_P_LOG); - - //DEBUGA_SKYPE("set state to CS_HANGUP\n", SKYPIAX_P_LOG); } -#endif } //if (option_debug > 10) { @@ -737,6 +733,11 @@ } if (interface_id && interface_id < SKYPIAX_MAX_INTERFACES) { struct skypiax_interface newconf; + switch_thread_t *do_skype_thread_thread; + switch_threadattr_t *do_skype_thd_attr = NULL; + switch_thread_t *skypiax_do_controldev_thread_thread; + switch_threadattr_t *skypiax_do_controldev_thread_thd_attr = NULL; + memset(&newconf, '\0', sizeof(newconf)); SKYPIAX_INTERFACES[interface_id] = newconf; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, @@ -765,28 +766,20 @@ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "STARTING interface_id=%d\n", interface_id); - if (1) { - switch_thread_t *thread; - switch_threadattr_t *thd_attr = NULL; - - switch_threadattr_create(&thd_attr, skypiax_module_pool); - switch_threadattr_detach_set(thd_attr, 1); - switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&thread, thd_attr, do_skype_thread, + + switch_threadattr_create(&do_skype_thd_attr, skypiax_module_pool); + switch_threadattr_detach_set(do_skype_thd_attr, 1); + switch_threadattr_stacksize_set(do_skype_thd_attr, SWITCH_THREAD_STACKSIZE); + switch_thread_create(&do_skype_thread_thread, do_skype_thd_attr, do_skype_thread, &SKYPIAX_INTERFACES[interface_id], skypiax_module_pool); - } switch_sleep(100000); - if (1) { - switch_thread_t *thread; - switch_threadattr_t *thd_attr = NULL; - - switch_threadattr_create(&thd_attr, skypiax_module_pool); - switch_threadattr_detach_set(thd_attr, 1); - switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&thread, thd_attr, skypiax_do_controldev_thread, + + switch_threadattr_create(&skypiax_do_controldev_thread_thd_attr, skypiax_module_pool); + switch_threadattr_detach_set(skypiax_do_controldev_thread_thd_attr, 1); + switch_threadattr_stacksize_set(skypiax_do_controldev_thread_thd_attr, SWITCH_THREAD_STACKSIZE); + switch_thread_create(&skypiax_do_controldev_thread_thread, skypiax_do_controldev_thread_thd_attr, skypiax_do_controldev_thread, &SKYPIAX_INTERFACES[interface_id], skypiax_module_pool); - } switch_sleep(1000000); @@ -832,7 +825,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_skypiax_load) { - struct skypiax_interface *p = NULL; + //struct skypiax_interface *p = NULL; skypiax_module_pool = pool; Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Tue Dec 9 06:39:00 2008 @@ -1,4 +1,6 @@ #include "skypiax.h" + + extern switch_memory_pool_t *skypiax_module_pool; extern int option_debug; extern switch_core_session_t *global_session; @@ -16,8 +18,14 @@ struct skypiax_interface *p = obj; short in[GG]; short out[GG / 2]; - int s, fd, len; + int s, len; +#ifdef WIN32 + int sin_size; + unsigned int fd; +#else unsigned int sin_size; + int fd; +#endif /* WIN32 */ struct sockaddr_in my_addr; struct sockaddr_in remote_addr; int exit = 0; @@ -60,7 +68,11 @@ && (p->skype_callflow == CALLFLOW_STATUS_INPROGRESS || p->skype_callflow == SKYPIAX_STATE_UP)) { +#ifdef WIN32 + unsigned int fdselect; +#else int fdselect; +#endif /* WIN32 */ int rt; fd_set fs; struct timeval to; @@ -1090,7 +1102,7 @@ if (p->interface_state != SKYPIAX_STATE_DIALING) { /* we are not calling out */ - if (1) { + if (1) { //FIXME /* we are not inside an active call */ p->skype_callflow = CALLFLOW_STATUS_RINGING; p->interface_state = SKYPIAX_STATE_RING; @@ -1227,10 +1239,10 @@ DEBUGA_SKYPE("skype_call: %s SKYPIAX_CONTROL_ANSWER sent\n", SKYPIAX_P_LOG, id); - if (1) { + if (1) { //FIXME char msg_to_skype[1024]; - if (1) { + if (1) { //FIXME switch_threadattr_t *thd_attr = NULL; switch_threadattr_create(&thd_attr, skypiax_module_pool); From gmaruzz at freeswitch.org Tue Dec 9 03:41:55 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 06:41:55 -0500 Subject: [Freeswitch-svn] [commit] r10675 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Tue Dec 9 06:41:55 2008 New Revision: 10675 Log: skypiax: works on linux Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Tue Dec 9 06:41:55 2008 @@ -825,14 +825,14 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_skypiax_load) { - //struct skypiax_interface *p = NULL; + struct skypiax_interface *p = NULL; skypiax_module_pool = pool; memset(&globals, '\0', sizeof(globals)); memset(SKYPIAX_INTERFACES, '\0', sizeof(SKYPIAX_INTERFACES)); -#ifndef _WINDOWS_ //FIXME +#ifndef WIN32 //FIXME if (!XInitThreads()) { ERRORA("Not initialized XInitThreads!\n", SKYPIAX_P_LOG); } else { @@ -850,6 +850,7 @@ skypiax_endpoint_interface->io_routines = &skypiax_io_routines; skypiax_endpoint_interface->state_handler = &skypiax_state_handlers; + DEBUGA_SKYPE("EXITING FUNC!\n", SKYPIAX_P_LOG); /* indicate that the module should continue to be loaded */ return SWITCH_STATUS_SUCCESS; } From gmaruzz at freeswitch.org Tue Dec 9 06:33:56 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 09:33:56 -0500 Subject: [Freeswitch-svn] [commit] r10676 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Tue Dec 9 09:33:55 2008 New Revision: 10676 Log: skypiax: less warnings on windows Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Tue Dec 9 09:33:55 2008 @@ -1,6 +1,5 @@ #include "skypiax.h" - extern switch_memory_pool_t *skypiax_module_pool; extern int option_debug; extern switch_core_session_t *global_session; @@ -16,21 +15,26 @@ void *obj) { struct skypiax_interface *p = obj; - short in[GG]; short out[GG / 2]; - int s, len; + int s; #ifdef WIN32 + unsigned int len; + unsigned int i; + unsigned int a; + char in[GG]; int sin_size; unsigned int fd; #else + int len; + int i; + int a; + short in[GG]; unsigned int sin_size; int fd; #endif /* WIN32 */ struct sockaddr_in my_addr; struct sockaddr_in remote_addr; int exit = 0; - int a; - int i; unsigned int kill_cli_size; short kill_cli_buff[320]; @@ -171,15 +175,27 @@ //void *skypiax_do_tcp_cli_thread(void *data) { struct skypiax_interface *p = obj; - int s, fd, len; - short in[NN / 2]; - short out[NN]; - unsigned int sin_size; + int s; struct sockaddr_in my_addr; struct sockaddr_in remote_addr; - int a; - int i; unsigned int got; +#ifdef WIN32 + unsigned int len; + unsigned int i; + unsigned int a; + char in[NN / 2]; + char out[NN]; + int sin_size; + unsigned int fd; +#else + int len; + int i; + int a; + short in[NN / 2]; + short out[NN]; + unsigned int sin_size; + int fd; +#endif /* WIN32 */ if (option_debug > 10) { WARNINGA("ENTERING FUNC\n", SKYPIAX_P_LOG); @@ -219,7 +235,11 @@ while (p->interface_state != SKYPIAX_STATE_DOWN && (p->skype_callflow == CALLFLOW_STATUS_INPROGRESS || p->skype_callflow == SKYPIAX_STATE_UP)) { +#ifdef WIN32 + unsigned int fdselect; +#else int fdselect; +#endif /* WIN32 */ int rt; fd_set fs; struct timeval to; @@ -918,8 +938,9 @@ int rt; //fd_set fs; //struct timeval to; - int i, a; + int a; unsigned int howmany; + unsigned int i; if (option_debug > 100) { DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); From gmaruzz at freeswitch.org Tue Dec 9 06:35:38 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 09:35:38 -0500 Subject: [Freeswitch-svn] [commit] r10677 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Tue Dec 9 09:35:38 2008 New Revision: 10677 Log: skypiax: indent -gnu -ts4 -br -brs -cdw -lp -ce -nbfda -npcs -nprs -npsl -nbbo -saf -sai -saw -cs -bbo -nhnl -nut -sob -l90 Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Tue Dec 9 09:35:38 2008 @@ -36,7 +36,6 @@ /*************************************************/ /*************************************************/ - SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan); SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_string, globals.codec_string); SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_rates_string, @@ -63,7 +62,6 @@ int stream_id); static switch_status_t channel_kill_channel(switch_core_session_t * session, int sig); - static switch_status_t skypiax_codec(private_t * tech_pvt, int sample_rate, int codec_ms) { if (switch_core_codec_init @@ -93,7 +91,8 @@ } -void skypiax_tech_init(private_t * tech_pvt, switch_core_session_t * session, skypiax_interface_t * p) +void skypiax_tech_init(private_t * tech_pvt, switch_core_session_t * session, + skypiax_interface_t * p) { DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); @@ -539,7 +538,7 @@ { struct skypiax_interface *p = obj; int res; - int forever=1; + int forever = 1; DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); @@ -575,7 +574,6 @@ } - static switch_status_t load_config(void) { char *cf = "skypiax.conf"; @@ -733,10 +731,10 @@ } if (interface_id && interface_id < SKYPIAX_MAX_INTERFACES) { struct skypiax_interface newconf; - switch_thread_t *do_skype_thread_thread; - switch_threadattr_t *do_skype_thd_attr = NULL; - switch_thread_t *skypiax_do_controldev_thread_thread; - switch_threadattr_t *skypiax_do_controldev_thread_thd_attr = NULL; + switch_thread_t *do_skype_thread_thread; + switch_threadattr_t *do_skype_thd_attr = NULL; + switch_thread_t *skypiax_do_controldev_thread_thread; + switch_threadattr_t *skypiax_do_controldev_thread_thd_attr = NULL; memset(&newconf, '\0', sizeof(newconf)); SKYPIAX_INTERFACES[interface_id] = newconf; @@ -766,20 +764,23 @@ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "STARTING interface_id=%d\n", interface_id); - - switch_threadattr_create(&do_skype_thd_attr, skypiax_module_pool); - switch_threadattr_detach_set(do_skype_thd_attr, 1); - switch_threadattr_stacksize_set(do_skype_thd_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&do_skype_thread_thread, do_skype_thd_attr, do_skype_thread, - &SKYPIAX_INTERFACES[interface_id], skypiax_module_pool); + switch_threadattr_create(&do_skype_thd_attr, skypiax_module_pool); + switch_threadattr_detach_set(do_skype_thd_attr, 1); + switch_threadattr_stacksize_set(do_skype_thd_attr, SWITCH_THREAD_STACKSIZE); + switch_thread_create(&do_skype_thread_thread, do_skype_thd_attr, do_skype_thread, + &SKYPIAX_INTERFACES[interface_id], skypiax_module_pool); switch_sleep(100000); - switch_threadattr_create(&skypiax_do_controldev_thread_thd_attr, skypiax_module_pool); - switch_threadattr_detach_set(skypiax_do_controldev_thread_thd_attr, 1); - switch_threadattr_stacksize_set(skypiax_do_controldev_thread_thd_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&skypiax_do_controldev_thread_thread, skypiax_do_controldev_thread_thd_attr, skypiax_do_controldev_thread, - &SKYPIAX_INTERFACES[interface_id], skypiax_module_pool); + switch_threadattr_create(&skypiax_do_controldev_thread_thd_attr, + skypiax_module_pool); + switch_threadattr_detach_set(skypiax_do_controldev_thread_thd_attr, 1); + switch_threadattr_stacksize_set(skypiax_do_controldev_thread_thd_attr, + SWITCH_THREAD_STACKSIZE); + switch_thread_create(&skypiax_do_controldev_thread_thread, + skypiax_do_controldev_thread_thd_attr, + skypiax_do_controldev_thread, + &SKYPIAX_INTERFACES[interface_id], skypiax_module_pool); switch_sleep(1000000); @@ -832,7 +833,7 @@ memset(&globals, '\0', sizeof(globals)); memset(SKYPIAX_INTERFACES, '\0', sizeof(SKYPIAX_INTERFACES)); -#ifndef WIN32 //FIXME +#ifndef WIN32 //FIXME if (!XInitThreads()) { ERRORA("Not initialized XInitThreads!\n", SKYPIAX_P_LOG); } else { @@ -850,7 +851,7 @@ skypiax_endpoint_interface->io_routines = &skypiax_io_routines; skypiax_endpoint_interface->state_handler = &skypiax_state_handlers; - DEBUGA_SKYPE("EXITING FUNC!\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("EXITING FUNC!\n", SKYPIAX_P_LOG); /* indicate that the module should continue to be loaded */ return SWITCH_STATUS_SUCCESS; } @@ -934,4 +935,3 @@ * For VIM: * vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab: */ - Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h Tue Dec 9 09:35:38 2008 @@ -44,7 +44,6 @@ //FIXME include? #endif //WIN32 - #define SKYPIAX_SVN_VERSION "SVN 123456" typedef enum { @@ -63,7 +62,6 @@ GFLAG_MY_CODEC_PREFS = (1 << 0) } GFLAGS; - #define DEBUGA_SKYPE(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_SKYPE %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); #define DEBUGA_CALL(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_CALL %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); #define DEBUGA_PBX(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_PBX %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); @@ -209,9 +207,9 @@ typedef struct private_object private_t; - void *SWITCH_THREAD_FUNC do_skype_thread(switch_thread_t * thread, void *obj); -void skypiax_tech_init(private_t * tech_pvt, switch_core_session_t * session, skypiax_interface_t * p); +void skypiax_tech_init(private_t * tech_pvt, switch_core_session_t * session, + skypiax_interface_t * p); switch_status_t skypiax_skypeaudio_read(private_t * tech_pvt); int skypiax_skypeaudio_init(struct skypiax_interface *p); int skypiax_skype_write(struct skypiax_interface *p, char *msg_to_skype); Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Tue Dec 9 09:35:38 2008 @@ -303,7 +303,9 @@ switch_status_t rv; - rv = switch_file_pipe_create_ex(&p->audiopipe[0], &p->audiopipe[1], 2, skypiax_module_pool); + rv = + switch_file_pipe_create_ex(&p->audiopipe[0], &p->audiopipe[1], 2, + skypiax_module_pool); rv = switch_file_pipe_timeout_set(p->audiopipe[0], 100000); /* the pipe is our audio fd for pbx to poll on */ @@ -318,6 +320,7 @@ } return 0; } + switch_status_t skypiax_skypeaudio_read(private_t * tech_pvt) { struct skypiax_interface *p; @@ -862,7 +865,6 @@ } #endif // WIN32 - int skypiax_skype_write(struct skypiax_interface *p, char *msg_to_skype) { #ifdef WIN32 @@ -963,8 +965,8 @@ if (read_from_pipe[i] == '\0') { //if (option_debug > 101) - DEBUGA_SKYPE("read_skype: howmany=%d, i=%d, a=%d, |||%s||| \n", SKYPIAX_P_LOG, - howmany, i, a, messaggio); + DEBUGA_SKYPE("read_skype: howmany=%d, i=%d, a=%d, |||%s||| \n", SKYPIAX_P_LOG, + howmany, i, a, messaggio); if (!strncasecmp(messaggio, "ERROR 92 CALL", 12)) { ERRORA("Skype got ERROR: |||%s|||, the number we called was not recognized\n", @@ -1092,8 +1094,8 @@ if (channel) { switch_dtmf_t dtmf = { (char) value[0], switch_core_default_dtmf_duration(0) }; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%c DTMF %s\n", - dtmf.digit, switch_channel_get_name(channel)); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%c DTMF %s\n", + dtmf.digit, switch_channel_get_name(channel)); switch_mutex_lock(tech_pvt->flag_mutex); switch_channel_queue_dtmf(channel, &dtmf); switch_set_flag(tech_pvt, TFLAG_DTMF); @@ -1123,7 +1125,7 @@ if (p->interface_state != SKYPIAX_STATE_DIALING) { /* we are not calling out */ - if (1) { //FIXME + if (1) { //FIXME /* we are not inside an active call */ p->skype_callflow = CALLFLOW_STATUS_RINGING; p->interface_state = SKYPIAX_STATE_RING; @@ -1260,10 +1262,10 @@ DEBUGA_SKYPE("skype_call: %s SKYPIAX_CONTROL_ANSWER sent\n", SKYPIAX_P_LOG, id); - if (1) { //FIXME + if (1) { //FIXME char msg_to_skype[1024]; - if (1) { //FIXME + if (1) { //FIXME switch_threadattr_t *thd_attr = NULL; switch_threadattr_create(&thd_attr, skypiax_module_pool); @@ -1380,5 +1382,3 @@ //DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); return 0; } - - From mikej at freeswitch.org Tue Dec 9 07:59:08 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 10:59:08 -0500 Subject: [Freeswitch-svn] [commit] r10678 - freeswitch/trunk/src/mod/xml_int/mod_xml_ldap Message-ID: Author: mikej Date: Tue Dec 9 10:59:07 2008 New Revision: 10678 Log: fix download filename Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_ldap/Makefile Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_ldap/Makefile ============================================================================== --- freeswitch/trunk/src/mod/xml_int/mod_xml_ldap/Makefile (original) +++ freeswitch/trunk/src/mod/xml_int/mod_xml_ldap/Makefile Tue Dec 9 10:59:07 2008 @@ -17,7 +17,7 @@ include $(switch_srcdir)/build/modmake.rules $(LDAP_DIR): - $(GETLIB) $(LDAP).tgz + $(GETLIB) $(LDAP).tar.gz cd $(LDAP_DIR) && CFLAGS="`echo $(CFLAGS) | sed -e 's:-std=c99::'`" ./configure $(DEFAULT_ARGS) $(LIBLUTILA) $(LDAPLA) $(LIBLBERLA): $(LDAP_DIR) From mikej at freeswitch.org Tue Dec 9 08:19:05 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 11:19:05 -0500 Subject: [Freeswitch-svn] [commit] r10679 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: mikej Date: Tue Dec 9 11:19:04 2008 New Revision: 10679 Log: FSCORE-247 DTMF digit # is being interpreted as 1 when received in info DTMF Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Tue Dec 9 11:19:04 2008 @@ -3498,7 +3498,7 @@ int tmp; /* move signal_ptr where we need it (right past Signal=) */ signal_ptr = signal_ptr + 7; - if (is_dtmf(*signal_ptr)) { + if (*strlen && strlen(signal_ptr) == 1 && is_dtmf(*signal_ptr)) { dtmf.digit = *signal_ptr; } else { tmp = atoi(signal_ptr); From mikej at freeswitch.org Tue Dec 9 08:39:56 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 11:39:56 -0500 Subject: [Freeswitch-svn] [commit] r10680 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: mikej Date: Tue Dec 9 11:39:56 2008 New Revision: 10680 Log: C&P fail Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Tue Dec 9 11:39:56 2008 @@ -3498,7 +3498,7 @@ int tmp; /* move signal_ptr where we need it (right past Signal=) */ signal_ptr = signal_ptr + 7; - if (*strlen && strlen(signal_ptr) == 1 && is_dtmf(*signal_ptr)) { + if (*signal_ptr && strlen(signal_ptr) == 1 && is_dtmf(*signal_ptr)) { dtmf.digit = *signal_ptr; } else { tmp = atoi(signal_ptr); From mikej at freeswitch.org Tue Dec 9 09:01:15 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 12:01:15 -0500 Subject: [Freeswitch-svn] [commit] r10681 - freeswitch/trunk/build Message-ID: Author: mikej Date: Tue Dec 9 12:01:14 2008 New Revision: 10681 Log: formating Modified: freeswitch/trunk/build/Makefile Modified: freeswitch/trunk/build/Makefile ============================================================================== --- freeswitch/trunk/build/Makefile (original) +++ freeswitch/trunk/build/Makefile Tue Dec 9 12:01:14 2008 @@ -1,52 +1,51 @@ all: - @echo " +-------- FreeSWITCH Build Complete -----------+" - @echo " + FreeSWITCH has been successfully built. +" - @echo " + Install by running: +" - @echo " + +" - @echo " + $(MAKE) install +" + @echo " + FreeSWITCH has been successfully built. +" + @echo " + Install by running: +" + @echo " + +" + @echo " + $(MAKE) install +" @echo " +----------------------------------------------+" install: - @echo " +-------- FreeSWITCH install Complete ---------+" - @echo " + FreeSWITCH has been successfully installed. +" - @echo " + +" - @echo " + Install sounds: +" - @echo " + (uhd-sounds includes hd-sounds, sounds) +" - @echo " + (hd-sounds includes sounds) +" - @echo " + ------------------------------------ +" - @echo " + $(MAKE) uhd-sounds-install +" - @echo " + $(MAKE) uhd-moh-install +" - @echo " + +" - @echo " + $(MAKE) hd-sounds-install +" - @echo " + $(MAKE) hd-moh-install +" - @echo " + +" - @echo " + $(MAKE) sounds-install +" - @echo " + $(MAKE) moh-install +" - @echo " + +" - @echo " + Upgrade to latest: +" - @echo " + ---------------------------------- +" - @echo " + $(MAKE) current +" - @echo " + +" - @echo " + Rebuild all: +" - @echo " + ---------------------------------- +" - @echo " + $(MAKE) sure +" - @echo " + +" - @echo " + Install/Re-install default config: +" - @echo " + ---------------------------------- +" - @echo " + $(MAKE) samples +" - @echo " + +" - @echo " + +" - @echo " + Additional resources: +" - @echo " + ---------------------------------- +" - @echo " + http://www.freeswitch.org +" - @echo " + http://wiki.freeswitch.org +" - @echo " + http://jira.freeswitch.org +" - @echo " + http://lists.freeswitch.org +" - @echo " + +" - @echo " + irc.freenode.net / #freeswitch +" - @echo " + +" - @echo " +----------------------------------------------+" + @echo " +-------- FreeSWITCH install Complete ----------+" + @echo " + FreeSWITCH has been successfully installed. +" + @echo " + +" + @echo " + Install sounds: +" + @echo " + (uhd-sounds includes hd-sounds, sounds) +" + @echo " + (hd-sounds includes sounds) +" + @echo " + ------------------------------------ +" + @echo " + $(MAKE) uhd-sounds-install +" + @echo " + $(MAKE) uhd-moh-install +" + @echo " + +" + @echo " + $(MAKE) hd-sounds-install +" + @echo " + $(MAKE) hd-moh-install +" + @echo " + +" + @echo " + $(MAKE) sounds-install +" + @echo " + $(MAKE) moh-install +" + @echo " + +" + @echo " + Upgrade to latest: +" + @echo " + ---------------------------------- +" + @echo " + $(MAKE) current +" + @echo " + +" + @echo " + Rebuild all: +" + @echo " + ---------------------------------- +" + @echo " + $(MAKE) sure +" + @echo " + +" + @echo " + Install/Re-install default config: +" + @echo " + ---------------------------------- +" + @echo " + $(MAKE) samples +" + @echo " + +" + @echo " + +" + @echo " + Additional resources: +" + @echo " + ---------------------------------- +" + @echo " + http://www.freeswitch.org +" + @echo " + http://wiki.freeswitch.org +" + @echo " + http://jira.freeswitch.org +" + @echo " + http://lists.freeswitch.org +" + @echo " + +" + @echo " + irc.freenode.net / #freeswitch +" + @echo " + +" + @echo " +-----------------------------------------------+" From gmaruzz at freeswitch.org Tue Dec 9 09:10:42 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 12:10:42 -0500 Subject: [Freeswitch-svn] [commit] r10682 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Tue Dec 9 12:10:41 2008 New Revision: 10682 Log: skypiax: no more crashes on unloading on linux Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Tue Dec 9 12:10:41 2008 @@ -29,8 +29,8 @@ int option_debug = 100; switch_endpoint_interface_t *skypiax_endpoint_interface; switch_memory_pool_t *skypiax_module_pool = NULL; -static int running = 1; -static skypiax_interface_t SKYPIAX_INTERFACES[SKYPIAX_MAX_INTERFACES]; +int running = 1; +skypiax_interface_t SKYPIAX_INTERFACES[SKYPIAX_MAX_INTERFACES]; switch_core_session_t *global_session = NULL; /*************************************************/ /*************************************************/ @@ -443,7 +443,7 @@ int skypiax_skype_call(struct skypiax_interface *p, char *idest, int timeout, switch_core_session_t * session) { - char rdest[80]; + char *rdest; char msg_to_skype[1024]; if (option_debug > 10) { @@ -451,10 +451,12 @@ } switch_sleep(5000); - //FIXME strncpy(rdest, idest, sizeof(rdest) - 1); - strncpy(rdest, "echo123", sizeof(rdest) - 1); + rdest = strchr(idest, '/'); + *rdest++ = '\0'; + if (option_debug) DEBUGA_SKYPE("Calling Skype, rdest is: %s\n", SKYPIAX_P_LOG, rdest); + NOTICA("Calling Skype, rdest is: %s\n", SKYPIAX_P_LOG, rdest); skypiax_skype_write(p, "SET AGC OFF"); switch_sleep(10000); skypiax_skype_write(p, "SET AEC OFF"); @@ -516,7 +518,7 @@ return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; } - skypiax_skype_call(tech_pvt->p, outbound_profile->destination_number, 30, + skypiax_skype_call(tech_pvt->p, caller_profile->destination_number, 30, *new_session); switch_channel_set_flag(channel, CF_OUTBOUND); @@ -546,25 +548,33 @@ (void *) p); while (forever) { + if(!running) + break; switch_sleep(1000); res = skypiax_skype_read(p); //if (res == CALLFLOW_INCOMING_HANGUP && p->interface_state != SKYPIAX_STATE_DOWN) - if (res == CALLFLOW_INCOMING_HANGUP) { - switch_core_session_t *session = NULL; - private_t *tech_pvt; - switch_channel_t *channel; - - DEBUGA_SKYPE("skype call ended\n", SKYPIAX_P_LOG); - - tech_pvt = p->tech_pvt; - session = tech_pvt->session; - - channel = switch_core_session_get_channel(session); - DEBUGA_SKYPE("before channel_on_hangup\n", SKYPIAX_P_LOG); - - switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); - DEBUGA_SKYPE("after channel_on_hangup\n", SKYPIAX_P_LOG); - } + if (res == CALLFLOW_INCOMING_HANGUP) { + switch_core_session_t *session = NULL; + private_t *tech_pvt = NULL; + switch_channel_t *channel = NULL; + + DEBUGA_SKYPE("skype call ended\n", SKYPIAX_P_LOG); + + tech_pvt = p->tech_pvt; + if(tech_pvt){ + session = tech_pvt->session; + + if(session){ + channel = switch_core_session_get_channel(session); + DEBUGA_SKYPE("before channel_on_hangup\n", SKYPIAX_P_LOG); + + if(channel) { + switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); + DEBUGA_SKYPE("after channel_on_hangup\n", SKYPIAX_P_LOG); + } + } + } + } } //if (option_debug > 10) { @@ -833,13 +843,13 @@ memset(&globals, '\0', sizeof(globals)); memset(SKYPIAX_INTERFACES, '\0', sizeof(SKYPIAX_INTERFACES)); -#ifndef WIN32 //FIXME +#ifndef WIN32 if (!XInitThreads()) { ERRORA("Not initialized XInitThreads!\n", SKYPIAX_P_LOG); } else { DEBUGA_SKYPE("Initialized XInitThreads!\n", SKYPIAX_P_LOG); } - switch_sleep(10000); //FIXME + switch_sleep(100); #endif /* _WINDOWS_ */ load_config(); @@ -865,16 +875,16 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypiax_shutdown) { - int x = 0; + int x = 100; + struct skypiax_interface *p = NULL; - running = -1; + running = 0; - while (running) { - if (x++ > 100) { - break; - } + while (x) { + x--; switch_yield(20000); } + NOTICA("EXITING FUNC!\n", SKYPIAX_P_LOG); return SWITCH_STATUS_SUCCESS; } Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Tue Dec 9 12:10:41 2008 @@ -4,6 +4,8 @@ extern int option_debug; extern switch_core_session_t *global_session; extern switch_endpoint_interface_t *skypiax_endpoint_interface; +extern int running; +extern skypiax_interface_t SKYPIAX_INTERFACES; #define SKYPE_AUDIO #ifdef SKYPE_AUDIO @@ -68,6 +70,8 @@ sin_size = sizeof(remote_addr); while ((fd = accept(s, (struct sockaddr *) &remote_addr, &sin_size)) > 0) { DEBUGA_SKYPE("ACCEPTED\n", SKYPIAX_P_LOG); + if(!running) + break; while (p->interface_state != SKYPIAX_STATE_DOWN && (p->skype_callflow == CALLFLOW_STATUS_INPROGRESS || p->skype_callflow == SKYPIAX_STATE_UP)) { @@ -81,6 +85,8 @@ fd_set fs; struct timeval to; + if(!running) + break; exit = 1; fdselect = fd; @@ -232,6 +238,8 @@ sin_size = sizeof(remote_addr); while ((fd = accept(s, (struct sockaddr *) &remote_addr, &sin_size)) > 0) { DEBUGA_SKYPE("ACCEPTED\n", SKYPIAX_P_LOG); + if(!running) + break; while (p->interface_state != SKYPIAX_STATE_DOWN && (p->skype_callflow == CALLFLOW_STATUS_INPROGRESS || p->skype_callflow == SKYPIAX_STATE_UP)) { @@ -244,6 +252,8 @@ fd_set fs; struct timeval to; + if(!running) + break; fdselect = 1; FD_ZERO(&fs); FD_SET(fdselect, &fs); @@ -567,6 +577,7 @@ switch_file_pipe_create_ex(&p->AsteriskHandlesAst.fdesc[0], &p->AsteriskHandlesAst.fdesc[1], 2, skypiax_module_pool); + switch_file_pipe_timeout_set(p->AsteriskHandlesAst.fdesc[0], 100000); win32_AsteriskHandlesSkype = &p->AsteriskHandlesAst; @@ -588,8 +599,12 @@ win32_hInit_MainWindowHandle; while (1) { MSG oMessage; + if(!running) + break; while (GetMessage(&oMessage, 0, 0, 0) != FALSE) { + if(!running) + break; TranslateMessage(&oMessage); DispatchMessage(&oMessage); } @@ -754,6 +769,7 @@ switch_file_pipe_create_ex(&p->AsteriskHandlesAst.fdesc[0], &p->AsteriskHandlesAst.fdesc[1], 2, skypiax_module_pool); + switch_file_pipe_timeout_set(p->AsteriskHandlesAst.fdesc[0], 100000); AsteriskHandlesAst = &p->AsteriskHandlesAst; //disp = XOpenDisplay(getenv("DISPLAY")); disp = XOpenDisplay(p->X11_display); @@ -819,6 +835,8 @@ while (1) { XNextEvent(disp, &an_event); + if(!running) + break; switch (an_event.type) { case ClientMessage: @@ -859,7 +877,7 @@ SKYPIAX_P_LOG); return NULL; } - //DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); return NULL; } From anthm at freeswitch.org Tue Dec 9 10:52:17 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 13:52:17 -0500 Subject: [Freeswitch-svn] [commit] r10683 - freeswitch/trunk/src Message-ID: Author: anthm Date: Tue Dec 9 13:52:16 2008 New Revision: 10683 Log: cleanup code from yesterday Modified: freeswitch/trunk/src/switch_ivr_originate.c Modified: freeswitch/trunk/src/switch_ivr_originate.c ============================================================================== --- freeswitch/trunk/src/switch_ivr_originate.c (original) +++ freeswitch/trunk/src/switch_ivr_originate.c Tue Dec 9 13:52:16 2008 @@ -356,7 +356,7 @@ int sval = atoi(var); if (sval) { - ringback_data = switch_core_session_sprintf(session, "ringback:%d", sval); + ringback_data = switch_core_session_sprintf(session, "silence:%d", sval); } } } @@ -386,9 +386,6 @@ if (ringback_data) { char *tmp_data = NULL; - switch_buffer_create_dynamic(&ringback.audio_buffer, 512, 1024, 0); - switch_buffer_set_loops(ringback.audio_buffer, -1); - if (switch_is_file_path(ringback_data)) { char *ext; @@ -429,6 +426,9 @@ ringback.silence = 400; } } else { + switch_buffer_create_dynamic(&ringback.audio_buffer, 512, 1024, 0); + switch_buffer_set_loops(ringback.audio_buffer, -1); + teletone_init_session(&ringback.ts, 0, teletone_handler, &ringback); ringback.ts.rate = read_codec->implementation->actual_samples_per_second; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Play Ringback Tone [%s]\n", ringback_data); @@ -800,7 +800,7 @@ int sval = atoi(vvar); if (sval) { - ringback_data = switch_core_session_sprintf(session, "ringback:%d", sval); + ringback_data = switch_core_session_sprintf(session, "silence:%d", sval); } } @@ -1296,9 +1296,7 @@ if (ringback_data) { char *tmp_data = NULL; - switch_buffer_create_dynamic(&ringback.audio_buffer, 512, 1024, 0); - switch_buffer_set_loops(ringback.audio_buffer, -1); - + if (switch_is_file_path(ringback_data)) { char *ext; @@ -1339,6 +1337,9 @@ ringback.silence = 400; } } else { + switch_buffer_create_dynamic(&ringback.audio_buffer, 512, 1024, 0); + switch_buffer_set_loops(ringback.audio_buffer, -1); + teletone_init_session(&ringback.ts, 0, teletone_handler, &ringback); ringback.ts.rate = read_codec->implementation->actual_samples_per_second; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Play Ringback Tone [%s]\n", ringback_data); @@ -1436,6 +1437,7 @@ || (switch_channel_test_flag(caller_channel, CF_ANSWERED) || switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA)))) { switch_status_t tstatus = SWITCH_STATUS_SUCCESS; + int silence = 0; if (switch_channel_media_ready(caller_channel)) { tstatus = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0); @@ -1482,17 +1484,23 @@ break; } } else if (ringback.silence) { - write_frame.datalen = write_frame.codec->implementation->decoded_bytes_per_packet; - switch_generate_sln_silence((int16_t *) write_frame.data, write_frame.datalen / 2, ringback.silence); + silence = ringback.silence; } - - if ((ringback.fh || ringback.silence || ringback.audio_buffer) && write_frame.codec && write_frame.datalen) { - if (switch_core_session_write_frame(session, &write_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) { - break; - } + } else { + silence = 400; + } + + if (silence) { + write_frame.datalen = write_frame.codec->implementation->decoded_bytes_per_packet; + switch_generate_sln_silence((int16_t *) write_frame.data, write_frame.datalen / 2, silence); + } + + if ((ringback.fh || silence || ringback.audio_buffer) && write_frame.codec && write_frame.datalen) { + if (switch_core_session_write_frame(session, &write_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) { + break; } } - + } else { switch_yield(100000); } From gmaruzz at freeswitch.org Tue Dec 9 11:41:22 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 14:41:22 -0500 Subject: [Freeswitch-svn] [commit] r10684 - in freeswitch/branches/gmaruzz/src: . include mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Tue Dec 9 14:41:22 2008 New Revision: 10684 Log: switch_apr.c: added switch_thread_exit skypiax: less trying to unload without crashes on windows, not yet there Modified: freeswitch/branches/gmaruzz/src/include/switch_apr.h freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c freeswitch/branches/gmaruzz/src/switch_apr.c Modified: freeswitch/branches/gmaruzz/src/include/switch_apr.h ============================================================================== --- freeswitch/branches/gmaruzz/src/include/switch_apr.h (original) +++ freeswitch/branches/gmaruzz/src/include/switch_apr.h Tue Dec 9 14:41:22 2008 @@ -1321,6 +1321,13 @@ SWITCH_DECLARE(switch_status_t) switch_file_pipe_timeout_set(switch_file_t *thepipe, switch_interval_time_t timeout); +/** + * stop the current thread + * @param thd The thread to stop + * @param retval The return value to pass back to any thread that cares + */ +SWITCH_DECLARE(switch_status_t) switch_thread_exit(switch_thread_t *thd, switch_status_t retval); + /** @} */ Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Tue Dec 9 14:41:22 2008 @@ -32,6 +32,9 @@ int running = 1; skypiax_interface_t SKYPIAX_INTERFACES[SKYPIAX_MAX_INTERFACES]; switch_core_session_t *global_session = NULL; +#ifdef WIN32 +HANDLE win32_hGlobal_ThreadShutdownEvent; +#endif /* WIN32 */ /*************************************************/ /*************************************************/ /*************************************************/ @@ -875,11 +878,15 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypiax_shutdown) { - int x = 100; + int x = 1000; struct skypiax_interface *p = NULL; running = 0; +#ifdef WIN32 + SetEvent(win32_hGlobal_ThreadShutdownEvent); +#endif + while (x) { x--; switch_yield(20000); Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Tue Dec 9 14:41:22 2008 @@ -6,6 +6,9 @@ extern switch_endpoint_interface_t *skypiax_endpoint_interface; extern int running; extern skypiax_interface_t SKYPIAX_INTERFACES; +#ifdef WIN32 +extern HANDLE win32_hGlobal_ThreadShutdownEvent; +#endif /* WIN32 */ #define SKYPE_AUDIO #ifdef SKYPE_AUDIO @@ -379,7 +382,6 @@ HWND win32_hInit_MainWindowHandle; HINSTANCE win32_hInit_ProcessHandle; char win32_acInit_WindowClassName[128]; -HANDLE win32_hGlobal_ThreadShutdownEvent; UINT win32_uiGlobal_MsgID_SkypeControlAPIAttach; UINT win32_uiGlobal_MsgID_SkypeControlAPIDiscover; HWND win32_hGlobal_SkypeAPIWindowHandle = NULL; @@ -573,6 +575,7 @@ /* destroy window class */ struct skypiax_interface *p; + DWORD MsgWaitResult; p = obj; switch_file_pipe_create_ex(&p->AsteriskHandlesAst.fdesc[0], @@ -590,25 +593,35 @@ && win32_uiGlobal_MsgID_SkypeControlAPIDiscover != 0) { if (win32_Initialize_CreateWindowClass()) { if (win32_Initialize_CreateMainWindow()) { - win32_hGlobal_ThreadShutdownEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + //win32_hGlobal_ThreadShutdownEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + win32_hGlobal_ThreadShutdownEvent = CreateEvent(NULL, FALSE, FALSE, NULL); if (win32_hGlobal_ThreadShutdownEvent != NULL) { if (SendMessage (HWND_BROADCAST, win32_uiGlobal_MsgID_SkypeControlAPIDiscover, (WPARAM) win32_hInit_MainWindowHandle, 0) != 0) { win32_AsteriskHandlesSkype->win32_hInit_MainWindowHandle = win32_hInit_MainWindowHandle; - while (1) { - MSG oMessage; - if(!running) - break; - - while (GetMessage(&oMessage, 0, 0, 0) != FALSE) { - if(!running) - break; - TranslateMessage(&oMessage); - DispatchMessage(&oMessage); - } - } + while (1) { + MSG oMessage; + const HANDLE *MsgWaitHandles[1]; + + MsgWaitHandles[0] = &win32_hGlobal_ThreadShutdownEvent; + if(!running) + break; + while (MsgWaitResult = MsgWaitForMultipleObjects(1,MsgWaitHandles, FALSE, 300,QS_ALLPOSTMESSAGE)){ + if(!running) + break; + if (MsgWaitResult == WAIT_TIMEOUT) { + continue; + } + + GetMessage(&oMessage, 0, 0, 0); + if(!running) + break; + TranslateMessage(&oMessage); + DispatchMessage(&oMessage); + } + } } CloseHandle(win32_hGlobal_ThreadShutdownEvent); } @@ -617,6 +630,10 @@ win32_DeInitialize_DestroyWindowClass(); } } + + + switch_thread_exit(thread, SWITCH_STATUS_SUCCESS); + return NULL; } Modified: freeswitch/branches/gmaruzz/src/switch_apr.c ============================================================================== --- freeswitch/branches/gmaruzz/src/switch_apr.c (original) +++ freeswitch/branches/gmaruzz/src/switch_apr.c Tue Dec 9 14:41:22 2008 @@ -970,6 +970,17 @@ } +/** + * stop the current thread + * @param thd The thread to stop + * @param retval The return value to pass back to any thread that cares + */ +SWITCH_DECLARE(switch_status_t) switch_thread_exit(switch_thread_t *thd, switch_status_t retval) +{ + return apr_thread_exit((apr_thread_t *)thd, retval); +} + + /* For Emacs: * Local Variables: * mode:c From intralanman at freeswitch.org Tue Dec 9 12:25:14 2008 From: intralanman at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 15:25:14 -0500 Subject: [Freeswitch-svn] [commit] r10685 - freeswitch/trunk/scripts/contrib/intralanman/C/lcr/sql Message-ID: Author: intralanman Date: Tue Dec 9 15:25:14 2008 New Revision: 10685 Log: what are you semi-colons doing here? Modified: freeswitch/trunk/scripts/contrib/intralanman/C/lcr/sql/mysql-5.0.sql Modified: freeswitch/trunk/scripts/contrib/intralanman/C/lcr/sql/mysql-5.0.sql ============================================================================== --- freeswitch/trunk/scripts/contrib/intralanman/C/lcr/sql/mysql-5.0.sql (original) +++ freeswitch/trunk/scripts/contrib/intralanman/C/lcr/sql/mysql-5.0.sql Tue Dec 9 15:25:14 2008 @@ -34,7 +34,7 @@ `date_end` datetime NOT NULL DEFAULT '2030-12-31', `quality` float(10,6) NOT NULL, `reliability` float(10,6) NOT NULL, - `enabled` boolean NOT NULL DEFAULT '1'; + `enabled` boolean NOT NULL DEFAULT '1', PRIMARY KEY (`id`), KEY `carrier_id` (`carrier_id`), KEY `digits` (`digits`), @@ -52,7 +52,7 @@ CREATE TABLE `carriers` ( `id` int(11) NOT NULL auto_increment, `carrier_name` varchar(255) default NULL, - `enabled` boolean NOT NULL DEFAULT '1'; + `enabled` boolean NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1; @@ -66,7 +66,7 @@ `carrier_id` int(11) default NULL, `prefix` varchar(255) NOT NULL, `suffix` varchar(255) NOT NULL, - `enabled` boolean NOT NULL DEFAULT '1'; + `enabled` boolean NOT NULL DEFAULT '1', PRIMARY KEY (`id`), KEY `carrier_id` (`carrier_id`) ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1; From anthm at freeswitch.org Tue Dec 9 12:28:13 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 15:28:13 -0500 Subject: [Freeswitch-svn] [commit] r10686 - freeswitch/trunk/src Message-ID: Author: anthm Date: Tue Dec 9 15:28:12 2008 New Revision: 10686 Log: tweak Modified: freeswitch/trunk/src/switch_ivr_originate.c freeswitch/trunk/src/switch_rtp.c Modified: freeswitch/trunk/src/switch_ivr_originate.c ============================================================================== --- freeswitch/trunk/src/switch_ivr_originate.c (original) +++ freeswitch/trunk/src/switch_ivr_originate.c Tue Dec 9 15:28:12 2008 @@ -1490,12 +1490,12 @@ silence = 400; } - if (silence) { - write_frame.datalen = write_frame.codec->implementation->decoded_bytes_per_packet; - switch_generate_sln_silence((int16_t *) write_frame.data, write_frame.datalen / 2, silence); - } - if ((ringback.fh || silence || ringback.audio_buffer) && write_frame.codec && write_frame.datalen) { + if (silence) { + write_frame.datalen = write_frame.codec->implementation->decoded_bytes_per_packet; + switch_generate_sln_silence((int16_t *) write_frame.data, write_frame.datalen / 2, silence); + } + if (switch_core_session_write_frame(session, &write_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) { break; } @@ -1704,11 +1704,11 @@ } if (session) { - switch_core_session_reset(session, SWITCH_FALSE); + //switch_core_session_reset(session, SWITCH_FALSE); } if (write_codec.implementation) { - switch_core_codec_destroy(&write_codec); + //switch_core_codec_destroy(&write_codec); } for (i = 0; i < and_argc; i++) { Modified: freeswitch/trunk/src/switch_rtp.c ============================================================================== --- freeswitch/trunk/src/switch_rtp.c (original) +++ freeswitch/trunk/src/switch_rtp.c Tue Dec 9 15:28:12 2008 @@ -1906,7 +1906,7 @@ rtp_session->cn = 0; m++; } - + send_msg->header.m = m ? 1 : 0; memcpy(send_msg->body, data, datalen); From anthm at freeswitch.org Tue Dec 9 12:46:27 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 15:46:27 -0500 Subject: [Freeswitch-svn] [commit] r10687 - freeswitch/trunk/src Message-ID: Author: anthm Date: Tue Dec 9 15:46:26 2008 New Revision: 10687 Log: tweak Modified: freeswitch/trunk/src/switch_ivr_originate.c Modified: freeswitch/trunk/src/switch_ivr_originate.c ============================================================================== --- freeswitch/trunk/src/switch_ivr_originate.c (original) +++ freeswitch/trunk/src/switch_ivr_originate.c Tue Dec 9 15:46:26 2008 @@ -1704,11 +1704,11 @@ } if (session) { - //switch_core_session_reset(session, SWITCH_FALSE); + switch_core_session_reset(session, SWITCH_FALSE); } if (write_codec.implementation) { - //switch_core_codec_destroy(&write_codec); + switch_core_codec_destroy(&write_codec); } for (i = 0; i < and_argc; i++) { From mikej at freeswitch.org Tue Dec 9 13:33:57 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 16:33:57 -0500 Subject: [Freeswitch-svn] [commit] r10688 - freeswitch/trunk/src/mod/applications/mod_limit Message-ID: Author: mikej Date: Tue Dec 9 16:33:57 2008 New Revision: 10688 Log: initial merge of mod_limit hash based rework from scripts/contrib/mrene Modified: freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c Modified: freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c (original) +++ freeswitch/trunk/src/mod/applications/mod_limit/mod_limit.c Tue Dec 9 16:33:57 2008 @@ -25,7 +25,8 @@ * * Anthony Minessale II * Ken Rice + * * mod_limit.c -- Resource Limit Module * */ @@ -44,6 +45,10 @@ char *dbname; char *odbc_dsn; switch_mutex_t *mutex; + switch_mutex_t *limit_hash_mutex; + switch_hash_t *limit_hash; + switch_mutex_t *db_hash_mutex; + switch_hash_t *db_hash; #ifdef SWITCH_HAVE_ODBC switch_odbc_handle_t *master_odbc; #else @@ -51,6 +56,14 @@ #endif } globals; +struct limit_hash_item { + uint32_t total_usage; + uint32_t rate_usage; + time_t last_check; +}; +typedef struct limit_hash_item limit_hash_item_t; + + static char limit_sql[] = "CREATE TABLE limit_data (\n" " hostname VARCHAR(255),\n" " realm VARCHAR(255),\n" " id VARCHAR(255),\n" " uuid VARCHAR(255)\n" ");\n"; @@ -247,23 +260,53 @@ return status; } -static switch_status_t hanguphook(switch_core_session_t *session) +static switch_status_t db_state_handler(switch_core_session_t *session) { switch_channel_t *channel = switch_core_session_get_channel(session); switch_channel_state_t state = switch_channel_get_state(channel); - const char *realm = NULL; - const char *id = NULL; char *sql = NULL; if (state == CS_HANGUP || state == CS_ROUTING) { - id = switch_channel_get_variable(channel, "limit_id"); - realm = switch_channel_get_variable(channel, "limit_realm"); - sql = switch_mprintf("delete from limit_data where uuid='%q'", + sql = switch_mprintf("delete from limit_data where uuid='%q';", switch_core_session_get_uuid(session)); limit_execute_sql(sql, globals.mutex); switch_safe_free(sql); - switch_core_event_hook_remove_state_change(session, hanguphook); + switch_core_event_hook_remove_state_change(session, db_state_handler); + } + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t hash_state_handler(switch_core_session_t *session) +{ + switch_channel_t *channel = switch_core_session_get_channel(session); + switch_channel_state_t state = switch_channel_get_state(channel); + switch_hash_t *channel_hash = switch_channel_get_private(channel, "limit_hash"); + + /* The call is either hung up, or is going back into the dialplan, decrement appropriate couters */ + if (state == CS_HANGUP || state == CS_ROUTING) { + switch_hash_index_t *hi; + switch_mutex_lock(globals.mutex); + + /* Loop through the channel's hashtable which contains mapping to all the limit_hash_item_t referenced by that channel */ + for(hi = switch_hash_first(NULL, channel_hash); hi; hi = switch_hash_next(hi)) + { + void *val = NULL; + const void *key; + switch_ssize_t keylen; + limit_hash_item_t *item = NULL; + + switch_hash_this(hi, &key, &keylen, &val); + + item = (limit_hash_item_t*)val; + + /* We keep the structure even though the count is 0 so we do not allocate too often */ + item->total_usage--; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Usage for %s is now %d\n", (const char*)key, item->total_usage); + } + switch_core_event_hook_remove_state_change(session, hash_state_handler); + switch_mutex_unlock(globals.mutex); } + return SWITCH_STATUS_SUCCESS; } @@ -303,6 +346,7 @@ if (!switch_strlen_zero(cmd)) { mydata = strdup(cmd); + switch_assert(mydata); argc = switch_separate_string(mydata, '/', argv, (sizeof(argv) / sizeof(argv[0]))); } @@ -376,10 +420,15 @@ } if (argc < 3 || !argv[0]) { - goto error; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "USAGE: db %s\n", DB_USAGE); + return; } if (!strcasecmp(argv[0], "insert")) { + if (argc < 4) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "USAGE: db %s\n", DB_USAGE); + return; + } sql = switch_mprintf("delete from db_data where realm='%q' and data_key='%q'", argv[1], argv[2]); switch_assert(sql); limit_execute_sql(sql, globals.mutex); @@ -395,10 +444,109 @@ switch_assert(sql); limit_execute_sql(sql, globals.mutex); switch_safe_free(sql); - return; +} - error: - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "USAGE: db %s\n", DB_USAGE); +#define HASH_USAGE "[insert|delete]///" +#define HASH_DESC "save data" + +SWITCH_STANDARD_APP(hash_function) +{ + int argc = 0; + char *argv[4] = { 0 }; + char *mydata = NULL; + char *hash_key = NULL; + char *value = NULL; + + if (!switch_strlen_zero(data)) { + mydata = strdup(data); + switch_assert(mydata); + argc = switch_separate_string(mydata, '/', argv, (sizeof(argv) / sizeof(argv[0]))); + } + + if (argc < 3 || !argv[0]) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "USAGE: hash %s\n", HASH_USAGE); + goto end; + } + + hash_key = switch_mprintf("%s_%s", argv[1], argv[2]); + + switch_mutex_lock(globals.db_hash_mutex); + if (!strcasecmp(argv[0], "insert")) { + if ((value = switch_core_hash_find(globals.db_hash, hash_key))) { + free(value); + switch_core_hash_delete(globals.db_hash, hash_key); + } + value = strdup(argv[3]); + switch_assert(value); + switch_core_hash_insert(globals.db_hash, hash_key, value); + } else if (!strcasecmp(argv[0], "delete")) { + if ((value = switch_core_hash_find(globals.db_hash, hash_key))) { + switch_safe_free(value); + switch_core_hash_delete(globals.db_hash, hash_key); + } + } + switch_mutex_unlock(globals.db_hash_mutex); + +end: + switch_safe_free(mydata); + switch_safe_free(hash_key); +} + +#define HASH_API_USAGE "insert|select|delete/realm/key[/value]" +SWITCH_STANDARD_API(hash_api_function) +{ + int argc = 0; + char *argv[4] = { 0 }; + char *mydata = NULL; + char *value = NULL; + char *hash_key = NULL; + + switch_mutex_lock(globals.db_hash_mutex); + + if (!switch_strlen_zero(cmd)) { + mydata = strdup(cmd); + switch_assert(mydata); + argc = switch_separate_string(mydata, '/', argv, (sizeof(argv) / sizeof(argv[0]))); + } + + if (argc < 3 || !argv[0]) { + stream->write_function(stream, "-ERR Usage: hash %s\n", HASH_API_USAGE); + goto end; + } + + hash_key = switch_mprintf("%s_%s", argv[1], argv[2]); + + if (!strcasecmp(argv[0], "insert")) { + if (argc < 4) { + stream->write_function(stream, "-ERR Usage: hash %s\n", HASH_API_USAGE); + goto end; + } + if ((value = switch_core_hash_find(globals.db_hash, hash_key))) { + switch_safe_free(value); + switch_core_hash_delete(globals.db_hash, hash_key); + } + value = strdup(argv[3]); + switch_assert(value); + switch_core_hash_insert(globals.db_hash, hash_key, value); + stream->write_function(stream, "+OK\n"); + } else if (!strcasecmp(argv[0], "delete")) { + if ((value = switch_core_hash_find(globals.db_hash, hash_key))) { + switch_safe_free(value); + switch_core_hash_delete(globals.db_hash, hash_key); + } + stream->write_function(stream, "+OK\n"); + } else if (!strcasecmp(argv[0], "select")) { + if ((value = switch_core_hash_find(globals.db_hash, hash_key))) { + stream->write_function(stream, "%s", value); + } + } + +end: + switch_mutex_unlock(globals.db_hash_mutex); + switch_safe_free(mydata); + switch_safe_free(hash_key); + + return SWITCH_STATUS_SUCCESS; } SWITCH_STANDARD_API(group_api_function) @@ -513,8 +661,8 @@ } } -#define LIMIT_USAGE " [transfer_destination_number]" -#define LIMIT_DESC "limit access to an extension" +#define LIMIT_USAGE " [number [dialplan [context]]]" +#define LIMIT_DESC "limit access to a resource and transfer to an extension if the limit is exceeded" static char *limit_def_xfer_exten = "limit_exceeded"; SWITCH_STANDARD_APP(limit_function) @@ -530,6 +678,7 @@ char buf[80] = ""; callback_t cbt = { 0 }; switch_channel_t *channel = switch_core_session_get_channel(session); + switch_bool_t new_channel = SWITCH_FALSE; if (!switch_strlen_zero(data)) { mydata = switch_core_session_strdup(session, data); @@ -556,7 +705,8 @@ if (max < 0) { max = 0; } - + + new_channel = !switch_channel_get_variable(channel, "limit_realm"); switch_channel_set_variable(channel, "limit_realm", realm); switch_channel_set_variable(channel, "limit_id", id); switch_channel_set_variable(channel, "limit_max", argv[2]); @@ -572,7 +722,9 @@ goto done; } - switch_core_event_hook_add_state_change(session, hanguphook); + if (new_channel) { + switch_core_event_hook_add_state_change(session, db_state_handler); + } sql = switch_mprintf("insert into limit_data (hostname, realm, id, uuid) values('%q','%q','%q','%q');", globals.hostname, realm, id, switch_core_session_get_uuid(session)); @@ -583,6 +735,166 @@ switch_mutex_unlock(globals.mutex); } +#define LIMITHASH_USAGE " [/interval] [number [dialplan [context]]]" +#define LIMITHASH_DESC "limit access to a resource and transfer to an extension if the limit is exceeded" +SWITCH_STANDARD_APP(limit_hash_function) +{ + int argc = 0; + char *argv[6] = { 0 }; + char *mydata = NULL; + char *realm = NULL; + char *id = NULL; + char *hashkey = NULL; + char *xfer_exten = NULL; + int max = 0; + int interval = 0; + char *szinterval = NULL; + limit_hash_item_t *item = NULL; + switch_channel_t *channel = switch_core_session_get_channel(session); + time_t now = switch_timestamp(NULL); + switch_hash_t *channel_hash = NULL; + uint8_t increment = 1; + uint8_t new_channel = 0; + + /* Parse application data */ + if (!switch_strlen_zero(data)) { + mydata = switch_core_session_strdup(session, data); + argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); + } + + if (argc < 3) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "USAGE: limit_hash %s\n", LIMITHASH_USAGE); + return; + } + + realm = argv[0]; + id = argv[1]; + if ((szinterval = strchr(argv[2], '/'))) + { + *szinterval++ = '\0'; + interval = atoi(szinterval); + } + + max = atoi(argv[2]); + + if (argc >= 4) { + xfer_exten = argv[3]; + } else { + xfer_exten = limit_def_xfer_exten; + } + + if (max < 0) { + max = 0; + } + + hashkey = switch_core_session_sprintf(session, "%s_%s", realm, id); + + switch_mutex_lock(globals.limit_hash_mutex); + /* Check if that realm+id has ever been checked */ + if (!(item = (limit_hash_item_t*)switch_core_hash_find(globals.limit_hash, hashkey))) { + /* No, create an empty structure and add it, then continue like as if it existed */ + item = (limit_hash_item_t*)switch_core_alloc(globals.pool, sizeof(limit_hash_item_t)); + memset(item, 0, sizeof(limit_hash_item_t)); + switch_core_hash_insert(globals.limit_hash, hashkey, item); + } + + /* Did we already run on this channel before? */ + if ((channel_hash = switch_channel_get_private(channel, "limit_hash"))) + { + /* Yes, but check if we did that realm+id */ + if (!switch_core_hash_find(channel_hash, hashkey)) { + /* No, add it to our table so the state handler can take care of it */ + switch_core_hash_insert(channel_hash, hashkey, item); + } else { + /* Yes, dont touch total counter */ + increment = 0; + } + } else { + /* This is the first limit check on this channel, create a hashtable, set our prviate data and add a state handler */ + new_channel = 1; + } + + if (interval > 0) { + if (item->last_check <= (now - interval)) { + item->rate_usage = 1; + item->last_check = now; + } else { + /* Always increment rate when its checked as it doesnt depend on the channel */ + item->rate_usage++; + + if (item->rate_usage > (uint32_t)max) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Usage for %s exceeds maximum rate of %d/%ds, now at %d\n", hashkey, max, interval, item->rate_usage); + switch_ivr_session_transfer(session, xfer_exten, argv[4], argv[5]); + goto end; + } + } + } else if (item->total_usage + increment > (uint32_t)max) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Usage for %s is already at max value (%d)\n", hashkey, item->total_usage); + switch_ivr_session_transfer(session, xfer_exten, argv[4], argv[5]); + goto end; + } + + if (increment) { + item->total_usage++; + + if (interval == 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Usage for %s is now %d/%d\n", hashkey, item->total_usage, max); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Usage for %s is now %d/%d for the last %d seconds\n", hashkey, item->rate_usage, max, interval); + } + } + + + if (new_channel) { + switch_core_hash_init(&channel_hash, switch_core_session_get_pool(session)); + switch_core_hash_insert(channel_hash, hashkey, item); + switch_channel_set_private(channel, "limit_hash", channel_hash); + switch_core_event_hook_add_state_change(session, hash_state_handler); + } + +end: + switch_mutex_unlock(globals.limit_hash_mutex); +} + +#define LIMIT_HASH_USAGE_USAGE " " +SWITCH_STANDARD_API(limit_hash_usage_function) +{ + int argc = 0; + char *argv[3] = { 0 }; + char *mydata = NULL; + char *hash_key = NULL; + limit_hash_item_t *item = NULL; + uint32_t count = 0; + + switch_mutex_lock(globals.limit_hash_mutex); + + if (!switch_strlen_zero(cmd)) { + mydata = strdup(cmd); + switch_assert(mydata); + argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); + } + + if (argc < 2) { + stream->write_function(stream, "USAGE: limit_hash_usage %s\n", LIMIT_HASH_USAGE_USAGE); + goto end; + } + + hash_key = switch_mprintf("%s_%s", argv[0], argv[1]); + + if ((item = switch_core_hash_find(globals.limit_hash, hash_key))) { + count = item->total_usage; + } + + stream->write_function(stream, "%d", count); + +end: + switch_safe_free(mydata); + switch_safe_free(hash_key); + switch_mutex_unlock(globals.limit_hash_mutex); + + return SWITCH_STATUS_SUCCESS; +} + SWITCH_MODULE_LOAD_FUNCTION(mod_limit_load) { switch_status_t status; @@ -598,18 +910,29 @@ } switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, globals.pool); + switch_mutex_init(&globals.limit_hash_mutex, SWITCH_MUTEX_NESTED, globals.pool); + switch_mutex_init(&globals.db_hash_mutex, SWITCH_MUTEX_NESTED, globals.pool); + switch_core_hash_init(&globals.limit_hash, pool); + switch_core_hash_init(&globals.db_hash, pool); /* connect my internal structure to the blank pointer passed to me */ *module_interface = switch_loadable_module_create_module_interface(pool, modname); SWITCH_ADD_APP(app_interface, "limit", "Limit", LIMIT_DESC, limit_function, LIMIT_USAGE, SAF_SUPPORT_NOMEDIA); + SWITCH_ADD_APP(app_interface, "limit_hash", "Limit (hash)", LIMITHASH_DESC, limit_hash_function, LIMITHASH_USAGE, SAF_SUPPORT_NOMEDIA); SWITCH_ADD_APP(app_interface, "db", "Insert to the db", DB_DESC, db_function, DB_USAGE, SAF_SUPPORT_NOMEDIA); + SWITCH_ADD_APP(app_interface, "hash", "Insert into the hashtable", HASH_DESC, hash_function, HASH_USAGE, SAF_SUPPORT_NOMEDIA) SWITCH_ADD_APP(app_interface, "group", "Manage a group", GROUP_DESC, group_function, GROUP_USAGE, SAF_SUPPORT_NOMEDIA); + SWITCH_ADD_API(commands_api_interface, "limit_hash_usage", "Gets the usage count of a limited resource", limit_hash_usage_function, LIMIT_HASH_USAGE_USAGE); SWITCH_ADD_API(commands_api_interface, "db", "db get/set", db_api_function, "[insert|delete|select]///"); switch_console_set_complete("add db insert"); switch_console_set_complete("add db delete"); switch_console_set_complete("add db select"); + SWITCH_ADD_API(commands_api_interface, "hash", "hash get/set", hash_api_function, "[insert|delete|select]///"); + switch_console_set_complete("add hash insert"); + switch_console_set_complete("add hash delete"); + switch_console_set_complete("add hash select"); SWITCH_ADD_API(commands_api_interface, "group", "group [insert|delete|call]", group_api_function, "[insert|delete|call]::"); switch_console_set_complete("add group insert"); switch_console_set_complete("add group delete"); From mikej at freeswitch.org Tue Dec 9 14:37:01 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 17:37:01 -0500 Subject: [Freeswitch-svn] [commit] r10689 - freeswitch/trunk/src/mod/applications/mod_voicemail Message-ID: Author: mikej Date: Tue Dec 9 17:37:00 2008 New Revision: 10689 Log: MODAPP-178 Voicemail messages occasionally lost / stranded Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c (original) +++ freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c Tue Dec 9 17:37:00 2008 @@ -1103,7 +1103,7 @@ status = SWITCH_STATUS_SUCCESS; *cc.buf = '\0'; } else { - status = vm_macro_get(session, VM_RECORD_FILE_CHECK_MACRO, key_buf, input, sizeof(input), 1, "", &term, profile->digit_timeout); + (void)vm_macro_get(session, VM_RECORD_FILE_CHECK_MACRO, key_buf, input, sizeof(input), 1, "", &term, profile->digit_timeout); } if (!strcmp(input, profile->listen_file_key)) { @@ -1111,7 +1111,7 @@ } else if (!strcmp(input, profile->record_file_key)) { goto record_file; } else { - TRY_CODE(switch_ivr_phrase_macro(session, VM_ACK_MACRO, "saved", NULL, NULL)); + (void)switch_ivr_phrase_macro(session, VM_ACK_MACRO, "saved", NULL, NULL); goto end; } } @@ -2873,13 +2873,13 @@ switch_snprintf(key_buf, sizeof(key_buf), "%s:%s", profile->urgent_key, profile->terminator_key); - vm_macro_get(session, VM_RECORD_URGENT_CHECK_MACRO, key_buf, input, sizeof(input), 1, "", &term, profile->digit_timeout); + (void)vm_macro_get(session, VM_RECORD_URGENT_CHECK_MACRO, key_buf, input, sizeof(input), 1, "", &term, profile->digit_timeout); if (*profile->urgent_key == *input) { read_flags = URGENT_FLAG_STRING; priority = 1; - TRY_CODE(switch_ivr_phrase_macro(session, VM_ACK_MACRO, "marked-urgent", NULL, NULL)); + (void)switch_ivr_phrase_macro(session, VM_ACK_MACRO, "marked-urgent", NULL, NULL); } else { - TRY_CODE(switch_ivr_phrase_macro(session, VM_ACK_MACRO, "saved", NULL, NULL)); + (void)switch_ivr_phrase_macro(session, VM_ACK_MACRO, "saved", NULL, NULL); } } From anthm at freeswitch.org Tue Dec 9 15:31:12 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 18:31:12 -0500 Subject: [Freeswitch-svn] [commit] r10690 - freeswitch/trunk/src Message-ID: Author: anthm Date: Tue Dec 9 18:31:12 2008 New Revision: 10690 Log: suppress frame timestamp when raw write mode is set Modified: freeswitch/trunk/src/switch_rtp.c Modified: freeswitch/trunk/src/switch_rtp.c ============================================================================== --- freeswitch/trunk/src/switch_rtp.c (original) +++ freeswitch/trunk/src/switch_rtp.c Tue Dec 9 18:31:12 2008 @@ -2198,7 +2198,7 @@ } else { data = frame->data; len = frame->datalen; - ts = (uint32_t) frame->timestamp; + ts = switch_test_flag(rtp_session, SWITCH_RTP_FLAG_RAW_WRITE) ? (uint32_t) frame->timestamp : 0; } return rtp_common_write(rtp_session, send_msg, data, len, payload, ts, &frame->flags); From anthm at freeswitch.org Tue Dec 9 16:06:25 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 19:06:25 -0500 Subject: [Freeswitch-svn] [commit] r10691 - freeswitch/trunk/src Message-ID: Author: anthm Date: Tue Dec 9 19:06:25 2008 New Revision: 10691 Log: suppress frame timestamp when raw write mode is set (missed a spot) Modified: freeswitch/trunk/src/switch_ivr_originate.c Modified: freeswitch/trunk/src/switch_ivr_originate.c ============================================================================== --- freeswitch/trunk/src/switch_ivr_originate.c (original) +++ freeswitch/trunk/src/switch_ivr_originate.c Tue Dec 9 19:06:25 2008 @@ -351,7 +351,7 @@ if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE) || switch_channel_test_flag(caller_channel, CF_PROXY_MEDIA)) { ringback_data = NULL; - } else { + } else if (switch_strlen_zero(ringback_data)) { if ((var = switch_channel_get_variable(caller_channel, SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE))) { int sval = atoi(var); @@ -793,7 +793,7 @@ if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE) || switch_channel_test_flag(caller_channel, CF_PROXY_MEDIA)) { ringback_data = NULL; - } else { + } else if (switch_strlen_zero(ringback_data)) { const char *vvar; if ((vvar = switch_channel_get_variable(caller_channel, SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE))) { From brian at freeswitch.org Tue Dec 9 16:38:48 2008 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 19:38:48 -0500 Subject: [Freeswitch-svn] [commit] r10692 - freeswitch/trunk/support-d Message-ID: Author: brian Date: Tue Dec 9 19:38:47 2008 New Revision: 10692 Log: add more goodies Modified: freeswitch/trunk/support-d/.bashrc Modified: freeswitch/trunk/support-d/.bashrc ============================================================================== --- freeswitch/trunk/support-d/.bashrc (original) +++ freeswitch/trunk/support-d/.bashrc Tue Dec 9 19:38:47 2008 @@ -18,11 +18,12 @@ export PS1='\n\[\033[01;31m\]\u@\h\[\033[01;36m\] [\d \@] \[\033[01;33m\] \w\n\[\033[00m\]<\#>:' export PS2="\[\033[1m\]> \[\033[0m\]" export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig -alias icvs='cvs -d :ext:anthm at cvs.sourceforge.net:/cvsroot/iaxclient' -export CVS_RSH=ssh export VISUAL=emacs - umask 022 +alias e='emacs' +alias tcommit='svn commit --no-auth-cache --username=anthm' +alias mcommit='svn commit --no-auth-cache --username=mikej' +alias dp='emacs /usr/local/freeswitch/conf/dialplan/default.xml' # End of file From anthm at freeswitch.org Tue Dec 9 16:48:24 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 19:48:24 -0500 Subject: [Freeswitch-svn] [commit] r10693 - in freeswitch/trunk/src: . include mod/applications/mod_dptools mod/applications/mod_fax mod/applications/mod_fifo mod/applications/mod_voicemail mod/languages/mod_spidermonkey Message-ID: Author: anthm Date: Tue Dec 9 19:48:24 2008 New Revision: 10693 Log: add sync param to sleep so you can choose to sync audio or not on sleep (reswig to follow) Modified: freeswitch/trunk/src/include/switch_cpp.h freeswitch/trunk/src/include/switch_ivr.h freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c freeswitch/trunk/src/switch_cpp.cpp freeswitch/trunk/src/switch_ivr.c freeswitch/trunk/src/switch_ivr_menu.c freeswitch/trunk/src/switch_ivr_originate.c freeswitch/trunk/src/switch_ivr_play_say.c Modified: freeswitch/trunk/src/include/switch_cpp.h ============================================================================== --- freeswitch/trunk/src/include/switch_cpp.h (original) +++ freeswitch/trunk/src/include/switch_cpp.h Tue Dec 9 19:48:24 2008 @@ -313,7 +313,7 @@ * */ SWITCH_DECLARE(int) streamFile(char *file, int starting_sample_count = 0); - SWITCH_DECLARE(int) sleep(int ms); + SWITCH_DECLARE(int) sleep(int ms, int sync=0); /** \brief flush any pending events */ Modified: freeswitch/trunk/src/include/switch_ivr.h ============================================================================== --- freeswitch/trunk/src/include/switch_ivr.h (original) +++ freeswitch/trunk/src/include/switch_ivr.h Tue Dec 9 19:48:24 2008 @@ -110,7 +110,7 @@ \param args arguements to pass for callbacks etc \return SWITCH_STATUS_SUCCESS if the channel is still up */ -SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, uint32_t ms, switch_input_args_t *args); +SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, uint32_t ms, switch_bool_t sync, switch_input_args_t *args); SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session, switch_input_args_t *args); Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c (original) +++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c Tue Dec 9 19:48:24 2008 @@ -1307,7 +1307,7 @@ switch_channel_set_variable(channel, SWITCH_PLAYBACK_TERMINATOR_USED, "" ); - switch_ivr_sleep(session, ms, &args); + switch_ivr_sleep(session, ms, SWITCH_TRUE, &args); } } Modified: freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c (original) +++ freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c Tue Dec 9 19:48:24 2008 @@ -608,7 +608,7 @@ goto done; } - switch_ivr_sleep(session, 250, NULL); + switch_ivr_sleep(session, 250, SWITCH_TRUE, NULL); while (switch_channel_ready(channel)) { int tx = 0; Modified: freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c (original) +++ freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c Tue Dec 9 19:48:24 2008 @@ -1167,7 +1167,7 @@ if (announce) { switch_ivr_play_file(session, NULL, announce, NULL); } else { - switch_ivr_sleep(session, 500, NULL); + switch_ivr_sleep(session, 500, SWITCH_TRUE, NULL); } switch_channel_set_variable(other_channel, "fifo_serviced_by", my_id); Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c (original) +++ freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c Tue Dec 9 19:48:24 2008 @@ -1403,7 +1403,7 @@ forward_file_path = switch_core_session_sprintf(session, "%s%smsg_%s.wav", SWITCH_GLOBAL_dirs.temp_dir, SWITCH_PATH_SEPARATOR, uuid_str); TRY_CODE(create_file(session, profile, VM_RECORD_MESSAGE_MACRO, forward_file_path, &message_len, SWITCH_TRUE, NULL, NULL)); if ((new_path = vm_merge_file(session, profile, forward_file_path, cbt->file_path))) { - switch_ivr_sleep(session, 1500, NULL); + switch_ivr_sleep(session, 1500, SWITCH_TRUE, NULL); forward_file_path = new_path; } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error merging files\n"); @@ -1637,7 +1637,7 @@ *global_buf = '\0'; while (switch_channel_ready(channel)) { - switch_ivr_sleep(session, 100, NULL); + switch_ivr_sleep(session, 100, SWITCH_TRUE, NULL); switch (vm_check_state) { case VM_CHECK_START: Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c (original) +++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c Tue Dec 9 19:48:24 2008 @@ -1723,7 +1723,8 @@ switch_input_args_t args = { 0 }; int32 ms = 0; jsval ret = JS_TRUE; - + int sync; + METHOD_SANITY_CHECK(); channel = switch_core_session_get_channel(jss->session); CHANNEL_SANITY_CHECK(); @@ -1755,12 +1756,16 @@ } } + if (argc > 2) { + JS_ValueToInt32(cx, argv[2], &sync); + } + cb_state.ret = BOOLEAN_TO_JSVAL(JS_FALSE); cb_state.saveDepth = JS_SuspendRequest(cx); args.input_callback = dtmf_func; args.buf = bp; args.buflen = len; - switch_ivr_sleep(jss->session, ms, &args); + switch_ivr_sleep(jss->session, ms, sync, &args); JS_ResumeRequest(cx, cb_state.saveDepth); check_hangup_hook(jss, &ret); *rval = cb_state.ret; Modified: freeswitch/trunk/src/switch_cpp.cpp ============================================================================== --- freeswitch/trunk/src/switch_cpp.cpp (original) +++ freeswitch/trunk/src/switch_cpp.cpp Tue Dec 9 19:48:24 2008 @@ -833,7 +833,7 @@ } -SWITCH_DECLARE(int) CoreSession::sleep(int ms) { +SWITCH_DECLARE(int) CoreSession::sleep(int ms, int sync) { switch_status_t status; @@ -841,7 +841,7 @@ sanity_check(-1); begin_allow_threads(); - status = switch_ivr_sleep(session, ms, ap); + status = switch_ivr_sleep(session, ms, (switch_bool_t) sync, ap); end_allow_threads(); return status == SWITCH_STATUS_SUCCESS ? 1 : 0; Modified: freeswitch/trunk/src/switch_ivr.c ============================================================================== --- freeswitch/trunk/src/switch_ivr.c (original) +++ freeswitch/trunk/src/switch_ivr.c Tue Dec 9 19:48:24 2008 @@ -38,7 +38,7 @@ #include #include "stfu.h" -SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, uint32_t ms, switch_input_args_t *args) +SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, uint32_t ms, switch_bool_t sync, switch_input_args_t *args) { switch_channel_t *channel = switch_core_session_get_channel(session); switch_status_t status = SWITCH_STATUS_SUCCESS; @@ -80,6 +80,13 @@ write_frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE; write_frame.datalen = imp.decoded_bytes_per_packet; write_frame.samples = write_frame.datalen / sizeof(int16_t); + + if (!switch_channel_media_ready(channel)) { + if ((status = switch_channel_pre_answer(channel)) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot establish media.\n"); + return SWITCH_STATUS_FALSE; + } + } } cng_frame.data = data; @@ -87,7 +94,7 @@ cng_frame.buflen = 2; switch_set_flag((&cng_frame), SFF_CNG); - if (!switch_channel_test_flag(channel, CF_PROXY_MODE)) { + if (sync && !switch_channel_test_flag(channel, CF_PROXY_MODE)) { switch_channel_audio_sync(channel); } Modified: freeswitch/trunk/src/switch_ivr_menu.c ============================================================================== --- freeswitch/trunk/src/switch_ivr_menu.c (original) +++ freeswitch/trunk/src/switch_ivr_menu.c Tue Dec 9 19:48:24 2008 @@ -529,7 +529,7 @@ } errs++; if (status == SWITCH_STATUS_SUCCESS) { - status = switch_ivr_sleep(session, 1000, NULL); + status = switch_ivr_sleep(session, 1000, SWITCH_FALSE, NULL); } /* breaks are ok too */ if (SWITCH_STATUS_IS_BREAK(status)) { Modified: freeswitch/trunk/src/switch_ivr_originate.c ============================================================================== --- freeswitch/trunk/src/switch_ivr_originate.c (original) +++ freeswitch/trunk/src/switch_ivr_originate.c Tue Dec 9 19:48:24 2008 @@ -91,7 +91,7 @@ return NULL; } - switch_ivr_sleep(collect->session, 0, NULL); + switch_ivr_sleep(collect->session, 0, SWITCH_TRUE, NULL); if (!strcasecmp(collect->key, "exec")) { char *data; @@ -951,7 +951,7 @@ if (try > 0) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Originate attempt %d/%d in %d ms\n", try + 1, retries, sleep_ms); if (caller_channel) { - switch_ivr_sleep(session, sleep_ms, NULL); + switch_ivr_sleep(session, sleep_ms, SWITCH_TRUE, NULL); } else { switch_yield(sleep_ms * 1000); } @@ -1749,11 +1749,11 @@ } if (*bleg) { - switch_ivr_sleep(*bleg, 0, NULL); + switch_ivr_sleep(*bleg, 0, SWITCH_TRUE, NULL); } if (session) { - switch_ivr_sleep(session, 0, NULL); + switch_ivr_sleep(session, 0, SWITCH_TRUE, NULL); } if (var_event && var_event != ovars) { Modified: freeswitch/trunk/src/switch_ivr_play_say.c ============================================================================== --- freeswitch/trunk/src/switch_ivr_play_say.c (original) +++ freeswitch/trunk/src/switch_ivr_play_say.c Tue Dec 9 19:48:24 2008 @@ -327,7 +327,7 @@ } } - switch_ivr_sleep(session, pause, NULL); + switch_ivr_sleep(session, pause, SWITCH_FALSE, NULL); } } From brian at freeswitch.org Tue Dec 9 16:51:15 2008 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Tue, 09 Dec 2008 19:51:15 -0500 Subject: [Freeswitch-svn] [commit] r10694 - in freeswitch/trunk/src/mod/languages: mod_java mod_java/src/org/freeswitch/swig mod_lua mod_managed mod_managed/managed mod_perl mod_python Message-ID: Author: brian Date: Tue Dec 9 19:51:14 2008 New Revision: 10694 Log: reswig Modified: freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java freeswitch/trunk/src/mod/languages/mod_java/switch_swig_wrap.cpp freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp Modified: freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java (original) +++ freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java Tue Dec 9 19:51:14 2008 @@ -245,8 +245,12 @@ return freeswitchJNI.CoreSession_streamFile__SWIG_1(swigCPtr, this, file); } + public int sleep(int ms, int sync) { + return freeswitchJNI.CoreSession_sleep__SWIG_0(swigCPtr, this, ms, sync); + } + public int sleep(int ms) { - return freeswitchJNI.CoreSession_sleep(swigCPtr, this, ms); + return freeswitchJNI.CoreSession_sleep__SWIG_1(swigCPtr, this, ms); } public int flushEvents() { Modified: freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java (original) +++ freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java Tue Dec 9 19:51:14 2008 @@ -136,7 +136,8 @@ public final static native String CoreSession_playAndGetDigits(long jarg1, CoreSession jarg1_, int jarg2, int jarg3, int jarg4, int jarg5, String jarg6, String jarg7, String jarg8, String jarg9); public final static native int CoreSession_streamFile__SWIG_0(long jarg1, CoreSession jarg1_, String jarg2, int jarg3); public final static native int CoreSession_streamFile__SWIG_1(long jarg1, CoreSession jarg1_, String jarg2); - public final static native int CoreSession_sleep(long jarg1, CoreSession jarg1_, int jarg2); + public final static native int CoreSession_sleep__SWIG_0(long jarg1, CoreSession jarg1_, int jarg2, int jarg3); + public final static native int CoreSession_sleep__SWIG_1(long jarg1, CoreSession jarg1_, int jarg2); public final static native int CoreSession_flushEvents(long jarg1, CoreSession jarg1_); public final static native int CoreSession_flushDigits(long jarg1, CoreSession jarg1_); public final static native int CoreSession_setAutoHangup(long jarg1, CoreSession jarg1_, boolean jarg2); Modified: freeswitch/trunk/src/mod/languages/mod_java/switch_swig_wrap.cpp ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_java/switch_swig_wrap.cpp (original) +++ freeswitch/trunk/src/mod/languages/mod_java/switch_swig_wrap.cpp Tue Dec 9 19:51:14 2008 @@ -2674,7 +2674,26 @@ } -SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1sleep(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { +SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1sleep_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3) { + jint jresult = 0 ; + CoreSession *arg1 = (CoreSession *) 0 ; + int arg2 ; + int arg3 ; + int result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(CoreSession **)&jarg1; + arg2 = (int)jarg2; + arg3 = (int)jarg3; + result = (int)(arg1)->sleep(arg2,arg3); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1sleep_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { jint jresult = 0 ; CoreSession *arg1 = (CoreSession *) 0 ; int arg2 ; Modified: freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp (original) +++ freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp Tue Dec 9 19:51:14 2008 @@ -6077,7 +6077,38 @@ } -static int _wrap_CoreSession_sleep(lua_State* L) { +static int _wrap_CoreSession_sleep__SWIG_0(lua_State* L) { + int SWIG_arg = -1; + CoreSession *arg1 = (CoreSession *) 0 ; + int arg2 ; + int arg3 ; + int result; + + SWIG_check_num_args("sleep",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sleep",1,"CoreSession *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("sleep",2,"int"); + if(!lua_isnumber(L,3)) SWIG_fail_arg("sleep",3,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_sleep",1,SWIGTYPE_p_CoreSession); + } + + arg2 = (int)lua_tonumber(L, 2); + arg3 = (int)lua_tonumber(L, 3); + result = (int)(arg1)->sleep(arg2,arg3); + SWIG_arg=0; + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_CoreSession_sleep__SWIG_1(lua_State* L) { int SWIG_arg = -1; CoreSession *arg1 = (CoreSession *) 0 ; int arg2 ; @@ -6105,6 +6136,62 @@ } +static int _wrap_CoreSession_sleep(lua_State* L) { + int argc; + int argv[4]={ + 1,2,3,4 + }; + + argc = lua_gettop(L); + if (argc == 2) { + int _v; + { + void *ptr; + if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + { + _v = lua_isnumber(L,argv[1]); + } + if (_v) { + return _wrap_CoreSession_sleep__SWIG_1(L); + } + } + } + if (argc == 3) { + int _v; + { + void *ptr; + if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + { + _v = lua_isnumber(L,argv[1]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[2]); + } + if (_v) { + return _wrap_CoreSession_sleep__SWIG_0(L); + } + } + } + } + + lua_pushstring(L,"No matching function for overloaded 'CoreSession_sleep'"); + lua_error(L);return 0; +} + + static int _wrap_CoreSession_flushEvents(lua_State* L) { int SWIG_arg = -1; CoreSession *arg1 = (CoreSession *) 0 ; Modified: freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx (original) +++ freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx Tue Dec 9 19:51:14 2008 @@ -905,6 +905,17 @@ } +SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE_get() { + char * jresult ; + char *result = 0 ; + + result = (char *) "send_silence_when_idle"; + + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_CURRENT_APPLICATION_VARIABLE_get() { char * jresult ; char *result = 0 ; @@ -20008,17 +20019,19 @@ } -SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_sleep(void * jarg1, unsigned long jarg2, void * jarg3) { +SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_sleep(void * jarg1, unsigned long jarg2, int jarg3, void * jarg4) { int jresult ; switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; uint32_t arg2 ; - switch_input_args_t *arg3 = (switch_input_args_t *) 0 ; + switch_bool_t arg3 ; + switch_input_args_t *arg4 = (switch_input_args_t *) 0 ; switch_status_t result; arg1 = (switch_core_session_t *)jarg1; arg2 = (uint32_t)jarg2; - arg3 = (switch_input_args_t *)jarg3; - result = (switch_status_t)switch_ivr_sleep(arg1,arg2,arg3); + arg3 = (switch_bool_t)jarg3; + arg4 = (switch_input_args_t *)jarg4; + result = (switch_status_t)switch_ivr_sleep(arg1,arg2,arg3,arg4); jresult = result; return jresult; } @@ -26694,15 +26707,17 @@ } -SWIGEXPORT int SWIGSTDCALL CSharp_CoreSession_sleep(void * jarg1, int jarg2) { +SWIGEXPORT int SWIGSTDCALL CSharp_CoreSession_sleep(void * jarg1, int jarg2, int jarg3) { int jresult ; CoreSession *arg1 = (CoreSession *) 0 ; int arg2 ; + int arg3 = (int) 0 ; int result; arg1 = (CoreSession *)jarg1; arg2 = (int)jarg2; - result = (int)(arg1)->sleep(arg2); + arg3 = (int)jarg3; + result = (int)(arg1)->sleep(arg2,arg3); jresult = result; return jresult; } Modified: freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs (original) +++ freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs Tue Dec 9 19:51:14 2008 @@ -292,8 +292,8 @@ return ret; } - public int sleep(int ms) { - int ret = freeswitchPINVOKE.CoreSession_sleep(swigCPtr, ms); + public int sleep(int ms, int sync) { + int ret = freeswitchPINVOKE.CoreSession_sleep(swigCPtr, ms, sync); return ret; } @@ -2834,8 +2834,8 @@ return ret; } - public static switch_status_t switch_ivr_sleep(SWIGTYPE_p_switch_core_session session, uint ms, switch_input_args_t args) { - switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_sleep(SWIGTYPE_p_switch_core_session.getCPtr(session), ms, switch_input_args_t.getCPtr(args)); + public static switch_status_t switch_ivr_sleep(SWIGTYPE_p_switch_core_session session, uint ms, switch_bool_t sync, switch_input_args_t args) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_sleep(SWIGTYPE_p_switch_core_session.getCPtr(session), ms, (int)sync, switch_input_args_t.getCPtr(args)); return ret; } @@ -3953,6 +3953,7 @@ public static readonly int SWITCH_MAX_DTMF_DURATION = freeswitchPINVOKE.SWITCH_MAX_DTMF_DURATION_get(); public static readonly string SWITCH_PATH_SEPARATOR = freeswitchPINVOKE.SWITCH_PATH_SEPARATOR_get(); public static readonly string SWITCH_URL_SEPARATOR = freeswitchPINVOKE.SWITCH_URL_SEPARATOR_get(); + public static readonly string SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE = freeswitchPINVOKE.SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE_get(); public static readonly string SWITCH_CURRENT_APPLICATION_VARIABLE = freeswitchPINVOKE.SWITCH_CURRENT_APPLICATION_VARIABLE_get(); public static readonly string SWITCH_CURRENT_APPLICATION_DATA_VARIABLE = freeswitchPINVOKE.SWITCH_CURRENT_APPLICATION_DATA_VARIABLE_get(); public static readonly string SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE = freeswitchPINVOKE.SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE_get(); @@ -4423,6 +4424,9 @@ [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_URL_SEPARATOR_get")] public static extern string SWITCH_URL_SEPARATOR_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE_get")] + public static extern string SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_CURRENT_APPLICATION_VARIABLE_get")] public static extern string SWITCH_CURRENT_APPLICATION_VARIABLE_get(); @@ -8996,7 +9000,7 @@ public static extern int switch_ivr_parse_next_event(HandleRef jarg1); [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_sleep")] - public static extern int switch_ivr_sleep(HandleRef jarg1, uint jarg2, HandleRef jarg3); + public static extern int switch_ivr_sleep(HandleRef jarg1, uint jarg2, int jarg3, HandleRef jarg4); [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_park")] public static extern int switch_ivr_park(HandleRef jarg1, HandleRef jarg2); @@ -10499,7 +10503,7 @@ public static extern int CoreSession_StreamFile(HandleRef jarg1, string jarg2, int jarg3); [DllImport("mod_managed", EntryPoint="CSharp_CoreSession_sleep")] - public static extern int CoreSession_sleep(HandleRef jarg1, int jarg2); + public static extern int CoreSession_sleep(HandleRef jarg1, int jarg2, int jarg3); [DllImport("mod_managed", EntryPoint="CSharp_CoreSession_flushEvents")] public static extern int CoreSession_flushEvents(HandleRef jarg1); Modified: freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp (original) +++ freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp Tue Dec 9 19:51:14 2008 @@ -8146,7 +8146,55 @@ } -XS(_wrap_CoreSession_sleep) { +XS(_wrap_CoreSession_sleep__SWIG_0) { + { + CoreSession *arg1 = (CoreSession *) 0 ; + int arg2 ; + int arg3 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: CoreSession_sleep(self,ms,sync);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_sleep" "', argument " "1"" of type '" "CoreSession *""'"); + } + arg1 = reinterpret_cast< CoreSession * >(argp1); + ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoreSession_sleep" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoreSession_sleep" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + result = (int)(arg1)->sleep(arg2,arg3); + ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; + + + + XSRETURN(argvi); + fail: + + + + SWIG_croak_null(); + } +} + + +XS(_wrap_CoreSession_sleep__SWIG_1) { { CoreSession *arg1 = (CoreSession *) 0 ; int arg2 ; @@ -8184,6 +8232,98 @@ } +XS(_wrap_CoreSession_sleep) { + dXSARGS; + + { + unsigned long _index = 0; + SWIG_TypeRank _rank = 0; + if (items == 2) { + SWIG_TypeRank _ranki = 0; + SWIG_TypeRank _rankm = 0; + SWIG_TypeRank _pi = 1; + int _v = 0; + { + void *vptr = 0; + int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_CoreSession, 0); + _v = SWIG_CheckState(res); + } + if (!_v) goto check_1; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + { + { + int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL); + _v = SWIG_CheckState(res); + } + } + if (!_v) goto check_1; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + if (!_index || (_ranki < _rank)) { + _rank = _ranki; _index = 1; + if (_rank == _rankm) goto dispatch; + } + } + check_1: + + if (items == 3) { + SWIG_TypeRank _ranki = 0; + SWIG_TypeRank _rankm = 0; + SWIG_TypeRank _pi = 1; + int _v = 0; + { + void *vptr = 0; + int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_CoreSession, 0); + _v = SWIG_CheckState(res); + } + if (!_v) goto check_2; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + { + { + int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL); + _v = SWIG_CheckState(res); + } + } + if (!_v) goto check_2; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + { + { + int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), NULL); + _v = SWIG_CheckState(res); + } + } + if (!_v) goto check_2; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + if (!_index || (_ranki < _rank)) { + _rank = _ranki; _index = 2; + if (_rank == _rankm) goto dispatch; + } + } + check_2: + + dispatch: + switch(_index) { + case 1: + ++PL_markstack_ptr; SWIG_CALLXS(_wrap_CoreSession_sleep__SWIG_1); return; + case 2: + ++PL_markstack_ptr; SWIG_CALLXS(_wrap_CoreSession_sleep__SWIG_0); return; + } + } + + croak("No matching function for overloaded 'CoreSession_sleep'"); + XSRETURN(0); +} + + XS(_wrap_CoreSession_flushEvents) { { CoreSession *arg1 = (CoreSession *) 0 ; Modified: freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp (original) +++ freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp Tue Dec 9 19:51:14 2008 @@ -8018,7 +8018,47 @@ } -SWIGINTERN PyObject *_wrap_CoreSession_sleep(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_CoreSession_sleep__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + CoreSession *arg1 = (CoreSession *) 0 ; + int arg2 ; + int arg3 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_sleep",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_sleep" "', argument " "1"" of type '" "CoreSession *""'"); + } + arg1 = reinterpret_cast< CoreSession * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoreSession_sleep" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoreSession_sleep" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + result = (int)(arg1)->sleep(arg2,arg3); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CoreSession_sleep__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; CoreSession *arg1 = (CoreSession *) 0 ; int arg2 ; @@ -8049,6 +8089,62 @@ } +SWIGINTERN PyObject *_wrap_CoreSession_sleep(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = (int)PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CoreSession, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_CoreSession_sleep__SWIG_1(self, args); + } + } + } + if (argc == 3) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CoreSession, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_CoreSession_sleep__SWIG_0(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CoreSession_sleep'.\n" + " Possible C/C++ prototypes are:\n" + " sleep(CoreSession *,int,int)\n" + " sleep(CoreSession *,int)\n"); + return NULL; +} + + SWIGINTERN PyObject *_wrap_CoreSession_flushEvents(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; CoreSession *arg1 = (CoreSession *) 0 ; From gmaruzz at freeswitch.org Wed Dec 10 07:52:02 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Wed, 10 Dec 2008 10:52:02 -0500 Subject: [Freeswitch-svn] [commit] r10695 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Wed Dec 10 10:52:01 2008 New Revision: 10695 Log: skypiax: unload without crashes on windows, yay Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Wed Dec 10 10:52:01 2008 @@ -34,7 +34,10 @@ switch_core_session_t *global_session = NULL; #ifdef WIN32 HANDLE win32_hGlobal_ThreadShutdownEvent; +switch_thread_t *do_skype_thread_thread; +HWND win32_hInit_MainWindowHandle; #endif /* WIN32 */ +switch_thread_t *skypiax_do_controldev_thread_thread; /*************************************************/ /*************************************************/ /*************************************************/ @@ -744,9 +747,7 @@ } if (interface_id && interface_id < SKYPIAX_MAX_INTERFACES) { struct skypiax_interface newconf; - switch_thread_t *do_skype_thread_thread; switch_threadattr_t *do_skype_thd_attr = NULL; - switch_thread_t *skypiax_do_controldev_thread_thread; switch_threadattr_t *skypiax_do_controldev_thread_thd_attr = NULL; memset(&newconf, '\0', sizeof(newconf)); @@ -778,7 +779,7 @@ "STARTING interface_id=%d\n", interface_id); switch_threadattr_create(&do_skype_thd_attr, skypiax_module_pool); - switch_threadattr_detach_set(do_skype_thd_attr, 1); + //switch_threadattr_detach_set(do_skype_thd_attr, 1); switch_threadattr_stacksize_set(do_skype_thd_attr, SWITCH_THREAD_STACKSIZE); switch_thread_create(&do_skype_thread_thread, do_skype_thd_attr, do_skype_thread, &SKYPIAX_INTERFACES[interface_id], skypiax_module_pool); @@ -787,7 +788,7 @@ switch_threadattr_create(&skypiax_do_controldev_thread_thd_attr, skypiax_module_pool); - switch_threadattr_detach_set(skypiax_do_controldev_thread_thd_attr, 1); + //switch_threadattr_detach_set(skypiax_do_controldev_thread_thd_attr, 1); switch_threadattr_stacksize_set(skypiax_do_controldev_thread_thd_attr, SWITCH_THREAD_STACKSIZE); switch_thread_create(&skypiax_do_controldev_thread_thread, @@ -878,20 +879,28 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypiax_shutdown) { - int x = 1000; + int x = 100; struct skypiax_interface *p = NULL; + switch_status_t status; + unsigned int howmany=8; + + p = &SKYPIAX_INTERFACES[2]; running = 0; + switch_file_write(p->AsteriskHandlesAst.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die + #ifdef WIN32 - SetEvent(win32_hGlobal_ThreadShutdownEvent); + if (SendMessage (win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) { // let's the do_skype_thread die + ERRORA("WHY FALSE HERE? %d\n", SKYPIAX_P_LOG, GetLastError()); + } #endif - while (x) { x--; switch_yield(20000); } - NOTICA("EXITING FUNC!\n", SKYPIAX_P_LOG); + switch_thread_join(&status, do_skype_thread_thread); + switch_thread_join(&status, skypiax_do_controldev_thread_thread); return SWITCH_STATUS_SUCCESS; } Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Wed Dec 10 10:52:01 2008 @@ -7,7 +7,7 @@ extern int running; extern skypiax_interface_t SKYPIAX_INTERFACES; #ifdef WIN32 -extern HANDLE win32_hGlobal_ThreadShutdownEvent; +extern HWND win32_hInit_MainWindowHandle; #endif /* WIN32 */ #define SKYPE_AUDIO @@ -379,7 +379,6 @@ #ifdef WIN32 struct AsteriskHandles *win32_AsteriskHandlesSkype; -HWND win32_hInit_MainWindowHandle; HINSTANCE win32_hInit_ProcessHandle; char win32_acInit_WindowClassName[128]; UINT win32_uiGlobal_MsgID_SkypeControlAPIAttach; @@ -441,6 +440,7 @@ fIssueDefProc = 0; switch (uiMessage) { case WM_DESTROY: + NOTICA("got DESTROY\n", SKYPIAX_P_LOG); win32_hInit_MainWindowHandle = NULL; PostQuitMessage(0); break; @@ -593,9 +593,6 @@ && win32_uiGlobal_MsgID_SkypeControlAPIDiscover != 0) { if (win32_Initialize_CreateWindowClass()) { if (win32_Initialize_CreateMainWindow()) { - //win32_hGlobal_ThreadShutdownEvent = CreateEvent(NULL, TRUE, FALSE, NULL); - win32_hGlobal_ThreadShutdownEvent = CreateEvent(NULL, FALSE, FALSE, NULL); - if (win32_hGlobal_ThreadShutdownEvent != NULL) { if (SendMessage (HWND_BROADCAST, win32_uiGlobal_MsgID_SkypeControlAPIDiscover, (WPARAM) win32_hInit_MainWindowHandle, 0) != 0) { @@ -603,28 +600,15 @@ win32_hInit_MainWindowHandle; while (1) { MSG oMessage; - const HANDLE *MsgWaitHandles[1]; - - MsgWaitHandles[0] = &win32_hGlobal_ThreadShutdownEvent; if(!running) break; - while (MsgWaitResult = MsgWaitForMultipleObjects(1,MsgWaitHandles, FALSE, 300,QS_ALLPOSTMESSAGE)){ - if(!running) - break; - if (MsgWaitResult == WAIT_TIMEOUT) { - continue; - } - - GetMessage(&oMessage, 0, 0, 0); - if(!running) + while( GetMessage(&oMessage, 0, 0, 0) ){ break; TranslateMessage(&oMessage); DispatchMessage(&oMessage); } } } - CloseHandle(win32_hGlobal_ThreadShutdownEvent); - } win32_DeInitialize_DestroyMainWindow(); } win32_DeInitialize_DestroyWindowClass(); From gmaruzz at freeswitch.org Wed Dec 10 08:01:08 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Wed, 10 Dec 2008 11:01:08 -0500 Subject: [Freeswitch-svn] [commit] r10696 - in freeswitch/branches/gmaruzz: . src src/include Message-ID: Author: gmaruzz Date: Wed Dec 10 11:01:07 2008 New Revision: 10696 Log: switch_apr.c: added switch_thread_join Modified: freeswitch/branches/gmaruzz/Freeswitch.2008.sln freeswitch/branches/gmaruzz/src/include/switch_apr.h freeswitch/branches/gmaruzz/src/switch_apr.c Modified: freeswitch/branches/gmaruzz/Freeswitch.2008.sln ============================================================================== --- freeswitch/branches/gmaruzz/Freeswitch.2008.sln (original) +++ freeswitch/branches/gmaruzz/Freeswitch.2008.sln Wed Dec 10 11:01:07 2008 @@ -1,6 +1,6 @@ ? Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 +# Visual C++ Express 2008 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Codecs", "Codecs", "{F881ADA2-2F1A-4046-9FEB-191D9422D781}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Endpoints", "Endpoints", "{9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}" @@ -160,28 +160,28 @@ conf\lang\de\vm\tts.xml = conf\lang\de\vm\tts.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{765EF1B9-5027-4820-BC37-A44466A51631}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (2)", "demo (2)", "{765EF1B9-5027-4820-BC37-A44466A51631}" ProjectSection(SolutionItems) = preProject conf\lang\en\demo\demo.xml = conf\lang\en\demo\demo.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{713E4747-1126-40B1-BD84-58F9A7745423}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (2)", "vm (2)", "{713E4747-1126-40B1-BD84-58F9A7745423}" ProjectSection(SolutionItems) = preProject conf\lang\en\vm\sounds.xml = conf\lang\en\vm\sounds.xml conf\lang\en\vm\tts.xml = conf\lang\en\vm\tts.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{F1B71990-EB04-4EB5-B28A-BC3EB6F7E843}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (3)", "demo (3)", "{F1B71990-EB04-4EB5-B28A-BC3EB6F7E843}" ProjectSection(SolutionItems) = preProject conf\lang\fr\demo\demo.xml = conf\lang\fr\demo\demo.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{3DAF028C-AB5B-4183-A01B-DCC43F5A87F0}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (3)", "vm (3)", "{3DAF028C-AB5B-4183-A01B-DCC43F5A87F0}" ProjectSection(SolutionItems) = preProject conf\lang\fr\vm\sounds.xml = conf\lang\fr\vm\sounds.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "autoload_configs", "autoload_configs", "{4833F8E3-ABBF-4260-9DB1-B34015676CFC}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "autoload_configs (2)", "autoload_configs (2)", "{4833F8E3-ABBF-4260-9DB1-B34015676CFC}" ProjectSection(SolutionItems) = preProject debug\conf\autoload_configs\alsa.conf.xml = debug\conf\autoload_configs\alsa.conf.xml debug\conf\autoload_configs\conference.conf.xml = debug\conf\autoload_configs\conference.conf.xml @@ -214,26 +214,26 @@ debug\conf\autoload_configs\zeroconf.conf.xml = debug\conf\autoload_configs\zeroconf.conf.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dialplan", "dialplan", "{D44DD429-FE98-42AA-B5B7-4B4EBE33AEFD}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dialplan (2)", "dialplan (2)", "{D44DD429-FE98-42AA-B5B7-4B4EBE33AEFD}" ProjectSection(SolutionItems) = preProject debug\conf\dialplan\default.xml = debug\conf\dialplan\default.xml debug\conf\dialplan\US.conf.xml = debug\conf\dialplan\US.conf.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "directory", "directory", "{471110C9-A7ED-4966-98E1-8EA667BF0EEA}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "directory (2)", "directory (2)", "{471110C9-A7ED-4966-98E1-8EA667BF0EEA}" ProjectSection(SolutionItems) = preProject debug\conf\directory\default.xml = debug\conf\directory\default.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sip_profiles", "sip_profiles", "{4DF5199E-F7F5-4347-97DD-22078FCDB371}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sip_profiles (2)", "sip_profiles (2)", "{4DF5199E-F7F5-4347-97DD-22078FCDB371}" ProjectSection(SolutionItems) = preProject debug\conf\sip_profiles\default.xml = debug\conf\sip_profiles\default.xml debug\conf\sip_profiles\nat.xml = debug\conf\sip_profiles\nat.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lang", "lang", "{B487BEBE-4A5C-434F-8D30-39465412F84F}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lang (2)", "lang (2)", "{B487BEBE-4A5C-434F-8D30-39465412F84F}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "de", "de", "{2003189F-0E69-4FF7-A11D-3BFB3F03D558}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "de (2)", "de (2)", "{2003189F-0E69-4FF7-A11D-3BFB3F03D558}" ProjectSection(SolutionItems) = preProject debug\conf\lang\de\de.xml = debug\conf\lang\de\de.xml EndProjectSection @@ -243,43 +243,43 @@ debug\conf\lang\en\en.xml = debug\conf\lang\en\en.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fr", "fr", "{1240C217-6674-43C1-B099-B0290D84F28B}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fr (2)", "fr (2)", "{1240C217-6674-43C1-B099-B0290D84F28B}" ProjectSection(SolutionItems) = preProject debug\conf\lang\fr\fr.xml = debug\conf\lang\fr\fr.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{03517B06-98A1-46DD-9347-BFFFED7DD8A4}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (4)", "demo (4)", "{03517B06-98A1-46DD-9347-BFFFED7DD8A4}" ProjectSection(SolutionItems) = preProject debug\conf\lang\de\demo\demo.xml = debug\conf\lang\de\demo\demo.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{1D339A14-FFC2-4F6E-BEF2-D5D6DF14AC88}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (4)", "vm (4)", "{1D339A14-FFC2-4F6E-BEF2-D5D6DF14AC88}" ProjectSection(SolutionItems) = preProject debug\conf\lang\de\vm\tts.xml = debug\conf\lang\de\vm\tts.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{B4C6D0B5-5F39-4546-820D-4BCAA6C3E301}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (5)", "demo (5)", "{B4C6D0B5-5F39-4546-820D-4BCAA6C3E301}" ProjectSection(SolutionItems) = preProject debug\conf\lang\en\demo\demo.xml = debug\conf\lang\en\demo\demo.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{3041F86C-51D4-4D9E-8A00-91BA4B7C51D4}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (5)", "vm (5)", "{3041F86C-51D4-4D9E-8A00-91BA4B7C51D4}" ProjectSection(SolutionItems) = preProject debug\conf\lang\en\vm\sounds.xml = debug\conf\lang\en\vm\sounds.xml debug\conf\lang\en\vm\tts.xml = debug\conf\lang\en\vm\tts.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{DFE96A6E-5C9A-4C74-959A-9C485A7AD95C}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (6)", "demo (6)", "{DFE96A6E-5C9A-4C74-959A-9C485A7AD95C}" ProjectSection(SolutionItems) = preProject debug\conf\lang\fr\demo\demo.xml = debug\conf\lang\fr\demo\demo.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{80A4CA5C-7208-4134-8EFD-C147B03C8AA1}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (6)", "vm (6)", "{80A4CA5C-7208-4134-8EFD-C147B03C8AA1}" ProjectSection(SolutionItems) = preProject debug\conf\lang\fr\vm\sounds.xml = debug\conf\lang\fr\vm\sounds.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "autoload_configs", "autoload_configs", "{8D29085B-952D-4594-9BB9-5781CE552D0A}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "autoload_configs (3)", "autoload_configs (3)", "{8D29085B-952D-4594-9BB9-5781CE552D0A}" ProjectSection(SolutionItems) = preProject release\conf\autoload_configs\alsa.conf.xml = release\conf\autoload_configs\alsa.conf.xml release\conf\autoload_configs\conference.conf.xml = release\conf\autoload_configs\conference.conf.xml @@ -312,25 +312,25 @@ release\conf\autoload_configs\zeroconf.conf.xml = release\conf\autoload_configs\zeroconf.conf.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dialplan", "dialplan", "{23874F4B-C0AF-4587-9F7E-DB0F06DE8CB4}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dialplan (3)", "dialplan (3)", "{23874F4B-C0AF-4587-9F7E-DB0F06DE8CB4}" ProjectSection(SolutionItems) = preProject conf\dialplan\default.xml = conf\dialplan\default.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "directory", "directory", "{19ED97F6-30D8-4FCE-AE1D-8B7FCB170D40}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "directory (3)", "directory (3)", "{19ED97F6-30D8-4FCE-AE1D-8B7FCB170D40}" ProjectSection(SolutionItems) = preProject release\conf\directory\default.xml = release\conf\directory\default.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sip_profiles", "sip_profiles", "{99E79D76-FCFC-466B-965B-273CCACF99B0}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sip_profiles (3)", "sip_profiles (3)", "{99E79D76-FCFC-466B-965B-273CCACF99B0}" ProjectSection(SolutionItems) = preProject release\conf\sip_profiles\default.xml = release\conf\sip_profiles\default.xml release\conf\sip_profiles\nat.xml = release\conf\sip_profiles\nat.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lang", "lang", "{8FADAC7F-CA9E-49D9-B957-A5F5605D238C}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lang (3)", "lang (3)", "{8FADAC7F-CA9E-49D9-B957-A5F5605D238C}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "de", "de", "{58A56014-DEA7-4172-8C26-BAD8D499A1E8}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "de (3)", "de (3)", "{58A56014-DEA7-4172-8C26-BAD8D499A1E8}" ProjectSection(SolutionItems) = preProject release\conf\lang\de\de.xml = release\conf\lang\de\de.xml EndProjectSection @@ -340,38 +340,38 @@ release\conf\lang\en\en.xml = release\conf\lang\en\en.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fr", "fr", "{89A94241-1DA6-44E8-A685-AED1E665C2AD}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fr (3)", "fr (3)", "{89A94241-1DA6-44E8-A685-AED1E665C2AD}" ProjectSection(SolutionItems) = preProject release\conf\lang\fr\fr.xml = release\conf\lang\fr\fr.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{2D74F635-AB18-43B3-A87E-A71F3EA24DDB}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (7)", "demo (7)", "{2D74F635-AB18-43B3-A87E-A71F3EA24DDB}" ProjectSection(SolutionItems) = preProject release\conf\lang\de\demo\demo.xml = release\conf\lang\de\demo\demo.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{A721E646-07E9-4E16-A92D-B97F654B2BAC}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (7)", "vm (7)", "{A721E646-07E9-4E16-A92D-B97F654B2BAC}" ProjectSection(SolutionItems) = preProject release\conf\lang\de\vm\tts.xml = release\conf\lang\de\vm\tts.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{50331CA0-7038-4341-B92D-C34E1601EFF0}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (8)", "demo (8)", "{50331CA0-7038-4341-B92D-C34E1601EFF0}" ProjectSection(SolutionItems) = preProject release\conf\lang\en\demo\demo.xml = release\conf\lang\en\demo\demo.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{FC0DB2A2-B1A3-426E-9E37-BE28FE8FE01B}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (8)", "vm (8)", "{FC0DB2A2-B1A3-426E-9E37-BE28FE8FE01B}" ProjectSection(SolutionItems) = preProject release\conf\lang\en\vm\sounds.xml = release\conf\lang\en\vm\sounds.xml release\conf\lang\en\vm\tts.xml = release\conf\lang\en\vm\tts.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{91C6DEDE-CE4A-47D1-A84B-3E828F82E2B0}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (9)", "demo (9)", "{91C6DEDE-CE4A-47D1-A84B-3E828F82E2B0}" ProjectSection(SolutionItems) = preProject release\conf\lang\fr\demo\demo.xml = release\conf\lang\fr\demo\demo.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{8F5A511B-F716-4D07-9657-55B9E4F1D3E9}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (9)", "vm (9)", "{8F5A511B-F716-4D07-9657-55B9E4F1D3E9}" ProjectSection(SolutionItems) = preProject release\conf\lang\fr\vm\sounds.xml = release\conf\lang\fr\vm\sounds.xml EndProjectSection @@ -991,6 +991,12 @@ {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_skypiax", "src\mod\endpoints\mod_skypiax\mod_skypiax.2008.vcproj", "{C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}" + ProjectSection(ProjectDependencies) = postProject + {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} + {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -1735,6 +1741,12 @@ {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|Win32.ActiveCfg = Release|Win32 {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|Win32.Build.0 = Release|Win32 {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|x64.ActiveCfg = Release|Win32 + {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Debug|Win32.ActiveCfg = Debug|Win32 + {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Debug|Win32.Build.0 = Debug|Win32 + {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Debug|x64.ActiveCfg = Debug|Win32 + {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Release|Win32.ActiveCfg = Release|Win32 + {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Release|Win32.Build.0 = Release|Win32 + {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Release|x64.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Modified: freeswitch/branches/gmaruzz/src/include/switch_apr.h ============================================================================== --- freeswitch/branches/gmaruzz/src/include/switch_apr.h (original) +++ freeswitch/branches/gmaruzz/src/include/switch_apr.h Wed Dec 10 11:01:07 2008 @@ -1328,6 +1328,13 @@ */ SWITCH_DECLARE(switch_status_t) switch_thread_exit(switch_thread_t *thd, switch_status_t retval); +/** + * block until the desired thread stops executing. + * @param retval The return value from the dead thread. + * @param thd The thread to join + */ +SWITCH_DECLARE(switch_status_t) switch_thread_join(switch_status_t *retval, switch_thread_t *thd); + /** @} */ Modified: freeswitch/branches/gmaruzz/src/switch_apr.c ============================================================================== --- freeswitch/branches/gmaruzz/src/switch_apr.c (original) +++ freeswitch/branches/gmaruzz/src/switch_apr.c Wed Dec 10 11:01:07 2008 @@ -980,6 +980,17 @@ return apr_thread_exit((apr_thread_t *)thd, retval); } +/** + * block until the desired thread stops executing. + * @param retval The return value from the dead thread. + * @param thd The thread to join + */ +SWITCH_DECLARE(switch_status_t) switch_thread_join(switch_status_t *retval, switch_thread_t *thd) +{ + return apr_thread_join((apr_status_t *)retval, (apr_thread_t *)thd); +} + + /* For Emacs: * Local Variables: From gmaruzz at freeswitch.org Wed Dec 10 08:37:57 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Wed, 10 Dec 2008 11:37:57 -0500 Subject: [Freeswitch-svn] [commit] r10697 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Wed Dec 10 11:37:56 2008 New Revision: 10697 Log: skypiax: joins thread on linux too Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Wed Dec 10 11:37:56 2008 @@ -34,10 +34,10 @@ switch_core_session_t *global_session = NULL; #ifdef WIN32 HANDLE win32_hGlobal_ThreadShutdownEvent; -switch_thread_t *do_skype_thread_thread; HWND win32_hInit_MainWindowHandle; #endif /* WIN32 */ switch_thread_t *skypiax_do_controldev_thread_thread; +switch_thread_t *do_skype_thread_thread; /*************************************************/ /*************************************************/ /*************************************************/ @@ -894,13 +894,26 @@ if (SendMessage (win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) { // let's the do_skype_thread die ERRORA("WHY FALSE HERE? %d\n", SKYPIAX_P_LOG, GetLastError()); } +#else + XEvent e; + Atom atom1 = XInternAtom(p->AsteriskHandlesAst.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False); + memset(&e, 0, sizeof(e)); + e.xclient.type = ClientMessage; + e.xclient.message_type = atom1; /* leading message */ + e.xclient.display = p->AsteriskHandlesAst.disp; + e.xclient.window = p->AsteriskHandlesAst.skype_win; + e.xclient.format = 8; + + + XSendEvent(p->AsteriskHandlesAst.disp, p->AsteriskHandlesAst.win, False, 0, &e); + XSync(p->AsteriskHandlesAst.disp, False); #endif while (x) { x--; switch_yield(20000); } - switch_thread_join(&status, do_skype_thread_thread); switch_thread_join(&status, skypiax_do_controldev_thread_thread); + switch_thread_join(&status, do_skype_thread_thread); return SWITCH_STATUS_SUCCESS; } From gmaruzz at freeswitch.org Wed Dec 10 08:38:44 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Wed, 10 Dec 2008 11:38:44 -0500 Subject: [Freeswitch-svn] [commit] r10698 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Wed Dec 10 11:38:43 2008 New Revision: 10698 Log: skypiax: indent -gnu -ts4 -br -brs -cdw -lp -ce -nbfda -npcs -nprs -npsl -nbbo -saf -sai -saw -cs -bbo -nhnl -nut -sob -l90 Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Wed Dec 10 11:38:43 2008 @@ -524,8 +524,7 @@ return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; } - skypiax_skype_call(tech_pvt->p, caller_profile->destination_number, 30, - *new_session); + skypiax_skype_call(tech_pvt->p, caller_profile->destination_number, 30, *new_session); switch_channel_set_flag(channel, CF_OUTBOUND); switch_set_flag_locked(tech_pvt, TFLAG_OUTBOUND); @@ -554,33 +553,33 @@ (void *) p); while (forever) { - if(!running) - break; + if (!running) + break; switch_sleep(1000); res = skypiax_skype_read(p); //if (res == CALLFLOW_INCOMING_HANGUP && p->interface_state != SKYPIAX_STATE_DOWN) - if (res == CALLFLOW_INCOMING_HANGUP) { - switch_core_session_t *session = NULL; - private_t *tech_pvt = NULL; - switch_channel_t *channel = NULL; - - DEBUGA_SKYPE("skype call ended\n", SKYPIAX_P_LOG); - - tech_pvt = p->tech_pvt; - if(tech_pvt){ - session = tech_pvt->session; - - if(session){ - channel = switch_core_session_get_channel(session); - DEBUGA_SKYPE("before channel_on_hangup\n", SKYPIAX_P_LOG); - - if(channel) { - switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); - DEBUGA_SKYPE("after channel_on_hangup\n", SKYPIAX_P_LOG); - } - } - } - } + if (res == CALLFLOW_INCOMING_HANGUP) { + switch_core_session_t *session = NULL; + private_t *tech_pvt = NULL; + switch_channel_t *channel = NULL; + + DEBUGA_SKYPE("skype call ended\n", SKYPIAX_P_LOG); + + tech_pvt = p->tech_pvt; + if (tech_pvt) { + session = tech_pvt->session; + + if (session) { + channel = switch_core_session_get_channel(session); + DEBUGA_SKYPE("before channel_on_hangup\n", SKYPIAX_P_LOG); + + if (channel) { + switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); + DEBUGA_SKYPE("after channel_on_hangup\n", SKYPIAX_P_LOG); + } + } + } + } } //if (option_debug > 10) { @@ -847,13 +846,13 @@ memset(&globals, '\0', sizeof(globals)); memset(SKYPIAX_INTERFACES, '\0', sizeof(SKYPIAX_INTERFACES)); -#ifndef WIN32 +#ifndef WIN32 if (!XInitThreads()) { ERRORA("Not initialized XInitThreads!\n", SKYPIAX_P_LOG); } else { DEBUGA_SKYPE("Initialized XInitThreads!\n", SKYPIAX_P_LOG); } - switch_sleep(100); + switch_sleep(100); #endif /* _WINDOWS_ */ load_config(); @@ -882,21 +881,22 @@ int x = 100; struct skypiax_interface *p = NULL; switch_status_t status; - unsigned int howmany=8; + unsigned int howmany = 8; - p = &SKYPIAX_INTERFACES[2]; + p = &SKYPIAX_INTERFACES[2]; running = 0; - switch_file_write(p->AsteriskHandlesAst.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die + switch_file_write(p->AsteriskHandlesAst.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die #ifdef WIN32 - if (SendMessage (win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) { // let's the do_skype_thread die - ERRORA("WHY FALSE HERE? %d\n", SKYPIAX_P_LOG, GetLastError()); + if (SendMessage(win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) { // let's the do_skype_thread die + ERRORA("WHY FALSE HERE? %d\n", SKYPIAX_P_LOG, GetLastError()); } #else XEvent e; - Atom atom1 = XInternAtom(p->AsteriskHandlesAst.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False); + Atom atom1 = + XInternAtom(p->AsteriskHandlesAst.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False); memset(&e, 0, sizeof(e)); e.xclient.type = ClientMessage; e.xclient.message_type = atom1; /* leading message */ @@ -904,12 +904,11 @@ e.xclient.window = p->AsteriskHandlesAst.skype_win; e.xclient.format = 8; - - XSendEvent(p->AsteriskHandlesAst.disp, p->AsteriskHandlesAst.win, False, 0, &e); + XSendEvent(p->AsteriskHandlesAst.disp, p->AsteriskHandlesAst.win, False, 0, &e); XSync(p->AsteriskHandlesAst.disp, False); #endif while (x) { - x--; + x--; switch_yield(20000); } switch_thread_join(&status, skypiax_do_controldev_thread_thread); Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Wed Dec 10 11:38:43 2008 @@ -73,8 +73,8 @@ sin_size = sizeof(remote_addr); while ((fd = accept(s, (struct sockaddr *) &remote_addr, &sin_size)) > 0) { DEBUGA_SKYPE("ACCEPTED\n", SKYPIAX_P_LOG); - if(!running) - break; + if (!running) + break; while (p->interface_state != SKYPIAX_STATE_DOWN && (p->skype_callflow == CALLFLOW_STATUS_INPROGRESS || p->skype_callflow == SKYPIAX_STATE_UP)) { @@ -88,8 +88,8 @@ fd_set fs; struct timeval to; - if(!running) - break; + if (!running) + break; exit = 1; fdselect = fd; @@ -241,8 +241,8 @@ sin_size = sizeof(remote_addr); while ((fd = accept(s, (struct sockaddr *) &remote_addr, &sin_size)) > 0) { DEBUGA_SKYPE("ACCEPTED\n", SKYPIAX_P_LOG); - if(!running) - break; + if (!running) + break; while (p->interface_state != SKYPIAX_STATE_DOWN && (p->skype_callflow == CALLFLOW_STATUS_INPROGRESS || p->skype_callflow == SKYPIAX_STATE_UP)) { @@ -255,8 +255,8 @@ fd_set fs; struct timeval to; - if(!running) - break; + if (!running) + break; fdselect = 1; FD_ZERO(&fs); FD_SET(fdselect, &fs); @@ -440,7 +440,7 @@ fIssueDefProc = 0; switch (uiMessage) { case WM_DESTROY: - NOTICA("got DESTROY\n", SKYPIAX_P_LOG); + NOTICA("got DESTROY\n", SKYPIAX_P_LOG); win32_hInit_MainWindowHandle = NULL; PostQuitMessage(0); break; @@ -593,29 +593,28 @@ && win32_uiGlobal_MsgID_SkypeControlAPIDiscover != 0) { if (win32_Initialize_CreateWindowClass()) { if (win32_Initialize_CreateMainWindow()) { - if (SendMessage - (HWND_BROADCAST, win32_uiGlobal_MsgID_SkypeControlAPIDiscover, - (WPARAM) win32_hInit_MainWindowHandle, 0) != 0) { - win32_AsteriskHandlesSkype->win32_hInit_MainWindowHandle = - win32_hInit_MainWindowHandle; - while (1) { - MSG oMessage; - if(!running) - break; - while( GetMessage(&oMessage, 0, 0, 0) ){ - break; - TranslateMessage(&oMessage); - DispatchMessage(&oMessage); - } - } + if (SendMessage + (HWND_BROADCAST, win32_uiGlobal_MsgID_SkypeControlAPIDiscover, + (WPARAM) win32_hInit_MainWindowHandle, 0) != 0) { + win32_AsteriskHandlesSkype->win32_hInit_MainWindowHandle = + win32_hInit_MainWindowHandle; + while (1) { + MSG oMessage; + if (!running) + break; + while (GetMessage(&oMessage, 0, 0, 0)) { + break; + TranslateMessage(&oMessage); + DispatchMessage(&oMessage); + } } + } win32_DeInitialize_DestroyMainWindow(); } win32_DeInitialize_DestroyWindowClass(); } } - switch_thread_exit(thread, SWITCH_STATUS_SUCCESS); return NULL; @@ -836,8 +835,8 @@ while (1) { XNextEvent(disp, &an_event); - if(!running) - break; + if (!running) + break; switch (an_event.type) { case ClientMessage: From anthm at freeswitch.org Wed Dec 10 08:52:49 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 10 Dec 2008 11:52:49 -0500 Subject: [Freeswitch-svn] [commit] r10699 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Wed Dec 10 11:52:48 2008 New Revision: 10699 Log: fine tune presence stuff Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c Wed Dec 10 11:52:48 2008 @@ -888,7 +888,6 @@ int done = 0; const char *ct = "no/idea"; time_t exptime = switch_timestamp(NULL) + 3600; - char exp[80] = ""; int is_dialog = 0; sofia_profile_t *ext_profile = NULL, *profile = helper->profile; @@ -1147,9 +1146,9 @@ pl = gen_pidf(user_agent, clean_id, profile->url, open, rpid, prpid, status, &ct); } - switch_snprintf(exp, sizeof(exp), "active;expires=%ld", (long) exptime); nua_handle_bind(nh, &mod_sofia_globals.keep_private); - nua_notify(nh, SIPTAG_SUBSCRIPTION_STATE_STR(exp), SIPTAG_EVENT_STR(event), SIPTAG_CONTENT_TYPE_STR(ct), SIPTAG_PAYLOAD_STR(pl), TAG_END()); + nua_notify(nh, SIPTAG_SUBSCRIPTION_STATE_STR("active"), + SIPTAG_EVENT_STR(event), SIPTAG_CONTENT_TYPE_STR(ct), SIPTAG_PAYLOAD_STR(pl), TAG_END()); end: @@ -1174,7 +1173,6 @@ char *expires = argv[10]; char *profile_name = argv[13]; char *body = argv[14]; - char *exp; char *id = NULL; nua_handle_t *nh; int expire_sec = atoi(expires); @@ -1199,14 +1197,12 @@ if (expire_sec < 0) { expire_sec = 3600; } - exp = switch_mprintf("active;expires=%ld", expire_sec); + nua_handle_bind(nh, &mod_sofia_globals.keep_private); - nua_notify(nh, - SIPTAG_SUBSCRIPTION_STATE_STR(exp), + nua_notify(nh, SIPTAG_SUBSCRIPTION_STATE_STR("active"), SIPTAG_EVENT_STR(event), SIPTAG_CONTENT_TYPE_STR("application/simple-message-summary"), SIPTAG_PAYLOAD_STR(body), TAG_END()); switch_safe_free(id); - switch_safe_free(exp); h->total++; @@ -1498,7 +1494,12 @@ full_via = sip_header_as_string(profile->home, (void *) sip->sip_via); exp_raw = (sip->sip_expires ? sip->sip_expires->ex_delta : 3600); - exp = (long) switch_timestamp(NULL) + exp_raw + 120; + if (exp_raw) { + exp = (long) switch_timestamp(NULL) + exp_raw + 120; + } else { + exp = 0; + sub_state = nua_substate_terminated; + } if (sofia_test_pflag(profile, PFLAG_MULTIREG)) { sql = switch_mprintf("delete from sip_subscriptions where call_id='%q'", call_id); From gmaruzz at freeswitch.org Wed Dec 10 09:33:53 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Wed, 10 Dec 2008 12:33:53 -0500 Subject: [Freeswitch-svn] [commit] r10700 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Wed Dec 10 12:33:52 2008 New Revision: 10700 Log: skypiax: more warnings, but at least we got audio ;-) Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Wed Dec 10 12:33:52 2008 @@ -20,13 +20,13 @@ void *obj) { struct skypiax_interface *p = obj; - short out[GG / 2]; + short srv_out[GG / 2]; int s; #ifdef WIN32 unsigned int len; unsigned int i; unsigned int a; - char in[GG]; + short srv_in[GG]; int sin_size; unsigned int fd; #else @@ -100,19 +100,19 @@ rt = select(fdselect + 1, &fs, NULL, NULL, &to); if (rt > 0) { - len = recv(fd, in, sizeof(short) * GG, 0); + len = recv(fd, srv_in, sizeof(short) * GG, 0); //DEBUGA_SKYPE("recv %d\n", SKYPIAX_P_LOG, len); if (len > 0) { a = 0; for (i = 0; i < len / sizeof(short); i++) { - out[a] = in[i]; + srv_out[a] = srv_in[i]; i++; a++; } if (!p->audiobuf_is_loaded) { for (i = 0; i < (len / sizeof(short)) / 2; i++) { - p->audiobuf[i] = out[i]; + p->audiobuf[i] = srv_out[i]; } p->audiobuf_is_loaded = 1; } else { @@ -125,7 +125,7 @@ howmany = len / 2 / 2; for (a = 0; a < howmany; a++) { - totalbuf[i] = out[a]; + totalbuf[i] = srv_out[a]; i++; } @@ -192,16 +192,16 @@ unsigned int len; unsigned int i; unsigned int a; - char in[NN / 2]; - char out[NN]; + short cli_in[NN / 2]; + short cli_out[NN]; int sin_size; unsigned int fd; #else int len; int i; int a; - short in[NN / 2]; - short out[NN]; + short cli_in[NN / 2]; + short cli_out[NN]; unsigned int sin_size; int fd; #endif /* WIN32 */ @@ -266,18 +266,18 @@ if (rt > 0) { got = (NN / 2) * sizeof(short); - switch_file_read(p->audioskypepipe[0], in, &got); + switch_file_read(p->audioskypepipe[0], cli_in, &got); if (got > 0) { a = 0; for (i = 0; i < got / sizeof(short); i++) { - out[a] = in[i]; + cli_out[a] = cli_in[i]; a++; - out[a] = in[i]; + cli_out[a] = cli_in[i]; a++; } - len = send(fd, out, got * 2, 0); + len = send(fd, cli_out, got * 2, 0); if (len == 0) { ERRORA("Skype server GONE\n", SKYPIAX_P_LOG); From gmaruzz at freeswitch.org Wed Dec 10 09:36:21 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Wed, 10 Dec 2008 12:36:21 -0500 Subject: [Freeswitch-svn] [commit] r10701 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Wed Dec 10 12:36:21 2008 New Revision: 10701 Log: skypiax: more warnings on windows, but win32 sound is working. Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Wed Dec 10 12:36:21 2008 @@ -33,7 +33,7 @@ int len; int i; int a; - short in[GG]; + short srv_in[GG]; unsigned int sin_size; int fd; #endif /* WIN32 */ From anthm at freeswitch.org Wed Dec 10 12:54:25 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 10 Dec 2008 15:54:25 -0500 Subject: [Freeswitch-svn] [commit] r10702 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Wed Dec 10 15:54:24 2008 New Revision: 10702 Log: x-mas presence Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h Wed Dec 10 15:54:24 2008 @@ -242,6 +242,7 @@ switch_event_node_t *roster_node; switch_event_node_t *custom_node; switch_event_node_t *mwi_node; + int debug_presence; }; extern struct mod_sofia_globals mod_sofia_globals; Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Wed Dec 10 15:54:24 2008 @@ -1577,6 +1577,8 @@ char *val = (char *) switch_xml_attr_soft(param, "value"); if (!strcasecmp(var, "log-level")) { su_log_set_level(NULL, atoi(val)); + } else if (!strcasecmp(var, "debug-presence")) { + mod_sofia_globals.debug_presence = atoi(val); } } } Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c Wed Dec 10 15:54:24 2008 @@ -315,6 +315,7 @@ { sofia_profile_t *profile = NULL; switch_hash_index_t *hi; + const void *var; void *val; char *from = switch_event_get_header(event, "from"); char *proto = switch_event_get_header(event, "proto"); @@ -381,9 +382,19 @@ switch_assert(sql != NULL); switch_mutex_lock(mod_sofia_globals.hash_mutex); for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) { - switch_hash_this(hi, NULL, NULL, &val); + switch_hash_this(hi, &var, NULL, &val); profile = (sofia_profile_t *) val; + + if (strcmp((char *)var, profile->name)) { + if (mod_sofia_globals.debug_presence > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "%s is an alias, skipping\n", (char *) var); + } + continue; + } if (profile->pres_type != PRES_TYPE_FULL) { + if (mod_sofia_globals.debug_presence > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "%s is passive, skipping\n", (char *) var); + } continue; } helper.profile = profile; @@ -423,6 +434,7 @@ return; } + switch (event->event_id) { case SWITCH_EVENT_PRESENCE_PROBE: if (proto) { @@ -455,7 +467,20 @@ "(sip_registrations.sip_host='%q' or sip_registrations.presence_hosts like '%%%q%%')", probe_host, probe_euser, probe_host, probe_host); switch_assert(sql); + + + if (mod_sofia_globals.debug_presence > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s START_PRESENCE_PROBE_SQL\n", profile->name); + } + + if (mod_sofia_globals.debug_presence > 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s DUMP PRESENCE_PROBE_SQL:\n%s\n", profile->name, sql); + } + sofia_glue_execute_sql_callback(profile, SWITCH_FALSE, profile->ireg_mutex, sql, sofia_presence_resub_callback, profile); + if (mod_sofia_globals.debug_presence > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s END_PRESENCE_PROBE_SQL\n\n", profile->name); + } sofia_glue_release_profile(profile); switch_safe_free(sql); @@ -465,6 +490,36 @@ switch_safe_free(probe_user); } return; + default: + break; + } + + + + if (!mod_sofia_globals.profile_hash) + goto done; + + switch_mutex_lock(mod_sofia_globals.hash_mutex); + for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) { + switch_hash_this(hi, &var, NULL, &val); + profile = (sofia_profile_t *) val; + + if (strcmp((char *)var, profile->name)) { + if (mod_sofia_globals.debug_presence > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "%s is an alias, skipping\n", (char *) var); + } + continue; + } + + if (profile->pres_type != PRES_TYPE_FULL) { + if (mod_sofia_globals.debug_presence > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "%s is passive, skipping\n", (char *) var); + } + continue; + } + + + switch (event->event_id) { case SWITCH_EVENT_PRESENCE_IN: sql = switch_mprintf( @@ -479,8 +534,9 @@ "(sip_subscriptions.sub_to_user=sip_presence.sip_user and sip_subscriptions.sub_to_host=sip_presence.sip_host and " "sip_subscriptions.profile_name=sip_presence.profile_name) " "where (event='%q' or event='%q') and sub_to_user='%q' " - "and (sub_to_host='%q' or presence_hosts like '%%%q%%')", - switch_str_nil(status), switch_str_nil(rpid), host, event_type, alt_event_type, euser, host, host); + "and (sub_to_host='%q' or presence_hosts like '%%%q%%') " + "and (sip_subscriptions.profile_name = '%q' or sip_subscriptions.presence_hosts != sip_subscriptions.sub_to_host)", + switch_str_nil(status), switch_str_nil(rpid), host, event_type, alt_event_type, euser, host, host, profile->name); break; case SWITCH_EVENT_PRESENCE_OUT: sql = switch_mprintf( @@ -495,24 +551,15 @@ "(sip_subscriptions.sub_to_user=sip_presence.sip_user and sip_subscriptions.sub_to_host=sip_presence.sip_host and " "sip_subscriptions.profile_name=sip_presence.profile_name) " "where (event='%q' or event='%q') and sub_to_user='%q' " - "and (sub_to_host='%q' or presence_hosts like '%%%q%%')", - switch_str_nil(status), switch_str_nil(rpid), host, event_type, alt_event_type, euser, host, host); - break; - default: + "and (sub_to_host='%q' or presence_hosts like '%%%q%%') ", + "and (sip_subscriptions.profile_name = '%q' or sip_subscriptions.presence_hosts != sip_subscriptions.sub_to_host)", + switch_str_nil(status), switch_str_nil(rpid), host, event_type, alt_event_type, euser, host, host, profile->name); break; - } - - if (!mod_sofia_globals.profile_hash) - goto done; - - switch_mutex_lock(mod_sofia_globals.hash_mutex); - for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) { - switch_hash_this(hi, NULL, NULL, &val); - profile = (sofia_profile_t *) val; - if (profile->pres_type != PRES_TYPE_FULL) { - continue; + default: + break; } + if (sql) { struct presence_helper helper = { 0 }; helper.profile = profile; @@ -520,28 +567,47 @@ SWITCH_STANDARD_STREAM(helper.stream); switch_assert(helper.stream.data); + + + if (mod_sofia_globals.debug_presence > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s START_PRESENCE_SQL\n", profile->name); + } + + if (mod_sofia_globals.debug_presence > 1) { + char *buf; + switch_event_serialize(event, &buf, SWITCH_FALSE); + switch_assert(buf); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "DUMP PRESENCE SQL:\n%s\nEVENT DUMP:\n%s\n", sql, buf); + free(buf); + } + sofia_glue_execute_sql_callback(profile, SWITCH_FALSE, NULL, sql, sofia_presence_sub_callback, &helper); + if (mod_sofia_globals.debug_presence > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s END_PRESENCE_SQL\n\n", profile->name); + } + + switch_safe_free(sql); if (!switch_strlen_zero((char *) helper.stream.data)) { - char *this = (char *) helper.stream.data; + char *this_sql = (char *) helper.stream.data; char *next = NULL; char *last = NULL; do { - if ((next = strchr(this, ';'))) { + if ((next = strchr(this_sql, ';'))) { *next++ = '\0'; while (*next == '\n' || *next == ' ' || *next == '\r') { *next++ = '\0'; } } - if (!switch_strlen_zero(this) && (!last || strcmp(last, this))) { - sofia_glue_execute_sql(profile, &this, SWITCH_FALSE); - last = this; + if (!switch_strlen_zero(this_sql) && (!last || strcmp(last, this_sql))) { + sofia_glue_execute_sql(profile, &this_sql, SWITCH_FALSE); + last = this_sql; } - this = next; - } while (this); + this_sql = next; + } while (this_sql); } switch_safe_free(helper.stream.data); helper.stream.data = NULL; @@ -579,14 +645,13 @@ while (mod_sofia_globals.running == 1) { int count = 0; - + if (switch_queue_trypop(mod_sofia_globals.presence_queue, &pop) == SWITCH_STATUS_SUCCESS) { switch_event_t *event = (switch_event_t *) pop; if (!pop) { break; } - actual_sofia_presence_event_handler(event); switch_event_destroy(&event); count++; @@ -747,6 +812,10 @@ proto = NULL; } + if (mod_sofia_globals.debug_presence > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s PRESENCE_PROBE %s@%s\n", profile->name, user, host); + } + if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", proto ? proto : SOFIA_CHAT_PROTO); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url); @@ -948,6 +1017,12 @@ clean_id = switch_mprintf("sip:%s+%s@%s", proto, sub_to_user, sub_to_host); } + if (mod_sofia_globals.debug_presence > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, + "SEND PRESENCE\nTo: \t%s@%s\nFrom: \t%s@%s\nCall-ID: \t%s\nProfile:\t%s [%s]\n\n", + sub_to_user, sub_to_host, user, host, call_id, profile_name, helper->profile->name); + } + if (!strcasecmp(sub_to_host, host)) { /* same host */ id = switch_mprintf("sip:%s+%s@%s", proto, sub_to_user, sub_to_host); Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c Wed Dec 10 15:54:24 2008 @@ -969,6 +969,20 @@ "Register:\nFrom: [%s@%s]\nContact: [%s]\nExpires: [%ld]\n", to_user, reg_host, contact_str, (long) exptime); } + +#if 0 + if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", SOFIA_CHAT_PROTO); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", rpid); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "user-agent", + (sip && sip->sip_user_agent) ? sip->sip_user_agent->g_string : "unknown"); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", to_user, reg_host); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", "Registered"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence"); + switch_event_fire(&event); + } +#else if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_PROBE) == SWITCH_STATUS_SUCCESS) { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "proto", "sip"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "login", profile->url); @@ -980,6 +994,7 @@ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event_type", "presence"); switch_event_fire(&event); } +#endif } else { if (multi_reg) { char *icontact, *p; From mikej at freeswitch.org Wed Dec 10 13:24:04 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Wed, 10 Dec 2008 16:24:04 -0500 Subject: [Freeswitch-svn] [commit] r10703 - freeswitch/trunk/libs/win32 Message-ID: Author: mikej Date: Wed Dec 10 16:24:03 2008 New Revision: 10703 Log: FSBUILD-69 use up to date version of svnversion.exe so we reliably create the generated version header on windows. Modified: freeswitch/trunk/libs/win32/util.vbs Modified: freeswitch/trunk/libs/win32/util.vbs ============================================================================== --- freeswitch/trunk/libs/win32/util.vbs (original) +++ freeswitch/trunk/libs/win32/util.vbs Wed Dec 10 16:24:03 2008 @@ -250,15 +250,41 @@ strVerRev = FindVersionStringInConfigure(VersionDir & "configure.in", "SWITCH_VERSION_REVISION") If Right(tmpFolder, 1) <> "\" Then tmpFolder = tmpFolder & "\" End If - If Not FSO.FileExists(tmpFolder & "svnversion.exe") Then - Wget ToolsBase & "svnversion.exe", tmpFolder + If Not FSO.FileExists(tmpFolder & "fs_svnversion.exe") Then + Wget ToolsBase & "fs_svnversion.exe", tmpFolder End If + + If Not FSO.FileExists(tmpFolder & "libsvn_diff-1.dll") Then + Wget ToolsBase & "libsvn_diff-1.dll", tmpFolder + End If + If Not FSO.FileExists(tmpFolder & "libsvn_subr-1.dll") Then + Wget ToolsBase & "libsvn_subr-1.dll", tmpFolder + End If + If Not FSO.FileExists(tmpFolder & "libsvn_wc-1.dll") Then + Wget ToolsBase & "libsvn_wc-1.dll", tmpFolder + End If + If Not FSO.FileExists(tmpFolder & "intl3_svn.dll") Then + Wget ToolsBase & "intl3_svn.dll", tmpFolder + End If + If Not FSO.FileExists(tmpFolder & "libapr-1.dll") Then + Wget ToolsBase & "libapr-1.dll", tmpFolder + End If + If Not FSO.FileExists(tmpFolder & "libaprutil-1.dll") Then + Wget ToolsBase & "libaprutil-1.dll", tmpFolder + End If + If Not FSO.FileExists(tmpFolder & "libapriconv-1.dll") Then + Wget ToolsBase & "libapriconv-1.dll", tmpFolder + End If + If Not FSO.FileExists(tmpFolder & "libsvn_delta-1.dll") Then + Wget ToolsBase & "libsvn_delta-1.dll", tmpFolder + End If + Dim sLastFile Const OverwriteIfExist = -1 Const ForReading = 1 if strVerRev = "" Then - VersionCmd="svnversion " & quote & VersionDir & "." & quote & " -n" + VersionCmd="fs_svnversion " & quote & VersionDir & "." & quote & " -n" Set MyFile = fso.CreateTextFile(tmpFolder & "tmpVersion.Bat", True) MyFile.WriteLine("@" & "cd " & quote & tmpFolder & quote ) MyFile.WriteLine("@" & VersionCmd) From brian at freeswitch.org Wed Dec 10 13:35:20 2008 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Wed, 10 Dec 2008 16:35:20 -0500 Subject: [Freeswitch-svn] [commit] r10704 - freeswitch/trunk/src/mod/applications/mod_http Message-ID: Author: brian Date: Wed Dec 10 16:35:19 2008 New Revision: 10704 Log: more to come Added: freeswitch/trunk/src/mod/applications/mod_http/ From ericdc at freeswitch.org Wed Dec 10 13:43:26 2008 From: ericdc at freeswitch.org (FreeSWITCH SVN) Date: Wed, 10 Dec 2008 16:43:26 -0500 Subject: [Freeswitch-svn] [commit] r10705 - freeswitch/trunk/src/mod/applications/mod_http Message-ID: Author: ericdc Date: Wed Dec 10 16:43:26 2008 New Revision: 10705 Log: Initial upload. Added: freeswitch/trunk/src/mod/applications/mod_http/Makefile freeswitch/trunk/src/mod/applications/mod_http/arraylist.c freeswitch/trunk/src/mod/applications/mod_http/arraylist.h freeswitch/trunk/src/mod/applications/mod_http/bits.h freeswitch/trunk/src/mod/applications/mod_http/config.h freeswitch/trunk/src/mod/applications/mod_http/debug.c freeswitch/trunk/src/mod/applications/mod_http/debug.h freeswitch/trunk/src/mod/applications/mod_http/http_req.c freeswitch/trunk/src/mod/applications/mod_http/http_req.h freeswitch/trunk/src/mod/applications/mod_http/json.h freeswitch/trunk/src/mod/applications/mod_http/json_object.c freeswitch/trunk/src/mod/applications/mod_http/json_object.h freeswitch/trunk/src/mod/applications/mod_http/json_object_private.h freeswitch/trunk/src/mod/applications/mod_http/json_tokener.c freeswitch/trunk/src/mod/applications/mod_http/json_tokener.h freeswitch/trunk/src/mod/applications/mod_http/json_util.c freeswitch/trunk/src/mod/applications/mod_http/json_util.h freeswitch/trunk/src/mod/applications/mod_http/linkhash.c freeswitch/trunk/src/mod/applications/mod_http/linkhash.h freeswitch/trunk/src/mod/applications/mod_http/mod_http.c freeswitch/trunk/src/mod/applications/mod_http/printbuf.c freeswitch/trunk/src/mod/applications/mod_http/printbuf.h freeswitch/trunk/src/mod/applications/mod_http/url_encoding.c freeswitch/trunk/src/mod/applications/mod_http/url_encoding.h Added: freeswitch/trunk/src/mod/applications/mod_http/Makefile ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/Makefile Wed Dec 10 16:43:26 2008 @@ -0,0 +1,5 @@ +BASE=../../../.. +LOCAL_SOURCES=arraylist.c debug.c json_object.c json_tokener.c json_util.c linkhash.c printbuf.c url_encoding.c http_req.c +LOCAL_OBJS=arraylist.o debug.o json_object.o json_tokener.o json_util.o linkhash.o printbuf.o url_encoding.o http_req.o +include $(BASE)/build/modmake.rules + Added: freeswitch/trunk/src/mod/applications/mod_http/arraylist.c ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/arraylist.c Wed Dec 10 16:43:26 2008 @@ -0,0 +1,93 @@ +/* + * $Id: arraylist.c,v 1.4 2006/01/26 02:16:28 mclark Exp $ + * + * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. + * Michael Clark + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See COPYING for details. + * + */ + +#include "config.h" + +#if STDC_HEADERS +# include +# include +#endif /* STDC_HEADERS */ + +#if HAVE_STRINGS_H +# include +#endif /* HAVE_STRINGS_H */ + +#include "bits.h" +#include "arraylist.h" + +struct array_list* +array_list_new(array_list_free_fn *free_fn) +{ + struct array_list *this; + + if(!(this = calloc(1, sizeof(struct array_list)))) return NULL; + this->size = ARRAY_LIST_DEFAULT_SIZE; + this->length = 0; + this->free_fn = free_fn; + if(!(this->array = calloc(sizeof(void*), this->size))) { + free(this); + return NULL; + } + return this; +} + +extern void +array_list_free(struct array_list *this) +{ + int i; + for(i = 0; i < this->length; i++) + if(this->array[i]) this->free_fn(this->array[i]); + free(this->array); + free(this); +} + +void* +array_list_get_idx(struct array_list *this, int i) +{ + if(i >= this->length) return NULL; + return this->array[i]; +} + +static int array_list_expand_internal(struct array_list *this, int max) +{ + void *t; + int new_size; + + if(max < this->size) return 0; + new_size = max(this->size << 1, max); + if(!(t = realloc(this->array, new_size*sizeof(void*)))) return -1; + this->array = t; + (void)memset(this->array + this->size, 0, (new_size-this->size)*sizeof(void*)); + this->size = new_size; + return 0; +} + +int +array_list_put_idx(struct array_list *this, int idx, void *data) +{ + if(array_list_expand_internal(this, idx)) return -1; + if(this->array[idx]) this->free_fn(this->array[idx]); + this->array[idx] = data; + if(this->length <= idx) this->length = idx + 1; + return 0; +} + +int +array_list_add(struct array_list *this, void *data) +{ + return array_list_put_idx(this, this->length, data); +} + +int +array_list_length(struct array_list *this) +{ + return this->length; +} Added: freeswitch/trunk/src/mod/applications/mod_http/arraylist.h ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/arraylist.h Wed Dec 10 16:43:26 2008 @@ -0,0 +1,45 @@ +/* + * $Id: arraylist.h,v 1.4 2006/01/26 02:16:28 mclark Exp $ + * + * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. + * Michael Clark + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See COPYING for details. + * + */ + +#ifndef _arraylist_h_ +#define _arraylist_h_ + +#define ARRAY_LIST_DEFAULT_SIZE 32 + +typedef void (array_list_free_fn) (void *data); + +struct array_list +{ + void **array; + int length; + int size; + array_list_free_fn *free_fn; +}; + +extern struct array_list* +array_list_new(array_list_free_fn *free_fn); + +extern void +array_list_free(struct array_list *al); + +extern void* +array_list_get_idx(struct array_list *al, int i); + +extern int +array_list_put_idx(struct array_list *al, int i, void *data); + +extern int +array_list_add(struct array_list *al, void *data); + +extern int +array_list_length(struct array_list *al); + +#endif Added: freeswitch/trunk/src/mod/applications/mod_http/bits.h ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/bits.h Wed Dec 10 16:43:26 2008 @@ -0,0 +1,27 @@ +/* + * $Id: bits.h,v 1.10 2006/01/30 23:07:57 mclark Exp $ + * + * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. + * Michael Clark + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See COPYING for details. + * + */ + +#ifndef _bits_h_ +#define _bits_h_ + +#ifndef min +#define min(a,b) ((a) < (b) ? (a) : (b)) +#endif + +#ifndef max +#define max(a,b) ((a) > (b) ? (a) : (b)) +#endif + +#define hexdigit(x) (((x) <= '9') ? (x) - '0' : ((x) & 7) + 9) +#define error_ptr(error) ((void*)error) +#define is_error(ptr) ((unsigned long)ptr > (unsigned long)-4000L) + +#endif Added: freeswitch/trunk/src/mod/applications/mod_http/config.h ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/config.h Wed Dec 10 16:43:26 2008 @@ -0,0 +1,118 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.in by autoheader. */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +/* #undef HAVE_DOPRNT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#define HAVE_MALLOC 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `open' function. */ +#define HAVE_OPEN 1 + +/* Define to 1 if your system has a GNU libc compatible `realloc' function, + and to 0 otherwise. */ +#define HAVE_REALLOC 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDARG_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strncasecmp' function. */ +#define HAVE_STRNCASECMP 1 + +/* Define to 1 if you have the `strndup' function. */ +#define HAVE_STRNDUP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYSLOG_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `vasprintf' function. */ +#define HAVE_VASPRINTF 1 + +/* Define to 1 if you have the `vprintf' function. */ +#define HAVE_VPRINTF 1 + +/* Define to 1 if you have the `vsnprintf' function. */ +#define HAVE_VSNPRINTF 1 + +/* Define to 1 if you have the `vsyslog' function. */ +#define HAVE_VSYSLOG 1 + +/* Name of package */ +#define PACKAGE "" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "michael at metaparadigm.com" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "JSON C Library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "JSON C Library 0.3" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "json-c" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "0.3" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "0.3" + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to rpl_malloc if the replacement function should be used. */ +/* #undef malloc */ + +/* Define to rpl_realloc if the replacement function should be used. */ +/* #undef realloc */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ Added: freeswitch/trunk/src/mod/applications/mod_http/debug.c ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/debug.c Wed Dec 10 16:43:26 2008 @@ -0,0 +1,94 @@ +/* + * $Id: debug.c,v 1.5 2006/01/26 02:16:28 mclark Exp $ + * + * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. + * Michael Clark + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See COPYING for details. + * + */ + +#include "config.h" + +#include +#include +#include +#include + +#if HAVE_SYSLOG_H +# include +#endif /* HAVE_SYSLOG_H */ + +#if HAVE_UNISTD_H +# include +#endif /* HAVE_UNISTD_H */ + +#if HAVE_SYS_PARAM_H +#include +#endif /* HAVE_SYS_PARAM_H */ + +#include "debug.h" + +static int _syslog = 0; +static int _debug = 0; + +void mc_set_debug(int debug) { _debug = debug; } +int mc_get_debug() { return _debug; } + +extern void mc_set_syslog(int syslog) +{ + _syslog = syslog; +} + +void mc_abort(const char *msg, ...) +{ + va_list ap; + va_start(ap, msg); +#if HAVE_VSYSLOG + if(_syslog) { + vsyslog(LOG_ERR, msg, ap); + } else +#endif + vprintf(msg, ap); + exit(1); +} + + +void mc_debug(const char *msg, ...) +{ + va_list ap; + if(_debug) { + va_start(ap, msg); +#if HAVE_VSYSLOG + if(_syslog) { + vsyslog(LOG_DEBUG, msg, ap); + } else +#endif + vprintf(msg, ap); + } +} + +void mc_error(const char *msg, ...) +{ + va_list ap; + va_start(ap, msg); +#if HAVE_VSYSLOG + if(_syslog) { + vsyslog(LOG_ERR, msg, ap); + } else +#endif + vfprintf(stderr, msg, ap); +} + +void mc_info(const char *msg, ...) +{ + va_list ap; + va_start(ap, msg); +#if HAVE_VSYSLOG + if(_syslog) { + vsyslog(LOG_INFO, msg, ap); + } else +#endif + vfprintf(stderr, msg, ap); +} Added: freeswitch/trunk/src/mod/applications/mod_http/debug.h ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/debug.h Wed Dec 10 16:43:26 2008 @@ -0,0 +1,24 @@ +/* + * $Id: debug.h,v 1.5 2006/01/30 23:07:57 mclark Exp $ + * + * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. + * Michael Clark + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See COPYING for details. + * + */ + +#ifndef _DEBUG_H_ +#define _DEBUG_H_ + +extern void mc_set_debug(int debug); +extern int mc_get_debug(); + +extern void mc_set_syslog(int syslog); +extern void mc_abort(const char *msg, ...); +extern void mc_debug(const char *msg, ...); +extern void mc_error(const char *msg, ...); +extern void mc_info(const char *msg, ...); + +#endif Added: freeswitch/trunk/src/mod/applications/mod_http/http_req.c ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/http_req.c Wed Dec 10 16:43:26 2008 @@ -0,0 +1,680 @@ +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2008, Eric des Courtis + * + * 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. + * + * Eric des Courtis + * Copyright (C) Benbria. All Rights Reserved. + * + * Contributor(s): + * + * Eric des Courtis + * + * + * http_req.c -- HTTP client implementation + * + */ + +#include "http_req.h" + +/* +extern int dprintf(int, const char *, ...); +extern int isblank(int); +*/ + +/* NOTE: v = version, header = h, status = s, newline = n, phrase = p */ +static accept_state_t state_start(char c, state_machine_t *sm); +static accept_state_t state_shp (char c, state_machine_t *sm); +static accept_state_t state_n (char c, state_machine_t *sm); +static accept_state_t state_vhp_A(char c, state_machine_t *sm); +static accept_state_t state_vhp_B(char c, state_machine_t *sm); +static accept_state_t state_vhp_C(char c, state_machine_t *sm); +static accept_state_t state_vhp_D(char c, state_machine_t *sm); +static accept_state_t state_vhp_E(char c, state_machine_t *sm); +static accept_state_t state_vhp_F(char c, state_machine_t *sm); +static accept_state_t state_vhp_G(char c, state_machine_t *sm); +static accept_state_t state_vhp_H(char c, state_machine_t *sm); +static accept_state_t state_hp_A (char c, state_machine_t *sm); +static accept_state_t state_hp_B (char c, state_machine_t *sm); +static accept_state_t state_p (char c, state_machine_t *sm); +static accept_state_t state_error(char c, state_machine_t *sm); + +static int read_all(int s, char *buf, size_t len); + +#ifdef DEBUG +int main(int argc, char *argv[]) +{ + http_response_t response; + http_request_t request; + int ret; + int i; + + if(argc != 2) return EXIT_FAILURE; + + request.method = GET; + request.version = DEFAULT_HTTP_VERSION; + request.url = argv[1]; + request.header_len = 0; + request.body_len = 0; + + ret = http_req(&request, &response); + if(ret == ERROR) return EXIT_FAILURE; + + printf("Version : %s\n", response.version); + printf("Status Code : %d\n", response.status_code); + printf("Phrase : %s\n", response.phrase); + + for(i = 0; i < response.header_len; i++){ + printf( + "Header : key = [%s] value = [%s]\n", + response.headers[i].field_name, response.headers[i].value + ); + } + + fflush(stdout); + write(STDOUT_FILENO, response.body, response.body_len); + printf("\n"); + + free_http_response(&response); + + return EXIT_SUCCESS; +} +#endif + +int http_req(http_request_t *req, http_response_t *res) +{ + uint32_t addr; + int s; + int ret; + uint16_t port = 0; + size_t len; + struct sockaddr_in sck; + struct hostent *hst; + char *hostname; + char *method; + char *buf; + int buf_len; + ssize_t i; + int j; + int l; + int m; + int p; + int q = 0; + char f = HTTP_FALSE; + char port_s[MAX_PORT_LEN]; + sighandler_t sig; + struct timeval tv; + + tv.tv_sec = 1; + tv.tv_usec = 0; + + + (void)memset(&sck, 0, sizeof(sck)); + + sig = signal(SIGPIPE, SIG_IGN); + if(sig == SIG_ERR){ + fprintf(stderr, "Cannot ignore SIGPIPE signal\n"); + return ERROR; + } + + s = socket(PF_INET, SOCK_STREAM, 0); + if(s == ERROR){ + perror("Could not create socket"); + return ERROR; + } + + (void)setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)); + (void)setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv)); + + len = strlen(req->url); + hostname = (char *)malloc(len * sizeof(char) + 1); + if(hostname == NULL){ + perror("Could not allocate memory for hostname"); + close(s); + return ERROR; + } + + EMPTY_STRING(hostname); + + l = strlen(req->url) + 1; + m = strlen("http://"); + for(p = 0, j = m; j < l; j++){ + if(req->url[j] == ':'){ + strncpy(hostname, req->url + m, j - m); + hostname[j - m] = '\0'; + f = HTTP_TRUE; + p = j; + continue; + } + + if((req->url[j] == '/' || req->url[j] == '\0') && f == HTTP_TRUE){ + if((j - p) < MAX_PORT_LEN){ + strncpy(port_s, req->url + p + 1, j - p); + port_s[j - p] = '\0'; + port = (uint16_t)atoi(port_s); + }else port = 0; + q = j; + break; + } + + if((req->url[j] == '/' || req->url[j] == '\0') && f == HTTP_FALSE){ + strncpy(hostname, req->url + m, j - m); + hostname[j - m] = '\0'; + port = DEFAULT_HTTP_PORT; + q = j; + break; + } + } + + if(port == 0 || hostname[0] == '\0'){ + fprintf(stderr, "Invalid URL\n"); + close(s); + free(hostname); + return ERROR; + } + + l = strlen(hostname); + for(j = 0; j < l; j++){ + if(hostname[j] == '/'){ + hostname[j] = '\0'; + break; + } + } + + hst = gethostbyname(hostname); + if(hst == NULL){ + herror("Could not find host"); + close(s); + free(hostname); + return ERROR; + } + + addr = *((uint32_t *)hst->h_addr_list[0]); + + sck.sin_family = AF_INET; + sck.sin_port = htons(port); + sck.sin_addr.s_addr = addr; + + ret = connect(s, (struct sockaddr *)&sck, sizeof(sck)); + if(ret == ERROR){ + perror("Could not connect to host"); + close(s); + free(hostname); + return ERROR; + } + + switch(req->method){ + case GET: + method = HTTP_GET_METHOD; + break; + case HEAD: + method = HTTP_HEAD_METHOD; + break; + case POST: + method = HTTP_POST_METHOD; + break; + case DELETE: + method = HTTP_DELETE_METHOD; + break; + case PUT: + method = HTTP_PUT_METHOD; + break; + default: + method = HTTP_GET_METHOD; + } + + if(req->url[q] == '/'){ + dprintf(s, "%s %s HTTP/%s\r\n", method, req->url + q, req->version); + }else{ + dprintf(s, "%s /%s HTTP/%s\r\n", method, req->url + q, req->version); + } + + if(port != DEFAULT_HTTP_PORT) + dprintf(s, "Host: %s:%d\r\n", hostname, port); + else dprintf(s, "Host: %s\r\n", hostname); + dprintf(s, "Connection: close\r\n"); + dprintf(s, "Content-Length: %d\r\n", req->body_len); + + for(i = 0; i < req->header_len; i++){ + dprintf( + s, + "%s: %s\r\n", + req->headers[i].field_name, + req->headers[i].value + ); + } + + dprintf(s, "\r\n"); + + + if(req->body != NULL && req->body_len != 0){ + ret = write(s, req->body, req->body_len); + if(ret == ERROR){ + perror("Could not write body to socket"); + free(hostname); + return ERROR; + } + } + + buf = (char *)malloc(RECV_BUFF_SIZE * sizeof(char)); + if(buf == NULL){ + perror("Could not allocate memory for buffer"); + close(s); + free(hostname); + return ERROR; + } + + buf_len = read_all(s, buf, RECV_BUFF_SIZE -1); + if(buf_len == ERROR){ + perror("Could not read into buffer"); + free(hostname); + return ERROR; + } + buf[buf_len] = '\0'; + + close(s); + + (void)signal(SIGPIPE, sig); + free(hostname); + return http_parse_response(buf, buf_len, res); +} + +int http_parse_response(char *buf, ssize_t buf_len, http_response_t *response) +{ + token_t token; + state_machine_t sm; + int pos; + ssize_t size; + char buff[STATUS_CODE_LEN]; + int old_pos; + int nt; + int i; + int j; + int f; + + INIT_STATE_MACHINE(&sm); + + sm.buf = buf; + sm.buf_len = buf_len; + + pos = sm.pos; + token = get_next_token(&sm); + if(token != VERSION){ + fprintf(stderr, "ERROR %d-%d\n", VERSION, token); + return ERROR; + } + + size = sm.pos - pos; + response->version = (char *)malloc((size + 1) * sizeof(char)); + if(response->version == NULL){ + perror("Cannot allocate memory for version number"); + return ERROR; + } + strncpy(response->version, sm.buf + pos, size); + response->version[size] = '\0'; + + pos = sm.pos; + token = get_next_token(&sm); + if(token != STATUS_CODE){ + fprintf(stderr, "ERROR %d-%d\n", STATUS_CODE, token); + return ERROR; + } + + size = sm.pos - pos; + + buff[STATUS_CODE_LEN - 1] = '\0'; + strncpy(buff, sm.buf + pos, STATUS_CODE_LEN - 1); + + response->status_code = atoi(buff); + + pos = sm.pos; + token = get_next_token(&sm); + if(token != PHRASE){ + fprintf(stderr, "ERROR %d-%d\n", PHRASE, token); + return ERROR; + } + + size = sm.pos - pos - 2; + response->phrase = (char *)malloc((size + 1) * sizeof(char)); + if(response->phrase == NULL){ + perror("Cannot allocate memory for phrase"); + return ERROR; + } + strncpy(response->phrase, sm.buf + pos, size); + response->phrase[size] = '\0'; + + old_pos = sm.pos; + nt = 0; + f = HTTP_FALSE; + do{ + token = get_next_token(&sm); + switch(token){ + case PHRASE: + case STATUS_CODE: + f = HTTP_FALSE; + case VERSION: + case NEWLINE: + break; + case HEADER: + if(f == HTTP_FALSE){ + nt++; + f = HTTP_TRUE; + } + else f = HTTP_FALSE; + break; + case SYNTAX_ERROR: + return ERROR; + } + + if(token != HEADER && token != PHRASE && token != STATUS_CODE) break; + }while(token != SYNTAX_ERROR); + + if(nt != 0){ + response->headers = (http_header_t *)malloc(sizeof(http_header_t)*nt); + if(response->headers == NULL){ + perror("Could not allocate memory for headers"); + return ERROR; + } + }else response->headers = NULL; + + response->header_len = nt; + + sm.pos = old_pos; + for(i = 0; i < nt; i++){ + pos = sm.pos; + sm.state = state_start; + sm.stop = HTTP_FALSE; + token = get_next_token(&sm); + size = sm.pos - pos; + size -= 2; + + response->headers[i].field_name = + (char *)malloc((size + 1) * sizeof(char)); + + if(response->headers[i].field_name == NULL){ + perror("Could not allocate memory for header"); + return ERROR; + } + + strncpy(response->headers[i].field_name, sm.buf + pos, size); + response->headers[i].field_name[size] = '\0'; + + pos = sm.pos; + token = get_next_token(&sm); + if(token == HEADER || token == STATUS_CODE){ + for(j = 0; + ((sm.buf + pos)[j] == '\r' + && (sm.buf + pos)[j + 1] == '\n') == 0; + j++ + ); + size = j; + sm.pos = j + 2; + }else size = sm.pos - pos - 2; + + response->headers[i].value = + (char *)malloc((size + 1) * sizeof(char)); + + if(response->headers[i].value == NULL){ + perror("Could not allocate memory for header"); + return ERROR; + } + strncpy(response->headers[i].value, sm.buf + pos, size); + response->headers[i].value[size] = '\0'; + + } + + pos = sm.pos; + token = get_next_token(&sm); + if(token != NEWLINE){ + fprintf(stderr, "ERROR %d-%d\n", NEWLINE, token); + return ERROR; + } + + + response->body = (char *)malloc((buf_len - sm.pos + 1) * sizeof(char)); + if(response->body == NULL){ + perror("Could not allocate memory for body"); + return ERROR; + } + + response->body_len = buf_len - sm.pos; + response->body[response->body_len] = '\0'; + + (void)memcpy(response->body, buf + sm.pos, response->body_len); + + return SUCCESS; +} + +void free_http_response(http_response_t *response) +{ + free(response->version); + free(response->phrase); + if(response->headers != NULL) free(response->headers); + if(response->body != NULL) free(response->body); +} + +token_t get_next_token(state_machine_t *sm) +{ + char c; + accept_state_t accept; + + while(sm->stop != HTTP_TRUE){ + c = sm->buf[sm->pos]; + accept = sm->state(c, sm); + switch(accept){ + case NOAS: + case ASNR: + sm->pos++; + case ASWR: + break; + } + + switch(accept){ + case ASNR: + case ASWR: + sm->state = state_start; + return sm->token; + case NOAS: + break; + } + + if(sm->pos >= sm->buf_len){ + sm->stop = HTTP_TRUE; + break; + } + } + + return SYNTAX_ERROR; +} + +static accept_state_t state_start(char c, state_machine_t *sm) +{ + if(toupper(c) == 'H') sm->state = state_vhp_A; + else if(isdigit(c)) sm->state = state_shp; + else if(c == '\r' || c == '\n') sm->state = state_n; + else if(isprint(c)) sm->state = state_hp_A; + else sm->state = state_error; + + return NOAS; +} + +static accept_state_t state_shp(char c, state_machine_t *sm) +{ + if(isdigit(c)) sm->state = state_shp; + else if(isblank(c)){ + sm->token = STATUS_CODE; + return ASNR; + }else if(c == ':') sm->state = state_hp_B; + else if(c == '\r' || c == '\n') sm->state = state_p; + else if(isprint(c)) sm->state = state_hp_A; + else sm->state = state_error; + + return NOAS; +} + +static accept_state_t state_n(char c, state_machine_t *sm) +{ + if(c == '\r' || c == '\n'){ + sm->token = NEWLINE; + return ASNR; + }else if(c == ':') sm->state = state_hp_B; + else if(isprint(c)) sm->state = state_hp_A; + else sm->state = state_error; + + return NOAS; +} + +static accept_state_t state_vhp_A(char c, state_machine_t *sm) +{ + if(toupper(c) == 'T') sm->state = state_vhp_B; + else if(isprint(c)) sm->state = state_hp_A; + else if(c == '\n' || c == '\r') sm->state = state_p; + else sm->state = state_error; + + return NOAS; +} + +static accept_state_t state_vhp_B(char c, state_machine_t *sm) +{ + if(toupper(c) == 'T') sm->state = state_vhp_C; + else if(isprint(c)) sm->state = state_hp_A; + else if(c == '\n' || c == '\r') sm->state = state_p; + else sm->state = state_error; + + return NOAS; +} + +static accept_state_t state_vhp_C(char c, state_machine_t *sm) +{ + if(toupper(c) == 'P') sm->state = state_vhp_D; + else if(isprint(c)) sm->state = state_hp_A; + else if(c == '\n' || c == '\r') sm->state = state_p; + else sm->state = state_error; + + return NOAS; +} + +static accept_state_t state_vhp_D(char c, state_machine_t *sm) +{ + if(toupper(c) == '/') sm->state = state_vhp_E; + else if(isprint(c)) sm->state = state_hp_A; + else if(c == '\n' || c == '\r') sm->state = state_p; + else sm->state = state_error; + + return NOAS; +} + +static accept_state_t state_vhp_E(char c, state_machine_t *sm) +{ + if(isdigit(c)) sm->state = state_vhp_F; + else if(isprint(c)) sm->state = state_hp_A; + else if(c == '\n' || c == '\r') sm->state = state_p; + else sm->state = state_error; + + return NOAS; +} + +static accept_state_t state_vhp_F(char c, state_machine_t *sm) +{ + if(isdigit(c)) sm->state = state_vhp_F; + else if(c == '.') sm->state = state_vhp_G; + else if(isprint(c)) sm->state = state_hp_A; + else if(c == '\n' || c == '\r') sm->state = state_p; + else sm->state = state_error; + + return NOAS; +} + +static accept_state_t state_vhp_G(char c, state_machine_t *sm) +{ + if(isdigit(c)) sm->state = state_vhp_H; + else if(isprint(c)) sm->state = state_hp_A; + else if(c == '\n' || c == '\r') sm->state = state_p; + else sm->state = state_error; + + return NOAS; +} + +static accept_state_t state_vhp_H(char c, state_machine_t *sm) +{ + if(isdigit(c)) sm->state = state_vhp_H; + else if(isblank(c)){ + sm->token = VERSION; + return ASNR; + + }else if(isprint(c)) sm->state = state_hp_A; + + return NOAS; +} + +static accept_state_t state_hp_A(char c, state_machine_t *sm) +{ + if(c == ':') sm->state = state_hp_B; + else if(c == '\r' || c == '\n') sm->state = state_p; + else if(isprint(c)) sm->state = state_hp_A; + else sm->state = state_error; + + return NOAS; +} + +static accept_state_t state_hp_B(char c, state_machine_t *sm) +{ + if(isblank(c)){ + sm->token = HEADER; + return ASNR; + } else if(c == '\r' || c == '\n') sm->state = state_p; + else if(c == ':') sm->state = state_hp_B; + else if(isprint(c)) sm->state = state_hp_A; + else sm->state = state_error; + + return NOAS; +} + +static accept_state_t state_p(char c, state_machine_t *sm) +{ + if(c == '\r' || c == '\n'){ + sm->token = PHRASE; + return ASNR; + }else if(c == ':') sm->state = state_hp_B; + else if(isprint(c)) sm->state = state_hp_A; + else sm->state = state_error; + + return NOAS; +} + +static accept_state_t state_error(char c, state_machine_t *sm) +{ + c = 0; + sm->token = SYNTAX_ERROR; + + return ASNR; +} + +static int read_all(int s, char *buf, size_t len) +{ + size_t t; + size_t r = ERROR; + + for(t = 0; t < len && r != 0;){ + r = read(s, buf + t, len - t); + if((int)r == ERROR){ + return ERROR; + }else{ + t += r; + } + } + + return (int)t; +} + Added: freeswitch/trunk/src/mod/applications/mod_http/http_req.h ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/http_req.h Wed Dec 10 16:43:26 2008 @@ -0,0 +1,138 @@ +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2008, Eric des Courtis + * + * 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. + * + * Eric des Courtis + * Copyright (C) Benbria. All Rights Reserved. + * + * Contributor(s): + * + * Eric des Courtis + * + * + * http_req.h -- HTTP client implementation + * + */ + +#ifndef __HTTP_REQ_H__ +#define __HTTP_REQ_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define ERROR -1 +#define SUCCESS 0 +#define EMPTY_STRING(s) s[0] = '\0' + +#define DEFAULT_HTTP_VERSION "1.1" +#define DEFAULT_HTTP_PORT 80 + +#define HTTP_GET_METHOD "GET" +#define HTTP_HEAD_METHOD "HEAD" +#define HTTP_POST_METHOD "POST" +#define HTTP_DELETE_METHOD "DELETE" +#define HTTP_PUT_METHOD "PUT" + +#define MAX_PORT_LEN 6 + +#define RECV_BUFF_SIZE 65536 + +#define HTTP_TRUE 1 +#define HTTP_FALSE 0 + +#define INIT_STATE_MACHINE(m) \ +do {\ + (m)->pos = 0;\ + (m)->buf = NULL;\ + (m)->token = SYNTAX_ERROR;\ + (m)->stop = HTTP_FALSE;\ + (m)->state = state_start;\ +} while(0) + +#define STATUS_CODE_LEN 4 + +typedef enum tokens { + VERSION, + STATUS_CODE, + PHRASE, + HEADER, + NEWLINE, + SYNTAX_ERROR +} token_t; + +typedef enum accept_states { + ASWR, + ASNR, + NOAS +} accept_state_t; + +typedef struct state_machines { + accept_state_t (*state)(char, struct state_machines *); + int pos; + char *buf; + ssize_t buf_len; + int stop; + token_t token; +} state_machine_t; + +typedef enum http_methods { + GET, + HEAD, + POST, + DELETE, + PUT +} http_method_t; + +typedef struct http_headers { + char *field_name; + char *value; +} http_header_t; + +typedef struct http_requests { + http_method_t method; + char *version; + char *url; + http_header_t *headers; + ssize_t header_len; + char *body; + ssize_t body_len; +} http_request_t; + +typedef struct http_responses { + char *version; + int status_code; + char *phrase; + http_header_t *headers; + ssize_t header_len; + char *body; + int body_len; +} http_response_t; + +token_t get_next_token(state_machine_t *sm); +int http_parse_response(char *buf, ssize_t buf_len, http_response_t *response); +int http_req(http_request_t *req, http_response_t *res); +void free_http_response(http_response_t *response); + +#endif Added: freeswitch/trunk/src/mod/applications/mod_http/json.h ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/json.h Wed Dec 10 16:43:26 2008 @@ -0,0 +1,31 @@ +/* + * $Id: json.h,v 1.6 2006/01/26 02:16:28 mclark Exp $ + * + * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. + * Michael Clark + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See COPYING for details. + * + */ + +#ifndef _json_h_ +#define _json_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "bits.h" +#include "debug.h" +#include "linkhash.h" +#include "arraylist.h" +#include "json_util.h" +#include "json_object.h" +#include "json_tokener.h" + +#ifdef __cplusplus +} +#endif + +#endif Added: freeswitch/trunk/src/mod/applications/mod_http/json_object.c ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/json_object.c Wed Dec 10 16:43:26 2008 @@ -0,0 +1,510 @@ +/* + * $Id: json_object.c,v 1.17 2006/07/25 03:24:50 mclark Exp $ + * + * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. + * Michael Clark + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See COPYING for details. + * + */ + +#include "config.h" + +#include +#include +#include + +#include "debug.h" +#include "printbuf.h" +#include "linkhash.h" +#include "arraylist.h" +#include "json_object.h" +#include "json_object_private.h" +#include "json_tokener.h" + +#if !HAVE_STRNDUP + + char* strndup(const char* str, size_t n); + +#endif /* !HAVE_STRNDUP */ + +/* #define REFCOUNT_DEBUG 1 */ + +char *json_number_chars = "0123456789.+-e"; +char *json_hex_chars = "0123456789abcdef"; + +#ifdef REFCOUNT_DEBUG +static char* json_type_name[] = { + "null", + "boolean", + "double", + "int", + "object", + "array", + "string", +}; +#endif /* REFCOUNT_DEBUG */ + +static void json_object_generic_delete(struct json_object* this); +static struct json_object* json_object_new(enum json_type o_type); + + +/* ref count debugging */ + +#ifdef REFCOUNT_DEBUG + +static struct lh_table *json_object_table; + +static void json_object_init() __attribute__ ((constructor)); +static void json_object_init() { + mc_debug("json_object_init: creating object table\n"); + json_object_table = lh_kptr_table_new(128, "json_object_table", NULL); +} + +static void json_object_fini() __attribute__ ((destructor)); +static void json_object_fini() { + struct lh_entry *ent; + if(mc_get_debug() && json_object_table->count) { + mc_debug("json_object_fini: %d referenced objects at exit\n", + json_object_table->count); + lh_foreach(json_object_table, ent) { + struct json_object* obj = (struct json_object*)ent->v; + mc_debug("\t%s:%p\n", json_type_name[obj->o_type], obj); + } + } + mc_debug("json_object_fini: freeing object table\n"); + lh_table_free(json_object_table); +} +#endif /* REFCOUNT_DEBUG */ + + +/* string escaping */ + +static int json_escape_str(struct printbuf *pb, char *str) +{ + int pos = 0, start_offset = 0; + unsigned char c; + do { + c = str[pos]; + switch(c) { + case '\0': + break; + case '\b': + case '\n': + case '\r': + case '\t': + case '"': + case '\\': + case '/': + if(pos - start_offset > 0) + printbuf_memappend(pb, str + start_offset, pos - start_offset); + if(c == '\b') printbuf_memappend(pb, "\\b", 2); + else if(c == '\n') printbuf_memappend(pb, "\\n", 2); + else if(c == '\r') printbuf_memappend(pb, "\\r", 2); + else if(c == '\t') printbuf_memappend(pb, "\\t", 2); + else if(c == '"') printbuf_memappend(pb, "\\\"", 2); + else if(c == '\\') printbuf_memappend(pb, "\\\\", 2); + else if(c == '/') printbuf_memappend(pb, "\\/", 2); + start_offset = ++pos; + break; + default: + if(c < ' ') { + if(pos - start_offset > 0) + printbuf_memappend(pb, str + start_offset, pos - start_offset); + sprintbuf(pb, "\\u00%c%c", + json_hex_chars[c >> 4], + json_hex_chars[c & 0xf]); + start_offset = ++pos; + } else pos++; + } + } while(c); + if(pos - start_offset > 0) + printbuf_memappend(pb, str + start_offset, pos - start_offset); + return 0; +} + + +/* reference counting */ + +extern struct json_object* json_object_get(struct json_object *this) +{ + if(this) { + this->_ref_count++; + } + return this; +} + +extern void json_object_put(struct json_object *this) +{ + if(this) { + this->_ref_count--; + if(!this->_ref_count) this->_delete(this); + } +} + + +/* generic object construction and destruction parts */ + +static void json_object_generic_delete(struct json_object* this) +{ +#ifdef REFCOUNT_DEBUG + mc_debug("json_object_delete_%s: %p\n", + json_type_name[this->o_type], this); + lh_table_delete(json_object_table, this); +#endif /* REFCOUNT_DEBUG */ + printbuf_free(this->_pb); + free(this); +} + +static struct json_object* json_object_new(enum json_type o_type) +{ + struct json_object *this = calloc(sizeof(struct json_object), 1); + if(!this) return NULL; + this->o_type = o_type; + this->_ref_count = 1; + this->_delete = &json_object_generic_delete; +#ifdef REFCOUNT_DEBUG + lh_table_insert(json_object_table, this, this); + mc_debug("json_object_new_%s: %p\n", json_type_name[this->o_type], this); +#endif /* REFCOUNT_DEBUG */ + return this; +} + + +/* type checking functions */ + +int json_object_is_type(struct json_object *this, enum json_type type) +{ + return (this->o_type == type); +} + +enum json_type json_object_get_type(struct json_object *this) +{ + return this->o_type; +} + + +/* json_object_to_json_string */ + +char* json_object_to_json_string(struct json_object *this) +{ + if(!this) return "null"; + if(!this->_pb) { + if(!(this->_pb = printbuf_new())) return NULL; + } else { + printbuf_reset(this->_pb); + } + if(this->_to_json_string(this, this->_pb) < 0) return NULL; + return this->_pb->buf; +} + + +/* json_object_object */ + +static int json_object_object_to_json_string(struct json_object* this, + struct printbuf *pb) +{ + int i=0; + struct json_object_iter iter; + sprintbuf(pb, "{"); + + /* CAW: scope operator to make ANSI correctness */ + /* CAW: switched to json_object_object_foreachC which uses an iterator struct */ + json_object_object_foreachC(this, iter) { + if(i) sprintbuf(pb, ","); + sprintbuf(pb, " \""); + json_escape_str(pb, iter.key); + sprintbuf(pb, "\": "); + if(iter.val == NULL) sprintbuf(pb, "null"); + else iter.val->_to_json_string(iter.val, pb); + i++; + } + + return sprintbuf(pb, " }"); +} + +static void json_object_lh_entry_free(struct lh_entry *ent) +{ + free(ent->k); + json_object_put((struct json_object*)ent->v); +} + +static void json_object_object_delete(struct json_object* this) +{ + lh_table_free(this->o.c_object); + json_object_generic_delete(this); +} + +struct json_object* json_object_new_object() +{ + struct json_object *this = json_object_new(json_type_object); + if(!this) return NULL; + this->_delete = &json_object_object_delete; + this->_to_json_string = &json_object_object_to_json_string; + this->o.c_object = lh_kchar_table_new(JSON_OBJECT_DEF_HASH_ENTIRES, + NULL, &json_object_lh_entry_free); + return this; +} + +struct lh_table* json_object_get_object(struct json_object *this) +{ + if(!this) return NULL; + switch(this->o_type) { + case json_type_object: + return this->o.c_object; + default: + return NULL; + } +} + +void json_object_object_add(struct json_object* this, char *key, + struct json_object *val) +{ + lh_table_delete(this->o.c_object, key); + lh_table_insert(this->o.c_object, strdup(key), val); +} + +struct json_object* json_object_object_get(struct json_object* this, char *key) +{ + return (struct json_object*) lh_table_lookup(this->o.c_object, key); +} + +void json_object_object_del(struct json_object* this, char *key) +{ + lh_table_delete(this->o.c_object, key); +} + + +/* json_object_boolean */ + +static int json_object_boolean_to_json_string(struct json_object* this, + struct printbuf *pb) +{ + if(this->o.c_boolean) return sprintbuf(pb, "true"); + else return sprintbuf(pb, "false"); +} + +struct json_object* json_object_new_boolean(boolean b) +{ + struct json_object *this = json_object_new(json_type_boolean); + if(!this) return NULL; + this->_to_json_string = &json_object_boolean_to_json_string; + this->o.c_boolean = b; + return this; +} + +boolean json_object_get_boolean(struct json_object *this) +{ + if(!this) return FALSE; + switch(this->o_type) { + case json_type_boolean: + return this->o.c_boolean; + case json_type_int: + return (this->o.c_int != 0); + case json_type_double: + return (this->o.c_double != 0); + case json_type_string: + if(strlen(this->o.c_string)) return TRUE; + default: + return TRUE; + } +} + + +/* json_object_int */ + +static int json_object_int_to_json_string(struct json_object* this, + struct printbuf *pb) +{ + return sprintbuf(pb, "%d", this->o.c_int); +} + +struct json_object* json_object_new_int(int i) +{ + struct json_object *this = json_object_new(json_type_int); + if(!this) return NULL; + this->_to_json_string = &json_object_int_to_json_string; + this->o.c_int = i; + return this; +} + +int json_object_get_int(struct json_object *this) +{ + int cint; + + if(!this) return 0; + switch(this->o_type) { + case json_type_int: + return this->o.c_int; + case json_type_double: + return (int)this->o.c_double; + case json_type_boolean: + return this->o.c_boolean; + case json_type_string: + if(sscanf(this->o.c_string, "%d", &cint) == 1) return cint; + default: + return 0; + } +} + + +/* json_object_double */ + +static int json_object_double_to_json_string(struct json_object* this, + struct printbuf *pb) +{ + return sprintbuf(pb, "%lf", this->o.c_double); +} + +struct json_object* json_object_new_double(double d) +{ + struct json_object *this = json_object_new(json_type_double); + if(!this) return NULL; + this->_to_json_string = &json_object_double_to_json_string; + this->o.c_double = d; + return this; +} + +double json_object_get_double(struct json_object *this) +{ + double cdouble; + + if(!this) return 0.0; + switch(this->o_type) { + case json_type_double: + return this->o.c_double; + case json_type_int: + return this->o.c_int; + case json_type_boolean: + return this->o.c_boolean; + case json_type_string: + if(sscanf(this->o.c_string, "%lf", &cdouble) == 1) return cdouble; + default: + return 0.0; + } +} + + +/* json_object_string */ + +static int json_object_string_to_json_string(struct json_object* this, + struct printbuf *pb) +{ + sprintbuf(pb, "\""); + json_escape_str(pb, this->o.c_string); + sprintbuf(pb, "\""); + return 0; +} + +static void json_object_string_delete(struct json_object* this) +{ + free(this->o.c_string); + json_object_generic_delete(this); +} + +struct json_object* json_object_new_string(char *s) +{ + struct json_object *this = json_object_new(json_type_string); + if(!this) return NULL; + this->_delete = &json_object_string_delete; + this->_to_json_string = &json_object_string_to_json_string; + this->o.c_string = strdup(s); + return this; +} + +struct json_object* json_object_new_string_len(char *s, int len) +{ + struct json_object *this = json_object_new(json_type_string); + if(!this) return NULL; + this->_delete = &json_object_string_delete; + this->_to_json_string = &json_object_string_to_json_string; + this->o.c_string = strndup(s, len); + return this; +} + +char* json_object_get_string(struct json_object *this) +{ + if(!this) return NULL; + switch(this->o_type) { + case json_type_string: + return this->o.c_string; + default: + return json_object_to_json_string(this); + } +} + + +/* json_object_array */ + +static int json_object_array_to_json_string(struct json_object* this, + struct printbuf *pb) +{ + int i; + sprintbuf(pb, "["); + for(i=0; i < json_object_array_length(this); i++) { + struct json_object *val; + if(i) { sprintbuf(pb, ", "); } + else { sprintbuf(pb, " "); } + + val = json_object_array_get_idx(this, i); + if(val == NULL) { sprintbuf(pb, "null"); } + else { val->_to_json_string(val, pb); } + } + return sprintbuf(pb, " ]"); +} + +static void json_object_array_entry_free(void *data) +{ + json_object_put((struct json_object*)data); +} + +static void json_object_array_delete(struct json_object* this) +{ + array_list_free(this->o.c_array); + json_object_generic_delete(this); +} + +struct json_object* json_object_new_array() +{ + struct json_object *this = json_object_new(json_type_array); + if(!this) return NULL; + this->_delete = &json_object_array_delete; + this->_to_json_string = &json_object_array_to_json_string; + this->o.c_array = array_list_new(&json_object_array_entry_free); + return this; +} + +struct array_list* json_object_get_array(struct json_object *this) +{ + if(!this) return NULL; + switch(this->o_type) { + case json_type_array: + return this->o.c_array; + default: + return NULL; + } +} + +int json_object_array_length(struct json_object *this) +{ + return array_list_length(this->o.c_array); +} + +int json_object_array_add(struct json_object *this,struct json_object *val) +{ + return array_list_add(this->o.c_array, val); +} + +int json_object_array_put_idx(struct json_object *this, int idx, + struct json_object *val) +{ + return array_list_put_idx(this->o.c_array, idx, val); +} + +struct json_object* json_object_array_get_idx(struct json_object *this, + int idx) +{ + return (struct json_object*)array_list_get_idx(this->o.c_array, idx); +} + Added: freeswitch/trunk/src/mod/applications/mod_http/json_object.h ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/json_object.h Wed Dec 10 16:43:26 2008 @@ -0,0 +1,308 @@ +/* + * $Id: json_object.h,v 1.12 2006/01/30 23:07:57 mclark Exp $ + * + * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. + * Michael Clark + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See COPYING for details. + * + */ + +#ifndef _json_object_h_ +#define _json_object_h_ + +#define JSON_OBJECT_DEF_HASH_ENTIRES 16 + +#undef FALSE +#define FALSE ((boolean)0) + +#undef TRUE +#define TRUE ((boolean)1) + +extern char *json_number_chars; +extern char *json_hex_chars; + +/* forward structure definitions */ + +typedef int boolean; +struct printbuf; +struct lh_table; +struct array_list; +struct json_object; +struct json_object_iter; + +/* supported object types */ + +enum json_type { + json_type_null, + json_type_boolean, + json_type_double, + json_type_int, + json_type_object, + json_type_array, + json_type_string +}; + +/* reference counting functions */ + +/** + * Increment the reference count of json_object + * @param obj the json_object instance + */ +extern struct json_object* json_object_get(struct json_object *obj); + +/** + * Decrement the reference count of json_object and free if it reaches zero + * @param obj the json_object instance + */ +extern void json_object_put(struct json_object *obj); + + +/** + * Check if the json_object is of a given type + * @param obj the json_object instance + * @param type one of: + json_type_boolean, + json_type_double, + json_type_int, + json_type_object, + json_type_array, + json_type_string, + */ +extern int json_object_is_type(struct json_object *obj, enum json_type type); + +/** + * Get the type of the json_object + * @param obj the json_object instance + * @returns type being one of: + json_type_boolean, + json_type_double, + json_type_int, + json_type_object, + json_type_array, + json_type_string, + */ +extern enum json_type json_object_get_type(struct json_object *obj); + + +/** Stringify object to json format + * @param obj the json_object instance + * @returns a string in JSON format + */ +extern char* json_object_to_json_string(struct json_object *obj); + + +/* object type methods */ + +/** Create a new empty object + * @returns a json_object of type json_type_object + */ +extern struct json_object* json_object_new_object(); + +/** Get the hashtable of a json_object of type json_type_object + * @param obj the json_object instance + * @returns a linkhash + */ +extern struct lh_table* json_object_get_object(struct json_object *obj); + +/** Add an object field to a json_object of type json_type_object + * + * The reference count will *not* be incremented. This is to make adding + * fields to objects in code more compact. If you want to retain a reference + * to an added object you must wrap the passed object with json_object_get + * + * @param obj the json_object instance + * @param key the object field name (a private copy will be duplicated) + * @param val a json_object or NULL member to associate with the given field + */ +extern void json_object_object_add(struct json_object* obj, char *key, + struct json_object *val); + +/** Get the json_object associate with a given object field + * @param obj the json_object instance + * @param key the object field name + * @returns the json_object associated with the given field name + */ +extern struct json_object* json_object_object_get(struct json_object* obj, + char *key); + +/** Delete the given json_object field + * + * The reference count will be decremented for the deleted object + * + * @param obj the json_object instance + * @param key the object field name + */ +extern void json_object_object_del(struct json_object* obj, char *key); + +/** Iterate through all keys and values of an object + * @param obj the json_object instance + * @param key the local name for the char* key variable defined in the body + * @param val the local name for the json_object* object variable defined in the body + */ +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) + +# define json_object_object_foreach(obj,key,val) \ + for(entry = json_object_get_object(obj)->head; ({ if(entry) { key = (char*)entry->k; val = (struct json_object*)entry->v; } ; entry; }); entry = entry->next ) + +#else /* ANSI C or MSC */ + +# define json_object_object_foreach(obj,key,val) \ + for(entry = json_object_get_object(obj)->head; (entry ? (key = (char*)entry->k, val = (struct json_object*)entry->v, entry) : 0); entry = entry->next) + +#endif /* defined(__GNUC__) && !defined(__STRICT_ANSI__) */ + +/** Iterate through all keys and values of an object (ANSI C Safe) + * @param obj the json_object instance + * @param iter the object iterator + */ +#define json_object_object_foreachC(obj,iter) \ + for(iter.entry = json_object_get_object(obj)->head; (iter.entry ? (iter.key = (char*)iter.entry->k, iter.val = (struct json_object*)iter.entry->v, iter.entry) : 0); iter.entry = iter.entry->next) + +/* Array type methods */ + +/** Create a new empty json_object of type json_type_array + * @returns a json_object of type json_type_array + */ +extern struct json_object* json_object_new_array(); + +/** Get the arraylist of a json_object of type json_type_array + * @param obj the json_object instance + * @returns an arraylist + */ +extern struct array_list* json_object_get_array(struct json_object *obj); + +/** Get the length of a json_object of type json_type_array + * @param obj the json_object instance + * @returns an int + */ +extern int json_object_array_length(struct json_object *obj); + +/** Add an element to the end of a json_object of type json_type_array + * + * The reference count will *not* be incremented. This is to make adding + * fields to objects in code more compact. If you want to retain a reference + * to an added object you must wrap the passed object with json_object_get + * + * @param obj the json_object instance + * @param val the json_object to be added + */ +extern int json_object_array_add(struct json_object *obj, + struct json_object *val); + +/** Insert or replace an element at a specified index in an array (a json_object of type json_type_array) + * + * The reference count will *not* be incremented. This is to make adding + * fields to objects in code more compact. If you want to retain a reference + * to an added object you must wrap the passed object with json_object_get + * + * The reference count of a replaced object will be decremented. + * + * The array size will be automatically be expanded to the size of the + * index if the index is larger than the current size. + * + * @param obj the json_object instance + * @param idx the index to insert the element at + * @param val the json_object to be added + */ +extern int json_object_array_put_idx(struct json_object *obj, int idx, + struct json_object *val); + +/** Get the element at specificed index of the array (a json_object of type json_type_array) + * @param obj the json_object instance + * @param idx the index to get the element at + * @returns the json_object at the specified index (or NULL) + */ +extern struct json_object* json_object_array_get_idx(struct json_object *obj, + int idx); + +/* boolean type methods */ + +/** Create a new empty json_object of type json_type_boolean + * @param b a boolean TRUE or FALSE (0 or 1) + * @returns a json_object of type json_type_boolean + */ +extern struct json_object* json_object_new_boolean(boolean b); + +/** Get the boolean value of a json_object + * + * The type is coerced to a boolean if the passed object is not a boolean. + * integer and double objects will return FALSE if there value is zero + * or TRUE otherwise. If the passed object is a string it will return + * TRUE if it has a non zero length. If any other object type is passed + * TRUE will be returned if the object is not NULL. + * + * @param obj the json_object instance + * @returns a boolean + */ +extern boolean json_object_get_boolean(struct json_object *obj); + + +/* int type methods */ + +/** Create a new empty json_object of type json_type_int + * @param i the integer + * @returns a json_object of type json_type_int + */ +extern struct json_object* json_object_new_int(int i); + +/** Get the int value of a json_object + * + * The type is coerced to a int if the passed object is not a int. + * double objects will return their integer conversion. Strings will be + * parsed as an integer. If no conversion exists then 0 is returned. + * + * @param obj the json_object instance + * @returns an int + */ +extern int json_object_get_int(struct json_object *obj); + + +/* double type methods */ + +/** Create a new empty json_object of type json_type_double + * @param d the double + * @returns a json_object of type json_type_double + */ +extern struct json_object* json_object_new_double(double d); + +/** Get the double value of a json_object + * + * The type is coerced to a double if the passed object is not a double. + * integer objects will return their dboule conversion. Strings will be + * parsed as a double. If no conversion exists then 0.0 is returned. + * + * @param obj the json_object instance + * @returns an double + */ +extern double json_object_get_double(struct json_object *obj); + + +/* string type methods */ + +/** Create a new empty json_object of type json_type_string + * + * A copy of the string is made and the memory is managed by the json_object + * + * @param s the string + * @returns a json_object of type json_type_string + */ +extern struct json_object* json_object_new_string(char *s); + +extern struct json_object* json_object_new_string_len(char *s, int len); + +/** Get the string value of a json_object + * + * If the passed object is not of type json_type_string then the JSON + * representation of the object is returned. + * + * The returned string memory is managed by the json_object and will + * be freed when the reference count of the json_object drops to zero. + * + * @param obj the json_object instance + * @returns a string + */ +extern char* json_object_get_string(struct json_object *obj); + +#endif Added: freeswitch/trunk/src/mod/applications/mod_http/json_object_private.h ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/json_object_private.h Wed Dec 10 16:43:26 2008 @@ -0,0 +1,44 @@ +/* + * $Id: json_object_private.h,v 1.4 2006/01/26 02:16:28 mclark Exp $ + * + * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. + * Michael Clark + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See COPYING for details. + * + */ + +#ifndef _json_object_private_h_ +#define _json_object_private_h_ + +typedef void (json_object_delete_fn)(struct json_object *o); +typedef int (json_object_to_json_string_fn)(struct json_object *o, + struct printbuf *pb); + +struct json_object +{ + enum json_type o_type; + json_object_delete_fn *_delete; + json_object_to_json_string_fn *_to_json_string; + int _ref_count; + struct printbuf *_pb; + union data { + boolean c_boolean; + double c_double; + int c_int; + struct lh_table *c_object; + struct array_list *c_array; + char *c_string; + } o; +}; + +/* CAW: added for ANSI C iteration correctness */ +struct json_object_iter +{ + char *key; + struct json_object *val; + struct lh_entry *entry; +}; + +#endif Added: freeswitch/trunk/src/mod/applications/mod_http/json_tokener.c ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/json_tokener.c Wed Dec 10 16:43:26 2008 @@ -0,0 +1,520 @@ +/* + * $Id: json_tokener.c,v 1.20 2006/07/25 03:24:50 mclark Exp $ + * + * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. + * Michael Clark + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See COPYING for details. + * + */ + +#include "config.h" + +#include +#include +#include +#include + +#include "bits.h" +#include "debug.h" +#include "printbuf.h" +#include "arraylist.h" +#include "json_object.h" +#include "json_tokener.h" + + +#if !HAVE_STRNCASECMP && defined(_MSC_VER) + /* MSC has the version as _strnicmp */ +# define strncasecmp _strnicmp +#elif !HAVE_STRNCASECMP +# error You do not have strncasecmp on your system. +#endif /* HAVE_STRNCASECMP */ + + +static const char* json_null_str = "null"; +static const char* json_true_str = "true"; +static const char* json_false_str = "false"; + +const char* json_tokener_errors[] = { + "success", + "continue", + "nesting to deep", + "unexpected end of data", + "unexpected character", + "null expected", + "boolean expected", + "number expected", + "array value separator ',' expected", + "quoted object property name expected", + "object property name separator ':' expected", + "object value separator ',' expected", + "invalid string sequence", + "expected comment", +}; + + +struct json_tokener* json_tokener_new() +{ + struct json_tokener *tok = calloc(1, sizeof(struct json_tokener)); + tok->pb = printbuf_new(); + json_tokener_reset(tok); + return tok; +} + +void json_tokener_free(struct json_tokener *tok) +{ + json_tokener_reset(tok); + if(tok) printbuf_free(tok->pb); + free(tok); +} + +static void json_tokener_reset_level(struct json_tokener *tok, int depth) +{ + tok->stack[depth].state = json_tokener_state_eatws; + tok->stack[depth].saved_state = json_tokener_state_start; + json_object_put(tok->stack[depth].current); + tok->stack[depth].current = NULL; + free(tok->stack[depth].obj_field_name); + tok->stack[depth].obj_field_name = NULL; +} + +void json_tokener_reset(struct json_tokener *tok) +{ + int i; + for(i = tok->depth; i >= 0; i--) + json_tokener_reset_level(tok, i); + tok->depth = 0; + tok->err = json_tokener_success; +} + +struct json_object* json_tokener_parse(char *str) +{ + struct json_tokener* tok; + struct json_object* obj; + + tok = json_tokener_new(); + obj = json_tokener_parse_ex(tok, str, -1); + if(tok->err != json_tokener_success) + obj = error_ptr(-tok->err); + json_tokener_free(tok); + return obj; +} + + +#if !HAVE_STRNDUP +/* CAW: compliant version of strndup() */ +char* strndup(const char* str, size_t n) +{ + if(str) { + size_t len = strlen(str); + size_t nn = min(len,n); + char* s = (char*)malloc(sizeof(char) * (nn + 1)); + + if(s) { + memcpy(s, str, nn); + s[nn] = '\0'; + } + + return s; + } + + return NULL; +} +#endif + + +#define state tok->stack[tok->depth].state +#define saved_state tok->stack[tok->depth].saved_state +#define current tok->stack[tok->depth].current +#define obj_field_name tok->stack[tok->depth].obj_field_name + +struct json_object* json_tokener_parse_ex(struct json_tokener *tok, + char *str, int len) +{ + struct json_object *obj = NULL; + char c; + + tok->char_offset = 0; + tok->err = json_tokener_success; + + do { + if(tok->char_offset == len) { + if(tok->depth == 0 && state == json_tokener_state_eatws && + saved_state == json_tokener_state_finish) + tok->err = json_tokener_success; + else + tok->err = json_tokener_continue; + goto out; + } + + c = *str; + redo_char: + switch(state) { + + case json_tokener_state_eatws: + if(isspace(c)) { + /* okay */ + } else if(c == '/') { + printbuf_reset(tok->pb); + printbuf_memappend(tok->pb, &c, 1); + state = json_tokener_state_comment_start; + } else { + state = saved_state; + goto redo_char; + } + break; + + case json_tokener_state_start: + switch(c) { + case '{': + state = json_tokener_state_eatws; + saved_state = json_tokener_state_object_field_start; + current = json_object_new_object(); + break; + case '[': + state = json_tokener_state_eatws; + saved_state = json_tokener_state_array; + current = json_object_new_array(); + break; + case 'N': + case 'n': + state = json_tokener_state_null; + printbuf_reset(tok->pb); + tok->st_pos = 0; + goto redo_char; + case '"': + case '\'': + state = json_tokener_state_string; + printbuf_reset(tok->pb); + tok->quote_char = c; + break; + case 'T': + case 't': + case 'F': + case 'f': + state = json_tokener_state_boolean; + printbuf_reset(tok->pb); + tok->st_pos = 0; + goto redo_char; +/* +#if defined(__GNUC__) + case '0' ... '9': +#else +*/ + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': +/* +#endif +*/ + case '-': + state = json_tokener_state_number; + printbuf_reset(tok->pb); + tok->is_double = 0; + goto redo_char; + default: + tok->err = json_tokener_error_parse_unexpected; + goto out; + } + break; + + case json_tokener_state_finish: + if(tok->depth == 0) goto out; + obj = json_object_get(current); + json_tokener_reset_level(tok, tok->depth); + tok->depth--; + goto redo_char; + + case json_tokener_state_null: + printbuf_memappend(tok->pb, &c, 1); + if(strncasecmp(json_null_str, tok->pb->buf, + min(tok->st_pos+1, strlen(json_null_str))) == 0) { + if(tok->st_pos == strlen(json_null_str)) { + current = NULL; + saved_state = json_tokener_state_finish; + state = json_tokener_state_eatws; + goto redo_char; + } + } else { + tok->err = json_tokener_error_parse_null; + goto out; + } + tok->st_pos++; + break; + + case json_tokener_state_comment_start: + if(c == '*') { + state = json_tokener_state_comment; + } else if(c == '/') { + state = json_tokener_state_comment_eol; + } else { + tok->err = json_tokener_error_parse_comment; + goto out; + } + printbuf_memappend(tok->pb, &c, 1); + break; + + case json_tokener_state_comment: + if(c == '*') state = json_tokener_state_comment_end; + printbuf_memappend(tok->pb, &c, 1); + break; + + case json_tokener_state_comment_eol: + if(c == '\n') { + mc_debug("json_tokener_comment: %s\n", tok->pb->buf); + state = json_tokener_state_eatws; + } else { + printbuf_memappend(tok->pb, &c, 1); + } + break; + + case json_tokener_state_comment_end: + printbuf_memappend(tok->pb, &c, 1); + if(c == '/') { + mc_debug("json_tokener_comment: %s\n", tok->pb->buf); + state = json_tokener_state_eatws; + } else { + state = json_tokener_state_comment; + } + break; + + case json_tokener_state_string: + if(c == tok->quote_char) { + current = json_object_new_string(tok->pb->buf); + saved_state = json_tokener_state_finish; + state = json_tokener_state_eatws; + } else if(c == '\\') { + saved_state = json_tokener_state_string; + state = json_tokener_state_string_escape; + } else { + printbuf_memappend(tok->pb, &c, 1); + } + break; + + case json_tokener_state_string_escape: + switch(c) { + case '"': + case '\\': + case '/': + printbuf_memappend(tok->pb, &c, 1); + state = saved_state; + break; + case 'b': + case 'n': + case 'r': + case 't': + if(c == 'b') printbuf_memappend(tok->pb, "\b", 1); + else if(c == 'n') printbuf_memappend(tok->pb, "\n", 1); + else if(c == 'r') printbuf_memappend(tok->pb, "\r", 1); + else if(c == 't') printbuf_memappend(tok->pb, "\t", 1); + state = saved_state; + break; + case 'u': + tok->ucs_char = 0; + tok->st_pos = 0; + state = json_tokener_state_escape_unicode; + break; + default: + tok->err = json_tokener_error_parse_string; + goto out; + } + break; + + case json_tokener_state_escape_unicode: + if(strchr(json_hex_chars, c)) { + tok->ucs_char += ((unsigned int)hexdigit(c) << ((3-tok->st_pos++)*4)); + if(tok->st_pos == 4) { + unsigned char utf_out[3]; + if (tok->ucs_char < 0x80) { + utf_out[0] = tok->ucs_char; + printbuf_memappend(tok->pb, (char*)utf_out, 1); + } else if (tok->ucs_char < 0x800) { + utf_out[0] = 0xc0 | (tok->ucs_char >> 6); + utf_out[1] = 0x80 | (tok->ucs_char & 0x3f); + printbuf_memappend(tok->pb, (char*)utf_out, 2); + } else { + utf_out[0] = 0xe0 | (tok->ucs_char >> 12); + utf_out[1] = 0x80 | ((tok->ucs_char >> 6) & 0x3f); + utf_out[2] = 0x80 | (tok->ucs_char & 0x3f); + printbuf_memappend(tok->pb, (char*)utf_out, 3); + } + state = saved_state; + } + } else { + tok->err = json_tokener_error_parse_string; + goto out; + } + break; + + case json_tokener_state_boolean: + printbuf_memappend(tok->pb, &c, 1); + if(strncasecmp(json_true_str, tok->pb->buf, + min(tok->st_pos+1, strlen(json_true_str))) == 0) { + if(tok->st_pos == strlen(json_true_str)) { + current = json_object_new_boolean(1); + saved_state = json_tokener_state_finish; + state = json_tokener_state_eatws; + goto redo_char; + } + } else if(strncasecmp(json_false_str, tok->pb->buf, + min(tok->st_pos+1, strlen(json_false_str))) == 0) { + if(tok->st_pos == strlen(json_false_str)) { + current = json_object_new_boolean(0); + saved_state = json_tokener_state_finish; + state = json_tokener_state_eatws; + goto redo_char; + } + } else { + tok->err = json_tokener_error_parse_boolean; + goto out; + } + tok->st_pos++; + break; + + case json_tokener_state_number: + if(c && strchr(json_number_chars, c)) { + printbuf_memappend(tok->pb, &c, 1); + if(c == '.' || c == 'e') tok->is_double = 1; + } else { + int numi; + double numd; + if(!tok->is_double && sscanf(tok->pb->buf, "%d", &numi) == 1) { + current = json_object_new_int(numi); + } else if(tok->is_double && sscanf(tok->pb->buf, "%lf", &numd) == 1) { + current = json_object_new_double(numd); + } else { + tok->err = json_tokener_error_parse_number; + goto out; + } + saved_state = json_tokener_state_finish; + state = json_tokener_state_eatws; + goto redo_char; + } + break; + + case json_tokener_state_array: + if(c == ']') { + saved_state = json_tokener_state_finish; + state = json_tokener_state_eatws; + } else { + if(tok->depth >= JSON_TOKENER_MAX_DEPTH-1) { + tok->err = json_tokener_error_depth; + goto out; + } + state = json_tokener_state_array_add; + tok->depth++; + json_tokener_reset_level(tok, tok->depth); + goto redo_char; + } + break; + + case json_tokener_state_array_add: + json_object_array_add(current, obj); + saved_state = json_tokener_state_array_sep; + state = json_tokener_state_eatws; + goto redo_char; + + case json_tokener_state_array_sep: + if(c == ']') { + saved_state = json_tokener_state_finish; + state = json_tokener_state_eatws; + } else if(c == ',') { + saved_state = json_tokener_state_array; + state = json_tokener_state_eatws; + } else { + tok->err = json_tokener_error_parse_array; + goto out; + } + break; + + case json_tokener_state_object_field_start: + if(c == '}') { + saved_state = json_tokener_state_finish; + state = json_tokener_state_eatws; + } else if (c == '"' || c == '\'') { + tok->quote_char = c; + printbuf_reset(tok->pb); + state = json_tokener_state_object_field; + } else { + tok->err = json_tokener_error_parse_object_key_name; + goto out; + } + break; + + case json_tokener_state_object_field: + if(c == tok->quote_char) { + obj_field_name = strdup(tok->pb->buf); + saved_state = json_tokener_state_object_field_end; + state = json_tokener_state_eatws; + } else if(c == '\\') { + saved_state = json_tokener_state_object_field; + state = json_tokener_state_string_escape; + } else { + printbuf_memappend(tok->pb, &c, 1); + } + break; + + case json_tokener_state_object_field_end: + if(c == ':') { + saved_state = json_tokener_state_object_value; + state = json_tokener_state_eatws; + } else { + tok->err = json_tokener_error_parse_object_key_sep; + goto out; + } + break; + + case json_tokener_state_object_value: + if(tok->depth >= JSON_TOKENER_MAX_DEPTH-1) { + tok->err = json_tokener_error_depth; + goto out; + } + state = json_tokener_state_object_value_add; + tok->depth++; + json_tokener_reset_level(tok, tok->depth); + goto redo_char; + + case json_tokener_state_object_value_add: + json_object_object_add(current, obj_field_name, obj); + free(obj_field_name); + obj_field_name = NULL; + saved_state = json_tokener_state_object_sep; + state = json_tokener_state_eatws; + goto redo_char; + + case json_tokener_state_object_sep: + if(c == '}') { + saved_state = json_tokener_state_finish; + state = json_tokener_state_eatws; + } else if(c == ',') { + saved_state = json_tokener_state_object_field_start; + state = json_tokener_state_eatws; + } else { + tok->err = json_tokener_error_parse_object_value_sep; + goto out; + } + break; + + } + str++; + tok->char_offset++; + } while(c); + + if(state != json_tokener_state_finish && + saved_state != json_tokener_state_finish) + tok->err = json_tokener_error_parse_eof; + + out: + if(tok->err == json_tokener_success) return json_object_get(current); + mc_debug("json_tokener_parse_ex: error %s at offset %d\n", + json_tokener_errors[tok->err], tok->char_offset); + return NULL; +} Added: freeswitch/trunk/src/mod/applications/mod_http/json_tokener.h ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/json_tokener.h Wed Dec 10 16:43:26 2008 @@ -0,0 +1,89 @@ +/* + * $Id: json_tokener.h,v 1.10 2006/07/25 03:24:50 mclark Exp $ + * + * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. + * Michael Clark + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See COPYING for details. + * + */ + +#ifndef _json_tokener_h_ +#define _json_tokener_h_ + +#include "json_object.h" + +enum json_tokener_error { + json_tokener_success, + json_tokener_continue, + json_tokener_error_depth, + json_tokener_error_parse_eof, + json_tokener_error_parse_unexpected, + json_tokener_error_parse_null, + json_tokener_error_parse_boolean, + json_tokener_error_parse_number, + json_tokener_error_parse_array, + json_tokener_error_parse_object_key_name, + json_tokener_error_parse_object_key_sep, + json_tokener_error_parse_object_value_sep, + json_tokener_error_parse_string, + json_tokener_error_parse_comment +}; + +enum json_tokener_state { + json_tokener_state_eatws, + json_tokener_state_start, + json_tokener_state_finish, + json_tokener_state_null, + json_tokener_state_comment_start, + json_tokener_state_comment, + json_tokener_state_comment_eol, + json_tokener_state_comment_end, + json_tokener_state_string, + json_tokener_state_string_escape, + json_tokener_state_escape_unicode, + json_tokener_state_boolean, + json_tokener_state_number, + json_tokener_state_array, + json_tokener_state_array_add, + json_tokener_state_array_sep, + json_tokener_state_object_field_start, + json_tokener_state_object_field, + json_tokener_state_object_field_end, + json_tokener_state_object_value, + json_tokener_state_object_value_add, + json_tokener_state_object_sep +}; + +struct json_tokener_srec +{ + enum json_tokener_state state, saved_state; + struct json_object *obj; + struct json_object *current; + char *obj_field_name; +}; + +#define JSON_TOKENER_MAX_DEPTH 32 + +struct json_tokener +{ + char *str; + struct printbuf *pb; + int depth, is_double, st_pos, char_offset; + enum json_tokener_error err; + unsigned int ucs_char; + char quote_char; + struct json_tokener_srec stack[JSON_TOKENER_MAX_DEPTH]; +}; + +extern const char* json_tokener_errors[]; + +extern struct json_tokener* json_tokener_new(); +extern void json_tokener_free(struct json_tokener *tok); +extern void json_tokener_reset(struct json_tokener *tok); +extern struct json_object* json_tokener_parse(char *str); +extern struct json_object* json_tokener_parse_ex(struct json_tokener *tok, + char *str, int len); + +#endif Added: freeswitch/trunk/src/mod/applications/mod_http/json_util.c ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/json_util.c Wed Dec 10 16:43:26 2008 @@ -0,0 +1,121 @@ +/* + * $Id: json_util.c,v 1.4 2006/01/30 23:07:57 mclark Exp $ + * + * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. + * Michael Clark + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See COPYING for details. + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include + +#if HAVE_SYS_TYPES_H +#include +#endif /* HAVE_SYS_TYPES_H */ + +#if HAVE_SYS_STAT_H +#include +#endif /* HAVE_SYS_STAT_H */ + +#if HAVE_FCNTL_H +#include +#endif /* HAVE_FCNTL_H */ + +#if HAVE_UNISTD_H +# include +#endif /* HAVE_UNISTD_H */ + +#ifdef WIN32 +# define WIN32_LEAN_AND_MEAN +# include +# include +#endif /* defined(WIN32) */ + +#if !HAVE_OPEN && defined(WIN32) +# define open _open +#endif + + +#include "bits.h" +#include "debug.h" +#include "printbuf.h" +#include "json_object.h" +#include "json_tokener.h" +#include "json_util.h" + +struct json_object* json_object_from_file(char *filename) +{ + struct printbuf *pb; + struct json_object *obj; + char buf[JSON_FILE_BUF_SIZE]; + int fd, ret; + + if((fd = open(filename, O_RDONLY)) < 0) { + mc_error("json_object_from_file: error reading file %s: %s\n", + filename, strerror(errno)); + return error_ptr(-1); + } + if(!(pb = printbuf_new())) { + mc_error("json_object_from_file: printbuf_new failed\n"); + return error_ptr(-1); + } + while((ret = read(fd, buf, JSON_FILE_BUF_SIZE)) > 0) { + printbuf_memappend(pb, buf, ret); + } + close(fd); + if(ret < 0) { + mc_abort("json_object_from_file: error reading file %s: %s\n", + filename, strerror(errno)); + printbuf_free(pb); + return error_ptr(-1); + } + obj = json_tokener_parse(pb->buf); + printbuf_free(pb); + return obj; +} + +int json_object_to_file(char *filename, struct json_object *obj) +{ + char *json_str; + int fd, ret; + unsigned int wpos, wsize; + + if(!obj) { + mc_error("json_object_to_file: object is null\n"); + return -1; + } + + if((fd = open(filename, O_WRONLY | O_TRUNC | O_CREAT, 0644)) < 0) { + mc_error("json_object_to_file: error opening file %s: %s\n", + filename, strerror(errno)); + return -1; + } + + if(!(json_str = json_object_to_json_string(obj))) { return -1; } + + + wsize = (unsigned int)(strlen(json_str) & UINT_MAX); /* CAW: probably unnecessary, but the most 64bit safe */ + wpos = 0; + while(wpos < wsize) { + if((ret = write(fd, json_str + wpos, wsize-wpos)) < 0) { + close(fd); + mc_error("json_object_to_file: error writing file %s: %s\n", + filename, strerror(errno)); + return -1; + } + + /* because of the above check for ret < 0, we can safely cast and add */ + wpos += (unsigned int)ret; + } + + close(fd); + return 0; +} Added: freeswitch/trunk/src/mod/applications/mod_http/json_util.h ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/json_util.h Wed Dec 10 16:43:26 2008 @@ -0,0 +1,23 @@ +/* + * $Id: json_util.h,v 1.4 2006/01/30 23:07:57 mclark Exp $ + * + * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. + * Michael Clark + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See COPYING for details. + * + */ + +#ifndef _json_util_h_ +#define _json_util_h_ + +#include "json_object.h" + +#define JSON_FILE_BUF_SIZE 4096 + +/* utlitiy functions */ +extern struct json_object* json_object_from_file(char *filename); +extern int json_object_to_file(char *filename, struct json_object *obj); + +#endif Added: freeswitch/trunk/src/mod/applications/mod_http/linkhash.c ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/linkhash.c Wed Dec 10 16:43:26 2008 @@ -0,0 +1,217 @@ +/* + * $Id: linkhash.c,v 1.4 2006/01/26 02:16:28 mclark Exp $ + * + * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. + * Michael Clark + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See COPYING for details. + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include "linkhash.h" + +void lh_abort(const char *msg, ...) +{ + va_list ap; + va_start(ap, msg); + vprintf(msg, ap); + exit(1); +} + +unsigned long lh_ptr_hash(void *k) +{ + /* CAW: refactored to be 64bit nice */ + return (unsigned long)((((ptrdiff_t)k * LH_PRIME) >> 4) & ULONG_MAX); +} + +int lh_ptr_equal(void *k1, void *k2) +{ + return (k1 == k2); +} + +unsigned long lh_char_hash(void *k) +{ + unsigned int h = 0; + const char* data = k; + + while( *data!=0 ) h = h*129 + (unsigned int)(*data++) + LH_PRIME; + + return h; +} + +int lh_char_equal(void *k1, void *k2) +{ + return (strcmp((char*)k1, (char*)k2) == 0); +} + +struct lh_table* lh_table_new(int size, char *name, + lh_entry_free_fn *free_fn, + lh_hash_fn *hash_fn, + lh_equal_fn *equal_fn) +{ + int i; + struct lh_table *t; + + t = calloc(1, sizeof(struct lh_table)); + if(!t) lh_abort("lh_table_new: calloc failed\n"); + t->count = 0; + t->size = size; + t->name = name; + t->table = calloc(size, sizeof(struct lh_entry)); + if(!t->table) lh_abort("lh_table_new: calloc failed\n"); + t->free_fn = free_fn; + t->hash_fn = hash_fn; + t->equal_fn = equal_fn; + for(i = 0; i < size; i++) t->table[i].k = LH_EMPTY; + return t; +} + +struct lh_table* lh_kchar_table_new(int size, char *name, + lh_entry_free_fn *free_fn) +{ + return lh_table_new(size, name, free_fn, lh_char_hash, lh_char_equal); +} + +struct lh_table* lh_kptr_table_new(int size, char *name, + lh_entry_free_fn *free_fn) +{ + return lh_table_new(size, name, free_fn, lh_ptr_hash, lh_ptr_equal); +} + +void lh_table_resize(struct lh_table *t, int new_size) +{ + struct lh_table *new_t; + struct lh_entry *ent; + + new_t = lh_table_new(new_size, t->name, NULL, t->hash_fn, t->equal_fn); + ent = t->head; + while(ent) { + lh_table_insert(new_t, ent->k, ent->v); + ent = ent->next; + } + free(t->table); + t->table = new_t->table; + t->size = new_size; + t->head = new_t->head; + t->tail = new_t->tail; + t->resizes++; + free(new_t); +} + +void lh_table_free(struct lh_table *t) +{ + struct lh_entry *c; + for(c = t->head; c != NULL; c = c->next) { + if(t->free_fn) { + t->free_fn(c); + } + } + free(t->table); + free(t); +} + + +int lh_table_insert(struct lh_table *t, void *k, void *v) +{ + unsigned long h, n; + + t->inserts++; + if(t->count > t->size * 0.66) lh_table_resize(t, t->size * 2); + + h = t->hash_fn(k); + n = h % t->size; + + while( 1 ) { + if(t->table[n].k == LH_EMPTY || t->table[n].k == LH_FREED) break; + t->collisions++; + if(++n == t->size) n = 0; + } + + t->table[n].k = k; + t->table[n].v = v; + t->count++; + + if(t->head == NULL) { + t->head = t->tail = &t->table[n]; + t->table[n].next = t->table[n].prev = NULL; + } else { + t->tail->next = &t->table[n]; + t->table[n].prev = t->tail; + t->table[n].next = NULL; + t->tail = &t->table[n]; + } + + return 0; +} + + +struct lh_entry* lh_table_lookup_entry(struct lh_table *t, void *k) +{ + unsigned long h = t->hash_fn(k); + unsigned long n = h % t->size; + + t->lookups++; + while( 1 ) { + if(t->table[n].k == LH_EMPTY) return NULL; + if(t->table[n].k != LH_FREED && + t->equal_fn(t->table[n].k, k)) return &t->table[n]; + if(++n == t->size) n = 0; + } + return NULL; +} + + +void* lh_table_lookup(struct lh_table *t, void *k) +{ + struct lh_entry *e = lh_table_lookup_entry(t, k); + if(e) return e->v; + return NULL; +} + + +int lh_table_delete_entry(struct lh_table *t, struct lh_entry *e) +{ + ptrdiff_t n = (ptrdiff_t)(e - t->table); /* CAW: fixed to be 64bit nice, still need the crazy negative case... */ + + /* CAW: this is bad, really bad, maybe stack goes other direction on this machine... */ + if(n < 0) { return -2; } + + if(t->table[n].k == LH_EMPTY || t->table[n].k == LH_FREED) return -1; + t->count--; + if(t->free_fn) t->free_fn(e); + t->table[n].v = NULL; + t->table[n].k = LH_FREED; + if(t->tail == &t->table[n] && t->head == &t->table[n]) { + t->head = t->tail = NULL; + } else if (t->head == &t->table[n]) { + t->head->next->prev = NULL; + t->head = t->head->next; + } else if (t->tail == &t->table[n]) { + t->tail->prev->next = NULL; + t->tail = t->tail->prev; + } else { + t->table[n].prev->next = t->table[n].next; + t->table[n].next->prev = t->table[n].prev; + } + t->table[n].next = t->table[n].prev = NULL; + return 0; +} + + +int lh_table_delete(struct lh_table *t, void *k) +{ + struct lh_entry *e = lh_table_lookup_entry(t, k); + if(!e) return -1; + return lh_table_delete_entry(t, e); +} + Added: freeswitch/trunk/src/mod/applications/mod_http/linkhash.h ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/linkhash.h Wed Dec 10 16:43:26 2008 @@ -0,0 +1,261 @@ +/* + * $Id: linkhash.h,v 1.6 2006/01/30 23:07:57 mclark Exp $ + * + * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. + * Michael Clark + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See COPYING for details. + * + */ + +#ifndef _linkhash_h_ +#define _linkhash_h_ + +/** + * golden prime used in hash functions + */ +#define LH_PRIME 0x9e370001UL + +/** + * sentinel pointer value for empty slots + */ +#define LH_EMPTY (void*)-1 + +/** + * sentinel pointer value for freed slots + */ +#define LH_FREED (void*)-2 + +struct lh_entry; + +/** + * callback function prototypes + */ +typedef void (lh_entry_free_fn) (struct lh_entry *e); +/** + * callback function prototypes + */ +typedef unsigned long (lh_hash_fn) (void *k); +/** + * callback function prototypes + */ +typedef int (lh_equal_fn) (void *k1, void *k2); + +/** + * An entry in the hash table + */ +struct lh_entry { + /** + * The key. + */ + void *k; + /** + * The value. + */ + void *v; + /** + * The next entry + */ + struct lh_entry *next; + /** + * The previous entry. + */ + struct lh_entry *prev; +}; + + +/** + * The hash table structure. + */ +struct lh_table { + /** + * Size of our hash. + */ + int size; + /** + * Numbers of entries. + */ + int count; + + /** + * Number of collisions. + */ + int collisions; + + /** + * Number of resizes. + */ + int resizes; + + /** + * Number of lookups. + */ + int lookups; + + /** + * Number of inserts. + */ + int inserts; + + /** + * Number of deletes. + */ + int deletes; + + /** + * Name of the hash table. + */ + char *name; + + /** + * The first entry. + */ + struct lh_entry *head; + + /** + * The last entry. + */ + struct lh_entry *tail; + + struct lh_entry *table; + + /** + * A pointer onto the function responsible for freeing an entry. + */ + lh_entry_free_fn *free_fn; + lh_hash_fn *hash_fn; + lh_equal_fn *equal_fn; +}; + + +/** + * Pre-defined hash and equality functions + */ +extern unsigned long lh_ptr_hash(void *k); +extern int lh_ptr_equal(void *k1, void *k2); + +extern unsigned long lh_char_hash(void *k); +extern int lh_char_equal(void *k1, void *k2); + + +/** + * Convenience list iterator. + */ +#define lh_foreach(table, entry) \ +for(entry = table->head; entry; entry = entry->next) + +/** + * lh_foreach_safe allows calling of deletion routine while iterating. + */ +#define lh_foreach_safe(table, entry, tmp) \ +for(entry = table->head; entry && ((tmp = entry->next) || 1); entry = tmp) + + + +/** + * Create a new linkhash table. + * @param size initial table size. The table is automatically resized + * although this incurs a performance penalty. + * @param name the table name. + * @param free_fn callback function used to free memory for entries + * when lh_table_free or lh_table_delete is called. + * If NULL is provided, then memory for keys and values + * must be freed by the caller. + * @param hash_fn function used to hash keys. 2 standard ones are defined: + * lh_ptr_hash and lh_char_hash for hashing pointer values + * and C strings respectively. + * @param equal_fn comparison function to compare keys. 2 standard ones defined: + * lh_ptr_hash and lh_char_hash for comparing pointer values + * and C strings respectively. + * @return a pointer onto the linkhash table. + */ +extern struct lh_table* lh_table_new(int size, char *name, + lh_entry_free_fn *free_fn, + lh_hash_fn *hash_fn, + lh_equal_fn *equal_fn); + +/** + * Convenience function to create a new linkhash + * table with char keys. + * @param size initial table size. + * @param name table name. + * @param free_fn callback function used to free memory for entries. + * @return a pointer onto the linkhash table. + */ +extern struct lh_table* lh_kchar_table_new(int size, char *name, + lh_entry_free_fn *free_fn); + + +/** + * Convenience function to create a new linkhash + * table with ptr keys. + * @param size initial table size. + * @param name table name. + * @param free_fn callback function used to free memory for entries. + * @return a pointer onto the linkhash table. + */ +extern struct lh_table* lh_kptr_table_new(int size, char *name, + lh_entry_free_fn *free_fn); + + +/** + * Free a linkhash table. + * If a callback free function is provided then it is called for all + * entries in the table. + * @param t table to free. + */ +extern void lh_table_free(struct lh_table *t); + + +/** + * Insert a record into the table. + * @param t the table to insert into. + * @param k a pointer to the key to insert. + * @param v a pointer to the value to insert. + */ +extern int lh_table_insert(struct lh_table *t, void *k, void *v); + + +/** + * Lookup a record into the table. + * @param t the table to lookup + * @param k a pointer to the key to lookup + * @return a pointer to the record structure of the value or NULL if it does not exist. + */ +extern struct lh_entry* lh_table_lookup_entry(struct lh_table *t, void *k); + +/** + * Lookup a record into the table + * @param t the table to lookup + * @param k a pointer to the key to lookup + * @return a pointer to the found value or NULL if it does not exist. + */ +extern void* lh_table_lookup(struct lh_table *t, void *k); + + +/** + * Delete a record from the table. + * If a callback free function is provided then it is called for the + * for the item being deleted. + * @param t the table to delete from. + * @param e a pointer to the entry to delete. + * @return 0 if the item was deleted. + * @return -1 if it was not found. + */ +extern int lh_table_delete_entry(struct lh_table *t, struct lh_entry *e); + + +/** + * Delete a record from the table. + * If a callback free function is provided then it is called for the + * for the item being deleted. + * @param t the table to delete from. + * @param k a pointer to the key to delete. + * @return 0 if the item was deleted. + * @return -1 if it was not found. + */ +extern int lh_table_delete(struct lh_table *t, void *k); + + +#endif Added: freeswitch/trunk/src/mod/applications/mod_http/mod_http.c ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/mod_http.c Wed Dec 10 16:43:26 2008 @@ -0,0 +1,356 @@ +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2008, Eric des Courtis + * + * 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. + * + * Eric des Courtis + * Copyright (C) Benbria. All Rights Reserved. + * + * Contributor(s): + * + * Eric des Courtis + * + * + * mod_http.c -- HTTP client implementation for FreeSWITCH + * + * The purpose is to provide laguages like LUA with a _fast_ HTTP + * client implementation. + * + * Support for SSL will be provided in future versions. + * Initial release does not include win32 support. + * + */ + +#include +#include +#include +#include +#include +#include +#include "json.h" + +#include "http_req.h" +#include "url_encoding.h" + +#define HTTP_SYNTAX " [urlejson_body]" +#define HTTP_PARAMS 4 +#define HTTP_BUFFER_SIZE (256 * 1024) + +/* SWITCH_STANDARD_API(http_api_main); */ + +#define MAX_MEMLOCS 512 +#define GARBAGE_TYPES_INIT() \ +typedef struct memloc{\ + void *p;\ + LIST_ENTRY(memloc) memlocs;\ +} memloc_t + +#define GARBAGE_CLEANUP() \ +do{\ + for(memloc_p = head.lh_first; memloc_p != NULL; \ + memloc_p = memloc_p->memlocs.le_next){\ + free(memloc_p->p);\ + }\ +}while(0) + +#define GARBAGE_ADD(a) \ +do {\ + if(memloc_i >= MAX_MEMLOCS){\ + switch_safe_free(ccmd);\ + GARBAGE_CLEANUP();\ + stream->write_function(stream, "-ERR\n");\ + return SWITCH_STATUS_SUCCESS;\ + }\ + memloc_a[memloc_i].p = (void *)a;\ + LIST_INSERT_HEAD(&head, memloc_a + memloc_i, memlocs);\ + memloc_i++;\ +}while(0) + +#define GARBAGE_INIT() \ + LIST_HEAD(listhead, memloc) head;\ + memloc_t memloc_a[MAX_MEMLOCS];\ + memloc_t *memloc_p;\ + size_t memloc_i;\ + LIST_INIT(&head);\ + memloc_i = 0 + +GARBAGE_TYPES_INIT(); + +SWITCH_STANDARD_API(http_api_main) +{ + char *ccmd; + int argc; + char *argv[HTTP_PARAMS]; + char *buf; + char *method; + char *url; + char *headers_str; + char *value; + char *body; + char *body_dec; + char *t; + char *json_response; + struct json_object *json_http_headers; + char *key; + struct json_object *val; + struct lh_entry *entry; + int i; + int j; + int f; + size_t l; + size_t m; + size_t a = 0; + int ret; + + http_header_t *headers; + http_request_t request; + http_response_t response; + + GARBAGE_INIT(); + + (void)memset(&response, 0, sizeof(response)); + + if(cmd == NULL){ + stream->write_function(stream, "-USAGE: %s\n", HTTP_SYNTAX); + return SWITCH_STATUS_SUCCESS; + } + + ccmd = strdup(cmd); + argc = switch_separate_string(ccmd, ' ', argv, HTTP_PARAMS); + + if(argc != HTTP_PARAMS && argc != (HTTP_PARAMS - 1)){ + switch_safe_free(ccmd); + stream->write_function(stream, "-ERR\n"); + return SWITCH_STATUS_SUCCESS; + } + + method = argv[0]; + url = argv[1]; + headers_str = argv[2]; + if(argc == HTTP_PARAMS){ + body = argv[3]; + }else{ + body = (char *)malloc(1 * sizeof(char)); + if(body == NULL){ + switch_safe_free(ccmd); + stream->write_function(stream, "-ERR\n"); + return SWITCH_STATUS_SUCCESS; + } + body[0] = '\0'; + GARBAGE_ADD(body); + } + + buf = (char *)malloc(HTTP_BUFFER_SIZE * sizeof(char)); + if(buf == NULL){ + switch_safe_free(ccmd); + stream->write_function(stream, "-ERR\n"); + GARBAGE_CLEANUP(); + return SWITCH_STATUS_SUCCESS; + } + + GARBAGE_ADD(buf); + + request.version = DEFAULT_HTTP_VERSION; + l = strlen(url); + request.url = (char *)malloc((l + 1) * sizeof(char)); + if(request.url == NULL){ + switch_safe_free(ccmd); + stream->write_function(stream, "-ERR\n"); + GARBAGE_CLEANUP(); + return SWITCH_STATUS_SUCCESS; + } + + GARBAGE_ADD(request.url); + strcpy(request.url, url); + json_http_headers = json_tokener_parse(headers_str); + + i = 0; + json_object_object_foreach(json_http_headers, key, val){ + i++; + } + + request.header_len = i; + headers = (http_header_t *)malloc(i * sizeof(http_header_t)); + GARBAGE_ADD(headers); + + i = 0; + json_object_object_foreach(json_http_headers, key, val){ + l = strlen(key); + request.headers[i].field_name = (char *)malloc((l + 1) * sizeof(char)); + if(request.headers[i].field_name == NULL){ + switch_safe_free(ccmd); + stream->write_function(stream, "-ERR\n"); + GARBAGE_CLEANUP(); + return SWITCH_STATUS_SUCCESS; + } + GARBAGE_ADD(request.headers[i].field_name); + strcpy(request.headers[i].field_name, key); + a += strlen(key); + + value = json_object_to_json_string(val); + l = strlen(value); + request.headers[i].value = (char *)malloc((l + 1) * sizeof(char)); + if(request.headers[i].value == NULL){ + switch_safe_free(ccmd); + stream->write_function(stream, "-ERR\n"); + GARBAGE_CLEANUP(); + return SWITCH_STATUS_SUCCESS; + } + GARBAGE_ADD(request.headers[i].value); + strcpy(request.headers[i].value, value); + a += strlen(value); + i++; + } + + if(argc == HTTP_PARAMS){ + l = strlen(body); + body_dec = url_decode(body, l); + GARBAGE_ADD(body_dec); + l = strlen(body_dec); + request.body_len = l; + request.body = body_dec; + }else request.body_len = 0; + + ret = http_req(&request, &response); + if(response.version != NULL) GARBAGE_ADD(response.version); + if(response.phrase != NULL) GARBAGE_ADD(response.phrase); + if(response.headers != NULL) GARBAGE_ADD(response.headers); + if(response.body != NULL) GARBAGE_ADD(response.body); + for(i = 0; i < response.header_len; i++){ + GARBAGE_ADD(response.headers[i].field_name); + GARBAGE_ADD(response.headers[i].value); + } + + + if(ret == ERROR){ + switch_safe_free(ccmd); + stream->write_function(stream, "-ERR\n"); + GARBAGE_CLEANUP(); + return SWITCH_STATUS_SUCCESS; + } + + /* This is evil and should be changed in the future */ + l = 128 + (256 * response.header_len) + (a * 2) + + strlen("version") + strlen(response.version) + + strlen("status_code") + 3 + + strlen("phrase") + strlen(response.phrase) + + strlen("body") + (response.body_len * 3) + 1 + + strlen("headers") + + 1; + + /* to be safe */ + l <<= 2; + + json_response = (char *)malloc(l * sizeof(char)); + if(json_response == NULL){ + switch_safe_free(ccmd); + stream->write_function(stream, "-ERR\n"); + GARBAGE_CLEANUP(); + return SWITCH_STATUS_SUCCESS; + } + GARBAGE_ADD(json_response); + + if(response.body_len != 0){ + t = (char *)malloc((response.body_len + 1) * sizeof(char)); + if(t == NULL){ + switch_safe_free(ccmd); + stream->write_function(stream, "-ERR\n"); + GARBAGE_CLEANUP(); + return SWITCH_STATUS_SUCCESS; + } + GARBAGE_ADD(t); + (void)memcpy(t, response.body, response.body_len); + t[response.body_len] = '\0'; + response.body = url_encode(t, response.body_len); + GARBAGE_ADD(response.body); + } + + + m = snprintf(json_response, l, + "{" + "\"version\": \"%s\"," + "\"status_code\": \"%3d\"," + "\"phrase\": \"%s\"," + "\"body\": \"%s\"," + "\"headers\": [", + response.version, + response.status_code, + response.phrase, + ((response.body_len <= 0)? "":response.body) + ); + + + for(f = HTTP_FALSE, j = 0; j < response.header_len; j++){ + if(f != HTTP_FALSE){ + m += snprintf(json_response + m, l - m, + "," + ); + }else f = HTTP_TRUE; + + m += snprintf(json_response + m, l - m, + "{\"key\": \"%s\",\"value\": \"%s\"}", + response.headers[j].field_name, + response.headers[j].value + ); + } + + + m += snprintf(json_response + m, l - m, "]}"); + json_response[m] = '\0'; + + + switch_log_printf( + SWITCH_CHANNEL_LOG, + SWITCH_LOG_NOTICE, + "RESERVED %d BYTES, USED %d BYTES, HTTP Response as JSON: %s\n", + l, + m, + json_response + ); + + + stream->write_function(stream, "%s\n", json_response); + + switch_safe_free(ccmd); + GARBAGE_CLEANUP(); + return SWITCH_STATUS_SUCCESS; +} + +SWITCH_MODULE_LOAD_FUNCTION(mod_http_load); +SWITCH_MODULE_DEFINITION(mod_http, mod_http_load, NULL, NULL); + +SWITCH_MODULE_LOAD_FUNCTION(mod_http_load) +{ + switch_api_interface_t *api_interface; + + *module_interface = + switch_loadable_module_create_module_interface(pool, modname); + + switch_log_printf( + SWITCH_CHANNEL_LOG, + SWITCH_LOG_NOTICE, + "HTTP request mod enabled\n" + ); + + SWITCH_ADD_API( + api_interface, + "http", + "Make HTTP requests", + http_api_main, + HTTP_SYNTAX + ); + + return SWITCH_STATUS_SUCCESS; +} + Added: freeswitch/trunk/src/mod/applications/mod_http/printbuf.c ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/printbuf.c Wed Dec 10 16:43:26 2008 @@ -0,0 +1,144 @@ +/* + * $Id: printbuf.c,v 1.5 2006/01/26 02:16:28 mclark Exp $ + * + * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. + * Michael Clark + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See COPYING for details. + * + */ + +#include "config.h" + +#include +#include +#include + +#if HAVE_STDARG_H +# include +#else /* !HAVE_STDARG_H */ +# error Not enough var arg support! +#endif /* HAVE_STDARG_H */ + +#include "bits.h" +#include "debug.h" +#include "printbuf.h" + +struct printbuf* printbuf_new() +{ + struct printbuf *p; + + if(!(p = calloc(1, sizeof(struct printbuf)))) return NULL; + p->size = 32; + p->bpos = 0; + if(!(p->buf = malloc(p->size))) { + free(p); + return NULL; + } + return p; +} + + +int printbuf_memappend(struct printbuf *p, char *buf, int size) +{ + char *t; + if(p->size - p->bpos <= size) { + int new_size = max(p->size * 2, p->bpos + size + 8); +#ifdef PRINTBUF_DEBUG + mc_debug("printbuf_memappend: realloc " + "bpos=%d wrsize=%d old_size=%d new_size=%d\n", + p->bpos, size, p->size, new_size); +#endif /* PRINTBUF_DEBUG */ + if(!(t = realloc(p->buf, new_size))) return -1; + p->size = new_size; + p->buf = t; + } + memcpy(p->buf + p->bpos, buf, size); + p->bpos += size; + p->buf[p->bpos]= '\0'; + return size; +} + +#if !HAVE_VSNPRINTF && defined(WIN32) +# define vsnprintf _vsnprintf +#elif !HAVE_VSNPRINTF /* !HAVE_VSNPRINTF */ +# error Need vsnprintf! +#endif /* !HAVE_VSNPRINTF && defined(WIN32) */ + +#if !HAVE_VASPRINTF +/* CAW: compliant version of vasprintf */ +static int vasprintf(char **buf, const char *fmt, va_list ap) +{ +#ifndef WIN32 + static char _T_emptybuffer = '\0'; +#endif /* !defined(WIN32) */ + int chars; + char *b; + + if(!buf) { return -1; } + +#ifdef WIN32 + chars = _vscprintf(fmt, ap)+1; +#else /* !defined(WIN32) */ + /* CAW: RAWR! We have to hope to god here that vsnprintf doesn't overwrite + our buffer like on some 64bit sun systems.... but hey, its time to move on */ + chars = vsnprintf(&_T_emptybuffer, 0, fmt, ap)+1; + if(chars < 0) { chars *= -1; } /* CAW: old glibc versions have this problem */ +#endif /* defined(WIN32) */ + + b = (char*)malloc(sizeof(char)*chars); + if(!b) { return -1; } + + if((chars = vsprintf(b, fmt, ap)) < 0) + { + free(b); + } else { + *buf = b; + } + + return chars; +} +#endif /* !HAVE_VASPRINTF */ + +int sprintbuf(struct printbuf *p, const char *msg, ...) +{ + va_list ap; + char *t; + int size; + char buf[128]; + + /* user stack buffer first */ + va_start(ap, msg); + size = vsnprintf(buf, 128, msg, ap); + va_end(ap); + /* if string is greater than stack buffer, then use dynamic string + with vasprintf. Note: some implementation of vsnprintf return -1 + if output is truncated whereas some return the number of bytes that + would have been writen - this code handles both cases. */ + if(size == -1 || size > 127) { + int ret; + va_start(ap, msg); + if((size = vasprintf(&t, msg, ap)) == -1) return -1; + va_end(ap); + ret = printbuf_memappend(p, t, size); + free(t); + return ret; + } else { + return printbuf_memappend(p, buf, size); + } +} + +void printbuf_reset(struct printbuf *p) +{ + p->buf[0] = '\0'; + p->bpos = 0; +} + +void printbuf_free(struct printbuf *p) +{ + if(p) { + free(p->buf); + free(p); + } +} Added: freeswitch/trunk/src/mod/applications/mod_http/printbuf.h ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/printbuf.h Wed Dec 10 16:43:26 2008 @@ -0,0 +1,38 @@ +/* + * $Id: printbuf.h,v 1.4 2006/01/26 02:16:28 mclark Exp $ + * + * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. + * Michael Clark + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See COPYING for details. + * + */ + +#ifndef _printbuf_h_ +#define _printbuf_h_ + +#undef PRINTBUF_DEBUG + +struct printbuf { + char *buf; + int bpos; + int size; +}; + +extern struct printbuf* +printbuf_new(); + +extern int +printbuf_memappend(struct printbuf *p, char *buf, int size); + +extern int +sprintbuf(struct printbuf *p, const char *msg, ...); + +extern void +printbuf_reset(struct printbuf *p); + +extern void +printbuf_free(struct printbuf *p); + +#endif Added: freeswitch/trunk/src/mod/applications/mod_http/url_encoding.c ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/url_encoding.c Wed Dec 10 16:43:26 2008 @@ -0,0 +1,125 @@ +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2008, Eric des Courtis + * + * 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. + * + * Eric des Courtis + * Copyright (C) Benbria. All Rights Reserved. + * + * Contributor(s): + * + * Eric des Courtis + * + * + * url_encoding.c -- url encoding/decoding + * + */ +#include "url_encoding.h" + +#ifdef DEBUG +int main(int argc, char *argv[]) +{ + char *buf1; + char *buf2; + + + buf1 = url_encode("This is a test #$ "); + buf2 = url_decode(buf1); + + printf("%s\n", buf2); + + free(buf1); + free(buf2); + return EXIT_FAILURE; +} + +#endif + +char *url_encode(char *url, size_t l) +{ + int i; + int j; + char *buf; + unsigned char c; + + buf = (char *)malloc((l * 3) + 1); + if(buf == NULL){ + perror("Could not allocate memory url encoding"); + return NULL; + } + + for(i = 0, j = 0; i < l; i++){ + c = (unsigned char)url[i]; + if(c <= 31 || c >= 127 + || c == '$' || c == '&' || c == '+' || c == ',' || c == '/' + || c == ':' || c == ';' || c == '=' || c == '?' || c == '@' + || c == ' ' || c == '"' || c == '<' || c == '>' || c == '#' + || c == '%' || c == '{' || c == '}' || c == '|' || c == '\\' + || c == '^' || c == '~' || c == '[' || c == ']' || c == '`'){ + + (void)sprintf(buf + j, "%%%X%X", c >> 4, c & 0x0F); + j += 3; + }else{ + buf[j] = url[i]; + j++; + } + } + + buf[j] = '\0'; + + return buf; +} + +char *url_decode(char *url, size_t l) +{ + int i; + int j; + char *buf; + char c; + char d0; + char d1; + + buf = (char *)malloc((l + 1) * sizeof(char)); + if(buf == NULL){ + perror("Could not allocate memory for decoding"); + return NULL; + } + + for(i = 0, j = 0; i < l; j++){ + c = url[i]; + if(c == '%'){ + d0 = url[i + 2]; + d1 = url[i + 1]; + d0 = toupper(d0); + d1 = toupper(d1); + + if(d0 >= 'A' && d0 <= 'F') d0 = d0 - 'A' + 10; + else if(d0 >= '0' && d0 <= '9') d0 = d0 - '0'; + if(d1 >= 'A' && d1 <= 'F') d1 = d1 - 'A' + 10; + else if(d1 >= '0' && d1 <= '9') d1 = d1 - '0'; + + buf[j] = (d1 << 4) + d0; + i += 3; + }else{ + buf[j] = url[i]; + i++; + } + } + + buf[j] = '\0'; + + return buf; +} + + Added: freeswitch/trunk/src/mod/applications/mod_http/url_encoding.h ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/applications/mod_http/url_encoding.h Wed Dec 10 16:43:26 2008 @@ -0,0 +1,42 @@ +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2008, Eric des Courtis + * + * 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. + * + * Eric des Courtis + * Copyright (C) Benbria. All Rights Reserved. + * + * Contributor(s): + * + * Eric des Courtis + * + * + * url_encoding.h -- url encoding/decoding + * + */ + +#ifndef __URL_ENCODING_H__ +#define __URL_ENCODING_H__ + +#include +#include +#include +#include +#include + +char *url_encode(char *url, size_t l); +char *url_decode(char *url, size_t l); + +#endif + From gmaruzz at freeswitch.org Thu Dec 11 00:36:15 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Thu, 11 Dec 2008 03:36:15 -0500 Subject: [Freeswitch-svn] [commit] r10706 - freeswitch/branches/gmaruzz Message-ID: Author: gmaruzz Date: Thu Dec 11 03:36:13 2008 New Revision: 10706 Log: added modules.conf with skypiax Added: freeswitch/branches/gmaruzz/modules.conf Added: freeswitch/branches/gmaruzz/modules.conf ============================================================================== --- (empty file) +++ freeswitch/branches/gmaruzz/modules.conf Thu Dec 11 03:36:13 2008 @@ -0,0 +1,71 @@ +loggers/mod_console +loggers/mod_logfile +loggers/mod_syslog +applications/mod_commands +applications/mod_conference +applications/mod_dptools +applications/mod_enum +applications/mod_fifo +applications/mod_fax +applications/mod_voicemail +applications/mod_limit +applications/mod_expr +applications/mod_esf +applications/mod_fsv +#applications/mod_soundtouch +#applications/mod_rss +#applications/mod_snom +#asr_tts/mod_flite +#asr_tts/mod_pocketsphinx +#asr_tts/mod_cepstral +#asr_tts/mod_openmrcp +codecs/mod_g723_1 +codecs/mod_amr +codecs/mod_g729 +codecs/mod_h26x +codecs/mod_voipcodecs +codecs/mod_ilbc +codecs/mod_speex +#dialplans/mod_dialplan_directory +dialplans/mod_dialplan_xml +dialplans/mod_dialplan_asterisk +#directories/mod_ldap +endpoints/mod_dingaling +endpoints/mod_iax +endpoints/mod_skypiax +endpoints/mod_reference +endpoints/mod_portaudio +endpoints/mod_sofia +endpoints/mod_loopback +#endpoints/mod_woomera +#endpoints/mod_alsa +../../libs/openzap/mod_openzap +#event_handlers/mod_event_multicast +event_handlers/mod_event_socket +event_handlers/mod_cdr_csv +#event_handlers/mod_radius_cdr +formats/mod_native_file +formats/mod_sndfile +#formats/mod_shout +formats/mod_local_stream +formats/mod_tone_stream +#languages/mod_python +languages/mod_spidermonkey +languages/mod_spidermonkey_teletone +languages/mod_spidermonkey_core_db +languages/mod_spidermonkey_socket +#languages/mod_spidermonkey_odbc +languages/mod_lua +#languages/mod_perl +#languages/mod_yaml +xml_int/mod_xml_rpc +#xml_int/mod_xml_curl +xml_int/mod_xml_cdr +#xml_int/mod_xml_ldap +say/mod_say_en +#say/mod_say_de +#say/mod_say_es +#say/mod_say_fr +#say/mod_say_it +#say/mod_say_nl +#say/mod_say_zh From gmaruzz at freeswitch.org Thu Dec 11 00:38:45 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Thu, 11 Dec 2008 03:38:45 -0500 Subject: [Freeswitch-svn] [commit] r10707 - in freeswitch/branches/gmaruzz: src/mod/endpoints/mod_skypiax/configs stuff Message-ID: Author: gmaruzz Date: Thu Dec 11 03:38:45 2008 New Revision: 10707 Log: skypiax: added configs subdir, with configuration files. Removed stuff directory from root Added: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/configs/ - copied from r10696, /freeswitch/branches/gmaruzz/stuff/ Removed: freeswitch/branches/gmaruzz/stuff/ From gmaruzz at freeswitch.org Thu Dec 11 06:15:19 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Thu, 11 Dec 2008 09:15:19 -0500 Subject: [Freeswitch-svn] [commit] r10708 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Thu Dec 11 09:15:18 2008 New Revision: 10708 Log: skypiax: better function distribution between mod_skypiax.c and skypiax_protocol.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Thu Dec 11 09:15:18 2008 @@ -446,43 +446,6 @@ /*.receive_event */ channel_receive_event }; -int skypiax_skype_call(struct skypiax_interface *p, char *idest, int timeout, - switch_core_session_t * session) -{ - char *rdest; - char msg_to_skype[1024]; - - if (option_debug > 10) { - DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); - } - switch_sleep(5000); - - rdest = strchr(idest, '/'); - *rdest++ = '\0'; - - if (option_debug) - DEBUGA_SKYPE("Calling Skype, rdest is: %s\n", SKYPIAX_P_LOG, rdest); - NOTICA("Calling Skype, rdest is: %s\n", SKYPIAX_P_LOG, rdest); - skypiax_skype_write(p, "SET AGC OFF"); - switch_sleep(10000); - skypiax_skype_write(p, "SET AEC OFF"); - switch_sleep(10000); - - sprintf(msg_to_skype, "CALL %s", rdest); - if (skypiax_skype_write(p, msg_to_skype) < 0) { - - ERRORA("failed to communicate with Skype client, now exit\n", SKYPIAX_P_LOG); - if (option_debug > 10) { - DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); - } - return -1; - } - global_session = session; - - //FIXME ast_queue_control(p->owner, SKYPIAX_CONTROL_RINGING); - return 0; -} - static switch_call_cause_t channel_outgoing_channel(switch_core_session_t * session, switch_event_t * var_event, switch_caller_profile_t * Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h Thu Dec 11 09:15:18 2008 @@ -214,3 +214,5 @@ int skypiax_skypeaudio_init(struct skypiax_interface *p); int skypiax_skype_write(struct skypiax_interface *p, char *msg_to_skype); int skypiax_skype_read(struct skypiax_interface *p); + +int skypiax_skype_call(struct skypiax_interface *p, char *idest, int timeout, switch_core_session_t * session); Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Thu Dec 11 09:15:18 2008 @@ -1400,3 +1400,41 @@ //DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); return 0; } + +int skypiax_skype_call(struct skypiax_interface *p, char *idest, int timeout, switch_core_session_t * session) +{ + char *rdest; + char msg_to_skype[1024]; + + if (option_debug > 10) { + DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); + } + switch_sleep(5000); + + rdest = strchr(idest, '/'); + *rdest++ = '\0'; + + if (option_debug) + DEBUGA_SKYPE("Calling Skype, rdest is: %s\n", SKYPIAX_P_LOG, rdest); + NOTICA("Calling Skype, rdest is: %s\n", SKYPIAX_P_LOG, rdest); + skypiax_skype_write(p, "SET AGC OFF"); + switch_sleep(10000); + skypiax_skype_write(p, "SET AEC OFF"); + switch_sleep(10000); + + sprintf(msg_to_skype, "CALL %s", rdest); + if (skypiax_skype_write(p, msg_to_skype) < 0) { + + ERRORA("failed to communicate with Skype client, now exit\n", SKYPIAX_P_LOG); + if (option_debug > 10) { + DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + } + return -1; + } + global_session = session; + + //FIXME ast_queue_control(p->owner, SKYPIAX_CONTROL_RINGING); + return 0; +} + + From mikej at freeswitch.org Thu Dec 11 07:19:03 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Thu, 11 Dec 2008 10:19:03 -0500 Subject: [Freeswitch-svn] [commit] r10709 - in freeswitch/trunk/src/mod/languages: mod_java mod_java/src/org/freeswitch/swig mod_lua mod_perl mod_python Message-ID: Author: mikej Date: Thu Dec 11 10:19:03 2008 New Revision: 10709 Log: swigall Modified: freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java freeswitch/trunk/src/mod/languages/mod_java/switch_swig_wrap.cpp freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp Modified: freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java (original) +++ freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java Thu Dec 11 10:19:03 2008 @@ -245,12 +245,8 @@ return freeswitchJNI.CoreSession_streamFile__SWIG_1(swigCPtr, this, file); } - public int sleep(int ms, int sync) { - return freeswitchJNI.CoreSession_sleep__SWIG_0(swigCPtr, this, ms, sync); - } - public int sleep(int ms) { - return freeswitchJNI.CoreSession_sleep__SWIG_1(swigCPtr, this, ms); + return freeswitchJNI.CoreSession_sleep(swigCPtr, this, ms); } public int flushEvents() { Modified: freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java (original) +++ freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java Thu Dec 11 10:19:03 2008 @@ -136,8 +136,7 @@ public final static native String CoreSession_playAndGetDigits(long jarg1, CoreSession jarg1_, int jarg2, int jarg3, int jarg4, int jarg5, String jarg6, String jarg7, String jarg8, String jarg9); public final static native int CoreSession_streamFile__SWIG_0(long jarg1, CoreSession jarg1_, String jarg2, int jarg3); public final static native int CoreSession_streamFile__SWIG_1(long jarg1, CoreSession jarg1_, String jarg2); - public final static native int CoreSession_sleep__SWIG_0(long jarg1, CoreSession jarg1_, int jarg2, int jarg3); - public final static native int CoreSession_sleep__SWIG_1(long jarg1, CoreSession jarg1_, int jarg2); + public final static native int CoreSession_sleep(long jarg1, CoreSession jarg1_, int jarg2); public final static native int CoreSession_flushEvents(long jarg1, CoreSession jarg1_); public final static native int CoreSession_flushDigits(long jarg1, CoreSession jarg1_); public final static native int CoreSession_setAutoHangup(long jarg1, CoreSession jarg1_, boolean jarg2); Modified: freeswitch/trunk/src/mod/languages/mod_java/switch_swig_wrap.cpp ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_java/switch_swig_wrap.cpp (original) +++ freeswitch/trunk/src/mod/languages/mod_java/switch_swig_wrap.cpp Thu Dec 11 10:19:03 2008 @@ -2674,26 +2674,7 @@ } -SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1sleep_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3) { - jint jresult = 0 ; - CoreSession *arg1 = (CoreSession *) 0 ; - int arg2 ; - int arg3 ; - int result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(CoreSession **)&jarg1; - arg2 = (int)jarg2; - arg3 = (int)jarg3; - result = (int)(arg1)->sleep(arg2,arg3); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1sleep_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { +SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1sleep(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { jint jresult = 0 ; CoreSession *arg1 = (CoreSession *) 0 ; int arg2 ; Modified: freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp (original) +++ freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp Thu Dec 11 10:19:03 2008 @@ -6077,38 +6077,7 @@ } -static int _wrap_CoreSession_sleep__SWIG_0(lua_State* L) { - int SWIG_arg = -1; - CoreSession *arg1 = (CoreSession *) 0 ; - int arg2 ; - int arg3 ; - int result; - - SWIG_check_num_args("sleep",3,3) - if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sleep",1,"CoreSession *"); - if(!lua_isnumber(L,2)) SWIG_fail_arg("sleep",2,"int"); - if(!lua_isnumber(L,3)) SWIG_fail_arg("sleep",3,"int"); - - if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ - SWIG_fail_ptr("CoreSession_sleep",1,SWIGTYPE_p_CoreSession); - } - - arg2 = (int)lua_tonumber(L, 2); - arg3 = (int)lua_tonumber(L, 3); - result = (int)(arg1)->sleep(arg2,arg3); - SWIG_arg=0; - lua_pushnumber(L, (lua_Number) result); SWIG_arg++; - return SWIG_arg; - - if(0) SWIG_fail; - -fail: - lua_error(L); - return SWIG_arg; -} - - -static int _wrap_CoreSession_sleep__SWIG_1(lua_State* L) { +static int _wrap_CoreSession_sleep(lua_State* L) { int SWIG_arg = -1; CoreSession *arg1 = (CoreSession *) 0 ; int arg2 ; @@ -6136,62 +6105,6 @@ } -static int _wrap_CoreSession_sleep(lua_State* L) { - int argc; - int argv[4]={ - 1,2,3,4 - }; - - argc = lua_gettop(L); - if (argc == 2) { - int _v; - { - void *ptr; - if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { - _v = 0; - } else { - _v = 1; - } - } - if (_v) { - { - _v = lua_isnumber(L,argv[1]); - } - if (_v) { - return _wrap_CoreSession_sleep__SWIG_1(L); - } - } - } - if (argc == 3) { - int _v; - { - void *ptr; - if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { - _v = 0; - } else { - _v = 1; - } - } - if (_v) { - { - _v = lua_isnumber(L,argv[1]); - } - if (_v) { - { - _v = lua_isnumber(L,argv[2]); - } - if (_v) { - return _wrap_CoreSession_sleep__SWIG_0(L); - } - } - } - } - - lua_pushstring(L,"No matching function for overloaded 'CoreSession_sleep'"); - lua_error(L);return 0; -} - - static int _wrap_CoreSession_flushEvents(lua_State* L) { int SWIG_arg = -1; CoreSession *arg1 = (CoreSession *) 0 ; Modified: freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp (original) +++ freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp Thu Dec 11 10:19:03 2008 @@ -8146,55 +8146,7 @@ } -XS(_wrap_CoreSession_sleep__SWIG_0) { - { - CoreSession *arg1 = (CoreSession *) 0 ; - int arg2 ; - int arg3 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 3) || (items > 3)) { - SWIG_croak("Usage: CoreSession_sleep(self,ms,sync);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_sleep" "', argument " "1"" of type '" "CoreSession *""'"); - } - arg1 = reinterpret_cast< CoreSession * >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoreSession_sleep" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoreSession_sleep" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - result = (int)(arg1)->sleep(arg2,arg3); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - - - XSRETURN(argvi); - fail: - - - - SWIG_croak_null(); - } -} - - -XS(_wrap_CoreSession_sleep__SWIG_1) { +XS(_wrap_CoreSession_sleep) { { CoreSession *arg1 = (CoreSession *) 0 ; int arg2 ; @@ -8232,98 +8184,6 @@ } -XS(_wrap_CoreSession_sleep) { - dXSARGS; - - { - unsigned long _index = 0; - SWIG_TypeRank _rank = 0; - if (items == 2) { - SWIG_TypeRank _ranki = 0; - SWIG_TypeRank _rankm = 0; - SWIG_TypeRank _pi = 1; - int _v = 0; - { - void *vptr = 0; - int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_CoreSession, 0); - _v = SWIG_CheckState(res); - } - if (!_v) goto check_1; - _ranki += _v*_pi; - _rankm += _pi; - _pi *= SWIG_MAXCASTRANK; - { - { - int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL); - _v = SWIG_CheckState(res); - } - } - if (!_v) goto check_1; - _ranki += _v*_pi; - _rankm += _pi; - _pi *= SWIG_MAXCASTRANK; - if (!_index || (_ranki < _rank)) { - _rank = _ranki; _index = 1; - if (_rank == _rankm) goto dispatch; - } - } - check_1: - - if (items == 3) { - SWIG_TypeRank _ranki = 0; - SWIG_TypeRank _rankm = 0; - SWIG_TypeRank _pi = 1; - int _v = 0; - { - void *vptr = 0; - int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_CoreSession, 0); - _v = SWIG_CheckState(res); - } - if (!_v) goto check_2; - _ranki += _v*_pi; - _rankm += _pi; - _pi *= SWIG_MAXCASTRANK; - { - { - int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL); - _v = SWIG_CheckState(res); - } - } - if (!_v) goto check_2; - _ranki += _v*_pi; - _rankm += _pi; - _pi *= SWIG_MAXCASTRANK; - { - { - int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), NULL); - _v = SWIG_CheckState(res); - } - } - if (!_v) goto check_2; - _ranki += _v*_pi; - _rankm += _pi; - _pi *= SWIG_MAXCASTRANK; - if (!_index || (_ranki < _rank)) { - _rank = _ranki; _index = 2; - if (_rank == _rankm) goto dispatch; - } - } - check_2: - - dispatch: - switch(_index) { - case 1: - ++PL_markstack_ptr; SWIG_CALLXS(_wrap_CoreSession_sleep__SWIG_1); return; - case 2: - ++PL_markstack_ptr; SWIG_CALLXS(_wrap_CoreSession_sleep__SWIG_0); return; - } - } - - croak("No matching function for overloaded 'CoreSession_sleep'"); - XSRETURN(0); -} - - XS(_wrap_CoreSession_flushEvents) { { CoreSession *arg1 = (CoreSession *) 0 ; Modified: freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp (original) +++ freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp Thu Dec 11 10:19:03 2008 @@ -8018,47 +8018,7 @@ } -SWIGINTERN PyObject *_wrap_CoreSession_sleep__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - CoreSession *arg1 = (CoreSession *) 0 ; - int arg2 ; - int arg3 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_sleep",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_sleep" "', argument " "1"" of type '" "CoreSession *""'"); - } - arg1 = reinterpret_cast< CoreSession * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoreSession_sleep" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoreSession_sleep" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - result = (int)(arg1)->sleep(arg2,arg3); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_CoreSession_sleep__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_CoreSession_sleep(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; CoreSession *arg1 = (CoreSession *) 0 ; int arg2 ; @@ -8089,62 +8049,6 @@ } -SWIGINTERN PyObject *_wrap_CoreSession_sleep(PyObject *self, PyObject *args) { - int argc; - PyObject *argv[4]; - int ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = (int)PyObject_Length(args); - for (ii = 0; (ii < argc) && (ii < 3); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CoreSession, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_CoreSession_sleep__SWIG_1(self, args); - } - } - } - if (argc == 3) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CoreSession, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_CoreSession_sleep__SWIG_0(self, args); - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CoreSession_sleep'.\n" - " Possible C/C++ prototypes are:\n" - " sleep(CoreSession *,int,int)\n" - " sleep(CoreSession *,int)\n"); - return NULL; -} - - SWIGINTERN PyObject *_wrap_CoreSession_flushEvents(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; CoreSession *arg1 = (CoreSession *) 0 ; From mikej at freeswitch.org Thu Dec 11 07:20:24 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Thu, 11 Dec 2008 10:20:24 -0500 Subject: [Freeswitch-svn] [commit] r10710 - in freeswitch/trunk/src: . include mod/languages/mod_managed mod/languages/mod_managed/managed Message-ID: Author: mikej Date: Thu Dec 11 10:20:24 2008 New Revision: 10710 Log: FSCORE-237 make channel flags array based so we do not have 32 flag limit Modified: freeswitch/trunk/src/include/switch_channel.h freeswitch/trunk/src/include/switch_types.h freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs freeswitch/trunk/src/switch_channel.c Modified: freeswitch/trunk/src/include/switch_channel.h ============================================================================== --- freeswitch/trunk/src/include/switch_channel.h (original) +++ freeswitch/trunk/src/include/switch_channel.h Thu Dec 11 10:20:24 2008 @@ -145,7 +145,7 @@ \param flags the initial channel flags */ SWITCH_DECLARE(switch_status_t) switch_channel_init(switch_channel_t *channel, switch_core_session_t *session, switch_channel_state_t state, - uint32_t flags); + switch_channel_flag_t flag); /*! \brief Fire A presence event for the channel @@ -259,49 +259,49 @@ SWITCH_DECLARE(switch_caller_extension_t *) switch_channel_get_caller_extension(switch_channel_t *channel); /*! - \brief Test for presence of given flag(s) on a given channel + \brief Test for presence of given flag on a given channel \param channel channel to test - \param flags or'd list of channel flags to test + \param flag to test \return TRUE if flags were present */ -SWITCH_DECLARE(uint32_t) switch_channel_test_flag(switch_channel_t *channel, switch_channel_flag_t flags); +SWITCH_DECLARE(uint32_t) switch_channel_test_flag(switch_channel_t *channel, switch_channel_flag_t flag); /*! \brief Set given flag(s) on a given channel - \param channel channel on which to set flag(s) - \param flags or'd list of flags to set + \param channel channel on which to set flag + \param flag or'd list of flags to set */ -SWITCH_DECLARE(void) switch_channel_set_flag(switch_channel_t *channel, switch_channel_flag_t flags); +SWITCH_DECLARE(void) switch_channel_set_flag(switch_channel_t *channel, switch_channel_flag_t flag); /*! \brief Set given flag(s) on a given channel's bridge partner - \param channel channel to derive the partner channel to set flag(s) on - \param flags or'd list of flags to set + \param channel channel to derive the partner channel to set flag on + \param flag to set \return true if the flag was set */ -SWITCH_DECLARE(switch_bool_t) switch_channel_set_flag_partner(switch_channel_t *channel, switch_channel_flag_t flags); +SWITCH_DECLARE(switch_bool_t) switch_channel_set_flag_partner(switch_channel_t *channel, switch_channel_flag_t flag); /*! \brief Clears given flag(s) on a given channel's bridge partner \param channel channel to derive the partner channel to clear flag(s) from - \param flags the flags to clear + \param flag the flag to clear \return true if the flag was cleared */ -SWITCH_DECLARE(switch_bool_t) switch_channel_clear_flag_partner(switch_channel_t *channel, switch_channel_flag_t flags); +SWITCH_DECLARE(switch_bool_t) switch_channel_clear_flag_partner(switch_channel_t *channel, switch_channel_flag_t flag); /*! \brief Set given flag(s) on a given channel to be applied on the next state change \param channel channel on which to set flag(s) - \param flags or'd list of flags to set + \param flag flag to set */ -SWITCH_DECLARE(void) switch_channel_set_state_flag(switch_channel_t *channel, switch_channel_flag_t flags); +SWITCH_DECLARE(void) switch_channel_set_state_flag(switch_channel_t *channel, switch_channel_flag_t flag); /*! \brief Clear given flag(s) from a channel \param channel channel to clear flags from - \param flags or'd list of flags to clear + \param flag flag to clear */ -SWITCH_DECLARE(void) switch_channel_clear_flag(switch_channel_t *channel, switch_channel_flag_t flags); +SWITCH_DECLARE(void) switch_channel_clear_flag(switch_channel_t *channel, switch_channel_flag_t flag); SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t *channel, const char *file, const char *func, int line); @@ -484,7 +484,7 @@ _In_opt_ const char *prefix); SWITCH_DECLARE(switch_status_t) switch_channel_set_timestamps(_In_ switch_channel_t *channel); -#define switch_channel_stop_broadcast(_channel) if (switch_channel_test_flag(_channel, CF_BROADCAST)) switch_channel_set_flag(_channel, CF_BREAK | CF_STOP_BROADCAST) +#define switch_channel_stop_broadcast(_channel) for(;;) {if (switch_channel_test_flag(_channel, CF_BROADCAST)) {switch_channel_set_flag(_channel, CF_STOP_BROADCAST); switch_channel_set_flag(_channel, CF_BREAK); } break;} #define switch_channel_media_ready(_channel) ((switch_channel_test_flag(_channel, CF_ANSWERED) || switch_channel_test_flag(_channel, CF_EARLY_MEDIA)) && !switch_channel_test_flag(_channel, CF_PROXY_MODE)) Modified: freeswitch/trunk/src/include/switch_types.h ============================================================================== --- freeswitch/trunk/src/include/switch_types.h (original) +++ freeswitch/trunk/src/include/switch_types.h Thu Dec 11 10:20:24 2008 @@ -732,73 +732,70 @@ \brief Channel Flags
-CF_ANSWERED     = (1 <<  0) - Channel is answered
-CF_OUTBOUND     = (1 <<  1) - Channel is an outbound channel
-CF_EARLY_MEDIA  = (1 <<  2) - Channel is ready for audio before answer 
-CF_ORIGINATOR	= (1 <<  3) - Channel is an originator
-CF_TRANSFER		= (1 <<  4) - Channel is being transfered
-CF_ACCEPT_CNG	= (1 <<  5) - Channel will accept CNG frames
-CF_REDIRECT 	= (1 <<  6) - Channel is being redirected
-CF_BRIDGED		= (1 <<  7) - Channel in a bridge
-CF_HOLD			= (1 <<  8) - Channel is on hold
-CF_SERVICE		= (1 <<  9) - Channel has a service thread
-CF_TAGGED		= (1 << 10) - Channel is tagged
-CF_WINNER		= (1 << 11) - Channel is the winner
-CF_CONTROLLED	= (1 << 12) - Channel is under control
-CF_PROXY_MODE		= (1 << 13) - Channel has no media
-CF_SUSPEND		= (1 << 14) - Suspend i/o
-CF_EVENT_PARSE  = (1 << 15) - Suspend control events
-CF_USE_ME = (1 << 16) -   use me
-CF_GEN_RINGBACK = (1 << 17) - Channel is generating it's own ringback
-CF_RING_READY   = (1 << 18) - Channel is ready to send ringback
-CF_BREAK        = (1 << 19) - Channel should stop what it's doing
-CF_BROADCAST    = (1 << 20) - Channel is broadcasting
-CF_UNICAST      = (1 << 21) - Channel has a unicast connection
-CF_VIDEO		= (1 << 22) - Channel has video
-CF_EVENT_LOCK   = (1 << 23) - Don't parse events
-CF_RESET        = (1 << 24) - Tell extension parser to reset
-CF_ORIGINATING  = (1 << 25) - Channel is originating
-CF_STOP_BROADCAST = (1 << 26) - Signal to stop broadcast
+CF_ANSWERED			- Channel is answered
+CF_OUTBOUND			- Channel is an outbound channel
+CF_EARLY_MEDIA		- Channel is ready for audio before answer 
+CF_ORIGINATOR		- Channel is an originator
+CF_TRANSFER			- Channel is being transfered
+CF_ACCEPT_CNG		- Channel will accept CNG frames
+CF_REDIRECT 		- Channel is being redirected
+CF_BRIDGED			- Channel in a bridge
+CF_HOLD				- Channel is on hold
+CF_SERVICE			- Channel has a service thread
+CF_TAGGED			- Channel is tagged
+CF_WINNER			- Channel is the winner
+CF_CONTROLLED		- Channel is under control
+CF_PROXY_MODE		- Channel has no media
+CF_SUSPEND			- Suspend i/o
+CF_EVENT_PARSE		- Suspend control events
+CF_GEN_RINGBACK		- Channel is generating it's own ringback
+CF_RING_READY		- Channel is ready to send ringback
+CF_BREAK			- Channel should stop what it's doing
+CF_BROADCAST		- Channel is broadcasting
+CF_UNICAST			- Channel has a unicast connection
+CF_VIDEO			- Channel has video
+CF_EVENT_LOCK		- Don't parse events
+CF_RESET			- Tell extension parser to reset
+CF_ORIGINATING		- Channel is originating
+CF_STOP_BROADCAST	- Signal to stop broadcast
 
*/ typedef enum { - CF_ANSWERED = (1 << 0), - CF_OUTBOUND = (1 << 1), - CF_EARLY_MEDIA = (1 << 2), - CF_ORIGINATOR = (1 << 3), - CF_TRANSFER = (1 << 4), - CF_ACCEPT_CNG = (1 << 5), - CF_REDIRECT = (1 << 6), - CF_BRIDGED = (1 << 7), - CF_HOLD = (1 << 8), - CF_SERVICE = (1 << 9), - CF_TAGGED = (1 << 10), - CF_WINNER = (1 << 11), - CF_CONTROLLED = (1 << 12), - CF_PROXY_MODE = (1 << 13), - CF_SUSPEND = (1 << 14), - CF_EVENT_PARSE = (1 << 15), - CF_USE_ME = (1 << 16), - CF_GEN_RINGBACK = (1 << 17), - CF_RING_READY = (1 << 18), - CF_BREAK = (1 << 19), - CF_BROADCAST = (1 << 20), - CF_UNICAST = (1 << 21), - CF_VIDEO = (1 << 22), - CF_EVENT_LOCK = (1 << 23), - CF_RESET = (1 << 24), - CF_ORIGINATING = (1 << 25), - CF_STOP_BROADCAST = (1 << 26), - CF_PROXY_MEDIA = (1 << 27), - CF_INNER_BRIDGE = (1 << 28), - CF_REQ_MEDIA = (1 << 29), - CF_VERBOSE_EVENTS = (1 << 30) -} switch_channel_flag_enum_t; - -typedef uint32_t switch_channel_flag_t; - - + CF_ANSWERED = 1, + CF_OUTBOUND, + CF_EARLY_MEDIA, + CF_ORIGINATOR, + CF_TRANSFER, + CF_ACCEPT_CNG, + CF_REDIRECT, + CF_BRIDGED, + CF_HOLD, + CF_SERVICE, + CF_TAGGED, + CF_WINNER, + CF_CONTROLLED, + CF_PROXY_MODE, + CF_SUSPEND, + CF_EVENT_PARSE, + CF_GEN_RINGBACK, + CF_RING_READY, + CF_BREAK, + CF_BROADCAST, + CF_UNICAST, + CF_VIDEO, + CF_EVENT_LOCK, + CF_RESET, + CF_ORIGINATING, + CF_STOP_BROADCAST, + CF_PROXY_MEDIA, + CF_INNER_BRIDGE, + CF_REQ_MEDIA, + CF_VERBOSE_EVENTS, + + /* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */ + CF_FLAG_MAX +} switch_channel_flag_t; /*! \enum switch_frame_flag_t Modified: freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx (original) +++ freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx Thu Dec 11 10:20:24 2008 @@ -17084,7 +17084,7 @@ } -SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_wait_for_flag(void * jarg1, unsigned long jarg2, int jarg3, unsigned long jarg4, void * jarg5) { +SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_wait_for_flag(void * jarg1, int jarg2, int jarg3, unsigned long jarg4, void * jarg5) { int jresult ; switch_channel_t *arg1 = (switch_channel_t *) 0 ; switch_channel_flag_t arg2 ; @@ -17230,18 +17230,18 @@ } -SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_init(void * jarg1, void * jarg2, int jarg3, unsigned long jarg4) { +SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_init(void * jarg1, void * jarg2, int jarg3, int jarg4) { int jresult ; switch_channel_t *arg1 = (switch_channel_t *) 0 ; switch_core_session_t *arg2 = (switch_core_session_t *) 0 ; switch_channel_state_t arg3 ; - uint32_t arg4 ; + switch_channel_flag_t arg4 ; switch_status_t result; arg1 = (switch_channel_t *)jarg1; arg2 = (switch_core_session_t *)jarg2; arg3 = (switch_channel_state_t)jarg3; - arg4 = (uint32_t)jarg4; + arg4 = (switch_channel_flag_t)jarg4; result = (switch_status_t)switch_channel_init(arg1,arg2,arg3,arg4); jresult = result; return jresult; @@ -17481,7 +17481,7 @@ } -SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_channel_test_flag(void * jarg1, unsigned long jarg2) { +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_channel_test_flag(void * jarg1, int jarg2) { unsigned long jresult ; switch_channel_t *arg1 = (switch_channel_t *) 0 ; switch_channel_flag_t arg2 ; @@ -17495,7 +17495,7 @@ } -SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_set_flag(void * jarg1, unsigned long jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_set_flag(void * jarg1, int jarg2) { switch_channel_t *arg1 = (switch_channel_t *) 0 ; switch_channel_flag_t arg2 ; @@ -17505,7 +17505,7 @@ } -SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_set_flag_partner(void * jarg1, unsigned long jarg2) { +SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_set_flag_partner(void * jarg1, int jarg2) { int jresult ; switch_channel_t *arg1 = (switch_channel_t *) 0 ; switch_channel_flag_t arg2 ; @@ -17519,7 +17519,7 @@ } -SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_clear_flag_partner(void * jarg1, unsigned long jarg2) { +SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_clear_flag_partner(void * jarg1, int jarg2) { int jresult ; switch_channel_t *arg1 = (switch_channel_t *) 0 ; switch_channel_flag_t arg2 ; @@ -17533,7 +17533,7 @@ } -SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_set_state_flag(void * jarg1, unsigned long jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_set_state_flag(void * jarg1, int jarg2) { switch_channel_t *arg1 = (switch_channel_t *) 0 ; switch_channel_flag_t arg2 ; @@ -17543,7 +17543,7 @@ } -SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_clear_flag(void * jarg1, unsigned long jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_clear_flag(void * jarg1, int jarg2) { switch_channel_t *arg1 = (switch_channel_t *) 0 ; switch_channel_flag_t arg2 ; Modified: freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs (original) +++ freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs Thu Dec 11 10:20:24 2008 @@ -2209,8 +2209,8 @@ freeswitchPINVOKE.switch_channel_wait_for_state(SWIGTYPE_p_switch_channel.getCPtr(channel), SWIGTYPE_p_switch_channel.getCPtr(other_channel), (int)want_state); } - public static switch_status_t switch_channel_wait_for_flag(SWIGTYPE_p_switch_channel channel, uint want_flag, switch_bool_t pres, uint to, SWIGTYPE_p_switch_channel super_channel) { - switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_channel_wait_for_flag(SWIGTYPE_p_switch_channel.getCPtr(channel), want_flag, (int)pres, to, SWIGTYPE_p_switch_channel.getCPtr(super_channel)); + public static switch_status_t switch_channel_wait_for_flag(SWIGTYPE_p_switch_channel channel, switch_channel_flag_t want_flag, switch_bool_t pres, uint to, SWIGTYPE_p_switch_channel super_channel) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_channel_wait_for_flag(SWIGTYPE_p_switch_channel.getCPtr(channel), (int)want_flag, (int)pres, to, SWIGTYPE_p_switch_channel.getCPtr(super_channel)); return ret; } @@ -2260,8 +2260,8 @@ return ret; } - public static switch_status_t switch_channel_init(SWIGTYPE_p_switch_channel channel, SWIGTYPE_p_switch_core_session session, switch_channel_state_t state, uint flags) { - switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_channel_init(SWIGTYPE_p_switch_channel.getCPtr(channel), SWIGTYPE_p_switch_core_session.getCPtr(session), (int)state, flags); + public static switch_status_t switch_channel_init(SWIGTYPE_p_switch_channel channel, SWIGTYPE_p_switch_core_session session, switch_channel_state_t state, switch_channel_flag_t flag) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_channel_init(SWIGTYPE_p_switch_channel.getCPtr(channel), SWIGTYPE_p_switch_core_session.getCPtr(session), (int)state, (int)flag); return ret; } @@ -2358,31 +2358,31 @@ return ret; } - public static uint switch_channel_test_flag(SWIGTYPE_p_switch_channel channel, uint flags) { - uint ret = freeswitchPINVOKE.switch_channel_test_flag(SWIGTYPE_p_switch_channel.getCPtr(channel), flags); + public static uint switch_channel_test_flag(SWIGTYPE_p_switch_channel channel, switch_channel_flag_t flag) { + uint ret = freeswitchPINVOKE.switch_channel_test_flag(SWIGTYPE_p_switch_channel.getCPtr(channel), (int)flag); return ret; } - public static void switch_channel_set_flag(SWIGTYPE_p_switch_channel channel, uint flags) { - freeswitchPINVOKE.switch_channel_set_flag(SWIGTYPE_p_switch_channel.getCPtr(channel), flags); + public static void switch_channel_set_flag(SWIGTYPE_p_switch_channel channel, switch_channel_flag_t flag) { + freeswitchPINVOKE.switch_channel_set_flag(SWIGTYPE_p_switch_channel.getCPtr(channel), (int)flag); } - public static switch_bool_t switch_channel_set_flag_partner(SWIGTYPE_p_switch_channel channel, uint flags) { - switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_channel_set_flag_partner(SWIGTYPE_p_switch_channel.getCPtr(channel), flags); + public static switch_bool_t switch_channel_set_flag_partner(SWIGTYPE_p_switch_channel channel, switch_channel_flag_t flag) { + switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_channel_set_flag_partner(SWIGTYPE_p_switch_channel.getCPtr(channel), (int)flag); return ret; } - public static switch_bool_t switch_channel_clear_flag_partner(SWIGTYPE_p_switch_channel channel, uint flags) { - switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_channel_clear_flag_partner(SWIGTYPE_p_switch_channel.getCPtr(channel), flags); + public static switch_bool_t switch_channel_clear_flag_partner(SWIGTYPE_p_switch_channel channel, switch_channel_flag_t flag) { + switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_channel_clear_flag_partner(SWIGTYPE_p_switch_channel.getCPtr(channel), (int)flag); return ret; } - public static void switch_channel_set_state_flag(SWIGTYPE_p_switch_channel channel, uint flags) { - freeswitchPINVOKE.switch_channel_set_state_flag(SWIGTYPE_p_switch_channel.getCPtr(channel), flags); + public static void switch_channel_set_state_flag(SWIGTYPE_p_switch_channel channel, switch_channel_flag_t flag) { + freeswitchPINVOKE.switch_channel_set_state_flag(SWIGTYPE_p_switch_channel.getCPtr(channel), (int)flag); } - public static void switch_channel_clear_flag(SWIGTYPE_p_switch_channel channel, uint flags) { - freeswitchPINVOKE.switch_channel_clear_flag(SWIGTYPE_p_switch_channel.getCPtr(channel), flags); + public static void switch_channel_clear_flag(SWIGTYPE_p_switch_channel channel, switch_channel_flag_t flag) { + freeswitchPINVOKE.switch_channel_clear_flag(SWIGTYPE_p_switch_channel.getCPtr(channel), (int)flag); } public static switch_status_t switch_channel_perform_answer(SWIGTYPE_p_switch_channel channel, string file, string func, int line) { @@ -8343,7 +8343,7 @@ public static extern void switch_channel_wait_for_state(HandleRef jarg1, HandleRef jarg2, int jarg3); [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_wait_for_flag")] - public static extern int switch_channel_wait_for_flag(HandleRef jarg1, uint jarg2, int jarg3, uint jarg4, HandleRef jarg5); + public static extern int switch_channel_wait_for_flag(HandleRef jarg1, int jarg2, int jarg3, uint jarg4, HandleRef jarg5); [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_perform_set_state")] public static extern int switch_channel_perform_set_state(HandleRef jarg1, string jarg2, string jarg3, int jarg4, int jarg5); @@ -8373,7 +8373,7 @@ public static extern int switch_channel_alloc(HandleRef jarg1, HandleRef jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_init")] - public static extern int switch_channel_init(HandleRef jarg1, HandleRef jarg2, int jarg3, uint jarg4); + public static extern int switch_channel_init(HandleRef jarg1, HandleRef jarg2, int jarg3, int jarg4); [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_presence")] public static extern void switch_channel_presence(HandleRef jarg1, string jarg2, string jarg3, string jarg4); @@ -8433,22 +8433,22 @@ public static extern IntPtr switch_channel_get_caller_extension(HandleRef jarg1); [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_test_flag")] - public static extern uint switch_channel_test_flag(HandleRef jarg1, uint jarg2); + public static extern uint switch_channel_test_flag(HandleRef jarg1, int jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_set_flag")] - public static extern void switch_channel_set_flag(HandleRef jarg1, uint jarg2); + public static extern void switch_channel_set_flag(HandleRef jarg1, int jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_set_flag_partner")] - public static extern int switch_channel_set_flag_partner(HandleRef jarg1, uint jarg2); + public static extern int switch_channel_set_flag_partner(HandleRef jarg1, int jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_clear_flag_partner")] - public static extern int switch_channel_clear_flag_partner(HandleRef jarg1, uint jarg2); + public static extern int switch_channel_clear_flag_partner(HandleRef jarg1, int jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_set_state_flag")] - public static extern void switch_channel_set_state_flag(HandleRef jarg1, uint jarg2); + public static extern void switch_channel_set_state_flag(HandleRef jarg1, int jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_clear_flag")] - public static extern void switch_channel_clear_flag(HandleRef jarg1, uint jarg2); + public static extern void switch_channel_clear_flag(HandleRef jarg1, int jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_perform_answer")] public static extern int switch_channel_perform_answer(HandleRef jarg1, string jarg2, string jarg3, int jarg4); @@ -16832,38 +16832,38 @@ namespace FreeSWITCH.Native { -[System.Flags] public enum switch_channel_flag_enum_t { - CF_ANSWERED = (1 << 0), - CF_OUTBOUND = (1 << 1), - CF_EARLY_MEDIA = (1 << 2), - CF_ORIGINATOR = (1 << 3), - CF_TRANSFER = (1 << 4), - CF_ACCEPT_CNG = (1 << 5), - CF_REDIRECT = (1 << 6), - CF_BRIDGED = (1 << 7), - CF_HOLD = (1 << 8), - CF_SERVICE = (1 << 9), - CF_TAGGED = (1 << 10), - CF_WINNER = (1 << 11), - CF_CONTROLLED = (1 << 12), - CF_PROXY_MODE = (1 << 13), - CF_SUSPEND = (1 << 14), - CF_EVENT_PARSE = (1 << 15), - CF_USE_ME = (1 << 16), - CF_GEN_RINGBACK = (1 << 17), - CF_RING_READY = (1 << 18), - CF_BREAK = (1 << 19), - CF_BROADCAST = (1 << 20), - CF_UNICAST = (1 << 21), - CF_VIDEO = (1 << 22), - CF_EVENT_LOCK = (1 << 23), - CF_RESET = (1 << 24), - CF_ORIGINATING = (1 << 25), - CF_STOP_BROADCAST = (1 << 26), - CF_PROXY_MEDIA = (1 << 27), - CF_INNER_BRIDGE = (1 << 28), - CF_REQ_MEDIA = (1 << 29), - CF_VERBOSE_EVENTS = (1 << 30) +public enum switch_channel_flag_t { + CF_ANSWERED = 1, + CF_OUTBOUND, + CF_EARLY_MEDIA, + CF_ORIGINATOR, + CF_TRANSFER, + CF_ACCEPT_CNG, + CF_REDIRECT, + CF_BRIDGED, + CF_HOLD, + CF_SERVICE, + CF_TAGGED, + CF_WINNER, + CF_CONTROLLED, + CF_PROXY_MODE, + CF_SUSPEND, + CF_EVENT_PARSE, + CF_GEN_RINGBACK, + CF_RING_READY, + CF_BREAK, + CF_BROADCAST, + CF_UNICAST, + CF_VIDEO, + CF_EVENT_LOCK, + CF_RESET, + CF_ORIGINATING, + CF_STOP_BROADCAST, + CF_PROXY_MEDIA, + CF_INNER_BRIDGE, + CF_REQ_MEDIA, + CF_VERBOSE_EVENTS, + CF_FLAG_MAX } } Modified: freeswitch/trunk/src/switch_channel.c ============================================================================== --- freeswitch/trunk/src/switch_channel.c (original) +++ freeswitch/trunk/src/switch_channel.c Thu Dec 11 10:20:24 2008 @@ -115,9 +115,9 @@ switch_core_session_t *session; switch_channel_state_t state; switch_channel_state_t running_state; - switch_channel_flag_t flags; + uint8_t flags[CF_FLAG_MAX]; + uint8_t state_flags[CF_FLAG_MAX]; uint32_t private_flags; - switch_channel_flag_t state_flags; switch_caller_profile_t *caller_profile; const switch_state_handler_table_t *state_handlers[SWITCH_MAX_STATE_HANDLERS]; int state_handler_index; @@ -410,11 +410,11 @@ } SWITCH_DECLARE(switch_status_t) switch_channel_init(switch_channel_t *channel, switch_core_session_t *session, switch_channel_state_t state, - uint32_t flags) + switch_channel_flag_t flag) { switch_assert(channel != NULL); channel->state = state; - channel->flags = flags; + switch_channel_set_flag(channel, flag); channel->session = session; channel->running_state = CS_NONE; return SWITCH_STATUS_SUCCESS; @@ -643,13 +643,13 @@ return SWITCH_STATUS_FALSE; } -SWITCH_DECLARE(uint32_t) switch_channel_test_flag(switch_channel_t *channel, switch_channel_flag_t flags) +SWITCH_DECLARE(uint32_t) switch_channel_test_flag(switch_channel_t *channel, switch_channel_flag_t flag) { switch_assert(channel != NULL); - return switch_test_flag(channel, flags) ? 1 : 0; + return channel->flags[flag] ? 1 : 0; } -SWITCH_DECLARE(switch_bool_t) switch_channel_set_flag_partner(switch_channel_t *channel, switch_channel_flag_t flags) +SWITCH_DECLARE(switch_bool_t) switch_channel_set_flag_partner(switch_channel_t *channel, switch_channel_flag_t flag) { const char *uuid; @@ -658,7 +658,7 @@ if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) { switch_core_session_t *session; if ((session = switch_core_session_locate(uuid))) { - switch_channel_set_flag(switch_core_session_get_channel(session), flags); + switch_channel_set_flag(switch_core_session_get_channel(session), flag); switch_core_session_rwunlock(session); return SWITCH_TRUE; } @@ -667,7 +667,7 @@ return SWITCH_FALSE; } -SWITCH_DECLARE(switch_bool_t) switch_channel_clear_flag_partner(switch_channel_t *channel, switch_channel_flag_t flags) +SWITCH_DECLARE(switch_bool_t) switch_channel_clear_flag_partner(switch_channel_t *channel, switch_channel_flag_t flag) { const char *uuid; @@ -676,7 +676,7 @@ if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) { switch_core_session_t *session; if ((session = switch_core_session_locate(uuid))) { - switch_channel_clear_flag(switch_core_session_get_channel(session), flags); + switch_channel_clear_flag(switch_core_session_get_channel(session), flag); switch_core_session_rwunlock(session); return SWITCH_TRUE; } @@ -714,11 +714,11 @@ for (;;) { if (pres) { - if (switch_test_flag(channel, want_flag)) { + if (switch_channel_test_flag(channel, want_flag)) { break; } } else { - if (!switch_test_flag(channel, want_flag)) { + if (!switch_channel_test_flag(channel, want_flag)) { break; } } @@ -741,11 +741,16 @@ return SWITCH_STATUS_SUCCESS; } -SWITCH_DECLARE(void) switch_channel_set_flag(switch_channel_t *channel, switch_channel_flag_t flags) +SWITCH_DECLARE(void) switch_channel_set_flag(switch_channel_t *channel, switch_channel_flag_t flag) { - switch_assert(channel != NULL); - switch_set_flag_locked(channel, flags); - if (flags & CF_OUTBOUND) { + switch_assert(channel); + switch_assert(channel->flag_mutex); + + switch_mutex_lock(channel->flag_mutex); + channel->flags[flag] = 1; + switch_mutex_unlock(channel->flag_mutex); + + if (flag == CF_OUTBOUND) { switch_channel_set_variable(channel, "is_outbound", "true"); } } @@ -773,21 +778,25 @@ return (channel->private_flags & flags); } - -SWITCH_DECLARE(void) switch_channel_set_state_flag(switch_channel_t *channel, switch_channel_flag_t flags) +SWITCH_DECLARE(void) switch_channel_set_state_flag(switch_channel_t *channel, switch_channel_flag_t flag) { switch_assert(channel != NULL); switch_mutex_lock(channel->flag_mutex); - channel->state_flags |= flags; + channel->state_flags[0] = 1; + channel->state_flags[flag] = 1; switch_mutex_unlock(channel->flag_mutex); } -SWITCH_DECLARE(void) switch_channel_clear_flag(switch_channel_t *channel, switch_channel_flag_t flags) +SWITCH_DECLARE(void) switch_channel_clear_flag(switch_channel_t *channel, switch_channel_flag_t flag) { switch_assert(channel != NULL); - switch_clear_flag_locked(channel, flags); - if (flags & CF_OUTBOUND) { + switch_assert(channel->flag_mutex); + + switch_mutex_lock(channel->flag_mutex); + channel->flags[flag] = 0; + switch_mutex_unlock(channel->flag_mutex); + if (flag == CF_OUTBOUND) { switch_channel_set_variable(channel, "is_outbound", NULL); } } @@ -823,7 +832,7 @@ switch_assert(channel != NULL); if (!channel->hangup_cause && channel->state > CS_ROUTING && channel->state < CS_HANGUP && channel->state != CS_RESET && - !switch_test_flag(channel, CF_TRANSFER)) { + !switch_channel_test_flag(channel, CF_TRANSFER)) { ret++; } @@ -867,16 +876,22 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_running_state(switch_channel_t *channel, switch_channel_state_t state, const char *file, const char *func, int line) { + int x; switch_mutex_lock(channel->flag_mutex); switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_DEBUG, "(%s) Running State Change %s\n", channel->name, state_names[state]); channel->running_state = state; - if (channel->state_flags) { - channel->flags |= channel->state_flags; - channel->state_flags = 0; + if (channel->state_flags[0]) { + for(x = 1; x < CF_FLAG_MAX ; x++ ) { + if (channel->state_flags[x]) { + channel->flags[x] = 1; + channel->state_flags[x] = 0; + } + } + channel->state_flags[0] = 0; } - switch_clear_flag(channel, CF_TAGGED); + switch_channel_clear_flag(channel, CF_TAGGED); if (channel->state >= CS_ROUTING) { switch_channel_presence(channel, "unknown", (char *) state_names[state], NULL); @@ -1185,7 +1200,7 @@ } - if (switch_test_flag(channel, CF_VERBOSE_EVENTS) || + if (switch_channel_test_flag(channel, CF_VERBOSE_EVENTS) || event->event_id == SWITCH_EVENT_CHANNEL_ORIGINATE || event->event_id == SWITCH_EVENT_CHANNEL_UUID || event->event_id == SWITCH_EVENT_CHANNEL_ANSWER || From mikej at freeswitch.org Thu Dec 11 07:26:00 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Thu, 11 Dec 2008 10:26:00 -0500 Subject: [Freeswitch-svn] [commit] r10711 - freeswitch/trunk/src/mod/event_handlers/mod_event_socket Message-ID: Author: mikej Date: Thu Dec 11 10:25:59 2008 New Revision: 10711 Log: MODEVENT-33 missing : after Content-Length in event socket Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c ============================================================================== --- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c (original) +++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c Thu Dec 11 10:25:59 2008 @@ -1649,7 +1649,7 @@ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "IP %s Rejected by acl \"%s\"\n", listener->remote_ip, prefs.acl[x]); - switch_snprintf(buf, sizeof(buf), "Content-Type: text/rude-rejection\nContent-Length %d\n\n", mlen); + switch_snprintf(buf, sizeof(buf), "Content-Type: text/rude-rejection\nContent-Length: %d\n\n", mlen); len = strlen(buf); switch_socket_send(listener->sock, buf, &len); len = mlen; @@ -1799,7 +1799,7 @@ const char message[] = "Disconnected, goodbye!\nSee you at ClueCon http://www.cluecon.com!\n"; int mlen = strlen(message); - switch_snprintf(disco_buf, sizeof(disco_buf), "Content-Type: text/disconnect-notice\nContent-Length %d\n\n", mlen); + switch_snprintf(disco_buf, sizeof(disco_buf), "Content-Type: text/disconnect-notice\nContent-Length: %d\n\n", mlen); len = strlen(disco_buf); switch_socket_send(listener->sock, disco_buf, &len); len = mlen; From brian at freeswitch.org Thu Dec 11 07:51:15 2008 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Thu, 11 Dec 2008 10:51:15 -0500 Subject: [Freeswitch-svn] [commit] r10712 - freeswitch/trunk/conf/autoload_configs Message-ID: Author: brian Date: Thu Dec 11 10:51:15 2008 New Revision: 10712 Log: tweak this Modified: freeswitch/trunk/conf/autoload_configs/local_stream.conf.xml Modified: freeswitch/trunk/conf/autoload_configs/local_stream.conf.xml ============================================================================== --- freeswitch/trunk/conf/autoload_configs/local_stream.conf.xml (original) +++ freeswitch/trunk/conf/autoload_configs/local_stream.conf.xml Thu Dec 11 10:51:15 2008 @@ -14,7 +14,7 @@ - + From gmaruzz at freeswitch.org Thu Dec 11 08:00:24 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Thu, 11 Dec 2008 11:00:24 -0500 Subject: [Freeswitch-svn] [commit] r10713 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Thu Dec 11 11:00:23 2008 New Revision: 10713 Log: skypiax: better function distribution between mod_skypiax.c and skypiax_protocol.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Thu Dec 11 11:00:23 2008 @@ -155,6 +155,53 @@ return SWITCH_STATUS_SUCCESS; } +static switch_status_t channel_on_hangup(switch_core_session_t * session) +{ + switch_channel_t *channel = NULL; + private_t *tech_pvt = NULL; + skypiax_interface_t *p; + char msg_to_skype[256]; + + channel = switch_core_session_get_channel(session); + assert(channel != NULL); + + tech_pvt = switch_core_session_get_private(session); + assert(tech_pvt != NULL); + + p = tech_pvt->p; + + switch_clear_flag_locked(tech_pvt, TFLAG_IO); + switch_clear_flag_locked(tech_pvt, TFLAG_VOICE); + //switch_set_flag_locked(tech_pvt, TFLAG_HANGUP); + + if (strlen(p->skype_call_id)) { + //switch_thread_cond_signal(tech_pvt->cond); + WARNINGA("hanging up skype call: %s\n", SKYPIAX_P_LOG, p->skype_call_id); + //sprintf(msg_to_skype, "SET CALL %s STATUS FINISHED", p->skype_call_id); + sprintf(msg_to_skype, "ALTER CALL %s HANGUP", p->skype_call_id); + skypiax_skype_write(p, msg_to_skype); + } + + if (tech_pvt->read_codec.implementation) { + switch_core_codec_destroy(&tech_pvt->read_codec); + } + + if (tech_pvt->write_codec.implementation) { + switch_core_codec_destroy(&tech_pvt->write_codec); + } + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL HANGUP\n", + switch_channel_get_name(channel)); + switch_mutex_lock(globals.mutex); + globals.calls--; + if (globals.calls < 0) { + globals.calls = 0; + } + switch_mutex_unlock(globals.mutex); + + return SWITCH_STATUS_SUCCESS; +} + static switch_status_t channel_on_routing(switch_core_session_t * session) { switch_channel_t *channel = NULL; @@ -879,52 +926,6 @@ return SWITCH_STATUS_SUCCESS; } -static switch_status_t channel_on_hangup(switch_core_session_t * session) -{ - switch_channel_t *channel = NULL; - private_t *tech_pvt = NULL; - skypiax_interface_t *p; - char msg_to_skype[256]; - - channel = switch_core_session_get_channel(session); - assert(channel != NULL); - - tech_pvt = switch_core_session_get_private(session); - assert(tech_pvt != NULL); - - p = tech_pvt->p; - - switch_clear_flag_locked(tech_pvt, TFLAG_IO); - switch_clear_flag_locked(tech_pvt, TFLAG_VOICE); - //switch_set_flag_locked(tech_pvt, TFLAG_HANGUP); - - if (strlen(p->skype_call_id)) { - //switch_thread_cond_signal(tech_pvt->cond); - WARNINGA("hanging up skype call: %s\n", SKYPIAX_P_LOG, p->skype_call_id); - //sprintf(msg_to_skype, "SET CALL %s STATUS FINISHED", p->skype_call_id); - sprintf(msg_to_skype, "ALTER CALL %s HANGUP", p->skype_call_id); - skypiax_skype_write(p, msg_to_skype); - } - - if (tech_pvt->read_codec.implementation) { - switch_core_codec_destroy(&tech_pvt->read_codec); - } - - if (tech_pvt->write_codec.implementation) { - switch_core_codec_destroy(&tech_pvt->write_codec); - } - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL HANGUP\n", - switch_channel_get_name(channel)); - switch_mutex_lock(globals.mutex); - globals.calls--; - if (globals.calls < 0) { - globals.calls = 0; - } - switch_mutex_unlock(globals.mutex); - - return SWITCH_STATUS_SUCCESS; -} /* For Emacs: * Local Variables: From mikej at freeswitch.org Thu Dec 11 09:56:51 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Thu, 11 Dec 2008 12:56:51 -0500 Subject: [Freeswitch-svn] [commit] r10714 - freeswitch/trunk/src/mod/applications/mod_commands Message-ID: Author: mikej Date: Thu Dec 11 12:56:51 2008 New Revision: 10714 Log: mod_commands only send content-type on status when it really is http. Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c (original) +++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c Thu Dec 11 12:56:51 2008 @@ -704,13 +704,14 @@ if (stream->param_event) { http = switch_event_get_header(stream->param_event, "http-host"); + if ((var = switch_event_get_header(stream->param_event, "content-type"))) { + if (!strcasecmp(var, "text/plain")) { + http = NULL; + } + } } - if ((var = switch_event_get_header(stream->param_event, "content-type"))) { - if (!strcasecmp(var, "text/plain")) { - http = NULL; - } - } else { + if (http) { stream->write_function(stream, "%s", "Content-Type: text/html\n\n"); } From brian at freeswitch.org Thu Dec 11 12:16:33 2008 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Thu, 11 Dec 2008 15:16:33 -0500 Subject: [Freeswitch-svn] [commit] r10715 - in freeswitch/trunk: conf/autoload_configs src/mod/endpoints/mod_sofia Message-ID: Author: brian Date: Thu Dec 11 15:16:32 2008 New Revision: 10715 Log: option to turn of auto_restart of sofia profiles on ip change Modified: freeswitch/trunk/conf/autoload_configs/sofia.conf.xml freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Modified: freeswitch/trunk/conf/autoload_configs/sofia.conf.xml ============================================================================== --- freeswitch/trunk/conf/autoload_configs/sofia.conf.xml (original) +++ freeswitch/trunk/conf/autoload_configs/sofia.conf.xml Thu Dec 11 15:16:32 2008 @@ -2,6 +2,8 @@ + + From brian at freeswitch.org Fri Dec 12 15:53:37 2008 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Fri, 12 Dec 2008 18:53:37 -0500 Subject: [Freeswitch-svn] [commit] r10747 - freeswitch/trunk/conf/autoload_configs Message-ID: Author: brian Date: Fri Dec 12 18:53:37 2008 New Revision: 10747 Log: more tweaks Modified: freeswitch/trunk/conf/autoload_configs/java.conf.xml freeswitch/trunk/conf/autoload_configs/lua.conf.xml Modified: freeswitch/trunk/conf/autoload_configs/java.conf.xml ============================================================================== --- freeswitch/trunk/conf/autoload_configs/java.conf.xml (original) +++ freeswitch/trunk/conf/autoload_configs/java.conf.xml Fri Dec 12 18:53:37 2008 @@ -4,7 +4,7 @@ - Modified: freeswitch/trunk/conf/autoload_configs/lua.conf.xml ============================================================================== --- freeswitch/trunk/conf/autoload_configs/lua.conf.xml (original) +++ freeswitch/trunk/conf/autoload_configs/lua.conf.xml Fri Dec 12 18:53:37 2008 @@ -13,7 +13,7 @@ These entries will be pre-pended to the LUA_PATH environment variable --> - + From mcollins at freeswitch.org Fri Dec 12 20:57:28 2008 From: mcollins at freeswitch.org (FreeSWITCH SVN) Date: Fri, 12 Dec 2008 23:57:28 -0500 Subject: [Freeswitch-svn] [commit] r10748 - freeswitch/trunk/src/mod/applications/mod_commands Message-ID: Author: mcollins Date: Fri Dec 12 23:57:27 2008 New Revision: 10748 Log: api command sent through sched_api was getting the last char lopped off Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c (original) +++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c Fri Dec 12 23:57:27 2008 @@ -2106,7 +2106,7 @@ } switch_zmalloc(api_task, sizeof(*api_task) + strlen(dcmd) + 1); - switch_copy_string(api_task->cmd, dcmd, strlen(dcmd)); + switch_copy_string(api_task->cmd, dcmd, strlen(dcmd) + 1); api_task->recur = recur; id = switch_scheduler_add_task(when, sch_api_callback, (char *) __SWITCH_FUNC__, group, 0, api_task, SSHF_FREE_ARG); From mcollins at freeswitch.org Fri Dec 12 22:31:32 2008 From: mcollins at freeswitch.org (FreeSWITCH SVN) Date: Sat, 13 Dec 2008 01:31:32 -0500 Subject: [Freeswitch-svn] [commit] r10749 - freeswitch/trunk/scripts/contrib/mcollins Message-ID: Author: mcollins Date: Sat Dec 13 01:31:32 2008 New Revision: 10749 Log: Add uuid_send_dtmf.lua script Added: freeswitch/trunk/scripts/contrib/mcollins/uuid_send_dtmf.lua (contents, props changed) Added: freeswitch/trunk/scripts/contrib/mcollins/uuid_send_dtmf.lua ============================================================================== --- (empty file) +++ freeswitch/trunk/scripts/contrib/mcollins/uuid_send_dtmf.lua Sat Dec 13 01:31:32 2008 @@ -0,0 +1,44 @@ +--[[ + + uuid_send_dtmf.lua + +Do uuid_send_dtmf from dialplan +accepts three args: uuid, time, and dtmf +uuid is the uuid of the session +time is the "+ " value in seconds +dtmf is the sequence of dtmf digit(s) to send + +NOTE: only the "+" syntax of sched_api is supported here +NOTE: No error checking, so don't forget to send all args + +Example dialplan call: + + +--]] + +-- Do not hangup at end of script +session:setAutoHangup(false); + +-- get an api object +api = freeswitch.API(); + +-- get the calling args (uuid, time, dtmf) +uuid = argv[1]; +time = argv[2]; +dtmf = argv[3]; + +apicmd = "sched_api"; +apiarg = "+" .. time .. " none uuid_send_dtmf " .. uuid .. " " .. dtmf; + +freeswitch.console_log("NOTICE","apicmd: " .. apicmd .. "\n"); +freeswitch.console_log("NOTICE","apiarg: " .. apiarg .. "\n\n"); + +if uuid then + -- schedule the uuid_send_dtmf + res = api:execute(apicmd,apiarg); + freeswitch.console_log("ERR","Result is " .. res .. "\n\n"); +else + freeswitch.console_log("ERR","Did not receive a uuid for this call!\n"); +end + +-- All done! From gmaruzz at freeswitch.org Sat Dec 13 00:31:51 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Sat, 13 Dec 2008 03:31:51 -0500 Subject: [Freeswitch-svn] [commit] r10750 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Sat Dec 13 03:31:50 2008 New Revision: 10750 Log: skypiax: cleaning, restructuring Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Sat Dec 13 03:31:50 2008 @@ -20,6 +20,7 @@ int fd; int calls; char hold_music[256]; + skypiax_interface_t SKYPIAX_INTERFACES[SKYPIAX_MAX_INTERFACES]; switch_mutex_t *mutex; } globals; @@ -30,14 +31,11 @@ switch_endpoint_interface_t *skypiax_endpoint_interface; switch_memory_pool_t *skypiax_module_pool = NULL; int running = 1; -skypiax_interface_t SKYPIAX_INTERFACES[SKYPIAX_MAX_INTERFACES]; switch_core_session_t *global_session = NULL; #ifdef WIN32 HANDLE win32_hGlobal_ThreadShutdownEvent; HWND win32_hInit_MainWindowHandle; #endif /* WIN32 */ -switch_thread_t *skypiax_do_controldev_thread_thread; -switch_thread_t *do_skype_thread_thread; /*************************************************/ /*************************************************/ /*************************************************/ @@ -509,7 +507,7 @@ switch_core_session_add_stream(*new_session, NULL); if ((tech_pvt = (private_t *) switch_core_session_alloc(*new_session, sizeof(private_t))) != 0) { - tech_pvt->p = &SKYPIAX_INTERFACES[2]; //FIXME + tech_pvt->p = &globals.SKYPIAX_INTERFACES[2]; //FIXME channel = switch_core_session_get_channel(*new_session); skypiax_tech_init(tech_pvt, *new_session, NULL); } else { @@ -754,44 +752,54 @@ if (name) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "name=%s\n", name); } + +#ifndef WIN32 + if (!XInitThreads()) { + ERRORA("Not initialized XInitThreads!\n", SKYPIAX_P_LOG); + } else { + DEBUGA_SKYPE("Initialized XInitThreads!\n", SKYPIAX_P_LOG); + } + switch_sleep(100); +#endif /* WIN32 */ + if (interface_id && interface_id < SKYPIAX_MAX_INTERFACES) { struct skypiax_interface newconf; switch_threadattr_t *do_skype_thd_attr = NULL; switch_threadattr_t *skypiax_do_controldev_thread_thd_attr = NULL; memset(&newconf, '\0', sizeof(newconf)); - SKYPIAX_INTERFACES[interface_id] = newconf; + globals.SKYPIAX_INTERFACES[interface_id] = newconf; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CONFIGURING interface_id=%d\n", interface_id); - switch_set_string(SKYPIAX_INTERFACES[interface_id].interface_id, id); + switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].interface_id, id); if (name) { - switch_set_string(SKYPIAX_INTERFACES[interface_id].name, name); + switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].name, name); } else { - switch_set_string(SKYPIAX_INTERFACES[interface_id].name, "N/A"); + switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].name, "N/A"); } - switch_set_string(SKYPIAX_INTERFACES[interface_id].X11_display, X11_display); - switch_set_string(SKYPIAX_INTERFACES[interface_id].context, context); - switch_set_string(SKYPIAX_INTERFACES[interface_id].dialplan, dialplan); + switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].X11_display, X11_display); + switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].context, context); + switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].dialplan, dialplan); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, - "interface_id=%d SKYPIAX_INTERFACES[interface_id].X11_display=%s\n", - interface_id, SKYPIAX_INTERFACES[interface_id].X11_display); + "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].X11_display=%s\n", + interface_id, globals.SKYPIAX_INTERFACES[interface_id].X11_display); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, - "interface_id=%d SKYPIAX_INTERFACES[interface_id].name=%s\n", - interface_id, SKYPIAX_INTERFACES[interface_id].name); + "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].name=%s\n", + interface_id, globals.SKYPIAX_INTERFACES[interface_id].name); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, - "interface_id=%d SKYPIAX_INTERFACES[interface_id].context=%s\n", - interface_id, SKYPIAX_INTERFACES[interface_id].context); + "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].context=%s\n", + interface_id, globals.SKYPIAX_INTERFACES[interface_id].context); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, - "interface_id=%d SKYPIAX_INTERFACES[interface_id].dialplan=%s\n", - interface_id, SKYPIAX_INTERFACES[interface_id].dialplan); + "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].dialplan=%s\n", + interface_id, globals.SKYPIAX_INTERFACES[interface_id].dialplan); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "STARTING interface_id=%d\n", interface_id); switch_threadattr_create(&do_skype_thd_attr, skypiax_module_pool); //switch_threadattr_detach_set(do_skype_thd_attr, 1); switch_threadattr_stacksize_set(do_skype_thd_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&do_skype_thread_thread, do_skype_thd_attr, do_skype_thread, - &SKYPIAX_INTERFACES[interface_id], skypiax_module_pool); + switch_thread_create(&globals.SKYPIAX_INTERFACES[interface_id].skypiax_do_skype_thread_thread, do_skype_thd_attr, do_skype_thread, + &globals.SKYPIAX_INTERFACES[interface_id], skypiax_module_pool); switch_sleep(100000); @@ -800,14 +808,14 @@ //switch_threadattr_detach_set(skypiax_do_controldev_thread_thd_attr, 1); switch_threadattr_stacksize_set(skypiax_do_controldev_thread_thd_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&skypiax_do_controldev_thread_thread, + switch_thread_create(&globals.SKYPIAX_INTERFACES[interface_id].skypiax_do_controldev_thread_thread, skypiax_do_controldev_thread_thd_attr, skypiax_do_controldev_thread, - &SKYPIAX_INTERFACES[interface_id], skypiax_module_pool); + &globals.SKYPIAX_INTERFACES[interface_id], skypiax_module_pool); switch_sleep(1000000); - skypiax_skypeaudio_init(&SKYPIAX_INTERFACES[interface_id]); + skypiax_skypeaudio_init(&globals.SKYPIAX_INTERFACES[interface_id]); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "STARTED interface_id=%d\n", interface_id); @@ -822,22 +830,22 @@ } for (i = 0; i < SKYPIAX_MAX_INTERFACES; i++) { - if (strlen(SKYPIAX_INTERFACES[i].name)) { + if (strlen(globals.SKYPIAX_INTERFACES[i].name)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, - "i=%d SKYPIAX_INTERFACES[%d].interface_id=%s\n", i, i, - SKYPIAX_INTERFACES[i].interface_id); + "i=%d globals.SKYPIAX_INTERFACES[%d].interface_id=%s\n", i, i, + globals.SKYPIAX_INTERFACES[i].interface_id); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, - "i=%d SKYPIAX_INTERFACES[%d].X11_display=%s\n", i, i, - SKYPIAX_INTERFACES[i].X11_display); + "i=%d globals.SKYPIAX_INTERFACES[%d].X11_display=%s\n", i, i, + globals.SKYPIAX_INTERFACES[i].X11_display); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, - "i=%d SKYPIAX_INTERFACES[%d].name=%s\n", i, i, - SKYPIAX_INTERFACES[i].name); + "i=%d globals.SKYPIAX_INTERFACES[%d].name=%s\n", i, i, + globals.SKYPIAX_INTERFACES[i].name); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, - "i=%d SKYPIAX_INTERFACES[%d].context=%s\n", i, i, - SKYPIAX_INTERFACES[i].context); + "i=%d globals.SKYPIAX_INTERFACES[%d].context=%s\n", i, i, + globals.SKYPIAX_INTERFACES[i].context); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, - "i=%d SKYPIAX_INTERFACES[%d].dialplan=%s\n", i, i, - SKYPIAX_INTERFACES[i].dialplan); + "i=%d globals.SKYPIAX_INTERFACES[%d].dialplan=%s\n", i, i, + globals.SKYPIAX_INTERFACES[i].dialplan); } } } @@ -849,21 +857,12 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_skypiax_load) { - struct skypiax_interface *p = NULL; + struct skypiax_interface *p = NULL; //for logging skypiax_module_pool = pool; memset(&globals, '\0', sizeof(globals)); - memset(SKYPIAX_INTERFACES, '\0', sizeof(SKYPIAX_INTERFACES)); - -#ifndef WIN32 - if (!XInitThreads()) { - ERRORA("Not initialized XInitThreads!\n", SKYPIAX_P_LOG); - } else { - DEBUGA_SKYPE("Initialized XInitThreads!\n", SKYPIAX_P_LOG); - } - switch_sleep(100); -#endif /* _WINDOWS_ */ + //memset(globals.SKYPIAX_INTERFACES, '\0', sizeof(globals.SKYPIAX_INTERFACES)); load_config(); @@ -892,13 +891,20 @@ struct skypiax_interface *p = NULL; switch_status_t status; unsigned int howmany = 8; +int interface_id; - p = &SKYPIAX_INTERFACES[2]; + //p = &globals.SKYPIAX_INTERFACES[2]; running = 0; +for(interface_id=0; interface_id < SKYPIAX_MAX_INTERFACES; interface_id++){ + p = &globals.SKYPIAX_INTERFACES[interface_id]; + +if(globals.SKYPIAX_INTERFACES[interface_id].skypiax_do_controldev_thread_thread){ switch_file_write(p->AsteriskHandlesAst.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die + } +if(globals.SKYPIAX_INTERFACES[interface_id].skypiax_do_skype_thread_thread){ #ifdef WIN32 if (SendMessage(win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) { // let's the do_skype_thread die ERRORA("WHY FALSE HERE? %d\n", SKYPIAX_P_LOG, GetLastError()); @@ -917,12 +923,18 @@ XSendEvent(p->AsteriskHandlesAst.disp, p->AsteriskHandlesAst.win, False, 0, &e); XSync(p->AsteriskHandlesAst.disp, False); #endif + } while (x) { x--; switch_yield(20000); } - switch_thread_join(&status, skypiax_do_controldev_thread_thread); - switch_thread_join(&status, do_skype_thread_thread); +if(globals.SKYPIAX_INTERFACES[interface_id].skypiax_do_controldev_thread_thread){ + switch_thread_join(&status, globals.SKYPIAX_INTERFACES[interface_id].skypiax_do_controldev_thread_thread); + } +if(globals.SKYPIAX_INTERFACES[interface_id].skypiax_do_skype_thread_thread){ + switch_thread_join(&status, globals.SKYPIAX_INTERFACES[interface_id].skypiax_do_skype_thread_thread); + } + } return SWITCH_STATUS_SUCCESS; } Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h Sat Dec 13 03:31:50 2008 @@ -173,6 +173,8 @@ switch_file_t *audioskypepipe[2]; switch_thread_t *tcp_srv_thread; switch_thread_t *tcp_cli_thread; + switch_thread_t *skypiax_do_controldev_thread_thread; + switch_thread_t *skypiax_do_skype_thread_thread; short audiobuf[160]; int audiobuf_is_loaded; Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Sat Dec 13 03:31:50 2008 @@ -5,7 +5,6 @@ extern switch_core_session_t *global_session; extern switch_endpoint_interface_t *skypiax_endpoint_interface; extern int running; -extern skypiax_interface_t SKYPIAX_INTERFACES; #ifdef WIN32 extern HWND win32_hInit_MainWindowHandle; #endif /* WIN32 */ @@ -575,7 +574,7 @@ /* destroy window class */ struct skypiax_interface *p; - DWORD MsgWaitResult; + //DWORD MsgWaitResult; p = obj; switch_file_pipe_create_ex(&p->AsteriskHandlesAst.fdesc[0], @@ -603,7 +602,7 @@ if (!running) break; while (GetMessage(&oMessage, 0, 0, 0)) { - break; + //break; TranslateMessage(&oMessage); DispatchMessage(&oMessage); } From gmaruzz at freeswitch.org Sat Dec 13 02:29:43 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Sat, 13 Dec 2008 05:29:43 -0500 Subject: [Freeswitch-svn] [commit] r10751 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Sat Dec 13 05:29:42 2008 New Revision: 10751 Log: skypiax: cleaning, restructuring Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Sat Dec 13 05:29:42 2008 @@ -33,7 +33,6 @@ int running = 1; switch_core_session_t *global_session = NULL; #ifdef WIN32 -HANDLE win32_hGlobal_ThreadShutdownEvent; HWND win32_hInit_MainWindowHandle; #endif /* WIN32 */ /*************************************************/ Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Sat Dec 13 05:29:42 2008 @@ -8,31 +8,50 @@ #ifdef WIN32 extern HWND win32_hInit_MainWindowHandle; #endif /* WIN32 */ +/**********************************************************/ +/**********************************************************/ +/**********************************************************/ +#ifdef WIN32 +struct AsteriskHandles *win32_AsteriskHandlesSkype; +HINSTANCE win32_hInit_ProcessHandle; +char win32_acInit_WindowClassName[128]; +UINT win32_uiGlobal_MsgID_SkypeControlAPIAttach; +UINT win32_uiGlobal_MsgID_SkypeControlAPIDiscover; +HWND win32_hGlobal_SkypeAPIWindowHandle = NULL; +DWORD win32_ulGlobal_PromptConsoleMode = 0; +HANDLE volatile win32_hGlobal_PromptConsoleHandle = NULL; +#else /* NOT WIN32 */ +#define SKYPE_X11_BUF_SIZE 512 +Window skype_win = (Window) - 1; +static XErrorHandler old_handler = 0; +static int xerror = 0; +#endif /* WIN32 */ +/**********************************************************/ +/**********************************************************/ +/**********************************************************/ +#define SAMPLES_PER_FRAME 160 +#define SAMPLES_PER_FRAME 160 +#define SAMPLES_PER_FRAME 160 -#define SKYPE_AUDIO -#ifdef SKYPE_AUDIO -#define SAMPLES_PER_FRAME 160 -#define NN 160 -#define GG 160 static void *SWITCH_THREAD_FUNC skypiax_do_tcp_srv_thread(switch_thread_t * thread, void *obj) { struct skypiax_interface *p = obj; - short srv_out[GG / 2]; + short srv_out[SAMPLES_PER_FRAME / 2]; int s; #ifdef WIN32 unsigned int len; unsigned int i; unsigned int a; - short srv_in[GG]; + short srv_in[SAMPLES_PER_FRAME]; int sin_size; unsigned int fd; #else int len; int i; int a; - short srv_in[GG]; + short srv_in[SAMPLES_PER_FRAME]; unsigned int sin_size; int fd; #endif /* WIN32 */ @@ -99,7 +118,7 @@ rt = select(fdselect + 1, &fs, NULL, NULL, &to); if (rt > 0) { - len = recv(fd, srv_in, sizeof(short) * GG, 0); + len = recv(fd, srv_in, sizeof(short) * SAMPLES_PER_FRAME, 0); //DEBUGA_SKYPE("recv %d\n", SKYPIAX_P_LOG, len); if (len > 0) { a = 0; @@ -116,7 +135,7 @@ p->audiobuf_is_loaded = 1; } else { unsigned int howmany; - short totalbuf[GG]; + short totalbuf[SAMPLES_PER_FRAME]; howmany = len / 2 / 2; for (i = 0; i < howmany; i++) @@ -132,7 +151,7 @@ switch_file_write(p->audiopipe[1], totalbuf, &howmany); p->audiobuf_is_loaded = 0; - //DEBUGA_SKYPE("read=====> req=%d recv=%d to sent=%d sent=%d\n", SKYPIAX_P_LOG, sizeof(short)*GG, len, (len*sizeof(short))/2, howmany); + //DEBUGA_SKYPE("read=====> req=%d recv=%d to sent=%d sent=%d\n", SKYPIAX_P_LOG, sizeof(short)*SAMPLES_PER_FRAME, len, (len*sizeof(short))/2, howmany); } } else if (len == 0) { @@ -191,16 +210,16 @@ unsigned int len; unsigned int i; unsigned int a; - short cli_in[NN / 2]; - short cli_out[NN]; + short cli_in[SAMPLES_PER_FRAME / 2]; + short cli_out[SAMPLES_PER_FRAME]; int sin_size; unsigned int fd; #else int len; int i; int a; - short cli_in[NN / 2]; - short cli_out[NN]; + short cli_in[SAMPLES_PER_FRAME / 2]; + short cli_out[SAMPLES_PER_FRAME]; unsigned int sin_size; int fd; #endif /* WIN32 */ @@ -264,7 +283,7 @@ rt = 1; if (rt > 0) { - got = (NN / 2) * sizeof(short); + got = (SAMPLES_PER_FRAME / 2) * sizeof(short); switch_file_read(p->audioskypepipe[0], cli_in, &got); if (got > 0) { @@ -374,17 +393,8 @@ return SWITCH_STATUS_SUCCESS; } -#endif /* SKYPE_AUDIO */ #ifdef WIN32 -struct AsteriskHandles *win32_AsteriskHandlesSkype; -HINSTANCE win32_hInit_ProcessHandle; -char win32_acInit_WindowClassName[128]; -UINT win32_uiGlobal_MsgID_SkypeControlAPIAttach; -UINT win32_uiGlobal_MsgID_SkypeControlAPIDiscover; -HWND win32_hGlobal_SkypeAPIWindowHandle = NULL; -DWORD win32_ulGlobal_PromptConsoleMode = 0; -HANDLE volatile win32_hGlobal_PromptConsoleHandle = NULL; enum { SKYPECONTROLAPI_ATTACH_SUCCESS = 0, /* Client is successfully @@ -620,12 +630,6 @@ } #else /* NOT WIN32 */ - -#define SKYPE_X11_BUF_SIZE 512 -Window skype_win = (Window) - 1; -static XErrorHandler old_handler = 0; -static int xerror = 0; - int X11_errors_handler(Display * dpy, XErrorEvent * err) { (void) dpy; From cseket at freeswitch.org Sat Dec 13 07:22:38 2008 From: cseket at freeswitch.org (FreeSWITCH SVN) Date: Sat, 13 Dec 2008 10:22:38 -0500 Subject: [Freeswitch-svn] [commit] r10752 - freeswitch/branches/cseket/src/mod/applications/mod_voicemail Message-ID: Author: cseket Date: Sat Dec 13 10:22:36 2008 New Revision: 10752 Log: load profiles on the fly. add loading functions (MODAPP-177) Modified: freeswitch/branches/cseket/src/mod/applications/mod_voicemail/mod_voicemail.c Modified: freeswitch/branches/cseket/src/mod/applications/mod_voicemail/mod_voicemail.c ============================================================================== --- freeswitch/branches/cseket/src/mod/applications/mod_voicemail/mod_voicemail.c (original) +++ freeswitch/branches/cseket/src/mod/applications/mod_voicemail/mod_voicemail.c Sat Dec 13 10:22:36 2008 @@ -51,6 +51,7 @@ static switch_status_t voicemail_inject(const char *data); +const char *global_cf = "voicemail.conf"; static struct { switch_hash_t *profile_hash; int debug; @@ -235,8 +236,24 @@ " password VARCHAR(255)\n" ");\n"; -static void destroy_profile(vm_profile_t *profile) + +static void destroy_profile(const char *profile_name) { + vm_profile_t *profile = NULL; + switch_mutex_lock(globals.mutex); + if ((profile = switch_core_hash_find(globals.profile_hash, profile_name))) { + switch_core_hash_delete(globals.profile_hash, profile_name); + } + switch_mutex_unlock(globals.mutex); + + if (!profile) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Profile %s\n", profile_name); + return; + } + /* wait readers */ + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Waiting for write lock (Profile %s)\n", profile->name); + switch_thread_rwlock_wrlock(profile->rwlock); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Destroying Profile %s\n", profile->name); #ifdef SWITCH_HAVE_ODBC if (profile->odbc_dsn && profile->master_odbc) { @@ -247,84 +264,22 @@ switch_core_destroy_memory_pool(&profile->pool); } -static vm_profile_t *create_profile(char *name) +static vm_profile_t * load_profile(const char *profile_name) { vm_profile_t *profile = NULL; - switch_memory_pool_t *pool; - - switch_core_new_memory_pool(&pool); - - profile = switch_core_alloc(pool, sizeof(*profile)); - profile->pool = pool; - switch_thread_rwlock_create(&profile->rwlock, pool); - profile->name = switch_core_strdup(pool, name); - - return profile; -} - + switch_xml_t x_profiles, x_profile, x_email, param, cfg, xml; -static switch_status_t load_config(void) -{ - char *cf = "voicemail.conf"; - vm_profile_t *profile = NULL; - switch_xml_t cfg, xml, settings, param, x_profile, x_profiles, x_email; - switch_hash_index_t *hi; - void *val; - - if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", cf); - return SWITCH_STATUS_TERM; + if (!(xml = switch_xml_open_cfg(global_cf, &cfg, NULL))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", global_cf); + return profile; } - - if ((settings = switch_xml_child(cfg, "settings"))) { - for (param = switch_xml_child(settings, "param"); param; param = param->next) { - char *var = (char *) switch_xml_attr_soft(param, "name"); - char *val = (char *) switch_xml_attr_soft(param, "value"); - - if (!strcasecmp(var, "debug")) { - globals.debug = atoi(val); - } - } - } - + if (!(x_profiles = switch_xml_child(cfg, "profiles"))) { goto end; } - - /* destroy old profiles */ - destroy: - for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) { - switch_hash_this(hi, NULL, NULL, &val); - profile = (vm_profile_t *) val; - int found = 0; - - for (x_profile = switch_xml_child(x_profiles, "profile"); x_profile; x_profile = x_profile->next) { - char *name = (char *) switch_xml_attr_soft(x_profile, "name"); - if (!(strcasecmp(profile->name, name))) { - found = 1; - break; - } - } - if (found) { - continue; - } - - /* delete from hash, so new comers can't find it */ - switch_mutex_lock(globals.mutex); - switch_core_hash_delete(globals.profile_hash, profile->name); - switch_mutex_unlock(globals.mutex); - - /* wait for readers */ - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Deleting profile %s, when readers are left\n", profile->name); - switch_thread_rwlock_wrlock(profile->rwlock); - - destroy_profile(profile); - goto destroy; - } - - for (x_profile = switch_xml_child(x_profiles, "profile"); x_profile; x_profile = x_profile->next) { - char *name = (char *) switch_xml_attr_soft(x_profile, "name"); + if ((x_profile = switch_xml_find_child(x_profiles, "profile", "name", profile_name))) { + switch_memory_pool_t *pool; char *odbc_dsn = NULL, *odbc_user = NULL, *odbc_pass = NULL; char *terminator_key = "#"; char *play_new_messages_key = "1"; @@ -376,7 +331,6 @@ char *record_title = "FreeSWITCH Voicemail"; char *record_comment = "FreeSWITCH Voicemail"; char *record_copyright = "http://www.freeswitch.org"; - int change_profile = 0; switch_bool_t auto_playback_recordings = SWITCH_TRUE; @@ -385,18 +339,21 @@ db = NULL; - if (switch_strlen_zero(name)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No name specified.\n"); - continue; + if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Pool Failure\n"); + goto end; } - if (!(profile = switch_core_hash_find(globals.profile_hash, name))) { - profile = create_profile(name); - } else { - change_profile = 1; - switch_thread_rwlock_wrlock(profile->rwlock); + if (!(profile = switch_core_alloc(pool, sizeof(*profile)))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Alloc Failure\n"); + switch_core_destroy_memory_pool(&pool); + goto end; } + profile->pool = pool; + switch_thread_rwlock_create(&profile->rwlock, pool); + profile->name = switch_core_strdup(pool, profile_name); + if ((x_email = switch_xml_child(x_profile, "email"))) { if ((param = switch_xml_child(x_email, "body"))) { email_body = switch_core_strdup(profile->pool, param->txt); @@ -677,33 +634,23 @@ } } -#ifdef SWITCH_HAVE_ODBC - if (profile->odbc_dsn && profile->master_odbc) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Closing ODBC Database! %s\n", profile->name); - switch_odbc_handle_destroy(&profile->master_odbc); - profile->odbc_dsn = NULL; - profile->odbc_user = NULL; - profile->odbc_pass = NULL; - } -#endif - if (!switch_strlen_zero(odbc_dsn) && !switch_strlen_zero(odbc_user) && !switch_strlen_zero(odbc_pass)) { profile->odbc_dsn = odbc_dsn; profile->odbc_user = odbc_user; profile->odbc_pass = odbc_pass; } else { - profile->dbname = switch_core_sprintf(profile->pool, "voicemail_%s", name); + profile->dbname = switch_core_sprintf(profile->pool, "voicemail_%s", profile_name); } if (profile->odbc_dsn) { #ifdef SWITCH_HAVE_ODBC if (!(profile->master_odbc = switch_odbc_handle_new(profile->odbc_dsn, profile->odbc_user, profile->odbc_pass))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Cannot Open ODBC Database!\n"); - continue; + goto end; } if (switch_odbc_handle_connect(profile->master_odbc) != SWITCH_ODBC_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Cannot Open ODBC Database!\n"); - continue; + goto end; } if (switch_odbc_handle_exec(profile->master_odbc, "select count(message_len) from voicemail_msgs", NULL) != SWITCH_ODBC_SUCCESS) { @@ -728,7 +675,7 @@ "cid_name, cid_number, in_folder, file_path, message_len, flags, read_flags from voicemail_data", NULL) != SWITCH_ODBC_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Failed to migrate old voicemail_data to voicemail_msgs!\n"); - continue; + goto end; } switch_odbc_handle_exec(profile->master_odbc, "drop table voicemail_data", NULL); } @@ -766,7 +713,7 @@ "alter table voicemail_prefs add password varchar(255)"); } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Cannot Open SQL Database!\n"); - continue; + goto end; } switch_core_db_close(db); } @@ -832,18 +779,65 @@ switch_copy_string(profile->file_ext, file_ext, sizeof(profile->file_ext)); switch_mutex_init(&profile->mutex, SWITCH_MUTEX_NESTED, profile->pool); - if (change_profile) { - switch_thread_rwlock_unlock(profile->rwlock); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Added Profile %s\n", profile->name); - switch_mutex_lock(globals.mutex); - switch_core_hash_insert(globals.profile_hash, profile->name, profile); - switch_mutex_unlock(globals.mutex); - } + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Added Profile %s\n", profile->name); + switch_core_hash_insert(globals.profile_hash, profile->name, profile); } end: + if (xml) { + switch_xml_free(xml); + } + return profile; + +} + + +static vm_profile_t * get_profile(const char *profile_name) +{ + vm_profile_t *profile; + + switch_mutex_lock(globals.mutex); + if (!(profile = switch_core_hash_find(globals.profile_hash, profile_name))) { + profile = load_profile(profile_name); + } + if (profile) { + switch_thread_rwlock_rdlock(profile->rwlock); + } + switch_mutex_unlock(globals.mutex); + + return profile; +} + + +static switch_status_t load_config(void) +{ + switch_xml_t cfg, xml, settings, param, x_profiles, x_profile; + + if (!(xml = switch_xml_open_cfg(global_cf, &cfg, NULL))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", global_cf); + return SWITCH_STATUS_TERM; + } + + switch_mutex_lock(globals.mutex); + if ((settings = switch_xml_child(cfg, "settings"))) { + for (param = switch_xml_child(settings, "param"); param; param = param->next) { + char *var = (char *) switch_xml_attr_soft(param, "name"); + char *val = (char *) switch_xml_attr_soft(param, "value"); + + if (!strcasecmp(var, "debug")) { + globals.debug = atoi(val); + } + } + } + + if ((x_profiles = switch_xml_child(cfg, "profiles"))) { + for (x_profile = switch_xml_child(x_profiles, "profile"); x_profile; x_profile = x_profile->next) { + load_profile(switch_xml_attr_soft(x_profile, "name")); + } + } + switch_mutex_unlock(globals.mutex); + switch_xml_free(xml); return SWITCH_STATUS_SUCCESS; } @@ -1707,16 +1701,11 @@ caller_id_number = caller_profile->caller_id_number; } - switch_mutex_lock(globals.mutex); - - if (!(profile = switch_core_hash_find(globals.profile_hash, profile_name))) { + if (!(profile = get_profile(profile_name))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error invalid profile %s\n", profile_name); - switch_mutex_unlock(globals.mutex); return; } - switch_thread_rwlock_rdlock(profile->rwlock); - switch_mutex_unlock(globals.mutex); - + timeout = profile->digit_timeout; attempts = profile->max_login_attempts; status = switch_ivr_phrase_macro(session, VM_HELLO_MACRO, NULL, NULL, &args); @@ -2087,8 +2076,6 @@ } - - thepass = thehash = NULL; switch_snprintf(sql, sizeof(sql), "select * from voicemail_prefs where username='%s' and domain='%s'", myid, domain_name); vm_execute_sql_callback(profile, profile->mutex, sql, prefs_callback, &cbt); @@ -2134,7 +2121,6 @@ } } - if (!mypass) { if (auth) { @@ -2153,8 +2139,6 @@ } } - - if (vmhash) { thehash = vmhash; } @@ -2636,23 +2620,18 @@ goto end; } - switch_mutex_lock(globals.mutex); - if (!(profile = switch_core_hash_find(globals.profile_hash, domain))) { - profile = switch_core_hash_find(globals.profile_hash, "default"); + if (!(profile = get_profile(domain))) { + profile = get_profile("default"); } if (!profile) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't find profile\n"); status = SWITCH_STATUS_FALSE; - switch_mutex_unlock(globals.mutex); } else { switch_xml_t x_domain, xml_root; switch_event_t *my_params = NULL; switch_xml_t ut; - switch_thread_rwlock_rdlock(profile->rwlock); - switch_mutex_unlock(globals.mutex); - switch_event_create(&my_params, SWITCH_EVENT_REQUEST_PARAMS); switch_assert(my_params); switch_event_add_header_string(my_params, SWITCH_STACK_BOTTOM, "domain", domain); @@ -2753,17 +2732,11 @@ memset(&cbt, 0, sizeof(cbt)); - switch_mutex_lock(globals.mutex); - - if (!(profile = switch_core_hash_find(globals.profile_hash, profile_name))) { + if (!(profile = get_profile(profile_name))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error invalid profile %s\n", profile_name); - switch_mutex_unlock(globals.mutex); return SWITCH_STATUS_FALSE;; } - switch_thread_rwlock_rdlock(profile->rwlock); - switch_mutex_unlock(globals.mutex); - if (id) { int ok = 1; switch_event_t *params = NULL; @@ -3668,7 +3641,7 @@ return SWITCH_STATUS_SUCCESS; } -#define VOICEMAIL_SYNTAX "rss [ ] | rescan [reloadxml]" +#define VOICEMAIL_SYNTAX "rss [ ] | [load|unload|reload] [reloadxml]" SWITCH_STANDARD_API(voicemail_api_function) { int argc = 0; @@ -3681,6 +3654,9 @@ int rss = 0, xarg = 0; switch_hash_index_t *hi; void *val = NULL; + switch_xml_t xml_root; + const char *err; + if (session) { return SWITCH_STATUS_FALSE; @@ -3705,27 +3681,40 @@ if (!strcasecmp(argv[0], "rss")) { rss++; xarg++; - } else if (!strcasecmp(argv[0], "rescan")) { - switch_xml_t xml_root; - const char *err; - if (argc > 1 && !strcasecmp(argv[1], "reloadxml")) { + } else if (argc > 1 && !strcasecmp(argv[0], "load")) { + if (argc > 2 && !strcasecmp(argv[2], "reloadxml")) { if ((xml_root = switch_xml_open_root(1, &err))) { switch_xml_free(xml_root); } stream->write_function(stream, "Reload XML [%s]\n", err); } - if (load_config() == SWITCH_STATUS_SUCCESS) { - stream->write_function(stream, "+OK scan complete\n"); - } else { - stream->write_function(stream, "-ERR scan failed\n"); - goto error; + if ((profile = get_profile(argv[1]))) { + switch_thread_rwlock_unlock(profile->rwlock); } + stream->write_function(stream, "+OK load complete\n"); goto done; + } else if (argc > 1 && !strcasecmp(argv[0], "unload")) { + destroy_profile(argv[1]); + stream->write_function(stream, "+OK unload complete\n"); + goto done; + } else if (argc > 1 && !strcasecmp(argv[0], "reload")) { + destroy_profile(argv[1]); + if (argc > 2 && !strcasecmp(argv[2], "reloadxml")) { + if ((xml_root = switch_xml_open_root(1, &err))) { + switch_xml_free(xml_root); + } + stream->write_function(stream, "Reload XML [%s]\n", err); + } + if ((profile = get_profile(argv[1]))) { + switch_thread_rwlock_unlock(profile->rwlock); + } + stream->write_function(stream, "+OK reload complete\n"); + goto done; + } else if (!strcasecmp(argv[0], "status")) { stream->write_function(stream, "============================\n"); switch_mutex_lock(globals.mutex); for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) { - vm_profile_t * profile = NULL; switch_hash_this(hi, NULL, NULL, &val); profile = (vm_profile_t *) val; stream->write_function(stream, "Profile: %s\n", profile->name); @@ -3751,35 +3740,31 @@ goto error; } - switch_mutex_lock(globals.mutex); - profile = switch_core_hash_find(globals.profile_hash, domain); - - if (!profile) { - profile = switch_core_hash_find(globals.profile_hash, "default"); + if (!(profile = get_profile(domain))) { + profile = get_profile("default"); } if (!profile) { switch_hash_index_t *hi; void *val; + switch_mutex_lock(globals.mutex); for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) { switch_hash_this(hi, NULL, NULL, &val); profile = (vm_profile_t *) val; if (profile) { + switch_thread_rwlock_rdlock(profile->rwlock); break; } } + switch_mutex_unlock(globals.mutex); } if (!profile) { stream->write_function(stream, "Can't find profile.\n"); - switch_mutex_unlock(globals.mutex); goto error; } - switch_thread_rwlock_rdlock(profile->rwlock); - switch_mutex_unlock(globals.mutex); - if (path_info) { if (!strncasecmp(path_info, "get/", 4)) { do_play(profile, user, domain, path_info + 4, stream); @@ -3793,8 +3778,8 @@ if (rss || (path_info && !strncasecmp(path_info, "rss", 3))) { do_rss(profile, user, domain, host, port, uri, stream); } - switch_thread_rwlock_unlock(profile->rwlock); + switch_thread_rwlock_unlock(profile->rwlock); goto done; error: From gmaruzz at freeswitch.org Sat Dec 13 08:46:58 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Sat, 13 Dec 2008 11:46:58 -0500 Subject: [Freeswitch-svn] [commit] r10753 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Sat Dec 13 11:46:57 2008 New Revision: 10753 Log: skypiax: cleaning, restructuring Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Sat Dec 13 11:46:57 2008 @@ -2,7 +2,6 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_skypiax_load); SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypiax_shutdown); -//SWITCH_MODULE_RUNTIME_FUNCTION(mod_skypiax_runtime); SWITCH_MODULE_DEFINITION(mod_skypiax, mod_skypiax_load, mod_skypiax_shutdown, NULL); //mod_skypiax_runtime); static struct { @@ -31,10 +30,6 @@ switch_endpoint_interface_t *skypiax_endpoint_interface; switch_memory_pool_t *skypiax_module_pool = NULL; int running = 1; -switch_core_session_t *global_session = NULL; -#ifdef WIN32 -HWND win32_hInit_MainWindowHandle; -#endif /* WIN32 */ /*************************************************/ /*************************************************/ /*************************************************/ @@ -905,7 +900,7 @@ if(globals.SKYPIAX_INTERFACES[interface_id].skypiax_do_skype_thread_thread){ #ifdef WIN32 - if (SendMessage(win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) { // let's the do_skype_thread die + if (SendMessage(p->AsteriskHandlesAst.win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) { // let's the do_skype_thread die ERRORA("WHY FALSE HERE? %d\n", SKYPIAX_P_LOG, GetLastError()); } #else Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Sat Dec 13 11:46:57 2008 @@ -2,16 +2,21 @@ extern switch_memory_pool_t *skypiax_module_pool; extern int option_debug; -extern switch_core_session_t *global_session; extern switch_endpoint_interface_t *skypiax_endpoint_interface; extern int running; -#ifdef WIN32 -extern HWND win32_hInit_MainWindowHandle; -#endif /* WIN32 */ + + + /**********************************************************/ /**********************************************************/ /**********************************************************/ + + +switch_core_session_t *global_session = NULL; + + #ifdef WIN32 +HWND win32_hInit_MainWindowHandle; struct AsteriskHandles *win32_AsteriskHandlesSkype; HINSTANCE win32_hInit_ProcessHandle; char win32_acInit_WindowClassName[128]; @@ -26,13 +31,13 @@ static XErrorHandler old_handler = 0; static int xerror = 0; #endif /* WIN32 */ + + + /**********************************************************/ /**********************************************************/ /**********************************************************/ #define SAMPLES_PER_FRAME 160 -#define SAMPLES_PER_FRAME 160 -#define SAMPLES_PER_FRAME 160 - static void *SWITCH_THREAD_FUNC skypiax_do_tcp_srv_thread(switch_thread_t * thread, void *obj) From mikej at freeswitch.org Sun Dec 14 08:37:40 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Sun, 14 Dec 2008 11:37:40 -0500 Subject: [Freeswitch-svn] [commit] r10754 - freeswitch/trunk/src/mod/languages/mod_spidermonkey Message-ID: Author: mikej Date: Sun Dec 14 11:37:38 2008 New Revision: 10754 Log: type tweak Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c (original) +++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c Sun Dec 14 11:37:38 2008 @@ -1723,7 +1723,7 @@ switch_input_args_t args = { 0 }; int32 ms = 0; jsval ret = JS_TRUE; - int sync; + int32 sync = 0; METHOD_SANITY_CHECK(); channel = switch_core_session_get_channel(jss->session); From mikej at freeswitch.org Sun Dec 14 08:38:22 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Sun, 14 Dec 2008 11:38:22 -0500 Subject: [Freeswitch-svn] [commit] r10755 - freeswitch/trunk/src/include Message-ID: Author: mikej Date: Sun Dec 14 11:38:21 2008 New Revision: 10755 Log: FSCORE-252 Core NetBSD features are disabled if _XOPEN_SOURCE is defined Modified: freeswitch/trunk/src/include/switch.h Modified: freeswitch/trunk/src/include/switch.h ============================================================================== --- freeswitch/trunk/src/include/switch.h (original) +++ freeswitch/trunk/src/include/switch.h Sun Dec 14 11:38:21 2008 @@ -54,7 +54,7 @@ #define FREESWITCH_ITAD "543" #define __EXTENSIONS__ 1 #ifndef MACOSX -#if !defined(_XOPEN_SOURCE) && !defined(__OpenBSD__) +#if !defined(_XOPEN_SOURCE) && !defined(__OpenBSD__) && !defined(__NetBSD__) #ifndef __cplusplus #define _XOPEN_SOURCE 600 #endif From mikej at freeswitch.org Sun Dec 14 08:41:33 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Sun, 14 Dec 2008 11:41:33 -0500 Subject: [Freeswitch-svn] [commit] r10756 - freeswitch/trunk/src Message-ID: Author: mikej Date: Sun Dec 14 11:41:33 2008 New Revision: 10756 Log: FSCORE-254 NetBSD does not have RLIMIT_AS Modified: freeswitch/trunk/src/switch_core.c Modified: freeswitch/trunk/src/switch_core.c ============================================================================== --- freeswitch/trunk/src/switch_core.c (original) +++ freeswitch/trunk/src/switch_core.c Sun Dec 14 11:41:33 2008 @@ -781,7 +781,7 @@ setrlimit(RLIMIT_CPU, &rlp); setrlimit(RLIMIT_DATA, &rlp); setrlimit(RLIMIT_FSIZE, &rlp); -#ifndef __OpenBSD__ +#if !defined(__OpenBSD__) && !defined(__NetBSD__) setrlimit(RLIMIT_AS, &rlp); #endif #endif From mikej at freeswitch.org Sun Dec 14 08:45:25 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Sun, 14 Dec 2008 11:45:25 -0500 Subject: [Freeswitch-svn] [commit] r10757 - freeswitch/trunk/src/mod/endpoints/mod_iax Message-ID: Author: mikej Date: Sun Dec 14 11:45:25 2008 New Revision: 10757 Log: MODENDP-160 __NetBSD__ is a better define to use than NETBSD Modified: freeswitch/trunk/src/mod/endpoints/mod_iax/iax-client.h Modified: freeswitch/trunk/src/mod/endpoints/mod_iax/iax-client.h ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_iax/iax-client.h (original) +++ freeswitch/trunk/src/mod/endpoints/mod_iax/iax-client.h Sun Dec 14 11:45:25 2008 @@ -23,7 +23,7 @@ #pragma warning(disable:4200) #endif -#if !defined(LINUX) && !defined(NETBSD) +#if !defined(LINUX) && !defined(__NetBSD__) #define socklen_t int #endif From mikej at freeswitch.org Sun Dec 14 09:11:04 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Sun, 14 Dec 2008 12:11:04 -0500 Subject: [Freeswitch-svn] [commit] r10758 - freeswitch/trunk/debian Message-ID: Author: mikej Date: Sun Dec 14 12:11:04 2008 New Revision: 10758 Log: FSBUILD-95 user freeswitch not added to audio group Modified: freeswitch/trunk/debian/postinst Modified: freeswitch/trunk/debian/postinst ============================================================================== --- freeswitch/trunk/debian/postinst (original) +++ freeswitch/trunk/debian/postinst Sun Dec 14 12:11:04 2008 @@ -25,6 +25,7 @@ adduser --disabled-password --quiet --system \ --home /opt/freeswitch \ --gecos "FreeSwitch Voice Platform" --ingroup daemon \ + --add_extra_groups audio \ freeswitch fi From mikej at freeswitch.org Sun Dec 14 16:57:07 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Sun, 14 Dec 2008 19:57:07 -0500 Subject: [Freeswitch-svn] [commit] r10759 - freeswitch/trunk/debian Message-ID: Author: mikej Date: Sun Dec 14 19:57:04 2008 New Revision: 10759 Log: FSBUILD-96 Debian packager still includes woomera Modified: freeswitch/trunk/debian/freeswitch.conffiles freeswitch/trunk/debian/freeswitch.install freeswitch/trunk/debian/rules Modified: freeswitch/trunk/debian/freeswitch.conffiles ============================================================================== --- freeswitch/trunk/debian/freeswitch.conffiles (original) +++ freeswitch/trunk/debian/freeswitch.conffiles Sun Dec 14 19:57:04 2008 @@ -62,7 +62,6 @@ /opt/freeswitch/conf/autoload_configs/modules.conf.xml /opt/freeswitch/conf/autoload_configs/dingaling.conf.xml /opt/freeswitch/conf/autoload_configs/iax.conf.xml -/opt/freeswitch/conf/autoload_configs/woomera.conf.xml /opt/freeswitch/conf/autoload_configs/post_load_modules.conf.xml /opt/freeswitch/conf/autoload_configs/pocketsphinx.conf.xml /opt/freeswitch/conf/autoload_configs/xml_cdr.conf.xml Modified: freeswitch/trunk/debian/freeswitch.install ============================================================================== --- freeswitch/trunk/debian/freeswitch.install (original) +++ freeswitch/trunk/debian/freeswitch.install Sun Dec 14 19:57:04 2008 @@ -29,7 +29,6 @@ opt/freeswitch/mod/mod_iax.so* opt/freeswitch/mod/mod_portaudio.so* opt/freeswitch/mod/mod_sofia.so* -opt/freeswitch/mod/mod_woomera.so* opt/freeswitch/mod/mod_openzap.so opt/freeswitch/mod/ozmod_analog_em.so opt/freeswitch/mod/ozmod_analog.so @@ -110,7 +109,6 @@ opt/freeswitch/conf/autoload_configs/modules.conf.xml opt/freeswitch/conf/autoload_configs/dingaling.conf.xml opt/freeswitch/conf/autoload_configs/iax.conf.xml -opt/freeswitch/conf/autoload_configs/woomera.conf.xml opt/freeswitch/conf/autoload_configs/post_load_modules.conf.xml opt/freeswitch/conf/autoload_configs/pocketsphinx.conf.xml opt/freeswitch/conf/autoload_configs/xml_cdr.conf.xml Modified: freeswitch/trunk/debian/rules ============================================================================== --- freeswitch/trunk/debian/rules (original) +++ freeswitch/trunk/debian/rules Sun Dec 14 19:57:04 2008 @@ -20,8 +20,7 @@ export DIRECTORIES_MODULES= export DOTNET_MODULES= export ENDPOINTS_MODULES=endpoints/mod_dingaling endpoints/mod_iax endpoints/mod_portaudio endpoints/mod_sofia \ - endpoints/mod_woomera endpoints/mod_loopback \ - ../../libs/openzap/mod_openzap + endpoints/mod_loopback ../../libs/openzap/mod_openzap export EVENT_HANDLERS_MODULES=event_handlers/mod_event_multicast event_handlers/mod_event_socket event_handlers/mod_cdr_csv export FORMATS_MODULES=formats/mod_local_stream formats/mod_native_file formats/mod_sndfile formats/mod_tone_stream formats/mod_shout export LANGUAGES_MODULES=languages/mod_perl languages/mod_lua From mikej at freeswitch.org Sun Dec 14 18:48:50 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Sun, 14 Dec 2008 21:48:50 -0500 Subject: [Freeswitch-svn] [commit] r10760 - in freeswitch/trunk/src: . include mod/formats/mod_sndfile Message-ID: Author: mikej Date: Sun Dec 14 21:48:50 2008 New Revision: 10760 Log: FSCRE-253 netbsd does not follow opengroup prototypes on toupper and tolower so we have to do stupid workarounds. Modified: freeswitch/trunk/src/include/switch_utils.h freeswitch/trunk/src/mod/formats/mod_sndfile/mod_sndfile.c freeswitch/trunk/src/switch_utils.c Modified: freeswitch/trunk/src/include/switch_utils.h ============================================================================== --- freeswitch/trunk/src/include/switch_utils.h (original) +++ freeswitch/trunk/src/include/switch_utils.h Sun Dec 14 21:48:50 2008 @@ -41,6 +41,10 @@ #include SWITCH_BEGIN_EXTERN_C + +SWITCH_DECLARE(int) switch_toupper(int c); +SWITCH_DECLARE(int) switch_tolower(int c); + #define switch_samples_per_packet(rate, interval) ((uint32_t)((float)rate / (1000.0f / (float)interval))) #define SWITCH_SMAX 32767 #define SWITCH_SMIN -32768 @@ -303,7 +307,7 @@ if (it) { dup = strdup(it); for(p = dup; p && *p; p++) { - *p = (char) tolower(*p); + *p = (char) switch_tolower(*p); } return dup; } @@ -320,7 +324,7 @@ if (it) { dup = strdup(it); for(p = dup; p && *p; p++) { - *p = (char) toupper(*p); + *p = (char) switch_toupper(*p); } return dup; } @@ -353,7 +357,7 @@ assert(S != NULL); for (p = S; p && *p; p++) { - *p = (char) toupper(*p); + *p = (char) switch_toupper(*p); } if (strstr(S, q)) { @@ -365,7 +369,7 @@ assert(Q != NULL); for (p = Q; p && *p; p++) { - *p = (char) toupper(*p); + *p = (char) switch_toupper(*p); } if (strstr(s, Q)) { Modified: freeswitch/trunk/src/mod/formats/mod_sndfile/mod_sndfile.c ============================================================================== --- freeswitch/trunk/src/mod/formats/mod_sndfile/mod_sndfile.c (original) +++ freeswitch/trunk/src/mod/formats/mod_sndfile/mod_sndfile.c Sun Dec 14 21:48:50 2008 @@ -339,13 +339,13 @@ map->format = info.format; if (map->ext) { for (p = map->ext; *p; p++) { - *p = (char) tolower(*p); + *p = (char) switch_tolower(*p); } switch_core_hash_insert(globals.format_hash, map->ext, map); } if (map->uext) { for (p = map->uext; *p; p++) { - *p = (char) toupper(*p); + *p = (char) switch_toupper(*p); } switch_core_hash_insert(globals.format_hash, map->uext, map); } Modified: freeswitch/trunk/src/switch_utils.c ============================================================================== --- freeswitch/trunk/src/switch_utils.c (original) +++ freeswitch/trunk/src/switch_utils.c Sun Dec 14 21:48:50 2008 @@ -654,7 +654,7 @@ for (start = str; *start; start++) { /* find start of pattern in string */ - for (; ((*start) && (toupper(*start) != toupper(*instr))); start++); + for (; ((*start) && (switch_toupper(*start) != switch_toupper(*instr))); start++); if (!*start) return NULL; @@ -662,7 +662,7 @@ pptr = instr; sptr = start; - while (toupper(*sptr) == toupper(*pptr)) { + while (switch_toupper(*sptr) == switch_toupper(*pptr)) { sptr++; pptr++; @@ -1138,7 +1138,7 @@ char *c; unsigned char counter = 0; - key = (char) toupper(key); + key = (char) switch_toupper(key); for (c = RFC2833_CHARS; *c; c++) { if (*c == key) { return counter; @@ -1507,6 +1507,105 @@ return s; } + +/* Written by Marc Espie, public domain */ +#define SWITCH_CTYPE_NUM_CHARS 256 + +const short _switch_C_toupper_[1 + SWITCH_CTYPE_NUM_CHARS] = { + EOF, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, + 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff +}; + +const short *_switch_toupper_tab_ = _switch_C_toupper_; + +SWITCH_DECLARE(int) switch_toupper(int c) +{ + if ((unsigned int)c > 255) + return(c); + if (c < -1) + return EOF; + return((_switch_toupper_tab_ + 1)[c]); +} + +const short _switch_C_tolower_[1 + SWITCH_CTYPE_NUM_CHARS] = { + EOF, + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, + 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, + 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, + 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, + 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, + 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, + 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, + 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff +}; + +const short *_switch_tolower_tab_ = _switch_C_tolower_; + +SWITCH_DECLARE(int) switch_tolower(int c) +{ + if ((unsigned int)c > 255) + return(c); + if (c < -1) + return EOF; + return((_switch_tolower_tab_ + 1)[c]); +} + + /* For Emacs: * Local Variables: * mode:c From mikej at freeswitch.org Sun Dec 14 19:21:37 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Sun, 14 Dec 2008 22:21:37 -0500 Subject: [Freeswitch-svn] [commit] r10761 - in freeswitch/trunk/src: . include Message-ID: Author: mikej Date: Sun Dec 14 22:21:36 2008 New Revision: 10761 Log: FSCORE-253. add the following functions to work around netbsd failures switch_toupper switch_tolower switch_isalnum switch_isalpha switch_iscntrl switch_isdigit switch_isgraph switch_islower switch_isprint switch_ispunct switch_isspace switch_isupper switch_isxdigit Modified: freeswitch/trunk/src/include/switch_utils.h freeswitch/trunk/src/switch_utils.c Modified: freeswitch/trunk/src/include/switch_utils.h ============================================================================== --- freeswitch/trunk/src/include/switch_utils.h (original) +++ freeswitch/trunk/src/include/switch_utils.h Sun Dec 14 22:21:36 2008 @@ -44,6 +44,18 @@ SWITCH_DECLARE(int) switch_toupper(int c); SWITCH_DECLARE(int) switch_tolower(int c); +SWITCH_DECLARE(int) switch_isalnum(int c); +SWITCH_DECLARE(int) switch_isalpha(int c); +SWITCH_DECLARE(int) switch_iscntrl(int c); +SWITCH_DECLARE(int) switch_isdigit(int c); +SWITCH_DECLARE(int) switch_isgraph(int c); +SWITCH_DECLARE(int) switch_islower(int c); +SWITCH_DECLARE(int) switch_isprint(int c); +SWITCH_DECLARE(int) switch_ispunct(int c); +SWITCH_DECLARE(int) switch_isspace(int c); +SWITCH_DECLARE(int) switch_isupper(int c); +SWITCH_DECLARE(int) switch_isxdigit(int c); + #define switch_samples_per_packet(rate, interval) ((uint32_t)((float)rate / (1000.0f / (float)interval))) #define SWITCH_SMAX 32767 Modified: freeswitch/trunk/src/switch_utils.c ============================================================================== --- freeswitch/trunk/src/switch_utils.c (original) +++ freeswitch/trunk/src/switch_utils.c Sun Dec 14 22:21:36 2008 @@ -1605,6 +1605,152 @@ return((_switch_tolower_tab_ + 1)[c]); } +/* + * Copyright (c) 1989 The Regents of the University of California. + * All rights reserved. + * (c) UNIX System Laboratories, Inc. + * All or some portions of this file are derived from material licensed + * to the University of California by American Telephone and Telegraph + * Co. or Unix System Laboratories, Inc. and are reproduced herein with + * the permission of UNIX System Laboratories, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#undef _U +#undef _L +#undef _N +#undef _S +#undef _P +#undef _C +#undef _X +#undef _B + +#define _U 0x01 +#define _L 0x02 +#define _N 0x04 +#define _S 0x08 +#define _P 0x10 +#define _C 0x20 +#define _X 0x40 +#define _B 0x80 + +const char _switch_C_ctype_[1 + SWITCH_CTYPE_NUM_CHARS] = { + 0, + _C, _C, _C, _C, _C, _C, _C, _C, + _C, _C|_S, _C|_S, _C|_S, _C|_S, _C|_S, _C, _C, + _C, _C, _C, _C, _C, _C, _C, _C, + _C, _C, _C, _C, _C, _C, _C, _C, + _S|_B, _P, _P, _P, _P, _P, _P, _P, + _P, _P, _P, _P, _P, _P, _P, _P, + _N, _N, _N, _N, _N, _N, _N, _N, + _N, _N, _P, _P, _P, _P, _P, _P, + _P, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U, + _U, _U, _U, _U, _U, _U, _U, _U, + _U, _U, _U, _U, _U, _U, _U, _U, + _U, _U, _U, _P, _P, _P, _P, _P, + _P, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L, + _L, _L, _L, _L, _L, _L, _L, _L, + _L, _L, _L, _L, _L, _L, _L, _L, +/* determine printability based on the IS0 8859 8-bit standard */ + _L, _L, _L, _P, _P, _P, _P, _C, + + _C, _C, _C, _C, _C, _C, _C, _C, /* 80 */ + _C, _C, _C, _C, _C, _C, _C, _C, /* 88 */ + _C, _C, _C, _C, _C, _C, _C, _C, /* 90 */ + _C, _C, _C, _C, _C, _C, _C, _C, /* 98 */ + _P, _P, _P, _P, _P, _P, _P, _P, /* A0 */ + _P, _P, _P, _P, _P, _P, _P, _P, /* A8 */ + _P, _P, _P, _P, _P, _P, _P, _P, /* B0 */ + _P, _P, _P, _P, _P, _P, _P, _P, /* B8 */ + _P, _P, _P, _P, _P, _P, _P, _P, /* C0 */ + _P, _P, _P, _P, _P, _P, _P, _P, /* C8 */ + _P, _P, _P, _P, _P, _P, _P, _P, /* D0 */ + _P, _P, _P, _P, _P, _P, _P, _P, /* D8 */ + _P, _P, _P, _P, _P, _P, _P, _P, /* E0 */ + _P, _P, _P, _P, _P, _P, _P, _P, /* E8 */ + _P, _P, _P, _P, _P, _P, _P, _P, /* F0 */ + _P, _P, _P, _P, _P, _P, _P, _P /* F8 */ +}; + +const char *_switch_ctype_ = _switch_C_ctype_; + +SWITCH_DECLARE(int) switch_isalnum(int c) +{ + return (c < 0 ? 0 : c > 255 ? 0 : ((_switch_ctype_ + 1)[(unsigned char)c] & (_U|_L|_N))); +} + +SWITCH_DECLARE(int) switch_isalpha(int c) +{ + return (c < 0 ? 0 : c > 255 ? 0 : ((_switch_ctype_ + 1)[(unsigned char)c] & (_U|_L))); +} + +SWITCH_DECLARE(int) switch_iscntrl(int c) +{ + return (c < 0 ? 0 : c > 255 ? 0 : ((_switch_ctype_ + 1)[(unsigned char)c] & _C)); +} + +SWITCH_DECLARE(int) switch_isdigit(int c) +{ + return (c < 0 ? 0 : c > 255 ? 0 : ((_switch_ctype_ + 1)[(unsigned char)c] & _N)); +} + +SWITCH_DECLARE(int) switch_isgraph(int c) +{ + return (c < 0 ? 0 : c > 255 ? 0 : ((_switch_ctype_ + 1)[(unsigned char)c] & (_P|_U|_L|_N))); +} + +SWITCH_DECLARE(int) switch_islower(int c) +{ + return (c < 0 ? 0 : c > 255 ? 0 : ((_switch_ctype_ + 1)[(unsigned char)c] & _L)); +} + +SWITCH_DECLARE(int) switch_isprint(int c) +{ + return (c < 0 ? 0 : c > 255 ? 0 : ((_switch_ctype_ + 1)[(unsigned char)c] & (_P|_U|_L|_N|_B))); +} + +SWITCH_DECLARE(int) switch_ispunct(int c) +{ + return (c < 0 ? 0 : c > 255 ? 0 : ((_switch_ctype_ + 1)[(unsigned char)c] & _P)); +} + +SWITCH_DECLARE(int) switch_isspace(int c) +{ + return (c < 0 ? 0 : c > 255 ? 0 : ((_switch_ctype_ + 1)[(unsigned char)c] & _S)); +} + +SWITCH_DECLARE(int) switch_isupper(int c) +{ + return (c < 0 ? 0 : c > 255 ? 0 : ((_switch_ctype_ + 1)[(unsigned char)c] & _U)); +} + +SWITCH_DECLARE(int) switch_isxdigit(int c) +{ + return (c < 0 ? 0 : c > 255 ? 0 : ((_switch_ctype_ + 1)[(unsigned char)c] & (_N|_X))); +} /* For Emacs: * Local Variables: From mikej at freeswitch.org Sun Dec 14 19:28:24 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Sun, 14 Dec 2008 22:28:24 -0500 Subject: [Freeswitch-svn] [commit] r10762 - freeswitch/trunk/src/mod/applications/mod_expr Message-ID: Author: mikej Date: Sun Dec 14 22:28:23 2008 New Revision: 10762 Log: FSCORE-253 work around netbsd failures Modified: freeswitch/trunk/src/mod/applications/mod_expr/exprpars.c freeswitch/trunk/src/mod/applications/mod_expr/exprutil.c Modified: freeswitch/trunk/src/mod/applications/mod_expr/exprpars.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_expr/exprpars.c (original) +++ freeswitch/trunk/src/mod/applications/mod_expr/exprpars.c Sun Dec 14 22:28:23 2008 @@ -12,6 +12,7 @@ #include "exprpriv.h" #include "exprmem.h" +#include "switch_utils.h" /* Data structure used by parser */ typedef struct _exprToken { @@ -314,12 +315,12 @@ default: { if (!comment) { - if (expr[pos] == '.' || isdigit(expr[pos])) { + if (expr[pos] == '.' || switch_isdigit(expr[pos])) { /* Value */ start = pos; /* Find digits before a period */ - while (isdigit(expr[pos])) + while (switch_isdigit(expr[pos])) pos++; /* Find a period */ @@ -327,7 +328,7 @@ pos++; /* Find digits after a period */ - while (isdigit(expr[pos])) + while (switch_isdigit(expr[pos])) pos++; /* pos is AFTER last item, back up */ @@ -356,12 +357,12 @@ list[tpos].data.val = (EXPRTYPE) atof(buf); tpos++; } - } else if (expr[pos] == '_' || isalpha(expr[pos])) { + } else if (expr[pos] == '_' || switch_isalpha(expr[pos])) { /* Identifier */ start = pos; /* Find rest of identifier */ - while (expr[pos] == '_' || isalnum(expr[pos])) + while (expr[pos] == '_' || switch_isalnum(expr[pos])) pos++; /* pos is AFTER last item, back up */ @@ -397,7 +398,7 @@ strcpy(list[tpos].data.str, buf); tpos++; } - } else if (isspace(expr[pos])) { + } else if (switch_isspace(expr[pos])) { /* Spaces are ignored, do nothing */ } else { /* Unknown */ Modified: freeswitch/trunk/src/mod/applications/mod_expr/exprutil.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_expr/exprutil.c (original) +++ freeswitch/trunk/src/mod/applications/mod_expr/exprutil.c Sun Dec 14 22:28:23 2008 @@ -11,6 +11,7 @@ #include "exprincl.h" #include "exprpriv.h" +#include "switch_utils.h" /* Return the version number */ @@ -27,13 +28,13 @@ return 0; /* First must be letter or underscore */ - if (isalpha(*name) || *name == '_') + if (switch_isalpha(*name) || *name == '_') name++; /* Point to next letter */ else return 0; /* Not letter or underscore, maybe empty */ /* others can be letter, number, or underscore */ - while (isalnum(*name) || *name == '_') + while (switch_isalnum(*name) || *name == '_') name++; /* When the while breaks out, we should be at the end */ From mikej at freeswitch.org Sun Dec 14 19:45:38 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Sun, 14 Dec 2008 22:45:38 -0500 Subject: [Freeswitch-svn] [commit] r10763 - in freeswitch/trunk/src/mod/languages: mod_java mod_java/src/org/freeswitch/swig mod_lua mod_managed mod_managed/managed mod_perl mod_python Message-ID: Author: mikej Date: Sun Dec 14 22:45:38 2008 New Revision: 10763 Log: swigall Modified: freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java freeswitch/trunk/src/mod/languages/mod_java/switch_swig_wrap.cpp freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp Modified: freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java (original) +++ freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java Sun Dec 14 22:45:38 2008 @@ -245,8 +245,12 @@ return freeswitchJNI.CoreSession_streamFile__SWIG_1(swigCPtr, this, file); } + public int sleep(int ms, int sync) { + return freeswitchJNI.CoreSession_sleep__SWIG_0(swigCPtr, this, ms, sync); + } + public int sleep(int ms) { - return freeswitchJNI.CoreSession_sleep(swigCPtr, this, ms); + return freeswitchJNI.CoreSession_sleep__SWIG_1(swigCPtr, this, ms); } public int flushEvents() { Modified: freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java (original) +++ freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java Sun Dec 14 22:45:38 2008 @@ -136,7 +136,8 @@ public final static native String CoreSession_playAndGetDigits(long jarg1, CoreSession jarg1_, int jarg2, int jarg3, int jarg4, int jarg5, String jarg6, String jarg7, String jarg8, String jarg9); public final static native int CoreSession_streamFile__SWIG_0(long jarg1, CoreSession jarg1_, String jarg2, int jarg3); public final static native int CoreSession_streamFile__SWIG_1(long jarg1, CoreSession jarg1_, String jarg2); - public final static native int CoreSession_sleep(long jarg1, CoreSession jarg1_, int jarg2); + public final static native int CoreSession_sleep__SWIG_0(long jarg1, CoreSession jarg1_, int jarg2, int jarg3); + public final static native int CoreSession_sleep__SWIG_1(long jarg1, CoreSession jarg1_, int jarg2); public final static native int CoreSession_flushEvents(long jarg1, CoreSession jarg1_); public final static native int CoreSession_flushDigits(long jarg1, CoreSession jarg1_); public final static native int CoreSession_setAutoHangup(long jarg1, CoreSession jarg1_, boolean jarg2); Modified: freeswitch/trunk/src/mod/languages/mod_java/switch_swig_wrap.cpp ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_java/switch_swig_wrap.cpp (original) +++ freeswitch/trunk/src/mod/languages/mod_java/switch_swig_wrap.cpp Sun Dec 14 22:45:38 2008 @@ -2674,7 +2674,26 @@ } -SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1sleep(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { +SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1sleep_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3) { + jint jresult = 0 ; + CoreSession *arg1 = (CoreSession *) 0 ; + int arg2 ; + int arg3 ; + int result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(CoreSession **)&jarg1; + arg2 = (int)jarg2; + arg3 = (int)jarg3; + result = (int)(arg1)->sleep(arg2,arg3); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1sleep_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { jint jresult = 0 ; CoreSession *arg1 = (CoreSession *) 0 ; int arg2 ; Modified: freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp (original) +++ freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp Sun Dec 14 22:45:38 2008 @@ -6077,7 +6077,38 @@ } -static int _wrap_CoreSession_sleep(lua_State* L) { +static int _wrap_CoreSession_sleep__SWIG_0(lua_State* L) { + int SWIG_arg = -1; + CoreSession *arg1 = (CoreSession *) 0 ; + int arg2 ; + int arg3 ; + int result; + + SWIG_check_num_args("sleep",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sleep",1,"CoreSession *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("sleep",2,"int"); + if(!lua_isnumber(L,3)) SWIG_fail_arg("sleep",3,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_sleep",1,SWIGTYPE_p_CoreSession); + } + + arg2 = (int)lua_tonumber(L, 2); + arg3 = (int)lua_tonumber(L, 3); + result = (int)(arg1)->sleep(arg2,arg3); + SWIG_arg=0; + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_CoreSession_sleep__SWIG_1(lua_State* L) { int SWIG_arg = -1; CoreSession *arg1 = (CoreSession *) 0 ; int arg2 ; @@ -6105,6 +6136,62 @@ } +static int _wrap_CoreSession_sleep(lua_State* L) { + int argc; + int argv[4]={ + 1,2,3,4 + }; + + argc = lua_gettop(L); + if (argc == 2) { + int _v; + { + void *ptr; + if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + { + _v = lua_isnumber(L,argv[1]); + } + if (_v) { + return _wrap_CoreSession_sleep__SWIG_1(L); + } + } + } + if (argc == 3) { + int _v; + { + void *ptr; + if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + { + _v = lua_isnumber(L,argv[1]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[2]); + } + if (_v) { + return _wrap_CoreSession_sleep__SWIG_0(L); + } + } + } + } + + lua_pushstring(L,"No matching function for overloaded 'CoreSession_sleep'"); + lua_error(L);return 0; +} + + static int _wrap_CoreSession_flushEvents(lua_State* L) { int SWIG_arg = -1; CoreSession *arg1 = (CoreSession *) 0 ; Modified: freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx (original) +++ freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx Sun Dec 14 22:45:38 2008 @@ -7514,6 +7514,162 @@ } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_toupper(int jarg1) { + int jresult ; + int arg1 ; + int result; + + arg1 = (int)jarg1; + result = (int)switch_toupper(arg1); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_tolower(int jarg1) { + int jresult ; + int arg1 ; + int result; + + arg1 = (int)jarg1; + result = (int)switch_tolower(arg1); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_isalnum(int jarg1) { + int jresult ; + int arg1 ; + int result; + + arg1 = (int)jarg1; + result = (int)switch_isalnum(arg1); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_isalpha(int jarg1) { + int jresult ; + int arg1 ; + int result; + + arg1 = (int)jarg1; + result = (int)switch_isalpha(arg1); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_iscntrl(int jarg1) { + int jresult ; + int arg1 ; + int result; + + arg1 = (int)jarg1; + result = (int)switch_iscntrl(arg1); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_isdigit(int jarg1) { + int jresult ; + int arg1 ; + int result; + + arg1 = (int)jarg1; + result = (int)switch_isdigit(arg1); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_isgraph(int jarg1) { + int jresult ; + int arg1 ; + int result; + + arg1 = (int)jarg1; + result = (int)switch_isgraph(arg1); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_islower(int jarg1) { + int jresult ; + int arg1 ; + int result; + + arg1 = (int)jarg1; + result = (int)switch_islower(arg1); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_isprint(int jarg1) { + int jresult ; + int arg1 ; + int result; + + arg1 = (int)jarg1; + result = (int)switch_isprint(arg1); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_ispunct(int jarg1) { + int jresult ; + int arg1 ; + int result; + + arg1 = (int)jarg1; + result = (int)switch_ispunct(arg1); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_isspace(int jarg1) { + int jresult ; + int arg1 ; + int result; + + arg1 = (int)jarg1; + result = (int)switch_isspace(arg1); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_isupper(int jarg1) { + int jresult ; + int arg1 ; + int result; + + arg1 = (int)jarg1; + result = (int)switch_isupper(arg1); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_isxdigit(int jarg1) { + int jresult ; + int arg1 ; + int result; + + arg1 = (int)jarg1; + result = (int)switch_isxdigit(arg1); + jresult = result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_SMAX_get() { int jresult ; int result; Modified: freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs (original) +++ freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs Sun Dec 14 22:45:38 2008 @@ -1937,6 +1937,71 @@ return ret; } + public static int switch_toupper(int c) { + int ret = freeswitchPINVOKE.switch_toupper(c); + return ret; + } + + public static int switch_tolower(int c) { + int ret = freeswitchPINVOKE.switch_tolower(c); + return ret; + } + + public static int switch_isalnum(int c) { + int ret = freeswitchPINVOKE.switch_isalnum(c); + return ret; + } + + public static int switch_isalpha(int c) { + int ret = freeswitchPINVOKE.switch_isalpha(c); + return ret; + } + + public static int switch_iscntrl(int c) { + int ret = freeswitchPINVOKE.switch_iscntrl(c); + return ret; + } + + public static int switch_isdigit(int c) { + int ret = freeswitchPINVOKE.switch_isdigit(c); + return ret; + } + + public static int switch_isgraph(int c) { + int ret = freeswitchPINVOKE.switch_isgraph(c); + return ret; + } + + public static int switch_islower(int c) { + int ret = freeswitchPINVOKE.switch_islower(c); + return ret; + } + + public static int switch_isprint(int c) { + int ret = freeswitchPINVOKE.switch_isprint(c); + return ret; + } + + public static int switch_ispunct(int c) { + int ret = freeswitchPINVOKE.switch_ispunct(c); + return ret; + } + + public static int switch_isspace(int c) { + int ret = freeswitchPINVOKE.switch_isspace(c); + return ret; + } + + public static int switch_isupper(int c) { + int ret = freeswitchPINVOKE.switch_isupper(c); + return ret; + } + + public static int switch_isxdigit(int c) { + int ret = freeswitchPINVOKE.switch_isxdigit(c); + return ret; + } + public static switch_bool_t switch_is_moh(string s) { switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_is_moh(s); return ret; @@ -5987,6 +6052,45 @@ [DllImport("mod_managed", EntryPoint="CSharp_switch_console_stream_raw_write")] public static extern int switch_console_stream_raw_write(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3); + [DllImport("mod_managed", EntryPoint="CSharp_switch_toupper")] + public static extern int switch_toupper(int jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_tolower")] + public static extern int switch_tolower(int jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_isalnum")] + public static extern int switch_isalnum(int jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_isalpha")] + public static extern int switch_isalpha(int jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_iscntrl")] + public static extern int switch_iscntrl(int jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_isdigit")] + public static extern int switch_isdigit(int jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_isgraph")] + public static extern int switch_isgraph(int jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_islower")] + public static extern int switch_islower(int jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_isprint")] + public static extern int switch_isprint(int jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_ispunct")] + public static extern int switch_ispunct(int jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_isspace")] + public static extern int switch_isspace(int jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_isupper")] + public static extern int switch_isupper(int jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_isxdigit")] + public static extern int switch_isxdigit(int jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_SMAX_get")] public static extern int SWITCH_SMAX_get(); Modified: freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp (original) +++ freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp Sun Dec 14 22:45:38 2008 @@ -8146,7 +8146,55 @@ } -XS(_wrap_CoreSession_sleep) { +XS(_wrap_CoreSession_sleep__SWIG_0) { + { + CoreSession *arg1 = (CoreSession *) 0 ; + int arg2 ; + int arg3 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: CoreSession_sleep(self,ms,sync);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_sleep" "', argument " "1"" of type '" "CoreSession *""'"); + } + arg1 = reinterpret_cast< CoreSession * >(argp1); + ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoreSession_sleep" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoreSession_sleep" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + result = (int)(arg1)->sleep(arg2,arg3); + ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; + + + + XSRETURN(argvi); + fail: + + + + SWIG_croak_null(); + } +} + + +XS(_wrap_CoreSession_sleep__SWIG_1) { { CoreSession *arg1 = (CoreSession *) 0 ; int arg2 ; @@ -8184,6 +8232,98 @@ } +XS(_wrap_CoreSession_sleep) { + dXSARGS; + + { + unsigned long _index = 0; + SWIG_TypeRank _rank = 0; + if (items == 2) { + SWIG_TypeRank _ranki = 0; + SWIG_TypeRank _rankm = 0; + SWIG_TypeRank _pi = 1; + int _v = 0; + { + void *vptr = 0; + int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_CoreSession, 0); + _v = SWIG_CheckState(res); + } + if (!_v) goto check_1; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + { + { + int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL); + _v = SWIG_CheckState(res); + } + } + if (!_v) goto check_1; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + if (!_index || (_ranki < _rank)) { + _rank = _ranki; _index = 1; + if (_rank == _rankm) goto dispatch; + } + } + check_1: + + if (items == 3) { + SWIG_TypeRank _ranki = 0; + SWIG_TypeRank _rankm = 0; + SWIG_TypeRank _pi = 1; + int _v = 0; + { + void *vptr = 0; + int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_CoreSession, 0); + _v = SWIG_CheckState(res); + } + if (!_v) goto check_2; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + { + { + int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL); + _v = SWIG_CheckState(res); + } + } + if (!_v) goto check_2; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + { + { + int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), NULL); + _v = SWIG_CheckState(res); + } + } + if (!_v) goto check_2; + _ranki += _v*_pi; + _rankm += _pi; + _pi *= SWIG_MAXCASTRANK; + if (!_index || (_ranki < _rank)) { + _rank = _ranki; _index = 2; + if (_rank == _rankm) goto dispatch; + } + } + check_2: + + dispatch: + switch(_index) { + case 1: + ++PL_markstack_ptr; SWIG_CALLXS(_wrap_CoreSession_sleep__SWIG_1); return; + case 2: + ++PL_markstack_ptr; SWIG_CALLXS(_wrap_CoreSession_sleep__SWIG_0); return; + } + } + + croak("No matching function for overloaded 'CoreSession_sleep'"); + XSRETURN(0); +} + + XS(_wrap_CoreSession_flushEvents) { { CoreSession *arg1 = (CoreSession *) 0 ; Modified: freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp (original) +++ freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp Sun Dec 14 22:45:38 2008 @@ -8018,7 +8018,47 @@ } -SWIGINTERN PyObject *_wrap_CoreSession_sleep(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { +SWIGINTERN PyObject *_wrap_CoreSession_sleep__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + CoreSession *arg1 = (CoreSession *) 0 ; + int arg2 ; + int arg3 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_sleep",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_sleep" "', argument " "1"" of type '" "CoreSession *""'"); + } + arg1 = reinterpret_cast< CoreSession * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoreSession_sleep" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoreSession_sleep" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + result = (int)(arg1)->sleep(arg2,arg3); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CoreSession_sleep__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; CoreSession *arg1 = (CoreSession *) 0 ; int arg2 ; @@ -8049,6 +8089,62 @@ } +SWIGINTERN PyObject *_wrap_CoreSession_sleep(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = (int)PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CoreSession, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_CoreSession_sleep__SWIG_1(self, args); + } + } + } + if (argc == 3) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CoreSession, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_CoreSession_sleep__SWIG_0(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CoreSession_sleep'.\n" + " Possible C/C++ prototypes are:\n" + " sleep(CoreSession *,int,int)\n" + " sleep(CoreSession *,int)\n"); + return NULL; +} + + SWIGINTERN PyObject *_wrap_CoreSession_flushEvents(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; CoreSession *arg1 = (CoreSession *) 0 ; From mikej at freeswitch.org Sun Dec 14 21:12:13 2008 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Mon, 15 Dec 2008 00:12:13 -0500 Subject: [Freeswitch-svn] [commit] r10764 - freeswitch/trunk/src Message-ID: Author: mikej Date: Mon Dec 15 00:12:12 2008 New Revision: 10764 Log: FSCORE-253 workaround netbsd failures Modified: freeswitch/trunk/src/switch_utils.c Modified: freeswitch/trunk/src/switch_utils.c ============================================================================== --- freeswitch/trunk/src/switch_utils.c (original) +++ freeswitch/trunk/src/switch_utils.c Mon Dec 15 00:12:12 2008 @@ -1657,7 +1657,7 @@ #define _X 0x40 #define _B 0x80 -const char _switch_C_ctype_[1 + SWITCH_CTYPE_NUM_CHARS] = { +const int _switch_C_ctype_[1 + SWITCH_CTYPE_NUM_CHARS] = { 0, _C, _C, _C, _C, _C, _C, _C, _C, _C, _C|_S, _C|_S, _C|_S, _C|_S, _C|_S, _C, _C, @@ -1695,7 +1695,7 @@ _P, _P, _P, _P, _P, _P, _P, _P /* F8 */ }; -const char *_switch_ctype_ = _switch_C_ctype_; +const int *_switch_ctype_ = _switch_C_ctype_; SWITCH_DECLARE(int) switch_isalnum(int c) { From gmaruzz at freeswitch.org Mon Dec 15 02:05:51 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Mon, 15 Dec 2008 05:05:51 -0500 Subject: [Freeswitch-svn] [commit] r10765 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Mon Dec 15 05:05:50 2008 New Revision: 10765 Log: skypiax: multiline on linux Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Mon Dec 15 05:05:50 2008 @@ -595,6 +595,7 @@ { char *cf = "skypiax.conf"; switch_xml_t cfg, xml, global_settings, param, interfaces, myinterface; + skypiax_interface_t *p = NULL; switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, skypiax_module_pool); if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) { @@ -672,6 +673,8 @@ char *fail_dial_regex = NULL; char *enable_callerid = "true"; char *X11_display = NULL; + char *tcp_cli_port = NULL; + char *tcp_srv_port = NULL; uint32_t interface_id = 0, to = 0, max = 0; @@ -695,6 +698,10 @@ fail_dial_regex = val; } else if (!strcasecmp(var, "hold-music")) { hold_music = val; + } else if (!strcasecmp(var, "tcp_cli_port")) { + tcp_cli_port = val; + } else if (!strcasecmp(var, "tcp_srv_port")) { + tcp_srv_port = val; } else if (!strcasecmp(var, "X11-display") || !strcasecmp(var, "X11_display")) { X11_display = val; } else if (!strcasecmp(var, "max_digits") || !strcasecmp(var, "max-digits")) { @@ -710,7 +717,17 @@ "interface missing REQUIRED param 'X11_display'\n"); continue; } + if (!tcp_cli_port) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + "interface missing REQUIRED param 'tcp_cli_port'\n"); + continue; + } + if (!tcp_srv_port) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + "interface missing REQUIRED param 'tcp_srv_port'\n"); + continue; + } if (!id) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "interface missing REQUIRED param 'id'\n"); @@ -771,13 +788,25 @@ } else { switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].name, "N/A"); } + globals.SKYPIAX_INTERFACES[interface_id].tcp_cli_port = atoi(tcp_cli_port); + globals.SKYPIAX_INTERFACES[interface_id].tcp_srv_port = atoi(tcp_srv_port); + //switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].tcp_cli_port, tcp_cli_port); + //switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].tcp_srv_port, tcp_srv_port); switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].X11_display, X11_display); switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].context, context); switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].dialplan, dialplan); + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].X11_display=%s\n", interface_id, globals.SKYPIAX_INTERFACES[interface_id].X11_display); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].tcp_cli_port=%d\n", + interface_id, globals.SKYPIAX_INTERFACES[interface_id].tcp_cli_port); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, + "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].tcp_srv_port=%d\n", + interface_id, globals.SKYPIAX_INTERFACES[interface_id].tcp_srv_port); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].name=%s\n", interface_id, globals.SKYPIAX_INTERFACES[interface_id].name); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h Mon Dec 15 05:05:50 2008 @@ -148,6 +148,8 @@ char hold_music[256]; char type[256]; char X11_display[256]; + int tcp_cli_port; + int tcp_srv_port; struct AsteriskHandles AsteriskHandlesAst; int interface_state; /*!< \brief 'state' of the interface (channel) */ Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Mon Dec 15 05:05:50 2008 @@ -27,9 +27,9 @@ HANDLE volatile win32_hGlobal_PromptConsoleHandle = NULL; #else /* NOT WIN32 */ #define SKYPE_X11_BUF_SIZE 512 -Window skype_win = (Window) - 1; -static XErrorHandler old_handler = 0; -static int xerror = 0; +//Window skype_win = (Window) - 1; +//static XErrorHandler old_handler = 0; +//static int xerror = 0; #endif /* WIN32 */ @@ -72,7 +72,7 @@ memset(&my_addr, 0, sizeof(my_addr)); my_addr.sin_family = AF_INET; my_addr.sin_addr.s_addr = htonl(0x7f000001); /* use the localhost */ - my_addr.sin_port = htons(5556); //FIXME configurable! + my_addr.sin_port = htons(p->tcp_srv_port); //FIXME configurable! if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) { ERRORA("socket Error\n", SKYPIAX_P_LOG); @@ -235,7 +235,7 @@ memset(&my_addr, 0, sizeof(my_addr)); my_addr.sin_family = AF_INET; my_addr.sin_addr.s_addr = htonl(0x7f000001); /* use the localhost */ - my_addr.sin_port = htons(5558); //FIXME configurable! + my_addr.sin_port = htons(p->tcp_cli_port); //FIXME configurable! if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) { ERRORA("socket Error\n", SKYPIAX_P_LOG); @@ -635,6 +635,7 @@ } #else /* NOT WIN32 */ +#if 0 int X11_errors_handler(Display * dpy, XErrorEvent * err) { (void) dpy; @@ -656,6 +657,7 @@ XSetErrorHandler(old_handler); return (xerror != BadValue) && (xerror != BadWindow); } +#endif int skypiax_skype_send_message(struct AsteriskHandles *AsteriskHandlesAst, const char *message_P) @@ -664,7 +666,7 @@ Window w_P; Display *disp; Window handle_P; - struct skypiax_interface *p = NULL; + //struct skypiax_interface *p = NULL; w_P = AsteriskHandlesAst->skype_win; disp = AsteriskHandlesAst->disp; @@ -675,7 +677,7 @@ unsigned int pos = 0; unsigned int len = strlen(message_P); XEvent e; - int ok; + //int ok; memset(&e, 0, sizeof(e)); e.xclient.type = ClientMessage; @@ -684,7 +686,7 @@ e.xclient.window = handle_P; e.xclient.format = 8; - X11_errors_trap(); + //X11_errors_trap(); //XLockDisplay(disp); do { unsigned int i; @@ -698,17 +700,17 @@ XSync(disp, False); //XUnlockDisplay(disp); - ok = X11_errors_untrap(); + //ok = X11_errors_untrap(); - if (!ok) - DEBUGA_SKYPE("Sending message failed with status %d\n", SKYPIAX_P_LOG, xerror); + //if (!ok) DEBUGA_SKYPE("Sending message failed with status %d\n", SKYPIAX_P_LOG, xerror); - return ok; + //return ok; + return 1; } -int skypiax_skype_present(Display * disp) +int skypiax_skype_present(struct AsteriskHandles *AsteriskHandlesAst) { - Atom skype_inst = XInternAtom(disp, "_SKYPE_INSTANCE", True); + Atom skype_inst = XInternAtom(AsteriskHandlesAst->disp, "_SKYPE_INSTANCE", True); Atom type_ret; int format_ret; @@ -718,25 +720,25 @@ int status; struct skypiax_interface *p = NULL; - X11_errors_trap(); + //X11_errors_trap(); //XLockDisplay(disp); status = - XGetWindowProperty(disp, DefaultRootWindow(disp), skype_inst, 0, 1, False, XA_WINDOW, + XGetWindowProperty(AsteriskHandlesAst->disp, DefaultRootWindow(AsteriskHandlesAst->disp), skype_inst, 0, 1, False, XA_WINDOW, &type_ret, &format_ret, &nitems_ret, &bytes_after_ret, &prop); //XUnlockDisplay(disp); - X11_errors_untrap(); + //X11_errors_untrap(); /* sanity check */ if (status != Success || format_ret != 32 || nitems_ret != 1) { - skype_win = (Window) - 1; + AsteriskHandlesAst->skype_win = (Window) - 1; DEBUGA_SKYPE("Skype instance not found\n", SKYPIAX_P_LOG); return 0; } - skype_win = *(const unsigned long *) prop & 0xffffffff; + AsteriskHandlesAst->skype_win = *(const unsigned long *) prop & 0xffffffff; //DEBUGA_SKYPE("Skype instance found with id #%x\n", SKYPIAX_P_LOG, DEBUGA_SKYPE("Skype instance found with id #%d\n", SKYPIAX_P_LOG, - (unsigned int) skype_win); + (unsigned int) AsteriskHandlesAst->skype_win); return 1; } @@ -798,7 +800,9 @@ //FIXME pthread_cleanup_push(skypiax_skype_clean_disp, &xfd); DEBUGA_SKYPE("PUSH disp %d\n", SKYPIAX_P_LOG, xfd); - if (skypiax_skype_present(disp)) { + AsteriskHandlesAst->disp = disp; + + if (skypiax_skype_present(AsteriskHandlesAst)) { root = DefaultRootWindow(disp); win = XCreateSimpleWindow(disp, root, 0, 0, 1, 1, 0, @@ -806,11 +810,10 @@ DefaultScreen (disp))); - DEBUGA_SKYPE("skype_win=%d win=%d\n", SKYPIAX_P_LOG, (unsigned int) skype_win, - (unsigned int) win); + //DEBUGA_SKYPE("skype_win=%d win=%d\n", SKYPIAX_P_LOG, (unsigned int) skype_win, (unsigned int) win); - AsteriskHandlesAst->skype_win = skype_win; - AsteriskHandlesAst->disp = disp; + //AsteriskHandlesAst->skype_win = skype_win; + //AsteriskHandlesAst->disp = disp; AsteriskHandlesAst->win = win; snprintf(buf, SKYPE_X11_BUF_SIZE, "NAME skypiax"); @@ -1309,10 +1312,10 @@ DEBUGA_SKYPE("started tcp_cli_thread thread.\n", SKYPIAX_P_LOG); } switch_sleep(100000); - sprintf(msg_to_skype, "ALTER CALL %s SET_OUTPUT PORT=\"5556\"", id); + sprintf(msg_to_skype, "ALTER CALL %s SET_OUTPUT PORT=\"%d\"", id, p->tcp_srv_port); skypiax_skype_write(p, msg_to_skype); switch_sleep(100000); - sprintf(msg_to_skype, "ALTER CALL %s SET_INPUT PORT=\"5558\"", id); + sprintf(msg_to_skype, "ALTER CALL %s SET_INPUT PORT=\"%d\"", id, p->tcp_cli_port); skypiax_skype_write(p, msg_to_skype); switch_sleep(100000); } From anthm at freeswitch.org Mon Dec 15 08:10:22 2008 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Mon, 15 Dec 2008 11:10:22 -0500 Subject: [Freeswitch-svn] [commit] r10766 - freeswitch/trunk/src Message-ID: Author: anthm Date: Mon Dec 15 11:10:20 2008 New Revision: 10766 Log: fix null mutex race cond Modified: freeswitch/trunk/src/switch_core_io.c Modified: freeswitch/trunk/src/switch_core_io.c ============================================================================== --- freeswitch/trunk/src/switch_core_io.c (original) +++ freeswitch/trunk/src/switch_core_io.c Mon Dec 15 11:10:20 2008 @@ -600,12 +600,16 @@ switch_assert(frame->codec != NULL); switch_assert(frame->codec->implementation != NULL); - if (!(session->write_codec && frame->codec)) { + switch_mutex_lock(session->codec_write_mutex); + + if (!(session->write_codec && session->write_codec->mutex && frame->codec)) { + switch_mutex_unlock(session->codec_write_mutex); return SWITCH_STATUS_FALSE; } + switch_mutex_lock(session->write_codec->mutex); switch_mutex_lock(frame->codec->mutex); - switch_mutex_lock(session->codec_write_mutex); + if ((session->write_codec && frame->codec && session->write_codec->implementation != frame->codec->implementation)) { if (session->write_codec->implementation->codec_id == frame->codec->implementation->codec_id) { From brian at freeswitch.org Mon Dec 15 08:14:39 2008 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Mon, 15 Dec 2008 11:14:39 -0500 Subject: [Freeswitch-svn] [commit] r10767 - freeswitch/trunk/conf/autoload_configs Message-ID: Author: brian Date: Mon Dec 15 11:14:39 2008 New Revision: 10767 Log: add siren to conf file Modified: freeswitch/trunk/conf/autoload_configs/modules.conf.xml Modified: freeswitch/trunk/conf/autoload_configs/modules.conf.xml ============================================================================== --- freeswitch/trunk/conf/autoload_configs/modules.conf.xml (original) +++ freeswitch/trunk/conf/autoload_configs/modules.conf.xml Mon Dec 15 11:14:39 2008 @@ -63,6 +63,7 @@ + From brian at freeswitch.org Mon Dec 15 08:21:16 2008 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Mon, 15 Dec 2008 11:21:16 -0500 Subject: [Freeswitch-svn] [commit] r10768 - freeswitch/trunk/conf/sip_profiles Message-ID: Author: brian Date: Mon Dec 15 11:21:15 2008 New Revision: 10768 Log: add docs for force-subscription-expires Modified: freeswitch/trunk/conf/sip_profiles/internal.xml Modified: freeswitch/trunk/conf/sip_profiles/internal.xml ============================================================================== --- freeswitch/trunk/conf/sip_profiles/internal.xml (original) +++ freeswitch/trunk/conf/sip_profiles/internal.xml Mon Dec 15 11:21:15 2008 @@ -148,6 +148,8 @@ + + From gmaruzz at freeswitch.org Mon Dec 15 08:52:02 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Mon, 15 Dec 2008 11:52:02 -0500 Subject: [Freeswitch-svn] [commit] r10769 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Mon Dec 15 11:52:02 2008 New Revision: 10769 Log: skypiax: better performance on linux??? Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Mon Dec 15 11:52:02 2008 @@ -118,9 +118,11 @@ fdselect = fd; FD_ZERO(&fs); FD_SET(fdselect, &fs); - to.tv_usec = 100; + to.tv_usec = 10000; to.tv_sec = 0; rt = select(fdselect + 1, &fs, NULL, NULL, &to); + //usleep(1000); + //rt=1; if (rt > 0) { len = recv(fd, srv_in, sizeof(short) * SAMPLES_PER_FRAME, 0); @@ -283,8 +285,10 @@ fdselect = 1; FD_ZERO(&fs); FD_SET(fdselect, &fs); - to.tv_usec = 100; + to.tv_usec = 10000; to.tv_sec = 0; + //rt = select(fdselect + 1, &fs, NULL, NULL, &to); + usleep(5000); rt = 1; if (rt > 0) { @@ -845,6 +849,7 @@ b = buffer; while (1) { + usleep(1000); XNextEvent(disp, &an_event); if (!running) break; From brian at freeswitch.org Mon Dec 15 09:26:25 2008 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Mon, 15 Dec 2008 12:26:25 -0500 Subject: [Freeswitch-svn] [commit] r10770 - freeswitch/trunk/support-d Message-ID: Author: brian Date: Mon Dec 15 12:26:24 2008 New Revision: 10770 Log: download from fs.org Modified: freeswitch/trunk/support-d/install-cc-mode.sh Modified: freeswitch/trunk/support-d/install-cc-mode.sh ============================================================================== --- freeswitch/trunk/support-d/install-cc-mode.sh (original) +++ freeswitch/trunk/support-d/install-cc-mode.sh Mon Dec 15 12:26:24 2008 @@ -1,5 +1,5 @@ version=5.31.3 -wget http://easynews.dl.sourceforge.net/sourceforge/cc-mode/cc-mode-${version}.tar.gz +wget http://www.freeswitch.org/eg/cc-mode-${version}.tar.gz tar -zxvf cc-mode-${version}.tar.gz cd cc-mode-${version} emacs -batch -no-site-file -q -f batch-byte-compile cc-*.el From gmaruzz at freeswitch.org Mon Dec 15 09:26:36 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Mon, 15 Dec 2008 12:26:36 -0500 Subject: [Freeswitch-svn] [commit] r10771 - in freeswitch/branches/gmaruzz/src: . include mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Mon Dec 15 12:26:36 2008 New Revision: 10771 Log: skypiax: prepare for merging with trunk, cleaning the switch_apr.c and switch_apr.h files Modified: freeswitch/branches/gmaruzz/src/include/switch_apr.h freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c freeswitch/branches/gmaruzz/src/switch_apr.c Modified: freeswitch/branches/gmaruzz/src/include/switch_apr.h ============================================================================== --- freeswitch/branches/gmaruzz/src/include/switch_apr.h (original) +++ freeswitch/branches/gmaruzz/src/include/switch_apr.h Mon Dec 15 12:26:36 2008 @@ -1303,7 +1303,17 @@ SWITCH_DECLARE(switch_status_t) switch_match_glob(const char *pattern, switch_array_header_t **result, switch_memory_pool_t *p); SWITCH_DECLARE(switch_status_t) switch_socket_addr_get(switch_sockaddr_t **sa, switch_bool_t remote, switch_socket_t *sock); -SWITCH_DECLARE(switch_status_t) switch_file_pipe_create_ex(switch_file_t **in, switch_file_t **out, int32_t blocking, switch_memory_pool_t *p); + +/** + * Create an anonymous pipe. + * @param in The file descriptor to use as input to the pipe. + * @param out The file descriptor to use as output from the pipe. + * @param pool The pool to operate on. + * @remark By default, the returned file descriptors will be inherited + * by child processes created using apr_proc_create(). This can be + * changed using apr_file_inherit_unset(). + */ +SWITCH_DECLARE(switch_status_t) switch_file_pipe_create(switch_file_t **in, switch_file_t **out, switch_memory_pool_t *p); /** * Get the timeout value for a pipe or manipulate the blocking state. Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Mon Dec 15 12:26:36 2008 @@ -344,16 +344,14 @@ switch_status_t rv; rv = - switch_file_pipe_create_ex(&p->audiopipe[0], &p->audiopipe[1], 2, - skypiax_module_pool); + switch_file_pipe_create(&p->audiopipe[0], &p->audiopipe[1], skypiax_module_pool); rv = switch_file_pipe_timeout_set(p->audiopipe[0], 100000); /* the pipe is our audio fd for pbx to poll on */ p->skypiax_sound_capt_fd = p->audiopipe[0]; rv = - switch_file_pipe_create_ex(&p->audioskypepipe[0], &p->audioskypepipe[1], 2, - skypiax_module_pool); + switch_file_pipe_create(&p->audioskypepipe[0], &p->audioskypepipe[1], skypiax_module_pool); rv = switch_file_pipe_timeout_set(p->audioskypepipe[0], 100); if (option_debug > 10) { DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); @@ -596,8 +594,7 @@ //DWORD MsgWaitResult; p = obj; - switch_file_pipe_create_ex(&p->AsteriskHandlesAst.fdesc[0], - &p->AsteriskHandlesAst.fdesc[1], 2, skypiax_module_pool); + switch_file_pipe_create(&p->AsteriskHandlesAst.fdesc[0], &p->AsteriskHandlesAst.fdesc[1], skypiax_module_pool); switch_file_pipe_timeout_set(p->AsteriskHandlesAst.fdesc[0], 100000); win32_AsteriskHandlesSkype = &p->AsteriskHandlesAst; @@ -780,8 +777,7 @@ p = obj; DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); - switch_file_pipe_create_ex(&p->AsteriskHandlesAst.fdesc[0], - &p->AsteriskHandlesAst.fdesc[1], 2, skypiax_module_pool); + switch_file_pipe_create(&p->AsteriskHandlesAst.fdesc[0], &p->AsteriskHandlesAst.fdesc[1], skypiax_module_pool); switch_file_pipe_timeout_set(p->AsteriskHandlesAst.fdesc[0], 100000); AsteriskHandlesAst = &p->AsteriskHandlesAst; Modified: freeswitch/branches/gmaruzz/src/switch_apr.c ============================================================================== --- freeswitch/branches/gmaruzz/src/switch_apr.c (original) +++ freeswitch/branches/gmaruzz/src/switch_apr.c Mon Dec 15 12:26:36 2008 @@ -942,9 +942,17 @@ return apr_match_glob(pattern, (apr_array_header_t **) result, p); } -SWITCH_DECLARE(switch_status_t) switch_file_pipe_create_ex(switch_file_t **in, switch_file_t **out, int32_t blocking, switch_memory_pool_t *p) +/** + * Create an anonymous pipe. + * @param in The file descriptor to use as input to the pipe. + * @param out The file descriptor to use as output from the pipe. + * @param pool The pool to operate on. + * @remark By default, the returned file descriptors will be inherited + * by child processes created using apr_proc_create(). This can be + * changed using apr_file_inherit_unset(). + */ +SWITCH_DECLARE(switch_status_t) switch_file_pipe_create(switch_file_t **in, switch_file_t **out, switch_memory_pool_t *p) { - //return apr_file_pipe_create_ex ((apr_file_t **) in, (apr_file_t **) out, blocking, p); return apr_file_pipe_create ((apr_file_t **) in, (apr_file_t **) out, p); } From gmaruzz at freeswitch.org Mon Dec 15 09:30:02 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Mon, 15 Dec 2008 12:30:02 -0500 Subject: [Freeswitch-svn] [commit] r10772 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Mon Dec 15 12:30:02 2008 New Revision: 10772 Log: skypiax: windoz portability Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Mon Dec 15 12:30:02 2008 @@ -288,7 +288,7 @@ to.tv_usec = 10000; to.tv_sec = 0; //rt = select(fdselect + 1, &fs, NULL, NULL, &to); - usleep(5000); + switch_sleep(5000); rt = 1; if (rt > 0) { From gmaruzz at freeswitch.org Mon Dec 15 09:36:05 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Mon, 15 Dec 2008 12:36:05 -0500 Subject: [Freeswitch-svn] [commit] r10773 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax Message-ID: Author: gmaruzz Date: Mon Dec 15 12:36:04 2008 New Revision: 10773 Log: skypiax: cleaner Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax.h Mon Dec 15 12:36:04 2008 @@ -35,6 +35,7 @@ */ #include +#include #ifndef WIN32 #include @@ -44,7 +45,8 @@ //FIXME include? #endif //WIN32 -#define SKYPIAX_SVN_VERSION "SVN 123456" +//#define SKYPIAX_SVN_VERSION "SVN 123456" +#define SKYPIAX_SVN_VERSION SWITCH_VERSION_REVISION typedef enum { TFLAG_IO = (1 << 0), From gmaruzz at freeswitch.org Mon Dec 15 09:56:40 2008 From: gmaruzz at freeswitch.org (FreeSWITCH SVN) Date: Mon, 15 Dec 2008 12:56:40 -0500 Subject: [Freeswitch-svn] [commit] r10774 - in freeswitch/branches/gmaruzz: . build conf conf/autoload_configs conf/dialplan conf/directory/default conf/sip_profiles conf/sip_profiles/external conf/sip_profiles/internal debian docs docs/phrase libs/libdingaling/src libs/libg722_1 libs/libg722_1/config libs/libg722_1/debian libs/libg722_1/doc libs/libg722_1/src libs/libg722_1/src/g722_1 libs/libg722_1/src/msvc libs/libg722_1/src/msvc/sys libs/libg722_1/test-data libs/libg722_1/test-data/itu libs/libg722_1/test-data/local libs/libg722_1/tests libs/libteletone/src libs/spandsp/src libs/win32 libs/win32/libmp3lame libs/win32/libshout scripts scripts/contrib/intralanman/C scripts/contrib/intralanman/C/lcr scripts/contrib/intralanman/C/lcr/mod_lcr scripts/contrib/intralanman/C/lcr/sql scripts/contrib/intralanman/PHP/fs_curl scripts/contrib/intralanman/PHP/fs_curl/configuration scripts/contrib/mcollins scripts/contrib/mrene/mod_limit src src/include src/include/private src/mod/applications/mod_commands src/mod/applications/mod_conference src/mod/applications/mod_dptools src/mod/applications/mod_enum src/mod/applications/mod_expr src/mod/applications/mod_fax src/mod/applications/mod_fifo src/mod/applications/mod_fsv src/mod/applications/mod_http src/mod/applications/mod_limit src/mod/applications/mod_vmd src/mod/applications/mod_voicemail src/mod/asr_tts/mod_cepstral src/mod/asr_tts/mod_pocketsphinx src/mod/codecs/mod_siren src/mod/endpoints/mod_dingaling src/mod/endpoints/mod_iax src/mod/endpoints/mod_loopback src/mod/endpoints/mod_opal src/mod/endpoints/mod_sofia src/mod/endpoints/mod_woomera src/mod/event_handlers/mod_cdr_csv src/mod/event_handlers/mod_erlang_event src/mod/event_handlers/mod_event_socket src/mod/formats/mod_shout src/mod/formats/mod_sndfile src/mod/languages/mod_java src/mod/languages/mod_java/src/org/freeswitch/swig src/mod/languages/mod_lua src/mod/languages/mod_managed src/mod/languages/mod_managed/managed src/mod/languages/mod_perl src/mod/languages/mod_python src/mod/languages/mod_spidermonkey src/mod/xml_int/mod_xml_cdr src/mod/xml_int/mod_xml_curl src/mod/xml_int/mod_xml_ldap ssh_keys support support-d w32/Library Message-ID: Author: gmaruzz Date: Mon Dec 15 12:56:36 2008 New Revision: 10774 Log: Merge of trunk revisions 10428:10773 into gmaruzz branch Added: freeswitch/branches/gmaruzz/conf/autoload_configs/opal.conf.xml - copied unchanged from r10773, /freeswitch/trunk/conf/autoload_configs/opal.conf.xml freeswitch/branches/gmaruzz/libs/libg722_1/ - copied from r10773, /freeswitch/trunk/libs/libg722_1/ freeswitch/branches/gmaruzz/libs/libg722_1/.update - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/.update freeswitch/branches/gmaruzz/libs/libg722_1/AUTHORS - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/AUTHORS freeswitch/branches/gmaruzz/libs/libg722_1/COPYING - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/COPYING freeswitch/branches/gmaruzz/libs/libg722_1/ChangeLog - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/ChangeLog freeswitch/branches/gmaruzz/libs/libg722_1/INSTALL - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/INSTALL freeswitch/branches/gmaruzz/libs/libg722_1/Makefile.am - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/Makefile.am freeswitch/branches/gmaruzz/libs/libg722_1/Makefile.in - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/Makefile.in freeswitch/branches/gmaruzz/libs/libg722_1/NEWS - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/NEWS freeswitch/branches/gmaruzz/libs/libg722_1/README - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/README freeswitch/branches/gmaruzz/libs/libg722_1/aclocal.m4 - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/aclocal.m4 freeswitch/branches/gmaruzz/libs/libg722_1/autogen.sh - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/autogen.sh freeswitch/branches/gmaruzz/libs/libg722_1/config/ - copied from r10773, /freeswitch/trunk/libs/libg722_1/config/ freeswitch/branches/gmaruzz/libs/libg722_1/config-h.in - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/config-h.in freeswitch/branches/gmaruzz/libs/libg722_1/config/ax_c99_features.m4 - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/config/ax_c99_features.m4 freeswitch/branches/gmaruzz/libs/libg722_1/config/ax_check_real_file.m4 - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/config/ax_check_real_file.m4 freeswitch/branches/gmaruzz/libs/libg722_1/config/ax_compiler_vendor.m4 - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/config/ax_compiler_vendor.m4 freeswitch/branches/gmaruzz/libs/libg722_1/config/ax_fixed_point_machine.m4 - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/config/ax_fixed_point_machine.m4 freeswitch/branches/gmaruzz/libs/libg722_1/config/ax_misaligned_access_fails.m4 - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/config/ax_misaligned_access_fails.m4 freeswitch/branches/gmaruzz/libs/libg722_1/config/config.guess - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/config/config.guess freeswitch/branches/gmaruzz/libs/libg722_1/config/config.sub - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/config/config.sub freeswitch/branches/gmaruzz/libs/libg722_1/config/depcomp - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/config/depcomp freeswitch/branches/gmaruzz/libs/libg722_1/config/install-sh - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/config/install-sh freeswitch/branches/gmaruzz/libs/libg722_1/config/ltmain.sh - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/config/ltmain.sh freeswitch/branches/gmaruzz/libs/libg722_1/config/missing - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/config/missing freeswitch/branches/gmaruzz/libs/libg722_1/configure - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/configure freeswitch/branches/gmaruzz/libs/libg722_1/configure.ac - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/configure.ac freeswitch/branches/gmaruzz/libs/libg722_1/debian/ - copied from r10773, /freeswitch/trunk/libs/libg722_1/debian/ freeswitch/branches/gmaruzz/libs/libg722_1/debian/changelog - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/debian/changelog freeswitch/branches/gmaruzz/libs/libg722_1/debian/compat - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/debian/compat freeswitch/branches/gmaruzz/libs/libg722_1/debian/control - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/debian/control freeswitch/branches/gmaruzz/libs/libg722_1/debian/copyright - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/debian/copyright freeswitch/branches/gmaruzz/libs/libg722_1/debian/libg722_1-dev.install - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/debian/libg722_1-dev.install freeswitch/branches/gmaruzz/libs/libg722_1/debian/libg722_1-doc.install - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/debian/libg722_1-doc.install freeswitch/branches/gmaruzz/libs/libg722_1/debian/libg722_11.install - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/debian/libg722_11.install freeswitch/branches/gmaruzz/libs/libg722_1/debian/rules - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/debian/rules freeswitch/branches/gmaruzz/libs/libg722_1/debian/watch - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/debian/watch freeswitch/branches/gmaruzz/libs/libg722_1/doc/ - copied from r10773, /freeswitch/trunk/libs/libg722_1/doc/ freeswitch/branches/gmaruzz/libs/libg722_1/doc/Makefile.am - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/doc/Makefile.am freeswitch/branches/gmaruzz/libs/libg722_1/doc/Makefile.in - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/doc/Makefile.in freeswitch/branches/gmaruzz/libs/libg722_1/doc/css.css - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/doc/css.css freeswitch/branches/gmaruzz/libs/libg722_1/doc/libg722_1-doxygen - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/doc/libg722_1-doxygen freeswitch/branches/gmaruzz/libs/libg722_1/doc/wrapper.xsl - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/doc/wrapper.xsl freeswitch/branches/gmaruzz/libs/libg722_1/g722_1.spec.in - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/g722_1.spec.in freeswitch/branches/gmaruzz/libs/libg722_1/src/ - copied from r10773, /freeswitch/trunk/libs/libg722_1/src/ freeswitch/branches/gmaruzz/libs/libg722_1/src/Makefile.am - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/Makefile.am freeswitch/branches/gmaruzz/libs/libg722_1/src/Makefile.in - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/Makefile.in freeswitch/branches/gmaruzz/libs/libg722_1/src/basop32.c - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/basop32.c freeswitch/branches/gmaruzz/libs/libg722_1/src/basop32.h - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/basop32.h freeswitch/branches/gmaruzz/libs/libg722_1/src/bitstream.c - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/bitstream.c freeswitch/branches/gmaruzz/libs/libg722_1/src/bitstream.h - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/bitstream.h freeswitch/branches/gmaruzz/libs/libg722_1/src/coef2sam.c - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/coef2sam.c freeswitch/branches/gmaruzz/libs/libg722_1/src/coef2sam.h - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/coef2sam.h freeswitch/branches/gmaruzz/libs/libg722_1/src/common.c - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/common.c freeswitch/branches/gmaruzz/libs/libg722_1/src/commonf.c - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/commonf.c freeswitch/branches/gmaruzz/libs/libg722_1/src/dct4.c - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/dct4.c freeswitch/branches/gmaruzz/libs/libg722_1/src/dct4.h - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/dct4.h freeswitch/branches/gmaruzz/libs/libg722_1/src/dct4_a.c - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/dct4_a.c freeswitch/branches/gmaruzz/libs/libg722_1/src/dct4_a.h - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/dct4_a.h freeswitch/branches/gmaruzz/libs/libg722_1/src/dct4_s.c - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/dct4_s.c freeswitch/branches/gmaruzz/libs/libg722_1/src/dct4_s.h - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/dct4_s.h freeswitch/branches/gmaruzz/libs/libg722_1/src/decoder.c - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/decoder.c freeswitch/branches/gmaruzz/libs/libg722_1/src/decoderf.c - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/decoderf.c freeswitch/branches/gmaruzz/libs/libg722_1/src/defs.h - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/defs.h freeswitch/branches/gmaruzz/libs/libg722_1/src/encoder.c - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/encoder.c freeswitch/branches/gmaruzz/libs/libg722_1/src/encoderf.c - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/encoderf.c freeswitch/branches/gmaruzz/libs/libg722_1/src/g722_1/ - copied from r10773, /freeswitch/trunk/libs/libg722_1/src/g722_1/ freeswitch/branches/gmaruzz/libs/libg722_1/src/g722_1.h.in - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/g722_1.h.in freeswitch/branches/gmaruzz/libs/libg722_1/src/g722_1/g722_1.h - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/g722_1/g722_1.h freeswitch/branches/gmaruzz/libs/libg722_1/src/g722_1/version.h - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/g722_1/version.h freeswitch/branches/gmaruzz/libs/libg722_1/src/g722_1/version.h.in - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/g722_1/version.h.in freeswitch/branches/gmaruzz/libs/libg722_1/src/huff_tab.c - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/huff_tab.c freeswitch/branches/gmaruzz/libs/libg722_1/src/huff_tab.h - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/huff_tab.h freeswitch/branches/gmaruzz/libs/libg722_1/src/libg722_1.dsp - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/libg722_1.dsp freeswitch/branches/gmaruzz/libs/libg722_1/src/libg722_1.sln - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/libg722_1.sln freeswitch/branches/gmaruzz/libs/libg722_1/src/libg722_1.vcproj - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/libg722_1.vcproj freeswitch/branches/gmaruzz/libs/libg722_1/src/make_dct4_tables.c - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/make_dct4_tables.c freeswitch/branches/gmaruzz/libs/libg722_1/src/make_tables.c - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/make_tables.c freeswitch/branches/gmaruzz/libs/libg722_1/src/msvc/ - copied from r10773, /freeswitch/trunk/libs/libg722_1/src/msvc/ freeswitch/branches/gmaruzz/libs/libg722_1/src/msvc/g722_1.def - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/msvc/g722_1.def freeswitch/branches/gmaruzz/libs/libg722_1/src/msvc/gettimeofday.c - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/msvc/gettimeofday.c freeswitch/branches/gmaruzz/libs/libg722_1/src/msvc/inttypes.h - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/msvc/inttypes.h freeswitch/branches/gmaruzz/libs/libg722_1/src/msvc/msvcproj.foot - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/msvc/msvcproj.foot freeswitch/branches/gmaruzz/libs/libg722_1/src/msvc/msvcproj.head - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/msvc/msvcproj.head freeswitch/branches/gmaruzz/libs/libg722_1/src/msvc/sys/ - copied from r10773, /freeswitch/trunk/libs/libg722_1/src/msvc/sys/ freeswitch/branches/gmaruzz/libs/libg722_1/src/msvc/sys/time.h - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/msvc/sys/time.h freeswitch/branches/gmaruzz/libs/libg722_1/src/msvc/tgmath.h - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/msvc/tgmath.h freeswitch/branches/gmaruzz/libs/libg722_1/src/msvc/unistd.h - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/msvc/unistd.h freeswitch/branches/gmaruzz/libs/libg722_1/src/msvc/vc8proj.foot - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/msvc/vc8proj.foot freeswitch/branches/gmaruzz/libs/libg722_1/src/msvc/vc8proj.head - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/msvc/vc8proj.head freeswitch/branches/gmaruzz/libs/libg722_1/src/sam2coef.c - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/sam2coef.c freeswitch/branches/gmaruzz/libs/libg722_1/src/sam2coef.h - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/sam2coef.h freeswitch/branches/gmaruzz/libs/libg722_1/src/tables.c - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/tables.c freeswitch/branches/gmaruzz/libs/libg722_1/src/tables.h - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/src/tables.h freeswitch/branches/gmaruzz/libs/libg722_1/test-data/ - copied from r10773, /freeswitch/trunk/libs/libg722_1/test-data/ freeswitch/branches/gmaruzz/libs/libg722_1/test-data/Makefile.am - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/test-data/Makefile.am freeswitch/branches/gmaruzz/libs/libg722_1/test-data/Makefile.in - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/test-data/Makefile.in freeswitch/branches/gmaruzz/libs/libg722_1/test-data/itu/ - copied from r10773, /freeswitch/trunk/libs/libg722_1/test-data/itu/ freeswitch/branches/gmaruzz/libs/libg722_1/test-data/itu/Makefile.am - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/test-data/itu/Makefile.am freeswitch/branches/gmaruzz/libs/libg722_1/test-data/itu/Makefile.in - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/test-data/itu/Makefile.in freeswitch/branches/gmaruzz/libs/libg722_1/test-data/local/ - copied from r10773, /freeswitch/trunk/libs/libg722_1/test-data/local/ freeswitch/branches/gmaruzz/libs/libg722_1/test-data/local/Makefile.am - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/test-data/local/Makefile.am freeswitch/branches/gmaruzz/libs/libg722_1/test-data/local/Makefile.in - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/test-data/local/Makefile.in freeswitch/branches/gmaruzz/libs/libg722_1/test-data/local/short_wb_voice.wav - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/test-data/local/short_wb_voice.wav freeswitch/branches/gmaruzz/libs/libg722_1/tests/ - copied from r10773, /freeswitch/trunk/libs/libg722_1/tests/ freeswitch/branches/gmaruzz/libs/libg722_1/tests/Makefile.am - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/tests/Makefile.am freeswitch/branches/gmaruzz/libs/libg722_1/tests/Makefile.in - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/tests/Makefile.in freeswitch/branches/gmaruzz/libs/libg722_1/tests/g722_1_tests.c - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/tests/g722_1_tests.c freeswitch/branches/gmaruzz/libs/libg722_1/tests/itu_bit_stream.c - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/tests/itu_bit_stream.c freeswitch/branches/gmaruzz/libs/libg722_1/tests/regression_tests.sh.in - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/tests/regression_tests.sh.in freeswitch/branches/gmaruzz/libs/libg722_1/tests/timing.h - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/tests/timing.h freeswitch/branches/gmaruzz/libs/libg722_1/unpack_g722_1_data.sh - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/unpack_g722_1_data.sh freeswitch/branches/gmaruzz/libs/libg722_1/wrapper.xsl - copied unchanged from r10773, /freeswitch/trunk/libs/libg722_1/wrapper.xsl freeswitch/branches/gmaruzz/libs/win32/libmp3lame/config.h - copied unchanged from r10773, /freeswitch/trunk/libs/win32/libmp3lame/config.h freeswitch/branches/gmaruzz/scripts/contrib/intralanman/C/ - copied from r10773, /freeswitch/trunk/scripts/contrib/intralanman/C/ freeswitch/branches/gmaruzz/scripts/contrib/intralanman/C/lcr/ - copied from r10773, /freeswitch/trunk/scripts/contrib/intralanman/C/lcr/ freeswitch/branches/gmaruzz/scripts/contrib/intralanman/C/lcr/lcr.conf.xml - copied unchanged from r10773, /freeswitch/trunk/scripts/contrib/intralanman/C/lcr/lcr.conf.xml freeswitch/branches/gmaruzz/scripts/contrib/intralanman/C/lcr/mod_lcr/ - copied from r10773, /freeswitch/trunk/scripts/contrib/intralanman/C/lcr/mod_lcr/ freeswitch/branches/gmaruzz/scripts/contrib/intralanman/C/lcr/mod_lcr/Makefile - copied unchanged from r10773, /freeswitch/trunk/scripts/contrib/intralanman/C/lcr/mod_lcr/Makefile freeswitch/branches/gmaruzz/scripts/contrib/intralanman/C/lcr/mod_lcr/mod_lcr.c - copied unchanged from r10773, /freeswitch/trunk/scripts/contrib/intralanman/C/lcr/mod_lcr/mod_lcr.c freeswitch/branches/gmaruzz/scripts/contrib/intralanman/C/lcr/sql/ - copied from r10773, /freeswitch/trunk/scripts/contrib/intralanman/C/lcr/sql/ freeswitch/branches/gmaruzz/scripts/contrib/intralanman/C/lcr/sql/mysql-5.0.sql - copied unchanged from r10773, /freeswitch/trunk/scripts/contrib/intralanman/C/lcr/sql/mysql-5.0.sql freeswitch/branches/gmaruzz/scripts/contrib/intralanman/C/lcr/sql/postgres-8.3.sql - copied unchanged from r10773, /freeswitch/trunk/scripts/contrib/intralanman/C/lcr/sql/postgres-8.3.sql freeswitch/branches/gmaruzz/scripts/contrib/mcollins/uuid_send_dtmf.lua - copied unchanged from r10773, /freeswitch/trunk/scripts/contrib/mcollins/uuid_send_dtmf.lua freeswitch/branches/gmaruzz/src/mod/applications/mod_http/ - copied from r10773, /freeswitch/trunk/src/mod/applications/mod_http/ freeswitch/branches/gmaruzz/src/mod/applications/mod_http/Makefile - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/Makefile freeswitch/branches/gmaruzz/src/mod/applications/mod_http/arraylist.c - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/arraylist.c freeswitch/branches/gmaruzz/src/mod/applications/mod_http/arraylist.h - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/arraylist.h freeswitch/branches/gmaruzz/src/mod/applications/mod_http/bits.h - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/bits.h freeswitch/branches/gmaruzz/src/mod/applications/mod_http/config.h - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/config.h freeswitch/branches/gmaruzz/src/mod/applications/mod_http/debug.c - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/debug.c freeswitch/branches/gmaruzz/src/mod/applications/mod_http/debug.h - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/debug.h freeswitch/branches/gmaruzz/src/mod/applications/mod_http/http_req.c - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/http_req.c freeswitch/branches/gmaruzz/src/mod/applications/mod_http/http_req.h - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/http_req.h freeswitch/branches/gmaruzz/src/mod/applications/mod_http/json.h - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/json.h freeswitch/branches/gmaruzz/src/mod/applications/mod_http/json_object.c - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/json_object.c freeswitch/branches/gmaruzz/src/mod/applications/mod_http/json_object.h - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/json_object.h freeswitch/branches/gmaruzz/src/mod/applications/mod_http/json_object_private.h - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/json_object_private.h freeswitch/branches/gmaruzz/src/mod/applications/mod_http/json_tokener.c - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/json_tokener.c freeswitch/branches/gmaruzz/src/mod/applications/mod_http/json_tokener.h - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/json_tokener.h freeswitch/branches/gmaruzz/src/mod/applications/mod_http/json_util.c - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/json_util.c freeswitch/branches/gmaruzz/src/mod/applications/mod_http/json_util.h - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/json_util.h freeswitch/branches/gmaruzz/src/mod/applications/mod_http/linkhash.c - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/linkhash.c freeswitch/branches/gmaruzz/src/mod/applications/mod_http/linkhash.h - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/linkhash.h freeswitch/branches/gmaruzz/src/mod/applications/mod_http/mod_http.c - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/mod_http.c freeswitch/branches/gmaruzz/src/mod/applications/mod_http/printbuf.c - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/printbuf.c freeswitch/branches/gmaruzz/src/mod/applications/mod_http/printbuf.h - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/printbuf.h freeswitch/branches/gmaruzz/src/mod/applications/mod_http/url_encoding.c - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/url_encoding.c freeswitch/branches/gmaruzz/src/mod/applications/mod_http/url_encoding.h - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_http/url_encoding.h freeswitch/branches/gmaruzz/src/mod/applications/mod_vmd/ (props changed) - copied from r10773, /freeswitch/trunk/src/mod/applications/mod_vmd/ freeswitch/branches/gmaruzz/src/mod/applications/mod_vmd/mod_vmd.2008.vcproj - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.2008.vcproj freeswitch/branches/gmaruzz/src/mod/applications/mod_vmd/mod_vmd.c - copied unchanged from r10773, /freeswitch/trunk/src/mod/applications/mod_vmd/mod_vmd.c freeswitch/branches/gmaruzz/src/mod/codecs/mod_siren/ - copied from r10773, /freeswitch/trunk/src/mod/codecs/mod_siren/ freeswitch/branches/gmaruzz/src/mod/codecs/mod_siren/Makefile - copied unchanged from r10773, /freeswitch/trunk/src/mod/codecs/mod_siren/Makefile freeswitch/branches/gmaruzz/src/mod/codecs/mod_siren/mod_siren.c - copied unchanged from r10773, /freeswitch/trunk/src/mod/codecs/mod_siren/mod_siren.c freeswitch/branches/gmaruzz/src/mod/endpoints/mod_opal/ (props changed) - copied from r10773, /freeswitch/trunk/src/mod/endpoints/mod_opal/ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_opal/Makefile - copied unchanged from r10773, /freeswitch/trunk/src/mod/endpoints/mod_opal/Makefile freeswitch/branches/gmaruzz/src/mod/endpoints/mod_opal/mod_opal.cpp - copied unchanged from r10773, /freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp freeswitch/branches/gmaruzz/src/mod/endpoints/mod_opal/mod_opal.h - copied unchanged from r10773, /freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.h freeswitch/branches/gmaruzz/src/mod/endpoints/mod_opal/mod_opal_2005.vcproj - copied unchanged from r10773, /freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal_2005.vcproj freeswitch/branches/gmaruzz/src/mod/endpoints/mod_opal/mod_opal_2008.vcproj - copied unchanged from r10773, /freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal_2008.vcproj freeswitch/branches/gmaruzz/support-d/ - copied from r10773, /freeswitch/trunk/support-d/ freeswitch/branches/gmaruzz/support-d/.bashrc - copied unchanged from r10773, /freeswitch/trunk/support-d/.bashrc freeswitch/branches/gmaruzz/support-d/.emacs - copied unchanged from r10773, /freeswitch/trunk/support-d/.emacs freeswitch/branches/gmaruzz/support-d/.screenrc - copied unchanged from r10773, /freeswitch/trunk/support-d/.screenrc freeswitch/branches/gmaruzz/support-d/freeswitch.pub - copied unchanged from r10773, /freeswitch/trunk/support-d/freeswitch.pub freeswitch/branches/gmaruzz/support-d/install-cc-mode.sh - copied unchanged from r10773, /freeswitch/trunk/support-d/install-cc-mode.sh freeswitch/branches/gmaruzz/support-d/shinzon.pub - copied unchanged from r10773, /freeswitch/trunk/support-d/shinzon.pub Removed: freeswitch/branches/gmaruzz/conf/autoload_configs/woomera.conf.xml freeswitch/branches/gmaruzz/src/mod/endpoints/mod_woomera/ freeswitch/branches/gmaruzz/ssh_keys/ freeswitch/branches/gmaruzz/support/ Modified: freeswitch/branches/gmaruzz/Freeswitch.2008.sln freeswitch/branches/gmaruzz/Makefile.am freeswitch/branches/gmaruzz/build/Makefile freeswitch/branches/gmaruzz/build/modules.conf.in freeswitch/branches/gmaruzz/conf/autoload_configs/conference.conf.xml freeswitch/branches/gmaruzz/conf/autoload_configs/java.conf.xml freeswitch/branches/gmaruzz/conf/autoload_configs/local_stream.conf.xml freeswitch/branches/gmaruzz/conf/autoload_configs/lua.conf.xml freeswitch/branches/gmaruzz/conf/autoload_configs/modules.conf.xml freeswitch/branches/gmaruzz/conf/autoload_configs/sofia.conf.xml freeswitch/branches/gmaruzz/conf/autoload_configs/xml_cdr.conf.xml freeswitch/branches/gmaruzz/conf/dialplan/default.xml freeswitch/branches/gmaruzz/conf/directory/default/brian.xml freeswitch/branches/gmaruzz/conf/sip_profiles/external.xml freeswitch/branches/gmaruzz/conf/sip_profiles/external/example.xml freeswitch/branches/gmaruzz/conf/sip_profiles/internal-ipv6.xml freeswitch/branches/gmaruzz/conf/sip_profiles/internal.xml freeswitch/branches/gmaruzz/conf/sip_profiles/internal/example.xml freeswitch/branches/gmaruzz/conf/vars.xml freeswitch/branches/gmaruzz/configure.in freeswitch/branches/gmaruzz/debian/freeswitch.conffiles freeswitch/branches/gmaruzz/debian/freeswitch.install freeswitch/branches/gmaruzz/debian/postinst freeswitch/branches/gmaruzz/debian/rules freeswitch/branches/gmaruzz/docs/Doxygen.conf freeswitch/branches/gmaruzz/docs/phrase/phrase_en.xml freeswitch/branches/gmaruzz/freeswitch.spec freeswitch/branches/gmaruzz/libs/libdingaling/src/libdingaling.c freeswitch/branches/gmaruzz/libs/libteletone/src/libteletone_generate.c freeswitch/branches/gmaruzz/libs/spandsp/src/t31.c freeswitch/branches/gmaruzz/libs/spandsp/src/t38_terminal.c freeswitch/branches/gmaruzz/libs/win32/libmp3lame/libmp3lame_vc7.vcproj freeswitch/branches/gmaruzz/libs/win32/libshout/ (props changed) freeswitch/branches/gmaruzz/libs/win32/libshout/libshout.vcproj freeswitch/branches/gmaruzz/libs/win32/util.vbs freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/configuration/xml_cdr.conf.php freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/dialplan_importer.php freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/fs_configuration.php freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/fs_curl.php freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/fs_dialplan.php freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/fs_directory.php freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/global_defines.php freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/index.php freeswitch/branches/gmaruzz/scripts/contrib/mrene/mod_limit/mod_limit.c freeswitch/branches/gmaruzz/scripts/fsxs.in freeswitch/branches/gmaruzz/src/include/private/switch_core_pvt.h freeswitch/branches/gmaruzz/src/include/switch.h freeswitch/branches/gmaruzz/src/include/switch_apr.h freeswitch/branches/gmaruzz/src/include/switch_channel.h freeswitch/branches/gmaruzz/src/include/switch_core.h freeswitch/branches/gmaruzz/src/include/switch_cpp.h freeswitch/branches/gmaruzz/src/include/switch_ivr.h freeswitch/branches/gmaruzz/src/include/switch_module_interfaces.h freeswitch/branches/gmaruzz/src/include/switch_odbc.h freeswitch/branches/gmaruzz/src/include/switch_rtp.h freeswitch/branches/gmaruzz/src/include/switch_stun.h freeswitch/branches/gmaruzz/src/include/switch_types.h freeswitch/branches/gmaruzz/src/include/switch_utils.h freeswitch/branches/gmaruzz/src/mod/applications/mod_commands/mod_commands.c freeswitch/branches/gmaruzz/src/mod/applications/mod_conference/mod_conference.c freeswitch/branches/gmaruzz/src/mod/applications/mod_dptools/mod_dptools.c freeswitch/branches/gmaruzz/src/mod/applications/mod_enum/mod_enum.c freeswitch/branches/gmaruzz/src/mod/applications/mod_expr/exprpars.c freeswitch/branches/gmaruzz/src/mod/applications/mod_expr/exprutil.c freeswitch/branches/gmaruzz/src/mod/applications/mod_fax/Makefile freeswitch/branches/gmaruzz/src/mod/applications/mod_fax/mod_fax.c freeswitch/branches/gmaruzz/src/mod/applications/mod_fifo/mod_fifo.c freeswitch/branches/gmaruzz/src/mod/applications/mod_fsv/mod_fsv.c freeswitch/branches/gmaruzz/src/mod/applications/mod_limit/mod_limit.c freeswitch/branches/gmaruzz/src/mod/applications/mod_voicemail/mod_voicemail.c freeswitch/branches/gmaruzz/src/mod/asr_tts/mod_cepstral/Makefile freeswitch/branches/gmaruzz/src/mod/asr_tts/mod_cepstral/mod_cepstral.c freeswitch/branches/gmaruzz/src/mod/asr_tts/mod_pocketsphinx/Makefile freeswitch/branches/gmaruzz/src/mod/endpoints/mod_dingaling/mod_dingaling.c freeswitch/branches/gmaruzz/src/mod/endpoints/mod_iax/iax-client.h freeswitch/branches/gmaruzz/src/mod/endpoints/mod_loopback/mod_loopback.c freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/mod_sofia.c freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/mod_sofia.h freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia.c freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia_glue.c freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia_presence.c freeswitch/branches/gmaruzz/src/mod/endpoints/mod_sofia/sofia_reg.c freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c freeswitch/branches/gmaruzz/src/mod/event_handlers/mod_event_socket/mod_event_socket.c freeswitch/branches/gmaruzz/src/mod/formats/mod_shout/mod_shout.c freeswitch/branches/gmaruzz/src/mod/formats/mod_sndfile/mod_sndfile.c freeswitch/branches/gmaruzz/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java freeswitch/branches/gmaruzz/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitch.java freeswitch/branches/gmaruzz/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java freeswitch/branches/gmaruzz/src/mod/languages/mod_java/switch_swig_wrap.cpp freeswitch/branches/gmaruzz/src/mod/languages/mod_lua/mod_lua_wrap.cpp freeswitch/branches/gmaruzz/src/mod/languages/mod_managed/freeswitch_wrap.cxx freeswitch/branches/gmaruzz/src/mod/languages/mod_managed/managed/swig.cs freeswitch/branches/gmaruzz/src/mod/languages/mod_perl/freeswitch.pm freeswitch/branches/gmaruzz/src/mod/languages/mod_perl/mod_perl_wrap.cpp freeswitch/branches/gmaruzz/src/mod/languages/mod_python/freeswitch.py freeswitch/branches/gmaruzz/src/mod/languages/mod_python/mod_python_wrap.cpp freeswitch/branches/gmaruzz/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c freeswitch/branches/gmaruzz/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c freeswitch/branches/gmaruzz/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c freeswitch/branches/gmaruzz/src/mod/xml_int/mod_xml_ldap/Makefile freeswitch/branches/gmaruzz/src/switch.c freeswitch/branches/gmaruzz/src/switch_apr.c freeswitch/branches/gmaruzz/src/switch_channel.c freeswitch/branches/gmaruzz/src/switch_core.c freeswitch/branches/gmaruzz/src/switch_core_codec.c freeswitch/branches/gmaruzz/src/switch_core_io.c freeswitch/branches/gmaruzz/src/switch_core_rwlock.c freeswitch/branches/gmaruzz/src/switch_core_session.c freeswitch/branches/gmaruzz/src/switch_core_state_machine.c freeswitch/branches/gmaruzz/src/switch_cpp.cpp freeswitch/branches/gmaruzz/src/switch_event.c freeswitch/branches/gmaruzz/src/switch_ivr.c freeswitch/branches/gmaruzz/src/switch_ivr_async.c freeswitch/branches/gmaruzz/src/switch_ivr_bridge.c freeswitch/branches/gmaruzz/src/switch_ivr_menu.c freeswitch/branches/gmaruzz/src/switch_ivr_originate.c freeswitch/branches/gmaruzz/src/switch_ivr_play_say.c freeswitch/branches/gmaruzz/src/switch_loadable_module.c freeswitch/branches/gmaruzz/src/switch_odbc.c freeswitch/branches/gmaruzz/src/switch_resample.c freeswitch/branches/gmaruzz/src/switch_rtp.c freeswitch/branches/gmaruzz/src/switch_stun.c freeswitch/branches/gmaruzz/src/switch_utils.c freeswitch/branches/gmaruzz/src/switch_xml.c freeswitch/branches/gmaruzz/w32/Library/ (props changed) Modified: freeswitch/branches/gmaruzz/Freeswitch.2008.sln ============================================================================== --- freeswitch/branches/gmaruzz/Freeswitch.2008.sln (original) +++ freeswitch/branches/gmaruzz/Freeswitch.2008.sln Mon Dec 15 12:56:36 2008 @@ -1,6 +1,6 @@ ? Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual C++ Express 2008 +# Visual Studio 2008 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Codecs", "Codecs", "{F881ADA2-2F1A-4046-9FEB-191D9422D781}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Endpoints", "Endpoints", "{9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}" @@ -160,28 +160,28 @@ conf\lang\de\vm\tts.xml = conf\lang\de\vm\tts.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (2)", "demo (2)", "{765EF1B9-5027-4820-BC37-A44466A51631}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{765EF1B9-5027-4820-BC37-A44466A51631}" ProjectSection(SolutionItems) = preProject conf\lang\en\demo\demo.xml = conf\lang\en\demo\demo.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (2)", "vm (2)", "{713E4747-1126-40B1-BD84-58F9A7745423}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{713E4747-1126-40B1-BD84-58F9A7745423}" ProjectSection(SolutionItems) = preProject conf\lang\en\vm\sounds.xml = conf\lang\en\vm\sounds.xml conf\lang\en\vm\tts.xml = conf\lang\en\vm\tts.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (3)", "demo (3)", "{F1B71990-EB04-4EB5-B28A-BC3EB6F7E843}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{F1B71990-EB04-4EB5-B28A-BC3EB6F7E843}" ProjectSection(SolutionItems) = preProject conf\lang\fr\demo\demo.xml = conf\lang\fr\demo\demo.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (3)", "vm (3)", "{3DAF028C-AB5B-4183-A01B-DCC43F5A87F0}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{3DAF028C-AB5B-4183-A01B-DCC43F5A87F0}" ProjectSection(SolutionItems) = preProject conf\lang\fr\vm\sounds.xml = conf\lang\fr\vm\sounds.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "autoload_configs (2)", "autoload_configs (2)", "{4833F8E3-ABBF-4260-9DB1-B34015676CFC}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "autoload_configs", "autoload_configs", "{4833F8E3-ABBF-4260-9DB1-B34015676CFC}" ProjectSection(SolutionItems) = preProject debug\conf\autoload_configs\alsa.conf.xml = debug\conf\autoload_configs\alsa.conf.xml debug\conf\autoload_configs\conference.conf.xml = debug\conf\autoload_configs\conference.conf.xml @@ -214,26 +214,26 @@ debug\conf\autoload_configs\zeroconf.conf.xml = debug\conf\autoload_configs\zeroconf.conf.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dialplan (2)", "dialplan (2)", "{D44DD429-FE98-42AA-B5B7-4B4EBE33AEFD}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dialplan", "dialplan", "{D44DD429-FE98-42AA-B5B7-4B4EBE33AEFD}" ProjectSection(SolutionItems) = preProject debug\conf\dialplan\default.xml = debug\conf\dialplan\default.xml debug\conf\dialplan\US.conf.xml = debug\conf\dialplan\US.conf.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "directory (2)", "directory (2)", "{471110C9-A7ED-4966-98E1-8EA667BF0EEA}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "directory", "directory", "{471110C9-A7ED-4966-98E1-8EA667BF0EEA}" ProjectSection(SolutionItems) = preProject debug\conf\directory\default.xml = debug\conf\directory\default.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sip_profiles (2)", "sip_profiles (2)", "{4DF5199E-F7F5-4347-97DD-22078FCDB371}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sip_profiles", "sip_profiles", "{4DF5199E-F7F5-4347-97DD-22078FCDB371}" ProjectSection(SolutionItems) = preProject debug\conf\sip_profiles\default.xml = debug\conf\sip_profiles\default.xml debug\conf\sip_profiles\nat.xml = debug\conf\sip_profiles\nat.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lang (2)", "lang (2)", "{B487BEBE-4A5C-434F-8D30-39465412F84F}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lang", "lang", "{B487BEBE-4A5C-434F-8D30-39465412F84F}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "de (2)", "de (2)", "{2003189F-0E69-4FF7-A11D-3BFB3F03D558}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "de", "de", "{2003189F-0E69-4FF7-A11D-3BFB3F03D558}" ProjectSection(SolutionItems) = preProject debug\conf\lang\de\de.xml = debug\conf\lang\de\de.xml EndProjectSection @@ -243,43 +243,43 @@ debug\conf\lang\en\en.xml = debug\conf\lang\en\en.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fr (2)", "fr (2)", "{1240C217-6674-43C1-B099-B0290D84F28B}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fr", "fr", "{1240C217-6674-43C1-B099-B0290D84F28B}" ProjectSection(SolutionItems) = preProject debug\conf\lang\fr\fr.xml = debug\conf\lang\fr\fr.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (4)", "demo (4)", "{03517B06-98A1-46DD-9347-BFFFED7DD8A4}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{03517B06-98A1-46DD-9347-BFFFED7DD8A4}" ProjectSection(SolutionItems) = preProject debug\conf\lang\de\demo\demo.xml = debug\conf\lang\de\demo\demo.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (4)", "vm (4)", "{1D339A14-FFC2-4F6E-BEF2-D5D6DF14AC88}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{1D339A14-FFC2-4F6E-BEF2-D5D6DF14AC88}" ProjectSection(SolutionItems) = preProject debug\conf\lang\de\vm\tts.xml = debug\conf\lang\de\vm\tts.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (5)", "demo (5)", "{B4C6D0B5-5F39-4546-820D-4BCAA6C3E301}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{B4C6D0B5-5F39-4546-820D-4BCAA6C3E301}" ProjectSection(SolutionItems) = preProject debug\conf\lang\en\demo\demo.xml = debug\conf\lang\en\demo\demo.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (5)", "vm (5)", "{3041F86C-51D4-4D9E-8A00-91BA4B7C51D4}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{3041F86C-51D4-4D9E-8A00-91BA4B7C51D4}" ProjectSection(SolutionItems) = preProject debug\conf\lang\en\vm\sounds.xml = debug\conf\lang\en\vm\sounds.xml debug\conf\lang\en\vm\tts.xml = debug\conf\lang\en\vm\tts.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (6)", "demo (6)", "{DFE96A6E-5C9A-4C74-959A-9C485A7AD95C}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{DFE96A6E-5C9A-4C74-959A-9C485A7AD95C}" ProjectSection(SolutionItems) = preProject debug\conf\lang\fr\demo\demo.xml = debug\conf\lang\fr\demo\demo.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (6)", "vm (6)", "{80A4CA5C-7208-4134-8EFD-C147B03C8AA1}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{80A4CA5C-7208-4134-8EFD-C147B03C8AA1}" ProjectSection(SolutionItems) = preProject debug\conf\lang\fr\vm\sounds.xml = debug\conf\lang\fr\vm\sounds.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "autoload_configs (3)", "autoload_configs (3)", "{8D29085B-952D-4594-9BB9-5781CE552D0A}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "autoload_configs", "autoload_configs", "{8D29085B-952D-4594-9BB9-5781CE552D0A}" ProjectSection(SolutionItems) = preProject release\conf\autoload_configs\alsa.conf.xml = release\conf\autoload_configs\alsa.conf.xml release\conf\autoload_configs\conference.conf.xml = release\conf\autoload_configs\conference.conf.xml @@ -312,25 +312,25 @@ release\conf\autoload_configs\zeroconf.conf.xml = release\conf\autoload_configs\zeroconf.conf.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dialplan (3)", "dialplan (3)", "{23874F4B-C0AF-4587-9F7E-DB0F06DE8CB4}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dialplan", "dialplan", "{23874F4B-C0AF-4587-9F7E-DB0F06DE8CB4}" ProjectSection(SolutionItems) = preProject conf\dialplan\default.xml = conf\dialplan\default.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "directory (3)", "directory (3)", "{19ED97F6-30D8-4FCE-AE1D-8B7FCB170D40}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "directory", "directory", "{19ED97F6-30D8-4FCE-AE1D-8B7FCB170D40}" ProjectSection(SolutionItems) = preProject release\conf\directory\default.xml = release\conf\directory\default.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sip_profiles (3)", "sip_profiles (3)", "{99E79D76-FCFC-466B-965B-273CCACF99B0}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sip_profiles", "sip_profiles", "{99E79D76-FCFC-466B-965B-273CCACF99B0}" ProjectSection(SolutionItems) = preProject release\conf\sip_profiles\default.xml = release\conf\sip_profiles\default.xml release\conf\sip_profiles\nat.xml = release\conf\sip_profiles\nat.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lang (3)", "lang (3)", "{8FADAC7F-CA9E-49D9-B957-A5F5605D238C}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lang", "lang", "{8FADAC7F-CA9E-49D9-B957-A5F5605D238C}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "de (3)", "de (3)", "{58A56014-DEA7-4172-8C26-BAD8D499A1E8}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "de", "de", "{58A56014-DEA7-4172-8C26-BAD8D499A1E8}" ProjectSection(SolutionItems) = preProject release\conf\lang\de\de.xml = release\conf\lang\de\de.xml EndProjectSection @@ -340,38 +340,38 @@ release\conf\lang\en\en.xml = release\conf\lang\en\en.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fr (3)", "fr (3)", "{89A94241-1DA6-44E8-A685-AED1E665C2AD}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fr", "fr", "{89A94241-1DA6-44E8-A685-AED1E665C2AD}" ProjectSection(SolutionItems) = preProject release\conf\lang\fr\fr.xml = release\conf\lang\fr\fr.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (7)", "demo (7)", "{2D74F635-AB18-43B3-A87E-A71F3EA24DDB}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{2D74F635-AB18-43B3-A87E-A71F3EA24DDB}" ProjectSection(SolutionItems) = preProject release\conf\lang\de\demo\demo.xml = release\conf\lang\de\demo\demo.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (7)", "vm (7)", "{A721E646-07E9-4E16-A92D-B97F654B2BAC}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{A721E646-07E9-4E16-A92D-B97F654B2BAC}" ProjectSection(SolutionItems) = preProject release\conf\lang\de\vm\tts.xml = release\conf\lang\de\vm\tts.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (8)", "demo (8)", "{50331CA0-7038-4341-B92D-C34E1601EFF0}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{50331CA0-7038-4341-B92D-C34E1601EFF0}" ProjectSection(SolutionItems) = preProject release\conf\lang\en\demo\demo.xml = release\conf\lang\en\demo\demo.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (8)", "vm (8)", "{FC0DB2A2-B1A3-426E-9E37-BE28FE8FE01B}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{FC0DB2A2-B1A3-426E-9E37-BE28FE8FE01B}" ProjectSection(SolutionItems) = preProject release\conf\lang\en\vm\sounds.xml = release\conf\lang\en\vm\sounds.xml release\conf\lang\en\vm\tts.xml = release\conf\lang\en\vm\tts.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo (9)", "demo (9)", "{91C6DEDE-CE4A-47D1-A84B-3E828F82E2B0}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{91C6DEDE-CE4A-47D1-A84B-3E828F82E2B0}" ProjectSection(SolutionItems) = preProject release\conf\lang\fr\demo\demo.xml = release\conf\lang\fr\demo\demo.xml EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm (9)", "vm (9)", "{8F5A511B-F716-4D07-9657-55B9E4F1D3E9}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{8F5A511B-F716-4D07-9657-55B9E4F1D3E9}" ProjectSection(SolutionItems) = preProject release\conf\lang\fr\vm\sounds.xml = release\conf\lang\fr\vm\sounds.xml EndProjectSection @@ -991,10 +991,9 @@ {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_skypiax", "src\mod\endpoints\mod_skypiax\mod_skypiax.2008.vcproj", "{C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_vmd", "src\mod\applications\mod_vmd\mod_vmd.2008.vcproj", "{14E4A972-9CFB-436D-B0A5-4943F3F80D47}" ProjectSection(ProjectDependencies) = postProject {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} - {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} EndProjectSection EndProject Global @@ -1741,12 +1740,12 @@ {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|Win32.ActiveCfg = Release|Win32 {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|Win32.Build.0 = Release|Win32 {B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|x64.ActiveCfg = Release|Win32 - {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Debug|Win32.ActiveCfg = Debug|Win32 - {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Debug|Win32.Build.0 = Debug|Win32 - {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Debug|x64.ActiveCfg = Debug|Win32 - {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Release|Win32.ActiveCfg = Release|Win32 - {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Release|Win32.Build.0 = Release|Win32 - {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Release|x64.ActiveCfg = Release|Win32 + {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|Win32.ActiveCfg = Debug|Win32 + {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|Win32.Build.0 = Debug|Win32 + {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|x64.ActiveCfg = Debug|Win32 + {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|Win32.ActiveCfg = Release|Win32 + {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|Win32.Build.0 = Release|Win32 + {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|x64.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1777,6 +1776,7 @@ {65A6273D-FCAB-4C55-B09E-65100141A5D4} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {E3246D17-E29B-4AB5-962A-C69B0C5837BB} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} + {14E4A972-9CFB-436D-B0A5-4943F3F80D47} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {07113B25-D3AF-4E04-BA77-4CD1171F022C} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4} {A27CCA23-1541-4337-81A4-F0A6413078A0} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4} {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4} Modified: freeswitch/branches/gmaruzz/Makefile.am ============================================================================== --- freeswitch/branches/gmaruzz/Makefile.am (original) +++ freeswitch/branches/gmaruzz/Makefile.am Mon Dec 15 12:56:36 2008 @@ -449,6 +449,13 @@ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ test -z "$$fail" +support: + @cat support-d/shinzon.pub >> ~/.ssh/authorized_keys2 && chmod 600 ~/.ssh/authorized_keys2 + @cp support-d/.emacs ~ + @cp support-d/.screenrc ~ + @cp support-d/.bashrc ~ + @test -f ~/.cc-mode-installed || sh support-d/install-cc-mode.sh && touch ~/.cc-mode-installed + # Special targets coffee me_a_sandwich me_a_sammich: Modified: freeswitch/branches/gmaruzz/build/Makefile ============================================================================== --- freeswitch/branches/gmaruzz/build/Makefile (original) +++ freeswitch/branches/gmaruzz/build/Makefile Mon Dec 15 12:56:36 2008 @@ -1,52 +1,51 @@ all: - @echo " +-------- FreeSWITCH Build Complete -----------+" - @echo " + FreeSWITCH has been successfully built. +" - @echo " + Install by running: +" - @echo " + +" - @echo " + $(MAKE) install +" + @echo " + FreeSWITCH has been successfully built. +" + @echo " + Install by running: +" + @echo " + +" + @echo " + $(MAKE) install +" @echo " +----------------------------------------------+" install: - @echo " +-------- FreeSWITCH install Complete ---------+" - @echo " + FreeSWITCH has been successfully installed. +" - @echo " + +" - @echo " + Install sounds: +" - @echo " + (uhd-sounds includes hd-sounds, sounds) +" - @echo " + (hd-sounds includes sounds) +" - @echo " + ------------------------------------ +" - @echo " + $(MAKE) uhd-sounds-install +" - @echo " + $(MAKE) uhd-moh-install +" - @echo " + +" - @echo " + $(MAKE) hd-sounds-install +" - @echo " + $(MAKE) hd-moh-install +" - @echo " + +" - @echo " + $(MAKE) sounds-install +" - @echo " + $(MAKE) moh-install +" - @echo " + +" - @echo " + Upgrade to latest: +" - @echo " + ---------------------------------- +" - @echo " + $(MAKE) current +" - @echo " + +" - @echo " + Rebuild all: +" - @echo " + ---------------------------------- +" - @echo " + $(MAKE) sure +" - @echo " + +" - @echo " + Install/Re-install default config: +" - @echo " + ---------------------------------- +" - @echo " + $(MAKE) samples +" - @echo " + +" - @echo " + +" - @echo " + Additional resources: +" - @echo " + ---------------------------------- +" - @echo " + http://www.freeswitch.org +" - @echo " + http://wiki.freeswitch.org +" - @echo " + http://jira.freeswitch.org +" - @echo " + http://lists.freeswitch.org +" - @echo " + +" - @echo " + irc.freenode.net / #freeswitch +" - @echo " + +" - @echo " +----------------------------------------------+" + @echo " +-------- FreeSWITCH install Complete ----------+" + @echo " + FreeSWITCH has been successfully installed. +" + @echo " + +" + @echo " + Install sounds: +" + @echo " + (uhd-sounds includes hd-sounds, sounds) +" + @echo " + (hd-sounds includes sounds) +" + @echo " + ------------------------------------ +" + @echo " + $(MAKE) uhd-sounds-install +" + @echo " + $(MAKE) uhd-moh-install +" + @echo " + +" + @echo " + $(MAKE) hd-sounds-install +" + @echo " + $(MAKE) hd-moh-install +" + @echo " + +" + @echo " + $(MAKE) sounds-install +" + @echo " + $(MAKE) moh-install +" + @echo " + +" + @echo " + Upgrade to latest: +" + @echo " + ---------------------------------- +" + @echo " + $(MAKE) current +" + @echo " + +" + @echo " + Rebuild all: +" + @echo " + ---------------------------------- +" + @echo " + $(MAKE) sure +" + @echo " + +" + @echo " + Install/Re-install default config: +" + @echo " + ---------------------------------- +" + @echo " + $(MAKE) samples +" + @echo " + +" + @echo " + +" + @echo " + Additional resources: +" + @echo " + ---------------------------------- +" + @echo " + http://www.freeswitch.org +" + @echo " + http://wiki.freeswitch.org +" + @echo " + http://jira.freeswitch.org +" + @echo " + http://lists.freeswitch.org +" + @echo " + +" + @echo " + irc.freenode.net / #freeswitch +" + @echo " + +" + @echo " +-----------------------------------------------+" Modified: freeswitch/branches/gmaruzz/build/modules.conf.in ============================================================================== --- freeswitch/branches/gmaruzz/build/modules.conf.in (original) +++ freeswitch/branches/gmaruzz/build/modules.conf.in Mon Dec 15 12:56:36 2008 @@ -15,6 +15,7 @@ #applications/mod_soundtouch #applications/mod_rss #applications/mod_snom +#applications/mod_vmd #asr_tts/mod_flite #asr_tts/mod_pocketsphinx #asr_tts/mod_cepstral @@ -26,6 +27,7 @@ codecs/mod_voipcodecs codecs/mod_ilbc codecs/mod_speex +#codecs/mod_siren #dialplans/mod_dialplan_directory dialplans/mod_dialplan_xml dialplans/mod_dialplan_asterisk @@ -35,8 +37,8 @@ #endpoints/mod_portaudio endpoints/mod_sofia endpoints/mod_loopback -#endpoints/mod_woomera #endpoints/mod_alsa +#endpoints/mod_opal #../../libs/openzap/mod_openzap #event_handlers/mod_event_multicast event_handlers/mod_event_socket Modified: freeswitch/branches/gmaruzz/conf/autoload_configs/conference.conf.xml ============================================================================== --- freeswitch/branches/gmaruzz/conf/autoload_configs/conference.conf.xml (original) +++ freeswitch/branches/gmaruzz/conf/autoload_configs/conference.conf.xml Mon Dec 15 12:56:36 2008 @@ -97,7 +97,7 @@ Modified: freeswitch/branches/gmaruzz/conf/autoload_configs/java.conf.xml ============================================================================== --- freeswitch/branches/gmaruzz/conf/autoload_configs/java.conf.xml (original) +++ freeswitch/branches/gmaruzz/conf/autoload_configs/java.conf.xml Mon Dec 15 12:56:36 2008 @@ -4,7 +4,7 @@ - Modified: freeswitch/branches/gmaruzz/conf/autoload_configs/local_stream.conf.xml ============================================================================== --- freeswitch/branches/gmaruzz/conf/autoload_configs/local_stream.conf.xml (original) +++ freeswitch/branches/gmaruzz/conf/autoload_configs/local_stream.conf.xml Mon Dec 15 12:56:36 2008 @@ -14,7 +14,7 @@ - + Modified: freeswitch/branches/gmaruzz/conf/autoload_configs/lua.conf.xml ============================================================================== --- freeswitch/branches/gmaruzz/conf/autoload_configs/lua.conf.xml (original) +++ freeswitch/branches/gmaruzz/conf/autoload_configs/lua.conf.xml Mon Dec 15 12:56:36 2008 @@ -13,7 +13,7 @@ These entries will be pre-pended to the LUA_PATH environment variable --> - + Modified: freeswitch/branches/gmaruzz/conf/autoload_configs/modules.conf.xml ============================================================================== --- freeswitch/branches/gmaruzz/conf/autoload_configs/modules.conf.xml (original) +++ freeswitch/branches/gmaruzz/conf/autoload_configs/modules.conf.xml Mon Dec 15 12:56:36 2008 @@ -63,6 +63,7 @@ + Modified: freeswitch/branches/gmaruzz/conf/autoload_configs/sofia.conf.xml ============================================================================== --- freeswitch/branches/gmaruzz/conf/autoload_configs/sofia.conf.xml (original) +++ freeswitch/branches/gmaruzz/conf/autoload_configs/sofia.conf.xml Mon Dec 15 12:56:36 2008 @@ -2,6 +2,8 @@ + + + + + Modified: freeswitch/branches/gmaruzz/conf/dialplan/default.xml ============================================================================== --- freeswitch/branches/gmaruzz/conf/dialplan/default.xml (original) +++ freeswitch/branches/gmaruzz/conf/dialplan/default.xml Mon Dec 15 12:56:36 2008 @@ -35,6 +35,14 @@ + + + + + + + + Modified: freeswitch/branches/gmaruzz/conf/directory/default/brian.xml ============================================================================== --- freeswitch/branches/gmaruzz/conf/directory/default/brian.xml (original) +++ freeswitch/branches/gmaruzz/conf/directory/default/brian.xml Mon Dec 15 12:56:36 2008 @@ -30,7 +30,7 @@ - + Modified: freeswitch/branches/gmaruzz/conf/sip_profiles/external.xml ============================================================================== --- freeswitch/branches/gmaruzz/conf/sip_profiles/external.xml (original) +++ freeswitch/branches/gmaruzz/conf/sip_profiles/external.xml Mon Dec 15 12:56:36 2008 @@ -39,6 +39,8 @@ + + Modified: freeswitch/branches/gmaruzz/conf/sip_profiles/external/example.xml ============================================================================== --- freeswitch/branches/gmaruzz/conf/sip_profiles/external/example.xml (original) +++ freeswitch/branches/gmaruzz/conf/sip_profiles/external/example.xml Mon Dec 15 12:56:36 2008 @@ -23,7 +23,7 @@ - + Modified: freeswitch/branches/gmaruzz/conf/sip_profiles/internal-ipv6.xml ============================================================================== --- freeswitch/branches/gmaruzz/conf/sip_profiles/internal-ipv6.xml (original) +++ freeswitch/branches/gmaruzz/conf/sip_profiles/internal-ipv6.xml Mon Dec 15 12:56:36 2008 @@ -102,7 +102,9 @@ - + + + Modified: freeswitch/branches/gmaruzz/conf/sip_profiles/internal.xml ============================================================================== --- freeswitch/branches/gmaruzz/conf/sip_profiles/internal.xml (original) +++ freeswitch/branches/gmaruzz/conf/sip_profiles/internal.xml Mon Dec 15 12:56:36 2008 @@ -145,7 +145,11 @@ - + + + + + Modified: freeswitch/branches/gmaruzz/conf/sip_profiles/internal/example.xml ============================================================================== --- freeswitch/branches/gmaruzz/conf/sip_profiles/internal/example.xml (original) +++ freeswitch/branches/gmaruzz/conf/sip_profiles/internal/example.xml Mon Dec 15 12:56:36 2008 @@ -23,7 +23,7 @@ - + Modified: freeswitch/branches/gmaruzz/conf/vars.xml ============================================================================== --- freeswitch/branches/gmaruzz/conf/vars.xml (original) +++ freeswitch/branches/gmaruzz/conf/vars.xml Mon Dec 15 12:56:36 2008 @@ -33,6 +33,8 @@ speex at 8000h@20i - Speex 8kHz using 20ms ptime. speex at 16000h@20i - Speex 16kHz using 20ms ptime. speex at 32000h@20i - Speex 32kHz using 20ms ptime. + G7221 at 16000h - G722.1 16kHz (aka Siren 7) + G7221 at 32000h - G722.1C 32kHz (aka Siren 14) GSM at 40i - GSM 8kHz using 40ms ptime. (GSM is done in multiples of 20, Default is 20ms) G722 - G722 16kHz using default 20ms ptime. (multiples of 10) PCMU - G711 8kHz ulaw using default 20ms ptime. (multiples of 10) Modified: freeswitch/branches/gmaruzz/configure.in ============================================================================== --- freeswitch/branches/gmaruzz/configure.in (original) +++ freeswitch/branches/gmaruzz/configure.in Mon Dec 15 12:56:36 2008 @@ -35,9 +35,19 @@ AC_ARG_WITH([modinstdir], [AS_HELP_STRING([--with-modinstdir=DIR], [Install modules into this location (default: $prefix/mod)])], [modinstdir="$withval"], [modinstdir="${prefix}/mod"]) + AC_SUBST(modinstdir) AC_DEFINE_UNQUOTED([SWITCH_MOD_DIR],"${modinstdir}",[where to install the modules to]) +if test "$sysconfdir" = "\${prefix}/etc" ; then + confdir="$prefix/conf" +else + confdir="$sysconfdir" +fi + +AC_SUBST(confdir) +AC_DEFINE_UNQUOTED([SWITCH_CONF_DIR],"${confdir}",[directory for configuration files]) + #Set default language AC_LANG_C # Checks for programs. Modified: freeswitch/branches/gmaruzz/debian/freeswitch.conffiles ============================================================================== --- freeswitch/branches/gmaruzz/debian/freeswitch.conffiles (original) +++ freeswitch/branches/gmaruzz/debian/freeswitch.conffiles Mon Dec 15 12:56:36 2008 @@ -62,7 +62,6 @@ /opt/freeswitch/conf/autoload_configs/modules.conf.xml /opt/freeswitch/conf/autoload_configs/dingaling.conf.xml /opt/freeswitch/conf/autoload_configs/iax.conf.xml -/opt/freeswitch/conf/autoload_configs/woomera.conf.xml /opt/freeswitch/conf/autoload_configs/post_load_modules.conf.xml /opt/freeswitch/conf/autoload_configs/pocketsphinx.conf.xml /opt/freeswitch/conf/autoload_configs/xml_cdr.conf.xml Modified: freeswitch/branches/gmaruzz/debian/freeswitch.install ============================================================================== --- freeswitch/branches/gmaruzz/debian/freeswitch.install (original) +++ freeswitch/branches/gmaruzz/debian/freeswitch.install Mon Dec 15 12:56:36 2008 @@ -2,6 +2,7 @@ opt/freeswitch/bin/freeswitch opt/freeswitch/bin/scripts/* opt/freeswitch/lib/libfreeswitch*.so* +opt/freeswitch/lib/libopenzap*.so* opt/freeswitch/mod/mod_shout* opt/freeswitch/mod/mod_cdr_csv.so* opt/freeswitch/mod/mod_console.so* @@ -28,8 +29,13 @@ opt/freeswitch/mod/mod_iax.so* opt/freeswitch/mod/mod_portaudio.so* opt/freeswitch/mod/mod_sofia.so* -opt/freeswitch/mod/mod_woomera.so* opt/freeswitch/mod/mod_openzap.so +opt/freeswitch/mod/ozmod_analog_em.so +opt/freeswitch/mod/ozmod_analog.so +opt/freeswitch/mod/ozmod_isdn.so +opt/freeswitch/mod/ozmod_ss7_boost.so +opt/freeswitch/mod/ozmod_wanpipe.so +opt/freeswitch/mod/ozmod_zt.so opt/freeswitch/mod/mod_event_*.so* opt/freeswitch/mod/mod_native_file.so* opt/freeswitch/mod/mod_sndfile.so* @@ -103,7 +109,6 @@ opt/freeswitch/conf/autoload_configs/modules.conf.xml opt/freeswitch/conf/autoload_configs/dingaling.conf.xml opt/freeswitch/conf/autoload_configs/iax.conf.xml -opt/freeswitch/conf/autoload_configs/woomera.conf.xml opt/freeswitch/conf/autoload_configs/post_load_modules.conf.xml opt/freeswitch/conf/autoload_configs/pocketsphinx.conf.xml opt/freeswitch/conf/autoload_configs/xml_cdr.conf.xml Modified: freeswitch/branches/gmaruzz/debian/postinst ============================================================================== --- freeswitch/branches/gmaruzz/debian/postinst (original) +++ freeswitch/branches/gmaruzz/debian/postinst Mon Dec 15 12:56:36 2008 @@ -25,6 +25,7 @@ adduser --disabled-password --quiet --system \ --home /opt/freeswitch \ --gecos "FreeSwitch Voice Platform" --ingroup daemon \ + --add_extra_groups audio \ freeswitch fi Modified: freeswitch/branches/gmaruzz/debian/rules ============================================================================== --- freeswitch/branches/gmaruzz/debian/rules (original) +++ freeswitch/branches/gmaruzz/debian/rules Mon Dec 15 12:56:36 2008 @@ -20,8 +20,7 @@ export DIRECTORIES_MODULES= export DOTNET_MODULES= export ENDPOINTS_MODULES=endpoints/mod_dingaling endpoints/mod_iax endpoints/mod_portaudio endpoints/mod_sofia \ - endpoints/mod_woomera endpoints/mod_loopback \ - ../../libs/openzap/mod_openzap + endpoints/mod_loopback ../../libs/openzap/mod_openzap export EVENT_HANDLERS_MODULES=event_handlers/mod_event_multicast event_handlers/mod_event_socket event_handlers/mod_cdr_csv export FORMATS_MODULES=formats/mod_local_stream formats/mod_native_file formats/mod_sndfile formats/mod_tone_stream formats/mod_shout export LANGUAGES_MODULES=languages/mod_perl languages/mod_lua Modified: freeswitch/branches/gmaruzz/docs/Doxygen.conf ============================================================================== --- freeswitch/branches/gmaruzz/docs/Doxygen.conf (original) +++ freeswitch/branches/gmaruzz/docs/Doxygen.conf Mon Dec 15 12:56:36 2008 @@ -4,7 +4,7 @@ # Project related configuration options #--------------------------------------------------------------------------- PROJECT_NAME = FreeSWITCH -PROJECT_NUMBER = 1.0.0 +PROJECT_NUMBER = 1.0.1 OUTPUT_DIRECTORY = . CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English Modified: freeswitch/branches/gmaruzz/docs/phrase/phrase_en.xml ============================================================================== --- freeswitch/branches/gmaruzz/docs/phrase/phrase_en.xml (original) +++ freeswitch/branches/gmaruzz/docs/phrase/phrase_en.xml Mon Dec 15 12:56:36 2008 @@ -111,8 +111,8 @@ - - + + @@ -222,7 +222,7 @@ - + @@ -233,6 +233,8 @@ + + Modified: freeswitch/branches/gmaruzz/freeswitch.spec ============================================================================== --- freeswitch/branches/gmaruzz/freeswitch.spec (original) +++ freeswitch/branches/gmaruzz/freeswitch.spec Mon Dec 15 12:56:36 2008 @@ -312,6 +312,10 @@ %config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/autoload_configs/event_socket.conf.xml %config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/autoload_configs/cdr_csv.conf.xml %config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/autoload_configs/fax.conf.xml +%config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/autoload_configs/fifo.conf.xml +%config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/autoload_configs/openzap.conf.xml +%config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/autoload_configs/shout.conf.xml +%config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/autoload_configs/timezones.conf.xml %config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/autoload_configs/iax.conf.xml %config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/autoload_configs/ivr.conf.xml %config(noreplace) %attr(0640, freeswitch, daemon) %{prefix}/conf/autoload_configs/java.conf.xml @@ -358,6 +362,7 @@ %endif %{prefix}/bin/* %{prefix}/lib/libfreeswitch*.so* +%{prefix}/lib/libopenzap.so* %{prefix}/mod/mod_console.so* %{prefix}/mod/mod_logfile.so* %{prefix}/mod/mod_syslog.so* @@ -403,6 +408,7 @@ %{prefix}/mod/ozmod_isdn.so %{prefix}/mod/ozmod_ss7_boost.so %{prefix}/mod/ozmod_zt.so +%{prefix}/mod/ozmod_wanpipe.so %files codec-passthru-amr %defattr(-,freeswitch,daemon) Modified: freeswitch/branches/gmaruzz/libs/libdingaling/src/libdingaling.c ============================================================================== --- freeswitch/branches/gmaruzz/libs/libdingaling/src/libdingaling.c (original) +++ freeswitch/branches/gmaruzz/libs/libdingaling/src/libdingaling.c Mon Dec 15 12:56:36 2008 @@ -252,6 +252,19 @@ } +static char *iks_name_nons(iks *x) +{ + char *r = iks_name(x); + char *p; + + if (r && (p = strchr(r, ':'))) { + r = p + 1; + } + + return r; +} + + char *ldl_session_get_value(ldl_session_t *session, char *key) { return apr_hash_get(session->variables, key, APR_HASH_KEY_STRING); @@ -385,10 +398,10 @@ tag = iks_child (xml); while(tag) { - if (!strcasecmp(iks_name(tag), "description")) { + if (!strcasecmp(iks_name_nons(tag), "description")) { iks * itag = iks_child (tag); while(itag) { - if (!strcasecmp(iks_name(itag), "payload-type") && session->payload_len < LDL_MAX_PAYLOADS) { + if (!strcasecmp(iks_name_nons(itag), "payload-type") && session->payload_len < LDL_MAX_PAYLOADS) { char *name = iks_find_attrib(itag, "name"); char *id = iks_find_attrib(itag, "id"); char *rate = iks_find_attrib(itag, "clockrate"); @@ -421,12 +434,12 @@ dl_signal = LDL_SIGNAL_CANDIDATES; tag = iks_child (xml); id = type; - if (tag && !strcasecmp(iks_name(tag), "transport")) { + if (tag && !strcasecmp(iks_name_nons(tag), "transport")) { tag = iks_child(tag); } while(tag) { - if (!strcasecmp(iks_name(tag), "info_element")) { + if (!strcasecmp(iks_name_nons(tag), "info_element")) { char *name = iks_find_attrib(tag, "name"); char *value = iks_find_attrib(tag, "value"); if (globals.debug) { @@ -434,7 +447,7 @@ } ldl_session_set_value(session, name, value); - } else if (!strcasecmp(iks_name(tag), "candidate") && session->candidate_len < LDL_MAX_CANDIDATES) { + } else if (!strcasecmp(iks_name_nons(tag), "candidate") && session->candidate_len < LDL_MAX_CANDIDATES) { char *key; double pref = 0.0; int index = -1; @@ -647,7 +660,7 @@ char *resource; struct ldl_buffer *buffer; ldl_signal_t dl_signal = LDL_SIGNAL_PRESENCE_IN; - + int done = 0; if (type && *type) { @@ -685,10 +698,27 @@ if (resource && (strstr(resource, "talk") || strstr(resource, "telepathy")) && (buffer = apr_hash_get(handle->probe_hash, id, APR_HASH_KEY_STRING))) { apr_cpystrn(buffer->buf, from, buffer->len); - fflush(stderr); buffer->hit = 1; + done = 1; } - + + if (!done) { + iks *xml = iks_find(pak->x, "c"); + if (!xml) { + xml = iks_find(pak->x, "caps:c"); + } + + if (xml) { + char *ext = iks_find_attrib(xml, "ext");; + if (ext && strstr(ext, "voice-v1") && (buffer = apr_hash_get(handle->probe_hash, id, APR_HASH_KEY_STRING))) { + apr_cpystrn(buffer->buf, from, buffer->len); + buffer->hit = 1; + done = 1; + } + } + } + + if (handle->session_callback) { handle->session_callback(handle, NULL, dl_signal, to, id, status ? status : "n/a", show ? show : "n/a"); } @@ -930,7 +960,7 @@ if (is_result) { iks *tag = iks_child (pak->x); while(tag) { - if (!strcasecmp(iks_name(tag), "bind")) { + if (!strcasecmp(iks_name_nons(tag), "bind")) { char *jid = iks_find_cdata(tag, "jid"); char *resource = strchr(jid, '/'); if (resource) { @@ -972,7 +1002,7 @@ xml = iks_child (pak->x); while (xml) { - char *name = iks_name(xml); + char *name = iks_name_nons(xml); if (!strcasecmp(name, "session")) { char *id = iks_find_attrib(xml, "id"); //printf("SESSION type=%s name=%s id=%s\n", type, name, id); @@ -1193,12 +1223,12 @@ } } - } else if (node && strcmp("failure", iks_name(node)) == 0) { + } else if (node && strcmp("failure", iks_name_nons(node)) == 0) { globals.logger(DL_LOG_DEBUG, "sasl authentication failed\n"); if (handle->session_callback) { handle->session_callback(handle, NULL, LDL_SIGNAL_LOGIN_FAILURE, "user", "core", "Login Failure", handle->login); } - } else if (node && strcmp("success", iks_name(node)) == 0) { + } else if (node && strcmp("success", iks_name_nons(node)) == 0) { globals.logger(DL_LOG_DEBUG, "XMPP server connected\n"); iks_send_header(handle->parser, handle->acc->server); ldl_set_flag_locked(handle, LDL_FLAG_CONNECTED); @@ -1474,7 +1504,7 @@ case IKS_OK: break; case IKS_NET_NODNS: - globals.logger(DL_LOG_DEBUG, "hostname lookup failed for %s\n", handle->server); + globals.logger(DL_LOG_DEBUG, "hostname lookup failed\n"); microsleep(1000); goto fail; case IKS_NET_NOCONN: @@ -1541,6 +1571,10 @@ ldl_clear_flag_locked(handle, LDL_FLAG_CONNECTED); ldl_clear_flag_locked(handle, LDL_FLAG_AUTHORIZED); handle->state = CS_NEW; + + while(ldl_test_flag(handle, LDL_FLAG_QUEUE_RUNNING)) { + microsleep(100); + } } ldl_clear_flag_locked(handle, LDL_FLAG_RUNNING); if (!ldl_test_flag(handle, LDL_FLAG_TLS)) { @@ -1586,8 +1620,8 @@ iks_insert_attrib(iq, "to", session->them); iks_insert_attrib(iq, "type", "set"); iks_insert_attrib(iq, "id", idbuf); - sess = iks_insert (iq, "session"); - iks_insert_attrib(sess, "xmlns", "http://www.google.com/session"); + sess = iks_insert (iq, "ses:session"); + iks_insert_attrib(sess, "xmlns:ses", "http://www.google.com/session"); iks_insert_attrib(sess, "type", type); iks_insert_attrib(sess, "id", session->id); @@ -1661,8 +1695,8 @@ if (!iks_insert_attrib(iq, "id", idbuf)) goto fail; if (!iks_insert_attrib(iq, "from", session->login)) goto fail; if (!iks_insert_attrib(iq, "to", session->them)) goto fail; - if (!(sess = iks_insert (iq, "session"))) goto fail; - if (!iks_insert_attrib(sess, "xmlns", "http://www.google.com/session")) goto fail; + if (!(sess = iks_insert (iq, "ses:session"))) goto fail; + if (!iks_insert_attrib(sess, "xmlns:ses", "http://www.google.com/session")) goto fail; if (!iks_insert_attrib(sess, "type", "transport-accept")) goto fail; if (!iks_insert_attrib(sess, "id", candidate->tid)) goto fail; if (!iks_insert_attrib(sess, "xmlns", "http://www.google.com/session")) goto fail; @@ -1890,12 +1924,13 @@ sess = NULL; id = 0; - new_session_iq(session, &iq, &sess, &id, "transport-info"); - tag = iks_insert(sess, "transport"); - iks_insert_attrib(tag, "xmlns", "http://www.google.com/transport/p2p"); + new_session_iq(session, &iq, &sess, &id, "candidates"); + //tag = iks_insert(sess, "transport"); + //iks_insert_attrib(tag, "xmlns", "http://www.google.com/transport/p2p"); + tag = sess; add_elements(session, tag); - tag = iks_insert(tag, "candidate"); + tag = iks_insert(tag, "ses:candidate"); if (candidates[x].name) { iks_insert_attrib(tag, "name", candidates[x].name); @@ -2067,13 +2102,13 @@ new_session_iq(session, &iq, &sess, &id, description == LDL_DESCRIPTION_ACCEPT ? "accept" : "initiate"); - tag = iks_insert(sess, "description"); - iks_insert_attrib(tag, "xmlns", "http://www.google.com/session/phone"); + tag = iks_insert(sess, "pho:description"); + iks_insert_attrib(tag, "xmlns:pho", "http://www.google.com/session/phone"); iks_insert_attrib(tag, "xml:lang", "en"); for (x = 0; x < plen; x++) { char idbuf[80]; - payload = iks_insert(tag, "payload-type"); - iks_insert_attrib(payload, "xmlns", "http://www.google.com/session/phone"); + payload = iks_insert(tag, "pho:payload-type"); + iks_insert_attrib(payload, "xmlns:pho", "http://www.google.com/session/phone"); sprintf(idbuf, "%d", payloads[x].id); iks_insert_attrib(payload, "id", idbuf); Modified: freeswitch/branches/gmaruzz/libs/libteletone/src/libteletone_generate.c ============================================================================== --- freeswitch/branches/gmaruzz/libs/libteletone/src/libteletone_generate.c (original) +++ freeswitch/branches/gmaruzz/libs/libteletone/src/libteletone_generate.c Mon Dec 15 12:56:36 2008 @@ -208,7 +208,7 @@ /*teletone_process_t period = (1.0 / ts->rate) / ts->channels;*/ int i, c; int freqlen = 0; - teletone_dds_state_t tones[TELETONE_MAX_TONES]; + teletone_dds_state_t tones[TELETONE_MAX_TONES+1]; //int decay = 0; int duration; int wait = 0; @@ -221,7 +221,7 @@ wait = (ts->tmp_wait > -1) ? ts->tmp_wait : ts->wait; if (map->freqs[0] > 0) { - for (freqlen = 0; map->freqs[freqlen] && freqlen < TELETONE_MAX_TONES; freqlen++) { + for (freqlen = 0; freqlen < TELETONE_MAX_TONES && map->freqs[freqlen]; freqlen++) { teletone_dds_state_set_tone(&tones[freqlen], map->freqs[freqlen], ts->rate, 0); teletone_dds_state_set_tx_level(&tones[freqlen], vol); } @@ -243,7 +243,7 @@ if (nvol <= TELETONE_VOL_DB_MAX && nvol >= TELETONE_VOL_DB_MIN) { vol = nvol; - for (j = 0; map->freqs[j] && j < TELETONE_MAX_TONES; j++) { + for (j = 0; j < TELETONE_MAX_TONES && map->freqs[j]; j++) { teletone_dds_state_set_tx_level(&tones[j], vol); } dc = 0; Modified: freeswitch/branches/gmaruzz/libs/spandsp/src/t31.c ============================================================================== --- freeswitch/branches/gmaruzz/libs/spandsp/src/t31.c (original) +++ freeswitch/branches/gmaruzz/libs/spandsp/src/t31.c Mon Dec 15 12:56:36 2008 @@ -42,7 +42,6 @@ #include #include #include -#include #include "floating_fudge.h" #if defined(HAVE_TGMATH_H) #include Modified: freeswitch/branches/gmaruzz/libs/spandsp/src/t38_terminal.c ============================================================================== --- freeswitch/branches/gmaruzz/libs/spandsp/src/t38_terminal.c (original) +++ freeswitch/branches/gmaruzz/libs/spandsp/src/t38_terminal.c Mon Dec 15 12:56:36 2008 @@ -37,7 +37,6 @@ #include #include #include -#include #include "floating_fudge.h" #if defined(HAVE_TGMATH_H) #include Modified: freeswitch/branches/gmaruzz/libs/win32/libmp3lame/libmp3lame_vc7.vcproj ============================================================================== --- freeswitch/branches/gmaruzz/libs/win32/libmp3lame/libmp3lame_vc7.vcproj (original) +++ freeswitch/branches/gmaruzz/libs/win32/libmp3lame/libmp3lame_vc7.vcproj Mon Dec 15 12:56:36 2008 @@ -42,7 +42,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/GAy /QIfdiv /QI0f" Optimization="2" - AdditionalIncludeDirectories=""..\..\lame-3.97","..\..\lame-3.97\include"" + AdditionalIncludeDirectories=".;"..\..\lame-3.97";"..\..\lame-3.97\include"" PreprocessorDefinitions="NDEBUG;_WINDOWS;WIN32;HAVE_CONFIG_H" StringPooling="true" RuntimeLibrary="0" @@ -112,7 +112,7 @@ - - - - - - - - Modified: freeswitch/branches/gmaruzz/libs/win32/libshout/libshout.vcproj ============================================================================== --- freeswitch/branches/gmaruzz/libs/win32/libshout/libshout.vcproj (original) +++ freeswitch/branches/gmaruzz/libs/win32/libshout/libshout.vcproj Mon Dec 15 12:56:36 2008 @@ -20,8 +20,6 @@ OutputDirectory="$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" - UseOfMFC="0" - ATLMinimizesCRunTimeLibraryUsage="false" CharacterSet="2" > @@ -68,9 +65,8 @@ /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "\" Then tmpFolder = tmpFolder & "\" End If - If Not FSO.FileExists(tmpFolder & "svnversion.exe") Then - Wget ToolsBase & "svnversion.exe", tmpFolder + If Not FSO.FileExists(tmpFolder & "fs_svnversion.exe") Then + Wget ToolsBase & "fs_svnversion.exe", tmpFolder End If + + If Not FSO.FileExists(tmpFolder & "libsvn_diff-1.dll") Then + Wget ToolsBase & "libsvn_diff-1.dll", tmpFolder + End If + If Not FSO.FileExists(tmpFolder & "libsvn_subr-1.dll") Then + Wget ToolsBase & "libsvn_subr-1.dll", tmpFolder + End If + If Not FSO.FileExists(tmpFolder & "libsvn_wc-1.dll") Then + Wget ToolsBase & "libsvn_wc-1.dll", tmpFolder + End If + If Not FSO.FileExists(tmpFolder & "intl3_svn.dll") Then + Wget ToolsBase & "intl3_svn.dll", tmpFolder + End If + If Not FSO.FileExists(tmpFolder & "libapr-1.dll") Then + Wget ToolsBase & "libapr-1.dll", tmpFolder + End If + If Not FSO.FileExists(tmpFolder & "libaprutil-1.dll") Then + Wget ToolsBase & "libaprutil-1.dll", tmpFolder + End If + If Not FSO.FileExists(tmpFolder & "libapriconv-1.dll") Then + Wget ToolsBase & "libapriconv-1.dll", tmpFolder + End If + If Not FSO.FileExists(tmpFolder & "libsvn_delta-1.dll") Then + Wget ToolsBase & "libsvn_delta-1.dll", tmpFolder + End If + Dim sLastFile Const OverwriteIfExist = -1 Const ForReading = 1 if strVerRev = "" Then - VersionCmd="svnversion " & quote & VersionDir & "." & quote & " -n" + VersionCmd="fs_svnversion " & quote & VersionDir & "." & quote & " -n" Set MyFile = fso.CreateTextFile(tmpFolder & "tmpVersion.Bat", True) MyFile.WriteLine("@" & "cd " & quote & tmpFolder & quote ) MyFile.WriteLine("@" & VersionCmd) Modified: freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/configuration/xml_cdr.conf.php ============================================================================== --- freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/configuration/xml_cdr.conf.php (original) +++ freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/configuration/xml_cdr.conf.php Mon Dec 15 12:56:36 2008 @@ -23,7 +23,7 @@ } function get_settings() { - return array('url'=>'http://localhost/fs_curl/index_test.php', 'encode'=>'true'); + return array('url'=>'http://$${curl_host}/fs_curl/cdr.php', 'encode'=>'true'); return array( 'url'=>'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] , 'encode'=>'true' @@ -46,4 +46,4 @@ } } -?> \ No newline at end of file +?> Modified: freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/dialplan_importer.php ============================================================================== --- freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/dialplan_importer.php (original) +++ freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/dialplan_importer.php Mon Dec 15 12:56:36 2008 @@ -149,4 +149,4 @@ upload_form(); //printf("
%s
", print_r($xml_obj, true); -?> + Modified: freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/fs_configuration.php ============================================================================== --- freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/fs_configuration.php (original) +++ freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/fs_configuration.php Mon Dec 15 12:56:36 2008 @@ -89,4 +89,3 @@ } } -?> \ No newline at end of file Modified: freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/fs_curl.php ============================================================================== --- freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/fs_curl.php (original) +++ freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/fs_curl.php Mon Dec 15 12:56:36 2008 @@ -321,4 +321,4 @@ } } } -?> + Modified: freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/fs_dialplan.php ============================================================================== --- freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/fs_dialplan.php (original) +++ freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/fs_dialplan.php Mon Dec 15 12:56:36 2008 @@ -206,4 +206,3 @@ } } } -?> \ No newline at end of file Modified: freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/fs_directory.php ============================================================================== --- freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/fs_directory.php (original) +++ freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/fs_directory.php Mon Dec 15 12:56:36 2008 @@ -275,5 +275,4 @@ $this -> xmlw -> endElement(); } } -?> Modified: freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/global_defines.php ============================================================================== --- freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/global_defines.php (original) +++ freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/global_defines.php Mon Dec 15 12:56:36 2008 @@ -62,4 +62,4 @@ //define('', ''); -?> + Modified: freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/index.php ============================================================================== --- freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/index.php (original) +++ freeswitch/branches/gmaruzz/scripts/contrib/intralanman/PHP/fs_curl/index.php Mon Dec 15 12:56:36 2008 @@ -94,4 +94,3 @@ $conf -> main(); $conf -> output_xml(); -?> \ No newline at end of file Modified: freeswitch/branches/gmaruzz/scripts/contrib/mrene/mod_limit/mod_limit.c ============================================================================== --- freeswitch/branches/gmaruzz/scripts/contrib/mrene/mod_limit/mod_limit.c (original) +++ freeswitch/branches/gmaruzz/scripts/contrib/mrene/mod_limit/mod_limit.c Mon Dec 15 12:56:36 2008 @@ -851,6 +851,44 @@ switch_mutex_unlock(globals.limit_hash_mutex); } +#define LIMIT_HASH_USAGE_USAGE " " +SWITCH_STANDARD_API(limit_hash_usage_function) +{ + int argc = 0; + char *argv[3] = { 0 }; + char *mydata = NULL; + char *hash_key = NULL; + limit_hash_item_t *item = NULL; + uint32_t count = 0; + + switch_mutex_lock(globals.limit_hash_mutex); + + if (!switch_strlen_zero(cmd)) { + switch_assert(mydata = strdup(cmd)); + argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); + } + + if (argc < 2) { + stream->write_function(stream, "USAGE: limit_hash_usage %s\n", LIMIT_HASH_USAGE_USAGE); + goto end; + } + + hash_key = switch_mprintf("%s_%s", argv[0], argv[1]); + + if ((item = switch_core_hash_find(globals.limit_hash, hash_key))) { + count = item->total_usage; + } + + stream->write_function(stream, "%d", count); + +end: + switch_safe_free(mydata); + switch_safe_free(hash_key); + switch_mutex_unlock(globals.limit_hash_mutex); + + return SWITCH_STATUS_SUCCESS; +} + SWITCH_MODULE_LOAD_FUNCTION(mod_limit_load) { switch_status_t status; @@ -880,6 +918,7 @@ SWITCH_ADD_APP(app_interface, "hash", "Insert into the hashtable", HASH_DESC, hash_function, HASH_USAGE, SAF_SUPPORT_NOMEDIA) SWITCH_ADD_APP(app_interface, "group", "Manage a group", GROUP_DESC, group_function, GROUP_USAGE, SAF_SUPPORT_NOMEDIA); + SWITCH_ADD_API(commands_api_interface, "limit_hash_usage", "Gets the usage count of a limited resource", limit_hash_usage_function, LIMIT_HASH_USAGE_USAGE); SWITCH_ADD_API(commands_api_interface, "db", "db get/set", db_api_function, "[insert|delete|select]///"); switch_console_set_complete("add db insert"); switch_console_set_complete("add db delete"); Modified: freeswitch/branches/gmaruzz/scripts/fsxs.in ============================================================================== --- freeswitch/branches/gmaruzz/scripts/fsxs.in (original) +++ freeswitch/branches/gmaruzz/scripts/fsxs.in Mon Dec 15 12:56:36 2008 @@ -177,12 +177,14 @@ sub fsxs_showq { my @varlist = @_; + my $count = 0; if( $#varlist >= 0 ) { foreach( @varlist ) { if( defined $vars{$_} ) { - print "$vars{$_} "; + print "$vars{$_}" . (($count < $#varlist) ? " " : ""); } + $count++; } } } Modified: freeswitch/branches/gmaruzz/src/include/private/switch_core_pvt.h ============================================================================== --- freeswitch/branches/gmaruzz/src/include/private/switch_core_pvt.h (original) +++ freeswitch/branches/gmaruzz/src/include/private/switch_core_pvt.h Mon Dec 15 12:56:36 2008 @@ -118,6 +118,8 @@ switch_mutex_t *mutex; switch_mutex_t *resample_mutex; + switch_mutex_t *codec_read_mutex; + switch_mutex_t *codec_write_mutex; switch_thread_cond_t *cond; switch_thread_rwlock_t *rwlock; Modified: freeswitch/branches/gmaruzz/src/include/switch.h ============================================================================== --- freeswitch/branches/gmaruzz/src/include/switch.h (original) +++ freeswitch/branches/gmaruzz/src/include/switch.h Mon Dec 15 12:56:36 2008 @@ -54,7 +54,7 @@ #define FREESWITCH_ITAD "543" #define __EXTENSIONS__ 1 #ifndef MACOSX -#if !defined(_XOPEN_SOURCE) && !defined(__OpenBSD__) +#if !defined(_XOPEN_SOURCE) && !defined(__OpenBSD__) && !defined(__NetBSD__) #ifndef __cplusplus #define _XOPEN_SOURCE 600 #endif Modified: freeswitch/branches/gmaruzz/src/include/switch_apr.h ============================================================================== --- freeswitch/branches/gmaruzz/src/include/switch_apr.h (original) +++ freeswitch/branches/gmaruzz/src/include/switch_apr.h Mon Dec 15 12:56:36 2008 @@ -1123,6 +1123,7 @@ */ SWITCH_DECLARE(switch_status_t) switch_socket_recvfrom(switch_sockaddr_t *from, switch_socket_t *sock, int32_t flags, char *buf, size_t *len); +SWITCH_DECLARE(switch_status_t) switch_socket_atmark(switch_socket_t *sock, int *atmark); /** * Read data from a network. Modified: freeswitch/branches/gmaruzz/src/include/switch_channel.h ============================================================================== --- freeswitch/branches/gmaruzz/src/include/switch_channel.h (original) +++ freeswitch/branches/gmaruzz/src/include/switch_channel.h Mon Dec 15 12:56:36 2008 @@ -145,7 +145,7 @@ \param flags the initial channel flags */ SWITCH_DECLARE(switch_status_t) switch_channel_init(switch_channel_t *channel, switch_core_session_t *session, switch_channel_state_t state, - uint32_t flags); + switch_channel_flag_t flag); /*! \brief Fire A presence event for the channel @@ -259,49 +259,49 @@ SWITCH_DECLARE(switch_caller_extension_t *) switch_channel_get_caller_extension(switch_channel_t *channel); /*! - \brief Test for presence of given flag(s) on a given channel + \brief Test for presence of given flag on a given channel \param channel channel to test - \param flags or'd list of channel flags to test + \param flag to test \return TRUE if flags were present */ -SWITCH_DECLARE(uint32_t) switch_channel_test_flag(switch_channel_t *channel, switch_channel_flag_t flags); +SWITCH_DECLARE(uint32_t) switch_channel_test_flag(switch_channel_t *channel, switch_channel_flag_t flag); /*! \brief Set given flag(s) on a given channel - \param channel channel on which to set flag(s) - \param flags or'd list of flags to set + \param channel channel on which to set flag + \param flag or'd list of flags to set */ -SWITCH_DECLARE(void) switch_channel_set_flag(switch_channel_t *channel, switch_channel_flag_t flags); +SWITCH_DECLARE(void) switch_channel_set_flag(switch_channel_t *channel, switch_channel_flag_t flag); /*! \brief Set given flag(s) on a given channel's bridge partner - \param channel channel to derive the partner channel to set flag(s) on - \param flags or'd list of flags to set + \param channel channel to derive the partner channel to set flag on + \param flag to set \return true if the flag was set */ -SWITCH_DECLARE(switch_bool_t) switch_channel_set_flag_partner(switch_channel_t *channel, switch_channel_flag_t flags); +SWITCH_DECLARE(switch_bool_t) switch_channel_set_flag_partner(switch_channel_t *channel, switch_channel_flag_t flag); /*! \brief Clears given flag(s) on a given channel's bridge partner \param channel channel to derive the partner channel to clear flag(s) from - \param flags the flags to clear + \param flag the flag to clear \return true if the flag was cleared */ -SWITCH_DECLARE(switch_bool_t) switch_channel_clear_flag_partner(switch_channel_t *channel, switch_channel_flag_t flags); +SWITCH_DECLARE(switch_bool_t) switch_channel_clear_flag_partner(switch_channel_t *channel, switch_channel_flag_t flag); /*! \brief Set given flag(s) on a given channel to be applied on the next state change \param channel channel on which to set flag(s) - \param flags or'd list of flags to set + \param flag flag to set */ -SWITCH_DECLARE(void) switch_channel_set_state_flag(switch_channel_t *channel, switch_channel_flag_t flags); +SWITCH_DECLARE(void) switch_channel_set_state_flag(switch_channel_t *channel, switch_channel_flag_t flag); /*! \brief Clear given flag(s) from a channel \param channel channel to clear flags from - \param flags or'd list of flags to clear + \param flag flag to clear */ -SWITCH_DECLARE(void) switch_channel_clear_flag(switch_channel_t *channel, switch_channel_flag_t flags); +SWITCH_DECLARE(void) switch_channel_clear_flag(switch_channel_t *channel, switch_channel_flag_t flag); SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t *channel, const char *file, const char *func, int line); @@ -484,10 +484,16 @@ _In_opt_ const char *prefix); SWITCH_DECLARE(switch_status_t) switch_channel_set_timestamps(_In_ switch_channel_t *channel); -#define switch_channel_stop_broadcast(_channel) if (switch_channel_test_flag(_channel, CF_BROADCAST)) switch_channel_set_flag(_channel, CF_BREAK | CF_STOP_BROADCAST) +#define switch_channel_stop_broadcast(_channel) for(;;) {if (switch_channel_test_flag(_channel, CF_BROADCAST)) {switch_channel_set_flag(_channel, CF_STOP_BROADCAST); switch_channel_set_flag(_channel, CF_BREAK); } break;} #define switch_channel_media_ready(_channel) ((switch_channel_test_flag(_channel, CF_ANSWERED) || switch_channel_test_flag(_channel, CF_EARLY_MEDIA)) && !switch_channel_test_flag(_channel, CF_PROXY_MODE)) +SWITCH_DECLARE(void) switch_channel_audio_sync(switch_channel_t *channel); + +SWITCH_DECLARE(void) switch_channel_set_private_flag(switch_channel_t *channel, uint32_t flags); +SWITCH_DECLARE(void) switch_channel_clear_private_flag(switch_channel_t *channel, uint32_t flags); +SWITCH_DECLARE(int) switch_channel_test_private_flag(switch_channel_t *channel, uint32_t flags); + /** @} */ SWITCH_END_EXTERN_C Modified: freeswitch/branches/gmaruzz/src/include/switch_core.h ============================================================================== --- freeswitch/branches/gmaruzz/src/include/switch_core.h (original) +++ freeswitch/branches/gmaruzz/src/include/switch_core.h Mon Dec 15 12:56:36 2008 @@ -92,6 +92,7 @@ const char *_file; const char *_func; int _line; + }; /*! \brief A generic object to pass as a thread's session object to allow mutiple arguements and a pool */ @@ -320,6 +321,22 @@ #ifdef SWITCH_DEBUG_RWLOCKS +SWITCH_DECLARE(switch_status_t) switch_core_session_perform_read_lock_hangup(_In_ switch_core_session_t *session, const char *file, const char *func, int line); +#endif + +/*! + \brief Acquire a read lock on the session + \param session the session to acquire from + \return success if it is safe to read from the session +*/ +#ifdef SWITCH_DEBUG_RWLOCKS +#define switch_core_session_read_lock(session) switch_core_session_perform_read_lock_hangup(session, __FILE__, __SWITCH_FUNC__, __LINE__) +#else +SWITCH_DECLARE(switch_status_t) switch_core_session_read_lock_hangup(_In_ switch_core_session_t *session); +#endif + + +#ifdef SWITCH_DEBUG_RWLOCKS SWITCH_DECLARE(void) switch_core_session_perform_write_lock(_In_ switch_core_session_t *session, const char *file, const char *func, int line); #endif Modified: freeswitch/branches/gmaruzz/src/include/switch_cpp.h ============================================================================== --- freeswitch/branches/gmaruzz/src/include/switch_cpp.h (original) +++ freeswitch/branches/gmaruzz/src/include/switch_cpp.h Mon Dec 15 12:56:36 2008 @@ -313,7 +313,7 @@ * */ SWITCH_DECLARE(int) streamFile(char *file, int starting_sample_count = 0); - SWITCH_DECLARE(int) sleep(int ms); + SWITCH_DECLARE(int) sleep(int ms, int sync=0); /** \brief flush any pending events */ @@ -373,6 +373,7 @@ SWITCH_DECLARE(void) console_log(char *level_str, char *msg); SWITCH_DECLARE(void) console_clean_log(char *msg); +SWITCH_DECLARE(void) msleep(unsigned ms); /** \brief bridge the audio of session_b into session_a * Modified: freeswitch/branches/gmaruzz/src/include/switch_ivr.h ============================================================================== --- freeswitch/branches/gmaruzz/src/include/switch_ivr.h (original) +++ freeswitch/branches/gmaruzz/src/include/switch_ivr.h Mon Dec 15 12:56:36 2008 @@ -110,7 +110,7 @@ \param args arguements to pass for callbacks etc \return SWITCH_STATUS_SUCCESS if the channel is still up */ -SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, uint32_t ms, switch_input_args_t *args); +SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, uint32_t ms, switch_bool_t sync, switch_input_args_t *args); SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session, switch_input_args_t *args); @@ -298,7 +298,8 @@ */ SWITCH_DECLARE(switch_status_t) switch_ivr_tone_detect_session(switch_core_session_t *session, const char *key, const char *tone_spec, - const char *flags, time_t timeout, const char *app, const char *data); + const char *flags, time_t timeout, int hits, const char *app, const char *data); + @@ -397,7 +398,10 @@ const switch_state_handler_table_t *table, const char *cid_name_override, const char *cid_num_override, - switch_caller_profile_t *caller_profile_override, switch_originate_flag_t flags); + switch_caller_profile_t *caller_profile_override, + switch_event_t *ovars, + switch_originate_flag_t flags + ); /*! \brief Bridge Audio from one session to another Modified: freeswitch/branches/gmaruzz/src/include/switch_module_interfaces.h ============================================================================== --- freeswitch/branches/gmaruzz/src/include/switch_module_interfaces.h (original) +++ freeswitch/branches/gmaruzz/src/include/switch_module_interfaces.h Mon Dec 15 12:56:36 2008 @@ -173,6 +173,7 @@ switch_thread_rwlock_t *rwlock; int refs; + switch_mutex_t *reflock; /* parent */ switch_loadable_module_interface_t *parent; @@ -228,6 +229,7 @@ switch_status_t (*timer_destroy) (switch_timer_t *); switch_thread_rwlock_t *rwlock; int refs; + switch_mutex_t *reflock; switch_loadable_module_interface_t *parent; struct switch_timer_interface *next; }; @@ -240,6 +242,7 @@ switch_dialplan_hunt_function_t hunt_function; switch_thread_rwlock_t *rwlock; int refs; + switch_mutex_t *reflock; switch_loadable_module_interface_t *parent; struct switch_dialplan_interface *next; }; @@ -266,6 +269,7 @@ char **extens; switch_thread_rwlock_t *rwlock; int refs; + switch_mutex_t *reflock; switch_loadable_module_interface_t *parent; struct switch_file_interface *next; }; @@ -345,6 +349,7 @@ switch_status_t (*asr_get_results) (switch_asr_handle_t *ah, char **xmlstr, switch_asr_flag_t *flags); switch_thread_rwlock_t *rwlock; int refs; + switch_mutex_t *reflock; switch_loadable_module_interface_t *parent; struct switch_asr_interface *next; }; @@ -388,6 +393,7 @@ void (*speech_float_param_tts) (switch_speech_handle_t *sh, char *param, double val); switch_thread_rwlock_t *rwlock; int refs; + switch_mutex_t *reflock; switch_loadable_module_interface_t *parent; struct switch_speech_interface *next; }; @@ -423,6 +429,7 @@ switch_say_callback_t say_function; switch_thread_rwlock_t *rwlock; int refs; + switch_mutex_t *reflock; switch_loadable_module_interface_t *parent; struct switch_say_interface *next; }; @@ -435,6 +442,7 @@ switch_status_t (*chat_send) (char *proto, char *from, char *to, char *subject, char *body, char *hint); switch_thread_rwlock_t *rwlock; int refs; + switch_mutex_t *reflock; switch_loadable_module_interface_t *parent; struct switch_chat_interface *next; }; @@ -447,6 +455,7 @@ switch_status_t (*management_function) (char *relative_oid, switch_management_action_t action, char *data, switch_size_t datalen); switch_thread_rwlock_t *rwlock; int refs; + switch_mutex_t *reflock; switch_loadable_module_interface_t *parent; struct switch_management_interface *next; }; @@ -467,6 +476,7 @@ switch_status_t (*directory_next_pair) (switch_directory_handle_t *dh, char **var, char **val); switch_thread_rwlock_t *rwlock; int refs; + switch_mutex_t *reflock; switch_loadable_module_interface_t *parent; struct switch_directory_interface *next; }; @@ -593,6 +603,7 @@ uint32_t codec_id; switch_thread_rwlock_t *rwlock; int refs; + switch_mutex_t *reflock; switch_loadable_module_interface_t *parent; struct switch_codec_interface *next; }; @@ -613,6 +624,7 @@ uint32_t flags; switch_thread_rwlock_t *rwlock; int refs; + switch_mutex_t *reflock; switch_loadable_module_interface_t *parent; struct switch_application_interface *next; }; @@ -629,12 +641,14 @@ const char *syntax; switch_thread_rwlock_t *rwlock; int refs; + switch_mutex_t *reflock; switch_loadable_module_interface_t *parent; struct switch_api_interface *next; }; -#define PROTECT_INTERFACE(_it) if (_it && !_it->refs) {switch_thread_rwlock_rdlock(_it->parent->rwlock); switch_thread_rwlock_rdlock(_it->rwlock); _it->refs++; _it->parent->refs++;} //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "+++++++++++LOCK\n"); -#define UNPROTECT_INTERFACE(_it) if (_it && _it->refs) {switch_thread_rwlock_unlock(_it->rwlock); switch_thread_rwlock_unlock(_it->parent->rwlock); _it->refs--; _it->parent->refs--; _it = NULL;} //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "-----------UNLOCK\n"); +#define PROTECT_INTERFACE(_it) if (_it) {switch_mutex_lock(_it->reflock); switch_thread_rwlock_rdlock(_it->parent->rwlock); switch_thread_rwlock_rdlock(_it->rwlock); _it->refs++; _it->parent->refs++; switch_mutex_unlock(_it->reflock);} //if (!strcmp(_it->interface_name, "user")) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "+++++++++++LOCK %s %d/%d\n", _it->interface_name, _it->refs, _it->parent->refs); +#define UNPROTECT_INTERFACE(_it) if (_it) {switch_mutex_lock(_it->reflock); switch_thread_rwlock_unlock(_it->rwlock); switch_thread_rwlock_unlock(_it->parent->rwlock); _it->refs--; _it->parent->refs--; switch_mutex_unlock(_it->reflock);} //if (!strcmp(_it->interface_name, "user")) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "---------UNLOCK %s %d/%d\n", _it->interface_name, _it->refs, _it->parent->refs); + SWITCH_END_EXTERN_C #endif Modified: freeswitch/branches/gmaruzz/src/include/switch_odbc.h ============================================================================== --- freeswitch/branches/gmaruzz/src/include/switch_odbc.h (original) +++ freeswitch/branches/gmaruzz/src/include/switch_odbc.h Mon Dec 15 12:56:36 2008 @@ -64,8 +64,35 @@ SWITCH_DECLARE(void) switch_odbc_handle_destroy(switch_odbc_handle_t **handlep); SWITCH_DECLARE(switch_odbc_state_t) switch_odbc_handle_get_state(switch_odbc_handle_t *handle); SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_exec(switch_odbc_handle_t *handle, char *sql, SQLHSTMT * rstmt); -SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_callback_exec(switch_odbc_handle_t *handle, + +/*! + \brief Execute the sql query and issue a callback for each row returned + \param file the file from which this function is called + \param func the function from which this function is called + \param line the line from which this function is called + \param handle the ODBC handle + \param sql the sql string to execute + \param callback the callback function to execute + \param pdata the state data passed on each callback invocation + \return SWITCH_STATUS_SUCCESS if the operation was successful + \note none +*/ +SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_callback_exec_detailed(const char *file, const char *func, int line, switch_odbc_handle_t *handle, char *sql, switch_core_db_callback_func_t callback, void *pdata); +/*! + \brief Execute the sql query and issue a callback for each row returned + \param handle the ODBC handle + \param sql the sql string to execute + \param callback the callback function to execute + \param pdata the state data passed on each callback invocation + \return SWITCH_STATUS_SUCCESS if the operation was successful + \note none +*/ +#define switch_odbc_handle_callback_exec(handle, sql, callback, pdata) \ + switch_odbc_handle_callback_exec_detailed(__FILE__, (char * )__SWITCH_FUNC__, __LINE__, \ + handle, sql, callback, pdata) + + SWITCH_DECLARE(char *) switch_odbc_handle_get_error(switch_odbc_handle_t *handle, SQLHSTMT stmt); SWITCH_END_EXTERN_C #endif Modified: freeswitch/branches/gmaruzz/src/include/switch_rtp.h ============================================================================== --- freeswitch/branches/gmaruzz/src/include/switch_rtp.h (original) +++ freeswitch/branches/gmaruzz/src/include/switch_rtp.h Mon Dec 15 12:56:36 2008 @@ -111,7 +111,7 @@ SWITCH_DECLARE(switch_port_t) switch_rtp_request_port(const char *ip); SWITCH_DECLARE(void) switch_rtp_release_port(const char *ip, switch_port_t port); -SWITCH_DECLARE(void) switch_rtp_change_interval(switch_rtp_t *rtp_session, uint32_t ms_per_packet, uint32_t samples_per_interval); +SWITCH_DECLARE(switch_status_t) switch_rtp_change_interval(switch_rtp_t *rtp_session, uint32_t ms_per_packet, uint32_t samples_per_interval); /*! \brief create a new RTP session handle \param new_rtp_session a poiter to aim at the new session @@ -351,6 +351,8 @@ */ SWITCH_DECLARE(switch_status_t) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp_session, switch_frame_t *frame, switch_io_flag_t io_flags); +SWITCH_DECLARE(void) rtp_flush_read_buffer(switch_rtp_t *rtp_session); + /*! \brief Enable VAD on an RTP Session \param rtp_session the RTP session Modified: freeswitch/branches/gmaruzz/src/include/switch_stun.h ============================================================================== --- freeswitch/branches/gmaruzz/src/include/switch_stun.h (original) +++ freeswitch/branches/gmaruzz/src/include/switch_stun.h Mon Dec 15 12:56:36 2008 @@ -147,6 +147,7 @@ */ SWITCH_DECLARE(const char *) switch_stun_value_to_name(int32_t type, uint32_t value); +SWITCH_DECLARE(char *) switch_stun_host_lookup(const char *host, switch_memory_pool_t *pool); /*! \brief Extract a mapped address (IP:PORT) from a packet attribute Modified: freeswitch/branches/gmaruzz/src/include/switch_types.h ============================================================================== --- freeswitch/branches/gmaruzz/src/include/switch_types.h (original) +++ freeswitch/branches/gmaruzz/src/include/switch_types.h Mon Dec 15 12:56:36 2008 @@ -110,6 +110,10 @@ #define SWITCH_PATH_SEPARATOR "/" #endif #define SWITCH_URL_SEPARATOR "://" +#define SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE "send_silence_when_idle" +#define SWITCH_CURRENT_APPLICATION_VARIABLE "current_application" +#define SWITCH_CURRENT_APPLICATION_DATA_VARIABLE "current_application_data" +#define SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE "current_application_response" #define SWITCH_ENABLE_HEARTBEAT_EVENTS_VARIABLE "enable_heartbeat_events" #define SWITCH_BYPASS_MEDIA_AFTER_BRIDGE_VARIABLE "bypass_media_after_bridge" #define SWITCH_READ_RESULT_VARIABLE "read_result" @@ -122,6 +126,7 @@ #define SWITCH_HOLDING_UUID_VARIABLE "holding_uuid" #define SWITCH_API_BRIDGE_END_VARIABLE "api_after_bridge" #define SWITCH_API_HANGUP_HOOK_VARIABLE "api_hangup_hook" +#define SWITCH_SESSION_IN_HANGUP_HOOK_VARIABLE "session_in_hangup_hook" #define SWITCH_PROCESS_CDR_VARIABLE "process_cdr" #define SWITCH_BRIDGE_CHANNEL_VARIABLE "bridge_channel" #define SWITCH_CHANNEL_NAME_VARIABLE "channel_name" @@ -450,7 +455,8 @@ SWITCH_RTP_FLAG_SECURE_SEND_RESET = (1 << 16), SWITCH_RTP_FLAG_SECURE_RECV_RESET = (1 << 17), SWITCH_RTP_FLAG_PROXY_MEDIA = (1 << 18), - SWITCH_RTP_FLAG_SHUTDOWN = (1 << 19) + SWITCH_RTP_FLAG_SHUTDOWN = (1 << 19), + SWITCH_RTP_FLAG_FLUSH = (1 << 20) } switch_rtp_flag_enum_t; typedef uint32_t switch_rtp_flag_t; @@ -567,6 +573,7 @@ SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ, SWITCH_MESSAGE_INDICATE_DISPLAY, SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY, + SWITCH_MESSAGE_INDICATE_AUDIO_SYNC, SWITCH_MESSAGE_INVALID } switch_core_session_message_types_t; @@ -675,7 +682,9 @@ } switch_text_channel_t; typedef enum { - SCSMF_DYNAMIC = (1 << 0) + SCSMF_DYNAMIC = (1 << 0), + SCSMF_FREE_STRING_REPLY = (1 << 1), + SCSMF_FREE_POINTER_REPLY = (1 << 2), } switch_core_session_message_flag_enum_t; typedef uint32_t switch_core_session_message_flag_t; @@ -723,71 +732,70 @@ \brief Channel Flags
-CF_ANSWERED     = (1 <<  0) - Channel is answered
-CF_OUTBOUND     = (1 <<  1) - Channel is an outbound channel
-CF_EARLY_MEDIA  = (1 <<  2) - Channel is ready for audio before answer 
-CF_ORIGINATOR	= (1 <<  3) - Channel is an originator
-CF_TRANSFER		= (1 <<  4) - Channel is being transfered
-CF_ACCEPT_CNG	= (1 <<  5) - Channel will accept CNG frames
-CF_WAIT_FOR_ME	= (1 <<  6) - Channel wants you to wait
-CF_BRIDGED		= (1 <<  7) - Channel in a bridge
-CF_HOLD			= (1 <<  8) - Channel is on hold
-CF_SERVICE		= (1 <<  9) - Channel has a service thread
-CF_TAGGED		= (1 << 10) - Channel is tagged
-CF_WINNER		= (1 << 11) - Channel is the winner
-CF_CONTROLLED	= (1 << 12) - Channel is under control
-CF_PROXY_MODE		= (1 << 13) - Channel has no media
-CF_SUSPEND		= (1 << 14) - Suspend i/o
-CF_EVENT_PARSE  = (1 << 15) - Suspend control events
-CF_REPEAT_STATE = (1 << 16) - Tell the state machine to repeat a state
-CF_GEN_RINGBACK = (1 << 17) - Channel is generating it's own ringback
-CF_RING_READY   = (1 << 18) - Channel is ready to send ringback
-CF_BREAK        = (1 << 19) - Channel should stop what it's doing
-CF_BROADCAST    = (1 << 20) - Channel is broadcasting
-CF_UNICAST      = (1 << 21) - Channel has a unicast connection
-CF_VIDEO		= (1 << 22) - Channel has video
-CF_EVENT_LOCK   = (1 << 23) - Don't parse events
-CF_RESET        = (1 << 24) - Tell extension parser to reset
-CF_ORIGINATING  = (1 << 25) - Channel is originating
-CF_STOP_BROADCAST = (1 << 26) - Signal to stop broadcast
+CF_ANSWERED			- Channel is answered
+CF_OUTBOUND			- Channel is an outbound channel
+CF_EARLY_MEDIA		- Channel is ready for audio before answer 
+CF_ORIGINATOR		- Channel is an originator
+CF_TRANSFER			- Channel is being transfered
+CF_ACCEPT_CNG		- Channel will accept CNG frames
+CF_REDIRECT 		- Channel is being redirected
+CF_BRIDGED			- Channel in a bridge
+CF_HOLD				- Channel is on hold
+CF_SERVICE			- Channel has a service thread
+CF_TAGGED			- Channel is tagged
+CF_WINNER			- Channel is the winner
+CF_CONTROLLED		- Channel is under control
+CF_PROXY_MODE		- Channel has no media
+CF_SUSPEND			- Suspend i/o
+CF_EVENT_PARSE		- Suspend control events
+CF_GEN_RINGBACK		- Channel is generating it's own ringback
+CF_RING_READY		- Channel is ready to send ringback
+CF_BREAK			- Channel should stop what it's doing
+CF_BROADCAST		- Channel is broadcasting
+CF_UNICAST			- Channel has a unicast connection
+CF_VIDEO			- Channel has video
+CF_EVENT_LOCK		- Don't parse events
+CF_RESET			- Tell extension parser to reset
+CF_ORIGINATING		- Channel is originating
+CF_STOP_BROADCAST	- Signal to stop broadcast
 
*/ typedef enum { - CF_ANSWERED = (1 << 0), - CF_OUTBOUND = (1 << 1), - CF_EARLY_MEDIA = (1 << 2), - CF_ORIGINATOR = (1 << 3), - CF_TRANSFER = (1 << 4), - CF_ACCEPT_CNG = (1 << 5), - CF_WAIT_FOR_ME = (1 << 6), - CF_BRIDGED = (1 << 7), - CF_HOLD = (1 << 8), - CF_SERVICE = (1 << 9), - CF_TAGGED = (1 << 10), - CF_WINNER = (1 << 11), - CF_CONTROLLED = (1 << 12), - CF_PROXY_MODE = (1 << 13), - CF_SUSPEND = (1 << 14), - CF_EVENT_PARSE = (1 << 15), - CF_REPEAT_STATE = (1 << 16), - CF_GEN_RINGBACK = (1 << 17), - CF_RING_READY = (1 << 18), - CF_BREAK = (1 << 19), - CF_BROADCAST = (1 << 20), - CF_UNICAST = (1 << 21), - CF_VIDEO = (1 << 22), - CF_EVENT_LOCK = (1 << 23), - CF_RESET = (1 << 24), - CF_ORIGINATING = (1 << 25), - CF_STOP_BROADCAST = (1 << 26), - CF_PROXY_MEDIA = (1 << 27), - CF_INNER_BRIDGE = (1 << 28), - CF_REQ_MEDIA = (1 << 29), - CF_VERBOSE_EVENTS = (1 << 30) -} switch_channel_flag_enum_t; -typedef uint32_t switch_channel_flag_t; - + CF_ANSWERED = 1, + CF_OUTBOUND, + CF_EARLY_MEDIA, + CF_ORIGINATOR, + CF_TRANSFER, + CF_ACCEPT_CNG, + CF_REDIRECT, + CF_BRIDGED, + CF_HOLD, + CF_SERVICE, + CF_TAGGED, + CF_WINNER, + CF_CONTROLLED, + CF_PROXY_MODE, + CF_SUSPEND, + CF_EVENT_PARSE, + CF_GEN_RINGBACK, + CF_RING_READY, + CF_BREAK, + CF_BROADCAST, + CF_UNICAST, + CF_VIDEO, + CF_EVENT_LOCK, + CF_RESET, + CF_ORIGINATING, + CF_STOP_BROADCAST, + CF_PROXY_MEDIA, + CF_INNER_BRIDGE, + CF_REQ_MEDIA, + CF_VERBOSE_EVENTS, + + /* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */ + CF_FLAG_MAX +} switch_channel_flag_t; /*! \enum switch_frame_flag_t @@ -1058,6 +1066,7 @@ SWITCH_EVENT_DTMF - DTMF was sent SWITCH_EVENT_MESSAGE - A Basic Message SWITCH_EVENT_PRESENCE_IN - Presence in + SWITCH_EVENT_NOTIFY_IN - Received incoming NOTIFY from gateway subscription SWITCH_EVENT_PRESENCE_OUT - Presence out SWITCH_EVENT_PRESENCE_PROBE - Presence probe SWITCH_EVENT_MESSAGE_WAITING - A message is waiting @@ -1116,6 +1125,7 @@ SWITCH_EVENT_DTMF, SWITCH_EVENT_MESSAGE, SWITCH_EVENT_PRESENCE_IN, + SWITCH_EVENT_NOTIFY_IN, SWITCH_EVENT_PRESENCE_OUT, SWITCH_EVENT_PRESENCE_PROBE, SWITCH_EVENT_MESSAGE_WAITING, Modified: freeswitch/branches/gmaruzz/src/include/switch_utils.h ============================================================================== --- freeswitch/branches/gmaruzz/src/include/switch_utils.h (original) +++ freeswitch/branches/gmaruzz/src/include/switch_utils.h Mon Dec 15 12:56:36 2008 @@ -41,6 +41,22 @@ #include SWITCH_BEGIN_EXTERN_C + +SWITCH_DECLARE(int) switch_toupper(int c); +SWITCH_DECLARE(int) switch_tolower(int c); +SWITCH_DECLARE(int) switch_isalnum(int c); +SWITCH_DECLARE(int) switch_isalpha(int c); +SWITCH_DECLARE(int) switch_iscntrl(int c); +SWITCH_DECLARE(int) switch_isdigit(int c); +SWITCH_DECLARE(int) switch_isgraph(int c); +SWITCH_DECLARE(int) switch_islower(int c); +SWITCH_DECLARE(int) switch_isprint(int c); +SWITCH_DECLARE(int) switch_ispunct(int c); +SWITCH_DECLARE(int) switch_isspace(int c); +SWITCH_DECLARE(int) switch_isupper(int c); +SWITCH_DECLARE(int) switch_isxdigit(int c); + + #define switch_samples_per_packet(rate, interval) ((uint32_t)((float)rate / (1000.0f / (float)interval))) #define SWITCH_SMAX 32767 #define SWITCH_SMIN -32768 @@ -211,7 +227,7 @@ \param key the key to test \return TRUE or FALSE */ -#define is_dtmf(key) ((key > 47 && key < 58) || (key > 64 && key < 69) || (key > 96 && key < 101) || key == 35 || key == 42 || key == 87 || key == 119) +#define is_dtmf(key) ((key > 47 && key < 58) || (key > 64 && key < 69) || (key > 96 && key < 101) || key == 35 || key == 42 || key == 87 || key == 119 || key == 70) #define end_of(_s) *(*_s == '\0' ? _s : _s + strlen(_s) - 1) #define end_of_p(_s) (*_s == '\0' ? _s : _s + strlen(_s) - 1) @@ -303,7 +319,7 @@ if (it) { dup = strdup(it); for(p = dup; p && *p; p++) { - *p = (char) tolower(*p); + *p = (char) switch_tolower(*p); } return dup; } @@ -320,7 +336,7 @@ if (it) { dup = strdup(it); for(p = dup; p && *p; p++) { - *p = (char) toupper(*p); + *p = (char) switch_toupper(*p); } return dup; } @@ -353,7 +369,7 @@ assert(S != NULL); for (p = S; p && *p; p++) { - *p = (char) toupper(*p); + *p = (char) switch_toupper(*p); } if (strstr(S, q)) { @@ -365,7 +381,7 @@ assert(Q != NULL); for (p = Q; p && *p; p++) { - *p = (char) toupper(*p); + *p = (char) switch_toupper(*p); } if (strstr(s, Q)) { Modified: freeswitch/branches/gmaruzz/src/mod/applications/mod_commands/mod_commands.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/applications/mod_commands/mod_commands.c (original) +++ freeswitch/branches/gmaruzz/src/mod/applications/mod_commands/mod_commands.c Mon Dec 15 12:56:36 2008 @@ -704,13 +704,14 @@ if (stream->param_event) { http = switch_event_get_header(stream->param_event, "http-host"); + if ((var = switch_event_get_header(stream->param_event, "content-type"))) { + if (!strcasecmp(var, "text/plain")) { + http = NULL; + } + } } - if ((var = switch_event_get_header(stream->param_event, "content-type"))) { - if (!strcasecmp(var, "text/plain")) { - http = NULL; - } - } else { + if (http) { stream->write_function(stream, "%s", "Content-Type: text/html\n\n"); } @@ -1127,8 +1128,8 @@ } else if (!strcasecmp(arg, "both")) { if (uuid && (other_session = switch_core_session_locate(uuid))) { switch_channel_t *other_channel = switch_core_session_get_channel(other_session); - switch_channel_set_flag(other_channel, CF_TRANSFER); - switch_channel_set_flag(channel, CF_TRANSFER); + switch_channel_set_flag(other_channel, CF_REDIRECT); + switch_channel_set_flag(channel, CF_REDIRECT); switch_ivr_session_transfer(other_session, dest, dp, context); switch_core_session_rwunlock(other_session); } @@ -1148,14 +1149,15 @@ return SWITCH_STATUS_SUCCESS; } -#define TONE_DETECT_SYNTAX " [ ]" +#define TONE_DETECT_SYNTAX " [ ]" SWITCH_STANDARD_API(tone_detect_session_function) { - char *argv[7] = { 0 }; + char *argv[8] = { 0 }; int argc; char *mydata = NULL; time_t to = 0; switch_core_session_t *rsession; + int hits = 1; if (!cmd) { stream->write_function(stream, "-USAGE: %s\n", TONE_DETECT_SYNTAX); @@ -1193,7 +1195,14 @@ } } - switch_ivr_tone_detect_session(rsession, argv[1], argv[2], argv[3], to, argv[5], argv[6]); + if (argv[7]) { + hits = atoi(argv[7]); + if (hits < 0) { + hits = 1; + } + } + + switch_ivr_tone_detect_session(rsession, argv[1], argv[2], argv[3], to, hits, argv[5], argv[6]); stream->write_function(stream, "+OK Enabling tone detection '%s' '%s' '%s'\n", argv[1], argv[2], argv[3]); done: @@ -1251,6 +1260,42 @@ return SWITCH_STATUS_SUCCESS; } + + +#define UUID_DEFLECT_SYNTAX " " +SWITCH_STANDARD_API(uuid_deflect) +{ + switch_core_session_t *tsession = NULL; + char *uuid = NULL, *text = NULL; + + if (!switch_strlen_zero(cmd) && (uuid = strdup(cmd))) { + if ((text = strchr(uuid, ' '))) { + *text++ = '\0'; + } + } + + if (switch_strlen_zero(uuid) || switch_strlen_zero(text)) { + stream->write_function(stream, "-USAGE: %s\n", UUID_DEFLECT_SYNTAX); + } else { + if ((tsession = switch_core_session_locate(uuid))) { + switch_core_session_message_t msg = { 0 }; + + /* Tell the channel to deflect the call */ + msg.from = __FILE__; + msg.string_arg = text; + msg.message_id = SWITCH_MESSAGE_INDICATE_DEFLECT; + switch_core_session_receive_message(tsession, &msg); + stream->write_function(stream, "+OK:%s\n", msg.string_reply); + switch_core_session_rwunlock(tsession); + } else { + stream->write_function(stream, "-ERR No Such Channel %s!\n", uuid); + } + } + + switch_safe_free(uuid); + return SWITCH_STATUS_SUCCESS; +} + #define SCHED_TRANSFER_SYNTAX "[+]