Skip to content

docs: correct function and statistic names the modules do not export - #4250

Open
denys-i-didww wants to merge 1 commit into
OpenSIPS:masterfrom
denys-i-didww:docs/names-the-code-does-not-export
Open

docs: correct function and statistic names the modules do not export#4250
denys-i-didww wants to merge 1 commit into
OpenSIPS:masterfrom
denys-i-didww:docs/names-the-code-does-not-export

Conversation

@denys-i-didww

@denys-i-didww denys-i-didww commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

#4241 corrected five parameter names the modules do not export, and its Scope section
said the same class in the Exported Functions, MI Commands and Statistics sections was
left for a separate change. This is that change. Three names in three modules; the code is
right in each and the page is wrong.

Module Section README documents Code exports
janus Exported Functions janus_send_requeest() janus_send_requestjanus_mod.c:67
event_sqs Exported Functions sqs_publish_message() sqs_send_messageevent_sqs.c:65
registrar Exported Statistics defaults_expires default_expirereg_mod.c:233

A script calling a function the module does not export does not load, and an MI query for
a statistic that does not exist returns Statistics Not Found.

Details

janus is a plain misspelling — requeest — and only in the heading, README.md:163.
Two lines below, the example's title and the example itself already read
janus_send_request(), so the page contradicts itself and the heading is the odd one out.

event_sqs documents the name of the C function rather than the name of the script
command. event_sqs.c:65 reads

{"sqs_send_message", (cmd_function)sqs_publish_message, {

so sqs_publish_message is the static implementation (:48, :425) and
sqs_send_message is what a script may call. The README uses the implementation's name in
all four places — the prose at :77, the heading at :112, the example title at :130
and the example line at :134 — and nothing on the page corrects the reader.

registrar documents the statistic as defaults_expires, while stat_export_t
declares default_expire. The documented name is one letter away from the parameter
default_expires, which does exist (reg_mod.c:203), and the description under the
heading — "The value of default_expires parameter" — correctly describes that parameter;
the statistic does mirror it (reg_mod.c:405). Only the heading changes. The module's
other four documented statistics match stat_export_t exactly and are left alone.

Reproduced

opensips 4.1.0-dev, Debian 12, built from source.

The function name fails when the script is loaded, not at modparam parsing — a different
failure point from #4241, which is part of why this is a separate PR:

$ opensips -C -f j.cfg            # janus_send_requeest("a","b"); as the page reads today
CRITICAL:core:yyerror: parse error in j.cfg:9:33-34: unknown command <janus_send_requeest>, missing loadmodule?

$ opensips -C -f j.cfg            # janus_send_request("a","b"); as this PR documents
NOTICE:core:main: config file ok, exiting...

The statistic fails at the MI query, a third failure point. registrar running with
usrloc, signaling, tm and mi_http:

$ ... "method":"get_statistics","params":{"statistics":["defaults_expires"]}
{"jsonrpc":"2.0","error":{"code":404,"message":"Statistics Not Found"},"id":1}

$ ... "method":"get_statistics","params":{"statistics":["default_expire"]}
{"jsonrpc":"2.0","result":{"registrar:default_expire":3600},"id":1}

Listing every statistic on that instance returns registrar:default_expire and no
defaults_expires.

event_sqs is the one row not run. It links against libaws-cpp-sdk-sqs, which Debian
does not package, so the module cannot be built without building the AWS SDK first.
Compiling event_sqs.c on its own does work, and nm on the object shows
sqs_publish_message as a local text symbol — the static function — while
sqs_send_message is the name in cmds[]. That is source-level evidence, not a run, and
I would rather say so than imply otherwise.

Scope

Three renames, nothing else. The same sweep, re-run against 08e7f1c over every
module's Exported Functions, Asynchronous Functions, MI Functions, Statistics and
Pseudo-Variables sections, turns up two more documented names — presence_callinfo's
sca_set_calling_line() and ratelimit's rl_bin_status — that are not renames at all:
neither has an implementation anywhere in the tree, so there is nothing to point the
documentation at and the fix is yours to choose. They need an issue, not a patch, and are
not in this PR.

Everything else that looked like a mismatch is not one, and is recorded here so it is not
re-reported: MI command names come from #defines (usrloc, rtpengine, pike and
others), callops's E_CALL_TRANSFER and E_CALL_HOLD are built by token pasting from
"E_CALL_" #_name, registrar and mid_registrar's pn_process_purr() comes from a
macro in lib/reg, and call_center, janus and rr have #### sub-headings where
their siblings use ###, which a heading scan reads as names.

Compatibility

Documentation only, no behaviour change. Nothing that works today stops working: none of
the three documented names could ever have been used.


AI assistance disclosure. The defect list and the wording of this change were produced
with AI assistance. Every item was checked against the source before submission:

  • each exported name is the literal in the module's own export array — janus_mod.c:67
    (cmd_export_t), event_sqs.c:65 (cmd_export_t), reg_mod.c:233 (stat_export_t);
  • each documented name appears nowhere in the tree as a string literal — repository-wide
    grep over *.c, *.h and *.cpp, which is what distinguishes these three from the
    macro-defined names listed under Scope;
  • every occurrence in each README was changed, so no page is left carrying both spellings
    — one in janus, four in event_sqs, one in registrar;
  • registrar's other four statistics were checked against stat_export_t and left alone,
    and the parameter default_expires it is confused with is real — reg_mod.c:203;
  • the two failures and the two successes were run, not inferred — the output is quoted
    above, on a build of this branch;
  • event_sqs was not run, and the reason and the weaker evidence are stated in place;
  • the two names with no implementation were confirmed absent by the same repository-wide
    grep before being excluded from this PR.

…[skip ci]

The same defect as OpenSIPS#4241 in the sections it did not cover. Three names,
three modules: janus documents janus_send_requeest() while the module
exports janus_send_request(); event_sqs documents sqs_publish_message(),
which is the static C function behind the script command, exported as
sqs_send_message(); registrar documents the statistic defaults_expires
while stat_export_t declares default_expire.

Documentation only, no behaviour change. The code is right in all three.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant