Ignore:
Timestamp:
Aug 11, 2009 12:42:38 PM (15 years ago)
Author:
nanang
Message:

Ticket #833:

  • Initial version of Session Timers (RFC 4028).
  • Added new options in pjsua app to configure Session Timers settings.
  • Added python tests for Session Timers.
File:
1 edited

Legend:

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

    r2852 r2858  
    191191    puts  ("  --publish           Send presence PUBLISH for this account"); 
    192192    puts  ("  --use-100rel        Require reliable provisional response (100rel)"); 
     193    puts  ("  --use-timer         Require session timers"); 
     194    puts  ("  --timer-se          Session timers expiration period, in secs (def:1800)"); 
     195    puts  ("  --timer-min-se      Session timers minimum expiration period, in secs (def:90)"); 
    193196    puts  ("  --auto-update-nat=N Where N is 0 or 1 to enable/disable SIP traversal behind"); 
    194197    puts  ("                      symmetric NAT (default 1)"); 
     
    499502#endif 
    500503           OPT_AUTO_UPDATE_NAT,OPT_USE_COMPACT_FORM,OPT_DIS_CODEC, 
    501            OPT_NO_FORCE_LR 
     504           OPT_NO_FORCE_LR, 
     505           OPT_TIMER, OPT_TIMER_SE, OPT_TIMER_MIN_SE 
    502506    }; 
    503507    struct pj_getopt_option long_options[] = { 
     
    610614        { "ipv6",        0, 0, OPT_IPV6}, 
    611615#endif 
     616        { "use-timer",  0, 0, OPT_TIMER}, 
     617        { "timer-se",   1, 0, OPT_TIMER_SE}, 
     618        { "timer-min-se", 1, 0, OPT_TIMER_MIN_SE}, 
    612619        { NULL, 0, 0, 0} 
    613620    }; 
     
    824831            cur_acc->require_100rel = PJ_TRUE; 
    825832            cfg->cfg.require_100rel = PJ_TRUE; 
     833            break; 
     834 
     835        case OPT_TIMER: /** session timer */ 
     836            cur_acc->require_timer = PJ_TRUE; 
     837            cfg->cfg.require_timer = PJ_TRUE; 
     838            break; 
     839 
     840        case OPT_TIMER_SE: /** session timer session expiration */ 
     841            cur_acc->timer_se = pj_strtoul(pj_cstr(&tmp, pj_optarg)); 
     842            if (cur_acc->timer_se < 90) { 
     843                PJ_LOG(1,(THIS_FILE,  
     844                          "Error: invalid value for --timer-se " 
     845                          "(expecting higher than 90)")); 
     846                return PJ_EINVAL; 
     847            } 
     848            cfg->cfg.timer_se = cur_acc->timer_se; 
     849            break; 
     850 
     851        case OPT_TIMER_MIN_SE: /** session timer minimum session expiration */ 
     852            cur_acc->timer_min_se = pj_strtoul(pj_cstr(&tmp, pj_optarg)); 
     853            if (cur_acc->timer_min_se < 90) { 
     854                PJ_LOG(1,(THIS_FILE,  
     855                          "Error: invalid value for --timer-min-se " 
     856                          "(expecting higher than 90)")); 
     857                return PJ_EINVAL; 
     858            } 
     859            cfg->cfg.timer_min_se = cur_acc->timer_min_se; 
    826860            break; 
    827861 
Note: See TracChangeset for help on using the changeset viewer.