diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2012-04-24 05:40:32 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2012-04-24 05:40:32 +0000 |
commit | 603594518c4cbe3c564df98e3cd86f34b89e5971 (patch) | |
tree | 37acdb3307a94d23e1d834b304570a7cad3b4757 /pjsip/src/pjsua-lib/pjsua_core.c | |
parent | d73368a020b5723e58b529f0ed6401459b7750b3 (diff) |
Fix #1423:
- Added provisional media in call for generating initial and subsequent SDP offer/answer. If a reoffer is rejected by peer, the main call media will remain unchanged and the provisional media will be cleaned up (the cleanup is currently delayed until call gets destroyed or another reoffer/answer occurs).
- Reenabled media transport dump in pjsua_core.c.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4071 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsua-lib/pjsua_core.c')
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_core.c | 53 |
1 files changed, 37 insertions, 16 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_core.c b/pjsip/src/pjsua-lib/pjsua_core.c index aeb85ebf..8b6dc46e 100644 --- a/pjsip/src/pjsua-lib/pjsua_core.c +++ b/pjsip/src/pjsua-lib/pjsua_core.c @@ -2770,26 +2770,47 @@ PJ_DEF(void) pjsua_dump(pj_bool_t detail) pjmedia_endpt_dump(pjsua_get_pjmedia_endpt()); PJ_LOG(3,(THIS_FILE, "Dumping media transports:")); - // Suppress compile warning caused by unreferenced var. - PJ_UNUSED_ARG(i); -#if DISABLED_FOR_TICKET_1185 for (i=0; i<pjsua_var.ua_cfg.max_calls; ++i) { pjsua_call *call = &pjsua_var.calls[i]; - pjmedia_transport_info tpinfo; - char addr_buf[80]; - - /* MSVC complains about tpinfo not being initialized */ - //pj_bzero(&tpinfo, sizeof(tpinfo)); - - pjmedia_transport_info_init(&tpinfo); - pjmedia_transport_get_info(call->med_tp, &tpinfo); + pjmedia_transport *tp[PJSUA_MAX_CALL_MEDIA*2]; + unsigned tp_cnt = 0; + unsigned j; + + /* Collect media transports in this call */ + for (j = 0; j < call->med_cnt; ++j) { + if (call->media[j].tp != NULL) + tp[tp_cnt++] = call->media[j].tp; + } + for (j = 0; j < call->med_prov_cnt; ++j) { + pjmedia_transport *med_tp = call->media_prov[j].tp; + if (med_tp) { + unsigned k; + pj_bool_t used = PJ_FALSE; + for (k = 0; k < tp_cnt; ++k) { + if (med_tp == tp[k]) { + used = PJ_TRUE; + break; + } + } + if (!used) + tp[tp_cnt++] = med_tp; + } + } - PJ_LOG(3,(THIS_FILE, " %s: %s", - (pjsua_var.media_cfg.enable_ice ? "ICE" : "UDP"), - pj_sockaddr_print(&tpinfo.sock_info.rtp_addr_name, addr_buf, - sizeof(addr_buf), 3))); + /* Dump the media transports in this call */ + for (j = 0; j < tp_cnt; ++j) { + pjmedia_transport_info tpinfo; + char addr_buf[80]; + + pjmedia_transport_info_init(&tpinfo); + pjmedia_transport_get_info(tp[j], &tpinfo); + PJ_LOG(3,(THIS_FILE, " %s: %s", + (pjsua_var.media_cfg.enable_ice ? "ICE" : "UDP"), + pj_sockaddr_print(&tpinfo.sock_info.rtp_addr_name, + addr_buf, + sizeof(addr_buf), 3))); + } } -#endif pjsip_tsx_layer_dump(detail); pjsip_ua_dump(detail); |