Ignore:
Timestamp:
Jun 22, 2010 6:02:13 AM (14 years ago)
Author:
bennylp
Message:

Fixed #1095 (New option to control the Route headers in REGISTER request). Details:

  • added new account config setting: reg_use_proxy. This contains bitmask values to indicate whether outbound proxies and account proxies are to be added in the REGISTER request. Default value is to add both.
  • added new pjsua cmdline option to control this: --reg-use-proxy
  • miscellaneous minor fixes in other pjsua cmdline arguments
File:
1 edited

Legend:

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

    r3212 r3216  
    193193    puts  ("  --proxy=url         Optional URL of proxy server to visit"); 
    194194    puts  ("                      May be specified multiple times"); 
    195     puts  ("  --reg-timeout=SEC   Optional registration interval (default 55)"); 
    196     puts  ("  --rereg-delay=SEC   Optional auto retry registration interval (default 300)"); 
     195    printf("  --reg-timeout=SEC   Optional registration interval (default %d)\n", 
     196            PJSUA_REG_INTERVAL); 
     197    printf("  --rereg-delay=SEC   Optional auto retry registration interval (default %d)\n", 
     198            PJSUA_REG_RETRY_INTERVAL); 
     199    puts  ("  --reg-use-proxy=N   Control the use of proxy settings in REGISTER."); 
     200    puts  ("                      0=no proxy, 1=outbound only, 2=acc only, 3=all (default)"); 
    197201    puts  ("  --realm=string      Set realm"); 
    198202    puts  ("  --username=string   Set authentication username"); 
     
    202206    puts  ("  --use-100rel        Require reliable provisional response (100rel)"); 
    203207    puts  ("  --use-timer         Require SIP session timers"); 
    204     puts  ("  --timer-se=N        Session timers expiration period, in secs (def:1800)"); 
     208    printf("  --timer-se=N        Session timers expiration period, in secs (def:%d)\n", 
     209            PJSIP_SESS_TIMER_DEF_SE); 
    205210    puts  ("  --timer-min-se=N    Session timers minimum expiration period, in secs (def:90)"); 
    206211    puts  ("  --auto-update-nat=N Where N is 0 or 1 to enable/disable SIP traversal behind"); 
     
    490495           OPT_BOUND_ADDR, OPT_CONTACT_PARAMS, OPT_CONTACT_URI_PARAMS, 
    491496           OPT_100REL, OPT_USE_IMS, OPT_REALM, OPT_USERNAME, OPT_PASSWORD, 
    492            OPT_REG_RETRY_INTERVAL, 
     497           OPT_REG_RETRY_INTERVAL, OPT_REG_USE_PROXY, 
    493498           OPT_MWI, OPT_NAMESERVER, OPT_STUN_SRV, 
    494499           OPT_ADD_BUDDY, OPT_OFFER_X_MS_MSG, OPT_NO_PRESENCE, 
     
    559564        { "password",   1, 0, OPT_PASSWORD}, 
    560565        { "rereg-delay",1, 0, OPT_REG_RETRY_INTERVAL}, 
     566        { "reg-use-proxy", 1, 0, OPT_REG_USE_PROXY}, 
    561567        { "nameserver", 1, 0, OPT_NAMESERVER}, 
    562568        { "stun-srv",   1, 0, OPT_STUN_SRV}, 
     
    976982            break; 
    977983 
     984        case OPT_REG_USE_PROXY: 
     985            cur_acc->reg_use_proxy = (unsigned)pj_strtoul(pj_cstr(&tmp, pj_optarg)); 
     986            if (cur_acc->reg_use_proxy > 3) { 
     987                PJ_LOG(1,(THIS_FILE, "Error: invalid --reg-use-proxy value '%s'", 
     988                          pj_optarg)); 
     989                return PJ_EINVAL; 
     990            } 
     991            break; 
     992 
    978993        case OPT_NEXT_CRED: /* next credential */ 
    979994            cur_acc->cred_count++; 
     
    15701585        if (i != acc_cfg->cred_count - 1) 
    15711586            pj_strcat2(result, "--next-cred\n"); 
     1587    } 
     1588 
     1589    /* reg-use-proxy */ 
     1590    if (acc_cfg->reg_use_proxy != 3) { 
     1591        pj_ansi_sprintf(line, "--reg-use-proxy %d\n", 
     1592                              acc_cfg->reg_use_proxy); 
     1593        pj_strcat2(result, line); 
     1594    } 
     1595 
     1596    /* rereg-delay */ 
     1597    if (acc_cfg->reg_retry_interval != PJSUA_REG_RETRY_INTERVAL) { 
     1598        pj_ansi_sprintf(line, "--rereg-delay %d\n", 
     1599                              acc_cfg->reg_retry_interval); 
     1600        pj_strcat2(result, line); 
    15721601    } 
    15731602 
Note: See TracChangeset for help on using the changeset viewer.