17.1.2.2 Formal Description 17.1.2.2 形式描述 The state machine for the non-INVITE client transaction is shown in Figure 6. It is very similar to the state machine for INVITE. 非INVITE客户端事务的状态机如图6所示。它与INVITE的状态机非常相似。 The "Trying" state is entered when the TU initiates a new client transaction with a request. When entering this state, the client transaction SHOULD set timer F to fire in 64*T1 seconds. The request MUST be passed to the transport layer for transmission. If an unreliable transport is in use, the client transaction MUST set timer E to fire in T1 seconds. If timer E fires while still in this state, the timer is reset, but this time with a value of MIN(2*T1, T2). When the timer fires again, it is reset to a MIN(4*T1, T2). This process continues so that retransmissions occur with an exponentially increasing interval that caps at T2. The default value of T2 is 4s, and it represents the amount of time a non-INVITE server transaction will take to respond to a request, if it does not respond immediately. For the default values of T1 and T2, this results in intervals of 500 ms, 1 s, 2 s, 4 s, 4 s, 4 s, etc. 当TU通过请求启动新的客户端事务时,将进入“正在尝试”状态。当进入此状态时,客户端事务应该将计时器F设置为在64*T1秒内启动。请求必须传递到传输层进行传输。如果正在使用不可靠的传输,则客户端事务必须将计时器E设置为在T1秒内启动。如果计时器E在仍处于该状态时触发,则计时器被重置,但这次的值为MIN(2*T1,T2)。当计时器再次启动时,它被重置为MIN(4*T1,T2)。该过程继续进行,使得重传以指数增加的间隔发生,该间隔以T2为上限。T2的默认值是4s,它表示非INVITE服务端事务在没有立即响应的情况下响应请求所需的时间。对于T1和T2的默认值,这导致间隔为500毫秒、1秒、2秒、4秒、4秒钟等。 If Timer F fires while the client transaction is still in the "Trying" state, the client transaction SHOULD inform the TU about the timeout, and then it SHOULD enter the "Terminated" state. If a provisional response is received while in the "Trying" state, the response MUST be passed to the TU, and then the client transaction SHOULD move to the "Proceeding" state. If a final response (status codes 200-699) is received while in the "Trying" state, the response MUST be passed to the TU, and the client transaction MUST transition to the "Completed" state. 如果定时器F在客户端事务仍处于“正在尝试”状态时触发,则客户端事务应通知TU超时,然后进入“已终止”状态。如果在“正在尝试”状态下收到临时响应,则必须将响应传递给TU,然后客户端事务应移至“正在进行”状态。如果在“正在尝试”状态下收到最终响应(状态代码200-699),则必须将响应传递给TU,并且客户端事务必须转换到“已完成”状态。 If Timer E fires while in the "Proceeding" state, the request MUST be passed to the transport layer for retransmission, and Timer E MUST be reset with a value of T2 seconds. If timer F fires while in the "Proceeding" state, the TU MUST be informed of a timeout, and the client transaction MUST transition to the terminated state. If a final response (status codes 200-699) is received while in the "Proceeding" state, the response MUST be passed to the TU, and the client transaction MUST transition to the "Completed" state. 如果定时器E在“进行”状态下触发,则必须将请求传递到传输层进行重新传输,并且定时器E必须重置为T2秒。如果定时器F在“正在进行”状态下触发,则必须通知TU超时,并且客户端事务必须转换到终止状态。如果在“正在进行”状态下收到最终响应(状态代码200-699),则必须将响应传递给TU,并且客户端事务必须转换到“已完成”状态。 Once the client transaction enters the "Completed" state, it MUST set Timer K to fire in T4 seconds for unreliable transports, and zero seconds for reliable transports. The "Completed" state exists to buffer any additional response retransmissions that may be received (which is why the client transaction remains there only for unreliable transports). T4 represents the amount of time the network will take to clear messages between client and server transactions. The default value of T4 is 5s. A response is a retransmission when it matches the same transaction, using the rules specified in Section 17.1.3. If Timer K fires while in this state, the client transaction MUST transition to the "Terminated" state. 一旦客户端事务进入“已完成”状态,它必须将计时器K设置为T4秒(对于不可靠的传输)触发,0秒(对于可靠传输)触发。“完成”状态的存在是为了缓冲可能接收到的任何额外响应重传(这就是为什么客户端事务只在不可靠的传输中保留)。T4表示网络清除客户端和服务端事务之间的消息所花费的时间。T4的默认值为5s。当响应与同一事务匹配时,使用第17.1.3节中规定的规则进行重传。如果定时器K在此状态下触发,则客户端事务必须转换到“已终止”状态。 Once the transaction is in the terminated state, it MUST be destroyed immediately.
一旦事务处于终止状态,就必须立即销毁它。
非INVITE客户端事务状态机:流程、超时处理与通信策略,
本文详细描述了非INVITE客户端事务的状态机流程,涉及从尝试到完成,以及在不同状态下的计时器处理、重传策略和终止条件。特别关注了可靠与不可靠传输中的行为和时间参数设置。
1187

被折叠的 条评论
为什么被折叠?



