summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--apps/app_voicemail.c2
-rw-r--r--channels/sip/config_parser.c7
-rw-r--r--channels/sip/reqresp_parser.c23
-rw-r--r--funcs/func_curl.c2
-rw-r--r--res/res_pjsip.c2
-rw-r--r--res/res_pjsip_mwi.c28
-rw-r--r--res/res_rtp_asterisk.c2
8 files changed, 37 insertions, 33 deletions
diff --git a/Makefile b/Makefile
index befa4c431..6385fac9f 100644
--- a/Makefile
+++ b/Makefile
@@ -492,7 +492,7 @@ doc/core-en_US.xml: makeopts .lastclean $(XML_core_en_US)
@printf "Building Documentation For: "
@echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $@
@echo "<!DOCTYPE docs SYSTEM \"appdocsxml.dtd\">" >> $@
- @echo "<?xml-stylesheet type=\"text/xsl\" href=\"appdocsxml.xslt\"?>" > $@
+ @echo "<?xml-stylesheet type=\"text/xsl\" href=\"appdocsxml.xslt\"?>" >> $@
@echo "<docs xmlns:xi=\"http://www.w3.org/2001/XInclude\">" >> $@
@for x in $(MOD_SUBDIRS); do \
printf "$$x " ; \
@@ -516,7 +516,7 @@ else
@printf "Building Documentation For: "
@echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $@
@echo "<!DOCTYPE docs SYSTEM \"appdocsxml.dtd\">" >> $@
- @echo "<?xml-stylesheet type=\"text/xsl\" href=\"appdocsxml.xslt\"?>" > $@
+ @echo "<?xml-stylesheet type=\"text/xsl\" href=\"appdocsxml.xslt\"?>" >> $@
@echo "<docs xmlns:xi=\"http://www.w3.org/2001/XInclude\">" >> $@
@for x in $(MOD_SUBDIRS); do \
printf "$$x " ; \
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index e88d7069c..321e5c9c0 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -12228,6 +12228,7 @@ static int append_mailbox(const char *context, const char *box, const char *data
return 0;
}
+#ifdef TEST_FRAMEWORK
AST_TEST_DEFINE(test_voicemail_vmuser)
{
int res = 0;
@@ -12415,6 +12416,7 @@ AST_TEST_DEFINE(test_voicemail_vmuser)
free_user(vmu);
return res ? AST_TEST_FAIL : AST_TEST_PASS;
}
+#endif
static int vm_box_exists(struct ast_channel *chan, const char *data)
{
diff --git a/channels/sip/config_parser.c b/channels/sip/config_parser.c
index 50495427e..0feb24655 100644
--- a/channels/sip/config_parser.c
+++ b/channels/sip/config_parser.c
@@ -274,6 +274,7 @@ int sip_parse_register_line(struct sip_registry *reg, int default_expiry, const
return 0;
}
+#ifdef TEST_FRAMEWORK
AST_TEST_DEFINE(sip_parse_register_line_test)
{
int res = AST_TEST_PASS;
@@ -643,6 +644,7 @@ alloc_fail:
ast_test_status_update(test, "Out of memory. \n");
return res;
}
+#endif
int sip_parse_host(char *line, int lineno, char **hostname, int *portnum, enum ast_transport *transport)
{
@@ -708,6 +710,7 @@ int sip_parse_host(char *line, int lineno, char **hostname, int *portnum, enum a
return 0;
}
+#ifdef TEST_FRAMEWORK
AST_TEST_DEFINE(sip_parse_host_line_test)
{
int res = AST_TEST_PASS;
@@ -787,6 +790,7 @@ AST_TEST_DEFINE(sip_parse_host_line_test)
return res;
}
+#endif
/*! \brief Parse the comma-separated nat= option values */
void sip_parse_nat_option(const char *value, struct ast_flags *mask, struct ast_flags *flags)
@@ -834,6 +838,7 @@ void sip_parse_nat_option(const char *value, struct ast_flags *mask, struct ast_
}
}
+#ifdef TEST_FRAMEWORK
#define TEST_FORCE_RPORT 1 << 0
#define TEST_COMEDIA 1 << 1
#define TEST_AUTO_FORCE_RPORT 1 << 2
@@ -904,6 +909,8 @@ AST_TEST_DEFINE(sip_parse_nat_test)
return res;
}
+#endif
+
/*! \brief SIP test registration */
void sip_config_parser_register_tests(void)
{
diff --git a/channels/sip/reqresp_parser.c b/channels/sip/reqresp_parser.c
index 31832a33a..ecfb79d0e 100644
--- a/channels/sip/reqresp_parser.c
+++ b/channels/sip/reqresp_parser.c
@@ -258,7 +258,7 @@ int parse_uri_full(char *uri, const char *scheme, char **user, char **pass,
return error;
}
-
+#ifdef TEST_FRAMEWORK
AST_TEST_DEFINE(sip_parse_uri_full_test)
{
int res = AST_TEST_PASS;
@@ -514,7 +514,7 @@ AST_TEST_DEFINE(sip_parse_uri_full_test)
return res;
}
-
+#endif
int parse_uri(char *uri, const char *scheme, char **user, char **pass,
char **hostport, char **transport) {
@@ -530,6 +530,7 @@ int parse_uri(char *uri, const char *scheme, char **user, char **pass,
return ret;
}
+#ifdef TEST_FRAMEWORK
AST_TEST_DEFINE(sip_parse_uri_test)
{
int res = AST_TEST_PASS;
@@ -687,6 +688,7 @@ AST_TEST_DEFINE(sip_parse_uri_test)
return res;
}
+#endif
/*! \brief Get caller id name from SIP headers, copy into output buffer
*
@@ -817,6 +819,7 @@ const char *get_calleridname(const char *input, char *output, size_t outputsize)
return input;
}
+#ifdef TEST_FRAMEWORK
AST_TEST_DEFINE(get_calleridname_test)
{
int res = AST_TEST_PASS;
@@ -899,6 +902,7 @@ AST_TEST_DEFINE(get_calleridname_test)
return res;
}
+#endif
int get_name_and_number(const char *hdr, char **name, char **number)
{
@@ -940,6 +944,7 @@ int get_name_and_number(const char *hdr, char **name, char **number)
return 0;
}
+#ifdef TEST_FRAMEWORK
AST_TEST_DEFINE(get_name_and_number_test)
{
int res = AST_TEST_PASS;
@@ -1044,6 +1049,7 @@ AST_TEST_DEFINE(get_name_and_number_test)
return res;
}
+#endif
int get_in_brackets_const(const char *src,const char **start,int *length)
{
@@ -1176,6 +1182,7 @@ char *get_in_brackets(char *tmp)
return out;
}
+#ifdef TEST_FRAMEWORK
AST_TEST_DEFINE(get_in_brackets_test)
{
int res = AST_TEST_PASS;
@@ -1252,7 +1259,7 @@ AST_TEST_DEFINE(get_in_brackets_test)
return res;
}
-
+#endif
int parse_name_andor_addr(char *uri, const char *scheme, char **name,
char **user, char **pass, char **hostport,
@@ -1298,6 +1305,7 @@ int parse_name_andor_addr(char *uri, const char *scheme, char **name,
return parse_uri_full(uri, scheme, user, pass, hostport, params, headers, residue2);
}
+#ifdef TEST_FRAMEWORK
AST_TEST_DEFINE(parse_name_andor_addr_test)
{
int res = AST_TEST_PASS;
@@ -1427,6 +1435,7 @@ AST_TEST_DEFINE(parse_name_andor_addr_test)
return res;
}
+#endif
int get_comma(char *in, char **out)
{
@@ -1523,6 +1532,7 @@ int parse_contact_header(char *contactheader, struct contactliststruct *contactl
return last;
}
+#ifdef TEST_FRAMEWORK
AST_TEST_DEFINE(parse_contact_header_test)
{
int res = AST_TEST_PASS;
@@ -1668,6 +1678,7 @@ AST_TEST_DEFINE(parse_contact_header_test)
return res;
}
+#endif
/*!
* \brief Parse supported header in incoming packet
@@ -1755,6 +1766,7 @@ unsigned int parse_sip_options(const char *options, char *unsupported, size_t un
return profile;
}
+#ifdef TEST_FRAMEWORK
AST_TEST_DEFINE(sip_parse_options_test)
{
int res = AST_TEST_PASS;
@@ -1892,6 +1904,7 @@ AST_TEST_DEFINE(sip_parse_options_test)
return res;
}
+#endif
/*! \brief helper routine for sip_uri_cmp to compare URI parameters
*
@@ -2246,6 +2259,7 @@ int sip_uri_cmp(const char *input1, const char *input2)
#define URI_CMP_MATCH 0
#define URI_CMP_NOMATCH 1
+#ifdef TEST_FRAMEWORK
AST_TEST_DEFINE(sip_uri_cmp_test)
{
static const struct {
@@ -2362,6 +2376,7 @@ AST_TEST_DEFINE(sip_uri_cmp_test)
return test_res;
}
+#endif
void free_via(struct sip_via *v)
{
@@ -2448,6 +2463,7 @@ struct sip_via *parse_via(const char *header)
return v;
}
+#ifdef TEST_FRAMEWORK
AST_TEST_DEFINE(parse_via_test)
{
int res = AST_TEST_PASS;
@@ -2625,6 +2641,7 @@ AST_TEST_DEFINE(parse_via_test)
}
return res;
}
+#endif
void sip_request_parser_register_tests(void)
{
diff --git a/funcs/func_curl.c b/funcs/func_curl.c
index 61b05900b..c7a1c6e42 100644
--- a/funcs/func_curl.c
+++ b/funcs/func_curl.c
@@ -794,6 +794,7 @@ static struct ast_custom_function acf_curlopt = {
.write = acf_curlopt_write,
};
+#ifdef TEST_FRAMEWORK
AST_TEST_DEFINE(vulnerable_url)
{
const char *bad_urls [] = {
@@ -841,6 +842,7 @@ AST_TEST_DEFINE(vulnerable_url)
return res;
}
+#endif
static int unload_module(void)
{
diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index de8eb3e8a..40916684a 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -4118,6 +4118,7 @@ long ast_sip_threadpool_queue_size(void)
return ast_threadpool_queue_size(sip_threadpool);
}
+#ifdef TEST_FRAMEWORK
AST_TEST_DEFINE(xml_sanitization_end_null)
{
char sanitized[8];
@@ -4168,6 +4169,7 @@ AST_TEST_DEFINE(xml_sanitization_exceeds_buffer)
return AST_TEST_PASS;
}
+#endif
/*!
* \internal
diff --git a/res/res_pjsip_mwi.c b/res/res_pjsip_mwi.c
index 9eba335b5..d86c96c74 100644
--- a/res/res_pjsip_mwi.c
+++ b/res/res_pjsip_mwi.c
@@ -976,38 +976,12 @@ static int create_mwi_subscriptions_for_endpoint(void *obj, void *arg, int flags
{
RAII_VAR(struct mwi_subscription *, aggregate_sub, NULL, ao2_cleanup);
struct ast_sip_endpoint *endpoint = obj;
- char *endpoint_aors, *aor_name, *mailboxes, *mailbox;
- struct ao2_container *contacts = NULL;
+ char *mailboxes, *mailbox;
if (ast_strlen_zero(endpoint->subscription.mwi.mailboxes)) {
return 0;
}
- endpoint_aors = ast_strdupa(endpoint->aors);
-
- while ((aor_name = ast_strip(strsep(&endpoint_aors, ",")))) {
- RAII_VAR(struct ast_sip_aor *, aor, ast_sip_location_retrieve_aor(aor_name), ao2_cleanup);
-
- if (!aor) {
- continue;
- }
-
- contacts = ast_sip_location_retrieve_aor_contacts(aor);
- if (!contacts || (ao2_container_count(contacts) == 0)) {
- ao2_cleanup(contacts);
- contacts = NULL;
- continue;
- }
-
- break;
- }
-
- if (!contacts) {
- return 0;
- }
-
- ao2_ref(contacts, -1);
-
if (endpoint->subscription.mwi.aggregate) {
aggregate_sub = mwi_subscription_alloc(endpoint, 0, NULL);
if (!aggregate_sub) {
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 8055e877f..9db5aefe7 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -2592,7 +2592,7 @@ static int ast_rtp_new(struct ast_rtp_instance *instance,
/* Set default parameters on the newly created RTP structure */
rtp->ssrc = ast_random();
- rtp->seqno = ast_random() & 0xffff;
+ rtp->seqno = ast_random() & 0x7fff;
rtp->strict_rtp_state = (strictrtp ? STRICT_RTP_LEARN : STRICT_RTP_OPEN);
if (strictrtp) {
rtp_learning_seq_init(&rtp->rtp_source_learn, (uint16_t)rtp->seqno);