- if (has_rtp && has_rtcp &&
- pj_ice_sess_create_check_list(rtp->ice, &ufrag, &passwd, cand_cnt, &candidates[0]) == PJ_SUCCESS) {
- ast_test_suite_event_notify("ICECHECKLISTCREATE", "Result: SUCCESS");
- pj_ice_sess_start_check(rtp->ice);
- pj_timer_heap_poll(timer_heap, NULL);
- rtp->strict_rtp_state = STRICT_RTP_OPEN;
- return;
+ if (cand_cnt < ao2_container_count(rtp->ice_active_remote_candidates)) {
+ ast_log(LOG_WARNING, "Lost %d ICE candidates. Consider increasing PJ_ICE_MAX_CAND in PJSIP (%p)\n",
+ ao2_container_count(rtp->ice_active_remote_candidates) - cand_cnt, instance);
+ }
+
+ if (!has_rtp) {
+ ast_log(LOG_WARNING, "No RTP candidates; skipping ICE checklist (%p)\n", instance);
+ }
+
+ if (!has_rtcp) {
+ ast_log(LOG_WARNING, "No RTCP candidates; skipping ICE checklist (%p)\n", instance);
+ }
+
+ if (has_rtp && has_rtcp) {
+ pj_status_t res = pj_ice_sess_create_check_list(rtp->ice, &ufrag, &passwd, cand_cnt, &candidates[0]);
+ char reason[80];
+
+ if (res == PJ_SUCCESS) {
+ ast_debug(3, "Successfully created ICE checklist (%p)\n", instance);
+ ast_test_suite_event_notify("ICECHECKLISTCREATE", "Result: SUCCESS");
+ pj_ice_sess_start_check(rtp->ice);
+ pj_timer_heap_poll(timer_heap, NULL);
+ rtp->strict_rtp_state = STRICT_RTP_OPEN;
+ return;
+ }
+
+ pj_strerror(res, reason, sizeof(reason));
+ ast_log(LOG_WARNING, "Failed to create ICE session check list: %s (%p)\n", reason, instance);