this.dialog = this.inviteTid.getDialog(); ReInviteTest.assertTrue(this.dialog.getState() == null);
	public void sendInvite() {		try {			// Note that a provider has multiple listening points.			// all the listening points must have the same IP address			// and port but differ in their transport parameters.			String fromName = "BigGuy";			String fromSipAddress = "here.com";			String fromDisplayName = "The Master Blaster";			String toSipAddress = "there.com";			String toUser = "LittleGuy";			String toDisplayName = "The Little Blister";			// create >From Header			SipURI fromAddress = protocolObjects.addressFactory.createSipURI(					fromName, fromSipAddress);			Address fromNameAddress = protocolObjects.addressFactory					.createAddress(fromAddress);			fromNameAddress.setDisplayName(fromDisplayName);			FromHeader fromHeader = protocolObjects.headerFactory					.createFromHeader(fromNameAddress, new Integer((int) (Math							.random() * Integer.MAX_VALUE)).toString());			// create To Header			SipURI toAddress = protocolObjects.addressFactory.createSipURI(					toUser, toSipAddress);			Address toNameAddress = protocolObjects.addressFactory					.createAddress(toAddress);			toNameAddress.setDisplayName(toDisplayName);			ToHeader toHeader = protocolObjects.headerFactory.createToHeader(					toNameAddress, null);			// create Request URI			SipURI requestURI = protocolObjects.addressFactory.createSipURI(					toUser, peerHostPort);			// Create ViaHeaders			ArrayList viaHeaders = new ArrayList();			int port = provider.getListeningPoint(protocolObjects.transport)					.getPort();			ViaHeader viaHeader = protocolObjects.headerFactory					.createViaHeader(myAddress, port,							protocolObjects.transport, null);			// add via headers			viaHeaders.add(viaHeader);			// Create ContentTypeHeader			ContentTypeHeader contentTypeHeader = protocolObjects.headerFactory					.createContentTypeHeader("application", "sdp");			// Create a new CallId header			CallIdHeader callIdHeader = provider.getNewCallId();			// JvB: Make sure that the implementation matches the messagefactory			callIdHeader = protocolObjects.headerFactory.createCallIdHeader( callIdHeader.getCallId() );			// Create a new Cseq header			CSeqHeader cSeqHeader = protocolObjects.headerFactory					.createCSeqHeader(1, Request.INVITE);			// Create a new MaxForwardsHeader			MaxForwardsHeader maxForwards = protocolObjects.headerFactory					.createMaxForwardsHeader(70);			// Create the request.			Request request = protocolObjects.messageFactory.createRequest(					requestURI, Request.INVITE, callIdHeader, cSeqHeader,					fromHeader, toHeader, viaHeaders, maxForwards);			// Create contact headers			// Create the contact name address.			SipURI contactURI = protocolObjects.addressFactory.createSipURI(					fromName, myAddress);			contactURI.setPort(provider.getListeningPoint(					protocolObjects.transport).getPort());			Address contactAddress = protocolObjects.addressFactory					.createAddress(contactURI);			// Add the contact address.			contactAddress.setDisplayName(fromName);			contactHeader = protocolObjects.headerFactory					.createContactHeader(contactAddress);			request.addHeader(contactHeader);			// Add the extension header.			Header extensionHeader = protocolObjects.headerFactory					.createHeader("My-Header", "my header value");			request.addHeader(extensionHeader);			String sdpData = "v=0\r\n"					+ "o=4855 13760799956958020 13760799956958020"					+ " IN IP4  129.6.55.78\r\n" + "s=mysession session\r\n"					+ "p=+46 8 52018010\r\n" + "c=IN IP4  129.6.55.78\r\n"					+ "t=0 0\r\n" + "m=audio 6022 RTP/AVP 0 4 18\r\n"					+ "a=rtpmap:0 PCMU/8000\r\n" + "a=rtpmap:4 G723/8000\r\n"					+ "a=rtpmap:18 G729A/8000\r\n" + "a=ptime:20\r\n";			request.setContent(sdpData, contentTypeHeader);			// The following is the preferred method to route requests			// to the peer. Create a route header and set the "lr"			// parameter for the router header.			Address address = protocolObjects.addressFactory					.createAddress("<sip:" + PEER_ADDRESS + ":" + PEER_PORT							+ ">");			// SipUri sipUri = (SipUri) address.getURI();			// sipUri.setPort(PEER_PORT);			RouteHeader routeHeader = protocolObjects.headerFactory					.createRouteHeader(address);			((SipURI)address.getURI()).setLrParam();			request.addHeader(routeHeader);			extensionHeader = protocolObjects.headerFactory.createHeader(					"My-Other-Header", "my new header value ");			request.addHeader(extensionHeader);			Header callInfoHeader = protocolObjects.headerFactory.createHeader(					"Call-Info", "<http://www.antd.nist.gov>");			request.addHeader(callInfoHeader);			// Create the client transaction.			this.inviteTid = provider.getNewClientTransaction(request);			// send the request out.			this.inviteTid.sendRequest();			this.dialog = this.inviteTid.getDialog();			ReInviteTest.assertTrue(this.dialog.getState() == null);					} catch (Exception ex) {			logger.error("Unexpected exception", ex);			ReInviteTest.fail("unexpected exception");		}	}