Skip to content

Commit

Permalink
Move "Late Offer Answer Mode" parameter setting from configuration file
Browse files Browse the repository at this point in the history
to the application command
  • Loading branch information
Oleksandr-Goodicus committed Mar 2, 2024
1 parent 91cb0ca commit bc4114c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
13 changes: 1 addition & 12 deletions pjsip-apps/src/pjsua/pjsua_app_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ static void usage(void)
#endif
puts (" --set-qos Enable QoS tagging for SIP and media.");
puts (" --no-mci Disable message composition indication (RFC 3994)");
puts (" --set-loam Enable Late offer answer model");
puts (" --local-port=port Set TCP/UDP port. This implicitly enables both ");
puts (" TCP and UDP transports on the specified port, unless");
puts (" if TCP or UDP is disabled.");
Expand Down Expand Up @@ -394,8 +393,7 @@ static pj_status_t parse_args(int argc, char *argv[],
OPT_TLS_NEG_TIMEOUT, OPT_TLS_CIPHER,
OPT_CAPTURE_DEV, OPT_PLAYBACK_DEV,
OPT_CAPTURE_LAT, OPT_PLAYBACK_LAT, OPT_NO_TONES, OPT_JB_MAX_SIZE,
OPT_STDOUT_REFRESH, OPT_STDOUT_REFRESH_TEXT, OPT_IPV6, OPT_QOS,
OPT_MCI, OPT_LOAM,
OPT_STDOUT_REFRESH, OPT_STDOUT_REFRESH_TEXT, OPT_IPV6, OPT_QOS, OPT_MCI,
#ifdef _IONBF
OPT_STDOUT_NO_BUF,
#endif
Expand Down Expand Up @@ -537,7 +535,6 @@ static pj_status_t parse_args(int argc, char *argv[],
#endif
{ "set-qos", 0, 0, OPT_QOS},
{ "no-mci", 0, 0, OPT_MCI},
{ "set-loam", 0, 0, OPT_LOAM},
{ "use-timer", 1, 0, OPT_TIMER},
{ "timer-se", 1, 0, OPT_TIMER_SE},
{ "timer-min-se", 1, 0, OPT_TIMER_MIN_SE},
Expand Down Expand Up @@ -1474,9 +1471,6 @@ static pj_status_t parse_args(int argc, char *argv[],
case OPT_MCI:
cfg->no_mci = PJ_TRUE;
break;
case OPT_LOAM:
cfg->enable_loam = PJ_TRUE;
break;
case OPT_VIDEO:
cfg->vid.vid_cnt = 1;
cfg->vid.in_auto_show = PJ_TRUE;
Expand Down Expand Up @@ -1995,11 +1989,6 @@ int write_settings(pjsua_app_config *config, char *buf, pj_size_t max)
pj_strcat2(&cfg, "--no-mci\n");
}

/* Late Offer Answer Model */
if (config->enable_loam) {
pj_strcat2(&cfg, "--set-loam\n");
}

/* UDP Transport. */
pj_ansi_snprintf(line, sizeof(line), "--local-port %d\n",
config->udp_cfg.port);
Expand Down
16 changes: 16 additions & 0 deletions pjsip-apps/src/pjsua/pjsua_app_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ static void keystroke_help()
puts("| dq Dump curr. call quality | cd Disconnect port | dc Dump config |");
puts("| | V Adjust audio Volume | f Save config |");
puts("| S Send arbitrary REQUEST | Cp Codec priorities | |");
puts("| +l Set Late Offer Answer Mode | | |");
puts("| -l Unset Late Offer Answer Mode | | |");
puts("+-----------------------------------------------------------------------------+");
#if PJSUA_HAS_VIDEO
puts("| Video: \"vid help\" for more info |");
Expand Down Expand Up @@ -1088,6 +1090,11 @@ static void ui_delete_account()
}
}

static void ui_unset_loam_mode()
{
app_config.enable_loam = PJ_FALSE;
}

static void ui_call_hold()
{
if (current_call != -1) {
Expand Down Expand Up @@ -1453,6 +1460,11 @@ static void ui_send_arbitrary_request()
}
}

static void ui_set_loam_mode()
{
app_config.enable_loam = PJ_TRUE;
}

static void ui_echo(char menuin[])
{
if (pj_ansi_strnicmp(menuin, "echo", 4)==0) {
Expand Down Expand Up @@ -1930,6 +1942,8 @@ void legacy_main(void)
ui_add_buddy();
} else if (menuin[1] == 'a') {
ui_add_account(&app_config.rtp_cfg);
} else if (menuin[1] == 'l') {
ui_set_loam_mode();
} else {
printf("Invalid input %s\n", menuin);
}
Expand All @@ -1940,6 +1954,8 @@ void legacy_main(void)
ui_delete_buddy();
} else if (menuin[1] == 'a') {
ui_delete_account();
} else if (menuin[1] == 'l') {
ui_unset_loam_mode();
} else {
printf("Invalid input %s\n", menuin);
}
Expand Down

0 comments on commit bc4114c

Please sign in to comment.