Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pjsip-apps/src/pjsua/pjsua_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -2186,7 +2186,6 @@ static pj_status_t app_init(void)
/* Add accounts */
for (i=0; i<app_config.acc_cnt; ++i) {
app_config.acc_cfg[i].rtp_cfg = app_config.rtp_cfg;
app_config.acc_cfg[i].reg_retry_interval = 300;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this override gone, --rereg-delay=0 (or a non-numeric value, which pj_strtoul() parses as 0) now sets reg_retry_interval to 0, which disables auto re-registration entirely: after a 503/408 or a transport disconnect the account stays unregistered, with no error at startup. Previously this was masked by the hardcoded 300.

Could we either validate the value in OPT_REG_RETRY_INTERVAL (reject 0 / non-numeric), or document in the --rereg-delay help text that 0 disables re-registration?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. A 0 now reaches reg_retry_interval, where pjsua.h documents it as disabling auto re-registration, and the option could not produce 0 before because the app overwrote it. I've added a line to the --rereg-delay usage text saying so (2dcd7ca). I left non-numeric values alone: pj_strtoul() returns 0 for them and --reg-use-proxy is parsed the same way. Happy to reject them if you'd prefer.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing out the jitter in your review. As you suggested it went separately: the issue is #5318 and the fix is #5319.

app_config.acc_cfg[i].reg_first_retry_interval = 60;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this changes the first retry after a failure from ~60 s (50–70 s with randomisation) to the library default of 0–10 s for every command-line account, which isn't needed to honour --rereg-delay. Since there's no option to set reg_first_retry_interval, users relying on the old behaviour can't get it back.

Suggest keeping this line and only dropping the reg_retry_interval override, unless the change in first-retry behaviour is intended (in which case it'd be worth mentioning in the description).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I've dropped that commit and left reg_first_retry_interval = 60 as it is: nothing sets it, and it isn't needed to honour the option. The description now says that --rereg-delay governs the retries after the first one, and that the first still comes after about 60 s.


app_config_init_video(&app_config.acc_cfg[i]);
Expand Down
1 change: 1 addition & 0 deletions pjsip-apps/src/pjsua/pjsua_app_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ static void usage(void)
PJSUA_REG_INTERVAL);
printf(" --rereg-delay=SEC Optional auto retry registration interval (default %d)\n",
PJSUA_REG_RETRY_INTERVAL);
puts (" 0 disables auto re-registration");
puts (" --reg-use-proxy=N Control the use of proxy settings in REGISTER.");
puts (" 0=no proxy, 1=outbound only, 2=acc only, 3=all (default)");
puts (" --server-affinity[=on|off] Pin same SIP server across requests");
Expand Down
Loading