package test.tck.msgflow;
import junit.framework.*;
* The test tries to verify that Invite Server Transactions correctly change
states as specified by the rfc3261. The Reference Implementation is used
to send requests and a Tested Implementation ServerTransaction's states are
queried and compared to those in the state machine described in
section 17.2.1 of rfc3261
|INVITE
|pass INV to TU
INVITE V send 100 if TU won't in 200ms
send response+-----------+
+--------| |--------+101-199 from TU
| | Proceeding| |send response
+------->| |<-------+
| | Transport Err.
| | Inform TU
| |--------------->+
+-----------+ |
300-699 from TU | |2xx from TU |
send response | |send response |
| +------------------>+
| |
INVITE V Timer G fires |
send response+-----------+ send response |
+--------| |--------+ |
| | Completed | | |
+------->| |<-------+ |
+-----------+ |
| | |
ACK | | |
- | +------------------>+
| Timer H fires |
V or Transport Err.|
+-----------+ Inform TU |
| | |
| Confirmed | |
| | |
+-----------+ |
| |
|Timer I fires |
|- |
| |
V |
+-----------+ |
| | |
| Terminated|<---------------+
| |
+-----------+
Figure 7: INVITE server transaction
- Author(s):
- Emil Ivov
Network Research Team, Louis Pasteur University, Strasbourg, France.
This code is in the public domain.
- Version:
- 1.0
Tries to steer a TI server transaction through the following scenario
Proceeding-->Completed-->Confirmed-->Terminated. Apart from state
transitions, we also test, retransmissions and proper hiding/passing
of messages to the TU.
"Failed to register a SipListener with an RI SipProvider",
"A SipExceptionOccurred while trying to send request!",
"Failed to register a SipListener with a TI SipProvider",
if (inviteReceivedEvent == null
throw new TiUnexpectedError("The initial invite request was not received by the TI!");
+ "was thrown while trying to "
+ "create the server transaction");
"tiSipProvider.getNewServerTransaction() returned null",
"No TRYING response has been sent by the TI upon reception "
+ "of an INVITE request",
"A response different from 100 was sent by the TI upon "
"Failed to register a SipListener with an RI SipProvider",
"A SipExceptionOccurred while trying to send request!",
"Failed to register a SipListener with a TI SipProvider",
"Retransmitted INVITEs should not be passed to the TU",
"No TRYING response has been sent by the TI upon reception "
+ "of an INVITE request",
"A response different from 100 was sent by the TI upon "
"A ParseException was thrown while trying to create a ringing "
"Failed to register a SipListener with an RI SipProvider",
fail("The TI failed to send a RINGING response");
"The Transaction did not remain PROCEEDING after transmitting a RINGING response",
"The RINGING response was not received by the RI",
"A response different from RINGING was sent by the TI",
"Failed to register a SipListener with an RI SipProvider",
"A SipExceptionOccurred while trying to send request!",
"Failed to register a SipListener with a TI SipProvider",
"Retransmitted INVITEs should not be passed to the TU",
"No RINGING response has been sent by the TI upon reception "
+ "of an INVITE request",
"A response different from RINGING was sent by the TI upon "
+ "reception of a retransmitted invite INVITE",
"The server transaction left the PROCEEDING state.",
"A ParseException was thrown while trying to create a busy_here "
"Failed to register a SipListener with an RI SipProvider",
fail("The TI failed to send a BUSY_HERE response");
"The Transaction did not remain COMPLETED after transmitting a BUSY_HERE response",
"The BUSY_HERE response was not received by the RI",
"A response different from BUSY_HERE was sent by the TI",
"Failed to register a SipListener with an RI SipProvider",
"A SipExceptionOccurred while trying to send request!",
"Failed to register a SipListener with a TI SipProvider",
"Retransmitted INVITEs should not be passed to the TU",
"No BUSY_HERE response has been sent by the TI upon reception "
+ "of a retransmitted INVITE request",
"A response different from BUSY_HERE was sent by the TI upon "
+ "reception of a retransmitted invite INVITE",
"The server transaction left the COMPLETED state.",
"Failed to register a SipListener with the TI provider",
"Failed to create an ack request",
"ACKs in ServerInviteTransactions shouldn't be passed to the TU.",
"The ServerTransaction did not pas into the confirmed state"
+ "after receiving an ACK.",
JvB: tests CANCEL for an INVITE ST
"Failed to register a SipListener with an RI SipProvider",
"A SipExceptionOccurred while trying to send request!",
"Failed to register a SipListener with a TI SipProvider",
if (inviteReceivedEvent == null
throw new TiUnexpectedError("The initial invite request was not received by the TI!");
+ "was thrown while trying to "
+ "create the server transaction");
"tiSipProvider.getNewServerTransaction() returned null",
"No TRYING response has been sent by the TI upon reception "
+ "of an INVITE request",
"A response different from 100 was sent by the TI upon "
"A ParseException was thrown while trying to create a ringing "
"Failed to register a SipListener with an RI SipProvider",
fail("The TI failed to send a RINGING response");
"The Transaction did not remain PROCEEDING after transmitting a RINGING response",
"The RINGING response was not received by the RI",
"A response different from RINGING was sent by the TI",
"A SipExceptionOccurred while trying to send CANCEL request!",
"Failed to register a SipListener with a TI SipProvider",
if (cancelReceivedEvent == null
"A ParseException was thrown while trying to create a OK "
"Failed to register a SipListener with an RI SipProvider",
fail("The TI failed to send a CANCEL OK response");
"The CANCEL OK response was not received by the RI",
"A response different from OK was sent by the TI",
"A ParseException was thrown while trying to create a req_terminated "
"Failed to register a SipListener with an RI SipProvider",
fail("The TI failed to send a REQUEST_TERMINATED response");
"The Transaction did not remain COMPLETED after transmitting a REQUEST_TERMINATED response",
"The REQUEST_TERMINATED response was not received by the RI",
"A response different from REQUEST_TERMINATED was sent by the TI",
"The ServerTransaction did not pas into the confirmed state"
+ "after receiving an ACK.",
JvB: tests CANCEL for an INVITE ST, from an non-RFC3261 client
which uses a Via branch not starting with the magic cookie
"Failed to register a SipListener with an RI SipProvider",
"A SipExceptionOccurred while trying to send request!",
"Failed to register a SipListener with a TI SipProvider",
if (inviteReceivedEvent == null
throw new TiUnexpectedError("The initial invite request was not received by the TI!");
+ "was thrown while trying to "
+ "create the server transaction");
"tiSipProvider.getNewServerTransaction() returned null",
"No TRYING response has been sent by the TI upon reception "
+ "of an INVITE request",
"A response different from 100 was sent by the TI upon "
"A ParseException was thrown while trying to create a ringing "
"Failed to register a SipListener with an RI SipProvider",
fail("The TI failed to send a RINGING response");
"The Transaction did not remain PROCEEDING after transmitting a RINGING response",
"The RINGING response was not received by the RI",
"A response different from RINGING was sent by the TI",
"A SipExceptionOccurred while trying to send CANCEL request!",
"Failed to register a SipListener with a TI SipProvider",
if (cancelReceivedEvent == null
"A ParseException was thrown while trying to create a OK "
"Failed to register a SipListener with an RI SipProvider",
fail("The TI failed to send a CANCEL OK response");
"The CANCEL OK response was not received by the RI",
"A response different from OK was sent by the TI",
"A ParseException was thrown while trying to create a req_terminated "
"Failed to register a SipListener with an RI SipProvider",
fail("The TI failed to send a REQUEST_TERMINATED response");
"The Transaction did not remain COMPLETED after transmitting a REQUEST_TERMINATED response",
"The REQUEST_TERMINATED response was not received by the RI",
"A response different from REQUEST_TERMINATED was sent by the TI",
"The ServerTransaction did not pas into the confirmed state"
+ "after receiving an ACK.",
JvB: tests CANCEL for an INVITE ST, in case the client changes
the case of the branch id to all lowercvase (NIST used to do this)
"Failed to register a SipListener with an RI SipProvider",
"A SipExceptionOccurred while trying to send request!",
"Failed to register a SipListener with a TI SipProvider",
if (inviteReceivedEvent == null
throw new TiUnexpectedError("The initial invite request was not received by the TI!");
+ "was thrown while trying to "
+ "create the server transaction");
"tiSipProvider.getNewServerTransaction() returned null",
"No TRYING response has been sent by the TI upon reception "
+ "of an INVITE request",
"A response different from 100 was sent by the TI upon "
"A ParseException was thrown while trying to create a ringing "
"Failed to register a SipListener with an RI SipProvider",
fail("The TI failed to send a RINGING response");
"The Transaction did not remain PROCEEDING after transmitting a RINGING response",
"The RINGING response was not received by the RI",
"A response different from RINGING was sent by the TI",
"A SipExceptionOccurred while trying to send CANCEL request!",
"Failed to register a SipListener with a TI SipProvider",
if (cancelReceivedEvent == null
"A ParseException was thrown while trying to create a OK "
"Failed to register a SipListener with an RI SipProvider",
fail("The TI failed to send a CANCEL OK response");
"The CANCEL OK response was not received by the RI",
"A response different from OK was sent by the TI",
"A ParseException was thrown while trying to create a req_terminated "