summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README6
-rw-r--r--README-SERIOUSLY.bestpractices.txt4
-rwxr-xr-xbuild_tools/list_valid_installed_externals2
-rwxr-xr-xconfigure50
-rw-r--r--configure.ac1
-rw-r--r--doc/asterisk.86
-rw-r--r--doc/asterisk.sgml6
-rw-r--r--doc/lang/language-criteria.txt10
-rw-r--r--include/asterisk/cli.h21
-rw-r--r--include/asterisk/doxyref.h6
-rw-r--r--main/Makefile4
-rw-r--r--main/acl.c61
-rw-r--r--main/bridge_basic.c24
-rw-r--r--main/cli.c118
-rw-r--r--main/libasteriskssl.c2
-rw-r--r--main/loader.c14
-rw-r--r--makeopts.in2
-rw-r--r--menuselect/autoconfig.h.in9
-rwxr-xr-xmenuselect/configure302
-rw-r--r--menuselect/configure.ac32
-rw-r--r--menuselect/menuselect.c8
-rw-r--r--res/res_pjsip/location.c19
-rw-r--r--tests/test_utils.c28
-rw-r--r--third-party/Makefile.rules2
-rw-r--r--third-party/pjproject/Makefile13
-rwxr-xr-xthird-party/pjproject/apply_patches3
-rw-r--r--third-party/pjproject/configure.m48
27 files changed, 278 insertions, 483 deletions
diff --git a/README b/README
index 10f2824fd..a1ccf2c80 100644
--- a/README
+++ b/README
@@ -31,7 +31,7 @@ more telephony interfaces than just Internet telephony. Asterisk also has a
vast amount of support for traditional PSTN telephony, as well. For more
information on the project itself, please visit the Asterisk home page at:
- http://www.asterisk.org
+ https://www.asterisk.org
The official Asterisk wiki can be found at:
@@ -40,7 +40,7 @@ information on the project itself, please visit the Asterisk home page at:
In addition you'll find lots of information compiled by the Asterisk
community on this Wiki:
- http://www.voip-info.org/wiki-Asterisk
+ https://www.voip-info.org/wiki-Asterisk
There is a book on Asterisk published by O'Reilly under the Creative Commons
License. It is available in book stores as well as in a downloadable version on
@@ -285,7 +285,7 @@ additional documentation should have been included.
Finally, you may wish to visit the web site and join the mailing list if
you're interested in getting more information.
- http://www.asterisk.org/support
+ https://www.asterisk.org/support
Welcome to the growing worldwide community of Asterisk users!
-------------------------------------------------------------------------------
diff --git a/README-SERIOUSLY.bestpractices.txt b/README-SERIOUSLY.bestpractices.txt
index 0d3e670cf..7a656022e 100644
--- a/README-SERIOUSLY.bestpractices.txt
+++ b/README-SERIOUSLY.bestpractices.txt
@@ -40,7 +40,7 @@ security are listed below.
http://blogs.digium.com/2009/03/28/sip-security/
* Asterisk VoIP Security (webinar):
- http://www.asterisk.org/security/webinar/
+ https://www.asterisk.org/security/webinar/
==============
@@ -263,7 +263,7 @@ that contains a weak password that was forgotten prior to putting a system into
production.
Using a web search you can find several online password generators such as
-http://www.strongpasswordgenerator.com or there are several scripts that can be
+https://www.strongpasswordgenerator.com or there are several scripts that can be
used to generate a strong password.
diff --git a/build_tools/list_valid_installed_externals b/build_tools/list_valid_installed_externals
index ed362743c..c37102208 100755
--- a/build_tools/list_valid_installed_externals
+++ b/build_tools/list_valid_installed_externals
@@ -6,7 +6,7 @@ fi
set -e
ASTTOPDIR=${ASTTOPDIR:-.}
-export make=`sed -n -r -e "s/^MAKE\s*=\s*//gp" ${ASTTOPDIR}/makeopts`
+export make=`sed -n -e "s/^MAKE\s*=\s*//gp" ${ASTTOPDIR}/makeopts`
getvar() {
$make --quiet --no-print-directory -f- <<EOF
diff --git a/configure b/configure
index 70553fcdf..c3d3f1e6f 100755
--- a/configure
+++ b/configure
@@ -1277,6 +1277,7 @@ COMPRESS
FIND
PYTHON
FLEX
+CUT
CAT
CMP
BISON
@@ -6865,6 +6866,47 @@ $as_echo "no" >&6; }
fi
+# Extract the first word of "cut", so it can be a program name with args.
+set dummy cut; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_CUT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $CUT in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_CUT="$CUT" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_CUT="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_path_CUT" && ac_cv_path_CUT=":"
+ ;;
+esac
+fi
+CUT=$ac_cv_path_CUT
+if test -n "$CUT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUT" >&5
+$as_echo "$CUT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
# Extract the first word of "flex", so it can be a program name with args.
set dummy flex; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -9343,6 +9385,12 @@ $as_echo "configuring" >&6; }
if test "${CAT}" = ":" ; then
as_fn_error $? "cat is required to build bundled pjproject" "$LINENO" 5
fi
+ if test "${CUT}" = ":" ; then
+ as_fn_error $? "cut is required to build bundled pjproject" "$LINENO" 5
+ fi
+ if test "${GREP}" = ":" ; then
+ as_fn_error $? "grep is required to build bundled pjproject" "$LINENO" 5
+ fi
this_host=$(./config.sub $(./config.guess))
@@ -9353,7 +9401,7 @@ $as_echo "configuring" >&6; }
PJPROJECT_CONFIGURE_OPTS+=" --host=$host"
fi
- export TAR PATCH SED NM EXTERNALS_CACHE_DIR AST_DOWNLOAD_CACHE DOWNLOAD_TO_STDOUT DOWNLOAD_TIMEOUT DOWNLOAD MD5 CAT
+ export TAR PATCH SED NM EXTERNALS_CACHE_DIR AST_DOWNLOAD_CACHE DOWNLOAD_TO_STDOUT DOWNLOAD_TIMEOUT DOWNLOAD MD5 CAT CUT GREP
export NOISY_BUILD
${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} \
PJPROJECT_CONFIGURE_OPTS="$PJPROJECT_CONFIGURE_OPTS" \
diff --git a/configure.ac b/configure.ac
index f5c160c73..146e634e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -264,6 +264,7 @@ AC_SUBST(GNU_LD)
AC_PATH_PROG([BISON], [bison], :)
AC_PATH_PROG([CMP], [cmp], :)
AC_PATH_PROG([CAT], [cat], :)
+AC_PATH_PROG([CUT], [cut], :)
AC_PATH_PROG([FLEX], [flex], :)
AC_PATH_PROG([GREP], [grep], :)
AC_PATH_PROG([PYTHON], [python], :)
diff --git a/doc/asterisk.8 b/doc/asterisk.8
index 3f49a3401..1cb909a46 100644
--- a/doc/asterisk.8
+++ b/doc/asterisk.8
@@ -243,13 +243,13 @@ Enables executing of includes via \fB#exec\fR directive inside
.SH BUGS
Bug reports and feature requests may be filed at https://issues.asterisk.org
.SH "SEE ALSO"
-http://www.asterisk.org - The Asterisk Home Page
+https://www.asterisk.org - The Asterisk Home Page
.PP
http://www.asteriskdocs.org - The Asterisk Documentation Project
.PP
-http://wiki.asterisk.org - The Asterisk Wiki
+https://wiki.asterisk.org - The Asterisk Wiki
.PP
-http://www.digium.com/ - Asterisk is sponsored by Digium
+https://www.digium.com/ - Asterisk is sponsored by Digium
.SH AUTHOR
Mark Spencer <markster@digium.com>
.PP
diff --git a/doc/asterisk.sgml b/doc/asterisk.sgml
index df1b9e401..c684d2245 100644
--- a/doc/asterisk.sgml
+++ b/doc/asterisk.sgml
@@ -421,16 +421,16 @@
<refsect1>
<title>SEE ALSO</title>
<para>
- http://www.asterisk.org - The Asterisk Home Page
+ https://www.asterisk.org - The Asterisk Home Page
</para>
<para>
http://www.asteriskdocs.org - The Asterisk Documentation Project
</para>
<para>
- http://wiki.asterisk.org - The Asterisk Wiki
+ https://wiki.asterisk.org - The Asterisk Wiki
</para>
<para>
- http://www.digium.com/ - Asterisk is sponsored by Digium
+ https://www.digium.com/ - Asterisk is sponsored by Digium
</para>
</refsect1>
<refsect1>
diff --git a/doc/lang/language-criteria.txt b/doc/lang/language-criteria.txt
index c8d21bdf3..2ad5ab1e1 100644
--- a/doc/lang/language-criteria.txt
+++ b/doc/lang/language-criteria.txt
@@ -14,7 +14,7 @@ inclusion of soundfiles in multiple languages.
Criteria for language submission:
1) Creative Commons Attribution-Share Alike 3.0
-(http://creativecommons.org/licenses/by-sa/3.0/us/) for all
+(https://creativecommons.org/licenses/by-sa/3.0/us/) for all
soundfiles, and the actual artist who performs the prompts must be the
one who approves (in writing) the CCBYSAv3 license. Print out the
license, have the artist sign, and fax to Digium (+1-256-428-6217
@@ -86,9 +86,9 @@ artist as a URL and/or email address.
Example:
bash-3.2# more CREDITS
Recorded by:
- Allison Smith (http://www.theivrvoice.com)
+ Allison Smith (https://www.theivrvoice.com)
- Financial Contributions by: Digium, Inc. (http://www.digium.com)
+ Financial Contributions by: Digium, Inc. (https://www.digium.com)
bash-3.2#
5) Create a file called "LICENSE" and include the license text (listed
@@ -107,7 +107,7 @@ import to UTF-8 format.
7) Use "tar" to create a single file of your sounds and the three text
files.
-8) Create an account on http://issues.asterisk.org/ if you do not
+8) Create an account on https://issues.asterisk.org/ if you do not
already have one, and submit the file via that interface. In order to
eliminate confusion, you should also complete the license agreement on
that system, which is an electronic license agreement. You will
@@ -486,7 +486,7 @@ Creative Commons Notice
time. For the avoidance of doubt, this trademark restriction
does not form part of this License.
- Creative Commons may be contacted at http://creativecommons.org/
+ Creative Commons may be contacted at https://creativecommons.org/
-- end printout --
diff --git a/include/asterisk/cli.h b/include/asterisk/cli.h
index c79a4e93c..3ed88eb61 100644
--- a/include/asterisk/cli.h
+++ b/include/asterisk/cli.h
@@ -306,6 +306,27 @@ int ast_cli_generatornummatches(const char *, const char *);
char **ast_cli_completion_matches(const char *, const char *);
/*!
+ * \brief Generates a vector of strings for CLI completion.
+ *
+ * \param text Complete input being matched.
+ * \param word Current word being matched
+ *
+ * The results contain strings that both:
+ * 1) Begin with the string in \a word.
+ * 2) Are valid in a command after the string in \a text.
+ *
+ * The first entry (offset 0) of the result is the longest common substring
+ * in the results, useful to extend the string that has been completed.
+ * Subsequent entries are all possible values.
+ *
+ * \note All strings and the vector itself are malloc'ed and must be freed
+ * by the caller.
+ *
+ * \note The vector is sorted and does not contain any duplicates.
+ */
+struct ast_vector_string *ast_cli_completion_vector(const char *text, const char *word);
+
+/*!
* \brief Command completion for the list of active channels.
*
* This can be called from a CLI command completion function that wants to
diff --git a/include/asterisk/doxyref.h b/include/asterisk/doxyref.h
index 14ebb4b83..f5a87687f 100644
--- a/include/asterisk/doxyref.h
+++ b/include/asterisk/doxyref.h
@@ -58,12 +58,12 @@
* \arg \ref SoundFiles included in the Asterisk distribution
*
* \section weblinks Web sites
- * \arg \b Main: Asterisk Developer's website http://www.asterisk.org/developers/
+ * \arg \b Main: Asterisk Developer's website https://www.asterisk.org/developers/
* \arg \b Bugs: The Issue Tracker https://issues.asterisk.org
* \arg \b Lists: List Server http://lists.digium.com
- * \arg \b Wiki: The Asterisk Wiki http://wiki.asterisk..org
+ * \arg \b Wiki: The Asterisk Wiki https://wiki.asterisk..org
* \arg \b Docs: The Asterisk Documentation Project http://www.asteriskdocs.org
- * \arg \b Digium: The Asterisk Company http://www.digium.com
+ * \arg \b Digium: The Asterisk Company https://www.digium.com
*/
/*!
diff --git a/main/Makefile b/main/Makefile
index 08d1f6558..c724e2012 100644
--- a/main/Makefile
+++ b/main/Makefile
@@ -273,7 +273,7 @@ endif
$(ASTPJ_LIB).$(ASTPJ_SO_VERSION): _ASTLDFLAGS+=-Wl,-soname=$(ASTPJ_LIB).$(ASTPJ_SO_VERSION) $(PJ_LDFLAGS)
$(ASTPJ_LIB).$(ASTPJ_SO_VERSION): _ASTCFLAGS+=-fPIC -DAST_MODULE=\"asteriskpj\" -DAST_NOT_MODULE $(PJ_CFLAGS)
-$(ASTPJ_LIB).$(ASTPJ_SO_VERSION): LIBS+=$(PJPROJECT_LDLIBS) -lssl -lcrypto -luuid -lm -lpthread $(RT_LIB)
+$(ASTPJ_LIB).$(ASTPJ_SO_VERSION): LIBS+=$(PJPROJECT_LDLIBS) $(OPENSSL_LIB) $(UUID_LIB) -lm -lpthread $(RT_LIB)
ifeq ($(GNU_LD),1)
$(ASTPJ_LIB).$(ASTPJ_SO_VERSION): SO_SUPPRESS_SYMBOLS=-Wl,--version-script,libasteriskpj.exports,--warn-common
endif
@@ -298,7 +298,7 @@ ASTPJ_LIB:=libasteriskpj.dylib
# /lib or /usr/lib
$(ASTPJ_LIB): _ASTLDFLAGS+=-dynamiclib -install_name $(ASTLIBDIR)/$(ASTPJ_LIB) $(PJ_LDFLAGS)
$(ASTPJ_LIB): _ASTCFLAGS+=-fPIC -DAST_MODULE=\"asteriskpj\" $(PJ_CFLAGS) -DAST_NOT_MODULE
-$(ASTPJ_LIB): LIBS+=$(PJPROJECT_LIBS) -lssl -lcrypto -luuid -lm -lpthread $(RT_LIB)
+$(ASTPJ_LIB): LIBS+=$(PJPROJECT_LIBS) $(OPENSSL_LIB) $(UUID_LIB) -lm -lpthread $(RT_LIB)
$(ASTPJ_LIB): SOLINK=$(DYLINK)
# Special rules for building a shared library (not a dynamically loadable module)
diff --git a/main/acl.c b/main/acl.c
index 6868ea12e..bcb3f6391 100644
--- a/main/acl.c
+++ b/main/acl.c
@@ -281,6 +281,12 @@ struct ast_ha *ast_duplicate_ha_list(struct ast_ha *original)
while (start) {
current = ast_duplicate_ha(start); /* Create copy of this object */
+ if (!current) {
+ ast_free_ha(ret);
+
+ return NULL;
+ }
+
if (prev) {
prev->next = current; /* Link previous to this object */
}
@@ -318,7 +324,7 @@ struct ast_acl_list *ast_duplicate_acl_list(struct ast_acl_list *original)
}
if (!(clone = ast_calloc(1, sizeof(*clone)))) {
- ast_log(LOG_WARNING, "Failed to allocate ast_acl_list struct while cloning an ACL\n");
+ ast_log(LOG_ERROR, "Failed to allocate ast_acl_list struct while cloning an ACL\n");
return NULL;
}
AST_LIST_HEAD_INIT(clone);
@@ -327,8 +333,10 @@ struct ast_acl_list *ast_duplicate_acl_list(struct ast_acl_list *original)
AST_LIST_TRAVERSE(original, current_cursor, list) {
if ((acl_new(&current_clone, current_cursor->name))) {
- ast_log(LOG_WARNING, "Failed to allocate ast_acl struct while cloning an ACL.");
- continue;
+ ast_log(LOG_ERROR, "Failed to allocate ast_acl struct while cloning an ACL.\n");
+ ast_free_acl_list(clone);
+ clone = NULL;
+ break;
}
/* Copy data from original ACL to clone ACL */
@@ -338,6 +346,15 @@ struct ast_acl_list *ast_duplicate_acl_list(struct ast_acl_list *original)
current_clone->is_realtime = current_cursor->is_realtime;
AST_LIST_INSERT_TAIL(clone, current_clone, list);
+
+ if (current_cursor->acl && !current_clone->acl) {
+ /* Deal with failure after adding to clone so we don't have to free
+ * current_clone separately. */
+ ast_log(LOG_ERROR, "Failed to duplicate HA list while cloning ACL.\n");
+ ast_free_acl_list(clone);
+ clone = NULL;
+ break;
+ }
}
AST_LIST_UNLOCK(original);
@@ -448,6 +465,8 @@ void ast_append_acl(const char *sense, const char *stuff, struct ast_acl_list **
if (error) {
*error = 1;
}
+ AST_LIST_UNLOCK(working_list);
+ return;
}
// Need to INSERT the ACL at the head here.
AST_LIST_INSERT_HEAD(working_list, acl, list);
@@ -477,7 +496,8 @@ void ast_append_acl(const char *sense, const char *stuff, struct ast_acl_list **
AST_LIST_TRAVERSE(working_list, current, list) {
if (!strcasecmp(current->name, tmp)) { /* ACL= */
/* Inclusion of the same ACL multiple times isn't a catastrophic error, but it will raise the error flag and skip the entry. */
- ast_log(LOG_ERROR, "Named ACL '%s' occurs multiple times in ACL definition. Please update your ACL configuration.", tmp);
+ ast_log(LOG_ERROR, "Named ACL '%s' occurs multiple times in ACL definition. "
+ "Please update your ACL configuration.\n", tmp);
if (error) {
*error = 1;
}
@@ -536,6 +556,22 @@ int ast_acl_list_is_empty(struct ast_acl_list *acl_list)
return 1;
}
+/*!
+ * \internal
+ * \brief Used by ast_append_ha to avoid ast_strdupa in a loop.
+ *
+ * \note This function is only called at debug level 3 and higher.
+ */
+static void debug_ha_sense_appended(struct ast_ha *ha)
+{
+ const char *parsed_mask = ast_strdupa(ast_sockaddr_stringify(&ha->netmask));
+
+ ast_log(LOG_DEBUG, "%s/%s sense %u appended to ACL\n",
+ ast_sockaddr_stringify(&ha->addr),
+ parsed_mask,
+ ha->sense);
+}
+
struct ast_ha *ast_append_ha(const char *sense, const char *stuff, struct ast_ha *path, int *error)
{
struct ast_ha *ha;
@@ -545,7 +581,6 @@ struct ast_ha *ast_append_ha(const char *sense, const char *stuff, struct ast_ha
char *address = NULL, *mask = NULL;
int addr_is_v4;
int allowing = strncasecmp(sense, "p", 1) ? AST_SENSE_DENY : AST_SENSE_ALLOW;
- const char *parsed_addr, *parsed_mask;
ret = path;
while (path) {
@@ -653,10 +688,9 @@ struct ast_ha *ast_append_ha(const char *sense, const char *stuff, struct ast_ha
}
prev = ha;
- parsed_addr = ast_strdupa(ast_sockaddr_stringify(&ha->addr));
- parsed_mask = ast_strdupa(ast_sockaddr_stringify(&ha->netmask));
-
- ast_debug(3, "%s/%s sense %u appended to ACL\n", parsed_addr, parsed_mask, ha->sense);
+ if (DEBUG_ATLEAST(3)) {
+ debug_ha_sense_appended(ha);
+ }
}
return ret;
@@ -665,10 +699,11 @@ struct ast_ha *ast_append_ha(const char *sense, const char *stuff, struct ast_ha
void ast_ha_join(const struct ast_ha *ha, struct ast_str **buf)
{
for (; ha; ha = ha->next) {
- const char *addr = ast_strdupa(ast_sockaddr_stringify_addr(&ha->addr));
- ast_str_append(buf, 0, "%s%s/%s",
- ha->sense == AST_SENSE_ALLOW ? "!" : "",
- addr, ast_sockaddr_stringify_addr(&ha->netmask));
+ ast_str_append(buf, 0, "%s%s/",
+ ha->sense == AST_SENSE_ALLOW ? "!" : "",
+ ast_sockaddr_stringify_addr(&ha->addr));
+ /* Separated to avoid duplicating stringified addresses. */
+ ast_str_append(buf, 0, "%s", ast_sockaddr_stringify_addr(&ha->netmask));
if (ha->next) {
ast_str_append(buf, 0, ",");
}
diff --git a/main/bridge_basic.c b/main/bridge_basic.c
index e31f38561..fd6bac0c9 100644
--- a/main/bridge_basic.c
+++ b/main/bridge_basic.c
@@ -1547,6 +1547,23 @@ static void stimulate_attended_transfer(struct attended_transfer_properties *pro
ao2_unlock(props);
}
+static void remove_attended_transfer_stimulus(struct attended_transfer_properties *props,
+ enum attended_transfer_stimulus stimulus)
+{
+ struct stimulus_list *list;
+
+ ao2_lock(props);
+ AST_LIST_TRAVERSE_SAFE_BEGIN(&props->stimulus_queue, list, next) {
+ if (list->stimulus == stimulus) {
+ AST_LIST_REMOVE_CURRENT(next);
+ ast_free(list);
+ break;
+ }
+ }
+ AST_LIST_TRAVERSE_SAFE_END;
+ ao2_unlock(props);
+}
+
/*!
* \brief Get a desired transfer party for a bridge the transferer is not in.
*
@@ -2339,6 +2356,10 @@ static enum attended_transfer_state blond_nonfinal_exit(struct attended_transfer
return TRANSFER_RESUME;
case STIMULUS_TIMEOUT:
ast_softhangup(props->recall_target, AST_SOFTHANGUP_EXPLICIT);
+ /* It is possible before we hung them up that they queued up a recall target answer
+ * so we remove it if present as it should not exist.
+ */
+ remove_attended_transfer_stimulus(props, STIMULUS_RECALL_TARGET_ANSWER);
case STIMULUS_RECALL_TARGET_HANGUP:
props->recall_target = ast_channel_unref(props->recall_target);
return TRANSFER_RECALLING;
@@ -2803,7 +2824,8 @@ static struct ast_frame *transfer_target_framehook_cb(struct ast_channel *chan,
if (event == AST_FRAMEHOOK_EVENT_READ &&
frame && frame->frametype == AST_FRAME_CONTROL &&
- frame->subclass.integer == AST_CONTROL_ANSWER) {
+ frame->subclass.integer == AST_CONTROL_ANSWER &&
+ !ast_check_hangup(chan)) {
ast_debug(1, "Detected an answer for recall attempt on attended transfer %p\n", props);
if (props->superstate == SUPERSTATE_TRANSFER) {
diff --git a/main/cli.c b/main/cli.c
index 66ce8c4f1..eae14adc4 100644
--- a/main/cli.c
+++ b/main/cli.c
@@ -2490,76 +2490,98 @@ int ast_cli_generatornummatches(const char *text, const char *word)
return matches;
}
-static void destroy_match_list(char **match_list, int matches)
+char **ast_cli_completion_matches(const char *text, const char *word)
{
- if (match_list) {
- int idx;
+ struct ast_vector_string *vec = ast_cli_completion_vector(text, word);
+ char **match_list;
- for (idx = 1; idx < matches; ++idx) {
- ast_free(match_list[idx]);
- }
- ast_free(match_list);
+ if (!vec) {
+ return NULL;
+ }
+
+ if (AST_VECTOR_APPEND(vec, NULL)) {
+ /* We failed to NULL terminate the elements */
+ AST_VECTOR_CALLBACK_VOID(vec, ast_free);
+ AST_VECTOR_PTR_FREE(vec);
+
+ return NULL;
}
+
+ match_list = AST_VECTOR_STEAL_ELEMENTS(vec);
+ AST_VECTOR_PTR_FREE(vec);
+
+ return match_list;
}
-char **ast_cli_completion_matches(const char *text, const char *word)
+struct ast_vector_string *ast_cli_completion_vector(const char *text, const char *word)
{
- char **match_list = NULL, *retstr, *prevstr;
- char **new_list;
- size_t match_list_len, max_equal, which, i;
- int matches = 0;
+ char *retstr, *prevstr;
+ size_t max_equal;
+ size_t which = 0;
+ struct ast_vector_string *vec = ast_calloc(1, sizeof(*vec));
- /* leave entry 0 free for the longest common substring */
- match_list_len = 1;
- while ((retstr = ast_cli_generator(text, word, matches)) != NULL) {
- if (matches + 1 >= match_list_len) {
- match_list_len <<= 1;
- new_list = ast_realloc(match_list, match_list_len * sizeof(*match_list));
- if (!new_list) {
- destroy_match_list(match_list, matches);
- return NULL;
- }
- match_list = new_list;
+ if (!vec) {
+ return NULL;
+ }
+
+ while ((retstr = ast_cli_generator(text, word, which)) != NULL) {
+ if (AST_VECTOR_ADD_SORTED(vec, retstr, strcasecmp)) {
+ ast_free(retstr);
+
+ goto vector_cleanup;
}
- match_list[++matches] = retstr;
+
+ ++which;
}
- if (!match_list) {
- return match_list; /* NULL */
+ if (!AST_VECTOR_SIZE(vec)) {
+ AST_VECTOR_PTR_FREE(vec);
+
+ return NULL;
}
+ prevstr = AST_VECTOR_GET(vec, 0);
+ max_equal = strlen(prevstr);
+ which = 1;
+
/* Find the longest substring that is common to all results
* (it is a candidate for completion), and store a copy in entry 0.
*/
- prevstr = match_list[1];
- max_equal = strlen(prevstr);
- for (which = 2; which <= matches; which++) {
- for (i = 0; i < max_equal && toupper(prevstr[i]) == toupper(match_list[which][i]); i++)
+ while (which < AST_VECTOR_SIZE(vec)) {
+ size_t i = 0;
+
+ retstr = AST_VECTOR_GET(vec, which);
+ /* Check for and remove duplicate strings. */
+ if (!strcasecmp(prevstr, retstr)) {
+ AST_VECTOR_REMOVE(vec, which, 1);
+ ast_free(retstr);
+
continue;
+ }
+
+ while (i < max_equal && toupper(prevstr[i]) == toupper(retstr[i])) {
+ i++;
+ }
+
max_equal = i;
+ prevstr = retstr;
+ ++which;
}
- retstr = ast_malloc(max_equal + 1);
- if (!retstr) {
- destroy_match_list(match_list, matches);
- return NULL;
+ /* Insert longest match to position 0. */
+ retstr = ast_strndup(AST_VECTOR_GET(vec, 0), max_equal);
+ if (!retstr || AST_VECTOR_INSERT_AT(vec, 0, retstr)) {
+ ast_free(retstr);
+ goto vector_cleanup;
}
- ast_copy_string(retstr, match_list[1], max_equal + 1);
- match_list[0] = retstr;
- /* ensure that the array is NULL terminated */
- if (matches + 1 >= match_list_len) {
- new_list = ast_realloc(match_list, (match_list_len + 1) * sizeof(*match_list));
- if (!new_list) {
- ast_free(retstr);
- destroy_match_list(match_list, matches);
- return NULL;
- }
- match_list = new_list;
- }
- match_list[matches + 1] = NULL;
+ return vec;
- return match_list;
+vector_cleanup:
+ AST_VECTOR_CALLBACK_VOID(vec, ast_free);
+ AST_VECTOR_PTR_FREE(vec);
+
+ return NULL;
}
/*! \brief returns true if there are more words to match */
diff --git a/main/libasteriskssl.c b/main/libasteriskssl.c
index 8b19e247d..e2e256f8f 100644
--- a/main/libasteriskssl.c
+++ b/main/libasteriskssl.c
@@ -37,7 +37,7 @@
#endif
#if defined(HAVE_OPENSSL) && \
- !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ (!defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER))
#include <dlfcn.h>
diff --git a/main/loader.c b/main/loader.c
index fc3e9a374..19e30f835 100644
--- a/main/loader.c
+++ b/main/loader.c
@@ -117,14 +117,20 @@ static int modules_loaded;
struct ast_module {
const struct ast_module_info *info;
- /* Used to get module references into refs log */
+ /*! Used to get module references into refs log */
void *ref_debug;
- void *lib; /* the shared lib, or NULL if embedded */
- int usecount; /* the number of 'users' currently in this module */
- struct module_user_list users; /* the list of users in the module */
+ /*! The shared lib. */
+ void *lib;
+ /*! Number of 'users' and other references currently holding the module. */
+ int usecount;
+ /*! List of users holding the module. */
+ struct module_user_list users;
struct {
+ /*! The module running and ready to accept requests. */
unsigned int running:1;
+ /*! The module has declined to start. */
unsigned int declined:1;
+ /*! This module is being held open until it's time to shutdown. */
unsigned int keepuntilshutdown:1;
} flags;
AST_LIST_ENTRY(ast_module) list_entry;
diff --git a/makeopts.in b/makeopts.in
index e25b614e0..227ce071b 100644
--- a/makeopts.in
+++ b/makeopts.in
@@ -49,6 +49,7 @@ PATCH=@PATCH@
SED=@SED@
NM=@NM@
CAT=@CAT@
+CUT=@CUT@
BUILD_PLATFORM=@BUILD_PLATFORM@
BUILD_CPU=@BUILD_CPU@
@@ -73,7 +74,6 @@ CONFIG_LDFLAGS=@CONFIG_LDFLAGS@
CONFIG_SIGNED_CHAR=@CONFIG_SIGNED_CHAR@
GNU_LD=@GNU_LD@
-WEAKREF=@PBX_WEAKREF@
HAVE_DYNAMIC_LIST=@PBX_DYNAMIC_LIST@
prefix = @prefix@
diff --git a/menuselect/autoconfig.h.in b/menuselect/autoconfig.h.in
index 9cafa567b..590ce6161 100644
--- a/menuselect/autoconfig.h.in
+++ b/menuselect/autoconfig.h.in
@@ -26,15 +26,6 @@
/* Define to 1 if you have the `asprintf' function. */
#undef HAVE_ASPRINTF
-/* Define to 1 if your GCC C compiler supports the 'weak' attribute. */
-#undef HAVE_ATTRIBUTE_weak
-
-/* Define to 1 if your GCC C compiler supports the 'weak_import' attribute. */
-#undef HAVE_ATTRIBUTE_weak_import
-
-/* Define to 1 if your GCC C compiler supports the 'weakref' attribute. */
-#undef HAVE_ATTRIBUTE_weakref
-
/* Define to 1 if you have the curses library. */
#undef HAVE_CURSES
diff --git a/menuselect/configure b/menuselect/configure
index 4235ea0a4..13a330b07 100755
--- a/menuselect/configure
+++ b/menuselect/configure
@@ -1,5 +1,4 @@
#! /bin/sh
-# From configure.ac Revision.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69.
#
@@ -655,7 +654,6 @@ ALLOCA
EGREP
GREP
CPP
-PBX_WEAKREF
MENUSELECT_DEBUG
GNU_MAKE
OBJEXT
@@ -2218,7 +2216,6 @@ ac_config_headers="$ac_config_headers autoconfig.h"
-
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
if test -f "$ac_dir/install-sh"; then
@@ -3194,305 +3191,6 @@ fi
-# Support weak symbols on a platform specific basis. The Mac OS X
-# (Darwin) support must be isolated from the other platforms because
-# it has caused other platforms to fail.
-#
-case "${OSARCH}" in
- darwin*)
- # Allow weak symbol support on Darwin platforms only because there
- # is active community support for it.
- # However, Darwin seems to break weak symbols for each new version.
- #
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute weak_import' support" >&5
-$as_echo_n "checking for compiler 'attribute weak_import' support... " >&6; }
-saved_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
-PBX_WEAKREF=0
-
-if test "x" = "x"
-then
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- void __attribute__((weak_import)) *test(void *muffin, ...) {return (void *) 0;}
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- PBX_WEAKREF=1
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTRIBUTE_weak_import 1
-_ACEOF
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- void __attribute__(()) *test(void *muffin, ...) ;
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- PBX_WEAKREF=1
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTRIBUTE_weak_import 1
-_ACEOF
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-CFLAGS="$saved_CFLAGS"
-
-
-
- # Several other platforms including Linux have GCC versions that
- # define the weak attribute. However, this attribute is only
- # setup for use in the code by Darwin.
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute weak' support" >&5
-$as_echo_n "checking for compiler 'attribute weak' support... " >&6; }
-saved_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
-PBX_WEAKREF=0
-
-if test "x" = "x"
-then
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- void __attribute__((weak)) *test(void *muffin, ...) {return (void *) 0;}
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- PBX_WEAKREF=1
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTRIBUTE_weak 1
-_ACEOF
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- void __attribute__(()) *test(void *muffin, ...) ;
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- PBX_WEAKREF=1
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTRIBUTE_weak 1
-_ACEOF
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-CFLAGS="$saved_CFLAGS"
-
-
- ;;
- linux-gnu)
- # Primarily support weak symbols on Linux platforms.
- #
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute weakref' support" >&5
-$as_echo_n "checking for compiler 'attribute weakref' support... " >&6; }
-saved_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
-PBX_WEAKREF=0
-
-if test "xweakref("foo")" = "x"
-then
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-static void __attribute__((weakref)) *test(void *muffin, ...) {return (void *) 0;}
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- PBX_WEAKREF=1
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTRIBUTE_weakref 1
-_ACEOF
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-static void __attribute__((weakref("foo"))) *test(void *muffin, ...) ;
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- PBX_WEAKREF=1
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTRIBUTE_weakref 1
-_ACEOF
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-CFLAGS="$saved_CFLAGS"
-
-
- ;;
- *)
- # Allow weak symbols on other platforms. However, any problems
- # with this feature on other platforms must be fixed by the
- # community.
- #
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute weakref' support" >&5
-$as_echo_n "checking for compiler 'attribute weakref' support... " >&6; }
-saved_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
-PBX_WEAKREF=0
-
-if test "xweakref("foo")" = "x"
-then
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-static void __attribute__((weakref)) *test(void *muffin, ...) {return (void *) 0;}
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- PBX_WEAKREF=1
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTRIBUTE_weakref 1
-_ACEOF
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-static void __attribute__((weakref("foo"))) *test(void *muffin, ...) ;
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- PBX_WEAKREF=1
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTRIBUTE_weakref 1
-_ACEOF
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-CFLAGS="$saved_CFLAGS"
-
-
- ;;
-esac
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
diff --git a/menuselect/configure.ac b/menuselect/configure.ac
index 29c43cb50..5945f5c9f 100644
--- a/menuselect/configure.ac
+++ b/menuselect/configure.ac
@@ -15,7 +15,6 @@ AC_CONFIG_SRCDIR([menuselect.c])
AC_CONFIG_HEADER(autoconfig.h)
AC_COPYRIGHT("Menuselect")
-AC_REVISION($Revision$)
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
@@ -81,37 +80,6 @@ AC_ARG_ENABLE([debug],
esac])
AC_SUBST(MENUSELECT_DEBUG)
-# Support weak symbols on a platform specific basis. The Mac OS X
-# (Darwin) support must be isolated from the other platforms because
-# it has caused other platforms to fail.
-#
-case "${OSARCH}" in
- darwin*)
- # Allow weak symbol support on Darwin platforms only because there
- # is active community support for it.
- # However, Darwin seems to break weak symbols for each new version.
- #
- AST_GCC_ATTRIBUTE(weak_import, [], [], PBX_WEAKREF)
-
- # Several other platforms including Linux have GCC versions that
- # define the weak attribute. However, this attribute is only
- # setup for use in the code by Darwin.
- AST_GCC_ATTRIBUTE(weak, [], [], PBX_WEAKREF)
- ;;
- linux-gnu)
- # Primarily support weak symbols on Linux platforms.
- #
- AST_GCC_ATTRIBUTE(weakref, [weakref("foo")], static, PBX_WEAKREF)
- ;;
- *)
- # Allow weak symbols on other platforms. However, any problems
- # with this feature on other platforms must be fixed by the
- # community.
- #
- AST_GCC_ATTRIBUTE(weakref, [weakref("foo")], static, PBX_WEAKREF)
- ;;
-esac
-
AC_FUNC_ALLOCA
AC_CHECK_FUNCS([asprintf getloadavg setenv strcasestr strndup strnlen strsep unsetenv vasprintf])
diff --git a/menuselect/menuselect.c b/menuselect/menuselect.c
index 689cebf62..83f6098dc 100644
--- a/menuselect/menuselect.c
+++ b/menuselect/menuselect.c
@@ -986,8 +986,12 @@ static int match_member_relations(void)
}
}
- /* If weak linking is not supported, move module uses which are other modules to the dependency list */
-#if !defined(HAVE_ATTRIBUTE_weak_import) && !defined(HAVE_ATTRIBUTE_weakref) && !defined(HAVE_ATTRIBUTE_weak)
+/*
+ * BUGBUG:
+ * This doesn't work, the only way we can fix this is to remove OPTIONAL_API
+ * toggle from menuselect and add a command-line argument to ./configure.
+ */
+#if 0
AST_LIST_TRAVERSE(&categories, cat, list) {
AST_LIST_TRAVERSE(&cat->members, mem, list) {
if (mem->is_separator) {
diff --git a/res/res_pjsip/location.c b/res/res_pjsip/location.c
index 0d7b3da31..299fdb722 100644
--- a/res/res_pjsip/location.c
+++ b/res/res_pjsip/location.c
@@ -82,16 +82,17 @@ static void aor_deleted_observer(const void *object)
{
const struct ast_sip_aor *aor = object;
const char *aor_id = ast_sorcery_object_get_id(object);
- /* Give enough space for ^ at the beginning and ;@ at the end, since that is our object naming scheme */
- char regex[strlen(aor_id) + 4];
+ /* Give enough space for ;@ at the end, since that is our object naming scheme */
+ size_t prefix_len = strlen(aor_id) + sizeof(";@") - 1;
+ char prefix[prefix_len + 1];
struct ao2_container *contacts;
if (aor->permanent_contacts) {
ao2_callback(aor->permanent_contacts, OBJ_NODATA | OBJ_MULTIPLE | OBJ_UNLINK, destroy_contact, NULL);
}
- snprintf(regex, sizeof(regex), "^%s;@", aor_id);
- if (!(contacts = ast_sorcery_retrieve_by_regex(ast_sip_get_sorcery(), "contact", regex))) {
+ sprintf(prefix, "%s;@", aor_id); /* Safe */
+ if (!(contacts = ast_sorcery_retrieve_by_prefix(ast_sip_get_sorcery(), "contact", prefix, prefix_len))) {
return;
}
/* Destroy any contacts that may still exist that were made for this AoR */
@@ -223,13 +224,13 @@ struct ao2_container *ast_sip_location_retrieve_aor_contacts_nolock(const struct
struct ao2_container *ast_sip_location_retrieve_aor_contacts_nolock_filtered(const struct ast_sip_aor *aor,
unsigned int flags)
{
- /* Give enough space for ^ at the beginning and ;@ at the end, since that is our object naming scheme */
- char regex[strlen(ast_sorcery_object_get_id(aor)) + 4];
+ /* Give enough space for ;@ at the end, since that is our object naming scheme */
+ size_t prefix_len = strlen(ast_sorcery_object_get_id(aor)) + sizeof(";@") - 1;
+ char prefix[prefix_len + 1];
struct ao2_container *contacts;
- snprintf(regex, sizeof(regex), "^%s;@", ast_sorcery_object_get_id(aor));
-
- if (!(contacts = ast_sorcery_retrieve_by_regex(ast_sip_get_sorcery(), "contact", regex))) {
+ sprintf(prefix, "%s;@", ast_sorcery_object_get_id(aor)); /* Safe */
+ if (!(contacts = ast_sorcery_retrieve_by_prefix(ast_sip_get_sorcery(), "contact", prefix, prefix_len))) {
return NULL;
}
diff --git a/tests/test_utils.c b/tests/test_utils.c
index 072cf0a39..68a285727 100644
--- a/tests/test_utils.c
+++ b/tests/test_utils.c
@@ -324,20 +324,6 @@ AST_TEST_DEFINE(crypto_loaded_test)
break;
}
-#if 0 /* Not defined on Solaris */
- ast_test_status_update(test,
- "address of __stub__ast_crypto_loaded is %p\n",
- __stub__ast_crypto_loaded);
-#ifndef HAVE_ATTRIBUTE_weak_import
- ast_test_status_update(test,
- "address of __ref__ast_crypto_loaded is %p\n",
- __ref__ast_crypto_loaded);
-#endif
- ast_test_status_update(test,
- "pointer to ast_crypto_loaded is %p\n",
- ast_crypto_loaded);
-#endif
-
return ast_crypto_loaded() ? AST_TEST_PASS : AST_TEST_FAIL;
}
@@ -388,20 +374,6 @@ AST_TEST_DEFINE(agi_loaded_test)
break;
}
-#if 0
- ast_test_status_update(test,
- "address of __stub__ast_agi_register is %p\n",
- __stub__ast_agi_register);
-#ifndef HAVE_ATTRIBUTE_weak_import
- ast_test_status_update(test,
- "address of __ref__ast_agi_register is %p\n",
- __ref__ast_agi_register);
-#endif
- ast_test_status_update(test,
- "pointer to ast_agi_register is %p\n",
- ast_agi_register);
-#endif
-
if (ast_agi_register(ast_module_info->self, &noop_command) == AST_OPTIONAL_API_UNAVAILABLE) {
ast_test_status_update(test, "Unable to register testnoop command, because res_agi is not loaded.\n");
return AST_TEST_FAIL;
diff --git a/third-party/Makefile.rules b/third-party/Makefile.rules
index f8b72ba6d..8306869f9 100644
--- a/third-party/Makefile.rules
+++ b/third-party/Makefile.rules
@@ -28,6 +28,8 @@ export SED
export NM
export MD5
export CAT
+export CUT
+export GREP
export DOWNLOAD
export DOWNLOAD_TO_STDOUT
export DOWNLOAD_TIMEOUT
diff --git a/third-party/pjproject/Makefile b/third-party/pjproject/Makefile
index 7a42edcde..6ebd685b2 100644
--- a/third-party/pjproject/Makefile
+++ b/third-party/pjproject/Makefile
@@ -93,9 +93,9 @@ endef
define verify_tarball
($(SHELL_ECHO_PREFIX) Verifying $(TARBALL) &&\
- tarball_sum=$$($(CAT) $(TARBALL) | $(MD5) | $(SED) -n -r -e "s/^([^ ]+)\s+.*/\1/gp") ;\
- required_sum=$$($(SED) -n -r -e "s/^([^ ]+)\s+$(TARBALL_FILE)/\1/gp" $(PJMD5SUM)) ;\
- if [ "$$tarball_sum" != "$$required_sum" ] ; then $(SHELL_ECHO_PREFIX) Verify failed ; exit 1 ;\
+ tarball_sum=$$($(CAT) $(TARBALL) | $(MD5) | $(CUT) -d' ' -f1) ;\
+ required_sum=$$($(GREP) -e $(TARBALL_FILE) $(PJMD5SUM) | $(CUT) -d' ' -f1) ;\
+ if [ -z "$$required_sum" -o "$$tarball_sum" != "$$required_sum" ] ; then $(SHELL_ECHO_PREFIX) Verify failed ; exit 1 ;\
else $(SHELL_ECHO_PREFIX) Verify successful ; exit 0 ; fi; )
endef
@@ -127,8 +127,8 @@ source/.unpacked: $(DOWNLOAD_DIR)/pjproject-$(PJPROJECT_VERSION).tar.bz2
-@rm -rf source pjproject-* >/dev/null 2>&1
$(CMD_PREFIX) $(TAR) -xjf $<
@mv pjproject-$(PJPROJECT_VERSION) source
- $(ECHO_PREFIX) Applying patches
- $(CMD_PREFIX) ./apply_patches $(QUIET_CONFIGURE) patches source
+ $(ECHO_PREFIX) Applying patches "$(realpath patches)" "$(realpath .)/source"
+ $(CMD_PREFIX) ./apply_patches $(QUIET_CONFIGURE) "$(realpath patches)" "$(realpath .)/source"
-@touch source/.unpacked
source/version.mak: source/.unpacked
@@ -150,7 +150,8 @@ source/build.mak: Makefile.rules source/version.mak source/user.mak $(addprefix
$(CMD_PREFIX) (cd source ; ./aconfigure $(QUIET_CONFIGURE) $(PJPROJECT_CONFIG_OPTS))
build.mak: source/build.mak
- $(CMD_PREFIX) $(SED) -r -e "/prefix|export PJ_SHARED_LIBRARIES|MACHINE_NAME|OS_NAME|HOST_NAME|CC_NAME|CROSS_COMPILE|LINUX_POLL/d" source/build.mak > build.mak
+ $(CMD_PREFIX) $(GREP) -v -e prefix -e "export PJ_SHARED_LIBRARIES" -e MACHINE_NAME \
+ -e OS_NAME -e HOST_NAME -e CC_NAME -e CROSS_COMPILE -e LINUX_POLL $< > $@
configure: source/build.mak
diff --git a/third-party/pjproject/apply_patches b/third-party/pjproject/apply_patches
index 5f9fde283..134bd306f 100755
--- a/third-party/pjproject/apply_patches
+++ b/third-party/pjproject/apply_patches
@@ -10,9 +10,6 @@ PATCH=${PATCH:-patch}
patchdir=${1:?You must supply a patches directory}
sourcedir=${2?:You must supply a source directory}
-patchdir=`readlink -f $patchdir`
-sourcedir=`readlink -f $sourcedir`
-
if [ ! -d "$patchdir" ] ; then
echo "$patchdir is not a directory" >&2
exit 1
diff --git a/third-party/pjproject/configure.m4 b/third-party/pjproject/configure.m4
index 2d3353476..73887041c 100644
--- a/third-party/pjproject/configure.m4
+++ b/third-party/pjproject/configure.m4
@@ -39,6 +39,12 @@ AC_DEFUN([_PJPROJECT_CONFIGURE],
if test "${CAT}" = ":" ; then
AC_MSG_ERROR(cat is required to build bundled pjproject)
fi
+ if test "${CUT}" = ":" ; then
+ AC_MSG_ERROR(cut is required to build bundled pjproject)
+ fi
+ if test "${GREP}" = ":" ; then
+ AC_MSG_ERROR(grep is required to build bundled pjproject)
+ fi
AC_ARG_VAR([PJPROJECT_CONFIGURE_OPTS],[Additional configure options to pass to bundled pjproject])
this_host=$(./config.sub $(./config.guess))
@@ -49,7 +55,7 @@ AC_DEFUN([_PJPROJECT_CONFIGURE],
PJPROJECT_CONFIGURE_OPTS+=" --host=$host"
fi
- export TAR PATCH SED NM EXTERNALS_CACHE_DIR AST_DOWNLOAD_CACHE DOWNLOAD_TO_STDOUT DOWNLOAD_TIMEOUT DOWNLOAD MD5 CAT
+ export TAR PATCH SED NM EXTERNALS_CACHE_DIR AST_DOWNLOAD_CACHE DOWNLOAD_TO_STDOUT DOWNLOAD_TIMEOUT DOWNLOAD MD5 CAT CUT GREP
export NOISY_BUILD
${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} \
PJPROJECT_CONFIGURE_OPTS="$PJPROJECT_CONFIGURE_OPTS" \