Skip to content

Commit

Permalink
Add an option to disable default pjsua behaviour to not send
Browse files Browse the repository at this point in the history
Message Composition Information (RFC-3994).
The option name is "--no-mci".
  • Loading branch information
Oleksandr-Goodicus committed Feb 21, 2024
1 parent caaf1b7 commit fe3dc8b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pjsip-apps/src/pjsua/pjsua_app_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ typedef struct pjsua_app_config
pj_bool_t no_refersub;
pj_bool_t ipv6;
pj_bool_t enable_qos;
pj_bool_t enable_mci;
pj_bool_t no_mci;
pj_bool_t no_tcp;
pj_bool_t no_udp;
pj_bool_t use_tls;
Expand Down
10 changes: 5 additions & 5 deletions pjsip-apps/src/pjsua/pjsua_app_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ static void usage(void)
puts (" --ipv6 Create SIP IPv6 transports.");
#endif
puts (" --set-qos Enable QoS tagging for SIP and media.");
puts (" --no-mci Disable message composition indication (RFC 3994)");
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 @@ -226,7 +227,6 @@ static void usage(void)
puts (" --accept-redirect=N Specify how to handle call redirect (3xx) response.");
puts (" 0: reject, 1: follow automatically,");
puts (" 2: follow + replace To header (default), 3: ask");
puts (" --set-mci Use message composition indication RFC 3994");

puts ("");
puts ("CLI options:");
Expand Down Expand Up @@ -534,7 +534,7 @@ static pj_status_t parse_args(int argc, char *argv[],
{ "ipv6", 0, 0, OPT_IPV6},
#endif
{ "set-qos", 0, 0, OPT_QOS},
{ "set-mci", 0, 0, OPT_MCI},
{ "no-mci", 0, 0, OPT_MCI},
{ "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 @@ -1469,7 +1469,7 @@ static pj_status_t parse_args(int argc, char *argv[],
cfg->udp_cfg.qos_params.dscp_val = 0x18;
break;
case OPT_MCI:
cfg->enable_mci = PJ_TRUE;
cfg->no_mci = PJ_TRUE;
break;
case OPT_VIDEO:
cfg->vid.vid_cnt = 1;
Expand Down Expand Up @@ -1985,8 +1985,8 @@ int write_settings(pjsua_app_config *config, char *buf, pj_size_t max)
}

/* Message Composition Indication */
if (config->enable_mci) {
pj_strcat2(&cfg, "--set-mci\n");
if (config->no_mci) {
pj_strcat2(&cfg, "--no-mci\n");
}
/* UDP Transport. */
pj_ansi_snprintf(line, sizeof(line), "--local-port %d\n",
Expand Down
4 changes: 2 additions & 2 deletions pjsip-apps/src/pjsua/pjsua_app_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ static void ui_send_instant_message()


/* Send typing indication. */
if (app_config.enable_mci) {
if (!app_config.no_mci) {
if (i != -1)
pjsua_call_send_typing_ind(i, PJ_TRUE, NULL);
else {
Expand All @@ -835,7 +835,7 @@ static void ui_send_instant_message()

/* Input the IM . */
if (!simple_input("Message", text, sizeof(text))) {
if (app_config.enable_mci) {
if (!app_config.no_mci) {
/*
* Cancelled.
* Send typing notification too, saying we're not typing.
Expand Down

0 comments on commit fe3dc8b

Please sign in to comment.