Skip to content

Commit

Permalink
install: Target 21.2.0, minor module updates.
Browse files Browse the repository at this point in the history
* install: Target 21.2.0.
* res_phreaknet: Remove inappropriate hard module dependency.
* app_verify: Add debug logs for failed ENUM verifications.
  • Loading branch information
InterLinked1 committed Mar 9, 2024
1 parent 1c5adf8 commit c047f6e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
19 changes: 18 additions & 1 deletion apps/app_verify.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,7 @@ static int resolve_verify_request(struct ast_channel *chan, char *url, struct as
}
ast_debug(1, "curl result is: %s\n", ast_str_buffer(strbuf));
} else { /* ENUM */
int res;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(number);
AST_APP_ARG(tech);
Expand Down Expand Up @@ -821,7 +822,13 @@ static int resolve_verify_request(struct ast_channel *chan, char *url, struct as
strncat(num, tmp, sizeof(num) - strlen(num) - 1);
}
}
ast_get_enum(chan, num, dest, sizeof(dest), tech, sizeof(tech), args.zone, args.options, record, NULL);
res = ast_get_enum(chan, num, dest, sizeof(dest), tech, sizeof(tech), args.zone, args.options, record, NULL);
if (res < 0) {
return -1;
} else if (!res) {
ast_log(LOG_WARNING, "ENUM lookup failed for ast_get_enum(%s,%s,%s,%s,%u)\n", num, dest, args.zone, args.options, record);
return -1;
}
ast_debug(1, "ENUM lookup: %s\n", dest);
p = strchr(dest, ':');
if (p && strcasecmp(tech, "ALL") && !strchr(args.options, 'u')) {
Expand Down Expand Up @@ -1464,6 +1471,14 @@ static int verify_exec(struct ast_channel *chan, const char *data)
}
vresult = viaverify ? remote_result : code_good;
success = 1;
} else if (!strcmp(peerip, "127.0.0.1")) {
if (viaverify) {
ast_debug(1, "Upstream node is loopback, trusting its assignment of '%s'\n", remote_result);
} else {
ast_debug(1, "Upstream node is loopback\n");
}
vresult = viaverify ? remote_result : code_good;
success = 1;
} else {
vresult = viaverify ? code_spoof : code_fail;
}
Expand Down Expand Up @@ -2065,6 +2080,7 @@ static int unload_module(void)

AST_RWLIST_UNLOCK(&verifys);

ast_mutex_destroy(&ss_lock);
return 0;
}

Expand All @@ -2085,6 +2101,7 @@ static int load_module(void)
ast_mutex_init(&ss_lock);

if (reload_verify(0)) {
ast_mutex_destroy(&ss_lock);
return AST_MODULE_LOAD_DECLINE;
}

Expand Down
5 changes: 1 addition & 4 deletions phreaknet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,7 @@ run_testsuite_tests() {
cd $AST_SOURCE_PARENT_DIR/testsuite

# run manually for good measure, and so we get the full output
apt-get install -y python3.11-venv
./setupVenv.sh

run_testsuite_test "apps/assert"
Expand Down Expand Up @@ -1699,10 +1700,6 @@ phreak_patches() { # $1 = $PATCH_DIR, $2 = $AST_SRC_DIR
## merged into master, not yet in a release version (use asterisk_pr_if, e.g. asterisk_pr_if 399 210100 200600 182100)

## Unmerged patches: remove once merged
if [ -f main/logger.xml ]; then
asterisk_pr_unconditional 540 # critical linking fix for 21.1.0-rc1
fi
asterisk_pr_unconditional 568 # critical fix for Read, etc.
git_patch "config_c_fix_template_inheritance_overrides.patch" # config.c: fix template inheritance/overrides

if [ $AST_MAJOR_VER -lt 21 ]; then
Expand Down
4 changes: 2 additions & 2 deletions res/res_phreaknet.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<depend>res_crypto</depend>
<depend>curl</depend>
<depend>pbx_config</depend>
<depend>app_verify</depend>
<use type="module">app_verify</use>
<support_level>extended</support_level>
***/

Expand Down Expand Up @@ -2256,5 +2256,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PhreakNet Enhancement
.unload = unload_module,
.reload = reload_module,
.load_pri = AST_MODPRI_CDR_DRIVER,
.requires = "cdr,pbx_config,app_verify",
.requires = "cdr,pbx_config",
);

0 comments on commit c047f6e

Please sign in to comment.