newRequest = sipRequest; MessageChannel messageChannel = sipStack .createRawMessageChannel(this.listeningPoint.port, nextHop); if (messageChannel != null) { messageChannel.sendMessage((SIPMessage) newRequest); return; } else { continue;
MessageChannel messageChannel = null; if (this.listeningPoints.containsKey(hop.getTransport() .toUpperCase())) messageChannel = sipStack.createRawMessageChannel( ((ListeningPointImpl) this.getListeningPoint(hop .getTransport())).port, hop); if (messageChannel != null) { messageChannel.sendMessage((SIPMessage) sipRequest); } else { throw new SipException( "Could not create a message channel for " + hop.toString()); } } catch (IOException ex) { if (sipStack.isLoggingEnabled()) { sipStack.getLogWriter().logException(ex); }  throw new SipException( "IO Exception occured while Sending Request", ex);  } catch (ParseException ex1) { InternalErrorHandler.handleException(ex1); } finally { if (sipStack.isLoggingEnabled()) sipStack.getLogWriter().logDebug( "done sending " + request.getMethod() + " to hop " + hop);
    public void sendRequest(Request request) throws SipException {        Iterator it = sipStack.getRouter().getNextHops(request);        if (it == null || !it.hasNext())            throw new SipException("could not determine next hop!");        // Bug reported by Rhys Ulerich        if (((SIPRequest) request).getTopmostVia() == null)            throw new SipException("Invalid SipRequest -- no via header!");        // Will slow down the implementation because it involves        // a search to see if a transaction exists.        // This is a common bug so adding some assertion        // checking under debug.        SIPTransaction tr = sipStack.findTransaction((SIPRequest) request,                false);        if (tr != null)            throw new SipException("Cannot send statelessly Transaction found!");        while (it.hasNext()) {            Hop nextHop = (Hop) it.next();            try {                SIPRequest sipRequest = (SIPRequest) request;                String bid = sipRequest.getTransactionId();                Via via = sipRequest.getTopmostVia();                via.setBranch(bid);                SIPRequest newRequest;                newRequest = sipRequest;                MessageChannel messageChannel = sipStack                        .createRawMessageChannel(this.listeningPoint.port, nextHop);                if (messageChannel != null) {                    messageChannel.sendMessage((SIPMessage) newRequest);		    return;                } else {		    continue;		}            } catch (IOException ex) {		if (LogWriter.needsLogging ) {			sipStack.getLogWriter().logException (ex);		}		continue;            } catch (ParseException ex1) {                InternalErrorHandler.handleException(ex1);            }        }	// Could not find a suitable hop to forward the request.        throw new SipException("could not forward request");    }