Merge branch 'master' of ssh://git.freeswitch.org:222/freeswitch

This commit is contained in:
Chris Rienzo 2014-02-21 15:27:40 -05:00
commit 36f1e5e2bb
6 changed files with 186 additions and 22 deletions

2
docs/man/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.1
*.html

155
docs/man/freeswitch.1.ronn Normal file
View File

@ -0,0 +1,155 @@
freeswitch(1) -- scalable multi-protocol softswitch
===================================================
## SYNOPSIS
`freeswitch` [<options>]
## DESCRIPTION
`freeswitch` is a high-performance softswitch that supports many kinds
of telephony applications. It's commonly used as a PBX with SIP
endpoints.
`freeswitch` expects a set of configuration files to exist in
/etc/freeswitch. Example configurations can be found in
/usr/share/freeswitch/conf.
`freeswitch` is a modular system and modules can be loaded at runtime.
`freeswitch` is started in the foreground by default but can also be
started as a daemon.
## OPTIONS
* `-h`:
Show inline help.
* `-version`:
Print the version and exit.
* `-nf`:
Stay in the foreground (default unless `-nc` is specified).
* `-reincarnate`:
Restart the switch in the event of an uncontrolled exit.
* `-reincarnate-reexec`:
Like `-reincarnate` but cause the switch binary to be run again
with execv.
* `-u` <user>:
Run setuid after starting the switch.
* `-g` <group>:
Run setgid after starting the switch.
* `-core`:
Cause the switch to dump a core when crashing; you'll need to
ensure your system ulimits allow this, and if you've set `-u` or
`-g` you may also need to run:
sysctl -w fs.suid_dumpable=1
* `-rp`:
Enable realtime priority.
* `-lp`:
Enable low priority.
* `-np`:
Enable normal priority.
* `-vg`:
Run under Valgrind.
* `-nosql`:
Disable the use of SQL for internal switch operations.
* `-heavy-timer`:
Use a more expensive system timer that may be more accurate, but
note this may also impose heavier loads on your system.
* `-nonat`:
When the switch starts, it runs checks to determine if it is
behind NAT; this flag disables these checks.
* `-nonatmap`:
Disable automatic NAT port mapping.
* `-nocal`:
When the switch starts, it calibrates itself to deviations in the
system clock; this flag disables this calibration.
* `-nort`:
Disable use of clock_realtime.
* `-stop`:
Stop the switch if running in the background.
* `-nc`:
Disable the interactive console and cause the switch to go into
the background unless `-nf` is also specified.
* `-ncwait`:
Like `-nc` but cause the parent process to wait until the switch
is started before exiting.
* `-c`:
Enable the interactive console and stay in the foreground (this is
the default).
* `-base` <basedir>:
Set the prefix directory.
* `-cfgname` <filename>:
Set the pathname to the main configuration file.
* `-conf` <directory>:
Set the directory for configuration files.
* `-log` <directory>:
Set the directory for log files.
* `-run` <directory>:
Set the directory for temporary runtime files.
* `-db` <directory>:
Set the directory for internal database files.
* `-mod` <directory>:
Set the directory for runtime modules.
* `-htdocs` <directory>:
Set the directory for htdocs.
* `-scripts` <directory>:
Set the directory for call control scripts.
* `-temp` <directory>:
Set the directory for temporary files.
* `-grammar` <directory>:
Set the directory for grammar files.
* `-recordings` <directory>:
Set the directory for call recordings.
* `-storage` <directory>:
Set the directory for voicemail storage.
* `-sounds` <directory>:
Set the directory for sound files.
## AUTHORS
FreeSWITCH was originally developed by `Anthony Minessale II
<anthm@freeswitch.org>` with continued development by Anthony and a
team of active contributors.
This man page and the packaging for Debian was written by `Travis
Cross <tc@traviscross.com>`.
## SEE ALSO
sysctl(8), ulimit(1posix)

View File

@ -238,7 +238,7 @@ enum {
};
#define ALIGNMENT (8)
#define ALIGN(n) (size_t)(((n) + (ALIGNMENT - 1)) & (size_t)~(ALIGNMENT - 1))
#define __ALIGN(n) (size_t)(((n) + (ALIGNMENT - 1)) & (size_t)~(ALIGNMENT - 1))
#define SIZEBITS (sizeof (unsigned) * 8 - 1)
typedef struct {
@ -478,7 +478,7 @@ void *sub_alloc(su_home_t *home,
sub->sub_preload && size <= sub->sub_prsize) {
/* Use preloaded memory */
size_t prused = sub->sub_prused + size + MEMCHECK_EXTRA;
prused = ALIGN(prused);
prused = __ALIGN(prused);
if (prused <= sub->sub_prsize) {
preload = (char *)sub->sub_preload + sub->sub_prused;
sub->sub_prused = (unsigned)prused;
@ -1313,7 +1313,7 @@ void su_home_preload(su_home_t *home, isize_t n, isize_t isize)
size_t size;
void *preload;
size = n * ALIGN(isize);
size = n * __ALIGN(isize);
if (size > 65535) /* We have 16 bits... */
size = 65535 & (ALIGNMENT - 1);
@ -1334,13 +1334,13 @@ su_home_t *su_home_auto(void *area, isize_t size)
{
su_home_t *home;
su_block_t *sub;
size_t homesize = ALIGN(sizeof *home);
size_t subsize = ALIGN(offsetof(su_block_t, sub_nodes[SUB_N_AUTO]));
size_t homesize = __ALIGN(sizeof *home);
size_t subsize = __ALIGN(offsetof(su_block_t, sub_nodes[SUB_N_AUTO]));
size_t prepsize;
char *p = area;
prepsize = homesize + subsize + (ALIGN((intptr_t)p) - (intptr_t)p);
prepsize = homesize + subsize + (__ALIGN((intptr_t)p) - (intptr_t)p);
if (area == NULL || size < prepsize)
return NULL;
@ -1443,11 +1443,11 @@ void *su_realloc(su_home_t *home, void *data, isize_t size)
p = (char *)data - home->suh_blocks->sub_preload;
p += sua->sua_size + MEMCHECK_EXTRA;
p = ALIGN(p);
p = __ALIGN(p);
if (p == sub->sub_prused) {
size_t p2 = (char *)data - sub->sub_preload + size + MEMCHECK_EXTRA;
p2 = ALIGN(p2);
p2 = __ALIGN(p2);
if (p2 <= sub->sub_prsize) {
/* Extend/reduce existing preload */
if (sub->sub_stats) {
@ -1840,7 +1840,7 @@ void su_home_stats_alloc(su_block_t *sub, void *p, void *preload,
{
su_home_stat_t *hs = sub->sub_stats;
size_t rsize = ALIGN(size);
size_t rsize = __ALIGN(size);
hs->hs_rehash += (sub->sub_n != hs->hs_blocksize);
hs->hs_blocksize = sub->sub_n;
@ -1869,7 +1869,7 @@ void su_home_stats_free(su_block_t *sub, void *p, void *preload,
{
su_home_stat_t *hs = sub->sub_stats;
size_t rsize = ALIGN(size);
size_t rsize = __ALIGN(size);
if (preload) {
hs->hs_frees.hsf_preload++;

View File

@ -393,7 +393,7 @@ octet_string_set_to_zero(uint8_t *s, int len);
# define be64_to_cpu(x) bswap_64((x))
#else
#if defined(__GNUC__) && defined(HAVE_X86) && !defined(__FreeBSD__)
#if defined(__GNUC__) && defined(HAVE_X86) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
/* Fall back. */
static inline uint32_t be32_to_cpu(uint32_t v) {
/* optimized for x86. */

View File

@ -3160,6 +3160,10 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_hangup(switch_chan
}
switch_mutex_unlock(channel->state_mutex);
if (switch_channel_test_flag(channel, CF_LEG_HOLDING)) {
switch_channel_mark_hold(channel, SWITCH_FALSE);
}
if (!ok) {
return channel->state;
}

View File

@ -647,21 +647,24 @@ static void *audio_bridge_thread(switch_thread_t *thread, void *obj)
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session_a), SWITCH_LOG_DEBUG, "BRIDGE THREAD DONE [%s]\n", switch_channel_get_name(chan_a));
switch_channel_clear_flag(chan_a, CF_BRIDGED);
if (switch_channel_test_flag(chan_a, CF_LEG_HOLDING) && switch_channel_ready(chan_b) && switch_channel_get_state(chan_b) != CS_PARK) {
const char *ext = switch_channel_get_variable(chan_a, "hold_hangup_xfer_exten");
if (switch_channel_test_flag(chan_a, CF_LEG_HOLDING)) {
switch_channel_stop_broadcast(chan_b);
if (switch_channel_ready(chan_b) && switch_channel_get_state(chan_b) != CS_PARK) {
const char *ext = switch_channel_get_variable(chan_a, "hold_hangup_xfer_exten");
if (zstr(ext)) {
switch_call_cause_t cause = switch_channel_get_cause(chan_b);
if (cause == SWITCH_CAUSE_NONE) {
cause = SWITCH_CAUSE_NORMAL_CLEARING;
switch_channel_stop_broadcast(chan_b);
if (zstr(ext)) {
switch_call_cause_t cause = switch_channel_get_cause(chan_b);
if (cause == SWITCH_CAUSE_NONE) {
cause = SWITCH_CAUSE_NORMAL_CLEARING;
}
switch_channel_hangup(chan_b, cause);
} else {
switch_channel_set_variable(chan_b, SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE, ext);
}
switch_channel_hangup(chan_b, cause);
} else {
switch_channel_set_variable(chan_b, SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE, ext);
}
switch_channel_clear_flag(chan_a, CF_LEG_HOLDING);
switch_channel_mark_hold(chan_a, SWITCH_FALSE);
}
if (switch_channel_test_flag(chan_a, CF_INTERCEPTED)) {