PJ_DEF(void) pjsip_tpmgr_dump_transports(pjsip_tpmgr *mgr)
{
#if PJ_LOG_MAX_LEVEL >= 3
    pj_hash_iterator_t itr_val;
    pj_hash_iterator_t *itr;
    pjsip_tpfactory *factory;

    pj_lock_acquire(mgr->lock);

#if defined(PJ_DEBUG) && PJ_DEBUG!=0
    PJ_LOG(3,(THIS_FILE, " Outstanding transmit buffers: %d",
	      pj_atomic_get(mgr->tdata_counter)));
#endif

    PJ_LOG(3, (THIS_FILE, " Dumping listeners:"));
    factory = mgr->factory_list.next;
    while (factory != &mgr->factory_list) {
	PJ_LOG(3, (THIS_FILE, "  %s %s:%.*s:%d", 
		   factory->obj_name,
		   factory->type_name,
		   (int)factory->addr_name.host.slen,
		   factory->addr_name.host.ptr,
		   (int)factory->addr_name.port));
	factory = factory->next;
    }

    itr = pj_hash_first(mgr->table, &itr_val);
    if (itr) {
	PJ_LOG(3, (THIS_FILE, " Dumping transports:"));

	do {
	    transport *tp_entry = (transport *) pj_hash_this(mgr->table, itr);
	    if (tp_entry) {
		transport *tp_iter = tp_entry;

		do {
		    pjsip_transport *tp_ref = tp_iter->tp;

		    PJ_LOG(3, (THIS_FILE, "  %s %s%s%s%s(refcnt=%d%s)",
			       tp_ref->obj_name,
			       tp_ref->info,
			       (tp_ref->factory)?" listener[":"",
			       (tp_ref->factory)?tp_ref->factory->obj_name:"",
			       (tp_ref->factory)?"]":"",
			       pj_atomic_get(tp_ref->ref_cnt),
			       (tp_ref->idle_timer.id ? " [idle]" : "")));

		    tp_iter = tp_iter->next;
		} while (tp_iter != tp_entry);
	    }
	    itr = pj_hash_next(mgr->table, itr);
	} while (itr);
    }

    pj_lock_release(mgr->lock);
#else
    PJ_UNUSED_ARG(mgr);
#endif
}
PJ_DEF(void) pjsip_tpmgr_dump_transports(pjsip_tpmgr *mgr)
{
#if PJ_LOG_MAX_LEVEL >= 3
    pj_hash_iterator_t itr_val;
    pj_hash_iterator_t *itr;
    pjsip_tpfactory *factory;

    pj_lock_acquire(mgr->lock);

#if defined(PJ_DEBUG) && PJ_DEBUG!=0
    PJ_LOG(3,(THIS_FILE, " Outstanding transmit buffers: %d",
	      pj_atomic_get(mgr->tdata_counter)));
#endif

    PJ_LOG(3, (THIS_FILE, " Dumping listeners:"));
    factory = mgr->factory_list.next;
    while (factory != &mgr->factory_list) {
	PJ_LOG(3, (THIS_FILE, "  %s %s:%.*s:%d", 
		   factory->obj_name,
		   factory->type_name,
		   (int)factory->addr_name.host.slen,
		   factory->addr_name.host.ptr,
		   (int)factory->addr_name.port));
	factory = factory->next;
    }

    itr = pj_hash_first(mgr->table, &itr_val);
    if (itr) {
	PJ_LOG(3, (THIS_FILE, " Dumping transports:"));

	do {
	    transport *tp_entry = (transport *) pj_hash_this(mgr->table, itr);
	    if (tp_entry) {
		transport *tp_iter = tp_entry;

		do {
		    pjsip_transport *tp_ref = tp_iter->tp;

		    PJ_LOG(3, (THIS_FILE, "  %s %s%s%s%s(refcnt=%d%s)",
			       tp_ref->obj_name,
			       tp_ref->info,
			       (tp_ref->factory)?" listener[":"",
			       (tp_ref->factory)?tp_ref->factory->obj_name:"",
			       (tp_ref->factory)?"]":"",
			       pj_atomic_get(tp_ref->ref_cnt),
			       (tp_ref->idle_timer.id ? " [idle]" : "")));

		    tp_iter = tp_iter->next;
		} while (tp_iter != tp_entry);
	    }
	    itr = pj_hash_next(mgr->table, itr);
	} while (itr);
    }

    pj_lock_release(mgr->lock);
#else
    PJ_UNUSED_ARG(mgr);
#endif
}