Ticket #1990 (closed defect: fixed)

Opened 3 months ago

Last modified 3 months ago

Call fails to answer due to ICE media transport init blocking

Reported by: nanang Owned by: bennylp
Priority: normal Milestone: release-2.6
Component: pjnath Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported: no

Description

Log indication

pjsua_call.c  Answering call 1: code=200
pjsua_call.c  Pending answering call 1 upon completion of media transport
...
pjsua_call.c  Answering call 1: code=200
pjsua_call.c  Pending answering call 1 upon completion of media transport
... (and so on)

Scenario

After investigation, the blocking part turns out to be TURN allocation which seems to take forever.

  1. DNS resolver is configured and the TURN server hostname is in the DNS resolver cache
  2. ICE is trying to create TURN candidate, it creates TURN transport and starts TURN allocation by invoking pj_turn_sock_alloc()
  3. pj_turn_session_set_server() starts resolving TURN server IP address by invoking pj_dns_srv_resolve()
  4. as DNS entry is in the cache, DNS resolver callback is invoked in the same context which triggers TURN allocation
  5. the TURN allocation fails synchronously too, so TURN transport destroys itself, DNS resolver callback returns, and then pj_dns_srv_resolve() also returns with PJ_SUCCESS return value as the resolution was successful
  6. alas, the PJ_SUCCESS return value is propagated upstream, so ICE sees that pj_turn_sock_alloc() returns PJ_SUCCESS and TURN candidate is added
  7. as the failure happens prematurely before TURN candidate is added, the candidate status remains PJ_EPENDING forever.

The idea is to add check for possibility of premature failure in pj_turn_sock_alloc() after pj_turn_session_set_server() returns PJ_SUCCESS.

Thanks Bing Huan Chio for the report.

Change History

comment:1 Changed 3 months ago by nanang

  • Status changed from new to closed
  • Resolution set to fixed

In 5521:

Fixed #1990:

  • Added check for possibility of premature failure in pj_turn_sock_alloc() after pj_turn_session_set_server() returns PJ_SUCCESS.
  • Added more logs on ICE initialization progress for future debugging.
Note: See TracTickets for help on using tickets.