Ignore:
Timestamp:
Jan 18, 2008 6:49:29 PM (16 years ago)
Author:
bennylp
Message:

More ticket #452: SRTP creation/destruction, added use_srtp and srtp_secure_signaling in pjsua_account_config, updated pjsua

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/users/nanang/pjsip-apps/src/pjsua/pjsua_app.c

    r1698 r1709  
    121121    puts  ("SIP Account options:"); 
    122122    puts  ("  --use-ims           Enable 3GPP/IMS related settings on this account"); 
     123    puts  ("  --use-srtp=N        Use SRTP N= 0: disabled, 1: optional, 2: mandatory"); 
    123124    puts  ("  --registrar=url     Set the URL of registrar server"); 
    124125    puts  ("  --id=url            Set the URL of local ID (used in From header)"); 
     
    166167    puts  ("Media Options:"); 
    167168    puts  ("  --use-ice           Enable ICE (default:no)"); 
    168     puts  ("  --use-srtp          Enable SRTP (default:no)"); 
    169169    puts  ("  --add-codec=name    Manually add codec (default is to enable all)"); 
    170170    puts  ("  --dis-codec=name    Disable codec (can be specified multiple times)"); 
     
    443443        { "rtp-port",   1, 0, OPT_RTP_PORT}, 
    444444        { "use-ice",    0, 0, OPT_USE_ICE}, 
    445         { "use-srtp",   0, 0, OPT_USE_SRTP}, 
     445        { "use-srtp",   1, 0, OPT_USE_SRTP}, 
    446446        { "add-codec",  1, 0, OPT_ADD_CODEC}, 
    447447        { "dis-codec",  1, 0, OPT_DIS_CODEC}, 
     
    800800 
    801801        case OPT_USE_SRTP: 
    802             cfg->media_cfg.enable_srtp = PJ_TRUE; 
     802            i = my_atoi(pj_optarg); 
     803            if (!pj_isdigit(*pj_optarg) || i > 2) { 
     804                PJ_LOG(1,(THIS_FILE, "Invalid value for --use-srtp option")); 
     805                return -1; 
     806            } 
     807            cur_acc->use_srtp = i; 
    803808            break; 
    804809 
     
    11151120        pj_ansi_sprintf(line, "--auto-update-nat %i\n", 
    11161121                        (int)acc_cfg->auto_update_nat); 
     1122        pj_strcat2(result, line); 
     1123    } 
     1124 
     1125    /* SRTP */ 
     1126    if (acc_cfg->use_srtp) { 
     1127        pj_ansi_sprintf(line, "--use-srtp %i\n", 
     1128                        (int)acc_cfg->use_srtp); 
    11171129        pj_strcat2(result, line); 
    11181130    } 
Note: See TracChangeset for help on using the changeset viewer.