Changeset 1594


Ignore:
Timestamp:
Nov 23, 2007 3:47:50 AM (16 years ago)
Author:
bennylp
Message:

Ticket #424: Added API to retrieve number of transactions and dialogs (thanks Sergey Bakulin)

Location:
pjproject/trunk/pjsip
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsip/sip_transaction.h

    r1463 r1594  
    160160 
    161161/** 
     162 * Retrieve the current number of transactions currently registered 
     163 * in the hash table. 
     164 * 
     165 * @return          Number of transactions. 
     166 */ 
     167PJ_DECL(unsigned) pjsip_tsx_layer_get_tsx_count(void); 
     168 
     169/** 
    162170 * Find a transaction with the specified key. The transaction key normally 
    163171 * is created by calling #pjsip_tsx_create_key() from an incoming message. 
  • pjproject/trunk/pjsip/include/pjsip/sip_ua_layer.h

    r1417 r1594  
    8282 
    8383/** 
     84 * Retrieve the current number of dialog-set currently registered 
     85 * in the hash table. Note that dialog-set is different than dialog 
     86 * when the request forks. In this case, all dialogs created from 
     87 * the original request will belong to the same dialog set. When 
     88 * no forking occurs, the number of dialog sets will be equal to 
     89 * the number of dialogs. 
     90 * 
     91 * @return          Number of dialog sets. 
     92 */ 
     93PJ_DECL(pj_uint32_t) pjsip_ua_get_dlg_set_count(void); 
     94 
     95 
     96/** 
    8497 * Find a dialog with the specified Call-ID and tags properties. This 
    8598 * function may optionally lock the matching dialog instance before 
  • pjproject/trunk/pjsip/src/pjsip/sip_transaction.c

    r1469 r1594  
    582582 
    583583/* 
     584 * Retrieve the current number of transactions currently registered in  
     585 * the hash table. 
     586 */ 
     587PJ_DEF(unsigned) pjsip_tsx_layer_get_tsx_count(void) 
     588{ 
     589    unsigned count; 
     590 
     591    /* Are we registered? */ 
     592    PJ_ASSERT_RETURN(mod_tsx_layer.endpt!=NULL, 0); 
     593 
     594    pj_mutex_lock(mod_tsx_layer.mutex); 
     595    count = pj_hash_count(mod_tsx_layer.htable); 
     596    pj_mutex_unlock(mod_tsx_layer.mutex); 
     597 
     598    return count; 
     599} 
     600 
     601 
     602/* 
    584603 * Find a transaction. 
    585604 */ 
  • pjproject/trunk/pjsip/src/pjsip/sip_ua_layer.c

    r1417 r1594  
    413413 
    414414 
     415/* 
     416 * Retrieve the current number of dialog-set currently registered 
     417 * in the hash table.  
     418 */ 
     419PJ_DEF(unsigned) pjsip_ua_get_dlg_set_count(void) 
     420{ 
     421    unsigned count; 
     422 
     423    PJ_ASSERT_RETURN(mod_ua.endpt, 0); 
     424 
     425    pj_mutex_lock(mod_ua.mutex); 
     426    count = pj_hash_count(mod_ua.dlg_table); 
     427    pj_mutex_unlock(mod_ua.mutex); 
     428 
     429    return count; 
     430} 
     431 
     432 
    415433/*  
    416434 * Find a dialog. 
Note: See TracChangeset for help on using the changeset viewer.