Ignore:
Timestamp:
Jan 23, 2008 8:39:07 PM (16 years ago)
Author:
bennylp
Message:

Ticket #61: Implement SRTP support in PJMEDIA and PJSUA-LIB, and updated applications because of the changes. This is a major modification back ported from SRTP branch. See ticket #61 for changelog detail of this commit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c

    r1626 r1735  
    121121    puts  ("SIP Account options:"); 
    122122    puts  ("  --use-ims           Enable 3GPP/IMS related settings on this account"); 
     123#if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 
     124    puts  ("  --use-srtp=N        Use SRTP N= 0: disabled, 1: optional, 2: mandatory"); 
     125#endif 
    123126    puts  ("  --registrar=url     Set the URL of registrar server"); 
    124127    puts  ("  --id=url            Set the URL of local ID (used in From header)"); 
     
    383386           OPT_ADD_BUDDY, OPT_OFFER_X_MS_MSG, OPT_NO_PRESENCE, 
    384387           OPT_AUTO_ANSWER, OPT_AUTO_HANGUP, OPT_AUTO_PLAY, OPT_AUTO_LOOP, 
    385            OPT_AUTO_CONF, OPT_CLOCK_RATE, OPT_USE_ICE, 
     388           OPT_AUTO_CONF, OPT_CLOCK_RATE, OPT_USE_ICE, OPT_USE_SRTP, 
    386389           OPT_PLAY_FILE, OPT_PLAY_TONE, OPT_RTP_PORT, OPT_ADD_CODEC,  
    387390           OPT_ILBC_MODE, OPT_REC_FILE, OPT_AUTO_REC, 
     
    442445        { "rtp-port",   1, 0, OPT_RTP_PORT}, 
    443446        { "use-ice",    0, 0, OPT_USE_ICE}, 
     447#if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 
     448        { "use-srtp",   1, 0, OPT_USE_SRTP}, 
     449#endif 
    444450        { "add-codec",  1, 0, OPT_ADD_CODEC}, 
    445451        { "dis-codec",  1, 0, OPT_DIS_CODEC}, 
     
    797803            break; 
    798804 
     805#if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 
     806        case OPT_USE_SRTP: 
     807            app_config.cfg.use_srtp = my_atoi(pj_optarg); 
     808            if (!pj_isdigit(*pj_optarg) || app_config.cfg.use_srtp > 2) { 
     809                PJ_LOG(1,(THIS_FILE, "Invalid value for --use-srtp option")); 
     810                return -1; 
     811            } 
     812            break; 
     813#endif 
     814 
    799815        case OPT_RTP_PORT: 
    800816            cfg->rtp_cfg.port = my_atoi(pj_optarg); 
     
    11111127        pj_strcat2(result, line); 
    11121128    } 
     1129 
     1130#if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) 
     1131    /* SRTP */ 
     1132    if (acc_cfg->use_srtp) { 
     1133        pj_ansi_sprintf(line, "--use-srtp %i\n", 
     1134                        (int)acc_cfg->use_srtp); 
     1135        pj_strcat2(result, line); 
     1136    } 
     1137#endif 
    11131138 
    11141139    /* Proxy */ 
Note: See TracChangeset for help on using the changeset viewer.