Ignore:
Timestamp:
Mar 1, 2006 8:46:13 PM (18 years ago)
Author:
bennylp
Message:

Added option to perform detailed or summary only dump

File:
1 edited

Legend:

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

    r238 r255  
    455455 * Dump presence status. 
    456456 */ 
    457 void pjsua_pres_dump(void) 
     457void pjsua_pres_dump(pj_bool_t detail) 
    458458{ 
    459459    int acc_index; 
    460460    int i; 
    461461 
     462 
     463    /* 
     464     * When no detail is required, just dump number of server and client 
     465     * subscriptions. 
     466     */ 
     467    if (detail == PJ_FALSE) { 
     468         
     469        int count = 0; 
     470 
     471        for (acc_index=0; acc_index < pjsua.acc_cnt; ++acc_index) { 
     472 
     473            if (!pj_list_empty(&pjsua.acc[acc_index].pres_srv_list)) { 
     474                struct pjsua_srv_pres *uapres; 
     475 
     476                uapres = pjsua.acc[acc_index].pres_srv_list.next; 
     477                while (uapres != &pjsua.acc[acc_index].pres_srv_list) { 
     478                    ++count; 
     479                    uapres = uapres->next; 
     480                } 
     481            } 
     482        } 
     483 
     484        PJ_LOG(3,(THIS_FILE, "Number of server/UAS subscriptions: %d",  
     485                  count)); 
     486 
     487        count = 0; 
     488 
     489        for (i=0; i<pjsua.buddy_cnt; ++i) { 
     490            if (pjsua.buddies[i].sub) { 
     491                ++count; 
     492            } 
     493        } 
     494 
     495        PJ_LOG(3,(THIS_FILE, "Number of client/UAC subscriptions: %d",  
     496                  count)); 
     497        return; 
     498    } 
     499     
     500 
     501    /* 
     502     * Dumping all server (UAS) subscriptions 
     503     */ 
    462504    PJ_LOG(3,(THIS_FILE, "Dumping pjsua server subscriptions:")); 
     505 
    463506    for (acc_index=0; acc_index < pjsua.acc_cnt; ++acc_index) { 
    464507 
     
    468511 
    469512        if (pj_list_empty(&pjsua.acc[acc_index].pres_srv_list)) { 
     513 
    470514            PJ_LOG(3,(THIS_FILE, "  - none - ")); 
     515 
    471516        } else { 
    472517            struct pjsua_srv_pres *uapres; 
     
    484529    } 
    485530 
     531    /* 
     532     * Dumping all client (UAC) subscriptions 
     533     */ 
    486534    PJ_LOG(3,(THIS_FILE, "Dumping pjsua client subscriptions:")); 
     535 
    487536    if (pjsua.buddy_cnt == 0) { 
     537 
    488538        PJ_LOG(3,(THIS_FILE, "  - no buddy list - ")); 
     539 
    489540    } else { 
    490541        for (i=0; i<pjsua.buddy_cnt; ++i) { 
Note: See TracChangeset for help on using the changeset viewer.