/** * Creates a new ContactHeader based on the newly supplied address value. * * @param address - the new Address value of the address. * @return the newly created ContactHeader object. */ public ContactHeader createContactHeader(Address address) { if (address == null) throw new NullPointerException("null arg address"); Contact contact = new Contact(); contact.setAddress(address); return contact; }
/** * Creates a new wildcard ContactHeader. This is used in Register requests * to indicate to the server that it should remove all locations the * at which the user is currently available. This implies that the * following conditions are met: * <ul> * <li><code>ContactHeader.getAddress.getAddress.getUserInfo() == *;</code> * <li><code>ContactHeader.getAddress.getAddress.isWildCard() == true;</code> * <li><code>ContactHeader.getExpires() == 0;</code> * </ul> * * @return the newly created wildcard ContactHeader. */ public ContactHeader createContactHeader() { Contact contact = new Contact(); contact.setWildCardFlag(true); contact.setExpires(0); return contact; }
/** * Encode body of the header into a cannonical String. * @return string encoding of the header value. */ protected String encodeBody() { return encodeBody(new StringBuilder()).toString(); }
public SIPHeader parse() throws ParseException { // past the header name and the colon. headerName(TokenTypes.CONTACT); ContactList retval = new ContactList(); while (true) { Contact contact = new Contact(); if (lexer.lookAhead(0) == '*') { final char next = lexer.lookAhead(1); if (next == ' ' || next == '\t' || next == '\r' || next == '\n') { this.lexer.match('*'); contact.setWildCardFlag(true); } else { super.parse(contact); } } else { super.parse(contact); } retval.add(contact); this.lexer.SPorHT(); char la = lexer.lookAhead(0); if (la == ',') { this.lexer.match(','); this.lexer.SPorHT(); } else if (la == '\n' || la == '\0') break; else throw createParseException("unexpected char"); } return retval; }
calleeContact = nistResponse.getContactHeader().getAddress().getURI(); callerContact = nistRequest.getContactHeader().getAddress().getURI();
public void setWildCard() { this.setWildCardFlag(true); }
/** get the Q-value * @return float */ public float getQValue() { return getParameterAsFloat(Q); }
/** get Expires parameter. * @return the Expires parameter. */ public int getExpires() { return getParameterAsInt(EXPIRES); }
dialogMetaData.put(CONTACT_HEADER, contactHeader.getHeaderValue());
public SIPHeader parse() throws ParseException { // past the header name and the colon. headerName(TokenTypes.CONTACT); ContactList retval = new ContactList(); while (true) { Contact contact = new Contact(); if (lexer.lookAhead(0) == '*') { final char next = lexer.lookAhead(1); if (next == ' ' || next == '\t' || next == '\r' || next == '\n') { this.lexer.match('*'); contact.setWildCardFlag(true); } else { super.parse(contact); } } else { super.parse(contact); } retval.add(contact); this.lexer.SPorHT(); char la = lexer.lookAhead(0); if (la == ',') { this.lexer.match(','); this.lexer.SPorHT(); } else if (la == '\n' || la == '\0') break; else throw createParseException("unexpected char"); } return retval; }
final Contact contact = dialog.getMyContactHeader(); if (contact != null) { SipUri contactUri = (SipUri) (contact.getAddress().getURI()); String ipAddress = contactUri.getHost(); int contactPort = contactUri.getPort();
public ContactHeader createContactHeader() { try { String ipAddress = this.getIPAddress(); int port = this.getPort(); SipURI sipURI = new SipUri(); sipURI.setHost(ipAddress); sipURI.setPort(port); sipURI.setTransportParam(this.transport); Contact contact = new Contact(); AddressImpl address = new AddressImpl(); address.setURI(sipURI); contact.setAddress(address); return contact; } catch (Exception ex) { InternalErrorHandler.handleException("Unexpected exception",logger); return null; } }
Contact contact = new Contact(); try { super.remotePartyStringified = remoteTargetCache; contact.setAddress(addressFactory.createAddress(remoteTargetCache)); super.setRemoteTarget(contact); } catch (ParseException e) {