diff --git a/libsofia-sip-ua/nua/nua.docs b/libsofia-sip-ua/nua/nua.docs index f941ac0e921124f5664eede6d856426acf8396e2..478fff5fe48b0cc2715aba6ea5266fdedf5366d5 100644 --- a/libsofia-sip-ua/nua/nua.docs +++ b/libsofia-sip-ua/nua/nua.docs @@ -857,26 +857,26 @@ typically 180 (Ringing) or 183 (Session Progress). INVITE/- | +---------------+ | INVITE/100 V | +------------+ +------------+ - +----| CALLING | +---| RECEIVED |--+ - | +------------+ | +------------+ | - | | | | | - | | 18X/- | | -/18X | - | V | V | - | +------------+ | +------------+ | - |<---| PROCEEDING |--+ | | EARLY |->| + +----| CALLING |--+ +---| RECEIVED |--+ + | +------------+ | | +------------+ | + | | | | | | + | | 18X/- | | | -/18X | + | V | | V | + | +------------+ | | +------------+ | + |<---| PROCEEDING | | | | EARLY |->| | +------------+ | | +------------+ | -/[3456]XX - | : | | | | - | | 2XX/- | | -/2XX | -/2XX | or + | | | | | | + | | 2XX/- | 2XX/- | -/2XX | -/2XX | or | V | | V | | + - - - - - -+ | | +------------+ | CANCEL/200,487 - | : COMPLETING : | +-->| COMPLETE | | - | + - - - - - -+ | +------------+ | - | : | | | - | | -/ACK | 2XX/ACK ACK/- | | - | : | | | - | : V | | - | : +---------------+ | | - | + - - >| READY |<----+ | + | : COMPLETING :<-+ +-->| COMPLETE | | + | + - - - - - -+ +------------+ | + | | | | + | | -/ACK ACK/- | | + | | | | + | | | | + | | +---------------+ | | + | +----->| READY |<----+ | | +---------------+ | | | | | | BYE/200 | | -/BYE | @@ -899,110 +899,179 @@ The detailed call model at client side is presented below. This model does not include the extensions like @b 100rel or @b UPDATE. @code - +------------+ - | INIT | - +------------+ - | - (1) nua_invite/INVITE - | - V - +------------+ - | |- - + - +-------------------| CALLING | (8) nua_cancel/CANCEL - | | |<- -+ - | +------------+ - | | - | (2) 18X/- - | | - | V - | +------------+ - | | |- - + - | | | (8) nua_cancel/CANCEL - |<------------------| PROCEEDING |<- -+ - | | | - | | |- - - - - -+ - | +------------+ : - | : | : - (7) [3456]XX/ACK (5) 2XX/- (3) 2XX/ACK (9) nua_bye/BYE - | : | : - | V | : - | + - - - - - -+ | : - | + - - - -: COMPLETING : (X) - + : - | : + - - - - - -+ | : : - | : : | : : - | : nua_ack : nua_ack | : : - | (9) /ACK+BYE (6) /ACK | : : - | : : | : : - | : (X)- - - - -|- - + : - | : : | : : - | : V V : : - | : +------------+ : : - | : | | : : - | : | READY | (4)-/BYE : - | : | | : : - | : +------------+ : : - | : : : - | : : : - | : : : - | : V V - | : +-------------+ - | + - - - - - - - - - - - - ->| TERMINATING | - | +-------------+ - | | - | | [23456]XX/- - | | - | | - | +------------+ | - +------------------>| TERMINATED |<------+ - +------------+ + +------------+ + | INIT | + +------------+ + | + (1) nua_invite/INVITE + | + V + +------------+ + | |---------------------------------------+ + | |----+ | + +------| CALLING | (7a) nua_cancel/CANCEL | + | | |<---+ | + | | | | + | +------------+ | + | | | + | (2) 18X/- | + | | | + | V | + | +------------+ | + | | |-------------------------------------->| + | | |----+ | + | | PROCEEDING | (7b) nua_cancel/CANCEL | + | | |<---+ | + | | |----------------------+ | + | +------------+ | | + | | | | + (3b) 2XX/- (3a) 2XX/- | (6) [3456]XX/ACK + | | | | + | V | | + | + - - - - - -+ | | + +----->: : | | + : COMPLETING :-------+ | | + + - - -: : | | | + : + - - - - - -+ | | | + : | | | | + : | | | | + :or nua_ack | | | | + :and media | or nua_ack | nua_bye | | + (5) error (4) /ACK (9) /ACK+BYE (8) nua_bye/BYE | + : /ACK+BYE | | | | + : V | | | + : +------------+ | | | + : | | | | | + : | READY | | | | + : | | | | | + : +------------+ | | | + : | | | + | | | | + : | | | + : +-------------+ | | | + + - - >| TERMINATING |<-----+<-------------+ | + +-------------+ | + | | + | [23456]XX/- | + | | + V | + +------------+ | + | TERMINATED |<--------------------------------------+ + +------------+ @endcode The detailed description of state transitions on the client side is as follows: --# Entering @b calling state: \n - Client application invokes nua_invite(). By default, stack runs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#Previous stateInputOutputNext stateOffer/ AnswerDescription
1initnua_invite()INVITEcallingGenerate offer + Client application starts call be invoking nua_invite(). By default, stack runs the initial offer/answer step and sends @b INVITE request with the SDP offer. --# Entering @b proceeding state: \n +
2calling18X-proceeding(Save answer) Stack receives a 18X response (a provisional response between 101 and 199). It establishes an early dialog with server. If the provisional response contains an SDP answer, a session with early media is established. The caller can be listen to, for instance, ring tone or announcements about call progress using the early media session. --# Entering @b ready state: \n - Client receives a 2XX response (usually 200 OK) and sends an - ACK request. If the initial offer was sent with INVITE, the answer must - be included with 2XX response at latest. If the client has not received - the SDP answer, it sends immediately a BYE request after sending the ACK - request and enters the @b terminating state. --# Error entering @b ready state: \n - If there is an failure entering the @b ready state (because of SDP - negotiation or media failure), the stack will automatically terminate the - call by sending the BYE request towards the server. --# Entering @b completing state: \n - Client receives 2XX series response (usually 200 OK) and forwards - it to the application. This state transition happens only when the - @ref NUTAG_AUTOACK() "auto-ack" - mode is explicitly turned off by application. --# Entering @b ready state: \n - Client completes offer/answer exchange and sends the ACK request to the - server. --# Entering @b terminated state: \n +
3aproceeding2XX-completingSave answer + Client receives a 2XX response (usually 200 OK) indicating that + call has been accepted by the server. If there is an SDP session + description included with response, it is stored. + + Unless the @ref NUTAG_AUTOACK() "auto-ack" mode is explicitly turned off + by application the client does not stay in @b completing state, but + proceeds immediately to next state transition. +
3bcalling
4completingnua_ack() or
@ref NUTAG_AUTOACK() "auto-ack"
ACKreadyProcess answer + Client sends an ACK request in this state transition. If the initial + offer was sent with INVITE, the answer must have been received by this + time, usually in the 2XX response. Client now completes the SDP + offer-answer exchange and activates the media. +
5completingnua_ack() or
@ref NUTAG_AUTOACK() "auto-ack" and
media error
ACK
BYE
terminatingProcess answer + If there was an failure in SDP negotiation or other failure with media, + the stack will automatically terminate the call. The BYE follows + immediatelhy after the ACK. +
6calling3XX 4XX
5XX 6XX
ACK*terminated- Call is terminated when client receives a final error response (from 300 to 699) to its INVITE request. In this case, the underlying transaction engine takes care of sending ACK even when application-driven-ack mode is requested by application. --# Canceling call in @b calling or @b proceeding state: \n +
proceeding
7acallingnua_cancel()CANCELcalling- Client can ask server to cancel the call attempt while in in @b calling or @b proceeding state. There is no direct call state transition caused by nua_cancel(). However, the server will return a 487 Request Terminated response when receiving CANCEL and call is terminated as in previous item. --# Entering @b terminated state: \n - Call can be terminated by sending a @b BYE request after entering - proceeding state. If the stack is in @b completing state (it has already +
7bproceedingproceeding
8proceedingnua_bye()BYEterminating- + Even an early session can be terminated after entering @b proceeding + state with nua_bye(). Stack sends a @b BYE request, and enters + terminating state. Unlike @b CANCEL, @b BYE affects only one fork. +
8completingnua_bye()ACK
BYE
terminating- + If the stack is in @b completing state (it has already received 2XX response), it will have to @b ACK the final response, too. +
@par Detailed Server-Side Call Model