Oracle Server E10293-02 Manual de usuario Pagina 25

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 108
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 24
Classes and Methods
SIP Servlets 2-11
Example 2–3 Accessing Parameters in SipURI
// Create a SipURI, set the port, the lr, and the transport
// protocol parameter
SipURI myURI;
myURI = sipFactory.createSipURI("bob", "10.0.0.10");
myURI.setPort(5072);
myURI.setLrParam(true);
myURI.setTransportParam("udp");
Address
SIP addresses found in headers, such as the From, To, and Contact headers, are stored
as javax.servlet.sip Address objects. As shown in
Example 2–4, the object
holds, beside the URI, an optional display name and a set of name-value parameters.
Example 2–4 SIP Addresses Stored in java.servlet.sip Address Objects
Address contactAddress;
String displayName;
try
{
// Get the contact address
contactAdress = req.getAddressHeader("Contact");
displayName = contactAdress.getDisplayName();
}
catch (ServletParseException spe)
{
// Handle exception
}
// Create a new address
Address myNewAddress;
myNewAddress = sipFactory.createAddress(URI, "Bob's display name");
myNewAddress.setParameter("myparameter","42");
The content of myNewAddress in the preceding example is as follows:
DisplayName: "Bob’s display name"
URI: <sip:[email protected];lr>;
parameter myparameter: 42
The Address class offers the following methods:
getDisplayName()
setDisplayName()
getURI()
setURI()
clone()
toString()
SIP Details
When working with the SIP Servlet API, many SIP details are hidden and performed
automatically by the OCMS SIP Application Server.
When the transport protocol is UDP, retransmissions are handled automatically.
Vista de pagina 24
1 2 ... 20 21 22 23 24 25 26 27 28 29 30 ... 107 108

Comentarios a estos manuales

Sin comentarios