Changeset 3172 for pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
- Timestamp:
- May 13, 2010 5:22:51 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r3128 r3172 179 179 puts (" --use-ims Enable 3GPP/IMS related settings on this account"); 180 180 #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 181 puts (" --use-srtp=N Use SRTP? 0:disabled, 1:optional, 2:mandatory (def:0)"); 181 puts (" --use-srtp=N Use SRTP? 0:disabled, 1:optional, 2:mandatory,"); 182 puts (" 3:optional by duplicating media offer (def:0)"); 182 183 puts (" --srtp-secure=N SRTP require secure SIP? 0:no, 1:tls, 1:sips (def:1)"); 183 184 #endif … … 1093 1094 case OPT_USE_SRTP: 1094 1095 app_config.cfg.use_srtp = my_atoi(pj_optarg); 1095 if (!pj_isdigit(*pj_optarg) || app_config.cfg.use_srtp > 2) {1096 if (!pj_isdigit(*pj_optarg) || app_config.cfg.use_srtp > 3) { 1096 1097 PJ_LOG(1,(THIS_FILE, "Invalid value for --use-srtp option")); 1097 1098 return -1; 1099 } 1100 if ((int)app_config.cfg.use_srtp == 3) { 1101 /* SRTP optional mode with duplicated media offer */ 1102 app_config.cfg.use_srtp = PJMEDIA_SRTP_OPTIONAL; 1103 app_config.cfg.srtp_optional_dup_offer = PJ_TRUE; 1104 cur_acc->srtp_optional_dup_offer = PJ_TRUE; 1098 1105 } 1099 1106 cur_acc->use_srtp = app_config.cfg.use_srtp; … … 1504 1511 /* SRTP */ 1505 1512 if (acc_cfg->use_srtp) { 1506 pj_ansi_sprintf(line, "--use-srtp %i\n", 1507 (int)acc_cfg->use_srtp); 1513 int use_srtp = (int)acc_cfg->use_srtp; 1514 if (use_srtp == PJMEDIA_SRTP_OPTIONAL && 1515 acc_cfg->srtp_optional_dup_offer) 1516 { 1517 use_srtp = 3; 1518 } 1519 pj_ansi_sprintf(line, "--use-srtp %i\n", use_srtp); 1520 pj_strcat2(result, line); 1521 } 1522 if (acc_cfg->srtp_secure_signaling != 1523 PJSUA_DEFAULT_SRTP_SECURE_SIGNALING) 1524 { 1525 pj_ansi_sprintf(line, "--srtp-secure %d\n", 1526 acc_cfg->srtp_secure_signaling); 1508 1527 pj_strcat2(result, line); 1509 1528 } … … 1737 1756 #if PJMEDIA_HAS_SRTP 1738 1757 if (app_config.cfg.use_srtp != PJSUA_DEFAULT_USE_SRTP) { 1739 pj_ansi_sprintf(line, "--use-srtp %d\n", 1740 app_config.cfg.use_srtp); 1758 int use_srtp = (int)app_config.cfg.use_srtp; 1759 if (use_srtp == PJMEDIA_SRTP_OPTIONAL && 1760 app_config.cfg.srtp_optional_dup_offer) 1761 { 1762 use_srtp = 3; 1763 } 1764 pj_ansi_sprintf(line, "--use-srtp %d\n", use_srtp); 1741 1765 pj_strcat2(&cfg, line); 1742 1766 }
Note: See TracChangeset
for help on using the changeset viewer.