Opened 13 years ago

Last modified 12 years ago

#1266 closed task

Asynchronous media transport creation — at Version 2

Reported by: bennylp Owned by: ming
Priority: major Milestone: release-2.0-alpha2
Component: pjsua-lib Version: 2.0-dev-branch
Keywords: Cc:
Backport to 1.x milestone: Backported:

Description (last modified by bennylp)

In 2.0, media transport creation is now made on as-needed basis, i.e. when calls need them. Currently the creation is blocking, so call initialization would wait (blocking) until media is created and initialized.

This ticket makes the creation asynchronous. The proposed solution is as follows:

  1. modify media transport creation to asynchronous (e.g. for STUN resolution)
  2. add new callback, e.g. on_call_media_transport_state(call_id, state_struct) to report media transport status. We'll use this to report transport creation status, as well as other events. The events reported by existing on_ice_transport_error() callback may as well go to this callback too (and remove on_ice_transport_error() altogether? I'd say yes.)
  3. for outgoing calls, delay the INVITE transmission until media transport is ready. Be aware that app may hangup the call at any time, including when transport is being created, hence need to handle this case.
  4. for incoming calls, report the INVITE to on_incoming_call() immediately. As long as app doesn't reject the call in this callback, proceed with creating the transport (which will finish asynchronously later). If app answers the call while the transport is not ready, there are several cases:
    1. if worker thread is enabled *and* current thread is not worker thread, block the execution waiting until transport is created.
    2. for Symbian, do event polling
    3. for other cases, return PJMEDIA_TP_EINSTATE (new errror: invalid transport state).

Also as in outgoing call case, app may hangup the call at any time.

Change History (2)

comment:1 Changed 13 years ago by bennylp

  • Milestone changed from release-2.0-alpha to release-2.0-beta
  • Priority changed from normal to major

comment:2 Changed 13 years ago by bennylp

  • Description modified (diff)
  • Milestone changed from release-2.0-beta to release-2.0-alpha2
  • Owner changed from bennylp to ming
  • Status changed from new to assigned
  • Summary changed from Make media transport creation asynchronous to Asynchronous media transport creation
Note: See TracTickets for help on using tickets.