From anthm at freeswitch.org Fri May 1 05:29:44 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Fri, 01 May 2009 07:29:44 -0500 Subject: [Freeswitch-svn] [commit] r13214 - freeswitch/trunk/src/mod/endpoints/mod_loopback Message-ID: Author: anthm Date: Fri May 1 07:29:44 2009 New Revision: 13214 Log: MODENDP-216 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 Fri May 1 07:29:44 2009 @@ -573,6 +573,7 @@ tech_pvt->cng_frame.codec = &tech_pvt->read_codec; tech_pvt->cng_frame.datalen = tech_pvt->read_codec.implementation->decoded_bytes_per_packet; memset(tech_pvt->cng_frame.data, 0, tech_pvt->cng_frame.datalen); + memset(&data, 0, sizeof(data)); if (strcasecmp(tech_pvt->read_codec.implementation->iananame, "L16")) { status = switch_core_codec_encode(&tech_pvt->read_codec, From anthm at freeswitch.org Fri May 1 05:32:44 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Fri, 01 May 2009 07:32:44 -0500 Subject: [Freeswitch-svn] [commit] r13215 - freeswitch/trunk/src/mod/applications/mod_commands Message-ID: Author: anthm Date: Fri May 1 07:32:44 2009 New Revision: 13215 Log: MODAPP-269 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 May 1 07:32:44 2009 @@ -2750,11 +2750,11 @@ } } if (strchr(argv[2], '%')) { - sprintf(sql, "select * from channels where name like '%s' or cid_name like '%s' or cid_num like '%s' order by created_epoch", - argv[2], argv[2], argv[2]); + sprintf(sql, "select * from channels where uuid like '%s' or name like '%s' or cid_name like '%s' or cid_num like '%s' order by created_epoch", + argv[2], argv[2], argv[2], argv[2]); } else { - sprintf(sql, "select * from channels where name like '%%%s%%' or cid_name like '%%%s%%' or cid_num like '%%%s%%' order by created_epoch", - argv[2], argv[2], argv[2]); + sprintf(sql, "select * from channels where uuid like '%%%s%%' or name like '%%%s%%' or cid_name like '%%%s%%' or cid_num like '%%%s%%' order by created_epoch", + argv[2], argv[2], argv[2], argv[2]); } From rupa at freeswitch.org Fri May 1 06:13:44 2009 From: rupa at freeswitch.org (FreeSWITCH SVN) Date: Fri, 01 May 2009 08:13:44 -0500 Subject: [Freeswitch-svn] [commit] r13216 - freeswitch/trunk/src/mod/applications/mod_conference Message-ID: Author: rupa Date: Fri May 1 08:13:44 2009 New Revision: 13216 Log: add execute_application to custom controls 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 Fri May 1 08:13:44 2009 @@ -28,6 +28,7 @@ * Bret McDanel * Dale Thatcher * Chris Danielson + * Rupa Schomaker * * mod_conference.c -- Software Conference Bridge * @@ -96,7 +97,8 @@ CALLER_CONTROL_DIAL, CALLER_CONTROL_EVENT, CALLER_CONTROL_LOCK, - CALLER_CONTROL_TRANSFER + CALLER_CONTROL_TRANSFER, + CALLER_CONTROL_EXEC_APP } caller_control_t; /* forward declaration for conference_obj and caller_control */ @@ -948,7 +950,7 @@ switch_size_t file_data_len = samples * 2; int has_file_data = 0, members_with_video = 0; - if (conference->perpetual_sound && !conference->async_fnode) { + if (conference->perpetual_sound && !conference->async_fnode) { conference_play_file(conference, conference->perpetual_sound, CONF_DEFAULT_LEADIN, NULL, 1); } else if (conference->moh_sound && conference->count == 1 && !conference->async_fnode) { conference_play_file(conference, conference->moh_sound, CONF_DEFAULT_LEADIN, NULL, 1); @@ -1582,6 +1584,7 @@ conference_add_event_member_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "dtmf"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "DTMF-Key", action->binded_dtmf); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Data", action->data); switch_event_fire(&event); } } @@ -1634,6 +1637,54 @@ return; } +static void conference_loop_fn_exec_app(conference_member_t *member, caller_control_action_t *action) +{ + char *app = NULL; + char *arg = ""; + + char *argv[2] = { 0 }; + int argc; + char *mydata = NULL; + switch_event_t *event = NULL; + switch_channel_t *channel = NULL; + + if (test_eflag(member->conference, EFLAG_DTMF) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { + conference_add_event_member_data(member, event); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "execute_app"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application", action->data); + switch_event_fire(&event); + } + + if ((mydata = switch_core_session_strdup(member->session, action->data))) { + if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) { + if (argc > 0) { + app = argv[0]; + } + if (argc > 1) { + arg = argv[1]; + } + + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Empty execute app string [%s]\n", (char *) action->data); + goto done; + } + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to allocate memory to duplicate execute_app data.\n"); + goto done; + } + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Execute app: %s, %s\n", app, arg); + + channel = switch_core_session_get_channel(member->session); + + switch_channel_set_app_flag(channel, CF_APP_TAGGED); + switch_core_session_set_read_codec(member->session, NULL); + switch_core_session_execute_application(member->session, app, arg); + switch_core_session_set_read_codec(member->session, &member->read_codec); + switch_channel_clear_app_flag(channel, CF_APP_TAGGED); +done: + return; +} + static void conference_loop_fn_hangup(conference_member_t *member, caller_control_action_t *action) { switch_clear_flag_locked(member, MFLAG_RUNNING); @@ -1872,7 +1923,8 @@ {"hangup", "#", CALLER_CONTROL_HANGUP, conference_loop_fn_hangup}, {"event", NULL, CALLER_CONTROL_EVENT, conference_loop_fn_event}, {"lock", NULL, CALLER_CONTROL_LOCK, conference_loop_fn_lock_toggle}, - {"transfer", NULL, CALLER_CONTROL_TRANSFER, conference_loop_fn_transfer} + {"transfer", NULL, CALLER_CONTROL_TRANSFER, conference_loop_fn_transfer}, + {"execute_application", NULL, CALLER_CONTROL_EXEC_APP, conference_loop_fn_exec_app} }; #define CCFNTBL_QTY (sizeof(ccfntbl)/sizeof(ccfntbl[0])) From anthm at freeswitch.org Fri May 1 08:00:31 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Fri, 01 May 2009 10:00:31 -0500 Subject: [Freeswitch-svn] [commit] r13217 - freeswitch/trunk/libs/esl/src Message-ID: Author: anthm Date: Fri May 1 10:00:31 2009 New Revision: 13217 Log: ESL-12 Modified: freeswitch/trunk/libs/esl/src/esl.c Modified: freeswitch/trunk/libs/esl/src/esl.c ============================================================================== --- freeswitch/trunk/libs/esl/src/esl.c (original) +++ freeswitch/trunk/libs/esl/src/esl.c Fri May 1 10:00:31 2009 @@ -789,7 +789,9 @@ } esl_mutex_lock(handle->mutex); - + esl_event_safe_destroy(&handle->last_event); + esl_event_safe_destroy(&handle->last_ievent); + if (check_q && handle->race_event) { qevent = handle->race_event; handle->race_event = handle->race_event->next; @@ -806,7 +808,6 @@ return ESL_SUCCESS; } - esl_event_safe_destroy(&handle->last_event); memset(handle->header_buf, 0, sizeof(handle->header_buf)); c = handle->header_buf; @@ -907,13 +908,11 @@ if (!esl_safe_strcasecmp(hval, "text/disconnect-notice") && revent->body) { goto fail; } - + if (!esl_safe_strcasecmp(hval, "text/event-plain") && revent->body) { esl_event_types_t et = ESL_EVENT_COMMAND; char *body = strdup(revent->body); - esl_event_safe_destroy(&handle->last_ievent); - esl_event_create(&handle->last_ievent, et); beg = body; From rupa at freeswitch.org Fri May 1 09:22:36 2009 From: rupa at freeswitch.org (FreeSWITCH SVN) Date: Fri, 01 May 2009 11:22:36 -0500 Subject: [Freeswitch-svn] [commit] r13218 - freeswitch/trunk/src/mod/formats/mod_shout Message-ID: Author: rupa Date: Fri May 1 11:22:36 2009 New Revision: 13218 Log: Fix race condition between shout thread starting and shout_file_read Fix race condition between thread terminating and context being cleaned up Fix stutter when first 64k is drained from shoutcast streaming buffer Reduce the amount of padding from around 6s to 1s if the stream goes away or runs slow Modified: freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c Modified: freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c ============================================================================== --- freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c (original) +++ freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c Fri May 1 11:22:36 2009 @@ -24,6 +24,7 @@ * Contributor(s): * * Anthony Minessale II + * Rupa Schomaker * * mod_shout.c -- Icecast Module * @@ -122,6 +123,7 @@ switch_size_t rlen; unsigned char *mp3buf; switch_size_t mp3buflen; + switch_thread_rwlock_t *rwlock; }; typedef struct shout_context shout_context_t; @@ -134,6 +136,7 @@ if (context) { context->err++; + switch_thread_rwlock_wrlock(context->rwlock); if (context->fd) { switch_file_close(context->fd); @@ -201,6 +204,9 @@ if (context->mh) { mpg123_delete(context->mh); } + + switch_thread_rwlock_unlock(context->rwlock); + switch_thread_rwlock_destroy(context->rwlock); } } @@ -405,7 +411,8 @@ unsigned char *out; int outlen; int usedlen; - uint32_t used, buf_size = 1024 * 64; + uint32_t used, buf_size = 1024 * 128; /* do not make this 64 or less, stutter will ensue after + first 64k buffer is dry */ in = ptr; inlen = realsize; @@ -433,7 +440,7 @@ switch_mutex_unlock(context->audio_mutex); if (used < buf_size) { - //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Buffered %u/%u!\n", used, buf_size); + /* switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Buffered %u/%u!\n", used, buf_size); */ break; } @@ -506,6 +513,8 @@ { CURL *curl_handle = NULL; shout_context_t *context = (shout_context_t *) obj; + + switch_thread_rwlock_rdlock(context->rwlock); curl_handle = curl_easy_init(); curl_easy_setopt(curl_handle, CURLOPT_URL, context->stream_url); @@ -516,11 +525,13 @@ curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "FreeSWITCH(mod_shout)/1.0"); curl_easy_perform(curl_handle); curl_easy_cleanup(curl_handle); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Thread Done\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Read Thread Done\n"); + switch_mutex_lock(context->audio_mutex); context->err++; switch_mutex_unlock(context->audio_mutex); context->thread_running = 0; + switch_thread_rwlock_unlock(context->rwlock); return NULL; } @@ -544,9 +555,12 @@ { shout_context_t *context = (shout_context_t *) obj; + switch_thread_rwlock_rdlock(context->rwlock); + if (context->thread_running) { context->thread_running++; } else { + switch_thread_rwlock_unlock(context->rwlock); return NULL; } @@ -617,7 +631,8 @@ } error: - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Thread Done\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Write Thread Done\n"); + switch_thread_rwlock_unlock(context->rwlock); context->thread_running = 0; return NULL; } @@ -652,6 +667,7 @@ char *username, *password, *port; char *err = NULL; int portno = 0; + int sanity = 0; if ((context = switch_core_alloc(handle->memory_pool, sizeof(*context))) == 0) { return SWITCH_STATUS_MEMERR; @@ -664,6 +680,10 @@ context->memory_pool = handle->memory_pool; context->samplerate = handle->samplerate; context->handle = handle; + + switch_thread_rwlock_create(&(context->rwlock), context->memory_pool); + + switch_thread_rwlock_rdlock(context->rwlock); if (switch_test_flag(handle, SWITCH_FILE_FLAG_READ)) { if (switch_buffer_create_dynamic(&context->audio_buffer, TC_BUFFER_SIZE, TC_BUFFER_SIZE * 2, 0) != SWITCH_STATUS_SUCCESS) { @@ -682,6 +702,10 @@ context->stream_url = switch_core_sprintf(context->memory_pool, "http://%s", path); context->prebuf = handle->prebuf; launch_read_stream_thread(context); + while((switch_buffer_inuse(context->audio_buffer) < 1*2*context->samplerate) && ++sanity < 10) { + /* at least 1s of audio and up to 5s initialize */ + switch_yield(500000); + } } else { mpg123_param(context->mh, MPG123_FLAGS, MPG123_MONO_MIX, 0); if (switch_file_open(&context->fd, path, SWITCH_FOPEN_READ, SWITCH_FPROT_UREAD | SWITCH_FPROT_UWRITE, handle->memory_pool) != @@ -820,7 +844,7 @@ /* lame being lame and all has FILE * coded into it's API for some functions so we gotta use it */ if (!(context->fp = fopen(path, "wb+"))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error opening %s\n", path); - return SWITCH_STATUS_GENERR; + goto error; } } } @@ -830,10 +854,12 @@ handle->sections = 0; handle->speed = 0; handle->private_info = context; + switch_thread_rwlock_unlock(context->rwlock); return SWITCH_STATUS_SUCCESS; error: + switch_thread_rwlock_unlock(context->rwlock); if (err) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: %s\n", err); } @@ -884,7 +910,7 @@ static switch_status_t shout_file_read(switch_file_handle_t *handle, void *data, size_t *len) { shout_context_t *context = handle->private_info; - size_t rb = 0, bytes = *len * sizeof(int16_t); + size_t rb = 0, bytes = *len * sizeof(int16_t), newbytes = 0; *len = 0; @@ -905,14 +931,24 @@ } switch_mutex_unlock(context->audio_mutex); } + if (context->err) { return SWITCH_STATUS_FALSE; } - + + /* switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rb: %d, bytes: %d\n", (int) rb, (int) bytes); */ + if (rb) { *len = rb / sizeof(int16_t); } else { + /* no data, so insert 1 second of silence */ + newbytes = 2 * handle->samplerate; + if(newbytes < bytes) { + bytes = newbytes; + } + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Padding mp3 stream with 1s of empty audio. (%s)\n", context->stream_url); + memset(data, 255, bytes); *len = bytes / sizeof(int16_t); } @@ -1055,7 +1091,7 @@ id3tag_set_genre(context->gfp, string); break; default: - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Value Ignored\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Value Ignored %d, %s\n", col, string); break; } @@ -1085,7 +1121,7 @@ } break; default: - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Value Ignored\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Value Ignored %d, %s\n", col, string); break; } From anthm at freeswitch.org Fri May 1 14:31:16 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Fri, 01 May 2009 16:31:16 -0500 Subject: [Freeswitch-svn] [commit] r13219 - freeswitch/trunk/src Message-ID: Author: anthm Date: Fri May 1 16:31:16 2009 New Revision: 13219 Log: prevent buffer destroy race Modified: freeswitch/trunk/src/switch_core_io.c freeswitch/trunk/src/switch_core_session.c Modified: freeswitch/trunk/src/switch_core_io.c ============================================================================== --- freeswitch/trunk/src/switch_core_io.c (original) +++ freeswitch/trunk/src/switch_core_io.c Fri May 1 16:31:16 2009 @@ -915,6 +915,9 @@ } else { switch_size_t x; for (x = 0; x < frames; x++) { + if (switch_channel_down(session->channel) || !session->raw_write_buffer) { + goto error; + } if ((session->raw_write_frame.datalen = (uint32_t) switch_buffer_read(session->raw_write_buffer, session->raw_write_frame.data, bytes)) != 0) { int rate; Modified: freeswitch/trunk/src/switch_core_session.c ============================================================================== --- freeswitch/trunk/src/switch_core_session.c (original) +++ freeswitch/trunk/src/switch_core_session.c Fri May 1 16:31:16 2009 @@ -879,9 +879,15 @@ switch_mutex_unlock(session->resample_mutex); /* clear indications */ switch_core_session_flush_message(session); + /* wipe these, they will be recreated if need be */ - switch_buffer_destroy(&session->raw_read_buffer); + switch_mutex_lock(session->codec_write_mutex); switch_buffer_destroy(&session->raw_write_buffer); + switch_mutex_unlock(session->codec_write_mutex); + + switch_mutex_lock(session->codec_read_mutex); + switch_buffer_destroy(&session->raw_read_buffer); + switch_mutex_unlock(session->codec_read_mutex); if (flush_dtmf) { while ((has = switch_channel_has_dtmf(channel))) { From anthm at freeswitch.org Fri May 1 17:58:51 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Fri, 01 May 2009 19:58:51 -0500 Subject: [Freeswitch-svn] [commit] r13220 - in freeswitch/trunk/src/mod: endpoints/mod_sofia event_handlers/mod_event_socket Message-ID: Author: anthm Date: Fri May 1 19:58:51 2009 New Revision: 13220 Log: tweak log messages Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.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 May 1 19:58:51 2009 @@ -1880,7 +1880,7 @@ } if (!switch_strlen_zero(profile_name) && (profile = sofia_glue_find_profile(profile_name))) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Profile [%s] Already exists.\n", switch_str_nil(profile_name)); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Profile [%s] Already exists.\n", switch_str_nil(profile_name)); status = SWITCH_STATUS_FALSE; sofia_glue_release_profile(profile); return status; 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 Fri May 1 19:58:51 2009 @@ -93,6 +93,7 @@ static struct { switch_mutex_t *listener_mutex; switch_event_node_t *node; + int debug; } globals; static struct { @@ -235,7 +236,9 @@ } if (switch_test_flag(l, LFLAG_STATEFUL) && l->timeout && switch_epoch_time_now(NULL) - l->last_flush > l->timeout) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Stateful Listener %u has expired\n", l->id); + if (globals.debug > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Stateful Listener %u has expired\n", l->id); + } remove_listener(l); expire_listener(&l); continue; @@ -814,8 +817,11 @@ stream->write_function(stream, " Listener %u Created\n", listener->id); xmlize_listener(listener, stream); stream->write_function(stream, "\n"); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Creating event-sink listener [%u]\n", listener->id); + if (globals.debug > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Creating event-sink listener [%u]\n", listener->id); + } + goto end; } else if (!strcasecmp(wcmd, "destroy-listener")) { char *id = switch_event_get_header(stream->param_event, "listen-id"); @@ -826,7 +832,9 @@ } if ((listener = find_listener(idl))) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Destroying event-sink listener [%u]\n", idl); + if (globals.debug > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Destroying event-sink listener [%u]\n", idl); + } remove_listener(listener); stream->write_function(stream, "\n listener %u destroyed\n", listener->id); xmlize_listener(listener, stream); @@ -834,7 +842,9 @@ expire_listener(&listener); goto end; } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Request to destroy unknown event-sink listener [%u]\n", idl); + if (globals.debug > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Request to destroy unknown event-sink listener [%u]\n", idl); + } stream->write_function(stream, "Can't find listener\n"); goto end; } @@ -2003,10 +2013,12 @@ } } - if (switch_strlen_zero(listener->remote_ip)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connection Open\n"); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connection Open from %s:%d\n", listener->remote_ip, listener->remote_port); + if (globals.debug > 0) { + if (switch_strlen_zero(listener->remote_ip)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connection Open\n"); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connection Open from %s:%d\n", listener->remote_ip, listener->remote_port); + } } switch_socket_opt_set(listener->sock, SWITCH_SO_NONBLOCK, TRUE); @@ -2106,7 +2118,9 @@ remove_listener(listener); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Session complete, waiting for children\n"); + if (globals.debug > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Session complete, waiting for children\n"); + } switch_thread_rwlock_wrlock(listener->rwlock); flush_listener(listener, SWITCH_TRUE, SWITCH_TRUE); @@ -2145,7 +2159,10 @@ switch_thread_rwlock_unlock(listener->rwlock); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connection Closed\n"); + if (globals.debug > 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connection Closed\n"); + } + switch_core_hash_destroy(&listener->event_hash); if (listener->session) { @@ -2194,6 +2211,8 @@ if (!strcmp(var, "listen-ip")) { set_pref_ip(val); + } else if (!strcmp(var, "debug")) { + globals.debug = atoi(val); } else if (!strcmp(var, "listen-port")) { prefs.port = (uint16_t) atoi(val); } else if (!strcmp(var, "password")) { From trixter at freeswitch.org Fri May 1 18:18:57 2009 From: trixter at freeswitch.org (FreeSWITCH SVN) Date: Fri, 01 May 2009 20:18:57 -0500 Subject: [Freeswitch-svn] [commit] r13221 - freeswitch/trunk/scripts/contrib/trixter/skypiax Message-ID: Author: trixter Date: Fri May 1 20:18:57 2009 New Revision: 13221 Log: patches to skypiax to remove some duplicate code, *minor* performance tweaks Added: freeswitch/trunk/scripts/contrib/trixter/skypiax/ freeswitch/trunk/scripts/contrib/trixter/skypiax/README freeswitch/trunk/scripts/contrib/trixter/skypiax/mod_skypiax.c.r13219.svndiff Added: freeswitch/trunk/scripts/contrib/trixter/skypiax/README ============================================================================== --- (empty file) +++ freeswitch/trunk/scripts/contrib/trixter/skypiax/README Fri May 1 20:18:57 2009 @@ -0,0 +1,2 @@ +I am putting my patches and such in here so that people cna use them and test them, I did not feel like maintaining my own skypiax at this point, I will see how the patching parts go and if there are any conflicts between my ideas for this and other peoples ideas. + Added: freeswitch/trunk/scripts/contrib/trixter/skypiax/mod_skypiax.c.r13219.svndiff ============================================================================== --- (empty file) +++ freeswitch/trunk/scripts/contrib/trixter/skypiax/mod_skypiax.c.r13219.svndiff Fri May 1 20:18:57 2009 @@ -0,0 +1,144 @@ +Index: src/mod/endpoints/mod_skypiax/mod_skypiax.c +=================================================================== +--- src/mod/endpoints/mod_skypiax/mod_skypiax.c (revision 13219) ++++ src/mod/endpoints/mod_skypiax/mod_skypiax.c (working copy) +@@ -27,9 +27,9 @@ + * + * + * Further Contributors: ++ * Bret McDanel + * + * +- * + * mod_skypiax.c -- Skype compatible Endpoint Module + * + */ +@@ -338,13 +338,9 @@ + switch_frame_t ** frame, switch_io_flag_t flags, + int stream_id) + { +- switch_channel_t *channel = NULL; + private_t *tech_pvt = NULL; + switch_byte_t *data; + +- channel = switch_core_session_get_channel(session); +- switch_assert(channel != NULL); +- + tech_pvt = switch_core_session_get_private(session); + switch_assert(tech_pvt != NULL); + tech_pvt->read_frame.flags = SFF_NONE; +@@ -408,13 +404,9 @@ + switch_frame_t * frame, switch_io_flag_t flags, + int stream_id) + { +- switch_channel_t *channel = NULL; + private_t *tech_pvt = NULL; + unsigned int sent; + +- channel = switch_core_session_get_channel(session); +- switch_assert(channel != NULL); +- + tech_pvt = switch_core_session_get_private(session); + switch_assert(tech_pvt != NULL); + +@@ -444,11 +436,7 @@ + static switch_status_t channel_answer_channel(switch_core_session_t * session) + { + private_t *tech_pvt; +- switch_channel_t *channel = NULL; + +- channel = switch_core_session_get_channel(session); +- switch_assert(channel != NULL); +- + tech_pvt = switch_core_session_get_private(session); + switch_assert(tech_pvt != NULL); + +@@ -460,12 +448,8 @@ + 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; + +- channel = switch_core_session_get_channel(session); +- switch_assert(channel != NULL); +- + tech_pvt = (private_t *) switch_core_session_get_private(session); + switch_assert(tech_pvt != NULL); + +@@ -655,14 +639,11 @@ + { + private_t *tech_pvt = obj; + int res; +- int forever = 1; + + DEBUGA_SKYPE("In skypiax_signaling_thread_func: started, p=%p\n", SKYPIAX_P_LOG, + (void *) tech_pvt); + +- while (forever) { +- if (!running) +- break; ++ while (running) { + res = skypiax_signaling_read(tech_pvt); + if (res == CALLFLOW_INCOMING_HANGUP) { + switch_core_session_t *session = NULL; +@@ -912,7 +893,6 @@ + switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].dialplan, dialplan); + switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].destination, + destination); +- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].context, context); + + DEBUGA_SKYPE + ("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].X11_display=%s\n", +@@ -944,9 +924,6 @@ + ("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].destination=%s\n", + SKYPIAX_P_LOG, interface_id, + globals.SKYPIAX_INTERFACES[interface_id].destination); +- DEBUGA_SKYPE +- ("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].context=%s\n", +- SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].context); + WARNINGA("STARTING interface_id=%d\n", SKYPIAX_P_LOG, interface_id); + + switch_threadattr_create(&skypiax_api_thread_attr, skypiax_module_pool); +@@ -1036,8 +1013,6 @@ + i, i, globals.SKYPIAX_INTERFACES[i].dialplan); + DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].destination=%s\n", + SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].destination); +- DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].context=%s\n", SKYPIAX_P_LOG, i, +- i, globals.SKYPIAX_INTERFACES[i].context); + } + } + } +@@ -1348,10 +1323,9 @@ + private_t *find_available_skypiax_interface(void) + { + private_t *tech_pvt = NULL; +- int found = 0; + int i; + +- for (i = 0; !found && i < SKYPIAX_MAX_INTERFACES; i++) { ++ for (i = 0; i < SKYPIAX_MAX_INTERFACES; i++) { + if (strlen(globals.SKYPIAX_INTERFACES[i].name)) { + int skype_state = 0; + +@@ -1359,17 +1333,13 @@ + skype_state = tech_pvt->interface_state; + DEBUGA_SKYPE("skype interface: %d, name: %s, state: %d\n", SKYPIAX_P_LOG, i, + globals.SKYPIAX_INTERFACES[i].name, skype_state); +- if (SKYPIAX_STATE_DOWN == skype_state || 0 == skype_state) { +- found = 1; +- break; ++ if (SKYPIAX_STATE_DOWN == skype_state || 0 == skype_state) { ++ return tech_pvt; + } + } + } + +- if (found) +- return tech_pvt; +- else +- return NULL; ++ return NULL; + } + + SWITCH_STANDARD_API(sk_function) From anthm at freeswitch.org Sat May 2 20:15:42 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Sat, 02 May 2009 22:15:42 -0500 Subject: [Freeswitch-svn] [commit] r13222 - in freeswitch/trunk/src/mod: endpoints/mod_sofia formats/mod_local_stream Message-ID: Author: anthm Date: Sat May 2 22:15:42 2009 New Revision: 13222 Log: refactor resampling in mod_local_stream Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.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 Sat May 2 22:15:42 2009 @@ -1248,11 +1248,11 @@ } else { switch_set_string(ref_to, msg->string_arg); } + switch_yield(10); nua_refer(tech_pvt->nh, SIPTAG_REFER_TO_STR(ref_to), SIPTAG_REFERRED_BY_STR(tech_pvt->contact_url), TAG_END()); switch_mutex_unlock(tech_pvt->sofia_mutex); sofia_wait_for_reply(tech_pvt, 9999, 300); switch_mutex_lock(tech_pvt->sofia_mutex); - if ((var = switch_channel_get_variable(tech_pvt->channel, "sip_refer_reply"))) { msg->string_reply = switch_core_session_strdup(session, var); } else { Modified: freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c ============================================================================== --- freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c (original) +++ freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c Sat May 2 22:15:42 2009 @@ -184,7 +184,7 @@ fname = path_buf; fh.prebuf = source->prebuf; fh.pre_buffer_datalen = source->prebuf; - + if (switch_core_file_open(&fh, (char *) fname, source->channels, source->rate, SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, NULL) != SWITCH_STATUS_SUCCESS) { @@ -192,10 +192,7 @@ switch_yield(1000000); continue; } - - source->rate = fh.samplerate; - source->samples = switch_samples_per_packet(fh.native_rate, source->interval); - + if (switch_core_timer_init(&timer, source->timer_name, source->interval, source->samples, source->pool) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Can't start timer.\n"); switch_dir_close(source->dir_handle); From brian at freeswitch.org Sun May 3 08:33:48 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Sun, 03 May 2009 10:33:48 -0500 Subject: [Freeswitch-svn] [commit] r13223 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: brian Date: Sun May 3 10:33:48 2009 New Revision: 13223 Log: remove accidental commit 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 Sun May 3 10:33:48 2009 @@ -1248,7 +1248,6 @@ } else { switch_set_string(ref_to, msg->string_arg); } - switch_yield(10); nua_refer(tech_pvt->nh, SIPTAG_REFER_TO_STR(ref_to), SIPTAG_REFERRED_BY_STR(tech_pvt->contact_url), TAG_END()); switch_mutex_unlock(tech_pvt->sofia_mutex); sofia_wait_for_reply(tech_pvt, 9999, 300); From rupa at freeswitch.org Mon May 4 06:42:52 2009 From: rupa at freeswitch.org (FreeSWITCH SVN) Date: Mon, 04 May 2009 08:42:52 -0500 Subject: [Freeswitch-svn] [commit] r13224 - freeswitch/trunk/src/mod/formats/mod_shout Message-ID: Author: rupa Date: Mon May 4 08:42:52 2009 New Revision: 13224 Log: connection timeout (very) slow connection timeout Timeouts needed to avoid deadlock between read thread and file close. If read thread never returns -- the file can never be closed. Modified: freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c Modified: freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c ============================================================================== --- freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c (original) +++ freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c Mon May 4 08:42:52 2009 @@ -97,6 +97,7 @@ struct shout_context { shout_t *shout; + char curl_error_buff[CURL_ERROR_SIZE]; lame_global_flags *gfp; char *stream_url; switch_mutex_t *audio_mutex; @@ -512,6 +513,7 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void *obj) { CURL *curl_handle = NULL; + CURLcode cc; shout_context_t *context = (shout_context_t *) obj; switch_thread_rwlock_rdlock(context->rwlock); @@ -523,7 +525,15 @@ curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, stream_callback); curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *) context); curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "FreeSWITCH(mod_shout)/1.0"); - curl_easy_perform(curl_handle); + curl_easy_setopt(curl_handle, CURLOPT_NOSIGNAL, 1); + curl_easy_setopt(curl_handle, CURLOPT_CONNECTTIMEOUT, 30); /* eventually timeout connect */ + curl_easy_setopt(curl_handle, CURLOPT_LOW_SPEED_LIMIT, 100); /* handle trickle connections */ + curl_easy_setopt(curl_handle, CURLOPT_LOW_SPEED_TIME, 30); + curl_easy_setopt(curl_handle, CURLOPT_ERRORBUFFER, context->curl_error_buff); + cc = curl_easy_perform(curl_handle); + if (cc && cc != CURLE_WRITE_ERROR) { /* write error is ok, we just exited from callback early */ + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "CURL returned error:[%d] %s : %s [%s]\n", cc, curl_easy_strerror(cc), context->curl_error_buff, context->stream_url); + } curl_easy_cleanup(curl_handle); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Read Thread Done\n"); From anthm at freeswitch.org Mon May 4 07:09:32 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Mon, 04 May 2009 09:09:32 -0500 Subject: [Freeswitch-svn] [commit] r13225 - freeswitch/trunk/src Message-ID: Author: anthm Date: Mon May 4 09:09:32 2009 New Revision: 13225 Log: move originate retry related vars to only be in {} not in channel variable list 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 May 4 09:09:32 2009 @@ -1048,14 +1048,8 @@ ok = 1; } else if (!strcasecmp((char *) hi->name, "instant_ringback")) { ok = 1; - } else if (!strcasecmp((char *) hi->name, "originate_retries")) { - ok = 1; - } else if (!strcasecmp((char *) hi->name, "originate_timeout")) { - ok = 1; } else if (!strcasecmp((char *) hi->name, "progress_timeout")) { ok = 1; - } else if (!strcasecmp((char *) hi->name, "originate_retry_sleep_ms")) { - ok = 1; } if (ok) { @@ -1286,6 +1280,10 @@ 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(oglobals.session, sleep_ms, SWITCH_TRUE, NULL); + if (!switch_channel_ready(caller_channel)) { + status = SWITCH_STATUS_FALSE; + goto done; + } } else { switch_yield(sleep_ms * 1000); } From anthm at freeswitch.org Mon May 4 07:36:11 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Mon, 04 May 2009 09:36:11 -0500 Subject: [Freeswitch-svn] [commit] r13226 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Mon May 4 09:36:11 2009 New Revision: 13226 Log: MODENDP-217 Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c Mon May 4 09:36:11 2009 @@ -819,7 +819,13 @@ switch_url_encode(path_val, path_encoded + 9, path_encoded_len - 9); } else if (is_nat) { char my_contact_str[1024]; - switch_snprintf(my_contact_str, sizeof(my_contact_str), "sip:%s@%s:%d", contact->m_url->url_user, url_ip, network_port); + if (sip->sip_contact->m_url->url_params) { + switch_snprintf(my_contact_str, sizeof(my_contact_str), "sip:%s@%s:%d;%s", + contact->m_url->url_user, url_ip, network_port, sip->sip_contact->m_url->url_params); + } else { + switch_snprintf(my_contact_str, sizeof(my_contact_str), "sip:%s@%s:%d", contact->m_url->url_user, url_ip, network_port); + } + path_encoded_len = (strlen(my_contact_str) * 3) + 1; switch_zmalloc(path_encoded, path_encoded_len); From mrene at freeswitch.org Mon May 4 12:56:46 2009 From: mrene at freeswitch.org (FreeSWITCH SVN) Date: Mon, 04 May 2009 14:56:46 -0500 Subject: [Freeswitch-svn] [commit] r13227 - freeswitch/trunk/src/include Message-ID: Author: mrene Date: Mon May 4 14:56:46 2009 New Revision: 13227 Log: Update doxygen for switch_channel_variable_first and switch_channel_variable_last Modified: freeswitch/trunk/src/include/switch_channel.h Modified: freeswitch/trunk/src/include/switch_channel.h ============================================================================== --- freeswitch/trunk/src/include/switch_channel.h (original) +++ freeswitch/trunk/src/include/switch_channel.h Mon May 4 14:56:46 2009 @@ -247,13 +247,16 @@ SWITCH_DECLARE(switch_status_t) switch_channel_get_variables(switch_channel_t *channel, switch_event_t **event); /*! - * Start iterating over the entries in the channel variable list. - * @param channel the channel to intterate the variales for - * @remark Use switch_hash_next and switch_hash_this with this function to iterate all the channel variables + * \brief Start iterating over the entries in the channel variable list. + * \param channel the channel to iterate the variables for + * \remark This function locks the profile mutex, use switch_channel_variable_last to unlock */ SWITCH_DECLARE(switch_event_header_t *) switch_channel_variable_first(switch_channel_t *channel); - +/*! + * \brief Stop iterating over channel variables. + * \remark Unlocks the profile mutex initially locked in switch_channel_variable_first + */ SWITCH_DECLARE(void) switch_channel_variable_last(switch_channel_t *channel); /*! From mrene at freeswitch.org Mon May 4 13:43:09 2009 From: mrene at freeswitch.org (FreeSWITCH SVN) Date: Mon, 04 May 2009 15:43:09 -0500 Subject: [Freeswitch-svn] [commit] r13228 - freeswitch/trunk/src Message-ID: Author: mrene Date: Mon May 4 15:43:09 2009 New Revision: 13228 Log: Make { } vars take precedence over channel variables 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 May 4 15:43:09 2009 @@ -1082,7 +1082,7 @@ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "variable string %d = [%s]\n", x, var_array[x]); if ((inner_var_count = switch_separate_string(var_array[x], '=', inner_var_array, (sizeof(inner_var_array) / sizeof(inner_var_array[0])))) == 2) { - + switch_event_del_header(var_event, inner_var_array[0]); switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, inner_var_array[0], inner_var_array[1]); } } From anthm at freeswitch.org Mon May 4 14:41:43 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Mon, 04 May 2009 16:41:43 -0500 Subject: [Freeswitch-svn] [commit] r13229 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Mon May 4 16:41:42 2009 New Revision: 13229 Log: fix mem corruption on failed register Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c Mon May 4 16:41:42 2009 @@ -1385,23 +1385,6 @@ if (ostate != sofia_private->gateway->state) { sofia_reg_fire_custom_gateway_state_event(sofia_private->gateway); } - - - if (status >= 300) { - if (sofia_private) { - if (sofia_private->gateway) { - nua_handle_destroy(sofia_private->gateway->nh); - sofia_private->gateway->nh = NULL; - nua_handle_bind(sofia_private->gateway->nh, NULL); - sofia_private->gateway->sofia_private = NULL; - } else { - nua_handle_destroy(nh); - } - sofia_private_free(sofia_private); - } else { - nua_handle_destroy(nh); - } - } } } From anthm at freeswitch.org Mon May 4 14:48:10 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Mon, 04 May 2009 16:48:10 -0500 Subject: [Freeswitch-svn] [commit] r13230 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Mon May 4 16:48:10 2009 New Revision: 13230 Log: fix mem corruption on failed register 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 May 4 16:48:10 2009 @@ -537,8 +537,7 @@ break; } - if ((sofia_private && sofia_private == &mod_sofia_globals.destroy_private) || - (!session && (status >= 300 && status != 401 && status != 407))) { + if ((sofia_private && sofia_private == &mod_sofia_globals.destroy_private)) { nua_handle_bind(nh, NULL); nua_handle_destroy(nh); nh = NULL; From mrene at freeswitch.org Mon May 4 15:53:41 2009 From: mrene at freeswitch.org (FreeSWITCH SVN) Date: Mon, 04 May 2009 17:53:41 -0500 Subject: [Freeswitch-svn] [commit] r13231 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: mrene Date: Mon May 4 17:53:41 2009 New Revision: 13231 Log: MODENDP-206 Ignore ptime when missing instead of using @0i - thanks stangor 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 May 4 17:53:41 2009 @@ -2487,7 +2487,11 @@ } if (match) { - switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ",%s@%uh@%di", imp->iananame, (int) map->rm_rate, ptime); + if(ptime > 0) { + switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ",%s@%uh@%di", imp->iananame, (unsigned int) map->rm_rate, ptime); + } else { + switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ",%s@%uh", imp->iananame, (unsigned int) map->rm_rate); + } already_did[imp->ianacode] = 1; break; } @@ -2524,7 +2528,11 @@ } if (match) { - switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ",%s@%uh@%di", imp->iananame, (int) map->rm_rate, ptime); + if(ptime > 0) { + switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ",%s@%uh@%di", imp->iananame, (unsigned int) map->rm_rate, ptime); + } else { + switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ",%s@%uh", imp->iananame, (unsigned int) map->rm_rate); + } already_did[imp->ianacode] = 1; break; } From anthm at freeswitch.org Tue May 5 08:09:33 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Tue, 05 May 2009 10:09:33 -0500 Subject: [Freeswitch-svn] [commit] r13233 - freeswitch/trunk/src Message-ID: Author: anthm Date: Tue May 5 10:09:32 2009 New Revision: 13233 Log: fix memory issue in core file resampling code Modified: freeswitch/trunk/src/switch_core_file.c Modified: freeswitch/trunk/src/switch_core_file.c ============================================================================== --- freeswitch/trunk/src/switch_core_file.c (original) +++ freeswitch/trunk/src/switch_core_file.c Tue May 5 10:09:32 2009 @@ -122,7 +122,7 @@ } } - if (fh->pre_buffer_datalen) { + if (0 && fh->pre_buffer_datalen) { //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Prebuffering %d bytes\n", (int)fh->pre_buffer_datalen); switch_buffer_create_dynamic(&fh->pre_buffer, fh->pre_buffer_datalen * fh->channels, fh->pre_buffer_datalen * fh->channels / 2, 0); fh->pre_buffer_data = switch_core_alloc(fh->memory_pool, fh->pre_buffer_datalen * fh->channels); @@ -232,11 +232,13 @@ switch_assert(fh->buffer); } if (!fh->dbuf || fh->dbuflen < fh->resampler->to_len * 2) { + void *mem; fh->dbuflen = fh->resampler->to_len * 2; - fh->dbuf = switch_core_alloc(fh->memory_pool, fh->dbuflen); + mem = realloc(fh->dbuf, fh->dbuflen); + switch_assert(mem); + fh->dbuf = mem; } - switch_assert(fh->resampler->to_len <= fh->dbuflen); - + switch_assert(fh->resampler->to_len * 2 <= fh->dbuflen); memcpy((int16_t *) fh->dbuf, fh->resampler->to, fh->resampler->to_len * 2); switch_buffer_write(fh->buffer, fh->dbuf, fh->resampler->to_len * 2); @@ -286,10 +288,13 @@ if (fh->resampler->to_len > orig_len * fh->channels) { if (!fh->dbuf) { + void *mem; fh->dbuflen = fh->resampler->to_len * 2; - fh->dbuf = switch_core_alloc(fh->memory_pool, fh->dbuflen); + mem = realloc(fh->dbuf, fh->dbuflen); + switch_assert(mem); + fh->dbuf = mem; } - switch_assert(fh->resampler->to_len <= fh->dbuflen); + switch_assert(fh->resampler->to_len * 2 <= fh->dbuflen); memcpy(fh->dbuf, fh->resampler->to, fh->resampler->to_len * 2); data = fh->dbuf; } else { @@ -314,13 +319,14 @@ rlen = switch_buffer_inuse(fh->pre_buffer); if (rlen >= fh->pre_buffer_datalen) { - blen = switch_buffer_read(fh->pre_buffer, fh->pre_buffer_data, fh->pre_buffer_datalen); - if (!asis) blen /= 2; - if (fh->channels) blen /= fh->channels; - if ((status = fh->file_interface->file_write(fh, fh->pre_buffer_data, &blen)) != SWITCH_STATUS_SUCCESS) { - *len = 0; + if ((blen = switch_buffer_read(fh->pre_buffer, fh->pre_buffer_data, fh->pre_buffer_datalen))) { + if (!asis) blen /= 2; + if (fh->channels) blen /= fh->channels; + if ((status = fh->file_interface->file_write(fh, fh->pre_buffer_data, &blen)) != SWITCH_STATUS_SUCCESS) { + *len = 0; + } + fh->samples_out += blen; } - fh->samples_out += blen; } return status; @@ -409,11 +415,12 @@ int asis = switch_test_flag(fh, SWITCH_FILE_NATIVE); while((rlen = switch_buffer_inuse(fh->pre_buffer))) { - blen = switch_buffer_read(fh->pre_buffer, fh->pre_buffer_data, fh->pre_buffer_datalen); - if (!asis) blen /= 2; - if (fh->channels) blen /= fh->channels; - if (fh->file_interface->file_write(fh, fh->pre_buffer_data, &blen) != SWITCH_STATUS_SUCCESS) { - break; + if ((blen = switch_buffer_read(fh->pre_buffer, fh->pre_buffer_data, fh->pre_buffer_datalen))) { + if (!asis) blen /= 2; + if (fh->channels) blen /= fh->channels; + if (fh->file_interface->file_write(fh, fh->pre_buffer_data, &blen) != SWITCH_STATUS_SUCCESS) { + break; + } } } } @@ -432,6 +439,9 @@ switch_core_destroy_memory_pool(&fh->memory_pool); } + switch_safe_free(fh->dbuf); + + return status; } From brian at freeswitch.org Tue May 5 08:51:30 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Tue, 05 May 2009 10:51:30 -0500 Subject: [Freeswitch-svn] [commit] r13234 - freeswitch/trunk/conf/sip_profiles Message-ID: Author: brian Date: Tue May 5 10:51:30 2009 New Revision: 13234 Log: clean up 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 Tue May 5 10:51:30 2009 @@ -1,5 +1,5 @@ - + 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 Tue May 5 10:51:30 2009 @@ -1,8 +1,8 @@ - - + + Modified: freeswitch/trunk/conf/sip_profiles/internal.xml ============================================================================== --- freeswitch/trunk/conf/sip_profiles/internal.xml (original) +++ freeswitch/trunk/conf/sip_profiles/internal.xml Tue May 5 10:51:30 2009 @@ -1,12 +1,12 @@ - - - + + + From brian at freeswitch.org Tue May 5 10:30:06 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Tue, 05 May 2009 12:30:06 -0500 Subject: [Freeswitch-svn] [commit] r13235 - freeswitch/trunk/libs/esl/ruby Message-ID: Author: brian Date: Tue May 5 12:30:06 2009 New Revision: 13235 Log: ESL-15 Added: freeswitch/trunk/libs/esl/ruby/server3.rb Added: freeswitch/trunk/libs/esl/ruby/server3.rb ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/esl/ruby/server3.rb Tue May 5 12:30:06 2009 @@ -0,0 +1,66 @@ +#!/usr/bin/ruby + +# Simple Ruby ESL example that forks a new process for every connection. +# Called like this: +# +# Try pressing 5, 8 or 9 when the file is played and see what happens +# +# Contributed by Mikael Bjerkeland + +require "ESL" +require 'socket' +include Socket::Constants +bind_address = "127.0.0.1" +bind_port = 8086 + +def time_now + Time.now.strftime("%Y-%m-%d %H:%M:%S") +end + +socket = Socket.new(AF_INET, SOCK_STREAM, 0) +sockaddr = Socket.sockaddr_in(bind_port, bind_address) +socket.bind(sockaddr) +socket.listen(5) +puts "Listening for connections on #{bind_address}:#{bind_port}" +loop do + client_socket, client_sockaddr = socket.accept #_nonblock + pid = fork do + @con = ESL::ESLconnection.new(client_socket.fileno) + info = @con.getInfo + uuid = info.getHeader("UNIQUE-ID") + @con.sendRecv("myevents") + @con.sendRecv("divert_events on") + + puts "#{time_now} [#{uuid}] Call to [#{info.getHeader("Caller-Destination-Number")}]" + @con.execute("log", "1, Wee-wa-wee-wa") + @con.execute("info", "") + @con.execute("answer", "") + @con.execute("playback", "/usr/local/freeswitch/sounds/music/8000/suite-espanola-op-47-leyenda.wav") + + while @con.connected + e = @con.recvEvent + + if e + name = e.getHeader("Event-Name") + puts "EVENT: #{name}" + break if name == "SERVER_DISCONNECTED" + if name == "DTMF" + digit = e.getHeader("DTMF-DIGIT") + duration = e.getHeader("DTMF-DURATION") + puts "DTMF DIGIT #{digit} (#{duration})" + if digit == "5" + @con.execute("log", "1, WHA HA HA. User pressed 5") + elsif digit == "8" + # TODO: close connection without hangup in order to proceed in dialplan. How? + elsif digit == "9" + @con.execute("transfer", "99355151") + end + end + + end + end + puts "Connection closed" + end + + Process.detach(pid) +end From anthm at freeswitch.org Tue May 5 12:35:31 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Tue, 05 May 2009 14:35:31 -0500 Subject: [Freeswitch-svn] [commit] r13236 - freeswitch/trunk/src/mod/endpoints/mod_loopback Message-ID: Author: anthm Date: Tue May 5 14:35:31 2009 New Revision: 13236 Log: yipee, ten millionth bug in mod_loopaback 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 Tue May 5 14:35:31 2009 @@ -542,16 +542,15 @@ *frame = NULL; - mutex = tech_pvt->mutex; - switch_mutex_lock(mutex); - - if (!switch_channel_ready(channel)) { goto end; } switch_core_timer_next(&tech_pvt->timer); + mutex = tech_pvt->mutex; + switch_mutex_lock(mutex); + if (switch_queue_trypop(tech_pvt->frame_queue, &pop) == SWITCH_STATUS_SUCCESS && pop) { if (tech_pvt->write_frame) { switch_frame_free(&tech_pvt->write_frame); From anthm at freeswitch.org Tue May 5 15:15:52 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Tue, 05 May 2009 17:15:52 -0500 Subject: [Freeswitch-svn] [commit] r13237 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Tue May 5 17:15:52 2009 New Revision: 13237 Log: fix evil send myself a refer bug FSCORE-350 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 May 5 17:15:52 2009 @@ -554,6 +554,10 @@ } if (sofia_private && sofia_private->destroy_me) { + if (tech_pvt) { + tech_pvt->sofia_private = NULL; + } + if (nh) { nua_handle_bind(nh, NULL); } From brian at freeswitch.org Tue May 5 21:41:13 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Tue, 05 May 2009 23:41:13 -0500 Subject: [Freeswitch-svn] [commit] r13238 - freeswitch/trunk/build Message-ID: Author: brian Date: Tue May 5 23:41:13 2009 New Revision: 13238 Log: bump sounds Modified: freeswitch/trunk/build/sounds_version.txt Modified: freeswitch/trunk/build/sounds_version.txt ============================================================================== --- freeswitch/trunk/build/sounds_version.txt (original) +++ freeswitch/trunk/build/sounds_version.txt Tue May 5 23:41:13 2009 @@ -1 +1 @@ -1.0.8 \ No newline at end of file +1.0.9 From robertj at freeswitch.org Wed May 6 03:38:34 2009 From: robertj at freeswitch.org (FreeSWITCH SVN) Date: Wed, 06 May 2009 05:38:34 -0500 Subject: [Freeswitch-svn] [commit] r13239 - freeswitch/trunk/src/mod/endpoints/mod_opal Message-ID: Author: robertj Date: Wed May 6 05:38:34 2009 New Revision: 13239 Log: Fixed incorrect include path. Modified: freeswitch/trunk/src/mod/endpoints/mod_opal/ (props changed) freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.h Modified: freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp (original) +++ freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp Wed May 6 05:38:34 2009 @@ -24,7 +24,7 @@ #include "mod_opal.h" #include -#include +#include #include #include Modified: freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.h ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.h (original) +++ freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.h Wed May 6 05:38:34 2009 @@ -1,275 +1,275 @@ -/* Opal endpoint interface for Freeswitch Modular Media Switching Software Library / - * Soft-Switch Application - * - * Version: MPL 1.1 - * - * Copyright (c) 2007 Tuyan Ozipek (tuyanozipek at gmail.com) - * - * 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. - * - * Contributor(s): - * Tuyan Ozipek (tuyanozipek at gmail.com) - * Lukasz Zwierko (lzwierko at gmail.com) - * Robert Jongbloed (robertj at voxlucida.com.au) - * - */ - - -#ifndef __FREESWITCH_MOD_OPAL__ -#define __FREESWITCH_MOD_OPAL__ - -#if defined(__GNUC__) && defined(HAVE_VISIBILITY) -#pragma GCC visibility push(default) -#endif - -#include -#include -#include -#include -#include - -#if defined(__GNUC__) && defined(HAVE_VISIBILITY) -#pragma GCC visibility pop -#endif - -#undef strcasecmp -#undef strncasecmp - -#define HAVE_APR -#include -#include -#define MODNAME "mod_opal" - - -class FSEndPoint; -class FSManager; - - -struct mod_opal_globals { - int trace_level; - char *codec_string; - char *context; - char *dialplan; -}; - -extern struct mod_opal_globals mod_opal_globals; - - -class FSProcess : public PLibraryProcess { - PCLASSINFO(FSProcess, PLibraryProcess); - - public: - FSProcess(); - ~FSProcess(); - - bool Initialise(switch_loadable_module_interface_t *iface); - - FSManager & GetManager() const { return *m_manager; } - - protected: - FSManager * m_manager; -}; - - -struct FSListener { - FSListener() { - } - - PString name; - OpalTransportAddress listenAddress; - PString localUserName; - PString gatekeeper; -}; - - -class FSCall : public OpalCall { - PCLASSINFO(FSCall, OpalCall); - public: - FSCall(OpalManager & manager); - virtual PBoolean OnSetUp(OpalConnection & connection); -}; - - -class FSManager : public OpalManager { - PCLASSINFO(FSManager, OpalManager); - - public: - FSManager(); - - bool Initialise(switch_loadable_module_interface_t *iface); - - switch_status_t ReadConfig(int reload); - - switch_endpoint_interface_t *GetSwitchInterface() const { - return m_FreeSwitch; - } - - virtual OpalCall * CreateCall(void * userData); - - private: - switch_endpoint_interface_t *m_FreeSwitch; - - H323EndPoint *m_h323ep; - IAX2EndPoint *m_iaxep; - FSEndPoint *m_fsep; - - PString m_gkAddress; - PString m_gkIdentifer; - PString m_gkInterface; - - list < FSListener > m_listeners; -}; - - -class FSConnection; -typedef struct { - switch_timer_t read_timer; - switch_codec_t read_codec; - switch_codec_t write_codec; - - switch_timer_t vid_read_timer; - switch_codec_t vid_read_codec; - switch_codec_t vid_write_codec; - FSConnection *me; -} opal_private_t; - - -class FSEndPoint:public OpalLocalEndPoint { - PCLASSINFO(FSEndPoint, OpalLocalEndPoint); - public: - FSEndPoint(FSManager & manager); - - virtual bool OnIncomingCall(OpalLocalConnection &); - virtual OpalLocalConnection *CreateConnection(OpalCall &, void *); -}; - - -#define DECLARE_CALLBACK0(name) \ - static switch_status_t name(switch_core_session_t *session) { \ - opal_private_t *tech_pvt = (opal_private_t *) switch_core_session_get_private(session); \ - return tech_pvt && tech_pvt->me != NULL ? tech_pvt->me->name() : SWITCH_STATUS_FALSE; } \ -switch_status_t name() - -#define DECLARE_CALLBACK1(name, type1, name1) \ - static switch_status_t name(switch_core_session_t *session, type1 name1) { \ - opal_private_t *tech_pvt = (opal_private_t *) switch_core_session_get_private(session); \ - return tech_pvt && tech_pvt->me != NULL ? tech_pvt->me->name(name1) : SWITCH_STATUS_FALSE; } \ -switch_status_t name(type1 name1) - -#define DECLARE_CALLBACK3(name, type1, name1, type2, name2, type3, name3) \ - static switch_status_t name(switch_core_session_t *session, type1 name1, type2 name2, type3 name3) { \ - opal_private_t *tech_pvt = (opal_private_t *) switch_core_session_get_private(session); \ - return tech_pvt && tech_pvt->me != NULL ? tech_pvt->me->name(name1, name2, name3) : SWITCH_STATUS_FALSE; } \ -switch_status_t name(type1 name1, type2 name2, type3 name3) - - - - -class FSConnection:public OpalLocalConnection { - PCLASSINFO(FSConnection, OpalLocalConnection) - - public: - FSConnection(OpalCall & call, - FSEndPoint & endpoint, - switch_caller_profile_t *outbound_profile, - switch_core_session_t *fsSession, - switch_channel_t *fsChannel); - - virtual bool OnIncoming(); - virtual void OnReleased(); - virtual PBoolean SetAlerting(const PString & calleeName, PBoolean withMedia); - virtual void OnAlerting(); - virtual void OnEstablished(); - virtual OpalMediaStream *CreateMediaStream(const OpalMediaFormat &, unsigned, PBoolean); - virtual PBoolean OnOpenMediaStream(OpalMediaStream & stream); - virtual OpalMediaFormatList GetMediaFormats() const; - virtual PBoolean SendUserInputTone(char tone, unsigned duration); +/* Opal endpoint interface for Freeswitch Modular Media Switching Software Library / + * Soft-Switch Application + * + * Version: MPL 1.1 + * + * Copyright (c) 2007 Tuyan Ozipek (tuyanozipek at gmail.com) + * + * 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. + * + * Contributor(s): + * Tuyan Ozipek (tuyanozipek at gmail.com) + * Lukasz Zwierko (lzwierko at gmail.com) + * Robert Jongbloed (robertj at voxlucida.com.au) + * + */ + + +#ifndef __FREESWITCH_MOD_OPAL__ +#define __FREESWITCH_MOD_OPAL__ + +#if defined(__GNUC__) && defined(HAVE_VISIBILITY) +#pragma GCC visibility push(default) +#endif + +#include +#include +#include +#include +#include + +#if defined(__GNUC__) && defined(HAVE_VISIBILITY) +#pragma GCC visibility pop +#endif + +#undef strcasecmp +#undef strncasecmp + +#define HAVE_APR +#include +#include +#define MODNAME "mod_opal" + + +class FSEndPoint; +class FSManager; + + +struct mod_opal_globals { + int trace_level; + char *codec_string; + char *context; + char *dialplan; +}; + +extern struct mod_opal_globals mod_opal_globals; + + +class FSProcess : public PLibraryProcess { + PCLASSINFO(FSProcess, PLibraryProcess); + + public: + FSProcess(); + ~FSProcess(); + + bool Initialise(switch_loadable_module_interface_t *iface); + + FSManager & GetManager() const { return *m_manager; } + + protected: + FSManager * m_manager; +}; + + +struct FSListener { + FSListener() { + } + + PString name; + OpalTransportAddress listenAddress; + PString localUserName; + PString gatekeeper; +}; + + +class FSCall : public OpalCall { + PCLASSINFO(FSCall, OpalCall); + public: + FSCall(OpalManager & manager); + virtual PBoolean OnSetUp(OpalConnection & connection); +}; + + +class FSManager : public OpalManager { + PCLASSINFO(FSManager, OpalManager); + + public: + FSManager(); + + bool Initialise(switch_loadable_module_interface_t *iface); + + switch_status_t ReadConfig(int reload); + + switch_endpoint_interface_t *GetSwitchInterface() const { + return m_FreeSwitch; + } + + virtual OpalCall * CreateCall(void * userData); + + private: + switch_endpoint_interface_t *m_FreeSwitch; + + H323EndPoint *m_h323ep; + IAX2EndPoint *m_iaxep; + FSEndPoint *m_fsep; + + PString m_gkAddress; + PString m_gkIdentifer; + PString m_gkInterface; + + list < FSListener > m_listeners; +}; + + +class FSConnection; +typedef struct { + switch_timer_t read_timer; + switch_codec_t read_codec; + switch_codec_t write_codec; + + switch_timer_t vid_read_timer; + switch_codec_t vid_read_codec; + switch_codec_t vid_write_codec; + FSConnection *me; +} opal_private_t; + + +class FSEndPoint:public OpalLocalEndPoint { + PCLASSINFO(FSEndPoint, OpalLocalEndPoint); + public: + FSEndPoint(FSManager & manager); + + virtual bool OnIncomingCall(OpalLocalConnection &); + virtual OpalLocalConnection *CreateConnection(OpalCall &, void *); +}; + + +#define DECLARE_CALLBACK0(name) \ + static switch_status_t name(switch_core_session_t *session) { \ + opal_private_t *tech_pvt = (opal_private_t *) switch_core_session_get_private(session); \ + return tech_pvt && tech_pvt->me != NULL ? tech_pvt->me->name() : SWITCH_STATUS_FALSE; } \ +switch_status_t name() + +#define DECLARE_CALLBACK1(name, type1, name1) \ + static switch_status_t name(switch_core_session_t *session, type1 name1) { \ + opal_private_t *tech_pvt = (opal_private_t *) switch_core_session_get_private(session); \ + return tech_pvt && tech_pvt->me != NULL ? tech_pvt->me->name(name1) : SWITCH_STATUS_FALSE; } \ +switch_status_t name(type1 name1) + +#define DECLARE_CALLBACK3(name, type1, name1, type2, name2, type3, name3) \ + static switch_status_t name(switch_core_session_t *session, type1 name1, type2 name2, type3 name3) { \ + opal_private_t *tech_pvt = (opal_private_t *) switch_core_session_get_private(session); \ + return tech_pvt && tech_pvt->me != NULL ? tech_pvt->me->name(name1, name2, name3) : SWITCH_STATUS_FALSE; } \ +switch_status_t name(type1 name1, type2 name2, type3 name3) + + + + +class FSConnection:public OpalLocalConnection { + PCLASSINFO(FSConnection, OpalLocalConnection) + + public: + FSConnection(OpalCall & call, + FSEndPoint & endpoint, + switch_caller_profile_t *outbound_profile, + switch_core_session_t *fsSession, + switch_channel_t *fsChannel); + + virtual bool OnIncoming(); + virtual void OnReleased(); + virtual PBoolean SetAlerting(const PString & calleeName, PBoolean withMedia); + virtual void OnAlerting(); + virtual void OnEstablished(); + virtual OpalMediaStream *CreateMediaStream(const OpalMediaFormat &, unsigned, PBoolean); + virtual PBoolean OnOpenMediaStream(OpalMediaStream & stream); + virtual OpalMediaFormatList GetMediaFormats() const; + virtual PBoolean SendUserInputTone(char tone, unsigned duration); virtual PBoolean SendUserInputString(const PString & value); - - void SetCodecs(); - - DECLARE_CALLBACK0(on_init); - DECLARE_CALLBACK0(on_routing); - DECLARE_CALLBACK0(on_execute); - - DECLARE_CALLBACK0(on_exchange_media); - DECLARE_CALLBACK0(on_soft_execute); - - DECLARE_CALLBACK1(kill_channel, int, sig); - DECLARE_CALLBACK1(send_dtmf, const switch_dtmf_t *, dtmf); - DECLARE_CALLBACK1(receive_message, switch_core_session_message_t *, msg); - DECLARE_CALLBACK1(receive_event, switch_event_t *, event); - DECLARE_CALLBACK0(state_change); - DECLARE_CALLBACK3(read_audio_frame, switch_frame_t **, frame, switch_io_flag_t, flags, int, stream_id); - DECLARE_CALLBACK3(write_audio_frame, switch_frame_t *, frame, switch_io_flag_t, flags, int, stream_id); - DECLARE_CALLBACK3(read_video_frame, switch_frame_t **, frame, switch_io_flag_t, flag, int, stream_id); - DECLARE_CALLBACK3(write_video_frame, switch_frame_t *, frame, switch_io_flag_t, flag, int, stream_id); - - switch_status_t read_frame(const OpalMediaType & mediaType, switch_frame_t **frame, switch_io_flag_t flags); - switch_status_t write_frame(const OpalMediaType & mediaType, const switch_frame_t *frame, switch_io_flag_t flags); - - switch_core_session_t *GetSession() const { - return m_fsSession; - } - - private: - FSEndPoint & m_endpoint; - switch_core_session_t *m_fsSession; - switch_channel_t *m_fsChannel; - PSyncPoint m_rxAudioOpened; - PSyncPoint m_txAudioOpened; - OpalMediaFormatList m_switchMediaFormats; -}; - - -class FSMediaStream:public OpalMediaStream { - PCLASSINFO(FSMediaStream, OpalMediaStream); - public: - FSMediaStream(FSConnection & conn, const OpalMediaFormat & mediaFormat, ///< Media format for stream - unsigned sessionID, ///< Session number for stream - bool isSource ///< Is a source stream - ); - - virtual PBoolean Open(); - virtual PBoolean Close(); - virtual PBoolean IsSynchronous() const; - virtual PBoolean RequiresPatchThread(OpalMediaStream *) const; - - switch_status_t read_frame(switch_frame_t **frame, switch_io_flag_t flags); - switch_status_t write_frame(const switch_frame_t *frame, switch_io_flag_t flags); - - private: - switch_core_session_t *m_fsSession; - switch_channel_t *m_fsChannel; - switch_timer_t *m_switchTimer; - switch_codec_t *m_switchCodec; - switch_frame_t m_readFrame; - unsigned char m_buf[SWITCH_RECOMMENDED_BUFFER_SIZE]; - RTP_DataFrame m_readRTP; - bool m_callOnStart; - uint32_t m_timeStamp; - - bool CheckPatchAndLock(); -}; - - -#endif /* __FREESWITCH_MOD_OPAL__ */ - -/* For Emacs: - * Local Variables: - * mode:c - * indent-tabs-mode:nil - * tab-width:4 - * c-basic-offset:4 - * End: - * For VIM: - * vim:set softtabstop=4 shiftwidth=4 tabstop=4: expandtabs: - */ + + void SetCodecs(); + + DECLARE_CALLBACK0(on_init); + DECLARE_CALLBACK0(on_routing); + DECLARE_CALLBACK0(on_execute); + + DECLARE_CALLBACK0(on_exchange_media); + DECLARE_CALLBACK0(on_soft_execute); + + DECLARE_CALLBACK1(kill_channel, int, sig); + DECLARE_CALLBACK1(send_dtmf, const switch_dtmf_t *, dtmf); + DECLARE_CALLBACK1(receive_message, switch_core_session_message_t *, msg); + DECLARE_CALLBACK1(receive_event, switch_event_t *, event); + DECLARE_CALLBACK0(state_change); + DECLARE_CALLBACK3(read_audio_frame, switch_frame_t **, frame, switch_io_flag_t, flags, int, stream_id); + DECLARE_CALLBACK3(write_audio_frame, switch_frame_t *, frame, switch_io_flag_t, flags, int, stream_id); + DECLARE_CALLBACK3(read_video_frame, switch_frame_t **, frame, switch_io_flag_t, flag, int, stream_id); + DECLARE_CALLBACK3(write_video_frame, switch_frame_t *, frame, switch_io_flag_t, flag, int, stream_id); + + switch_status_t read_frame(const OpalMediaType & mediaType, switch_frame_t **frame, switch_io_flag_t flags); + switch_status_t write_frame(const OpalMediaType & mediaType, const switch_frame_t *frame, switch_io_flag_t flags); + + switch_core_session_t *GetSession() const { + return m_fsSession; + } + + private: + FSEndPoint & m_endpoint; + switch_core_session_t *m_fsSession; + switch_channel_t *m_fsChannel; + PSyncPoint m_rxAudioOpened; + PSyncPoint m_txAudioOpened; + OpalMediaFormatList m_switchMediaFormats; +}; + + +class FSMediaStream:public OpalMediaStream { + PCLASSINFO(FSMediaStream, OpalMediaStream); + public: + FSMediaStream(FSConnection & conn, const OpalMediaFormat & mediaFormat, ///< Media format for stream + unsigned sessionID, ///< Session number for stream + bool isSource ///< Is a source stream + ); + + virtual PBoolean Open(); + virtual PBoolean Close(); + virtual PBoolean IsSynchronous() const; + virtual PBoolean RequiresPatchThread(OpalMediaStream *) const; + + switch_status_t read_frame(switch_frame_t **frame, switch_io_flag_t flags); + switch_status_t write_frame(const switch_frame_t *frame, switch_io_flag_t flags); + + private: + switch_core_session_t *m_fsSession; + switch_channel_t *m_fsChannel; + switch_timer_t *m_switchTimer; + switch_codec_t *m_switchCodec; + switch_frame_t m_readFrame; + unsigned char m_buf[SWITCH_RECOMMENDED_BUFFER_SIZE]; + RTP_DataFrame m_readRTP; + bool m_callOnStart; + uint32_t m_timeStamp; + + bool CheckPatchAndLock(); +}; + + +#endif /* __FREESWITCH_MOD_OPAL__ */ + +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:nil + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4: expandtabs: + */ From anthm at freeswitch.org Wed May 6 06:55:46 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 06 May 2009 08:55:46 -0500 Subject: [Freeswitch-svn] [commit] r13240 - freeswitch/trunk/src/mod/applications/mod_fifo Message-ID: Author: anthm Date: Wed May 6 08:55:46 2009 New Revision: 13240 Log: MODAPP-272 + a few more goodies, abandon outbound calls when they are not needed, place queue name in the caller id Modified: freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c 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 Wed May 6 08:55:46 2009 @@ -50,6 +50,7 @@ switch_hash_t *consumer_hash; int caller_count; int consumer_count; + int ring_consumer_count; switch_time_t start_waiting; uint32_t importance; switch_thread_rwlock_t *rwlock; @@ -458,6 +459,17 @@ char *app_name, *arg = NULL; char sql[256] = ""; const char *member_wait = NULL; + fifo_node_t *node = NULL; + + switch_mutex_lock(globals.mutex); + node = switch_core_hash_find(globals.fifo_hash, h->node_name); + switch_mutex_unlock(globals.mutex); + + if (node) { + switch_mutex_lock(node->mutex); + node->ring_consumer_count++; + switch_mutex_unlock(node->mutex); + } 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); @@ -490,6 +502,11 @@ end: + if (node) { + switch_mutex_lock(node->mutex); + if (node->ring_consumer_count-- < 0) node->ring_consumer_count = 0; + switch_mutex_unlock(node->mutex); + } switch_core_destroy_memory_pool(&h->pool); return NULL; @@ -532,7 +549,7 @@ sql = switch_mprintf("select uuid, fifo_name, originate_string, simo_count, use_count, timeout, lag, " "next_avail, expires, static, outbound_call_count, outbound_fail_count, hostname " "from fifo_outbound where (fifo_name = '%q') and (use_count < simo_count) and (next_avail = 0 or next_avail <= %ld) " - "order by outbound_call_count", node->name, (long) switch_epoch_time_now(NULL)); + "order by next_avail", node->name, (long) switch_epoch_time_now(NULL)); switch_assert(sql); fifo_execute_sql_callback(globals.sql_mutex, sql, place_call_callback, &need); @@ -561,9 +578,9 @@ idle_consumers = node_idle_consumers(node); //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, - //"%s waiting %d consumer_total %d idle_consumers %d\n", node->name, ppl_waiting, consumer_total, idle_consumers); + //"%s waiting %d consumer_total %d idle_consumers %d ring_consumers\n", node->name, ppl_waiting, consumer_total, idle_consumers, node->ring_consumer_count); - if (ppl_waiting && (!consumer_total || !idle_consumers)) { + if ((ppl_waiting - node->ring_consumer_count > 0)&& (!consumer_total || !idle_consumers)) { find_consumers(node); } switch_mutex_unlock(node->mutex); @@ -607,6 +624,19 @@ return 0; } +static void check_cancel(fifo_node_t *node) +{ + int ppl_waiting = node_consumer_wait_count(node); + + if (node->ring_consumer_count > 0 && ppl_waiting < 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Outbound call count (%d) exceeds required value for queue %s (%d), " + "Ending extraneous calls\n", node->ring_consumer_count, node->name, ppl_waiting); + + + switch_core_session_hupall_matching_var("fifo_hangup_check", node->name, SWITCH_CAUSE_ORIGINATOR_CANCEL); + } +} + static void send_presence(fifo_node_t *node) { switch_event_t *event; @@ -708,6 +738,8 @@ return; } + switch_channel_set_variable(channel, "fifo_hangup_check", NULL); + mydata = switch_core_session_strdup(session, data); switch_assert(mydata); @@ -977,6 +1009,7 @@ switch_core_hash_delete(node->caller_hash, uuid); switch_mutex_unlock(node->mutex); send_presence(node); + check_cancel(node); switch_mutex_unlock(globals.mutex); } @@ -1224,7 +1257,8 @@ switch_core_hash_delete(node->caller_hash, uuid); switch_mutex_unlock(node->mutex); send_presence(node); - + check_cancel(node); + if (app) { extension = switch_caller_extension_new(other_session, app, arg); @@ -1308,6 +1342,7 @@ switch_core_hash_delete(node->caller_hash, uuid); switch_mutex_unlock(node->mutex); send_presence(node); + check_cancel(node); switch_core_session_rwunlock(other_session); switch_safe_free(uuid); @@ -1841,6 +1876,7 @@ const char *simo = switch_xml_attr_soft(member, "simo"); const char *lag = switch_xml_attr_soft(member, "lag"); const char *timeout = switch_xml_attr_soft(member, "timeout"); + char *name_dup, *p; char digest[SWITCH_MD5_DIGEST_STRING_SIZE] = { 0 }; switch_md5_string(digest, (void *) member->txt, strlen(member->txt)); @@ -1861,17 +1897,24 @@ } } - + name_dup = strdup(node->name); + if ((p = strchr(name_dup, '@'))) { + *p = '\0'; + } + sql = switch_mprintf("insert into fifo_outbound " "(uuid, fifo_name, originate_string, simo_count, use_count, timeout, lag, " "next_avail, expires, static, outbound_call_count, outbound_fail_count, hostname) " - "values ('%q','%q','%q',%d,%d,%d,%d,0,0,1,0,0,'%q')", - digest, node->name, member->txt, simo_i, 0, timeout_i, lag_i, globals.hostname + "values ('%q','%q'," + "'{execute_on_answer=''unset fifo_hangup_check'',fifo_hangup_check=''%q'',origination_caller_id_name=Queue," + "origination_caller_id_number=''fifo+%q''}%q',%d,%d,%d,%d,0,0,1,0,0,'%q')", + + digest, node->name, node->name, name_dup, member->txt, simo_i, 0, timeout_i, lag_i, globals.hostname ); switch_assert(sql); fifo_execute_sql(sql, globals.sql_mutex); free(sql); - + free(name_dup); node->has_outbound = 1; } From anthm at freeswitch.org Wed May 6 08:13:51 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 06 May 2009 10:13:51 -0500 Subject: [Freeswitch-svn] [commit] r13241 - in freeswitch/trunk/src: . mod/applications/mod_dptools Message-ID: Author: anthm Date: Wed May 6 10:13:51 2009 New Revision: 13241 Log: add group_recurse_variables and user_recurse_variables to {} vars (default is true, set to false to not pass vars down to user or group channels) Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c freeswitch/trunk/src/switch_ivr_originate.c 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 Wed May 6 10:13:51 2009 @@ -2187,11 +2187,11 @@ switch_originate_flag_t myflags = SOF_NONE; char *cid_name_override = NULL; char *cid_num_override = NULL; - const char *var; + const char *var, *skip = NULL; unsigned int timelimit = 60; char *domain = NULL; switch_channel_t *new_channel = NULL; - + group = strdup(outbound_profile->destination_number); if (!group) goto done; @@ -2206,17 +2206,35 @@ goto done; } + + if (var_event && (skip=switch_event_get_header(var_event, "group_recurse_variables")) && switch_false(skip)) { + if ((var = switch_event_get_header(var_event, SWITCH_CALL_TIMEOUT_VARIABLE)) || + (var = switch_event_get_header(var_event, "leg_timeout"))) { + timelimit = atoi(var); + } + var_event = NULL; + } + + + template = switch_mprintf("${group_call(%s@%s)}", group, domain); if (session) { switch_channel_t *channel = switch_core_session_get_channel(session); dest = switch_channel_expand_variables(channel, template); - if ((var = switch_channel_get_variable(channel, SWITCH_CALL_TIMEOUT_VARIABLE))) { + if ((var = switch_channel_get_variable(channel, SWITCH_CALL_TIMEOUT_VARIABLE)) || + (var = switch_event_get_header(var_event, "leg_timeout"))) { timelimit = atoi(var); } } else if (var_event) { dest = switch_event_expand_headers(var_event, template); + } else { + switch_event_t *event = NULL; + switch_event_create(&event, SWITCH_EVENT_REQUEST_PARAMS); + dest = switch_event_expand_headers(event, template); + switch_event_destroy(&event); } + if (!dest) { goto done; } @@ -2224,7 +2242,8 @@ if (var_event) { cid_name_override = switch_event_get_header(var_event, "origination_caller_id_name"); cid_num_override = switch_event_get_header(var_event, "origination_caller_id_number"); - if ((var = switch_event_get_header(var_event, SWITCH_CALL_TIMEOUT_VARIABLE))) { + if ((var = switch_event_get_header(var_event, SWITCH_CALL_TIMEOUT_VARIABLE)) || + (var = switch_event_get_header(var_event, "leg_timeout"))) { timelimit = atoi(var); } } @@ -2290,6 +2309,7 @@ switch_channel_t *new_channel = NULL; switch_event_t *params = NULL; char stupid[128] = ""; + const char *skip = NULL, *var = NULL; if (switch_strlen_zero(outbound_profile->destination_number)) { goto done; @@ -2310,6 +2330,16 @@ } + if (var_event && (skip=switch_event_get_header(var_event, "user_recurse_variables")) && switch_false(skip)) { + if ((var = switch_event_get_header(var_event, SWITCH_CALL_TIMEOUT_VARIABLE)) || + (var = switch_event_get_header(var_event, "leg_timeout"))) { + timelimit = atoi(var); + } + var_event = NULL; + } + + + switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS); switch_assert(params); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "as_channel", "true"); @@ -2374,7 +2404,8 @@ if (session) { channel = switch_core_session_get_channel(session); - if ((var = switch_channel_get_variable(channel, SWITCH_CALL_TIMEOUT_VARIABLE))) { + if ((var = switch_channel_get_variable(channel, SWITCH_CALL_TIMEOUT_VARIABLE)) + || (var = switch_event_get_header(var_event, "leg_timeout"))) { timelimit = atoi(var); } @@ -2388,22 +2419,20 @@ if (var_event) { switch_event_dup(&event, var_event); - switch_event_del_header(event, "dialer_user"); - switch_event_del_header(event, "dialer_domain"); - if ((var = switch_event_get_header(var_event, SWITCH_CALL_TIMEOUT_VARIABLE))) { + switch_event_del_header(event, "dialed_user"); + switch_event_del_header(event, "dialed_domain"); + if ((var = switch_event_get_header(var_event, SWITCH_CALL_TIMEOUT_VARIABLE)) || + (var = switch_event_get_header(var_event, "leg_timeout"))) { timelimit = atoi(var); } } else { switch_event_create(&event, SWITCH_EVENT_REQUEST_PARAMS); switch_assert(event); - } - switch_assert(var_event); - - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "dialed_user", user); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "dialed_domain", domain); - d_dest = switch_event_expand_headers(event, dest); - - switch_event_destroy(&event); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "dialed_user", user); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "dialed_domain", domain); + d_dest = switch_event_expand_headers(event, dest); + switch_event_destroy(&event); + } } if ((flags & SOF_FORKED_DIAL)) { Modified: freeswitch/trunk/src/switch_ivr_originate.c ============================================================================== --- freeswitch/trunk/src/switch_ivr_originate.c (original) +++ freeswitch/trunk/src/switch_ivr_originate.c Wed May 6 10:13:51 2009 @@ -1545,7 +1545,7 @@ if (originate_status[i].peer_channel) { const char *vvar; - + if ((vvar = switch_channel_get_variable(originate_status[i].peer_channel, "leg_timeout"))) { int val = atoi(vvar); if (val > 0) { From anthm at freeswitch.org Wed May 6 08:24:04 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 06 May 2009 10:24:04 -0500 Subject: [Freeswitch-svn] [commit] r13242 - freeswitch/trunk/src/mod/applications/mod_fifo Message-ID: Author: anthm Date: Wed May 6 10:24:04 2009 New Revision: 13242 Log: MODAPP-272 Modified: freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c 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 Wed May 6 10:24:04 2009 @@ -1014,7 +1014,7 @@ } - if (cd.do_orbit && cd.orbit_exten) { + if ((switch_true(switch_channel_get_variable(channel, "fifo_caller_exit_to_orbit")) || cd.do_orbit) && cd.orbit_exten) { if (orbit_ann) { switch_ivr_play_file(session, NULL, orbit_ann, NULL); } @@ -1975,7 +1975,7 @@ static void fifo_member_add(char *fifo_name, char *originate_string, int simo_count, int timeout, int lag, time_t expires) { char digest[SWITCH_MD5_DIGEST_STRING_SIZE] = { 0 }; - char *sql; + char *sql, *name_dup, *p; fifo_node_t *node = NULL; switch_md5_string(digest, (void *) originate_string, strlen(originate_string)); @@ -1994,15 +1994,23 @@ node->has_outbound = 1; + name_dup = strdup(fifo_name); + if ((p = strchr(name_dup, '@'))) { + *p = '\0'; + } + sql = switch_mprintf("insert into fifo_outbound " "(uuid, fifo_name, originate_string, simo_count, use_count, timeout, " "lag, next_avail, expires, static, outbound_call_count, outbound_fail_count, hostname) " - "values ('%q','%q','%q',%d,%d,%d,%d,%d,%ld,0,0,0,'%q')", - digest, fifo_name, originate_string, simo_count, 0, timeout, lag, 0, (long)expires, globals.hostname + "values ('%q','%q'," + "'{execute_on_answer=''unset fifo_hangup_check'',fifo_hangup_check=''%q'',origination_caller_id_name=Queue," + "origination_caller_id_number=''fifo+%q''}%q',%d,%d,%d,%d,%d,%ld,0,0,0,'%q')", + digest, fifo_name, fifo_name, name_dup, originate_string, simo_count, 0, timeout, lag, 0, (long)expires, globals.hostname ); switch_assert(sql); fifo_execute_sql(sql, globals.sql_mutex); free(sql); + free(name_dup); } From brian at freeswitch.org Wed May 6 10:34:29 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Wed, 06 May 2009 12:34:29 -0500 Subject: [Freeswitch-svn] [commit] r13243 - freeswitch/trunk/src Message-ID: Author: brian Date: Wed May 6 12:34:29 2009 New Revision: 13243 Log: remove unused code Modified: freeswitch/trunk/src/switch_core_file.c Modified: freeswitch/trunk/src/switch_core_file.c ============================================================================== --- freeswitch/trunk/src/switch_core_file.c (original) +++ freeswitch/trunk/src/switch_core_file.c Wed May 6 12:34:29 2009 @@ -122,12 +122,6 @@ } } - if (0 && fh->pre_buffer_datalen) { - //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Prebuffering %d bytes\n", (int)fh->pre_buffer_datalen); - switch_buffer_create_dynamic(&fh->pre_buffer, fh->pre_buffer_datalen * fh->channels, fh->pre_buffer_datalen * fh->channels / 2, 0); - fh->pre_buffer_data = switch_core_alloc(fh->memory_pool, fh->pre_buffer_datalen * fh->channels); - } - if (fh->channels > 1 && (flags & SWITCH_FILE_FLAG_READ)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "File has %d channels, muxing to mono will occur.\n", fh->channels); } From brian at freeswitch.org Wed May 6 11:00:29 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Wed, 06 May 2009 13:00:29 -0500 Subject: [Freeswitch-svn] [commit] r13244 - freeswitch/trunk/src Message-ID: Author: brian Date: Wed May 6 13:00:28 2009 New Revision: 13244 Log: fix play and get digits when using phrase macros Modified: freeswitch/trunk/src/switch_ivr_play_say.c 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 Wed May 6 13:00:28 2009 @@ -340,7 +340,7 @@ switch_safe_free(substituted); - if (match && do_break && switch_true(do_break)) { + if ((match && do_break && switch_true(do_break)) || status == SWITCH_STATUS_BREAK) { break; } @@ -860,8 +860,6 @@ char *argv[128] = { 0 }; int argc; int cur; - switch_status_t rst; - switch_core_session_get_read_impl(session, &read_impl); @@ -927,8 +925,8 @@ if ((arg = strchr(dup, ':'))) { *arg++ = '\0'; } - if ((rst = switch_ivr_phrase_macro(session, dup, arg, lang, args) != SWITCH_STATUS_SUCCESS)) { - return rst; + if ((status = switch_ivr_phrase_macro(session, dup, arg, lang, args)) != SWITCH_STATUS_SUCCESS) { + return status; } continue; } else { @@ -951,8 +949,8 @@ } if (!switch_strlen_zero(engine) && !switch_strlen_zero(voice) && !switch_strlen_zero(text)) { - if ((rst = switch_ivr_speak_text(session, engine, voice, text, args)) != SWITCH_STATUS_SUCCESS) { - return rst; + if ((status = switch_ivr_speak_text(session, engine, voice, text, args)) != SWITCH_STATUS_SUCCESS) { + return status; } continue; } else if (!switch_strlen_zero(engine) && !(voice && text)) { @@ -960,8 +958,8 @@ engine = (char *) switch_channel_get_variable(channel, "tts_engine"); voice = (char *) switch_channel_get_variable(channel, "tts_voice"); if (engine && text) { - if ((rst = switch_ivr_speak_text(session, engine, voice, text, args)) != SWITCH_STATUS_SUCCESS) { - return rst; + if ((status = switch_ivr_speak_text(session, engine, voice, text, args)) != SWITCH_STATUS_SUCCESS) { + return status; } continue; } @@ -1404,8 +1402,6 @@ switch_core_timer_destroy(&timer); } - - switch_safe_free(abuf); switch_core_session_reset(session, SWITCH_FALSE, SWITCH_TRUE); From mrene at freeswitch.org Wed May 6 11:12:44 2009 From: mrene at freeswitch.org (FreeSWITCH SVN) Date: Wed, 06 May 2009 13:12:44 -0500 Subject: [Freeswitch-svn] [commit] r13245 - in freeswitch/trunk: conf/sip_profiles src/mod/endpoints/mod_sofia Message-ID: Author: mrene Date: Wed May 6 13:12:44 2009 New Revision: 13245 Log: Add sofia profile params to fine-tune timers Modified: freeswitch/trunk/conf/sip_profiles/internal.xml freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Modified: freeswitch/trunk/conf/sip_profiles/internal.xml ============================================================================== --- freeswitch/trunk/conf/sip_profiles/internal.xml (original) +++ freeswitch/trunk/conf/sip_profiles/internal.xml Wed May 6 13:12:44 2009 @@ -207,6 +207,34 @@ + + + + + + + + + + + + + + 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 May 6 13:12:44 2009 @@ -479,6 +479,10 @@ uint32_t ob_calls; uint32_t ib_failed_calls; uint32_t ob_failed_calls; + uint32_t timer_t1; + uint32_t timer_t1x64; + uint32_t timer_t2; + uint32_t timer_t4; }; struct private_object { 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 May 6 13:12:44 2009 @@ -775,6 +775,10 @@ NTATAG_DEFAULT_PROXY(profile->outbound_proxy), NTATAG_SERVER_RPORT(profile->rport_level), TPTAG_LOG(sofia_test_flag(profile, TFLAG_TPORT_LOG)), + TAG_IF(profile->timer_t1, NTATAG_SIP_T1(profile->timer_t1)), + TAG_IF(profile->timer_t1x64, NTATAG_SIP_T1X64(profile->timer_t1x64)), + TAG_IF(profile->timer_t2, NTATAG_SIP_T2(profile->timer_t2)), + TAG_IF(profile->timer_t4, NTATAG_SIP_T4(profile->timer_t4)), TAG_END()); /* Last tag should always finish the sequence */ if (!profile->nua) { @@ -1780,6 +1784,38 @@ profile->dtmf_duration = SWITCH_DEFAULT_DTMF_DURATION; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Duration out of bounds, using default of %d!\n", SWITCH_DEFAULT_DTMF_DURATION); } + } else if (!strcasecmp(var, "timer-T1")) { + int v = atoi(val); + if (v > 0) { + profile->timer_t1 = v; + } else { + profile->timer_t1 = 500; + } + nua_set_params(profile->nua, NTATAG_SIP_T1(profile->timer_t1), TAG_END()); + } else if (!strcasecmp(var, "timer-T1X64")) { + int v = atoi(val); + if (v > 0) { + profile->timer_t1x64 = v; + } else { + profile->timer_t1x64 = 32000; + } + nua_set_params(profile->nua, NTATAG_SIP_T1X64(profile->timer_t1x64), TAG_END()); + } else if (!strcasecmp(var, "timer-T2")) { + int v = atoi(val); + if (v > 0) { + profile->timer_t2 = v; + } else { + profile->timer_t2 = 4000; + } + nua_set_params(profile->nua, NTATAG_SIP_T2(profile->timer_t2), TAG_END()); + } else if (!strcasecmp(var, "timer-T4")) { + int v = atoi(val); + if (v > 0) { + profile->timer_t4 = v; + } else { + profile->timer_t4 = 4000; + } + nua_set_params(profile->nua, NTATAG_SIP_T4(profile->timer_t4), TAG_END()); } } } @@ -2408,6 +2444,34 @@ } else { profile->tls_version = 0; } + } else if (!strcasecmp(var, "timer-T1")) { + int v = atoi(val); + if (v > 0) { + profile->timer_t1 = v; + } else { + profile->timer_t1 = 500; + } + } else if (!strcasecmp(var, "timer-T1X64")) { + int v = atoi(val); + if (v > 0) { + profile->timer_t1x64 = v; + } else { + profile->timer_t1x64 = 32000; + } + } else if (!strcasecmp(var, "timer-T2")) { + int v = atoi(val); + if (v > 0) { + profile->timer_t2 = v; + } else { + profile->timer_t2 = 4000; + } + } else if (!strcasecmp(var, "timer-T4")) { + int v = atoi(val); + if (v > 0) { + profile->timer_t4 = v; + } else { + profile->timer_t4 = 4000; + } } } From anthm at freeswitch.org Wed May 6 15:52:09 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 06 May 2009 17:52:09 -0500 Subject: [Freeswitch-svn] [commit] r13246 - freeswitch/trunk/src/mod/applications/mod_dptools Message-ID: Author: anthm Date: Wed May 6 17:52:09 2009 New Revision: 13246 Log: doh Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c 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 Wed May 6 17:52:09 2009 @@ -2428,11 +2428,12 @@ } else { switch_event_create(&event, SWITCH_EVENT_REQUEST_PARAMS); switch_assert(event); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "dialed_user", user); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "dialed_domain", domain); - d_dest = switch_event_expand_headers(event, dest); - switch_event_destroy(&event); - } + } + + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "dialed_user", user); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "dialed_domain", domain); + d_dest = switch_event_expand_headers(event, dest); + switch_event_destroy(&event); } if ((flags & SOF_FORKED_DIAL)) { From mrene at freeswitch.org Wed May 6 19:05:17 2009 From: mrene at freeswitch.org (FreeSWITCH SVN) Date: Wed, 06 May 2009 21:05:17 -0500 Subject: [Freeswitch-svn] [commit] r13247 - in freeswitch/trunk/src: . mod/applications/mod_dptools Message-ID: Author: mrene Date: Wed May 6 21:05:16 2009 New Revision: 13247 Log: MODAPP-271 Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c freeswitch/trunk/src/switch_ivr_originate.c 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 Wed May 6 21:05:16 2009 @@ -2307,7 +2307,7 @@ static switch_call_cause_t cause = SWITCH_CAUSE_NONE; unsigned int timelimit = 60; switch_channel_t *new_channel = NULL; - switch_event_t *params = NULL; + switch_event_t *params = NULL, *var_event_orig = var_event; char stupid[128] = ""; const char *skip = NULL, *var = NULL; @@ -2357,7 +2357,13 @@ if (!strcasecmp(var, "dial-string")) { dest = val; - break; + } else if (!strncasecmp(var, "dial-var-", 9)) { + if (!var_event) { + switch_event_create(&var_event, SWITCH_EVENT_GENERAL); + } else { + switch_event_del_header(var_event, var + 9); + } + switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, var + 9, val); } } } @@ -2369,7 +2375,13 @@ if (!strcasecmp(var, "dial-string")) { dest = val; - break; + } else if (!strncasecmp(var, "dial-var-", 9)) { + if (!var_event) { + switch_event_create(&var_event, SWITCH_EVENT_GENERAL); + } else { + switch_event_del_header(var_event, var + 9); + } + switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, var + 9, val); } } } @@ -2381,7 +2393,13 @@ if (!strcasecmp(var, "dial-string")) { dest = val; - break; + } else if (!strncasecmp(var, "dial-var-", 9)) { + if (!var_event) { + switch_event_create(&var_event, SWITCH_EVENT_GENERAL); + } else { + switch_event_del_header(var_event, var + 9); + } + switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, var + 9, val); } } } @@ -2489,6 +2507,10 @@ if (params) { switch_event_destroy(¶ms); } + + if (var_event && var_event_orig != var_event) { + switch_event_destroy(&var_event); + } switch_safe_free(user); Modified: freeswitch/trunk/src/switch_ivr_originate.c ============================================================================== --- freeswitch/trunk/src/switch_ivr_originate.c (original) +++ freeswitch/trunk/src/switch_ivr_originate.c Wed May 6 21:05:16 2009 @@ -1006,6 +1006,24 @@ } } + if (vars) { /* Parse parameters specified from the dialstring */ + char *var_array[1024] = { 0 }; + int var_count = 0; + if ((var_count = switch_separate_string(vars, ',', var_array, (sizeof(var_array) / sizeof(var_array[0]))))) { + int x = 0; + for (x = 0; x < var_count; x++) { + char *inner_var_array[2] = { 0 }; + int inner_var_count; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "variable string %d = [%s]\n", x, var_array[x]); + if ((inner_var_count = + switch_separate_string(var_array[x], '=', inner_var_array, (sizeof(inner_var_array) / sizeof(inner_var_array[0])))) == 2) { + switch_event_del_header(var_event, inner_var_array[0]); + switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, inner_var_array[0], inner_var_array[1]); + } + } + } + } + if (oglobals.session) { switch_event_header_t *hi; const char *cdr_total_var; @@ -1020,7 +1038,7 @@ } - /* Copy all the applicable channel variables into the event */ + /* Copy all the missing applicable channel variables from A-leg into the event */ if ((hi = switch_channel_variable_first(caller_channel))) { for (; hi; hi = hi->next) { int ok = 0; @@ -1052,7 +1070,7 @@ ok = 1; } - if (ok) { + if (ok && !switch_event_get_header(var_event, hi->name)) { switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, (char *) hi->name, (char *) hi->value); } } @@ -1071,24 +1089,6 @@ */ } - if (vars) { /* Parse parameters specified from the dialstring */ - char *var_array[1024] = { 0 }; - int var_count = 0; - if ((var_count = switch_separate_string(vars, ',', var_array, (sizeof(var_array) / sizeof(var_array[0]))))) { - int x = 0; - for (x = 0; x < var_count; x++) { - char *inner_var_array[2] = { 0 }; - int inner_var_count; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "variable string %d = [%s]\n", x, var_array[x]); - if ((inner_var_count = - switch_separate_string(var_array[x], '=', inner_var_array, (sizeof(inner_var_array) / sizeof(inner_var_array[0])))) == 2) { - switch_event_del_header(var_event, inner_var_array[0]); - switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, inner_var_array[0], inner_var_array[1]); - } - } - } - } - if (caller_channel) { /* ringback is only useful when there is an originator */ ringback_data = NULL; From mrene at freeswitch.org Wed May 6 19:16:12 2009 From: mrene at freeswitch.org (FreeSWITCH SVN) Date: Wed, 06 May 2009 21:16:12 -0500 Subject: [Freeswitch-svn] [commit] r13248 - freeswitch/trunk/src Message-ID: Author: mrene Date: Wed May 6 21:16:12 2009 New Revision: 13248 Log: Don't set the caller name to origination_uuid's value 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 Wed May 6 21:16:12 2009 @@ -1410,7 +1410,6 @@ strncpy(tmp, var_begin, strlen(var_begin)); } - new_profile->caller_id_name = switch_core_strdup(new_profile->pool, tmp); switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "origination_uuid", tmp); } From anthm at freeswitch.org Thu May 7 08:07:04 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Thu, 07 May 2009 10:07:04 -0500 Subject: [Freeswitch-svn] [commit] r13249 - in freeswitch/trunk: conf/sip_profiles src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Thu May 7 10:07:04 2009 New Revision: 13249 Log: add rtp-autoflush-during-bridge param Modified: freeswitch/trunk/conf/sip_profiles/internal.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/sip_profiles/internal.xml ============================================================================== --- freeswitch/trunk/conf/sip_profiles/internal.xml (original) +++ freeswitch/trunk/conf/sip_profiles/internal.xml Thu May 7 10:07:04 2009 @@ -92,6 +92,10 @@ + + + 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 May 7 10:07:04 2009 @@ -1024,21 +1024,49 @@ case SWITCH_MESSAGE_INDICATE_BRIDGE: if (switch_rtp_ready(tech_pvt->rtp_session)) { + const char *val; + int ok = 0; + if (sofia_test_flag(tech_pvt, TFLAG_PASS_RFC2833) && switch_channel_test_flag_partner(channel, CF_FS_RTP)) { switch_rtp_set_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_PASS_RFC2833); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s activate passthru 2833 mode.\n", switch_channel_get_name(channel)); } + + if ((val = switch_channel_get_variable(channel, "rtp_autoflush_during_bridge"))) { + ok = switch_true(val); + } else { + ok = sofia_test_pflag(tech_pvt->profile, PFLAG_RTP_AUTOFLUSH_DURING_BRIDGE); + } - rtp_flush_read_buffer(tech_pvt->rtp_session, SWITCH_RTP_FLUSH_ONCE); + if (ok) { + rtp_flush_read_buffer(tech_pvt->rtp_session, SWITCH_RTP_FLUSH_STICK); + } else { + rtp_flush_read_buffer(tech_pvt->rtp_session, SWITCH_RTP_FLUSH_ONCE); + } } goto end; case SWITCH_MESSAGE_INDICATE_UNBRIDGE: if (switch_rtp_ready(tech_pvt->rtp_session)) { + const char *val; + int ok = 0; + if (switch_rtp_test_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_PASS_RFC2833)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s deactivate passthru 2833 mode.\n", switch_channel_get_name(channel)); switch_rtp_clear_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_PASS_RFC2833); } - rtp_flush_read_buffer(tech_pvt->rtp_session, SWITCH_RTP_FLUSH_ONCE); + + if ((val = switch_channel_get_variable(channel, "rtp_autoflush_during_bridge"))) { + ok = switch_true(val); + } else { + ok = sofia_test_pflag(tech_pvt->profile, PFLAG_RTP_AUTOFLUSH_DURING_BRIDGE); + } + + if (ok) { + rtp_flush_read_buffer(tech_pvt->rtp_session, SWITCH_RTP_FLUSH_STICK); + } else { + rtp_flush_read_buffer(tech_pvt->rtp_session, SWITCH_RTP_FLUSH_ONCE); + } + } goto end; case SWITCH_MESSAGE_INDICATE_AUDIO_SYNC: 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 Thu May 7 10:07:04 2009 @@ -189,6 +189,7 @@ PFLAG_NAT_OPTIONS_PING, PFLAG_AUTOFIX_TIMING, PFLAG_MESSAGE_QUERY_ON_REGISTER, + PFLAG_RTP_AUTOFLUSH_DURING_BRIDGE, /* No new flags below this line */ PFLAG_MAX } PFLAGS; 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 Thu May 7 10:07:04 2009 @@ -1557,6 +1557,12 @@ } else { sofia_clear_pflag(profile, PFLAG_CALLID_AS_UUID); } + } else if (!strcasecmp(var, "rtp-autoflush-during-bridge")) { + if (switch_true(val)) { + sofia_set_pflag(profile, PFLAG_RTP_AUTOFLUSH_DURING_BRIDGE); + } else { + sofia_clear_pflag(profile, PFLAG_RTP_AUTOFLUSH_DURING_BRIDGE); + } } else if (!strcasecmp(var, "outbound-use-uuid-as-callid")) { if (switch_true(val)) { sofia_set_pflag(profile, PFLAG_UUID_AS_CALLID); @@ -2059,6 +2065,12 @@ sofia_set_flag(profile, TFLAG_INB_NOMEDIA); } else if (!strcasecmp(var, "inbound-late-negotiation") && switch_true(val)) { sofia_set_flag(profile, TFLAG_LATE_NEGOTIATION); + } else if (!strcasecmp(var, "rtp-autoflush-during-bridge")) { + if (switch_true(val)) { + sofia_set_pflag(profile, PFLAG_RTP_AUTOFLUSH_DURING_BRIDGE); + } else { + sofia_clear_pflag(profile, PFLAG_RTP_AUTOFLUSH_DURING_BRIDGE); + } } else if (!strcasecmp(var, "inbound-proxy-media") && switch_true(val)) { sofia_set_flag(profile, TFLAG_PROXY_MEDIA); } else if (!strcasecmp(var, "force-subscription-expires")) { From anthm at freeswitch.org Thu May 7 08:07:49 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Thu, 07 May 2009 10:07:49 -0500 Subject: [Freeswitch-svn] [commit] r13250 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Thu May 7 10:07:48 2009 New Revision: 13250 Log: add rtp-autoflush-during-bridge param 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 May 7 10:07:48 2009 @@ -1062,7 +1062,7 @@ } if (ok) { - rtp_flush_read_buffer(tech_pvt->rtp_session, SWITCH_RTP_FLUSH_STICK); + rtp_flush_read_buffer(tech_pvt->rtp_session, SWITCH_RTP_FLUSH_UNSTICK); } else { rtp_flush_read_buffer(tech_pvt->rtp_session, SWITCH_RTP_FLUSH_ONCE); } From anthm at freeswitch.org Thu May 7 08:14:29 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Thu, 07 May 2009 10:14:29 -0500 Subject: [Freeswitch-svn] [commit] r13251 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Thu May 7 10:14:28 2009 New Revision: 13251 Log: sleep when loading odbc profiles to prevent connection races in underlying libs 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 Thu May 7 10:14:28 2009 @@ -2664,8 +2664,13 @@ } if (profile->sipip) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Started Profile %s [%s]\n", profile->name, url); launch_sofia_profile_thread(profile); + if (profile->odbc_dsn) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Connecting ODBC Profile %s [%s]\n", profile->name, url); + switch_yield(1000000); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Started Profile %s [%s]\n", profile->name, url); + } } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Unable to start Profile %s due to no configured sip-ip\n", profile->name); } From silik0n at freeswitch.org Thu May 7 09:40:37 2009 From: silik0n at freeswitch.org (FreeSWITCH SVN) Date: Thu, 07 May 2009 11:40:37 -0500 Subject: [Freeswitch-svn] [commit] r13252 - freeswitch/trunk/scripts/contrib/swk/php/esl_cdr Message-ID: Author: silik0n Date: Thu May 7 11:40:37 2009 New Revision: 13252 Log: ooops Modified: freeswitch/trunk/scripts/contrib/swk/php/esl_cdr/esl_cdr.php Modified: freeswitch/trunk/scripts/contrib/swk/php/esl_cdr/esl_cdr.php ============================================================================== --- freeswitch/trunk/scripts/contrib/swk/php/esl_cdr/esl_cdr.php (original) +++ freeswitch/trunk/scripts/contrib/swk/php/esl_cdr/esl_cdr.php Thu May 7 11:40:37 2009 @@ -58,49 +58,50 @@ } } - $insert = sprintf("INSERT into cdr (uuid, acctcode, ani, e164_ani, dnis, translated_dnis, e164_dnis, src_host, read_codec, write_codec, clid_name, ". - "clid_number, src_sdp, dest_sdp, originate_disposition, bridge_to_uuid, endpoint_disposition, sip_hangup_disposition, term_cause, ". - "hangup_cause, start_stamp, answer_stamp, progress_media_stamp, end_stamp, duration, billsec, progress_mediasec, billmin, ". - "carrier_id, cust_cost, carrier_cost)". - "VALUES". - "('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %s, '%s', '%s',". - "%s, %s, %s, %s, %s, %s, %s)", - $data['Unique-ID'], - $data['acctcode'], - $data['Caller-Caller-ID-Number'], - $data['Caller-Caller-ID-Number'], - urldecode($data['Caller-Destination-Number']), - urldecode($data['Caller-Destination-Number']), - urldecode($data['Caller-Destination-Number']), - $data['Caller-Network-Addr'], - $data['Channel-Read-Codec-Name']."-". $data['Channel-Read-Codec-Rate'], - $data['Channel-Write-Codec-Name']."-". $data['Channel-Write-Codec-Rate'], - urlencode($data['Caller-Caller-ID-Name']), - $data['Caller-Caller-ID-Number'], - $data['variable_switch_r_sdp'], - $data['variable_switch_m_sdp'], - $data['variable_originate_disposition'], - $data['variable_bridge_to'], - $data['variable_endpoint_disposition'], - $data['variable_sip_hangup_disposition'], - $data['variable_sip_term_cause'], - $data['variable_hangup_cause'], - urldecode($data['variable_start_stamp']) . '-05', - isset($data['variable_answer_stamp'])?'\''. urldecode($data['variable_answer_stamp']) . '-05\'':'null', - urldecode($data['variable_progress_media_stamp']) . '-05', - urldecode($data['variable_end_stamp']) . '-05', - $data['variable_duration'], - $data['variable_billsec'], - $data['variable_progress_mediasec'], - $data['variable_billsec'], - "0", - "0", - "0" - ); - - $inserted = $dbh->exec($insert); - if ($inserted < 1){ - die($db->errorInfo()); + $insert = sprintf("INSERT into cdr (uuid, acctcode, ani, e164_ani, dnis, translated_dnis, e164_dnis, src_host, read_codec, write_codec, clid_name, ". + "clid_number, src_sdp, dest_sdp, originate_disposition, bridge_to_uuid, endpoint_disposition, sip_hangup_disposition, term_cause, ". + "hangup_cause, start_stamp, answer_stamp, progress_media_stamp, end_stamp, duration, billsec, progress_mediasec, billmin, ". + "carrier_id, cust_cost, carrier_cost)". + "VALUES". + "('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %s, '%s', '%s',". + "%s, %s, %s, %s, %s, %s, %s)", + $data['Unique-ID'], + $data['acctcode'], + $data['Caller-Caller-ID-Number'], + $data['Caller-Caller-ID-Number'], + urldecode($data['Caller-Destination-Number']), + urldecode($data['Caller-Destination-Number']), + urldecode($data['Caller-Destination-Number']), + $data['Caller-Network-Addr'], + $data['Channel-Read-Codec-Name']."-". $data['Channel-Read-Codec-Rate'], + $data['Channel-Write-Codec-Name']."-". $data['Channel-Write-Codec-Rate'], + urlencode($data['Caller-Caller-ID-Name']), + $data['Caller-Caller-ID-Number'], + $data['variable_switch_r_sdp'], + $data['variable_switch_m_sdp'], + $data['variable_originate_disposition'], + $data['variable_bridge_to'], + $data['variable_endpoint_disposition'], + $data['variable_sip_hangup_disposition'], + $data['variable_sip_term_cause'], + $data['variable_hangup_cause'], + urldecode($data['variable_start_stamp']) . '-05', + isset($data['variable_answer_stamp'])?'\''. urldecode($data['variable_answer_stamp']) . '-05\'':'null', + urldecode($data['variable_progress_media_stamp']) . '-05', + urldecode($data['variable_end_stamp']) . '-05', + $data['variable_duration'], + $data['variable_billsec'], + $data['variable_progress_mediasec'], + $data['variable_billsec'], + "0", + "0", + "0" + ); + + $inserted = $dbh->exec($insert); + if ($inserted < 1){ + die($db->errorInfo()); + } } } ?> From anthm at freeswitch.org Thu May 7 10:27:16 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Thu, 07 May 2009 12:27:16 -0500 Subject: [Freeswitch-svn] [commit] r13253 - in freeswitch/trunk/src: . include Message-ID: Author: anthm Date: Thu May 7 12:27:15 2009 New Revision: 13253 Log: wait for cdr to be generated in failed cdr_x Modified: freeswitch/trunk/src/include/switch_channel.h freeswitch/trunk/src/switch_channel.c freeswitch/trunk/src/switch_ivr_originate.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 May 7 12:27:15 2009 @@ -82,6 +82,7 @@ #define switch_channel_down(_channel) (switch_channel_get_state(_channel) >= CS_HANGUP) SWITCH_DECLARE(void) switch_channel_wait_for_state(switch_channel_t *channel, switch_channel_t *other_channel, switch_channel_state_t want_state); +SWITCH_DECLARE(void) switch_channel_wait_for_state_timeout(switch_channel_t *other_channel, switch_channel_state_t want_state, uint32_t timeout); SWITCH_DECLARE(switch_status_t) switch_channel_wait_for_flag(switch_channel_t *channel, switch_channel_flag_t want_flag, switch_bool_t pres, Modified: freeswitch/trunk/src/switch_channel.c ============================================================================== --- freeswitch/trunk/src/switch_channel.c (original) +++ freeswitch/trunk/src/switch_channel.c Thu May 7 12:27:15 2009 @@ -771,6 +771,25 @@ } } + +SWITCH_DECLARE(void) switch_channel_wait_for_state_timeout(switch_channel_t *other_channel, switch_channel_state_t want_state, uint32_t timeout) +{ + switch_channel_state_t state; + uint32_t count = 0; + + for (;;) { + state = switch_channel_get_running_state(other_channel); + + if (state >= want_state) { + break; + } + switch_cond_next(); + if (++count >= timeout) { + break; + } + } +} + SWITCH_DECLARE(switch_status_t) switch_channel_wait_for_flag(switch_channel_t *channel, switch_channel_flag_t want_flag, switch_bool_t pres, Modified: freeswitch/trunk/src/switch_ivr_originate.c ============================================================================== --- freeswitch/trunk/src/switch_ivr_originate.c (original) +++ freeswitch/trunk/src/switch_ivr_originate.c Thu May 7 12:27:15 2009 @@ -2052,8 +2052,8 @@ continue; } - switch_channel_wait_for_state(caller_channel, switch_core_session_get_channel(originate_status[i].peer_session), CS_DESTROY); - + switch_channel_wait_for_state_timeout(switch_core_session_get_channel(originate_status[i].peer_session), CS_DESTROY, 5000); + if (switch_ivr_generate_xml_cdr(originate_status[i].peer_session, &cdr) == SWITCH_STATUS_SUCCESS) { if ((xml_text = switch_xml_toxml(cdr, SWITCH_FALSE))) { switch_snprintf(buf, sizeof(buf), "%s_%d", cdr_var, ++cdr_total); From mcollins at freeswitch.org Thu May 7 14:10:30 2009 From: mcollins at freeswitch.org (FreeSWITCH SVN) Date: Thu, 07 May 2009 16:10:30 -0500 Subject: [Freeswitch-svn] [commit] r13254 - freeswitch/trunk/docs Message-ID: Author: mcollins Date: Thu May 7 16:10:30 2009 New Revision: 13254 Log: Update Changelog through 5/6/2009 (r13248) Modified: freeswitch/trunk/docs/ChangeLog Modified: freeswitch/trunk/docs/ChangeLog ============================================================================== --- freeswitch/trunk/docs/ChangeLog (original) +++ freeswitch/trunk/docs/ChangeLog Thu May 7 16:10:30 2009 @@ -134,6 +134,15 @@ core: Add Q850 hangup cause variable (FSCORE-356/r:13163) core: keep presence up to date (r:13166) core: fix failed_xml_cdr_prefix is processed before all variables for the b-leg have been generated (FSCORE-357/r:13167,13176) + core: failed_xml_cdr_prefix doesn't work for list of destinations separated by pipe (FSCORE-359/r:13209) + core: add support for gcc 4.4.0 (FSCORE-355/r:13210) + core: add resume command to event socket and socket_resume variable (r:13212) + core: prevent buffer destroy race (r:13219) + core: move originate retry related vars to only be in {} not in channel variable list (r:13225) + core: Make { } vars take precedence over channel variables (r:13228) + core: fix memory issue in core file resampling code (r:13233) + core: fix play and get digits when using phrase macros (r:13244) + core: Don't set the caller name to origination_uuid's value (r:13248) docs: Fix filename references in phrase_en.xml (r:12976) docs: Update phrase_en.xml to include v1.0.8 sound prompts (r:13041) docs: Updates to phrase_es.xml (r:13067) @@ -169,6 +178,8 @@ libesl: adding sendevent example for esl perl (r:13079) libesl: send content len with body in esl sendevent (r:13168) libesl: add arbitrary notify (r:13188) + libesl: fix Phantom events when doing several bgapi calls without interleaving them with recvEvent (ESL-12/r:13217) + libesl: add Ruby example for ESL (ESL-15/r:13235) libiksemel: let return 0 be a failure on read in iks to avoid cpu race (r:13123,13124,13133) libsndfile: add executable permissions to libs/libsndfile/src/create_symbols_file.py (FSBUILD-134/r:12535) libsofiasip: Fix compile time out-of-bounds error in su_uniqueid.c (SFSIP-136/r:12914) @@ -205,6 +216,7 @@ mod_conference: dist-dtmf flag in conference (r:13191) mod_conference: add transfer action to caller-controls (r:13194) mod_conference: fix dtmf queue issue in dist-dtmf feature (MODAPP-268/r:13206) + mod_conference: add execute_application to custom controls (r:13216) mod_console: Fix mod_console (missing FD_ZERO before FD_SET) (r:13126) mod_dahdi_codec: delay init of resources until the first time they are actually used to avoid unnecessary waste of resources in hardware codec (r:12962) mod_dingaling: fix crash when unloading/reload mod_dingaling (LBDING-13/r:12612) @@ -218,6 +230,8 @@ mod_dptools: Custom events fired from event application bypass filtering mechanism (MODAPP-249/r:12894) mod_dptools: change inline limit from 4 to 128 apps (MODAPP-253/r:12957) mod_dptools: improvements to presence function (r:13164) + mod_dptools: add group_recurse_variables and user_recurse_variables to {} vars (default is true, set to false to not pass vars down to user or group channels) (r:13241,13246) + mod_dptools: add param dial-timeout to directory (MODAPP-271/r:13247) mod_enum: fix enum_auto_route (MODAPP220/r:12243) mod_erlang_event: Bind to 0.0.0.0 instead of 127.0.0.1 by default; like most erlang nodes do. (r:12249) mod_erlang_event: Reply appropriately to net_adm:ping() (r:13066) @@ -231,6 +245,8 @@ mod_fifo: fix uuid_transfer into mod_conference audio issue (MODAPP-259/r:13030) mod_fifo: add fifo_orbit_dialplan and fifo_orbit_context vars (MODAPP-189/r:13038) mod_fifo: don't do wrapup when agent is in nowait mode or call has ended (r:13094) + mod_fifo: don't call all members on on-hook mode and round robin based on next_avail (MODAPP-272/r:13240,13242) + mod_fifo: abandon outbound calls when they are not needed, place queue name in the caller id (r:13240) mod_file_string: add new module, allows for playing ! delimited lists of sound files (r:13182) mod_flite: three new voices - rms, awb (male), slt (female) (r:12166) mod_iax: make mod_iax async (r:13021) @@ -242,6 +258,7 @@ mod_limit: prevent multiple bindings of the same event_hooks to make code simpler in mod_limit (MODAPP-264/r:13113) mod_local_stream: Add show_local_stream [stream name] (MODFORM-27/r:13165) mod_local_stream: fail over to default if desired stream is not found (r:13184,13185,13186) + mod_local_stream: refactor resampling in mod_local_stream (r:13222) mod_loopback: mod_lopback: other_loopback _leg_uuid variables are sometimes unset while executing the dialplan (MODENDP-210/r:12905) mod_loopback: destroy codec (r:12936) mod_loopback: fix loopback channels that stay alive (FSCORE-349/r:12944,12953) @@ -251,6 +268,7 @@ mod_loopback: make mod_loopback render silence to prevent livelock (r:13147) mod_loopback: drop excess frames on loopback channel (r:13156,13157,13158) mod_loopback: add loopback_bowout variable (set to false to skip auto-bowout) (r:13162) + mod_loopback: mod_loopback plays noise instead of silence (MODENDP-216/r:13214) mod_lua: windows build changes to support externally built modules. (MODLANG-101/r:12237) mod_lua: fix visibility support (FSCORE-302/r:12239-12240) mod_lua: fix windows build (FSBUILD-149/r:12919) @@ -270,6 +288,7 @@ mod_opal: prevent endless loop (r:13034) mod_opal: Fixed ability to send a string as user indications (DTMF) (r:13049) mod_opal: try to flag CNG frames (MODOPAL-6/r:13098) + mod_opal: Fixed incorrect include path (r:13239) mod_perl: Libtool build fix for mod_perl: use LIBTOOL_LIB_EXTEN to make libtool-2.2 happy and CXXLINK since we are linking a C++ lib (r:13080) mod_pocketsphinx: Revamp mod_pocketsphinx to use jsgf format (r:12224) mod_portaudio: fix audio issue in portaudio (r:12669) @@ -286,6 +305,7 @@ mod_say_ru: change dollars and cents to rubles and kopecks (r:13025) mod_say_ru: add ru_ip (r:13026) mod_say_ru: Update phrase_ru.xml to include v1.0.8 sound prompts (r:13044,13045) + mod_shout: Fix race conditions; fix stutter when first 64k is drained from shoutcast stream (r:13218) mod_skel: add more example code and info (r:12459) mod_skypiax: move to trunk (r:12167) mod_skypiax: fix hang on invalid mod_skypiax.conf.xml (MODSKYPIAX-21/r:12320-12322,12343) @@ -336,6 +356,11 @@ mod_sofia: parse out alert-info and call-info from infos (r:13173) mod_sofia: add arbitrary notify (r:13187,13189) mod_sofia: add experimental NDLB-connectile-dysfunction-2.0 (r:13197~13203) + mod_sofia: allow register-transport (MODENDP-217/r:13226) + mod_sofia: fix mem corruption on failed register (r:13229,13230) + mod_sofia: Ignore ptime when missing instead of using @0i (MODENDP-206/r:13231) + mod_sofia: fix evil send myself a refer bug (FSCORE-350/r:13237) + mod_sofia: Add sofia profile params to fine-tune timers (r:13245) mod_spy: add new module, mod_spy (MODAPP-260/r:13035,13036) mod_syslog: Keep the indent string in memory (LOGGER-1/r:12852) mod_t38gateway: Introduction of the skeleton of a media bug implementing a T.38 gateway, so the From mrene at freeswitch.org Thu May 7 14:40:21 2009 From: mrene at freeswitch.org (FreeSWITCH SVN) Date: Thu, 07 May 2009 16:40:21 -0500 Subject: [Freeswitch-svn] [commit] r13255 - in freeswitch/trunk/src: . include Message-ID: Author: mrene Date: Thu May 7 16:40:21 2009 New Revision: 13255 Log: Add switch_xml_parse_str_dynamic and switch_xml_parse_str_dup Modified: freeswitch/trunk/src/include/switch_xml.h freeswitch/trunk/src/switch_xml.c Modified: freeswitch/trunk/src/include/switch_xml.h ============================================================================== --- freeswitch/trunk/src/include/switch_xml.h (original) +++ freeswitch/trunk/src/include/switch_xml.h Thu May 7 16:40:21 2009 @@ -98,6 +98,21 @@ uint32_t flags; }; +/*! + * \brief Parses a string into a switch_xml_t, ensuring the memory will be freed with switch_xml_free + * \param s The string to parse + * \param dup true if you want the string to be strdup()'d automatically + * \return the switch_xml_t or NULL if an error occured + */ +SWITCH_DECLARE(switch_xml_t) switch_xml_parse_str_dynamic(char *s, switch_bool_t dup); + +/*! + * \brief Parses a string into a switch_xml_t + * \param s The string to parse + * \return the switch_xml_t or NULL if an error occured + */ +#define switch_xml_parse_str_dup(x) switch_xml_parse_str_dynamic(x, SWITCH_TRUE) + ///\brief Given a string of xml data and its length, parses it and creates an switch_xml ///\ structure. For efficiency, modifies the data by adding null terminators ///\ and decoding ampersand sequences. If you don't want this, copy the data and Modified: freeswitch/trunk/src/switch_xml.c ============================================================================== --- freeswitch/trunk/src/switch_xml.c (original) +++ freeswitch/trunk/src/switch_xml.c Thu May 7 16:40:21 2009 @@ -902,6 +902,19 @@ free(attr); } +SWITCH_DECLARE(switch_xml_t) switch_xml_parse_str_dynamic(char *s, switch_bool_t dup) +{ + switch_xml_root_t root; + char *data = dup ? strdup(s) : s; + + if ((root = (switch_xml_root_t) switch_xml_parse_str(data, strlen(data)))) { + root->dynamic = 1; /* Make sure we free the memory is switch_xml_free() */ + return &root->xml; + } else { + return NULL; + } +} + /* parse the given xml string and return an switch_xml structure */ SWITCH_DECLARE(switch_xml_t) switch_xml_parse_str(char *s, switch_size_t len) { @@ -1552,14 +1565,9 @@ if ((conf = switch_xml_find_child(xml, "section", "name", section)) && (tag = switch_xml_find_child(conf, tag_name, key_name, key_value))) { if (clone) { - char *x; - switch_xml_root_t xmlroot = NULL; - x = switch_xml_toxml(tag, SWITCH_FALSE); + char *x = switch_xml_toxml(tag, SWITCH_FALSE); switch_assert(x); - xmlroot = (switch_xml_root_t)switch_xml_parse_str(x, strlen(x)); - xmlroot->dynamic = 1; /* free the memory in switch_xml_free */ - *root = (switch_xml_t)xmlroot; - *node = *root; + *node = *root = switch_xml_parse_str_dynamic(x, SWITCH_FALSE); /* x will be free()'d in switch_xml_free() */ switch_xml_free(xml); } else { *node = tag; From andrew at freeswitch.org Thu May 7 15:13:05 2009 From: andrew at freeswitch.org (FreeSWITCH SVN) Date: Thu, 07 May 2009 17:13:05 -0500 Subject: [Freeswitch-svn] [commit] r13256 - freeswitch/trunk/src/mod/event_handlers/mod_erlang_event Message-ID: Author: andrew Date: Thu May 7 17:13:05 2009 New Revision: 13256 Log: Use switch_xml_parse_str_dynamic so we don't leak (thanks Math) Modified: freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c Modified: freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c ============================================================================== --- freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c (original) +++ freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c Thu May 7 17:13:05 2009 @@ -434,7 +434,7 @@ if (switch_strlen_zero(xmlstr)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Result\n"); - } else if (!(xml = switch_xml_parse_str(xmlstr, strlen(xmlstr)))) { + } else if (!(xml = switch_xml_parse_str_dynamic(xmlstr, strlen(xmlstr)))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Parsing XML Result!\n"); } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "XML parsed OK!\n"); @@ -444,7 +444,6 @@ switch_core_hash_delete(ptr->listener->fetch_reply_hash, uuid_str); switch_safe_free(rep->buff); switch_safe_free(rep); - switch_safe_free(xmlstr); return xml; } From moy at freeswitch.org Thu May 7 18:25:39 2009 From: moy at freeswitch.org (FreeSWITCH SVN) Date: Thu, 07 May 2009 20:25:39 -0500 Subject: [Freeswitch-svn] [commit] r13257 - freeswitch/trunk/src/mod/codecs/mod_dahdi_codec Message-ID: Author: moy Date: Thu May 7 20:25:39 2009 New Revision: 13257 Log: set mod_dahdi_codec dahdi transcoding device sockets to non-blocking to avoid hanging when there is no data and just return 0 bytes frame Jira: MODCODEC-8 Modified: freeswitch/trunk/src/mod/codecs/mod_dahdi_codec/mod_dahdi_codec.c Modified: freeswitch/trunk/src/mod/codecs/mod_dahdi_codec/mod_dahdi_codec.c ============================================================================== --- freeswitch/trunk/src/mod/codecs/mod_dahdi_codec/mod_dahdi_codec.c (original) +++ freeswitch/trunk/src/mod/codecs/mod_dahdi_codec/mod_dahdi_codec.c Thu May 7 20:25:39 2009 @@ -32,8 +32,12 @@ #include #include +#include #include /* __u32 */ #include +#include +#include +#include /*#define DEBUG_DAHDI_CODEC 1*/ @@ -91,6 +95,7 @@ static int32_t switch_dahdi_get_transcoder(struct dahdi_transcoder_formats *fmts) { + int32_t fdflags; int32_t fd = open(transcoding_device, O_RDWR); if (fd < 0) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, @@ -105,6 +110,21 @@ close(fd); return -1; } + fdflags = fcntl(fd, F_GETFL); + if (fdflags > -1) { + fdflags |= O_NONBLOCK; + if (fcntl(fd, F_SETFL, fdflags)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not set non-block mode in %s transcoder FD: %s\n", + transcoder_name, strerror(errno)); + /* should we abort? this may cause channels to hangup when overruning the device + * see jira dahdi codec issue MODCODEC-8 (Hung Calls and Codec DAHDI G.729A 8.0k decoder error!) + * */ + } + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not get flags from %s transcoder FD: %s\n", + transcoder_name, strerror(errno)); + } + if (fmts->srcfmt & DAHDI_FORMAT_ULAW) { switch_mutex_lock(transcoder_counter_mutex); total_encoders_usage++; @@ -114,6 +134,7 @@ total_decoders_usage++; switch_mutex_unlock(transcoder_counter_mutex); } + return fd; } @@ -194,13 +215,28 @@ context->encoding_fd = -1; context->decoding_fd = -1; - /* ulaw requires 8 times more storage than g729 and 12 times more than G723, right? */ + /* ulaw requires 8 times more storage than g729 and 12 times more than G723, right? + * this can be used to calculate the target buffer when encoding and decoding + * */ context->codec_r = (codec->implementation->ianacode == CODEC_G729_IANA_CODE) ? 8 : 12; return SWITCH_STATUS_SUCCESS; } +static int wait_for_transcoder(int fd) +{ + /* let's wait a bit for the transcoder, if in 20msthe driver does not notify us that its ready to accept more works + then just bail out with 0 bytes encoded/decoded as result, I'd expect the card to hold that buffer and return it later */ + int res = 0; + struct pollfd readpoll; + memset(&readpoll, 0, sizeof(readpoll)); + readpoll.fd = fd; + readpoll.events = POLLOUT; + res = poll(&readpoll, 1, 50); + return res; +} + static switch_status_t switch_dahdi_encode(switch_codec_t *codec, switch_codec_t *other_codec, void *decoded_data, @@ -244,12 +280,26 @@ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Requested to write %d bytes to %s encoder device, but only wrote %d bytes.\n", i, transcoder_name, res); return SWITCH_STATUS_FALSE; } + res = wait_for_transcoder(context->encoding_fd); + if (-1 == res) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to poll on %s encoder device: %s.\n", transcoder_name, strerror(errno)); + return SWITCH_STATUS_FALSE; + } + if (0 == res) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No output on %s encoder device.\n", transcoder_name); + *encoded_data_len = 0; + return SWITCH_STATUS_SUCCESS; + } #ifdef DEBUG_DAHDI_CODEC - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Wrote %d bytes of decoded ulaw data.\n", res); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Attempting to read %d bytes of encoded data.\n", i/context->codec_r); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Attempting to read %d bytes of encoded data.\n", *encoded_data_len); #endif - res = read(context->encoding_fd, encoded_data, i/context->codec_r); + res = read(context->encoding_fd, encoded_data, *encoded_data_len); if (-1 == res) { + if (EAGAIN == errno || EWOULDBLOCK == errno) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No output on %s encoder device (%s).\n", transcoder_name, strerror(errno)); + *encoded_data_len = 0; + return SWITCH_STATUS_SUCCESS; + } switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to read from %s encoder device: %s.\n", transcoder_name, strerror(errno)); return SWITCH_STATUS_FALSE; } @@ -269,7 +319,8 @@ { int32_t res; short *dbuf_linear; - unsigned char dbuf_ulaw[encoded_data_len * ((struct dahdi_context*)codec->private_info)->codec_r]; + // we only can decode up to half ulaw bytes of whatever their destiny linear buffer is + unsigned char dbuf_ulaw[*decoded_data_len/2]; unsigned char *ebuf_g729; uint32_t i; struct dahdi_context *context; @@ -302,7 +353,7 @@ #endif res = write(context->decoding_fd, ebuf_g729, encoded_data_len); if (-1 == res) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to write to %s decoder device.\n", transcoder_name); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to write to %s decoder device: %s.\n", transcoder_name, strerror(errno)); return SWITCH_STATUS_FALSE; } if (encoded_data_len != res) { @@ -310,13 +361,27 @@ return SWITCH_STATUS_FALSE; } #ifdef DEBUG_DAHDI_CODEC - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Wrote %d bytes to decode.\n", res); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Attempting to read from device %d bytes of decoded ulaw data.\n", - encoded_data_len*context->codec_r); + sizeof(dbuf_ulaw)); #endif - res = read(context->decoding_fd, dbuf_ulaw, encoded_data_len*context->codec_r); + res = wait_for_transcoder(context->decoding_fd); if (-1 == res) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to read from %s encoder device: %s.\n", transcoder_name, strerror(errno)); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to poll on %s decoder device: %s.\n", transcoder_name, strerror(errno)); + return SWITCH_STATUS_FALSE; + } + if (0 == res) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No output on %s decoder device.\n", transcoder_name); + *decoded_data_len = 0; + return SWITCH_STATUS_SUCCESS; + } + res = read(context->decoding_fd, dbuf_ulaw, sizeof(dbuf_ulaw)); + if (-1 == res) { + if (EAGAIN == errno || EWOULDBLOCK == errno) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No output on %s decoder device (%s).\n", transcoder_name, strerror(errno)); + *decoded_data_len = 0; + return SWITCH_STATUS_SUCCESS; + } + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to read from %s decoder device: %s.\n", transcoder_name, strerror(errno)); return SWITCH_STATUS_FALSE; } for (i = 0; i < res; i++) { From mrene at freeswitch.org Thu May 7 21:00:14 2009 From: mrene at freeswitch.org (FreeSWITCH SVN) Date: Thu, 07 May 2009 23:00:14 -0500 Subject: [Freeswitch-svn] [commit] r13258 - freeswitch/trunk/libs/esl Message-ID: Author: mrene Date: Thu May 7 23:00:14 2009 New Revision: 13258 Log: Fix an error in fs_cli's usage Modified: freeswitch/trunk/libs/esl/fs_cli.c Modified: freeswitch/trunk/libs/esl/fs_cli.c ============================================================================== --- freeswitch/trunk/libs/esl/fs_cli.c (original) +++ freeswitch/trunk/libs/esl/fs_cli.c Thu May 7 23:00:14 2009 @@ -187,7 +187,7 @@ printf(" -?,-h --help Usage Information\n"); printf(" -H, --host=hostname Host to connect\n"); printf(" -P, --port=port Port to connect (1 - 65535)\n"); - printf(" -p, --password=FILENAME Password\n"); + printf(" -p, --password=password Password\n"); printf(" -x, --execute=command Execute Command and Exit\n"); printf(" -l, --loglevel=command Log Level\n"); printf(" -q, --quiet Disable logging\n"); From mrene at freeswitch.org Thu May 7 21:05:39 2009 From: mrene at freeswitch.org (FreeSWITCH SVN) Date: Thu, 07 May 2009 23:05:39 -0500 Subject: [Freeswitch-svn] [commit] r13259 - freeswitch/trunk/src/mod/event_handlers/mod_erlang_event Message-ID: Author: mrene Date: Thu May 7 23:05:39 2009 New Revision: 13259 Log: Properly use switch_xml_parse_str_dynamic Modified: freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c Modified: freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c ============================================================================== --- freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c (original) +++ freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c Thu May 7 23:05:39 2009 @@ -434,7 +434,7 @@ if (switch_strlen_zero(xmlstr)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Result\n"); - } else if (!(xml = switch_xml_parse_str_dynamic(xmlstr, strlen(xmlstr)))) { + } else if (!(xml = switch_xml_parse_str_dynamic(xmlstr, SWITCH_FALSE))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Parsing XML Result!\n"); } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "XML parsed OK!\n"); From mrene at freeswitch.org Thu May 7 21:33:58 2009 From: mrene at freeswitch.org (FreeSWITCH SVN) Date: Thu, 07 May 2009 23:33:58 -0500 Subject: [Freeswitch-svn] [commit] r13260 - freeswitch/trunk/src Message-ID: Author: mrene Date: Thu May 7 23:33:58 2009 New Revision: 13260 Log: Fix leak-on-failure Modified: freeswitch/trunk/src/switch_xml.c Modified: freeswitch/trunk/src/switch_xml.c ============================================================================== --- freeswitch/trunk/src/switch_xml.c (original) +++ freeswitch/trunk/src/switch_xml.c Thu May 7 23:33:58 2009 @@ -905,12 +905,18 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_parse_str_dynamic(char *s, switch_bool_t dup) { switch_xml_root_t root; - char *data = dup ? strdup(s) : s; + char *data; + + switch_assert(s); + data = dup ? strdup(s) : s; if ((root = (switch_xml_root_t) switch_xml_parse_str(data, strlen(data)))) { root->dynamic = 1; /* Make sure we free the memory is switch_xml_free() */ return &root->xml; } else { + if (dup) { + free(data); + } return NULL; } } From mrene at freeswitch.org Thu May 7 21:38:44 2009 From: mrene at freeswitch.org (FreeSWITCH SVN) Date: Thu, 07 May 2009 23:38:44 -0500 Subject: [Freeswitch-svn] [commit] r13261 - freeswitch/trunk/src/include Message-ID: Author: mrene Date: Thu May 7 23:38:44 2009 New Revision: 13261 Log: Add code analyzer tags to xml functions Modified: freeswitch/trunk/src/include/switch_xml.h Modified: freeswitch/trunk/src/include/switch_xml.h ============================================================================== --- freeswitch/trunk/src/include/switch_xml.h (original) +++ freeswitch/trunk/src/include/switch_xml.h Thu May 7 23:38:44 2009 @@ -104,7 +104,7 @@ * \param dup true if you want the string to be strdup()'d automatically * \return the switch_xml_t or NULL if an error occured */ -SWITCH_DECLARE(switch_xml_t) switch_xml_parse_str_dynamic(char *s, switch_bool_t dup); +SWITCH_DECLARE(switch_xml_t) switch_xml_parse_str_dynamic(_In_z_ char *s, _In_opt_ switch_bool_t dup); /*! * \brief Parses a string into a switch_xml_t @@ -120,7 +120,7 @@ ///\param s a string ///\param len the length of the string ///\return a formated xml node or NULL -SWITCH_DECLARE(switch_xml_t) switch_xml_parse_str(char *s, switch_size_t len); +SWITCH_DECLARE(switch_xml_t) switch_xml_parse_str(_In_z_ char *s, _In_ switch_size_t len); ///\brief A wrapper for switch_xml_parse_str() that accepts a file descriptor. First ///\ attempts to mem map the file. Failing that, reads the file into memory. @@ -132,23 +132,23 @@ ///\brief a wrapper for switch_xml_parse_fd() that accepts a file name ///\param file a file to parse ///\return a formated xml node or NULL -SWITCH_DECLARE(switch_xml_t) switch_xml_parse_file(const char *file); +SWITCH_DECLARE(switch_xml_t) switch_xml_parse_file(_In_z_ const char *file); -SWITCH_DECLARE(switch_xml_t) switch_xml_parse_file_simple(const char *file); +SWITCH_DECLARE(switch_xml_t) switch_xml_parse_file_simple(_In_z_ const char *file); ///\brief Wrapper for switch_xml_parse_str() that accepts a file stream. Reads the entire ///\ stream into memory and then parses it. For xml files, use switch_xml_parse_file() ///\ or switch_xml_parse_fd() ///\param fp a FILE pointer to parse ///\return an xml node or NULL -SWITCH_DECLARE(switch_xml_t) switch_xml_parse_fp(FILE * fp); +SWITCH_DECLARE(switch_xml_t) switch_xml_parse_fp(_In_ FILE * fp); ///\brief returns the first child tag (one level deeper) with the given name or NULL ///\ if not found ///\param xml an xml node ///\param name the name of the child tag ///\return an xml node or NULL -SWITCH_DECLARE(switch_xml_t) switch_xml_child(switch_xml_t xml, const char *name); +SWITCH_DECLARE(switch_xml_t) switch_xml_child(_In_ switch_xml_t xml, _In_z_ const char *name); ///\brief find a child tag in a node called 'childname' with an attribute 'attrname' which equals 'value' ///\param node the xml node @@ -156,8 +156,8 @@ ///\param attrname the attribute name ///\param value the value ///\return an xml node or NULL -SWITCH_DECLARE(switch_xml_t) switch_xml_find_child(switch_xml_t node, const char *childname, const char *attrname, const char *value); -SWITCH_DECLARE(switch_xml_t) switch_xml_find_child_multi(switch_xml_t node, const char *childname, ...); +SWITCH_DECLARE(switch_xml_t) switch_xml_find_child(_In_ switch_xml_t node, _In_z_ const char *childname, _In_z_ const char *attrname, _In_z_ const char *value); +SWITCH_DECLARE(switch_xml_t) switch_xml_find_child_multi(_In_ switch_xml_t node, _In_z_ const char *childname, ...); ///\brief returns the next tag of the same name in the same section and depth or NULL ///\ if not found @@ -170,7 +170,7 @@ ///\param xml the xml node ///\param idx the index ///\return an xml node or NULL - switch_xml_t switch_xml_idx(switch_xml_t xml, int idx); + switch_xml_t switch_xml_idx(_In_z_ switch_xml_t xml, _In_opt_ int idx); ///\brief returns the name of the given tag ///\param xml the xml node @@ -186,13 +186,13 @@ ///\param xml the xml node ///\param attr the attribute ///\return the value -SWITCH_DECLARE(const char *) switch_xml_attr(switch_xml_t xml, const char *attr); +SWITCH_DECLARE(const char *) switch_xml_attr(_In_ switch_xml_t xml, _In_z_ const char *attr); ///\brief returns the value of the requested tag attribute, or "" if not found ///\param xml the xml node ///\param attr the attribute ///\return the value -SWITCH_DECLARE(const char *) switch_xml_attr_soft(switch_xml_t xml, const char *attr); +SWITCH_DECLARE(const char *) switch_xml_attr_soft(_In_ switch_xml_t xml, _In_z_ const char *attr); ///\brief Traverses the switch_xml sturcture to retrieve a specific subtag. Takes a ///\ variable length list of tag names and indexes. The argument list must be @@ -202,14 +202,14 @@ ///\ Returns NULL if not found. ///\param xml the xml node ///\return an xml node or NULL -SWITCH_DECLARE(switch_xml_t) switch_xml_get(switch_xml_t xml, ...); +SWITCH_DECLARE(switch_xml_t) switch_xml_get(_In_ switch_xml_t xml, ...); ///\brief Converts an switch_xml structure back to xml. Returns a string of xml data that ///\ must be freed. ///\param xml the xml node ///\param prn_header add header too ///\return the xml text string -SWITCH_DECLARE(char *) switch_xml_toxml(switch_xml_t xml, switch_bool_t prn_header); +SWITCH_DECLARE(char *) switch_xml_toxml(_In_ switch_xml_t xml, _In_opt_ switch_bool_t prn_header); ///\brief Converts an switch_xml structure back to xml using the buffer passed in the parameters. ///\param xml the xml node @@ -218,29 +218,29 @@ ///\param offset offset to start at ///\param prn_header add header too ///\return the xml text string -SWITCH_DECLARE(char *) switch_xml_toxml_buf(switch_xml_t xml, char *buf, switch_size_t buflen, switch_size_t offset, switch_bool_t prn_header); +SWITCH_DECLARE(char *) switch_xml_toxml_buf(_In_ switch_xml_t xml, _In_z_ char *buf, _In_ switch_size_t buflen, _In_opt_ switch_size_t offset, _In_opt_ switch_bool_t prn_header); ///\brief returns a NULL terminated array of processing instructions for the given ///\ target ///\param xml the xml node ///\param target the instructions ///\return the array -SWITCH_DECLARE(const char **) switch_xml_pi(switch_xml_t xml, const char *target); +SWITCH_DECLARE(const char **) switch_xml_pi(_In_ switch_xml_t xml, _In_z_ const char *target); ///\brief frees the memory allocated for an switch_xml structure ///\param xml the xml node ///\note in the case of the root node the readlock will be lifted -SWITCH_DECLARE(void) switch_xml_free(switch_xml_t xml); -SWITCH_DECLARE(void) switch_xml_free_in_thread(switch_xml_t xml, int stacksize); +SWITCH_DECLARE(void) switch_xml_free(_In_ switch_xml_t xml); +SWITCH_DECLARE(void) switch_xml_free_in_thread(_In_ switch_xml_t xml, _In_ int stacksize); ///\brief returns parser error message or empty string if none ///\param xml the xml node ///\return the error string or nothing -SWITCH_DECLARE(const char *) switch_xml_error(switch_xml_t xml); +SWITCH_DECLARE(const char *) switch_xml_error(_In_ switch_xml_t xml); ///\brief returns a new empty switch_xml structure with the given root tag name ///\param name the name of the new root tag -SWITCH_DECLARE(switch_xml_t) switch_xml_new(const char *name); +SWITCH_DECLARE(switch_xml_t) switch_xml_new(_In_z_ const char *name); ///\brief wrapper for switch_xml_new() that strdup()s name ///\param name the name of the root @@ -253,7 +253,7 @@ ///\param name the name of the tag ///\param off the offset ///\return an xml node or NULL -SWITCH_DECLARE(switch_xml_t) switch_xml_add_child(switch_xml_t xml, const char *name, switch_size_t off); +SWITCH_DECLARE(switch_xml_t) switch_xml_add_child(_In_ switch_xml_t xml, _In_z_ const char *name, _In_opt_ switch_size_t off); ///\brief wrapper for switch_xml_add_child() that strdup()s name ///\param xml the xml node @@ -303,10 +303,10 @@ ///\brief removes a tag along with its subtags without freeing its memory ///\param xml the xml node -SWITCH_DECLARE(switch_xml_t) switch_xml_cut(switch_xml_t xml); +SWITCH_DECLARE(switch_xml_t) switch_xml_cut(_In_ switch_xml_t xml); ///\brief inserts an existing tag into an ezxml structure -SWITCH_DECLARE(switch_xml_t) switch_xml_insert(switch_xml_t xml, switch_xml_t dest, switch_size_t off); +SWITCH_DECLARE(switch_xml_t) switch_xml_insert(_In_ switch_xml_t xml, _In_ switch_xml_t dest, _In_opt_ switch_size_t off); ///\brief Moves an existing tag to become a subtag of dest at the given offset from ///\ the start of dest's character content. Returns the moved tag. @@ -319,13 +319,13 @@ ///\param reload if it's is already open close it and open it again as soon as permissable (blocking) ///\param err a pointer to set error strings ///\return the xml root node or NULL -SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(uint8_t reload, const char **err); +SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(_In_opt_ uint8_t reload, _Out_ const char **err); ///\brief initilize the core XML backend ///\param pool a memory pool to use ///\param err a pointer to set error strings ///\return SWITCH_STATUS_SUCCESS if successful -SWITCH_DECLARE(switch_status_t) switch_xml_init(switch_memory_pool_t *pool, const char **err); +SWITCH_DECLARE(switch_status_t) switch_xml_init(_In_ switch_memory_pool_t *pool, _Out_ const char **err); SWITCH_DECLARE(switch_status_t) switch_xml_destroy(void); @@ -344,39 +344,39 @@ ///\param node a pointer to the requested node ///\param params optional URL formatted params to pass to external gateways ///\return SWITCH_STATUS_SUCCESS if successful root and node will be assigned -SWITCH_DECLARE(switch_status_t) switch_xml_locate(const char *section, - const char *tag_name, - const char *key_name, - const char *key_value, - switch_xml_t *root, - switch_xml_t *node, - switch_event_t *params, - switch_bool_t clone); - -SWITCH_DECLARE(switch_status_t) switch_xml_locate_domain(const char *domain_name, switch_event_t *params, switch_xml_t *root, switch_xml_t *domain); - -SWITCH_DECLARE(switch_status_t) switch_xml_locate_group(const char *group_name, - const char *domain_name, - switch_xml_t *root, - switch_xml_t *domain, - switch_xml_t *group, - switch_event_t *params); - -SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(const char *key, - const char *user_name, - const char *domain_name, - const char *ip, - switch_xml_t *root, switch_xml_t *domain, switch_xml_t *user, switch_xml_t *ingroup, - switch_event_t *params); +SWITCH_DECLARE(switch_status_t) switch_xml_locate(_In_z_ const char *section, + _In_z_ const char *tag_name, + _In_z_ const char *key_name, + _In_z_ const char *key_value, + _Out_ switch_xml_t *root, + _Out_ switch_xml_t *node, + _In_opt_ switch_event_t *params, + _In_opt_ switch_bool_t clone); + +SWITCH_DECLARE(switch_status_t) switch_xml_locate_domain(_In_z_ const char *domain_name, _In_opt_ switch_event_t *params, _Out_ switch_xml_t *root, _Out_ switch_xml_t *domain); + +SWITCH_DECLARE(switch_status_t) switch_xml_locate_group(_In_z_ const char *group_name, + _In_z_ const char *domain_name, + _Out_ switch_xml_t *root, + _Out_ switch_xml_t *domain, + _Out_ switch_xml_t *group, + _In_ switch_event_t *params); + +SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(_In_z_ const char *key, + _In_z_ const char *user_name, + _In_z_ const char *domain_name, + _In_z_ const char *ip, + _Out_ switch_xml_t *root, _Out_ switch_xml_t *domain, _Out_ switch_xml_t *user, _Out_ switch_xml_t *ingroup, + _In_ switch_event_t *params); -SWITCH_DECLARE(switch_status_t) switch_xml_locate_user_in_domain(const char *user_name, switch_xml_t domain, switch_xml_t *user, switch_xml_t *ingroup); +SWITCH_DECLARE(switch_status_t) switch_xml_locate_user_in_domain(_In_z_ const char *user_name, _In_ switch_xml_t domain, _Out_ switch_xml_t *user, _Out_ switch_xml_t *ingroup); ///\brief open a config in the core registry ///\param file_path the name of the config section e.g. modules.conf ///\param node a pointer to point to the node if it is found ///\param params optional URL formatted params to pass to external gateways ///\return the root xml node associated with the current request or NULL -SWITCH_DECLARE(switch_xml_t) switch_xml_open_cfg(const char *file_path, switch_xml_t *node, switch_event_t *params); +SWITCH_DECLARE(switch_xml_t) switch_xml_open_cfg(_In_z_ const char *file_path, _Out_ switch_xml_t *node, _In_opt_ switch_event_t *params); ///\brief bind a search function to an external gateway ///\param function the search function to bind @@ -385,22 +385,22 @@ ///\return SWITCH_STATUS_SUCCESS if successful ///\note gateway functions will be executed in the order they were binded until a success is found else the root registry will be used -SWITCH_DECLARE(void) switch_xml_set_binding_sections(switch_xml_binding_t *binding, switch_xml_section_t sections); -SWITCH_DECLARE(void) switch_xml_set_binding_user_data(switch_xml_binding_t *binding, void *user_data); -SWITCH_DECLARE(switch_xml_section_t) switch_xml_get_binding_sections(switch_xml_binding_t *binding); -SWITCH_DECLARE(void *) switch_xml_get_binding_user_data(switch_xml_binding_t *binding); +SWITCH_DECLARE(void) switch_xml_set_binding_sections(_In_ switch_xml_binding_t *binding, _In_ switch_xml_section_t sections); +SWITCH_DECLARE(void) switch_xml_set_binding_user_data(_In_ switch_xml_binding_t *binding, _In_opt_ void *user_data); +SWITCH_DECLARE(switch_xml_section_t) switch_xml_get_binding_sections(_In_ switch_xml_binding_t *binding); +SWITCH_DECLARE(void *) switch_xml_get_binding_user_data(_In_ switch_xml_binding_t *binding); -SWITCH_DECLARE(switch_status_t) switch_xml_bind_search_function_ret(switch_xml_search_function_t function, switch_xml_section_t sections, void *user_data, switch_xml_binding_t **ret_binding); +SWITCH_DECLARE(switch_status_t) switch_xml_bind_search_function_ret(_In_ switch_xml_search_function_t function, _In_ switch_xml_section_t sections, _In_opt_ void *user_data, switch_xml_binding_t **ret_binding); #define switch_xml_bind_search_function(_f, _s, _u) switch_xml_bind_search_function_ret(_f, _s, _u, NULL) -SWITCH_DECLARE(switch_status_t) switch_xml_unbind_search_function(switch_xml_binding_t **binding); -SWITCH_DECLARE(switch_status_t) switch_xml_unbind_search_function_ptr(switch_xml_search_function_t function); +SWITCH_DECLARE(switch_status_t) switch_xml_unbind_search_function(_In_ switch_xml_binding_t **binding); +SWITCH_DECLARE(switch_status_t) switch_xml_unbind_search_function_ptr(_In_ switch_xml_search_function_t function); ///\brief parse a string for a list of sections ///\param str a | delimited list of section names ///\return the section mask -SWITCH_DECLARE(switch_xml_section_t) switch_xml_parse_section_string(const char *str); +SWITCH_DECLARE(switch_xml_section_t) switch_xml_parse_section_string(_In_z_ const char *str); SWITCH_END_EXTERN_C ///\} From moy at freeswitch.org Thu May 7 21:40:32 2009 From: moy at freeswitch.org (FreeSWITCH SVN) Date: Thu, 07 May 2009 23:40:32 -0500 Subject: [Freeswitch-svn] [commit] r13262 - freeswitch/trunk/src/mod/codecs/mod_dahdi_codec Message-ID: Author: moy Date: Thu May 7 23:40:32 2009 New Revision: 13262 Log: added proper waiting (up to 10ms) for the DAHDI transcoder output frame Modified: freeswitch/trunk/src/mod/codecs/mod_dahdi_codec/mod_dahdi_codec.c Modified: freeswitch/trunk/src/mod/codecs/mod_dahdi_codec/mod_dahdi_codec.c ============================================================================== --- freeswitch/trunk/src/mod/codecs/mod_dahdi_codec/mod_dahdi_codec.c (original) +++ freeswitch/trunk/src/mod/codecs/mod_dahdi_codec/mod_dahdi_codec.c Thu May 7 23:40:32 2009 @@ -39,6 +39,16 @@ #include #include +/* + * some rules to keep in mind for G729 (the frame size may be different for G723) + * we cannot write more than SFRAME_SIZE (320) - sizeof(struct rtp_packet) which + * seems to be 266 bytes + * if we write less than 160 bytes (1 ulaw frame which is 20 bytes of G729 bytes, a read will block forever) + * TODO: do buffering ourselves to provide just the fixed amount of samples that the card expects + * */ +#define DAHDI_G729_INPUT_FRAME_SIZE 160 +#define DAHDI_G729_OUTPUT_FRAME_SIZE 20 + /*#define DEBUG_DAHDI_CODEC 1*/ #define CODEC_G729_IANA_CODE 18 @@ -221,19 +231,22 @@ context->codec_r = (codec->implementation->ianacode == CODEC_G729_IANA_CODE) ? 8 : 12; + return SWITCH_STATUS_SUCCESS; } static int wait_for_transcoder(int fd) { - /* let's wait a bit for the transcoder, if in 20msthe driver does not notify us that its ready to accept more works + /* let's wait a bit for the transcoder, if in 20msthe driver does not notify us that its ready to give us something then just bail out with 0 bytes encoded/decoded as result, I'd expect the card to hold that buffer and return it later */ int res = 0; struct pollfd readpoll; memset(&readpoll, 0, sizeof(readpoll)); readpoll.fd = fd; - readpoll.events = POLLOUT; - res = poll(&readpoll, 1, 50); + readpoll.events = POLLIN; + /* my testing shows that it does not take more than 1ms to encode a 160 bytes frame ulaw to g729, + I dont think there is much difference decoding and for g723, waiting 10ms seems more than reasonable */ + res = poll(&readpoll, 1, 10); return res; } From mrene at freeswitch.org Thu May 7 21:48:55 2009 From: mrene at freeswitch.org (FreeSWITCH SVN) Date: Thu, 07 May 2009 23:48:55 -0500 Subject: [Freeswitch-svn] [commit] r13263 - freeswitch/trunk/src/include Message-ID: Author: mrene Date: Thu May 7 23:48:55 2009 New Revision: 13263 Log: oops Modified: freeswitch/trunk/src/include/switch_xml.h Modified: freeswitch/trunk/src/include/switch_xml.h ============================================================================== --- freeswitch/trunk/src/include/switch_xml.h (original) +++ freeswitch/trunk/src/include/switch_xml.h Thu May 7 23:48:55 2009 @@ -360,14 +360,14 @@ _Out_ switch_xml_t *root, _Out_ switch_xml_t *domain, _Out_ switch_xml_t *group, - _In_ switch_event_t *params); + _In_opt_ switch_event_t *params); SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(_In_z_ const char *key, _In_z_ const char *user_name, _In_z_ const char *domain_name, _In_z_ const char *ip, _Out_ switch_xml_t *root, _Out_ switch_xml_t *domain, _Out_ switch_xml_t *user, _Out_ switch_xml_t *ingroup, - _In_ switch_event_t *params); + _In_opt_ switch_event_t *params); SWITCH_DECLARE(switch_status_t) switch_xml_locate_user_in_domain(_In_z_ const char *user_name, _In_ switch_xml_t domain, _Out_ switch_xml_t *user, _Out_ switch_xml_t *ingroup); From anthm at freeswitch.org Fri May 8 12:03:54 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Fri, 08 May 2009 14:03:54 -0500 Subject: [Freeswitch-svn] [commit] r13264 - freeswitch/trunk/src Message-ID: Author: anthm Date: Fri May 8 14:03:54 2009 New Revision: 13264 Log: FSCORE-357 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 Fri May 8 14:03:54 2009 @@ -2052,8 +2052,8 @@ continue; } - switch_channel_wait_for_state_timeout(switch_core_session_get_channel(originate_status[i].peer_session), CS_DESTROY, 5000); - + switch_channel_wait_for_state_timeout(switch_core_session_get_channel(originate_status[i].peer_session), CS_REPORTING, 5000); + switch_yield(100000); if (switch_ivr_generate_xml_cdr(originate_status[i].peer_session, &cdr) == SWITCH_STATUS_SUCCESS) { if ((xml_text = switch_xml_toxml(cdr, SWITCH_FALSE))) { switch_snprintf(buf, sizeof(buf), "%s_%d", cdr_var, ++cdr_total); From moy at freeswitch.org Fri May 8 17:23:05 2009 From: moy at freeswitch.org (FreeSWITCH SVN) Date: Fri, 08 May 2009 19:23:05 -0500 Subject: [Freeswitch-svn] [commit] r13265 - freeswitch/trunk/src/mod/codecs/mod_dahdi_codec Message-ID: Author: moy Date: Fri May 8 19:23:05 2009 New Revision: 13265 Log: return silence frame in dahdi codec when there is no output from the decoder Modified: freeswitch/trunk/src/mod/codecs/mod_dahdi_codec/mod_dahdi_codec.c Modified: freeswitch/trunk/src/mod/codecs/mod_dahdi_codec/mod_dahdi_codec.c ============================================================================== --- freeswitch/trunk/src/mod/codecs/mod_dahdi_codec/mod_dahdi_codec.c (original) +++ freeswitch/trunk/src/mod/codecs/mod_dahdi_codec/mod_dahdi_codec.c Fri May 8 19:23:05 2009 @@ -383,8 +383,11 @@ return SWITCH_STATUS_FALSE; } if (0 == res) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No output on %s decoder device.\n", transcoder_name); - *decoded_data_len = 0; + memset(dbuf_linear, 0, codec->implementation->decoded_bytes_per_packet); + *decoded_data_len = codec->implementation->decoded_bytes_per_packet; +#ifdef DEBUG_DAHDI_CODEC + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No output on %s decoder device, returning silence frame of %d bytes.\n", transcoder_name, *decoded_data_len); +#endif return SWITCH_STATUS_SUCCESS; } res = read(context->decoding_fd, dbuf_ulaw, sizeof(dbuf_ulaw)); @@ -508,7 +511,7 @@ int spf = 160; int bpfd = 320; int bpfc = 20; - int fpnp = 10; + int fpnp = 20; switch_core_codec_add_implementation(pool, codec_interface, SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */ @@ -518,7 +521,7 @@ 8000, /* samples transferred per second */ 8000, /* actual samples transferred per second */ 8000, /* bits transferred per second */ - mpf, /* number of microseconds per frame (10ms frames) */ + mpf, /* number of microseconds per frame */ spf, /* number of samples per frame */ bpfd, /* number of bytes per frame decompressed */ bpfc, /* number of bytes per frame compressed */ @@ -544,7 +547,7 @@ 8000, /* samples transferred per second */ 8000, /* actual samples transferred per second */ 8000, /* bits transferred per second */ - mpf, /* number of microseconds per frame (10ms frames) */ + mpf, /* number of microseconds per frame */ spf, /* number of samples per frame */ bpfd, /* number of bytes per frame decompressed */ bpfc, /* number of bytes per frame compressed */ From mrene at freeswitch.org Fri May 8 18:58:31 2009 From: mrene at freeswitch.org (FreeSWITCH SVN) Date: Fri, 08 May 2009 20:58:31 -0500 Subject: [Freeswitch-svn] [commit] r13266 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: mrene Date: Fri May 8 20:58:30 2009 New Revision: 13266 Log: SFSIP-144 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 Fri May 8 20:58:30 2009 @@ -1605,7 +1605,7 @@ TAG_IF(!switch_strlen_zero(tech_pvt->rpid), SIPTAG_REMOTE_PARTY_ID_STR(tech_pvt->rpid)), TAG_IF(!switch_strlen_zero(tech_pvt->preferred_id), SIPTAG_P_PREFERRED_IDENTITY_STR(tech_pvt->preferred_id)), TAG_IF(!switch_strlen_zero(tech_pvt->asserted_id), SIPTAG_P_ASSERTED_IDENTITY_STR(tech_pvt->asserted_id)), - TAG_IF(!switch_strlen_zero(tech_pvt->privacy), SIPTAG_PRIVACY_STR(tech_pvt->preferred_id)), + TAG_IF(!switch_strlen_zero(tech_pvt->privacy), SIPTAG_PRIVACY_STR(tech_pvt->privacy)), TAG_IF(!switch_strlen_zero(alert_info), SIPTAG_HEADER_STR(alert_info)), TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)), TAG_IF(!switch_strlen_zero(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)), From mrene at freeswitch.org Sat May 9 08:05:34 2009 From: mrene at freeswitch.org (FreeSWITCH SVN) Date: Sat, 09 May 2009 10:05:34 -0500 Subject: [Freeswitch-svn] [commit] r13267 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: mrene Date: Sat May 9 10:05:33 2009 New Revision: 13267 Log: SFSIP-145 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 Sat May 9 10:05:33 2009 @@ -1857,10 +1857,10 @@ char *sql = NULL; if ((argv[1]) && (profile = sofia_glue_find_profile(argv[1]))) { + stream->write_function(stream, "%s\n", header); + stream->write_function(stream, "\n"); 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, " \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)) { @@ -1902,9 +1902,8 @@ stream->write_function(stream, " %d\n", profile->ob_calls); stream->write_function(stream, " %d\n", profile->ib_failed_calls); stream->write_function(stream, " %d\n", profile->ob_failed_calls); - + stream->write_function(stream, " \n"); } - stream->write_function(stream, " \n"); stream->write_function(stream, " \n"); cb.profile = profile; @@ -1939,7 +1938,7 @@ 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"); stream->write_function(stream, "\n"); sofia_glue_release_profile(profile); From mrene at freeswitch.org Sat May 9 09:51:12 2009 From: mrene at freeswitch.org (FreeSWITCH SVN) Date: Sat, 09 May 2009 11:51:12 -0500 Subject: [Freeswitch-svn] [commit] r13268 - freeswitch/trunk/src/mod/applications/mod_lcr Message-ID: Author: mrene Date: Sat May 9 11:51:12 2009 New Revision: 13268 Log: mod_lcr: Add ifdefs around odbc calls in shutdown function Modified: freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c Modified: freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c (original) +++ freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c Sat May 9 11:51:12 2009 @@ -1350,8 +1350,10 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_lcr_shutdown) { +#ifdef SWITCH_HAVE_ODBC switch_odbc_handle_disconnect(globals.master_odbc); switch_odbc_handle_destroy(&globals.master_odbc); +#endif switch_core_hash_destroy(&globals.profile_hash); return SWITCH_STATUS_SUCCESS; From mrene at freeswitch.org Sat May 9 12:30:46 2009 From: mrene at freeswitch.org (FreeSWITCH SVN) Date: Sat, 09 May 2009 14:30:46 -0500 Subject: [Freeswitch-svn] [commit] r13269 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: mrene Date: Sat May 9 14:30:46 2009 New Revision: 13269 Log: mod_sofia: Add rescan option to killgw 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 Sat May 9 14:30:46 2009 @@ -2043,6 +2043,14 @@ sofia_glue_del_gateway(gateway_ptr); sofia_reg_release_gateway(gateway_ptr); stream->write_function(stream, "+OK gateway marked for deletion.\n"); + + if (argc > 3 && !strcasecmp(argv[3], "rescan")) { + if (reconfig_sofia(profile) == SWITCH_STATUS_SUCCESS) { + stream->write_function(stream, "+OK scan complete\n"); + } else { + stream->write_function(stream, "-ERR cannot find config for profile %s\n", profile->name); + } + } } else { stream->write_function(stream, "-ERR no such gateway.\n"); } From brian at freeswitch.org Sun May 10 10:06:33 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Sun, 10 May 2009 12:06:33 -0500 Subject: [Freeswitch-svn] [commit] r13270 - freeswitch/trunk/src/mod/asr_tts/mod_flite Message-ID: Author: brian Date: Sun May 10 12:06:33 2009 New Revision: 13270 Log: MODASRTTS-15 Modified: freeswitch/trunk/src/mod/asr_tts/mod_flite/mod_flite.c Modified: freeswitch/trunk/src/mod/asr_tts/mod_flite/mod_flite.c ============================================================================== --- freeswitch/trunk/src/mod/asr_tts/mod_flite/mod_flite.c (original) +++ freeswitch/trunk/src/mod/asr_tts/mod_flite/mod_flite.c Sun May 10 12:06:33 2009 @@ -45,8 +45,8 @@ void unregister_cmu_us_slt(cst_voice * v); SWITCH_MODULE_LOAD_FUNCTION(mod_flite_load); -SWITCH_MODULE_DEFINITION(mod_flite, mod_flite_load, NULL, NULL); SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_flite_shutdown); +SWITCH_MODULE_DEFINITION(mod_flite, mod_flite_load, mod_flite_shutdown, NULL); static struct { cst_voice *awb; From brian at freeswitch.org Sun May 10 10:12:30 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Sun, 10 May 2009 12:12:30 -0500 Subject: [Freeswitch-svn] [commit] r13271 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: brian Date: Sun May 10 12:12:29 2009 New Revision: 13271 Log: MODSOFIA-7 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 Sun May 10 12:12:29 2009 @@ -2898,6 +2898,11 @@ switch_channel_set_variable_partner(channel, var_name, p_contact->m_url->url_host); switch_channel_set_variable(channel, var_name, p_contact->m_url->url_host); } + if (p_contact->m_url->url_params) { + switch_snprintf(var_name, sizeof(var_name), "sip_redirect_contact_params_%d", i); + switch_channel_set_variable_partner(channel, var_name, p_contact->m_url->url_params); + switch_channel_set_variable(channel, var_name, p_contact->m_url->url_params); + } p_contact = p_contact->m_next; i++; } From mrene at freeswitch.org Sun May 10 17:27:58 2009 From: mrene at freeswitch.org (FreeSWITCH SVN) Date: Sun, 10 May 2009 19:27:58 -0500 Subject: [Freeswitch-svn] [commit] r13272 - freeswitch/trunk/src/mod/applications/mod_voicemail Message-ID: Author: mrene Date: Sun May 10 19:27:58 2009 New Revision: 13272 Log: mod_voicemail: expand the right variable 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 Sun May 10 19:27:58 2009 @@ -2521,7 +2521,7 @@ if (switch_strlen_zero(profile->email_from)) { from = switch_core_sprintf(pool, "%s@%s", myid, domain_name); } else { - from = switch_event_expand_headers(params, profile->email_headers); + from = switch_event_expand_headers(params, profile->email_from); } From mrene at freeswitch.org Sun May 10 21:07:01 2009 From: mrene at freeswitch.org (FreeSWITCH SVN) Date: Sun, 10 May 2009 23:07:01 -0500 Subject: [Freeswitch-svn] [commit] r13273 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: mrene Date: Sun May 10 23:07:01 2009 New Revision: 13273 Log: Revert 13269 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 Sun May 10 23:07:01 2009 @@ -2043,14 +2043,6 @@ sofia_glue_del_gateway(gateway_ptr); sofia_reg_release_gateway(gateway_ptr); stream->write_function(stream, "+OK gateway marked for deletion.\n"); - - if (argc > 3 && !strcasecmp(argv[3], "rescan")) { - if (reconfig_sofia(profile) == SWITCH_STATUS_SUCCESS) { - stream->write_function(stream, "+OK scan complete\n"); - } else { - stream->write_function(stream, "-ERR cannot find config for profile %s\n", profile->name); - } - } } else { stream->write_function(stream, "-ERR no such gateway.\n"); } From anthm at freeswitch.org Mon May 11 09:52:01 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Mon, 11 May 2009 11:52:01 -0500 Subject: [Freeswitch-svn] [commit] r13274 - in freeswitch/trunk/src: . include Message-ID: Author: anthm Date: Mon May 11 11:52:01 2009 New Revision: 13274 Log: FSCORE-357 Modified: freeswitch/trunk/src/include/switch_types.h freeswitch/trunk/src/switch_channel.c freeswitch/trunk/src/switch_ivr_originate.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 May 11 11:52:01 2009 @@ -886,6 +886,7 @@ CF_FS_RTP, CF_REPORTING, CF_PARK, + CF_TIMESTAMP_SET, /* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */ CF_FLAG_MAX } switch_channel_flag_t; Modified: freeswitch/trunk/src/switch_channel.c ============================================================================== --- freeswitch/trunk/src/switch_channel.c (original) +++ freeswitch/trunk/src/switch_channel.c Mon May 11 11:52:01 2009 @@ -2507,6 +2507,8 @@ switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, legbillusec); switch_channel_set_variable(channel, "flow_billusec", tmp); + switch_channel_set_flag(channel, CF_TIMESTAMP_SET); + 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 May 11 11:52:01 2009 @@ -2048,12 +2048,24 @@ if (cdr_var) { for (i = 0; i < and_argc; i++) { + switch_channel_t *channel; + if (!originate_status[i].peer_session) { continue; } + + channel = switch_core_session_get_channel(originate_status[i].peer_session); - switch_channel_wait_for_state_timeout(switch_core_session_get_channel(originate_status[i].peer_session), CS_REPORTING, 5000); - switch_yield(100000); + switch_channel_wait_for_flag(channel, + CF_TIMESTAMP_SET, + SWITCH_TRUE, + 5000, + NULL); + + if (!switch_channel_test_flag(channel, CF_TIMESTAMP_SET) || !switch_core_session_running(originate_status[i].peer_session)) { + switch_core_session_reporting_state(originate_status[i].peer_session); + } + if (switch_ivr_generate_xml_cdr(originate_status[i].peer_session, &cdr) == SWITCH_STATUS_SUCCESS) { if ((xml_text = switch_xml_toxml(cdr, SWITCH_FALSE))) { switch_snprintf(buf, sizeof(buf), "%s_%d", cdr_var, ++cdr_total); From mcollins at freeswitch.org Mon May 11 10:55:57 2009 From: mcollins at freeswitch.org (FreeSWITCH SVN) Date: Mon, 11 May 2009 12:55:57 -0500 Subject: [Freeswitch-svn] [commit] r13275 - freeswitch/trunk/docs Message-ID: Author: mcollins Date: Mon May 11 12:55:57 2009 New Revision: 13275 Log: Update Changelog through r13274 Modified: freeswitch/trunk/docs/ChangeLog Modified: freeswitch/trunk/docs/ChangeLog ============================================================================== --- freeswitch/trunk/docs/ChangeLog (original) +++ freeswitch/trunk/docs/ChangeLog Mon May 11 12:55:57 2009 @@ -133,7 +133,7 @@ core: add auto-sync idle timers in switch_time.c (r:13161) core: Add Q850 hangup cause variable (FSCORE-356/r:13163) core: keep presence up to date (r:13166) - core: fix failed_xml_cdr_prefix is processed before all variables for the b-leg have been generated (FSCORE-357/r:13167,13176) + core: fix failed_xml_cdr_prefix is processed before all variables for the b-leg have been generated (FSCORE-357/r:13167,13176,13264,13274) core: failed_xml_cdr_prefix doesn't work for list of destinations separated by pipe (FSCORE-359/r:13209) core: add support for gcc 4.4.0 (FSCORE-355/r:13210) core: add resume command to event socket and socket_resume variable (r:13212) @@ -143,6 +143,7 @@ core: fix memory issue in core file resampling code (r:13233) core: fix play and get digits when using phrase macros (r:13244) core: Don't set the caller name to origination_uuid's value (r:13248) + core: Add switch_xml_parse_str_dynamic and switch_xml_parse_str_dup (r:13255) docs: Fix filename references in phrase_en.xml (r:12976) docs: Update phrase_en.xml to include v1.0.8 sound prompts (r:13041) docs: Updates to phrase_es.xml (r:13067) @@ -219,6 +220,9 @@ mod_conference: add execute_application to custom controls (r:13216) mod_console: Fix mod_console (missing FD_ZERO before FD_SET) (r:13126) mod_dahdi_codec: delay init of resources until the first time they are actually used to avoid unnecessary waste of resources in hardware codec (r:12962) + mod_dahdi_codec: set mod_dahdi_codec dahdi transcoding device sockets to non-blocking to avoid hanging when there is no data and just return 0 bytes frame (MODCODEC-8/r:13257) + mod_dahdi_codec: added proper waiting (up to 10ms) for the DAHDI transcoder output frame (r:13262) + mod_dahdi_codec: return silence frame in dahdi codec when there is no output from the decoder (r:13265) mod_dingaling: fix crash when unloading/reload mod_dingaling (LBDING-13/r:12612) mod_dingaling: fix no sound if phone picked up after 5th dingaling on Gtalk client (MODENDP-198/r:12641) mod_dingaling: fix core dump when calling Gtalk enabled FS using leg_timeout (MODENDP-199/r:12641) @@ -249,9 +253,11 @@ mod_fifo: abandon outbound calls when they are not needed, place queue name in the caller id (r:13240) mod_file_string: add new module, allows for playing ! delimited lists of sound files (r:13182) mod_flite: three new voices - rms, awb (male), slt (female) (r:12166) + mod_flite: mod_flite_shutdown not called/used (MODASRTTS-15/r:13270) mod_iax: make mod_iax async (r:13021) mod_iax: autoflush these channels that use queues (r:13057) mod_lcr: allow channel vars in custom_sql (r:12198) + mod_lcr: Add ifdefs around odbc calls in shutdown function (r:13268) mod_limit: Add events and a shutdown function (r:12497) mod_limit: close odbc handle (r:12632) mod_limit: Add more error checking to hash api/app (r:13007) @@ -361,6 +367,9 @@ mod_sofia: Ignore ptime when missing instead of using @0i (MODENDP-206/r:13231) mod_sofia: fix evil send myself a refer bug (FSCORE-350/r:13237) mod_sofia: Add sofia profile params to fine-tune timers (r:13245) + mod_sofia: Fix incoming anonymous from MetaSwitch will not bridge (SFSIP-144/r:13266) + mod_sofia: Fix command "sofia xmlstatus profile internal reg" returns invalid xml text (SFSIP-145/r:13267) + mod_sofia: Allow retrieval of redirect contact uri parameters via channel variable (MODSOFIA-7/r:13271) mod_spy: add new module, mod_spy (MODAPP-260/r:13035,13036) mod_syslog: Keep the indent string in memory (LOGGER-1/r:12852) mod_t38gateway: Introduction of the skeleton of a media bug implementing a T.38 gateway, so the @@ -375,6 +384,7 @@ mod_voicemail: change len to seconds (r:13127) mod_voicemail: message-query-exact-match global param in settings section of voicemail to assume profile names match domain names (r:13138) mod_voicemail: allow unload and reload of mod_voicemail (MODAPP-177/r:13145) + mod_voicemail: expand the right variable (r:13272) mod_xml_curl: fix data fetch (MODXMLINT-48/r:12586) sofia-sip: su.h - define su_family via struct sockaddr (r:12260) sofia-sip: sip_parser.c - fixed sip_transport_d() (r:12261) From buklov at freeswitch.org Mon May 11 11:34:22 2009 From: buklov at freeswitch.org (FreeSWITCH SVN) Date: Mon, 11 May 2009 13:34:22 -0500 Subject: [Freeswitch-svn] [commit] r13276 - freeswitch/trunk/conf/lang/ru/vm Message-ID: Author: buklov Date: Mon May 11 13:34:22 2009 New Revision: 13276 Log: macro voicemail_message_count fix Modified: freeswitch/trunk/conf/lang/ru/vm/sounds.xml Modified: freeswitch/trunk/conf/lang/ru/vm/sounds.xml ============================================================================== --- freeswitch/trunk/conf/lang/ru/vm/sounds.xml (original) +++ freeswitch/trunk/conf/lang/ru/vm/sounds.xml Mon May 11 13:34:22 2009 @@ -61,7 +61,7 @@ - + From buklov at freeswitch.org Mon May 11 11:57:38 2009 From: buklov at freeswitch.org (FreeSWITCH SVN) Date: Mon, 11 May 2009 13:57:38 -0500 Subject: [Freeswitch-svn] [commit] r13277 - freeswitch/trunk/conf/lang/ru/vm Message-ID: Author: buklov Date: Mon May 11 13:57:38 2009 New Revision: 13277 Log: macro voicemail_message_count fix v.2 Modified: freeswitch/trunk/conf/lang/ru/vm/sounds.xml Modified: freeswitch/trunk/conf/lang/ru/vm/sounds.xml ============================================================================== --- freeswitch/trunk/conf/lang/ru/vm/sounds.xml (original) +++ freeswitch/trunk/conf/lang/ru/vm/sounds.xml Mon May 11 13:57:38 2009 @@ -61,7 +61,7 @@ - + From buklov at freeswitch.org Mon May 11 12:06:08 2009 From: buklov at freeswitch.org (FreeSWITCH SVN) Date: Mon, 11 May 2009 14:06:08 -0500 Subject: [Freeswitch-svn] [commit] r13278 - freeswitch/trunk/src/mod/say/mod_say_ru Message-ID: Author: buklov Date: Mon May 11 14:06:08 2009 New Revision: 13278 Log: rewrite the module Added: freeswitch/trunk/src/mod/say/mod_say_ru/mod_say_ru.h Modified: freeswitch/trunk/src/mod/say/mod_say_ru/mod_say_ru.c Modified: freeswitch/trunk/src/mod/say/mod_say_ru/mod_say_ru.c ============================================================================== --- freeswitch/trunk/src/mod/say/mod_say_ru/mod_say_ru.c (original) +++ freeswitch/trunk/src/mod/say/mod_say_ru/mod_say_ru.c Mon May 11 14:06:08 2009 @@ -39,7 +39,6 @@ * * Anthony Minessale II * Michael B. Murdock - * Oleg Dolya * Boris Buklov * * mod_say_ru.c -- Say for Russian @@ -49,40 +48,24 @@ #include #include #include +#include "mod_say_ru.h" + +//?????????????? ?????? ????????? ???????????? ???? ??????? ? define mod_say_ru.h +struct say_t matrix[7][8]= {{m_00,m_01,m_02,m_03,m_04,m_05,m_06,m_07}, + {m_10,m_11,m_12,m_13,m_14,m_15,m_16,m_17}, + {m_20,m_21,m_22,m_23,m_24,m_25,m_26,m_27}, + {m_30,m_31,m_32,m_33,m_34,m_35,m_36,m_37}, + {m_40,m_41,m_42,m_43,m_44,m_45,m_46,m_47}, + {m_50,m_51,m_52,m_53,m_54,m_55,m_56,m_57}, + {m_60,m_61,m_62,m_63,m_64,m_65,m_66,m_67}}; + + -typedef enum { - male, //???????? ???? - female, //???????? - it //??? -} sex_t; - - - -typedef enum { - how_much, //??????? ? ????? - when, //?????? - ????? -- ??? ???? - what_ //?????/?????/????? ? ????? -} question_t; //?????? - -typedef enum { - million, - thousand, - zero, - empty -} unit_t; SWITCH_MODULE_LOAD_FUNCTION(mod_say_ru_load); SWITCH_MODULE_DEFINITION(mod_say_ru, mod_say_ru_load, NULL, NULL); -#define say_num(num, t) { \ - char tmp[80];\ - switch_status_t tstatus;\ - switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \ - if ((tstatus = ru_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\ - return tstatus;\ - }}\ - #define say_file(...) {\ char tmp[80];\ switch_status_t tstatus;\ @@ -95,1010 +78,175 @@ }}\ -static switch_status_t ru_spell(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args) -{ - char *p; - for (p = tosay; p && *p; p++) { - int a = tolower((int) *p); - if (a >= 48 && a <= 57) { - say_file("digits/%d.wav", a - 48); - } else { - if (type == SST_NAME_SPELLED) { - say_file("ascii/%d.wav", a); - } else if (type == SST_NAME_PHONETIC) { - say_file("phonetic-ascii/%d.wav", a); - } - } +static char *strip_commas(char *in, char *out, switch_size_t len) +{ + char *p = in, *q = out; + char *ret = out; + switch_size_t x = 0; + + for (; p && *p; p++) { + if ((*p > 47 && *p < 58)) { + *q++ = *p; + } else if (*p != ',') { + ret = NULL; + break; + } + if (++x > len) { + ret = NULL; + break; + } } - - return SWITCH_STATUS_SUCCESS; + return ret; } -//?????????????? ?? 3 ????? -static switch_status_t play_group( sex_t sex,question_t question, int a, int b, int c, - unit_t what,int last, switch_core_session_t *session, switch_input_args_t *args) + +static char *strip_nonnumerics(char *in, char *out, switch_size_t len) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group %d %d %d sex=%d q=%d last=%d\n", a,b,c,sex,question,last); - if (a) { - if ((b==0)||(c==0)) { // ???? b ? ? ????? 0 ?? ??????? ????????, ??????????, ?????????? - switch (question) { -//------------------------------------------------------ - case how_much: //??????? ????? ?????? ???? ???? ???????? 100 200... - switch (sex) { //??? - case male: //??????? - say_file("digits/%d00.wav", a); //??? - if (what==thousand) { - say_file("digits/thousands.wav");//????? - } - else if (what==million) { - say_file("digits/millions.wav");//????????? - } - //------------- - break; - - case female: //??????? - say_file("digits/%d00.wav", a);//??? - if (what==thousand) { - say_file("digits/thousands.wav");//????? - } - else if (what==million) { - say_file("digits/millions.wav");//????????? - } - break; - //------------- - case it: //??? - say_file("digits/%d00.wav", a);//??? - if (what==thousand) { - say_file("digits/thousands.wav"); //????? - } - else if (what==million) { - say_file("digits/millions.wav");//????????? - } - break; - //------------- - } - break; -//------------------------------------------------------ - case what_: //?????/?/?? - switch (sex) { //??? - case male: //??????? - if (what==thousand) { - if (last==0) { - say_file("digits/h-%d00xx.wav", a);//??????? - say_file("digits/h-millionx.wav");//???????? - } - else { - say_file("digits/%d00.wav", a);//?????? - say_file("digits/thousands.wav");//????? - } - } - else if (what==million) { - if (last==0) { - say_file("digits/h-%d00xx.wav", a);//??????? - say_file("digits/h-millionm.wav");//?????????? - } - else { - say_file("digits/%d00.wav", a);//?????? - say_file("digits/millions.wav");//????????? - } - } - else { - say_file("digits/h-%d00m.wav", a);//????? ????????? - } - break; - - case female: //??????? - if (what==thousand) { - if (last==0) { - say_file("digits/h-%d00xx.wav", a);//??????? - say_file("digits/h-millionf.wav");//???????? - } - else { - say_file("digits/%d00.wav", a);//?????? - say_file("digits/thousands.wav");//????? - } - } - else if (what==million) { - if (last==0) { - say_file("digits/h-%d00xx.wav", a);//??????? - say_file("digits/h-millionf.wav");//?????????? - } - else { - say_file("digits/%d00.wav", a);//?????? - say_file("digits/millions.wav");//????????? - } - } - else { - say_file("digits/h-%d00f.wav", a);//????? ????????? - } - break; - case it: //??? - if (what==thousand) { - if (last==0) { - say_file("digits/h-%d00xx.wav", a);//??????? - say_file("digits/h-millionn.wav");//???????? - } - else { - say_file("digits/%d00.wav", a);//?????? - say_file("digits/thousands.wav");//????? - } - } - else if (what==million) { - if (last==0) { - say_file("digits/h-%d00xx.wav", a);//??????? - say_file("digits/h-millionn.wav");//?????????? - } - else { - say_file("digits/%d00.wav", a);//?????? - say_file("digits/millions.wav");//????????? - } - } - else { - say_file("digits/h-%d00n.wav", a);//?????? - } - break; - } - break; -//------------------------------------------------------- - case when: //?????? - ????? ??? ???? - if (what==thousand) { - if (last==0) { - say_file("digits/h-%d00xx.wav", a);//??????? - say_file("digits/h-millionx.wav");//????????? - } - else { - say_file("digits/%d00.wav", a);//?????? - say_file("digits/thousands.wav");//????? - } - } - else if (what==million) { - if (last==0) { - say_file("digits/h-%d00xx.wav", a);//??????? - say_file("digits/h-millionx.wav");//??????????? - } - else { - say_file("digits/%d00.wav", a);//?????? - say_file("digits/millions.wav");//????????? - } - } - else { - say_file("digits/h-%d00x.wav", a);//?????? - } - break; - } //end switch (question) - }//end if ((b==0)||(c==0)) - else // ???? ???? ??? ????? - { - switch (question) { - case how_much: - say_file("digits/%d00.wav", a); //?????? ??? ? ?? - break; - case what_: - if (last==0) { - say_file("digits/h-%d00xx.wav", a); - } - else { - say_file("digits/%d00.wav", a); //??? - } - break; - case when: - if (last==0) { - say_file("digits/h-%d00xx.wav", a); - } - else { - say_file("digits/%d00.wav", a); //??? - } - break; - } - } - }//end if (a) - if (b) // ???? b ?????? 0 - { - if (b > 1) { //???? ????? ?????? 19 - if (c==0) { // ???? c == ???? 20-30-40-50 - switch (question) { -//------------------------------------------------------ - case how_much: //??????? ????? ?????? ???? ???? ???????? 10 20... - switch (sex) { //??? - case male: //??????? - say_file("digits/%d0.wav", b); //???????? - if (what==thousand) { - say_file("digits/thousands.wav", b); //????? - } - else if (what==million) { - say_file("digits/millions.wav", b); //????????? - } - //------------- - break; - - case female: //??????? - say_file("digits/%d0.wav", b);//???????? - if (what==thousand) { - say_file("digits/thousands.wav", b); //????? - } - else if (what==million) { - say_file("digits/millions.wav", b); //????????? - } - break; - //------------- - case it: //??? - say_file("digits/%d0.wav", b);// ???????? - if (what==thousand) { - say_file("digits/thousands.wav", b); //????? - } - else if (what==million) { - say_file("digits/millions.wav", b); //????????? - } - break; - //------------- - } - break; -//------------------------------------------------------ - case what_: //?????/?/?? >19 ? c==0 20-30-40 - switch (sex) { //??? - case male: //??????? - if (what==thousand) { - if (last==0) { - say_file("digits/h-%d0xx.wav", b);//???????? - say_file("digits/h-thousandm.wav", b); //???????? - } - else { - say_file("digits/%d0.wav", b);//???????? - say_file("digits/h-thousand.wav", b); //????? - } - } - else if (what==million) { - if (last==0) { - say_file("digits/h-%d0xx.wav", b);//???????? - say_file("digits/h-millionm.wav", b); //?????????? - } - else { - say_file("digits/%d0.wav", b);//???????? - say_file("digits/h-thousand.wav", b); //????????? - } - } - else { //??? ????????? ? ????? - if (last==0) { - say_file("digits/h-%d0m.wav", b);//????????? - } - else { - say_file("digits/%d0.wav", b);//???????? - } - } - break; - case female: //??????? - if (what==thousand) { - if (last==0) { - say_file("digits/h-%d0xx.wav", b);//???????? - say_file("digits/h-thousandf.wav", b); //???????? - } - else { - say_file("digits/%d0.wav", b);//???????? - say_file("digits/h-thousand.wav", b); //????? - } - } - else if (what==million) { - if (last==0) { - say_file("digits/h-%d0xx.wav", b);//???????? - say_file("digits/h-millionf.wav", b); //?????????? - } - else { - say_file("digits/%d0.wav", b);//???????? - say_file("digits/h-thousand.wav", b); //????????? - } - } - else { //??? ????????? ? ????? - if (last==0) { - say_file("digits/h-%d0f.wav", b);//????????? - } - else { - say_file("digits/%d0.wav", b);//???????? - } - } - break; - case it: //??? - if (what==thousand) { - if (last==0) { - say_file("digits/h-%d0xx.wav", b);//???????? - say_file("digits/h-thousandn.wav", b); //???????? - } - else { - say_file("digits/%d0.wav", b);//???????? - say_file("digits/h-thousand.wav", b); //????? - } - } - else if (what==million) { - if (last==0) { - say_file("digits/h-%d0xx.wav", b);//???????? - say_file("digits/h-millionn.wav", b); //?????????? - } - else { - say_file("digits/%d0.wav", b);//???????? - say_file("digits/h-thousand.wav", b); //????????? - } - } - else { //??? ????????? ? ????? - if (last==0) { - say_file("digits/h-%d0n.wav", b);//????????? - } - else { - say_file("digits/%d0.wav", b);//???????? - } - } - break; - } - break; -//------------------------------------------------------- - case when: //?????? - ????? ??? ???? - if (what==thousand) { - if (last==0) { - say_file("digits/h-%d0xx.wav", b);//???????? - say_file("digits/h-thousandx.wav", b); //????????? - } - else { - say_file("digits/%d0.wav", b);//???????? - say_file("digits/h-thousand.wav", b); //????? - } - } - else if (what==million) { - if (last==0) { - say_file("digits/h-%d0xx.wav", b);//???????? - say_file("digits/h-millionx.wav", b); //??????????? - } - else { - say_file("digits/%d0.wav", b);//???????? - say_file("digits/h-thousand.wav", b); //????????? - } - } - else { //??? ????????? ? ????? - if (last==0) { - say_file("digits/h-%d0x.wav", b);//?????????? - } - else { - say_file("digits/%d0.wav", b);//???????? - } - } - break; - } - }//????? ???? c == ???? - else - { - say_file("digits/%d0.wav", b); // ????? ?????? ???????? .. ? ?? + char *p = in, *q = out; + char *ret = out; + switch_size_t x = 0; + // valid are 0 - 9, period (.), minus (-), and plus (+) - remove all others + for (; p && *p; p++) { + if ((*p > 47 && *p < 58) || *p == '.' || *p == '-' || *p == '+') { + *q++ = *p; + } + if (++x > len) { + ret = NULL; + break; + } + } + return ret; +} + + +static switch_status_t ru_spell(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args) +{ + char *p; + + for (p = tosay; p && *p; p++) { + int a = tolower((int) *p); + if (a >= 48 && a <= 57) { + say_file("digits/%d.wav", a - 48); + } else { + if (type == SST_NAME_SPELLED) { + say_file("ascii/%d.wav", a); + } else if (type == SST_NAME_PHONETIC) { + say_file("phonetic-ascii/%d.wav", a); } - }//????? ???? ?????? 19 - else { //???? ????? ?????? 20 - switch (question) { -//------------------------------------------------------ - case how_much: //??????? ????? ?? 10 ?? 19 - switch (sex) { //??? - case male: //??????? - say_file("digits/%d%d.wav",b ,c); //???????????? - if (what==thousand) { - say_file("digits/thousands.wav"); //????? - } - else if (what==million) { - say_file("digits/millions.wav"); //????????? - } - //------------- - break; - case female: //??????? - say_file("digits/%d%d.wav",b ,c);//???????????? - if (what==thousand) { - say_file("digits/thousands.wav"); //????? - } - else if (what==million) { - say_file("digits/millions.wav"); //????????? - } - break; - //------------- - case it: //??? - say_file("digits/%d%d.wav",b ,c);// ???????????? - if (what==thousand) { - say_file("digits/thousands.wav"); //????? - } - else if (what==million) { - say_file("digits/millions.wav"); //????????? - } - break; - //------------- - } - break; -//------------------------------------------------------ - case what_: //?????/?/?? - switch (sex) { //??? - case male: //??????? - if (what==thousand) { - if (last==0) { - say_file("digits/h-%d%dxx.wav", b,c);//??????, ?????????? .. - say_file("digits/h-thousandm.wav"); //???????? - } - else { - say_file("digits/%d%d.wav", b,c);//??????????? - say_file("digits/h-thousand.wav"); //????? - } - } - else if (what==million) { - if (last==0) { - say_file("digits/h-%d%dxx.wav", b,c);//??????, ?????????? .. - say_file("digits/h-millionm.wav"); //?????????? - } - else { - say_file("digits/%d%d.wav", b,c);//???????????? - say_file("digits/h-thousand.wav"); //????????? - } - } - else { //??? ????????? ? ????? - if (last==0) { - say_file("digits/h-%d%dm.wav", b,c);//????????????? - } - else { - say_file("digits/%d%d.wav");//???????????? - } - } - case female: //??????? - if (what==thousand) { - if (last==0) { - say_file("digits/h-%d%dxx.wav", b,c);//??????, ?????????? .. - say_file("digits/h-thousandf.wav"); //???????? - } - else { - say_file("digits/%d%d.wav", b,c);//??????????? - say_file("digits/h-thousand.wav"); //????? - } - } - else if (what==million) { - if (last==0) { - say_file("digits/h-%d%dxx.wav", b,c);//??????, ?????????? .. - say_file("digits/h-millionf.wav"); //?????????? - } - else { - say_file("digits/%d%d.wav", b,c);//???????????? - say_file("digits/h-thousand.wav"); //????????? - } - } - else { //??? ????????? ? ????? - if (last==0) { - say_file("digits/h-%d%df.wav", b,c);//????????????? - } - else { - say_file("digits/%d%d.wav");//???????????? - } - } - break; - case it: //??? - if (what==thousand) { - if (last==0) { - say_file("digits/h-%d%dxx.wav", b,c);//??????, ?????????? .. - say_file("digits/h-thousandn.wav"); //???????? - } - else { - say_file("digits/%d%d.wav", b,c);//??????????? - say_file("digits/h-thousand.wav"); //????? - } - } - else if (what==million) { - if (last==0) { - say_file("digits/h-%d%dxx.wav", b,c);//??????, ?????????? .. - say_file("digits/h-millionn.wav"); //?????????? - } - else { - say_file("digits/%d%d.wav", b,c);//???????????? - say_file("digits/h-thousand.wav"); //????????? - } - } - else { //??? ????????? ? ????? - if (last==0) { - say_file("digits/h-%d%dn.wav", b,c);//????????????? - } - else { - say_file("digits/%d%d.wav");//???????????? - } - } - break; - } - break; -//------------------------------------------------------- - case when: //?????? - ????? ??? ???? - if (what==thousand) { - if (last==0) { - say_file("digits/h-%d%dxx.wav", b,c);//??????, ?????????? .. - say_file("digits/h-thousandx.wav"); //????????? - } - else { - say_file("digits/%d%d.wav", b,c);//??????????? - say_file("digits/h-thousand.wav"); //????? - } - } - else if (what==million) { - if (last==0) { - say_file("digits/h-%d%dxx.wav", b,c);//??????, ?????????? .. - say_file("digits/h-millionx.wav"); //??????????? - } - else { - say_file("digits/%d%d.wav", b,c);//???????????? - say_file("digits/h-thousand.wav"); //????????? - } - } - else { //??? ????????? ? ????? - if (last==0) { - say_file("digits/h-%d%dx.wav", b,c);//?????????????? - } - else { - say_file("digits/%d%d.wav");//???????????? - } - } - - break; - }//????? ???? c == ???? - c=0; //??? ?? ?? ????????????? c - }// ????? //???? ????? ?????? 20 - }//????? if (b) - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group c \n"); - - - - if ((c)||(what==zero)) {// ????????? ????? (????? ???????) ??? ??????????? ???? , ??? ??????? ????? ?????? ????? ???? - if (c>2||c==0) {//0 ? 3-9 - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group c 1\n"); - - switch (question) - { -//------------------------------------------------------ - case how_much: //??????? 3-9 - switch (sex) - { //??? - case male: //??????? - if (what==thousand) { //????? - if ((c>2)&&(c<5)) { - say_file("digits/%d.wav", c);// ??? - ?????? - say_file("digits/thousands-i.wav"); //?????? - } - else{ - say_file("digits/%d.wav", c);// ???? .. ?????? - say_file("digits/thousands.wav"); //????? - } - } - else if (what==million) { //????????? - if ((c>2)&&(c<5)) { - say_file("digits/%d.wav", c);// ??? ?????? - say_file("digits/million-a.wav"); //???????? - } - else{ - say_file("digits/%d.wav", c);// ???? .. ?????? - say_file("digits/millions.wav"); //????????? - } - } - else { - say_file("digits/%d.wav", c);// ??? ?????? ???? - } - break; - - case female: //??????? - if (what==thousand) { //????? - if ((c>2)&&(c<5)) { - say_file("digits/%d.wav", c);// ??? - ?????? - say_file("digits/thousands-i.wav"); //?????? - } - else{ - say_file("digits/%d.wav", c);// ???? .. ?????? - say_file("digits/thousands.wav"); //????? - } - } - else if (what==million) { //????????? - if ((c>2)&&(c<5)) { - say_file("digits/%d.wav", c);// ??? ?????? - say_file("digits/million-a.wav"); //???????? - } - else{ - say_file("digits/%d.wav", c);// ???? .. ?????? - say_file("digits/millions.wav"); //????????? - } - } - else { - say_file("digits/%d.wav", c);// ??? ?????? ???? - } - break; - - //------------- - case it: //??? - if (what==thousand) { //????? - if ((c>2)&&(c<5)) { - say_file("digits/%d.wav", c);// ??? - ?????? - say_file("digits/thousands-i.wav"); //?????? - } - else{ - say_file("digits/%d.wav", c);// ???? .. ?????? - say_file("digits/thousands.wav"); //????? - } - } - else if (what==million) { //????????? - if ((c>2)&&(c<5)) { - say_file("digits/%d.wav", c);// ??? ?????? - say_file("digits/million-a.wav"); //???????? - } - else{ - say_file("digits/%d.wav", c);// ???? .. ?????? - say_file("digits/millions.wav"); //????????? - } - } - else { - say_file("digits/%d.wav", c);// ??? ?????? ???? - } - break; - } - break; -//------------------------------------------------------ - case what_: //?????/?/?? - switch (sex) - { //??? - case male: //??????? - if (what==thousand) { - if (last==0) {// ???? ?????? ???? ???? ?????? ???????? ????, 3-?, 4-? ... - say_file("digits/h-%dxx.wav", c);//????, ????, ???? - say_file("digits/h-thousandm.wav"); //???????? - } - else { //???? ???? ?????? ????? ?????? 1000 - say_file("digits/%d.wav", c);//??? ?????? .. - say_file("digits/thousand.wav"); //?????? - } - } - else if (what==million) { - if (last==0) {// ???? ?????? ???? ???? ?????? ???????? ????, 3-?, 4-? ... - say_file("digits/h-%dxx.wav", c);//????, ????, ???? - say_file("digits/h-millionm.wav"); //?????????? - } - else { //???? ???? ?????? ????? ?????? 1000 - say_file("digits/%d.wav", c);//??? ?????? .. - say_file("digits/thousand.wav"); //???????? - } - }//?????? ????? ??? ????? - else{ - say_file("digits/h-%dm.wav", c);//?????? ??????? .. - } - break; - case female: //??????? - if (what==thousand) { - if (last==0) {// ???? ?????? ???? ???? ?????? ???????? ????, 3-?, 4-? ... - say_file("digits/h-%dxx.wav", c);//????, ????, ???? - say_file("digits/h-thousandf.wav"); //???????? - } - else { //???? ???? ?????? ????? ?????? 1000 - say_file("digits/%d.wav", c);//??? ?????? .. - say_file("digits/thousand.wav"); //?????? - } - } - else if (what==million) { - if (last==0) {// ???? ?????? ???? ???? ?????? ???????? ????, 3-?, 4-? ... - say_file("digits/h-%dxx.wav", c);//????, ????, ???? - say_file("digits/h-millionf.wav"); //?????????? - } - else { //???? ???? ?????? ????? ?????? 1000 - say_file("digits/%d.wav", c);//??? ?????? .. - say_file("digits/thousand.wav"); //???????? - } - }//?????? ????? ??? ????? - else{ - say_file("digits/h-%df.wav", c);//?????? ??????? .. - } - break; - case it: //??? - if (what==thousand) { - if (last==0) {// ???? ?????? ???? ???? ?????? ???????? ????, 3-?, 4-? ... - say_file("digits/h-%dxx.wav", c);//????, ????, ???? - say_file("digits/h-thousandn.wav"); //???????? - } - else { //???? ???? ?????? ????? ?????? 1000 - say_file("digits/%d.wav", c);//??? ?????? .. - say_file("digits/thousand.wav"); //?????? - } - } - else if (what==million) { - if (last==0) {// ???? ?????? ???? ???? ?????? ???????? ????, 3-?, 4-? ... - say_file("digits/h-%dxx.wav", c);//????, ????, ???? - say_file("digits/h-millionn.wav"); //?????????? - } - else { //???? ???? ?????? ????? ?????? 1000 - say_file("digits/%d.wav", c);//??? ?????? .. - say_file("digits/thousand.wav"); //???????? - } - }//?????? ????? ??? ????? - else{ - say_file("digits/h-%dn.wav", c);//?????? ??????? .. - } - break; - } - break; -//------------------------------------------------------- - case when: //?????? - ????? ??? ???? - if (what==thousand) { - if (last==0) {// ???? ?????? ???? ???? ?????? ???????? ????, 3-?, 4-? ... - say_file("digits/h-%dxx.wav", c);//????, ????, ???? - say_file("digits/h-thousandx.wav"); //????????? - } - else { //???? ???? ?????? ????? ?????? 1000 - say_file("digits/%d.wav", c);//??? ?????? .. - say_file("digits/thousand.wav"); //?????? - } - } - else if (what==million) { - if (last==0) {// ???? ?????? ???? ???? ?????? ???????? ????, 3-?, 4-? ... - say_file("digits/h-%dxx.wav", c);//????, ????, ???? - say_file("digits/h-millionx.wav"); //?????????? - } - else { //???? ???? ?????? ????? ?????? 1000 - say_file("digits/%d.wav", c);//??? ?????? .. - say_file("digits/thousand.wav"); //???????? - } - }//?????? ????? ??? ????? - else{ - say_file("digits/h-%dx.wav", c);//???????? ???????? .. - } - break; - }//????? switch (question) - } //????? //0 ? 3-9 - else if ((c==2)||(c==1)) { //1 2 - switch (question) { -//------------------------------------------------------ - case how_much: // - switch (sex) - { //??? - case male: //??????? - if (what==thousand) { - if (c==1) { - say_file("digits/%df.wav", c); // ???? ??? - say_file("digits/thousand.wav"); //?????? - } - else{ - say_file("digits/%df.wav", c); // ???? ??? - say_file("digits/thousands-i.wav"); //?????? - } - } - else if (what==million) { - say_file("digits/%d.wav", c); // ???? ??? - if (c==1) { - say_file("digits/million.wav", c); //??????? - } - else { //???? ??? - say_file("digits/million-a.wav"); // ???????? - } - } - else { //?????? ???? ??? - say_file("digits/%d.wav", c); // ???? ??? - } - break; - //------------- - case female: //??????? - if (what==thousand) { - if (c==1) { - say_file("digits/%df.wav", c); // ???? ??? - say_file("digits/thousand.wav"); //?????? - } - else{ - say_file("digits/%df.wav", c); // ???? ??? - say_file("digits/thousands-i.wav"); //?????? - } - } - else if (what==million) { - say_file("digits/%d.wav", c); // ???? ??? - if (c==1) { - say_file("digits/million.wav"); //??????? - } - else { //???? ??? - say_file("digits/million-a.wav"); // ???????? - } - } - else { //?????? ???? ??? - say_file("digits/%df.wav", c); // ???? ??? - } - break; - //------------- - case it: //??? - if (what==thousand) { - if (c==1) { - say_file("digits/%df.wav", c); // ???? ??? - say_file("digits/thousand.wav"); //?????? - } - else{ - say_file("digits/%df.wav", c); // ???? ??? - say_file("digits/thousands-i.wav"); //?????? - } - } - else if (what==million) { - say_file("digits/%d.wav", c); // ???? ??? - if (c==1) { - say_file("digits/million.wav"); //??????? - } - else { //???? ??? - say_file("digits/million-a.wav"); // ???????? - } - } - else { //?????? ???? ??? - say_file("digits/%dn.wav", c); // ???? ??? - } - break; - } - break; -//------------------------------------------------------ - case what_: //?????/?/?? - switch (sex) - { //??? - case male: //??????? - if (what==thousand) { - if (last==0) {// ???? ?????? ???? ???? ?????? ???????? ????,???? 2-?, ... - if (c!=1) { //?? ?????????? ???? ???????? - say_file("digits/h-%dxx.wav", c);//????, ???? - } - say_file("digits/h-thousandm.wav"); //???????? - } - else { //???? ???? ?????? ????? ?????? 1000 - say_file("digits/%df.wav", c);//???? ??? - say_file("digits/thousands-i.wav"); //?????? - } - } - else if (what==million) { - if (last==0) {// ???? ?????? ???? ???? ?????? ???????? ????, 3-?, 4-? ... - if (c!=1) { - say_file("digits/h-%dxx.wav", c);//????, ????, ???? - } - say_file("digits/h-millionm.wav"); //?????????? - } - else { //???? ???? ?????? ????? ?????? 1000 - say_file("digits/%d.wav", c);//??? ?????? .. - say_file("digits/thousand-a.wav"); //???????? - } - }//?????? ????? ??? ????? - else{ - say_file("digits/h-%dm.wav", c);//?????? ??????? .. - } - break; - case female: //??????? - if (what==thousand) { - if (last==0) {// ???? ?????? ???? ???? ?????? ???????? ????, 1-?, 2-? ... - if (c!=1) { //?? ?????????? ???? ???????? - say_file("digits/h-%dxx.wav", c);//????, ???? - } - say_file("digits/h-thousandf.wav"); //???????? - } - else { //???? ???? ?????? ????? ?????? 1000 - say_file("digits/%df.wav", c);//??? ?????? .. - say_file("digits/thousands-i.wav"); //?????? - } - } - else if (what==million) { - if (last==0) {// ???? ?????? ???? ???? ?????? ???????? ????, 3-?, 4-? ... - if (c!=1) { - say_file("digits/h-%dxx.wav", c);//????, ????, ???? - } - say_file("digits/h-millionf.wav"); //?????????? - } - else { //???? ???? ?????? ????? ?????? 1000 - say_file("digits/%d.wav", c);//??? ?????? .. - say_file("digits/thousand-a.wav"); //???????? - } - }//?????? ????? ??? ????? - else{ - say_file("digits/h-%df.wav", c);//?????? ??????? .. - } - break; - case it: //??? - if (what==thousand) { - if (last==0) {// ???? ?????? ???? ???? ?????? ???????? ????, 1-?, 2-? ... - if (c!=1) { //?? ?????????? ???? ???????? - say_file("digits/h-%dxx.wav", c);//????, ???? - } - say_file("digits/h-thousandn.wav"); //???????? - } - else { //???? ???? ?????? ????? ?????? 1000 - say_file("digits/%df.wav", c);//??? .. - say_file("digits/thousands-i.wav"); //?????? - } - } - else if (what==million) { - if (last==0) {// ???? ?????? ???? ???? ?????? ???????? ????, 3-?, 4-? ... - if (c!=1) { - say_file("digits/h-%dxx.wav", c);//????, ???? - } - say_file("digits/h-millionn.wav"); //?????????? - } - else { //???? ???? ?????? ????? ?????? 1000 - say_file("digits/%d.wav", c);//??? ?????? .. - say_file("digits/thousand-a.wav"); //???????? - } - }//?????? ????? ??? ????? - else{ - say_file("digits/h-%dn.wav", c);//?????? ??????? .. - } - break; - } - break; -//------------------------------------------------------- - case when: //?????? - ????? ??? ???? - if (what==thousand) { - if (last==0) {// ???? ?????? ???? ???? ?????? ???????? ????, 3-?, 4-? ... - if (c!=1) { //?? ?????????? ???? ????????? - say_file("digits/h-%dxx.wav", c);//????, ???? - } - say_file("digits/h-thousandx.wav"); //????????? - } - else { //???? ???? ?????? ????? ?????? 1000 - say_file("digits/%df.wav", c);//??? ?????? .. - say_file("digits/thousands-i.wav"); //?????? - } - } - else if (what==million) { - if (last==0) {// ???? ?????? ???? ???? ?????? ???????? ????, 3-?, 4-? ... - if (c!=1) { - say_file("digits/h-%dxx.wav", c);//????, ????, ???? - } - say_file("digits/h-millionx.wav"); //??????????? - } - else { //???? ???? ?????? ????? ?????? 1000 - say_file("digits/%d.wav", c);//??? ?????? .. - say_file("digits/thousand-a.wav"); //???????? - } - }//?????? ????? ??? ????? - else{ - say_file("digits/h-%dx.wav", c);//???????? ???????? .. - } - break; - } - }//else if ((c==2)||(c==1)) { //1 2 - - }//????? if ((c)||(what=="zero")) + } + } return SWITCH_STATUS_SUCCESS; -} - +} + + +static switch_status_t play_group(say_type_t say_type, casus_t casus, int a, int b, int c, + unit_t what, switch_core_session_t *session, switch_input_args_t *args) +{ +// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "a= %d b=%d c=%d what=%d!\n", a, b, c,what); + if (a) { + if (((b==0)&&(c==0))||(matrix[casus][say_type].all==1)) { //???? b ? ? ????? 0 ?? ??????? ????????, ??????????, ?????????? + if (what==million) { //??????? ????? ????????? + say_file("digits/%s%d00%s.wav",matrix[casus][say_type].million[12], a, matrix[casus][say_type].million[13]); + say_file("digits/%s.wav", matrix[casus][say_type].million[11]); + } + else if (what==thousand){ + say_file("digits/%s%d00%s.wav",matrix[casus][say_type].thousand[12], a, matrix[casus][say_type].thousand[13]); + say_file("digits/%s.wav", matrix[casus][say_type].thousand[11]); + } + else { + say_file("digits/%s%d00%s.wav",matrix[casus][say_type].num[6], a, matrix[casus][say_type].num[7]); + } + } + else { //???? ?????? ???? ????? ?? ?????? ? ???????? ?? ?????????? ???? + say_file("digits/%d00.wav",a); +// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%d - ??????? ?????\n",a); + } +// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "??????? ?? a"); + } -static char *strip_commas(char *in, char *out, switch_size_t len) -{ - char *p = in, *q = out; - char *ret = out; - switch_size_t x = 0; - - for (; p && *p; p++) { - if ((*p > 47 && *p < 58)) { - *q++ = *p; - } else if (*p != ',') { - ret = NULL; - break; +// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play b\n"); + + if (b) { + if (b>1) { //???? 20 ? ?????? + if ((c==0)||(matrix[casus][say_type].all==1)) { //???? ? ????? 0 ?? ??????? 20, ????????, ????????? + if (what==million) { //??????? ????? ????????? + say_file("digits/%s%d0%s.wav",matrix[casus][say_type].million[12], b, matrix[casus][say_type].million[13]); + say_file("digits/%s.wav", matrix[casus][say_type].million[11]); + } + else if (what==thousand){ + say_file("digits/%s%d0%s.wav",matrix[casus][say_type].thousand[12], b, matrix[casus][say_type].thousand[13]); + say_file("digits/%s.wav", matrix[casus][say_type].thousand[11]); } - - if (++x > len) { - ret = NULL; - break; + else { + say_file("digits/%s%d0%s.wav",matrix[casus][say_type].num[6], b, matrix[casus][say_type].num[7]); } + } + else { //???? ???? ?????? ????? + say_file("digits/%d0.wav",b); + } } - - return ret; -} - -static char *strip_nonnumerics(char *in, char *out, switch_size_t len) -{ - char *p = in, *q = out; - char *ret = out; - switch_size_t x = 0; - // valid are 0 - 9, period (.), minus (-), and plus (+) - remove all others - for (; p && *p; p++) { - if ((*p > 47 && *p < 58) || *p == '.' || *p == '-' || *p == '+') { - *q++ = *p; + else { //?? 10 ?? 19 + if (what==million) { + say_file("digits/%s%d%d%s.wav",matrix[casus][say_type].million[12], b, c, matrix[casus][say_type].million[13]); + say_file("digits/%s.wav", matrix[casus][say_type].million[11]); + } + else if (what==thousand) { + say_file("digits/%s%d%d%s.wav",matrix[casus][say_type].thousand[12], b, c, matrix[casus][say_type].thousand[13]); + say_file("digits/%s.wav", matrix[casus][say_type].thousand[11]); + } + else { //?????? ?????????? ????? ? ????????? ? ?????????? + say_file("digits/%s%d%d%s.wav",matrix[casus][say_type].num[6], b, c, matrix[casus][say_type].num[7]); + } + c=0; + } + } +// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play c\n"); + if (c||what==zero) { +// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play c= %d in matrix=%s what=%d say_type=%d casus=%d\n", c,matrix[casus][say_type].num[c],what,say_type,casus); + if (c<=5) { +// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "c=%d c<=5\n",c); + if (what==million) { + if ((strlen(matrix[casus][say_type].million[c*2])) > 0) { // ?? ??????????? ???? ?? ??????? ???????? 1 ??????? ? ?????? ??????? + say_file("digits/%s.wav", matrix[casus][say_type].million[c*2]) } - - if (++x > len) { - ret = NULL; - break; + say_file("digits/%s.wav", matrix[casus][say_type].million[c*2+1]); + } + else if (what==thousand) { + if ((strlen(matrix[casus][say_type].thousand[c*2])) > 0) {// // ?? ??????????? ???? ?? ??????? ???????? ???? ??????? ? ?????? ?????? + say_file("digits/%s.wav",matrix[casus][say_type].thousand[c*2]) } + say_file("digits/%s.wav", matrix[casus][say_type].thousand[c*2+1]); + } + else { //?????? ?????????? ????? ? ????????? ? ?????????? +// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play c= %d in matrix=%s!\n", c,matrix[casus][say_type].num[c]); + say_file("digits/%s.wav",matrix[casus][say_type].num[c]); + } } - - return ret; -} + else //?????? 5 + { +// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "c=%d c>5\n",c); + if (what==million) { + say_file("digits/%s%d%s.wav",matrix[casus][say_type].million[12], c, matrix[casus][say_type].million[13]); + say_file("digits/%s.wav", matrix[casus][say_type].million[11]); + } + else if (what==thousand) { + say_file("digits/%s%d%s.wav",matrix[casus][say_type].thousand[12], c, matrix[casus][say_type].thousand[13]); + say_file("digits/%s.wav", matrix[casus][say_type].thousand[11]); + } + else { //?????? ?????????? ????? ? ????????? ? ?????????? + say_file("digits/%s%d%s.wav",matrix[casus][say_type].num[6], c, matrix[casus][say_type].num[7]); + } + } + } + return SWITCH_STATUS_SUCCESS; +} static switch_status_t ru_say_count(switch_core_session_t *session, - char *tosay, sex_t sex, question_t question, switch_input_args_t *args) + char *tosay, say_type_t say_type, casus_t casus, switch_input_args_t *args) { int in; int x = 0; @@ -1107,7 +255,7 @@ switch_status_t status; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "ru_say_count %d %d %d other!\n", places[2], places[1], places[0]); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "ru_say_count %s!\n", tosay); if (!(tosay = strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); @@ -1116,7 +264,7 @@ in = atoi(tosay); int in_ = in; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "int in=%d!\n", in); +// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "int in=%d!\n", in); if (in != 0) { for (x = 8; x >= 0; x--) { int num = (int) pow(10, x); @@ -1124,23 +272,45 @@ in -= places[(uint32_t) x] * num; } } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "int in=%d \n", in); - - if ((status = play_group(sex,question, places[8], places[7], places[6], million,in%1000000, session, args)) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group %d %d %d million!\n", places[8], places[7], places[6]); - return status; +// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "a=%d b=%d c=%d\n", places[8],places[7],places[6]); +//???????? + if (places[8]||places[7]||places[6]) { + if ((in_%1000000>0)&&(matrix[casus][say_type].all!=1)) {// ???? ???? ????????? ???? ????? ????????? ??? ??????????? ????????????? ?????? + if ((status = play_group(male_c,nominativus, places[8], places[7], places[6],million, session, args)) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group %d %d %d million! status=%d\n", places[8], places[7], places[6],status); + return status; + } + } + else {// ????? ?????????? ? ?????? ?????? + if ((status = play_group(say_type,casus, places[8], places[7], places[6],million, session, args)) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group %d %d %d million! status=%d\n", places[8], places[7], places[6],status); + return status; + } + } } - if ((status = play_group(sex,question, places[5], places[4], places[3], thousand,in_%1000,session, args)) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group %d %d %d thousand!\n", places[5], places[4], places[3]); - return status; +//?????? + if (places[5]||places[4]||places[3]) { + if ((in_%1000>0)&&(matrix[casus][say_type].all!=1)) {// ???? ???? ????????? ???? ????? ????????? ??? ??????????? ????????????? ?????? + if ((status = play_group(male_c,nominativus, places[5], places[4], places[3],thousand, session, args)) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group %d %d %d thousand! status=%d\n", places[5], places[4], places[3],status); + return status; + } + } + else {// ????? ?????????? ? ?????? ?????? + if ((status = play_group(say_type,casus, places[5], places[4], places[3], thousand,session, args)) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group %d %d %d thousand! status=%d\n", places[5], places[4], places[3],status); + return status; + } + } } - if ((status = play_group(sex,question, places[2], places[1], places[0], empty, 0,session, args)) != SWITCH_STATUS_SUCCESS) - { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group %d %d %d other!\n", places[2], places[1], places[0]); +// ????? + if ((status = play_group(say_type,casus, places[2], places[1], places[0], empty, session, args)) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group %d %d %d thousand! status=%d\n", places[5], places[4], places[3],status); return status; } - } else { //???? ???? ??? ?? ? ??? ????????????? ? ?????????? ??????? - if ((status = play_group(sex,question, places[2], places[1], places[0], zero,0, session, args)) != SWITCH_STATUS_SUCCESS) + } + else { + if ((status = play_group(say_type, casus, places[2], places[1], places[0], zero, session, args)) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group %d %d %d other!\n", places[2], places[1], places[0]); return status; @@ -1150,296 +320,291 @@ return SWITCH_STATUS_SUCCESS; } - +//???????? static switch_status_t ru_say_general_count(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args) { switch_status_t status; - sex_t sex; - question_t question; - - if (type== SST_MESSAGES) - { - sex=it; - question=how_much; - } - else if (type== SST_NUMBER||type==SST_PERSONS) - { - sex=male; - question=how_much; - } - else if (type== SST_ITEMS) - { - sex=male; - question=what_; - } - else - { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unknown Say type=[%d]\n", type); - return SWITCH_STATUS_FALSE; - } - status=ru_say_count(session,tosay,sex,question,args); - return SWITCH_STATUS_SUCCESS; + casus_t casus; //????? + say_type_t say_type;//??? ???????????? + + switch (type) { + case SST_MESSAGES: + say_type=it_c; + casus=nominativus; + break; + default: + say_type=male_c; + casus=nominativus; + break; + }; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, " type=%d casus=%d\n", say_type,casus); + status=ru_say_count(session,tosay,say_type,casus,args); + return status; +// return SWITCH_STATUS_SUCCESS; } - + static switch_status_t ru_say_money(switch_core_session_t *session, char *tosay, switch_say_type_t type, - switch_say_method_t method,switch_input_args_t *args) + switch_say_method_t method,switch_input_args_t *args) { - char sbuf[16] = ""; - char *rubles = NULL; - char *kopecks = NULL; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, " ru_say_money %s\n",tosay ); - if (strlen(tosay) > 15 || !(tosay = strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); - return SWITCH_STATUS_GENERR; - } - rubles = sbuf; - - if ((kopecks = strchr(sbuf, '.'))) { - *kopecks++ = '\0'; - if (strlen(kopecks) > 2) { - kopecks[2] = '\0'; - } - } - if (sbuf[0] == '+') { - rubles++; - } + char sbuf[16] = ""; + char *rubles = NULL; + char *kopecks = NULL; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, " ru_say_money %s\n",tosay ); + if (strlen(tosay) > 15 || !(tosay = strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n"); + return SWITCH_STATUS_GENERR; + } + rubles = sbuf; + if ((kopecks = strchr(sbuf, '.'))) { + *kopecks++ = '\0'; + if (strlen(kopecks) > 2) { + kopecks[2] = '\0'; + } + } + if (sbuf[0] == '+') { + rubles++; + } + if (sbuf[0] == '-') { + say_file("currency/minus.wav"); + rubles++; + } + + ru_say_count(session,rubles ,male_c,nominativus ,args); + int irubles = atoi(rubles)%100; + int iruble = atoi(rubles)%10; + if (irubles == 1 || (irubles > 20 && iruble == 1)) {/* ????? */ + say_file("currency/ruble.wav"); + } + else if ((irubles > 1 && irubles < 5) || (irubles > 20 && iruble > 1 && iruble < 5)) { /*????? */ + say_file("currency/ruble-a.wav"); + } + else { /*?????? */ + say_file("currency/rubles.wav"); + } - if (sbuf[0] == '-') { - say_file("currency/minus.wav"); - rubles++; - } - ru_say_count(session,rubles ,male,how_much,args); - int irubles = atoi(rubles)%100; - int iruble = atoi(rubles)%10; - if (irubles == 1 || (irubles > 20 && iruble == 1)) {/* ????? */ - say_file("currency/ruble.wav"); - } - else if ((irubles > 1 && irubles < 5) || (irubles > 20 && iruble > 1 && iruble < 5)) { /*????? */ - say_file("currency/ruble-a.wav"); - } - else { /*?????? */ - say_file("currency/rubles.wav"); - } - /* Say kopecks */ - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, " %s\n",kopecks ); - ru_say_count(session,kopecks ,female,how_much,args); - int ikopecks = atoi(kopecks)%100; - int ikopeck = atoi(kopecks)%10; - if (ikopecks == 1 || (ikopecks > 20 && ikopeck == 1)) - { - /* ??????? */ - say_file("currency/kopeck.wav"); - } - else if ((ikopecks > 1 && ikopecks < 5) || (ikopecks > 20 && ikopeck > 1 && ikopeck < 5)) - { - /* ??????? */ - say_file("currency/kopeck-i.wav"); - } - else - { - /* ?????? */ - say_file("currency/kopecks.wav"); - } + /* Say kopecks */ + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, " %s\n",kopecks ); + ru_say_count(session,kopecks ,female_c,nominativus ,args); + + int ikopecks = atoi(kopecks)%100; + int ikopeck = atoi(kopecks)%10; + if (ikopecks == 1 || (ikopecks > 20 && ikopeck == 1)) + { + /* ??????? */ + say_file("currency/kopeck.wav"); + } + else if ((ikopecks > 1 && ikopecks < 5) || (ikopecks > 20 && ikopeck > 1 && ikopeck < 5)) + { + /* ??????? */ + say_file("currency/kopeck-i.wav"); + } + else + { + /* ?????? */ + say_file("currency/kopecks.wav"); + } return SWITCH_STATUS_SUCCESS; } + static switch_status_t ru_say_time(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method, - switch_input_args_t *args) + switch_input_args_t *args) { - int32_t t; - char tmp[80]; - switch_time_t target = 0, target_now = 0; - switch_time_exp_t tm, tm_now; - uint8_t say_date = 0, say_time = 0, say_year = 0, say_month = 0, say_dow = 0, say_day = 0, say_yesterday = 0, say_today = 0; - switch_channel_t *channel = switch_core_session_get_channel(session); - const char *tz = switch_channel_get_variable(channel, "timezone"); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, " ru_say_time %s type=%d method=%d\n",tosay, type,method ); - - if (type == SST_TIME_MEASUREMENT) { - int64_t hours = 0; - int64_t minutes = 0; - int64_t seconds = 0; - int64_t r = 0; - - if (strchr(tosay, ':')) { - char *tme = switch_core_session_strdup(session, tosay); - char *p; - - if ((p = strrchr(tme, ':'))) { - *p++ = '\0'; - seconds = atoi(p); - if ((p = strchr(tme, ':'))) { - *p++ = '\0'; - minutes = atoi(p); - if (tme) { - hours = atoi(tme); - } - } else { - minutes = atoi(tme); - } - } - } else { - if ((seconds = atol(tosay)) <= 0) { - seconds = (int64_t) switch_epoch_time_now(NULL); - } - - if (seconds >= 60) { - minutes = seconds / 60; - r = seconds % 60; - seconds = r; - } - - if (minutes >= 60) { - hours = minutes / 60; - r = minutes % 60; - minutes = r; - } - } + int32_t t; + char tmp[80]; + switch_time_t target = 0, target_now = 0; + switch_time_exp_t tm, tm_now; + uint8_t say_date = 0, say_time = 0, say_year = 0, say_month = 0, say_dow = 0, say_day = 0, say_yesterday = 0, say_today = 0; + switch_channel_t *channel = switch_core_session_get_channel(session); + const char *tz = switch_channel_get_variable(channel, "timezone"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, " ru_say_time %s type=%d method=%d\n",tosay, type,method ); + + if (type == SST_TIME_MEASUREMENT) { + int64_t hours = 0; + int64_t minutes = 0; + int64_t seconds = 0; + int64_t r = 0; + + if (strchr(tosay, ':')) { + char *tme = switch_core_session_strdup(session, tosay); + char *p; + + if ((p = strrchr(tme, ':'))) { + *p++ = '\0'; + seconds = atoi(p); + if ((p = strchr(tme, ':'))) { + *p++ = '\0'; + minutes = atoi(p); + if (tme) { + hours = atoi(tme); + } + } else { + minutes = atoi(tme); + } + } + } else { + if ((seconds = atol(tosay)) <= 0) { + seconds = (int64_t) switch_epoch_time_now(NULL); + } + + if (seconds >= 60) { + minutes = seconds / 60; + r = seconds % 60; + } + + if (minutes >= 60) { + hours = minutes / 60; + r = minutes % 60; + minutes = r; + } + } - switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)hours); - ru_say_count(session,tmp ,male,how_much,args); - if (((hours%10) == 1) && (hours!=11)) { + switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)hours); + ru_say_count(session,tmp ,male_c,nominativus,args); + if (((hours%10) == 1) && (hours!=11)) { /* ??? */ - say_file("time/hour.wav"); - } - else if (((hours%10>1)&&(hours%10<5)) &&((hours<12)||(hours>14))) { - say_file("time/hours-a.wav"); /* ???? */ - } - else { - say_file("time/hours.wav"); /* ?????*/ - } + say_file("time/hour.wav"); + } + else if (((hours%10>1)&&(hours%10<5)) &&((hours<12)||(hours>14))) { + say_file("time/hours-a.wav"); /* ???? */ + } + else { + say_file("time/hours.wav"); /* ?????*/ + } switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)minutes); //????????? ?????? ? *char - ru_say_count(session,tmp ,female,how_much,args); - if (((minutes%10) == 1) && (minutes!=11)) { - say_file("time/minute.wav"); //?????? - } - else if (((minutes%10>1)&&(minutes%10<5))&&((minutes<12)||(minutes>14))){ - say_file("time/minutes-i.wav"); // ?????? - } - else { - say_file("time/minutes.wav"); //????? - } - - if (seconds!=0) { - switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)seconds); - ru_say_count(session,tmp ,female,how_much,args); - if (((seconds%10) == 1) && (seconds!=11)) { - say_file("time/second.wav"); // ??????? - } - else if (((seconds%10>1)&&(seconds%10<5))&&((seconds<12)||(seconds>14))) { - say_file("time/seconds-i.wav"); // ?????? - } - else { - say_file("time/seconds.wav"); //?????? - } - } + ru_say_count(session,tmp ,female_c,nominativus,args); + if (((minutes%10) == 1) && (minutes!=11)) { + say_file("time/minute.wav"); //?????? + } + else if (((minutes%10>1)&&(minutes%10<5))&&((minutes<12)||(minutes>14))){ + say_file("time/minutes-i.wav"); // ?????? + } + else { + say_file("time/minutes.wav"); //????? + } - return SWITCH_STATUS_SUCCESS; - } + if (seconds!=0) { + switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)seconds); + ru_say_count(session,tmp ,female_c,nominativus,args); + if (((seconds%10) == 1) && (seconds!=11)) { + say_file("time/second.wav"); // ??????? + } + else if (((seconds%10>1)&&(seconds%10<5))&&((seconds<12)||(seconds>14))) { + say_file("time/seconds-i.wav"); // ?????? + } + else { + say_file("time/seconds.wav"); //?????? + } + } - if ((t = atol(tosay)) > 0) { - target = switch_time_make(t, 0); - target_now = switch_micro_time_now(); - } else { - target = switch_micro_time_now(); - target_now = switch_micro_time_now(); - } - - if (tz) { - int check = atoi(tz); - if (check) { - switch_time_exp_tz(&tm, target, check); - switch_time_exp_tz(&tm_now, target_now, check); - } else { - switch_time_exp_tz_name(tz, &tm, target); - switch_time_exp_tz_name(tz, &tm_now, target_now); - } - } else { - switch_time_exp_lt(&tm, target); - switch_time_exp_lt(&tm_now, target_now); - } - switch (type) { - case SST_CURRENT_DATE_TIME: - say_date = say_time = 1; - break; - case SST_CURRENT_DATE: - say_date = 1; - break; - case SST_CURRENT_TIME: - say_time = 1; - break; - case SST_SHORT_DATE_TIME: - say_time = 1; - if (tm.tm_year != tm_now.tm_year) { - say_date = 1; - break; - } - if (tm.tm_yday == tm_now.tm_yday) { - say_today = 1; - break; - } - if (tm.tm_yday == tm_now.tm_yday - 1) { - say_yesterday = 1; - break; - } - if (tm.tm_yday >= tm_now.tm_yday - 5) { - say_dow = 1; - break; - } - if (tm.tm_mon != tm_now.tm_mon) { - say_month = say_day = say_dow = 1; - break; - } + return SWITCH_STATUS_SUCCESS; + } - say_month = say_day = say_dow = 1; - - break; - default: - break; - } + if ((t = atol(tosay)) > 0) { + target = switch_time_make(t, 0); + target_now = switch_micro_time_now(); + } else { + target = switch_micro_time_now(); + target_now = switch_micro_time_now(); + } - if (say_today) { - say_file("time/today.wav"); - } - if (say_yesterday) { - say_file("time/yesterday.wav"); - } - if (say_dow) { - say_file("time/day-%d.wav", tm.tm_wday); - } - if (say_date) { - say_year = say_month = say_day = say_dow = 1; - say_today = say_yesterday = 0; - } - if (say_day) { - switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)tm.tm_mday); - ru_say_count(session,tmp ,male,when,args); - } - if (say_month) { - say_file("time/mon-%d.wav", tm.tm_mon); - } - if (say_year) { - switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)(tm.tm_year + 1900)); - ru_say_count(session,tmp ,male,when,args); - say_file("time/h-year.wav"); - } - if (say_month||say_year||say_date||say_dow) - { - say_file("time/at.wav"); - } - if (say_time) { - switch_snprintf(tmp, sizeof(tmp), "%d:%d:%d",tm.tm_hour+1,tm.tm_min,tm.tm_sec); - ru_say_time(session, tmp, SST_TIME_MEASUREMENT, method, args); - } - return SWITCH_STATUS_SUCCESS; + if (tz) { + int check = atoi(tz); + if (check) { + switch_time_exp_tz(&tm, target, check); + switch_time_exp_tz(&tm_now, target_now, check); + } else { + switch_time_exp_tz_name(tz, &tm, target); + switch_time_exp_tz_name(tz, &tm_now, target_now); + } + } else { + switch_time_exp_lt(&tm, target); + switch_time_exp_lt(&tm_now, target_now); + } + switch (type) { + case SST_CURRENT_DATE_TIME: + say_date = say_time = 1; + break; + case SST_CURRENT_DATE: + say_date = 1; + break; + case SST_CURRENT_TIME: + say_time = 1; + break; + case SST_SHORT_DATE_TIME: + say_time = 1; + if (tm.tm_year != tm_now.tm_year) { + say_date = 1; + break; + } + if (tm.tm_yday == tm_now.tm_yday) { + say_today = 1; + break; + } + if (tm.tm_yday == tm_now.tm_yday - 1) { + say_yesterday = 1; + break; + } + if (tm.tm_yday >= tm_now.tm_yday - 5) { + say_dow = 1; + break; + } + if (tm.tm_mon != tm_now.tm_mon) { + say_month = say_day = say_dow = 1; + break; + } + + say_month = say_day = say_dow = 1; + + break; + default: + break; + } + + if (say_today) { + say_file("time/today.wav"); + } + if (say_yesterday) { + say_file("time/yesterday.wav"); + } + if (say_dow) { + say_file("time/day-%d.wav", tm.tm_wday); + } + if (say_date) { + say_year = say_month = say_day = say_dow = 1; + say_today = say_yesterday = 0; + } + if (say_day) { + switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)tm.tm_mday); + ru_say_count(session,tmp ,male_h,genitivus,args); + } + if (say_month) { + say_file("time/mon-%d.wav", tm.tm_mon); + } + if (say_year) { + switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)(tm.tm_year + 1900)); + ru_say_count(session,tmp ,male_h,genitivus,args); + say_file("time/h-year.wav"); + } + if (say_month||say_year||say_date||say_dow) + { + say_file("time/at.wav"); + } + if (say_time) { + switch_snprintf(tmp, sizeof(tmp), "%d:%d:%d",tm.tm_hour+1,tm.tm_min,tm.tm_sec); + ru_say_time(session, tmp, SST_TIME_MEASUREMENT, method, args); + } + return SWITCH_STATUS_SUCCESS; } + + static switch_status_t ru_ip(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args) { @@ -1447,37 +612,40 @@ if (!(a = switch_core_session_strdup(session, tosay))) { return SWITCH_STATUS_FALSE; } - + if (!(b = strchr(a, '.'))) { return SWITCH_STATUS_FALSE; } - + *b++ = '\0'; - + if (!(c = strchr(b, '.'))) { return SWITCH_STATUS_FALSE; } - + *c++ = '\0'; - + if (!(d = strchr(c, '.'))) { return SWITCH_STATUS_FALSE; } - + *d++ = '\0'; - - ru_say_count(session,a ,male,how_much,args); + + ru_say_count(session,a ,male_c,nominativus,args); say_file("digits/dot.wav"); - ru_say_count(session,b ,male,how_much,args); + + ru_say_count(session,b ,male_c,nominativus,args); say_file("digits/dot.wav"); - ru_say_count(session,c ,male,how_much,args); + + ru_say_count(session,c ,male_c,nominativus,args); say_file("digits/dot.wav"); - ru_say_count(session,d ,male,how_much,args); + + ru_say_count(session,d ,male_c,nominativus,args); return SWITCH_STATUS_SUCCESS; } - - + + static switch_status_t ru_say(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args) { switch_say_callback_t say_cb = NULL; @@ -1524,9 +692,8 @@ } return SWITCH_STATUS_FALSE; } + - - SWITCH_MODULE_LOAD_FUNCTION(mod_say_ru_load) { switch_say_interface_t *say_interface; Added: freeswitch/trunk/src/mod/say/mod_say_ru/mod_say_ru.h ============================================================================== --- (empty file) +++ freeswitch/trunk/src/mod/say/mod_say_ru/mod_say_ru.h Mon May 11 14:06:08 2009 @@ -0,0 +1,581 @@ +//??????? ????? ??????? ??????? ???????? ??????? ?????? ???????? +//?????? ??????? ????????? ??? 1 ???? ?? ??????? +//http://ru.wiktionary.org/wiki/%D0%BE%D0%B4%D0%B8%D0%BD +//http://ru.wiktionary.org/wiki/%D0%BF%D0%B5%D1%80%D0%B2%D1%8B%D0%B9 + +typedef enum { + million, + thousand, + zero, + empty +} unit_t; + +//??? ????? ?????????? ??? ?????????????? +typedef enum{ + nominativus, // ???????????? ???? ???? + genitivus, // ??????????? ????? ????? + dativus, // ????????? ????? ???? + accusativus_a, // ??????????? ????? animate - ???????????? + accusativus_i, // ??????????? ???? inanimate - ?????????????? + instrumentalis, // ???????????? ???? ???? + prepositive // ?????????? ? ???? ? ???? +} casus_t; + + +typedef enum { + //?????????????? + male_c, //???????? ???? + it_c, //???????? + female_c, //???????? + plural_c, //????????????? ????? + //?????????? + male_h, //?????????? ???????? ???? + it_h, //?????????? ???????? + female_h, //?????????? ???????? + plural_h //?????????? ????????????? ????? +} say_type_t; + + + +struct say_t{ + char *num[8]; + char *thousand[14]; + char *million[14]; + int all; +}; + + +//???????????? +//???????????? ??????????????/???????????? + +//??????? ??? ??????????? ????? + +//?????? ?????? ???????? ??? ??????????? ????? ?? 0 ?? 5 ????? ???????????? ? ????????? ??? ????????? +// ???? ????? ??? ????? ? ?????????, ?????? ??? ? ????????????? ????? ? ????????? ? ????? ??? ?? ????????? ??? ???? +// ??? ??????????? ?????? ? ???????? ????? ? ????? 5 + +#define m_00 {\ + {"0","1","2","3","4","5","",""},\ + {"","","1f","thousand","2f","thousands-i","3","thousands-i","4","thousands-i","5","thousands","",""},\ + {"","","1","million","2","million-a","3","million-a","4","million-a","5","millions","",""},\ + 0,\ +}\ +//??????? ??? ???????????? ????? +#define m_01 {\ + {"0","1n","2","3","4","5","",""},\ + {"","","1f","thousand","2f","thousands-i","3","thousands-i","4","thousands-i","5","thousands","",""},\ + {"","","","million","2","million-a","3","million-a","4","million-a","5","millions","",""},\ + 0,\ +}\ + +//??????? +#define m_02 {\ + {"0","1f","2f","3","4","5","",""},\ + {"","","1f","thousand","2f","thousands-i","3","thousands-i","4","thousands-i","5","thousands","",""},\ + {"","","1","million","2","million-a","3","million-a","4","million-a","5","millions","",""},\ + 0,\ +}\ + +//????????????? ????? +#define m_03 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//?????????? +//??????? +#define m_04 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ +//??????? +#define m_05 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ +//??????? +#define m_06 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//????????????? ????? +#define m_07 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + + + +//??????????? ????? ????? +//??????????????/???????????? +//??????? +#define m_10 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ +//??????? +#define m_11 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//??????? +#define m_12 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//????????????? ????? +#define m_13 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//?????????? +//??????? +#define m_14 {\ + {"h-0x","h-1x","h-2x","h-3x","h-4x","h-4x","h-","x"},\ + {"","","","h-thousandx","h-2xx","h-thousandx","h-3xx","h-thousandx","h-4xx","h-thousandx","h-5xx","h-thousandx","h-","xx"},\ + {"","","","h-millionx","h-2xx","h-millionx","h-3xx","h-millionx","h-4xx","h-millionx","h-5xx","h-millionx","h-","xx"},\ + 0,\ +}\ +//??????? +#define m_15 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ +//??????? +#define m_16 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//????????????? ????? +#define m_17 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + + + +//????????? ????? ???? +//??????????????/???????????? +//??????? +#define m_20 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ +//??????? +#define m_21 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//??????? +#define m_22 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//????????????? ????? +#define m_23 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//?????????? +//??????? +#define m_24 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ +//??????? +#define m_25 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ +//??????? +#define m_26 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//????????????? ????? +#define m_27 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + + + +//??????????? ????? animate - ???????????? +//??????????????/???????????? +//??????? +#define m_30 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ +//??????? +#define m_31 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//??????? +#define m_32 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//????????????? ????? +#define m_33 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//?????????? +//??????? +#define m_34 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ +//??????? +#define m_35 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ +//??????? +#define m_36 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//????????????? ????? +#define m_37 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + + + +//??????????? ???? inanimate - ?????????????? +//??????????????/???????????? +//??????? +#define m_40 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ +//??????? +#define m_41 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//??????? +#define m_42 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//????????????? ????? +#define m_43 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//?????????? +//??????? +#define m_44 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ +//??????? +#define m_45 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ +//??????? +#define m_46 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//????????????? ????? +#define m_47 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + + + +//???????????? ???? ???? +//??????????????/???????????? +//??????? +#define m_50 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ +//??????? +#define m_51 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//??????? +#define m_52 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//????????????? ????? +#define m_53 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//?????????? +//??????? +#define m_54 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ +//??????? +#define m_55 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ +//??????? +#define m_56 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//????????????? ????? +#define m_57 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + + + +//?????????? ? ???? ? ???? +//??????????????/???????????? +//??????? +#define m_60 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ +//??????? +#define m_61 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//??????? +#define m_62 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//????????????? ????? +#define m_63 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//?????????? +//??????? +#define m_64 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ +//??????? +#define m_65 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ +//??????? +#define m_66 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//????????????? ????? +#define m_67 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + + + +//???????????? +//???????????? ??????????????/???????????? +//??????? +#define m_60 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ +//??????? +#define m_61 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//??????? +#define m_62 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//????????????? ????? +#define m_63 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//?????????? +//??????? +#define m_64 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ +//??????? +#define m_65 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ +//??????? +#define m_66 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + +//????????????? ????? +#define m_67 {\ + {"","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + {"","","","","","","","","","","","","",""},\ + 0,\ +}\ + + + From anthm at freeswitch.org Mon May 11 13:20:11 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Mon, 11 May 2009 15:20:11 -0500 Subject: [Freeswitch-svn] [commit] r13279 - freeswitch/trunk/src Message-ID: Author: anthm Date: Mon May 11 15:20:11 2009 New Revision: 13279 Log: use menu-timeout instead of menu-inter-digit-timeout when no digits have been entered 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 Mon May 11 15:20:11 2009 @@ -292,6 +292,7 @@ switch_input_args_t args = { 0 }; switch_channel_t *channel; char *sound_expanded = sound; + switch_size_t menu_buf_len = 0; if (!session || !menu || switch_strlen_zero(sound)) { return status; @@ -324,12 +325,14 @@ return status; } - menu->ptr += strlen(menu->buf); - if (strlen(menu->buf) < need) { + menu_buf_len = strlen(menu->buf); + + menu->ptr += menu_buf_len; + if (menu_buf_len < need) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "waiting for %u/%u digits t/o %d\n", (uint32_t)(menu->inlen - strlen(menu->buf)), (uint32_t)need, menu->inter_timeout); status = switch_ivr_collect_digits_count(session, menu->ptr, menu->inlen - strlen(menu->buf), - need, "#", &terminator, menu->inter_timeout, 0, 0); + need, "#", &terminator, menu_buf_len ? menu->inter_timeout : menu->timeout, 0, 0); } if (menu->confirm_macro && status == SWITCH_STATUS_SUCCESS && *menu->buf != '\0') { From mikej at freeswitch.org Mon May 11 15:28:02 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Mon, 11 May 2009 17:28:02 -0500 Subject: [Freeswitch-svn] [commit] r13280 - in freeswitch/trunk/src: include mod/applications/mod_conference mod/applications/mod_dptools mod/applications/mod_fifo mod/applications/mod_voicemail mod/endpoints/mod_loopback mod/endpoints/mod_sofia mod/event_handlers/mod_event_socket mod/formats/mod_local_stream mod/formats/mod_shout Message-ID: Author: mikej Date: Mon May 11 17:28:02 2009 New Revision: 13280 Log: cleanup msvc code analysis tagging and warnings Modified: freeswitch/trunk/src/include/switch_core.h freeswitch/trunk/src/include/switch_xml.h 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/applications/mod_voicemail/mod_voicemail.c freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c Modified: freeswitch/trunk/src/include/switch_core.h ============================================================================== --- freeswitch/trunk/src/include/switch_core.h (original) +++ freeswitch/trunk/src/include/switch_core.h Mon May 11 17:28:02 2009 @@ -1505,7 +1505,7 @@ const char *module_name, const char *voice_name, _In_ unsigned int rate, - _In_ unsigned int interval, switch_speech_flag_t *flags, _In_ switch_memory_pool_t *pool); + _In_ unsigned int interval, switch_speech_flag_t *flags, _In_opt_ switch_memory_pool_t *pool); /*! \brief Feed text to the TTS module \param sh the speech handle to feed Modified: freeswitch/trunk/src/include/switch_xml.h ============================================================================== --- freeswitch/trunk/src/include/switch_xml.h (original) +++ freeswitch/trunk/src/include/switch_xml.h Mon May 11 17:28:02 2009 @@ -104,7 +104,7 @@ * \param dup true if you want the string to be strdup()'d automatically * \return the switch_xml_t or NULL if an error occured */ -SWITCH_DECLARE(switch_xml_t) switch_xml_parse_str_dynamic(_In_z_ char *s, _In_opt_ switch_bool_t dup); +SWITCH_DECLARE(switch_xml_t) switch_xml_parse_str_dynamic(_In_z_ char *s, _In_ switch_bool_t dup); /*! * \brief Parses a string into a switch_xml_t @@ -156,7 +156,7 @@ ///\param attrname the attribute name ///\param value the value ///\return an xml node or NULL -SWITCH_DECLARE(switch_xml_t) switch_xml_find_child(_In_ switch_xml_t node, _In_z_ const char *childname, _In_z_ const char *attrname, _In_z_ const char *value); +SWITCH_DECLARE(switch_xml_t) switch_xml_find_child(_In_ switch_xml_t node, _In_z_ const char *childname, _In_opt_z_ const char *attrname, _In_opt_z_ const char *value); SWITCH_DECLARE(switch_xml_t) switch_xml_find_child_multi(_In_ switch_xml_t node, _In_z_ const char *childname, ...); ///\brief returns the next tag of the same name in the same section and depth or NULL @@ -170,7 +170,7 @@ ///\param xml the xml node ///\param idx the index ///\return an xml node or NULL - switch_xml_t switch_xml_idx(_In_z_ switch_xml_t xml, _In_opt_ int idx); + switch_xml_t switch_xml_idx(_In_ switch_xml_t xml, _In_ int idx); ///\brief returns the name of the given tag ///\param xml the xml node @@ -186,7 +186,7 @@ ///\param xml the xml node ///\param attr the attribute ///\return the value -SWITCH_DECLARE(const char *) switch_xml_attr(_In_ switch_xml_t xml, _In_z_ const char *attr); +SWITCH_DECLARE(const char *) switch_xml_attr(_In_opt_ switch_xml_t xml, _In_opt_z_ const char *attr); ///\brief returns the value of the requested tag attribute, or "" if not found ///\param xml the xml node @@ -209,7 +209,7 @@ ///\param xml the xml node ///\param prn_header add header too ///\return the xml text string -SWITCH_DECLARE(char *) switch_xml_toxml(_In_ switch_xml_t xml, _In_opt_ switch_bool_t prn_header); +SWITCH_DECLARE(char *) switch_xml_toxml(_In_ switch_xml_t xml, _In_ switch_bool_t prn_header); ///\brief Converts an switch_xml structure back to xml using the buffer passed in the parameters. ///\param xml the xml node @@ -218,7 +218,7 @@ ///\param offset offset to start at ///\param prn_header add header too ///\return the xml text string -SWITCH_DECLARE(char *) switch_xml_toxml_buf(_In_ switch_xml_t xml, _In_z_ char *buf, _In_ switch_size_t buflen, _In_opt_ switch_size_t offset, _In_opt_ switch_bool_t prn_header); +SWITCH_DECLARE(char *) switch_xml_toxml_buf(_In_ switch_xml_t xml, _In_z_ char *buf, _In_ switch_size_t buflen, _In_ switch_size_t offset, _In_ switch_bool_t prn_header); ///\brief returns a NULL terminated array of processing instructions for the given ///\ target @@ -230,7 +230,7 @@ ///\brief frees the memory allocated for an switch_xml structure ///\param xml the xml node ///\note in the case of the root node the readlock will be lifted -SWITCH_DECLARE(void) switch_xml_free(_In_ switch_xml_t xml); +SWITCH_DECLARE(void) switch_xml_free(_In_opt_ switch_xml_t xml); SWITCH_DECLARE(void) switch_xml_free_in_thread(_In_ switch_xml_t xml, _In_ int stacksize); ///\brief returns parser error message or empty string if none @@ -253,7 +253,7 @@ ///\param name the name of the tag ///\param off the offset ///\return an xml node or NULL -SWITCH_DECLARE(switch_xml_t) switch_xml_add_child(_In_ switch_xml_t xml, _In_z_ const char *name, _In_opt_ switch_size_t off); +SWITCH_DECLARE(switch_xml_t) switch_xml_add_child(_In_ switch_xml_t xml, _In_z_ const char *name, _In_ switch_size_t off); ///\brief wrapper for switch_xml_add_child() that strdup()s name ///\param xml the xml node @@ -306,7 +306,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_cut(_In_ switch_xml_t xml); ///\brief inserts an existing tag into an ezxml structure -SWITCH_DECLARE(switch_xml_t) switch_xml_insert(_In_ switch_xml_t xml, _In_ switch_xml_t dest, _In_opt_ switch_size_t off); +SWITCH_DECLARE(switch_xml_t) switch_xml_insert(_In_ switch_xml_t xml, _In_ switch_xml_t dest, _In_ switch_size_t off); ///\brief Moves an existing tag to become a subtag of dest at the given offset from ///\ the start of dest's character content. Returns the moved tag. @@ -319,7 +319,7 @@ ///\param reload if it's is already open close it and open it again as soon as permissable (blocking) ///\param err a pointer to set error strings ///\return the xml root node or NULL -SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(_In_opt_ uint8_t reload, _Out_ const char **err); +SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(_In_ uint8_t reload, _Out_ const char **err); ///\brief initilize the core XML backend ///\param pool a memory pool to use @@ -345,13 +345,13 @@ ///\param params optional URL formatted params to pass to external gateways ///\return SWITCH_STATUS_SUCCESS if successful root and node will be assigned SWITCH_DECLARE(switch_status_t) switch_xml_locate(_In_z_ const char *section, - _In_z_ const char *tag_name, - _In_z_ const char *key_name, - _In_z_ const char *key_value, + _In_opt_z_ const char *tag_name, + _In_opt_z_ const char *key_name, + _In_opt_z_ const char *key_value, _Out_ switch_xml_t *root, _Out_ switch_xml_t *node, _In_opt_ switch_event_t *params, - _In_opt_ switch_bool_t clone); + _In_ switch_bool_t clone); SWITCH_DECLARE(switch_status_t) switch_xml_locate_domain(_In_z_ const char *domain_name, _In_opt_ switch_event_t *params, _Out_ switch_xml_t *root, _Out_ switch_xml_t *domain); @@ -365,11 +365,11 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(_In_z_ const char *key, _In_z_ const char *user_name, _In_z_ const char *domain_name, - _In_z_ const char *ip, - _Out_ switch_xml_t *root, _Out_ switch_xml_t *domain, _Out_ switch_xml_t *user, _Out_ switch_xml_t *ingroup, + _In_opt_z_ const char *ip, + _Out_ switch_xml_t *root, _Out_ switch_xml_t *domain, _Out_ switch_xml_t *user, _Out_opt_ switch_xml_t *ingroup, _In_opt_ switch_event_t *params); -SWITCH_DECLARE(switch_status_t) switch_xml_locate_user_in_domain(_In_z_ const char *user_name, _In_ switch_xml_t domain, _Out_ switch_xml_t *user, _Out_ switch_xml_t *ingroup); +SWITCH_DECLARE(switch_status_t) switch_xml_locate_user_in_domain(_In_z_ const char *user_name, _In_ switch_xml_t domain, _Out_ switch_xml_t *user, _Out_opt_ switch_xml_t *ingroup); ///\brief open a config in the core registry ///\param file_path the name of the config section e.g. modules.conf @@ -400,7 +400,7 @@ ///\brief parse a string for a list of sections ///\param str a | delimited list of section names ///\return the section mask -SWITCH_DECLARE(switch_xml_section_t) switch_xml_parse_section_string(_In_z_ const char *str); +SWITCH_DECLARE(switch_xml_section_t) switch_xml_parse_section_string(_In_opt_z_ const char *str); SWITCH_END_EXTERN_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 Mon May 11 17:28:02 2009 @@ -1672,6 +1672,11 @@ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to allocate memory to duplicate execute_app data.\n"); goto done; } + + if (!app) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to find application.\n"); + goto done; + } switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Execute app: %s, %s\n", app, arg); channel = switch_core_session_get_channel(member->session); @@ -2541,10 +2546,10 @@ if (imember->session) { const char *p; for (p = dtmf; p && *p; p++) { - switch_dtmf_t dtmf = { *p, SWITCH_DEFAULT_DTMF_DURATION}; + switch_dtmf_t digit = { *p, SWITCH_DEFAULT_DTMF_DURATION}; switch_mutex_lock(imember->control_mutex); switch_core_session_kill_channel(imember->session, SWITCH_SIG_BREAK); - switch_core_session_send_dtmf(imember->session, &dtmf); + switch_core_session_send_dtmf(imember->session, &digit); switch_mutex_unlock(imember->control_mutex); } } @@ -4562,7 +4567,7 @@ argc = switch_separate_string(dup, '|', argv, (sizeof(argv) / sizeof(argv[0]))); - for(i = 0; i < argc; i++) { + for(i = 0; i < argc && argv[i]; i++) { if (!strcasecmp(argv[i], "mute")) { *f &= ~MFLAG_CAN_SPEAK; } else if (!strcasecmp(argv[i], "deaf")) { 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 May 11 17:28:02 2009 @@ -2352,54 +2352,54 @@ if ((x_params = switch_xml_child(x_domain, "params"))) { for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) { - const char *var = switch_xml_attr(x_param, "name"); + const char *pvar = switch_xml_attr(x_param, "name"); const char *val = switch_xml_attr(x_param, "value"); - if (!strcasecmp(var, "dial-string")) { + if (!strcasecmp(pvar, "dial-string")) { dest = val; } else if (!strncasecmp(var, "dial-var-", 9)) { if (!var_event) { switch_event_create(&var_event, SWITCH_EVENT_GENERAL); } else { - switch_event_del_header(var_event, var + 9); + switch_event_del_header(var_event, pvar + 9); } - switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, var + 9, val); + switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, pvar + 9, val); } } } if ((x_params = switch_xml_child(x_group, "params"))) { for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) { - const char *var = switch_xml_attr(x_param, "name"); + const char *pvar = switch_xml_attr(x_param, "name"); const char *val = switch_xml_attr(x_param, "value"); - if (!strcasecmp(var, "dial-string")) { + if (!strcasecmp(pvar, "dial-string")) { dest = val; - } else if (!strncasecmp(var, "dial-var-", 9)) { + } else if (!strncasecmp(pvar, "dial-var-", 9)) { if (!var_event) { switch_event_create(&var_event, SWITCH_EVENT_GENERAL); } else { - switch_event_del_header(var_event, var + 9); + switch_event_del_header(var_event, pvar + 9); } - switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, var + 9, val); + switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, pvar + 9, val); } } } if ((x_params = switch_xml_child(x_user, "params"))) { for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) { - const char *var = switch_xml_attr(x_param, "name"); + const char *pvar = switch_xml_attr(x_param, "name"); const char *val = switch_xml_attr(x_param, "value"); - if (!strcasecmp(var, "dial-string")) { + if (!strcasecmp(pvar, "dial-string")) { dest = val; - } else if (!strncasecmp(var, "dial-var-", 9)) { + } else if (!strncasecmp(pvar, "dial-var-", 9)) { if (!var_event) { switch_event_create(&var_event, SWITCH_EVENT_GENERAL); } else { - switch_event_del_header(var_event, var + 9); + switch_event_del_header(var_event, pvar + 9); } - switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, var + 9, val); + switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, pvar + 9, val); } } } @@ -2408,7 +2408,7 @@ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No dial-string available, please check your user directory.\n"); cause = SWITCH_CAUSE_MANDATORY_IE_MISSING; } else { - const char *var; + const char *varval; char *d_dest = NULL; switch_channel_t *channel; switch_originate_flag_t myflags = SOF_NONE; @@ -2422,9 +2422,9 @@ if (session) { channel = switch_core_session_get_channel(session); - if ((var = switch_channel_get_variable(channel, SWITCH_CALL_TIMEOUT_VARIABLE)) - || (var = switch_event_get_header(var_event, "leg_timeout"))) { - timelimit = atoi(var); + if ((varval = switch_channel_get_variable(channel, SWITCH_CALL_TIMEOUT_VARIABLE)) + || (varval = switch_event_get_header(var_event, "leg_timeout"))) { + timelimit = atoi(varval); } switch_channel_set_variable(channel, "dialed_user", user); @@ -2439,9 +2439,9 @@ switch_event_dup(&event, var_event); switch_event_del_header(event, "dialed_user"); switch_event_del_header(event, "dialed_domain"); - if ((var = switch_event_get_header(var_event, SWITCH_CALL_TIMEOUT_VARIABLE)) || - (var = switch_event_get_header(var_event, "leg_timeout"))) { - timelimit = atoi(var); + if ((varval = switch_event_get_header(var_event, SWITCH_CALL_TIMEOUT_VARIABLE)) || + (varval = switch_event_get_header(var_event, "leg_timeout"))) { + timelimit = atoi(varval); } } else { switch_event_create(&event, SWITCH_EVENT_REQUEST_PARAMS); @@ -2485,17 +2485,17 @@ if (new_channel && xml) { if ((x_params = switch_xml_child(x_domain, "variables"))) { for (x_param = switch_xml_child(x_params, "variable"); x_param; x_param = x_param->next) { - const char *var = switch_xml_attr(x_param, "name"); + const char *pvar = switch_xml_attr(x_param, "name"); const char *val = switch_xml_attr(x_param, "value"); - switch_channel_set_variable(new_channel, var, val); + switch_channel_set_variable(new_channel, pvar, val); } } if ((x_params = switch_xml_child(x_user, "variables"))) { for (x_param = switch_xml_child(x_params, "variable"); x_param; x_param = x_param->next) { - const char *var = switch_xml_attr(x_param, "name"); + const char *pvar = switch_xml_attr(x_param, "name"); const char *val = switch_xml_attr(x_param, "value"); - switch_channel_set_variable(new_channel, var, val); + switch_channel_set_variable(new_channel, pvar, val); } } } 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 Mon May 11 17:28:02 2009 @@ -2168,8 +2168,7 @@ stop_node_thread(); } - top: - for (hi = switch_hash_first(NULL, globals.fifo_hash); hi; hi = switch_hash_next(hi)) { + for (hi = switch_hash_first(NULL, globals.fifo_hash); hi; hi = switch_hash_first(NULL, globals.fifo_hash)) { int x = 0; switch_hash_this(hi, NULL, NULL, &val); node = (fifo_node_t *) val; @@ -2186,8 +2185,8 @@ switch_core_hash_destroy(&node->consumer_hash); switch_thread_rwlock_unlock(node->rwlock); switch_core_destroy_memory_pool(&node->pool); - goto top; } + switch_core_hash_destroy(&globals.fifo_hash); memset(&globals, 0, sizeof(globals)); switch_mutex_unlock(mutex); 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 Mon May 11 17:28:02 2009 @@ -2858,15 +2858,15 @@ if (id) { int ok = 1; - switch_event_t *params = NULL; + switch_event_t *locate_params = NULL; const char *email_addr = NULL; - switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS); - switch_assert(params); - switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "mailbox", id); + switch_event_create(&locate_params, SWITCH_EVENT_REQUEST_PARAMS); + switch_assert(locate_params); + switch_event_add_header_string(locate_params, SWITCH_STACK_BOTTOM, "mailbox", id); if (switch_xml_locate_user("id", id, domain_name, switch_channel_get_variable(channel, "network_addr"), - &x_domain_root, &x_domain, &x_user, NULL, params) == SWITCH_STATUS_SUCCESS) { + &x_domain_root, &x_domain, &x_user, NULL, locate_params) == SWITCH_STATUS_SUCCESS) { if ((x_params = switch_xml_child(x_user, "params"))) { for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) { const char *var = switch_xml_attr_soft(x_param, "name"); @@ -2925,7 +2925,7 @@ ok = 0; } - switch_event_destroy(¶ms); + switch_event_destroy(&locate_params); if (!ok) { goto end; @@ -3904,13 +3904,13 @@ } if (!profile) { - switch_hash_index_t *hi; - void *val; + switch_hash_index_t *index; + void *value; 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; + for (index = switch_hash_first(NULL, globals.profile_hash); index; index = switch_hash_next(index)) { + switch_hash_this(index, NULL, NULL, &value); + profile = (vm_profile_t *) value; if (profile) { switch_thread_rwlock_rdlock(profile->rwlock); break; 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 Mon May 11 17:28:02 2009 @@ -565,7 +565,7 @@ if (switch_test_flag(tech_pvt, TFLAG_CNG)) { unsigned char data[SWITCH_RECOMMENDED_BUFFER_SIZE]; uint32_t flag = 0; - switch_status_t status; + switch_status_t encode_status; uint32_t rate = tech_pvt->read_codec.implementation->actual_samples_per_second; *frame = &tech_pvt->cng_frame; @@ -575,7 +575,7 @@ memset(&data, 0, sizeof(data)); if (strcasecmp(tech_pvt->read_codec.implementation->iananame, "L16")) { - status = switch_core_codec_encode(&tech_pvt->read_codec, + encode_status = switch_core_codec_encode(&tech_pvt->read_codec, NULL, data, sizeof(data), @@ -585,7 +585,7 @@ &tech_pvt->cng_frame.datalen, &rate, &flag); - if (status != SWITCH_STATUS_SUCCESS) { + if (encode_status != SWITCH_STATUS_SUCCESS) { switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); } @@ -664,7 +664,7 @@ } } - if (switch_test_flag(tech_pvt, TFLAG_LINKED)) { + if (switch_test_flag(tech_pvt, TFLAG_LINKED) && tech_pvt->other_tech_pvt) { switch_frame_t *clone; if (frame->codec->implementation != tech_pvt->write_codec.implementation) { Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Mon May 11 17:28:02 2009 @@ -4096,7 +4096,7 @@ end: - if (switch_event_create(&event, SWITCH_EVENT_RECV_INFO) == SWITCH_STATUS_SUCCESS) { + if (sip && switch_event_create(&event, SWITCH_EVENT_RECV_INFO) == SWITCH_STATUS_SUCCESS) { sip_alert_info_t *alert_info = sip_alert_info(sip); if (sip && sip->sip_content_type) { 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 May 11 17:28:02 2009 @@ -1177,8 +1177,8 @@ if (listener->session) { - switch_channel_t *channel = switch_core_session_get_channel(listener->session); - if (switch_channel_get_state(channel) < CS_HANGUP && switch_channel_test_flag(channel, CF_DIVERT_EVENTS)) { + switch_channel_t *chan = switch_core_session_get_channel(listener->session); + if (switch_channel_get_state(chan) < CS_HANGUP && switch_channel_test_flag(chan, CF_DIVERT_EVENTS)) { switch_event_t *e = NULL; while (switch_core_session_dequeue_event(listener->session, &e, SWITCH_TRUE) == SWITCH_STATUS_SUCCESS) { if (switch_queue_trypush(listener->event_queue, e) != SWITCH_STATUS_SUCCESS) { @@ -1480,8 +1480,10 @@ switch_set_flag_locked(listener, LFLAG_CONNECTED); switch_event_create(&call_event, SWITCH_EVENT_CHANNEL_DATA); - switch_caller_profile_event_set_data(switch_channel_get_caller_profile(channel), "Channel", call_event); - switch_channel_event_set_data(channel, call_event); + if (channel) { + switch_caller_profile_event_set_data(switch_channel_get_caller_profile(channel), "Channel", call_event); + switch_channel_event_set_data(channel, call_event); + } switch_event_add_header_string(call_event, SWITCH_STACK_BOTTOM, "Content-Type", "command/reply"); switch_event_add_header_string(call_event, SWITCH_STACK_BOTTOM, "Reply-Text", "+OK\n"); switch_event_add_header_string(call_event, SWITCH_STACK_BOTTOM, "Socket-Mode", switch_test_flag(listener, LFLAG_ASYNC) ? "async" : "static"); Modified: freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c ============================================================================== --- freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c (original) +++ freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c Mon May 11 17:28:02 2009 @@ -597,6 +597,10 @@ } } + if (!local_stream_name) { + goto usage; + } + source = switch_core_hash_find(globals.source_hash, local_stream_name); if (source) { if (xml) { Modified: freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c ============================================================================== --- freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c (original) +++ freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c Mon May 11 17:28:02 2009 @@ -712,7 +712,7 @@ context->stream_url = switch_core_sprintf(context->memory_pool, "http://%s", path); context->prebuf = handle->prebuf; launch_read_stream_thread(context); - while((switch_buffer_inuse(context->audio_buffer) < 1*2*context->samplerate) && ++sanity < 10) { + while((switch_buffer_inuse(context->audio_buffer) < (switch_size_t)(2 * context->samplerate)) && ++sanity < 10) { /* at least 1s of audio and up to 5s initialize */ switch_yield(500000); } From mrene at freeswitch.org Mon May 11 20:31:40 2009 From: mrene at freeswitch.org (FreeSWITCH SVN) Date: Mon, 11 May 2009 22:31:40 -0500 Subject: [Freeswitch-svn] [commit] r13281 - freeswitch/trunk/src/mod/applications/mod_fifo Message-ID: Author: mrene Date: Mon May 11 22:31:40 2009 New Revision: 13281 Log: s/for/while Modified: freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c 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 Mon May 11 22:31:40 2009 @@ -2168,7 +2168,7 @@ stop_node_thread(); } - for (hi = switch_hash_first(NULL, globals.fifo_hash); hi; hi = switch_hash_first(NULL, globals.fifo_hash)) { + while (hi = switch_hash_first(NULL, globals.fifo_hash)) { int x = 0; switch_hash_this(hi, NULL, NULL, &val); node = (fifo_node_t *) val; From mrene at freeswitch.org Mon May 11 20:42:11 2009 From: mrene at freeswitch.org (FreeSWITCH SVN) Date: Mon, 11 May 2009 22:42:11 -0500 Subject: [Freeswitch-svn] [commit] r13282 - freeswitch/trunk/src/mod/applications/mod_fifo Message-ID: Author: mrene Date: Mon May 11 22:42:11 2009 New Revision: 13282 Log: doh Modified: freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c 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 Mon May 11 22:42:11 2009 @@ -2168,7 +2168,7 @@ stop_node_thread(); } - while (hi = switch_hash_first(NULL, globals.fifo_hash)) { + while ((hi = switch_hash_first(NULL, globals.fifo_hash))) { int x = 0; switch_hash_this(hi, NULL, NULL, &val); node = (fifo_node_t *) val; From mrene at freeswitch.org Mon May 11 21:58:32 2009 From: mrene at freeswitch.org (FreeSWITCH SVN) Date: Mon, 11 May 2009 23:58:32 -0500 Subject: [Freeswitch-svn] [commit] r13283 - freeswitch/trunk/src/mod/applications/mod_voicemail Message-ID: Author: mrene Date: Mon May 11 23:58:32 2009 New Revision: 13283 Log: mod_voicemail: rework vm_boxcount api and add an optional profile parameter 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 Mon May 11 23:58:32 2009 @@ -3210,43 +3210,62 @@ } -#define BOXCOUNT_SYNTAX "@[|[new|saved|new-urgent|saved-urgent|all]]" +#define BOXCOUNT_SYNTAX "[profile/]@[|[new|saved|new-urgent|saved-urgent|all]]" SWITCH_STANDARD_API(boxcount_api_function) { char *dup; - char *how = "new"; + const char *how = "new"; int total_new_messages = 0; int total_saved_messages = 0; int total_new_urgent_messages = 0; int total_saved_urgent_messages = 0; + vm_profile_t *profile; + char *id, *domain, *p, *profilename = NULL; + + if (switch_strlen_zero(cmd)) { + stream->write_function(stream, "%d", 0); + return SWITCH_STATUS_SUCCESS; + } - if (cmd) { - switch_hash_index_t *hi; - void *val; - vm_profile_t *profile; - char *id, *domain, *p; - - dup = strdup(cmd); - id = dup; + id = dup = strdup(cmd); + + if ((p = strchr(dup, '/'))) { + *p++ = '\0'; + id = p; + profilename = dup; + } + + if (!strncasecmp(id, "sip:", 4)) { + id += 4; + } - if (!strncasecmp(cmd, "sip:", 4)) { - id += 4; - } + if (switch_strlen_zero(id)) { + stream->write_function(stream, "%d", 0); + goto done; + } - if (!id) { - stream->write_function(stream, "%d", 0); - free(dup); - return SWITCH_STATUS_SUCCESS; + if ((domain = strchr(id, '@'))) { + *domain++ = '\0'; + if ((p = strchr(domain, '|'))) { + *p++ = '\0'; + how = p; } - if ((domain = strchr(id, '@'))) { - *domain++ = '\0'; - if ((p = strchr(domain, '|'))) { - *p++ = '\0'; - how = p; + if (!switch_strlen_zero(profilename)) { + if ((profile = get_profile(profilename))) { + message_count(profile, id, domain, "inbox", &total_new_messages, &total_saved_messages, + &total_new_urgent_messages, &total_saved_urgent_messages); + switch_thread_rwlock_unlock(profile->rwlock); + } else { + stream->write_function(stream, "-ERR No such profile\n"); + goto done; } + } else { + /* Kept for backwards-compatibility */ + switch_hash_index_t *hi; switch_mutex_lock(globals.mutex); for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) { + void *val; switch_hash_this(hi, NULL, NULL, &val); profile = (vm_profile_t *) val; total_new_messages = total_saved_messages = 0; @@ -3255,8 +3274,6 @@ } switch_mutex_unlock(globals.mutex); } - - switch_safe_free(dup); } if (!strcasecmp(how, "saved")) { @@ -3271,6 +3288,8 @@ stream->write_function(stream, "%d", total_new_messages); } +done: + switch_safe_free(dup); return SWITCH_STATUS_SUCCESS; } From buklov at freeswitch.org Tue May 12 00:35:51 2009 From: buklov at freeswitch.org (FreeSWITCH SVN) Date: Tue, 12 May 2009 02:35:51 -0500 Subject: [Freeswitch-svn] [commit] r13284 - freeswitch/trunk/src/mod/say/mod_say_ru Message-ID: Author: buklov Date: Tue May 12 02:35:51 2009 New Revision: 13284 Log: small fix Modified: freeswitch/trunk/src/mod/say/mod_say_ru/mod_say_ru.h Modified: freeswitch/trunk/src/mod/say/mod_say_ru/mod_say_ru.h ============================================================================== --- freeswitch/trunk/src/mod/say/mod_say_ru/mod_say_ru.h (original) +++ freeswitch/trunk/src/mod/say/mod_say_ru/mod_say_ru.h Tue May 12 02:35:51 2009 @@ -152,8 +152,9 @@ //?????????? //??????? +//??????????? #define m_14 {\ - {"h-0x","h-1x","h-2x","h-3x","h-4x","h-4x","h-","x"},\ + {"h-0x","h-1x","h-2x","h-3x","h-4x","h-5x","h-","x"},\ {"","","","h-thousandx","h-2xx","h-thousandx","h-3xx","h-thousandx","h-4xx","h-thousandx","h-5xx","h-thousandx","h-","xx"},\ {"","","","h-millionx","h-2xx","h-millionx","h-3xx","h-millionx","h-4xx","h-millionx","h-5xx","h-millionx","h-","xx"},\ 0,\ From anthm at freeswitch.org Tue May 12 07:54:34 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Tue, 12 May 2009 09:54:34 -0500 Subject: [Freeswitch-svn] [commit] r13285 - freeswitch/trunk/src Message-ID: Author: anthm Date: Tue May 12 09:54:34 2009 New Revision: 13285 Log: FSCORE-357 Modified: freeswitch/trunk/src/switch_channel.c freeswitch/trunk/src/switch_ivr_originate.c Modified: freeswitch/trunk/src/switch_channel.c ============================================================================== --- freeswitch/trunk/src/switch_channel.c (original) +++ freeswitch/trunk/src/switch_channel.c Tue May 12 09:54:34 2009 @@ -796,7 +796,7 @@ uint32_t to, switch_channel_t *super_channel) { - + if (to) { to++; } @@ -2314,6 +2314,12 @@ char dtstr[SWITCH_DTMF_LOG_LEN+1] = ""; int x = 0; + if (switch_channel_test_flag(channel, CF_TIMESTAMP_SET)) { + return SWITCH_STATUS_FALSE; + } + + switch_channel_set_flag(channel, CF_TIMESTAMP_SET); + if (!(caller_profile = switch_channel_get_caller_profile(channel)) || !channel->variables) { return SWITCH_STATUS_FALSE; } @@ -2506,8 +2512,6 @@ switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, legbillusec); switch_channel_set_variable(channel, "flow_billusec", tmp); - - switch_channel_set_flag(channel, CF_TIMESTAMP_SET); 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 Tue May 12 09:54:34 2009 @@ -2056,16 +2056,12 @@ channel = switch_core_session_get_channel(originate_status[i].peer_session); - switch_channel_wait_for_flag(channel, - CF_TIMESTAMP_SET, - SWITCH_TRUE, - 5000, - NULL); - - if (!switch_channel_test_flag(channel, CF_TIMESTAMP_SET) || !switch_core_session_running(originate_status[i].peer_session)) { - switch_core_session_reporting_state(originate_status[i].peer_session); + switch_channel_wait_for_state_timeout(channel, CS_REPORTING, 5000); + + if (!switch_channel_test_flag(channel, CF_TIMESTAMP_SET)) { + switch_channel_set_timestamps(channel); } - + if (switch_ivr_generate_xml_cdr(originate_status[i].peer_session, &cdr) == SWITCH_STATUS_SUCCESS) { if ((xml_text = switch_xml_toxml(cdr, SWITCH_FALSE))) { switch_snprintf(buf, sizeof(buf), "%s_%d", cdr_var, ++cdr_total); From anthm at freeswitch.org Tue May 12 09:46:16 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Tue, 12 May 2009 11:46:16 -0500 Subject: [Freeswitch-svn] [commit] r13286 - freeswitch/trunk/src Message-ID: Author: anthm Date: Tue May 12 11:46:16 2009 New Revision: 13286 Log: FSCORE-365 Modified: freeswitch/trunk/src/switch_apr.c freeswitch/trunk/src/switch_rtp.c Modified: freeswitch/trunk/src/switch_apr.c ============================================================================== --- freeswitch/trunk/src/switch_apr.c (original) +++ freeswitch/trunk/src/switch_apr.c Tue May 12 11:46:16 2009 @@ -786,15 +786,23 @@ SWITCH_DECLARE(switch_status_t) switch_pollset_add(switch_pollset_t *pollset, const switch_pollfd_t *descriptor) { + if (!pollset) { + return SWITCH_STATUS_FALSE; + } + return apr_pollset_add((apr_pollset_t *)pollset, (const apr_pollfd_t *)descriptor); } SWITCH_DECLARE(switch_status_t) switch_poll(switch_pollfd_t *aprset, int32_t numsock, int32_t *nsds, switch_interval_time_t timeout) { - apr_status_t st = apr_poll((apr_pollfd_t *)aprset, numsock, nsds, timeout); - - if (st == APR_TIMEUP) { - st = SWITCH_STATUS_TIMEOUT; + apr_status_t st = SWITCH_STATUS_FALSE; + + if (aprset) { + st = apr_poll((apr_pollfd_t *)aprset, numsock, nsds, timeout); + + if (st == APR_TIMEUP) { + st = SWITCH_STATUS_TIMEOUT; + } } return st; Modified: freeswitch/trunk/src/switch_rtp.c ============================================================================== --- freeswitch/trunk/src/switch_rtp.c (original) +++ freeswitch/trunk/src/switch_rtp.c Tue May 12 11:46:16 2009 @@ -1475,7 +1475,8 @@ int do_cng = 0; if (rtp_session->timer.interval) { - if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOFLUSH) || switch_test_flag(rtp_session, SWITCH_RTP_FLAG_STICKY_FLUSH)) { + if ((switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOFLUSH) || switch_test_flag(rtp_session, SWITCH_RTP_FLAG_STICKY_FLUSH)) && + rtp_session->read_pollfd) { if (switch_poll(rtp_session->read_pollfd, 1, &fdr, 1) == SWITCH_STATUS_SUCCESS) { hot_socket = 1; } @@ -1487,7 +1488,7 @@ recvfrom: - if (!rtp_session->timer.interval) { + if (!rtp_session->timer.interval && rtp_session->read_pollfd) { poll_status = switch_poll(rtp_session->read_pollfd, 1, &fdr, poll_sec * 1000000); } From anthm at freeswitch.org Tue May 12 10:10:57 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Tue, 12 May 2009 12:10:57 -0500 Subject: [Freeswitch-svn] [commit] r13287 - in freeswitch/trunk/src: . include Message-ID: Author: anthm Date: Tue May 12 12:10:57 2009 New Revision: 13287 Log: accept asterisk N/X/Z/. notation everywhere regexes are expected when they start with _ Modified: freeswitch/trunk/src/include/switch_utils.h freeswitch/trunk/src/switch_regex.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 Tue May 12 12:10:57 2009 @@ -514,7 +514,7 @@ SWITCH_DECLARE(const char *) switch_stristr(const char *instr, const char *str); SWITCH_DECLARE(switch_bool_t) switch_is_lan_addr(const char *ip); SWITCH_DECLARE(char *) switch_replace_char(char *str, char from, char to, switch_bool_t dup); -SWITCH_DECLARE(switch_bool_t) switch_ast2regex(char *pat, char *rbuf, size_t len); +SWITCH_DECLARE(switch_bool_t) switch_ast2regex(const char *pat, char *rbuf, size_t len); /*! \brief Escape a string by prefixing a list of characters with an escape character Modified: freeswitch/trunk/src/switch_regex.c ============================================================================== --- freeswitch/trunk/src/switch_regex.c (original) +++ freeswitch/trunk/src/switch_regex.c Tue May 12 12:10:57 2009 @@ -60,11 +60,18 @@ int match_count = 0; char *tmp = NULL; uint32_t flags = 0; + char abuf[256] = ""; if (!(field && expression)) { return 0; } + if (*expression == '_') { + if (switch_ast2regex(expression + 1, abuf, sizeof(abuf))) { + expression = abuf; + } + } + if (*expression == '/') { char *opts = NULL; tmp = strdup(expression + 1); Modified: freeswitch/trunk/src/switch_utils.c ============================================================================== --- freeswitch/trunk/src/switch_utils.c (original) +++ freeswitch/trunk/src/switch_utils.c Tue May 12 12:10:57 2009 @@ -565,9 +565,9 @@ )? SWITCH_FALSE : SWITCH_TRUE; } -SWITCH_DECLARE(switch_bool_t) switch_ast2regex(char *pat, char *rbuf, size_t len) +SWITCH_DECLARE(switch_bool_t) switch_ast2regex(const char *pat, char *rbuf, size_t len) { - char *p = pat; + const char *p = pat; if (!pat) { return SWITCH_FALSE; From andrew at freeswitch.org Tue May 12 13:00:49 2009 From: andrew at freeswitch.org (FreeSWITCH SVN) Date: Tue, 12 May 2009 15:00:49 -0500 Subject: [Freeswitch-svn] [commit] r13288 - freeswitch/trunk/build/config Message-ID: Author: andrew Date: Tue May 12 15:00:49 2009 New Revision: 13288 Log: Fix erlang autoconf macro to deal with crazy things being in ~/.erlang (MODEVENT-45) Modified: freeswitch/trunk/build/config/erlang.m4 Modified: freeswitch/trunk/build/config/erlang.m4 ============================================================================== --- freeswitch/trunk/build/config/erlang.m4 (original) +++ freeswitch/trunk/build/config/erlang.m4 Tue May 12 15:00:49 2009 @@ -34,7 +34,7 @@ fi AC_MSG_RESULT([$ERLANG_VER]) - ERLANG_LIBDIR=`$ERLANG -noshell -eval 'io:format("~s/lib~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt` + ERLANG_LIBDIR=`$ERLANG -noshell -eval 'io:format("~n~s/lib~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1` AC_MSG_CHECKING([erlang libdir]) if test -z "`echo $ERLANG_LIBDIR`" ; then AC_MSG_ERROR([failed]) @@ -44,7 +44,7 @@ fi AC_MSG_RESULT([$ERLANG_LIBDIR]) - ERLANG_INCDIR=`$ERLANG -noshell -eval 'io:format("~s/include~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt` + ERLANG_INCDIR=`$ERLANG -noshell -eval 'io:format("~n~s/include~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1` AC_MSG_CHECKING([erlang incdir]) if test -z "`echo $ERLANG_INCDIR`" ; then AC_MSG_ERROR([failed]) From mikej at freeswitch.org Wed May 13 08:46:01 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Wed, 13 May 2009 10:46:01 -0500 Subject: [Freeswitch-svn] [commit] r13289 - freeswitch/trunk/libs/apr-util Message-ID: Author: mikej Date: Wed May 13 10:46:01 2009 New Revision: 13289 Log: add xml/expat stuff back to apr-utils (will require re-bootstrap before building anything that uses this) Modified: freeswitch/trunk/libs/apr-util/.update freeswitch/trunk/libs/apr-util/build-outputs.mk freeswitch/trunk/libs/apr-util/build.conf freeswitch/trunk/libs/apr-util/configure.in Modified: freeswitch/trunk/libs/apr-util/.update ============================================================================== --- freeswitch/trunk/libs/apr-util/.update (original) +++ freeswitch/trunk/libs/apr-util/.update Wed May 13 10:46:01 2009 @@ -1 +1 @@ -Thu May 8 18:41:57 EDT 2008 +Wed May 13 10:45:16 CDT 2009 Modified: freeswitch/trunk/libs/apr-util/build-outputs.mk ============================================================================== --- freeswitch/trunk/libs/apr-util/build-outputs.mk (original) +++ freeswitch/trunk/libs/apr-util/build-outputs.mk Wed May 13 10:46:01 2009 @@ -13,10 +13,11 @@ misc/apu_version.lo: misc/apu_version.c .make.dirs include/apu_version.h misc/apr_queue.lo: misc/apr_queue.c .make.dirs include/apr_queue.h uri/apr_uri.lo: uri/apr_uri.c .make.dirs include/apr_uri.h +xml/apr_xml.lo: xml/apr_xml.c .make.dirs include/apr_xml.h include/apr_xlate.h strmatch/apr_strmatch.lo: strmatch/apr_strmatch.c .make.dirs include/apr_strmatch.h xlate/xlate.lo: xlate/xlate.c .make.dirs include/apr_xlate.h -OBJECTS_all = crypto/apr_md5.lo crypto/uuid.lo crypto/apr_sha1.lo crypto/getuuid.lo crypto/apr_md4.lo encoding/apr_base64.lo hooks/apr_hooks.lo misc/apr_reslist.lo misc/apr_rmm.lo misc/apr_date.lo misc/apu_version.lo misc/apr_queue.lo uri/apr_uri.lo strmatch/apr_strmatch.lo xlate/xlate.lo +OBJECTS_all = crypto/apr_md5.lo crypto/uuid.lo crypto/apr_sha1.lo crypto/getuuid.lo crypto/apr_md4.lo encoding/apr_base64.lo hooks/apr_hooks.lo misc/apr_reslist.lo misc/apr_rmm.lo misc/apr_date.lo misc/apu_version.lo misc/apr_queue.lo uri/apr_uri.lo xml/apr_xml.lo strmatch/apr_strmatch.lo xlate/xlate.lo OBJECTS_unix = $(OBJECTS_all) @@ -28,11 +29,11 @@ OBJECTS_os390 = $(OBJECTS_all) -HEADERS = $(top_srcdir)/include/apr_optional.h $(top_srcdir)/include/apu_version.h $(top_srcdir)/include/apr_strmatch.h $(top_srcdir)/include/apr_optional_hooks.h $(top_srcdir)/include/apr_sdbm.h $(top_srcdir)/include/apr_md4.h $(top_srcdir)/include/apr_reslist.h $(top_srcdir)/include/apr_base64.h $(top_srcdir)/include/apr_anylock.h $(top_srcdir)/include/apr_rmm.h $(top_srcdir)/include/apr_md5.h $(top_srcdir)/include/apr_date.h $(top_srcdir)/include/apr_hooks.h $(top_srcdir)/include/apr_xlate.h $(top_srcdir)/include/apr_queue.h $(top_srcdir)/include/apr_uri.h $(top_srcdir)/include/apr_uuid.h $(top_srcdir)/include/apr_sha1.h +HEADERS = $(top_srcdir)/include/apr_optional.h $(top_srcdir)/include/apu_version.h $(top_srcdir)/include/apr_strmatch.h $(top_srcdir)/include/apr_optional_hooks.h $(top_srcdir)/include/apr_sdbm.h $(top_srcdir)/include/apr_md4.h $(top_srcdir)/include/apr_reslist.h $(top_srcdir)/include/apr_base64.h $(top_srcdir)/include/apr_xml.h $(top_srcdir)/include/apr_anylock.h $(top_srcdir)/include/apr_rmm.h $(top_srcdir)/include/apr_md5.h $(top_srcdir)/include/apr_date.h $(top_srcdir)/include/apr_hooks.h $(top_srcdir)/include/apr_xlate.h $(top_srcdir)/include/apr_queue.h $(top_srcdir)/include/apr_uri.h $(top_srcdir)/include/apr_uuid.h $(top_srcdir)/include/apr_sha1.h -SOURCE_DIRS = encoding hooks misc crypto uri strmatch xlate $(EXTRA_SOURCE_DIRS) +SOURCE_DIRS = xml encoding hooks misc crypto uri strmatch xlate $(EXTRA_SOURCE_DIRS) -BUILD_DIRS = crypto encoding hooks misc strmatch uri xlate +BUILD_DIRS = crypto encoding hooks misc strmatch uri xlate xml .make.dirs: $(srcdir)/build-outputs.mk @for d in $(BUILD_DIRS); do test -d $$d || mkdir $$d; done Modified: freeswitch/trunk/libs/apr-util/build.conf ============================================================================== --- freeswitch/trunk/libs/apr-util/build.conf (original) +++ freeswitch/trunk/libs/apr-util/build.conf Wed May 13 10:46:01 2009 @@ -15,10 +15,10 @@ ldap/*.c misc/*.c uri/apr_uri.c + xml/*.c strmatch/*.c xlate/*.c dbd/*.c -# xml/*.c # we have no platform-specific subdirs platform_dirs = Modified: freeswitch/trunk/libs/apr-util/configure.in ============================================================================== --- freeswitch/trunk/libs/apr-util/configure.in (original) +++ freeswitch/trunk/libs/apr-util/configure.in Wed May 13 10:46:01 2009 @@ -122,7 +122,7 @@ APU_CHECK_DBD_MYSQL APU_CHECK_DBD_SQLITE3 APU_CHECK_DBD_SQLITE2 -#APU_FIND_EXPAT +APU_FIND_EXPAT APU_FIND_ICONV AC_SEARCH_LIBS(crypt, crypt ufc) From mikej at freeswitch.org Wed May 13 08:58:42 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Wed, 13 May 2009 10:58:42 -0500 Subject: [Freeswitch-svn] [commit] r13290 - freeswitch/trunk/libs/apr-util Message-ID: Author: mikej Date: Wed May 13 10:58:42 2009 New Revision: 13290 Log: add xml/expat stuff back to apr-utils (will require re-bootstrap before building anything that uses this) Modified: freeswitch/trunk/libs/apr-util/.update freeswitch/trunk/libs/apr-util/configure.gnu Modified: freeswitch/trunk/libs/apr-util/.update ============================================================================== --- freeswitch/trunk/libs/apr-util/.update (original) +++ freeswitch/trunk/libs/apr-util/.update Wed May 13 10:58:42 2009 @@ -1 +1 @@ -Wed May 13 10:45:16 CDT 2009 +Wed May 13 10:54:08 CDT 2009 Modified: freeswitch/trunk/libs/apr-util/configure.gnu ============================================================================== --- freeswitch/trunk/libs/apr-util/configure.gnu (original) +++ freeswitch/trunk/libs/apr-util/configure.gnu Wed May 13 10:58:42 2009 @@ -1,3 +1,3 @@ #! /bin/sh -./configure "$@" --with-apr=../apr --disable-shared --with-pic --without-sqlite2 --without-sqlite3 +./configure "$@" --with-apr=../apr --disable-shared --with-pic --without-sqlite2 --without-sqlite3 --with-expat=builtin From mikej at freeswitch.org Wed May 13 09:13:16 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Wed, 13 May 2009 11:13:16 -0500 Subject: [Freeswitch-svn] [commit] r13291 - in freeswitch/trunk/libs/tiff-3.8.2: . contrib contrib/acorn contrib/addtiffo contrib/dbs contrib/dbs/xtiff contrib/iptcutil contrib/mac-cw contrib/mac-mpw contrib/mfs contrib/ojpeg contrib/pds contrib/ras contrib/stream contrib/tags contrib/win_dib html html/images html/man libtiff man port test tools Message-ID: Author: mikej Date: Wed May 13 11:13:16 2009 New Revision: 13291 Log: svn::ignore Modified: freeswitch/trunk/libs/tiff-3.8.2/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/contrib/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/contrib/acorn/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/contrib/addtiffo/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/contrib/dbs/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/contrib/dbs/xtiff/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/contrib/iptcutil/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/contrib/mac-cw/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/contrib/mac-mpw/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/contrib/mfs/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/contrib/ojpeg/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/contrib/pds/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/contrib/ras/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/contrib/stream/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/contrib/tags/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/contrib/win_dib/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/html/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/html/images/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/html/man/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/libtiff/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/man/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/port/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/test/ (props changed) freeswitch/trunk/libs/tiff-3.8.2/tools/ (props changed) From brian at freeswitch.org Wed May 13 09:23:13 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Wed, 13 May 2009 11:23:13 -0500 Subject: [Freeswitch-svn] [commit] r13293 - freeswitch/trunk/libs/esl/perl Message-ID: Author: brian Date: Wed May 13 11:23:13 2009 New Revision: 13293 Log: adding info example Added: freeswitch/trunk/libs/esl/perl/info.pl Added: freeswitch/trunk/libs/esl/perl/info.pl ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/esl/perl/info.pl Wed May 13 11:23:13 2009 @@ -0,0 +1,15 @@ +#!/usr/bin/perl + +require ESL; + +my $con = ESL::ESLconnection->new("localhost", "8021", "ClueCon"); +my $e = ESL::ESLevent->new("SEND_INFO"); + +#my $e = $con->sendEvent("MESSAGE_WAITING"); + +$e->addHeader("Content-Type", "text/xml"); +$e->addHeader("to-uri", 'sip:1002 at dev.bkw.org'); +$e->addHeader("from-uri", 'sip:1234 at dev.bkw.org'); +$e->addHeader("profile", 'external'); + +$con->sendEvent($e); From anthm at freeswitch.org Wed May 13 09:34:39 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 13 May 2009 11:34:39 -0500 Subject: [Freeswitch-svn] [commit] r13294 - in freeswitch/trunk/src: . mod/endpoints/mod_sofia mod/event_handlers/mod_event_socket Message-ID: Author: anthm Date: Wed May 13 11:34:39 2009 New Revision: 13294 Log: allow socket app to operate without pre_answer (please test) Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c freeswitch/trunk/src/switch_ivr.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 May 13 11:34:39 2009 @@ -1401,7 +1401,7 @@ if (!sofia_test_flag(tech_pvt, TFLAG_ANS) && !sofia_test_flag(tech_pvt, TFLAG_EARLY_MEDIA)) { sofia_set_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Asked to send early media by %s\n", msg->from); + switch_log_printf(SWITCH_CHANNEL_ID_LOG, msg->_file, msg->_func, msg->_line, NULL, SWITCH_LOG_INFO, "Sending early media\n"); /* Transmit 183 Progress with SDP */ if (switch_channel_test_flag(channel, CF_PROXY_MODE) || switch_channel_test_flag(channel, CF_PROXY_MEDIA)) { 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 Wed May 13 11:34:39 2009 @@ -432,10 +432,6 @@ launch_listener_thread(listener); - if (switch_channel_pre_answer(channel) != SWITCH_STATUS_SUCCESS) { - return; - } - while(switch_channel_ready(channel) && !switch_test_flag(listener, LFLAG_CONNECTED)) { switch_cond_next(); } Modified: freeswitch/trunk/src/switch_ivr.c ============================================================================== --- freeswitch/trunk/src/switch_ivr.c (original) +++ freeswitch/trunk/src/switch_ivr.c Wed May 13 11:34:39 2009 @@ -642,40 +642,23 @@ int stream_id = 0; switch_event_t *event; switch_unicast_conninfo_t *conninfo = NULL; - uint32_t rate; - uint32_t bpf; + uint32_t rate = 0; + uint32_t bpf = 0; const char *to; int timeout = 0; time_t expires = 0; - switch_codec_implementation_t read_impl = {0}; - switch_core_session_get_read_impl(session, &read_impl); + if (switch_channel_test_flag(channel, CF_CONTROLLED)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot park channels that are under control already.\n"); return SWITCH_STATUS_FALSE; } - if (!switch_channel_test_flag(channel, CF_ANSWERED)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Careful, Channel is unanswered. Pre-answering...\n"); - 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; - } - } - if (switch_channel_test_flag(channel, CF_PROXY_MODE) || switch_channel_get_state(channel) == CS_RESET) { return SWITCH_STATUS_FALSE; } - if (!switch_channel_media_ready(channel)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot park channels that have no read codec.\n"); - return SWITCH_STATUS_FALSE; - } - - rate = read_impl.actual_samples_per_second; - bpf = read_impl.decoded_bytes_per_packet; - if ((to = switch_channel_get_variable(channel, "park_timeout"))) { if ((timeout = atoi(to)) < 0) { timeout = 0; @@ -693,20 +676,36 @@ switch_event_fire(&event); } - while (switch_channel_media_ready(channel) && switch_channel_ready(channel) && switch_channel_test_flag(channel, CF_CONTROLLED) - && switch_channel_test_flag(channel, CF_PARK)) { - - if ((status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, stream_id)) == SWITCH_STATUS_SUCCESS) { - if (!SWITCH_READ_ACCEPTABLE(status)) { - break; - } + while (switch_channel_ready(channel) && switch_channel_test_flag(channel, CF_CONTROLLED) && switch_channel_test_flag(channel, CF_PARK)) { + + if (!rate && switch_channel_media_ready(channel)) { + switch_core_session_get_read_impl(session, &read_impl); + rate = read_impl.actual_samples_per_second; + bpf = read_impl.decoded_bytes_per_packet; + } + + if (rate) { + status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, stream_id); + } else { + switch_yield(20000); + status = SWITCH_STATUS_SUCCESS; + } + if (!SWITCH_READ_ACCEPTABLE(status)) { + break; + } else { if (expires && switch_epoch_time_now(NULL) >= expires) { switch_channel_hangup(channel, SWITCH_CAUSE_RECOVERY_ON_TIMER_EXPIRE); break; } if (switch_channel_test_flag(channel, CF_UNICAST)) { + if (!switch_channel_media_ready(channel)) { + if (switch_channel_pre_answer(channel) != SWITCH_STATUS_SUCCESS) { + return SWITCH_STATUS_FALSE; + } + } + if (!conninfo) { if (!(conninfo = switch_channel_get_private(channel, "unicast"))) { switch_channel_clear_flag(channel, CF_UNICAST); From brian at freeswitch.org Wed May 13 17:15:06 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Wed, 13 May 2009 19:15:06 -0500 Subject: [Freeswitch-svn] [commit] r13295 - in freeswitch/trunk: conf/dialplan src/mod/endpoints/mod_sofia Message-ID: Author: brian Date: Wed May 13 19:15:06 2009 New Revision: 13295 Log: sigh, polycom srtp will work now Modified: freeswitch/trunk/conf/dialplan/default.xml freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Modified: freeswitch/trunk/conf/dialplan/default.xml ============================================================================== --- freeswitch/trunk/conf/dialplan/default.xml (original) +++ freeswitch/trunk/conf/dialplan/default.xml Wed May 13 19:15:06 2009 @@ -87,15 +87,6 @@ - - - - - - - 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 May 13 19:15:06 2009 @@ -3372,6 +3372,9 @@ } if (is_ok) { + if (tech_pvt->local_crypto_key) { + sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0); + } nua_respond(tech_pvt->nh, SIP_200_OK, SIPTAG_CONTACT_STR(tech_pvt->reply_contact), SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), 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 May 13 19:15:06 2009 @@ -2805,11 +2805,26 @@ const char *a = switch_stristr("AES", tech_pvt->remote_crypto_key); const char *b = switch_stristr("AES", crypto); + /* Change our key every time we can */ + if (switch_stristr(SWITCH_RTP_CRYPTO_KEY_32, crypto)) { + switch_channel_set_variable(tech_pvt->channel, SOFIA_HAS_CRYPTO_VARIABLE, SWITCH_RTP_CRYPTO_KEY_32); + sofia_glue_build_crypto(tech_pvt, atoi(crypto), AES_CM_128_HMAC_SHA1_32, SWITCH_RTP_CRYPTO_SEND); + switch_rtp_add_crypto_key(tech_pvt->rtp_session, SWITCH_RTP_CRYPTO_SEND, atoi(crypto), tech_pvt->crypto_type, + tech_pvt->local_raw_key, SWITCH_RTP_KEY_LEN); + } else if (switch_stristr(SWITCH_RTP_CRYPTO_KEY_80, crypto)) { + switch_channel_set_variable(tech_pvt->channel, SOFIA_HAS_CRYPTO_VARIABLE, SWITCH_RTP_CRYPTO_KEY_80); + sofia_glue_build_crypto(tech_pvt, atoi(crypto), AES_CM_128_HMAC_SHA1_80, SWITCH_RTP_CRYPTO_SEND); + switch_rtp_add_crypto_key(tech_pvt->rtp_session, SWITCH_RTP_CRYPTO_SEND, atoi(crypto), tech_pvt->crypto_type, + tech_pvt->local_raw_key, SWITCH_RTP_KEY_LEN); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Crypto Setup Failed!.\n"); + } + if (a && b && !strncasecmp(a, b, 23)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Change Remote key to [%s]\n", crypto); tech_pvt->remote_crypto_key = switch_core_session_strdup(tech_pvt->session, crypto); tech_pvt->crypto_tag = crypto_tag; - + if (switch_rtp_ready(tech_pvt->rtp_session) && sofia_test_flag(tech_pvt, TFLAG_SECURE)) { sofia_glue_add_crypto(tech_pvt, tech_pvt->remote_crypto_key, SWITCH_RTP_CRYPTO_RECV); switch_rtp_add_crypto_key(tech_pvt->rtp_session, SWITCH_RTP_CRYPTO_RECV, tech_pvt->crypto_tag, From anthm at freeswitch.org Wed May 13 17:57:52 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 13 May 2009 19:57:52 -0500 Subject: [Freeswitch-svn] [commit] r13296 - freeswitch/trunk/src Message-ID: Author: anthm Date: Wed May 13 19:57:52 2009 New Revision: 13296 Log: more_calls=true Modified: freeswitch/trunk/src/switch_time.c Modified: freeswitch/trunk/src/switch_time.c ============================================================================== --- freeswitch/trunk/src/switch_time.c (original) +++ freeswitch/trunk/src/switch_time.c Wed May 13 19:57:52 2009 @@ -35,9 +35,9 @@ #include #include "private/switch_core_pvt.h" -#if defined(DARWIN) +//#if defined(DARWIN) #define DISABLE_1MS_COND -#endif +//#endif #ifndef UINT32_MAX #define UINT32_MAX 0xffffffff From brian at freeswitch.org Wed May 13 18:36:32 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Wed, 13 May 2009 20:36:32 -0500 Subject: [Freeswitch-svn] [commit] r13297 - freeswitch/trunk/src/mod/languages/mod_lua Message-ID: Author: brian Date: Wed May 13 20:36:32 2009 New Revision: 13297 Log: MODLANG-111 Modified: freeswitch/trunk/src/mod/languages/mod_lua/mod_lua.cpp Modified: freeswitch/trunk/src/mod/languages/mod_lua/mod_lua.cpp ============================================================================== --- freeswitch/trunk/src/mod/languages/mod_lua/mod_lua.cpp (original) +++ freeswitch/trunk/src/mod/languages/mod_lua/mod_lua.cpp Wed May 13 20:36:32 2009 @@ -213,7 +213,7 @@ if (!switch_strlen_zero(globals.xml_handler)) { lua_State *L = lua_init(); char *mycmd = strdup(globals.xml_handler); - const char *str; + char *str; switch_assert(mycmd); @@ -240,8 +240,8 @@ lua_parse_and_execute(L, mycmd); lua_getfield(L, LUA_GLOBALSINDEX, "XML_STRING"); - str = lua_tostring(L, 1); - + str = strdup( lua_tostring(L, 1) ); + if (str) { if (switch_strlen_zero(str)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Result\n"); @@ -252,6 +252,7 @@ lua_uninit(L); free(mycmd); + free(str); } return xml; From brian at freeswitch.org Wed May 13 18:41:55 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Wed, 13 May 2009 20:41:55 -0500 Subject: [Freeswitch-svn] [commit] r13298 - freeswitch/trunk/src/mod/applications/mod_dptools Message-ID: Author: brian Date: Wed May 13 20:41:54 2009 New Revision: 13298 Log: MODAPP-273 Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c 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 Wed May 13 20:41:54 2009 @@ -1807,6 +1807,7 @@ char *mydata = NULL; switch_input_args_t args = { 0 }; switch_channel_t *channel = switch_core_session_get_channel(session); + switch_status_t status; if (!switch_strlen_zero(data) && (mydata = switch_core_session_strdup(session, data))) { const char *lang; @@ -1825,7 +1826,22 @@ switch_channel_set_variable(channel, SWITCH_PLAYBACK_TERMINATOR_USED, "" ); - switch_ivr_phrase_macro(session, macro, mdata, lang, &args); + status = switch_ivr_phrase_macro(session, macro, mdata, lang, &args); + } else { + status = SWITCH_STATUS_NOOP; + } + + switch (status) { + case SWITCH_STATUS_SUCCESS: + case SWITCH_STATUS_BREAK: + switch_channel_set_variable(channel, SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE, "PHRASE PLAYED"); + break; + case SWITCH_STATUS_NOOP: + switch_channel_set_variable(channel, SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE, "NOTHING"); + break; + default: + switch_channel_set_variable(channel, SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE, "UNKNOWN ERROR"); + break; } } From robertj at freeswitch.org Wed May 13 19:15:50 2009 From: robertj at freeswitch.org (FreeSWITCH SVN) Date: Wed, 13 May 2009 21:15:50 -0500 Subject: [Freeswitch-svn] [commit] r13299 - freeswitch/trunk/src/mod/endpoints/mod_opal Message-ID: Author: robertj Date: Wed May 13 21:15:50 2009 New Revision: 13299 Log: Applied patch for blind transfer, thanks Peter Olsson Modified: freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp Modified: freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp (original) +++ freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp Wed May 13 21:15:50 2009 @@ -997,7 +997,7 @@ { char transfer_to[128] = ""; switch_set_string(transfer_to, msg->string_arg); - TransferConnection(transfer_to); + GetCall().Transfer(transfer_to); break; } From silik0n at freeswitch.org Wed May 13 19:57:21 2009 From: silik0n at freeswitch.org (FreeSWITCH SVN) Date: Wed, 13 May 2009 21:57:21 -0500 Subject: [Freeswitch-svn] [commit] r13300 - freeswitch/trunk/src/mod/applications/mod_easyroute Message-ID: Author: silik0n Date: Wed May 13 21:57:21 2009 New Revision: 13300 Log: MODAPP-276 Modified: freeswitch/trunk/src/mod/applications/mod_easyroute/mod_easyroute.c Modified: freeswitch/trunk/src/mod/applications/mod_easyroute/mod_easyroute.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_easyroute/mod_easyroute.c (original) +++ freeswitch/trunk/src/mod/applications/mod_easyroute/mod_easyroute.c Wed May 13 21:57:21 2009 @@ -44,7 +44,6 @@ typedef struct easyroute_results{ char limit[16]; - char destnum[16]; char dialstring[256]; char group[16]; char acctcode[17]; @@ -323,7 +322,7 @@ } route_lookup(destnum, &results, noat, seperator); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "EASY ROUTE DEST: [%s]\n", results.dialstring); - switch_channel_set_variable(channel, "easy_destnum", results.destnum); + switch_channel_set_variable(channel, "easy_destnum", destnum); switch_channel_set_variable(channel, "easy_dialstring", results.dialstring); switch_channel_set_variable(channel, "easy_group", results.group); switch_channel_set_variable(channel, "easy_limit", results.limit); From anthm at freeswitch.org Thu May 14 06:48:11 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Thu, 14 May 2009 08:48:11 -0500 Subject: [Freeswitch-svn] [commit] r13301 - freeswitch/trunk/src Message-ID: Author: anthm Date: Thu May 14 08:48:11 2009 New Revision: 13301 Log: FSCORE-367 Modified: freeswitch/trunk/src/switch_ivr.c Modified: freeswitch/trunk/src/switch_ivr.c ============================================================================== --- freeswitch/trunk/src/switch_ivr.c (original) +++ freeswitch/trunk/src/switch_ivr.c Thu May 14 08:48:11 2009 @@ -638,7 +638,7 @@ { switch_status_t status = SWITCH_STATUS_SUCCESS; switch_channel_t *channel = switch_core_session_get_channel(session); - switch_frame_t *read_frame; + switch_frame_t *read_frame = NULL; int stream_id = 0; switch_event_t *event; switch_unicast_conninfo_t *conninfo = NULL; From mikej at freeswitch.org Thu May 14 07:58:58 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Thu, 14 May 2009 09:58:58 -0500 Subject: [Freeswitch-svn] [commit] r13302 - freeswitch/trunk/src Message-ID: Author: mikej Date: Thu May 14 09:58:58 2009 New Revision: 13302 Log: FSBUILD-159 Modified: freeswitch/trunk/src/switch_ivr.c Modified: freeswitch/trunk/src/switch_ivr.c ============================================================================== --- freeswitch/trunk/src/switch_ivr.c (original) +++ freeswitch/trunk/src/switch_ivr.c Thu May 14 09:58:58 2009 @@ -725,6 +725,8 @@ switch_byte_t *sendbuf = NULL; uint32_t sendlen = 0; + switch_assert(read_frame); + if (switch_test_flag(read_frame, SFF_CNG)) { sendlen = bpf; switch_assert(sendlen <= SWITCH_RECOMMENDED_BUFFER_SIZE); From brian at freeswitch.org Thu May 14 08:44:44 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Thu, 14 May 2009 10:44:44 -0500 Subject: [Freeswitch-svn] [commit] r13303 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: brian Date: Thu May 14 10:44:43 2009 New Revision: 13303 Log: preserve the transport on SLA interactions, still needs work for TLS but should work for UDP and TCP Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_sla.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_sla.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_sla.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_sla.c Thu May 14 10:44:43 2009 @@ -27,7 +27,7 @@ * Ken Rice, Asteria Solutions Group, Inc * Paul D. Tinsley * Bret McDanel - * + * Brian West * * sofia_sla.c -- SOFIA SIP Endpoint (support for shared line appearance) * This file (and calls into it) developed by Matthew T Kaufman @@ -35,21 +35,17 @@ */ #include "mod_sofia.h" - static int sofia_sla_sub_callback(void *pArg, int argc, char **argv, char **columnNames); - struct sla_helper { char call_id[1024]; }; - static int get_call_id_callback(void *pArg, int argc, char **argv, char **columnNames) { struct sla_helper *sh = (struct sla_helper *) pArg; switch_set_string(sh->call_id, argv[0]); - return 0; } @@ -79,14 +75,14 @@ char *sql; struct sla_helper sh = { { 0 } }; char *contact_str = strip_uri(full_contact); - + sofia_transport_t transport = sofia_glue_url2transport(sip->sip_contact->m_url); sql = switch_mprintf("select call_id from sip_shared_appearance_dialogs where hostname='%q' and profile_name='%q' and contact_str='%q'", mod_sofia_globals.hostname, profile->name, contact_str); sofia_glue_execute_sql_callback(profile, SWITCH_FALSE, profile->ireg_mutex, sql, get_call_id_callback, &sh); free(sql); - + if (*sh.call_id) { if (!(nh = nua_handle_by_call_id(profile->nua, sh.call_id))) { if ((sql = switch_mprintf("delete from sip_shared_appearance_dialogs where hostname='%q' and profile_name='%q' and contact_str='%q'", @@ -103,11 +99,11 @@ nua_handle_bind(nh, &mod_sofia_globals.keep_private); switch_snprintf(exp_str, sizeof(exp_str), "%ld", exptime + 30); - switch_snprintf(my_contact, sizeof(my_contact), "%s;expires=%s", profile->sla_contact, exp_str); - + switch_snprintf(my_contact, sizeof(my_contact), "<%s;transport=%s>;expires=%s", profile->sla_contact, sofia_glue_transport2str(transport), exp_str); + nua_subscribe(nh, SIPTAG_TO(sip->sip_to), - SIPTAG_FROM(sip->sip_to), // ? + SIPTAG_FROM(sip->sip_to), SIPTAG_CONTACT_STR(my_contact), SIPTAG_EXPIRES_STR(exp_str), SIPTAG_EVENT_STR("dialog;sla"), /* some phones want ;include-session-description too? */ @@ -128,7 +124,9 @@ char *subscriber = NULL; char *sql = NULL; char *route_uri = NULL; - + char *sla_contact = NULL; + sofia_transport_t transport = sofia_glue_url2transport(sip->sip_contact->m_url); + /* * XXX MTK FIXME - we don't look at the tag to see if NUTAG_SUBSTATE(nua_substate_terminated) or * a Subscription-State header with state "terminated" and/or expiration of 0. So we never forget @@ -143,7 +141,8 @@ * so we do what openser's pua_bla does and... */ - aor = switch_mprintf("sip:%s@%s",sip->sip_contact->m_url->url_user, sip->sip_from->a_url->url_host); + aor = switch_mprintf("sip:%s@%s;transport=%s", sip->sip_contact->m_url->url_user, + sip->sip_from->a_url->url_host, sofia_glue_transport2str(transport)); /* * ok, and now that we HAVE the AOR, we REALLY should go check in the XML config and see if this particular @@ -153,9 +152,9 @@ /* then the subscriber is the user at their network location... this is arguably the wrong way, but works so far... */ - subscriber = switch_mprintf("sip:%s@%s",sip->sip_from->a_url->url_user, sip->sip_contact->m_url->url_host); + subscriber = switch_mprintf("sip:%s@%s;transport=%s", sip->sip_from->a_url->url_user, + sip->sip_contact->m_url->url_host, sofia_glue_transport2str(transport)); - if ((sql = switch_mprintf("delete from sip_shared_appearance_subscriptions where subscriber='%q' and profile_name='%q' and hostname='%q'", subscriber, profile->name, mod_sofia_globals.hostname @@ -170,7 +169,6 @@ sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE); } - if (strstr(contact_str, ";fs_nat")) { char *p; route_uri = sofia_glue_get_url_from_contact((char *)contact_str, 1); @@ -179,7 +177,6 @@ } } - if (route_uri) { char *p; @@ -191,16 +188,19 @@ } } - nua_respond(nh, SIP_202_ACCEPTED, SIPTAG_CONTACT_STR(profile->sla_contact), NUTAG_WITH_THIS(nua), + sla_contact = switch_mprintf("<%s;transport=%s>", profile->sla_contact, sofia_glue_transport2str(transport)); + + nua_respond(nh, SIP_202_ACCEPTED, SIPTAG_CONTACT_STR(sla_contact), NUTAG_WITH_THIS(nua), TAG_IF(route_uri, NUTAG_PROXY(route_uri)), SIPTAG_SUBSCRIPTION_STATE_STR("active;expires=300"), /* you thought the OTHER time was fake... need delta here FIXME XXX MTK */ SIPTAG_EXPIRES_STR("300"), /* likewise, totally fake - FIXME XXX MTK */ - /* sofia_presence says something about needing TAG_IF(sticky, NUTAG_PROXY(sticky)) for NAT stuff? */ - TAG_END()); + /* sofia_presence says something about needing TAG_IF(sticky, NUTAG_PROXY(sticky)) for NAT stuff? */ + TAG_END()); switch_safe_free(aor); switch_safe_free(subscriber); switch_safe_free(route_uri); + switch_safe_free(sla_contact); switch_safe_free(sql); } @@ -234,7 +234,6 @@ free(contact_str); } - } void sofia_sla_handle_sip_i_notify(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sip_t const *sip, tagi_t tags[]) @@ -243,6 +242,7 @@ struct sla_notify_helper helper; char *aor = NULL; char *contact = NULL; + sofia_transport_t transport = sofia_glue_url2transport(sip->sip_contact->m_url); /* * things we know we don't do: @@ -276,7 +276,8 @@ } /* calculate the AOR we're trying to tell people about. should probably double-check before derferencing XXX MTK */ - aor = switch_mprintf("sip:%s@%s",sip->sip_to->a_url->url_user, sip->sip_to->a_url->url_host); + aor = switch_mprintf("sip:%s@%s;transport=%s", sip->sip_to->a_url->url_user, + sip->sip_to->a_url->url_host, sofia_glue_transport2str(transport)); /* this isn't sufficient because on things like the polycom, the subscriber is the 'main' ext number, but the * 'main' ext number isn't in ANY of the headers they send us in the notify. of course. @@ -285,7 +286,8 @@ * so we don't reflect it back at anyone who is the "boss" config, but we do reflect it back at the "secretary" * config. if that breaks the phone, just set them all up as the "boss" config where ext#==third-party# */ - contact = switch_mprintf("sip:%s@%s",sip->sip_contact->m_url->url_user, sip->sip_contact->m_url->url_host); + contact = switch_mprintf("sip:%s@%s;transport=%s",sip->sip_contact->m_url->url_user, + sip->sip_contact->m_url->url_host, sofia_glue_transport2str(transport)); if (sip->sip_payload && sip->sip_payload->pl_data) { sql = switch_mprintf("select subscriber,call_id,aor,profile_name,hostname,contact_str from sip_shared_appearance_subscriptions where " @@ -351,4 +353,3 @@ } return 0; } - From anthm at freeswitch.org Thu May 14 09:16:03 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Thu, 14 May 2009 11:16:03 -0500 Subject: [Freeswitch-svn] [commit] r13304 - freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua Message-ID: Author: anthm Date: Thu May 14 11:16:03 2009 New Revision: 13304 Log: comment out assert Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_server.c Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_server.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_server.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_server.c Thu May 14 11:16:03 2009 @@ -505,7 +505,8 @@ #endif if (sr->sr_response.msg == NULL) { - assert(sr->sr_status == 500); + //assert(sr->sr_status == 500); + SU_DEBUG_0(("sr without msg, sr_status=%u", sr->sr_status)); goto internal_error; } From brian at freeswitch.org Thu May 14 09:18:34 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Thu, 14 May 2009 11:18:34 -0500 Subject: [Freeswitch-svn] [commit] r13305 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: brian Date: Thu May 14 11:18:33 2009 New Revision: 13305 Log: should be ; 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 May 14 11:18:33 2009 @@ -839,10 +839,10 @@ if (strchr(stripped, ';')) { if (params) { - new_uri = switch_core_session_sprintf(session, "%s%s&transport=%s;%s%s", + new_uri = switch_core_session_sprintf(session, "%s%s;transport=%s;%s%s", uri_only ? "" : "<", stripped, sofia_glue_transport2str(transport), params, uri_only ? "" : ">"); } else { - new_uri = switch_core_session_sprintf(session, "%s%s&transport=%s%s", + new_uri = switch_core_session_sprintf(session, "%s%s;transport=%s%s", uri_only ? "" : "<", stripped, sofia_glue_transport2str(transport), uri_only ? "" : ">"); } } else { From brian at freeswitch.org Thu May 14 09:56:18 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Thu, 14 May 2009 11:56:18 -0500 Subject: [Freeswitch-svn] [commit] r13306 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: brian Date: Thu May 14 11:56:18 2009 New Revision: 13306 Log: now pickup, barge-in and various other things will work with SLA is turned on 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 Thu May 14 11:56:18 2009 @@ -4575,16 +4575,21 @@ tech_pvt->reply_contact = switch_core_session_sprintf(session, "<%s>", tech_pvt->to_uri); } } else { - const char *url; - - if ((url = (sofia_glue_transport_has_tls(transport)) ? profile->tls_url : profile->url)) { - if (strchr(url, '>')) { - tech_pvt->reply_contact = switch_core_session_sprintf(session, "%s;transport=%s", url, sofia_glue_transport2str(transport)); + if (sofia_test_pflag(profile, PFLAG_MANAGE_SHARED_APPEARANCE)) { + tech_pvt->reply_contact = switch_core_session_sprintf(session, "", user, host); + } else { + + const char *url; + + if ((url = (sofia_glue_transport_has_tls(transport)) ? profile->tls_url : profile->url)) { + if (strchr(url, '>')) { + tech_pvt->reply_contact = switch_core_session_sprintf(session, "%s;transport=%s", url, sofia_glue_transport2str(transport)); + } else { + tech_pvt->reply_contact = switch_core_session_sprintf(session, "<%s;transport=%s>", url, sofia_glue_transport2str(transport)); + } } else { - tech_pvt->reply_contact = switch_core_session_sprintf(session, "<%s;transport=%s>", url, sofia_glue_transport2str(transport)); + switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); } - } else { - switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); } } } else { From anthm at freeswitch.org Thu May 14 10:36:44 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Thu, 14 May 2009 12:36:44 -0500 Subject: [Freeswitch-svn] [commit] r13307 - freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta Message-ID: Author: anthm Date: Thu May 14 12:36:44 2009 New Revision: 13307 Log: temp solution to assert Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c Thu May 14 12:36:44 2009 @@ -8872,7 +8872,11 @@ orq = original->orq_forks; original->orq_forks = orq->orq_forks; - assert(orq->orq_forking == original); + //assert(orq->orq_forking == original); + + if (orq->orq_forking != original) { + break; + } SU_DEBUG_5(("nta: timer %s fired, %s %s (%u);tag=%s\n", "D", "terminate", orq->orq_method_name, orq->orq_cseq->cs_seq, From anthm at freeswitch.org Thu May 14 11:30:50 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Thu, 14 May 2009 13:30:50 -0500 Subject: [Freeswitch-svn] [commit] r13308 - freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta Message-ID: Author: anthm Date: Thu May 14 13:30:50 2009 New Revision: 13308 Log: add checks to find issue in FSCORE-338 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c Thu May 14 13:30:50 2009 @@ -1048,11 +1048,14 @@ nta_outgoing_t *orq = oht->oht_table[i]; if (!orq->orq_destroyed) - SU_DEBUG_3(("%s: destroying %s client transaction to <" + SU_DEBUG_3(("%s: destroying %s%s client transaction to <" URL_PRINT_FORMAT ">\n", - __func__, orq->orq_method_name, + __func__, + (orq->orq_forking || orq->orq_forks) ? "forked " : "forking", + orq->orq_method_name, URL_PRINT_ARGS(orq->orq_to->a_url))); + orq->orq_forks = NULL, orq->orq_forking = NULL; outgoing_free(orq); } @@ -8493,6 +8496,7 @@ void outgoing_free(nta_outgoing_t *orq) { SU_DEBUG_9(("nta: outgoing_free(%p)\n", (void *)orq)); + assert(orq->orq_forks == NULL && orq->orq_forking == NULL); outgoing_cut_off(orq); outgoing_reclaim(orq); } @@ -8585,7 +8589,10 @@ void outgoing_destroy(nta_outgoing_t *orq) { if (orq->orq_terminated || orq->orq_default) { - outgoing_free(orq); + if (!orq->orq_forking && !orq->orq_forks) { + outgoing_free(orq); + return; + } } /* Application is expected to handle 200 OK statelessly => kill transaction immediately */ @@ -8596,12 +8603,12 @@ && !orq->orq_forking && !orq->orq_forks) { orq->orq_destroyed = 1; outgoing_terminate(orq); + return; } - else { - orq->orq_destroyed = 1; - orq->orq_callback = outgoing_default_cb; - orq->orq_magic = NULL; - } + + orq->orq_destroyed = 1; + orq->orq_callback = outgoing_default_cb; + orq->orq_magic = NULL; } /** @internal Outgoing transaction timer routine. @@ -8882,6 +8889,8 @@ "terminate", orq->orq_method_name, orq->orq_cseq->cs_seq, orq->orq_tag)); + orq->orq_forking = NULL; + if (outgoing_terminate(orq)) continue; From anthm at freeswitch.org Thu May 14 11:55:17 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Thu, 14 May 2009 13:55:17 -0500 Subject: [Freeswitch-svn] [commit] r13309 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Thu May 14 13:55:17 2009 New Revision: 13309 Log: tweak code logic 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 May 14 13:55:17 2009 @@ -2603,7 +2603,7 @@ stream = tech_pvt->profile->hold_music; } - if (stream && switch_is_moh(stream)) { + if (stream && strcasecmp(stream, "silence")) { if (!strcasecmp(stream, "indicate_hold")) { switch_channel_set_flag(tech_pvt->channel, CF_SUSPEND); switch_channel_set_flag(tech_pvt->channel, CF_HOLD); From anthm at freeswitch.org Thu May 14 14:07:39 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Thu, 14 May 2009 16:07:39 -0500 Subject: [Freeswitch-svn] [commit] r13310 - freeswitch/trunk/src/include/private Message-ID: Author: anthm Date: Thu May 14 16:07:39 2009 New Revision: 13310 Log: FSCORE-368 Modified: freeswitch/trunk/src/include/private/switch_core_pvt.h Modified: freeswitch/trunk/src/include/private/switch_core_pvt.h ============================================================================== --- freeswitch/trunk/src/include/private/switch_core_pvt.h (original) +++ freeswitch/trunk/src/include/private/switch_core_pvt.h Thu May 14 16:07:39 2009 @@ -127,7 +127,7 @@ void *streams[SWITCH_MAX_STREAMS]; int stream_count; - char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; + char uuid_str[128]; void *private_info; switch_queue_t *event_queue; switch_queue_t *message_queue; From mikej at freeswitch.org Thu May 14 14:52:52 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Thu, 14 May 2009 16:52:52 -0500 Subject: [Freeswitch-svn] [commit] r13311 - in freeswitch/trunk/libs/spandsp: src src/spandsp src/spandsp/private tests Message-ID: Author: mikej Date: Thu May 14 16:52:52 2009 New Revision: 13311 Log: update to spandsp-0.0.6pre12 Modified: freeswitch/trunk/libs/spandsp/src/spandsp/private/v22bis.h freeswitch/trunk/libs/spandsp/src/spandsp/v22bis.h freeswitch/trunk/libs/spandsp/src/spandsp/version.h freeswitch/trunk/libs/spandsp/src/t30.c freeswitch/trunk/libs/spandsp/src/t38_terminal.c freeswitch/trunk/libs/spandsp/src/t4.c freeswitch/trunk/libs/spandsp/src/v22bis_rx.c freeswitch/trunk/libs/spandsp/src/v22bis_tx.c freeswitch/trunk/libs/spandsp/tests/fax_decode.c freeswitch/trunk/libs/spandsp/tests/t4_tests.c freeswitch/trunk/libs/spandsp/tests/tsb85_tests.sh Modified: freeswitch/trunk/libs/spandsp/src/spandsp/private/v22bis.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/private/v22bis.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/private/v22bis.h Thu May 14 16:52:52 2009 @@ -22,12 +22,40 @@ * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: v22bis.h,v 1.9 2009/04/26 09:50:28 steveu Exp $ + * $Id: v22bis.h,v 1.10 2009/04/29 12:37:45 steveu Exp $ */ #if !defined(_SPANDSP_PRIVATE_V22BIS_H_) #define _SPANDSP_PRIVATE_V22BIS_H_ +/*! Segments of the training sequence on the receive side */ +enum +{ + V22BIS_RX_TRAINING_STAGE_NORMAL_OPERATION, + V22BIS_RX_TRAINING_STAGE_SYMBOL_ACQUISITION, + V22BIS_RX_TRAINING_STAGE_LOG_PHASE, + V22BIS_RX_TRAINING_STAGE_UNSCRAMBLED_ONES, + V22BIS_RX_TRAINING_STAGE_UNSCRAMBLED_ONES_SUSTAINING, + V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200, + V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200_SUSTAINING, + V22BIS_RX_TRAINING_STAGE_WAIT_FOR_SCRAMBLED_ONES_AT_2400, + V22BIS_RX_TRAINING_STAGE_PARKED +}; + +/*! Segments of the training sequence on the transmit side */ +enum +{ + V22BIS_TX_TRAINING_STAGE_NORMAL_OPERATION = 0, + V22BIS_TX_TRAINING_STAGE_INITIAL_TIMED_SILENCE, + V22BIS_TX_TRAINING_STAGE_INITIAL_SILENCE, + V22BIS_TX_TRAINING_STAGE_U11, + V22BIS_TX_TRAINING_STAGE_U0011, + V22BIS_TX_TRAINING_STAGE_S11, + V22BIS_TX_TRAINING_STAGE_TIMED_S11, + V22BIS_TX_TRAINING_STAGE_S1111, + V22BIS_TX_TRAINING_STAGE_PARKED +}; + /*! V.22bis modem descriptor. This defines the working state for a single instance of a V.22bis modem. @@ -195,6 +223,8 @@ void v22bis_report_status_change(v22bis_state_t *s, int status); +void v22bis_equalizer_coefficient_reset(v22bis_state_t *s); + #if defined(__cplusplus) } #endif Modified: freeswitch/trunk/libs/spandsp/src/spandsp/v22bis.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/v22bis.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/v22bis.h Thu May 14 16:52:52 2009 @@ -22,7 +22,7 @@ * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: v22bis.h,v 1.41 2009/04/25 10:18:50 steveu Exp $ + * $Id: v22bis.h,v 1.42 2009/04/29 12:37:45 steveu Exp $ */ /*! \file */ @@ -150,13 +150,20 @@ \return 0 for OK, -1 for bad parameter. */ SPAN_DECLARE(int) v22bis_restart(v22bis_state_t *s, int bit_rate); -/*! Request a retrain for a V.22bis modem context. A rate change may also be resquested. +/*! Request a retrain for a V.22bis modem context. A rate change may also be requested. \brief Request a retrain for a V.22bis modem context. \param s The modem context. \param bit_rate The bit rate of the modem. Valid values are 1200 and 2400. - \return 0 for OK, -1 for bad parameter. */ + \return 0 for OK, -1 for request rejected. */ SPAN_DECLARE(int) v22bis_request_retrain(v22bis_state_t *s, int bit_rate); +/*! Request a loopback 2 for a V.22bis modem context. + \brief Request a loopback 2 for a V.22bis modem context. + \param s The modem context. + \param enable TRUE to enable loopback, or FALSE to disable it. + \return 0 for OK, -1 for request reject. */ +SPAN_DECLARE(int) v22bis_remote_loopback(v22bis_state_t *s, int enable); + /*! Report the current operating bit rate of a V.22bis modem context. \brief Report the current operating bit rate of a V.22bis modem context \param s The modem context. */ Modified: freeswitch/trunk/libs/spandsp/src/spandsp/version.h ============================================================================== --- freeswitch/trunk/libs/spandsp/src/spandsp/version.h (original) +++ freeswitch/trunk/libs/spandsp/src/spandsp/version.h Thu May 14 16:52:52 2009 @@ -30,9 +30,9 @@ /* The date and time of the version are in UTC form. */ -#define SPANDSP_RELEASE_DATE 20090427 -#define SPANDSP_RELEASE_TIME 151958 -#define SPANDSP_RELEASE_DATETIME_STRING "20090427 151958" +#define SPANDSP_RELEASE_DATE 20090502 +#define SPANDSP_RELEASE_TIME 044449 +#define SPANDSP_RELEASE_DATETIME_STRING "20090502 044449" #endif /*- End of file ------------------------------------------------------------*/ Modified: freeswitch/trunk/libs/spandsp/src/t30.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/t30.c (original) +++ freeswitch/trunk/libs/spandsp/src/t30.c Thu May 14 16:52:52 2009 @@ -5,7 +5,7 @@ * * Written by Steve Underwood * - * Copyright (C) 2003, 2004, 2005, 2006, 2007 Steve Underwood + * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Steve Underwood * * All rights reserved. * @@ -22,7 +22,7 @@ * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: t30.c,v 1.291 2009/04/23 15:40:32 steveu Exp $ + * $Id: t30.c,v 1.298 2009/04/30 18:46:14 steveu Exp $ */ /*! \file */ @@ -73,8 +73,13 @@ #include "t30_local.h" -/*! The maximum number of consecutive retries allowed. */ -#define MAX_MESSAGE_TRIES 3 +/*! The maximum permitted number of retries of a single command allowed. */ +#define MAX_COMMAND_TRIES 3 + +/*! The maximum permitted number of retries of a single response request allowed. This + is not specified in T.30. However, if you don't apply some limit a messed up FAX + terminal could keep you retrying all day. Its a backstop protection. */ +#define MAX_RESPONSE_TRIES 6 /*! Conversion between milliseconds and audio samples. */ #define ms_to_samples(t) (((t)*SAMPLE_RATE)/1000) @@ -245,7 +250,7 @@ end of a frame, after the initial flag has been seen. */ #define DEFAULT_TIMER_T2A 3000 -/*! If the HDLC carrier falls during reception, we need to apply a minimum time before continuing. if we +/*! If the HDLC carrier falls during reception, we need to apply a minimum time before continuing. If we don't, there are circumstances where we could continue and reply before the incoming signals have really finished. E.g. if a bad DCS is received in a DCS-TCF sequence, we need wait for the TCF carrier to pass, before continuing. This timer is specified as 200ms, but no tolerance is specified. @@ -316,14 +321,16 @@ enum { - TIMER_IS_T2 = 0, - TIMER_IS_T2A = 1, - TIMER_IS_T2B = 2, - TIMER_IS_T2C = 3, - TIMER_IS_T4 = 4, - TIMER_IS_T4A = 5, - TIMER_IS_T4B = 6, - TIMER_IS_T4C = 7 + TIMER_IS_IDLE = 0, + TIMER_IS_T2, + TIMER_IS_T1A, + TIMER_IS_T2A, + TIMER_IS_T2B, + TIMER_IS_T2C, + TIMER_IS_T4, + TIMER_IS_T4A, + TIMER_IS_T4B, + TIMER_IS_T4C }; /* Start points in the fallback table for different capabilities */ @@ -2507,6 +2514,9 @@ { unexpected_frame_length(s, msg, len); } + /* We have received something, so any missing carrier status is out of date */ + if (s->current_status == T30_ERR_RX_NOCARRIER) + s->current_status = T30_ERR_OK; break; default: unexpected_non_final_frame(s, msg, len); @@ -2517,16 +2527,21 @@ static void process_rx_rcp(t30_state_t *s, const uint8_t *msg, int len) { - /* Return to control for partial page. These might come through with or without the final frame tag, - so we have this routine to deal with the "no final frame tag" case. */ + /* Return to control for partial page. These might come through with or without the final frame tag. + Here we deal with the "no final frame tag" case. */ switch (s->state) { case T30_STATE_F_DOC_ECM: set_state(s, T30_STATE_F_POST_DOC_ECM); queue_phase(s, T30_PHASE_D_RX); + timer_t2_start(s); + /* We have received something, so any missing carrier status is out of date */ + if (s->current_status == T30_ERR_RX_NOCARRIER) + s->current_status = T30_ERR_OK; break; case T30_STATE_F_POST_DOC_ECM: - /* Just ignore this */ + /* Just ignore this. It must be an extra RCP. Several are usually sent, to maximise the chance + of receiving a correct one. */ break; default: unexpected_non_final_frame(s, msg, len); @@ -2773,7 +2788,7 @@ break; case T30_DIS: /* It appears they didn't see what we sent - retry the TCF */ - if (++s->retries >= MAX_MESSAGE_TRIES) + if (++s->retries >= MAX_COMMAND_TRIES) { span_log(&s->logging, SPAN_LOG_FLOW, "Too many retries. Giving up.\n"); s->current_status = T30_ERR_RETRYDCN; @@ -2827,6 +2842,10 @@ /* We're waiting for a response to the CFR we sent */ switch (msg[2] & 0xFE) { + case T30_DCS: + /* If we received another DCS, they must have missed our CFR */ + process_rx_dcs(s, msg, len); + break; case T30_CRP: repeat_last_command(s); break; @@ -3150,7 +3169,7 @@ } /*- End of function --------------------------------------------------------*/ -static void process_state_f_doc_ecm(t30_state_t *s, const uint8_t *msg, int len) +static void process_state_f_doc_and_post_doc_ecm(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf2; @@ -3164,16 +3183,22 @@ process_rx_dcs(s, msg, len); break; case T4_RCP: + /* Return to control for partial page. These might come through with or without the final frame tag. + Here we deal with the "final frame tag" case. */ if (s->state == T30_STATE_F_DOC_ECM) { /* Return to control for partial page */ - queue_phase(s, T30_PHASE_D_RX); set_state(s, T30_STATE_F_POST_DOC_ECM); + queue_phase(s, T30_PHASE_D_RX); + timer_t2_start(s); + /* We have received something, so any missing carrier status is out of date */ + if (s->current_status == T30_ERR_RX_NOCARRIER) + s->current_status = T30_ERR_OK; } else { - /* Ignore extra RCP frames. The source will usually send several to maximise the chance of - one getting through OK. */ + /* Just ignore this. It must be an extra RCP. Several are usually sent, to maximise the chance + of receiving a correct one. */ } break; case T30_EOR: @@ -4166,6 +4191,7 @@ /* Restart the command or response timer, T2 or T4 */ switch (s->timer_t2_t4_is) { + case TIMER_IS_T1A: case TIMER_IS_T2: case TIMER_IS_T2A: case TIMER_IS_T2B: @@ -4358,7 +4384,7 @@ break; case T30_STATE_F_DOC_ECM: case T30_STATE_F_POST_DOC_ECM: - process_state_f_doc_ecm(s, msg, len); + process_state_f_doc_and_post_doc_ecm(s, msg, len); break; case T30_STATE_F_POST_RCP_MCF: process_state_f_post_rcp_mcf(s, msg, len); @@ -4564,7 +4590,7 @@ static void repeat_last_command(t30_state_t *s) { s->step = 0; - if (++s->retries >= MAX_MESSAGE_TRIES) + if (++s->retries >= MAX_COMMAND_TRIES) { span_log(&s->logging, SPAN_LOG_FLOW, "Too many retries. Giving up.\n"); switch (s->state) @@ -4670,13 +4696,14 @@ { span_log(&s->logging, SPAN_LOG_FLOW, "Start T1A\n"); s->timer_t2_t4 = ms_to_samples(DEFAULT_TIMER_T1A); + s->timer_t2_t4_is = TIMER_IS_T1A; } else { span_log(&s->logging, SPAN_LOG_FLOW, "Start T2A\n"); s->timer_t2_t4 = ms_to_samples(DEFAULT_TIMER_T2A); + s->timer_t2_t4_is = TIMER_IS_T2A; } - s->timer_t2_t4_is = TIMER_IS_T2A; } /*- End of function --------------------------------------------------------*/ @@ -4714,8 +4741,47 @@ static void timer_t2_t4_stop(t30_state_t *s) { - span_log(&s->logging, SPAN_LOG_FLOW, "Stop T2/T4\n"); + const char *tag; + + switch (s->timer_t2_t4_is) + { + case TIMER_IS_IDLE: + tag = "none"; + break; + case TIMER_IS_T1A: + tag = "T1A"; + break; + case TIMER_IS_T2: + tag = "T2"; + break; + case TIMER_IS_T2A: + tag = "T2A"; + break; + case TIMER_IS_T2B: + tag = "T2B"; + break; + case TIMER_IS_T2C: + tag = "T2C"; + break; + case TIMER_IS_T4: + tag = "T4"; + break; + case TIMER_IS_T4A: + tag = "T4A"; + break; + case TIMER_IS_T4B: + tag = "T4B"; + break; + case TIMER_IS_T4C: + tag = "T4C"; + break; + default: + tag = "T2/T4"; + break; + } + span_log(&s->logging, SPAN_LOG_FLOW, "Stop %s (%d remaining)\n", tag, s->timer_t2_t4); s->timer_t2_t4 = 0; + s->timer_t2_t4_is = TIMER_IS_IDLE; } /*- End of function --------------------------------------------------------*/ @@ -4754,7 +4820,8 @@ static void timer_t2_expired(t30_state_t *s) { - span_log(&s->logging, SPAN_LOG_FLOW, "T2 expired in phase %s, state %d\n", phase_names[s->phase], s->state); + if (s->timer_t2_t4_is != TIMER_IS_T2B) + span_log(&s->logging, SPAN_LOG_FLOW, "T2 expired in phase %s, state %d\n", phase_names[s->phase], s->state); switch (s->state) { case T30_STATE_III_Q_MCF: @@ -4820,6 +4887,14 @@ } /*- End of function --------------------------------------------------------*/ +static void timer_t1a_expired(t30_state_t *s) +{ + span_log(&s->logging, SPAN_LOG_FLOW, "T1A expired in phase %s, state %d. An HDLC frame lasted too long.\n", phase_names[s->phase], s->state); + s->current_status = T30_ERR_HDLC_CARRIER; + disconnect(s); +} +/*- End of function --------------------------------------------------------*/ + static void timer_t2a_expired(t30_state_t *s) { span_log(&s->logging, SPAN_LOG_FLOW, "T2A expired in phase %s, state %d. An HDLC frame lasted too long.\n", phase_names[s->phase], s->state); @@ -5273,6 +5348,7 @@ static void t30_hdlc_rx_status(void *user_data, int status) { t30_state_t *s; + int was_trained; s = (t30_state_t *) user_data; span_log(&s->logging, SPAN_LOG_FLOW, "HDLC signal status is %s (%d) in state %d\n", signal_status_to_str(status), status, s->state); @@ -5293,32 +5369,56 @@ switch (s->timer_t2_t4_is) { case TIMER_IS_T2B: - s->timer_t2_t4_is = TIMER_IS_T2C; timer_t2_t4_stop(s); + s->timer_t2_t4_is = TIMER_IS_T2C; break; case TIMER_IS_T4B: - s->timer_t2_t4_is = TIMER_IS_T4C; timer_t2_t4_stop(s); + s->timer_t2_t4_is = TIMER_IS_T4C; break; } break; case SIG_STATUS_CARRIER_DOWN: + was_trained = s->rx_trained; s->rx_signal_present = FALSE; s->rx_trained = FALSE; /* If a phase change has been queued to occur after the receive signal drops, its time to change. */ + if (s->state == T30_STATE_F_DOC_ECM) + { + /* We should be receiving a document right now, but we haven't seen an RCP at the end of + transmission. */ + if (was_trained) + { + /* We trained OK, so we should have some kind of received page, possibly with + zero good HDLC frames. It just did'nt end cleanly with an RCP. */ + span_log(&s->logging, SPAN_LOG_WARNING, "ECM signal did not end cleanly\n"); + /* Fake the existance of an RCP, and proceed */ + set_state(s, T30_STATE_F_POST_DOC_ECM); + queue_phase(s, T30_PHASE_D_RX); + timer_t2_start(s); + /* We at least trained, so any missing carrier status is out of date */ + if (s->current_status == T30_ERR_RX_NOCARRIER) + s->current_status = T30_ERR_OK; + } + else + { + /* Either there was no image carrier, or we failed to train to it. */ + span_log(&s->logging, SPAN_LOG_WARNING, "ECM carrier not found\n"); + s->current_status = T30_ERR_RX_NOCARRIER; + } + } if (s->next_phase != T30_PHASE_IDLE) { - timer_t2_t4_stop(s); + /* The appropriate timer for the next phase should already be in progress */ set_phase(s, s->next_phase); - if (s->next_phase == T30_PHASE_C_NON_ECM_RX) - timer_t2_start(s); s->next_phase = T30_PHASE_IDLE; } else { switch (s->timer_t2_t4_is) { + case TIMER_IS_T1A: case TIMER_IS_T2A: case TIMER_IS_T2C: timer_t2b_start(s); @@ -5344,6 +5444,7 @@ { switch(s->timer_t2_t4_is) { + case TIMER_IS_T1A: case TIMER_IS_T2: case TIMER_IS_T2A: timer_t2a_start(s); @@ -5416,7 +5517,7 @@ return; } s->rx_frame_received = TRUE; - /* Cancel the command or response timer */ + /* Cancel the command or response timer (if one is running) */ timer_t2_t4_stop(s); process_rx_control_msg(s, msg, len); } @@ -5760,6 +5861,9 @@ { switch (s->timer_t2_t4_is) { + case TIMER_IS_T1A: + timer_t1a_expired(s); + break; case TIMER_IS_T2: timer_t2_expired(s); break; @@ -5869,6 +5973,13 @@ s->far_dis_dtc_len = 0; memset(&s->far_dis_dtc_frame, 0, sizeof(s->far_dis_dtc_frame)); t30_build_dis_or_dtc(s); + memset(&s->rx_info, 0, sizeof(s->rx_info)); + release_resources(s); + /* The ECM page number is only reset at call establishment */ + s->ecm_rx_page = 0; + s->ecm_tx_page = 0; + s->far_end_detected = FALSE; + s->timer_t0_t1 = ms_to_samples(DEFAULT_TIMER_T0); if (s->calling_party) { set_state(s, T30_STATE_T); @@ -5879,13 +5990,6 @@ set_state(s, T30_STATE_ANSWERING); set_phase(s, T30_PHASE_A_CED); } - memset(&s->rx_info, 0, sizeof(s->rx_info)); - s->far_end_detected = FALSE; - s->timer_t0_t1 = ms_to_samples(DEFAULT_TIMER_T0); - release_resources(s); - /* The ECM page number is only reset at call establishment */ - s->ecm_rx_page = 0; - s->ecm_tx_page = 0; return 0; } /*- End of function --------------------------------------------------------*/ 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 Thu May 14 16:52:52 2009 @@ -22,7 +22,7 @@ * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: t38_terminal.c,v 1.124 2009/03/13 14:49:56 steveu Exp $ + * $Id: t38_terminal.c,v 1.125 2009/05/02 04:43:48 steveu Exp $ */ /*! \file */ @@ -566,6 +566,8 @@ /* Create a 75ms silence */ if (fe->t38.current_tx_indicator != T38_IND_NO_SIGNAL) delay = t38_core_send_indicator(&fe->t38, T38_IND_NO_SIGNAL, fe->t38.indicator_tx_count); + else + delay = 75000; fe->timed_step = T38_TIMED_STEP_NON_ECM_MODEM_2; fe->next_tx_samples = fe->samples; break; @@ -663,6 +665,8 @@ /* Create a 75ms silence */ if (fe->t38.current_tx_indicator != T38_IND_NO_SIGNAL) delay = t38_core_send_indicator(&fe->t38, T38_IND_NO_SIGNAL, fe->t38.indicator_tx_count); + else + delay = 75000; fe->timed_step = T38_TIMED_STEP_HDLC_MODEM_2; fe->next_tx_samples = fe->samples; break; Modified: freeswitch/trunk/libs/spandsp/src/t4.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/t4.c (original) +++ freeswitch/trunk/libs/spandsp/src/t4.c Thu May 14 16:52:52 2009 @@ -1668,9 +1668,14 @@ } if (s->row_bits) { - /* We may need to pad the row to a minimum length. */ - if (s->row_bits + length < s->min_bits_per_row) - put_encoded_bits(s, 0, s->min_bits_per_row - (s->row_bits + length)); + /* We may need to pad the row to a minimum length, unless we are in T.6 mode. + In T.6 we only come here at the end of the page to add the EOFB marker, which + is like two 1D EOLs. */ + if (s->line_encoding != T4_COMPRESSION_ITU_T6) + { + if (s->row_bits + length < s->min_bits_per_row) + put_encoded_bits(s, 0, s->min_bits_per_row - (s->row_bits + length)); + } put_encoded_bits(s, code, length); update_row_bit_info(s); } @@ -1678,6 +1683,10 @@ { /* We don't pad zero length rows. They are the consecutive EOLs which end a page. */ put_encoded_bits(s, code, length); + /* Don't do the full update row bit info, or the minimum suddenly drops to the + length of an EOL. Just clear the row bits, so we treat the next EOL as an + end of page EOL, with no padding. */ + s->row_bits = 0; } } /*- End of function --------------------------------------------------------*/ @@ -2183,8 +2192,9 @@ encode_eol(s); } - /* Force any partial byte in progress to flush */ - put_encoded_bits(s, 0, 7); + /* Force any partial byte in progress to flush using ones. Any post EOL padding when + sending is normally ones, so this is consistent. */ + put_encoded_bits(s, 0xFF, 7); s->bit_pos = 7; s->bit_ptr = 0; s->line_image_size = s->image_size*8; Modified: freeswitch/trunk/libs/spandsp/src/v22bis_rx.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/v22bis_rx.c (original) +++ freeswitch/trunk/libs/spandsp/src/v22bis_rx.c Thu May 14 16:52:52 2009 @@ -22,12 +22,19 @@ * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: v22bis_rx.c,v 1.66 2009/04/27 15:18:52 steveu Exp $ + * $Id: v22bis_rx.c,v 1.67 2009/04/29 12:37:45 steveu Exp $ */ /*! \file */ -/* THIS IS A WORK IN PROGRESS - NOT YET FUNCTIONAL! */ +/* THIS IS A WORK IN PROGRESS - It is basically functional, but it is not feature + complete, and doesn't reliably sync over the signal and noise level ranges it + should. There are some nasty inefficiencies too! + TODO: + Better noise performance + Retrain is incomplete + Rate change is not implemented + Remote loopback is not implemented */ #if defined(HAVE_CONFIG_H) #include "config.h" @@ -103,33 +110,6 @@ Descramble and output the bits represented by the decision. */ -enum -{ - V22BIS_RX_TRAINING_STAGE_NORMAL_OPERATION, - V22BIS_RX_TRAINING_STAGE_SYMBOL_ACQUISITION, - V22BIS_RX_TRAINING_STAGE_LOG_PHASE, - V22BIS_RX_TRAINING_STAGE_UNSCRAMBLED_ONES, - V22BIS_RX_TRAINING_STAGE_UNSCRAMBLED_ONES_SUSTAINING, - V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200, - V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200_SUSTAINING, - V22BIS_RX_TRAINING_STAGE_WAIT_FOR_SCRAMBLED_ONES_AT_2400, - V22BIS_RX_TRAINING_STAGE_PARKED -}; - -/* Segments of the training sequence */ -enum -{ - V22BIS_TX_TRAINING_STAGE_NORMAL_OPERATION = 0, - V22BIS_TX_TRAINING_STAGE_INITIAL_TIMED_SILENCE, - V22BIS_TX_TRAINING_STAGE_INITIAL_SILENCE, - V22BIS_TX_TRAINING_STAGE_U11, - V22BIS_TX_TRAINING_STAGE_U0011, - V22BIS_TX_TRAINING_STAGE_S11, - V22BIS_TX_TRAINING_STAGE_TIMED_S11, - V22BIS_TX_TRAINING_STAGE_S1111, - V22BIS_TX_TRAINING_STAGE_PARKED -}; - static const uint8_t space_map_v22bis[6][6] = { {11, 9, 9, 6, 6, 7}, @@ -194,20 +174,29 @@ } /*- End of function --------------------------------------------------------*/ -static void equalizer_reset(v22bis_state_t *s) +void v22bis_equalizer_coefficient_reset(v22bis_state_t *s) { /* Start with an equalizer based on everything being perfect */ #if defined(SPANDSP_USE_FIXED_POINTx) cvec_zeroi16(s->rx.eq_coeff, 2*V22BIS_EQUALIZER_LEN + 1); s->rx.eq_coeff[V22BIS_EQUALIZER_LEN] = complex_seti16(3*FP_FACTOR, 0*FP_FACTOR); - cvec_zeroi16(s->rx.eq_buf, V22BIS_EQUALIZER_MASK + 1); s->rx.eq_delta = 32768.0f*EQUALIZER_DELTA/(2*V22BIS_EQUALIZER_LEN + 1); #else cvec_zerof(s->rx.eq_coeff, 2*V22BIS_EQUALIZER_LEN + 1); s->rx.eq_coeff[V22BIS_EQUALIZER_LEN] = complex_setf(3.0f, 0.0f); - cvec_zerof(s->rx.eq_buf, V22BIS_EQUALIZER_MASK + 1); s->rx.eq_delta = EQUALIZER_DELTA/(2*V22BIS_EQUALIZER_LEN + 1); #endif +} +/*- End of function --------------------------------------------------------*/ + +static void equalizer_reset(v22bis_state_t *s) +{ + v22bis_equalizer_coefficient_reset(s); +#if defined(SPANDSP_USE_FIXED_POINTx) + cvec_zeroi16(s->rx.eq_buf, V22BIS_EQUALIZER_MASK + 1); +#else + cvec_zerof(s->rx.eq_buf, V22BIS_EQUALIZER_MASK + 1); +#endif s->rx.eq_put_step = 20 - 1; s->rx.eq_step = 0; } @@ -345,63 +334,18 @@ } /*- End of function --------------------------------------------------------*/ -static __inline__ int find_quadrant(const complexf_t *z) -{ - int b1; - int b2; - - /* Split the space along the two diagonals, as follows: - \ 1 / - \ / - 2 X 0 - / \ - / 3 \ - */ - b1 = (z->im > z->re); - b2 = (z->im < -z->re); - return (b2 << 1) | (b1 ^ b2); -} -/*- End of function --------------------------------------------------------*/ - -static void process_half_baud(v22bis_state_t *s, const complexf_t *sample) +static __inline__ void symbol_sync(v22bis_state_t *s) { + float p; + float q; + complexf_t zz; complexf_t a; complexf_t b; complexf_t c; - complexf_t z; - complexf_t zz; - const complexf_t *target; - float p; - float q; - int re; - int im; - int nearest; - int bitstream; - int raw_bits; - - z.re = sample->re; - z.im = sample->im; - - /* Add a sample to the equalizer's circular buffer, but don't calculate anything - at this time. */ - s->rx.eq_buf[s->rx.eq_step] = z; - s->rx.eq_step = (s->rx.eq_step + 1) & V22BIS_EQUALIZER_MASK; - - /* On alternate insertions we have a whole baud and must process it. */ - if ((s->rx.baud_phase ^= 1)) - return; + /* This routine adapts the position of the half baud samples entering the equalizer. */ /* Perform a Gardner test for baud alignment on the three most recent samples. */ -#if 0 - p = s->rx.eq_buf[(s->rx.eq_step - 3) & V22BIS_EQUALIZER_MASK].re - - s->rx.eq_buf[(s->rx.eq_step - 1) & V22BIS_EQUALIZER_MASK].re; - p *= s->rx.eq_buf[(s->rx.eq_step - 2) & V22BIS_EQUALIZER_MASK].re; - - q = s->rx.eq_buf[(s->rx.eq_step - 3) & V22BIS_EQUALIZER_MASK].im - - s->rx.eq_buf[(s->rx.eq_step - 1) & V22BIS_EQUALIZER_MASK].im; - q *= s->rx.eq_buf[(s->rx.eq_step - 2) & V22BIS_EQUALIZER_MASK].im; -#else if (s->rx.sixteen_way_decisions) { p = s->rx.eq_buf[(s->rx.eq_step - 3) & V22BIS_EQUALIZER_MASK].re @@ -414,18 +358,18 @@ } else { - /* Rotate the points to the 45 degree positions, to maximise the effectiveness of the Gardner algorithm */ - zz = complex_setf(cosf(26.57f*3.14159f/180.0f), sinf(26.57f*3.14159f/180.0f)); + /* Rotate the points to the 45 degree positions, to maximise the effectiveness of + the Gardner algorithm. This is particularly significant at the start of operation + to pull things in quickly. */ + zz = complex_setf(0.894427, 0.44721f); a = complex_mulf(&s->rx.eq_buf[(s->rx.eq_step - 3) & V22BIS_EQUALIZER_MASK], &zz); b = complex_mulf(&s->rx.eq_buf[(s->rx.eq_step - 2) & V22BIS_EQUALIZER_MASK], &zz); c = complex_mulf(&s->rx.eq_buf[(s->rx.eq_step - 1) & V22BIS_EQUALIZER_MASK], &zz); p = (a.re - c.re)*b.re; q = (a.im - c.im)*b.im; } -#endif - p += q; - s->rx.gardner_integrate += ((p + q) > 0.0f) ? s->rx.gardner_step : -s->rx.gardner_step; + s->rx.gardner_integrate += (p + q > 0.0f) ? s->rx.gardner_step : -s->rx.gardner_step; if (abs(s->rx.gardner_integrate) >= 16) { @@ -439,9 +383,37 @@ s->rx.qam_report(s->rx.qam_user_data, NULL, NULL, s->rx.gardner_integrate); s->rx.gardner_integrate = 0; } +} +/*- End of function --------------------------------------------------------*/ + +static void process_half_baud(v22bis_state_t *s, const complexf_t *sample) +{ + complexf_t z; + complexf_t zz; + const complexf_t *target; + int re; + int im; + int nearest; + int bitstream; + int raw_bits; + + z.re = sample->re; + z.im = sample->im; + + /* Add a sample to the equalizer's circular buffer, but don't calculate anything + at this time. */ + s->rx.eq_buf[s->rx.eq_step] = z; + s->rx.eq_step = (s->rx.eq_step + 1) & V22BIS_EQUALIZER_MASK; + + /* On alternate insertions we have a whole baud and must process it. */ + if ((s->rx.baud_phase ^= 1)) + return; + + symbol_sync(s); z = equalizer_get(s); + /* Find the constellation point */ if (s->rx.sixteen_way_decisions) { re = (int) (z.re + 3.0f); @@ -458,9 +430,17 @@ } else { - zz = complex_setf(3.0f/3.162278f, -1.0f/3.162278f); + /* Rotate to 45 degrees, to make the slicing trivial */ + zz = complex_setf(0.894427, 0.44721f); zz = complex_mulf(&z, &zz); - nearest = (find_quadrant(&zz) << 2) | 0x01; + nearest = 0x01; + if (zz.re < 0.0f) + nearest |= 0x04; + if (zz.im < 0.0f) + { + nearest ^= 0x04; + nearest |= 0x08; + } } raw_bits = 0; @@ -471,6 +451,31 @@ target = &v22bis_constellation[nearest]; track_carrier(s, &z, target); tune_equalizer(s, &z, target); + raw_bits = phase_steps[((nearest >> 2) - (s->rx.constellation_state >> 2)) & 3]; + /* TODO: detect unscrambled ones indicating a loopback request */ + + /* Search for the S1 signal that might be requesting a retrain */ + if ((s->rx.last_raw_bits ^ raw_bits) == 0x3) + { + s->rx.pattern_repeats++; + } + else + { + if (s->rx.pattern_repeats >= 50 && (s->rx.last_raw_bits == 0x3 || s->rx.last_raw_bits == 0x0)) + { + /* We should get a full run of 00 11 (about 60 bauds) at either modem. */ + span_log(&s->logging, SPAN_LOG_FLOW, "+++ S1 detected (%d long)\n", s->rx.pattern_repeats); + span_log(&s->logging, SPAN_LOG_FLOW, "+++ Accepting a retrain request\n"); + s->rx.pattern_repeats = 0; + s->rx.training_count = 0; + s->rx.training = V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200; + s->tx.training_count = 0; + s->tx.training = V22BIS_TX_TRAINING_STAGE_U0011; + v22bis_equalizer_coefficient_reset(s); + v22bis_report_status_change(s, SIG_STATUS_MODEM_RETRAIN_OCCURRED); + } + s->rx.pattern_repeats = 0; + } decode_baud(s, nearest); break; case V22BIS_RX_TRAINING_STAGE_SYMBOL_ACQUISITION: @@ -505,7 +510,7 @@ track_carrier(s, &z, target); raw_bits = phase_steps[((nearest >> 2) - (s->rx.constellation_state >> 2)) & 3]; s->rx.constellation_state = nearest; - if (raw_bits != s->rx.last_raw_bits) + if (raw_bits != s->rx.last_raw_bits) s->rx.pattern_repeats = 0; else s->rx.pattern_repeats++; @@ -578,7 +583,7 @@ { /* We should get a full run of 00 11 (about 60 bauds) at the calling modem, but only about 20 at the answering modem, as the first 40 are TED settling time. */ - span_log(&s->logging, SPAN_LOG_FLOW, "+++ S1 detected at %d\n", s->rx.pattern_repeats); + span_log(&s->logging, SPAN_LOG_FLOW, "+++ S1 detected (%d long)\n", s->rx.pattern_repeats); if (s->bit_rate == 2400) { if (!s->caller) @@ -709,7 +714,8 @@ s->rx.rrc_filter_step = 0; /* Calculate the I filter, with an arbitrary phase step, just so we can calculate - the signal power. */ + the signal power of the required carrier, with any guard tone or spillback of our + own transmitted signal suppressed. */ if (s->caller) { ii = rx_pulseshaper_2400_re[6][0]*s->rx.rrc_filter[s->rx.rrc_filter_step]; @@ -744,7 +750,7 @@ if (s->rx.training != V22BIS_RX_TRAINING_STAGE_PARKED) { /* Only spend effort processing this data if the modem is not - parked, after training failure. */ + parked, after a training failure. */ z = dds_complexf(&s->rx.carrier_phase, s->rx.carrier_phase_rate); if (s->rx.training == V22BIS_RX_TRAINING_STAGE_SYMBOL_ACQUISITION) { Modified: freeswitch/trunk/libs/spandsp/src/v22bis_tx.c ============================================================================== --- freeswitch/trunk/libs/spandsp/src/v22bis_tx.c (original) +++ freeswitch/trunk/libs/spandsp/src/v22bis_tx.c Thu May 14 16:52:52 2009 @@ -22,12 +22,13 @@ * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: v22bis_tx.c,v 1.61 2009/04/25 10:18:50 steveu Exp $ + * $Id: v22bis_tx.c,v 1.62 2009/04/29 12:37:45 steveu Exp $ */ /*! \file */ -/* THIS IS A WORK IN PROGRESS - NOT YET FUNCTIONAL! */ +/* THIS IS A WORK IN PROGRESS - It is basically functional, but it is not feature + complete, and doesn't reliably sync over the signal and noise level ranges it should! */ #if defined(HAVE_CONFIG_H) #include "config.h" @@ -240,20 +241,6 @@ #define ms_to_symbols(t) (((t)*600)/1000) -/* Segments of the training sequence */ -enum -{ - V22BIS_TX_TRAINING_STAGE_NORMAL_OPERATION = 0, - V22BIS_TX_TRAINING_STAGE_INITIAL_TIMED_SILENCE, - V22BIS_TX_TRAINING_STAGE_INITIAL_SILENCE, - V22BIS_TX_TRAINING_STAGE_U11, - V22BIS_TX_TRAINING_STAGE_U0011, - V22BIS_TX_TRAINING_STAGE_S11, - V22BIS_TX_TRAINING_STAGE_TIMED_S11, - V22BIS_TX_TRAINING_STAGE_S1111, - V22BIS_TX_TRAINING_STAGE_PARKED -}; - static const int phase_steps[4] = { 1, 0, 2, 3 @@ -598,6 +585,7 @@ SPAN_DECLARE(int) v22bis_request_retrain(v22bis_state_t *s, int bit_rate) { + /* TODO: support bit rate switching */ switch (bit_rate) { case 2400: @@ -606,7 +594,33 @@ default: return -1; } - /* TODO: Implement retrain and bit rate change */ + /* TODO: support bit rate changes */ + /* Retrain is only valid when we are normal operation at 2400bps */ + if (s->rx.training != V22BIS_RX_TRAINING_STAGE_NORMAL_OPERATION + || + s->tx.training != V22BIS_TX_TRAINING_STAGE_NORMAL_OPERATION + || + s->negotiated_bit_rate != 2400) + { + return -1; + } + /* Send things back into the training process at the appropriate point. + The far end should detect the S1 signal, and reciprocate. */ + span_log(&s->logging, SPAN_LOG_FLOW, "+++ Initiating a retrain\n"); + s->rx.pattern_repeats = 0; + s->rx.training_count = 0; + s->rx.training = V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200; + s->tx.training_count = 0; + s->tx.training = V22BIS_TX_TRAINING_STAGE_U0011; + v22bis_equalizer_coefficient_reset(s); + v22bis_report_status_change(s, SIG_STATUS_MODEM_RETRAIN_OCCURRED); + return 0; +} +/*- End of function --------------------------------------------------------*/ + +SPAN_DECLARE(int) v22bis_remote_loopback(v22bis_state_t *s, int enable) +{ + /* TODO: */ return -1; } /*- End of function --------------------------------------------------------*/ Modified: freeswitch/trunk/libs/spandsp/tests/fax_decode.c ============================================================================== --- freeswitch/trunk/libs/spandsp/tests/fax_decode.c (original) +++ freeswitch/trunk/libs/spandsp/tests/fax_decode.c Thu May 14 16:52:52 2009 @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: fax_decode.c,v 1.54 2009/02/10 13:06:47 steveu Exp $ + * $Id: fax_decode.c,v 1.55 2009/04/29 12:37:45 steveu Exp $ */ /*! \page fax_decode_page FAX decoder @@ -229,7 +229,7 @@ { if (msg[0] != 0xFF || !(msg[1] == 0x03 || msg[1] == 0x13)) { - fprintf(stderr, "Bad frame header - %02x %02x", msg[0], msg[1]); + fprintf(stderr, "Bad frame header - %02x %02x\n", msg[0], msg[1]); return; } print_frame("HDLC: ", msg, len); Modified: freeswitch/trunk/libs/spandsp/tests/t4_tests.c ============================================================================== --- freeswitch/trunk/libs/spandsp/tests/t4_tests.c (original) +++ freeswitch/trunk/libs/spandsp/tests/t4_tests.c Thu May 14 16:52:52 2009 @@ -137,7 +137,6 @@ } /*- End of function --------------------------------------------------------*/ -#if 0 static int row_read_handler(void *user_data, uint8_t buf[], size_t len) { int i; @@ -189,22 +188,108 @@ printf("Oops - '%c' at end of row %d\n", *s, row); if (memcmp(buf, ref, len)) { - printf("Failed at row %d\n", row); + printf("Test failed at row %d\n", row); exit(2); } return len; } /*- End of function --------------------------------------------------------*/ -#endif + +static int detect_page_end(int bit, int page_ended) +{ + static int consecutive_eols; + static int max_consecutive_eols; + static int consecutive_zeros; + static int consecutive_ones; + static int eol_zeros; + static int eol_ones; + static int expected_eols; + static int end_marks; + + /* Check the EOLs are added properly to the end of an image. We can't rely on the + decoder giving the right answer, as a full set of EOLs is not needed for the + decoder to work. */ + if (bit == -1000000) + { + /* Reset */ + consecutive_eols = 0; + max_consecutive_eols = 0; + consecutive_zeros = 0; + consecutive_ones = 0; + end_marks = 0; + + eol_zeros = 11; + eol_ones = (page_ended == T4_COMPRESSION_ITU_T4_2D) ? 2 : 1; + expected_eols = (page_ended == T4_COMPRESSION_ITU_T6) ? 2 : 6; + return FALSE; + } + + /* Monitor whether the EOLs are there in the correct amount */ + if (bit == 0) + { + consecutive_zeros++; + consecutive_ones = 0; + } + else if (bit == 1) + { + if (++consecutive_ones == eol_ones) + { + if (consecutive_eols == 0 && consecutive_zeros >= eol_zeros) + consecutive_eols++; + else if (consecutive_zeros == eol_zeros) + consecutive_eols++; + else + consecutive_eols = 0; + consecutive_zeros = 0; + consecutive_ones = 0; + } + if (max_consecutive_eols < consecutive_eols) + max_consecutive_eols = consecutive_eols; + } + else if (bit == SIG_STATUS_END_OF_DATA) + { + if (end_marks == 0) + { + if (max_consecutive_eols != expected_eols) + { + printf("Only %d EOLs (should be %d)\n", max_consecutive_eols, expected_eols); + return 2; + } + consecutive_zeros = 0; + consecutive_eols = 0; + max_consecutive_eols = 0; + } + if (!page_ended) + { + /* We might need to push a few bits to get the receiver to report the + end of page condition (at least with T.6). */ + if (++end_marks > 50) + { + printf("Receiver missed the end of page mark\n"); + return 2; + } + return 0; + } + return 1; + } + return 0; +} +/*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { + static const int compression_sequence[] = + { + T4_COMPRESSION_ITU_T4_1D, + T4_COMPRESSION_ITU_T4_2D, + T4_COMPRESSION_ITU_T6 + }; int sends; int page_no; int bit; int end_of_page; int end_marks; - int decode_test; + int res; int compression; int compression_step; int add_page_headers; @@ -214,6 +299,7 @@ char buf[1024]; uint8_t block[1024]; const char *in_file_name; + const char *decode_file_name; int opt; int i; int bit_error_rate; @@ -221,29 +307,37 @@ int tests_failed; unsigned int last_pkt_no; unsigned int pkt_no; + int page_ended; + FILE *file; tests_failed = 0; - decode_test = FALSE; compression = -1; + compression_step = 0; add_page_headers = FALSE; restart_pages = FALSE; in_file_name = IN_FILE_NAME; - min_row_bits = 0; + decode_file_name = NULL; + /* Use a non-zero default minimum row length to ensure we test the consecutive EOLs part + properly. */ + min_row_bits = 50; block_size = 0; bit_error_rate = 0; dump_as_xxx = FALSE; - while ((opt = getopt(argc, argv, "126b:dehri:m:x")) != -1) + while ((opt = getopt(argc, argv, "126b:d:ehri:m:x")) != -1) { switch (opt) { case '1': compression = T4_COMPRESSION_ITU_T4_1D; + compression_step = -1; break; case '2': compression = T4_COMPRESSION_ITU_T4_2D; + compression_step = -1; break; case '6': compression = T4_COMPRESSION_ITU_T6; + compression_step = -1; break; case 'b': block_size = atoi(optarg); @@ -251,7 +345,7 @@ block_size = 1024; break; case 'd': - decode_test = TRUE; + decode_file_name = optarg; break; case 'e': bit_error_rate = 0x3FF; @@ -282,7 +376,7 @@ memset(&receive_state, 0, sizeof(receive_state)); end_of_page = FALSE; - if (decode_test) + if (decode_file_name) { if (compression < 0) compression = T4_COMPRESSION_ITU_T4_1D; @@ -302,7 +396,8 @@ page_no = 1; t4_rx_start_page(&receive_state); last_pkt_no = 0; - while (fgets(buf, 1024, stdin)) + file = fopen(decode_file_name, "r"); + while (fgets(buf, 1024, file)) { if (sscanf(buf, "HDLC: FCD: 06 %x", &pkt_no) == 1) { @@ -361,6 +456,7 @@ } } } + fclose(file); if (dump_as_xxx) dump_image_as_xxx(&receive_state); t4_rx_end_page(&receive_state); @@ -370,6 +466,75 @@ else { #if 1 + printf("Testing image_function->compress->decompress->image_function\n"); + /* Send end gets image from a function */ + if (t4_tx_init(&send_state, in_file_name, -1, -1) == NULL) + { + printf("Failed to init T.4 tx\n"); + exit(2); + } + span_log_set_level(&send_state.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW); + t4_tx_set_row_read_handler(&send_state, row_read_handler, NULL); + t4_tx_set_min_row_bits(&send_state, min_row_bits); + t4_tx_set_local_ident(&send_state, "111 2222 3333"); + + /* Receive end puts TIFF to a function. */ + if (t4_rx_init(&receive_state, OUT_FILE_NAME, T4_COMPRESSION_ITU_T4_2D) == NULL) + { + printf("Failed to init T.4 rx\n"); + exit(2); + } + span_log_set_level(&receive_state.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW); + t4_rx_set_row_write_handler(&receive_state, row_write_handler, NULL); + t4_rx_set_x_resolution(&receive_state, t4_tx_get_x_resolution(&send_state)); + t4_rx_set_y_resolution(&receive_state, t4_tx_get_y_resolution(&send_state)); + t4_rx_set_image_width(&receive_state, t4_tx_get_image_width(&send_state)); + + /* Now send and receive all the pages in the source TIFF file */ + page_no = 1; + /* If we are stepping around the compression schemes, reset to the start of the sequence. */ + if (compression_step > 0) + compression_step = 0; + for (;;) + { + end_marks = 0; + if (compression_step >= 0) + { + compression = compression_sequence[compression_step++]; + if (compression_step > 3) + break; + } + t4_tx_set_tx_encoding(&send_state, compression); + t4_rx_set_rx_encoding(&receive_state, compression); + + if (t4_tx_start_page(&send_state)) + break; + t4_rx_start_page(&receive_state); + do + { + bit = t4_tx_get_bit(&send_state); + if (bit == SIG_STATUS_END_OF_DATA) + { + if (++end_marks > 50) + { + printf("Receiver missed the end of page mark\n"); + tests_failed++; + break; + } + } + end_of_page = t4_rx_put_bit(&receive_state, bit & 1); + } + while (!end_of_page); + t4_tx_end_page(&send_state); + t4_rx_end_page(&receive_state); + if (compression_step < 0) + break; + } + t4_tx_release(&send_state); + t4_rx_release(&receive_state); +#endif +#if 1 + printf("Testing TIFF->compress->decompress->TIFF cycle\n"); /* Send end gets TIFF from a file */ if (t4_tx_init(&send_state, in_file_name, -1, -1) == NULL) { @@ -383,7 +548,7 @@ /* Receive end puts TIFF to a new file. */ if (t4_rx_init(&receive_state, OUT_FILE_NAME, T4_COMPRESSION_ITU_T4_2D) == NULL) { - printf("Failed to init T.4 rx\n"); + printf("Failed to init T.4 rx for '%s'\n", OUT_FILE_NAME); exit(2); } span_log_set_level(&receive_state.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW); @@ -394,8 +559,9 @@ /* Now send and receive all the pages in the source TIFF file */ page_no = 1; sends = 0; - /* Select whether we step round the compression schemes, or use a single specified one. */ - compression_step = (compression < 0) ? 0 : -1; + /* If we are stepping around the compression schemes, reset to the start of the sequence. */ + if (compression_step > 0) + compression_step = 0; for (;;) { end_marks = 0; @@ -412,20 +578,11 @@ } else { - switch (compression_step) + if (compression_step >= 0) { - case 0: - compression = T4_COMPRESSION_ITU_T4_1D; - compression_step++; - break; - case 1: - compression = T4_COMPRESSION_ITU_T4_2D; - compression_step++; - break; - case 2: - compression = T4_COMPRESSION_ITU_T6; - compression_step = 0; - break; + compression = compression_sequence[compression_step++]; + if (compression_step > 2) + compression_step = 0; } t4_tx_set_tx_encoding(&send_state, compression); t4_rx_set_rx_encoding(&receive_state, compression); @@ -434,32 +591,36 @@ break; } t4_rx_start_page(&receive_state); + detect_page_end(-1000000, compression); + page_ended = FALSE; if (block_size == 0) { - do + for (;;) { bit = t4_tx_get_bit(&send_state); - if (bit == SIG_STATUS_END_OF_DATA) + /* Monitor whether the EOLs are there in the correct amount */ + if ((res = detect_page_end(bit, page_ended))) { - /* T.6 data does not contain an image termination sequence. - T.4 1D and 2D do, and should locate that sequence. */ - if (compression == T4_COMPRESSION_ITU_T6) - break; - if (++end_marks > 50) - { - printf("Receiver missed the end of page mark\n"); - tests_failed++; - break; - } + tests_failed += (res - 1); + break; } - if (bit_error_rate) + if (!page_ended) { - if ((rand() % bit_error_rate) == 0) - bit ^= 1; + if (bit_error_rate) + { + if ((rand() % bit_error_rate) == 0) + bit ^= 1; + } + if (t4_rx_put_bit(&receive_state, bit & 1)) + page_ended = TRUE; } - end_of_page = t4_rx_put_bit(&receive_state, bit & 1); } - while (!end_of_page); + /* Now throw junk at the receive context, to ensure stuff occuring + after the end of page condition has no bad effect. */ + for (i = 0; i < 1000; i++) + { + t4_rx_put_bit(&receive_state, (rand() >> 10) & 1); + } } else if (block_size == 1) { @@ -468,10 +629,6 @@ bit = t4_tx_get_byte(&send_state); if ((bit & 0x100)) { - /* T.6 data does not contain an image termination sequence. - T.4 1D and 2D do, and should locate that sequence. */ - if (compression == T4_COMPRESSION_ITU_T6) - break; if (++end_marks > 50) { printf("Receiver missed the end of page mark\n"); @@ -492,10 +649,6 @@ end_of_page = t4_rx_put_chunk(&receive_state, block, bit); if (bit < block_size) { - /* T.6 data does not contain an image termination sequence. - T.4 1D and 2D do, and should locate that sequence. */ - if (compression == T4_COMPRESSION_ITU_T6) - break; if (++end_marks > 50) { printf("Receiver missed the end of page mark\n"); @@ -520,93 +673,13 @@ at the image level. TIFF files allow a lot of ways to express the same thing, so bit matching of the files is not the normal case. */ fflush(stdout); - sprintf(buf, "tiffcmp -t %s " OUT_FILE_NAME, in_file_name); - if (tests_failed)// || system(buf)) + sprintf(buf, "tiffcmp -t %s %s", in_file_name, OUT_FILE_NAME); + if (tests_failed || system(buf)) { printf("Tests failed\n"); exit(2); } #endif -#if 0 - /* Send end gets TIFF from a function */ - if (t4_tx_init(&send_state, in_file_name, -1, -1) == NULL) - { - printf("Failed to init T.4 tx\n"); - exit(2); - } - span_log_set_level(&send_state.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW); - t4_tx_set_row_read_handler(&send_state, row_read_handler, NULL); - t4_tx_set_min_row_bits(&send_state, min_row_bits); - t4_tx_set_local_ident(&send_state, "111 2222 3333"); - - /* Receive end puts TIFF to a function. */ - if (t4_rx_init(&receive_state, OUT_FILE_NAME, T4_COMPRESSION_ITU_T4_2D) == NULL) - { - printf("Failed to init T.4 rx\n"); - exit(2); - } - span_log_set_level(&receive_state.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW); - t4_rx_set_row_write_handler(&receive_state, row_write_handler, NULL); - t4_rx_set_x_resolution(&receive_state, t4_tx_get_x_resolution(&send_state)); - t4_rx_set_y_resolution(&receive_state, t4_tx_get_y_resolution(&send_state)); - t4_rx_set_image_width(&receive_state, t4_tx_get_image_width(&send_state)); - - /* Now send and receive all the pages in the source TIFF file */ - page_no = 1; - /* Select whether we step round the compression schemes, or use a single specified one. */ - compression_step = (compression < 0) ? 0 : -1; - for (;;) - { - end_marks = 0; - /* Add a header line to alternate pages, if required */ - switch (compression_step) - { - case 0: - compression = T4_COMPRESSION_ITU_T4_1D; - compression_step++; - break; - case 1: - compression = T4_COMPRESSION_ITU_T4_2D; - compression_step++; - break; - case 2: - compression = T4_COMPRESSION_ITU_T6; - compression_step = 0; - break; - } - t4_tx_set_tx_encoding(&send_state, compression); - t4_rx_set_rx_encoding(&receive_state, compression); - - if (t4_tx_start_page(&send_state)) - break; - t4_rx_start_page(&receive_state); - do - { - bit = t4_tx_get_bit(&send_state); - if (bit == SIG_STATUS_END_OF_DATA) - { - /* T.6 data does not contain an image termination sequence. - T.4 1D and 2D do, and should locate that sequence. */ - if (compression == T4_COMPRESSION_ITU_T6) - break; - if (++end_marks > 50) - { - printf("Receiver missed the end of page mark\n"); - tests_failed++; - break; - } - } - end_of_page = t4_rx_put_bit(&receive_state, bit & 1); - } - while (!end_of_page); - t4_tx_end_page(&send_state); - t4_rx_end_page(&receive_state); - break; - } - t4_tx_release(&send_state); - t4_rx_release(&receive_state); -#endif - printf("Tests passed\n"); } return 0; Modified: freeswitch/trunk/libs/spandsp/tests/tsb85_tests.sh ============================================================================== --- freeswitch/trunk/libs/spandsp/tests/tsb85_tests.sh (original) +++ freeswitch/trunk/libs/spandsp/tests/tsb85_tests.sh Thu May 14 16:52:52 2009 @@ -15,7 +15,7 @@ # License along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # -# $Id: tsb85_tests.sh,v 1.6 2008/09/11 15:13:42 steveu Exp $ +# $Id: tsb85_tests.sh,v 1.7 2009/04/30 15:04:20 steveu Exp $ # run_tsb85_test() @@ -54,11 +54,12 @@ run_tsb85_test done +# MRGX03 is failing because the V.27ter modemsays it trained on HDLC # MRGX05 is failing because we don't distinguish MPS immediately after MCF from MPS after # a corrupt image signal. #for TEST in MRGX01 MRGX02 MRGX03 MRGX04 MRGX05 MRGX06 MRGX07 MRGX08 ; do -for TEST in MRGX01 MRGX02 MRGX03 MRGX04 MRGX06 MRGX07 MRGX08 ; do +for TEST in MRGX01 MRGX02 MRGX04 MRGX06 MRGX07 MRGX08 ; do run_tsb85_test done @@ -94,7 +95,8 @@ run_tsb85_test done -for TEST in OTEN01 OTEN02 OTEN03 OTEN04 OTEN05 OTEN06 ; do +#for TEST in OTEN01 OTEN02 OTEN03 OTEN04 OTEN05 OTEN06 ; do +for TEST in OTEN01 OTEN03 OTEN04 OTEN05 OTEN06 ; do run_tsb85_test done From mikej at freeswitch.org Thu May 14 15:01:55 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Thu, 14 May 2009 17:01:55 -0500 Subject: [Freeswitch-svn] [commit] r13312 - freeswitch/trunk/src/mod/applications/mod_fax Message-ID: Author: mikej Date: Thu May 14 17:01:55 2009 New Revision: 13312 Log: can't print base 8 number that has a 9 in it.. use stringified version instead Modified: freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c 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 Thu May 14 17:01:55 2009 @@ -805,8 +805,7 @@ /* Not such severe to prevent loading */ } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "mod_fax loaded, using spandsp library version %d [%d]\n", SPANDSP_RELEASE_DATE, - SPANDSP_RELEASE_TIME); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "mod_fax loaded, using spandsp library version [%s]\n", SPANDSP_RELEASE_DATETIME_STRING); return SWITCH_STATUS_SUCCESS; } From mikej at freeswitch.org Thu May 14 15:33:17 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Thu, 14 May 2009 17:33:17 -0500 Subject: [Freeswitch-svn] [commit] r13313 - freeswitch/trunk/src/mod/applications/mod_conference Message-ID: Author: mikej Date: Thu May 14 17:33:17 2009 New Revision: 13313 Log: MODAPP-219 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 Thu May 14 17:33:17 2009 @@ -4858,6 +4858,11 @@ conf_name = mydata; + /* eat all leading spaces on conference name, which can cause problems */ + while (*conf_name == ' ') { + conf_name++; + } + /* is there a conference pin ? */ if ((dpin = strchr(conf_name, '+'))) { *dpin++ = '\0'; From brian at freeswitch.org Thu May 14 15:47:44 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Thu, 14 May 2009 17:47:44 -0500 Subject: [Freeswitch-svn] [commit] r13314 - in freeswitch/trunk: conf/lang/en/vm src/mod/applications/mod_voicemail Message-ID: Author: brian Date: Thu May 14 17:47:44 2009 New Revision: 13314 Log: MODAPP-173 you'll need the latest sounds and a make vm-sync to use this Modified: freeswitch/trunk/conf/lang/en/vm/sounds.xml freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c Modified: freeswitch/trunk/conf/lang/en/vm/sounds.xml ============================================================================== --- freeswitch/trunk/conf/lang/en/vm/sounds.xml (original) +++ freeswitch/trunk/conf/lang/en/vm/sounds.xml Thu May 14 17:47:44 2009 @@ -332,4 +332,13 @@ + + + + + + + + + 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 May 14 17:47:44 2009 @@ -1046,6 +1046,7 @@ #define VM_HELLO_MACRO "voicemail_hello" #define VM_GOODBYE_MACRO "voicemail_goodbye" #define VM_MESSAGE_COUNT_MACRO "voicemail_message_count" +#define VM_DISK_QUOTA_EXCEEDED_MACRO "voicemail_disk_quota_exceeded" #define URGENT_FLAG_STRING "A_URGENT" #define NORMAL_FLAG_STRING "B_NORMAL" @@ -2844,6 +2845,7 @@ switch_xml_t x_domain = NULL, x_domain_root = NULL, x_user = NULL, x_params = NULL, x_param = NULL; switch_event_t *vars = NULL; const char *vm_cc = NULL, *vtmp, *vm_ext = NULL; + int disk_quota = 0; switch_event_t *params = NULL; if (!(caller_id_name = switch_channel_get_variable(channel, "effective_caller_id_name"))) { @@ -2888,6 +2890,8 @@ insert_db = switch_true(val); } else if (!strcasecmp(var, "vm-attach-file")) { email_attach = switch_true(val); + } else if (!strcasecmp(var, "vm-disk-quota")) { + disk_quota = atoi(val); } else if (!strcasecmp(var, "vm-alternate-greet-id")) { read_id = switch_core_session_strdup(session, val); } @@ -3032,6 +3036,27 @@ } } + if (disk_quota) { + callback_t cbt = { 0 }; + char sql[256]; + char disk_usage[256]; + + cbt.buf = disk_usage; + cbt.len = sizeof(disk_usage); + + switch_snprintf(sql, sizeof(sql), + "select sum(message_len) from voicemail_msgs where username='%s' and domain='%s'", + id, domain_name); + vm_execute_sql_callback(profile, profile->mutex, sql, sql2str_callback, &cbt); + + if (atoi(disk_usage) >= disk_quota) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Voicemail disk quota is exceeded for %s\n", id); + TRY_CODE(switch_ivr_phrase_macro(session, VM_DISK_QUOTA_EXCEEDED_MACRO, NULL, NULL, NULL)); + goto end; + } + } + + memset(&fh, 0, sizeof(fh)); args.input_callback = control_playback; memset(&cc, 0, sizeof(cc)); From brian at freeswitch.org Thu May 14 15:56:05 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Thu, 14 May 2009 17:56:05 -0500 Subject: [Freeswitch-svn] [commit] r13315 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: brian Date: Thu May 14 17:56:04 2009 New Revision: 13315 Log: Do not verify TLS certificates since we do not have the framework in place to do so. 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 Thu May 14 17:56:04 2009 @@ -768,12 +768,13 @@ TAG_IF(strchr(profile->sipip, ':'), SOATAG_AF(SOA_AF_IP6_ONLY)), TAG_IF(sofia_test_pflag(profile, PFLAG_TLS), NUTAG_SIPS_URL(profile->tls_bindurl)), TAG_IF(sofia_test_pflag(profile, PFLAG_TLS), NUTAG_CERTIFICATE_DIR(profile->tls_cert_dir)), + TAG_IF(sofia_test_pflag(profile, PFLAG_TLS), TPTAG_TLS_VERIFY_POLICY(0)), TAG_IF(sofia_test_pflag(profile, PFLAG_TLS), TPTAG_TLS_VERSION(profile->tls_version)), TAG_IF(!strchr(profile->sipip, ':'), NTATAG_UDP_MTU(65535)), TAG_IF(sofia_test_pflag(profile, PFLAG_DISABLE_SRV), NTATAG_USE_SRV(0)), TAG_IF(sofia_test_pflag(profile, PFLAG_DISABLE_NAPTR), NTATAG_USE_NAPTR(0)), NTATAG_DEFAULT_PROXY(profile->outbound_proxy), - NTATAG_SERVER_RPORT(profile->rport_level), + NTATAG_SERVER_RPORT(profile->rport_level), TPTAG_LOG(sofia_test_flag(profile, TFLAG_TPORT_LOG)), TAG_IF(profile->timer_t1, NTATAG_SIP_T1(profile->timer_t1)), TAG_IF(profile->timer_t1x64, NTATAG_SIP_T1X64(profile->timer_t1x64)), From brian at freeswitch.org Thu May 14 20:17:19 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Thu, 14 May 2009 22:17:19 -0500 Subject: [Freeswitch-svn] [commit] r13316 - freeswitch/trunk/src/mod/applications/mod_dptools Message-ID: Author: brian Date: Thu May 14 22:17:19 2009 New Revision: 13316 Log: MODAPP-278, thanks Moc see you at cluecon... Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c 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 Thu May 14 22:17:19 2009 @@ -2373,7 +2373,7 @@ if (!strcasecmp(pvar, "dial-string")) { dest = val; - } else if (!strncasecmp(var, "dial-var-", 9)) { + } else if (!strncasecmp(pvar, "dial-var-", 9)) { if (!var_event) { switch_event_create(&var_event, SWITCH_EVENT_GENERAL); } else { From mikej at freeswitch.org Fri May 15 08:42:25 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 10:42:25 -0500 Subject: [Freeswitch-svn] [commit] r13317 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/tport Message-ID: Author: mikej Date: Fri May 15 10:42:25 2009 New Revision: 13317 Log: Wed Apr 29 13:03:20 CDT 2009 Pekka Pessi * tport: close half-closed idle connections on windows, too Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 10:42:25 2009 @@ -1 +1 @@ -Thu Apr 16 12:20:45 CDT 2009 +Fri May 15 10:42:15 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport.c Fri May 15 10:42:25 2009 @@ -2815,8 +2815,9 @@ if (!tport_is_secondary(self)) return; - /* End of stream */ - tport_shutdown0(self, 0); + /* Shutdown completely if there are no queued messages */ + /* Problem reported by Arsen Chaloyan */ + tport_shutdown0(self, tport_has_queued(self) ? 0 : 2); tport_set_secondary_timer(self); } From mikej at freeswitch.org Fri May 15 08:43:29 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 10:43:29 -0500 Subject: [Freeswitch-svn] [commit] r13318 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua Message-ID: Author: mikej Date: Fri May 15 10:43:28 2009 New Revision: 13318 Log: Tue May 12 12:08:13 CDT 2009 Pekka Pessi * nua_session.c: include Session-Expires to session refresh requests Thanks for Linus Surguy for reporting the problem. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 10:43:28 2009 @@ -1 +1 @@ -Fri May 15 10:42:15 CDT 2009 +Fri May 15 10:43:02 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Fri May 15 10:43:28 2009 @@ -4393,10 +4393,15 @@ */ if (t->local.refresher == nua_local_refresher) refresher = nua_local_refresher; + else if (!initial) + refresher = t->refresher; expires = t->local.expires; if (expires != 0 && expires < min) expires = min; + + if (expires == 0 && !initial && t->interval) + expires = t->interval; } sip_min_se_init(min_se)->min_delta = min; From mikej at freeswitch.org Fri May 15 08:44:40 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 10:44:40 -0500 Subject: [Freeswitch-svn] [commit] r13319 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua Message-ID: Author: mikej Date: Fri May 15 10:44:40 2009 New Revision: 13319 Log: Tue May 12 12:08:51 CDT 2009 Pekka Pessi * check_session.c: ensure that re-INVITEs have correct Session-Expires parameters Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 10:44:40 2009 @@ -1 +1 @@ -Fri May 15 10:43:02 CDT 2009 +Fri May 15 10:43:59 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c Fri May 15 10:44:40 2009 @@ -1195,6 +1195,9 @@ fail_unless(s2_check_callstate(nua_callstate_calling)); invite = s2_sip_wait_for_request(SIP_METHOD_INVITE); process_offer(invite); + /* Check that INVITE contains Session-Expires header with refresher=uac */ + fail_unless(invite->sip->sip_session_expires != NULL); + fail_unless(su_casematch(invite->sip->sip_session_expires->x_refresher, "uac")); respond_with_sdp( invite, dialog, SIP_200_OK, SIPTAG_SESSION_EXPIRES_STR(session_expires), @@ -1261,9 +1264,9 @@ TAG_END()); s2_nua_fast_forward(300, s2base->root); - invite_timer_round(nh, "300", NULL); + invite_timer_round(nh, "300;refresher=uac", NULL); s2_nua_fast_forward(300, s2base->root); - invite_timer_round(nh, "300", NULL); + invite_timer_round(nh, "300;refresher=uac", NULL); bye_by_nua(nh, TAG_END()); From mikej at freeswitch.org Fri May 15 08:45:39 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 10:45:39 -0500 Subject: [Freeswitch-svn] [commit] r13320 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua Message-ID: Author: mikej Date: Fri May 15 10:45:39 2009 New Revision: 13320 Log: Tue May 12 11:05:19 CDT 2009 Pekka Pessi * nua: NUTAG_AUTOACK(0) is now obeyed always when media is disabled Ignore-this: c5960a8330904eae5a1428158e4498c7 If media is enabled, stack autoacks 2XX responses to re-INVITEs unless NUTAG_AUTOACK(0) is set on handle. Also documenting NUTAG_AUTOACK() behaviour with re-INVITEs. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 10:45:39 2009 @@ -1 +1 @@ -Fri May 15 10:43:59 CDT 2009 +Fri May 15 10:45:11 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Fri May 15 10:45:39 2009 @@ -1108,8 +1108,9 @@ if (next_state == nua_callstate_completing) { if (NH_PGET(nh, auto_ack) || - /* Auto-ACK response to re-INVITE unless auto_ack is set to 0 */ - (ss->ss_state == nua_callstate_ready && + /* Auto-ACK response to re-INVITE when media is enabled + and auto_ack is not set to 0 on handle */ + (ss->ss_state == nua_callstate_ready && nh->nh_soa && !NH_PISSET(nh, auto_ack))) { nua_client_request_t *cru; @@ -1867,8 +1868,10 @@ /* There is an un-ACK-ed INVITE there */ assert(du->du_cr->cr_method == sip_method_invite); if (NH_PGET(nh, auto_ack) || - /* Auto-ACK response to re-INVITE unless auto_ack is set to 0 */ - (ss->ss_state == nua_callstate_ready && !NH_PISSET(nh, auto_ack))) { + /* Auto-ACK response to re-INVITE when media is enabled + and auto_ack is not set to 0 on handle */ + (ss->ss_state == nua_callstate_ready && nh->nh_soa && + !NH_PISSET(nh, auto_ack))) { /* There should be no UPDATE with offer/answer if PRACK with offer/answer was ongoing! */ if (nua_invite_client_ack(du->du_cr, NULL) > 0) @@ -3407,8 +3410,10 @@ assert(du->du_cr->cr_method == sip_method_invite); if (NH_PGET(nh, auto_ack) || - /* Auto-ACK response to re-INVITE unless auto_ack is set to 0 */ - (ss->ss_state == nua_callstate_ready && !NH_PISSET(nh, auto_ack))) { + /* Auto-ACK response to re-INVITE when media is enabled + and auto_ack is not set to 0 on handle */ + (ss->ss_state == nua_callstate_ready && nh->nh_soa && + !NH_PISSET(nh, auto_ack))) { if (nua_invite_client_ack(du->du_cr, NULL) > 0) next_state = nua_callstate_ready; else Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c Fri May 15 10:45:39 2009 @@ -1319,6 +1319,12 @@ * * Default value is NUTAG_AUTOACK(1). * + * @par Auto ACK with Re-INVITE requests + * By default, NUA tries to auto-ACK the final response to re-INVITE used to + * refresh the session when the media is enabled. Set NUTAG_AUTOACK(0) on + * the call handle (e.g., include the tag with nua_invite() or + * nua_respond()) in order to disable the auto ACK with re-INVITE. + * * Corresponding tag taking reference parameter is NUTAG_AUTOACK_REF(). */ tag_typedef_t nutag_autoack = BOOLTAG_TYPEDEF(autoACK); From mikej at freeswitch.org Fri May 15 08:46:27 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 10:46:27 -0500 Subject: [Freeswitch-svn] [commit] r13321 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/soa Message-ID: Author: mikej Date: Fri May 15 10:46:27 2009 New Revision: 13321 Log: Tue May 12 14:59:28 CDT 2009 Pekka Pessi * soa_static.c: include media formats in rejected m= line Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 10:46:27 2009 @@ -1 +1 @@ -Fri May 15 10:45:11 CDT 2009 +Fri May 15 10:46:01 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c Fri May 15 10:46:27 2009 @@ -281,7 +281,12 @@ rejected->m_proto_name = m->m_proto_name; if (include_all_codecs) { - rejected->m_rtpmaps = m->m_rtpmaps; + if (m->m_rtpmaps) { + rejected->m_rtpmaps = m->m_rtpmaps; + } + else if (m->m_format) { + rejected->m_format = m->m_format; + } } rejected->m_rejected = 1; From mikej at freeswitch.org Fri May 15 08:47:55 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 10:47:55 -0500 Subject: [Freeswitch-svn] [commit] r13322 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nta Message-ID: Author: mikej Date: Fri May 15 10:47:55 2009 New Revision: 13322 Log: Tue May 12 11:08:07 CDT 2009 Pekka Pessi * nta: do not free transaction in reliable_timeout() if caused by failure to send final response Ignore-this: 8e32f83925b6f2a3629afbb8b20ba693 Issue detected by Coverity. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 10:47:55 2009 @@ -1 +1 @@ -Fri May 15 10:46:01 CDT 2009 +Fri May 15 10:47:06 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c Fri May 15 10:47:55 2009 @@ -11007,10 +11007,12 @@ irq->irq_in_callback = 0; + if (!timeout) + return; + if (irq->irq_completed && irq->irq_destroyed) incoming_free(irq), irq = NULL; - - if (timeout && irq && irq->irq_status < 200) + else if (irq->irq_status < 200) nta_incoming_treply(irq, 503, "Reliable Response Time-Out", TAG_END()); } From mikej at freeswitch.org Fri May 15 08:49:34 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 10:49:34 -0500 Subject: [Freeswitch-svn] [commit] r13323 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/iptsec Message-ID: Author: mikej Date: Fri May 15 10:49:34 2009 New Revision: 13323 Log: Tue May 12 11:38:36 CDT 2009 Pekka Pessi * auth_common.c::auth_get_params(): added missing va_end() Ignore-this: 43f33c9e069f4b80c35bab09bec7f925 Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_common.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 10:49:34 2009 @@ -1 +1 @@ -Fri May 15 10:47:06 CDT 2009 +Fri May 15 10:49:06 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_common.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_common.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_common.c Fri May 15 10:49:34 2009 @@ -125,8 +125,10 @@ else value = su_strdup(home, p + len); - if (value == NULL) + if (value == NULL) { + va_end(ap); return -1; + } break; } From mikej at freeswitch.org Fri May 15 08:50:43 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 10:50:43 -0500 Subject: [Freeswitch-svn] [commit] r13324 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua Message-ID: Author: mikej Date: Fri May 15 10:50:43 2009 New Revision: 13324 Log: Tue May 12 11:52:32 CDT 2009 Pekka Pessi * nua_session.c: always clean and remove INVITE client request in nua_invite_client_ack() Ignore-this: bdace77be7b43629b591f5adf7315341 Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 10:50:43 2009 @@ -1 +1 @@ -Fri May 15 10:49:06 CDT 2009 +Fri May 15 10:49:56 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Fri May 15 10:50:43 2009 @@ -1250,9 +1250,7 @@ if (!ds->ds_leg) { /* XXX - fix nua_dialog_usage_remove_at() instead! */ - nua_client_request_clean(cr); - nua_client_request_remove(cr); - return -1; + goto error; } assert(ds->ds_leg); @@ -1260,7 +1258,7 @@ msg = nta_outgoing_getrequest(cr->cr_orq); sip = sip_object(msg); if (!msg) - return -1; + goto error; invite_branch = nta_outgoing_branch(cr->cr_orq); wa = sip_authorization(sip); @@ -1271,7 +1269,7 @@ msg = nta_msg_create(nh->nh_nua->nua_nta, 0); sip = sip_object(msg); if (!msg) - return -1; + goto error; cseq = sip_cseq_create(msg_home(msg), cr->cr_seq, SIP_METHOD_ACK); @@ -1386,6 +1384,7 @@ if (error == -1) msg_destroy(msg); + error: cr->cr_acked = 1; /* ... or we have at least tried */ nua_client_request_clean(cr); @@ -1617,7 +1616,6 @@ } else if (cri->cr_status < 300 && !cri->cr_acked) { nua_invite_client_ack(cri, NULL); - nua_client_request_clean(cri); } } if (nua_client_create(nh, nua_r_bye, &nua_bye_client_methods, NULL) != 0) @@ -3418,7 +3416,6 @@ next_state = nua_callstate_ready; else next_state = nua_callstate_terminating; - nua_client_request_clean(du->du_cr); } } From mikej at freeswitch.org Fri May 15 08:52:14 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 10:52:14 -0500 Subject: [Freeswitch-svn] [commit] r13325 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua Message-ID: Author: mikej Date: Fri May 15 10:52:14 2009 New Revision: 13325 Log: Tue May 12 11:57:49 CDT 2009 Pekka Pessi * nua_session.c: doublecheck invite client transaction Ignore-this: 4236b668c99e6e0d72a7889ce6cdf671 Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 10:52:14 2009 @@ -1 +1 @@ -Fri May 15 10:49:56 CDT 2009 +Fri May 15 10:51:24 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Fri May 15 10:52:14 2009 @@ -1885,8 +1885,8 @@ } if (acked && - du->du_cr->cr_method == sip_method_invite && - nua_client_is_queued(du->du_cr)) { + nua_client_is_queued(du->du_cr) && + du->du_cr->cr_method == sip_method_invite) { /* New INVITE was queued - do not send UPDATE */ } else if (ss->ss_update_needed && 200 <= status && status < 300 && From mikej at freeswitch.org Fri May 15 08:53:31 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 10:53:31 -0500 Subject: [Freeswitch-svn] [commit] r13326 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua Message-ID: Author: mikej Date: Fri May 15 10:53:31 2009 New Revision: 13326 Log: Tue May 12 13:00:40 CDT 2009 Pekka Pessi * nua_session.c: removed dead code from process_prack() Ignore-this: 325e40cbba4e6933aa1681d6862533f Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 10:53:31 2009 @@ -1 +1 @@ -Fri May 15 10:51:24 CDT 2009 +Fri May 15 10:53:11 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Fri May 15 10:53:31 2009 @@ -2776,9 +2776,9 @@ sip_t const *sip) { nua_handle_t *nh; - nua_dialog_usage_t *du; nta_reliable_destroy(rel); + if (irq == NULL) /* Final response interrupted 100rel, we did not actually receive PRACK */ return 200; @@ -2793,8 +2793,6 @@ if (nh->nh_ds->ds_leg == NULL) return 500; - du = nua_dialog_usage_for_session(nh->nh_ds); - if (sip == NULL) { /* 100rel timeout */ SR_STATUS(sr, 504, "Reliable Response Timeout"); From mikej at freeswitch.org Fri May 15 08:54:55 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 10:54:55 -0500 Subject: [Freeswitch-svn] [commit] r13327 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/tport Message-ID: Author: mikej Date: Fri May 15 10:54:54 2009 New Revision: 13327 Log: Tue May 12 13:04:33 CDT 2009 Pekka Pessi * tport_type_udp.c: tport_check_trunc() cleaned code Ignore-this: b39558360afb657325a4615d0919baaa Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 10:54:54 2009 @@ -1 +1 @@ -Fri May 15 10:53:11 CDT 2009 +Fri May 15 10:54:18 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_udp.c Fri May 15 10:54:54 2009 @@ -254,19 +254,15 @@ if (n != 4) return; - for (;;) { - n = su_recvfrom(tp->tp_socket, buffer, sizeof buffer, MSG_TRUNC, - (void *)&su, &sulen); - - if (n > (ssize_t)sizeof buffer) { - tp->tp_trunc = 1; - return; - } - - /* XXX - check that su and tp->tp_addrinfo->ai_addr match */ + n = su_recvfrom(tp->tp_socket, buffer, sizeof buffer, MSG_TRUNC, + (void *)&su, &sulen); + if (n > (ssize_t)sizeof buffer) { + tp->tp_trunc = 1; return; } + + /* XXX - check that su and tp->tp_addrinfo->ai_addr match */ #endif } From mikej at freeswitch.org Fri May 15 08:57:37 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 10:57:37 -0500 Subject: [Freeswitch-svn] [commit] r13328 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua Message-ID: Author: mikej Date: Fri May 15 10:57:37 2009 New Revision: 13328 Log: Tue May 12 13:07:45 CDT 2009 Pekka Pessi * nua_session.c: check dialog usage before using it in nua_update_server_respond() Ignore-this: 543e8d6d999a5a4d54600f1dbdfb1444 Coverity issue 7312. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 10:57:37 2009 @@ -1 +1 @@ -Fri May 15 10:54:18 CDT 2009 +Fri May 15 10:57:19 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Fri May 15 10:57:37 2009 @@ -3543,7 +3543,7 @@ } } - if (200 <= sr->sr_status && sr->sr_status < 300) { + if (ss && 200 <= sr->sr_status && sr->sr_status < 300) { session_timer_preferences(ss->ss_timer, sip, NH_PGET(nh, supported), @@ -3552,7 +3552,7 @@ NH_PGET(nh, refresher), NH_PGET(nh, min_se)); - if (ss && session_timer_is_supported(ss->ss_timer)) { + if (session_timer_is_supported(ss->ss_timer)) { nua_server_request_t *sr0; int uas; From mikej at freeswitch.org Fri May 15 08:59:02 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 10:59:02 -0500 Subject: [Freeswitch-svn] [commit] r13329 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua Message-ID: Author: mikej Date: Fri May 15 10:59:02 2009 New Revision: 13329 Log: Tue May 12 13:13:16 CDT 2009 Pekka Pessi * nua_client.c: removed extra NULL check from nua_client_request_complete() Ignore-this: cc1f1fb7bf8e4ae07f965846418410a Coverity issue 7310. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 10:59:02 2009 @@ -1 +1 @@ -Fri May 15 10:57:19 CDT 2009 +Fri May 15 10:58:24 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_client.c Fri May 15 10:59:02 2009 @@ -336,7 +336,8 @@ { if (cr->cr_orq) { nua_client_request_ref(cr); - if (cr && cr->cr_methods->crm_complete) + if (cr->cr_methods->crm_complete) + /* Calls nua_invite_client_complete() */ cr->cr_methods->crm_complete(cr); nua_client_request_clean(cr); if (nua_client_request_unref(cr)) From mikej at freeswitch.org Fri May 15 09:00:18 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:00:18 -0500 Subject: [Freeswitch-svn] [commit] r13330 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nta Message-ID: Author: mikej Date: Fri May 15 11:00:17 2009 New Revision: 13330 Log: Tue May 12 13:17:07 CDT 2009 Pekka Pessi * nta.c: check input in nta_leg_by_uri() Ignore-this: f149ac04b5e1bf078c3b00e837738301 Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:00:17 2009 @@ -1 +1 @@ -Fri May 15 10:58:24 CDT 2009 +Fri May 15 10:59:42 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c Fri May 15 11:00:17 2009 @@ -4899,7 +4899,7 @@ nta_leg_t *nta_leg_by_uri(nta_agent_t const *agent, url_string_t const *us) { url_t *url; - nta_leg_t *leg; + nta_leg_t *leg = NULL; if (!agent) return NULL; @@ -4909,11 +4909,11 @@ url = url_hdup(NULL, us->us_url); - agent_aliases(agent, url, NULL); - - leg = url ? dst_find(agent, url, NULL) : NULL; - - su_free(NULL, url); + if (url) { + agent_aliases(agent, url, NULL); + leg = dst_find(agent, url, NULL); + su_free(NULL, url); + } return leg; } From mikej at freeswitch.org Fri May 15 09:01:31 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:01:31 -0500 Subject: [Freeswitch-svn] [commit] r13331 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/tport Message-ID: Author: mikej Date: Fri May 15 11:01:31 2009 New Revision: 13331 Log: Tue May 12 13:23:33 CDT 2009 Pekka Pessi * tport.c: do not use out-of-scope array in tport_deliver() Ignore-this: a651d5eb213850d9dfd317102a432f8e Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:01:31 2009 @@ -1 +1 @@ -Fri May 15 10:59:42 CDT 2009 +Fri May 15 11:01:11 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport.c Fri May 15 11:01:31 2009 @@ -2952,6 +2952,7 @@ tport_t *ref; int error; struct tport_delivery *d; + char ipaddr[SU_ADDRSIZE + 2]; assert(msg); @@ -2962,7 +2963,6 @@ *d->d_from = *self->tp_name; if (tport_is_primary(self)) { - char ipaddr[SU_ADDRSIZE + 2]; su_sockaddr_t const *su = msg_addr(msg); #if SU_HAVE_IN6 @@ -3005,16 +3005,16 @@ ref = tport_incref(self); - if (self->tp_pri->pri_vtable->vtp_deliver) { self->tp_pri->pri_vtable->vtp_deliver(self, msg, now); } else tport_base_deliver(self, msg, now); - tport_decref(&ref); - + memset(d->d_from, 0, sizeof d->d_from); d->d_msg = NULL; + + tport_decref(&ref); } /** Pass message to the protocol stack */ From mikej at freeswitch.org Fri May 15 09:02:35 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:02:35 -0500 Subject: [Freeswitch-svn] [commit] r13332 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/soa Message-ID: Author: mikej Date: Fri May 15 11:02:34 2009 New Revision: 13332 Log: Tue May 12 14:57:48 CDT 2009 Pekka Pessi * soa_static.c: avoid overrun of arrays in soa_sdp_upgrade() Ignore-this: 9f7eae37e7d97c509a2797363b03c54a Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:02:34 2009 @@ -1 +1 @@ -Fri May 15 11:01:11 CDT 2009 +Fri May 15 11:02:00 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/soa_static.c Fri May 15 11:02:34 2009 @@ -716,7 +716,7 @@ { soa_static_session_t *sss = (soa_static_session_t *)ss; - int Ns, Nu, Nr, size, i, j; + int Ns, Nu, Nr, Nmax, n, i, j; sdp_media_t *m, **mm, *um; sdp_media_t **s_media, **o_media, **u_media; sdp_media_t const *rm, **r_media; @@ -730,13 +730,13 @@ Nr = sdp_media_count(remote, sdp_media_any, 0, 0, 0); if (remote == NULL) - size = Ns + Nu + 1; + Nmax = Ns + Nu; else if (Ns < Nr) - size = Nr + 1; + Nmax = Nr; else - size = Ns + 1; + Nmax = Ns; - s_media = su_zalloc(home, size * (sizeof *s_media)); + s_media = su_zalloc(home, (Nmax + 1) * (sizeof *s_media)); o_media = su_zalloc(home, (Ns + 1) * (sizeof *o_media)); u_media = su_zalloc(home, (Nu + 1) * (sizeof *u_media)); r_media = su_zalloc(home, (Nr + 1) * (sizeof *r_media)); @@ -748,17 +748,17 @@ return -1; u2s = su_alloc(home, (Nu + 1) * sizeof(*u2s)); - s2u = su_alloc(home, size * sizeof(*s2u)); + s2u = su_alloc(home, (Nmax + 1) * sizeof(*s2u)); if (!u2s || !s2u) return -1; for (i = 0; i < Nu; i++) u2s[i] = U2S_NOT_USED; - u2s[i] = U2S_SENTINEL; + u2s[Nu] = U2S_SENTINEL; - for (i = 0; i <= size; i++) + for (i = 0; i < Nmax; i++) s2u[i] = U2S_NOT_USED; - s2u[i] = U2S_SENTINEL; + s2u[Nmax] = U2S_SENTINEL; for (i = 0, m = session->sdp_media; m && i < Ns; m = m->m_next) o_media[i++] = m; @@ -778,6 +778,7 @@ continue; if (j >= Nu) /* lines removed from user SDP */ continue; + assert(i < Ns); s_media[i] = u_media[j], u_media[j] = SDP_MEDIA_NONE; u2s[j] = i, s2u[i] = j; } @@ -834,7 +835,7 @@ if (u_media[j] == SDP_MEDIA_NONE) continue; - for (i = 0; i < size - 1; i++) { + for (i = 0; i < Nmax; i++) { if (s_media[i] == NULL) { s_media[i] = u_media[j], u_media[j] = SDP_MEDIA_NONE; u2s[j] = i, s2u[i] = j; @@ -842,7 +843,7 @@ } } - assert(i != size - 1); + assert(i != Nmax); } } @@ -869,7 +870,7 @@ i++; } } - assert(i <= size); + assert(i <= Nmax); } mm = &session->sdp_media; @@ -878,7 +879,7 @@ } *mm = NULL; - s2u[size = i] = U2S_SENTINEL; + s2u[n = i] = U2S_SENTINEL; *return_u2s = u2s; *return_s2u = s2u; @@ -887,7 +888,7 @@ i = u2s[j]; assert(i == U2S_NOT_USED || s2u[i] == j); } - for (i = 0; i < size; i++) { + for (i = 0; i < n; i++) { j = s2u[i]; assert(j == U2S_NOT_USED || u2s[j] == i); } From mikej at freeswitch.org Fri May 15 09:03:08 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:03:08 -0500 Subject: [Freeswitch-svn] [commit] r13333 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/soa Message-ID: Author: mikej Date: Fri May 15 11:03:07 2009 New Revision: 13333 Log: Tue May 12 14:58:43 CDT 2009 Pekka Pessi * test_soa: check larger sessions Ignore-this: fac46a2328bc0db501cd98e7a67309c0 Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/test_soa.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:03:07 2009 @@ -1 +1 @@ -Fri May 15 11:02:00 CDT 2009 +Fri May 15 11:03:00 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/test_soa.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/test_soa.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/soa/test_soa.c Fri May 15 11:03:07 2009 @@ -1878,6 +1878,175 @@ } +int test_large_sessions(struct context *ctx) +{ + BEGIN(); + int n; + + soa_session_t *a, *b; + + char const *offer = NONE, *answer = NONE; + isize_t offerlen = (isize_t)-1, answerlen = (isize_t)-1; + + sdp_session_t const *a_sdp, *b_sdp; + sdp_media_t const *m; + + char const a_caps[] = + "v=0\r\n" + "o=a 432432423423 2 IN IP4 127.0.0.2\r\n" + "c=IN IP4 127.0.0.2\r\n" + "m=image 5556 UDPTL t38\r\n" + "m=audio 5004 RTP/AVP 0 8\n" + ; + + char const a_caps2[] = + "v=0\r\n" + "o=a 432432423423 2 IN IP4 127.0.0.2\r\n" + "c=IN IP4 127.0.0.2\r\n" + "m=image 5556 UDPTL t38\r\n" + "m=audio 5004 RTP/AVP 0\n" + "m=audio1 5006 RTP/AVP 8\n" + "m=audio2 5008 RTP/AVP 3\n" + "m=audio3 5010 RTP/AVP 9\n" + "m=audio4 5010 RTP/AVP 15\n" + ; + + char const b_caps[] = + "v=0\r\n" + "o=left 219498671 2 IN IP4 127.0.0.2\r\n" + "c=IN IP4 127.0.0.2\r\n" + "m=audio 5008 RTP/AVP 0 8\r\n" + ; + + char const b_caps2[] = + "v=0\r\n" + "o=left 219498671 2 IN IP4 127.0.0.2\r\n" + "c=IN IP4 127.0.0.2\r\n" + "m=audio 5008 RTP/AVP 0 8\r\n" + "m=image 5008 UDPTL t38\r\n" + "m=audio00 5008 RTP/AVP 0 8\r\n" + "m=audio01 5006 RTP/AVP 8\n" + "m=audio02 5008 RTP/AVP 3\n" + "m=audio03 5010 RTP/AVP 9\n" + "m=audio04 5010 RTP/AVP 15\n" + ; + + TEST_1(a = soa_create("static", ctx->root, ctx)); + TEST_1(b = soa_create("static", ctx->root, ctx)); + + TEST_1(soa_set_params(a, SOATAG_ORDERED_USER(1), + TAG_END()) > 0); + TEST_1(soa_set_params(b, SOATAG_ORDERED_USER(1), + TAG_END()) > 0); + + TEST(soa_set_user_sdp(a, 0, a_caps, strlen(a_caps)), 1); + TEST(soa_set_user_sdp(b, 0, b_caps, strlen(b_caps)), 1); + + n = soa_generate_offer(a, 1, test_completed); TEST(n, 0); + n = soa_get_local_sdp(a, NULL, &offer, &offerlen); TEST(n, 1); + TEST_1(offer != NULL && offer != NONE); + /* printf("offer1: %s\n", offer); */ + n = soa_set_remote_sdp(b, 0, offer, offerlen); TEST(n, 1); + n = soa_get_local_sdp(b, NULL, &answer, &answerlen); TEST(n, 0); + n = soa_generate_answer(b, test_completed); TEST(n, 0); + n = soa_get_local_sdp(b, &b_sdp, &answer, &answerlen); TEST(n, 1); + TEST_1(answer != NULL && answer != NONE); + /* printf("answer1: %s\n", answer); */ + n = soa_set_remote_sdp(a, 0, answer, -1); TEST(n, 1); + n = soa_process_answer(a, test_completed); TEST(n, 0); + + n = soa_get_local_sdp(a, &a_sdp, NULL, NULL); TEST(n, 1); + + TEST_1(soa_is_complete(b)); + TEST(soa_activate(b, NULL), 0); + + TEST_1(soa_is_complete(a)); + TEST(soa_activate(a, NULL), 0); + + TEST(soa_is_audio_active(a), SOA_ACTIVE_SENDRECV); + TEST(soa_is_remote_audio_active(a), SOA_ACTIVE_SENDRECV); + + TEST_1(a_sdp->sdp_media); + TEST_1(a_sdp->sdp_media->m_type == sdp_media_image); + TEST_1(a_sdp->sdp_media->m_next); + TEST_1(a_sdp->sdp_media->m_next->m_type == sdp_media_audio); + + /* ---------------------------------------------------------------------- */ + /* Re-O/A - activate image, add incompatible m= lines */ + + TEST_1(soa_set_params(b, SOATAG_RTP_MISMATCH(0), + SOATAG_USER_SDP_STR(b_caps2), + SOATAG_REUSE_REJECTED(1), + TAG_END()) > 0); + + n = soa_generate_offer(b, 1, test_completed); TEST(n, 0); + n = soa_get_local_sdp(b, &b_sdp, &offer, &offerlen); TEST(n, 1); + TEST_1(offer != NULL && offer != NONE); + n = soa_set_remote_sdp(a, 0, offer, offerlen); TEST(n, 1); + /* printf("offer2: %s\n", offer); */ + + n = soa_generate_answer(a, test_completed); TEST(n, 0); + n = soa_get_local_sdp(a, &a_sdp, &answer, &answerlen); TEST(n, 1); + TEST_1(answer != NULL && answer != NONE); + /* printf("answer2: %s\n", answer); */ + n = soa_set_remote_sdp(b, 0, answer, -1); TEST(n, 1); + n = soa_process_answer(b, test_completed); TEST(n, 0); + n = soa_get_local_sdp(b, &b_sdp, NULL, NULL); TEST(n, 1); + + TEST_1(soa_is_complete(a)); + TEST(soa_activate(a, NULL), 0); + + TEST_1(soa_is_complete(b)); + TEST(soa_activate(b, NULL), 0); + + TEST_1(m = a_sdp->sdp_media); + TEST(m->m_type, sdp_media_image); TEST(m->m_proto, sdp_proto_udptl); + TEST_1(m->m_format); TEST_S(m->m_format->l_text, "t38"); + + TEST_1(m = b_sdp->sdp_media); + TEST(m->m_type, sdp_media_image); TEST(m->m_proto, sdp_proto_udptl); + TEST_1(m->m_format); TEST_S(m->m_format->l_text, "t38"); + + TEST(soa_is_audio_active(a), SOA_ACTIVE_SENDRECV); + TEST(soa_is_remote_audio_active(a), SOA_ACTIVE_SENDRECV); + + /* 2nd re-offer */ + /* Add even more incompatible lines */ + TEST_1(soa_set_params(a, SOATAG_RTP_MISMATCH(0), + SOATAG_USER_SDP_STR(a_caps2), + TAG_END()) > 0); + + n = soa_generate_offer(a, 1, test_completed); TEST(n, 0); + n = soa_get_local_sdp(a, NULL, &offer, &offerlen); TEST(n, 1); + TEST_1(offer != NULL && offer != NONE); + /* printf("offer3: %s\n", offer); */ + n = soa_set_remote_sdp(b, 0, offer, offerlen); TEST(n, 1); + n = soa_get_local_sdp(b, NULL, &answer, &answerlen); TEST(n, 1); + n = soa_generate_answer(b, test_completed); TEST(n, 0); + n = soa_get_local_sdp(b, &b_sdp, &answer, &answerlen); TEST(n, 1); + TEST_1(answer != NULL && answer != NONE); + /* printf("answer3: %s\n", answer); */ + n = soa_set_remote_sdp(a, 0, answer, -1); TEST(n, 1); + n = soa_process_answer(a, test_completed); TEST(n, 0); + + n = soa_get_local_sdp(a, &a_sdp, NULL, NULL); TEST(n, 1); + + TEST_1(soa_is_complete(b)); + TEST(soa_activate(b, NULL), 0); + + TEST_1(soa_is_complete(a)); + TEST(soa_activate(a, NULL), 0); + + TEST_VOID(soa_terminate(a, NULL)); + TEST_VOID(soa_terminate(b, NULL)); + + TEST_VOID(soa_destroy(a)); + TEST_VOID(soa_destroy(b)); + + END(); +} + + int test_asynch_offer_answer(struct context *ctx) { BEGIN(); @@ -2536,7 +2705,7 @@ if (retval == 0) { retval |= test_address_selection(ctx); SINGLE_FAILURE_CHECK(); - + retval |= test_large_sessions(ctx); SINGLE_FAILURE_CHECK(); retval |= test_params(ctx); SINGLE_FAILURE_CHECK(); retval |= test_static_offer_answer(ctx); SINGLE_FAILURE_CHECK(); retval |= test_codec_selection(ctx); SINGLE_FAILURE_CHECK(); From mikej at freeswitch.org Fri May 15 09:03:45 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:03:45 -0500 Subject: [Freeswitch-svn] [commit] r13334 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua Message-ID: Author: mikej Date: Fri May 15 11:03:45 2009 New Revision: 13334 Log: Wed May 13 04:19:01 CDT 2009 Pekka Pessi * outbound.c: logging string after freeing it. Ignore-this: 78c744681a08302beaa01b3752bd5f43 Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:03:45 2009 @@ -1 +1 @@ -Fri May 15 11:03:00 CDT 2009 +Fri May 15 11:03:27 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c Fri May 15 11:03:45 2009 @@ -309,13 +309,12 @@ } invalid = s && s[0]; - su_free(NULL, options); - - if (invalid) { + if (invalid) SU_DEBUG_1(("outbound(%p): invalid options \"%s\"\n", (void *)ob->ob_owner, options)); + su_free(NULL, options); + if (invalid) return -1; - } if (prefs->natify && !(prefs->outbound || From mikej at freeswitch.org Fri May 15 09:04:28 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:04:28 -0500 Subject: [Freeswitch-svn] [commit] r13335 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/tport Message-ID: Author: mikej Date: Fri May 15 11:04:28 2009 New Revision: 13335 Log: Wed May 13 05:14:56 CDT 2009 Pekka Pessi * tport.c: better checking of IP6 addresses Ignore-this: 49f502ccaaf771abed1e5b2d00eaa8b8 Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:04:28 2009 @@ -1 +1 @@ -Fri May 15 11:03:27 CDT 2009 +Fri May 15 11:04:08 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport.c Fri May 15 11:04:28 2009 @@ -1593,7 +1593,7 @@ enum tport_via public, tagi_t *tags) { - char hostname[256]; + char hostname[TPORT_HOSTPORTSIZE]; char const *canon = NULL, *host, *service; int error = 0, not_supported, family = 0; tport_primary_t *pri = NULL, **tbf; @@ -1613,10 +1613,12 @@ host = NULL; } #ifdef SU_HAVE_IN6 - else if (tpn->tpn_host && tpn->tpn_host[0] == '[') { + else if (host_is_ip6_reference(tpn->tpn_host)) { /* Remove [] around IPv6 addresses. */ - host = strcpy(hostname, tpn->tpn_host + 1); - hostname[strlen(hostname) - 1] = '\0'; + size_t len = strlen(tpn->tpn_host); + assert(len < sizeof hostname); + host = memcpy(hostname, tpn->tpn_host + 1, len - 2); + hostname[len - 2] = '\0'; } #endif else @@ -3986,29 +3988,21 @@ hints->ai_socktype = self->tp_addrinfo->ai_socktype; hints->ai_protocol = self->tp_addrinfo->ai_protocol; -#if HAVE_OPEN_C - if (host_is_ip_address(tpn->tpn_host)) - hints->ai_flags |= AI_NUMERICHOST; -#endif - - if (tpn->tpn_host[0] == '[') { + if (host_is_ip6_reference(tpn->tpn_host)) { /* Remove [] around IPv6 address */ - char *end; + size_t len = strlen(tpn->tpn_host); + assert(len < sizeof ipaddr); + host = memcpy(ipaddr, tpn->tpn_host + 1, len - 2); + ipaddr[len - 2] = '\0'; hints->ai_flags |= AI_NUMERICHOST; - host = strncpy(ipaddr, tpn->tpn_host + 1, sizeof(ipaddr) - 1); - ipaddr[sizeof(ipaddr) - 1] = '\0'; - - if ((end = strchr(host, ']'))) { - *end = 0; - } - else { - SU_DEBUG_3(("tport_resolve: bad IPv6 address\n")); - msg_set_errno(msg, EINVAL); - return -1; - } } - else + else { +#if HAVE_OPEN_C + if (host_is_ip_address(tpn->tpn_host)) + hints->ai_flags |= AI_NUMERICHOST; +#endif host = tpn->tpn_host; + } if ((error = su_getaddrinfo(host, tpn->tpn_port, hints, &res))) { SU_DEBUG_3(("tport_resolve: getaddrinfo(\"%s\":%s): %s\n", From mikej at freeswitch.org Fri May 15 09:05:15 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:05:15 -0500 Subject: [Freeswitch-svn] [commit] r13336 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/msg Message-ID: Author: mikej Date: Fri May 15 11:05:15 2009 New Revision: 13336 Log: Wed May 13 10:50:41 CDT 2009 Pekka Pessi * msg: fixed possible leak in msg_params_d() with more than 16 params Ignore-this: a45ef326def7b1bcd14de4850f3c24ab Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser_util.c freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/test_msg.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:05:15 2009 @@ -1 +1 @@ -Fri May 15 11:04:08 CDT 2009 +Fri May 15 11:04:52 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser_util.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser_util.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser_util.c Fri May 15 11:05:15 2009 @@ -415,12 +415,14 @@ if (n == N) { /* Reallocate params */ - char **nparams = su_alloc(home, - (N = MSG_PARAMS_NUM(N + 1)) * sizeof(*params)); + char const **nparams = su_realloc(home, params != stack ? params : NULL, + (N = MSG_PARAMS_NUM(N + 1)) * sizeof(*params)); if (!nparams) { goto error; } - params = memcpy(nparams, params, n * sizeof(*params)); + if (params == stack) + memcpy(nparams, stack, n * sizeof(*params)); + params = nparams; } params[n++] = p; @@ -441,12 +443,14 @@ } else if (n == N) { /* Reallocate params */ - char **nparams = su_alloc(home, - (N = MSG_PARAMS_NUM(N + 1)) * sizeof(*params)); + char const **nparams = su_realloc(home, params != stack ? params : NULL, + (N = MSG_PARAMS_NUM(N + 1)) * sizeof(*params)); if (!nparams) { goto error; } - params = memcpy(nparams, params, n * sizeof(*params)); + if (params == stack) + memcpy(nparams, stack, n * sizeof(*params)); + params = nparams; } params[n] = NULL; Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/test_msg.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/test_msg.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/test_msg.c Fri May 15 11:05:15 2009 @@ -285,6 +285,24 @@ su_free(home, (void *)p), p = NULL; } + master = ";0"; + + for (i = 1; i < 256; i++) { + master = su_sprintf(home, "%s; %u", master, i); TEST_1(master); + list = end = su_strdup(home, master); + TEST_1(msg_params_d(NULL, &end, &p) >= 0); + TEST_S(end, ""); + TEST_1(p); + for (j = 0; j <= i; j++) { + char number[10]; + snprintf(number, sizeof number, "%u", j); + TEST_S(p[j], number); + } + TEST_1(p[i + 1] == NULL); + su_free(home, list); + su_free(NULL, (void *)p), p = NULL; + } + su_home_deinit(home); } @@ -722,6 +740,8 @@ TEST(msg_serialize(msg, (msg_pub_t *)tst), 0); } + msg_destroy(msg); + /* Bug #2429 */ orig = read_msg("GET a-life HTTP/1.1" CRLF "Foo: bar" CRLF @@ -734,6 +754,7 @@ TEST_1(otst); msg = msg_copy(orig); + msg_destroy(orig); tst = msg_test_public(msg); TEST_1(tst); From mikej at freeswitch.org Fri May 15 09:05:59 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:05:59 -0500 Subject: [Freeswitch-svn] [commit] r13337 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/iptsec Message-ID: Author: mikej Date: Fri May 15 11:05:59 2009 New Revision: 13337 Log: Wed May 13 11:00:40 CDT 2009 Pekka Pessi * auth_client.c: removed leak in auc_digest_authorization() Ignore-this: 9b0297083b6c6ce1bf9ef3d723b01f3b Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_client.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:05:59 2009 @@ -1 +1 @@ -Fri May 15 11:04:52 CDT 2009 +Fri May 15 11:05:48 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_client.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_client.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/iptsec/auth_client.c Fri May 15 11:05:59 2009 @@ -919,9 +919,9 @@ auth_challenge_t const *ac = cda->cda_ac; char const *cnonce = cda->cda_cnonce; unsigned nc = ++cda->cda_ncount; - char *uri = url_as_string(home, url); void const *data = body ? body->pl_data : ""; usize_t dlen = body ? body->pl_len : 0; + char *uri; msg_header_t *h; auth_hexmd5_t sessionkey, response; @@ -942,7 +942,10 @@ ar->ar_qop = NULL; ar->ar_auth = ac->ac_auth; ar->ar_auth_int = ac->ac_auth_int; - ar->ar_uri = uri; + ar->ar_uri = uri = url_as_string(home, url); + + if (ar->ar_uri == NULL) + return -1; /* If there is no qop, we MUST NOT include cnonce or nc */ if (!ar->ar_auth && !ar->ar_auth_int) From mikej at freeswitch.org Fri May 15 09:06:43 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:06:43 -0500 Subject: [Freeswitch-svn] [commit] r13338 - in freeswitch/trunk/libs/sofia-sip: . utils Message-ID: Author: mikej Date: Fri May 15 11:06:43 2009 New Revision: 13338 Log: Wed May 13 11:07:04 CDT 2009 Pekka Pessi * sip-dig.c: fixed buffer overrun Ignore-this: d8776bd28ef951602449e87d80dc20e7 Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/utils/sip-dig.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:06:43 2009 @@ -1 +1 @@ -Fri May 15 11:05:48 CDT 2009 +Fri May 15 11:06:28 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/utils/sip-dig.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/utils/sip-dig.c (original) +++ freeswitch/trunk/libs/sofia-sip/utils/sip-dig.c Fri May 15 11:06:43 2009 @@ -52,7 +52,6 @@ * The @e sip-dig utility accepts following command line options: *
*
-p protoname
- *
Use named transport protocol. The protoname can be either * well-known, e.g., "udp", or it can specify NAPTR service and SRV * identifier, e.g., "tls-udp/SIPS+D2U/_sips._udp.". @@ -160,7 +159,7 @@ unsigned preference, ip4, ip6, sips, print; - struct transport tports[N_TPORT]; + struct transport tports[N_TPORT + 1]; }; int dig_naptr(struct dig *dig, char const *host, double weight); @@ -370,7 +369,7 @@ struct transport *tports = dig->tports; int j; - for (j = 0; j < N_TPORT - 1; j++) { + for (j = 0; j < N_TPORT; j++) { if (!tports[j].name) break; if (su_casematch(tports[j].name, tport)) From mikej at freeswitch.org Fri May 15 09:07:05 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:07:05 -0500 Subject: [Freeswitch-svn] [commit] r13339 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/sip Message-ID: Author: mikej Date: Fri May 15 11:07:05 2009 New Revision: 13339 Log: Wed May 13 11:09:06 CDT 2009 Pekka Pessi * sip_parser.c: fixed overrrun in sip_method_name() Ignore-this: efe0fc0935451b1b0ee403befac5df40 Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:07:05 2009 @@ -1 +1 @@ -Fri May 15 11:06:28 CDT 2009 +Fri May 15 11:06:55 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sip/sip_parser.c Fri May 15 11:07:05 2009 @@ -335,7 +335,7 @@ char const *sip_method_name(sip_method_t method, char const *name) { const size_t N = sizeof(sip_method_names)/sizeof(sip_method_names[0]); - if (method > 0 && (size_t)method <= N) + if (method > 0 && (size_t)method < N) return sip_method_names[method]; else if (method == 0) return name; From mikej at freeswitch.org Fri May 15 09:07:59 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:07:59 -0500 Subject: [Freeswitch-svn] [commit] r13340 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/msg Message-ID: Author: mikej Date: Fri May 15 11:07:59 2009 New Revision: 13340 Log: Wed May 13 11:18:27 CDT 2009 Pekka Pessi * msg_header_copy.c: unobfuscated msg_default_dup_one() Ignore-this: 1fda1941baecad1f6397de453e606f1c Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_header_copy.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:07:59 2009 @@ -1 +1 @@ -Fri May 15 11:06:55 CDT 2009 +Fri May 15 11:07:28 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_header_copy.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_header_copy.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_header_copy.c Fri May 15 11:07:59 2009 @@ -346,9 +346,9 @@ char *b, isize_t xtra) { - memcpy(&h->sh_header_next[1], - &src->sh_header_next[1], - h->sh_class->hc_size - offsetof(msg_header_t, sh_header_next[1])); + size_t skip = offsetof(msg_numeric_t, x_value); /* Skip common part */ + + memcpy((char *)h + skip, (char const *)src + skip, h->sh_class->hc_size - skip); return b; } From mikej at freeswitch.org Fri May 15 09:09:12 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:09:12 -0500 Subject: [Freeswitch-svn] [commit] r13341 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/msg Message-ID: Author: mikej Date: Fri May 15 11:09:12 2009 New Revision: 13341 Log: Wed May 13 11:37:19 CDT 2009 Pekka Pessi * msg: unobfuscated casts of msg_header_t Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_auth.c freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_basic.c freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_generic.c freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:09:12 2009 @@ -1 +1 @@ -Fri May 15 11:07:28 CDT 2009 +Fri May 15 11:08:48 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_auth.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_auth.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_auth.c Fri May 15 11:09:12 2009 @@ -130,7 +130,7 @@ */ isize_t msg_auth_dup_xtra(msg_header_t const *h, isize_t offset) { - msg_auth_t const *au = h->sh_auth; + msg_auth_t const *au = (msg_auth_t *)h; MSG_PARAMS_SIZE(offset, au->au_params); offset += MSG_STRING_SIZE(au->au_scheme); @@ -144,8 +144,8 @@ char *b, isize_t xtra) { - msg_auth_t *au = dst->sh_auth; - msg_auth_t const *o = src->sh_auth; + msg_auth_t *au = (msg_auth_t *)dst; + msg_auth_t const *o = (msg_auth_t const *)src; char *end = b + xtra; b = msg_params_dup(&au->au_params, o->au_params, b, xtra); Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_basic.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_basic.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_basic.c Fri May 15 11:09:12 2009 @@ -235,8 +235,10 @@ /** Parse payload. */ issize_t msg_payload_d(su_home_t *home, msg_header_t *h, char *s, isize_t slen) { - h->sh_payload->pl_len = slen; - h->sh_payload->pl_data = s; + msg_payload_t *pl = (msg_payload_t *)h; + + pl->pl_len = slen; + pl->pl_data = s; h->sh_len = slen; h->sh_data = s; @@ -246,11 +248,14 @@ issize_t msg_payload_e(char b[], isize_t bsiz, msg_header_t const *h, int flags) { - size_t len = h->sh_payload->pl_len; + msg_payload_t *pl = (msg_payload_t *)h; + size_t len = pl->pl_len; if (bsiz > 0) { - memcpy(b, h->sh_payload->pl_data, bsiz > len ? len : bsiz); - b[bsiz > len ? len : bsiz - 1] = '\0'; + if (len < bsiz) + memcpy(b, pl->pl_data, len), b[len] = '\0'; + else + memcpy(b, pl->pl_data, bsiz - 1), b[bsiz - 1] = '\0'; } return len; @@ -258,7 +263,8 @@ isize_t msg_payload_dup_xtra(msg_header_t const *h, isize_t offset) { - return offset + h->sh_payload->pl_len + 1; + msg_payload_t *pl = (msg_payload_t *)h; + return offset + pl->pl_len + 1; } char *msg_payload_dup_one(msg_header_t *dst, @@ -266,13 +272,13 @@ char *b, isize_t xtra) { - msg_payload_t *pl = dst->sh_payload; - msg_payload_t const *o = src->sh_payload; + msg_payload_t *pl = (msg_payload_t *)dst; + msg_payload_t const *o = (msg_payload_t const *)src; memcpy(pl->pl_data = b, o->pl_data, pl->pl_len = o->pl_len); - pl->pl_common->h_data = pl->pl_data; - pl->pl_common->h_len = pl->pl_len; + dst->sh_data = pl->pl_data; + dst->sh_len = pl->pl_len; pl->pl_data[pl->pl_len] = 0; /* NUL terminate just in case */ @@ -322,12 +328,13 @@ issize_t msg_separator_d(su_home_t *home, msg_header_t *h, char *s, isize_t slen) { int len = CRLF_TEST(s); + msg_separator_t *sep = (msg_separator_t *)h; if (len == 0 && slen > 0) return -1; - memcpy(h->sh_separator->sep_data, s, len); - h->sh_separator->sep_data[len] = '\0'; + memcpy(sep->sep_data, s, len); + sep->sep_data[len] = '\0'; return 0; } @@ -335,19 +342,20 @@ /** Encode a separator line. */ issize_t msg_separator_e(char b[], isize_t bsiz, msg_header_t const *h, int flags) { - size_t n = strlen(h->sh_separator->sep_data); + msg_separator_t const *sep = (msg_separator_t const *)h; + size_t n = strlen(sep->sep_data); if (bsiz > n) - strcpy(b, h->sh_separator->sep_data); + strcpy(b, sep->sep_data); return (issize_t)n; } msg_separator_t *msg_separator_create(su_home_t *home) { - msg_separator_t *sep = - msg_header_alloc(home, msg_separator_class, 0)->sh_separator; + msg_separator_t *sep; + sep = (msg_separator_t *)msg_header_alloc(home, msg_separator_class, 0); if (sep) strcpy(sep->sep_data, CRLF); Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_generic.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_generic.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_generic.c Fri May 15 11:09:12 2009 @@ -68,7 +68,8 @@ char *s, isize_t slen) { - h->sh_generic->g_string = s; + msg_generic_t *g = (msg_generic_t *)h; + g->g_string = s; return 0; } @@ -80,7 +81,7 @@ */ issize_t msg_generic_e(char b[], isize_t bsiz, msg_header_t const *h, int flags) { - msg_generic_t const *g = h->sh_generic; + msg_generic_t const *g = (msg_generic_t const *)h; size_t n = strlen(g->g_string); if (bsiz > n) @@ -92,7 +93,7 @@ /** Calculate the size of strings associated with a @c msg_generic_t object. */ isize_t msg_generic_dup_xtra(msg_header_t const *h, isize_t offset) { - msg_generic_t const *g = h->sh_generic; + msg_generic_t const *g = (msg_generic_t const *)h; return offset + MSG_STRING_SIZE(g->g_string); } @@ -102,8 +103,10 @@ char *b, isize_t xtra) { + msg_generic_t *g = (msg_generic_t *)dst; + msg_generic_t const *o = (msg_generic_t const *)src; char *end = b + xtra; - MSG_STRING_DUP(b, dst->sh_generic->g_string, src->sh_generic->g_string); + MSG_STRING_DUP(b, g->g_string, o->g_string); assert(b <= end); (void)end; return b; } @@ -117,7 +120,7 @@ uint32_t value = 0; issize_t retval = msg_uint32_d(&s, &value); - assert(x->x_common->h_class->hc_size >= sizeof *x); + assert(h->sh_class->hc_size >= sizeof *x); x->x_value = value; @@ -150,15 +153,17 @@ issize_t msg_list_d(su_home_t *home, msg_header_t *h, char *s, isize_t slen) { - return msg_commalist_d(home, &s, &h->sh_list->k_items, NULL); + msg_list_t *k = (msg_list_t *)h; + return msg_commalist_d(home, &s, &k->k_items, NULL); } issize_t msg_list_e(char b[], isize_t bsiz, msg_header_t const *h, int flags) { + msg_list_t *k = (msg_list_t *)h; int compact = MSG_IS_COMPACT(flags); char *b0 = b, *end = b + bsiz; - MSG_COMMALIST_E(b, end, h->sh_list->k_items, compact); + MSG_COMMALIST_E(b, end, k->k_items, compact); MSG_TERM_E(b, end); return b - b0; @@ -176,7 +181,8 @@ */ isize_t msg_list_dup_xtra(msg_header_t const *h, isize_t offset) { - MSG_PARAMS_SIZE(offset, h->sh_list->k_items); + msg_list_t const *k = (msg_list_t const *)h; + MSG_PARAMS_SIZE(offset, k->k_items); return offset; } @@ -185,10 +191,12 @@ char *b, isize_t xtra) { + msg_list_t *k = (msg_list_t *)dst; + msg_list_t const *o = (msg_list_t const *)src; char *end = b + xtra; - msg_param_t const ** items = (msg_param_t const **)&dst->sh_list->k_items; + msg_param_t const ** items = (msg_param_t const **)&k->k_items; - b = msg_params_dup(items, src->sh_list->k_items, b, xtra); + b = msg_params_dup(items, o->k_items, b, xtra); assert(b <= end); (void)end; Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser.c Fri May 15 11:09:12 2009 @@ -1003,7 +1003,7 @@ /** Extract a header. */ issize_t msg_extract_header(msg_t *msg, msg_pub_t *mo, - char b[], isize_t bsiz, int eos) + char b[], isize_t bsiz, int eos) { return extract_header(msg, mo, b, bsiz, eos, 0); } @@ -1143,6 +1143,7 @@ /* XXX - This should be done by msg_header_free_all() */ msg_header_t *h_next; msg_param_t *h_params; + msg_error_t *er; while (h) { h_next = h->sh_next; @@ -1157,10 +1158,12 @@ /* XXX - This should be done by msg_header_free_all() */ hr = msg->m_class->mc_error; h = msg_header_alloc(home, hr->hr_class, 0); - if (!h) - return h; + er = (msg_error_t *)h; - h->sh_error->er_name = hc->hc_name; + if (!er) + return NULL; + + er->er_name = hc->hc_name; hh = (msg_header_t **)((char *)mo + hr->hr_offset); } } From mikej at freeswitch.org Fri May 15 09:09:49 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:09:49 -0500 Subject: [Freeswitch-svn] [commit] r13342 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/sdp Message-ID: Author: mikej Date: Fri May 15 11:09:49 2009 New Revision: 13342 Log: Wed May 13 12:03:01 CDT 2009 Pekka Pessi * sdp_print(): correctly handle NULL session Ignore-this: 206a9027d6dfb73371d7f0ddac5f640b Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:09:49 2009 @@ -1 +1 @@ -Fri May 15 11:08:48 CDT 2009 +Fri May 15 11:09:32 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c Fri May 15 11:09:49 2009 @@ -154,7 +154,10 @@ p->pr_mode_manual = (flags & sdp_f_mode_manual) != 0; p->pr_mode_always = (flags & sdp_f_mode_always) != 0; - print_session(p, session); + if (sdp) + print_session(p, session); + else + printing_error(p, "NULL session description"); return p; } @@ -267,8 +270,6 @@ { p->pr_ok = 1; - if (!sdp) - printing_error(p, "NULL session description"); if (p->pr_ok && sdp->sdp_version) print_version(p, sdp->sdp_version); if (p->pr_ok && sdp->sdp_origin) From mikej at freeswitch.org Fri May 15 09:10:38 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:10:38 -0500 Subject: [Freeswitch-svn] [commit] r13343 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua Message-ID: Author: mikej Date: Fri May 15 11:10:38 2009 New Revision: 13343 Log: Wed May 13 12:04:15 CDT 2009 Pekka Pessi * nua_update_server_report(): fix bugs checking pending INVITEs in fake precondition handling Ignore-this: dc67f6287bf48aa8e2a39e2ece96821 Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:10:38 2009 @@ -1 +1 @@ -Fri May 15 11:09:32 CDT 2009 +Fri May 15 11:10:31 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Fri May 15 11:10:38 2009 @@ -3622,7 +3622,7 @@ && NH_PGET(nh, auto_alert)) { nua_server_request_t *sri; - for (sri = nh->nh_ds->ds_sr; sri; sri = sr->sr_next) + for (sri = nh->nh_ds->ds_sr; sri; sri = sri->sr_next) if (sri->sr_method == sip_method_invite && nua_server_request_is_pending(sri)) break; From mikej at freeswitch.org Fri May 15 09:11:57 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:11:57 -0500 Subject: [Freeswitch-svn] [commit] r13344 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua Message-ID: Author: mikej Date: Fri May 15 11:11:57 2009 New Revision: 13344 Log: Wed May 13 12:14:18 CDT 2009 Pekka Pessi * nua_event_server.c: free temp strings Ignore-this: 18b592f7d6ae942a48cd117f7a6f3c31 Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_event_server.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:11:57 2009 @@ -1 +1 @@ -Fri May 15 11:10:31 CDT 2009 +Fri May 15 11:11:24 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_event_server.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_event_server.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_event_server.c Fri May 15 11:11:57 2009 @@ -144,9 +144,13 @@ char const *ct_s = NULL; if (ev == NULL) { - char *o_type = su_strdup(home, event->o_type); - char *o_subtype = o_type ? strchr(o_type, '.') : NULL; + char *o_type, *o_subtype; + char *temp = NULL; + o_type = su_strdup(home, event->o_type); + if (o_type == NULL) + return NULL; + o_subtype = strchr(o_type, '.'); if (o_subtype) *o_subtype++ = '\0'; @@ -162,7 +166,7 @@ * types */ if (accept_s == NULL && accept) - accept_s = sip_header_as_string(home, (sip_header_t *)accept); + accept_s = temp = sip_header_as_string(home, (sip_header_t *)accept); if (accept_s == NULL && ct) accept_s = ct->c_type; if (accept_s == NULL && ct_s) @@ -173,6 +177,9 @@ o_type, o_subtype, ct ? ct->c_type : ct_s, accept_s); + + su_free(home, temp); + su_free(home, o_type); } return ev; From mikej at freeswitch.org Fri May 15 09:12:41 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:12:41 -0500 Subject: [Freeswitch-svn] [commit] r13345 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nta Message-ID: Author: mikej Date: Fri May 15 11:12:41 2009 New Revision: 13345 Log: Wed May 13 12:35:38 CDT 2009 Pekka Pessi * nta_incoming_create_response(): sanitized oom check Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:12:41 2009 @@ -1 +1 @@ -Fri May 15 11:11:24 CDT 2009 +Fri May 15 11:12:29 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c Fri May 15 11:12:41 2009 @@ -6386,11 +6386,13 @@ msg = nta_msg_create(irq->irq_agent, 0); sip = sip_object(msg); - if (sip && status != 0) - sip->sip_status = sip_status_create(msg_home(msg), status, phrase, NULL); + if (sip) { + if (status != 0) + sip->sip_status = sip_status_create(msg_home(msg), status, phrase, NULL); - if (nta_incoming_response_headers(irq, msg, sip) < 0) - msg_destroy(msg), msg = NULL; + if (nta_incoming_response_headers(irq, msg, sip) < 0) + msg_destroy(msg), msg = NULL; + } } return msg; From mikej at freeswitch.org Fri May 15 09:13:21 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:13:21 -0500 Subject: [Freeswitch-svn] [commit] r13346 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/msg Message-ID: Author: mikej Date: Fri May 15 11:13:20 2009 New Revision: 13346 Log: Wed May 13 13:02:06 CDT 2009 Pekka Pessi * msg_parser_util.c: fixed msg_unquoted_e() Ignore-this: 78b9afb6e97ff730d7924d860ef33921 Now accepts NULL buffer with nonzero size. Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser_util.c freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/test_msg.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:13:20 2009 @@ -1 +1 @@ -Fri May 15 11:12:29 CDT 2009 +Fri May 15 11:13:02 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser_util.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser_util.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_parser_util.c Fri May 15 11:13:20 2009 @@ -1741,35 +1741,37 @@ /** Quote string */ issize_t msg_unquoted_e(char *b, isize_t bsiz, char const *s) { - char *begin = b; - char *end = b + bsiz; + isize_t e = 0; - if (b && b + 1 < end) + if (b == NULL) + bsiz = 0; + + if (0 < bsiz) *b = '"'; - b++; + e++; for (;*s;) { size_t n = strcspn(s, "\"\\"); if (n == 0) { - if (b && b + 2 < end) - b[0] = '\\', b[1] = s[0]; - b += 2; + if (e + 2 <= bsiz) + b[e] = '\\', b[e + 1] = s[0]; + e += 2; s++; } else { - if (b && b + n < end) - memcpy(b, s, n); - b += n; + if (e + n <= bsiz) + memcpy(b + e, s, n); + e += n; s += n; } } - if (b && b + 1 < end) - *b = '"'; - b++; + if (e < bsiz) + b[e] = '"'; + e++; - return b - begin; + return e; } Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/test_msg.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/test_msg.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/test_msg.c Fri May 15 11:13:20 2009 @@ -496,6 +496,22 @@ su_home_deinit(home); } + { + char b[8]; + TEST(msg_unquoted_e(NULL, 0, "\"\""), 6); + TEST(msg_unquoted_e(b, 0, "\"\""), 6); + TEST(msg_unquoted_e(b, 4, "\"\""), 6); + TEST(msg_unquoted_e(b, 6, "\"\""), 6); + TEST(memcmp(b, "\"\\\"\\\"\"", 6), 0); + TEST(msg_unquoted_e(b, 4, "\""), 4); + memset(b, 0, sizeof b); + TEST(msg_unquoted_e(b, 1, "\"kuik"), 8); + TEST(memcmp(b, "\"\0", 2), 0); + TEST(msg_unquoted_e(b, 3, "\"kuik"), 8); + TEST(memcmp(b, "\"\\\"\0", 4), 0); + TEST(msg_unquoted_e(b, 7, "\"kuik"), 8); + TEST(memcmp(b, "\"\\\"kuik\0", 8), 0); + } END(); } From mikej at freeswitch.org Fri May 15 09:14:01 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:14:01 -0500 Subject: [Freeswitch-svn] [commit] r13347 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nea Message-ID: Author: mikej Date: Fri May 15 11:14:01 2009 New Revision: 13347 Log: Wed May 13 13:07:25 CDT 2009 Pekka Pessi * nea_server.c: check params in nea_event_tcreate() Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea_server.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:14:01 2009 @@ -1 +1 @@ -Fri May 15 11:13:02 CDT 2009 +Fri May 15 11:13:34 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea_server.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea_server.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nea/nea_server.c Fri May 15 11:14:01 2009 @@ -1222,6 +1222,9 @@ size_t len = strlen(name); ta_list ta; + if (nes == NULL || callback == NULL || name == NULL) + return NULL; + /* Find a matching event */ if (subname == NULL) { for (pev = &nes->nes_events; (ev = *pev); pev = &(*pev)->ev_next) { From mikej at freeswitch.org Fri May 15 09:14:33 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:14:33 -0500 Subject: [Freeswitch-svn] [commit] r13348 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/sresolv Message-ID: Author: mikej Date: Fri May 15 11:14:33 2009 New Revision: 13348 Log: Wed May 13 13:08:11 CDT 2009 Pekka Pessi * sres_resolver_new_with_cache_va(): added missing va_end() Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:14:33 2009 @@ -1 +1 @@ -Fri May 15 11:13:34 CDT 2009 +Fri May 15 11:14:26 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c Fri May 15 11:14:33 2009 @@ -707,6 +707,8 @@ if (olist != oarray) free(olist); + va_end(va0); + return res; } From mikej at freeswitch.org Fri May 15 09:15:28 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:15:28 -0500 Subject: [Freeswitch-svn] [commit] r13349 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/msg Message-ID: Author: mikej Date: Fri May 15 11:15:28 2009 New Revision: 13349 Log: Wed May 13 13:18:14 CDT 2009 Pekka Pessi * msg_mclass_insert_header(): not using uninit data Ignore-this: 40a6993391b5f2993af8ee01c407c0c7 Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_mclass.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:15:28 2009 @@ -1 +1 @@ -Fri May 15 11:14:26 CDT 2009 +Fri May 15 11:14:57 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_mclass.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_mclass.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/msg_mclass.c Fri May 15 11:15:28 2009 @@ -164,25 +164,7 @@ msg_hclass_t *hc, unsigned short offset) { - msg_href_t hr[1]; - - if (mc == NULL || hc == NULL) { - errno = EINVAL; - return -1; - } - - if (msg_hclass_offset(mc, NULL, hc)) - return (void)(errno = EEXIST), -1; - - if (offset == 0) - offset = mc->mc_msize, mc->mc_msize += sizeof(msg_header_t *); - - assert(offset < mc->mc_msize); - - hr->hr_class = hc; - hr->hr_offset = offset; - - return msg_mclass_insert(mc, hr); + return msg_mclass_insert_with_mask(mc, hc, offset, 0); } /**Add a new header to the message class. From mikej at freeswitch.org Fri May 15 09:15:59 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:15:59 -0500 Subject: [Freeswitch-svn] [commit] r13350 - in freeswitch/trunk/libs/sofia-sip: . utils Message-ID: Author: mikej Date: Fri May 15 11:15:58 2009 New Revision: 13350 Log: Wed May 13 13:20:54 CDT 2009 Pekka Pessi * sip-dig.c: fixed crash on bad param Ignore-this: 9e73dd7095a51d15e5bc6f00e8aab98c Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/utils/sip-dig.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:15:58 2009 @@ -1 +1 @@ -Fri May 15 11:14:57 CDT 2009 +Fri May 15 11:15:49 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/utils/sip-dig.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/utils/sip-dig.c (original) +++ freeswitch/trunk/libs/sofia-sip/utils/sip-dig.c Fri May 15 11:15:58 2009 @@ -303,7 +303,7 @@ if (uri && uri->url_type == url_unknown) url_sanitize(uri); - if (uri->url_type == url_any) + if (uri && uri->url_type == url_any) continue; if (!uri || (uri->url_type != url_sip && uri->url_type != url_sips)) { From mikej at freeswitch.org Fri May 15 09:16:36 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:16:36 -0500 Subject: [Freeswitch-svn] [commit] r13351 - in freeswitch/trunk/libs/sofia-sip: . utils Message-ID: Author: mikej Date: Fri May 15 11:16:35 2009 New Revision: 13351 Log: Wed May 13 13:21:12 CDT 2009 Pekka Pessi * sip-date.c: not using uninit data. Ignore-this: 48751cc510886e42e23e48c535a869bc Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/utils/sip-date.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:16:35 2009 @@ -1 +1 @@ -Fri May 15 11:15:49 CDT 2009 +Fri May 15 11:16:18 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/utils/sip-date.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/utils/sip-date.c (original) +++ freeswitch/trunk/libs/sofia-sip/utils/sip-date.c Fri May 15 11:16:35 2009 @@ -99,7 +99,7 @@ int main(int ac, char *av[]) { int numeric = 0; - sip_time_t t, t2; + sip_time_t t = 0, t2 = 0; char const *s; char buf[1024]; @@ -132,8 +132,6 @@ } else { for (; *s; ) { - t2 = 0; - if (msg_delta_d(&s, &t2) < 0) usage(); From mikej at freeswitch.org Fri May 15 09:17:09 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:17:09 -0500 Subject: [Freeswitch-svn] [commit] r13352 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/sresolv Message-ID: Author: mikej Date: Fri May 15 11:17:09 2009 New Revision: 13352 Log: Wed May 13 13:33:21 CDT 2009 Pekka Pessi * sres.c: use unsigned lenghts with m_get_string() and m_get_domain() Ignore-this: 7b09dd7d26a10dabb645156563c0cd6c Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:17:09 2009 @@ -1 +1 @@ -Fri May 15 11:16:18 CDT 2009 +Fri May 15 11:17:02 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c Fri May 15 11:17:09 2009 @@ -543,8 +543,8 @@ static uint16_t m_get_uint16(sres_message_t *m); static uint8_t m_get_uint8(sres_message_t *m); -static int m_get_string(char *d, int n, sres_message_t *m, uint16_t offset); -static int m_get_domain(char *d, int n, sres_message_t *m, uint16_t offset); +static unsigned m_get_string(char *d, unsigned n, sres_message_t *m, uint16_t offset); +static unsigned m_get_domain(char *d, unsigned n, sres_message_t *m, uint16_t offset); /* ---------------------------------------------------------------------- */ @@ -3673,7 +3673,7 @@ uint16_t m_size; char name[1025]; - int len; + unsigned len; char btype[8], bclass[8]; sr = memset(sr0, 0, sizeof sr0); @@ -3686,7 +3686,10 @@ sr->sr_parsed = 1; if (m->m_error) goto error; - + if (len >= (sizeof name)) { + m->m_error = "too long domain name in record"; + goto error; + } name[len] = 0; SU_DEBUG_9(("%s RR received %s %s %s %d rdlen=%d\n", @@ -3766,7 +3769,7 @@ sres_message_t *m) { uint16_t moffset, roffset; - int mnamelen, rnamelen; + unsigned mnamelen, rnamelen; soa->soa_record->r_size = sizeof *soa; @@ -3818,8 +3821,8 @@ sres_message_t *m) { - int suffixlen = 0, i; - int prefixlen = 0; + unsigned suffixlen = 0, i; + unsigned prefixlen = 0; uint16_t offset; a6->a6_record->r_size = sizeof *a6; @@ -3876,7 +3879,7 @@ sres_message_t *m) { uint16_t offset; - int dlen; + unsigned dlen; cn->cn_record->r_size = sizeof *cn; @@ -3898,7 +3901,7 @@ sres_message_t *m) { uint16_t offset; - int dlen; + unsigned dlen; ptr->ptr_record->r_size = sizeof *ptr; @@ -3920,7 +3923,7 @@ sres_message_t *m) { uint16_t offset; - int dlen; + unsigned dlen; srv->srv_record->r_size = sizeof *srv; @@ -3944,7 +3947,7 @@ sres_message_t *m) { uint16_t offset[4]; - int len[4]; + unsigned len[4]; na->na_record->r_size = sizeof *na; @@ -4186,10 +4189,11 @@ /** * Get a string. */ -static int m_get_string(char *d, - int n, - sres_message_t *m, - uint16_t offset) +static unsigned +m_get_string(char *d, + unsigned n, + sres_message_t *m, + uint16_t offset) { uint8_t size; uint8_t *p = m->m_data; @@ -4231,13 +4235,14 @@ * * @param offset start uncompression from this point in message */ -static int m_get_domain(char *d, - int n, - sres_message_t *m, - uint16_t offset) +static unsigned +m_get_domain(char *d, + unsigned n, + sres_message_t *m, + uint16_t offset) { uint8_t cnt; - int i = 0; + unsigned i = 0; uint8_t *p = m->m_data; uint16_t new_offset; int save_offset; From mikej at freeswitch.org Fri May 15 09:18:11 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:18:11 -0500 Subject: [Freeswitch-svn] [commit] r13353 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua Message-ID: Author: mikej Date: Fri May 15 11:18:10 2009 New Revision: 13353 Log: Wed May 13 13:39:29 CDT 2009 Pekka Pessi * nua_stack_ack(), nua_invite_client_ack(): cleaned code Ignore-this: 9edf1594e20f27f4e2effb43c83858ea Fixed clean-up after ACK. Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:18:10 2009 @@ -1 +1 @@ -Fri May 15 11:17:02 CDT 2009 +Fri May 15 11:17:32 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Fri May 15 11:18:10 2009 @@ -1190,11 +1190,8 @@ return 1; } - if (tags) { + if (tags) nua_stack_set_params(nua, nh, nua_i_error, tags); - if (nh->nh_soa) - soa_set_params(nh->nh_soa, TAG_NEXT(tags)); - } nua_client_request_ref(cr); error = nua_invite_client_ack(cr, tags); @@ -1387,8 +1384,8 @@ error: cr->cr_acked = 1; /* ... or we have at least tried */ - nua_client_request_clean(cr); nua_client_request_remove(cr); + nua_client_request_clean(cr); return error; } From mikej at freeswitch.org Fri May 15 09:19:19 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:19:19 -0500 Subject: [Freeswitch-svn] [commit] r13354 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nta Message-ID: Author: mikej Date: Fri May 15 11:19:19 2009 New Revision: 13354 Log: Thu May 14 13:05:43 CDT 2009 Pekka Pessi * nta: clarify outgoing_ack() logic Ignore-this: a745b3e7df63835d9768ec9dc3d5c5b2 Coverity issue. Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Fri May 15 11:19:19 2009 @@ -1 +1 @@ -Fri May 15 11:17:32 CDT 2009 +Fri May 15 11:18:36 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nta/nta.c Fri May 15 11:19:19 2009 @@ -9353,7 +9353,6 @@ */ void outgoing_ack(nta_outgoing_t *orq, sip_t *sip) { - nta_outgoing_t *ack; msg_t *ackmsg; assert(orq); @@ -9367,18 +9366,16 @@ assert(orq->orq_tport); ackmsg = outgoing_ackmsg(orq, SIP_METHOD_ACK, SIPTAG_TO(sip->sip_to), TAG_END()); + if (!ackmsg) + return; - if (ackmsg) { - if ((ack = outgoing_create(orq->orq_agent, NULL, NULL, - NULL, orq->orq_tpn, ackmsg, - NTATAG_BRANCH_KEY(sip->sip_via->v_branch), - NTATAG_USER_VIA(1), - NTATAG_STATELESS(1), - TAG_END()))) - ; - else - msg_destroy(ackmsg); - } + if (!outgoing_create(orq->orq_agent, NULL, NULL, + NULL, orq->orq_tpn, ackmsg, + NTATAG_BRANCH_KEY(sip->sip_via->v_branch), + NTATAG_USER_VIA(1), + NTATAG_STATELESS(1), + TAG_END())) + msg_destroy(ackmsg); } /** Generate messages for hop-by-hop ACK or CANCEL. From mikej at freeswitch.org Fri May 15 09:27:26 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 11:27:26 -0500 Subject: [Freeswitch-svn] [commit] r13355 - freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp Message-ID: Author: mikej Date: Fri May 15 11:27:26 2009 New Revision: 13355 Log: fix typos Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c Fri May 15 11:27:26 2009 @@ -87,6 +87,8 @@ sizeof(printer_memory_error.pr_buffer) }; +static void printing_error(sdp_printer_t *p, const char *fmt, ...); + static void print_session(sdp_printer_t *p, sdp_session_t const *session); /** Print a SDP description. @@ -154,7 +156,7 @@ p->pr_mode_manual = (flags & sdp_f_mode_manual) != 0; p->pr_mode_always = (flags & sdp_f_mode_always) != 0; - if (sdp) + if (session) print_session(p, session); else printing_error(p, "NULL session description"); @@ -264,7 +266,6 @@ const char *, sdp_list_t const *l); static void sdp_printf(sdp_printer_t *p, const char *fmt, ...); -static void printing_error(sdp_printer_t *p, const char *fmt, ...); static void print_session(sdp_printer_t *p, sdp_session_t const *sdp) { From mikej at freeswitch.org Fri May 15 10:04:54 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 12:04:54 -0500 Subject: [Freeswitch-svn] [commit] r13356 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: mikej Date: Fri May 15 12:04:53 2009 New Revision: 13356 Log: the price you pay for TLS it seems 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 May 15 12:04:53 2009 @@ -770,6 +770,7 @@ TAG_IF(sofia_test_pflag(profile, PFLAG_TLS), NUTAG_CERTIFICATE_DIR(profile->tls_cert_dir)), TAG_IF(sofia_test_pflag(profile, PFLAG_TLS), TPTAG_TLS_VERIFY_POLICY(0)), TAG_IF(sofia_test_pflag(profile, PFLAG_TLS), TPTAG_TLS_VERSION(profile->tls_version)), + TAG_IF(sofia_test_pflag(profile, PFLAG_TLS), TPTAG_KEEPALIVE(20000)), TAG_IF(!strchr(profile->sipip, ':'), NTATAG_UDP_MTU(65535)), TAG_IF(sofia_test_pflag(profile, PFLAG_DISABLE_SRV), NTATAG_USE_SRV(0)), TAG_IF(sofia_test_pflag(profile, PFLAG_DISABLE_NAPTR), NTATAG_USE_NAPTR(0)), From mikej at freeswitch.org Fri May 15 10:07:07 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 12:07:07 -0500 Subject: [Freeswitch-svn] [commit] r13357 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: mikej Date: Fri May 15 12:07:07 2009 New Revision: 13357 Log: MODENDP-219 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 May 15 12:07:07 2009 @@ -557,6 +557,7 @@ TAG_IF(sticky, NUTAG_PROXY(tech_pvt->record_route)), NUTAG_SESSION_TIMER(session_timeout), SIPTAG_CONTACT_STR(tech_pvt->reply_contact), + SIPTAG_CALL_INFO_STR(switch_channel_get_variable(tech_pvt->channel, SOFIA_SIP_HEADER_PREFIX "call_info")), SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), SOATAG_REUSE_REJECTED(1), SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1), TAG_END()); sofia_set_flag_locked(tech_pvt, TFLAG_ANS); @@ -2994,6 +2995,7 @@ const char *from_uri = switch_event_get_header(event, "from-uri"); const char *call_info = switch_event_get_header(event, "call-info"); const char *alert_info = switch_event_get_header(event, "alert-info"); + const char *call_id = switch_event_get_header(event, "call-id"); const char *body = switch_event_get_body(event); sofia_profile_t *profile = NULL; nua_handle_t *nh; @@ -3007,12 +3009,12 @@ goto done; } - if (!to_uri && !local_user_full) { + if (!call_id && !to_uri && !local_user_full) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing To-URI header\n"); goto done; } - if (!from_uri) { + if (!call_id && !from_uri) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing From-URI header\n"); goto done; } @@ -3023,37 +3025,47 @@ goto done; } + if (call_id) { + nh = nua_handle_by_call_id(profile->nua, call_id); - if (local_user_full) { - local_dup = strdup(local_user_full); - local_user = local_dup; - if ((local_host = strchr(local_user, '@'))) { - *local_host++ = '\0'; - } - - if (!local_user || !local_host || !sofia_reg_find_reg_url(profile, local_user, local_host, buf, sizeof(buf))) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't find local user\n"); + if (!nh) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Call-ID %s\n", call_id); goto done; } + } - to_uri = sofia_glue_get_url_from_contact(buf, 0); - - if ((p = strstr(to_uri, ";fs_"))) { - *p = '\0'; - } + else { + if (local_user_full) { + local_dup = strdup(local_user_full); + local_user = local_dup; + if ((local_host = strchr(local_user, '@'))) { + *local_host++ = '\0'; + } - } + if (!local_user || !local_host || !sofia_reg_find_reg_url(profile, local_user, local_host, buf, sizeof(buf))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't find local user\n"); + goto done; + } + to_uri = sofia_glue_get_url_from_contact(buf, 0); + + if ((p = strstr(to_uri, ";fs_"))) { + *p = '\0'; + } - nh = nua_handle(profile->nua, - NULL, - NUTAG_URL(to_uri), - SIPTAG_FROM_STR(from_uri), - SIPTAG_TO_STR(to_uri), - SIPTAG_CONTACT_STR(profile->url), - TAG_END()); - - nua_handle_bind(nh, &mod_sofia_globals.destroy_private); + } + + + nh = nua_handle(profile->nua, + NULL, + NUTAG_URL(to_uri), + SIPTAG_FROM_STR(from_uri), + SIPTAG_TO_STR(to_uri), + SIPTAG_CONTACT_STR(profile->url), + TAG_END()); + + nua_handle_bind(nh, &mod_sofia_globals.destroy_private); + } nua_info(nh, NUTAG_WITH_THIS(profile->nua), @@ -3063,6 +3075,9 @@ TAG_IF(!switch_strlen_zero(body), SIPTAG_PAYLOAD_STR(body)), TAG_END()); + if (call_id && nh) { + nua_handle_unref(nh); + } if (profile) { sofia_glue_release_profile(profile); From mikej at freeswitch.org Fri May 15 10:44:47 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 12:44:47 -0500 Subject: [Freeswitch-svn] [commit] r13358 - freeswitch/trunk/src Message-ID: Author: mikej Date: Fri May 15 12:44:47 2009 New Revision: 13358 Log: ensure vasprintf is available on linux (FSBUILD-160) Modified: freeswitch/trunk/src/switch_apr.c Modified: freeswitch/trunk/src/switch_apr.c ============================================================================== --- freeswitch/trunk/src/switch_apr.c (original) +++ freeswitch/trunk/src/switch_apr.c Fri May 15 12:44:47 2009 @@ -30,6 +30,10 @@ * */ +#ifdef __linux__ +#define _GNU_SOURCE +#endif + #include #ifndef WIN32 #include From mikej at freeswitch.org Fri May 15 10:50:37 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 12:50:37 -0500 Subject: [Freeswitch-svn] [commit] r13359 - freeswitch/trunk/src Message-ID: Author: mikej Date: Fri May 15 12:50:37 2009 New Revision: 13359 Log: setgroup/initgroup availability on linux (FSBUILD-160) 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 Fri May 15 12:50:37 2009 @@ -33,6 +33,11 @@ * */ + +#ifdef __linux__ +#define _BSD_SOURCE +#endif + #include #include #include "private/switch_core_pvt.h" @@ -44,6 +49,7 @@ #endif #include + SWITCH_DECLARE_DATA switch_directories SWITCH_GLOBAL_dirs = { 0 }; /* The main runtime obj we keep this hidden for ourselves */ From mikej at freeswitch.org Fri May 15 10:55:53 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 12:55:53 -0500 Subject: [Freeswitch-svn] [commit] r13360 - freeswitch/trunk/src Message-ID: Author: mikej Date: Fri May 15 12:55:53 2009 New Revision: 13360 Log: use uint16_t instead of u_short (FSBUILD-160) 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 Fri May 15 12:55:53 2009 @@ -1981,7 +1981,7 @@ switch_set_flag(frame, SFF_RFC2833); } frame->timestamp = ntohl(rtp_session->recv_msg.header.ts); - frame->seq = (uint16_t) ntohs((u_short) rtp_session->recv_msg.header.seq); + frame->seq = (uint16_t) ntohs((uint16_t) rtp_session->recv_msg.header.seq); frame->ssrc = ntohl(rtp_session->recv_msg.header.ssrc); frame->m = rtp_session->recv_msg.header.m ? SWITCH_TRUE : SWITCH_FALSE; From mikej at freeswitch.org Fri May 15 11:10:59 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 13:10:59 -0500 Subject: [Freeswitch-svn] [commit] r13361 - freeswitch/trunk/src Message-ID: Author: mikej Date: Fri May 15 13:10:59 2009 New Revision: 13361 Log: ensure vasprintf is available on linux (FSBUILD-160) Modified: freeswitch/trunk/src/switch_apr.c Modified: freeswitch/trunk/src/switch_apr.c ============================================================================== --- freeswitch/trunk/src/switch_apr.c (original) +++ freeswitch/trunk/src/switch_apr.c Fri May 15 13:10:59 2009 @@ -31,8 +31,10 @@ */ #ifdef __linux__ +#ifndef _GNU_SOURCE #define _GNU_SOURCE #endif +#endif #include #ifndef WIN32 From mikej at freeswitch.org Fri May 15 11:19:30 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 13:19:30 -0500 Subject: [Freeswitch-svn] [commit] r13362 - in freeswitch/trunk: . src Message-ID: Author: mikej Date: Fri May 15 13:19:30 2009 New Revision: 13362 Log: add configure checks for tm->tm_gmtoff and tm->tm_zone (FSBUILD-160) Modified: freeswitch/trunk/configure.in freeswitch/trunk/src/switch_time.c Modified: freeswitch/trunk/configure.in ============================================================================== --- freeswitch/trunk/configure.in (original) +++ freeswitch/trunk/configure.in Fri May 15 13:19:30 2009 @@ -337,6 +337,14 @@ AC_CHECK_LIB(rt, clock_nanosleep, [AC_DEFINE(HAVE_CLOCK_NANOSLEEP, 1, [Define if you have clock_nanosleep()])]) AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket)) +AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct tm.__tm_gmtoff],,,[ +#include +#include ]) + +AC_CHECK_MEMBERS([struct tm.tm_zone, struct tm.__tm_zone],,,[ +#include +#include ]) + AC_CHECK_DECL([RLIMIT_MEMLOCK], [AC_DEFINE([HAVE_RLIMIT_MEMLOCK],[1],[RLIMIT_MEMLOCK constant for setrlimit])],, [#ifdef HAVE_SYS_RESOURCE_H Modified: freeswitch/trunk/src/switch_time.c ============================================================================== --- freeswitch/trunk/src/switch_time.c (original) +++ freeswitch/trunk/src/switch_time.c Fri May 15 13:19:30 2009 @@ -586,8 +586,8 @@ xt->tm_wday = tm->tm_wday; xt->tm_yday = tm->tm_yday; xt->tm_isdst = tm->tm_isdst; -#if !defined(WIN32) && !defined(__SVR4) && !defined(__sun) +#if defined(HAVE_STRUCT_TM_TM_GMTOFF) xt->tm_gmtoff = tm->tm_gmtoff; #endif @@ -1635,7 +1635,7 @@ tmp->tm_mday = (int) (days + 1); tmp->tm_isdst = 0; -#if !defined(WIN32) && !defined(__SVR4) && !defined(__sun) +#if defined(HAVE_STRUCT_TM_TM_GMTOFF) tmp->tm_gmtoff = offset; #endif } @@ -1691,7 +1691,7 @@ { timesub( &t, ttisp->tt_gmtoff, sp, tmp); tmp->tm_isdst = ttisp->tt_isdst; -#if !defined(WIN32) && !defined(__SVR4) && !defined(__sun) +#if defined(HAVE_STRUCT_TM_TM_ZONE) tmp->tm_zone = &sp->chars[ttisp->tt_abbrind]; #endif } From mikej at freeswitch.org Fri May 15 12:36:43 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 14:36:43 -0500 Subject: [Freeswitch-svn] [commit] r13363 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: mikej Date: Fri May 15 14:36:43 2009 New Revision: 13363 Log: Allow to send the flush/reboot all the registration of a domain (MODENDP-187) Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c 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 Fri May 15 14:36:43 2009 @@ -484,23 +484,33 @@ void sofia_reg_expire_call_id(sofia_profile_t *profile, const char *call_id, int reboot) { char sql[1024]; + char sqlextra[1024] = ""; char *psql = sql; - char *user = strdup(call_id); - char *host = NULL; + char *dup = strdup(call_id); + char *host = NULL, *user = NULL; - switch_assert(user); + switch_assert(dup); - if ((host = strchr(user, '@'))) { + if ((host = strchr(dup, '@'))) { *host++ = '\0'; + user = dup; + } else { + host = dup; } - + if (!host) { host = "none"; } + if (switch_strlen_zero(user)) { + switch_snprintf(sqlextra, sizeof(sqlextra), " or (sip_host='%s')", host); + } else { + switch_snprintf(sqlextra, sizeof(sqlextra), " or (sip_user='%s' and sip_host='%s')", user, host); + } + switch_snprintf(sql, sizeof(sql), "select call_id,sip_user,sip_host,contact,status,rpid,expires,user_agent,server_user,server_host,profile_name" - ",%d from sip_registrations where call_id='%s' or (sip_user='%s' and sip_host='%s')", - reboot, call_id, user, host); + ",%d from sip_registrations where call_id='%s' %s", + reboot, call_id, sqlextra); switch_mutex_lock(profile->ireg_mutex); sofia_glue_execute_sql_callback(profile, SWITCH_TRUE, NULL, sql, sofia_reg_del_callback, profile); @@ -510,7 +520,7 @@ call_id, user, host); sofia_glue_execute_sql(profile, &psql, SWITCH_FALSE); - switch_safe_free(user); + switch_safe_free(dup); } From mikej at freeswitch.org Fri May 15 12:40:23 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 14:40:23 -0500 Subject: [Freeswitch-svn] [commit] r13364 - freeswitch/trunk/w32/Library Message-ID: Author: mikej Date: Fri May 15 14:40:23 2009 New Revision: 13364 Log: remove broken code analysis test Modified: freeswitch/trunk/w32/Library/FreeSwitchCore.2008.vcproj Modified: freeswitch/trunk/w32/Library/FreeSwitchCore.2008.vcproj ============================================================================== --- freeswitch/trunk/w32/Library/FreeSwitchCore.2008.vcproj (original) +++ freeswitch/trunk/w32/Library/FreeSwitchCore.2008.vcproj Fri May 15 14:40:23 2009 @@ -30,7 +30,7 @@ > Author: intralanman Date: Fri May 15 15:03:17 2009 New Revision: 13365 Log: MODAPP-279 Modified: freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c Modified: freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c (original) +++ freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c Fri May 15 15:03:17 2009 @@ -230,17 +230,26 @@ char *cid = NULL; orig_destination_number = destination_number = switch_core_strdup(pool, dialed_number); - + tstrip = ((cur_route->digit_len - cur_route->tstrip) + 1); lstrip = cur_route->lstrip; - if (strlen(destination_number) > tstrip && cur_route->tstrip > 0) { - destination_number[tstrip] = '\0'; - } - if (strlen(destination_number) > lstrip && cur_route->lstrip > 0) { - destination_number += lstrip; - } - + if (cur_route->tstrip > 0) { + if (strlen(destination_number) > tstrip) { + destination_number[tstrip] = '\0'; + } + else { + destination_number[0] = '\0'; + } + } + if (cur_route->lstrip > 0) { + if (strlen(destination_number) > lstrip) { + destination_number += lstrip; + } + else { + destination_number[0] = '\0'; + } + } codec = ""; if (!switch_strlen_zero(cur_route->codec)) { codec = switch_core_sprintf(pool, ",absolute_codec_string=%s", cur_route->codec); From mikej at freeswitch.org Fri May 15 14:07:18 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 16:07:18 -0500 Subject: [Freeswitch-svn] [commit] r13366 - in freeswitch/trunk: src src/include w32/Library Message-ID: Author: mikej Date: Fri May 15 16:07:18 2009 New Revision: 13366 Log: cleanup msvc code analysis warnings Modified: freeswitch/trunk/src/include/switch_xml.h freeswitch/trunk/src/switch_utils.c freeswitch/trunk/src/switch_xml.c freeswitch/trunk/w32/Library/FreeSwitchCore.2008.vcproj Modified: freeswitch/trunk/src/include/switch_xml.h ============================================================================== --- freeswitch/trunk/src/include/switch_xml.h (original) +++ freeswitch/trunk/src/include/switch_xml.h Fri May 15 16:07:18 2009 @@ -240,7 +240,7 @@ ///\brief returns a new empty switch_xml structure with the given root tag name ///\param name the name of the new root tag -SWITCH_DECLARE(switch_xml_t) switch_xml_new(_In_z_ const char *name); +SWITCH_DECLARE(switch_xml_t) switch_xml_new(_In_opt_z_ const char *name); ///\brief wrapper for switch_xml_new() that strdup()s name ///\param name the name of the root Modified: freeswitch/trunk/src/switch_utils.c ============================================================================== --- freeswitch/trunk/src/switch_utils.c (original) +++ freeswitch/trunk/src/switch_utils.c Fri May 15 16:07:18 2009 @@ -83,6 +83,8 @@ switch_frame_t *new_frame; new_frame = malloc(sizeof(*new_frame)); + + switch_assert(new_frame); *new_frame = *orig; switch_set_flag(new_frame, SFF_DYNAMIC); Modified: freeswitch/trunk/src/switch_xml.c ============================================================================== --- freeswitch/trunk/src/switch_xml.c (original) +++ freeswitch/trunk/src/switch_xml.c Fri May 15 16:07:18 2009 @@ -391,17 +391,17 @@ if (!xml || !xml->attr) return NULL; - while (xml->attr[i] && strcmp(attr, xml->attr[i])) + while (xml->attr[i] && attr && strcmp(attr, xml->attr[i])) i += 2; if (xml->attr[i]) return xml->attr[i + 1]; /* found attribute */ while (root->xml.parent) root = (switch_xml_root_t) root->xml.parent; /* root tag */ - for (i = 0; root->attr[i] && strcmp(xml->name, root->attr[i][0]); i++); + for (i = 0; root->attr[i] && xml->name && strcmp(xml->name, root->attr[i][0]); i++); if (!root->attr[i]) return NULL; /* no matching default attributes */ - while (root->attr[i][j] && strcmp(attr, root->attr[i][j])) + while (root->attr[i][j] && attr && strcmp(attr, root->attr[i][j])) j += 3; return (root->attr[i][j]) ? root->attr[i][j + 1] : NULL; /* found default */ } @@ -2140,6 +2140,7 @@ char *r, *s; switch_mutex_lock(XML_GEN_LOCK); s = (char *)malloc(SWITCH_XML_BUFSIZE); + switch_assert(s); r = switch_xml_toxml_buf(xml, s, SWITCH_XML_BUFSIZE, 0, prn_header); switch_mutex_unlock(XML_GEN_LOCK); return r; @@ -2251,6 +2252,9 @@ /*switch_xml_free(xml->ordered);*/ if (!xml->parent) { /* free root tag allocations */ +#if (_MSC_VER >= 1400) // VC8+ + __analysis_assume(sizeof(root->ent) > 44); /* tail recursion confuses code analysis */ +#endif for (i = 10; root->ent[i]; i += 2) /* 0 - 9 are default entities (<>&"') */ if ((s = root->ent[i + 1]) < root->s || s > root->e) free(s); Modified: freeswitch/trunk/w32/Library/FreeSwitchCore.2008.vcproj ============================================================================== --- freeswitch/trunk/w32/Library/FreeSwitchCore.2008.vcproj (original) +++ freeswitch/trunk/w32/Library/FreeSwitchCore.2008.vcproj Fri May 15 16:07:18 2009 @@ -713,6 +713,22 @@ + + + + + + Author: mikej Date: Fri May 15 16:10:48 2009 New Revision: 13367 Log: Add mod_file_string to build + misc cleaning and correction (FSBUILD-158) Modified: freeswitch/trunk/Freeswitch.2008.sln freeswitch/trunk/libs/esl/fs_cli.2008.vcproj freeswitch/trunk/src/mod/asr_tts/mod_flite/mod_flite.2008.vcproj freeswitch/trunk/src/mod/formats/mod_file_string/mod_file_string.2008.vcproj Modified: freeswitch/trunk/Freeswitch.2008.sln ============================================================================== --- freeswitch/trunk/Freeswitch.2008.sln (original) +++ freeswitch/trunk/Freeswitch.2008.sln Fri May 15 16:10:48 2009 @@ -1013,6 +1013,8 @@ {1F0A8A77-E661-418F-BB92-82172AE43803} = {1F0A8A77-E661-418F-BB92-82172AE43803} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_file_string", "src\mod\formats\mod_file_string\mod_file_string.2008.vcproj", "{70564D74-199A-4452-9C60-19ED5F242F0D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution All|Win32 = All|Win32 @@ -2458,6 +2460,17 @@ {EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959}.Debug|x64.ActiveCfg = Debug|Win32 {EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959}.Release|Win32.ActiveCfg = Release|Win32 {EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959}.Release|x64.ActiveCfg = Release|Win32 + {70564D74-199A-4452-9C60-19ED5F242F0D}.All|Win32.ActiveCfg = Release|x64 + {70564D74-199A-4452-9C60-19ED5F242F0D}.All|x64.ActiveCfg = Release|x64 + {70564D74-199A-4452-9C60-19ED5F242F0D}.All|x64.Build.0 = Release|x64 + {70564D74-199A-4452-9C60-19ED5F242F0D}.Debug|Win32.ActiveCfg = Debug|Win32 + {70564D74-199A-4452-9C60-19ED5F242F0D}.Debug|Win32.Build.0 = Debug|Win32 + {70564D74-199A-4452-9C60-19ED5F242F0D}.Debug|x64.ActiveCfg = Debug|x64 + {70564D74-199A-4452-9C60-19ED5F242F0D}.Debug|x64.Build.0 = Debug|x64 + {70564D74-199A-4452-9C60-19ED5F242F0D}.Release|Win32.ActiveCfg = Release|Win32 + {70564D74-199A-4452-9C60-19ED5F242F0D}.Release|Win32.Build.0 = Release|Win32 + {70564D74-199A-4452-9C60-19ED5F242F0D}.Release|x64.ActiveCfg = Release|x64 + {70564D74-199A-4452-9C60-19ED5F242F0D}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2507,6 +2520,7 @@ {2CA40887-1622-46A1-A7F9-17FD7E7E545B} = {A5A27244-AD24-46E5-B01B-840CD296C91D} {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52} = {A5A27244-AD24-46E5-B01B-840CD296C91D} {38FE0559-9910-43A8-9E45-3E5004C27692} = {A5A27244-AD24-46E5-B01B-840CD296C91D} + {70564D74-199A-4452-9C60-19ED5F242F0D} = {A5A27244-AD24-46E5-B01B-840CD296C91D} {1A1FF289-4FD6-4285-A422-D31DD67A4723} = {CBD81696-EFB4-4D2F-8451-1B8DAA86155A} {EC3E5C7F-EE09-47E2-80FE-546363D14A98} = {B8F5B47B-8568-46EB-B320-64C17D2A98BC} {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {0C808854-54D1-4230-BFF5-77B5FD905000} Modified: freeswitch/trunk/libs/esl/fs_cli.2008.vcproj ============================================================================== --- freeswitch/trunk/libs/esl/fs_cli.2008.vcproj (original) +++ freeswitch/trunk/libs/esl/fs_cli.2008.vcproj Fri May 15 16:10:48 2009 @@ -103,7 +103,7 @@ @@ -124,10 +123,9 @@ /> Author: mikej Date: Fri May 15 16:15:49 2009 New Revision: 13368 Log: build: add new files to debian package build (FSBUILD-148) Modified: freeswitch/trunk/debian/freeswitch-dev.install freeswitch/trunk/debian/freeswitch.conffiles freeswitch/trunk/debian/freeswitch.install Modified: freeswitch/trunk/debian/freeswitch-dev.install ============================================================================== --- freeswitch/trunk/debian/freeswitch-dev.install (original) +++ freeswitch/trunk/debian/freeswitch-dev.install Fri May 15 16:15:49 2009 @@ -1,5 +1,6 @@ opt/freeswitch/lib/*.a opt/freeswitch/lib/*.la +opt/freeswitch/lib/pkgconfig/spandsp.pc opt/freeswitch/mod/*.a opt/freeswitch/mod/*.la -opt/freeswitch/include/*.h +opt/freeswitch/include/* Modified: freeswitch/trunk/debian/freeswitch.conffiles ============================================================================== --- freeswitch/trunk/debian/freeswitch.conffiles (original) +++ freeswitch/trunk/debian/freeswitch.conffiles Fri May 15 16:15:49 2009 @@ -6,15 +6,22 @@ /opt/freeswitch/conf/voicemail.tpl /opt/freeswitch/conf/freeswitch.xml /opt/freeswitch/conf/extensions.conf +/opt/freeswitch/conf/zt.conf +/opt/freeswitch/conf/tones.conf +/opt/freeswitch/conf/pika.conf +/opt/freeswitch/conf/notify-voicemail.tpl +/opt/freeswitch/conf/m3ua.conf /opt/freeswitch/conf/dialplan/public.xml /opt/freeswitch/conf/dialplan/default.xml /opt/freeswitch/conf/dialplan/features.xml /opt/freeswitch/conf/dialplan/default/00_pizza_demo.xml +/opt/freeswitch/conf/dialplan/default/01_example.com.xml /opt/freeswitch/conf/dialplan/default/99999_enum.xml /opt/freeswitch/conf/dialplan/public/00_inbound_did.xml /opt/freeswitch/conf/sip_profiles/external.xml /opt/freeswitch/conf/sip_profiles/internal/example.xml /opt/freeswitch/conf/sip_profiles/internal.xml +/opt/freeswitch/conf/sip_profiles/internal-ipv6.xml /opt/freeswitch/conf/sip_profiles/external/example.xml /opt/freeswitch/conf/directory/default/1007.xml /opt/freeswitch/conf/directory/default/1001.xml @@ -38,9 +45,10 @@ /opt/freeswitch/conf/directory/default/1006.xml /opt/freeswitch/conf/directory/default/1016.xml /opt/freeswitch/conf/directory/default/1012.xml +/opt/freeswitch/conf/directory/default/example.com.xml /opt/freeswitch/conf/directory/default.xml /opt/freeswitch/conf/autoload_configs/ivr.conf.xml -opt/freeswitch/conf/autoload_configs/shout.conf.xml +/opt/freeswitch/conf/autoload_configs/shout.conf.xml /opt/freeswitch/conf/autoload_configs/voicemail.conf.xml /opt/freeswitch/conf/autoload_configs/switch.conf.xml /opt/freeswitch/conf/autoload_configs/syslog.conf.xml @@ -70,5 +78,12 @@ /opt/freeswitch/conf/autoload_configs/console.conf.xml /opt/freeswitch/conf/autoload_configs/timezones.conf.xml /opt/freeswitch/conf/autoload_configs/fax.conf.xml +/opt/freeswitch/conf/autoload_configs/acl.conf.xml +/opt/freeswitch/conf/autoload_configs/lcr.conf.xml +/opt/freeswitch/conf/autoload_configs/opal.conf.xml +/opt/freeswitch/conf/autoload_configs/easyroute.conf.xml +/opt/freeswitch/conf/autoload_configs/memcache.conf.xml +/opt/freeswitch/conf/autoload_configs/unicall.conf.xml +/opt/freeswitch/conf/autoload_configs/python.conf.xml /opt/freeswitch/conf/jingle_profiles/server.xml /opt/freeswitch/conf/jingle_profiles/client.xml Modified: freeswitch/trunk/debian/freeswitch.install ============================================================================== --- freeswitch/trunk/debian/freeswitch.install (original) +++ freeswitch/trunk/debian/freeswitch.install Fri May 15 16:15:49 2009 @@ -1,6 +1,9 @@ opt/freeswitch/htdocs/* opt/freeswitch/bin/freeswitch opt/freeswitch/bin/fs_cli +opt/freeswitch/bin/gentls_cert +opt/freeswitch/bin/fsxs +opt/freeswitch/bin/fs_ivrd opt/freeswitch/bin/scripts/* opt/freeswitch/lib/libfreeswitch*.so* opt/freeswitch/lib/libopenzap*.so* @@ -25,7 +28,7 @@ opt/freeswitch/mod/mod_enum.so* opt/freeswitch/mod/mod_fifo.so* opt/freeswitch/mod/mod_voipcodecs.so* -opt/freeswutch/mod/mod_speex.so* +opt/freeswitch/mod/mod_speex.so* opt/freeswitch/mod/mod_dialplan*.so* opt/freeswitch/mod/mod_dingaling.so* opt/freeswitch/mod/mod_iax.so* @@ -35,7 +38,8 @@ 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_skel.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* @@ -54,15 +58,22 @@ opt/freeswitch/conf/fur_elise.ttml opt/freeswitch/conf/openzap.conf opt/freeswitch/conf/wanpipe.conf +opt/freeswitch/conf/zt.conf +opt/freeswitch/conf/tones.conf +opt/freeswitch/conf/pika.conf +opt/freeswitch/conf/notify-voicemail.tpl +opt/freeswitch/conf/m3ua.conf opt/freeswitch/conf/dialplan/public.xml opt/freeswitch/conf/dialplan/default.xml opt/freeswitch/conf/dialplan/features.xml opt/freeswitch/conf/dialplan/default/00_pizza_demo.xml +opt/freeswitch/conf/dialplan/default/01_example.com.xml opt/freeswitch/conf/dialplan/default/99999_enum.xml opt/freeswitch/conf/dialplan/public/00_inbound_did.xml opt/freeswitch/conf/sip_profiles/external.xml opt/freeswitch/conf/sip_profiles/internal/example.xml opt/freeswitch/conf/sip_profiles/internal.xml +opt/freeswitch/conf/sip_profiles/internal-ipv6.xml opt/freeswitch/conf/sip_profiles/external/example.xml opt/freeswitch/conf/directory/default/1007.xml opt/freeswitch/conf/directory/default/1001.xml @@ -86,6 +97,7 @@ opt/freeswitch/conf/directory/default/1006.xml opt/freeswitch/conf/directory/default/1016.xml opt/freeswitch/conf/directory/default/1012.xml +opt/freeswitch/conf/directory/default/example.com.xml opt/freeswitch/conf/directory/default.xml opt/freeswitch/conf/voicemail.tpl opt/freeswitch/conf/freeswitch.xml @@ -123,5 +135,12 @@ opt/freeswitch/conf/autoload_configs/timezones.conf.xml opt/freeswitch/conf/autoload_configs/fax.conf.xml opt/freeswitch/conf/autoload_configs/fifo.conf.xml +opt/freeswitch/conf/autoload_configs/acl.conf.xml +opt/freeswitch/conf/autoload_configs/lcr.conf.xml +opt/freeswitch/conf/autoload_configs/opal.conf.xml +opt/freeswitch/conf/autoload_configs/easyroute.conf.xml +opt/freeswitch/conf/autoload_configs/memcache.conf.xml +opt/freeswitch/conf/autoload_configs/unicall.conf.xml +opt/freeswitch/conf/autoload_configs/python.conf.xml opt/freeswitch/conf/jingle_profiles/server.xml opt/freeswitch/conf/jingle_profiles/client.xml From mikej at freeswitch.org Fri May 15 14:21:07 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 16:21:07 -0500 Subject: [Freeswitch-svn] [commit] r13369 - freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su Message-ID: Author: mikej Date: Fri May 15 16:21:06 2009 New Revision: 13369 Log: silence solaris warning from missing braces (SFSIP-132) Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_uniqueid.c Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_uniqueid.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_uniqueid.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_uniqueid.c Fri May 15 16:21:06 2009 @@ -84,7 +84,11 @@ #include +#if defined(__sun) +static pthread_once_t once = { PTHREAD_ONCE_INIT }; +#else static pthread_once_t once = PTHREAD_ONCE_INIT; +#endif static int done_once = 1; static pthread_key_t state_key; From mikej at freeswitch.org Fri May 15 15:05:59 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 17:05:59 -0500 Subject: [Freeswitch-svn] [commit] r13370 - in freeswitch/trunk: . src/mod/formats/mod_file_string Message-ID: Author: mikej Date: Fri May 15 17:05:59 2009 New Revision: 13370 Log: fix mod_file_string dependencies on windows Modified: freeswitch/trunk/Freeswitch.2008.sln freeswitch/trunk/src/mod/formats/mod_file_string/ (props changed) Modified: freeswitch/trunk/Freeswitch.2008.sln ============================================================================== --- freeswitch/trunk/Freeswitch.2008.sln (original) +++ freeswitch/trunk/Freeswitch.2008.sln Fri May 15 17:05:59 2009 @@ -1014,6 +1014,9 @@ EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_file_string", "src\mod\formats\mod_file_string\mod_file_string.2008.vcproj", "{70564D74-199A-4452-9C60-19ED5F242F0D}" + ProjectSection(ProjectDependencies) = postProject + {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution From anthm at freeswitch.org Fri May 15 15:16:41 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Fri, 15 May 2009 17:16:41 -0500 Subject: [Freeswitch-svn] [commit] r13371 - freeswitch/trunk/src/mod/formats/mod_file_string Message-ID: Author: anthm Date: Fri May 15 17:16:41 2009 New Revision: 13371 Log: copy flags too Modified: freeswitch/trunk/src/mod/formats/mod_file_string/mod_file_string.c Modified: freeswitch/trunk/src/mod/formats/mod_file_string/mod_file_string.c ============================================================================== --- freeswitch/trunk/src/mod/formats/mod_file_string/mod_file_string.c (original) +++ freeswitch/trunk/src/mod/formats/mod_file_string/mod_file_string.c Fri May 15 17:16:41 2009 @@ -87,7 +87,8 @@ handle->seekable = context->fh.seekable; handle->speed = context->fh.speed; handle->interval = context->fh.interval; - + handle->flags = context->fh.flags; + if (context->index == 0) { context->samples = (handle->samplerate / 1000) * 250; } From mikej at freeswitch.org Mon May 18 07:02:39 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Mon, 18 May 2009 09:02:39 -0500 Subject: [Freeswitch-svn] [commit] r13372 - freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx Message-ID: Author: mikej Date: Mon May 18 09:02:38 2009 New Revision: 13372 Log: JANITOR-1 Modified: freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/Makefile Modified: freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/Makefile ============================================================================== --- freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/Makefile (original) +++ freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/Makefile Mon May 18 09:02:38 2009 @@ -45,11 +45,11 @@ $(DESTDIR)$(PREFIX)/grammar/model/communicator: $(GETLIB) $(SPHINXMODEL).tar.gz mkdir -p $(DESTDIR)$(PREFIX)/grammar/model/communicator - mv $(BASE)/libs/Communicator_semi_40.cd_semi_6000/* $(DESTDIR)$(PREFIX)/grammar/model/communicator + cp -drp $(BASE)/libs/Communicator_semi_40.cd_semi_6000/* $(DESTDIR)$(PREFIX)/grammar/model/communicator $(DESTDIR)$(PREFIX)/grammar/model/wsj1: mkdir -p $(DESTDIR)$(PREFIX)/grammar/model/wsj1 - mv $(POCKETSPHINX_DIR)/model/hmm/wsj1/* $(DESTDIR)$(PREFIX)/grammar/model/wsj1 + cp -drp $(POCKETSPHINX_DIR)/model/hmm/wsj1/* $(DESTDIR)$(PREFIX)/grammar/model/wsj1 dictionary: @cp -f $(POCKETSPHINX_DIR)/model/lm/cmudict.0.6d $(DESTDIR)$(PREFIX)/grammar/default.dic From brian at freeswitch.org Mon May 18 07:09:49 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Mon, 18 May 2009 09:09:49 -0500 Subject: [Freeswitch-svn] [commit] r13373 - freeswitch/trunk/src/mod/applications/mod_commands Message-ID: Author: brian Date: Mon May 18 09:09:49 2009 New Revision: 13373 Log: MODAPP-254 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 Mon May 18 09:09:49 2009 @@ -1096,6 +1096,7 @@ switch_core_session_ctl(SCSC_LAST_SPS, &last_sps); switch_core_session_ctl(SCSC_SPS, &sps); stream->write_function(stream, "%d session(s) %d/%d\n", switch_core_session_count(), last_sps, sps); + stream->write_function(stream, "%d session(s) max\n", switch_core_session_limit(0)); if (html) { stream->write_function(stream, "\n"); From mikej at freeswitch.org Mon May 18 07:56:09 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Mon, 18 May 2009 09:56:09 -0500 Subject: [Freeswitch-svn] [commit] r13374 - freeswitch/trunk/src/mod/endpoints/mod_dingaling Message-ID: Author: mikej Date: Mon May 18 09:56:09 2009 New Revision: 13374 Log: fix small memory Modified: freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c Modified: freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c Mon May 18 09:56:09 2009 @@ -2093,17 +2093,20 @@ { char *argv[10] = { 0 }; int argc = 0; - char *var, *val, *myarg; + char *var, *val, *myarg = NULL; mdl_profile_t *profile = NULL; int x; + switch_status_t status = SWITCH_STATUS_SUCCESS; if (session) { - return SWITCH_STATUS_FALSE; + status = SWITCH_STATUS_FALSE; + goto done; } if (switch_strlen_zero(cmd)) { stream->write_function(stream, "USAGE: %s\n", LOGIN_SYNTAX); - return SWITCH_STATUS_SUCCESS; + status = SWITCH_STATUS_SUCCESS; + goto done; } myarg = strdup(cmd); @@ -2112,7 +2115,8 @@ if (switch_strlen_zero(cmd) || argc != 1) { stream->write_function(stream, "USAGE: %s\n", LOGIN_SYNTAX); - return SWITCH_STATUS_SUCCESS; + status = SWITCH_STATUS_SUCCESS; + goto done; } if (argv[0] && !strncasecmp(argv[0], "profile=", 8)) { @@ -2123,7 +2127,8 @@ if (switch_test_flag(profile, TFLAG_IO)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Profile already exists.\n"); stream->write_function(stream, "Profile already exists\n"); - return SWITCH_STATUS_SUCCESS; + status = SWITCH_STATUS_SUCCESS; + goto done; } } @@ -2145,9 +2150,10 @@ } else { stream->write_function(stream, "FAIL\n"); } + done: + switch_safe_free(myarg); - return SWITCH_STATUS_SUCCESS; - + return status; } static switch_status_t load_config(void) From mikej at freeswitch.org Mon May 18 08:42:38 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Mon, 18 May 2009 10:42:38 -0500 Subject: [Freeswitch-svn] [commit] r13375 - freeswitch/trunk/conf/directory/default Message-ID: Author: mikej Date: Mon May 18 10:42:38 2009 New Revision: 13375 Log: remove mailbox= attribute Modified: freeswitch/trunk/conf/directory/default/1000.xml freeswitch/trunk/conf/directory/default/1001.xml freeswitch/trunk/conf/directory/default/1002.xml freeswitch/trunk/conf/directory/default/1003.xml freeswitch/trunk/conf/directory/default/1004.xml freeswitch/trunk/conf/directory/default/1005.xml freeswitch/trunk/conf/directory/default/1006.xml freeswitch/trunk/conf/directory/default/1007.xml freeswitch/trunk/conf/directory/default/1008.xml freeswitch/trunk/conf/directory/default/1009.xml freeswitch/trunk/conf/directory/default/1010.xml freeswitch/trunk/conf/directory/default/1011.xml freeswitch/trunk/conf/directory/default/1012.xml freeswitch/trunk/conf/directory/default/1013.xml freeswitch/trunk/conf/directory/default/1014.xml freeswitch/trunk/conf/directory/default/1015.xml freeswitch/trunk/conf/directory/default/1016.xml freeswitch/trunk/conf/directory/default/1017.xml freeswitch/trunk/conf/directory/default/1018.xml freeswitch/trunk/conf/directory/default/1019.xml freeswitch/trunk/conf/directory/default/brian.xml Modified: freeswitch/trunk/conf/directory/default/1000.xml ============================================================================== --- freeswitch/trunk/conf/directory/default/1000.xml (original) +++ freeswitch/trunk/conf/directory/default/1000.xml Mon May 18 10:42:38 2009 @@ -1,5 +1,5 @@ - + Modified: freeswitch/trunk/conf/directory/default/1001.xml ============================================================================== --- freeswitch/trunk/conf/directory/default/1001.xml (original) +++ freeswitch/trunk/conf/directory/default/1001.xml Mon May 18 10:42:38 2009 @@ -1,5 +1,5 @@ - + Modified: freeswitch/trunk/conf/directory/default/1002.xml ============================================================================== --- freeswitch/trunk/conf/directory/default/1002.xml (original) +++ freeswitch/trunk/conf/directory/default/1002.xml Mon May 18 10:42:38 2009 @@ -1,5 +1,5 @@ - + Modified: freeswitch/trunk/conf/directory/default/1003.xml ============================================================================== --- freeswitch/trunk/conf/directory/default/1003.xml (original) +++ freeswitch/trunk/conf/directory/default/1003.xml Mon May 18 10:42:38 2009 @@ -1,5 +1,5 @@ - + Modified: freeswitch/trunk/conf/directory/default/1004.xml ============================================================================== --- freeswitch/trunk/conf/directory/default/1004.xml (original) +++ freeswitch/trunk/conf/directory/default/1004.xml Mon May 18 10:42:38 2009 @@ -1,5 +1,5 @@ - + Modified: freeswitch/trunk/conf/directory/default/1005.xml ============================================================================== --- freeswitch/trunk/conf/directory/default/1005.xml (original) +++ freeswitch/trunk/conf/directory/default/1005.xml Mon May 18 10:42:38 2009 @@ -1,5 +1,5 @@ - + Modified: freeswitch/trunk/conf/directory/default/1006.xml ============================================================================== --- freeswitch/trunk/conf/directory/default/1006.xml (original) +++ freeswitch/trunk/conf/directory/default/1006.xml Mon May 18 10:42:38 2009 @@ -1,5 +1,5 @@ - + Modified: freeswitch/trunk/conf/directory/default/1007.xml ============================================================================== --- freeswitch/trunk/conf/directory/default/1007.xml (original) +++ freeswitch/trunk/conf/directory/default/1007.xml Mon May 18 10:42:38 2009 @@ -1,5 +1,5 @@ - + Modified: freeswitch/trunk/conf/directory/default/1008.xml ============================================================================== --- freeswitch/trunk/conf/directory/default/1008.xml (original) +++ freeswitch/trunk/conf/directory/default/1008.xml Mon May 18 10:42:38 2009 @@ -1,5 +1,5 @@ - + Modified: freeswitch/trunk/conf/directory/default/1009.xml ============================================================================== --- freeswitch/trunk/conf/directory/default/1009.xml (original) +++ freeswitch/trunk/conf/directory/default/1009.xml Mon May 18 10:42:38 2009 @@ -1,5 +1,5 @@ - + Modified: freeswitch/trunk/conf/directory/default/1010.xml ============================================================================== --- freeswitch/trunk/conf/directory/default/1010.xml (original) +++ freeswitch/trunk/conf/directory/default/1010.xml Mon May 18 10:42:38 2009 @@ -1,5 +1,5 @@ - + Modified: freeswitch/trunk/conf/directory/default/1011.xml ============================================================================== --- freeswitch/trunk/conf/directory/default/1011.xml (original) +++ freeswitch/trunk/conf/directory/default/1011.xml Mon May 18 10:42:38 2009 @@ -1,5 +1,5 @@ - + Modified: freeswitch/trunk/conf/directory/default/1012.xml ============================================================================== --- freeswitch/trunk/conf/directory/default/1012.xml (original) +++ freeswitch/trunk/conf/directory/default/1012.xml Mon May 18 10:42:38 2009 @@ -1,5 +1,5 @@ - + Modified: freeswitch/trunk/conf/directory/default/1013.xml ============================================================================== --- freeswitch/trunk/conf/directory/default/1013.xml (original) +++ freeswitch/trunk/conf/directory/default/1013.xml Mon May 18 10:42:38 2009 @@ -1,5 +1,5 @@ - + Modified: freeswitch/trunk/conf/directory/default/1014.xml ============================================================================== --- freeswitch/trunk/conf/directory/default/1014.xml (original) +++ freeswitch/trunk/conf/directory/default/1014.xml Mon May 18 10:42:38 2009 @@ -1,5 +1,5 @@ - + Modified: freeswitch/trunk/conf/directory/default/1015.xml ============================================================================== --- freeswitch/trunk/conf/directory/default/1015.xml (original) +++ freeswitch/trunk/conf/directory/default/1015.xml Mon May 18 10:42:38 2009 @@ -1,5 +1,5 @@ - + Modified: freeswitch/trunk/conf/directory/default/1016.xml ============================================================================== --- freeswitch/trunk/conf/directory/default/1016.xml (original) +++ freeswitch/trunk/conf/directory/default/1016.xml Mon May 18 10:42:38 2009 @@ -1,5 +1,5 @@ - + Modified: freeswitch/trunk/conf/directory/default/1017.xml ============================================================================== --- freeswitch/trunk/conf/directory/default/1017.xml (original) +++ freeswitch/trunk/conf/directory/default/1017.xml Mon May 18 10:42:38 2009 @@ -1,5 +1,5 @@ - + Modified: freeswitch/trunk/conf/directory/default/1018.xml ============================================================================== --- freeswitch/trunk/conf/directory/default/1018.xml (original) +++ freeswitch/trunk/conf/directory/default/1018.xml Mon May 18 10:42:38 2009 @@ -1,5 +1,5 @@ - + Modified: freeswitch/trunk/conf/directory/default/1019.xml ============================================================================== --- freeswitch/trunk/conf/directory/default/1019.xml (original) +++ freeswitch/trunk/conf/directory/default/1019.xml Mon May 18 10:42:38 2009 @@ -1,5 +1,5 @@ - + Modified: freeswitch/trunk/conf/directory/default/brian.xml ============================================================================== --- freeswitch/trunk/conf/directory/default/brian.xml (original) +++ freeswitch/trunk/conf/directory/default/brian.xml Mon May 18 10:42:38 2009 @@ -3,7 +3,7 @@ ipauth if you have an cidr= in the user attributes ie cidr="1.2.3.4/32" see in default acl.conf.xml --> - + From brian at freeswitch.org Mon May 18 10:04:51 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Mon, 18 May 2009 12:04:51 -0500 Subject: [Freeswitch-svn] [commit] r13376 - freeswitch/trunk/conf/autoload_configs Message-ID: Author: brian Date: Mon May 18 12:04:51 2009 New Revision: 13376 Log: adding default local stream just in case 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 Mon May 18 12:04:51 2009 @@ -1,4 +1,13 @@ + + + + + + + + + From mikej at freeswitch.org Mon May 18 10:06:13 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Mon, 18 May 2009 12:06:13 -0500 Subject: [Freeswitch-svn] [commit] r13377 - in freeswitch/trunk/src: . mod/applications/mod_commands mod/applications/mod_voicemail Message-ID: Author: mikej Date: Mon May 18 12:06:13 2009 New Revision: 13377 Log: abolish mailbox attribute in users and use number-alias attribute instead MODAPP-218 Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c freeswitch/trunk/src/switch_xml.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 Mon May 18 12:06:13 2009 @@ -357,7 +357,6 @@ switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "user", user); - switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "mailbox", user); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "domain", domain); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "type", type); 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 Mon May 18 12:06:13 2009 @@ -1312,6 +1312,22 @@ return -1; } +static void resolve_id(const char **myid, const char *domain_name, const char *action) +{ + switch_xml_t xx_user, xx_domain, xx_domain_root; + switch_event_t *params; + + switch_event_create(¶ms, SWITCH_EVENT_GENERAL); + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "action", action); + + if (switch_xml_locate_user("id", *myid, domain_name, NULL, + &xx_domain_root, &xx_domain, &xx_user, NULL, params) == SWITCH_STATUS_SUCCESS) { + *myid = switch_xml_attr(xx_user, "id"); + switch_xml_free(xx_domain_root); + } + + switch_event_destroy(¶ms); +} static void message_count(vm_profile_t *profile, const char *myid, const char *domain_name, const char *myfolder, int *total_new_messages, int *total_saved_messages, int *total_new_urgent_messages, int *total_saved_urgent_messages) @@ -1322,6 +1338,8 @@ cbt.buf = msg_count; cbt.len = sizeof(msg_count); + + resolve_id(&myid, domain_name, "message-count"); switch_snprintf(sql, sizeof(sql), "select count(*) from voicemail_msgs where username='%s' and domain='%s' and in_folder='%s' and read_epoch=0", @@ -1746,7 +1764,7 @@ switch_xml_t x_domain = NULL, x_domain_root = NULL, x_user = NULL, x_params, x_param; switch_status_t status; char pass_buf[80] = "", *mypass = NULL, id_buf[80] = "", *myfolder = NULL; - const char *thepass = NULL, *myid = id, *actual_id = NULL, *thehash = NULL, *vmhash = NULL; + const char *thepass = NULL, *myid = id, *thehash = NULL, *vmhash = NULL; char term = 0; uint32_t timeout, attempts = 0; int failed = 0; @@ -1792,7 +1810,6 @@ play_msg_type = MSG_NONE; attempts = profile->max_login_attempts; myid = id; - actual_id = NULL; mypass = NULL; myfolder = "inbox"; vm_check_state = VM_CHECK_AUTH; @@ -1912,7 +1929,7 @@ vm_execute_sql(profile, sql, profile->mutex); vm_check_state = VM_CHECK_FOLDER_SUMMARY; - update_mwi(profile, actual_id ? actual_id : myid, domain_name, myfolder); + update_mwi(profile, myid, domain_name, myfolder); } break; case VM_CHECK_CONFIG: @@ -2020,13 +2037,10 @@ switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "VM-Action", "change-password"); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "VM-User-Password", buf); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "VM-User", myid); - if (actual_id) { - switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "VM-Actual-User", actual_id); - } switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "VM-Domain", domain_name); switch_channel_event_set_data(channel, params); - if (switch_xml_locate_user("id", actual_id ? actual_id : myid, domain_name, switch_channel_get_variable(channel, "network_addr"), + if (switch_xml_locate_user("id", myid, domain_name, switch_channel_get_variable(channel, "network_addr"), &xx_domain_root, &xx_domain, &xx_user, NULL, params) == SWITCH_STATUS_SUCCESS) { switch_xml_free(xx_domain_root); } @@ -2114,7 +2128,6 @@ switch_event_create(¶ms, SWITCH_EVENT_GENERAL); switch_assert(params); - switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "mailbox", myid); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "destination_number", caller_profile->destination_number); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "caller_id_number", caller_id_number); @@ -2123,26 +2136,15 @@ &x_domain_root, &x_domain, &x_user, NULL, params) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Can't find user [%s@%s]\n", myid, domain_name); ok = 0; + } else { + myid = switch_xml_attr(x_user, "id"); } - + switch_event_destroy(¶ms); if (!ok) { goto end; - } else { - const char *x_box = switch_xml_attr(x_user, "mailbox"); - - if (x_box) { - myid = switch_core_session_strdup(session, x_box); - } - - if ((actual_id = switch_xml_attr(x_user, "id"))) { - actual_id = switch_core_session_strdup(session, actual_id); - } else { - actual_id = id; - } } - } thepass = thehash = NULL; @@ -2313,7 +2315,6 @@ { char *file_path = NULL, *dir_path = NULL; const char *myid = switch_xml_attr(x_user, "id"); - const char *mybox = switch_xml_attr(x_user, "mailbox"); switch_uuid_t uuid; char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; const char *filename; @@ -2334,10 +2335,6 @@ switch_event_t *local_event = NULL; switch_status_t ret = SWITCH_STATUS_SUCCESS; - if (mybox) { - myid = mybox; - } - if (params) { switch_event_create(&local_event, SWITCH_EVENT_REQUEST_PARAMS); params = local_event; @@ -2846,7 +2843,6 @@ switch_event_t *vars = NULL; const char *vm_cc = NULL, *vtmp, *vm_ext = NULL; int disk_quota = 0; - switch_event_t *params = NULL; if (!(caller_id_name = switch_channel_get_variable(channel, "effective_caller_id_name"))) { caller_id_name = caller_profile->caller_id_name; @@ -2865,10 +2861,10 @@ switch_event_create(&locate_params, SWITCH_EVENT_REQUEST_PARAMS); switch_assert(locate_params); - switch_event_add_header_string(locate_params, SWITCH_STACK_BOTTOM, "mailbox", id); if (switch_xml_locate_user("id", id, domain_name, switch_channel_get_variable(channel, "network_addr"), &x_domain_root, &x_domain, &x_user, NULL, locate_params) == SWITCH_STATUS_SUCCESS) { + id = switch_xml_attr(x_user, "id"); if ((x_params = switch_xml_child(x_user, "params"))) { for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) { const char *var = switch_xml_attr_soft(x_param, "name"); @@ -3105,13 +3101,10 @@ } } - switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS); - switch_assert(params); - switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "mailbox", id); - if (!x_domain_root) { switch_xml_locate_user("id", id, domain_name, switch_channel_get_variable(channel, "network_addr"), - &x_domain_root, &x_domain, &x_user, NULL, params); + &x_domain_root, &x_domain, &x_user, NULL, NULL); + id = switch_xml_attr(x_user, "id"); } if (x_domain_root) { @@ -3135,8 +3128,6 @@ } - switch_event_destroy(¶ms); - end: if (x_domain_root) { @@ -3419,11 +3410,11 @@ switch_xml_t x_item; switch_xml_t x_channel; int items; - char *user; - char *domain; - char *host; - char *port; - char *uri; + const char *user; + const char *domain; + const char *host; + const char *port; + const char *uri; }; @@ -3792,7 +3783,7 @@ } -static void do_web(vm_profile_t *profile, char *user, char *domain, char *host, char *port, char *uri, switch_stream_handle_t *stream) +static void do_web(vm_profile_t *profile, const char *user, const char *domain, const char *host, const char *port, const char *uri, switch_stream_handle_t *stream) { char buf[80] = ""; struct holder holder; @@ -3800,6 +3791,8 @@ callback_t cbt = { 0 }; int ttl = 0; + resolve_id(&user, domain, "web-vm"); + stream->write_function(stream, "Content-type: text/html\n\n"); memset(&holder, 0, sizeof(holder)); holder.profile = profile; Modified: freeswitch/trunk/src/switch_xml.c ============================================================================== --- freeswitch/trunk/src/switch_xml.c (original) +++ freeswitch/trunk/src/switch_xml.c Mon May 18 12:06:13 2009 @@ -1686,14 +1686,14 @@ } if (user_name) { - if (params && switch_event_get_header(params, (char *) "mailbox")) { - if ((*user = switch_xml_find_child_multi(tag, "user", "mailbox", user_name, "type", type, NULL))) { + if (!strcasecmp(key, "id")) { + if ((*user = switch_xml_find_child_multi(tag, "user", key, user_name, "number-alias", user_name, "type", type, NULL))) { + return SWITCH_STATUS_SUCCESS; + } + } else { + if ((*user = switch_xml_find_child_multi(tag, "user", key, user_name, "type", type, NULL))) { return SWITCH_STATUS_SUCCESS; } - } - - if ((*user = switch_xml_find_child_multi(tag, "user", key, user_name, "type", type, NULL))) { - return SWITCH_STATUS_SUCCESS; } } From mikej at freeswitch.org Mon May 18 10:11:47 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Mon, 18 May 2009 12:11:47 -0500 Subject: [Freeswitch-svn] [commit] r13378 - freeswitch/trunk/src Message-ID: Author: mikej Date: Mon May 18 12:11:47 2009 New Revision: 13378 Log: abolish mailbox attribute in users and use number-alias attribute instead MODAPP-218 Modified: freeswitch/trunk/src/switch_ivr.c Modified: freeswitch/trunk/src/switch_ivr.c ============================================================================== --- freeswitch/trunk/src/switch_ivr.c (original) +++ freeswitch/trunk/src/switch_ivr.c Mon May 18 12:11:47 2009 @@ -2026,7 +2026,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_set_user(switch_core_session_t *session, const char *data) { switch_xml_t x_domain, xml = NULL, x_user, x_param, x_params, x_group = NULL; - char *user, *mailbox, *domain; + char *user, *number_alias, *domain; switch_channel_t *channel = switch_core_session_get_channel(session); switch_status_t status = SWITCH_STATUS_FALSE; @@ -2049,8 +2049,8 @@ status = SWITCH_STATUS_SUCCESS; - if ((mailbox = (char *) switch_xml_attr(x_user, "mailbox"))) { - switch_channel_set_variable(channel, "mailbox", mailbox); + if ((number_alias = (char *) switch_xml_attr(x_user, "number-alias"))) { + switch_channel_set_variable(channel, "number_alias", number_alias); } if ((x_params = switch_xml_child(x_domain, "variables"))) { From brian at freeswitch.org Mon May 18 10:16:48 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Mon, 18 May 2009 12:16:48 -0500 Subject: [Freeswitch-svn] [commit] r13379 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: brian Date: Mon May 18 12:16:48 2009 New Revision: 13379 Log: remove mailbox and replace with number_alias Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c Mon May 18 12:16:48 2009 @@ -1557,7 +1557,7 @@ const char *passwd = NULL; const char *a1_hash = NULL; char *sql; - char *mailbox = NULL; + char *number_alias = NULL; switch_xml_t domain, xml = NULL, user, param, uparams, dparams, group = NULL, gparams = NULL; char hexdigest[2 * SU_MD5_DIGEST_SIZE + 1] = ""; char *domain_name = NULL; @@ -1714,8 +1714,8 @@ } } - if (!(mailbox = (char *) switch_xml_attr(user, "mailbox"))) { - mailbox = switch_strlen_zero(username) ? "nobody" : username; + if (!(number_alias = (char *) switch_xml_attr(user, "number-alias"))) { + number_alias = switch_strlen_zero(username) ? "nobody" : username; } dparams = switch_xml_child(domain, "params"); @@ -1877,10 +1877,10 @@ switch_xml_t xparams[3]; int i = 0; - switch_event_add_header_string(*v_event, SWITCH_STACK_BOTTOM, "sip_mailbox", mailbox); + switch_event_add_header_string(*v_event, SWITCH_STACK_BOTTOM, "sip_number_alias", number_alias); switch_event_add_header_string(*v_event, SWITCH_STACK_BOTTOM, "sip_auth_username", username); switch_event_add_header_string(*v_event, SWITCH_STACK_BOTTOM, "sip_auth_realm", realm); - switch_event_add_header_string(*v_event, SWITCH_STACK_BOTTOM, "mailbox", mailbox); + switch_event_add_header_string(*v_event, SWITCH_STACK_BOTTOM, "number_alias", number_alias); switch_event_add_header_string(*v_event, SWITCH_STACK_BOTTOM, "user_name", username); switch_event_add_header_string(*v_event, SWITCH_STACK_BOTTOM, "domain_name", domain_name); From brian at freeswitch.org Mon May 18 10:19:32 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Mon, 18 May 2009 12:19:32 -0500 Subject: [Freeswitch-svn] [commit] r13380 - freeswitch/trunk/src/mod/xml_int/mod_xml_rpc Message-ID: Author: brian Date: Mon May 18 12:19:31 2009 New Revision: 13380 Log: remove mailbox from mod_xml_rpc also and check number-alias Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c ============================================================================== --- freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c (original) +++ freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c Mon May 18 12:19:31 2009 @@ -209,7 +209,7 @@ switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS); switch_assert(params); - switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "mailbox", "check"); + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "number_alias", "check"); if (switch_xml_locate_user("id", user, domain_name, NULL, &x_domain_root, &x_domain, &x_user, NULL, params) != SWITCH_STATUS_SUCCESS) { switch_event_destroy(¶ms); @@ -217,7 +217,7 @@ } switch_event_destroy(¶ms); - box = switch_xml_attr_soft(x_user, "mailbox"); + box = switch_xml_attr_soft(x_user, "number-alias"); if ((x_params = switch_xml_child(x_domain, "params"))) { From mikej at freeswitch.org Mon May 18 10:34:35 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Mon, 18 May 2009 12:34:35 -0500 Subject: [Freeswitch-svn] [commit] r13381 - freeswitch/trunk/src/mod/applications/mod_voicemail Message-ID: Author: mikej Date: Mon May 18 12:34:35 2009 New Revision: 13381 Log: abolish mailbox attribute in users and use number-alias attribute instead MODAPP-218 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 Mon May 18 12:34:35 2009 @@ -1312,35 +1312,38 @@ return -1; } -static void resolve_id(const char **myid, const char *domain_name, const char *action) +static char *resolve_id(const char *myid, const char *domain_name, const char *action) { switch_xml_t xx_user, xx_domain, xx_domain_root; switch_event_t *params; + char *ret = (char *) myid; switch_event_create(¶ms, SWITCH_EVENT_GENERAL); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "action", action); - if (switch_xml_locate_user("id", *myid, domain_name, NULL, + if (switch_xml_locate_user("id", myid, domain_name, NULL, &xx_domain_root, &xx_domain, &xx_user, NULL, params) == SWITCH_STATUS_SUCCESS) { - *myid = switch_xml_attr(xx_user, "id"); + ret = strdup(switch_xml_attr(xx_user, "id")); switch_xml_free(xx_domain_root); } switch_event_destroy(¶ms); + return ret; } -static void message_count(vm_profile_t *profile, const char *myid, const char *domain_name, const char *myfolder, +static void message_count(vm_profile_t *profile, const char *id_in, const char *domain_name, const char *myfolder, int *total_new_messages, int *total_saved_messages, int *total_new_urgent_messages, int *total_saved_urgent_messages) { char msg_count[80] = ""; callback_t cbt = { 0 }; char sql[256]; + char *myid; cbt.buf = msg_count; cbt.len = sizeof(msg_count); - resolve_id(&myid, domain_name, "message-count"); - + myid = resolve_id(id_in, domain_name, "message-count"); + switch_snprintf(sql, sizeof(sql), "select count(*) from voicemail_msgs where username='%s' and domain='%s' and in_folder='%s' and read_epoch=0", myid, domain_name, myfolder); @@ -1364,6 +1367,11 @@ myid, domain_name, myfolder, URGENT_FLAG_STRING); vm_execute_sql_callback(profile, profile->mutex, sql, sql2str_callback, &cbt); *total_saved_urgent_messages = atoi(msg_count); + + if (myid != id_in) { + free(myid); + } + } #define VM_STARTSAMPLES 1024 * 32 @@ -2137,7 +2145,7 @@ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Can't find user [%s@%s]\n", myid, domain_name); ok = 0; } else { - myid = switch_xml_attr(x_user, "id"); + myid = switch_core_session_strdup(session, switch_xml_attr(x_user, "id")); } switch_event_destroy(¶ms); @@ -2864,7 +2872,7 @@ if (switch_xml_locate_user("id", id, domain_name, switch_channel_get_variable(channel, "network_addr"), &x_domain_root, &x_domain, &x_user, NULL, locate_params) == SWITCH_STATUS_SUCCESS) { - id = switch_xml_attr(x_user, "id"); + id = switch_core_session_strdup(session, switch_xml_attr(x_user, "id")); if ((x_params = switch_xml_child(x_user, "params"))) { for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) { const char *var = switch_xml_attr_soft(x_param, "name"); @@ -3104,7 +3112,7 @@ if (!x_domain_root) { switch_xml_locate_user("id", id, domain_name, switch_channel_get_variable(channel, "network_addr"), &x_domain_root, &x_domain, &x_user, NULL, NULL); - id = switch_xml_attr(x_user, "id"); + id = switch_core_session_strdup(session, switch_xml_attr(x_user, "id")); } if (x_domain_root) { @@ -3783,15 +3791,16 @@ } -static void do_web(vm_profile_t *profile, const char *user, const char *domain, const char *host, const char *port, const char *uri, switch_stream_handle_t *stream) +static void do_web(vm_profile_t *profile, const char *user_in, const char *domain, const char *host, const char *port, const char *uri, switch_stream_handle_t *stream) { char buf[80] = ""; struct holder holder; char *sql; callback_t cbt = { 0 }; int ttl = 0; + char *user; - resolve_id(&user, domain, "web-vm"); + user = resolve_id(user_in, domain, "web-vm"); stream->write_function(stream, "Content-type: text/html\n\n"); memset(&holder, 0, sizeof(holder)); @@ -3824,6 +3833,10 @@ if (profile->web_tail) { stream->raw_write_function(stream, (uint8_t *) profile->web_tail, strlen(profile->web_tail)); } + + if (user != user_in) { + free(user); + } } #define VM_INJECT_USAGE "[group=] [] []" From anthm at freeswitch.org Mon May 18 10:39:59 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Mon, 18 May 2009 12:39:59 -0500 Subject: [Freeswitch-svn] [commit] r13382 - freeswitch/trunk/src Message-ID: Author: anthm Date: Mon May 18 12:39:59 2009 New Revision: 13382 Log: MODAPP-280 Modified: freeswitch/trunk/src/switch_ivr_play_say.c 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 Mon May 18 12:39:59 2009 @@ -860,7 +860,8 @@ char *argv[128] = { 0 }; int argc; int cur; - + int done = 0; + switch_core_session_get_read_impl(session, &read_impl); if ((play_delimiter_val = switch_channel_get_variable(channel, "playback_delimiter"))) { @@ -898,7 +899,7 @@ argv[0] = (char *)file; } - for(cur = 0; switch_channel_ready(channel) && cur < argc; cur++) { + for(cur = 0; switch_channel_ready(channel) && !done && cur < argc; cur++) { file = argv[cur]; asis = 0; eof = 0; @@ -1125,7 +1126,6 @@ ilen = samples; for (;;) { - int done = 0; int do_speed = 1; int last_speed = -1; From mikej at freeswitch.org Tue May 19 07:46:38 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Tue, 19 May 2009 09:46:38 -0500 Subject: [Freeswitch-svn] [commit] r13383 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/sdp Message-ID: Author: mikej Date: Tue May 19 09:46:38 2009 New Revision: 13383 Log: Fri May 15 11:31:44 CDT 2009 Michael Jerris * sdp_print.c: build errors fix Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Tue May 19 09:46:38 2009 @@ -1 +1 @@ -Fri May 15 11:18:36 CDT 2009 +Tue May 19 09:46:18 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c Tue May 19 09:46:38 2009 @@ -87,9 +87,8 @@ sizeof(printer_memory_error.pr_buffer) }; -static void printing_error(sdp_printer_t *p, const char *fmt, ...); - static void print_session(sdp_printer_t *p, sdp_session_t const *session); +static void printing_error(sdp_printer_t *p, const char *fmt, ...); /** Print a SDP description. * From mikej at freeswitch.org Tue May 19 08:17:44 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Tue, 19 May 2009 10:17:44 -0500 Subject: [Freeswitch-svn] [commit] r13384 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: mikej Date: Tue May 19 10:17:44 2009 New Revision: 13384 Log: don't do this if its zero try one SFSIP-143 Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c 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 Tue May 19 10:17:44 2009 @@ -1375,7 +1375,7 @@ new_expires = contact->m_expires; expi = (uint32_t) atoi(new_expires); - if (expi != sofia_private->gateway->freq) { + if (expi > 0 && expi != sofia_private->gateway->freq) { sofia_private->gateway->freq = expi; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Changing expire time to %d by request of proxy %s\n", expi, sofia_private->gateway->register_proxy); From anthm at freeswitch.org Tue May 19 08:38:45 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Tue, 19 May 2009 10:38:45 -0500 Subject: [Freeswitch-svn] [commit] r13385 - freeswitch/trunk/src Message-ID: Author: anthm Date: Tue May 19 10:38:45 2009 New Revision: 13385 Log: fixx off-by-one in xml preprocessor Modified: freeswitch/trunk/src/switch_xml.c Modified: freeswitch/trunk/src/switch_xml.c ============================================================================== --- freeswitch/trunk/src/switch_xml.c (original) +++ freeswitch/trunk/src/switch_xml.c Tue May 19 10:38:45 2009 @@ -1147,7 +1147,7 @@ while (*rp && wp < ep) { if (*rp == '$' && *(rp + 1) == '$' && *(rp + 2) == '{') { - char *e = strchr(rp, '}'); + char *e = switch_find_end_paren(rp + 2, '{', '}'); if (e) { rp += 3; @@ -1160,6 +1160,7 @@ *wp++ = *p; } } + continue; } } From mikej at freeswitch.org Tue May 19 09:47:09 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Tue, 19 May 2009 11:47:09 -0500 Subject: [Freeswitch-svn] [commit] r13386 - in freeswitch/trunk/libs/apr: build include/arch/unix Message-ID: Author: mikej Date: Tue May 19 11:47:09 2009 New Revision: 13386 Log: fix PTHREAD_MUTEX_RECURSIVE detection on SUSE 10 Modified: freeswitch/trunk/libs/apr/build/apr_threads.m4 freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_proc_mutex.h freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_thread_mutex.h Modified: freeswitch/trunk/libs/apr/build/apr_threads.m4 ============================================================================== --- freeswitch/trunk/libs/apr/build/apr_threads.m4 (original) +++ freeswitch/trunk/libs/apr/build/apr_threads.m4 Tue May 19 11:47:09 2009 @@ -224,7 +224,8 @@ dnl Check for recursive mutex support (per SUSv3). AC_DEFUN([APR_CHECK_PTHREAD_RECURSIVE_MUTEX], [ AC_CACHE_CHECK([for recursive mutex support], [apr_cv_mutex_recursive], -[AC_TRY_RUN([#include +[AC_TRY_RUN([#define _XOPEN_SOURCE=600 +#include #include #include Modified: freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_proc_mutex.h ============================================================================== --- freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_proc_mutex.h (original) +++ freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_proc_mutex.h Tue May 19 11:47:09 2009 @@ -17,6 +17,10 @@ #ifndef PROC_MUTEX_H #define PROC_MUTEX_H +#ifndef _XOPEN_SOURCE +#define _XOPEN_SOURCE=600 +#endif + #include "apr.h" #include "apr_private.h" #include "apr_general.h" Modified: freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_thread_mutex.h ============================================================================== --- freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_thread_mutex.h (original) +++ freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_thread_mutex.h Tue May 19 11:47:09 2009 @@ -17,6 +17,10 @@ #ifndef THREAD_MUTEX_H #define THREAD_MUTEX_H +#ifndef _XOPEN_SOURCE +#define _XOPEN_SOURCE=600 +#endif + #include "apr.h" #include "apr_private.h" #include "apr_general.h" From mikej at freeswitch.org Tue May 19 10:23:16 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Tue, 19 May 2009 12:23:16 -0500 Subject: [Freeswitch-svn] [commit] r13387 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/su Message-ID: Author: mikej Date: Tue May 19 12:23:16 2009 New Revision: 13387 Log: Tue May 19 12:00:30 CDT 2009 Pekka Pessi * su_uniqueid.c: Solaris misdefines PTHREAD_ONCE_INIT Ignore-this: 9fe2247164d572901ed4a30b009353db Solaris defines pthread_once_t as a struct containing an array. The initializer PTHREAD_ONCE_INIT needs two levels of brackets it but only has one. Original patch from Mike Jerris . Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_uniqueid.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Tue May 19 12:23:16 2009 @@ -1 +1 @@ -Tue May 19 09:46:18 CDT 2009 +Tue May 19 12:23:01 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_uniqueid.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_uniqueid.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_uniqueid.c Tue May 19 12:23:16 2009 @@ -84,11 +84,12 @@ #include -#if defined(__sun) -static pthread_once_t once = { PTHREAD_ONCE_INIT }; -#else -static pthread_once_t once = PTHREAD_ONCE_INIT; +#if __sun +#undef PTHREAD_ONCE_INIT +#define PTHREAD_ONCE_INIT {{ 0, 0, 0, PTHREAD_ONCE_NOTDONE }} #endif + +static pthread_once_t once = PTHREAD_ONCE_INIT; static int done_once = 1; static pthread_key_t state_key; From mikej at freeswitch.org Tue May 19 10:25:08 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Tue, 19 May 2009 12:25:08 -0500 Subject: [Freeswitch-svn] [commit] r13388 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/tport Message-ID: Author: mikej Date: Tue May 19 12:25:08 2009 New Revision: 13388 Log: Tue May 19 12:00:30 CDT 2009 Pekka Pessi * su_uniqueid.c: Solaris misdefines PTHREAD_ONCE_INIT Ignore-this: 9fe2247164d572901ed4a30b009353db Solaris defines pthread_once_t as a struct containing an array. The initializer PTHREAD_ONCE_INIT needs two levels of brackets it but only has one. Original patch from Mike Jerris . Modified: freeswitch/trunk/libs/sofia-sip/.update freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.c Modified: freeswitch/trunk/libs/sofia-sip/.update ============================================================================== --- freeswitch/trunk/libs/sofia-sip/.update (original) +++ freeswitch/trunk/libs/sofia-sip/.update Tue May 19 12:25:08 2009 @@ -1 +1 @@ -Tue May 19 12:23:01 CDT 2009 +Tue May 19 12:24:21 CDT 2009 Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.c Tue May 19 12:25:08 2009 @@ -68,11 +68,38 @@ #include #endif +#if SU_HAVE_PTHREADS + +#include + +#if __sun +#undef PTHREAD_ONCE_INIT +#define PTHREAD_ONCE_INIT {{ 0, 0, 0, PTHREAD_ONCE_NOTDONE }} +#endif + +static pthread_once_t once = PTHREAD_ONCE_INIT; +#define ONCE_INIT(f) pthread_once(&once, f) + +#else + +static int once; +#define ONCE_INIT(f) (!once ? (once = 1), f() : (void)0) + +#endif + #include "tport_tls.h" char const tls_version[] = OPENSSL_VERSION_TEXT; int tls_ex_data_idx = -1; /* see SSL_get_ex_new_index(3ssl) */ +static void +tls_init_once(void) +{ + SSL_library_init(); + SSL_load_error_strings(); + tls_ex_data_idx = SSL_get_ex_new_index(0, "sofia-sip private data", NULL, NULL, NULL); +} + enum { tls_master = 0, tls_slave = 1}; struct tls_s { @@ -218,15 +245,13 @@ static int tls_init_context(tls_t *tls, tls_issues_t const *ti) { - static int initialized = 0; int verify; + static int random_loaded; + + ONCE_INIT(tls_init_once); - if (!initialized) { - initialized = 1; - SSL_library_init(); - SSL_load_error_strings(); - tls_ex_data_idx = SSL_get_ex_new_index(0, \ - "sofia-sip private data", NULL, NULL, NULL); + if (!random_loaded) { + random_loaded = 1; if (ti->randFile && !RAND_load_file(ti->randFile, 1024 * 1024)) { From anthm at freeswitch.org Tue May 19 10:49:22 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Tue, 19 May 2009 12:49:22 -0500 Subject: [Freeswitch-svn] [commit] r13389 - in freeswitch/trunk: conf/sip_profiles src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Tue May 19 12:49:21 2009 New Revision: 13389 Log: make autoflush on bridge the default Modified: freeswitch/trunk/conf/sip_profiles/internal.xml freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Modified: freeswitch/trunk/conf/sip_profiles/internal.xml ============================================================================== --- freeswitch/trunk/conf/sip_profiles/internal.xml (original) +++ freeswitch/trunk/conf/sip_profiles/internal.xml Tue May 19 12:49:21 2009 @@ -94,8 +94,8 @@ - + (reduces delay on latent connections default true, must be disabled explicitly)--> + 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 May 19 12:49:21 2009 @@ -2016,6 +2016,7 @@ profile->auto_restart = 1; sofia_set_pflag(profile, PFLAG_AUTOFIX_TIMING); sofia_set_pflag(profile, PFLAG_MESSAGE_QUERY_ON_REGISTER); + sofia_set_pflag(profile, PFLAG_RTP_AUTOFLUSH_DURING_BRIDGE); for (param = switch_xml_child(settings, "param"); param; param = param->next) { char *var = (char *) switch_xml_attr_soft(param, "name"); From mikej at freeswitch.org Tue May 19 10:49:54 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Tue, 19 May 2009 12:49:54 -0500 Subject: [Freeswitch-svn] [commit] r13390 - in freeswitch/trunk/libs/apr: . build include/arch/unix Message-ID: Author: mikej Date: Tue May 19 12:49:53 2009 New Revision: 13390 Log: fix PTHREAD_MUTEX_RECURSIVE detection on SUSE 10 Modified: freeswitch/trunk/libs/apr/.update freeswitch/trunk/libs/apr/build/apr_threads.m4 freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_proc_mutex.h freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_thread_mutex.h Modified: freeswitch/trunk/libs/apr/.update ============================================================================== --- freeswitch/trunk/libs/apr/.update (original) +++ freeswitch/trunk/libs/apr/.update Tue May 19 12:49:53 2009 @@ -1 +1 @@ -Thu Mar 19 21:08:11 CDT 2009 +Tue May 19 13:49:44 EDT 2009 Modified: freeswitch/trunk/libs/apr/build/apr_threads.m4 ============================================================================== --- freeswitch/trunk/libs/apr/build/apr_threads.m4 (original) +++ freeswitch/trunk/libs/apr/build/apr_threads.m4 Tue May 19 12:49:53 2009 @@ -224,7 +224,7 @@ dnl Check for recursive mutex support (per SUSv3). AC_DEFUN([APR_CHECK_PTHREAD_RECURSIVE_MUTEX], [ AC_CACHE_CHECK([for recursive mutex support], [apr_cv_mutex_recursive], -[AC_TRY_RUN([#define _XOPEN_SOURCE=600 +[AC_TRY_RUN([#define _XOPEN_SOURCE 600 #include #include #include Modified: freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_proc_mutex.h ============================================================================== --- freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_proc_mutex.h (original) +++ freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_proc_mutex.h Tue May 19 12:49:53 2009 @@ -18,7 +18,7 @@ #define PROC_MUTEX_H #ifndef _XOPEN_SOURCE -#define _XOPEN_SOURCE=600 +#define _XOPEN_SOURCE 600 #endif #include "apr.h" Modified: freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_thread_mutex.h ============================================================================== --- freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_thread_mutex.h (original) +++ freeswitch/trunk/libs/apr/include/arch/unix/apr_arch_thread_mutex.h Tue May 19 12:49:53 2009 @@ -18,7 +18,7 @@ #define THREAD_MUTEX_H #ifndef _XOPEN_SOURCE -#define _XOPEN_SOURCE=600 +#define _XOPEN_SOURCE 600 #endif #include "apr.h" From mcollins at freeswitch.org Tue May 19 12:10:47 2009 From: mcollins at freeswitch.org (FreeSWITCH SVN) Date: Tue, 19 May 2009 14:10:47 -0500 Subject: [Freeswitch-svn] [commit] r13391 - freeswitch/trunk/docs Message-ID: Author: mcollins Date: Tue May 19 14:10:47 2009 New Revision: 13391 Log: Update Changelog through r13390 Modified: freeswitch/trunk/docs/ChangeLog Modified: freeswitch/trunk/docs/ChangeLog ============================================================================== --- freeswitch/trunk/docs/ChangeLog (original) +++ freeswitch/trunk/docs/ChangeLog Tue May 19 14:10:47 2009 @@ -50,6 +50,15 @@ build: use sound_version.txt and moh_version.txt to determine sound file version on windows (FSBUILD-152/r:13097) build: use in tree libtiff for msvc build and fix some header generation checks (r:13150) build: clean esl on make current (r:13204,13205) + build: fix warning-as-error that stops MSVC from building solution (FSCORE-367/r:13301) + build: fix MSVC build issue from r13294 (FSBUILD-159/r:13302) + build: remove broken code analysis test (r:13364) + build: cleanup msvc code analysis warnings (r:13366) + build: Add mod_file_string to build + misc cleaning and correction (FSBUILD-158/r:13367) + build: add new files to debian package build (FSBUILD-148/r:13368) + build: fix mod_file_string dependencies on windows (r:13370) + build: fix mod_pocketsphinx build error (JANITOR-1/r:13372) + build: fix PTHREAD_MUTEX_RECURSIVE detection on SUSE 10 (r:13386,13390) config: default config, calling own extension no longer goes to voicemail (r:12596) config: default config, 1000-1019 uses $${default_password} instead of hard-coded 1234 (FSCONFIG-5/r:12838) config: tweak the configs to bind siptrace on and off to F10 and F11 (r:12938) @@ -57,6 +66,8 @@ config: Add ext 9991 as ClueCon ext; use transfer instead of bridge on demo ivr opt #4 (r:13046) config: remove invalid options from profiles (r:13153) config: add documention for dist-dtmf member flag in conference.conf.xml + config: remove mailbox= attribute (r:13375) + config: add default local stream (r:13376) core: fix suncc visibility support in libteletone (r:12154-12157) core: fix crash on FS shutdown with "..." (FSCORE-297/r:12173,12361,12402) core: add separate mutex for state related methods (r:12191) @@ -133,7 +144,7 @@ core: add auto-sync idle timers in switch_time.c (r:13161) core: Add Q850 hangup cause variable (FSCORE-356/r:13163) core: keep presence up to date (r:13166) - core: fix failed_xml_cdr_prefix is processed before all variables for the b-leg have been generated (FSCORE-357/r:13167,13176,13264,13274) + core: fix failed_xml_cdr_prefix is processed before all variables for the b-leg have been generated (FSCORE-357/r:13167,13176,13264,13274,13285) core: failed_xml_cdr_prefix doesn't work for list of destinations separated by pipe (FSCORE-359/r:13209) core: add support for gcc 4.4.0 (FSCORE-355/r:13210) core: add resume command to event socket and socket_resume variable (r:13212) @@ -144,6 +155,15 @@ core: fix play and get digits when using phrase macros (r:13244) core: Don't set the caller name to origination_uuid's value (r:13248) core: Add switch_xml_parse_str_dynamic and switch_xml_parse_str_dup (r:13255) + core: In IVR menu use menu-timeout instead of menu-inter-digit-timeout when no digits have been entered (r:13279) + core: fix segault on OpenSolaris 2009.06 snv_111a (FSCORE-365/r:13286) + core: allow socket app to operate without pre_answer (r:13294) + core: ensure vasprintf is available on linux (FSBUILD-160/r:13358,13361) + core: setgroup/initgroup availability on linux (FSBUILD-160/r:13359) + core: use uint16_t instead of u_short (FSBUILD-160/r:13360) + core: add configure checks for tm->tm_gmtoff and tm->tm_zone (FSBUILD-160/r:13362) + core: Fix IVR key response broken when multiple files are played (MODAPP-280/r:13382) + core: fixx off-by-one in xml preprocessor (r:13385) docs: Fix filename references in phrase_en.xml (r:12976) docs: Update phrase_en.xml to include v1.0.8 sound prompts (r:13041) docs: Updates to phrase_es.xml (r:13067) @@ -152,6 +172,7 @@ formats: add mod_portaudio_stream to get audio from any dev (MODFORM-25/r:12178) fs_cli: fix solaris build (r:12160) ivr: make tts-engine and tts-voice valid attributes on the menu xml (r:12278) + libapr-util: add xml/expat stuff back to apr-utils (requires re-bootstrap) (r:13289,13290) libdingaling: hijack gcrypt init call to fix threadsafe race in dingaling and fix buffer overrun in iksemel (r:12575) libdingaling: add ldl_handle_running (r:13085) libdingaling: add a function to check for connected and authorized (r:13100) @@ -181,10 +202,12 @@ libesl: add arbitrary notify (r:13188) libesl: fix Phantom events when doing several bgapi calls without interleaving them with recvEvent (ESL-12/r:13217) libesl: add Ruby example for ESL (ESL-15/r:13235) + libesl: add INFO example for Perl (r:13293) libiksemel: let return 0 be a failure on read in iks to avoid cpu race (r:13123,13124,13133) libsndfile: add executable permissions to libs/libsndfile/src/create_symbols_file.py (FSBUILD-134/r:12535) libsofiasip: Fix compile time out-of-bounds error in su_uniqueid.c (SFSIP-136/r:12914) libsofiasip: make info work out of dialog (r:13087) + libsofiasip: silence solaris warning from missing braces (SFSIP-132/r:13369) libspandsp: update to snapshot spandsp-20090421 (r:13086) libspandsp: update to snapshot spandsp-20090427 (r:13177) libspeex: Add visibility support for suncc on solaris (r:13117,13118) @@ -203,6 +226,7 @@ mod_commands: add "stun" fsapi command (r:13137) mod_commands: mod_commands: if no bind ip specified for stun fsapi command, use the guess ip (r:13140) mod_commands: add show channels like %foo% (no % in the string implies wrapped in %, no spaces allowed in match string (r:13193) + mod_commands: Add max-sessions to status (MODAPP-254/r:13373) mod_conference: fix read terminating on single digit when called from a meta-app inside a conference (MODAPP-226/r:12466) mod_conference: recording members should be invisible to commands (MODAPP-233/r:12582) mod_conference: add lock caller_control (r:12787) @@ -218,6 +242,7 @@ mod_conference: add transfer action to caller-controls (r:13194) mod_conference: fix dtmf queue issue in dist-dtmf feature (MODAPP-268/r:13206) mod_conference: add execute_application to custom controls (r:13216) + mod_conference: disallow spaces in conference names (MODAPP-219/r:13313) mod_console: Fix mod_console (missing FD_ZERO before FD_SET) (r:13126) mod_dahdi_codec: delay init of resources until the first time they are actually used to avoid unnecessary waste of resources in hardware codec (r:12962) mod_dahdi_codec: set mod_dahdi_codec dahdi transcoding device sockets to non-blocking to avoid hanging when there is no data and just return 0 bytes frame (MODCODEC-8/r:13257) @@ -228,6 +253,7 @@ mod_dingaling: fix core dump when calling Gtalk enabled FS using leg_timeout (MODENDP-199/r:12641) mod_dingaling: dl_login command line Usage and parameter doesn't match (MODENDP-202/r:12680) mod_dingaling: fix unload mod_dingaling core dump (MODENDP-204/r:12680) + mod_dingaling: fix small memory (r:13374) mod_dptools: prevent system crash when "user" in originate dialstring (FSCORE-313/r:12395) mod_dptools: added sched_heartbeat and enable_heartbeat dialplan apps (r:12491) mod_dptools: fix b & c legs not bridging when attended transfer used (FSCORE-334/r:12649) @@ -236,13 +262,17 @@ mod_dptools: improvements to presence function (r:13164) mod_dptools: add group_recurse_variables and user_recurse_variables to {} vars (default is true, set to false to not pass vars down to user or group channels) (r:13241,13246) mod_dptools: add param dial-timeout to directory (MODAPP-271/r:13247) + mod_dptools: add set current_application_response channel variable (MODAPP-273/r:13298) + mod_dptools: fix SEGV in strncasecmp call (MODAPP-278/r:13317) mod_enum: fix enum_auto_route (MODAPP220/r:12243) mod_erlang_event: Bind to 0.0.0.0 instead of 127.0.0.1 by default; like most erlang nodes do. (r:12249) mod_erlang_event: Reply appropriately to net_adm:ping() (r:13066) mod_erlang_event: snprintf needs a format string too, and write has the warn_unused_result attribute set, so store the return value somewhere (r:13090) + mod_erlang_event: fix erlang autoconf macro to deal with edge cases (MODEVENT-45/r:13288) mod_event_socket: disallow unloading mod_event_socket from event socket (r:12326,12334) mod_event_socket: fix api_exec crash on OSX (MODEVENT-40,r:12349) mod_event_socket: move connect command to always work on outbound socket not just the first time (r:12723) + mod_fax: can't print base 8 number that has a 9 in it.. use stringified version instead (r:13312) mod_fifo: consumer callback waiting an option in fifo.conf.xml (r:12685) mod_fifo: add fire events on bridge in fifo (r:12791) mod_fifo: fix fifo re-parse crash (FSCORE-343/r:12855) @@ -258,6 +288,7 @@ mod_iax: autoflush these channels that use queues (r:13057) mod_lcr: allow channel vars in custom_sql (r:12198) mod_lcr: Add ifdefs around odbc calls in shutdown function (r:13268) + mod_lcr: Adjust handling of strip parameters so entire number can be stripped (MODAPP-279/r:13365) mod_limit: Add events and a shutdown function (r:12497) mod_limit: close odbc handle (r:12632) mod_limit: Add more error checking to hash api/app (r:13007) @@ -278,6 +309,7 @@ mod_lua: windows build changes to support externally built modules. (MODLANG-101/r:12237) mod_lua: fix visibility support (FSCORE-302/r:12239-12240) mod_lua: fix windows build (FSBUILD-149/r:12919) + mod_lua: fix memory leak (MODLANG-111/r:13298) mod_memcache: add new module, mod_memcache; API for memcached (r:12871) mod_memcache: make -ERR for API call less verbose (r:12949) mod_memcache: add hook reloadxml event (r:12950) @@ -370,6 +402,13 @@ mod_sofia: Fix incoming anonymous from MetaSwitch will not bridge (SFSIP-144/r:13266) mod_sofia: Fix command "sofia xmlstatus profile internal reg" returns invalid xml text (SFSIP-145/r:13267) mod_sofia: Allow retrieval of redirect contact uri parameters via channel variable (MODSOFIA-7/r:13271) + mod_sofia: Fix Polycom SRTP (r:13295) + mod_sofia: preserve the transport on SLA interactions, still needs work for TLS but should work for UDP and TCP (r:13303) + mod_sofia: now pickup, barge-in and various other things will work with SLA is turned on (r:13306) + mod_sofia: Add ability to supply call-id when using SEND_INFO (MODENDP-219/r:13357) + mod_sofia: Allow sending the flush/reboot all the registration of a domain (MODENDP-187/r:13363) + mod_sofia: Fix double re-register problem (SFSIP-143/r:13384) + mod_sofia: make autoflush on bridge the default (r:13389) mod_spy: add new module, mod_spy (MODAPP-260/r:13035,13036) mod_syslog: Keep the indent string in memory (LOGGER-1/r:12852) mod_t38gateway: Introduction of the skeleton of a media bug implementing a T.38 gateway, so the @@ -385,10 +424,14 @@ mod_voicemail: message-query-exact-match global param in settings section of voicemail to assume profile names match domain names (r:13138) mod_voicemail: allow unload and reload of mod_voicemail (MODAPP-177/r:13145) mod_voicemail: expand the right variable (r:13272) + mod_voicemail: rework vm_boxcount api and add an optional profile parameter (r:13283) + mod_voicemail: add voicemail disk quota (MODAPP-173/r:13314) + mod_voicemail: abolish mailbox attribute in users and use number-alias attribute instead (MODAPP-218/r:13377,13378,13379,13380,13381) mod_xml_curl: fix data fetch (MODXMLINT-48/r:12586) sofia-sip: su.h - define su_family via struct sockaddr (r:12260) sofia-sip: sip_parser.c - fixed sip_transport_d() (r:12261) spandsp: update to snapshot 20090308 (r:12514) + spandsp: update to spandsp-0.0.6pre12 support: Add print_list gdb macro (r:12687) From mikej at freeswitch.org Tue May 19 13:12:32 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Tue, 19 May 2009 15:12:32 -0500 Subject: [Freeswitch-svn] [commit] r13392 - in freeswitch/trunk/src: . include Message-ID: Author: mikej Date: Tue May 19 15:12:32 2009 New Revision: 13392 Log: fix windows pch Modified: freeswitch/trunk/src/include/switch.h freeswitch/trunk/src/switch_apr.c freeswitch/trunk/src/switch_core.c Modified: freeswitch/trunk/src/include/switch.h ============================================================================== --- freeswitch/trunk/src/include/switch.h (original) +++ freeswitch/trunk/src/include/switch.h Tue May 19 15:12:32 2009 @@ -59,9 +59,19 @@ #define _XOPEN_SOURCE 600 #endif #endif +#ifdef __linux__ +#ifndef _BSD_SOURCE +#define _BSD_SOURCE +#endif +#endif #ifndef __BSD_VISIBLE #define __BSD_VISIBLE 1 #endif +#ifdef __linux__ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif +#endif #endif #include #include Modified: freeswitch/trunk/src/switch_apr.c ============================================================================== --- freeswitch/trunk/src/switch_apr.c (original) +++ freeswitch/trunk/src/switch_apr.c Tue May 19 15:12:32 2009 @@ -30,12 +30,6 @@ * */ -#ifdef __linux__ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif -#endif - #include #ifndef WIN32 #include Modified: freeswitch/trunk/src/switch_core.c ============================================================================== --- freeswitch/trunk/src/switch_core.c (original) +++ freeswitch/trunk/src/switch_core.c Tue May 19 15:12:32 2009 @@ -34,9 +34,6 @@ */ -#ifdef __linux__ -#define _BSD_SOURCE -#endif #include #include From mikej at freeswitch.org Tue May 19 13:13:57 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Tue, 19 May 2009 15:13:57 -0500 Subject: [Freeswitch-svn] [commit] r13393 - freeswitch/trunk/src/mod/formats/mod_file_string Message-ID: Author: mikej Date: Tue May 19 15:13:57 2009 New Revision: 13393 Log: svn::ignore Modified: freeswitch/trunk/src/mod/formats/mod_file_string/ (props changed) From mikej at freeswitch.org Tue May 19 13:24:53 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Tue, 19 May 2009 15:24:53 -0500 Subject: [Freeswitch-svn] [commit] r13394 - freeswitch/trunk/src/mod/applications/mod_voicemail Message-ID: Author: mikej Date: Tue May 19 15:24:53 2009 New Revision: 13394 Log: fix var scope masking 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 May 19 15:24:53 2009 @@ -3041,17 +3041,17 @@ } if (disk_quota) { - callback_t cbt = { 0 }; - char sql[256]; + callback_t callback = { 0 }; + char sqlstmt[256]; char disk_usage[256]; - cbt.buf = disk_usage; - cbt.len = sizeof(disk_usage); + callback.buf = disk_usage; + callback.len = sizeof(disk_usage); - switch_snprintf(sql, sizeof(sql), + switch_snprintf(sqlstmt, sizeof(sqlstmt), "select sum(message_len) from voicemail_msgs where username='%s' and domain='%s'", id, domain_name); - vm_execute_sql_callback(profile, profile->mutex, sql, sql2str_callback, &cbt); + vm_execute_sql_callback(profile, profile->mutex, sql, sql2str_callback, &callback); if (atoi(disk_usage) >= disk_quota) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Voicemail disk quota is exceeded for %s\n", id); From mikej at freeswitch.org Tue May 19 13:25:59 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Tue, 19 May 2009 15:25:59 -0500 Subject: [Freeswitch-svn] [commit] r13395 - in freeswitch/trunk: libs/sofia-sip/libsofia-sip-ua/sresolv libs/udns src Message-ID: Author: mikej Date: Tue May 19 15:25:59 2009 New Revision: 13395 Log: build: fix gcc-4.4.0 build failures (FSCORE-355) Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c freeswitch/trunk/libs/udns/udns_resolver.c freeswitch/trunk/src/switch_stun.c freeswitch/trunk/src/switch_utils.c Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c ============================================================================== --- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c (original) +++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sresolv/sres.c Tue May 19 15:25:59 2009 @@ -3486,15 +3486,17 @@ if (from == NULL) ; else if (from->ss_family == AF_INET) { - struct sockaddr_in const *sin = (void *)from; - su_inet_ntop(AF_INET, &sin->sin_addr, host, sizeof host); - port = sin->sin_port; + struct sockaddr_in sin; + memcpy(&sin, from, sizeof sin); + su_inet_ntop(AF_INET, &sin.sin_addr, host, sizeof host); + port = sin.sin_port; } #if HAVE_SIN6 else if (from->ss_family == AF_INET6) { - struct sockaddr_in6 const *sin6 = (void *)from; - su_inet_ntop(AF_INET6, &sin6->sin6_addr, host, sizeof host); - port = sin6->sin6_port; + struct sockaddr_in6 sin6; + memcpy(&sin6, from, sizeof sin6); + su_inet_ntop(AF_INET6, &sin6.sin6_addr, host, sizeof host); + port = sin6.sin6_port; } #endif Modified: freeswitch/trunk/libs/udns/udns_resolver.c ============================================================================== --- freeswitch/trunk/libs/udns/udns_resolver.c (original) +++ freeswitch/trunk/libs/udns/udns_resolver.c Tue May 19 15:25:59 2009 @@ -739,7 +739,7 @@ sns = &ctx->dnsc_serv[i]; if (sns->sa.sa_family == AF_INET) { sin6.sin6_port = sns->sin.sin_port; - ((struct in_addr*)&sin6.sin6_addr)[3] = sns->sin.sin_addr; + memcpy(&sin6.sin6_addr.s6_addr[12], &sns->sin.sin_addr, sizeof(struct in_addr)); sns->sin6 = sin6; } } Modified: freeswitch/trunk/src/switch_stun.c ============================================================================== --- freeswitch/trunk/src/switch_stun.c (original) +++ freeswitch/trunk/src/switch_stun.c Tue May 19 15:25:59 2009 @@ -549,7 +549,8 @@ case SWITCH_STUN_ATTR_MAPPED_ADDRESS: if (attr->type) { if (funny) { - ((switch_stun_ip_t *) attr->value)->address ^= ntohl(0xabcdabcd); + switch_stun_ip_t *tmp = (switch_stun_ip_t *)attr->value; + tmp->address ^= ntohl(0xabcdabcd); } switch_stun_packet_attribute_get_mapped_address(attr, rip, &rport); } Modified: freeswitch/trunk/src/switch_utils.c ============================================================================== --- freeswitch/trunk/src/switch_utils.c (original) +++ freeswitch/trunk/src/switch_utils.c Tue May 19 15:25:59 2009 @@ -1151,14 +1151,15 @@ int flags) { char host[NI_MAXHOST], serv[NI_MAXSERV]; - struct sockaddr_storage ss; + struct sockaddr_in6 si6; const struct sockaddr *addr; const char *colon; if (flags & SWITCH_URI_NO_SCOPE && sa->family == AF_INET6) { - memcpy(&ss, &sa->sa, sa->salen); - ((struct sockaddr_in6*) (intptr_t) &ss)->sin6_scope_id = 0; - addr = (const struct sockaddr*) (intptr_t)&ss; + memcpy(&si6, &sa->sa, sa->salen); + si6.sin6_scope_id = 0; + + addr = (const struct sockaddr*) &si6; } else { addr = (const struct sockaddr*) (intptr_t)&sa->sa; } From mikej at freeswitch.org Tue May 19 13:49:37 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Tue, 19 May 2009 15:49:37 -0500 Subject: [Freeswitch-svn] [commit] r13396 - freeswitch/trunk/src/mod/endpoints/mod_dingaling Message-ID: Author: mikej Date: Tue May 19 15:49:37 2009 New Revision: 13396 Log: mod_dingaling: add dingaling status fsapi command (MODENDP-212) Modified: freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c Modified: freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c Tue May 19 15:49:37 2009 @@ -204,6 +204,7 @@ SWITCH_STANDARD_API(dl_logout); SWITCH_STANDARD_API(dl_pres); SWITCH_STANDARD_API(dl_debug); +SWITCH_STANDARD_API(dingaling); 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_destroy(switch_core_session_t *session); @@ -1827,11 +1828,13 @@ #define LOGOUT_SYNTAX "dl_logout " #define LOGIN_SYNTAX "Existing Profile:\ndl_login profile=\nDynamic Profile:\ndl_login var1=val1;var2=val2;varN=valN\n" #define DEBUG_SYNTAX "dl_debug [true|false]" +#define DINGALING_SYNTAX "dingaling [status]" SWITCH_ADD_API(api_interface, "dl_debug", "DingaLing Debug", dl_debug, DEBUG_SYNTAX); SWITCH_ADD_API(api_interface, "dl_pres", "DingaLing Presence", dl_pres, PRES_SYNTAX); SWITCH_ADD_API(api_interface, "dl_logout", "DingaLing Logout", dl_logout, LOGOUT_SYNTAX); SWITCH_ADD_API(api_interface, "dl_login", "DingaLing Login", dl_login, LOGIN_SYNTAX); + SWITCH_ADD_API(api_interface, "dingaling", "DingaLing Menu", dingaling, DINGALING_SYNTAX); SWITCH_ADD_CHAT(chat_interface, MDL_CHAT_PROTO, chat_send); /* indicate that the module should continue to be loaded */ @@ -2089,6 +2092,53 @@ return SWITCH_STATUS_SUCCESS; } +SWITCH_STANDARD_API(dingaling) +{ + char *argv[10] = { 0 }; + int argc = 0; + void *val; + char *myarg = NULL; + mdl_profile_t *profile = NULL; + switch_hash_index_t *hi; + switch_status_t status = SWITCH_STATUS_SUCCESS; + + if (session) return status; + + if (switch_strlen_zero(cmd) || !(myarg = strdup(cmd))) { + stream->write_function(stream, "USAGE: %s\n", DINGALING_SYNTAX); + return SWITCH_STATUS_FALSE; + } + + if ((argc = switch_separate_string(myarg, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) != 1) { + stream->write_function(stream, "USAGE: %s\n", DINGALING_SYNTAX); + goto done; + } + + if (argv[0] && !strncasecmp(argv[0], "status", 6)) { + stream->write_function(stream, "--DingaLing status--\n"); + stream->write_function(stream, "login | connected\n"); + for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) { + switch_hash_this(hi, NULL, NULL, &val); + profile = (mdl_profile_t *) val; + stream->write_function(stream, "%s | ", profile->login); + if (ldl_handle_authorized(profile->handle)){ + stream->write_function(stream, "AUTHORIZED"); + } else if (ldl_handle_connected(profile->handle)){ + stream->write_function(stream, "CONNECTED"); + } else { + stream->write_function(stream, "UNCONNECTED"); + } + stream->write_function(stream, "\n"); + } + } else { + stream->write_function(stream, "USAGE: %s\n", DINGALING_SYNTAX); + } + +done: + switch_safe_free(myarg); + return status; +} + SWITCH_STANDARD_API(dl_login) { char *argv[10] = { 0 }; From mikej at freeswitch.org Tue May 19 14:16:03 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Tue, 19 May 2009 16:16:03 -0500 Subject: [Freeswitch-svn] [commit] r13397 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: mikej Date: Tue May 19 16:16:03 2009 New Revision: 13397 Log: mod_sofia: add contact-user profile param to override default contact username for a profile (MODSOFIA-8) Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.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 Tue May 19 16:16:03 2009 @@ -56,6 +56,7 @@ #define MAX_CODEC_CHECK_FRAMES 50 #define MAX_MISMATCH_FRAMES 3 #define MODNAME "mod_sofia" +#define SOFIA_DEFAULT_CONTACT_USER MODNAME static const switch_state_handler_table_t noop_state_handler = { 0 }; struct sofia_gateway; typedef struct sofia_gateway sofia_gateway_t; @@ -483,7 +484,8 @@ uint32_t timer_t1; uint32_t timer_t1x64; uint32_t timer_t2; - uint32_t timer_t4; + uint32_t timer_t4; + char *contact_user; }; struct private_object { 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 May 19 16:16:03 2009 @@ -2017,6 +2017,7 @@ sofia_set_pflag(profile, PFLAG_AUTOFIX_TIMING); sofia_set_pflag(profile, PFLAG_MESSAGE_QUERY_ON_REGISTER); sofia_set_pflag(profile, PFLAG_RTP_AUTOFLUSH_DURING_BRIDGE); + profile->contact_user = SOFIA_DEFAULT_CONTACT_USER; for (param = switch_xml_child(settings, "param"); param; param = param->next) { char *var = (char *) switch_xml_attr_soft(param, "name"); @@ -2312,6 +2313,8 @@ } else { sofia_clear_pflag(profile, PFLAG_AUTOFIX_TIMING); } + } else if (!strcasecmp(var, "contact-user")) { + profile->contact_user = switch_core_strdup(profile->pool, val); } else if (!strcasecmp(var, "nat-options-ping")) { if (switch_true(val)) { sofia_set_pflag(profile, PFLAG_NAT_OPTIONS_PING); @@ -2534,7 +2537,8 @@ if (profile->extsipip) { char *ipv6 = strchr(profile->extsipip, ':'); profile->url = switch_core_sprintf(profile->pool, - "sip:mod_sofia@%s%s%s:%d", + "sip:%s@%s%s%s:%d", + profile->contact_user, ipv6 ? "[" : "", profile->extsipip, ipv6 ? "]" : "", @@ -2543,7 +2547,8 @@ } else { char *ipv6 = strchr(profile->sipip, ':'); profile->url = switch_core_sprintf(profile->pool, - "sip:mod_sofia@%s%s%s:%d", + "sip:%s@%s%s%s:%d", + profile->contact_user, ipv6 ? "[" : "", profile->sipip, ipv6 ? "]" : "", @@ -2570,13 +2575,15 @@ char *ipv6 = strchr(profile->extsipip, ':'); profile->tls_url = switch_core_sprintf(profile->pool, - "sip:mod_sofia@%s%s%s:%d", + "sip:%s@%s%s%s:%d", + profile->contact_user, ipv6 ? "[" : "", profile->extsipip, ipv6 ? "]" : "", profile->tls_sip_port); profile->tls_bindurl = switch_core_sprintf(profile->pool, - "sips:mod_sofia@%s%s%s:%d;maddr=%s", + "sips:%s@%s%s%s:%d;maddr=%s", + profile->contact_user, ipv6 ? "[" : "", profile->extsipip, ipv6 ? "]" : "", @@ -2586,14 +2593,16 @@ char *ipv6 = strchr(profile->sipip, ':'); profile->tls_url = switch_core_sprintf(profile->pool, - "sip:mod_sofia@%s%s%s:%d", + "sip:%s@%s%s%s:%d", + profile->contact_user, ipv6 ? "[" : "", profile->sipip, ipv6 ? "]" : "", profile->tls_sip_port); profile->tls_bindurl = switch_core_sprintf(profile->pool, - "sips:mod_sofia@%s%s%s:%d", + "sips:%s@%s%s%s:%d", + profile->contact_user, ipv6 ? "[" : "", profile->sipip, ipv6 ? "]" : "", From mikej at freeswitch.org Tue May 19 14:25:52 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Tue, 19 May 2009 16:25:52 -0500 Subject: [Freeswitch-svn] [commit] r13398 - freeswitch/trunk/src Message-ID: Author: mikej Date: Tue May 19 16:25:52 2009 New Revision: 13398 Log: core: fix segfault on out of memory situation. (FSCORE-366) Modified: freeswitch/trunk/src/switch_xml.c Modified: freeswitch/trunk/src/switch_xml.c ============================================================================== --- freeswitch/trunk/src/switch_xml.c (original) +++ freeswitch/trunk/src/switch_xml.c Tue May 19 16:25:52 2009 @@ -2316,8 +2316,9 @@ static const char *ent[] = { "lt;", "<", "gt;", ">", "quot;", """, "apos;", "'", "amp;", "&", NULL }; - switch_xml_root_t root = (switch_xml_root_t) memset(malloc(sizeof(struct switch_xml_root)), - '\0', sizeof(struct switch_xml_root)); + switch_xml_root_t root = (switch_xml_root_t) malloc(sizeof(struct switch_xml_root)); + if (!root) return NULL; + memset(root, '\0', sizeof(struct switch_xml_root)); root->xml.name = (char *) name; root->cur = &root->xml; strcpy(root->err, root->xml.txt = (char *)""); @@ -2372,9 +2373,9 @@ { switch_xml_t child; - if (!xml) - return NULL; - child = (switch_xml_t) memset(malloc(sizeof(struct switch_xml)), '\0', sizeof(struct switch_xml)); + if (!xml) return NULL; + if (!(child = (switch_xml_t) malloc(sizeof(struct switch_xml)))) return NULL; + memset(child, '\0', sizeof(struct switch_xml)); child->name = (char *) name; child->attr = SWITCH_XML_NIL; child->off = off; From mikej at freeswitch.org Tue May 19 17:50:09 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Tue, 19 May 2009 19:50:09 -0500 Subject: [Freeswitch-svn] [commit] r13399 - freeswitch/trunk/src/include Message-ID: Author: mikej Date: Tue May 19 19:50:09 2009 New Revision: 13399 Log: OCD Modified: freeswitch/trunk/src/include/switch_rtp.h Modified: freeswitch/trunk/src/include/switch_rtp.h ============================================================================== --- freeswitch/trunk/src/include/switch_rtp.h (original) +++ freeswitch/trunk/src/include/switch_rtp.h Tue May 19 19:50:09 2009 @@ -45,7 +45,8 @@ #define SWITCH_RTP_KEY_LEN 30 #define SWITCH_RTP_CRYPTO_KEY_32 "AES_CM_128_HMAC_SHA1_32" #define SWITCH_RTP_CRYPTO_KEY_80 "AES_CM_128_HMAC_SHA1_80" - typedef enum { + +typedef enum { SWITCH_RTP_CRYPTO_SEND, SWITCH_RTP_CRYPTO_RECV, SWITCH_RTP_CRYPTO_MAX From anthm at freeswitch.org Wed May 20 06:02:41 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 20 May 2009 08:02:41 -0500 Subject: [Freeswitch-svn] [commit] r13400 - freeswitch/trunk/src Message-ID: Author: anthm Date: Wed May 20 08:02:41 2009 New Revision: 13400 Log: treat app::arg syntax in execute_on_answer as a broadcast request 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 Wed May 20 08:02:41 2009 @@ -1893,12 +1893,17 @@ char *arg = NULL; app = switch_core_session_strdup(channel->session, var); - - if ((arg = strchr(app, ' '))) { - *arg++ = '\0'; + + if ((arg = strchr(app, ':')) && *(arg+1) == ':') { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s execute on answer: %s (BROADCAST)\n", channel->name, app); + switch_ivr_broadcast(switch_core_session_get_uuid(channel->session), app, SMF_NONE); + } else { + if ((arg = strchr(app, ' '))) { + *arg++ = '\0'; + } + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s execute on answer: %s(%s)\n", channel->name, app, switch_str_nil(arg)); + switch_core_session_execute_application(channel->session, app, arg); } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s execute on answer: %s(%s)", channel->name, app, switch_str_nil(arg)); - switch_core_session_execute_application(channel->session, app, arg); } switch_channel_audio_sync(channel); From mikej at freeswitch.org Wed May 20 07:21:54 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Wed, 20 May 2009 09:21:54 -0500 Subject: [Freeswitch-svn] [commit] r13401 - freeswitch/trunk Message-ID: Author: mikej Date: Wed May 20 09:21:54 2009 New Revision: 13401 Log: attempt to remove regression caused by r13362 Modified: freeswitch/trunk/configure.in Modified: freeswitch/trunk/configure.in ============================================================================== --- freeswitch/trunk/configure.in (original) +++ freeswitch/trunk/configure.in Wed May 20 09:21:54 2009 @@ -337,11 +337,11 @@ AC_CHECK_LIB(rt, clock_nanosleep, [AC_DEFINE(HAVE_CLOCK_NANOSLEEP, 1, [Define if you have clock_nanosleep()])]) AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket)) -AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct tm.__tm_gmtoff],,,[ +AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[ #include #include ]) -AC_CHECK_MEMBERS([struct tm.tm_zone, struct tm.__tm_zone],,,[ +AC_CHECK_MEMBERS([struct tm.tm_zone],,,[ #include #include ]) From anthm at freeswitch.org Wed May 20 13:51:35 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 20 May 2009 15:51:35 -0500 Subject: [Freeswitch-svn] [commit] r13402 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Wed May 20 15:51:35 2009 New Revision: 13402 Log: add proxy-follow-redirect flag (experimental) 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_glue.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 May 20 15:51:35 2009 @@ -191,6 +191,7 @@ PFLAG_AUTOFIX_TIMING, PFLAG_MESSAGE_QUERY_ON_REGISTER, PFLAG_RTP_AUTOFLUSH_DURING_BRIDGE, + PFLAG_PROXY_FOLLOW_REDIRECT, /* No new flags below this line */ PFLAG_MAX } PFLAGS; @@ -559,6 +560,7 @@ char *record_route; char *extrtpip; char *stun_ip; + char *route_uri; switch_port_t stun_port; uint32_t stun_flags; unsigned long rm_rate; 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 May 20 15:51:35 2009 @@ -2897,6 +2897,12 @@ sip_contact_t * p_contact = sip->sip_contact; int i = 0; char var_name[80]; + + if (tech_pvt->route_uri && p_contact && p_contact->m_url) { + tech_pvt->route_uri = switch_core_session_strdup(tech_pvt->session, (const char *) p_contact->m_url); + nua_set_hparams(tech_pvt->nh, NUTAG_PROXY(tech_pvt->route_uri)); + } + while (p_contact) { if (p_contact->m_url) { 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 May 20 15:51:35 2009 @@ -1597,6 +1597,7 @@ if (route_uri) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Setting proxy route to %s\n", route_uri, switch_channel_get_name(channel)); + tech_pvt->route_uri = switch_core_session_strdup(tech_pvt->session, route_uri); } nua_invite(tech_pvt->nh, @@ -1609,7 +1610,7 @@ TAG_IF(!switch_strlen_zero(alert_info), SIPTAG_HEADER_STR(alert_info)), TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)), TAG_IF(!switch_strlen_zero(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)), - TAG_IF(route_uri, NUTAG_PROXY(route_uri)), + TAG_IF(tech_pvt->route_uri, NUTAG_PROXY(tech_pvt->route_uri)), TAG_IF(route, SIPTAG_ROUTE_STR(route)), TAG_IF(!switch_strlen_zero(sendto), NUTAG_PROXY(sendto)), SOATAG_ADDRESS(tech_pvt->adv_sdp_audio_ip), From anthm at freeswitch.org Wed May 20 14:01:51 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 20 May 2009 16:01:51 -0500 Subject: [Freeswitch-svn] [commit] r13403 - freeswitch/trunk/src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Wed May 20 16:01:51 2009 New Revision: 13403 Log: add proxy-follow-redirect flag (experimental) 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 May 20 16:01:51 2009 @@ -1565,6 +1565,12 @@ } else { sofia_clear_pflag(profile, PFLAG_RTP_AUTOFLUSH_DURING_BRIDGE); } + } else if (!strcasecmp(var, "proxy-follow-redirect")) { + if (switch_true(val)) { + sofia_set_pflag(profile, PFLAG_PROXY_FOLLOW_REDIRECT); + } else { + sofia_clear_pflag(profile, PFLAG_PROXY_FOLLOW_REDIRECT); + } } else if (!strcasecmp(var, "outbound-use-uuid-as-callid")) { if (switch_true(val)) { sofia_set_pflag(profile, PFLAG_UUID_AS_CALLID); @@ -2075,6 +2081,12 @@ } else { sofia_clear_pflag(profile, PFLAG_RTP_AUTOFLUSH_DURING_BRIDGE); } + } else if (!strcasecmp(var, "proxy-follow-redirect")) { + if (switch_true(val)) { + sofia_set_pflag(profile, PFLAG_PROXY_FOLLOW_REDIRECT); + } else { + sofia_clear_pflag(profile, PFLAG_PROXY_FOLLOW_REDIRECT); + } } else if (!strcasecmp(var, "inbound-proxy-media") && switch_true(val)) { sofia_set_flag(profile, TFLAG_PROXY_MEDIA); } else if (!strcasecmp(var, "force-subscription-expires")) { @@ -2898,12 +2910,11 @@ int i = 0; char var_name[80]; - if (tech_pvt->route_uri && p_contact && p_contact->m_url) { + if (sofia_test_pflag(profile, PFLAG_PROXY_FOLLOW_REDIRECT) && tech_pvt->route_uri && p_contact && p_contact->m_url) { tech_pvt->route_uri = switch_core_session_strdup(tech_pvt->session, (const char *) p_contact->m_url); - nua_set_hparams(tech_pvt->nh, NUTAG_PROXY(tech_pvt->route_uri)); + nua_set_hparams(tech_pvt->nh, NUTAG_PROXY(tech_pvt->route_uri), TAG_END()); } - while (p_contact) { if (p_contact->m_url) { if (p_contact->m_url->url_user) { From moy at freeswitch.org Wed May 20 14:28:17 2009 From: moy at freeswitch.org (FreeSWITCH SVN) Date: Wed, 20 May 2009 16:28:17 -0500 Subject: [Freeswitch-svn] [commit] r13404 - freeswitch/trunk/src/mod/codecs/mod_dahdi_codec Message-ID: Author: moy Date: Wed May 20 16:28:17 2009 New Revision: 13404 Log: add 30ms G729 codec in mod_dahdi_codec Modified: freeswitch/trunk/src/mod/codecs/mod_dahdi_codec/mod_dahdi_codec.c Modified: freeswitch/trunk/src/mod/codecs/mod_dahdi_codec/mod_dahdi_codec.c ============================================================================== --- freeswitch/trunk/src/mod/codecs/mod_dahdi_codec/mod_dahdi_codec.c (original) +++ freeswitch/trunk/src/mod/codecs/mod_dahdi_codec/mod_dahdi_codec.c Wed May 20 16:28:17 2009 @@ -532,6 +532,31 @@ switch_dahdi_decode, /* function to decode encoded data into raw data */ switch_dahdi_destroy); /* deinitalize a codec handle using this implementation */ + mpf = 30000; + spf = 240; + bpfd = 480; + bpfc = 30; + fpnp = 30; + switch_core_codec_add_implementation(pool, + codec_interface, + SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */ + 18, /* the IANA code number */ + "G729", /* the IANA code name */ + NULL, /* default fmtp to send (can be overridden by the init function) */ + 8000, /* samples transferred per second */ + 8000, /* actual samples transferred per second */ + 8000, /* bits transferred per second */ + mpf, /* number of microseconds per frame */ + spf, /* number of samples per frame */ + bpfd, /* number of bytes per frame decompressed */ + bpfc, /* number of bytes per frame compressed */ + 1, /* number of channels represented */ + fpnp, /* number of frames per network packet */ + switch_dahdi_init, /* function to initialize a codec handle using this implementation */ + switch_dahdi_encode, /* function to encode raw data into encoded data */ + switch_dahdi_decode, /* function to decode encoded data into raw data */ + switch_dahdi_destroy); /* deinitalize a codec handle using this implementation */ + SWITCH_ADD_CODEC(codec_interface, "DAHDI G.723.1 5.3k"); /* 5.3kbit */ mpf = 30000; /* Algorithmic delay of 37.5ms with 7.5ms of look-ahead delay */ spf = 240; From anthm at freeswitch.org Wed May 20 14:32:11 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Wed, 20 May 2009 16:32:11 -0500 Subject: [Freeswitch-svn] [commit] r13405 - in freeswitch/trunk: libs/apr/build src/mod/endpoints/mod_sofia Message-ID: Author: anthm Date: Wed May 20 16:32:11 2009 New Revision: 13405 Log: one least tweak to last 2 commits Modified: freeswitch/trunk/libs/apr/build/config.sub freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Modified: freeswitch/trunk/libs/apr/build/config.sub ============================================================================== --- freeswitch/trunk/libs/apr/build/config.sub (original) +++ freeswitch/trunk/libs/apr/build/config.sub Wed May 20 16:32:11 2009 @@ -1,10 +1,9 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, -# Inc. +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2006-07-02' +timestamp='2003-06-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -22,15 +21,14 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. - # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # @@ -72,7 +70,7 @@ version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -85,11 +83,11 @@ while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; + echo "$timestamp" ; exit 0 ;; --version | -v ) - echo "$version" ; exit ;; + echo "$version" ; exit 0 ;; --help | --h* | -h ) - echo "$usage"; exit ;; + echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -101,7 +99,7 @@ *local*) # First pass through any local machine types. echo $1 - exit ;; + exit 0;; * ) break ;; @@ -120,9 +118,7 @@ # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) + nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -148,7 +144,7 @@ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray) + -apple | -axis) os= basic_machine=$1 ;; @@ -173,10 +169,6 @@ -hiux*) os=-hiuxwe2 ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` @@ -193,10 +185,6 @@ # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` @@ -240,17 +228,14 @@ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | bfin \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore \ + | ip2k \ + | m32r | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -259,32 +244,28 @@ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ - | mt \ | msp430 \ - | nios | nios2 \ | ns16k | ns32k \ - | or32 \ + | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | s390 | s390x \ + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ + | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ - | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ + | x86 | xscale | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; @@ -295,9 +276,6 @@ ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; - ms1) - basic_machine=mt-unknown - ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and @@ -317,20 +295,20 @@ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | bfin-* | bs2000-* \ + | avr-* \ + | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | craynv-* | cydra-* \ + | clipper-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | m32c-* | m32r-* | m32rle-* \ + | ip2k-* \ + | m32r-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* \ + | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -339,36 +317,31 @@ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ | msp430-* \ - | nios-* | nios2-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ + | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | s390-* | s390x-* \ + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ | ymp-* \ | z8k-*) ;; @@ -388,9 +361,6 @@ basic_machine=a29k-amd os=-udi ;; - abacus) - basic_machine=abacus-unknown - ;; adobe68k) basic_machine=m68010-adobe os=-scout @@ -408,9 +378,6 @@ amd64) basic_machine=x86_64-pc ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; amdahl) basic_machine=580-amdahl os=-sysv @@ -470,27 +437,12 @@ basic_machine=j90-cray os=-unicos ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16c) - basic_machine=cr16c-unknown - os=-elf - ;; crds | unos) basic_machine=m68k-crds ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; da30 | da30-*) basic_machine=m68k-da30 ;; @@ -513,10 +465,6 @@ basic_machine=m88k-motorola os=-sysv3 ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx @@ -695,6 +643,10 @@ mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; monitor) basic_machine=m68k-rom68k os=-coff @@ -707,9 +659,6 @@ basic_machine=i386-pc os=-msdos ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; mvs) basic_machine=i370-ibm os=-mvs @@ -778,6 +727,10 @@ np1) basic_machine=np1-gould ;; + nv1) + basic_machine=nv1-cray + os=-unicosmp + ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -785,12 +738,9 @@ basic_machine=hppa1.1-oki os=-proelf ;; - openrisc | openrisc-*) + or32 | or32-*) basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 + os=-coff ;; OSE68000 | ose68000) basic_machine=m68000-ericsson @@ -817,12 +767,6 @@ pc532 | pc532-*) basic_machine=ns32k-pc532 ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; @@ -879,10 +823,6 @@ basic_machine=i586-unknown os=-pw32 ;; - rdos) - basic_machine=i386-pc - os=-rdos - ;; rom68k) basic_machine=m68k-rom68k os=-coff @@ -893,12 +833,6 @@ rtpc | rtpc-*) basic_machine=romp-ibm ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; sa29200) basic_machine=a29k-amd os=-udi @@ -1022,10 +956,6 @@ tower | tower-32) basic_machine=m68k-ncr ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; udi29k) basic_machine=a29k-amd os=-udi @@ -1069,10 +999,6 @@ basic_machine=hppa1.1-winbond os=-proelf ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; xps | xps100) basic_machine=xps100-honeywell ;; @@ -1103,9 +1029,6 @@ romp) basic_machine=romp-ibm ;; - mmix) - basic_machine=mmix-knuth - ;; rs6000) basic_machine=rs6000-ibm ;; @@ -1122,10 +1045,13 @@ we32k) basic_machine=we32k-att ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) @@ -1198,23 +1124,19 @@ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers*) + | -powermax* | -dnix* | -nx6 | -nx7 | -sei*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1232,15 +1154,12 @@ os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; @@ -1253,9 +1172,6 @@ -opened*) os=-openedition ;; - -os400*) - os=-os400 - ;; -wince*) os=-wince ;; @@ -1277,9 +1193,6 @@ -atheos*) os=-atheos ;; - -syllable*) - os=-syllable - ;; -386bsd) os=-bsd ;; @@ -1302,9 +1215,6 @@ -sinix*) os=-sysv4 ;; - -tpf*) - os=-tpf - ;; -triton*) os=-sysv3 ;; @@ -1341,9 +1251,6 @@ -kaos*) os=-kaos ;; - -zvmoe) - os=-zvmoe - ;; -none) ;; *) @@ -1366,9 +1273,6 @@ # system, and we'll never get to this point. case $basic_machine in - spu-*) - os=-elf - ;; *-acorn) os=-riscix1.2 ;; @@ -1378,8 +1282,8 @@ arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff + c4x-* | tic4x-*) + os=-coff ;; # This must come before the *-dec entry. pdp10-*) @@ -1424,15 +1328,9 @@ *-be) os=-beos ;; - *-haiku) - os=-haiku - ;; *-ibm) os=-aix ;; - *-knuth) - os=-mmixware - ;; *-wec) os=-proelf ;; @@ -1565,15 +1463,9 @@ -mvs* | -opened*) vendor=ibm ;; - -os400*) - vendor=ibm - ;; -ptx*) vendor=sequent ;; - -tpf*) - vendor=ibm - ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; @@ -1598,7 +1490,7 @@ esac echo $basic_machine$os -exit +exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) 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 May 20 16:32:11 2009 @@ -2911,7 +2911,14 @@ char var_name[80]; if (sofia_test_pflag(profile, PFLAG_PROXY_FOLLOW_REDIRECT) && tech_pvt->route_uri && p_contact && p_contact->m_url) { - tech_pvt->route_uri = switch_core_session_strdup(tech_pvt->session, (const char *) p_contact->m_url); + if (p_contact->m_url->url_port) { + tech_pvt->route_uri = switch_core_session_sprintf(tech_pvt->session, "sip:%s@%s:%s", + p_contact->m_url->url_user, p_contact->m_url->url_host, p_contact->m_url->url_port); + } else { + tech_pvt->route_uri = switch_core_session_sprintf(tech_pvt->session, "sip:%s@%s", + p_contact->m_url->url_user, p_contact->m_url->url_host); + } + nua_set_hparams(tech_pvt->nh, NUTAG_PROXY(tech_pvt->route_uri), TAG_END()); } From brian at freeswitch.org Wed May 20 16:04:05 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Wed, 20 May 2009 18:04:05 -0500 Subject: [Freeswitch-svn] [commit] r13406 - in freeswitch/trunk: . build patches src src/include Message-ID: Author: brian Date: Wed May 20 18:04:05 2009 New Revision: 13406 Log: ZRTP Support please download your SDK from http://www.zfone.com and use build/buildzrtp.sh to build the lib. Added: freeswitch/trunk/build/buildzrtp.sh freeswitch/trunk/patches/zrtp_bnlib_pic.diff Modified: freeswitch/trunk/Makefile.am freeswitch/trunk/configure.in freeswitch/trunk/src/include/switch_types.h freeswitch/trunk/src/switch_core.c freeswitch/trunk/src/switch_rtp.c Modified: freeswitch/trunk/Makefile.am ============================================================================== --- freeswitch/trunk/Makefile.am (original) +++ freeswitch/trunk/Makefile.am Wed May 20 18:04:05 2009 @@ -198,6 +198,10 @@ libfreeswitch_la_LDFLAGS += $(ODBC_LIB_FLAGS) endif +if ENABLE_ZRTP +libfreeswitch_la_LDFLAGS += -lzrtp -lbn +endif + bin_SCRIPTS = scripts/gentls_cert scripts/fsxs src/include/switch_swigable_cpp.h: src/include/switch_cpp.h Added: freeswitch/trunk/build/buildzrtp.sh ============================================================================== --- (empty file) +++ freeswitch/trunk/build/buildzrtp.sh Wed May 20 18:04:05 2009 @@ -0,0 +1,8 @@ +#!/bin/sh +tar zxf libzrtp-0.81.514.tar.gz +cd libzrtp-0.81.514 +patch -p1 < ../patches/zrtp_bnlib_pic.diff +cd projects/gnu/ +./configure CFLAGS="-fPIC" +make +make install Modified: freeswitch/trunk/configure.in ============================================================================== --- freeswitch/trunk/configure.in (original) +++ freeswitch/trunk/configure.in Wed May 20 18:04:05 2009 @@ -264,6 +264,21 @@ fi +AC_ARG_ENABLE(zrtp, + [AS_HELP_STRING([--enable-zrtp], [Compile with zrtp Support])],,[enable_zrtp="no"]) +if test "x$enable_zrtp" = "xyes" ; then + saved_LIBS=$LIBS + LIBS="$saved_LIBS -L/usr/local/lib -lbn -lpthread" + AC_CHECK_LIB(zrtp, zrtp_init, [has_zrtp="yes"], [has_zrtp="no"]) + LIBS=$saved_LIBS + if test "x$has_zrtp" = "xno"; then + AC_ERROR([Cannot locate zrtp libraries]) + fi + APR_ADDTO(SWITCH_AM_CFLAGS, -DENABLE_ZRTP) +fi +AM_CONDITIONAL([ENABLE_ZRTP],[test "x$enable_zrtp" != "xno"]) + + AM_CONDITIONAL([WANT_DEBUG],[test "${enable_debug}" = "yes"]) AC_ARG_ENABLE(core-odbc-support, Added: freeswitch/trunk/patches/zrtp_bnlib_pic.diff ============================================================================== --- (empty file) +++ freeswitch/trunk/patches/zrtp_bnlib_pic.diff Wed May 20 18:04:05 2009 @@ -0,0 +1,5 @@ +--- libzrtp-0.81.514.orig/third_party/bnlib/cfg.debug 2009-03-22 08:26:34.000000000 -0500 ++++ libzrtp-0.81.514.patched/third_party/bnlib/cfg.debug 2009-05-20 11:42:52.000000000 -0500 +@@ -1 +1 @@ +-./configure CFLAGS="-O0 -g3" ++./configure CFLAGS="-O0 -g3 -fPIC" Modified: freeswitch/trunk/src/include/switch_types.h ============================================================================== --- freeswitch/trunk/src/include/switch_types.h (original) +++ freeswitch/trunk/src/include/switch_types.h Wed May 20 18:04:05 2009 @@ -496,7 +496,9 @@ SWITCH_RTP_FLAG_SHUTDOWN = (1 << 19), SWITCH_RTP_FLAG_FLUSH = (1 << 20), SWITCH_RTP_FLAG_AUTOFLUSH = (1 << 21), - SWITCH_RTP_FLAG_STICKY_FLUSH = (1 << 22) + SWITCH_RTP_FLAG_STICKY_FLUSH = (1 << 22), + SWITCH_ZRTP_FLAG_SECURE_SEND = (1 << 23), + SWITCH_ZRTP_FLAG_SECURE_RECV = (1 << 24) } switch_rtp_flag_enum_t; typedef uint32_t switch_rtp_flag_t; Modified: freeswitch/trunk/src/switch_core.c ============================================================================== --- freeswitch/trunk/src/switch_core.c (original) +++ freeswitch/trunk/src/switch_core.c Wed May 20 18:04:05 2009 @@ -36,6 +36,7 @@ #include +#include #include #include "private/switch_core_pvt.h" #ifndef WIN32 @@ -1026,6 +1027,48 @@ return runtime.default_dtmf_duration; } +static void switch_core_set_serial(void) +{ + char buf[13] = ""; + char path[256]; + + int fd = -1, write_fd = -1; + ssize_t bytes = 0; + + switch_snprintf(path, sizeof(path), "%s%sfreeswitch.serial", SWITCH_GLOBAL_dirs.conf_dir, SWITCH_PATH_SEPARATOR); + + + if ((fd = open(path, O_RDONLY, 0)) < 0) { + char *ip = switch_core_get_variable("local_ip_v4"); + uint32_t ipi = 0; + switch_byte_t *byte; + int i = 0; + + switch_inet_pton(AF_INET, ip, &ipi); + byte = (switch_byte_t *) &ipi; + + for(i = 0; i < 8; i += 2) { + switch_snprintf(buf + i, sizeof(buf) - i, "%0.2x", *byte); + byte++; + } + + switch_stun_random_string(buf + 8, 4, "0123456789abcdef"); + + if ((write_fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR)) >= 0) { + bytes = write(write_fd, buf, sizeof(buf)); + close(write_fd); + write_fd = -1; + } + } else { + bytes = read(fd, buf, sizeof(buf)); + close(fd); + fd = -1; + } + + switch_core_set_variable("switch_serial", buf); +} + + SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switch_bool_t console, const char **err) { switch_uuid_t uuid; @@ -1084,12 +1127,14 @@ runtime.flags = flags; runtime.sps_total = 30; + + switch_find_local_ip(guess_ip, sizeof(guess_ip), AF_INET); switch_core_set_variable("local_ip_v4", guess_ip); switch_find_local_ip(guess_ip, sizeof(guess_ip), AF_INET6); switch_core_set_variable("local_ip_v6", guess_ip); switch_core_set_variable("base_dir", SWITCH_GLOBAL_dirs.base_dir); - + switch_core_set_serial(); switch_event_init(runtime.memory_pool); @@ -1253,6 +1298,10 @@ switch_rtp_set_start_port((switch_port_t) atoi(val)); } else if (!strcasecmp(var, "rtp-end-port") && !switch_strlen_zero(val)) { switch_rtp_set_end_port((switch_port_t) atoi(val)); +#ifdef ENABLE_ZRTP + } else if (!strcasecmp(var, "rtp-enable-zrtp")) { + switch_core_set_variable("zrtp_enabled", val); +#endif } } } Modified: freeswitch/trunk/src/switch_rtp.c ============================================================================== --- freeswitch/trunk/src/switch_rtp.c (original) +++ freeswitch/trunk/src/switch_rtp.c Wed May 20 18:04:05 2009 @@ -59,6 +59,8 @@ #define RTP_MAGIC_NUMBER 42 #define MAX_SRTP_ERRS 10 + + static switch_port_t START_PORT = RTP_START_PORT; static switch_port_t END_PORT = RTP_END_PORT; static switch_port_t NEXT_PORT = RTP_START_PORT; @@ -66,6 +68,14 @@ typedef srtp_hdr_t rtp_hdr_t; +#ifdef ENABLE_ZRTP +#include +static zrtp_global_t *zrtp_global; +static zrtp_zid_t zid = { "FreeSWITCH01" }; +static int zrtp_on = 0; + +#endif + #ifdef _MSC_VER #pragma pack(4) #endif @@ -205,6 +215,12 @@ switch_rtp_bug_flag_t rtp_bugs; switch_rtp_stats_t stats; +#ifdef ENABLE_ZRTP + zrtp_session_t *zrtp_session; + zrtp_profile_t *zrtp_profile; + zrtp_stream_t *zrtp_ctx; +#endif + #ifdef RTP_DEBUG_WRITE_DELTA switch_time_t send_time; #endif @@ -397,13 +413,114 @@ WRITE_DEC(rtp_session); } +#ifdef ENABLE_ZRTP +static void zrtp_security_event_callback(zrtp_stream_t *stream, unsigned event) +{ + switch_rtp_t *rtp_session = zrtp_stream_get_userdata(stream); + zrtp_session_info_t zrtp_session_info; + + switch (event) { + case ZRTP_EVENT_IS_SECURE: + zrtp_session_get(rtp_session->zrtp_session, &zrtp_session_info); + zrtp_log_print_sessioninfo(&zrtp_session_info); + + break; + default: + break; + } +} + +static int zrtp_send_rtp_callback(const zrtp_stream_t* stream, char* rtp_packet, unsigned int rtp_packet_length) +{ + switch_rtp_t *rtp_session = zrtp_stream_get_userdata(stream); + switch_size_t len = rtp_packet_length; + zrtp_status_t status = zrtp_status_ok; + + switch_socket_sendto(rtp_session->sock_output, rtp_session->remote_addr, 0, rtp_packet, &len); + return status; +} + +static void zrtp_protocol_event_callback(zrtp_stream_t *stream, unsigned event) +{ + switch_rtp_t *rtp_session = zrtp_stream_get_userdata(stream); + + switch (event) { + case ZRTP_EVENT_IS_SECURE_DONE: + break; + case ZRTP_EVENT_IS_SECURE: + switch_set_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_SEND); + switch_set_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_RECV); + break; + case ZRTP_EVENT_IS_CLIENT_ENROLLMENT: + case ZRTP_EVENT_IS_CLEAR: + case ZRTP_EVENT_IS_INITIATINGSECURE: + case ZRTP_EVENT_IS_PENDINGSECURE: + case ZRTP_EVENT_IS_PENDINGCLEAR: + case ZRTP_EVENT_NO_ZRTP: + case ZRTP_EVENT_LOCAL_SAS_UPDATED: + break; + default: + break; + } +} + +static void zrtp_logger(int level, const char *data, int len) +{ + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s", data); +} + +static void zrtp_handler(switch_rtp_t *rtp_session, switch_socket_t *sock, void *data, switch_size_t datalen, switch_sockaddr_t *from_addr) +{ + zrtp_status_t status = zrtp_status_fail; + unsigned int len = datalen; + + status = zrtp_process_srtp(rtp_session->zrtp_ctx, (char*)data, &len); + switch(status) { + case zrtp_status_ok: + break; + case zrtp_status_drop: + break; + case zrtp_status_fail: + break; + default: + break; + } +} +#endif SWITCH_DECLARE(void) switch_rtp_init(switch_memory_pool_t *pool) { +#ifdef ENABLE_ZRTP + const char *zid_string = switch_core_get_variable("switch_serial"); + const char *zrtp_enabled = switch_core_get_variable("zrtp_enabled"); + zrtp_on = zrtp_enabled ? switch_true(zrtp_enabled) : 0; + zrtp_config_t zrtp_config; + char zrtp_cache_path[256] = ""; +#endif if (global_init) { return; } switch_core_hash_init(&alloc_hash, pool); +#ifdef ENABLE_ZRTP + if (zrtp_on) { + zrtp_config_defaults(&zrtp_config); + strcpy(zrtp_config.client_id, "FreeSWITCH"); + zrtp_config.lic_mode = ZRTP_LICENSE_MODE_ACTIVE; + switch_snprintf(zrtp_cache_path, sizeof(zrtp_cache_path), "%s%szrtp.dat", SWITCH_GLOBAL_dirs.db_dir, SWITCH_PATH_SEPARATOR); + zrtp_zstrcpyc( ZSTR_GV(zrtp_config.def_cache_path), zrtp_cache_path); + zrtp_config.cb.event_cb.on_zrtp_protocol_event = zrtp_protocol_event_callback; + zrtp_config.cb.misc_cb.on_send_packet = zrtp_send_rtp_callback; + zrtp_config.cb.event_cb.on_zrtp_security_event = zrtp_security_event_callback; + + zrtp_log_set_log_engine(zrtp_logger); + zrtp_log_set_level(4); + if (zrtp_status_ok != zrtp_init(&zrtp_config, &zrtp_global)) { + abort(); + } + + memcpy(zid, zid_string, 12); + } +#endif srtp_init(); switch_mutex_init(&port_lock, SWITCH_MUTEX_NESTED, pool); global_init = 1; @@ -435,6 +552,9 @@ switch_core_hash_destroy(&alloc_hash); switch_mutex_unlock(port_lock); +#ifdef ENABLE_ZRTP + zrtp_down(zrtp_global); +#endif crypto_kernel_shutdown(); } @@ -918,6 +1038,29 @@ rtp_session->ready = 1; *new_rtp_session = rtp_session; +#ifdef ENABLE_ZRTP + if (zrtp_on) { + rtp_session->zrtp_profile = switch_core_alloc(rtp_session->pool, sizeof(*rtp_session->zrtp_profile)); + zrtp_profile_defaults(rtp_session->zrtp_profile, zrtp_global); + + if (zrtp_status_ok != zrtp_session_init(zrtp_global, rtp_session->zrtp_profile, zid, 1, &rtp_session->zrtp_session)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error! zRTP INIT Failed\n"); + zrtp_session_down(rtp_session->zrtp_session); + rtp_session->zrtp_session = NULL; + } + + zrtp_session_set_userdata(rtp_session->zrtp_session, rtp_session); + + if (zrtp_status_ok != zrtp_stream_attach(rtp_session->zrtp_session, &rtp_session->zrtp_ctx)) { + abort(); + } + zrtp_stream_set_userdata(rtp_session->zrtp_ctx, rtp_session); + + zrtp_stream_start(rtp_session->zrtp_ctx, rtp_session->ssrc); + + switch_rtp_set_invald_handler(rtp_session, zrtp_handler); + } +#endif return SWITCH_STATUS_SUCCESS; } @@ -1169,7 +1312,23 @@ (*rtp_session)->recv_ctx = NULL; switch_clear_flag((*rtp_session), SWITCH_RTP_FLAG_SECURE_RECV); } +#ifdef ENABLE_ZRTP + /* ZRTP */ + if (zrtp_on) { + if (switch_test_flag((*rtp_session), SWITCH_ZRTP_FLAG_SECURE_SEND)) { + switch_clear_flag((*rtp_session), SWITCH_ZRTP_FLAG_SECURE_SEND); + } + if (switch_test_flag((*rtp_session), SWITCH_ZRTP_FLAG_SECURE_RECV)) { + switch_clear_flag((*rtp_session), SWITCH_ZRTP_FLAG_SECURE_RECV); + } + + if ((*rtp_session)->zrtp_session) { + zrtp_session_down((*rtp_session)->zrtp_session); + (*rtp_session)->zrtp_session = NULL; + } + } +#endif if ((*rtp_session)->timer.timer_interface) { switch_core_timer_destroy(&(*rtp_session)->timer); } @@ -1316,11 +1475,11 @@ } } - wrote =switch_rtp_write_manual(rtp_session, - rtp_session->dtmf_data.out_digit_packet, - 4, - rtp_session->rtp_bugs & RTP_BUG_CISCO_SKIP_MARK_BIT_2833 ? 0 : 1, - rtp_session->te, rtp_session->dtmf_data.timestamp_dtmf, &flags); + wrote = switch_rtp_write_manual(rtp_session, + rtp_session->dtmf_data.out_digit_packet, + 4, + rtp_session->rtp_bugs & RTP_BUG_CISCO_SKIP_MARK_BIT_2833 ? 0 : 1, + rtp_session->te, rtp_session->dtmf_data.timestamp_dtmf, &flags); rtp_session->stats.outbound.raw_bytes += wrote; rtp_session->stats.outbound.dtmf_packet_count++; @@ -1592,7 +1751,7 @@ if (!bytes && (io_flags & SWITCH_IO_FLAG_NOBLOCK)) { return_cng_frame(); - } + } if (check && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTO_CNG) && @@ -1670,6 +1829,30 @@ bytes = sbytes; } +#ifdef ENABLE_ZRTP + /* ZRTP Recv */ + + if (bytes && switch_test_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_RECV)) { + unsigned int sbytes = (int) bytes; + zrtp_status_t stat = 0; + + stat = zrtp_process_srtp(rtp_session->zrtp_ctx, (void *)&rtp_session->recv_msg, &sbytes); + + switch (stat) { + case zrtp_status_ok: + break; + case zrtp_status_drop: + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: zRTP protection drop with code %d\n", stat); + case zrtp_status_fail: + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: zRTP protection fail with code %d\n", stat); + ret = -1; + goto end; + default: + break; + } + bytes = sbytes; + } +#endif #ifdef DEBUG_2833 if (rtp_session->dtmf_data.in_digit_sanity && !(rtp_session->dtmf_data.in_digit_sanity % 100)) { @@ -2235,7 +2418,29 @@ bytes = sbytes; } +#ifdef ENABLE_ZRTP + /* ZRTP Send */ + if (switch_test_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_SEND)) { + unsigned int sbytes = (int) bytes; + zrtp_status_t stat = zrtp_status_fail; + + stat = zrtp_process_rtp(rtp_session->zrtp_ctx, (void*)send_msg, &sbytes); + + switch (stat) { + case zrtp_status_ok: + break; + case zrtp_status_drop: + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: zRTP protection drop with code %d\n", stat); + case zrtp_status_fail: + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: zRTP protection fail with code %d\n", stat); + default: + break; + } + + bytes = sbytes; + } +#endif #ifdef RTP_DEBUG_WRITE_DELTA { @@ -2477,7 +2682,29 @@ } bytes = sbytes; } +#ifdef ENABLE_ZRTP + /* ZRTP Send */ + if (switch_test_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_SEND)) { + unsigned int sbytes = (int) bytes; + zrtp_status_t stat = zrtp_status_fail; + + stat = zrtp_process_rtp(rtp_session->zrtp_ctx, (void*)&rtp_session->write_msg, &sbytes); + + switch (stat) { + case zrtp_status_ok: + break; + case zrtp_status_drop: + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: zRTP protection drop with code %d\n", stat); + case zrtp_status_fail: + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error: zRTP protection fail with code %d\n", stat); + default: + break; + } + + bytes = sbytes; + } +#endif if (switch_socket_sendto(rtp_session->sock_output, rtp_session->remote_addr, 0, (void *) &rtp_session->write_msg, &bytes) != SWITCH_STATUS_SUCCESS) { rtp_session->seq--; ret = -1; From mikej at freeswitch.org Wed May 20 16:05:29 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Wed, 20 May 2009 18:05:29 -0500 Subject: [Freeswitch-svn] [commit] r13407 - freeswitch/trunk/conf/autoload_configs Message-ID: Author: mikej Date: Wed May 20 18:05:28 2009 New Revision: 13407 Log: woops need this too Modified: freeswitch/trunk/conf/autoload_configs/switch.conf.xml Modified: freeswitch/trunk/conf/autoload_configs/switch.conf.xml ============================================================================== --- freeswitch/trunk/conf/autoload_configs/switch.conf.xml (original) +++ freeswitch/trunk/conf/autoload_configs/switch.conf.xml Wed May 20 18:05:28 2009 @@ -60,6 +60,7 @@ + From brian at freeswitch.org Wed May 20 16:53:44 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Wed, 20 May 2009 18:53:44 -0500 Subject: [Freeswitch-svn] [commit] r13408 - freeswitch/trunk/src Message-ID: Author: brian Date: Wed May 20 18:53:44 2009 New Revision: 13408 Log: small bug 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 May 20 18:53:44 2009 @@ -553,7 +553,9 @@ switch_mutex_unlock(port_lock); #ifdef ENABLE_ZRTP - zrtp_down(zrtp_global); + if (zrtp_on) { + zrtp_down(zrtp_global); + } #endif crypto_kernel_shutdown(); From silik0n at freeswitch.org Thu May 21 00:03:15 2009 From: silik0n at freeswitch.org (FreeSWITCH SVN) Date: Thu, 21 May 2009 02:03:15 -0500 Subject: [Freeswitch-svn] [commit] r13409 - freeswitch/trunk/conf/dialplan Message-ID: Author: silik0n Date: Thu May 21 02:03:15 2009 New Revision: 13409 Log: small regex adjustment so we can dial PSTN numbers that happen to have 4000 in them Modified: freeswitch/trunk/conf/dialplan/default.xml Modified: freeswitch/trunk/conf/dialplan/default.xml ============================================================================== --- freeswitch/trunk/conf/dialplan/default.xml (original) +++ freeswitch/trunk/conf/dialplan/default.xml Thu May 21 02:03:15 2009 @@ -243,7 +243,7 @@ - + From brian at freeswitch.org Thu May 21 07:55:58 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Thu, 21 May 2009 09:55:58 -0500 Subject: [Freeswitch-svn] [commit] r13410 - freeswitch/trunk/src Message-ID: Author: brian Date: Thu May 21 09:55:58 2009 New Revision: 13410 Log: fix windows build 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 Thu May 21 09:55:58 2009 @@ -1033,7 +1033,7 @@ char path[256]; int fd = -1, write_fd = -1; - ssize_t bytes = 0; + switch_ssize_t bytes = 0; switch_snprintf(path, sizeof(path), "%s%sfreeswitch.serial", SWITCH_GLOBAL_dirs.conf_dir, SWITCH_PATH_SEPARATOR); From brian at freeswitch.org Thu May 21 08:18:21 2009 From: brian at freeswitch.org (FreeSWITCH SVN) Date: Thu, 21 May 2009 10:18:21 -0500 Subject: [Freeswitch-svn] [commit] r13411 - freeswitch/trunk/src Message-ID: Author: brian Date: Thu May 21 10:18:21 2009 New Revision: 13411 Log: use our own handler so it won't get overriden by anyone if zrtp is on 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 Thu May 21 10:18:21 2009 @@ -1059,8 +1059,6 @@ zrtp_stream_set_userdata(rtp_session->zrtp_ctx, rtp_session); zrtp_stream_start(rtp_session->zrtp_ctx, rtp_session->ssrc); - - switch_rtp_set_invald_handler(rtp_session, zrtp_handler); } #endif @@ -1772,11 +1770,19 @@ if (bytes && rtp_session->recv_msg.header.version != 2) { uint8_t *data = (uint8_t *) rtp_session->recv_msg.body; if (rtp_session->recv_msg.header.version == 0) { - if (rtp_session->ice_user) { - handle_ice(rtp_session, (void *) &rtp_session->recv_msg, bytes); - } else if (rtp_session->remote_stun_addr) { - handle_stun_ping_reply(rtp_session, (void *) &rtp_session->recv_msg, bytes); +#ifdef ENABLE_ZRTP + if (zrtp_on && ZRTP_PACKETS_MAGIC == zrtp_ntoh32(rtp_session->recv_msg.header.ts)) { + zrtp_handler(rtp_session, rtp_session->sock_input, (void *) &rtp_session->recv_msg, bytes, rtp_session->from_addr); + } else { +#endif + if (rtp_session->ice_user) { + handle_ice(rtp_session, (void *) &rtp_session->recv_msg, bytes); + } else if (rtp_session->remote_stun_addr) { + handle_stun_ping_reply(rtp_session, (void *) &rtp_session->recv_msg, bytes); + } +#ifdef ENABLE_ZRTP } +#endif } if (rtp_session->invalid_handler) { From mikej at freeswitch.org Thu May 21 10:55:57 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Thu, 21 May 2009 12:55:57 -0500 Subject: [Freeswitch-svn] [commit] r13412 - freeswitch/trunk/src Message-ID: Author: mikej Date: Thu May 21 12:55:56 2009 New Revision: 13412 Log: use define 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 Thu May 21 12:55:56 2009 @@ -623,7 +623,7 @@ switch_zmalloc(write_frame.data, SWITCH_RECOMMENDED_BUFFER_SIZE); write_frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE; - if (caller_channel && (var = switch_channel_get_variable(caller_channel, "call_timeout"))) { + if (caller_channel && (var = switch_channel_get_variable(caller_channel, SWITCH_CALL_TIMEOUT_VARIABLE))) { timelimit = atoi(var); if (timelimit < 0) { timelimit = 60; From mikej at freeswitch.org Thu May 21 11:37:03 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Thu, 21 May 2009 13:37:03 -0500 Subject: [Freeswitch-svn] [commit] r13413 - freeswitch/trunk/conf/dialplan Message-ID: Author: mikej Date: Thu May 21 13:37:03 2009 New Revision: 13413 Log: remove questions Modified: freeswitch/trunk/conf/dialplan/default.xml Modified: freeswitch/trunk/conf/dialplan/default.xml ============================================================================== --- freeswitch/trunk/conf/dialplan/default.xml (original) +++ freeswitch/trunk/conf/dialplan/default.xml Thu May 21 13:37:03 2009 @@ -65,10 +65,6 @@ - - - - From anthm at freeswitch.org Thu May 21 13:10:24 2009 From: anthm at freeswitch.org (FreeSWITCH SVN) Date: Thu, 21 May 2009 15:10:24 -0500 Subject: [Freeswitch-svn] [commit] r13414 - freeswitch/trunk/src Message-ID: Author: anthm Date: Thu May 21 15:10:24 2009 New Revision: 13414 Log: FSCORE-370 Modified: freeswitch/trunk/src/switch_channel.c freeswitch/trunk/src/switch_event.c Modified: freeswitch/trunk/src/switch_channel.c ============================================================================== --- freeswitch/trunk/src/switch_channel.c (original) +++ freeswitch/trunk/src/switch_channel.c Thu May 21 15:10:24 2009 @@ -1985,12 +1985,12 @@ if (*p == '\\') { if (*(p + 1) == '$') { nv = 1; + p++; } else if (*(p + 1) == '\\') { *c++ = *p++; len++; continue; } - p++; } if (*p == '$' && !nv) { Modified: freeswitch/trunk/src/switch_event.c ============================================================================== --- freeswitch/trunk/src/switch_event.c (original) +++ freeswitch/trunk/src/switch_event.c Thu May 21 15:10:24 2009 @@ -1353,12 +1353,12 @@ if (*p == '\\') { if (*(p + 1) == '$') { nv = 1; + p++; } else if (*(p + 1) == '\\') { *c++ = *p++; len++; continue; } - p++; } if (*p == '$' && !nv) { From mikej at freeswitch.org Thu May 21 14:09:30 2009 From: mikej at freeswitch.org (FreeSWITCH SVN) Date: Thu, 21 May 2009 16:09:30 -0500 Subject: [Freeswitch-svn] [commit] r13415 - in freeswitch/trunk/libs: libsndfile libsndfile/Cfg libsndfile/M4 libsndfile/Octave libsndfile/Win32 libsndfile/doc libsndfile/examples libsndfile/man libsndfile/programs libsndfile/regtest libsndfile/src libsndfile/src/G72x libsndfile/src/GSM610 libsndfile/tests win32/libsndfile Message-ID: Author: mikej Date: Thu May 21 16:09:30 2009 New Revision: 13415 Log: libsndfile: update to 1.0.19 (LBSNDF-7) http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-0186 http://www.mega-nerd.com/libsndfile/libsndfile-1.0.19.tar.gz This will likely require a fresh boostrap to updated source checkouts. Added: freeswitch/trunk/libs/libsndfile/Cfg/ freeswitch/trunk/libs/libsndfile/M4/ freeswitch/trunk/libs/libsndfile/M4/Makefile.am freeswitch/trunk/libs/libsndfile/M4/Makefile.in freeswitch/trunk/libs/libsndfile/M4/add_cflags.m4 freeswitch/trunk/libs/libsndfile/M4/add_cxxflags.m4 freeswitch/trunk/libs/libsndfile/M4/clip_mode.m4 freeswitch/trunk/libs/libsndfile/M4/endian.m4 freeswitch/trunk/libs/libsndfile/M4/extra_largefile.m4 freeswitch/trunk/libs/libsndfile/M4/extra_pkg.m4 freeswitch/trunk/libs/libsndfile/M4/flexible_array.m4 freeswitch/trunk/libs/libsndfile/M4/gcc_version.m4 freeswitch/trunk/libs/libsndfile/M4/libtool.m4 freeswitch/trunk/libs/libsndfile/M4/llrint.m4 freeswitch/trunk/libs/libsndfile/M4/lrint.m4 freeswitch/trunk/libs/libsndfile/M4/lrintf.m4 freeswitch/trunk/libs/libsndfile/M4/ltoptions.m4 freeswitch/trunk/libs/libsndfile/M4/ltsugar.m4 freeswitch/trunk/libs/libsndfile/M4/ltversion.m4 freeswitch/trunk/libs/libsndfile/M4/lt~obsolete.m4 freeswitch/trunk/libs/libsndfile/M4/mkoctfile_version.m4 freeswitch/trunk/libs/libsndfile/M4/octave.m4 freeswitch/trunk/libs/libsndfile/Octave/PKG_ADD freeswitch/trunk/libs/libsndfile/Octave/octave_test.m freeswitch/trunk/libs/libsndfile/Octave/octave_test.sh freeswitch/trunk/libs/libsndfile/Octave/sndfile.cc freeswitch/trunk/libs/libsndfile/doc/tutorial.html freeswitch/trunk/libs/libsndfile/examples/sndfile-to-text.c freeswitch/trunk/libs/libsndfile/examples/sndfilehandle.cc freeswitch/trunk/libs/libsndfile/programs/ freeswitch/trunk/libs/libsndfile/programs/Makefile.am freeswitch/trunk/libs/libsndfile/programs/Makefile.in freeswitch/trunk/libs/libsndfile/programs/common.c freeswitch/trunk/libs/libsndfile/programs/common.h freeswitch/trunk/libs/libsndfile/programs/sndfile-cmp.c freeswitch/trunk/libs/libsndfile/programs/sndfile-convert.c freeswitch/trunk/libs/libsndfile/programs/sndfile-info.c freeswitch/trunk/libs/libsndfile/programs/sndfile-jackplay.c freeswitch/trunk/libs/libsndfile/programs/sndfile-metadata-get.c freeswitch/trunk/libs/libsndfile/programs/sndfile-metadata-set.c freeswitch/trunk/libs/libsndfile/programs/sndfile-play-beos.cpp freeswitch/trunk/libs/libsndfile/programs/sndfile-play.c freeswitch/trunk/libs/libsndfile/programs/test-sndfile-metadata-set.py freeswitch/trunk/libs/libsndfile/src/Symbols.os2 freeswitch/trunk/libs/libsndfile/src/audio_detect.c freeswitch/trunk/libs/libsndfile/src/chunk.c freeswitch/trunk/libs/libsndfile/src/ima_oki_adpcm.c freeswitch/trunk/libs/libsndfile/src/ima_oki_adpcm.h freeswitch/trunk/libs/libsndfile/src/libsndfile-1.def freeswitch/trunk/libs/libsndfile/src/mpc2k.c freeswitch/trunk/libs/libsndfile/src/rf64.c freeswitch/trunk/libs/libsndfile/src/test_audio_detect.c freeswitch/trunk/libs/libsndfile/src/test_conversions.c freeswitch/trunk/libs/libsndfile/src/test_float.c freeswitch/trunk/libs/libsndfile/src/test_ima_oki_adpcm.c freeswitch/trunk/libs/libsndfile/src/test_main.c freeswitch/trunk/libs/libsndfile/src/test_main.h freeswitch/trunk/libs/libsndfile/tests/checksum_test.c freeswitch/trunk/libs/libsndfile/tests/external_libs_test.c freeswitch/trunk/libs/libsndfile/tests/generate.c freeswitch/trunk/libs/libsndfile/tests/generate.h freeswitch/trunk/libs/libsndfile/tests/ogg_test.c freeswitch/trunk/libs/libsndfile/tests/test_wrapper.sh.in freeswitch/trunk/libs/libsndfile/tests/vorbis_test.c Removed: freeswitch/trunk/libs/win32/libsndfile/common.c Modified: freeswitch/trunk/libs/libsndfile/AUTHORS freeswitch/trunk/libs/libsndfile/ChangeLog freeswitch/trunk/libs/libsndfile/Makefile.am freeswitch/trunk/libs/libsndfile/Mingw-make-dist.sh freeswitch/trunk/libs/libsndfile/NEWS freeswitch/trunk/libs/libsndfile/Octave/Makefile.am freeswitch/trunk/libs/libsndfile/Octave/sndfile_load.m freeswitch/trunk/libs/libsndfile/Octave/sndfile_play.m freeswitch/trunk/libs/libsndfile/Octave/sndfile_save.m freeswitch/trunk/libs/libsndfile/README freeswitch/trunk/libs/libsndfile/Win32/Makefile.am freeswitch/trunk/libs/libsndfile/Win32/testprog.c freeswitch/trunk/libs/libsndfile/configure.ac freeswitch/trunk/libs/libsndfile/configure.gnu freeswitch/trunk/libs/libsndfile/doc/FAQ.html freeswitch/trunk/libs/libsndfile/doc/Makefile.am freeswitch/trunk/libs/libsndfile/doc/api.html freeswitch/trunk/libs/libsndfile/doc/bugs.html freeswitch/trunk/libs/libsndfile/doc/command.html freeswitch/trunk/libs/libsndfile/doc/dither.html freeswitch/trunk/libs/libsndfile/doc/embedded_files.html freeswitch/trunk/libs/libsndfile/doc/index.html freeswitch/trunk/libs/libsndfile/doc/libsndfile.css freeswitch/trunk/libs/libsndfile/doc/libsndfile.css.in freeswitch/trunk/libs/libsndfile/doc/lists.html freeswitch/trunk/libs/libsndfile/doc/new_file_type.HOWTO freeswitch/trunk/libs/libsndfile/doc/octave.html freeswitch/trunk/libs/libsndfile/doc/pkgconfig.html freeswitch/trunk/libs/libsndfile/doc/sndfile_info.html freeswitch/trunk/libs/libsndfile/doc/win32.html freeswitch/trunk/libs/libsndfile/examples/Makefile.am freeswitch/trunk/libs/libsndfile/examples/generate.c freeswitch/trunk/libs/libsndfile/examples/list_formats.c freeswitch/trunk/libs/libsndfile/examples/make_sine.c freeswitch/trunk/libs/libsndfile/examples/sfprocess.c freeswitch/trunk/libs/libsndfile/man/Makefile.am freeswitch/trunk/libs/libsndfile/man/sndfile-convert.1 freeswitch/trunk/libs/libsndfile/man/sndfile-info.1 freeswitch/trunk/libs/libsndfile/man/sndfile-play.1 freeswitch/trunk/libs/libsndfile/regtest/Makefile.am freeswitch/trunk/libs/libsndfile/regtest/checksum.c freeswitch/trunk/libs/libsndfile/regtest/database.c freeswitch/trunk/libs/libsndfile/regtest/regtest.h freeswitch/trunk/libs/libsndfile/regtest/sndfile-regtest.c freeswitch/trunk/libs/libsndfile/src/G72x/Makefile.am freeswitch/trunk/libs/libsndfile/src/G72x/g721.c freeswitch/trunk/libs/libsndfile/src/G72x/g723_16.c freeswitch/trunk/libs/libsndfile/src/G72x/g723_24.c freeswitch/trunk/libs/libsndfile/src/G72x/g723_40.c freeswitch/trunk/libs/libsndfile/src/G72x/g72x.c freeswitch/trunk/libs/libsndfile/src/G72x/g72x.h freeswitch/trunk/libs/libsndfile/src/G72x/g72x_priv.h freeswitch/trunk/libs/libsndfile/src/G72x/g72x_test.c freeswitch/trunk/libs/libsndfile/src/GSM610/Makefile.am freeswitch/trunk/libs/libsndfile/src/GSM610/add.c freeswitch/trunk/libs/libsndfile/src/GSM610/code.c freeswitch/trunk/libs/libsndfile/src/GSM610/config.h freeswitch/trunk/libs/libsndfile/src/GSM610/decode.c freeswitch/trunk/libs/libsndfile/src/GSM610/gsm.h freeswitch/trunk/libs/libsndfile/src/GSM610/gsm610_priv.h freeswitch/trunk/libs/libsndfile/src/GSM610/gsm_create.c freeswitch/trunk/libs/libsndfile/src/GSM610/gsm_decode.c freeswitch/trunk/libs/libsndfile/src/GSM610/gsm_destroy.c freeswitch/trunk/libs/libsndfile/src/GSM610/gsm_encode.c freeswitch/trunk/libs/libsndfile/src/GSM610/gsm_option.c freeswitch/trunk/libs/libsndfile/src/GSM610/long_term.c freeswitch/trunk/libs/libsndfile/src/GSM610/lpc.c freeswitch/trunk/libs/libsndfile/src/GSM610/preprocess.c freeswitch/trunk/libs/libsndfile/src/GSM610/rpe.c freeswitch/trunk/libs/libsndfile/src/GSM610/short_term.c freeswitch/trunk/libs/libsndfile/src/GSM610/table.c freeswitch/trunk/libs/libsndfile/src/Makefile.am freeswitch/trunk/libs/libsndfile/src/aiff.c freeswitch/trunk/libs/libsndfile/src/alaw.c freeswitch/trunk/libs/libsndfile/src/au.c freeswitch/trunk/libs/libsndfile/src/avr.c freeswitch/trunk/libs/libsndfile/src/binheader_writef_check.py freeswitch/trunk/libs/libsndfile/src/broadcast.c freeswitch/trunk/libs/libsndfile/src/caf.c freeswitch/trunk/libs/libsndfile/src/command.c freeswitch/trunk/libs/libsndfile/src/common.c freeswitch/trunk/libs/libsndfile/src/common.h freeswitch/trunk/libs/libsndfile/src/create_symbols_file.py freeswitch/trunk/libs/libsndfile/src/dither.c freeswitch/trunk/libs/libsndfile/src/double64.c freeswitch/trunk/libs/libsndfile/src/dwd.c freeswitch/trunk/libs/libsndfile/src/dwvw.c freeswitch/trunk/libs/libsndfile/src/file_io.c freeswitch/trunk/libs/libsndfile/src/flac.c freeswitch/trunk/libs/libsndfile/src/float32.c freeswitch/trunk/libs/libsndfile/src/g72x.c freeswitch/trunk/libs/libsndfile/src/gsm610.c freeswitch/trunk/libs/libsndfile/src/htk.c freeswitch/trunk/libs/libsndfile/src/ima_adpcm.c freeswitch/trunk/libs/libsndfile/src/interleave.c freeswitch/trunk/libs/libsndfile/src/ircam.c freeswitch/trunk/libs/libsndfile/src/macbinary3.c freeswitch/trunk/libs/libsndfile/src/macos.c freeswitch/trunk/libs/libsndfile/src/mat4.c freeswitch/trunk/libs/libsndfile/src/mat5.c freeswitch/trunk/libs/libsndfile/src/ms_adpcm.c freeswitch/trunk/libs/libsndfile/src/nist.c freeswitch/trunk/libs/libsndfile/src/ogg.c freeswitch/trunk/libs/libsndfile/src/paf.c freeswitch/trunk/libs/libsndfile/src/pcm.c freeswitch/trunk/libs/libsndfile/src/pvf.c freeswitch/trunk/libs/libsndfile/src/raw.c freeswitch/trunk/libs/libsndfile/src/rx2.c freeswitch/trunk/libs/libsndfile/src/sd2.c freeswitch/trunk/libs/libsndfile/src/sds.c freeswitch/trunk/libs/libsndfile/src/sf_unistd.h freeswitch/trunk/libs/libsndfile/src/sfconfig.h freeswitch/trunk/libs/libsndfile/src/sfendian.h freeswitch/trunk/libs/libsndfile/src/sndfile.c freeswitch/trunk/libs/libsndfile/src/sndfile.h.in freeswitch/trunk/libs/libsndfile/src/sndfile.hh freeswitch/trunk/libs/libsndfile/src/strings.c freeswitch/trunk/libs/libsndfile/src/svx.c freeswitch/trunk/libs/libsndfile/src/test_endswap.c freeswitch/trunk/libs/libsndfile/src/test_endswap.def freeswitch/trunk/libs/libsndfile/src/test_endswap.tpl freeswitch/trunk/libs/libsndfile/src/test_file_io.c freeswitch/trunk/libs/libsndfile/src/test_log_printf.c freeswitch/trunk/libs/libsndfile/src/txw.c freeswitch/trunk/libs/libsndfile/src/ulaw.c freeswitch/trunk/libs/libsndfile/src/voc.c freeswitch/trunk/libs/libsndfile/src/vox_adpcm.c freeswitch/trunk/libs/libsndfile/src/w64.c freeswitch/trunk/libs/libsndfile/src/wav.c freeswitch/trunk/libs/libsndfile/src/wav_w64.c freeswitch/trunk/libs/libsndfile/src/wav_w64.h freeswitch/trunk/libs/libsndfile/src/wve.c freeswitch/trunk/libs/libsndfile/src/xi.c freeswitch/trunk/libs/libsndfile/tests/Makefile.am freeswitch/trunk/libs/libsndfile/tests/aiff_rw_test.c freeswitch/trunk/libs/libsndfile/tests/alaw_test.c freeswitch/trunk/libs/libsndfile/tests/benchmark.c freeswitch/trunk/libs/libsndfile/tests/benchmark.def freeswitch/trunk/libs/libsndfile/tests/benchmark.tpl freeswitch/trunk/libs/libsndfile/tests/command_test.c freeswitch/trunk/libs/libsndfile/tests/cpp_test.cc freeswitch/trunk/libs/libsndfile/tests/dft_cmp.c freeswitch/trunk/libs/libsndfile/tests/dft_cmp.h freeswitch/trunk/libs/libsndfile/tests/dither_test.c freeswitch/trunk/libs/libsndfile/tests/dwvw_test.c freeswitch/trunk/libs/libsndfile/tests/error_test.c freeswitch/trunk/libs/libsndfile/tests/fix_this.c freeswitch/trunk/libs/libsndfile/tests/floating_point_test.c freeswitch/trunk/libs/libsndfile/tests/floating_point_test.def freeswitch/trunk/libs/libsndfile/tests/floating_point_test.tpl freeswitch/trunk/libs/libsndfile/tests/header_test.c freeswitch/trunk/libs/libsndfile/tests/header_test.def freeswitch/trunk/libs/libsndfile/tests/header_test.tpl freeswitch/trunk/libs/libsndfile/tests/headerless_test.c freeswitch/trunk/libs/libsndfile/tests/largefile_test.c freeswitch/trunk/libs/libsndfile/tests/locale_test.c freeswitch/trunk/libs/libsndfile/tests/lossy_comp_test.c freeswitch/trunk/libs/libsndfile/tests/misc_test.c freeswitch/trunk/libs/libsndfile/tests/multi_file_test.c freeswitch/trunk/libs/libsndfile/tests/pcm_test.c freeswitch/trunk/libs/libsndfile/tests/pcm_test.def freeswitch/trunk/libs/libsndfile/tests/pcm_test.tpl freeswitch/trunk/libs/libsndfile/tests/peak_chunk_test.c freeswitch/trunk/libs/libsndfile/tests/pipe_test.c freeswitch/trunk/libs/libsndfile/tests/pipe_test.def freeswitch/trunk/libs/libsndfile/tests/pipe_test.tpl freeswitch/trunk/libs/libsndfile/tests/raw_test.c freeswitch/trunk/libs/libsndfile/tests/scale_clip_test.c freeswitch/trunk/libs/libsndfile/tests/scale_clip_test.def freeswitch/trunk/libs/libsndfile/tests/scale_clip_test.tpl freeswitch/trunk/libs/libsndfile/tests/sfversion.c freeswitch/trunk/libs/libsndfile/tests/stdin_test.c freeswitch/trunk/libs/libsndfile/tests/stdio_test.c freeswitch/trunk/libs/libsndfile/tests/stdout_test.c freeswitch/trunk/libs/libsndfile/tests/string_test.c freeswitch/trunk/libs/libsndfile/tests/ulaw_test.c freeswitch/trunk/libs/libsndfile/tests/utils.c freeswitch/trunk/libs/libsndfile/tests/utils.def freeswitch/trunk/libs/libsndfile/tests/utils.h freeswitch/trunk/libs/libsndfile/tests/utils.tpl freeswitch/trunk/libs/libsndfile/tests/virtual_io_test.c freeswitch/trunk/libs/libsndfile/tests/win32_ordinal_test.c freeswitch/trunk/libs/libsndfile/tests/win32_test.c freeswitch/trunk/libs/libsndfile/tests/write_read_test.c freeswitch/trunk/libs/libsndfile/tests/write_read_test.def freeswitch/trunk/libs/libsndfile/tests/write_read_test.tpl freeswitch/trunk/libs/win32/libsndfile/config.h freeswitch/trunk/libs/win32/libsndfile/libsndfile.2008.vcproj freeswitch/trunk/libs/win32/libsndfile/libsndfile.vcproj freeswitch/trunk/libs/win32/libsndfile/sndfile.h Modified: freeswitch/trunk/libs/libsndfile/AUTHORS ============================================================================== --- freeswitch/trunk/libs/libsndfile/AUTHORS (original) +++ freeswitch/trunk/libs/libsndfile/AUTHORS Thu May 21 16:09:30 2009 @@ -1,14 +1,14 @@ -The main author of libsndfile is Erik de Castro Lopo . +The main author of libsndfile is Erik de Castro Lopo +apart from code in the following directories: -The code in the src/GSM610 directory was written by Jutta Degener - and Carsten Bormann . -They should not be contacted in relation to libsndfile or the GSM 6.10 code -that is part of libsndfile. Their original code can be found at: + - src/GSM610 : Written by Jutta Degener and Carsten + Bormann . They should not be contacted in relation to + libsndfile or the GSM 6.10 code that is part of libsndfile. Their original + code can be found at: - http://kbs.cs.tu-berlin.de/~jutta/toast.html - -Code in the src/G72x directory was released by Sun Microsystems, Inc. to the -public domain. Minor modifications were required to integrate these files -into libsndfile. The changes are listed in src/G72x/ChangeLog. + http://kbs.cs.tu-berlin.de/~jutta/toast.html + - src/G72x : Released by Sun Microsystems, Inc. to the public domain. Minor + modifications were required to integrate these files into libsndfile. The + changes are listed in src/G72x/ChangeLog. Modified: freeswitch/trunk/libs/libsndfile/ChangeLog ============================================================================== --- freeswitch/trunk/libs/libsndfile/ChangeLog (original) +++ freeswitch/trunk/libs/libsndfile/ChangeLog Thu May 21 16:09:30 2009 @@ -1,15 +1,1671 @@ -2006-08-31 Erik de Castro Lopo +2009-03-03 Erik de Castro Lopo + + * configure.ac + Detect vorbis_version_string() correctly. + +2009-03-02 Erik de Castro Lopo + + * doc/index.html + Add a 'See Also' section with a link to sndfile-tools. + + * NEWS README doc/*.html + Updates for 1.0.19 release. + + * configure.ac + Fix --enable-external-libs logic. + +2009-03-01 Erik de Castro Lopo + + * src/aiff.c + Fix resource leak and potential read beyond end of buffer. + + * src/nist.c + Fix reading of header value sample_n_bytes. + + * src/sd2.c src/wav.c + Fix potential read beyond end of buffer. + + * src/sndfile.c src/svx.c + Check return values of file_io functions. + + * tests/win32_test.c + Fix resource leak. + + * configure.ac + Detect the presence/absence of vorbis_version_string() in libvorbis. + + * src/ogg.c + Only call vorbis_version_string() from libvorbis if present. + +2009-02-24 Erik de Castro Lopo + + * tests/win32_test.c + Don't use sprintf, even on windows. + + * src/aiff.c src/rf64.c src/wav.c + Eliminate dead code, more validation of data read from file. + +2009-02-22 Erik de Castro Lopo + + * src/ima_adpcm.c + Clamp values to a valid range before indexing ima_step_size array. + + * src/GSM610/*.c tests/*c programs/*.c src/audio_detect.c + Don't include un-needed headers. + + * programs/sndfile-info.c + Remove dead code. + + * tests/test_wrapper.sh.in + Add 'set -e' so the script exits on error. + + * src/test_ima_oki_adpcm.c + Fix read beyond end of array. + + * tests/win32_test.c + Add missing close on file descriptor. + + * src/nist.c programs/sndfile-metadata-set.c + Fix 'unused variable' warnings. + + * src/aiff.c + Fix potential memory leak in handling of 'MARK' chunk. + Remove un-needed test (unsigned > 0). + + * src/sd2.c + Improve handling of heap allocated buffer. + + * src/sndfile.c + Remove un-needed test (always true). + + * src/wav.c src/rf64.c + Ifdef out dead code that will be resurected some time in the future. + + * src/wav.c src/w64.c src/xi.c + Handle error return values from psf_ftell. + + * src/wav_w64.c + Fix handling and error checking of MSADPCM coefficient arrays. + + * regtest/*.c + Bunch of fixes. + + * src/test_file_io.c + Use snprintf instead of strncpy in test program. + +2009-02-21 Erik de Castro Lopo + + * src/sd2.c + Validate data before using. + + * src/caf.c + Validate channels per frame value before using, fixing a possible integer + overflow bug, leading to a possible heap overflow. Found by Alin Rad Pop of + Secunia Research (CVE-2009-0186). + +2009-02-20 Erik de Castro Lopo + + * Octave/octave_test.sh + Unset TERM environment variable and export LD_LIBRARY_PATH. + +2009-02-16 Erik de Castro Lopo + + * src/file_io.c + In windows code, cast LPVOID to 'char*' in printf. + +2009-02-15 Erik de Castro Lopo + + * M4/octave.m4 + Clear the TERM environment before evaluating anything in Octave. This works + around problems that might occur if a users TERM settings are incorrect. + Thanks to Rob Til Freedmen for helping to debug this. + + * src/wav.c + Handle four zero bytes as a marker within a LIST or INFO chunk. + Thanks to Rog?rio Brito for supplying an example file. + +2009-02-14 Erik de Castro Lopo + + * src/common.h src/*.c + Use C99 snprintf everywhere. + +2009-02-11 Erik de Castro Lopo + + * tests/test_wrapper.sh.in + New file to act as the template for the test wrapper script. + + * configure.ac + Generate tests/test_wrapper.sh from the template. + + * tests/Makefile.am + Replace all tests with a single invocation of the test wrapper script. + +2009-02-09 Erik de Castro Lopo + + * src/ogg.c + Record vorbis library version string. + + * configure.ac + Require libvorbis >= 1.2.2. + + * M4/endian.m4 + Fix bracketing of function for autoconf 2.63. Thanks to Richard Ash. + + * M4/octave.m4 M4/mkoctfile_version.m4 + Clean up AC_WITH_ARG usage using AC_HELP_STRING. + +2009-02-08 Erik de Castro Lopo + + * Octave/Makefile.am + Use $(top_buildir) instead of $(builddir) which may not be defined. + + * M4/octave.m4 + Improve logic and status reporting. + +2009-02-07 Erik de Castro Lopo + + * configure.ac AUTHORS NEWS README doc/*.html + Final tweaks for 1.0.18 release. + +2009-02-03 Erik de Castro Lopo + + * programs/sndfile-convert.c + Add 'htk' to the list of convert formats. + + * programs/sndfile-info.c + Simplify get_signal_max using SFC_CALC_SIGNAL_MAX command. + Increase size of files for which signal max will be calculated. + +2009-01-14 Erik de Castro Lopo + + * doc/index.html + Fix links for SoX and WavPlay. Thanks to Daniel Griscom. + +2009-01-11 Erik de Castro Lopo + + * programs/sndfile-metadata-get.c + Make valgrind clean. + Clean up temp string array usage. + Error out if trying to update coding history in RDWR mode. + +2009-01-10 Erik de Castro Lopo + + * doc/index.html + Fix links to versions of the LGPL. + +2008-12-14 Erik de Castro Lopo + + * tests/string_test.c + Add test for RDWR mode where the file ends up shorter than when it was + opened. + + * src/wav.c + Truncate the file on close for RDWR mode where the file ends up shorter + than when it was opened. + +2008-11-30 Erik de Castro Lopo + + * M4/add_cflags.m4 + Fix problem with quoting of '#include'. + + * M4/add_cxxflags.m4 configure.ac + Add new file M4/add_cxxflags.m4 and use it in configure.ac. + +2008-11-19 Erik de Castro Lopo + + * programs/sndfile-info.c + Apply patch from Conrad Parker to calculate and display total duration when + more than one file is dumped. + +2008-11-10 Erik de Castro Lopo + + * configure.ac src/Makefile.am + Tweaks to generation of Symbols files. + + * tests/win32_ordinal_test.c + Update tests for above changes. + +2008-11-06 Erik de Castro Lopo + + * programs/common.c + When merging broadcast info, make sure to clear the destination field + before copying in the new data. + + * programs/test-sndfile-metadata-set.py + Add test for the above. + + * src/broadcast.c + Fix checking of required coding_history_size. + +2008-10-28 Erik de Castro Lopo + + * tests/command_test.c + Add test to detect if coding history is truncated. + + * src/broadcast.c + Fix truncation of coding history. + +2008-10-27 Erik de Castro Lopo + + * tests/command_test.c + Add broadcast_coding_history_size test. + + * programs/*.[ch] + Use SF_BROADCAST_INFO_VAR to manipulate larger 'bext' chunks. + + * src/rf64.c + Add code to prevent infinite loop on malformed file. + + * src/common.h src/sndfile.c src/w64.c src/wav_w64.c + Rationalize and improve error handling when parsing 'fmt ' chunk. + + * M4/octave.m4 + Simplify and remove cruft. + Check for correct Octave version. + + * Octave/* + Reduce 3 C++ files to one, fix build for octave 3.0, fix build. + + * Octave/sndfile.cc Octave/PKG_ADD + Add Octave function sfversion which returns the libsndfile version that the + module is linked against. + + * Octave/Makefile.am + Bunch of build and 'make distcheck' fixes. + +2008-10-26 Erik de Castro Lopo + + * programs/common.c + Return 1 if SFC_SET_BROADCAST_INFO fails. + + * programs/test-sndfile-metadata-set.py + Update for new programs directory, exit on any error. + + * tests/error_test.c + Fix failure behaviour in error_number_test. + + * src/common.h src/sndfile.c + Add error number SFE_BAD_BROADCAST_INFO_SIZE. + + * src/* + Reimplement handling of broadcast extentioon chunk in WAV/WAVEX files. + + * src/broadcast.c + Fix generation of added coding history. + +2008-10-25 Erik de Castro Lopo + + * programs/sndfile-metadata-get.c programs/sndfile-info.c + Exit with non-zero on errors. + +2008-10-21 Erik de Castro Lopo + + * examples/sndfile-to-text.c examples/Makefile.am + Add a new example program and hook it into the build. + + * examples/ programs/ + Add a new directory programs and move sndfile-info, sndfile-play and other + real programs to the new directory, leaving example programs where they + were. + +2008-10-20 Erik de Castro Lopo + + * tests/Makefile.am + Automake 1.10 MinGW cross compiling fixes. + +2008-10-19 Erik de Castro Lopo + + * examples/sndfile-play.c + Remove call to deprecated function snd_pcm_sw_params_get_xfer_align. + Fix gcc-4.3 compiler warnings. + + * tests/command_test.c + Fix a valgrind warning. + + * tests/error_test.c tests/multi_file_test.c tests/peak_chunk_test.c + tests/pipe_test.tpl tests/stdio_test.c tests/win32_test.c + Fix gcc-4.3 compiler warnings. + +2008-10-17 Erik de Castro Lopo + + * src/broadcast.c + Fix termination of desitination string in strncpy_crlf. + When copying BROADCAST_INFO chunk, make sure destination gets correct line + endings. + + * examples/common.c + Fix copying of BROADCAST_INFO coding_history field. + +2008-10-13 Erik de Castro Lopo + + * tests/command_test.c + Add test function instrument_rw_test, but don't hook it into the testing + yet. + + * src/common.h src/command.c src/sndfile.c src/flac.c + Error code rationalization. + + * src/common.h src/sndfile.c + Set psf->error to SFE_CMD_HAS_DATA when adding metadata via sf_command() + fails due to psf->have_written being true. + + * doc/command.html + Document the SFC_GET/SET_BROADCAST_INFO comamnds. + +2008-10-10 Erik de Castro Lopo + + * tests/command_test.c + Improve error reporting when '\0' is found in coding history. + Fix false failure. + +2008-10-09 Erik de Castro Lopo + + * src/broadcast.c + Convert all coding history line endings to \r\n. + + * tests/command_test.c + Add test to make sure all line endings are converted to \r\n. + +2008-10-08 Erik de Castro Lopo + + * src/broadcast.c + Changed the order of coding history fields. + + * tests/command_test.c + Update bextch test to cope with previous change. + + * examples/common.c + Add extra length check when copying broadcast info data. + +2008-10-05 Erik de Castro Lopo + + * tests/utils.tpl tests/pcm_test.tpl + Update check_file_hash_or_die to use 64 bit hash. + + * tests/checksum_test.c tests/Makefile.am + Add new checksum_test specifically for lossy compression of headerless + files. + +2008-10-04 Erik de Castro Lopo + + * src/gsm610.c + Seek to psf->dataoffset before decoding first block. + + * src/sndfile.c + Fix detection of mpc2k files on big endian systems. + +2008-10-03 Erik de Castro Lopo + + * src/broadcast.c + Use '\r\n' newlines in Coding History as required by spec. + +2008-10-02 Erik de Castro Lopo + + * src/test_conversions.c + Use int64_t instead of 'long long'. + +2008-10-01 Erik de Castro Lopo + + * examples/sndfile-metadata-set.c + Remove --bext-coding-history-append command line option because it didn't + really make sense. + + * examples/sndfile-metadata-(get|set).c + Add usage messages. + + * examples/test-sndfile-metadata-set.py + Start work on test coding history. + +2008-09-30 Erik de Castro Lopo + + * README doc/win32.html + Bring these up to date. + + * src/aiff.c + Fix parsing of REX files. + +2008-09-29 Erik de Castro Lopo + + * src/file_io.c + Use intptr_t instead of long for return value of _get_osfhandle. + + * src/test_conversions.c src/test_endswap.tpl + Fix printing of int64_t values. + + * examples/sndfile-play.c + Fix win64 issues. + + * tests/win32_ordinal_test.c + Fix calling of GetProcAddress with ordinal under win64. + + * tests/utils.tpl + Fix win64 issues. + +2008-09-25 Erik de Castro Lopo + + * examples/* + Rename copy_data.[ch] to common.[ch]. Fix build. + Move code from sndfile-metadata-set.c to common.c. + + * examples/Makefile.am tests/Makefile.am regtest/Makefile.am + Clean paths. + +2008-09-19 Erik de Castro Lopo + + * doc/tutorial.html doc/Makefile.am + Add file doc/tutorial.html and hook into build/dist system. + +2008-09-14 Erik de Castro Lopo + + * examples/sndfile-metadata-set.c + Clean up handling of bext command line params. + +2008-09-13 Erik de Castro Lopo + + * src/w64.c + Add handling/skipping of a couple of new chunk types. + +2008-09-09 Erik de Castro Lopo + + * configure.ac + Add -funsigned-char to CFLAGS if the compiler supports it. + + * examples/sndfile-metadata-(get|set).c + Add handling for more metadata types. + +2008-09-04 Erik de Castro Lopo + + * src/common.h + Add macros SF_CONTAINER, SF_CODEC and SF_ENDIAN useful for splitting format + field of SF_INFO into component parts. + + * src/*.c + Use new macros everywhere it is appropriate. + +2008-09-02 Erik de Castro Lopo + + * examples/sndfile-bwf-set.c + Massive reworking. + +2008-08-24 Erik de Castro Lopo + + * examples/sndfile-bwf-set.c + Add --info-auto-create-date command line option. + + * examples/sndfile-metadata-set.c examples/sndfile-metadata-get.c + examples/Makefile.am examples/test-sndfile-bwf-set.py + Rename sndfile-bwf-(set|get).c to sndfile-metadata-(set|get).c. + Change command line args. + +2008-08-23 Erik de Castro Lopo + + * src/wav.c + Allow 'PAD ' chunk to be modified in RDWR mode. + + * src/sndfile.h.in src/sndfile.c + Add handling (incomplete) for SFC_SET_ADD_HEADER_PAD_CHUNK. + + * tests/Makefile.am tests/write_read_test.tpl tests/header_test.tpl + tests/misc_test.c + Add tests for RF64. + + * src/rf64.c + Fixes to make sure all tests pass. + + * tests/Makefile.am tests/string_test.c + Add string tests (not yet passing). + +2008-08-22 Erik de Castro Lopo + + * src/rf64.c + First pass at writing RF64 now working. + +2008-08-21 Erik de Castro Lopo + + * examples/sndfile-convert.c + Add SF_FORMAT_RF64 to format_map. + + * src/common.h src/sndfile.c + More RF64 support code. + + * examples/sndfile-bwf-set.c + Fix the month number in autogenerated date string and use hypen in date + instead of slash. + + * examples/test-sndfile-bwf-set.py + Update tests. + + * examples/sndfile-info.c + When called with -i or -b option, operate on all files on command line, not + just the first. + +2008-08-19 Erik de Castro Lopo + + * src/rf64.c + New file to handle RF64 (WAV like format supportting > 4Gig files). + + * src/sndfile.h.in src/common.h src/sndfile.c src/Makefile.am + Hook the above into build so hacking can begin. + + * src/pcm.c + Improve log message when pcm_init fails. + + * src/sndfile-info.c + Only calculate and print 'Signal Max' if file is less than 10 megabytes in + length. + +2008-08-18 Erik de Castro Lopo + + * tests/string_test.c + Polish string_multi_set_test. + + * src/wav.c + In RDWR mode, pad the header if necessary (ie LIST chunk has moved or + length has changed). + Minor fixes in wav_write_strings. + Write PAD chunk with default endian-ness, not a specific endian-ness. + + * examples/test-sndfile-bwf-set.py + Add Python script to test sndfile-bwf-set/get. + + * examples/sndfile-bwf-set.c + Clean up and fixes. + + * src/wav.c + Merge function wavex_write_header into wav_write_header, deleting about 70 + lines of code. + + * src/common.h + Double value of SF_MAX_STRINGS. + + * tests/string_test.c + Add string tests for WAVEX and RIFX files. + + * tests/command_test.c + Add broadcast test for WAVEX files. + +2008-08-17 Erik de Castro Lopo + + * tests/string_test.c + Add a new string_rdwr_test (currently failing for WAV). + Add a new string_multi_set_test (currently failing). + + * tests/command_test.c + Add new broadcast_rdwr_test (currently failing). + + * src/wav.c + Fix to WAV parser to allow 'bext' chunk to be updated in place. + In wav_write_tailer, seek to psf->dataend if its greater than zero. + + * src/sndfile.c + Make sure psf->have_written gets set correctly in mode SFM_RDWR. + + * configure.ac + Test for and gettimeofday. + + * src/common.c + Use gettimeofday() to initialize psf_rand_int32. + + * src/common.h src/sndfile.c + Add unique_id field to SF_PRIVATE struct. + + * src/common.h src/sndfile.c src/wav.c src/wav_w64.[ch] + Move wavex_ambisonic field from SF_PRIVATE struct to WAV_PRIVATE struct. + + * src/common.h src/strings.c + Add function psf_location_string_count. + +2008-08-16 Erik de Castro Lopo + + * configure.ac + Test for localtime and localtime_r. + + * examples/sndfile-convert.c + In function copy_metadata(), copy broadcast info if present. + + * examples/copy_data.[ch] examples/Makefile.am + Break some functionality out of sndfile-convert.c so it can be used in + examples/sndfile-bwf-set.c. + + * tests/utils.tpl + Add new function create_short_sndfile(). + + * examples/sndfile-bwf-set.c examples/sndfile-bwf-get.c + examples/Makefile.am + Add new files and hook into build. + +2008-08-11 Erik de Castro Lopo + + * src/sndfile.h.in + Fix comments. Patch from Mark Glines. + +2008-07-30 Erik de Castro Lopo + + * tests/misc_test.c + Use zero_data_test on Ogg/Vorbis files. + + * src/ogg.c + Fix segfault when closing an Ogg/Vorbis file that has been opened for write + but had no actual data written to it. Bug reported by Chinoy Gupta. + + * tests/Makefile.am + Make sure to run mist_test on Ogg/Vorbis files. + +2008-07-19 Erik de Castro Lopo + + * regtest/Makefile.am + Use SQLITE3_CFLAGS to locate sqlite headers. + +2008-07-10 Erik de Castro Lopo + + * doc/index.html doc/FAQ.html + Add notes about which versions of windows libsndfile works on. + +2008-07-03 Erik de Castro Lopo + + * tests/misc_test.c + Add a test for correct handling of Ambisonic files. Thanks to Fons + Adriaensen for the test. + + * src/wav.c src/wav_w64.c + Fix handling of Ambisonic files. Thanks to Fons Adriaensen for the patch. + +2008-06-29 Erik de Castro Lopo + + * configure.ac + Fix detection/enabling of external libs. + + * M4/extra_pkg.m4 M4/Makefile.am + Add m4 macro PKG_CHECK_MOD_VERSION which is a hacked version + PKG_CHECK_MODULES. The new macro prints the version number of the package + it is searching for. + +2008-06-14 Erik de Castro Lopo + + * src/aiff.c + Apply a fix from Axel Roebel where if the second loop in the instrument + chunk is none, the loop mode is written into the first loop. + +2008-05-31 Erik de Castro Lopo + + * src/test_float.c src/test_main.(c|h) src/Makefile.am + Add new file to test functions float32_(le|be)_(read|write) and + double64_(le|be)_(read|write). Hook into build and testsuite. + + * src/double64.c src/float32.c + Fix bugs in functions found by test added above. Thanks to Nicolas Castagne + for reporting this bug. + + * src/sndfile.h.in + Change time_reference_(low|high) entries of SF_BROADCAST_INFO struct to + unsigned. + + * examples/sndfile-info.c + Print out the BEXT time reference in a sensible format. + +2008-05-21 Erik de Castro Lopo + + * src/*.c + Fuzz fixes. + + * src/ogg.c + Add call to ogg_stream_clear to fix valgrind warning. + + * src/aiff.c + Fix x86_64 compile issue. + + * configure.ac src/Makefile.am src/flac.c src/ogg.c + Link to external versions of FLAC, Ogg and Vorbis. + + * tests/lossy_comp_test.c tests/ogg_test.c tests/string_test.c + tests/vorbis_test.c tests/write_read_test.tpl + Fix tests when configured with --disable-external-libs. + + * tests/external_libs_test.c tests/Makefile.am + Add new test and hook into build and test suite. + + * src/command.c + Use HAVE_EXTERNAL_LIBS to ensure that the SFC_GET_FORMAT_* commands return + the right data when external libs are disabled. + +2008-05-11 Erik de Castro Lopo + + * tests/write_read_test.tpl + Add a test for extending a file during write by seeking past the current + end of file. + + * src/sndfile.c + Allow seeking past end of file during write. + +2008-05-10 Erik de Castro Lopo + + * doc/api.html doc/command.html + Move all information about the sf_command function to command.html and add + a link from documentation of the sf_read/write_raw function to the + SFC_RAW_NEEDS_ENDSWAP command. + + * doc/index.html doc/FAQ.html doc/libsndfile.css + Minor documentation tweaks. + +2008-05-09 Erik de Castro Lopo + + * configure.ac + Add AM_PROG_CC_C_O. + +2008-04-27 Erik de Castro Lopo + + * tests/error_test.c + Add a test to make sure if file opened with sf_open_fd, and then the file + descriptor is closed, then sf_close will return an error code. Thanks to + Dave Flogeras for the bug report. + + * src/sndfile.c + Make sf_close return an error is the file descriptor is already closed. + +2008-04-19 Erik de Castro Lopo + + * configure.ac + Set object format to aout for OS/2. Thanks to David Yeo. + + * src/mpc2k.c src/sndfile.c src/sndfile.h.in src/common.h src/Makefile.am + Add ability to read MPC 2000 file. + + * tests/write_read_test.tpl tests/misc_test.c tests/header_test.tpl + tests/Makefile.am + Add tests for MPC 2000 file format. + + * examples/sndfile-convert.c + Allow conversion to MPC 2000 file format. + +2008-04-17 Erik de Castro Lopo + + * src/VORBIS/lib/codebook.c + Sync from upstream SVN. + + * autogen.sh configure.ac + Minor tweaks. + +2008-04-13 Erik de Castro Lopo + + * src/ogg.c + Add a patch that fixes finding the length in samples of an Ogg/Vorbis file. + The patch as supplied segfaulted and required many hours of debugging. + + * src/OGG/bitwise.c + Sync from upstream SVN. + +2008-04-09 Erik de Castro Lopo + + * src/aiff.c + Fix up handling of 'APPL' chunk. Thanks to Axel Roebel for bringing up + this issue. + +2008-04-06 Erik de Castro Lopo + + * tests/*.c + Add calls to sf_close() where needed. + + * tests/utils.tpl tests/multi_file_test.c + Always pass 0 as the third argument to open when OS_IS_WIN32. + +2008-04-03 Erik de Castro Lopo + + * src/test_* + Add files test_main.[ch]. + Collapse all tests into a single executable. + +2008-03-30 Erik de Castro Lopo + + * src/FLAC + Sync to upstream CVS. + +2008-03-25 Erik de Castro Lopo + + * src/common.h + Make SF_MIN and SF_MAX macros MinGW friendly. + + * examples/sndfile-(info|play).c + Use Sleep function from instead of _sleep. + + * tests/locale_test.c + Disable some tests when OS_IS_WIN32. + + * src/FLAC/src/share/replaygain_anal/replaygain_analysis.c + src/FLAC/src/share/utf8/utf8.c + MinGW fixes. + +2008-03-11 Erik de Castro Lopo + + * doc/FAQ.html + Tweaks to pcm16 <-> float conversion answer. + +2008-02-10 Erik de Castro Lopo + + * src/OGG + Sync to SVN upstream. + + * Makefile.am + Add 'DISTCHECK_CONFIGURE_FLAGS = --enable-gcc-werror'. + +2008-02-05 Erik de Castro Lopo + + * examples/sndfile-jackplay.c + Minor tweaks to warning message printed when compiled without libjack. + +2008-01-27 Erik de Castro Lopo + + * tests/peak_chunk_test.c + Improve read_write_peak_test to find more errors. Inspired by example + provided by Nicolas Castagne. + + * src/aiff.c + Another SFM_RDWR fix shown up by above test. + +2008-01-24 Erik de Castro Lopo + + * src/aiff.c + Fix reading of COMM encoding string. + + * src/chunk.c src/common.h src/Makefile.am + New file for storing and retrieving info about header chunks. Hook into + build. + + * src/aiff.c + Use new chunk logging to fix problem with AIFF in RDWR mode. + +2008-01-22 Erik de Castro Lopo + + * src/command.c + Add WVE to the list of major formats. + + * tests/aiff_rw_test.c + Fix error reporting. + +2008-01-21 Erik de Castro Lopo + + * src/common.[ch] + Add internal functions str_of_major_format, str_of_minor_format, + str_of_open_mode and str_of_endianness. + + * tests/write_read_test.tpl + Fix reporting of errors in new_rdwr_XXXX_test. + +2008-01-20 Erik de Castro Lopo + + * examples/sndfile-play.c + Apply patch from Yair K. to fix compiles with OSS v4. + + * src/common.h src/float32.c src/double64.c + Rename psf->float_enswap to psf->data_endswap. + + * src/sndfile.h.in src/sndfile.c src/pcm.c + Add command SFC_RAW_NEEDS_ENDSWAP. + + * tests/command.c + Add test for SFC_RAW_NEEDS_ENDSWAP. + + * doc/command.html + Document SFC_RAW_NEEDS_ENDSWAP. + + * tests/peak_chunk_test.c + Add test function read_write_peak_test. Thanks to Nicolas Castagne for the + bug report. + +2008-01-09 Erik de Castro Lopo + + * examples/sndfile-cmp.c + Add new example program contributed by Conrad Parker. + + * examples/Makefile.am + Hook into build. + + * doc/development.html + Change use or reconfigure.mk to autogen.sh. + +2008-01-08 Erik de Castro Lopo + + * tests/win32_test.c + Add another win32 test. + + * tests/util.tpl + Add function file_length_fd which wraps fstat. + + * tests/Makefile.am + Run the multi_file_test on AU files. + + * tests/multi_file_test.c + Use function file_length_fd() instead of file_length() to overcome stupid + win32 bug. Fscking hell Microsoft sucks so much. + +2008-01-05 Erik de Castro Lopo + + * src/sd2.c + Fix a rsrc parsing bug. Example file supplied by Uli Franke. + +2007-12-28 Erik de Castro Lopo + + * doc/index.html + Allow use of either LGPL v2.1 or LGPL v3. + + * tests/header_test.tpl + Add header_shrink_test from Axel Roebel. + + * src/wav.c + Add fix from Axel Roebel for writing files with float data but no peak + chunk (ie peak chunk gets removed after the file is opened). + + * src/aiff.c tests/header_test.tpl + Apply similar fix to above for AIFF files. + + * src/wav.c tests/header_test.tpl + Apply similar fix to above for WAVEX files. + + * src/command.c + Add Ogg/Vorbis to 'get format' commands. + +2007-12-16 Erik de Castro Lopo + + * src/ogg.c + Fix seeking on multichannel Ogg Vorbis files. Reported by Bodo. + Set the default encoding quality to 0.4 instead of 4.0 (Bodo again). + + * tests/ogg_test.c + Add stereo seek tests. + +2007-12-14 Erik de Castro Lopo + + * tests/ogg_test.c + Add a test (currently failing) for stereo seeking on Ogg Vorbis files. Test + case supplied by Bodo. + + * tests/utils.(def|tpl) + Add compare_XXX_or_die functions. + +2007-12-05 Erik de Castro Lopo + + * src/aiff.c + Fix a bug where ignoring ssnd_fmt.offset and ssnd_fmt.blocksize caused + misaligned reading of 24 bit data. Thanks to Uli Franke for reporting this. + +2007-12-03 Erik de Castro Lopo + + * src/vox_adpcm.c src/ima_oki_adpcm.[ch] src/Makefile.am + Merge in code from the vox-patch branch. Thanks to Robs for the patch + which fixes a long standing bug in the VOX codec. + +2007-12-01 Erik de Castro Lopo + + * examples/sndfile-convert.c + Fix handling of -override-sample-rate=X option. + +2007-11-25 Erik de Castro Lopo + + * src/ogg.c src/VORBIS + Merge in Ogg Vorbis support from John ffitch of the Csound project. + +2007-11-24 Erik de Castro Lopo + + * src/sndfile.c + Recognise files with 'vox6' extension as 6kHz OKI VOX ADPCM files. Also + recognise 'vox8' as and 'vox' as 8kHz files. + + * configure.ac + Detect libjack (JACK Audio Connect Kit). + + * examples/sndfile-jackplay.c examples/Makefile.am + Add new example program to play sound files using the JACK audio server. + Thanks to Jonatan Liljedahl for allowing this to be included. + +2007-11-21 Erik de Castro Lopo + + * doc/index.html + Update support table with SD2 and FLAC. + +2007-11-17 Erik de Castro Lopo + + * src/sndfile.c + Fix calculation of internal value psf->read_current when attempting to read + past end of audio data. + Remove redundant code. + + * tests/lossy_comp_test.c + Add read_raw_test to check that raw reads do not go past the end of the + audio data section. + Clean up error output messages. + + * src/sndfile.c + Add code to prevent sf_read_raw from reading past the end of the audio data. + + * tests/Makefile.am + Add the wav_pcm lossy_comp_test. + +2007-11-16 Erik de Castro Lopo + + * configure.ac src/Makefile.am src/create_symbols_file.py + More OS/2 fixes from David Yeo. + +2007-11-12 Erik de Castro Lopo + + * src/file_io.c tests/utils.tpl tests/benchmark.tpl + Improve handling of requirements for O_BINARY as suggested by Ed Schouten. + +2007-11-11 Erik de Castro Lopo + + * src/common.h + Fix symbol class when SF_MIN is nested inside SF_MAX or vice versa. + + * src/create_symbols_file.py + Add support for OS/2 contributed by David Yeo. + +2007-11-05 Erik de Castro Lopo + + * M4/gcc_version.m4 + Add macro AC_GCC_VERSION to detect GCC_MAJOR_VERSION and GCC_MINOR_VERSION. + + * configure.ac + Use AC_GCC_VERSION to work around gcc-4.2 inline warning stupidity. + See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33995 + Use -fgnu-inline to prevent stupid warnings. + +2007-11-03 Erik de Castro Lopo + + * tests/util.tpl + Increase the printing width for print_test_name(). + + * tests/command_test.c tests/Makefile.am + Add tests for correct updating of broadcast WAV coding history. + + * examples/sndfilehandle.cc examples/Makefile.am + Add example program using the C++ SndfileHandle class. + +2007-10-29 Erik de Castro Lopo + + * src/common.h src/sndfile.c + Add error codes SFE_ZERO_MAJOR_FORMAT and SFE_ZERO_MINOR_FORMAT. + +2007-10-26 Erik de Castro Lopo + + * src/sd2.c + Identify sample-rate/sample-size/channels by resource id. + +2007-10-25 Erik de Castro Lopo + + * src/broadcast.c src/common.h src/sndfile.c + Improvements to handling of broadcast info in WAV files. Thanks to Frederic + Cornu and other for their input. + +2007-10-24 Erik de Castro Lopo + + * src/FLAC/include/share/alloc.h + Mingw fix for SIZE_T_MAX from Uli Franke. + +2007-10-23 Erik de Castro Lopo + + * tests/open_fail_test.c tests/error_test.c tests/Makefile.am + Move tests from open_fail_test.c to error_test.c and remove the former. + +2007-10-22 Erik de Castro Lopo + + * tests/scale_clip_test.(def|tpl) + Add tests for SFC_SET_INT_FLOAT_WRITE command. + + * doc/command.html + Add docs for SFC_SET_INT_FLOAT_WRITE command. + + * examples/sndfile-play.c tests/dft_cmp.c + Fix gcc-4.2 warning messages. + +2007-10-21 Erik de Castro Lopo + + * src/sndfile.h.in src/sndfile.c + Add command SFC_GET_CURRENT_SF_INFO. + + * src/sndfile.h.in src/sndfile.c src/create_symbols_file.py + Remove function sf_get_info (only ever in pre-release code). + + * tests/command_test.c + Add test for SFC_GET_CURRENT_SF_INFO. + +2007-10-15 Erik de Castro Lopo + + * src/wav.c + Add parsing of 'exif' chunks. Originally coded by Trent Apted. + + * configure.ac + Put config stuff in Cfg directory. + Remove check for inttypes.h. + +2007-10-10 Erik de Castro Lopo + + * src/w64.c + Fix writing of 'riff' chunk length and check for correct value in parser. + +2007-09-20 Erik de Castro Lopo + + * doc/index.html + Link to MP3 FAQ entry. + +2007-09-18 Erik de Castro Lopo + + * src/flac.c + Move the blocksize check to an earlier stage of flac_buffer_copy. + +2007-09-12 Erik de Castro Lopo + + * src/FLAC + Huge merge from FLAC upstream. + +2007-09-10 Erik de Castro Lopo + + * examples/*.c + Change license to all example programs to BSD. + +2007-09-08 Erik de Castro Lopo + + * src/FLAC/include/FLAC/metadata.h + Include to prevent compile error on OSX. + + * Octave/octave_test.sh + Disable test on OSX. Can't get it to work. + + * src/flac.c + Check the blocksize returned from the FLAC decoder to prevent buffer + overruns. Reported by Jeremy Friesner. Thanks. + +2007-09-07 Erik de Castro Lopo + + * Makefile.am M4/octave.m4 + Fix build when Octave headers are not present. + +2007-08-27 Erik de Castro Lopo + + * doc/development.html + Add note about bzr repository directory looking empty. + +2007-08-26 Erik de Castro Lopo + + * configure.ac Octave/* M4/octave_* + Bunch of changes to add ability to build GNU Octave modules to read/write + sound files using libsndfile from Octave. + +2007-08-23 Erik de Castro Lopo + + * acinclude.m4 configure.ac ... + Get rid of acinclude.m4 and replace it with an M4 directory. + +2007-08-21 Erik de Castro Lopo + + * src/sndfile.h.in + Remove crufty Metrowerks compiler support. Allow header file to be compiled + on windows with both GCC and microsoft compiler. + +2007-08-19 Erik de Castro Lopo + + * tests/dft_cmp.[ch] tests/floating_point_test.tpl + Clean up floating point tests. + +2007-08-14 Erik de Castro Lopo + + * src/aiff.c + Fix segfault when COMM chunk length is byte swapped. + +2007-08-09 Erik de Castro Lopo + + * src/common.h src/mat4.c src/mat5.c src/sndfile.c + Add a generic SFE_CHANNEL_COUNT_ZERO error, remove format specific errors. + + * src/au.c + Fix crash on AU files with zero channel count. Reported by Ben Alison. + +2007-08-08 Erik de Castro Lopo + + * src/voc.c + Fix bug in handling file supplied by Matt Olenik. + +2007-07-31 Erik de Castro Lopo + + * src/OGG + Merge from OGG upstream sources. + +2007-07-25 Erik de Castro Lopo + + * src/FLAC + Merge from FLAC upstream sources. + +2007-07-15 Erik de Castro Lopo + + * src/flac.c + Fix memory leak; set copy parameter to FALSE in call to + FLAC__metadata_object_vorbiscomment_append_comment. + + * src/common.[ch] + Add function psf_rand_int32(). + +2007-07-14 Erik de Castro Lopo + + * src/FLAC + Merge from FLAC upstream sources. + + * src/strings.c tests/string_test.c tests/Makefile.am + Make sure string tests for SF_STR_LICENSE actually works. + +2007-07-13 Erik de Castro Lopo + + * tests/string_test.c + Add ability to test strings stored in metadata secion of FLAC files. + + * src/string.c + Fix logic for testing if audio data has been written and string is added. + Make sure SF_STR_ALBUM actually works. + + * src/flac.c + Finalize reading/writing string metadata. Tests pass. + + * src/sndfile.h.in tests/string_test.c src/flac.c + Add string type SF_STR_LICENSE, update test and use for FLAC files. + + * src/sndfile.h.in + Add definition for SFC_SET_SCALE_FLOAT_INT_WRITE command. + + * src/common.h src/double64.c src/float32.c src/sndfile.c + Add support for SFC_SET_SCALE_FLOAT_INT_WRITE (still needs testing). + +2007-07-12 Erik de Castro Lopo + + * src/flac.c + Apply patch from Ed Schouten to read artist and title metadata from FLAC + files. + Improve reporting of FLAC metadata. + + * src/sndfile.h.in tests/string_test.c src/flac.c + Add string type SF_STR_ALBUM, update test and use for FLAC files. + +2007-06-28 Erik de Castro Lopo + + * src/FLAC/* + Merge from upstream CVS. + +2007-06-16 Erik de Castro Lopo + + * src/FLAC/* + Update from upstream CVS. + +2007-06-14 Erik de Castro Lopo + + * tests/cpp_test.cc + Add extra tests for when the SndfileHandle constructor fails. + + * src/sndfile.hh + Make sure failure to open the file in the constructor does not allow later + calls to other methods to fail. + +2007-06-10 Erik de Castro Lopo + + * tests/util.tpl + Add function write_mono_file. + + * tests/generate.[ch] tests/Makefile.am + Add files generate.[ch] and hook into build. + + * tests/write_read_test.tpl + Add multi_seek_test. + + * src/flac.c + Fix buffer overflow bug. Test provided by Jeremy Friesner and fix provided + by David Viens. + +2007-06-07 Erik de Castro Lopo + + * doc/FAQ.html + Minor update. + + * configure.ac src/FLAC/src/libFLAC/ia32/Makefile.am src/Makefile.am + Apply patch from Trent Apted make it compile on Intel MacOSX. Thanks Trent. + +2007-05-28 Erik de Castro Lopo + + * src/wav.c + Fix writing of MSGUID subtypes. Thanks to Bruce Sharpe. + +2007-05-22 Erik de Castro Lopo + + * src/wav.c + Fix array indexing bug raised by Bruce Sharpe. + +2007-05-12 Erik de Castro Lopo + + * src/FLAC/src/share/getopt/getopt.c + Fix Mac OSX / PowerPC compile warnings. + + * configure.ac + Make sure WORDS_BIGENDIAN gets correctly defined for FLAC code. + +2007-05-04 Erik de Castro Lopo + + * doc/FAQ.html + Add Q/A about MP3 support. + +2007-05-03 Erik de Castro Lopo + + * doc/new_file_type.HOWTO + Minor updates. + +2007-05-02 Erik de Castro Lopo + + * src/wve.c + Fix a couple bad parameters with psf_log_printf. + + * src/pcm.c + Improve error reporting. + + * src/common.h src/common.c + Constify psf_hexdump. + +2007-04-30 Erik de Castro Lopo + + * src/FLAC + Ditch and re-import required FLAC code. + + * configure.ac + Force FLAC__HAS_OGG variable to 1. + + * src/FLAC/src/libFLAC/stream_encoder.c + Fix compiler warnings. + +2007-04-23 Erik de Castro Lopo + + * configure.ac tests/win32_ordinal_test.c + Detect if win32 DLL is beging generated and only run win32_ordinal_test if + true. + + * src/G72x/Makefile.am src/Makefile.am + Use $(EXEEXT) where possible. + +2007-04-18 Erik de Castro Lopo + + * src/wve.c src/common.h src/sndfile.c + Complete definition of SfE_WVE_NO_WVE error message. + + * src/wve.c + Fix error in files generated on big endian systems. Robustify parsing. + +2007-04-16 Erik de Castro Lopo + + * src/double64.c + Fix clipping of double to short conversions on 64 bit systems. + + * src/flac.c regtest/database.c tests/cpp_test.cc + Fix compile warnings for 64 bit systems. + +2007-04-15 Erik de Castro Lopo + + * src/wav.c src/wav_w64.c + Use audio detect function when 'fmt ' chunk data is suspicious. + + * configure.ac + Add ugly hack to remove -Werror from some Makefiles. + +2007-04-14 Erik de Castro Lopo + + * src/GSM610/long_term.c src/macbinary3.c tests/cpp_test.cc + Add patch from Andr? Pang to clean up compiles on OSX. + + * src/wve.c src/common.h src/sndfile.c src/sndfile.h.in + examples/sndfile-convert.c + Merge changes from Reuben Thomas to improve WVE support. + + * tests/lossy_comp_test.c tests/Makefile.am + Add tests for WVE files. + +2007-04-11 Erik de Castro Lopo + + * src/sndfile.hh + Add a static SndfileHandle::formatCheck method as suggested by Jorge + Jim?nez. + +2007-04-09 Erik de Castro Lopo + + * src/sndfile.c + Fixed a bug in sf_error() where the function itself was being compared + against zero. Add a check for a NULL return from peak_info_calloc. Fix a + possible NULL dereference. + +2007-04-07 Erik de Castro Lopo + + * src/flac.c + Turn off seekable flag when writing, return SFE_BAD_RDWR_FORMAT when + opening file for RDWR. + + * src/sndfile.c + Improve error message for SFE_BAD_RDWR_FORMAT. + + * src/mat4.c + Fix array indexing issue. Thanks to Ben Allison (Nullsoft) for alerting me. + +2007-03-05 Erik de Castro Lopo + + * doc/FAQ.html + Add Q/A 19 on project files. + +2007-03-01 Erik de Castro Lopo + + * src/sndfile.c + Guard agains MacOSX universal binary compiles. + + * doc/FAQ.html + Add Q/A 18 and clean up Q3. + +2007-02-22 Erik de Castro Lopo + + * src/aiff.c + Add support for 'in24' files. + +2007-02-13 Erik de Castro Lopo + + * src/wav.c src/wav_w64.c src/wav_w64.h + Start work towards detecting ausio codec type from the actual audio data. + + * src/audio_detect.c src/test_audio_detect.c + Add new file and its unit test. + +2007-02-07 Erik de Castro Lopo + + * examples/cooledit-fixer.c examples/Makefile.am + Remove old broken example program. + +2007-02-06 Erik de Castro Lopo + + * src/sndfile.c src/sndfile.h.in src/create_symbols_file.py + Add function sf_get_info. + +2007-01-25 Erik de Castro Lopo + + * examples/sndfile-play.c + For ALSA, use the 'default' device instead of 'plughw:0'. + +2007-01-22 Erik de Castro Lopo + + * src/sndfile.c + Allow writing of WAV/WAVEX 'BEXT' chunks in SFM_RDWR mode. + +2007-01-21 Erik de Castro Lopo + + * doc/development.html doc/embedded_files.html man/sndfile-play.1 + Minor documentation fixes. Thanks Reuben Thomas. + +2006-12-16 Erik de Castro Lopo + + * examples/sndfile-convert.c + Add -override-sample-rate command line option. + +2006-11-19 Erik de Castro Lopo + + * tests/misc_test.c + Force errno to zero at start of some tests. + + * src/sndfile.c + Minor clean up of error handling. + + * configure.ac + Remove an assembler test which was failing on OSX. + +2006-11-15 Erik de Castro Lopo + + * src/common.h + Fix the definition of SF_PLATFORM_S64 for MinGW. + + * src/FLAC/Makefile.am src/FLAC/share/grabbag/Makefile.am + Fix path problems for MinGW. + +2006-11-13 Erik de Castro Lopo + + * src/sfendian.h + Add include guard. + + * src/Makefile.am src/flac.c + Clean up include paths. + + * src/test_conversions.c + New file to test psf_binheader_readf/writef functions. + + * src/Makefile.am src/test_file_io.c src/test_log_printf.c src/common.c + Clean up unit testing. + + * src/common.c + Fix a bug reading/writing 64 bit header fields. Thanks to Jonathan Woithe + for reporting this. + + * src/test_conversions.c + Complete unit test for above fix. + +2006-11-11 Erik de Castro Lopo + + * src/sndfile.c + More refactoring to clean up psf_open_file() and vairous sf_open() + functions. + +2006-11-09 Erik de Castro Lopo + + * src/wav.c + Apply a patch from Jonathan Woithe to allow opening of (malformed) WAV + files of over 4 gigabytes. + +2006-11-05 Erik de Castro Lopo + + * src/sndfile.c + Refactor function psf_open_file() to provide a single return point. + + * tests/misc_test.c + Fix permission_test to ensure that read only file can be created. + +2006-11-03 Erik de Castro Lopo + + * src/common.h + Add SF_PLATFORM_S64 macro as a platform independant way of doing signed 64 + bit integers. + + * src/aiff.c src/svx.c src/wav.c + Add warning in log if files are larger than 4 gigabytes in size. + +2006-11-01 Erik de Castro Lopo + + * src/FLAC src/OGG confgure.ac src/Makefile.am + Pull in all required FLAC and OGG code so external libraries are not + needed. This makes compiling on stupid fscking Windoze easier. + +2006-10-27 Erik de Castro Lopo + + * src/sd2.c + Add workaround for switched sample rate and sample size. + + * src/wav.c + Add workaround for excessively long coding history in the 'bext' chunk. + +2006-10-23 Erik de Castro Lopo + + * src/sndfile.h.in src/sndfile.c src/wav.c doc/command.html + Use SF_AMBISONIC_* instead of SF_TRUE/SF_FALSE. + +2006-10-22 Erik de Castro Lopo + + * src/sndfile.h.in src/wav.c src/wav_w64.c src/common.h doc/command.html + Apply a patch from Fons Adriaensen to allow writing on WAVEX Ambisonic + files. Still needs a little tweaking before its ready for release. + + * src/*.c + Use the UNUSED macro to prevent compiler warnings. + +2006-10-19 Erik de Castro Lopo + + * src/aiff.c + Fix a bug in parsing AIFF files with a slightly unusual 'basc' chunk. Thanks + to David Viens for providing two example files. + + * src/common.(c|h) src/aiff.c + Add a function psf_sanitize_string and use it in aiff.c. + +2006-10-18 Erik de Castro Lopo + + * src/wav_w64.c + Apply a patch from Fons Adriaensen which fixes a minor WAVEX GUID issue. + +2006-10-17 Erik de Castro Lopo + + * src/Makefile.am + Fix problem related to recent test coverage changes. + +2006-10-15 Erik de Castro Lopo + + * configure.ac tests/Makefile.am + Add --enable-test-coverage configure option. + +2006-10-05 Erik de Castro Lopo + + * src/sndfile.hh + Add an std::string SndfileHandle constructor. + + * tests/scale_clip_test.tpl + Fix the 'make distcheck' target. + +2006-10-03 Erik de Castro Lopo + + * src/double64.c src/float32.c + Add optional clipping on float file data to int read data conversions. + + * tests/tests/scale_clip_test.(def|tpl) + Add test for above new code. + +2006-09-06 Erik de Castro Lopo + + * tests/aiff_rw_test.c + Add 'MARK' chunks to make sure they are parsed correctly. + +2006-09-05 Erik de Castro Lopo + + * src/aiff.c + Fix parsing of MARK chunks. Many thanks to Sciss for generating files to + help debug the problem. + +2006-09-02 Erik de Castro Lopo + + * src/common.h + Make the SF_MIN and SF_MAX macros at least partially type safe. + + * tests/lossy_comp_test.c + Fix overflow problems when ensuring that signalis not zero. + +2006-08-31 Erik de Castro Lopo * configure.ac docs/*.html Changes for release 1.0.17. -2006-08-08 Erik de Castro Lopo +2006-08-08 Erik de Castro Lopo * src/flac.c Remove inline from functions called by pointer. Thanks to Sampo Savolainen for notifying me of this. -2006-07-31 Erik de Castro Lopo +2006-07-31 Erik de Castro Lopo * src/sndfile.hh Add writeSync method. @@ -21,7 +1677,7 @@ * tests/cpp_test.cc Cleanup. Add tests. -2006-07-30 Erik de Castro Lopo +2006-07-30 Erik de Castro Lopo * src/sndfile.hh Templatize the read/write/readf/writef methods as suggested by Lars Luthman. @@ -33,7 +1689,7 @@ * tests/cpp_test.cc Add more tests. -2006-07-29 Erik de Castro Lopo +2006-07-29 Erik de Castro Lopo * tests/cpp_test.cc Remove the generated file so "make distcheck" passes. @@ -44,7 +1700,7 @@ * src/sndfile.hh Change the license for the C++ wrapper to modified BSD. -2006-07-28 Erik de Castro Lopo +2006-07-28 Erik de Castro Lopo * src/sndfile.hh Complete it. @@ -52,7 +1708,7 @@ * tests/cpp_test.cc Add more tests. -2006-07-27 Erik de Castro Lopo +2006-07-27 Erik de Castro Lopo * tests/utils.tpl Add extern C to generated header file. @@ -66,7 +1722,7 @@ * configure.ac Add appropriate CXXFLAGS. -2006-07-26 Erik de Castro Lopo +2006-07-26 Erik de Castro Lopo * configure.ac Test if compiler supports -Wpointer-arith. @@ -74,7 +1730,7 @@ * src/common.c Fix a warning resulting from -Wpointer-arith. -2006-07-15 Erik de Castro Lopo +2006-07-15 Erik de Castro Lopo * examples/sndfile-play.c Explicitly set endian-ness as well as setting 16 bit output. @@ -88,13 +1744,13 @@ * src/wav_w64.[ch] Minor clean up, add detection of IPP ITU G723.1. -2006-06-23 Erik de Castro Lopo +2006-06-23 Erik de Castro Lopo * src/sndfile.c Make sure psf->dataoffset gets reset to zero when openning headersless files based on the file name extension. -2006-06-21 Erik de Castro Lopo +2006-06-21 Erik de Castro Lopo * tests/(command|lossy_comp|pcm|scale_clip)_test.c tests/fix_this.c tests/write_read_test.(tpl|def) @@ -104,7 +1760,7 @@ * examples/cooledit-fixer.c More fixes like above. -2006-06-20 Erik de Castro Lopo +2006-06-20 Erik de Castro Lopo * src/file_io.c Fix a windows bug where the syserr string of SF_PRIVATE was not being set @@ -113,17 +1769,17 @@ * src/sndfile.c Fixed a logic bug in sf_seek(). Thanks to Paul Davis for finding this. -2006-06-04 Erik de Castro Lopo +2006-06-04 Erik de Castro Lopo * configure.ac Fixed detection of S_IRGRP. -2006-05-30 Erik de Castro Lopo +2006-05-30 Erik de Castro Lopo * sndfile-convert.c Add conversion SF_INSTRUMENT data when present. -2006-05-22 Erik de Castro Lopo +2006-05-22 Erik de Castro Lopo * doc/development.html Removed references to tla on windows. @@ -142,7 +1798,7 @@ src/(sndfile|voc|vox_adpcm|xi).c Remove fdata field from SF_PRIVATE struct and replace it with codec_data. -2006-05-10 Erik de Castro Lopo +2006-05-10 Erik de Castro Lopo * Win32/testprog.c Win32/Makefile.am Add a minimal win32 test program. @@ -150,17 +1806,17 @@ * Win32/README-precompiled-dll.txt Mingw-make-dist.sh Update readme and Mingw build script. -2006-05-09 Erik de Castro Lopo +2006-05-09 Erik de Castro Lopo * configure.ac acinclude.m4 Minor fixes for Solaris. -2006-05-05 Erik de Castro Lopo +2006-05-05 Erik de Castro Lopo * src/test_endswap.(def|tpl) Fix printf formatting for int64_t on 64 bit machines. -2006-05-04 Erik de Castro Lopo +2006-05-04 Erik de Castro Lopo * src/binhead_check.py New file to check for bad parameters passed to psf_binheader_writef(). @@ -174,20 +1830,20 @@ * src/double64.c Clean up double64_get_capability(). -2006-05-03 Erik de Castro Lopo +2006-05-03 Erik de Castro Lopo * src/wav_w64.c Fix a bug on x86_64 where an int was being passed via stdargs and being read using size_t which is 64 bits. Thenks to John ffitch for giving me a login on his box. -2006-05-02 Erik de Castro Lopo +2006-05-02 Erik de Castro Lopo * src/caf.c src/double64.c examples/sndfile-info.c tests/virtual_io_test.c tests/utils.tpl Fix a couple of signed/unsigned problems. -2006-05-01 Erik de Castro Lopo +2006-05-01 Erik de Castro Lopo * tests/command_test.c Add channel map tests. @@ -196,7 +1852,7 @@ Add a pointer the the SF_PRIVATE struct and make sure it gets freed in sf_close(). -2006-04-30 Erik de Castro Lopo +2006-04-30 Erik de Castro Lopo * configure.ac doc/(command|index|api).html NEWS README Updates for 1.0.16 release. @@ -207,7 +1863,7 @@ * examples/sndfile-info.c Clean up usage of SF_INFO struct. -2006-04-29 Erik de Castro Lopo +2006-04-29 Erik de Castro Lopo * tests/util.tpl Add function testing function exit_if_true(). @@ -215,7 +1871,7 @@ * tests/floating_point_test.tpl Fix a problem where the test program was not exiting when the test failed. -2006-04-15 Erik de Castro Lopo +2006-04-15 Erik de Castro Lopo * src/sndfile.h.in src/sndfile.c src/common.h src/command.c Implement new commands SFC_GET_SIGNAL_MAX and SFC_GET_MAX_ALL_CHANNELS. @@ -226,7 +1882,7 @@ * tests/peak_chunk_test.c Update tests for new commands. -2006-04-02 Erik de Castro Lopo +2006-04-02 Erik de Castro Lopo * tests/peak_chunk_test.c Add test for RIFX and WAVEX files. @@ -235,7 +1891,7 @@ * src/sndfile.c Fix a bug where enabling and disabling PEAK chunk was screwing up. -2006-03-31 Erik de Castro Lopo +2006-03-31 Erik de Castro Lopo * src/sndfile.h.in Add the block of 190 reserved bytes into this struct to allow for @@ -250,7 +1906,7 @@ * tests/command_test.c tests/Makefile.am Complete bext tests, hook test in test suite. -2006-03-30 Erik de Castro Lopo +2006-03-30 Erik de Castro Lopo * src/sndfile.h.in Make coding_history field of SF_BROADCAST_INFO struct a char array instead @@ -266,19 +1922,19 @@ * src/wav.c Ignore and skip the 'levl' chunk. -2006-03-26 Erik de Castro Lopo +2006-03-26 Erik de Castro Lopo * configure.ac Fix handling of --enable and --disable configure args. Thanks to Diego 'Flameeyes' Petten? who sent the patch. -2006-03-22 Erik de Castro Lopo +2006-03-22 Erik de Castro Lopo * doc/win32.html Make it really clear that although the MSVC++ cannot compile libsndfile, the precompiled DLL can be used in C++ programs compiled with MSVC++. -2006-03-18 Erik de Castro Lopo +2006-03-18 Erik de Castro Lopo * src/aiff.c Fix bug in writing of INST chunk in AIFF files. @@ -293,7 +1949,7 @@ * tests/utils.tpl Add usage of space character to psf_binheader_writef. -2006-03-17 Erik de Castro Lopo +2006-03-17 Erik de Castro Lopo * src/Makefile.am tests/Makefile.am Remove --source-time argument from autogen command lines. @@ -304,7 +1960,7 @@ * src/sndfile.c src/sndfile.h.in src/wav.c src/common.h Add patch from Paul Davis implementing read/write of the BEXT chunk. -2006-03-16 Erik de Castro Lopo +2006-03-16 Erik de Castro Lopo * Win32/README-precompiled-dll.txt New file descibing how to use the precompiled DLL. @@ -315,7 +1971,7 @@ * configure.ac Bump version to 1.0.15. -2006-03-11 Erik de Castro Lopo +2006-03-11 Erik de Castro Lopo * src/wav.c On read, only add the endian flag if the file is big endian. @@ -326,7 +1982,7 @@ * tests/write_read_test.tpl tests/lossy_comp_test.c Add tests for RIFX files. -2006-03-10 Erik de Castro Lopo +2006-03-10 Erik de Castro Lopo * Mingw-make-dist.sh Bunch of improvements. @@ -334,7 +1990,7 @@ * doc/win32.html Update MinGW program versions. -2006-03-09 Erik de Castro Lopo +2006-03-09 Erik de Castro Lopo * src/create_symbols_file.py Fix the library name in created win32 DEF file. Add correct DLL name for @@ -352,7 +2008,7 @@ * src/wav.c src/wav_w64.c src/sndfile.c src/sndfile.h.in Apply large patch from Jesse Chappell which adds support for RIFX files. -2006-03-08 Erik de Castro Lopo +2006-03-08 Erik de Castro Lopo * Makefile.am Add Mingw-make-dist.sh to the extra dist files. @@ -364,7 +2020,7 @@ New test program to test that the win32 DLL ordinals agree with the DEF file. -2006-03-04 Erik de Castro Lopo +2006-03-04 Erik de Castro Lopo * src/common.h Add a static inline function to convert an int to a size_t. This will be @@ -378,7 +2034,7 @@ Add a workaround for situations where OSX seems to add an extra 0x52 bytes to the start of the resource fork. -2006-02-19 Erik de Castro Lopo +2006-02-19 Erik de Castro Lopo * Mingw-make-dist.sh Add a shell script to build the windows binary/source ZIP file. @@ -393,17 +2049,17 @@ * configure.ac Bump version to 1.0.14. -2006-02-11 Erik de Castro Lopo +2006-02-11 Erik de Castro Lopo * src/sd2.c Improve logging of errors in resource fork parser. -2006-01-31 Erik de Castro Lopo +2006-01-31 Erik de Castro Lopo * Win32/Makefile.msvc Replace au_g72x.* with g72x.*. Thanks to ussell Borogove. -2006-01-29 Erik de Castro Lopo +2006-01-29 Erik de Castro Lopo * src/common.c Make sure return values are initialised header buffer is full. @@ -411,7 +2067,7 @@ * src/wav.c Add workarounds for messed up WAV files. -2006-01-21 Erik de Castro Lopo +2006-01-21 Erik de Castro Lopo * Win32/config.h Undef HAVE_INTTYPES_H for win32. @@ -425,7 +2081,7 @@ * doc/*.html NEWS README Update version numbers. -2006-01-19 Erik de Castro Lopo +2006-01-19 Erik de Castro Lopo * src/xi.c Start work on add read/write of instrument chunks. @@ -438,7 +2094,7 @@ automatically because it requires 3 Gig of disk space and takes 3 minutes to run. -2006-01-10 Erik de Castro Lopo +2006-01-10 Erik de Castro Lopo * examples/sndfile-play.c Fix calculation of samples remaining in win32 code. Thanks Axel Roebel. @@ -447,10 +2103,10 @@ Make sure length of header buffer can hold header plus strings. Thanks Axel Roebel. -2006-01-09 Erik de Castro Lopo +2006-01-09 Erik de Castro Lopo * src/sndfile.h.in src/aiff.c src/wav.c - Apply a patch from John Fitch (Csound project). + Apply a patch from John ffitch (Csound project). Add detune field to SF_INSTRUMENT struct. Add reading/writing instrument chunks to WAV files. @@ -460,7 +2116,7 @@ * tests/Makefile.am Hook instrument tests into test suite. -2006-01-05 Erik de Castro Lopo +2006-01-05 Erik de Castro Lopo * configure.ac Check for because some broken systems (like Solaris) don't have @@ -469,7 +2125,7 @@ * src/sfendian.h src/common.h Use if is not available. -2005-12-30 Erik de Castro Lopo +2005-12-30 Erik de Castro Lopo * tests/peak_chunk_test.c Extend and clean up tests. @@ -477,7 +2133,7 @@ * src/sndfile.c Fix a bug that prevented the turning off of PEAK chunks. -2005-12-29 Erik de Castro Lopo +2005-12-29 Erik de Castro Lopo * tests/error_test.c Make the test distclean correct. @@ -485,13 +2141,13 @@ * src/file_io.c Fix an SD2 MacOSX bug (reported by vince schwarzinger). -2005-12-28 Erik de Castro Lopo +2005-12-28 Erik de Castro Lopo * src/aiff.c tests/command_test.c Apply a big patch from John ffitch (Csound project) to add reading and writing of instrument chunks to AIFF files. Also update the test. -2005-12-10 Erik de Castro Lopo +2005-12-10 Erik de Castro Lopo * tests/aiff_rw_test.c tests/virtual_io_test.c tests/utils.tpl Move test function dump_data_to_file() to utils.tpl. @@ -500,7 +2156,7 @@ Updates, including a new test to test that sf_error() returns a valid error number. -2005-12-07 Erik de Castro Lopo +2005-12-07 Erik de Castro Lopo * examples/list_formats.c Make sure the SF_INFO struct is memset to all zero before being used. @@ -509,7 +2165,7 @@ * src/sndfile.c Make the return value of sf_error() match the API documentation. -2005-11-19 Erik de Castro Lopo +2005-11-19 Erik de Castro Lopo * examples/sndfile-convert.c Allow conversion to raw gsm610. @@ -523,7 +2179,7 @@ * src/sndfile.c Rejig file extension based file type detection. -2005-11-16 Erik de Castro Lopo +2005-11-16 Erik de Castro Lopo * src/sndfile.c Add "gsm" as a recognised file extension when no magic number can be found. @@ -531,12 +2187,12 @@ * tests/lossy_comp_test.c tests/Makefile.am Test headerless GSM610. -2005-11-13 Erik de Castro Lopo +2005-11-13 Erik de Castro Lopo * doc/api.html Fix a minor typo and a minor error. Thanks Christoph Kobe and John Pavel. -2005-10-30 Erik de Castro Lopo +2005-10-30 Erik de Castro Lopo * src/wav_w64.c Add more reporting of 'fmt ' chunk for G721 encoded files. @@ -544,12 +2200,12 @@ * src/wav.c Gernerate a more correct 20 byte 'fmt ' chunk rather than a 16 byte one. -2005-10-29 Erik de Castro Lopo +2005-10-29 Erik de Castro Lopo * src/G72x/g72x.[ch] Minor cleanup of interface. -2005-10-28 Erik de Castro Lopo +2005-10-28 Erik de Castro Lopo * src/ogg.c Removed the horribly broken and non-functional OGG implementation when @@ -559,7 +2215,7 @@ * src/caf.c Fix a memory leak. -2005-10-27 Erik de Castro Lopo +2005-10-27 Erik de Castro Lopo * src/g72x.c src/G72x/*.(c|h) src/common.h src/sndfile.c src/wav.c src/au.c Add support for G721 encoded WAV files. @@ -591,7 +2247,7 @@ * src/*.c Fix knock on effects of above. -2005-10-26 Erik de Castro Lopo +2005-10-26 Erik de Castro Lopo * examples/sndfile-info.c Complete dumping SF_INSTRUMENT data. @@ -603,13 +2259,13 @@ Add a string comment to the end of the files to make sure that the decoder doesn't decode beyond the end of the audio data section. -2005-10-25 Erik de Castro Lopo +2005-10-25 Erik de Castro Lopo * examples/sndfile-info.c Minor code cleanup. Start work on dumping SF_INSTRUMENT data. -2005-10-23 Erik de Castro Lopo +2005-10-23 Erik de Castro Lopo * src/sndfile.h.in src/common.h src/common.c Update definition of SF_INSTRUMENT struct and create a function to allocate @@ -629,17 +2285,17 @@ Add test for set and getof SF_INSTRUMENT data. The file command_test.c is no longer autogen generated. -2005-10-15 Erik de Castro Lopo +2005-10-15 Erik de Castro Lopo * src/gsm610.c Minor cleanup. -2005-10-14 Erik de Castro Lopo +2005-10-14 Erik de Castro Lopo * tests/lossy_comp_test.c Minor cleanup. -2005-10-13 Erik de Castro Lopo +2005-10-13 Erik de Castro Lopo * src/*.c Ensure sfconfig.h is included before any other header file. @@ -650,12 +2306,12 @@ * src/gsm610.c Make sure SF_FORMAT_WAVEX are handled correctly. -2005-10-07 Erik de Castro Lopo +2005-10-07 Erik de Castro Lopo * configure.ac Add options to allow disabling of FLAC and ALSA. Suggested by Ben Greear. -2005-09-30 Erik de Castro Lopo +2005-09-30 Erik de Castro Lopo * tests/locale_test.c Modify the way the unicode strings were encoded so that older compilers @@ -667,17 +2323,17 @@ * NEWS README Win32/config.h doc/(FAQ|index.html|command|api).html Update version numbers. -2005-09-26 Erik de Castro Lopo +2005-09-26 Erik de Castro Lopo * src/flac.c Fix valgrind error and minor cleanup. -2005-09-25 Erik de Castro Lopo +2005-09-25 Erik de Castro Lopo * src/(au|paf|aiff|w64|wav|svx).c Make sure structs are initialised. -2005-09-24 Erik de Castro Lopo +2005-09-24 Erik de Castro Lopo * configure.ac Make -Wdeclaration-after-statement work with --enable-gcc-werror configure @@ -685,23 +2341,23 @@ Add -std=gnu99 (C99 plus posix style stuff like gmtime_r) to CFLAGS if the compiler supports it. -2005-09-23 Erik de Castro Lopo +2005-09-23 Erik de Castro Lopo * configure.ac acinclude.m4 Add -Wdeclaration-after-statement to CFLAGS if the compilers supports it. -2005-09-22 Erik de Castro Lopo +2005-09-22 Erik de Castro Lopo * tests/util.(tpl|def) Make the test_write_*_or_die() functions const safe. -2005-09-21 Erik de Castro Lopo +2005-09-21 Erik de Castro Lopo * src/nist.c Make sure the data offset is read from the file header. Thanks to David A. van Leeuwen for a patch. -2005-09-20 Erik de Castro Lopo +2005-09-20 Erik de Castro Lopo * configure.ac src/sfconfig.h Check for and the function setlocale(). @@ -710,7 +2366,7 @@ * tests/locale_test.c tests/Makefile.am Add new test program and hook into build/test system. -2005-09-18 Erik de Castro Lopo +2005-09-18 Erik de Castro Lopo * src/common.h src/file_io.c On windows, use windows specific types for file handles. @@ -722,14 +2378,14 @@ * src/sndfile.c src/test_file_io.c Fix knock on effects. -2005-09-06 Erik de Castro Lopo +2005-09-06 Erik de Castro Lopo * src/float_cast.h The lrint and lrintf implementations in Cygwin are both buggy and slow. Add replacements which were pulled from the Public Domain MinGW math.h header file. -2005-09-05 Erik de Castro Lopo +2005-09-05 Erik de Castro Lopo * tests/(lossy_comp_test|virtual_io_test).c More Valgrind fixups. @@ -740,7 +2396,7 @@ * Win32/config.h Win32/sndfile.h Win32/Makefile.msvc Update build for MSVC. -2005-09-04 Erik de Castro Lopo +2005-09-04 Erik de Castro Lopo * tests/lossy_comp_test.c Make sure to close SNDFILE when exiting test when file format is not seekable. @@ -748,7 +2404,7 @@ * tests/(aiff_rw_test|virtual_io_test).c Do a few valgrind fix ups. -2005-09-03 Erik de Castro Lopo +2005-09-03 Erik de Castro Lopo * src/float32.c src/double64.c Replace floating point equality comparisons with greater/less comparisons. @@ -764,18 +2420,18 @@ * src/file_io.c Remove Mac OS9 Metrowerks compiler specific hacks. -2005-08-31 Erik de Castro Lopo +2005-08-31 Erik de Castro Lopo * src/w64.c Cast integer literal to sf_count_t in call to psf_binheader_writef() to prevent Valgrind error. -2005-08-30 Erik de Castro Lopo +2005-08-30 Erik de Castro Lopo * doc/command.html Improve documentation of SF_GET_FORMAT_SUBTYPE. -2005-08-26 Erik de Castro Lopo +2005-08-26 Erik de Castro Lopo * examples/sndfile-convert.c Allow files to be converted to SD2 format. @@ -784,17 +2440,17 @@ Fix a bug in reading and writing of SD2 files on little endian CPUs. Thanks to Matthew Willis for finding this. -2005-08-25 Erik de Castro Lopo +2005-08-25 Erik de Castro Lopo * doc/api.html Update Note2 to point to SFC_SET_SCALE_FLOAT_INT_READ. -2005-08-16 Erik de Castro Lopo +2005-08-16 Erik de Castro Lopo * configure.ac Use $host_os instead of $target_os (thanks to Mo De Jong). -2005-08-15 Erik de Castro Lopo +2005-08-15 Erik de Castro Lopo * src/Makefile.am Apply a patch from Mo DeJong to allow building outside of the source dir. @@ -806,7 +2462,7 @@ Move some code from wav.c to wav_w64.c to improve the log output of files of type WAVE_FORMAT_EXTENSIBLE. -2005-08-10 Erik de Castro Lopo +2005-08-10 Erik de Castro Lopo * src/create_symbols_file.py Make sure sf_write_fsync is an exported symbol. @@ -814,7 +2470,7 @@ * examples/sndfile-convert.c Add support for writing VOX adpcm files. -2005-07-31 Erik de Castro Lopo +2005-07-31 Erik de Castro Lopo * doc/api.html Document the new function sf_write_sync(). @@ -822,7 +2478,7 @@ * doc/FAQ.html Do you plan to support XYZ codec. -2005-07-28 Erik de Castro Lopo +2005-07-28 Erik de Castro Lopo * src/sndfile.h.in src/sndfile.c Add function sf_write_sync() to the API. @@ -833,7 +2489,7 @@ * tests/write_read_test.tpl Use the new function in the tests. -2005-07-24 Erik de Castro Lopo +2005-07-24 Erik de Castro Lopo * src/common.h src/double64.c src/float32.c src/sndfile.c Change the way PEAK chunk info is stored. Peaks now stored as an sf_count_t @@ -846,7 +2502,7 @@ Implement 'peak' chunk for file wuth data in SF_FORMAT_FLOAT or SF_FORMAT_DOUBLE format. -2005-07-23 Erik de Castro Lopo +2005-07-23 Erik de Castro Lopo * src/nist.c Fix a bug where a variable was being used without being initialized. @@ -858,7 +2514,7 @@ * src/aiff.c src/wav.c Fix allocation for PEAK_CHUNK (bug found using valgrind). -2005-07-21 Erik de Castro Lopo +2005-07-21 Erik de Castro Lopo * src/common.h Move the peak_loc field of SF_PRIVATE to the PEAK_CHUNK struct. @@ -868,12 +2524,12 @@ * src/aiff.c src/caf.c src/wav.c src/float32.c src/double64.c Fix knock on effects from above. -2005-07-19 Erik de Castro Lopo +2005-07-19 Erik de Castro Lopo * src/wav.c Prevent files with unknown chunks from being opened read/write. -2005-07-14 Erik de Castro Lopo +2005-07-14 Erik de Castro Lopo * src/flac.c Do not use psf->end_of_file because it never gets set to anything. @@ -881,7 +2537,7 @@ * src/common.h Remove unused SF_PRIVATE field end_of_file. -2005-07-12 Erik de Castro Lopo +2005-07-12 Erik de Castro Lopo * src/common.c Change the 'S' format specifier of psf_binheader_writef() to write AIFF @@ -891,7 +2547,7 @@ Move to new (correct) AIFF string style. Thanks to Axel Roebel for being so persistent on this issue. -2005-07-11 Erik de Castro Lopo +2005-07-11 Erik de Castro Lopo * src/sndfile.c Allow SFE_UNSUPPORTED_FORMAT as an error from sf_open(). @@ -902,7 +2558,7 @@ * src/mat5.c Modify the way the header is written. -2005-07-10 Erik de Castro Lopo +2005-07-10 Erik de Castro Lopo * src/caf.c Add a 'free' chunk to the written file so that the audio data starts at @@ -911,7 +2567,7 @@ * src/sndfile.c Allow SFE_UNSUPPORTED_FORMAT as an error from sf_open(). -2005-07-09 Erik de Castro Lopo +2005-07-09 Erik de Castro Lopo * src/caf.c src/sndfile.c Add support for signed 8 bit integers. @@ -922,7 +2578,7 @@ * doc/index.html Update matrix for signed 8 bit integers in CAF files. -2005-07-08 Erik de Castro Lopo +2005-07-08 Erik de Castro Lopo * src/sndfile.c Update sf_check_format() to support CAF. @@ -943,7 +2599,7 @@ tests/header_test.tpl misc_test.c Add tests for CAF files. -2005-07-07 Erik de Castro Lopo +2005-07-07 Erik de Castro Lopo * doc/FAQ.html Fix Q/A about reading/writing memory buffers. @@ -951,7 +2607,7 @@ * src/caf.c Bunch of work to support reading of CAF files. -2005-07-04 Erik de Castro Lopo +2005-07-04 Erik de Castro Lopo * src/(aiff|ima_adpcm|mat4|mat5|ms_adpcm).c examples/sndfile-play.c Fix sign conversion errors reported by gcc-4.0. @@ -962,7 +2618,7 @@ * src/sndfile.c src/common.h src/sndfile.h.in src/Makefile.am Hook new file into build system. -2005-06-21 Erik de Castro Lopo +2005-06-21 Erik de Castro Lopo * src_wav_w64.c Fix handling of stupidly large 'fmt ' chunks. Thanks to Vadim Berezniker @@ -971,7 +2627,7 @@ * src/common.h src/sndfile.c Remove redundant error code SFE_WAV_FMT_TOO_BIG. -2005-06-20 Erik de Castro Lopo +2005-06-20 Erik de Castro Lopo * src/sndfile.h.in src/common.h src/sndfile.c Add public error value SF_ERR_MALFORMED_FILE. @@ -986,7 +2642,7 @@ * regtest/database.c regtest/sndfile-regtest.c Fix compiling when sqlite is missing. -2005-06-11 Erik de Castro Lopo +2005-06-11 Erik de Castro Lopo * src/file_io.c Fix psf_is_pipe() and return value of psf_fread() when using virtual i/o. @@ -1003,7 +2659,7 @@ * src/(sndfile.h.in|file_io.c|common.h|sndfile.c) tests/virtual_io_test.c Rename some of the virtual i/o functions and data types. -2005-06-10 Erik de Castro Lopo +2005-06-10 Erik de Castro Lopo * src/sndfile.c Fix the return values of sf_commands : SFC_SET_NORM_DOUBLE, @@ -1014,7 +2670,7 @@ Correct documented return values for SFC_SET_NORM_DOUBLE and SFC_SET_NORM_FLOAT. Thanks to Kyroz again. -2005-05-17 Erik de Castro Lopo +2005-05-17 Erik de Castro Lopo * regtest/* Add new files for sndfile-regtest program. @@ -1026,7 +2682,7 @@ Fix a regression where long ICMT chunks were causing the WAV parser to exit. -2005-05-15 Erik de Castro Lopo +2005-05-15 Erik de Castro Lopo * libsndfile.spec.in Add html docs to the files section as suggested by Karsten Jeppesen. @@ -1034,17 +2690,17 @@ * src/aiff.c Fix parsing of odd length ANNO chunks. -2005-05-13 Erik de Castro Lopo +2005-05-13 Erik de Castro Lopo * src/common.h Change the include guard to prevent clashes with other code. -2005-05-12 Erik de Castro Lopo +2005-05-12 Erik de Castro Lopo * examples/sndfile-play.c Improve error handling in code for playback under Linux/ALSA. -2005-05-10 Erik de Castro Lopo +2005-05-10 Erik de Castro Lopo * src/ircam.c Fix writing of IRCAM files on big endian systems (thanks to Axel Roebel). @@ -1054,7 +2710,7 @@ produce files with very short LIST chunks (thanks to Jonathan Segel who supplied the file). -2005-04-30 Erik de Castro Lopo +2005-04-30 Erik de Castro Lopo * src/aiff.c Apply a patch From David Viens to make the parsing of basc chunks more @@ -1064,13 +2720,13 @@ Another patch from David Viens to write correct wavex channel masks for the most common channel configurations. -2005-04-08 Erik de Castro Lopo +2005-04-08 Erik de Castro Lopo * src/command.c Only allow FLAC in the format arrays if FLAC is enabled. Thanks to Leigh Smith. -2005-03-09 Erik de Castro Lopo +2005-03-09 Erik de Castro Lopo * src/common.h Add a directory field for storing the file directory to the SF_PRIVATE @@ -1083,13 +2739,13 @@ Cleanup psf_open_rsrc() and also check for resource fork in .AppleDouble/filename. -2005-03-01 Erik de Castro Lopo +2005-03-01 Erik de Castro Lopo * src/svx.c Fix a bug in the printing of the channel count. Bug reported by Michael Schwendt. Thanks. -2005-01-26 Erik de Castro Lopo +2005-01-26 Erik de Castro Lopo * src/paf.c Fix a seek bug for 24 bit PAF files. @@ -1097,7 +2753,7 @@ * tests/write_read_test.tpl Update write_read_test to trigger the previously hidden PAF seek bug. -2005-01-25 Erik de Castro Lopo +2005-01-25 Erik de Castro Lopo * src/aiff.c src/w64.c src/wav.c Do not return a header parse error when the log buffer overflows. @@ -2162,7 +3818,7 @@ * src/*.c examples/*.c tests/*.c Fix all compiler warnings arising from the above. -2003-08-02 +2003-08-02 Erik de Castro Lopo * tests/aiff_rw_test.c tests/Makefile.am New test program to check for errors re-writing the headers of AIFC files Added: freeswitch/trunk/libs/libsndfile/M4/Makefile.am ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/M4/Makefile.am Thu May 21 16:09:30 2009 @@ -0,0 +1,5 @@ +## Process this file with automake to produce Makefile.in + +EXTRA_DIST = add_cflags.m4 clip_mode.m4 endian.m4 extra_largefile.m4 \ + flexible_array.m4 llrint.m4 lrint.m4 lrintf.m4 octave.m4 extra_pkg.m4 + Added: freeswitch/trunk/libs/libsndfile/M4/Makefile.in ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/M4/Makefile.in Thu May 21 16:09:30 2009 @@ -0,0 +1,394 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + at SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = M4 +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/M4/add_cflags.m4 \ + $(top_srcdir)/M4/add_cxxflags.m4 $(top_srcdir)/M4/clip_mode.m4 \ + $(top_srcdir)/M4/endian.m4 $(top_srcdir)/M4/extra_largefile.m4 \ + $(top_srcdir)/M4/extra_pkg.m4 \ + $(top_srcdir)/M4/flexible_array.m4 \ + $(top_srcdir)/M4/gcc_version.m4 $(top_srcdir)/M4/libtool.m4 \ + $(top_srcdir)/M4/lrint.m4 $(top_srcdir)/M4/lrintf.m4 \ + $(top_srcdir)/M4/ltoptions.m4 $(top_srcdir)/M4/ltsugar.m4 \ + $(top_srcdir)/M4/ltversion.m4 $(top_srcdir)/M4/lt~obsolete.m4 \ + $(top_srcdir)/M4/mkoctfile_version.m4 \ + $(top_srcdir)/M4/octave.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +COMPILER_IS_GCC = @COMPILER_IS_GCC@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ENABLE_EXPERIMENTAL_CODE = @ENABLE_EXPERIMENTAL_CODE@ +EXEEXT = @EXEEXT@ +EXTERNAL_CFLAGS = @EXTERNAL_CFLAGS@ +EXTERNAL_LIBS = @EXTERNAL_LIBS@ +FGREP = @FGREP@ +FLAC_CFLAGS = @FLAC_CFLAGS@ +FLAC_LIBS = @FLAC_LIBS@ +GCC_MAJOR_VERSION = @GCC_MAJOR_VERSION@ +GCC_MINOR_VERSION = @GCC_MINOR_VERSION@ +GCC_VERSION = @GCC_VERSION@ +GETCONF = @GETCONF@ +GREP = @GREP@ +HAVE_AUTOGEN = @HAVE_AUTOGEN@ +HAVE_JACK = @HAVE_JACK@ +HAVE_MKOCTFILE = @HAVE_MKOCTFILE@ +HAVE_OCTAVE = @HAVE_OCTAVE@ +HAVE_OCTAVE_CONFIG = @HAVE_OCTAVE_CONFIG@ +HAVE_WINE = @HAVE_WINE@ +HTML_BGCOLOUR = @HTML_BGCOLOUR@ +HTML_FGCOLOUR = @HTML_FGCOLOUR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LIBS = @JACK_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MKOCTFILE = @MKOCTFILE@ +MKOCTFILE_VERSION = @MKOCTFILE_VERSION@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OCTAVE = @OCTAVE@ +OCTAVE_CONFIG = @OCTAVE_CONFIG@ +OCTAVE_CONFIG_VERSION = @OCTAVE_CONFIG_VERSION@ +OCTAVE_DEST_MDIR = @OCTAVE_DEST_MDIR@ +OCTAVE_DEST_ODIR = @OCTAVE_DEST_ODIR@ +OCTAVE_VERSION = @OCTAVE_VERSION@ +OGG_CFLAGS = @OGG_CFLAGS@ +OGG_LIBS = @OGG_LIBS@ +OS_SPECIFIC_CFLAGS = @OS_SPECIFIC_CFLAGS@ +OS_SPECIFIC_LINKS = @OS_SPECIFIC_LINKS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SF_COUNT_MAX = @SF_COUNT_MAX@ +SHARED_VERSION_INFO = @SHARED_VERSION_INFO@ +SHELL = @SHELL@ +SHLIB_VERSION_ARG = @SHLIB_VERSION_ARG@ +SIZEOF_SF_COUNT_T = @SIZEOF_SF_COUNT_T@ +SQLITE3_CFLAGS = @SQLITE3_CFLAGS@ +SQLITE3_LIBS = @SQLITE3_LIBS@ +STRIP = @STRIP@ +TYPEOF_SF_COUNT_T = @TYPEOF_SF_COUNT_T@ +VERSION = @VERSION@ +VORBISENC_CFLAGS = @VORBISENC_CFLAGS@ +VORBISENC_LIBS = @VORBISENC_LIBS@ +VORBIS_CFLAGS = @VORBIS_CFLAGS@ +VORBIS_LIBS = @VORBIS_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +htmldocdir = @htmldocdir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = add_cflags.m4 clip_mode.m4 endian.m4 extra_largefile.m4 \ + flexible_array.m4 llrint.m4 lrint.m4 lrintf.m4 octave.m4 extra_pkg.m4 + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu M4/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu M4/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Added: freeswitch/trunk/libs/libsndfile/M4/add_cflags.m4 ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/M4/add_cflags.m4 Thu May 21 16:09:30 2009 @@ -0,0 +1,17 @@ +dnl @synopsis AC_ADD_CFLAGS +dnl +dnl Add the given option to CFLAGS, if it doesn't break the compiler + +AC_DEFUN([AC_ADD_CFLAGS], +[AC_MSG_CHECKING([if $CC accepts $1]) + ac_add_cflags__old_cflags="$CFLAGS" + CFLAGS="$CFLAGS $1" + AC_TRY_LINK([ + #include + ], + [puts("Hello, World!"); return 0;], + AC_MSG_RESULT([yes]), + AC_MSG_RESULT([no]) + CFLAGS="$ac_add_cflags__old_cflags" + ) +])# AC_ADD_CFLAGS Added: freeswitch/trunk/libs/libsndfile/M4/add_cxxflags.m4 ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/M4/add_cxxflags.m4 Thu May 21 16:09:30 2009 @@ -0,0 +1,17 @@ +dnl @synopsis AC_ADD_CXXFLAGS +dnl +dnl Add the given option to CXXFLAGS, if it doesn't break the compiler + +AC_DEFUN([AC_ADD_CXXFLAGS], +[AC_MSG_CHECKING([if $CXX accepts $1]) + ac_add_cxxflags__old_cxxflags="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $1" + AC_TRY_LINK([ + #include + ], + [puts("Hello, World!"); return 0;], + AC_MSG_RESULT([yes]), + AC_MSG_RESULT([no]) + CXXFLAGS="$ac_add_cxxflags__old_cxxflags" + ) +])# AC_ADD_CXXFLAGS Added: freeswitch/trunk/libs/libsndfile/M4/clip_mode.m4 ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/M4/clip_mode.m4 Thu May 21 16:09:30 2009 @@ -0,0 +1,124 @@ +dnl @synopsis AC_C_CLIP_MODE +dnl +dnl Determine the clipping mode when converting float to int. +dnl @version 1.0 May 17 2003 +dnl @author Erik de Castro Lopo +dnl +dnl Permission to use, copy, modify, distribute, and sell this file for any +dnl purpose is hereby granted without fee, provided that the above copyright +dnl and this permission notice appear in all copies. No representations are +dnl made about the suitability of this software for any purpose. It is +dnl provided "as is" without express or implied warranty. + + + + + + + +dnl Find the clipping mode in the following way: +dnl 1) If we are not cross compiling test it. +dnl 2) IF we are cross compiling, assume that clipping isn't done correctly. + +AC_DEFUN([AC_C_CLIP_MODE], +[AC_CACHE_CHECK(processor clipping capabilities, + ac_cv_c_clip_type, + +# Initialize to unknown +ac_cv_c_clip_positive=unknown +ac_cv_c_clip_negative=unknown + + +if test $ac_cv_c_clip_positive = unknown ; then + AC_TRY_RUN( + [[ + #define _ISOC9X_SOURCE 1 + #define _ISOC99_SOURCE 1 + #define __USE_ISOC99 1 + #define __USE_ISOC9X 1 + #include + int main (void) + { double fval ; + int k, ival ; + + fval = 1.0 * 0x7FFFFFFF ; + for (k = 0 ; k < 100 ; k++) + { ival = (lrint (fval)) >> 24 ; + if (ival != 127) + return 1 ; + + fval *= 1.2499999 ; + } ; + + return 0 ; + } + ]], + ac_cv_c_clip_positive=yes, + ac_cv_c_clip_positive=no, + ac_cv_c_clip_positive=unknown + ) + + AC_TRY_RUN( + [[ + #define _ISOC9X_SOURCE 1 + #define _ISOC99_SOURCE 1 + #define __USE_ISOC99 1 + #define __USE_ISOC9X 1 + #include + int main (void) + { double fval ; + int k, ival ; + + fval = -8.0 * 0x10000000 ; + for (k = 0 ; k < 100 ; k++) + { ival = (lrint (fval)) >> 24 ; + if (ival != -128) + return 1 ; + + fval *= 1.2499999 ; + } ; + + return 0 ; + } + ]], + ac_cv_c_clip_negative=yes, + ac_cv_c_clip_negative=no, + ac_cv_c_clip_negative=unknown + ) + fi + +if test $ac_cv_c_clip_positive = yes ; then + ac_cv_c_clip_positive=1 +else + ac_cv_c_clip_positive=0 + fi + +if test $ac_cv_c_clip_negative = yes ; then + ac_cv_c_clip_negative=1 +else + ac_cv_c_clip_negative=0 + fi + +[[ +case "$ac_cv_c_clip_positive$ac_cv_c_clip_negative" in + "00") + ac_cv_c_clip_type="none" + ;; + "10") + ac_cv_c_clip_type="positive" + ;; + "01") + ac_cv_c_clip_type="negative" + ;; + "11") + ac_cv_c_clip_type="both" + ;; + esac + ]] + +) +] + +)# AC_C_CLIP_MODE + + Added: freeswitch/trunk/libs/libsndfile/M4/endian.m4 ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/M4/endian.m4 Thu May 21 16:09:30 2009 @@ -0,0 +1,159 @@ +dnl @synopsis AC_C_FIND_ENDIAN +dnl +dnl Determine endian-ness of target processor. +dnl @version 1.1 Mar 03 2002 +dnl @author Erik de Castro Lopo +dnl +dnl Majority written from scratch to replace the standard autoconf macro +dnl AC_C_BIGENDIAN. Only part remaining from the original it the invocation +dnl of the AC_TRY_RUN macro. +dnl +dnl Permission to use, copy, modify, distribute, and sell this file for any +dnl purpose is hereby granted without fee, provided that the above copyright +dnl and this permission notice appear in all copies. No representations are +dnl made about the suitability of this software for any purpose. It is +dnl provided "as is" without express or implied warranty. + +dnl Find endian-ness in the following way: +dnl 1) Look in . +dnl 2) If 1) fails, look in and . +dnl 3) If 1) and 2) fails and not cross compiling run a test program. +dnl 4) If 1) and 2) fails and cross compiling then guess based on target. + +AC_DEFUN([AC_C_FIND_ENDIAN], +[AC_CACHE_CHECK(processor byte ordering, + ac_cv_c_byte_order, + +# Initialize to unknown +ac_cv_c_byte_order=unknown + +if test x$ac_cv_header_endian_h = xyes ; then + + # First try which should set BYTE_ORDER. + + [AC_TRY_LINK([ + #include + #if BYTE_ORDER != LITTLE_ENDIAN + not big endian + #endif + ], return 0 ;, + ac_cv_c_byte_order=little + )] + + [AC_TRY_LINK([ + #include + #if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + ], return 0 ;, + ac_cv_c_byte_order=big + )] + + fi + +if test $ac_cv_c_byte_order = unknown ; then + + [AC_TRY_LINK([ + #include + #include + #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros + #endif + ], return 0 ;, + + [AC_TRY_LINK([ + #include + #include + #if BYTE_ORDER != LITTLE_ENDIAN + not big endian + #endif + ], return 0 ;, + ac_cv_c_byte_order=little + )] + + [AC_TRY_LINK([ + #include + #include + #if BYTE_ORDER != LITTLE_ENDIAN + not big endian + #endif + ], return 0 ;, + ac_cv_c_byte_order=little + )] + + )] + + fi + +if test $ac_cv_c_byte_order = unknown ; then + if test $cross_compiling = yes ; then + # This is the last resort. Try to guess the target processor endian-ness + # by looking at the target CPU type. + [ + case "$target_cpu" in + alpha* | i?86* | mipsel* | ia64*) + ac_cv_c_big_endian=0 + ac_cv_c_little_endian=1 + ;; + + m68* | mips* | powerpc* | hppa* | sparc*) + ac_cv_c_big_endian=1 + ac_cv_c_little_endian=0 + ;; + + esac + ] + else + AC_TRY_RUN( + [[ + int main (void) + { /* Are we little or big endian? From Harbison&Steele. */ + union + { long l ; + char c [sizeof (long)] ; + } u ; + u.l = 1 ; + return (u.c [sizeof (long) - 1] == 1); + } + ]], , ac_cv_c_byte_order=big, + ac_cv_c_byte_order=unknown + ) + + AC_TRY_RUN( + [[int main (void) + { /* Are we little or big endian? From Harbison&Steele. */ + union + { long l ; + char c [sizeof (long)] ; + } u ; + u.l = 1 ; + return (u.c [0] == 1); + }]], , ac_cv_c_byte_order=little, + ac_cv_c_byte_order=unknown + ) + fi + fi + +) + +if test $ac_cv_c_byte_order = big ; then + ac_cv_c_big_endian=1 + ac_cv_c_little_endian=0 +elif test $ac_cv_c_byte_order = little ; then + ac_cv_c_big_endian=0 + ac_cv_c_little_endian=1 +else + ac_cv_c_big_endian=0 + ac_cv_c_little_endian=0 + + AC_MSG_WARN([[*****************************************************************]]) + AC_MSG_WARN([[*** Not able to determine endian-ness of target processor. ]]) + AC_MSG_WARN([[*** The constants CPU_IS_BIG_ENDIAN and CPU_IS_LITTLE_ENDIAN in ]]) + AC_MSG_WARN([[*** src/config.h may need to be hand editied. ]]) + AC_MSG_WARN([[*****************************************************************]]) + fi + +] +)# AC_C_FIND_ENDIAN + + Added: freeswitch/trunk/libs/libsndfile/M4/extra_largefile.m4 ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/M4/extra_largefile.m4 Thu May 21 16:09:30 2009 @@ -0,0 +1,114 @@ +dnl By default, many hosts won't let programs access large files; +dnl one must use special compiler options to get large-file access to work. +dnl For more details about this brain damage please see: +dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html + +dnl Written by Paul Eggert . + +dnl Internal subroutine of AC_SYS_EXTRA_LARGEFILE. +dnl AC_SYS_EXTRA_LARGEFILE_FLAGS(FLAGSNAME) +AC_DEFUN([AC_SYS_EXTRA_LARGEFILE_FLAGS], + [AC_CACHE_CHECK([for $1 value to request large file support], + ac_cv_sys_largefile_$1, + [ac_cv_sys_largefile_$1=`($GETCONF LFS_$1) 2>/dev/null` || { + ac_cv_sys_largefile_$1=no + ifelse($1, CFLAGS, + [case "$host_os" in + # IRIX 6.2 and later require cc -n32. +changequote(, )dnl + irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*) +changequote([, ])dnl + if test "$GCC" != yes; then + ac_cv_sys_largefile_CFLAGS=-n32 + fi + ac_save_CC="$CC" + CC="$CC $ac_cv_sys_largefile_CFLAGS" + AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no) + CC="$ac_save_CC" + esac]) + }])]) + +dnl Internal subroutine of AC_SYS_EXTRA_LARGEFILE. +dnl AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(VAR, VAL) +AC_DEFUN([AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND], + [case $2 in + no) ;; + ?*) + case "[$]$1" in + '') $1=$2 ;; + *) $1=[$]$1' '$2 ;; + esac ;; + esac]) + +dnl Internal subroutine of AC_SYS_EXTRA_LARGEFILE. +dnl AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT) +AC_DEFUN([AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE], + [AC_CACHE_CHECK([for $1], $2, + [$2=no +changequote(, )dnl + $4 + for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do + case "$ac_flag" in + -D$1) + $2=1 ;; + -D$1=*) + $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;; + esac + done +changequote([, ])dnl + ]) + if test "[$]$2" != no; then + AC_DEFINE_UNQUOTED([$1], [$]$2, [$3]) + fi]) + +AC_DEFUN([AC_SYS_EXTRA_LARGEFILE], + [AC_REQUIRE([AC_CANONICAL_HOST]) + AC_ARG_ENABLE(largefile, + [ --disable-largefile omit support for large files]) + if test "$enable_largefile" != no; then + AC_CHECK_TOOL(GETCONF, getconf) + AC_SYS_EXTRA_LARGEFILE_FLAGS(CFLAGS) + AC_SYS_EXTRA_LARGEFILE_FLAGS(LDFLAGS) + AC_SYS_EXTRA_LARGEFILE_FLAGS(LIBS) + + for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do + case "$ac_flag" in + no) ;; + -D_FILE_OFFSET_BITS=*) ;; + -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;; + -D_LARGE_FILES | -D_LARGE_FILES=*) ;; + -D?* | -I?*) + AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;; + *) + AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;; + esac + done + AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS") + AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS") + AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, + ac_cv_sys_file_offset_bits, + [Number of bits in a file offset, on hosts where this is settable.]) + [case "$host_os" in + # HP-UX 10.20 and later + hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) + ac_cv_sys_file_offset_bits=64 ;; + esac] + AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, + ac_cv_sys_largefile_source, + [Define to make fseeko etc. visible, on some hosts.], + [case "$host_os" in + # HP-UX 10.20 and later + hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) + ac_cv_sys_largefile_source=1 ;; + esac]) + AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(_LARGE_FILES, + ac_cv_sys_large_files, + [Define for large files, on AIX-style hosts.], + [case "$host_os" in + # AIX 4.2 and later + aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*) + ac_cv_sys_large_files=1 ;; + esac]) + fi + ]) + Added: freeswitch/trunk/libs/libsndfile/M4/extra_pkg.m4 ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/M4/extra_pkg.m4 Thu May 21 16:09:30 2009 @@ -0,0 +1,85 @@ +# extra_pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright (c) 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# -------------------------------------------------------------- +# PKG_CHECK_MOD_VERSION(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# This is a very slight modification to the macro PKG_CHECK_MODULES that +# is in the original pkg.m4 file. It prints the versions in the checking +# message (erikd at mega-nerd.com). + +AC_DEFUN([PKG_CHECK_MOD_VERSION], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $2 ]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [AC_MSG_RESULT([no]) + $4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MOD_VERSION Added: freeswitch/trunk/libs/libsndfile/M4/flexible_array.m4 ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/M4/flexible_array.m4 Thu May 21 16:09:30 2009 @@ -0,0 +1,32 @@ +dnl @synopsis AC_C99_FLEXIBLE_ARRAY +dnl +dnl Dose the compiler support the 1999 ISO C Standard "stuct hack". +dnl @version 1.1 Mar 15 2004 +dnl @author Erik de Castro Lopo +dnl +dnl Permission to use, copy, modify, distribute, and sell this file for any +dnl purpose is hereby granted without fee, provided that the above copyright +dnl and this permission notice appear in all copies. No representations are +dnl made about the suitability of this software for any purpose. It is +dnl provided "as is" without express or implied warranty. + +AC_DEFUN([AC_C99_FLEXIBLE_ARRAY], +[AC_CACHE_CHECK(C99 struct flexible array support, + ac_cv_c99_flexible_array, + +# Initialize to unknown +ac_cv_c99_flexible_array=no + +AC_TRY_LINK([[ + #include + typedef struct { + int k; + char buffer [] ; + } MY_STRUCT ; + ]], + [ MY_STRUCT *p = calloc (1, sizeof (MY_STRUCT) + 42); ], + ac_cv_c99_flexible_array=yes, + ac_cv_c99_flexible_array=no + ))] +) # AC_C99_FLEXIBLE_ARRAY + Added: freeswitch/trunk/libs/libsndfile/M4/gcc_version.m4 ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/M4/gcc_version.m4 Thu May 21 16:09:30 2009 @@ -0,0 +1,33 @@ +dnl @synopsis AC_GCC_VERSION +dnl +dnl Find the version of gcc. +dnl @version 1.0 Nov 05 2007 +dnl @author Erik de Castro Lopo +dnl +dnl Permission to use, copy, modify, distribute, and sell this file for any +dnl purpose is hereby granted without fee, provided that the above copyright +dnl and this permission notice appear in all copies. No representations are +dnl made about the suitability of this software for any purpose. It is +dnl provided "as is" without express or implied warranty. +dnl + +AC_DEFUN([AC_GCC_VERSION], +[ +if test "x$ac_cv_c_compiler_gnu" = "xyes" ; then + + AC_MSG_CHECKING([for version of $CC]) + GCC_VERSION=`$CC -dumpversion` + AC_MSG_RESULT($GCC_VERSION) + + changequote(,)dnl + GCC_MINOR_VERSION=`echo $GCC_VERSION | sed "s/^[0-9]\+\.//" | sed "s/\..*//"` + GCC_MAJOR_VERSION=`echo $GCC_VERSION | sed "s/\..*//"` + changequote([,])dnl + fi + +AC_SUBST(GCC_VERSION) +AC_SUBST(GCC_MAJOR_VERSION) +AC_SUBST(GCC_MINOR_VERSION) + +])# AC_GCC_VERSION + Added: freeswitch/trunk/libs/libsndfile/M4/libtool.m4 ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/M4/libtool.m4 Thu May 21 16:09:30 2009 @@ -0,0 +1,7373 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 56 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl +_LT_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\[$]0 --fallback-echo"')dnl " + lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` + ;; +esac + +_LT_OUTPUT_LIBTOOL_INIT +]) + + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +cat >"$CONFIG_LT" <<_LTEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate a libtool stub with the current configuration. + +lt_cl_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AS_SHELL_SANITIZE +_AS_PREPARE + +exec AS_MESSAGE_FD>&1 +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2008 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +if test "$no_create" != yes; then + lt_cl_success=: + test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" + exec AS_MESSAGE_LOG_FD>/dev/null + $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false + exec AS_MESSAGE_LOG_FD>>config.log + $lt_cl_success || AS_EXIT(1) +fi +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_XSI_SHELLFNS + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES +# -------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=echo + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX +# ----------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_SHELL_INIT + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[_LT_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +[$]* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(lt_ECHO) +]) +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], + [An echo program that does not interpret backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[AC_CHECK_TOOL(AR, ar, false) +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1]) + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line __oline__ "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[[4-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[[3-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool at gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method == "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC*) + # IBM XL 8.0 on PPC + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac +AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + ;; + linux* | k*bsd*-gnu) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + _LT_TAGVAR(link_all_deplibs, $1)=no + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE(int foo(void) {}, + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + ) + LDFLAGS="$save_LDFLAGS" + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], + [[If ld is used when linking, flag to hardcode $libdir into a binary + during linking. This must work even if $libdir does not exist]]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting ${shlibpath_var} if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [fix_srcfile_path], [1], + [Fix the shell variable $srcfile for the compiler]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report which library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_PROG_CXX +# ------------ +# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ +# compiler, we have our own version here. +m4_defun([_LT_PROG_CXX], +[ +pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) +AC_PROG_CXX +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_CXX + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_CXX], []) + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[AC_REQUIRE([_LT_PROG_CXX])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + gnu*) + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 will use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + xl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=echo + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +]) +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_PROG_F77 +# ------------ +# Since AC_PROG_F77 is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_F77], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) +AC_PROG_F77 +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_F77 + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_F77], []) + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_REQUIRE([_LT_PROG_F77])dnl +AC_LANG_PUSH(Fortran 77) + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + CC=${F77-"f77"} + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_PROG_FC +# ----------- +# Since AC_PROG_FC is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_FC], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) +AC_PROG_FC +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_FC + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_FC], []) + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_REQUIRE([_LT_PROG_FC])dnl +AC_LANG_PUSH(Fortran) + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + CC=${FC-"f95"} + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC="$lt_save_CC" +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC="$lt_save_CC" +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_XSI_SHELLFNS +# --------------------- +# Bourne and XSI compatible variants of some useful shell functions. +m4_defun([_LT_PROG_XSI_SHELLFNS], +[case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $[*] )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + +dnl func_dirname_and_basename +dnl A portable version of this function is already defined in general.m4sh +dnl so there is no need for it here. + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[[^=]]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$[@]"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]+=\$[2]" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]=\$$[1]\$[2]" +} + +_LT_EOF + ;; + esac +]) Added: freeswitch/trunk/libs/libsndfile/M4/llrint.m4 ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/M4/llrint.m4 Thu May 21 16:09:30 2009 @@ -0,0 +1,38 @@ +dnl @synopsis AC_C99_FUNC_LLRINT +dnl +dnl Check whether C99's llrint function is available. +dnl @version 1.1 Sep 30 2002 +dnl @author Erik de Castro Lopo +dnl +dnl Permission to use, copy, modify, distribute, and sell this file for any +dnl purpose is hereby granted without fee, provided that the above copyright +dnl and this permission notice appear in all copies. No representations are +dnl made about the suitability of this software for any purpose. It is +dnl provided "as is" without express or implied warranty. +dnl +AC_DEFUN([AC_C99_FUNC_LLRINT], +[AC_CACHE_CHECK(for llrint, + ac_cv_c99_llrint, +[ +llrint_save_CFLAGS=$CFLAGS +CFLAGS="-lm" +AC_TRY_LINK([ +#define _ISOC9X_SOURCE 1 +#define _ISOC99_SOURCE 1 +#define __USE_ISOC99 1 +#define __USE_ISOC9X 1 + +#include +#include +], int64_t x ; x = llrint(3.14159) ;, ac_cv_c99_llrint=yes, ac_cv_c99_llrint=no) + +CFLAGS=$llrint_save_CFLAGS + +]) + +if test "$ac_cv_c99_llrint" = yes; then + AC_DEFINE(HAVE_LLRINT, 1, + [Define if you have C99's llrint function.]) +fi +])# AC_C99_FUNC_LLRINT + Added: freeswitch/trunk/libs/libsndfile/M4/lrint.m4 ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/M4/lrint.m4 Thu May 21 16:09:30 2009 @@ -0,0 +1,37 @@ +dnl @synopsis AC_C99_FUNC_LRINT +dnl +dnl Check whether C99's lrint function is available. +dnl @version 1.3 Feb 12 2002 +dnl @author Erik de Castro Lopo +dnl +dnl Permission to use, copy, modify, distribute, and sell this file for any +dnl purpose is hereby granted without fee, provided that the above copyright +dnl and this permission notice appear in all copies. No representations are +dnl made about the suitability of this software for any purpose. It is +dnl provided "as is" without express or implied warranty. +dnl +AC_DEFUN([AC_C99_FUNC_LRINT], +[AC_CACHE_CHECK(for lrint, + ac_cv_c99_lrint, +[ +lrint_save_CFLAGS=$CFLAGS +CFLAGS="-lm" +AC_TRY_LINK([ +#define _ISOC9X_SOURCE 1 +#define _ISOC99_SOURCE 1 +#define __USE_ISOC99 1 +#define __USE_ISOC9X 1 + +#include +], if (!lrint(3.14159)) lrint(2.7183);, ac_cv_c99_lrint=yes, ac_cv_c99_lrint=no) + +CFLAGS=$lrint_save_CFLAGS + +]) + +if test "$ac_cv_c99_lrint" = yes; then + AC_DEFINE(HAVE_LRINT, 1, + [Define if you have C99's lrint function.]) +fi +])# AC_C99_FUNC_LRINT + Added: freeswitch/trunk/libs/libsndfile/M4/lrintf.m4 ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/M4/lrintf.m4 Thu May 21 16:09:30 2009 @@ -0,0 +1,37 @@ +dnl @synopsis AC_C99_FUNC_LRINTF +dnl +dnl Check whether C99's lrintf function is available. +dnl @version 1.3 Feb 12 2002 +dnl @author Erik de Castro Lopo +dnl +dnl Permission to use, copy, modify, distribute, and sell this file for any +dnl purpose is hereby granted without fee, provided that the above copyright +dnl and this permission notice appear in all copies. No representations are +dnl made about the suitability of this software for any purpose. It is +dnl provided "as is" without express or implied warranty. +dnl +AC_DEFUN([AC_C99_FUNC_LRINTF], +[AC_CACHE_CHECK(for lrintf, + ac_cv_c99_lrintf, +[ +lrintf_save_CFLAGS=$CFLAGS +CFLAGS="-lm" +AC_TRY_LINK([ +#define _ISOC9X_SOURCE 1 +#define _ISOC99_SOURCE 1 +#define __USE_ISOC99 1 +#define __USE_ISOC9X 1 + +#include +], if (!lrintf(3.14159)) lrintf(2.7183);, ac_cv_c99_lrintf=yes, ac_cv_c99_lrintf=no) + +CFLAGS=$lrintf_save_CFLAGS + +]) + +if test "$ac_cv_c99_lrintf" = yes; then + AC_DEFINE(HAVE_LRINTF, 1, + [Define if you have C99's lrintf function.]) +fi +])# AC_C99_FUNC_LRINTF + Added: freeswitch/trunk/libs/libsndfile/M4/ltoptions.m4 ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/M4/ltoptions.m4 Thu May 21 16:09:30 2009 @@ -0,0 +1,368 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## Macros to handle LT_INIT options. ## +## --------------------------------- ## + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [0], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + +## ----------------- ## +## LTDL_INIT Options ## +## ----------------- ## + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) Added: freeswitch/trunk/libs/libsndfile/M4/ltsugar.m4 ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/M4/ltsugar.m4 Thu May 21 16:09:30 2009 @@ -0,0 +1,123 @@ +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) Added: freeswitch/trunk/libs/libsndfile/M4/ltversion.m4 ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/M4/ltversion.m4 Thu May 21 16:09:30 2009 @@ -0,0 +1,23 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# Generated from ltversion.in. + +# serial 3012 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.2.6]) +m4_define([LT_PACKAGE_REVISION], [1.3012]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.2.6' +macro_revision='1.3012' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) Added: freeswitch/trunk/libs/libsndfile/M4/lt~obsolete.m4 ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/M4/lt~obsolete.m4 Thu May 21 16:09:30 2009 @@ -0,0 +1,92 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 4 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) Added: freeswitch/trunk/libs/libsndfile/M4/mkoctfile_version.m4 ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/M4/mkoctfile_version.m4 Thu May 21 16:09:30 2009 @@ -0,0 +1,38 @@ +dnl @synopsis AC_MKOCTFILE_VERSION +dnl +dnl Find the version of mkoctfile. +dnl @version 1.0 Aug 23 2007 +dnl @author Erik de Castro Lopo +dnl +dnl Permission to use, copy, modify, distribute, and sell this file for any +dnl purpose is hereby granted without fee, provided that the above copyright +dnl and this permission notice appear in all copies. No representations are +dnl made about the suitability of this software for any purpose. It is +dnl provided "as is" without express or implied warranty. +dnl + +AC_DEFUN([AC_MKOCTFILE_VERSION], +[ + + +AC_ARG_WITH(mkoctfile, + AC_HELP_STRING([--with-mkoctfile], [choose the mkoctfile version]), + [ with_mkoctfile=$withval ]) + +test -z "$with_mkoctfile" && with_mkoctfile=mkoctfile + +AC_CHECK_PROG(HAVE_MKOCTFILE,$with_mkoctfile,yes,no) + +if test "x$ac_cv_prog_HAVE_MKOCTFILE" = "xyes" ; then + MKOCTFILE=$with_mkoctfile + + AC_MSG_CHECKING([for version of $MKOCTFILE]) + MKOCTFILE_VERSION=`$with_mkoctfile --version 2>&1 | sed 's/mkoctfile, version //g'` + AC_MSG_RESULT($MKOCTFILE_VERSION) + fi + +AC_SUBST(MKOCTFILE) +AC_SUBST(MKOCTFILE_VERSION) + +])# AC_MKOCTFILE_VERSION + Added: freeswitch/trunk/libs/libsndfile/M4/octave.m4 ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/M4/octave.m4 Thu May 21 16:09:30 2009 @@ -0,0 +1,143 @@ +dnl Evaluate an expression in octave +dnl +dnl OCTAVE_EVAL(expr,var) -> var=expr +dnl +dnl Stolen from octave-forge + +AC_DEFUN([OCTAVE_EVAL], +[ +AC_MSG_CHECKING([for $1 in $OCTAVE]) +$2=`TERM=;$OCTAVE -qfH --eval "disp($1)"` +AC_MSG_RESULT($$2) +AC_SUBST($2) +]) # OCTAVE_EVAL + +dnl @synopsis AC_OCTAVE_VERSION +dnl +dnl Find the version of Octave. +dnl @version 1.0 Aug 23 2007 +dnl @author Erik de Castro Lopo +dnl +dnl Permission to use, copy, modify, distribute, and sell this file for any +dnl purpose is hereby granted without fee, provided that the above copyright +dnl and this permission notice appear in all copies. No representations are +dnl made about the suitability of this software for any purpose. It is +dnl provided "as is" without express or implied warranty. +dnl + +AC_DEFUN([AC_OCTAVE_VERSION], +[ + +AC_ARG_WITH(octave, + AC_HELP_STRING([--with-octave], [choose the octave version]), + [ with_octave=$withval ]) + +test -z "$with_octave" && with_octave=octave + +AC_CHECK_PROG(HAVE_OCTAVE,$with_octave,yes,no) + +if test "x$ac_cv_prog_HAVE_OCTAVE" = "xyes" ; then + OCTAVE=$with_octave + OCTAVE_EVAL(OCTAVE_VERSION,OCTAVE_VERSION) + fi + +AC_SUBST(OCTAVE) +AC_SUBST(OCTAVE_VERSION) + +])# AC_OCTAVE_VERSION + +dnl @synopsis AC_OCTAVE_CONFIG_VERSION +dnl +dnl Find the version of Octave. +dnl @version 1.0 Aug 23 2007 +dnl @author Erik de Castro Lopo +dnl +dnl Permission to use, copy, modify, distribute, and sell this file for any +dnl purpose is hereby granted without fee, provided that the above copyright +dnl and this permission notice appear in all copies. No representations are +dnl made about the suitability of this software for any purpose. It is +dnl provided "as is" without express or implied warranty. +dnl + +AC_DEFUN([AC_OCTAVE_CONFIG_VERSION], +[ + +AC_ARG_WITH(octave-config, + AC_HELP_STRING([--with-octave-config], [choose the octave-config version]), + [ with_octave_config=$withval ]) + +test -z "$with_octave_config" && with_octave_config=octave-config + +AC_CHECK_PROG(HAVE_OCTAVE_CONFIG,$with_octave_config,yes,no) + +if test "x$ac_cv_prog_HAVE_OCTAVE_CONFIG" = "xyes" ; then + OCTAVE_CONFIG=$with_octave_config + AC_MSG_CHECKING([for version of $OCTAVE_CONFIG]) + OCTAVE_CONFIG_VERSION=`$OCTAVE_CONFIG --version` + AC_MSG_RESULT($OCTAVE_CONFIG_VERSION) + fi + +AC_SUBST(OCTAVE_CONFIG) +AC_SUBST(OCTAVE_CONFIG_VERSION) + +])# AC_OCTAVE_CONFIG_VERSION + +dnl @synopsis AC_OCTAVE_BUILD +dnl +dnl Check programs and headers required for building octave plugins. +dnl @version 1.0 Aug 23 2007 +dnl @author Erik de Castro Lopo +dnl +dnl Permission to use, copy, modify, distribute, and sell this file for any +dnl purpose is hereby granted without fee, provided that the above copyright +dnl and this permission notice appear in all copies. No representations are +dnl made about the suitability of this software for any purpose. It is +dnl provided "as is" without express or implied warranty. + + +AC_DEFUN([AC_OCTAVE_BUILD], +[ + +dnl Default to no. +OCTAVE_BUILD=no + +AC_OCTAVE_VERSION +AC_MKOCTFILE_VERSION +AC_OCTAVE_CONFIG_VERSION + +prog_concat="$ac_cv_prog_HAVE_OCTAVE$ac_cv_prog_HAVE_OCTAVE_CONFIG$ac_cv_prog_HAVE_MKOCTFILE" + +if test "x$prog_concat" = "xyesyesyes" ; then + if test "x$OCTAVE_VERSION" != "x$MKOCTFILE_VERSION" ; then + AC_MSG_WARN([** Mismatch between versions of octave and mkoctfile. **]) + AC_MSG_WARN([** Octave libsndfile modules will not be built. **]) + elif test "x$OCTAVE_VERSION" != "x$OCTAVE_CONFIG_VERSION" ; then + AC_MSG_WARN([** Mismatch between versions of octave and octave-config. **]) + AC_MSG_WARN([** Octave libsndfile modules will not be built. **]) + else + case "$MKOCTFILE_VERSION" in + 2.*) + AC_MSG_WARN([Octave version 2.X is not supported.]) + ;; + 3.0.*) + OCTAVE_DEST_ODIR=`$OCTAVE_CONFIG --oct-site-dir | sed 's%^/usr%${prefix}%'` + OCTAVE_DEST_MDIR=`$OCTAVE_CONFIG --m-site-dir | sed 's%^/usr%${prefix}%'` + + OCTAVE_BUILD=yes + ;; + *) + AC_MSG_WARN([Octave version $MKOCTFILE_VERSION is not supported.]) + ;; + esac + fi + AC_MSG_RESULT([building octave libsndfile module... $OCTAVE_BUILD]) + fi + +AC_SUBST(OCTAVE_DEST_ODIR) +AC_SUBST(OCTAVE_DEST_MDIR) + +AC_SUBST(MKOCTFILE) + +AM_CONDITIONAL(BUILD_OCTAVE_MOD, test "x$OCTAVE_BUILD" = xyes) + +])# AC_OCTAVE_BUILD Modified: freeswitch/trunk/libs/libsndfile/Makefile.am ============================================================================== --- freeswitch/trunk/libs/libsndfile/Makefile.am (original) +++ freeswitch/trunk/libs/libsndfile/Makefile.am Thu May 21 16:09:30 2009 @@ -1,28 +1,29 @@ -# Process this file with automake to produce Makefile.in - -SUBDIRS = Win32 Octave src -# man doc Win32 examples regtest tests -DIST_SUBDIRS = $(SUBDIRS) -EXTRA_DIST = reconfigure.mk acinclude.m4 libsndfile.spec.in \ - sndfile.pc.in Mingw-make-dist.sh - - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = sndfile.pc - -m4datadir = $(datadir)/aclocal - -test: check-recursive - -# Target to make autogenerated files. -genfiles : - (cd src ; make genfiles) - (cd tests ; make genfiles) - - -## Do not edit or modify anything in this comment block. -## The arch-tag line is a file identity tag for the GNU Arch -## revision control system. -## -## arch-tag: e40c569e-8020-4e95-b774-6b0703614526 - +## Process this file with automake to produce Makefile.in + +DISTCHECK_CONFIGURE_FLAGS = --enable-gcc-werror + +if BUILD_OCTAVE_MOD +octave_dir = Octave +endif + +SUBDIRS = M4 Win32 src $(octave_dir) +#man doc examples regtest tests programs + +DIST_SUBDIRS = M4 man doc Win32 src Octave examples regtest tests programs + +EXTRA_DIST = libsndfile.spec.in sndfile.pc.in Mingw-make-dist.sh + + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = sndfile.pc + +m4datadir = $(datadir)/aclocal + +test: check-recursive + +# Target to make autogenerated files. +genfiles : + (cd src ; make genfiles) + (cd tests ; make genfiles) + + Modified: freeswitch/trunk/libs/libsndfile/Mingw-make-dist.sh ============================================================================== --- freeswitch/trunk/libs/libsndfile/Mingw-make-dist.sh (original) +++ freeswitch/trunk/libs/libsndfile/Mingw-make-dist.sh Thu May 21 16:09:30 2009 @@ -114,9 +114,3 @@ zip -r $ZIPNAME $INSTALL/ fi - -# Do not edit or modify anything in this comment block. -# The following line is a file identity tag for the GNU Arch -# revision control system. -# -# arch-tag: 3f82cd8a-f800-48d7-9646-2cdcf03c81a0 Modified: freeswitch/trunk/libs/libsndfile/NEWS ============================================================================== --- freeswitch/trunk/libs/libsndfile/NEWS (original) +++ freeswitch/trunk/libs/libsndfile/NEWS Thu May 21 16:09:30 2009 @@ -1,3 +1,13 @@ +Version 1.0.19 (2009-03-02) + * Fix for CVE-2009-0186 (Alin Rad Pop, Secunia Research). + * Huge number of minor bug fixes as a result of static analysis. + +Version 1.0.18 (2009-02-07) + * Add Ogg/Vorbis support (thanks to John ffitch). + * Remove captive FLAC library. + * Many new features and bug fixes. + * Generate Win32 and Win64 pre-compiled binaries. + Version 1.0.17 (2006-08-31) * Add sndfile.hh C++ wrapper. * Update Win32 MinGW build instructions. Modified: freeswitch/trunk/libs/libsndfile/Octave/Makefile.am ============================================================================== --- freeswitch/trunk/libs/libsndfile/Octave/Makefile.am (original) +++ freeswitch/trunk/libs/libsndfile/Octave/Makefile.am Thu May 21 16:09:30 2009 @@ -1,14 +1,72 @@ ## Process this file with automake to produce Makefile.in -EXTRA_DIST = sndfile_load.m sndfile_save.m sndfile_play.m +# Prevent any extension. +EXEEXT = + +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ + +EXTRA_DIST = sndfile_load.m sndfile_save.m sndfile_play.m \ + octave_test.m octave_test.sh $(oct_module_srcs) PKG_ADD octconfigdir = $(exec_prefix)/share/octave/site/m octconfig_DATA = sndfile_load.m sndfile_save.m sndfile_play.m - -## Do not edit or modify anything in this comment block. -## The arch-tag line is a file identity tag for the GNU Arch -## revision control system. -## -## arch-tag: 56f1645a-3a13-4846-acc7-8b4abf2904ff +OCTAVE_DEST_MDIR = @OCTAVE_DEST_MDIR@ +OCTAVE_DEST_ODIR = @OCTAVE_DEST_ODIR@/sndfile + +OCT_CXXFLAGS = @OCT_CXXFLAGS@ +OCT_LIB_DIR = @OCT_LIB_DIR@ +OCT_LIBS = @OCT_LIBS@ + +SNDFILEDIR = $(top_builddir)/src +INCLUDES = -I$(SNDFILEDIR) + +oct_module_srcs = sndfile.cc +oct_module_files = sndfile.oct PKG_ADD + +# Make these noinst so they can be installed manually. +noinst_DATA = $(oct_module_files) + + +# Use Octave's mkoctfile to do all the heavy lifting. Unfortunately, its +# a little dumb so we need to guide it carefully. +sndfile.oct : sndfile.o + $(MKOCTFILE) -v $(INCLUDES) $(top_builddir)/Octave/$+ -L$(SNDFILEDIR)/.libs -L$(SNDFILEDIR) -lsndfile -o $(top_builddir)/Octave/$@ + +sndfile.o : sndfile.cc + $(MKOCTFILE) -v $(INCLUDES) -c $+ -o $(top_builddir)/Octave/$@ + +# Allow for the test being run in the build dir, but the test script +# being located in the source dir. +check : + octave_src_dir=$(srcdir) $(srcdir)/octave_test.sh + + +# Since the octave modules are installed in a special location, a custom install +# and uninstall routine must be specified. +install-exec-local : $(oct_module_files) + @$(NORMAL_INSTALL) + test -z "$(OCTAVE_DEST_ODIR)" || $(mkdir_p) "$(DESTDIR)$(OCTAVE_DEST_ODIR)" + @list='$(oct_module_files)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL) '$$p' '$(DESTDIR)$(OCTAVE_DEST_ODIR)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL) "$$p" "$(DESTDIR)$(OCTAVE_DEST_ODIR)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-local : + @$(NORMAL_UNINSTALL) + @list='$(oct_module_files)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(OCTAVE_DEST_ODIR)/$$f'"; \ + rm -f "$(DESTDIR)$(OCTAVE_DEST_ODIR)/$$f"; \ + done +clean-local : + rm -f sndfile.o sndfile.oct Added: freeswitch/trunk/libs/libsndfile/Octave/PKG_ADD ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/Octave/PKG_ADD Thu May 21 16:09:30 2009 @@ -0,0 +1,3 @@ +autoload ("sfread", "sndfile.oct"); +autoload ("sfversion", "sndfile.oct"); +autoload ("sfwrite", "sndfile.oct"); Added: freeswitch/trunk/libs/libsndfile/Octave/octave_test.m ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/Octave/octave_test.m Thu May 21 16:09:30 2009 @@ -0,0 +1,56 @@ +# Copyright (C) 2007 Erik de Castro Lopo +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# These tests are nowhere near comprehensive. + +printf ("\n\n\n\n\n\n\n") ; + +printf (" Running Octave tests : ") ; +fflush (stdout) ; + +filename = "whatever" ; +srate_out = 32000 ; +fmt_out = "wav-float" ; + +t = (2 * pi / srate_out * (0:srate_out-1))' ; +data_out = sin (440.0 * t) ; + +# Write out a file. +sfwrite (filename, data_out, srate_out, fmt_out) ; + +# Read it back in again. +[ data_in, srate_in, fmt_in ] = sfread (filename) ; + +if (srate_in != srate_out) + error ("\n\nSample rate mismatch : %d -> %d.\n\n", srate_out, srate_in) ; + endif + +# Octave strcmp return 1 for the same. +if (strcmp (fmt_in, fmt_out) != 1) + error ("\n\nFormat error : '%s' -> '%s'.\n\n", fmt_out, fmt_in) ; + endif + +err = max (abs (data_out - data_in)) ; + +if (err > 1e-7) + error ("err : %g\n", err) ; + endif + +printf ("ok") ; + +printf ("\n\n\n\n\n\n\n") ; + +unlink (filename) ; Added: freeswitch/trunk/libs/libsndfile/Octave/octave_test.sh ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/Octave/octave_test.sh Thu May 21 16:09:30 2009 @@ -0,0 +1,72 @@ +#!/bin/bash + + +# Check where we're being run from. +if [ -d Octave ]; then + cd Octave + fi + +# Find libsndfile shared object. +libsndfile_lib_location="" + +if [ -f "../src/.libs/libsndfile.so" ]; then + libsndfile_lib_location="../src/.libs/" +elif [ -f "../src/libsndfile.so" ]; then + libsndfile_lib_location="../src/" +elif [ -f "../src/.libs/libsndfile.dylib" ]; then + libsndfile_lib_location="../src/.libs/" +elif [ -f "../src/libsndfile.dylib" ]; then + libsndfile_lib_location="../src/" +else + echo + echo + echo "Not able to find the libsndfile shared lib we've just built." + echo "This may cause the following test to fail." + echo + echo + fi + +libsndfile_lib_location=`(cd $libsndfile_lib_location && pwd)` + + +# Find sndfile.oct +sndfile_oct_location="" + +if [ -f .libs/sndfile.oct ]; then + sndfile_oct_location=".libs" +elif [ -f sndfile.oct ]; then + sndfile_oct_location="." +else + echo "Not able to find the sndfile.oct binaries we've just built." + exit 1 + fi + +case `file -b $sndfile_oct_location/sndfile.oct` in + ELF*) + ;; + Mach*) + echo "Tests don't work on this platform." + exit 0 + ;; + *) + echo "Not able to find the sndfile.oct binaries we've just built." + exit 1 + ;; + esac + + +# Make sure the TERM environment variable doesn't contain anything wrong. +unset TERM + +# echo "libsndfile_lib_location : $libsndfile_lib_location" +# echo "sndfile_oct_location : $sndfile_oct_location" + +export LD_LIBRARY_PATH="$libsndfile_lib_location:$LD_LIBRARY_PATH" + +octave_src_dir=`(cd $octave_src_dir && pwd)` + +octave_script="$octave_src_dir/octave_test.m" + +(cd $sndfile_oct_location && octave -qH $octave_script) + + Added: freeswitch/trunk/libs/libsndfile/Octave/sndfile.cc ============================================================================== --- (empty file) +++ freeswitch/trunk/libs/libsndfile/Octave/sndfile.cc Thu May 21 16:09:30 2009 @@ -0,0 +1,405 @@ +/* +** Copyright (C) 2007 Erik de Castro Lopo +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU Lesser General Public License as published by +** the Free Software Foundation; either version 2.1 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU Lesser General Public License for more details. +** +** You should have received a copy of the GNU Lesser General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include + +#include "sndfile.h" + +#define FOUR_GIG (0x100000000LL) +#define BUFFER_FRAMES 8192 + + +static int format_of_str (const std::string & fmt) ; +static void string_of_format (std::string & fmt, int format) ; + + +DEFUN_DLD (sfversion, args, nargout , +"-*- texinfo -*-\n\ + at deftypefn {Loadable Function} {@var{version} =} sfversion ()\n\ + at cindex Reading sound files\n\ +Return a string containing the libsndfile version.\n\ + at seealso{sfread, sfwrite}\n\ + at end deftypefn") +{ char buffer [256] ; + octave_value_list retval ; + + /* Bail out if the input parameters are bad. */ + if (args.length () != 0 || nargout > 1) + { print_usage () ; + return retval ; + } ; + + sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer)) ; + + std::string version (buffer) ; + + retval.append (version) ; + return retval ; +} /* sfversion */ + + +DEFUN_DLD (sfread, args, nargout , +"-*- texinfo -*-\n\ + at deftypefn {Loadable Function} {@var{data}, at var{srate}, at var{format} =} sfread (@var{filename})\n\ + at cindex Reading sound files\n\ +Read a sound file from disk using libsndfile.\n\ + at seealso{sfversion, sfwrite}\n\ + at end deftypefn") +{ SNDFILE * file ; + SF_INFO sfinfo ; + + octave_value_list retval ; + + int nargin = args.length () ; + + /* Bail out if the input parameters are bad. */ + if ((nargin != 1) || !args (0) .is_string () || nargout < 1 || nargout > 3) + { print_usage () ; + return retval ; + } ; + + memset (&sfinfo, 0, sizeof (sfinfo)) ; + + std::string filename = args (0).string_value () ; + + if ((file = sf_open (filename.c_str (), SFM_READ, &sfinfo)) == NULL) + { error ("sfread: couldn't open file %s : %s", filename.c_str (), sf_strerror (NULL)) ; + return retval ; + } ; + + if (sfinfo.frames > FOUR_GIG) + printf ("This is a really huge file (%lld frames).\nYou may run out of memory trying to load it.\n", (long long) sfinfo.frames) ; + + dim_vector dim = dim_vector () ; + dim.resize (2) ; + dim (0) = sfinfo.frames ; + dim (1) = sfinfo.channels ; + + /* Should I be using Matrix instead? */ + NDArray out (dim, 0.0) ; + + float buffer [BUFFER_FRAMES * sfinfo.channels] ; + int readcount ; + sf_count_t total = 0 ; + + do + { readcount = sf_readf_float (file, buffer, BUFFER_FRAMES) ; + + /* Make sure we don't read more frames than we allocated. */ + if (total + readcount > sfinfo.frames) + readcount = sfinfo.frames - total ; + + for (int ch = 0 ; ch < sfinfo.channels ; ch++) + { for (int k = 0 ; k < readcount ; k++) + out (total + k, ch) = buffer [k * sfinfo.channels + ch] ; + } ; + + total += readcount ; + } while (readcount > 0 && total < sfinfo.frames) ; + + retval.append (out.squeeze ()) ; + + if (nargout >= 2) + retval.append ((octave_uint32) sfinfo.samplerate) ; + + if (nargout >= 3) + { std::string fmt ("") ; + string_of_format (fmt, sfinfo.format) ; + retval.append (fmt) ; + } ; + + /* Clean up. */ + sf_close (file) ; + + return retval ; +} /* sfread */ + +DEFUN_DLD (sfwrite, args, nargout , +"-*- texinfo -*-\n\ + at deftypefn {Function File} sfwrite (@var{filename}, at var{data}, at var{srate}, at var{format})\n\ +Write a sound file to disk using libsndfile.\n\ + at seealso{sfread, sfversion}\n\ + at end deftypefn\n\ +") +{ SNDFILE * file ; + SF_INFO sfinfo ; + + octave_value_list retval ; + + int nargin = args.length () ; + + /* Bail out if the input parameters are bad. */ + if (nargin != 4 || !args (0).is_string () || !args (1).is_real_matrix () + || !args (2).is_real_scalar () || !args (3).is_string () + || nargout != 0) + { print_usage () ; + return retval ; + } ; + + std::string filename = args (0).string_value () ; + std::string format = args (3).string_value () ; + + memset (&sfinfo, 0, sizeof (sfinfo)) ; + + sfinfo.format = format_of_str (format) ; + if (sfinfo.format == 0) + { error ("Bad format '%s'", format.c_str ()) ; + return retval ; + } ; + + sfinfo.samplerate = lrint (args (2).scalar_value ()) ; + if (sfinfo.samplerate < 1) + { error ("Bad sample rate : %d.\n", sfinfo.samplerate) ; + return retval ; + } ; + + Matrix data = args (1).matrix_value () ; + long rows = args (1).rows () ; + long cols = args (1).columns () ; + + if (cols > rows) + { error ("Audio data should have one column per channel, but supplied data " + "has %ld rows and %ld columns.\n", rows, cols) ; + return retval ; + } ; + + sfinfo.channels = cols ; + + if ((file = sf_open (filename.c_str (), SFM_WRITE, &sfinfo)) == NULL) + { error ("Couldn't open file %s : %s", filename.c_str (), sf_strerror (NULL)) ; + return retval ; + } ; + + float buffer [BUFFER_FRAMES * sfinfo.channels] ; + int writecount ; + long total = 0 ; + + do + { + writecount = BUFFER_FRAMES ; + + /* Make sure we don't read more frames than we allocated. */ + if (total + writecount > rows) + writecount = rows - total ; + + for (int ch = 0 ; ch < sfinfo.channels ; ch++) + { for (int k = 0 ; k < writecount ; k++) + buffer [k * sfinfo.channels + ch] = data (total + k, ch) ; + } ; + + if (writecount > 0) + sf_writef_float (file, buffer, writecount) ; + + total += writecount ; + } while (writecount > 0 && total < rows) ; + + /* Clean up. */ + sf_close (file) ; + + return retval ; +} /* sfwrite */ + + +static void +str_split (const std::string & str, const std::string & delim, std::vector & output) +{ + unsigned int offset = 0 ; + size_t delim_index = 0 ; + + delim_index = str.find (delim, offset) ; + + while (delim_index != std::string::npos) + { + output.push_back (str.substr(offset, delim_index - offset)) ; + offset += delim_index - offset + delim.length () ; + delim_index = str.find (delim, offset) ; + } + + output.push_back (str.substr (offset)) ; +} /* str_split */ + +static int +hash_of_str (const std::string & str) +{ + int hash = 0 ; + + for (unsigned k = 0 ; k < str.length () ; k++) + hash = (hash * 3) + tolower (str [k]) ; + + return hash ; +} /* hash_of_str */ + +static int +major_format_of_hash (const std::string & str) +{ int hash ; + + hash = hash_of_str (str) ; + + switch (hash) + { + case 0x5c8 : /* 'wav' */ return SF_FORMAT_WAV ; + case 0xf84 : /* 'aiff' */ return SF_FORMAT_AIFF ; + case 0x198 : /* 'au' */ return SF_FORMAT_AU ; + case 0x579 : /* 'paf' */ return SF_FORMAT_PAF ; + case 0x5e5 : /* 'svx' */ return SF_FORMAT_SVX ; + case 0x1118 : /* 'nist' */ return SF_FORMAT_NIST ; + case 0x5d6 : /* 'voc' */ return SF_FORMAT_VOC ; + case 0x324a : /* 'ircam' */ return SF_FORMAT_IRCAM ; + case 0x505 : /* 'w64' */ return SF_FORMAT_W64 ; + case 0x1078 : /* 'mat4' */ return SF_FORMAT_MAT4 ; + case 0x1079 : /* 'mat5' */ return SF_FORMAT_MAT5 ; + case 0x5b8 : /* 'pvf' */ return SF_FORMAT_PVF ; + case 0x1d1 : /* 'xi' */ return SF_FORMAT_XI ; + case 0x56f : /* 'htk' */ return SF_FORMAT_HTK ; + case 0x5aa : /* 'sds' */ return SF_FORMAT_SDS ; + case 0x53d : /* 'avr' */ return SF_FORMAT_AVR ; + case 0x11d0 : /* 'wavx' */ return SF_FORMAT_WAVEX ; + case 0x569 : /* 'sd2' */ return SF_FORMAT_SD2 ; + case 0x1014 : /* 'flac' */ return SF_FORMAT_FLAC ; + case 0x504 : /* 'caf' */ return SF_FORMAT_CAF ; + case 0x5f6 : /* 'wve' */ return SF_FORMAT_WVE ; + default : break ; + } ; + + printf ("%s : hash '%s' -> 0x%x\n", __func__, str.c_str (), hash) ; + + return 0 ; +} /* major_format_of_hash */ + +static int +minor_format_of_hash (const std::string & str) +{ int hash ; + + hash = hash_of_str (str) ; + + switch (hash) + { + case 0x1085 : /* 'int8' */ return SF_FORMAT_PCM_S8 ; + case 0x358a : /* 'uint8' */ return SF_FORMAT_PCM_U8 ; + case 0x31b0 : /* 'int16' */ return SF_FORMAT_PCM_16 ; + case 0x31b1 : /* 'int24' */ return SF_FORMAT_PCM_24 ; + case 0x31b2 : /* 'int32' */ return SF_FORMAT_PCM_32 ; + case 0x3128 : /* 'float' */ return SF_FORMAT_FLOAT ; + case 0x937d : /* 'double' */ return SF_FORMAT_DOUBLE ; + case 0x11bd : /* 'ulaw' */ return SF_FORMAT_ULAW ; + case 0xfa1 : /* 'alaw' */ return SF_FORMAT_ALAW ; + case 0xfc361 : /* 'ima_adpcm' */ return SF_FORMAT_IMA_ADPCM ; + case 0x5739a : /* 'ms_adpcm' */ return SF_FORMAT_MS_ADPCM ; + case 0x9450 : /* 'gsm610' */ return SF_FORMAT_GSM610 ; + case 0x172a3 : /* 'g721_32' */ return SF_FORMAT_G721_32 ; + case 0x172d8 : /* 'g723_24' */ return SF_FORMAT_G723_24 ; + case 0x172da : /* 'g723_40' */ return SF_FORMAT_G723_40 ; + default : break ; + } ; + + printf ("%s : hash '%s' -> 0x%x\n", __func__, str.c_str (), hash) ; + + return 0 ; +} /* minor_format_of_hash */ + + +static const char * +string_of_major_format (int format) +{ + switch (format & SF_FORMAT_TYPEMASK) + { + case SF_FORMAT_WAV : return "wav" ; + case SF_FORMAT_AIFF : return "aiff" ; + case SF_FORMAT_AU : return "au" ; + case SF_FORMAT_PAF : return "paf" ; + case SF_FORMAT_SVX : return "svx" ; + case SF_FORMAT_NIST : return "nist" ; + case SF_FORMAT_VOC : return "voc" ; + case SF_FORMAT_IRCAM : return "ircam" ; + case SF_FORMAT_W64 : return "w64" ; + case SF_FORMAT_MAT4 : return "mat4" ; + case SF_FORMAT_MAT5 : return "mat5" ; + case SF_FORMAT_PVF : return "pvf" ; + case SF_FORMAT_XI : return "xi" ; + case SF_FORMAT_HTK : return "htk" ; + case SF_FORMAT_SDS : return "sds" ; + case SF_FORMAT_AVR : return "avr" ; + case SF_FORMAT_WAVEX : return "wavx" ; + case SF_FORMAT_SD2 : return "sd2" ; + case SF_FORMAT_FLAC : return "flac" ; + case SF_FORMAT_CAF : return "caf" ; + case SF_FORMAT_WVE : return "wfe" ; + default : break ; + } ; + + return "unknown" ; +} /* string_of_major_format */ + +static const char * +string_of_minor_format (int format) +{ + switch (format & SF_FORMAT_SUBMASK) + { + case SF_FORMAT_PCM_S8 : return "int8" ; + case SF_FORMAT_PCM_U8 : return "uint8" ; + case SF_FORMAT_PCM_16 : return "int16" ; + case SF_FORMAT_PCM_24 : return "int24" ; + case SF_FORMAT_PCM_32 : return "int32" ; + case SF_FORMAT_FLOAT : return "float" ; + case SF_FORMAT_DOUBLE : return "double" ; + case SF_FORMAT_ULAW : return "ulaw" ; + case SF_FORMAT_ALAW : return "alaw" ; + case SF_FORMAT_IMA_ADPCM : return "ima_adpcm" ; + case SF_FORMAT_MS_ADPCM : return "ms_adpcm" ; + case SF_FORMAT_GSM610 : return "gsm610" ; + case SF_FORMAT_G721_32 : return "g721_32" ; + case SF_FORMAT_G723_24 : return "g723_24" ; + case SF_FORMAT_G723_40 : return "g723_40" ; + default : break ; + } ; + + return "unknown" ; +} /* string_of_minor_format */ + +static int +format_of_str (const std::string & fmt) +{ + std::vector split ; + + str_split (fmt, "-", split) ; + + if (split.size () != 2) + return 0 ; + + int major_fmt = major_format_of_hash (split.at (0)) ; + if (major_fmt == 0) + return 0 ; + + int minor_fmt = minor_format_of_hash (split.at (1)) ; + if (minor_fmt == 0) + return 0 ; + + return major_fmt | minor_fmt ; +} /* format_of_str */ + +static void +string_of_format (std::string & fmt, int format) +{ + char buffer [64] ; + + snprintf (buffer, sizeof (buffer), "%s-%s", string_of_major_format (format), string_of_minor_format (format)) ; + + fmt = buffer ; + + return ; +} /* string_of_format */ Modified: freeswitch/trunk/libs/libsndfile/Octave/sndfile_load.m ============================================================================== --- freeswitch/trunk/libs/libsndfile/Octave/sndfile_load.m (original) +++ freeswitch/trunk/libs/libsndfile/Octave/sndfile_load.m Thu May 21 16:09:30 2009 @@ -50,10 +50,3 @@ endif endfunction - -# Do not edit or modify anything in this comment block. -# The arch-tag line is a file identity tag for the GNU Arch -# revision control system. -# -# arch-tag: 9d7ed7ce-41fe-4efe-8bde-f5fc6f46bb03 - Modified: freeswitch/trunk/libs/libsndfile/Octave/sndfile_play.m ============================================================================== --- freeswitch/trunk/libs/libsndfile/Octave/sndfile_play.m (original) +++ freeswitch/trunk/libs/libsndfile/Octave/sndfile_play.m Thu May 21 16:09:30 2009 @@ -57,10 +57,3 @@ endif endfunction - -# Do not edit or modify anything in this comment block. -# The arch-tag line is a file identity tag for the GNU Arch -# revision control system. -# -# arch-tag: 96fb14c8-2b5a-4b93-a576-ab83a6d9026b - Modified: freeswitch/trunk/libs/libsndfile/Octave/sndfile_save.m ============================================================================== --- freeswitch/trunk/libs/libsndfile/Octave/sndfile_save.m (original) +++ freeswitch/trunk/libs/libsndfile/Octave/sndfile_save.m Thu May 21 16:09:30 2009 @@ -51,10 +51,3 @@ eval (str) ; endfunction - -# Do not edit or modify anything in this comment block. -# The arch-tag line is a file identity tag for the GNU Arch -# revision control system. -# -# arch-tag: 5e44602b-940b-4927-af7c-47639769a40b - Modified: freeswitch/trunk/libs/libsndfile/README ============================================================================== --- freeswitch/trunk/libs/libsndfile/README (original) +++ freeswitch/trunk/libs/libsndfile/README Thu May 21 16:09:30 2009 @@ -1,28 +1,19 @@ -This is libsndfile, 1.0.17 +This is libsndfile, 1.0.19 -libsndfile is a library of C routines for reading and writing -files containing sampled audio data. +libsndfile is a library of C routines for reading and writing +files containing sampled audio data. The src/ directory contains the source code for library itself. The doc/ directory contains the libsndfile documentation. The examples/ directory contains examples of how to write code using -libsndfile. 'wav32_aiff24' converts a WAV file containing 32 bit floating -point data into a 24 bit PCM AIFF file. 'sndfile2oct' dumps the audio -data of a file in a human readable format. 'sfconvert' is the beginnings -of a audio file format conversion utility. 'make_sine' generates a WAV -file containing one cycle of a sine wave with 4096 sample points in -32 bit floating point format. 'sfinfo' opens a sound file and prints -out information about that file. +libsndfile. The tests/ directory contains programs which link against libsndfile and test its functionality. -The Win32/ directory contains files and documentation to allow libsndfile -to compile under Win32 with the Microsoft Visual C++ compiler. - -The src/GSM610 directory contains code written by Jutta Degener and Carsten +The src/GSM610 directory contains code written by Jutta Degener and Carsten Bormann. Their original code can be found at : http://kbs.cs.tu-berlin.de/~jutta/toast.html @@ -30,41 +21,44 @@ under a suitably free license. -Win32 +LINUX ----- -There are detailed instructions for building libsndfile on Win32 in the file - - doc/win32.html - +Whereever possible, you should use the packages supplied by your Linux +distribution. -MacOSX ------- -Building on MacOSX should be the same as building it on any other Unix. +If you really do need to compile from source it should be as easy as: - -OTHER PLATFORMS ---------------- -To compile libsndfile on platforms which have a Bourne Shell compatible -shell, an ANSI C compiler and a make utility should require no more that -the following three commands : ./configure make make install - -For platforms without the required shell, it is usually sufficient to -create an approriate config.h file in the src/ directory with correct -values for the following #defines (this would work for AmigaOS) : - -#define HAVE_ENDIAN_H 0 -#define GUESS_BIG_ENDIAN 1 -#define GUESS_LITTLE_ENDIAN 0 -#define FORCE_BROKEN_FLOAT 0 + +Since libsndfile optionally links against libFLAC, libogg and libvorbis, you +will need to install appropriate versions of these libraries before running +configure as above. + + +UNIX +---- +Compile as for Linux. + + +Win32/Win64 +----------- +The default Windows compilers are nowhere near compliant with the 1999 ISO +C Standard and hence not able to compile libsndfile. + +Please use the libsndfile binaries available on the libsndfile web site. + + +MacOSX +------ +Building on MacOSX should be the same as building it on any other Unix. CONTACTS -------- -libsndfile was written by Erik de Castro Lopo (erikd AT mega-nerd DOT com). +libsndfile was written by Erik de Castro Lopo (erikd AT mega-nerd DOT com). The libsndfile home page is at : http://www.mega-nerd.com/libsndfile/ Modified: freeswitch/trunk/libs/libsndfile/Win32/Makefile.am ============================================================================== --- freeswitch/trunk/libs/libsndfile/Win32/Makefile.am (original) +++ freeswitch/trunk/libs/libsndfile/Win32/Makefile.am Thu May 21 16:09:30 2009 @@ -2,9 +2,3 @@ EXTRA_DIST = README-precompiled-dll.txt testprog.c -## Do not edit or modify anything in this comment block. -## The arch-tag line is a file identity tag for the GNU Arch -## revision control system. -## -## arch-tag: c28c7540-67f6-47e7-8035-0abbc6a174bc - Modified: freeswitch/trunk/libs/libsndfile/Win32/testprog.c ============================================================================== --- freeswitch/trunk/libs/libsndfile/Win32/testprog.c (original) +++ freeswitch/trunk/libs/libsndfile/Win32/testprog.c Thu May 21 16:09:30 2009 @@ -14,11 +14,3 @@ return 0 ; } - -/* -** Do not edit or modify anything in this comment block. -** The following line is a file identity tag for the GNU Arch -** revision control system. -** -** arch-tag: 31165fd8-9d91-4e5d-8b31-8efd42ef7645 -*/ Modified: freeswitch/trunk/libs/libsndfile/configure.ac ============================================================================== --- freeswitch/trunk/libs/libsndfile/configure.ac (original) +++ freeswitch/trunk/libs/libsndfile/configure.ac Thu May 21 16:09:30 2009 @@ -1,15 +1,24 @@ -# Copyright (C) 1999-2006 Erik de Castro Lopo (erikd AT mega-nerd DOT com). +# Copyright (C) 1999-2008 Erik de Castro Lopo (erikd AT mega-nerd DOT com). dnl Require autoconf version -AC_PREREQ(2.59) +AC_PREREQ(2.57) + +AC_INIT([libsndfile],[1.0.19],[erikd at mega-nerd.com]) + +# Put config stuff in Cfg. +AC_CONFIG_AUX_DIR(Cfg) -AC_INIT([libsndfile],[1.0.17],[erikd at mega-nerd.com]) AC_CONFIG_SRCDIR([src/sndfile.c]) AC_CANONICAL_TARGET([]) AM_INIT_AUTOMAKE +AC_CONFIG_MACRO_DIR([M4]) + AC_CONFIG_HEADERS([src/config.h]) +dnl Add parameters for aclocal +AC_SUBST(ACLOCAL_AMFLAGS, "-I M4") + AC_LANG([C]) #------------------------------------------------------------------------------------ @@ -28,14 +37,19 @@ # 6. If any interfaces have been removed since the last public release, then set age # to 0. -SHARED_VERSION_INFO="1:17:0" +SHARED_VERSION_INFO="1:19:0" AC_PROG_CC AM_PROG_CC_C_O AC_PROG_CXX + +# Do not check for F77. +define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl + AM_PROG_LIBTOOL -AC_CHECK_PROG(autogen, autogen, yes, no) +AC_CHECK_PROG(HAVE_AUTOGEN, autogen, yes, no) +AC_CHECK_PROG(HAVE_WINE, wine, yes, no) AC_PROG_INSTALL AC_PROG_LN_S @@ -45,7 +59,7 @@ AC_CHECK_HEADERS(endian.h) AC_CHECK_HEADERS(byteswap.h) AC_CHECK_HEADERS(locale.h) -AC_CHECK_HEADERS(inttypes.h) +AC_CHECK_HEADERS(sys/time.h) AC_HEADER_SYS_WAIT @@ -56,6 +70,9 @@ AC_DEFINE_UNQUOTED([HAVE_DECL_S_IRGRP],0) fi +AM_CONDITIONAL([LINUX_MINGW_CROSS_TEST], + [test "$build_os:$target_os:$host_os:$HAVE_WINE" = "linux-gnu:mingw32msvc:mingw32msvc:yes"]) + #==================================================================================== # Check for support of the struct hack. @@ -104,12 +121,19 @@ AC_ARG_ENABLE(sqlite, AC_HELP_STRING([--disable-sqlite], [disable use of sqlite])) -AC_ARG_ENABLE(flac, - AC_HELP_STRING([--disable-flac], [disable use of FLAC])) - AC_ARG_ENABLE(alsa, AC_HELP_STRING([--disable-alsa], [disable use of ALSA])) +AC_ARG_ENABLE(external-libs, + AC_HELP_STRING([--disable-external-libs], [disable use of FLAC, Ogg and Vorbis])) + +AC_ARG_ENABLE(octave, + AC_HELP_STRING([--enable-octave], [disable building of GNU Octave module])) + +AC_ARG_ENABLE(test-coverage, + AC_HELP_STRING([--enable-test-coverage], [enable test coverage])) +AM_CONDITIONAL([ENABLE_TEST_COVERAGE], [test "$enable_test_coverage" = yes]) + #==================================================================================== # Check types and their sizes. @@ -223,6 +247,8 @@ [Target processor is big endian.]) AC_DEFINE_UNQUOTED(CPU_IS_LITTLE_ENDIAN, ${ac_cv_c_little_endian}, [Target processor is little endian.]) +AC_DEFINE_UNQUOTED(WORDS_BIGENDIAN, ${ac_cv_c_big_endian}, + [Target processor is big endian.]) #==================================================================================== # Check for functions. @@ -231,36 +257,78 @@ AC_CHECK_FUNCS(open read write lseek pread pwrite) AC_CHECK_FUNCS(fstat ftruncate fsync) AC_CHECK_FUNCS(snprintf vsnprintf) -AC_CHECK_FUNCS(gmtime gmtime_r) +AC_CHECK_FUNCS(gmtime gmtime_r localtime localtime_r gettimeofday) AC_CHECK_FUNCS(mmap getpagesize) AC_CHECK_FUNCS(setlocale) AC_CHECK_LIB([m],floor) AC_CHECK_FUNCS(floor ceil fmod) -case "$host_os" in - cygwin*) - AC_MSG_WARN([[Not using built-in lrint() and lrintf() because they are broken on Cygwin.]]) - ;; - *) - AC_C99_FUNC_LRINT - AC_C99_FUNC_LRINTF +AC_C99_FUNC_LRINT +AC_C99_FUNC_LRINTF - if test "x$ac_cv_c99_lrint" = "xno" ; then - if test "x$ac_cv_c99_lrintf" = "xno" ; then - AC_MSG_WARN([[*** Missing C99 standard functions lrint() and lrintf().]]) - AC_MSG_WARN([[*** This may cause benign compiler warnings on some systems (ie Solaris).]]) - fi - fi - ;; - esac +#==================================================================================== +# Check for requirements for building plugins for other languages/enviroments. + +dnl Octave maths environment http://www.octave.org/ +if test x$cross_compiling = xno ; then + if test x$enable_octave = xno ; then + AM_CONDITIONAL(BUILD_OCTAVE_MOD, false) + else + AC_OCTAVE_BUILD + fi +else + AM_CONDITIONAL(BUILD_OCTAVE_MOD, false) + fi + +#==================================================================================== +# Check for Ogg, Vorbis and FLAC. + +HAVE_EXTERNAL_LIBS=0 +EXTERNAL_CFLAGS="" +EXTERNAL_LIBS="" + +# Check for pkg-config outside the if statement. +PKG_PROG_PKG_CONFIG + +if test x$enable_external_libs = xno ; then + AC_MSG_WARN([[*** External libs (FLAC, Ogg, Vorbis) disabled. ***]]) +else + PKG_CHECK_MOD_VERSION(FLAC, flac >= 1.2.1, ac_cv_flac=yes, ac_cv_flac=no) + PKG_CHECK_MOD_VERSION(OGG, ogg >= 1.1.3, ac_cv_ogg=yes, ac_cv_ogg=no) + + # Vorbis versions earlier than 1.2.1 are not const correct at the API level. + # Vorbis 1.2.2 adds vorbis_version_string. + PKG_CHECK_MOD_VERSION(VORBIS, vorbis >= 1.2.0, ac_cv_vorbis=yes, ac_cv_vorbis=no) + PKG_CHECK_MOD_VERSION(VORBISENC, vorbisenc >= 1.2.0, ac_cv_vorbisenc=yes, ac_cv_vorbisenc=no) + fi + +HAVE_VORBIS_VERSION_STRING=0 +if test x$ac_cv_flac$ac_cv_ogg$ac_cv_vorbis$ac_cv_vorbisenc = "xyesyesyesyes" ; then + + save_LIBS="$LIBS" + LIBS="$VORBIS_LIBS $LIBS" + AC_CHECK_LIB(vorbis, vorbis_version_string, HAVE_VORBIS_VERSION_STRING=1) + LIBS="$save_LIBS" + + HAVE_EXTERNAL_LIBS=1 + enable_external_libs=yes + + EXTERNAL_CFLAGS="$FLAC_CFLAGS $OGG_CFLAGS $VORBISENC_CFLAGS" + EXTERNAL_LIBS="$FLAC_LIBS $VORBISENC_LIBS" +else + enable_external_libs=no + fi + +AC_DEFINE_UNQUOTED([HAVE_EXTERNAL_LIBS], $HAVE_EXTERNAL_LIBS, [Will be set to 1 if flac, ogg and vorbis are available.]) +AC_DEFINE_UNQUOTED([HAVE_VORBIS_VERSION_STRING], $HAVE_VORBIS_VERSION_STRING, [Set to 1 if we have vorbis_version_string.]) #==================================================================================== # Check for libsqlite3 (only used in regtest). ac_cv_sqlite3=no if test x$enable_sqlite != xno ; then - PKG_CHECK_MODULES(SQLITE3, sqlite3 >= 3.2, ac_cv_sqlite3=yes, ac_cv_sqlite3=no) + PKG_CHECK_MOD_VERSION(SQLITE3, sqlite3 >= 3.2, ac_cv_sqlite3=yes, ac_cv_sqlite3=no) fi if test x$ac_cv_sqlite3 = "xyes" ; then @@ -272,6 +340,19 @@ AC_DEFINE_UNQUOTED([HAVE_SQLITE3],$HAVE_SQLITE3,[Set to 1 if you have libsqlite3.]) #==================================================================================== +# Check for JACK (only used for examples/sndfile-jackplay). + +PKG_CHECK_MOD_VERSION(JACK, jack >= 0.100, ac_cv_jack=yes, ac_cv_jack=no) + +if test x$ac_cv_jack = "xyes" ; then + HAVE_JACK=1 +else + HAVE_JACK=0 + fi + +AC_DEFINE_UNQUOTED([HAVE_JACK],$HAVE_JACK,[Set to 1 if you have JACK.]) + +#==================================================================================== # Determine if the processor can do clipping on float to int conversions. if test x$enable_cpu_clip != "xno" ; then @@ -307,10 +388,6 @@ use_windows_api=1 OS_SPECIFIC_LINKS="-lwinmm" ;; - cygwin*) - os_is_win32=1 - OS_SPECIFIC_LINKS="-lwinmm" - ;; esac AC_DEFINE_UNQUOTED(OS_IS_WIN32, ${os_is_win32}, [Set to 1 if compiling for Win32]) @@ -326,22 +403,7 @@ AC_CHECK_HEADERS(alsa/asoundlib.h) if test x$ac_cv_header_alsa_asoundlib_h = xyes ; then ALSA_LIBS="-lasound" - fi - fi - -#==================================================================================== -# Check for FLAC - -FLAC_LIBS="" - -if test x$enable_flac != xno ; then - AC_CHECK_HEADERS(FLAC/all.h) - if test x$ac_cv_header_FLAC_all_h = xyes ; then - AC_CHECK_LIB(FLAC, FLAC__seekable_stream_encoder_set_tell_callback, HAVE_FLAC_1_1_1="yes") - if test "x$HAVE_FLAC_1_1_1" = xyes ; then - AC_DEFINE(HAVE_FLAC_1_1_1, [1], [Define to 1 if you have libflac 1.1.1]) - fi - FLAC_LIBS="-lFLAC" + enable_alsa=yes fi fi @@ -380,7 +442,7 @@ AC_MSG_WARN([[******************************************************************]]) fi -if test x"$ac_cv_prog_autogen" = "xno" ; then +if test x"$ac_cv_prog_HAVE_AUTOGEN" = "xno" ; then AC_MSG_WARN([[Touching files in directory tests/.]]) touch tests/*.c tests/*.h fi @@ -407,20 +469,47 @@ #==================================================================================== # Now use the information from the checking stage. +win32_target_dll=0 +COMPILER_IS_GCC=0 + if test x$ac_cv_c_compiler_gnu = xyes ; then AC_ADD_CFLAGS(-std=gnu99) - CFLAGS="$CFLAGS -W -Wall" - CXXFLAGS="$CXXFLAGS -W -Wall" + AC_GCC_VERSION + + if test "x$GCC_MAJOR_VERSION$GCC_MINOR_VERSION" = "x42" ; then + AC_MSG_WARN([****************************************************************]) + AC_MSG_WARN([** GCC version 4.2 warns about the inline keyword for no good **]) + AC_MSG_WARN([** reason but the maintainers do not see it as a bug. **]) + AC_MSG_WARN([** See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33995 **]) + AC_MSG_WARN([** Using -fgnu-inline to avoid this stupidity. **]) + AC_MSG_WARN([****************************************************************]) + AC_ADD_CFLAGS([-fgnu89-inline]) + fi + + CFLAGS="$CFLAGS -Wall" + CXXFLAGS="$CXXFLAGS -Wall" + + AC_ADD_CFLAGS([-Wextra]) - AC_ADD_CFLAGS(-Wdeclaration-after-statement) - AC_ADD_CFLAGS(-Wpointer-arith) + AC_LANG_PUSH([C++]) + AC_ADD_CXXFLAGS([-Wextra]) + AC_LANG_POP([C++]) + + AC_ADD_CFLAGS([-Wdeclaration-after-statement]) + AC_ADD_CFLAGS([-Wpointer-arith]) + AC_ADD_CFLAGS([-funsigned-char]) if test x$enable_gcc_werror = "xyes" ; then CFLAGS="-Werror $CFLAGS" CXXFLAGS="-Werror $CXXFLAGS" fi + if test x$enable_test_coverage = "xyes" ; then + # AC_ADD_CFLAGS([-ftest-coverage]) + AC_ADD_CFLAGS([-coverage]) + fi + CFLAGS="$CFLAGS -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast -Wwrite-strings " # -Wundef -Wmissing-declarations -Winline -Wconversion" CXXFLAGS="$CXXFLAGS -Wcast-align -Wcast-qual -Wshadow -Wwrite-strings -Wctor-dtor-privacy -Wnon-virtual-dtor -Woverloaded-virtual -Wreorder -Wsign-promo " @@ -444,10 +533,16 @@ SHLIB_VERSION_ARG="-Wl,--version-script=\$(srcdir)/Symbols.linux" ;; mingw*) - SHLIB_VERSION_ARG="-Wl,\$(srcdir)/libsndfile.def" + # Linker flag '-Wl,--out-implib' does not work with mingw cross compiler + # so we don't use it here. + SHLIB_VERSION_ARG="-Wl,\$(srcdir)/libsndfile-1.def" + win32_target_dll=1 + if test x"$enable_shared" = xno ; then + win32_target_dll=0 + fi ;; - cygwin*) - SHLIB_VERSION_ARG="-Wl,\$(srcdir)/cygsndfile.def" + os2*) + SHLIB_VERSION_ARG="-Wl,-export-symbols \$(srcdir)/Symbols.os2" ;; *) ;; @@ -456,11 +551,11 @@ CFLAGS="$CFLAGS -pipe" fi - AC_DEFINE([COMPILER_IS_GCC],1, [Set to 1 if the compile is GNU GCC.]) - GCC_MAJOR_VERSION=`$CC -dumpversion | sed "s/\..*//"` - AC_DEFINE_UNQUOTED([GCC_MAJOR_VERSION],${GCC_MAJOR_VERSION}, [Major version of GCC or 3 otherwise.]) + COMPILER_IS_GCC=1 fi +AC_DEFINE_UNQUOTED([WIN32_TARGET_DLL], ${win32_target_dll}, [Set to 1 if windows DLL is being built.]) +AC_DEFINE_UNQUOTED([COMPILER_IS_GCC], ${COMPILER_IS_GCC}, [Set to 1 if the compile is GNU GCC.]) AC_DEFUN([AX_COMPILER_VENDOR], [ AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, @@ -497,6 +592,8 @@ exit fi +#------------------------------------------------------------------------------- + AC_SUBST(htmldocdir) AC_SUBST(HTML_BGCOLOUR) AC_SUBST(HTML_FGCOLOUR) @@ -506,25 +603,33 @@ AC_SUBST(OS_SPECIFIC_CFLAGS) AC_SUBST(OS_SPECIFIC_LINKS) AC_SUBST(ALSA_LIBS) -AC_SUBST(FLAC_LIBS) AC_SUBST(ENABLE_EXPERIMENTAL_CODE) +AC_SUBST(EXTERNAL_CFLAGS) +AC_SUBST(EXTERNAL_LIBS) + AC_SUBST(COMPILER_IS_GCC) AC_SUBST(GCC_MAJOR_VERSION) +AC_SUBST(HAVE_JACK) + dnl The following line causes the libtool distributed with the source dnl to be replaced if the build system has a more recent version. AC_SUBST(LIBTOOL_DEPS) AC_CONFIG_FILES([ \ - src/sndfile.h src/Makefile src/GSM610/Makefile src/G72x/Makefile \ - man/Makefile examples/Makefile tests/Makefile regtest/Makefile \ - doc/Makefile doc/libsndfile.css \ - Win32/Makefile Octave/Makefile \ - Makefile libsndfile.spec sndfile.pc \ - ]) + src/sndfile.h src/Makefile src/GSM610/Makefile src/G72x/Makefile \ + man/Makefile examples/Makefile tests/Makefile regtest/Makefile \ + M4/Makefile doc/Makefile Win32/Makefile Octave/Makefile \ + programs/Makefile doc/libsndfile.css \ + Makefile libsndfile.spec sndfile.pc \ + tests/test_wrapper.sh \ + ]) AC_OUTPUT +# Make it executable. +chmod u+x tests/test_wrapper.sh + #==================================================================================== AC_MSG_RESULT([ @@ -532,18 +637,21 @@ Configuration summary : - Version : ..................... ${VERSION} - Experimental code : ........... ${enable_experimental:-no} + Version : ............................. ${VERSION} + Experimental code : ................... ${enable_experimental:-no} + Using ALSA in example programs : ...... ${enable_alsa:-no} + External FLAC/Ogg/Vorbis : ............ ${enable_external_libs:-no} + ]) if test x$ac_cv_c_compiler_gnu = xyes ; then echo -e " Tools :\n" - echo " Compiler is GCC : ............. ${ac_cv_c_compiler_gnu}" - echo " GCC major version : ........... ${GCC_MAJOR_VERSION}" + echo " Compiler is GCC : ..................... ${ac_cv_c_compiler_gnu}" + echo " GCC version : ......................... ${GCC_VERSION}" if test $GCC_MAJOR_VERSION -lt 3 ; then echo -e "\n ** This compiler version allows applications to write" echo " ** to static strings within the library." - echo " ** Compile with GCC version 3.X to avoid this problem." + echo " ** Compile with GCC version 3.X or above to avoid this problem." fi fi @@ -558,10 +666,10 @@ AC_MSG_RESULT([[ Installation directories : - Library directory : ........... $libdir - Program directory : ........... $bindir - Pkgconfig directory : ......... $libdir/pkgconfig - HTML docs directory : ......... $htmldocdir + Library directory : ................... $libdir + Program directory : ................... $bindir + Pkgconfig directory : ................. $libdir/pkgconfig + HTML docs directory : ................. $htmldocdir ]]) if test x$prefix != "x/usr" ; then @@ -570,14 +678,5 @@ echo -e "PKG_CONFIG_PATH environment variable.\n" fi -#==================================================================================== - -ifelse(dnl - - Do not edit or modify anything in this comment block. - The arch-tag line is a file identity tag for the GNU Arch - revision control system. - - arch-tag: 6391b316-6cfc-43c2-a18a-8defdc4ee359 - -)dnl +(cd src && make genfiles) +(cd tests && make genfiles) Modified: freeswitch/trunk/libs/libsndfile/configure.gnu ============================================================================== --- freeswitch/trunk/libs/libsndfile/configure.gnu (original) +++ freeswitch/trunk/libs/libsndfile/configure.gnu Thu May 21 16:09:30 2009 @@ -1,3 +1,3 @@ -#! /bin/sh -./configure "$@" --disable-sqlite --disable-shared --with-pic --disable-flac - +#! /bin/sh +./configure "$@" --disable-sqlite --disable-shared --with-pic --disable-external-libs --disable-octave + Modified: freeswitch/trunk/libs/libsndfile/doc/FAQ.html ============================================================================== --- freeswitch/trunk/libs/libsndfile/doc/FAQ.html (original) +++ freeswitch/trunk/libs/libsndfile/doc/FAQ.html Thu May 21 16:09:30 2009 @@ -23,7 +23,7 @@ substitution" error during linking. What can I do to fix this?
Q5 : Why doesn't libsndfile do interleaving/de-interleaving?
Q6 : What's the best format for storing temporary files?
-Q7 : On Linux/Unix/MaxOSX, what's the best way of detecting the +Q7 : On Linux/Unix/MacOSX, what's the best way of detecting the presence of libsndfile?
Q8 : But I just want a simple Makefile! What do I do?
Q9 : How about adding the ability to write/read sound files to/from @@ -43,6 +43,19 @@
Q17 : Can libsndfile read/write files from/to UNIX pipes?
+Q18 : Is it possible to build a Universal Binary on Mac OSX? +
+Q19 : I have project files for Visual Studio / XCode / Whatever. Why + don't you distribute them with libsndfile? +
+Q20 : Why doesn't libsndfile support MP3? Lots of other Open Source + projects support it! +
+Q21 : How do I use libsndfile in a closed source or commercial program + and comply with the license? +
+Q22 : What versions of windows does libsndfile work on? +

@@ -89,9 +102,12 @@


Q3 : Compiling is really slow on MacOSX. Why?

-When you configure and compile libsndfile, it uses the Bourne shell for a number +When you configure and compile libsndfile, it uses the /bin/sh shell for a number of tasks (ie configure script and libtool). -However, Apple has decided to ship their system with a really crappy Bourne shell. +Older versions of OSX (10.2?) shipped a a really crappy Bourne shell as /bin/sh +which resulted in really slow compiles. +New version of OSX ship GNU BASh as /bin/sh and this answer doesn't apply in that +case.

To fix this I suggest that you install the GNU Bash shell, rename /bin/sh to @@ -313,8 +329,18 @@ in audio quality that they should also be concerned about.

-The correct way to deal with this problem is to consider 16 bit short data as -a final destination format only, not as an intermediate storage format. +Since this problem only occurs when converting between integer data on disk and +normalized floats in the application, it can be avoided by using something +other than normalized floats in the application. +Alternatives to normalized floats are the short and int data +types (ie using sf_read_short or sf_read_int) or using un-normalized floats +(see + + SFC_SET_NORM_FLOAT). +

+

+Another way to deal with this problem is to consider 16 bit short data as a +final destination format only, not as an intermediate storage format. All intermediate data (ie which is going to be processed further) should be stored in floating point format which is supported by all of the most common file formats. @@ -552,26 +578,213 @@

-Sell also FAQ Q6. +See also FAQ Q6. +

+ + + +


Q18 : Is it possible to build a Universal Binary on Mac OSX? +

+ +

+Yes, but you must do two separate configure/build/test runs; one on PowerPC +and one on Intel. +It is then possible to merge the binaries into a single universal binary using +one of the programs in the Apple tool chain. +

+ +

+It is not possible to build a working universal binary via a single +compile/build run on a single CPU. +

+ +

+The problem is that the libsndfile build process detects features of the CPU its +being built for during the configure process and when building a universal binary, +configure is only run once and that data is then used for both CPUs. +That configure data will be wrong for one of those CPUs. +You will still be able to compile libsndfile, and the test suite will pass on +the machine you compiled it on. +However, if you take the universal binary test suite programs compiled on one +CPU and run them on the other, the test suite will fail. +

+ +

+Part of the problem is the the CPU endian-ness is detected at configure time. +Yes, I know the Apple compiler defines one of the macros __LITTLE_ENDIAN__ +and __BIG_ENDIAN__, but those macros are not part of the 1999 ISO C Standard +and they are not portable. +

+ +

+Endian issues are not the only reason why the cross compiled binary will fail. +The configure script also detects other CPU specific idiosyncrasies to provide +more optimized code. +

+ +

+Finally, the real show stopper problem with universal binaries is the problem +with the test suite. +libsndfile contains a huge, comprehensive test suite. +When you compile a universal binary and run the test suite, you only test the +native compile. +The cross compiled binary (the one with the much higher chance of having +problems) cannot be tested. +

+ +

+Now, if you have read this far you're probably thinking there must be a way +to fix this and there probably is. +The problem is that its a hell of a lot of work and would require significant +changes to the configure process, the internal code and the test suite. +In addition, these changes must not break compilation on any of the platforms +libsndfile is currently working on. +

+ + + + +


Q19 : I have project files for Visual Studio / XCode / Whatever. Why + don't you distribute them with libsndfile? +

+ +

+There's a very good reason for this. +I will only distribute things that I actually have an ability to test and +maintain. +Project files for a bunch of different compilers and Integrated Development +Environments are simply too difficult to maintain. +

+ +

+The problem is that every time I add a new file to libsndfile or rename an +existing file I would have to modify all the project files and then test that +libsndfile still built with all the different compilers. +

+ +

+Maintaining these project files is also rather difficult if I don't have access +to the required compiler/IDE. +If I just edit the project files without testing them I will almost certainly +get it wrong. +If I release a version of libsndfile with broken project files, I'll get a bunch +of emails from people complaining about it not building and have no way of +fixing or even testing it. +

+ +

+I currently release sources that I personally test on Win32, Linux and +MacOSX (PowerPC) using the compiler I trust (GNU GCC). +Supporting one compiler on three (actually much more because GCC is available +almost everywhere) platforms is doable without too much pain. +I also release binaries for Win32 with instructions on how to use those +binaries with Visual Studio. +As a guy who is mainly interested in Linux, I'm not to keen to jump through +a bunch of hoops to support compilers and operating systems I don't use. +

+ +

+So, I hear you want to volunteer to maintain the project files for Some Crappy +Compiler 2007? +Well sorry, that won't work either. +I have had numerous people over the years offer to maintaining the project +files for Microsoft's Visual Studio. +Every single time that happened, they maintained it for a release or two and +then disappeared off the face of the earth. +Hence, I'm not willing to enter into an arrangement like that again.

+ +


Q20 : Why doesn't libsndfile support MP3? Lots of other Open Source + projects support it! +

+ +

+MP3 is not supported for one very good reason; doing so requires the payment +of licensing fees. +As can be seen from + + mp3licensing.com +the required royalty payments are not cheap. +

+ +

+Yes, I know other libraries ignore the licensing requirements, but their legal +status is extremely dubious. +At any time, the body selling the licenses could go after the authors of those +libraries. +Some of those authors may be students and hence wouldn't be worth pursuing. +

+ +

+However, libsndfile is released under the name of a company, Mega Nerd Pty Ltd; +a company which has income from from libsamplerate licensing, libsndfile based +consulting income and other unrelated consulting income. +Adding MP3 support to libsndfile could place that income would be under legal +threat. +

+ +

+Fortunately, Ogg Vorbis exists as an alternative to MP3. +Support for Ogg Vorbis was added to libsndfile (mostly due to the efforts of +John ffitch of the Csound project) in version 1.0.18. +

+ + + + +


Q21 : How do I use libsndfile in a closed source or commercial program + and comply with the license? +

+ +

+Here is a checklist of things you need to do to make sure your use of libsndfile +in a closed source or commercial project complies with the license libsndfile is +released under, the GNU Lesser General Public License (LGPL): +

+ +
    +
  • Make sure you are linking to libsndfile as a shared library (Linux and Unix + systems), Dynamic Link Library (Microsoft Windows) or dynlib (Mac OSX). + If you are using some other operating system that doesn't allow dynamically + linked libraries, you will not be able to use libsndfile unless you release + the source code to your program. +
  • In the licensing documentation for your program, add a statement that your + software depends on libsndfile and that libsndfile is released under the GNU + Lesser General Public License, either + version 2.1 + or optionally + version 3. +
  • Include the text for both versions of the license, possibly as separate + files named libsndfile_lgpl_v2_1.txt and libsndfile_lgpl_v3.txt. +
+ + + +


Q22 : What versions of windows does libsndfile work on? +

+ +

+Currently the precompiled windows binaries are tested in Windows XP. +As such, they should also work on Win2k and Windows Vista. +They may also work on earlier versions of windows. +

+ +

+libsndfile does not yet work on 64 bit versions of windows. +Support for 64 bit versions of WinXP and Vista is likely to be working some +time late in 2008. +

+

The libsndfile home page is here : http://www.mega-nerd.com/libsndfile/.
-Version : 1.0.13 +Version : 1.0.19

- - Modified: freeswitch/trunk/libs/libsndfile/doc/Makefile.am ============================================================================== --- freeswitch/trunk/libs/libsndfile/doc/Makefile.am (original) +++ freeswitch/trunk/libs/libsndfile/doc/Makefile.am Thu May 21 16:09:30 2009 @@ -4,13 +4,7 @@ html_DATA = index.html libsndfile.jpg libsndfile.css api.html command.html \ bugs.html sndfile_info.html new_file_type.HOWTO pkgconfig.html \ win32.html FAQ.html lists.html embedded_files.html octave.html \ - dither.html + dither.html tutorial.html EXTRA_DIST = $(html_DATA) -## Do not edit or modify anything in this comment block. -## The arch-tag line is a file identity tag for the GNU Arch -## revision control system. -## -## arch-tag: 2f7e97fe-5ef8-49a1-ae12-14ebab69c048 - Modified: freeswitch/trunk/libs/libsndfile/doc/api.html ============================================================================== --- freeswitch/trunk/libs/libsndfile/doc/api.html (original) +++ freeswitch/trunk/libs/libsndfile/doc/api.html Thu May 21 16:09:30 2009 @@ -62,7 +62,7 @@ sf_count_t sf_seek (SNDFILE *sndfile, sf_count_t frames, int whence) ; - int sf_command (SNDFILE *sndfile, int cmd, void *data, int datasize) ; + int sf_command (SNDFILE *sndfile, int cmd, void *data, int datasize) ; int sf_error (SNDFILE *sndfile) ; const char* sf_strerror (SNDFILE *sndfile) ; @@ -346,34 +346,6 @@ or -1 if an error occured (ie an attempt is made to seek beyond the start or end of the file).

- -


Command Interface

- -
-      int  sf_command  (SNDFILE *sndfile, int cmd, void *data, int datasize) ;
-
- -

-This function allows the caller to retrieve information from or change aspects of the -library behaviour on a per file basis. Examples include reading or writing text descriptions -to a file or changing the scaling applied to sample data during read and write. -

- -

-The cmd parameter is a short null terminated string which specifies which command -to execute. Data is passed to and returned from the library by use of a void -pointer. The library will not read or write more than datasize bytes from the void -pointer. For some calls no data is required in which case data should be NULL and -datasize may be used for some other purpose. -

-

-The return value of sf_command () depends on the value of the cmd parameter, but it is -usually non-zero for success and zero on error. -

-

-This function is explained more fully here. -

-


Error Reporting Functions

@@ -588,6 +560,10 @@

+

+See also : SFC_RAW_NEEDS_ENDSWAP +

+


Functions for Reading and Writing String Data

@@ -684,7 +660,7 @@ here.

-Version : 1.0.17 +Version : 1.0.19

@@ -693,11 +669,3 @@ - - Modified: freeswitch/trunk/libs/libsndfile/doc/bugs.html ============================================================================== --- freeswitch/trunk/libs/libsndfile/doc/bugs.html (original) +++ freeswitch/trunk/libs/libsndfile/doc/bugs.html Thu May 21 16:09:30 2009 @@ -74,11 +74,3 @@

- - Modified: freeswitch/trunk/libs/libsndfile/doc/command.html ============================================================================== --- freeswitch/trunk/libs/libsndfile/doc/command.html (original) +++ freeswitch/trunk/libs/libsndfile/doc/command.html Thu May 21 16:09:30 2009 @@ -95,6 +95,13 @@ Set/clear the scale factor when integer (short/int) data is read from a file containing floating point data. + + + SFC_SET_SCALE_INT_FLOAT_WRITE + Set/clear the scale factor when integer (short/int) data is written to a file + as floating point data. + + SFC_GET_SIMPLE_FORMAT_COUNT Retrieve the number of simple formats supported by libsndfile. @@ -168,6 +175,35 @@ Retreive information about audio files embedded inside other files. + + SFC_GET_AMBISONIC + Test a WAVEX file for Ambisonic format + + + + SFC_SET_AMBISONIC + Modify a WAVEX header for Ambisonic format + + + + SFC_SET_VBR_ENCODING_QUALITY + Set the the Variable Bit Rate encoding quality + + + + SFC_RAW_NEEDS_ENDSWAP + Determine if raw data needs endswapping + + + + SFC_GET_BROADCAST_INFO + Retrieve the Broadcast Chunk info + + + + SFC_SET_BROADCAST_INFO + Set the Broadcast Chunk info + + +


SFC_SET_SCALE_INT_FLOAT_WRITE

+

+Set/clear the scale factor when integer (short/int) data is written to a file +as floating point data. +

+

+Parameters: +

+
+        sndfile  : A valid SNDFILE* pointer
+        cmd      : SFC_SET_SCALE_FLOAT_INT_READ
+        data     : NULL
+        datasize : TRUE or FALSE
+
+

+Example: +

+
+        sf_command (sndfile, SFC_SET_SCALE_INT_FLOAT_WRITE, NULL, SF_TRUE) ;
+
+
+
Return value:
+
Returns the previous SFC_SET_SCALE_INT_FLOAT_WRITE setting for this file. +
+ +


SFC_GET_SIMPLE_FORMAT_COUNT

@@ -1059,7 +1122,7 @@

Return value:
-
Zero on sucess, non-zero otherwise. +
Zero on success, non-zero otherwise.
@@ -1137,7 +1200,7 @@ datasize : sizeof (SF_EMBED_FILE_INFO)

-The SF_FORMAT_INFO struct is defined in <sndfile.h> as: +The SF_EMBED_FILE_INFO struct is defined in <sndfile.h> as:

         typedef struct
@@ -1158,6 +1221,178 @@
 
 
 
+
+


SFC_WAVEX_GET_AMBISONIC

+

+Test if the current file has the GUID of a WAVEX file for any of the Ambisonic +formats. +

+

+Parameters: +

+        sndfile  : A valid SNDFILE* pointer
+        cmd      : SFC_WAVEX_GET_AMBISONIC
+        data     : NULL
+        datasize : 0
+
+

+ The Ambisonic WAVEX formats are defined here : + + http://dream.cs.bath.ac.uk/researchdev/wave-ex/bformat.html. +

+
+
Return value:
+
SF_AMBISONIC_NONE or SF_AMBISONIC_B_FORMAT or zero if the file format + does not support ambisonic formats. +
+ + + +


SFC_WAVEX_SET_AMBISONIC

+

+Set the GUID of a new WAVEX file to indicate an Ambisonics format. +

+

+Parameters: +

+        sndfile  : A valid SNDFILE* pointer
+        cmd      : SFC_WAVEX_SET_AMBISONIC
+        data     : NULL
+        datasize : SF_AMBISONIC_NONE or SF_AMBISONIC_B_FORMAT
+
+

+Turn on (SF_AMBISONIC_B_FORMAT) or off (SF_AMBISONIC_NONE) encoding. +This command is currently only supported for files with SF_FORMAT_WAVEX format. +

+

+ The Ambisonic WAVEX formats are defined here : + + http://dream.cs.bath.ac.uk/researchdev/wave-ex/bformat.html. +

+
+
Return value:
+
Return the ambisonic value that has just been set or zero if the file + format does not support ambisonic encoding. +
+ + + +


SFC_SET_VBR_ENCODING_QUALITY

+

+Set the the Variable Bit Rate encoding quality. +The encoding quality value should be between 0.0 (lowest quality) and 1.0 +(highest quality). +

+

+Parameters: +

+        sndfile  : A valid SNDFILE* pointer
+        cmd      : SFC_SET_VBR_ENCODING_QUALITY
+        data     : A pointer to a double value
+        datasize : sizeof (double)
+
+

+The command must be sent before any audio data is written to the file. +

+

+

+
+
Return value:
+
Zero on success, non-zero otherwise. +
+ + + +


SFC_RAW_NEEDS_ENDSWAP

+

+Determine if raw data read using + + sf_read_raw +needs to be end swapped on the host CPU. +

+

+For instance, will return SF_TRUE on when reading WAV containing +SF_FORMAT_PCM_16 data on a big endian machine and SF_FALSE on a little endian +machine. +

+

+Parameters: +

+        sndfile  : A valid SNDFILE* pointer
+        cmd      : SFC_RAW_NEEDS_ENDSWAP
+        data     : NULL
+        datasize : 0
+
+ +
+
Return value:
+
SF_TRUE or SF_FALSE +
+ + + + +


SFC_GET_BROADCAST_INFO

+

+Retrieve the Broadcast Extention Chunk from WAV (and related) files. +

+

+Parameters: +

+
+        sndfile  : A valid SNDFILE* pointer
+        cmd      : SFC_GET_BROADCAST_INFO
+        data     : a pointer to an SF_BROADCAST_INFO struct
+        datasize : sizeof (SF_BROADCAST_INFO)
+
+

+The SF_BROADCAST_INFO struct is defined in <sndfile.h> as: +

+
+    typedef struct
+    {   char            description [256] ;
+        char            originator [32] ;
+        char            originator_reference [32] ;
+        char            origination_date [10] ;
+        char            origination_time [8] ;
+        unsigned int    time_reference_low ;
+        unsigned int    time_reference_high ;
+        short           version ;
+        char            umid [64] ;
+        char            reserved [190] ;
+        unsigned int    coding_history_size ;
+        char            coding_history [256] ;
+    } SF_BROADCAST_INFO ;
+
+ +
+
Return value:
+
SF_TRUE if the file contained a Broadcast Extention chunk or SF_FALSE + otherwise. +
+ + + +


SFC_SET_BROADCAST_INFO

+

+Set the Broadcast Extention Chunk for WAV (and related) files. +

+

+Parameters: +

+
+        sndfile  : A valid SNDFILE* pointer
+        cmd      : SFC_SET_BROADCAST_INFO
+        data     : a pointer to an SF_BROADCAST_INFO struct
+        datasize : sizeof (SF_BROADCAST_INFO)
+
+ +
+
Return value:
+
SF_TRUE if setting the Broadcast Extention chunk was successful and SF_FALSE + otherwise. +
+
@@ -1166,16 +1401,8 @@ http://www.mega-nerd.com/libsndfile/.
-Version : 1.0.17 +Version : 1.0.19

- - Modified: freeswitch/trunk/libs/libsndfile/doc/dither.html ============================================================================== --- freeswitch/trunk/libs/libsndfile/doc/dither.html (original) +++ freeswitch/trunk/libs/libsndfile/doc/dither.html Thu May 21 16:09:30 2009 @@ -1009,16 +1009,8 @@ http://www.mega-nerd.com/libsndfile/.
-Version : 1.0.17 +Version : 1.0.19

- - Modified: freeswitch/trunk/libs/libsndfile/doc/embedded_files.html ============================================================================== --- freeswitch/trunk/libs/libsndfile/doc/embedded_files.html (original) +++ freeswitch/trunk/libs/libsndfile/doc/embedded_files.html Thu May 21 16:09:30 2009 @@ -37,18 +37,10 @@

-The test program multi_file.c in the tests/ directory of the +The test program multi_file_test.c in the tests/ directory of the source code tarball shows how this functionality is used to read and write embedded files.

- - Modified: freeswitch/trunk/libs/libsndfile/doc/index.html ============================================================================== --- freeswitch/trunk/libs/libsndfile/doc/index.html (original) +++ freeswitch/trunk/libs/libsndfile/doc/index.html Thu May 21 16:09:30 2009 @@ -6,7 +6,7 @@ libsndfile - + @@ -24,19 +24,20 @@ Features -+- Similar or Related Projects -+- News -
+
Development -+- Programming Interface -+- Bug Reporting -+- Download -
+
FAQ -+- Mailing Lists -+- Change Log -+- - Licensing Information + Licensing Information -+- + See Also -

+

Libsndfile is a C library for reading and writing files containing sampled sound (such as MS Windows WAV and the Apple/SGI AIFF format) through one standard @@ -73,8 +74,6 @@

  • mips-sgi-irix5.3 (using gcc)
  • QNX 6.0
  • i386-unknown-openbsd2.9 -
    -
  • Win32 (Microsoft Visual C++)

    @@ -117,40 +116,41 @@ The file formats are arranged across the top and encodings along the left edge.

    -
    +
    - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - + - + @@ -158,118 +158,128 @@ + - + - + - + - + - + - + + - + - + - + - + - + - + - + - + - + - + - +
     Micro- soft
    WAV
    SGI / Apple
    AIFF / AIFC
    Sun / DEC /
    NeXT
    AU / SND
    Header- less
    RAW
    Paris Audio
    File
    PAF
    Commo- dore
    Amiga
    IFF / SVX
    Sphere
    Nist
    WAV
    IRCAM
    SF
    Creative
    VOC
    Sound forge
    W64
    GNU Octave 2.0
    MAT4
    GNU Octave 2.1
    MAT5
    Portable Voice Format
    PVF
    Fasttracker 2
    XI
    HMM Tool Kit
    HTK
    Apple
    CAF
    Micro- soft
    WAV
    SGI / Apple
    AIFF / AIFC
    Sun / DEC /
    NeXT
    AU / SND
    Header- less
    RAW
    Paris Audio
    File
    PAF
    Commo- dore
    Amiga
    IFF / SVX
    Sphere
    Nist
    WAV
    IRCAM
    SF
    Creative
    VOC
    Sound forge
    W64
    GNU Octave 2.0
    MAT4
    GNU Octave 2.1
    MAT5
    Portable Voice Format
    PVF
    Fasttracker 2
    XI
    HMM Tool Kit
    HTK
    Apple
    CAF
    Sound
    Designer II
    SD2
    Free Lossless Audio Codec
    FLAC
    Unsigned 8 bit PCM R/WR/W R/W     R/W R/W R/W         
    Signed 8 bit PCM  R/WR/WR/W R/WR/WR/W      R/W  R/W  R/WR/WR/W
    Signed 16 bit PCMR/WR/WR/WR/W R/WR/WR/WR/W R/W R/WR/WR/WR/W
    Signed 24 bit PCM R/WR/WR/WR/W R/W R/WR/W  R/W     R/W  R/WR/WR/W
    Signed 32 bit PCM R/WR/WR/WR/W   R/WR/W  R/WR/WR/WR/W  R/W  R/W  
    32 bit float R/WR/WR/WR/W    R/W  R/WR/WR/W   R/W  R/W  
    64 bit double R/WR/WR/W R/W      R/WR/WR/W   R/W   R/W  
    u-law encoding R/WR/WR/WR/W   R/WR/WR/W R/W     R/WR/W  
    A-law encoding R/WR/WR/WR/W   R/WR/WR/W R/W     R/WR/W  
    IMA ADPCM R/W         R/W         
    MS ADPCM R/W         R/W            
    GSM 6.10 R/WR/W R/W      R/W            
    G721 ADPCM 32kbps R/W R/W                    
    G723 ADPCM 24kbps   R/W                    
    G723 ADPCM 40kbps   R/W                    
    12 bit DWVW  R/W R/W                   
    16 bit DWVW  R/W R/W                   
    24 bit DWVW  R/W R/W                   
    Ok Dialogic ADPCM    R/W                   
    8 bit DPCM               R/W   R/W    
    16 bit DPCM               R/W   R/W    
    + +

    +From version 1.0.18, libsndfile also reads and writes + FLAC +and + Ogg/Vorbis. +

    +

    @@ -277,13 +287,15 @@

    • Kurzweil K2000 sampler files. -
    • Ogg Vorbis.
    • Ogg Speex. -
    • FLAC.

    - I have decided that I will not be adding support for MPEG Layer 3 due to the - patent issues surrounding this file format. + I have decided that I will not be adding support for MPEG Layer 3 (commonly + known as MP3) due to the patent issues surrounding this file format. + See + + the FAQ + for more.

    Other file formats may also be added on request. @@ -346,15 +358,19 @@

  • Version 1.0.16 (Apr 30 2006) Add support for RIFX. Other minor feature enhancements and bug fixes.
  • Version 1.0.17 (Aug 31 2006) Add C++ wrapper sndfile.hh. Minor bug fixes and cleanups. +
  • Version 1.0.18 (Feb 07 2009) Add Ogg/Vorbis suppport, remove captive libraries, many + new features and bug fixes. Generate Win32 and Win64 pre-compiled binaries. +
  • Version 1.0.19 (Mar 02 2009) Fix for CVE-2009-0186. Huge number of minor fixes as a + result of static analysis.

    Similar or Related Projects