From 316963c5941d387b12de505d2e418c1788018b09 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 11 Jan 2011 15:09:03 -0600 Subject: [PATCH 01/23] treat EINTR returns as a BREAK (now mapped to SWITCH_STATUS_INTR), we appriciate the interrupted syscalls but we would like to continue working properly --- src/include/switch_types.h | 3 ++- src/include/switch_utils.h | 2 +- src/switch_rtp.c | 21 ++++++++++++++------- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 9a5e09db7c..3972404290 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -859,7 +859,7 @@ typedef enum { SWITCH_STATUS_FALSE, SWITCH_STATUS_TIMEOUT, SWITCH_STATUS_RESTART, - SWITCH_STATUS_TERM, + SWITCH_STATUS_INTR, SWITCH_STATUS_NOTIMPL, SWITCH_STATUS_MEMERR, SWITCH_STATUS_NOOP, @@ -876,6 +876,7 @@ typedef enum { SWITCH_STATUS_TOO_SMALL, SWITCH_STATUS_FOUND, SWITCH_STATUS_CONTINUE, + SWITCH_STATUS_TERM, SWITCH_STATUS_NOT_INITALIZED } switch_status_t; diff --git a/src/include/switch_utils.h b/src/include/switch_utils.h index 4771dba40a..2c4de14334 100644 --- a/src/include/switch_utils.h +++ b/src/include/switch_utils.h @@ -327,7 +327,7 @@ SWITCH_DECLARE(unsigned short) get_port(struct sockaddr *sa); */ SWITCH_DECLARE(int) switch_build_uri(char *uri, switch_size_t size, const char *scheme, const char *user, const switch_sockaddr_t *sa, int flags); -#define SWITCH_STATUS_IS_BREAK(x) (x == SWITCH_STATUS_BREAK || x == 730035 || x == 35) +#define SWITCH_STATUS_IS_BREAK(x) (x == SWITCH_STATUS_BREAK || x == 730035 || x == 35 || x == SWITCH_STATUS_INTR) /*! \brief Return a printable name of a switch_priority_t diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 038e1d981b..1b7500dd8c 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -2440,6 +2440,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ recvfrom: bytes = 0; read_loops++; + poll_loop = 0; if (!switch_rtp_ready(rtp_session)) { break; @@ -2466,21 +2467,27 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ status = read_rtp_packet(rtp_session, &bytes, flags); } else { if (!SWITCH_STATUS_IS_BREAK(poll_status) && poll_status != SWITCH_STATUS_TIMEOUT) { + char tmp[128] = ""; + strerror_r(poll_status, tmp, sizeof(tmp)); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Poll failed with error: %d [%s]\n", poll_status, tmp); ret = -1; goto end; } poll_loop = 1; - rtp_session->missed_count += (poll_sec * 1000) / (rtp_session->ms_per_packet ? rtp_session->ms_per_packet / 1000 : 20); - bytes = 0; - if (rtp_session->max_missed_packets) { - if (rtp_session->missed_count >= rtp_session->max_missed_packets) { - ret = -2; - goto end; + if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_UDPTL)) { + rtp_session->missed_count += (poll_sec * 1000) / (rtp_session->ms_per_packet ? rtp_session->ms_per_packet / 1000 : 20); + bytes = 0; + + if (rtp_session->max_missed_packets) { + if (rtp_session->missed_count >= rtp_session->max_missed_packets) { + ret = -2; + goto end; + } } } - + if ((!(io_flags & SWITCH_IO_FLAG_NOBLOCK)) && (rtp_session->dtmf_data.out_digit_dur == 0 || switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VIDEO))) { return_cng_frame(); From cf253c35bc8de814e7c5b3f5e88bd9988556dbdb Mon Sep 17 00:00:00 2001 From: Brian West Date: Tue, 11 Jan 2011 15:31:33 -0600 Subject: [PATCH 02/23] zrtp tweak for sas relay --- src/switch_rtp.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 1b7500dd8c..a56b5d11dd 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -3261,21 +3261,25 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp switch_rtp_t *other_rtp_session = switch_channel_get_private(other_channel, "__zrtp_audio_rtp_session"); if (other_rtp_session) { - if (zrtp_status_ok == zrtp_session_get(other_rtp_session->zrtp_session, &zrtp_session_info)) { - if (rtp_session->zrtp_mitm_tries > ZRTP_MITM_TRIES) { - switch_clear_flag(other_rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_RECV); - switch_clear_flag(other_rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_SEND); - switch_clear_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_RECV); - switch_clear_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_SEND); - } else if (zrtp_status_ok == zrtp_resolve_mitm_call(other_rtp_session->zrtp_stream, rtp_session->zrtp_stream)) { - switch_clear_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_RECV); - switch_clear_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_SEND); - switch_clear_flag(other_rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_RECV); - switch_clear_flag(other_rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_SEND); - zrtp_verified_set(zrtp_global, &rtp_session->zrtp_session->zid, - &rtp_session->zrtp_session->peer_zid, zrtp_session_info.sas_is_verified ^ 1); - rtp_session->zrtp_mitm_tries++; + if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_INBOUND) { + switch_mutex_lock(other_rtp_session->read_mutex); + if (zrtp_status_ok == zrtp_session_get(other_rtp_session->zrtp_session, &zrtp_session_info)) { + if (rtp_session->zrtp_mitm_tries > ZRTP_MITM_TRIES) { + switch_clear_flag(other_rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_RECV); + switch_clear_flag(other_rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_SEND); + switch_clear_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_RECV); + switch_clear_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_SEND); + } else if (zrtp_status_ok == zrtp_resolve_mitm_call(other_rtp_session->zrtp_stream, rtp_session->zrtp_stream)) { + switch_clear_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_RECV); + switch_clear_flag(rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_SEND); + switch_clear_flag(other_rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_RECV); + switch_clear_flag(other_rtp_session, SWITCH_ZRTP_FLAG_SECURE_MITM_SEND); + zrtp_verified_set(zrtp_global, &rtp_session->zrtp_session->zid, + &rtp_session->zrtp_session->peer_zid, zrtp_session_info.sas_is_verified ^ 1); + rtp_session->zrtp_mitm_tries++; + } } + switch_mutex_unlock(other_rtp_session->read_mutex); } } From eb88304a1680890d2644a3f0d14f38896e164e33 Mon Sep 17 00:00:00 2001 From: Joao Mesquita Date: Wed, 12 Jan 2011 16:24:04 -0300 Subject: [PATCH 03/23] Small fix on ESL that cause event_id to be set wrong on headers that had value failure. --- libs/esl/src/esl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/esl/src/esl.c b/libs/esl/src/esl.c index f5bab62fcb..078c5de973 100644 --- a/libs/esl/src/esl.c +++ b/libs/esl/src/esl.c @@ -1094,9 +1094,9 @@ ESL_DECLARE(esl_status_t) esl_recv_event(esl_handle_t *handle, int check_q, esl_ esl_log(ESL_LOG_DEBUG, "RECV INNER HEADER [%s] = [%s]\n", hname, hval); if (!strcasecmp(hname, "event-name")) { esl_event_del_header(handle->last_ievent, "event-name"); + esl_name_event(hval, &handle->last_ievent->event_id); } esl_event_add_header_string(handle->last_ievent, ESL_STACK_BOTTOM, hname, hval); - esl_name_event(hval, &handle->last_ievent->event_id); } beg = c + 1; From d2c34232ab046c9d8a004d8a1d919731a94cc70a Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 12 Jan 2011 15:32:05 -0600 Subject: [PATCH 04/23] fix userauth issue --- src/mod/event_handlers/mod_event_socket/mod_event_socket.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c index 0ebf6d5b53..344b0ee117 100644 --- a/src/mod/event_handlers/mod_event_socket/mod_event_socket.c +++ b/src/mod/event_handlers/mod_event_socket/mod_event_socket.c @@ -1548,7 +1548,7 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even char api_reply[512] = "Allowed-API: all\n"; char log_reply[512] = ""; int allowed_log = 1; - + char *tmp; switch_clear_flag(listener, LFLAG_ALLOW_LOG); @@ -1564,8 +1564,9 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t **even *pass++ = '\0'; } - if ((pass = strchr(user, ':'))) { - *pass++ = '\0'; + if ((tmp = strchr(user, ':'))) { + *tmp++ = '\0'; + pass = tmp; } if (zstr(user) || zstr(domain_name)) { From 7d1e664dc86c1b533bf70ad688fc58bbc0438073 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 12 Jan 2011 15:32:37 -0600 Subject: [PATCH 05/23] let switch_end_paren work with delims of the same char --- src/switch_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_utils.c b/src/switch_utils.c index 3622442710..1578e63f9a 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -372,7 +372,7 @@ SWITCH_DECLARE(char *) switch_find_end_paren(const char *s, char open, char clos if (s && *s == open) { depth++; for (e = s + 1; e && *e; e++) { - if (*e == open) { + if (*e == open && open != close) { depth++; } else if (*e == close) { depth--; From 54de293b0582bde9db579bc8de8ce8d6ab4750d2 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 12 Jan 2011 16:05:08 -0600 Subject: [PATCH 06/23] fix seg related to ptime mismatch + CNG + PLC (if you ever get purple ptime mismatch warnings you want this patch) --- src/mod/endpoints/mod_sofia/mod_sofia.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index a0bcdbdbd1..85b233d5f3 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -43,8 +43,6 @@ SWITCH_MODULE_DEFINITION(mod_sofia, mod_sofia_load, mod_sofia_shutdown, NULL); struct mod_sofia_globals mod_sofia_globals; switch_endpoint_interface_t *sofia_endpoint_interface; -static switch_frame_t silence_frame = { 0 }; -static char silence_data[13] = ""; #define STRLEN 15 @@ -1094,8 +1092,10 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f sofia_glue_do_invite(session); } #endif - - *frame = &silence_frame; + *frame = &tech_pvt->read_frame; + switch_set_flag((*frame), SFF_CNG); + (*frame)->datalen = tech_pvt->read_impl.encoded_bytes_per_packet; + memset((*frame)->data, 0, (*frame)->datalen); return SWITCH_STATUS_SUCCESS; } @@ -4718,11 +4718,6 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load) switch_management_interface_t *management_interface; struct in_addr in; - silence_frame.data = silence_data; - silence_frame.datalen = sizeof(silence_data); - silence_frame.buflen = sizeof(silence_data); - silence_frame.flags = SFF_CNG; - memset(&mod_sofia_globals, 0, sizeof(mod_sofia_globals)); mod_sofia_globals.destroy_private.destroy_nh = 1; mod_sofia_globals.destroy_private.is_static = 1; From 159ae98979fcfe78f497dc38e2f6daad8a1d87cd Mon Sep 17 00:00:00 2001 From: Brian West Date: Wed, 12 Jan 2011 16:27:56 -0600 Subject: [PATCH 07/23] be more iOS friendly when using TCP or TLS because the phone never sleeps thus drains the battery --- src/mod/endpoints/mod_sofia/sofia.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 904f3ecb46..67a7a6e582 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -1477,8 +1477,6 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void 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), From fb017a52d183ded3db8e01eec5e29b127ccb2ad0 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 12 Jan 2011 16:46:27 -0600 Subject: [PATCH 08/23] clear last_transferred conference when you exit the conference app --- src/mod/applications/mod_conference/mod_conference.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index a9da20e9d9..6bdb5680fc 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -5845,6 +5845,8 @@ SWITCH_STANDARD_APP(conference_function) if (rl) { switch_thread_rwlock_unlock(conference->rwlock); } + + switch_channel_set_variable(channel, "last_transfered_conference", NULL); } /* Create a thread for the conference and launch it */ From a10125b8c3661123d99ed77cb3224eb4fdee5854 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 12 Jan 2011 17:48:49 -0600 Subject: [PATCH 09/23] add origination_channel_name var for {} to choose the channel name value --- src/switch_ivr_originate.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index f31d0f5559..13d9506b17 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -2691,6 +2691,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess originate_status[i].tagged = 1; } + if ((vvar = switch_channel_get_variable(originate_status[i].peer_channel, "origination_channel_name"))) { + switch_channel_set_name(originate_status[i].peer_channel, vvar); + } + if ((vvar = switch_channel_get_variable(originate_status[i].peer_channel, "origination_callee_id_name"))) { switch_channel_set_profile_var(originate_status[i].peer_channel, "callee_id_name", vvar); } From 138fdc83c6a4f614b657629b2937f78485a78a26 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 12 Jan 2011 18:06:01 -0600 Subject: [PATCH 10/23] more from last commit --- src/switch_ivr_originate.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index 13d9506b17..822f404298 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -2602,6 +2602,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess } } + if (caller_channel && switch_true(switch_channel_get_variable(caller_channel, "push_channel_name"))) { + char *new_name = switch_core_session_sprintf(session, "%s__B", switch_channel_get_name(caller_channel)); + //switch_channel_set_variable(originate_status[i].peer_channel, "origination_channel_name", new_name); + switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "origination_channel_name", new_name); + new_name = switch_core_session_sprintf(session, "_%s", switch_channel_get_name(caller_channel)); + switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "sip_h_X-Channel-Name", new_name); + } + /* make a special var event with mixture of the {} and the [] vars to pass down as global vars to the outgoing channel so if something like the user channel does another originate our options will be passed down properly */ @@ -2690,7 +2698,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess if (switch_true(switch_channel_get_variable(originate_status[i].peer_channel, "leg_required"))) { originate_status[i].tagged = 1; } - + if ((vvar = switch_channel_get_variable(originate_status[i].peer_channel, "origination_channel_name"))) { switch_channel_set_name(originate_status[i].peer_channel, vvar); } From 1b91f811bdba30759946c23132579fc55f3579a1 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 12 Jan 2011 19:34:19 -0600 Subject: [PATCH 11/23] more --- src/mod/endpoints/mod_sofia/sofia.c | 3 +++ src/switch_ivr_originate.c | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 67a7a6e582..1d8d6a9a21 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -7135,6 +7135,9 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ switch_channel_set_variable(channel, "sip_history_info", un->un_value); } } + } else if (!strcasecmp(un->un_name, "X-FS-Channel-Name") && !zstr(un->un_value)) { + switch_channel_set_name(channel, un->un_value); + switch_channel_set_variable(channel, "push_channel_name", "true"); } else if (!strcasecmp(un->un_name, "X-FS-Support")) { tech_pvt->x_freeswitch_support_remote = switch_core_session_strdup(session, un->un_value); } else if (!strncasecmp(un->un_name, "X-", 2) || !strncasecmp(un->un_name, "P-", 2)) { diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index 822f404298..d17105a465 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -2604,10 +2604,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess if (caller_channel && switch_true(switch_channel_get_variable(caller_channel, "push_channel_name"))) { char *new_name = switch_core_session_sprintf(session, "%s__B", switch_channel_get_name(caller_channel)); - //switch_channel_set_variable(originate_status[i].peer_channel, "origination_channel_name", new_name); switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "origination_channel_name", new_name); new_name = switch_core_session_sprintf(session, "_%s", switch_channel_get_name(caller_channel)); - switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "sip_h_X-Channel-Name", new_name); + switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "sip_h_X-FS-Channel-Name", new_name); } /* make a special var event with mixture of the {} and the [] vars to pass down as global vars to the outgoing channel From fe1711fdbab9ccf7c1565c0309fe7609fcfe1afc Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 12 Jan 2011 20:02:49 -0600 Subject: [PATCH 12/23] eat rtp frames with the wrong payload type number --- src/switch_rtp.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index a56b5d11dd..5794ae7f28 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -2493,7 +2493,14 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ return_cng_frame(); } } - + + if (rtp_session->recv_msg.header.pt != 13 && + (!rtp_session->cng_pt || rtp_session->recv_msg.header.pt != rtp_session->cng_pt) && + rtp_session->recv_msg.header.pt != rtp_session->payload) { + /* drop frames of incorrect payload number and return CNG frame instead */ + return_cng_frame(); + } + if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_ENABLE_RTCP) && rtp_session->rtcp_read_pollfd) { rtcp_poll_status = switch_poll(rtp_session->rtcp_read_pollfd, 1, &rtcp_fdr, 0); From 9c7b507d06123aedd5842e2d7bc8eae42bd5e566 Mon Sep 17 00:00:00 2001 From: Jeff Lenk Date: Wed, 12 Jan 2011 23:10:29 -0600 Subject: [PATCH 13/23] managed esl vs2010 converted from 2008 w/x64 lib support --- libs/esl/managed/ESL.2010.vcxproj | 195 ++++++++++++++++++ libs/esl/managed/ESL.2010.vcxproj.filters | 30 +++ libs/esl/managed/ManagedEsl.2010.csproj | 93 +++++++++ .../ManagedEslTest/ManagedEslTest.2010.csproj | 98 +++++++++ libs/esl/managed/managed_esl.2010.sln | 74 +++++++ 5 files changed, 490 insertions(+) create mode 100644 libs/esl/managed/ESL.2010.vcxproj create mode 100644 libs/esl/managed/ESL.2010.vcxproj.filters create mode 100644 libs/esl/managed/ManagedEsl.2010.csproj create mode 100644 libs/esl/managed/ManagedEslTest/ManagedEslTest.2010.csproj create mode 100644 libs/esl/managed/managed_esl.2010.sln diff --git a/libs/esl/managed/ESL.2010.vcxproj b/libs/esl/managed/ESL.2010.vcxproj new file mode 100644 index 0000000000..1656ddd1db --- /dev/null +++ b/libs/esl/managed/ESL.2010.vcxproj @@ -0,0 +1,195 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + ESL + {FEA2D0AE-6713-4E41-A473-A143849BC7FF} + ESL + ManagedCProj + + + + DynamicLibrary + Unicode + true + true + + + DynamicLibrary + MultiByte + true + + + DynamicLibrary + Unicode + true + true + + + DynamicLibrary + MultiByte + true + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + true + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + false + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\src\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level4 + ProgramDatabase + + + esl.lib;Ws2_32.lib;%(AdditionalDependencies) + ..\..\..\libs\esl\src\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories) + true + true + NotSet + + + + + ..\src\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + esl.lib;Ws2_32.lib;%(AdditionalDependencies) + ..\..\..\libs\esl\src\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories) + true + MachineX86 + + + + + X64 + + + Disabled + ..\src\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + + + Level4 + ProgramDatabase + + + esl.lib;Ws2_32.lib;%(AdditionalDependencies) + ..\..\..\libs\esl\src\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories) + true + true + MachineX64 + + + + + X64 + + + ..\src\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + esl.lib;Ws2_32.lib;%(AdditionalDependencies) + ..\..\..\libs\esl\src\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories) + true + MachineX64 + + + + + true + true + + + true + true + + + true + true + + + + + + + + + + + + + \ No newline at end of file diff --git a/libs/esl/managed/ESL.2010.vcxproj.filters b/libs/esl/managed/ESL.2010.vcxproj.filters new file mode 100644 index 0000000000..0f46492f09 --- /dev/null +++ b/libs/esl/managed/ESL.2010.vcxproj.filters @@ -0,0 +1,30 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/libs/esl/managed/ManagedEsl.2010.csproj b/libs/esl/managed/ManagedEsl.2010.csproj new file mode 100644 index 0000000000..7be21f44cb --- /dev/null +++ b/libs/esl/managed/ManagedEsl.2010.csproj @@ -0,0 +1,93 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {DEE5837B-E01D-4223-B351-EDF9418F3F8E} + Library + Properties + ManagedEsl + ManagedEsl + v4.0 + 512 + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + + true + full + false + Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + + + + + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/libs/esl/managed/ManagedEslTest/ManagedEslTest.2010.csproj b/libs/esl/managed/ManagedEslTest/ManagedEslTest.2010.csproj new file mode 100644 index 0000000000..8b97ffc2df --- /dev/null +++ b/libs/esl/managed/ManagedEslTest/ManagedEslTest.2010.csproj @@ -0,0 +1,98 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {2321D01A-D64B-4461-9837-FACF38652212} + Exe + Properties + ManagedEslTest + ManagedEslTest + v4.0 + 512 + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + + true + full + false + ..\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + ..\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + + + + + + + + {DEE5837B-E01D-4223-B351-EDF9418F3F8E} + ManagedEsl + True + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + + + \ No newline at end of file diff --git a/libs/esl/managed/managed_esl.2010.sln b/libs/esl/managed/managed_esl.2010.sln new file mode 100644 index 0000000000..3460af4746 --- /dev/null +++ b/libs/esl/managed/managed_esl.2010.sln @@ -0,0 +1,74 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ESL", "ESL.2010.vcxproj", "{FEA2D0AE-6713-4E41-A473-A143849BC7FF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedEsl.2010", "ManagedEsl.2010.csproj", "{DEE5837B-E01D-4223-B351-EDF9418F3F8E}" + ProjectSection(ProjectDependencies) = postProject + {FEA2D0AE-6713-4E41-A473-A143849BC7FF} = {FEA2D0AE-6713-4E41-A473-A143849BC7FF} + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedEslTest.2010", "ManagedEslTest\ManagedEslTest.2010.csproj", "{2321D01A-D64B-4461-9837-FACF38652212}" + ProjectSection(ProjectDependencies) = postProject + {FEA2D0AE-6713-4E41-A473-A143849BC7FF} = {FEA2D0AE-6713-4E41-A473-A143849BC7FF} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|Win32.ActiveCfg = Debug|Win32 + {FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|Win32.Build.0 = Debug|Win32 + {FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|x64.ActiveCfg = Debug|x64 + {FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|x64.Build.0 = Debug|x64 + {FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|Any CPU.ActiveCfg = Release|Win32 + {FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|Mixed Platforms.Build.0 = Release|Win32 + {FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|Win32.ActiveCfg = Release|Win32 + {FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|Win32.Build.0 = Release|Win32 + {FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|x64.ActiveCfg = Release|x64 + {FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|x64.Build.0 = Release|x64 + {DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|Win32.ActiveCfg = Debug|Any CPU + {DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|x64.ActiveCfg = Debug|Any CPU + {DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|x64.Build.0 = Debug|Any CPU + {DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|Any CPU.Build.0 = Release|Any CPU + {DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|Win32.ActiveCfg = Release|Any CPU + {DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|x64.ActiveCfg = Release|Any CPU + {DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|x64.Build.0 = Release|Any CPU + {2321D01A-D64B-4461-9837-FACF38652212}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2321D01A-D64B-4461-9837-FACF38652212}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2321D01A-D64B-4461-9837-FACF38652212}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {2321D01A-D64B-4461-9837-FACF38652212}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {2321D01A-D64B-4461-9837-FACF38652212}.Debug|Win32.ActiveCfg = Debug|Any CPU + {2321D01A-D64B-4461-9837-FACF38652212}.Debug|x64.ActiveCfg = Debug|Any CPU + {2321D01A-D64B-4461-9837-FACF38652212}.Debug|x64.Build.0 = Debug|Any CPU + {2321D01A-D64B-4461-9837-FACF38652212}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2321D01A-D64B-4461-9837-FACF38652212}.Release|Any CPU.Build.0 = Release|Any CPU + {2321D01A-D64B-4461-9837-FACF38652212}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {2321D01A-D64B-4461-9837-FACF38652212}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {2321D01A-D64B-4461-9837-FACF38652212}.Release|Win32.ActiveCfg = Release|Any CPU + {2321D01A-D64B-4461-9837-FACF38652212}.Release|x64.ActiveCfg = Release|Any CPU + {2321D01A-D64B-4461-9837-FACF38652212}.Release|x64.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal From a6db66ef36c05d0989343fdb8dd5bd8860754839 Mon Sep 17 00:00:00 2001 From: Brian West Date: Thu, 13 Jan 2011 09:55:55 -0600 Subject: [PATCH 14/23] http://jira.freeswitch.org/browse/FS-2976 --- libs/js/nsprpub/pr/src/md/unix/os_Linux_x86.s | 136 ++++++++-------- .../nsprpub/pr/src/md/unix/os_Linux_x86_64.s | 110 ++++++------- libs/js/nsprpub/pr/src/md/unix/os_SunOS_x86.s | 154 +++++++++--------- .../nsprpub/pr/src/md/unix/os_SunOS_x86_64.s | 106 ++++++------ 4 files changed, 253 insertions(+), 253 deletions(-) diff --git a/libs/js/nsprpub/pr/src/md/unix/os_Linux_x86.s b/libs/js/nsprpub/pr/src/md/unix/os_Linux_x86.s index 743eff56fe..650aa2ad80 100644 --- a/libs/js/nsprpub/pr/src/md/unix/os_Linux_x86.s +++ b/libs/js/nsprpub/pr/src/md/unix/os_Linux_x86.s @@ -1,42 +1,42 @@ -/ -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- -/ -/ The contents of this file are subject to the Mozilla Public -/ License Version 1.1 (the "License"); you may not use this file -/ except in compliance with the License. You may obtain a copy of -/ the License at http://www.mozilla.org/MPL/ -/ -/ Software distributed under the License is distributed on an "AS -/ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -/ implied. See the License for the specific language governing -/ rights and limitations under the License. -/ -/ The Original Code is the Netscape Portable Runtime (NSPR). -/ -/ The Initial Developer of the Original Code is Netscape -/ Communications Corporation. Portions created by Netscape are -/ Copyright (C) 2000 Netscape Communications Corporation. All -/ Rights Reserved. -/ -/ Contributor(s): -/ -/ Alternatively, the contents of this file may be used under the -/ terms of the GNU General Public License Version 2 or later (the -/ "GPL"), in which case the provisions of the GPL are applicable -/ instead of those above. If you wish to allow use of your -/ version of this file only under the terms of the GPL and not to -/ allow others to use your version of this file under the MPL, -/ indicate your decision by deleting the provisions above and -/ replace them with the notice and other provisions required by -/ the GPL. If you do not delete the provisions above, a recipient -/ may use your version of this file under either the MPL or the -/ GPL. -/ +// -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- +// +// The contents of this file are subject to the Mozilla Public +// License Version 1.1 (the "License"); you may not use this file +// except in compliance with the License. You may obtain a copy of +// the License at http://www.mozilla.org/MPL/ +// +// Software distributed under the License is distributed on an "AS +// IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +// implied. See the License for the specific language governing +// rights and limitations under the License. +// +// The Original Code is the Netscape Portable Runtime (NSPR). +// +// The Initial Developer of the Original Code is Netscape +// Communications Corporation. Portions created by Netscape are +// Copyright (C) 2000 Netscape Communications Corporation. All +// Rights Reserved. +// +// Contributor(s): +// +// Alternatively, the contents of this file may be used under the +// terms of the GNU General Public License Version 2 or later (the +// "GPL"), in which case the provisions of the GPL are applicable +// instead of those above. If you wish to allow use of your +// version of this file only under the terms of the GPL and not to +// allow others to use your version of this file under the MPL, +// indicate your decision by deleting the provisions above and +// replace them with the notice and other provisions required by +// the GPL. If you do not delete the provisions above, a recipient +// may use your version of this file under either the MPL or the +// GPL. +// -/ PRInt32 _PR_x86_AtomicIncrement(PRInt32 *val) -/ -/ Atomically increment the integer pointed to by 'val' and return -/ the result of the increment. -/ +// PRInt32 _PR_x86_AtomicIncrement(PRInt32 *val) +// +// Atomically increment the integer pointed to by 'val' and return +// the result of the increment. +// .text .globl _PR_x86_AtomicIncrement .align 4 @@ -48,11 +48,11 @@ _PR_x86_AtomicIncrement: incl %eax ret -/ PRInt32 _PR_x86_AtomicDecrement(PRInt32 *val) -/ -/ Atomically decrement the integer pointed to by 'val' and return -/ the result of the decrement. -/ +// PRInt32 _PR_x86_AtomicDecrement(PRInt32 *val) +// +// Atomically decrement the integer pointed to by 'val' and return +// the result of the decrement. +// .text .globl _PR_x86_AtomicDecrement .align 4 @@ -64,25 +64,25 @@ _PR_x86_AtomicDecrement: decl %eax ret -/ PRInt32 _PR_x86_AtomicSet(PRInt32 *val, PRInt32 newval) -/ -/ Atomically set the integer pointed to by 'val' to the new -/ value 'newval' and return the old value. -/ -/ An alternative implementation: -/ .text -/ .globl _PR_x86_AtomicSet -/ .align 4 -/_PR_x86_AtomicSet: -/ movl 4(%esp), %ecx -/ movl 8(%esp), %edx -/ movl (%ecx), %eax -/retry: -/ lock -/ cmpxchgl %edx, (%ecx) -/ jne retry -/ ret -/ +// PRInt32 _PR_x86_AtomicSet(PRInt32 *val, PRInt32 newval) +// +// Atomically set the integer pointed to by 'val' to the new +// value 'newval' and return the old value. +// +// An alternative implementation: +// .text +// .globl _PR_x86_AtomicSet +// .align 4 +//_PR_x86_AtomicSet: +// movl 4(%esp), %ecx +// movl 8(%esp), %edx +// movl (%ecx), %eax +//retry: +// lock +// cmpxchgl %edx, (%ecx) +// jne retry +// ret +// .text .globl _PR_x86_AtomicSet .align 4 @@ -92,11 +92,11 @@ _PR_x86_AtomicSet: xchgl %eax, (%ecx) ret -/ PRInt32 _PR_x86_AtomicAdd(PRInt32 *ptr, PRInt32 val) -/ -/ Atomically add 'val' to the integer pointed to by 'ptr' -/ and return the result of the addition. -/ +// PRInt32 _PR_x86_AtomicAdd(PRInt32 *ptr, PRInt32 val) +// +// Atomically add 'val' to the integer pointed to by 'ptr' +// and return the result of the addition. +// .text .globl _PR_x86_AtomicAdd .align 4 @@ -109,5 +109,5 @@ _PR_x86_AtomicAdd: addl %edx, %eax ret -/ Magic indicating no need for an executable stack +// Magic indicating no need for an executable stack .section .note.GNU-stack, "", @progbits ; .previous diff --git a/libs/js/nsprpub/pr/src/md/unix/os_Linux_x86_64.s b/libs/js/nsprpub/pr/src/md/unix/os_Linux_x86_64.s index c62437b23a..230dd82887 100644 --- a/libs/js/nsprpub/pr/src/md/unix/os_Linux_x86_64.s +++ b/libs/js/nsprpub/pr/src/md/unix/os_Linux_x86_64.s @@ -1,42 +1,42 @@ -/ -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- -/ -/ The contents of this file are subject to the Mozilla Public -/ License Version 1.1 (the "License"); you may not use this file -/ except in compliance with the License. You may obtain a copy of -/ the License at http://www.mozilla.org/MPL/ -/ -/ Software distributed under the License is distributed on an "AS -/ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -/ implied. See the License for the specific language governing -/ rights and limitations under the License. -/ -/ The Original Code is the Netscape Portable Runtime (NSPR). -/ -/ The Initial Developer of the Original Code is Netscape -/ Communications Corporation. Portions created by Netscape are -/ Copyright (C) 2004 Netscape Communications Corporation. All -/ Rights Reserved. -/ -/ Contributor(s): -/ -/ Alternatively, the contents of this file may be used under the -/ terms of the GNU General Public License Version 2 or later (the -/ "GPL"), in which case the provisions of the GPL are applicable -/ instead of those above. If you wish to allow use of your -/ version of this file only under the terms of the GPL and not to -/ allow others to use your version of this file under the MPL, -/ indicate your decision by deleting the provisions above and -/ replace them with the notice and other provisions required by -/ the GPL. If you do not delete the provisions above, a recipient -/ may use your version of this file under either the MPL or the -/ GPL. -/ +// -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- +// +// The contents of this file are subject to the Mozilla Public +// License Version 1.1 (the "License"); you may not use this file +// except in compliance with the License. You may obtain a copy of +// the License at http://www.mozilla.org/MPL/ +// +// Software distributed under the License is distributed on an "AS +// IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +// implied. See the License for the specific language governing +// rights and limitations under the License. +// +// The Original Code is the Netscape Portable Runtime (NSPR). +// +// The Initial Developer of the Original Code is Netscape +// Communications Corporation. Portions created by Netscape are +// Copyright (C) 2004 Netscape Communications Corporation. All +// Rights Reserved. +// +// Contributor(s): +// +// Alternatively, the contents of this file may be used under the +// terms of the GNU General Public License Version 2 or later (the +// "GPL"), in which case the provisions of the GPL are applicable +// instead of those above. If you wish to allow use of your +// version of this file only under the terms of the GPL and not to +// allow others to use your version of this file under the MPL, +// indicate your decision by deleting the provisions above and +// replace them with the notice and other provisions required by +// the GPL. If you do not delete the provisions above, a recipient +// may use your version of this file under either the MPL or the +// GPL. +// -/ PRInt32 _PR_x86_64_AtomicIncrement(PRInt32 *val) -/ -/ Atomically increment the integer pointed to by 'val' and return -/ the result of the increment. -/ +// PRInt32 _PR_x86_64_AtomicIncrement(PRInt32 *val) +// +// Atomically increment the integer pointed to by 'val' and return +// the result of the increment. +// .text .globl _PR_x86_64_AtomicIncrement .align 4 @@ -47,11 +47,11 @@ _PR_x86_64_AtomicIncrement: incl %eax ret -/ PRInt32 _PR_x86_64_AtomicDecrement(PRInt32 *val) -/ -/ Atomically decrement the integer pointed to by 'val' and return -/ the result of the decrement. -/ +// PRInt32 _PR_x86_64_AtomicDecrement(PRInt32 *val) +// +// Atomically decrement the integer pointed to by 'val' and return +// the result of the decrement. +// .text .globl _PR_x86_64_AtomicDecrement .align 4 @@ -62,11 +62,11 @@ _PR_x86_64_AtomicDecrement: decl %eax ret -/ PRInt32 _PR_x86_64_AtomicSet(PRInt32 *val, PRInt32 newval) -/ -/ Atomically set the integer pointed to by 'val' to the new -/ value 'newval' and return the old value. -/ +// PRInt32 _PR_x86_64_AtomicSet(PRInt32 *val, PRInt32 newval) +// +// Atomically set the integer pointed to by 'val' to the new +// value 'newval' and return the old value. +// .text .globl _PR_x86_64_AtomicSet .align 4 @@ -75,11 +75,11 @@ _PR_x86_64_AtomicSet: xchgl %eax, (%rdi) ret -/ PRInt32 _PR_x86_64_AtomicAdd(PRInt32 *ptr, PRInt32 val) -/ -/ Atomically add 'val' to the integer pointed to by 'ptr' -/ and return the result of the addition. -/ +// PRInt32 _PR_x86_64_AtomicAdd(PRInt32 *ptr, PRInt32 val) +// +// Atomically add 'val' to the integer pointed to by 'ptr' +// and return the result of the addition. +// .text .globl _PR_x86_64_AtomicAdd .align 4 @@ -90,5 +90,5 @@ _PR_x86_64_AtomicAdd: addl %esi, %eax ret -/ Magic indicating no need for an executable stack -/.section .note.GNU-stack, "", @progbits ; .previous +// Magic indicating no need for an executable stack +//.section .note.GNU-stack, "", @progbits ; .previous diff --git a/libs/js/nsprpub/pr/src/md/unix/os_SunOS_x86.s b/libs/js/nsprpub/pr/src/md/unix/os_SunOS_x86.s index a46c20fe1e..6e94a732da 100644 --- a/libs/js/nsprpub/pr/src/md/unix/os_SunOS_x86.s +++ b/libs/js/nsprpub/pr/src/md/unix/os_SunOS_x86.s @@ -1,36 +1,36 @@ -/ -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- -/ -/ The contents of this file are subject to the Mozilla Public -/ License Version 1.1 (the "License"); you may not use this file -/ except in compliance with the License. You may obtain a copy of -/ the License at http://www.mozilla.org/MPL/ -/ -/ Software distributed under the License is distributed on an "AS -/ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -/ implied. See the License for the specific language governing -/ rights and limitations under the License. -/ -/ The Original Code is the Netscape Portable Runtime (NSPR). -/ -/ The Initial Developer of the Original Code is Netscape -/ Communications Corporation. Portions created by Netscape are -/ Copyright (C) 1998-2000 Netscape Communications Corporation. All -/ Rights Reserved. -/ -/ Contributor(s): -/ -/ Alternatively, the contents of this file may be used under the -/ terms of the GNU General Public License Version 2 or later (the -/ "GPL"), in which case the provisions of the GPL are applicable -/ instead of those above. If you wish to allow use of your -/ version of this file only under the terms of the GPL and not to -/ allow others to use your version of this file under the MPL, -/ indicate your decision by deleting the provisions above and -/ replace them with the notice and other provisions required by -/ the GPL. If you do not delete the provisions above, a recipient -/ may use your version of this file under either the MPL or the -/ GPL. -/ +// -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- +// +// The contents of this file are subject to the Mozilla Public +// License Version 1.1 (the "License"); you may not use this file +// except in compliance with the License. You may obtain a copy of +// the License at http://www.mozilla.org/MPL/ +// +// Software distributed under the License is distributed on an "AS +// IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +// implied. See the License for the specific language governing +// rights and limitations under the License. +// +// The Original Code is the Netscape Portable Runtime (NSPR). +// +// The Initial Developer of the Original Code is Netscape +// Communications Corporation. Portions created by Netscape are +// Copyright (C) 1998-2000 Netscape Communications Corporation. All +// Rights Reserved. +// +// Contributor(s): +// +// Alternatively, the contents of this file may be used under the +// terms of the GNU General Public License Version 2 or later (the +// "GPL"), in which case the provisions of the GPL are applicable +// instead of those above. If you wish to allow use of your +// version of this file only under the terms of the GPL and not to +// allow others to use your version of this file under the MPL, +// indicate your decision by deleting the provisions above and +// replace them with the notice and other provisions required by +// the GPL. If you do not delete the provisions above, a recipient +// may use your version of this file under either the MPL or the +// GPL. +// .text @@ -56,31 +56,31 @@ _MD_FlushRegisterWindows: ret -/ -/ sol_getsp() -/ -/ Return the current sp (for debugging) -/ +// +// sol_getsp() +// +// Return the current sp (for debugging) +// .globl sol_getsp sol_getsp: movl %esp, %eax ret -/ -/ sol_curthread() -/ -/ Return a unique identifier for the currently active thread. -/ +// +// sol_curthread() +// +// Return a unique identifier for the currently active thread. +// .globl sol_curthread sol_curthread: movl %ecx, %eax ret -/ PRInt32 _MD_AtomicIncrement(PRInt32 *val) -/ -/ Atomically increment the integer pointed to by 'val' and return -/ the result of the increment. -/ +// PRInt32 _MD_AtomicIncrement(PRInt32 *val) +// +// Atomically increment the integer pointed to by 'val' and return +// the result of the increment. +// .text .globl _MD_AtomicIncrement .align 4 @@ -92,11 +92,11 @@ _MD_AtomicIncrement: incl %eax ret -/ PRInt32 _MD_AtomicDecrement(PRInt32 *val) -/ -/ Atomically decrement the integer pointed to by 'val' and return -/ the result of the decrement. -/ +// PRInt32 _MD_AtomicDecrement(PRInt32 *val) +// +// Atomically decrement the integer pointed to by 'val' and return +// the result of the decrement. +// .text .globl _MD_AtomicDecrement .align 4 @@ -108,25 +108,25 @@ _MD_AtomicDecrement: decl %eax ret -/ PRInt32 _MD_AtomicSet(PRInt32 *val, PRInt32 newval) -/ -/ Atomically set the integer pointed to by 'val' to the new -/ value 'newval' and return the old value. -/ -/ An alternative implementation: -/ .text -/ .globl _MD_AtomicSet -/ .align 4 -/_MD_AtomicSet: -/ movl 4(%esp), %ecx -/ movl 8(%esp), %edx -/ movl (%ecx), %eax -/retry: -/ lock -/ cmpxchgl %edx, (%ecx) -/ jne retry -/ ret -/ +// PRInt32 _MD_AtomicSet(PRInt32 *val, PRInt32 newval) +// +// Atomically set the integer pointed to by 'val' to the new +// value 'newval' and return the old value. +// +// An alternative implementation: +// .text +// .globl _MD_AtomicSet +// .align 4 +//_MD_AtomicSet: +// movl 4(%esp), %ecx +// movl 8(%esp), %edx +// movl (%ecx), %eax +//retry: +// lock +// cmpxchgl %edx, (%ecx) +// jne retry +// ret +// .text .globl _MD_AtomicSet .align 4 @@ -136,11 +136,11 @@ _MD_AtomicSet: xchgl %eax, (%ecx) ret -/ PRInt32 _MD_AtomicAdd(PRInt32 *ptr, PRInt32 val) -/ -/ Atomically add 'val' to the integer pointed to by 'ptr' -/ and return the result of the addition. -/ +// PRInt32 _MD_AtomicAdd(PRInt32 *ptr, PRInt32 val) +// +// Atomically add 'val' to the integer pointed to by 'ptr' +// and return the result of the addition. +// .text .globl _MD_AtomicAdd .align 4 diff --git a/libs/js/nsprpub/pr/src/md/unix/os_SunOS_x86_64.s b/libs/js/nsprpub/pr/src/md/unix/os_SunOS_x86_64.s index d4446a5f6b..6d30bc505e 100644 --- a/libs/js/nsprpub/pr/src/md/unix/os_SunOS_x86_64.s +++ b/libs/js/nsprpub/pr/src/md/unix/os_SunOS_x86_64.s @@ -1,42 +1,42 @@ -/ -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- -/ -/ The contents of this file are subject to the Mozilla Public -/ License Version 1.1 (the "License"); you may not use this file -/ except in compliance with the License. You may obtain a copy of -/ the License at http://www.mozilla.org/MPL/ -/ -/ Software distributed under the License is distributed on an "AS -/ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -/ implied. See the License for the specific language governing -/ rights and limitations under the License. -/ -/ The Original Code is the Netscape Portable Runtime (NSPR). -/ -/ The Initial Developer of the Original Code is Netscape -/ Communications Corporation. Portions created by Netscape are -/ Copyright (C) 2004 Netscape Communications Corporation. All -/ Rights Reserved. -/ -/ Contributor(s): -/ -/ Alternatively, the contents of this file may be used under the -/ terms of the GNU General Public License Version 2 or later (the -/ "GPL"), in which case the provisions of the GPL are applicable -/ instead of those above. If you wish to allow use of your -/ version of this file only under the terms of the GPL and not to -/ allow others to use your version of this file under the MPL, -/ indicate your decision by deleting the provisions above and -/ replace them with the notice and other provisions required by -/ the GPL. If you do not delete the provisions above, a recipient -/ may use your version of this file under either the MPL or the -/ GPL. -/ +// -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- +// +// The contents of this file are subject to the Mozilla Public +// License Version 1.1 (the "License"); you may not use this file +// except in compliance with the License. You may obtain a copy of +// the License at http://www.mozilla.org/MPL/ +// +// Software distributed under the License is distributed on an "AS +// IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +// implied. See the License for the specific language governing +// rights and limitations under the License. +// +// The Original Code is the Netscape Portable Runtime (NSPR). +// +// The Initial Developer of the Original Code is Netscape +// Communications Corporation. Portions created by Netscape are +// Copyright (C) 2004 Netscape Communications Corporation. All +// Rights Reserved. +// +// Contributor(s): +// +// Alternatively, the contents of this file may be used under the +// terms of the GNU General Public License Version 2 or later (the +// "GPL"), in which case the provisions of the GPL are applicable +// instead of those above. If you wish to allow use of your +// version of this file only under the terms of the GPL and not to +// allow others to use your version of this file under the MPL, +// indicate your decision by deleting the provisions above and +// replace them with the notice and other provisions required by +// the GPL. If you do not delete the provisions above, a recipient +// may use your version of this file under either the MPL or the +// GPL. +// -/ PRInt32 _MD_AtomicIncrement(PRInt32 *val) -/ -/ Atomically increment the integer pointed to by 'val' and return -/ the result of the increment. -/ +// PRInt32 _MD_AtomicIncrement(PRInt32 *val) +// +// Atomically increment the integer pointed to by 'val' and return +// the result of the increment. +// .text .globl _MD_AtomicIncrement .align 4 @@ -47,11 +47,11 @@ _MD_AtomicIncrement: incl %eax ret -/ PRInt32 _MD_AtomicDecrement(PRInt32 *val) -/ -/ Atomically decrement the integer pointed to by 'val' and return -/ the result of the decrement. -/ +// PRInt32 _MD_AtomicDecrement(PRInt32 *val) +// +// Atomically decrement the integer pointed to by 'val' and return +// the result of the decrement. +// .text .globl _MD_AtomicDecrement .align 4 @@ -62,11 +62,11 @@ _MD_AtomicDecrement: decl %eax ret -/ PRInt32 _MD_AtomicSet(PRInt32 *val, PRInt32 newval) -/ -/ Atomically set the integer pointed to by 'val' to the new -/ value 'newval' and return the old value. -/ +// PRInt32 _MD_AtomicSet(PRInt32 *val, PRInt32 newval) +// +// Atomically set the integer pointed to by 'val' to the new +// value 'newval' and return the old value. +// .text .globl _MD_AtomicSet .align 4 @@ -75,11 +75,11 @@ _MD_AtomicSet: xchgl %eax, (%rdi) ret -/ PRInt32 _MD_AtomicAdd(PRInt32 *ptr, PRInt32 val) -/ -/ Atomically add 'val' to the integer pointed to by 'ptr' -/ and return the result of the addition. -/ +// PRInt32 _MD_AtomicAdd(PRInt32 *ptr, PRInt32 val) +// +// Atomically add 'val' to the integer pointed to by 'ptr' +// and return the result of the addition. +// .text .globl _MD_AtomicAdd .align 4 From d9c5634507118428b27dea28bb3950beb4da9741 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 13 Jan 2011 10:03:00 -0600 Subject: [PATCH 15/23] up assert vaule on header loop detection to 1 meeeeelyonne for hmmhesegs --- src/switch_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_event.c b/src/switch_event.c index 3941fabe1e..003fc82296 100644 --- a/src/switch_event.c +++ b/src/switch_event.c @@ -744,7 +744,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_del_header_val(switch_event_t *even tp = tp->next; x++; - switch_assert(x < 1000); + switch_assert(x < 1000000); hash = switch_ci_hashfunc_default(header_name, &hlen); if ((!hp->hash || hash == hp->hash) && !strcasecmp(header_name, hp->name) && (zstr(val) || !strcmp(hp->value, val))) { From 8458adebbb814ed3a38493bbd5af6b5a7531939e Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 13 Jan 2011 10:30:29 -0600 Subject: [PATCH 16/23] avoid scheduler caling a function on null hash during shutdown --- src/mod/applications/mod_hash/mod_hash.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/mod/applications/mod_hash/mod_hash.c b/src/mod/applications/mod_hash/mod_hash.c index d03ff92765..e3f01cec96 100644 --- a/src/mod/applications/mod_hash/mod_hash.c +++ b/src/mod/applications/mod_hash/mod_hash.c @@ -263,10 +263,14 @@ SWITCH_HASH_DELETE_FUNC(limit_hash_remote_cleanup_callback) SWITCH_STANDARD_SCHED_FUNC(limit_hash_cleanup_callback) { switch_thread_rwlock_wrlock(globals.limit_hash_rwlock); - switch_core_hash_delete_multi(globals.limit_hash, limit_hash_cleanup_delete_callback, NULL); + if (globals.limit_hash) { + switch_core_hash_delete_multi(globals.limit_hash, limit_hash_cleanup_delete_callback, NULL); + } switch_thread_rwlock_unlock(globals.limit_hash_rwlock); - - task->runtime = switch_epoch_time_now(NULL) + LIMIT_HASH_CLEANUP_INTERVAL; + + if (globals.limit_hash) { + task->runtime = switch_epoch_time_now(NULL) + LIMIT_HASH_CLEANUP_INTERVAL; + } } /* !\brief Releases usage of a limit_hash-controlled ressource */ @@ -991,7 +995,9 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_hash_shutdown) free(val); switch_core_hash_delete(globals.db_hash, key); } - + + switch_core_hash_destroy(&globals.limit_hash); + switch_core_hash_destroy(&globals.db_hash); switch_thread_rwlock_unlock(globals.limit_hash_rwlock); switch_thread_rwlock_unlock(globals.db_hash_rwlock); @@ -999,8 +1005,6 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_hash_shutdown) switch_thread_rwlock_destroy(globals.db_hash_rwlock); switch_thread_rwlock_destroy(globals.limit_hash_rwlock); - switch_core_hash_destroy(&globals.limit_hash); - switch_core_hash_destroy(&globals.db_hash); return SWITCH_STATUS_SUCCESS; } From 2e0747272fcc686851efb2fd804ee2bf78960f5d Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 13 Jan 2011 10:41:33 -0600 Subject: [PATCH 17/23] fix regression in commit 98f74a5f FS-2965 --- src/mod/applications/mod_conference/mod_conference.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 6bdb5680fc..2d9341a598 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -5046,7 +5046,7 @@ static switch_status_t conference_local_play_file(conference_obj_t *conference, goto done; } - if (conference->sound_prefix) { + if (!switch_is_file_path(path) && conference->sound_prefix) { if (!(dpath = switch_mprintf("%s%s%s", conference->sound_prefix, SWITCH_PATH_SEPARATOR, path))) { status = SWITCH_STATUS_MEMERR; goto done; @@ -5827,7 +5827,7 @@ SWITCH_STANDARD_APP(conference_function) toplay = conference->kicked_sound; } - if (conference->sound_prefix) { + if (!switch_is_file_path(toplay) && conference->sound_prefix) { dfile = switch_mprintf("%s%s%s", conference->sound_prefix, SWITCH_PATH_SEPARATOR, toplay); switch_assert(dfile); toplay = dfile; From c6bdb303d43383f4d3474f54e5dbf2b6d699f2bd Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 13 Jan 2011 10:58:53 -0600 Subject: [PATCH 18/23] FS-2975 --- src/switch_utils.c | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/src/switch_utils.c b/src/switch_utils.c index 1578e63f9a..0c492525b1 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -809,23 +809,29 @@ SWITCH_DECLARE(char *) switch_strip_whitespace(const char *str) { const char *sp = str; char *p, *s = NULL; + size_t len; - if (!sp) - return NULL; + if (zstr(sp)) { + return (char *) sp; + } while ((*sp == 13 ) || (*sp == 10 ) || (*sp == 9 ) || (*sp == 32) || (*sp == 11) ) { sp++; } + + if (zstr(sp)) { + return (char *) sp; + } s = strdup(sp); + switch_assert(s); - if (!s) - return NULL; + if ((len = strlen(s)) > 0) { + p = s + (len - 1); - p = s + (strlen(s) - 1); - - while ((*p == 13 ) || (*p == 10 ) || (*p == 9 ) || (*p == 32) || (*p == 11) ) { - *p-- = '\0'; + while (p > s && ((*p == 13 ) || (*p == 10 ) || (*p == 9 ) || (*p == 32) || (*p == 11))) { + *p-- = '\0'; + } } return s; @@ -835,9 +841,11 @@ SWITCH_DECLARE(char *) switch_strip_spaces(char *str, switch_bool_t dup) { char *sp = str; char *p, *s = NULL; + size_t len; - if (!sp) - return NULL; + if (zstr(sp)) { + return sp; + } while (*sp == ' ') { sp++; @@ -845,17 +853,21 @@ SWITCH_DECLARE(char *) switch_strip_spaces(char *str, switch_bool_t dup) if (dup) { s = strdup(sp); + switch_assert(s); } else { s = sp; } - if (!s) - return NULL; + if (zstr(s)) { + return s; + } - p = s + (strlen(s) - 1); + if ((len = strlen(s)) > 0) { + p = s + (len - 1); - while (*p == ' ') { - *p-- = '\0'; + while (p && *p && p > s && *p == ' ') { + *p-- = '\0'; + } } return s; From b2359797668addf5e79ce4de36f1cf62cc93136d Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 13 Jan 2011 12:35:39 -0600 Subject: [PATCH 19/23] You don't need to see this patch --- src/switch_rtp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 5794ae7f28..4e5450d7e8 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -2495,6 +2495,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ } if (rtp_session->recv_msg.header.pt != 13 && + rtp_session->recv_msg.header.pt != rtp_session->recv_te && (!rtp_session->cng_pt || rtp_session->recv_msg.header.pt != rtp_session->cng_pt) && rtp_session->recv_msg.header.pt != rtp_session->payload) { /* drop frames of incorrect payload number and return CNG frame instead */ From 03ae958ce40b529709dbaf4a304be2ba3f6454b1 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Thu, 13 Jan 2011 15:13:56 -0500 Subject: [PATCH 20/23] freetdm; TON/NPI defaults to unknown for Euroisdn --- .../ftmod_sangoma_isdn_cfg.c | 89 ++++++++++++++----- 1 file changed, 69 insertions(+), 20 deletions(-) diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c index c979000223..585f6d4aa0 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c @@ -38,6 +38,7 @@ static ftdm_status_t parse_switchtype(const char* switch_name, ftdm_span_t *span static ftdm_status_t parse_signalling(const char* signalling, ftdm_span_t *span); static ftdm_status_t add_local_number(const char* val, ftdm_span_t *span); static ftdm_status_t parse_yesno(const char* var, const char* val, uint8_t *target); +static ftdm_status_t set_switchtype_defaults(ftdm_span_t *span); extern ftdm_sngisdn_data_t g_sngisdn_data; @@ -191,6 +192,63 @@ static ftdm_status_t parse_signalling(const char* signalling, ftdm_span_t *span) return FTDM_SUCCESS; } +static ftdm_status_t set_switchtype_defaults(ftdm_span_t *span) +{ + sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) span->signal_data; + switch(signal_data->switchtype) { + case SNGISDN_SWITCH_NI2: + case SNGISDN_SWITCH_5ESS: + case SNGISDN_SWITCH_4ESS: + case SNGISDN_SWITCH_DMS100: + if (span->default_caller_data.dnis.plan >= FTDM_NPI_INVALID) { + ftdm_set_npi("isdn", &span->default_caller_data.dnis.plan); + } + if (span->default_caller_data.dnis.type >= FTDM_TON_INVALID) { + ftdm_set_ton("national", &span->default_caller_data.dnis.type); + } + if (span->default_caller_data.cid_num.plan >= FTDM_NPI_INVALID) { + ftdm_set_npi("isdn", &span->default_caller_data.cid_num.plan); + } + if (span->default_caller_data.cid_num.type >= FTDM_TON_INVALID) { + ftdm_set_ton("national", &span->default_caller_data.cid_num.type); + } + if (span->default_caller_data.rdnis.plan >= FTDM_NPI_INVALID) { + ftdm_set_npi("isdn", &span->default_caller_data.rdnis.plan); + } + if (span->default_caller_data.rdnis.type >= FTDM_TON_INVALID) { + ftdm_set_ton("national", &span->default_caller_data.rdnis.type); + } + break; + case SNGISDN_SWITCH_EUROISDN: + case SNGISDN_SWITCH_QSIG: + case SNGISDN_SWITCH_INSNET: + if (span->default_caller_data.dnis.plan >= FTDM_NPI_INVALID) { + ftdm_set_npi("unknown", &span->default_caller_data.dnis.plan); + } + if (span->default_caller_data.dnis.type >= FTDM_TON_INVALID) { + ftdm_set_ton("unknown", &span->default_caller_data.dnis.type); + } + if (span->default_caller_data.cid_num.plan >= FTDM_NPI_INVALID) { + ftdm_set_npi("unknown", &span->default_caller_data.cid_num.plan); + } + if (span->default_caller_data.cid_num.type >= FTDM_TON_INVALID) { + ftdm_set_ton("unknown", &span->default_caller_data.cid_num.type); + } + if (span->default_caller_data.rdnis.plan >= FTDM_NPI_INVALID) { + ftdm_set_npi("unknown", &span->default_caller_data.rdnis.plan); + } + if (span->default_caller_data.rdnis.type >= FTDM_TON_INVALID) { + ftdm_set_ton("unknown", &span->default_caller_data.rdnis.type); + } + break; + case SNGISDN_SWITCH_INVALID: + default: + ftdm_log(FTDM_LOG_ERROR, "Unsupported switchtype[%d]\n", signal_data->switchtype); + return FTDM_FAIL; + } + return FTDM_SUCCESS; +} + ftdm_status_t ftmod_isdn_parse_cfg(ftdm_conf_parameter_t *ftdm_parameters, ftdm_span_t *span) { unsigned paramindex; @@ -205,31 +263,19 @@ ftdm_status_t ftmod_isdn_parse_cfg(ftdm_conf_parameter_t *ftdm_parameters, ftdm_ signal_data->ignore_cause_value = SNGISDN_OPT_DEFAULT; signal_data->timer_t3 = 8; signal_data->restart_opt = SNGISDN_OPT_DEFAULT; - signal_data->link_id = span->span_id; - span->default_caller_data.bearer_capability = IN_ITC_SPEECH; + + span->default_caller_data.dnis.plan = FTDM_NPI_INVALID; + span->default_caller_data.dnis.type = FTDM_TON_INVALID; + span->default_caller_data.cid_num.plan = FTDM_NPI_INVALID; + span->default_caller_data.cid_num.type = FTDM_TON_INVALID; + span->default_caller_data.rdnis.plan = FTDM_NPI_INVALID; + span->default_caller_data.rdnis.type = FTDM_TON_INVALID; + span->default_caller_data.bearer_capability = IN_ITC_SPEECH; /* Cannot set default bearer_layer1 yet, as we do not know the switchtype */ span->default_caller_data.bearer_layer1 = FTDM_INVALID_INT_PARM; - if (span->trunk_type == FTDM_TRUNK_BRI || - span->trunk_type == FTDM_TRUNK_BRI_PTMP) { - - ftdm_set_npi("unknown", &span->default_caller_data.dnis.plan); - ftdm_set_ton("unknown", &span->default_caller_data.dnis.type); - ftdm_set_npi("unknown", &span->default_caller_data.cid_num.plan); - ftdm_set_ton("unknown", &span->default_caller_data.cid_num.type); - ftdm_set_npi("unknown", &span->default_caller_data.rdnis.plan); - ftdm_set_ton("unknown", &span->default_caller_data.rdnis.type); - } else { - ftdm_set_npi("isdn", &span->default_caller_data.dnis.plan); - ftdm_set_ton("national", &span->default_caller_data.dnis.type); - ftdm_set_npi("isdn", &span->default_caller_data.cid_num.plan); - ftdm_set_ton("national", &span->default_caller_data.cid_num.type); - ftdm_set_npi("isdn", &span->default_caller_data.rdnis.plan); - ftdm_set_ton("national", &span->default_caller_data.rdnis.type); - } - for (paramindex = 0; ftdm_parameters[paramindex].var; paramindex++) { ftdm_log(FTDM_LOG_DEBUG, "Sangoma ISDN key=value, %s=%s\n", ftdm_parameters[paramindex].var, ftdm_parameters[paramindex].val); var = ftdm_parameters[paramindex].var; @@ -239,6 +285,9 @@ ftdm_status_t ftmod_isdn_parse_cfg(ftdm_conf_parameter_t *ftdm_parameters, ftdm_ if (parse_switchtype(val, span) != FTDM_SUCCESS) { return FTDM_FAIL; } + if (set_switchtype_defaults(span) != FTDM_SUCCESS) { + return FTDM_FAIL; + } } else if (!strcasecmp(var, "signalling") || !strcasecmp(var, "interface")) { if (parse_signalling(val, span) != FTDM_SUCCESS) { From bba8aefca0b4b2eb7ccf86c2958b6cad397403ab Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Thu, 13 Jan 2011 16:28:31 -0500 Subject: [PATCH 21/23] freetdm: ISDN-Fix for d-channel indexing, causing improper configuration on non-consecutive logical spans --- .../ftmod_sangoma_isdn_cfg.c | 2 +- .../ftmod_sangoma_isdn_stack_cfg.c | 16 ++++++++-------- .../ftmod_sangoma_isdn_stack_cntrl.c | 13 ++++++++----- .../ftmod_sangoma_isdn_stack_out.c | 8 ++++---- .../ftmod_sangoma_isdn_stack_rcv.c | 18 +++++++++++------- 5 files changed, 32 insertions(+), 25 deletions(-) diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c index 585f6d4aa0..100631f345 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c @@ -150,7 +150,7 @@ static ftdm_status_t parse_switchtype(const char* switch_name, ftdm_span_t *span g_sngisdn_data.spans[signal_data->link_id] = signal_data; - ftdm_log(FTDM_LOG_DEBUG, "%s: cc_id:%d dchan_id:%d span_id:%d\n", span->name, signal_data->cc_id, signal_data->dchan_id, signal_data->span_id); + ftdm_log(FTDM_LOG_DEBUG, "%s: cc_id:%d dchan_id:%d span_id:%d link_id:%d\n", span->name, signal_data->cc_id, signal_data->dchan_id, signal_data->span_id, signal_data->link_id); chaniter = ftdm_span_get_chan_iterator(span, NULL); diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_cfg.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_cfg.c index de10a9fac0..a52a624dd0 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_cfg.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_cfg.c @@ -216,7 +216,7 @@ ftdm_status_t sngisdn_stack_cfg_phy_psap(ftdm_span_t *span) cfg.hdr.entId.inst = S_INST; cfg.hdr.elmId.elmnt = STPSAP; - cfg.hdr.elmId.elmntInst1 = signal_data->link_id; + cfg.hdr.elmId.elmntInst1 = signal_data->dchan_id; if (!signal_data->dchan) { ftdm_log(FTDM_LOG_ERROR, "%s:No d-channels specified\n", span->name); @@ -241,7 +241,8 @@ ftdm_status_t sngisdn_stack_cfg_phy_psap(ftdm_span_t *span) ftdm_log(FTDM_LOG_ERROR, "%s:Unsupported trunk type %d\n", span->name, span->trunk_type); return FTDM_FAIL; } - cfg.t.cfg.s.l1PSAP.spId = signal_data->link_id; + + cfg.t.cfg.s.l1PSAP.spId = signal_data->dchan_id; if (sng_isdn_phy_config(&pst, &cfg)) { return FTDM_FAIL; @@ -315,7 +316,7 @@ ftdm_status_t sngisdn_stack_cfg_q921_msap(ftdm_span_t *span) cfg.hdr.entId.inst = S_INST; cfg.hdr.elmId.elmnt = STMSAP; - cfg.t.cfg.s.bdMSAP.lnkNmb = signal_data->link_id; + cfg.t.cfg.s.bdMSAP.lnkNmb = signal_data->dchan_id; cfg.t.cfg.s.bdMSAP.maxOutsFrms = 24; /* MAC window */ cfg.t.cfg.s.bdMSAP.tQUpperTrs = 32; /* Tx Queue Upper Threshold */ @@ -408,7 +409,7 @@ ftdm_status_t sngisdn_stack_cfg_q921_dlsap(ftdm_span_t *span, uint8_t management cfg.hdr.entId.inst = S_INST; cfg.hdr.elmId.elmnt = STDLSAP; - cfg.t.cfg.s.bdDLSAP.lnkNmb = signal_data->link_id; + cfg.t.cfg.s.bdDLSAP.lnkNmb = signal_data->dchan_id; cfg.t.cfg.s.bdDLSAP.n201 = 1028; /* n201 */ if (span->trunk_type == FTDM_TRUNK_BRI_PTMP || @@ -613,9 +614,9 @@ ftdm_status_t sngisdn_stack_cfg_q931_dlsap(ftdm_span_t *span) cfg.hdr.response.selector=0; + cfg.t.cfg.s.inDLSAP.sapId = signal_data->dchan_id; + cfg.t.cfg.s.inDLSAP.spId = signal_data->dchan_id; - cfg.t.cfg.s.inDLSAP.sapId = signal_data->link_id; - cfg.t.cfg.s.inDLSAP.spId = signal_data->link_id; cfg.t.cfg.s.inDLSAP.swtch = sng_isdn_stack_switchtype(signal_data->switchtype); cfg.t.cfg.s.inDLSAP.n201 = 1024; @@ -876,8 +877,7 @@ ftdm_status_t sngisdn_stack_cfg_q931_lce(ftdm_span_t *span) cfg.hdr.response.selector=0; - cfg.t.cfg.s.inLCe.sapId = signal_data->link_id; - + cfg.t.cfg.s.inLCe.sapId = signal_data->dchan_id; cfg.t.cfg.s.inLCe.lnkUpDwnInd = TRUE; cfg.t.cfg.s.inLCe.tCon.enb = TRUE; diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_cntrl.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_cntrl.c index 225244f57e..2023f4c54c 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_cntrl.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_cntrl.c @@ -146,7 +146,8 @@ ftdm_status_t sngisdn_deactivate_phy(ftdm_span_t *span) cntrl.t.cntrl.action = AUBND_DIS; cntrl.t.cntrl.subAction = SAELMNT; - cntrl.t.cntrl.sapId = signal_data->link_id; + + cntrl.t.cntrl.sapId = signal_data->dchan_id; if (sng_isdn_phy_cntrl(&pst, &cntrl)) { return FTDM_FAIL; @@ -180,7 +181,8 @@ ftdm_status_t sngisdn_wake_up_phy(ftdm_span_t *span) cntrl.t.cntrl.action = AENA; cntrl.t.cntrl.subAction = SAELMNT; - cntrl.t.cntrl.sapId = signal_data->link_id; + + cntrl.t.cntrl.sapId = signal_data->dchan_id; if (sng_isdn_phy_cntrl(&pst, &cntrl)) { return FTDM_FAIL; @@ -298,7 +300,8 @@ ftdm_status_t sngisdn_cntrl_q931(ftdm_span_t *span, uint8_t action, uint8_t suba if (action == AENA && subaction == SATRC) { cntrl.t.cntrl.trcLen = -1; /* Trace the entire message buffer */ } - cntrl.t.cntrl.sapId = signal_data->link_id; + + cntrl.t.cntrl.sapId = signal_data->dchan_id; cntrl.t.cntrl.ces = 0; if(sng_isdn_q931_cntrl(&pst, &cntrl)) { @@ -339,11 +342,11 @@ ftdm_status_t sngisdn_cntrl_q921(ftdm_span_t *span, uint8_t action, uint8_t suba cntrl.t.cntrl.subAction = subaction; #if (SMBD_LMINT3 || BD_LMINT3) - cntrl.t.cntrl.lnkNmb = signal_data->link_id; + cntrl.t.cntrl.lnkNmb = signal_data->dchan_id; cntrl.t.cntrl.sapi = NOTUSED; cntrl.t.cntrl.tei = NOTUSED; #else /* _LMINT3 */ - cntrl.hdr.elmId.elmntInst1 = signal_data->link_id; + cntrl.hdr.elmId.elmntInst1 = signal_data->dchan_id; cntrl.hdr.elmId.elmntInst2 = NOTUSED; cntrl.hdr.elmId.elmntInst3 = NOTUSED; #endif /* _LMINT3 */ diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c index 9b4b7872c4..4b27f21e1c 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c @@ -491,8 +491,8 @@ void sngisdn_snd_data(ftdm_channel_t *dchan, uint8_t *data, ftdm_size_t len) /* Should we trigger congestion here? */ l1_frame.flags |= SNG_L1FRAME_QUEUE_FULL; } - - sng_isdn_data_ind(signal_data->link_id, &l1_frame); + + sng_isdn_data_ind(signal_data->dchan_id, &l1_frame); } void sngisdn_snd_event(ftdm_channel_t *dchan, ftdm_oob_event_t event) @@ -506,11 +506,11 @@ void sngisdn_snd_event(ftdm_channel_t *dchan, ftdm_oob_event_t event) switch(event) { case FTDM_OOB_ALARM_CLEAR: l1_event.type = SNG_L1EVENT_ALARM_OFF; - sng_isdn_event_ind(signal_data->link_id, &l1_event); + sng_isdn_event_ind(signal_data->dchan_id, &l1_event); break; case FTDM_OOB_ALARM_TRAP: l1_event.type = SNG_L1EVENT_ALARM_ON; - sng_isdn_event_ind(signal_data->link_id, &l1_event); + sng_isdn_event_ind(signal_data->dchan_id, &l1_event); break; default: /* We do not care about the other OOB events for now */ diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_rcv.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_rcv.c index a90968f64b..791b65f0f6 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_rcv.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_rcv.c @@ -662,7 +662,9 @@ void sngisdn_rcv_phy_ind(SuId suId, Reason reason) void sngisdn_rcv_q921_ind(BdMngmt *status) { ftdm_span_t *ftdmspan; - sngisdn_span_data_t *signal_data = g_sngisdn_data.spans[status->t.usta.lnkNmb]; + + sngisdn_span_data_t *signal_data = g_sngisdn_data.dchans[status->t.usta.lnkNmb].spans[1]; + if (!signal_data) { ftdm_log(FTDM_LOG_INFO, "Received q921 status on unconfigured span (lnkNmb:%d)\n", status->t.usta.lnkNmb); return; @@ -715,7 +717,7 @@ void sngisdn_rcv_q931_ind(InMngmt *status) case LCM_EVENT_DOWN: { ftdm_span_t *ftdmspan; - sngisdn_span_data_t *signal_data = g_sngisdn_data.spans[status->t.usta.suId]; + sngisdn_span_data_t *signal_data = g_sngisdn_data.dchans[status->t.usta.suId].spans[1]; if (!signal_data) { ftdm_log(FTDM_LOG_INFO, "Received q931 status on unconfigured span (lnkNmb:%d)\n", status->t.usta.suId); return; @@ -784,7 +786,8 @@ void sngisdn_rcv_q931_trace(InMngmt *trc, Buffer *mBuf) uint8_t data; ftdm_trace_dir_t dir; uint8_t tdata[1000]; - sngisdn_span_data_t *signal_data = g_sngisdn_data.spans[trc->t.trc.suId]; + + sngisdn_span_data_t *signal_data = g_sngisdn_data.dchans[trc->t.trc.suId].spans[1]; ftdm_assert(mBuf != NULLP, "Received a Q931 trace with no buffer"); mlen = ((SsMsgInfo*)(mBuf->b_rptr))->len; @@ -830,7 +833,8 @@ void sngisdn_rcv_q921_trace(BdMngmt *trc, Buffer *mBuf) uint8_t data; ftdm_trace_dir_t dir; uint8_t tdata[1000]; - sngisdn_span_data_t *signal_data = g_sngisdn_data.spans[trc->t.trc.lnkNmb]; + + sngisdn_span_data_t *signal_data = g_sngisdn_data.dchans[trc->t.trc.lnkNmb].spans[1]; if (trc->t.trc.evnt == TL2TMR) { return; @@ -879,7 +883,7 @@ int16_t sngisdn_rcv_l1_data_req(uint16_t spId, sng_l1_frame_t *l1_frame) { ftdm_status_t status; ftdm_wait_flag_t flags = FTDM_WRITE; - sngisdn_span_data_t *signal_data = g_sngisdn_data.spans[spId]; + sngisdn_span_data_t *signal_data = g_sngisdn_data.dchans[spId].spans[1]; ftdm_size_t length = l1_frame->len; ftdm_assert(signal_data, "Received Data request on unconfigured span\n"); @@ -912,8 +916,8 @@ int16_t sngisdn_rcv_l1_data_req(uint16_t spId, sng_l1_frame_t *l1_frame) } int16_t sngisdn_rcv_l1_cmd_req(uint16_t spId, sng_l1_cmd_t *l1_cmd) -{ - sngisdn_span_data_t *signal_data = g_sngisdn_data.spans[spId]; +{ + sngisdn_span_data_t *signal_data = g_sngisdn_data.dchans[spId].spans[1]; ftdm_assert(signal_data, "Received Data request on unconfigured span\n"); switch(l1_cmd->type) { From 33bb9b834d4a563413e52b6010de8fe7555716d3 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Fri, 14 Jan 2011 10:48:09 -0500 Subject: [PATCH 22/23] freetdm - ISDN Allowed state change from RING to PROGRESS_MEDIA --- libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.c index f1e0bf45ce..f2afd1cf9c 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.c @@ -120,7 +120,7 @@ ftdm_state_map_t sangoma_isdn_state_map = { ZSD_INBOUND, ZSM_UNACCEPTABLE, {FTDM_CHANNEL_STATE_RING, FTDM_END}, - {FTDM_CHANNEL_STATE_TERMINATING, FTDM_CHANNEL_STATE_HANGUP, FTDM_CHANNEL_STATE_PROCEED, FTDM_CHANNEL_STATE_RINGING, FTDM_CHANNEL_STATE_PROGRESS, FTDM_END} + {FTDM_CHANNEL_STATE_TERMINATING, FTDM_CHANNEL_STATE_HANGUP, FTDM_CHANNEL_STATE_PROCEED, FTDM_CHANNEL_STATE_RINGING, FTDM_CHANNEL_STATE_PROGRESS, FTDM_CHANNEL_STATE_PROGRESS_MEDIA, FTDM_END} }, { ZSD_INBOUND, From 4ee4c67003b7b0159ae5b980dc1ae1fb7a335f5d Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Fri, 14 Jan 2011 12:52:37 -0500 Subject: [PATCH 23/23] Removed unused SIGEVENT --- libs/freetdm/src/include/freetdm.h | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/freetdm/src/include/freetdm.h b/libs/freetdm/src/include/freetdm.h index 121aa18bf7..50ceee4267 100644 --- a/libs/freetdm/src/include/freetdm.h +++ b/libs/freetdm/src/include/freetdm.h @@ -394,7 +394,6 @@ typedef enum { FTDM_SIGEVENT_ADD_CALL, /*!< New call should be added to the channel */ FTDM_SIGEVENT_RESTART, /*!< Restart has been requested. Typically you hangup your call resources here */ FTDM_SIGEVENT_SIGSTATUS_CHANGED, /*!< Signaling protocol status changed (ie: D-chan up), see new status in raw_data ftdm_sigmsg_t member */ - FTDM_SIGEVENT_COLLISION, /*!< Outgoing call was dropped because an incoming call arrived at the same time */ FTDM_SIGEVENT_FACILITY, /*!< In call facility event */ FTDM_SIGEVENT_TRACE, /*!