Ignore:
Timestamp:
Sep 7, 2010 9:36:15 AM (9 years ago)
Author:
nanang
Message:

Re #1120:

  • Added enum pjsua_sip_timer_use for session timer usage types, containing: inactive, optional, required, always
  • Replaced require_timer (boolean) with above enum in global and account config setting.
  • Updated pjsua app --use-timer option accordingly.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c

    r3304 r3305  
    494494    /* Create the INVITE session: */ 
    495495    options |= PJSIP_INV_SUPPORT_100REL; 
    496     options |= PJSIP_INV_SUPPORT_TIMER; 
    497496    if (acc->cfg.require_100rel) 
    498497        options |= PJSIP_INV_REQUIRE_100REL; 
    499     if (acc->cfg.require_timer) 
    500         options |= PJSIP_INV_REQUIRE_TIMER; 
     498    if (acc->cfg.use_timer != PJSUA_SIP_TIMER_INACTIVE) { 
     499        options |= PJSIP_INV_SUPPORT_TIMER; 
     500        if (acc->cfg.use_timer == PJSUA_SIP_TIMER_REQUIRED) 
     501            options |= PJSIP_INV_REQUIRE_TIMER; 
     502        else if (acc->cfg.use_timer == PJSUA_SIP_TIMER_ALWAYS) 
     503            options |= PJSIP_INV_ALWAYS_USE_TIMER; 
     504    } 
    501505 
    502506    status = pjsip_inv_create_uac( dlg, offer, options, &inv); 
     
    840844    if (pjsua_var.acc[acc_id].cfg.require_100rel) 
    841845        options |= PJSIP_INV_REQUIRE_100REL; 
    842     if (pjsua_var.acc[acc_id].cfg.require_timer) 
    843         options |= PJSIP_INV_REQUIRE_TIMER; 
    844846    if (pjsua_var.media_cfg.enable_ice) 
    845847        options |= PJSIP_INV_SUPPORT_ICE; 
     848    if (pjsua_var.acc[acc_id].cfg.use_timer == PJSUA_SIP_TIMER_REQUIRED) 
     849        options |= PJSIP_INV_REQUIRE_TIMER; 
     850    else if (pjsua_var.acc[acc_id].cfg.use_timer == PJSUA_SIP_TIMER_ALWAYS) 
     851        options |= PJSIP_INV_ALWAYS_USE_TIMER; 
    846852 
    847853    status = pjsip_inv_verify_request2(rdata, &options, offer, answer, NULL, 
     
    909915    pjsip_auth_clt_set_prefs(&dlg->auth_sess,  
    910916                             &pjsua_var.acc[acc_id].cfg.auth_pref); 
     917 
     918    /* Disable Session Timers if not prefered and the incoming INVITE request 
     919     * did not require it. 
     920     */ 
     921    if (pjsua_var.acc[acc_id].cfg.use_timer == PJSUA_SIP_TIMER_INACTIVE &&  
     922        (options & PJSIP_INV_REQUIRE_TIMER) == 0) 
     923    { 
     924        options &= ~(PJSIP_INV_SUPPORT_TIMER); 
     925    } 
    911926 
    912927    /* Create invite session: */ 
Note: See TracChangeset for help on using the changeset viewer.