コード例 #1
0
 /**
  * Returns the type of the network for this Connection.
  *
  * @return the type of the network
  * @throws com.colibria.android.sipservice.sdp.api.SdpParseException
  */
 public String getAddress() throws SdpParseException {
   ConnectionAddress connectionAddress = getConnectionAddress();
   if (connectionAddress == null) return null;
   else {
     Host host = connectionAddress.getAddress();
     if (host == null) return null;
     else return host.getAddress();
   }
 }
コード例 #2
0
 /**
  * Sets the type of the address for this Connection.
  *
  * @param addr to set
  * @throws com.colibria.android.sipservice.sdp.api.SdpException if the type is null
  */
 public void setAddress(String addr) throws SdpException {
   if (addr == null) throw new SdpException("the addr is null");
   else {
     if (address == null) {
       address = new ConnectionAddress();
       Host host = new Host(addr);
       address.setAddress(host);
     } else {
       Host host = address.getAddress();
       if (host == null) {
         host = new Host(addr);
         address.setAddress(host);
       } else host.setAddress(addr);
     }
     setAddress(address);
   }
 }