# | +Previous state | Input | Output | Next state | +Offer/ Answer | +Description | +
---|---|---|---|---|---|---|
1 | +init | nua_invite() | INVITE | calling | +Generate 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 + |
2 | +calling | 18X | - | 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 + |
3a | +proceeding | 2XX | +- | completing | +Save 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. + |
3b | +calling | |||||
4 | +completing | +nua_ack() or @ref NUTAG_AUTOACK() "auto-ack" |
+ ACK | ready | +Process 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. + |
5 | +completing | +nua_ack() or @ref NUTAG_AUTOACK() "auto-ack" and media error |
+ ACK BYE |
+ terminating | +Process 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. + |
6 | +calling | +3XX 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 | ||||||
7a | +calling | +nua_cancel() | +CANCEL | +calling | +- | +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 + |
7b | +proceeding | +proceeding | ||||
8 | +proceeding | +nua_bye() | +BYE | +terminating | +- | ++ 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. + |
8 | +completing | nua_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. + |