Changeset 2824


Ignore:
Timestamp:
Jun 30, 2009 1:53:47 PM (15 years ago)
Author:
bennylp
Message:

Related to #911:

  • added subscription state name string in pjsua_buddy_info and display this in pjsua
Location:
pjproject/trunk
Files:
3 edited

Legend:

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

    r2724 r2824  
    25342534    pjsua_buddy_get_info(buddy_id, &info); 
    25352535 
    2536     PJ_LOG(3,(THIS_FILE, "%.*s status is %.*s", 
     2536    PJ_LOG(3,(THIS_FILE, "%.*s status is %.*s (subscription state is %s)", 
    25372537              (int)info.uri.slen, 
    25382538              info.uri.ptr, 
    25392539              (int)info.status_text.slen, 
    2540               info.status_text.ptr)); 
     2540              info.status_text.ptr, 
     2541              info.sub_state_name)); 
    25412542} 
    25422543 
  • pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h

    r2762 r2824  
    28972897 
    28982898    /** 
     2899     * String representation of subscription state. 
     2900     */ 
     2901    const char         *sub_state_name; 
     2902 
     2903    /** 
    28992904     * Specifies the last presence subscription terminatino reason. If  
    29002905     * presence subscription is currently active, the value will be empty. 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c

    r2762 r2824  
    196196    if (buddy->sub) { 
    197197        info->sub_state = pjsip_evsub_get_state(buddy->sub); 
     198        info->sub_state_name = pjsip_evsub_get_state_name(buddy->sub); 
    198199        if (info->sub_state == PJSIP_EVSUB_STATE_TERMINATED && 
    199200            total < sizeof(info->buf_))  
     
    208209        } 
    209210    } else if (total < sizeof(info->buf_)) { 
     211        info->sub_state_name = "NULL"; 
    210212        info->sub_term_reason.ptr = info->buf_ + total; 
    211213        pj_strncpy(&info->sub_term_reason, &buddy->term_reason, 
     
    213215        total += info->sub_term_reason.slen; 
    214216    } else { 
     217        info->sub_state_name = "NULL"; 
    215218        info->sub_term_reason = pj_str(""); 
    216219    } 
Note: See TracChangeset for help on using the changeset viewer.