Merge branch 'master' into v1.4

Conflicts:
	debian/bootstrap.sh
	debian/util.sh
	docs/SubmittingPatches
	src/mod/endpoints/mod_verto/mod_verto.c
This commit is contained in:
Ken Rice 2014-12-29 12:59:51 -06:00
commit 507a0f22c5
12 changed files with 2256 additions and 2214 deletions

61
.clang-format Normal file
View File

@ -0,0 +1,61 @@
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
---
Language: Cpp
AccessModifierOffset: 0
AlignAfterOpenBracket: true
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: false
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Linux
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IndentCaseLabels: false
IndentFunctionDeclarationAfterType: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: Always
...

6
debian/bootstrap.sh vendored
View File

@ -9,7 +9,7 @@ fs_description="FreeSWITCH is a scalable open source cross-platform telephony pl
mod_build_depends="." mod_depends="." mod_recommends="." mod_suggests="."
supported_debian_distros="squeeze wheezy jessie sid"
supported_ubuntu_distros="trusty utopic"
supported_distros=" $supported_debian_distros $supported_ubuntu_distros "
supported_distros="$supported_debian_distros $supported_ubuntu_distros"
avoid_mods=(
applications/mod_limit
applications/mod_mongo
@ -285,9 +285,7 @@ list_freeswitch_all_dbg_replaces () {
print_source_control () {
local libtool_dep="libtool, libtool-bin"
case "$codename" in
squeeze|wheezy|trusty)
libtool_dep="libtool"
;;
squeeze|wheezy|trusty) libtool_dep="libtool" ;;
esac
cat <<EOF
Source: freeswitch

7
debian/rules vendored
View File

@ -20,6 +20,11 @@ export CFLAGS:=$(FS_CFLAGS)
export CXXFLAGS:=$(FS_CXXFLAGS)
export LDFLAGS:=$(FS_LDFLAGS)
NJOBS=1
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NJOBS=$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif
show_vars= \
echo; \
echo "Making target $@"; \
@ -91,7 +96,7 @@ override_dh_auto_configure: .stamp-configure
.stamp-build: .stamp-configure
@$(call show_vars)
make
make -j$(NJOBS)
touch $@
override_dh_auto_build: .stamp-build

25
debian/util.sh vendored
View File

@ -357,6 +357,16 @@ build_debs () {
echo ${dsc%.dsc}_${arch}.changes
}
default_distros () {
local host_distro="Debian"
test -z "$(which lsb_release)" || host_distro="$(lsb_release -is)"
case "$host_distro" in
Debian) echo "sid jessie wheezy" ;;
Ubuntu) echo "utopic trusty" ;;
*) err "Unknown host distribution \"$host_distro\"" ;;
esac
}
build_all () {
local OPTIND OPTARG
local orig_opts="" dsc_opts="" deb_opts="" modlist=""
@ -385,20 +395,7 @@ build_all () {
done
shift $(($OPTIND-1))
[ -n "$archs" ] || archs="amd64 i386"
if [ -z "$distros" ]; then
case "$(lsb_release -is)" in
Debian)
distros="sid jessie wheezy"
;;
Ubuntu)
distros="utopic trusty"
;;
*)
echo "Unknown distribution"
exit -1
;;
esac
fi
[ -n "$distros" ] || distros="$(default_distros)"
! $depinst || aptitude install -y \
rsync git less cowbuilder ccache \
devscripts equivs build-essential

View File

@ -45,7 +45,7 @@ Create a Pull Request
# navigate to FreeSWITCH Stash
chromium https://freeswitch.org/stash
# Using the saem credentials as Jira, login to Stash; create a forked FS repository; read
# Using the same credentials as Jira, login to Stash; create a forked FS repository; read
# the details here:
chromium https://freeswitch.org/confluence/display/FREESWITCH/Pull+Requests
@ -214,4 +214,4 @@ Finally, feel free to join us in our weekly conference call. Many of
the core developers are often on the call and you'll have an
opportunity at the beginning or end of the call to ask your questions:
> https://wiki.freeswitch.org/wiki/Weekly_Conference_Call
> https://freeswitch.org/confluence/display/FREESWITCH/ClueCon+Weekly+Conference+call

File diff suppressed because it is too large Load Diff

View File

@ -763,7 +763,7 @@ case EXPR_NODEFUNC_CLAMP:
err = exprEvalNode(obj, nodes->data.function.nodes, 1, &d1);
if (!err)
err = exprEvalNode(obj, nodes->data.function.nodes, 1, &d2);
err = exprEvalNode(obj, nodes->data.function.nodes, 2, &d2);
if (!err) {
EXPR_RESET_ERR();
@ -771,7 +771,7 @@ case EXPR_NODEFUNC_CLAMP:
EXPR_CHECK_ERR();
if (tmp < 0.0)
*val = tmp * d2;
*val = tmp + d2;
else
*val = tmp + d1;
} else

File diff suppressed because it is too large Load Diff

View File

@ -283,7 +283,7 @@ SWITCH_STANDARD_API(memcache_function)
val = memcached_get(memcached, key, strlen(key), &string_length, &flags, &rc);
if (rc == MEMCACHED_SUCCESS) {
stream->write_function(stream, "%.*s", (int) string_length, val);
stream->raw_write_function(stream, (uint8_t*)val, (int)string_length);
} else {
switch_safe_free(val);
switch_goto_status(SWITCH_STATUS_SUCCESS, mcache_error);

View File

@ -1518,7 +1518,7 @@ new_req:
!strncmp(request.content_type, "application/x-www-form-urlencoded", 33)) {
char *buffer = NULL;
switch_size_t len = 0, bytes = 0;
switch_ssize_t len = 0, bytes = 0;
if (request.content_length > 2 * 1024 * 1024 - 1) {
char *data = "HTTP/1.1 413 Request Entity Too Large\r\n"
@ -1538,8 +1538,8 @@ new_req:
while(bytes < request.content_length) {
len = request.content_length - bytes;
if ((switch_ssize_t)(len = ws_raw_read(&jsock->ws, buffer + bytes, len, jsock->ws.block)) < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Read error %" SWITCH_SIZE_T_FMT"\n", len);
if ((len = ws_raw_read(&jsock->ws, buffer + bytes, len, jsock->ws.block)) < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Read error %" SWITCH_SSIZE_T_FMT"\n", len);
goto done;
}

View File

@ -54,13 +54,10 @@ struct sndfile_context {
typedef struct sndfile_context sndfile_context;
static switch_status_t sndfile_perform_open(sndfile_context *context, const char *path, const char *mask, int mode);
static switch_status_t sndfile_file_open(switch_file_handle_t *handle, const char *path)
{
sndfile_context *context;
int mode = 0;
const char *mask = "rb";
char *ext;
struct format_map *map = NULL;
switch_status_t status = SWITCH_STATUS_SUCCESS;
@ -87,10 +84,8 @@ static switch_status_t sndfile_file_open(switch_file_handle_t *handle, const cha
if (switch_test_flag(handle, SWITCH_FILE_FLAG_WRITE)) {
if (switch_test_flag(handle, SWITCH_FILE_WRITE_APPEND) || switch_test_flag(handle, SWITCH_FILE_WRITE_OVER) || handle->offset_pos) {
mask = "ab+";
mode += SFM_RDWR;
} else {
mask = "wb+";
mode += SFM_WRITE;
}
}
@ -186,7 +181,7 @@ static switch_status_t sndfile_file_open(switch_file_handle_t *handle, const cha
ldup = strdup(last);
switch_assert(ldup);
switch_snprintf(last, alt_len - (last - alt_path), "%d%s%s", handle->samplerate, SWITCH_PATH_SEPARATOR, ldup);
if (sndfile_perform_open(context, alt_path, mask, mode) == SWITCH_STATUS_SUCCESS) {
if ((context->handle = sf_open(alt_path, mode, &context->sfinfo))) {
path = alt_path;
} else {
/* Try to find the file at the highest rate possible if we can't find one that matches the exact rate.
@ -194,7 +189,7 @@ static switch_status_t sndfile_file_open(switch_file_handle_t *handle, const cha
*/
for (i = 3; i >= 0; i--) {
switch_snprintf(last, alt_len - (last - alt_path), "%d%s%s", rates[i], SWITCH_PATH_SEPARATOR, ldup);
if (sndfile_perform_open(context, alt_path, mask, mode) == SWITCH_STATUS_SUCCESS) {
if ((context->handle = sf_open(alt_path, mode, &context->sfinfo))) {
path = alt_path;
break;
}
@ -203,7 +198,7 @@ static switch_status_t sndfile_file_open(switch_file_handle_t *handle, const cha
}
if (!context->handle) {
if (sndfile_perform_open(context, path, mask, mode) != SWITCH_STATUS_SUCCESS) {
if ((context->handle = sf_open(path, mode, &context->sfinfo)) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening File [%s] [%s]\n", path, sf_strerror(context->handle));
status = SWITCH_STATUS_GENERR;
goto end;
@ -241,20 +236,6 @@ static switch_status_t sndfile_file_open(switch_file_handle_t *handle, const cha
return status;
}
static switch_status_t sndfile_perform_open(sndfile_context *context, const char *path, const char *mask, int mode)
{
FILE *fd = NULL;
fd = fopen(path, mask);
if (!fd) {
return SWITCH_STATUS_FALSE;
}
if ((context->handle = sf_open_fd(fileno(fd), mode, &context->sfinfo, SWITCH_TRUE)) == 0) {
fclose(fd);
return SWITCH_STATUS_FALSE;
}
return SWITCH_STATUS_SUCCESS;
}
static switch_status_t sndfile_file_truncate(switch_file_handle_t *handle, int64_t offset)
{
sndfile_context *context = handle->private_info;

View File

@ -1789,7 +1789,7 @@ static void *SWITCH_THREAD_FUNC early_thread_run(switch_thread_t *thread, void *
switch_core_session_set_read_codec(session, &read_codecs[i]);
}
status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0);
if (SWITCH_READ_ACCEPTABLE(status)) {
if (SWITCH_READ_ACCEPTABLE(status) && !switch_test_flag(read_frame, SFF_CNG)) {
data = (int16_t *) read_frame->data;
if (datalen < read_frame->datalen) {
datalen = read_frame->datalen;
@ -1802,7 +1802,7 @@ static void *SWITCH_THREAD_FUNC early_thread_run(switch_thread_t *thread, void *
}
} else {
status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0);
if (SWITCH_READ_ACCEPTABLE(status)) {
if (SWITCH_READ_ACCEPTABLE(status) && !switch_test_flag(read_frame, SFF_CNG)) {
datalen = read_frame->datalen;
}
break;
@ -3239,7 +3239,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
silence = 600;
}
if ((ringback.fh || silence || ringback.audio_buffer || oglobals.bridge_early_media > -1) && write_frame.codec && write_frame.datalen) {
if ((ringback.fh || silence || ringback.audio_buffer || oglobals.bridge_early_media > -1) && write_frame.codec && write_frame.codec->implementation && write_frame.datalen) {
if (silence) {
write_frame.datalen = read_impl.decoded_bytes_per_packet;
switch_generate_sln_silence((int16_t *) write_frame.data, write_frame.datalen / 2, write_frame.codec->implementation->number_of_channels, silence);