Resolve conflict and reset automerge.

git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377980 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Michelson
2012-12-13 16:39:40 +00:00
parent 7b5f4748fb
commit ece4c95798
10 changed files with 936 additions and 1031 deletions

View File

@@ -13167,10 +13167,11 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int
- Then other codecs in capabilities, including video - Then other codecs in capabilities, including video
*/ */
/* Prefer the audio codec we were requested to use, first, no matter what
Note that p->prefcodec can include video codecs, so mask them out /* Unless otherwise configured, the prefcaps is added before the peer's
*/ * configured codecs.
if (ast_format_cap_has_joint(tmpcap, p->prefcaps)) { */
if (!ast_test_flag(&p->flags[2], SIP_PAGE3_IGNORE_PREFCAPS) && ast_format_cap_has_joint(tmpcap, p->prefcaps)) {
ast_format_cap_iter_start(p->prefcaps); ast_format_cap_iter_start(p->prefcaps);
while (!(ast_format_cap_iter_next(p->prefcaps, &tmp_fmt))) { while (!(ast_format_cap_iter_next(p->prefcaps, &tmp_fmt))) {
if (AST_FORMAT_GET_TYPE(tmp_fmt.id) != AST_FORMAT_TYPE_AUDIO) { if (AST_FORMAT_GET_TYPE(tmp_fmt.id) != AST_FORMAT_TYPE_AUDIO) {
@@ -30766,6 +30767,8 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
ast_set2_flag(&peer->flags[2], ast_true(v->value), SIP_PAGE3_USE_AVPF); ast_set2_flag(&peer->flags[2], ast_true(v->value), SIP_PAGE3_USE_AVPF);
} else if (!strcasecmp(v->name, "icesupport")) { } else if (!strcasecmp(v->name, "icesupport")) {
ast_set2_flag(&peer->flags[2], ast_true(v->value), SIP_PAGE3_ICE_SUPPORT); ast_set2_flag(&peer->flags[2], ast_true(v->value), SIP_PAGE3_ICE_SUPPORT);
} else if (!strcasecmp(v->name, "ignore_requested_pref")) {
ast_set2_flag(&peer->flags[2], ast_true(v->value), SIP_PAGE3_IGNORE_PREFCAPS);
} else { } else {
ast_rtp_dtls_cfg_parse(&peer->dtls_cfg, v->name, v->value); ast_rtp_dtls_cfg_parse(&peer->dtls_cfg, v->name, v->value);
} }

View File

@@ -373,10 +373,11 @@
#define SIP_PAGE3_DIRECT_MEDIA_OUTGOING (1 << 4) /*!< DP: Only send direct media reinvites on outgoing calls */ #define SIP_PAGE3_DIRECT_MEDIA_OUTGOING (1 << 4) /*!< DP: Only send direct media reinvites on outgoing calls */
#define SIP_PAGE3_USE_AVPF (1 << 5) /*!< DGP: Support a minimal AVPF-compatible profile */ #define SIP_PAGE3_USE_AVPF (1 << 5) /*!< DGP: Support a minimal AVPF-compatible profile */
#define SIP_PAGE3_ICE_SUPPORT (1 << 6) /*!< DGP: Enable ICE support */ #define SIP_PAGE3_ICE_SUPPORT (1 << 6) /*!< DGP: Enable ICE support */
#define SIP_PAGE3_IGNORE_PREFCAPS (1 << 7) /*!< DP: Ignore prefcaps when setting up an outgoing call leg */
#define SIP_PAGE3_FLAGS_TO_COPY \ #define SIP_PAGE3_FLAGS_TO_COPY \
(SIP_PAGE3_SNOM_AOC | SIP_PAGE3_SRTP_TAG_32 | SIP_PAGE3_NAT_AUTO_RPORT | SIP_PAGE3_NAT_AUTO_COMEDIA | \ (SIP_PAGE3_SNOM_AOC | SIP_PAGE3_SRTP_TAG_32 | SIP_PAGE3_NAT_AUTO_RPORT | SIP_PAGE3_NAT_AUTO_COMEDIA | \
SIP_PAGE3_DIRECT_MEDIA_OUTGOING | SIP_PAGE3_USE_AVPF | SIP_PAGE3_ICE_SUPPORT) SIP_PAGE3_DIRECT_MEDIA_OUTGOING | SIP_PAGE3_USE_AVPF | SIP_PAGE3_ICE_SUPPORT | SIP_PAGE3_IGNORE_PREFCAPS )
#define CHECK_AUTH_BUF_INITLEN 256 #define CHECK_AUTH_BUF_INITLEN 256

View File

@@ -1259,6 +1259,8 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
; dtlscafile ; dtlscafile
; dtlscapath ; dtlscapath
; dtlssetup ; dtlssetup
; ignore_requested_pref ; Ignore the requested codec and determine the preferred codec
; ; from the peer's configuration.
; ;
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------

1886
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -494,7 +494,7 @@ AST_EXT_LIB_CHECK([TERMCAP], [termcap], [tgetent], [])
AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], []) AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], [])
AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h]) AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h]) AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
AST_EXT_LIB_CHECK([UUID], [uuid], [uuid_generate_random], [uuid.h], [-luuid]) AST_EXT_LIB_CHECK([UUID], [uuid], [uuid_generate_random], [uuid/uuid.h], [-luuid])
EDITLINE_LIB="" EDITLINE_LIB=""
if test "x$TERMCAP_LIB" != "x" ; then if test "x$TERMCAP_LIB" != "x" ; then
@@ -719,11 +719,6 @@ AC_DEFINE([HAVE_SYS_ENDIAN_BSWAP16], 1, [Define to 1 if your sys/endian.h header
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
) )
if test "${cross_compiling}" = "no";
then
AC_CHECK_FILE(/dev/urandom, AC_DEFINE([HAVE_DEV_URANDOM], 1, [Define to 1 if your system has /dev/urandom.]))
fi
AC_MSG_CHECKING(for locale_t in locale.h) AC_MSG_CHECKING(for locale_t in locale.h)
AC_LINK_IFELSE( AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <locale.h>], [locale_t lt = NULL])], [AC_LANG_PROGRAM([#include <locale.h>], [locale_t lt = NULL])],

View File

@@ -173,9 +173,6 @@
/* Define DAHDI headers version */ /* Define DAHDI headers version */
#undef HAVE_DAHDI_VERSION #undef HAVE_DAHDI_VERSION
/* Define to 1 if your system has /dev/urandom. */
#undef HAVE_DEV_URANDOM
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. /* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/ */
#undef HAVE_DIRENT_H #undef HAVE_DIRENT_H

View File

@@ -224,10 +224,15 @@ static const struct ast_taskprocessor_listener_callbacks default_listener_callba
.destroy = default_listener_destroy, .destroy = default_listener_destroy,
}; };
/*! \internal \brief Clean up resources on Asterisk shutdown */ /*!
* \internal
* \brief Clean up resources on Asterisk shutdown
*/
static void tps_shutdown(void) static void tps_shutdown(void)
{ {
ast_cli_unregister_multiple(taskprocessor_clis, ARRAY_LEN(taskprocessor_clis));
ao2_t_ref(tps_singletons, -1, "Unref tps_singletons in shutdown"); ao2_t_ref(tps_singletons, -1, "Unref tps_singletons in shutdown");
tps_singletons = NULL;
} }
/* initialize the taskprocessor container and register CLI operations */ /* initialize the taskprocessor container and register CLI operations */

View File

@@ -35,9 +35,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/stat.h> #include <sys/stat.h>
#ifdef HAVE_DEV_URANDOM
#include <fcntl.h> #include <fcntl.h>
#endif
#include <sys/syscall.h> #include <sys/syscall.h>
#if defined(__APPLE__) #if defined(__APPLE__)
@@ -496,9 +494,7 @@ const char *ast_inet_ntoa(struct in_addr ia)
return inet_ntop(AF_INET, &ia, buf, INET_ADDRSTRLEN); return inet_ntop(AF_INET, &ia, buf, INET_ADDRSTRLEN);
} }
#ifdef HAVE_DEV_URANDOM
static int dev_urandom_fd; static int dev_urandom_fd;
#endif
#ifndef __linux__ #ifndef __linux__
#undef pthread_create /* For ast_pthread_create function only */ #undef pthread_create /* For ast_pthread_create function only */
@@ -1494,7 +1490,7 @@ AST_MUTEX_DEFINE_STATIC(randomlock);
long int ast_random(void) long int ast_random(void)
{ {
long int res; long int res;
#ifdef HAVE_DEV_URANDOM
if (dev_urandom_fd >= 0) { if (dev_urandom_fd >= 0) {
int read_res = read(dev_urandom_fd, &res, sizeof(res)); int read_res = read(dev_urandom_fd, &res, sizeof(res));
if (read_res > 0) { if (read_res > 0) {
@@ -1504,7 +1500,7 @@ long int ast_random(void)
return res % rm; return res % rm;
} }
} }
#endif
/* XXX - Thread safety really depends on the libc, not the OS. /* XXX - Thread safety really depends on the libc, not the OS.
* *
* But... popular Linux libc's (uClibc, glibc, eglibc), all have a * But... popular Linux libc's (uClibc, glibc, eglibc), all have a
@@ -2035,9 +2031,7 @@ int ast_mkdir(const char *path, int mode)
int ast_utils_init(void) int ast_utils_init(void)
{ {
#ifdef HAVE_DEV_URANDOM
dev_urandom_fd = open("/dev/urandom", O_RDONLY); dev_urandom_fd = open("/dev/urandom", O_RDONLY);
#endif
base64_init(); base64_init();
#ifdef DEBUG_THREADS #ifdef DEBUG_THREADS
#if !defined(LOW_MEMORY) #if !defined(LOW_MEMORY)

View File

@@ -44,6 +44,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/lock.h" #include "asterisk/lock.h"
#include "asterisk/config.h" #include "asterisk/config.h"
#include "asterisk/astobj2.h" #include "asterisk/astobj2.h"
#include "asterisk/uuid.h"
static void *exchangecal_load_calendar(void *data); static void *exchangecal_load_calendar(void *data);
static void *unref_exchangecal(void *obj); static void *unref_exchangecal(void *obj);
@@ -241,36 +242,30 @@ static void *unref_exchangecal(void *obj)
/* It is very important to use the return value of this function as a realloc could occur */ /* It is very important to use the return value of this function as a realloc could occur */
static struct ast_str *generate_exchange_uuid(struct ast_str *uid) static struct ast_str *generate_exchange_uuid(struct ast_str *uid)
{ {
unsigned short val[8]; char buffer[AST_UUID_STR_LEN];
int x; struct ast_uuid *uuid = ast_uuid_generate();
for (x = 0; x < 8; x++) { if (!uuid) {
val[x] = ast_random(); return NULL;
} }
ast_str_set(&uid, 0, "%04x%04x-%04x-%04x-%04x-%04x%04x%04x", val[0], val[1], val[2], val[3], val[4], val[5], val[6], val[7]);
ast_str_set(&uid, 0, "%s", ast_uuid_to_str(uuid, buffer, AST_UUID_STR_LEN));
ast_free(uuid);
return uid; return uid;
} }
static int is_valid_uuid(struct ast_str *uid) static int is_valid_uuid(struct ast_str *uid)
{ {
int i; struct ast_uuid *uuid = ast_str_to_uuid(ast_str_buffer(uid));
if (ast_str_strlen(uid) != 36) { if (uuid) {
return 0; ast_free(uuid);
return 1;
} }
for (i = 0; i < ast_str_strlen(uid); i++) { return 0;
if (i == 8 || i == 13 || i == 18 || i == 23) {
if (ast_str_buffer(uid)[i] != '-') {
return 0;
}
} else if (!((ast_str_buffer(uid)[i] > 47 && ast_str_buffer(uid)[i] < 58) || (ast_str_buffer(uid)[i] > 96 && ast_str_buffer(uid)[i] < 103))) {
return 0;
}
}
return 1;
} }
static struct ast_str *xml_encode_str(struct ast_str *dst, const char *src) static struct ast_str *xml_encode_str(struct ast_str *dst, const char *src)

View File

@@ -218,7 +218,10 @@ static void load_config(int reload)
alias->cli_entry.command = alias->alias; alias->cli_entry.command = alias->alias;
alias->cli_entry.usage = "Aliased CLI Command\n"; alias->cli_entry.usage = "Aliased CLI Command\n";
ast_cli_register(&alias->cli_entry); if (ast_cli_register(&alias->cli_entry)) {
ao2_ref(alias, -1);
continue;
}
ao2_link(cli_aliases, alias); ao2_link(cli_aliases, alias);
ast_verb(2, "Aliased CLI command '%s' to '%s'\n", v1->name, v1->value); ast_verb(2, "Aliased CLI command '%s' to '%s'\n", v1->name, v1->value);
ao2_ref(alias, -1); ao2_ref(alias, -1);