Changeset 5558 for pjproject


Ignore:
Timestamp:
Feb 20, 2017 1:29:21 AM (8 years ago)
Author:
ming
Message:

Closed #1998: Add API pjsip_evsub_set_uas_timeout()

Location:
pjproject/trunk/pjsip
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsip-simple/evsub.h

    r5397 r5558  
    512512 
    513513 
     514/** 
     515 * Sets, resets, or cancels the UAS subscription timeout. 
     516 * If there is an existing timer, it is cancelled before any 
     517 * other action. A timeout of 0 is ignored except that any 
     518 * existing timer is cancelled. 
     519 * 
     520 * @param sub           The server subscription instance. 
     521 * @param seconds       The new timeout. 
     522 */ 
     523PJ_DEF(void) pjsip_evsub_uas_set_timeout(pjsip_evsub *sub, 
     524                                         pj_uint32_t seconds); 
     525 
    514526 
    515527PJ_END_DECL 
  • pjproject/trunk/pjsip/src/pjsip-simple/evsub.c

    r5397 r5558  
    510510    } 
    511511 
    512     if (timer_id != TIMER_TYPE_NONE) { 
     512    if (timer_id != TIMER_TYPE_NONE && seconds > 0) { 
    513513        pj_time_val timeout; 
    514514 
    515         PJ_ASSERT_ON_FAIL(seconds > 0, return); 
    516515        PJ_ASSERT_ON_FAIL(timer_id>TIMER_TYPE_NONE && timer_id<TIMER_TYPE_MAX, 
    517516                          return); 
     
    527526                  timer_names[sub->timer.id], timeout.sec)); 
    528527    } 
     528} 
     529 
     530 
     531/* 
     532 * Set event subscription UAS timout. 
     533 */ 
     534PJ_DEF(void) pjsip_evsub_uas_set_timeout(pjsip_evsub *sub, pj_uint32_t seconds) 
     535{ 
     536    set_timer(sub, TIMER_TYPE_UAS_TIMEOUT, (pj_int32_t)seconds); 
    529537} 
    530538 
  • pjproject/trunk/pjsip/src/pjsip-simple/evsub_msg.c

    r4537 r5558  
    180180    if (hdr->retry_after >= 0) { 
    181181        pj_memcpy(p, ";retry-after=", 13); 
    182         p += 9; 
     182        p += 13; 
    183183        printed = pj_utoa(hdr->retry_after, p); 
    184184        p += printed; 
Note: See TracChangeset for help on using the changeset viewer.