Merge branch 'master' into smgmaster

This commit is contained in:
Moises Silva
2011-07-29 16:50:22 -04:00
398 changed files with 38757 additions and 4041 deletions
+2 -2
View File
@@ -84,7 +84,6 @@
#define SWITCH_EVENT_QUEUE_LEN 256
#define SWITCH_MESSAGE_QUEUE_LEN 256
#define SWITCH_SQL_QUEUE_LEN 100000
#define SWITCH_BUFFER_BLOCK_FRAMES 25
#define SWITCH_BUFFER_START_FRAMES 50
@@ -145,6 +144,7 @@ struct switch_core_session {
void *private_info;
switch_queue_t *event_queue;
switch_queue_t *message_queue;
switch_queue_t *signal_data_queue;
switch_queue_t *private_event_queue;
switch_queue_t *private_event_queue_pri;
switch_thread_rwlock_t *bug_rwlock;
@@ -220,7 +220,7 @@ struct switch_runtime {
switch_mutex_t *throttle_mutex;
switch_mutex_t *session_hash_mutex;
switch_mutex_t *global_mutex;
switch_mutex_t *global_var_mutex;
switch_thread_rwlock_t *global_var_rwlock;
uint32_t sps_total;
int32_t sps;
int32_t sps_last;
+6 -2
View File
@@ -50,6 +50,8 @@ SWITCH_BEGIN_EXTERN_C struct switch_channel_timetable {
switch_time_t transferred;
switch_time_t resurrected;
switch_time_t bridged;
switch_time_t last_hold;
switch_time_t hold_accum;
struct switch_channel_timetable *next;
};
@@ -70,6 +72,7 @@ typedef struct switch_channel_timetable switch_channel_timetable_t;
*/
SWITCH_DECLARE(switch_channel_state_t) switch_channel_get_state(switch_channel_t *channel);
SWITCH_DECLARE(switch_channel_state_t) switch_channel_get_running_state(switch_channel_t *channel);
SWITCH_DECLARE(int) switch_channel_check_signal(switch_channel_t *channel, switch_bool_t in_thread_only);
/*!
\brief Determine if a channel is ready for io
@@ -82,8 +85,8 @@ SWITCH_DECLARE(int) switch_channel_test_ready(switch_channel_t *channel, switch_
#define switch_channel_media_ready(_channel) switch_channel_test_ready(_channel, SWITCH_TRUE, SWITCH_TRUE)
#define switch_channel_media_up(_channel) (switch_channel_test_flag(_channel, CF_ANSWERED) || switch_channel_test_flag(_channel, CF_EARLY_MEDIA))
#define switch_channel_up(_channel) (switch_channel_get_state(_channel) < CS_HANGUP)
#define switch_channel_down(_channel) (switch_channel_get_state(_channel) >= CS_HANGUP)
#define switch_channel_up(_channel) (switch_channel_check_signal(_channel, SWITCH_TRUE) || switch_channel_get_state(_channel) < CS_HANGUP)
#define switch_channel_down(_channel) (switch_channel_check_signal(_channel, SWITCH_TRUE) || switch_channel_get_state(_channel) >= CS_HANGUP)
#define switch_channel_media_ack(_channel) (!switch_channel_test_cap(_channel, CC_MEDIA_ACK) || switch_channel_test_flag(_channel, CF_MEDIA_ACK))
SWITCH_DECLARE(void) switch_channel_wait_for_state(switch_channel_t *channel, switch_channel_t *other_channel, switch_channel_state_t want_state);
@@ -123,6 +126,7 @@ SWITCH_DECLARE(switch_call_cause_t) switch_channel_get_cause(_In_ switch_channel
SWITCH_DECLARE(switch_call_cause_t) switch_channel_cause_q850(switch_call_cause_t cause);
SWITCH_DECLARE(switch_call_cause_t) switch_channel_get_cause_q850(switch_channel_t *channel);
SWITCH_DECLARE(switch_call_cause_t *) switch_channel_get_cause_ptr(switch_channel_t *channel);
/*!
\brief return a cause string for a given cause
+4
View File
@@ -835,6 +835,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_queue_message(_In_ switch_co
SWITCH_DECLARE(void) switch_core_session_free_message(switch_core_session_message_t **message);
SWITCH_DECLARE(switch_status_t) switch_core_session_queue_signal_data(switch_core_session_t *session, void *signal_data);
SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_signal_data(switch_core_session_t *session, void **signal_data);
/*!
\brief pass an indication message on a session
\param session the session to pass the message across
+1 -1
View File
@@ -110,7 +110,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(_In_ switch_core_session_
SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_events(switch_core_session_t *session);
SWITCH_DECLARE(switch_status_t) switch_ivr_parse_next_event(switch_core_session_t *session);
SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_messages(switch_core_session_t *session);
SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_signal_data(switch_core_session_t *session);
/*!
\brief Wait for time to pass for a specified number of milliseconds
\param session the session to wait for.
+5 -1
View File
@@ -438,7 +438,11 @@ static inline void switch_core_codec_add_implementation(switch_memory_pool_t *po
/*! deinitalize a codec handle using this implementation */
switch_core_codec_destroy_func_t destroy)
{
if (codec_type == SWITCH_CODEC_TYPE_VIDEO || switch_check_interval(actual_samples_per_second, microseconds_per_packet / 1000)) {
if (decoded_bytes_per_packet > SWITCH_RECOMMENDED_BUFFER_SIZE) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Rejected codec name: %s rate: %u ptime: %u not enough buffer space %d > %d\n",
iananame, actual_samples_per_second, microseconds_per_packet / 1000, decoded_bytes_per_packet, SWITCH_RECOMMENDED_BUFFER_SIZE);
} else if (codec_type == SWITCH_CODEC_TYPE_VIDEO || switch_check_interval(actual_samples_per_second, microseconds_per_packet / 1000)) {
switch_codec_implementation_t *impl = (switch_codec_implementation_t *) switch_core_alloc(pool, sizeof(*impl));
impl->codec_type = codec_type;
impl->ianacode = ianacode;
+3
View File
@@ -112,6 +112,9 @@ typedef int gid_t;
#else
/* packed attribute */
#if (defined __SUNPRO_CC) || defined(__SUNPRO_C)
#define PACKED
#endif
#ifndef PACKED
#define PACKED __attribute__ ((__packed__))
#endif
+7 -1
View File
@@ -799,6 +799,7 @@ typedef enum {
SWITCH_MESSAGE_INDICATE_CLEAR_PROGRESS,
SWITCH_MESSAGE_INDICATE_JITTER_BUFFER,
SWITCH_MESSAGE_INDICATE_RECOVERY_REFRESH,
SWITCH_MESSAGE_INDICATE_SIGNAL_DATA,
SWITCH_MESSAGE_INVALID
} switch_core_session_message_types_t;
@@ -1113,6 +1114,8 @@ typedef enum {
CF_CNG_PLC,
CF_ATTENDED_TRANSFER,
CF_LAZY_ATTENDED_TRANSFER,
CF_SIGNAL_DATA,
CF_SIMPLIFY,
/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
CF_FLAG_MAX
} switch_channel_flag_t;
@@ -1620,7 +1623,9 @@ typedef enum {
SCSC_CRASH,
SCSC_MIN_IDLE_CPU,
SCSC_VERBOSE_EVENTS,
SCSC_SHUTDOWN_CHECK
SCSC_SHUTDOWN_CHECK,
SCSC_PAUSE_CHECK,
SCSC_READY_CHECK
} switch_session_ctl_t;
typedef enum {
@@ -1810,6 +1815,7 @@ typedef switch_status_t (*switch_new_say_callback_t) (switch_say_file_handle_t *
typedef struct switch_xml *switch_xml_t;
typedef struct switch_core_time_duration switch_core_time_duration_t;
typedef switch_xml_t(*switch_xml_open_root_function_t) (uint8_t reload, const char **err, void *user_data);
typedef switch_xml_t(*switch_xml_search_function_t) (const char *section,
const char *tag_name, const char *key_name, const char *key_value, switch_event_t *params,
void *user_data);
+6
View File
@@ -320,6 +320,12 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_insert(_In_ switch_xml_t xml, _In_ switc
///\brief removes a tag along with all its subtags
#define switch_xml_remove(xml) switch_xml_free(switch_xml_cut(xml))
///\brief set new core xml root
SWITCH_DECLARE(switch_status_t) switch_xml_set_root(switch_xml_t new_main);
///\brief Set and alternate function for opening xml root
SWITCH_DECLARE(switch_status_t) switch_xml_set_open_root_function(switch_xml_open_root_function_t func, void *user_data);
///\brief open the Core xml root
///\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
+93
View File
@@ -0,0 +1,93 @@
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2011, Anthony Minessale II <anthm@freeswitch.org>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
*
* The Initial Developer of the Original Code is
* Anthony Minessale II <anthm@freeswitch.org>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Anthony Minessale II <anthm@freeswitch.org>
*
* timerfd_wrap.h -- timerfd syscall wrapper
*
*/
/*! \file timerfd_wrap.h
\brief timerfd syscall wrapper
*/
#ifndef TIMERFD_WRAP_H
#define TIMERFD_WRAP_H
SWITCH_BEGIN_EXTERN_C
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/signal.h>
#include <sys/time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <poll.h>
#include <fcntl.h>
#include <time.h>
#include <errno.h>
#ifndef __NR_timerfd
#if defined(__x86_64__)
#define __NR_timerfd_create 283
#define __NR_timerfd_settime 286
#define __NR_timerfd_gettime 287
#elif defined(__i386__)
#define __NR_timerfd_create 322
#define __NR_timerfd_settime 325
#define __NR_timerfd_gettime 326
#else
#error invalid system
#endif
#endif
#define TFD_TIMER_ABSTIME (1 << 0)
int timerfd_create(int clockid, int flags)
{
return syscall(__NR_timerfd_create, clockid, flags);
}
int timerfd_settime(int ufc, int flags, const struct itimerspec *utmr, struct itimerspec *otmr)
{
return syscall(__NR_timerfd_settime, ufc, flags, utmr, otmr);
}
int timerfd_gettime(int ufc, struct itimerspec *otmr)
{
return syscall(__NR_timerfd_gettime, ufc, otmr);
}
SWITCH_END_EXTERN_C
#endif