PJ_DEF(unsigned) pjsip_tpmgr_get_transport_count(pjsip_tpmgr *mgr)
{
    pj_hash_iterator_t itr_val;
    pj_hash_iterator_t *itr;
    int nr_of_transports = 0;

    pj_lock_acquire(mgr->lock);

    itr = pj_hash_first(mgr->table, &itr_val);
    while (itr) {
	transport *tp_entry = (transport *)pj_hash_this(mgr->table, itr);
	nr_of_transports += pj_list_size(tp_entry);
	itr = pj_hash_next(mgr->table, itr);
    }

    pj_lock_release(mgr->lock);

    return nr_of_transports;
}
PJ_DEF(unsigned) pjsip_tpmgr_get_transport_count(pjsip_tpmgr *mgr)
{
    pj_hash_iterator_t itr_val;
    pj_hash_iterator_t *itr;
    int nr_of_transports = 0;

    pj_lock_acquire(mgr->lock);

    itr = pj_hash_first(mgr->table, &itr_val);
    while (itr) {
	transport *tp_entry = (transport *)pj_hash_this(mgr->table, itr);
	nr_of_transports += pj_list_size(tp_entry);
	itr = pj_hash_next(mgr->table, itr);
    }

    pj_lock_release(mgr->lock);

    return nr_of_transports;
}