| java.lang.Object com.sun.midp.i3test.TestCase javax.microedition.sip.SipHeaderBaseTest javax.microedition.sip.TestViaHeader
TestViaHeader | public class TestViaHeader extends SipHeaderBaseTest (Code) | | RFC3261, p. 179; BNF: p. 232
The Via header field indicates the path taken by the request so far
and indicates the path that should be followed in routing responses.
The branch ID parameter in the Via header field values serves as a
transaction identifier, and is used by proxies to detect loops.
A Via header field value contains the transport protocol used to send
the message, the client's host name or network address, and possibly
the port number at which it wishes to receive responses. A Via
header field value can also contain parameters such as "maddr",
"ttl", "received", and "branch", whose meaning and use are described
in other sections. For implementations compliant to this
specification, the value of the branch parameter MUST start with the
magic cookie "z9hG4bK", as discussed in Section 8.1.1.7.
Transport protocols defined here are "UDP", "TCP", "TLS", and "SCTP".
"TLS" means TLS over TCP. When a request is sent to a SIPS URI, the
protocol still indicates "SIP", and the transport protocol is TLS.
Via: SIP/2.0/UDP erlang.bell-telephone.com:5060;branch=z9hG4bK87asdks7
Via: SIP/2.0/UDP 192.0.2.1:5060 ;received=192.0.2.207 ;branch=z9hG4bK77asjd
The compact form of the Via header field is v.
In this example, the message originated from a multi-homed host with
two addresses, 192.0.2.1 and 192.0.2.207. The sender guessed wrong
as to which network interface would be used. Erlang.bell-
telephone.com noticed the mismatch and added a parameter to the
previous hop's Via header field value, containing the address that
the packet actually came from.
The host or network address and port number are not required to
follow the SIP URI syntax. Specifically, LWS on either side of the
":" or "/" is allowed, as shown here:
Via: SIP / 2.0 / UDP first.example.com: 4000;ttl=16
;maddr=224.2.0.1 ;branch=z9hG4bKa7c6a8dlze.1
|
Method Summary | |
void | Test1() Body of the test 1. | void | Test2() Body of the test 2. | void | Test4() Body of the test 4. | void | Test5() Body of the test 5. | public void | runTests() |
Test1 | void Test1()(Code) | | Body of the test 1.
Test for Via header field: setName()/getName().
|
Test2 | void Test2()(Code) | | Body of the test 2.
Test for Via header field: getValue()/getHeaderValue().
|
Test4 | void Test4()(Code) | | Body of the test 4.
Test for Via header field: getParameterNames()/getParameter().
|
Test5 | void Test5()(Code) | | Body of the test 5.
Test for Via header field: setParameter()/removeParameter().
|
runTests | public void runTests()(Code) | | Run the tests
|
Methods inherited from com.sun.midp.i3test.TestCase | public void assertEquals(Object expected, Object actual)(Code)(Java Doc) public void assertEquals(String message, Object expected, Object actual)(Code)(Java Doc) public void assertEquals(int expected, int actual)(Code)(Java Doc) public void assertEquals(String message, int expected, int actual)(Code)(Java Doc) public void assertFalse(boolean condition)(Code)(Java Doc) public void assertFalse(String message, boolean condition)(Code)(Java Doc) public void assertNotNull(Object object)(Code)(Java Doc) public void assertNotNull(String message, Object object)(Code)(Java Doc) public void assertNotSame(Object expected, Object actual)(Code)(Java Doc) public void assertNotSame(String message, Object expected, Object actual)(Code)(Java Doc) public void assertNull(Object object)(Code)(Java Doc) public void assertNull(String message, Object object)(Code)(Java Doc) public void assertSame(Object expected, Object actual)(Code)(Java Doc) public void assertSame(String message, Object expected, Object actual)(Code)(Java Doc) public void assertTrue(String message, boolean condition)(Code)(Java Doc) public void assertTrue(boolean condition)(Code)(Java Doc) public void declare(String testName)(Code)(Java Doc) public void fail()(Code)(Java Doc) public void fail(String message)(Code)(Java Doc) protected SecurityToken getSecurityToken()(Code)(Java Doc) protected boolean getVerbose()(Code)(Java Doc) public void info(String s)(Code)(Java Doc) abstract public void runTests() throws Throwable(Code)(Java Doc)
|
|
|