Compare commits

...

6 Commits

Author SHA1 Message Date
Asterisk Development Team
c6c7103efa Update for 20.0.0 2022-10-19 09:31:39 -05:00
Asterisk Development Team
dfadc09bf5 Update for 20.0.0-rc2 2022-09-28 07:55:43 -05:00
Naveen Albert
e7dd8f5bcb res_pjsip_geolocation: Change some notices to debugs.
If geolocation is not in use for an endpoint, the NOTICE
log level is currently spammed with messages about this,
even though nothing is wrong and these messages provide
no real value. These log messages are therefore changed
to debugs.

ASTERISK-30241 #close

Change-Id: I656b355d812f67cc0f0fdf09b00b0e1458598bb4
(cherry picked from commit 8afb313a43)
2022-09-28 07:29:47 -05:00
George Joseph
ab9d57a3dd res_crypto: Memory issues and uninitialized variable errors
ASTERISK-30235

Change-Id: Ia1e326e7b52cd06fd5e6c9009e3e63193c92f6cd
2022-09-19 05:33:20 -06:00
George Joseph
45f1fd30a7 res_geolocation: Fix issues exposed by compiling with -O2
Fixed "may be used uninitialized" errors in geoloc_config.c.

ASTERISK-30234

Change-Id: I1ea336bf7abbc16fa59b75720f0db8f1d960b3d4
2022-09-16 08:43:05 -06:00
Asterisk Development Team
687f394572 Update for 20.0.0-rc1 2022-09-14 09:50:36 -05:00
15 changed files with 112934 additions and 16 deletions

1
.lastclean Normal file
View File

@@ -0,0 +1 @@
40

1
.version Normal file
View File

@@ -0,0 +1 @@
20.0.0

104246
ChangeLog Normal file

File diff suppressed because it is too large Load Diff

1836
asterisk-20.0.0-summary.html Normal file

File diff suppressed because one or more lines are too long

3804
asterisk-20.0.0-summary.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,41 @@
CREATE TABLE alembic_version (
version_num VARCHAR(32) NOT NULL,
CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num)
);
-- Running upgrade -> 210693f3123d
CREATE TABLE cdr (
accountcode VARCHAR(20),
src VARCHAR(80),
dst VARCHAR(80),
dcontext VARCHAR(80),
clid VARCHAR(80),
channel VARCHAR(80),
dstchannel VARCHAR(80),
lastapp VARCHAR(80),
lastdata VARCHAR(80),
start DATETIME,
answer DATETIME,
end DATETIME,
duration INTEGER,
billsec INTEGER,
disposition VARCHAR(45),
amaflags VARCHAR(45),
userfield VARCHAR(256),
uniqueid VARCHAR(150),
linkedid VARCHAR(150),
peeraccount VARCHAR(20),
sequence INTEGER
);
INSERT INTO alembic_version (version_num) VALUES ('210693f3123d');
-- Running upgrade 210693f3123d -> 54cde9847798
ALTER TABLE cdr MODIFY accountcode VARCHAR(80) NULL;
ALTER TABLE cdr MODIFY peeraccount VARCHAR(80) NULL;
UPDATE alembic_version SET version_num='54cde9847798' WHERE alembic_version.version_num = '210693f3123d';

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,35 @@
CREATE TABLE alembic_version (
version_num VARCHAR(32) NOT NULL,
CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num)
);
-- Running upgrade -> a2e9769475e
CREATE TABLE voicemail_messages (
dir VARCHAR(255) NOT NULL,
msgnum INTEGER NOT NULL,
context VARCHAR(80),
macrocontext VARCHAR(80),
callerid VARCHAR(80),
origtime INTEGER,
duration INTEGER,
recording BLOB,
flag VARCHAR(30),
category VARCHAR(30),
mailboxuser VARCHAR(30),
mailboxcontext VARCHAR(30),
msg_id VARCHAR(40)
);
ALTER TABLE voicemail_messages ADD CONSTRAINT voicemail_messages_dir_msgnum PRIMARY KEY (dir, msgnum);
CREATE INDEX voicemail_messages_dir ON voicemail_messages (dir);
INSERT INTO alembic_version (version_num) VALUES ('a2e9769475e');
-- Running upgrade a2e9769475e -> 39428242f7f5
ALTER TABLE voicemail_messages MODIFY recording BLOB(4294967295) NULL;
UPDATE alembic_version SET version_num='39428242f7f5' WHERE alembic_version.version_num = 'a2e9769475e';

View File

@@ -0,0 +1,45 @@
BEGIN;
CREATE TABLE alembic_version (
version_num VARCHAR(32) NOT NULL,
CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num)
);
-- Running upgrade -> 210693f3123d
CREATE TABLE cdr (
accountcode VARCHAR(20),
src VARCHAR(80),
dst VARCHAR(80),
dcontext VARCHAR(80),
clid VARCHAR(80),
channel VARCHAR(80),
dstchannel VARCHAR(80),
lastapp VARCHAR(80),
lastdata VARCHAR(80),
start TIMESTAMP WITHOUT TIME ZONE,
answer TIMESTAMP WITHOUT TIME ZONE,
"end" TIMESTAMP WITHOUT TIME ZONE,
duration INTEGER,
billsec INTEGER,
disposition VARCHAR(45),
amaflags VARCHAR(45),
userfield VARCHAR(256),
uniqueid VARCHAR(150),
linkedid VARCHAR(150),
peeraccount VARCHAR(20),
sequence INTEGER
);
INSERT INTO alembic_version (version_num) VALUES ('210693f3123d');
-- Running upgrade 210693f3123d -> 54cde9847798
ALTER TABLE cdr ALTER COLUMN accountcode TYPE VARCHAR(80);
ALTER TABLE cdr ALTER COLUMN peeraccount TYPE VARCHAR(80);
UPDATE alembic_version SET version_num='54cde9847798' WHERE alembic_version.version_num = '210693f3123d';
COMMIT;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,39 @@
BEGIN;
CREATE TABLE alembic_version (
version_num VARCHAR(32) NOT NULL,
CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num)
);
-- Running upgrade -> a2e9769475e
CREATE TABLE voicemail_messages (
dir VARCHAR(255) NOT NULL,
msgnum INTEGER NOT NULL,
context VARCHAR(80),
macrocontext VARCHAR(80),
callerid VARCHAR(80),
origtime INTEGER,
duration INTEGER,
recording BYTEA,
flag VARCHAR(30),
category VARCHAR(30),
mailboxuser VARCHAR(30),
mailboxcontext VARCHAR(30),
msg_id VARCHAR(40)
);
ALTER TABLE voicemail_messages ADD CONSTRAINT voicemail_messages_dir_msgnum PRIMARY KEY (dir, msgnum);
CREATE INDEX voicemail_messages_dir ON voicemail_messages (dir);
INSERT INTO alembic_version (version_num) VALUES ('a2e9769475e');
-- Running upgrade a2e9769475e -> 39428242f7f5
ALTER TABLE voicemail_messages ALTER COLUMN recording TYPE BYTEA;
UPDATE alembic_version SET version_num='39428242f7f5' WHERE alembic_version.version_num = 'a2e9769475e';
COMMIT;

View File

@@ -316,9 +316,13 @@ void ast_test_set_result(struct ast_test *test, enum ast_test_result_state state
void ast_test_capture_free(struct ast_test_capture *capture)
{
if (capture) {
free(capture->outbuf);
/*
* Need to use ast_std_free because this memory wasn't
* allocated by the astmm functions.
*/
ast_std_free(capture->outbuf);
capture->outbuf = NULL;
free(capture->errbuf);
ast_std_free(capture->errbuf);
capture->errbuf = NULL;
}
capture->pid = -1;
@@ -330,6 +334,7 @@ int ast_test_capture_command(struct ast_test_capture *capture, const char *file,
int fd0[2] = { -1, -1 }, fd1[2] = { -1, -1 }, fd2[2] = { -1, -1 };
pid_t pid = -1;
int status = 0;
FILE *cmd = NULL, *out = NULL, *err = NULL;
memset(capture, 0, sizeof(*capture));
capture->pid = capture->exitcode = -1;
@@ -379,8 +384,6 @@ int ast_test_capture_command(struct ast_test_capture *capture, const char *file,
exit(1);
} else {
FILE *cmd = NULL, *out = NULL, *err = NULL;
char buf[BUFSIZ];
int wstatus, n, nfds;
fd_set readfds, writefds;

View File

@@ -187,7 +187,7 @@ static int geoloc_profile_apply_handler(const struct ast_sorcery *sorcery, void
struct ast_geoloc_location *location;
const char *id = ast_sorcery_object_get_id(profile);
enum ast_geoloc_validate_result result;
enum ast_geoloc_format format;
enum ast_geoloc_format format = AST_GEOLOC_FORMAT_NONE;
int rc = 0;
if (!ast_strlen_zero(profile->location_reference)) {

View File

@@ -145,7 +145,7 @@ static int handle_incoming_request(struct ast_sip_session *session, struct pjsip
char *geoloc_routing_hdr_value = NULL;
char *geoloc_uri = NULL;
int rc = 0;
RAII_VAR(struct ast_str *, buf, ast_str_create(1024), ast_free);
RAII_VAR(struct ast_str *, buf, NULL, ast_free);
pjsip_generic_string_hdr *geoloc_hdr = NULL;
pjsip_generic_string_hdr *geoloc_routing_hdr = NULL;
SCOPE_ENTER(3, "%s\n", session_name);
@@ -191,7 +191,7 @@ static int handle_incoming_request(struct ast_sip_session *session, struct pjsip
"Done.\n", session_name,
PJSTR_PRINTF_VAR(geoloc_hdr->hvalue));
} else {
SCOPE_EXIT_LOG_RTN_VALUE(0, LOG_NOTICE, "%s: Endpoint has no geoloc_incoming_call_profile. "
SCOPE_EXIT_RTN_VALUE(0, "%s: Endpoint has no geoloc_incoming_call_profile. "
"Done.\n", session_name);
}
}
@@ -209,6 +209,11 @@ static int handle_incoming_request(struct ast_sip_session *session, struct pjsip
}
}
buf = ast_str_create(1024);
if (!buf) {
SCOPE_EXIT_LOG_RTN_VALUE(0, LOG_WARNING, "%s: Unable to allocate buf\n", session_name);
}
if (config_profile->precedence != AST_GEOLOC_PRECED_DISCARD_CONFIG) {
config_eprofile = ast_geoloc_eprofile_create_from_profile(config_profile);
if (!config_eprofile) {
@@ -469,7 +474,7 @@ static void handle_outgoing_request(struct ast_sip_session *session, struct pjsi
RAII_VAR(struct ast_geoloc_eprofile *, config_eprofile, NULL, ao2_cleanup);
RAII_VAR(struct ast_geoloc_eprofile *, incoming_eprofile, NULL, ao2_cleanup);
struct ast_geoloc_eprofile *final_eprofile = NULL;
RAII_VAR(struct ast_str *, buf, ast_str_create(1024), ast_free);
RAII_VAR(struct ast_str *, buf, NULL, ast_free);
struct ast_datastore *ds = NULL; /* The channel cleans up ds */
pjsip_msg_body *orig_body = NULL;
pjsip_generic_string_hdr *geoloc_hdr = NULL;
@@ -478,11 +483,6 @@ static void handle_outgoing_request(struct ast_sip_session *session, struct pjsi
const char *uri;
SCOPE_ENTER(3, "%s\n", session_name);
if (!buf) {
SCOPE_EXIT_LOG_RTN(LOG_WARNING, "%s: Unable to allocate buf\n",
session_name);
}
if (!endpoint) {
SCOPE_EXIT_LOG_RTN(LOG_WARNING, "%s: Session has no endpoint. Skipping.\n",
session_name);
@@ -494,8 +494,8 @@ static void handle_outgoing_request(struct ast_sip_session *session, struct pjsi
}
if (ast_strlen_zero(endpoint->geoloc_outgoing_call_profile)) {
SCOPE_EXIT_LOG_RTN(LOG_NOTICE, "%s: Endpoint has no geoloc_outgoing_call_profile. "
"Skipping.\n", session_name);
SCOPE_EXIT_RTN("%s: Endpoint has no geoloc_outgoing_call_profile. Skipping.\n",
session_name);
}
config_profile = ast_geoloc_get_profile(endpoint->geoloc_outgoing_call_profile);
@@ -578,6 +578,11 @@ static void handle_outgoing_request(struct ast_sip_session *session, struct pjsi
ast_geoloc_eprofile_refresh_location(final_eprofile);
}
buf = ast_str_create(1024);
if (!buf) {
SCOPE_EXIT_LOG_RTN(LOG_WARNING, "%s: Unable to allocate buf\n", session_name);
}
if (final_eprofile->format == AST_GEOLOC_FORMAT_URI) {
uri = ast_geoloc_eprofile_to_uri(final_eprofile, channel, &buf, session_name);
if (!uri) {

View File

@@ -49,7 +49,7 @@ static const char *old_key_dir = NULL;
static char *hexstring(const unsigned char *data, unsigned datalen)
{
char *buf = alloca(datalen * 2 + 1);
char *buf = ast_malloc(datalen * 2 + 1);
unsigned n;
for (n = 0; n < datalen; ++n) {
@@ -532,6 +532,7 @@ AST_TEST_DEFINE(crypto_aes_encrypt)
res = AST_TEST_PASS;
cleanup:
ast_free(args[KEY]);
ast_test_capture_free(&cap);
return res;
}
@@ -610,6 +611,7 @@ AST_TEST_DEFINE(crypto_aes_decrypt)
res = AST_TEST_PASS;
cleanup:
ast_free(args[KEY]);
ast_test_capture_free(&cap);
return res;
}