use of gov.nist.core.HostPort in project XobotOS by xamarin.
the class SIPTransactionStack method createMessageChannel.
/**
* Creates a client transaction to handle a new request. Gets the real message channel from
* the superclass, and then creates a new client transaction wrapped around this channel.
*
* @param nextHop Hop to create a channel to contact.
*/
public MessageChannel createMessageChannel(SIPRequest request, MessageProcessor mp, Hop nextHop) throws IOException {
// New client transaction to return
SIPTransaction returnChannel;
// Create a new client transaction around the
// superclass' message channel
// Create the host/port of the target hop
Host targetHost = new Host();
targetHost.setHostname(nextHop.getHost());
HostPort targetHostPort = new HostPort();
targetHostPort.setHost(targetHost);
targetHostPort.setPort(nextHop.getPort());
MessageChannel mc = mp.createMessageChannel(targetHostPort);
// available for the transport.
if (mc == null)
return null;
returnChannel = createClientTransaction(request, mc);
((SIPClientTransaction) returnChannel).setViaPort(nextHop.getPort());
((SIPClientTransaction) returnChannel).setViaHost(nextHop.getHost());
addTransactionHash(returnChannel);
// returnChannel.startTransactionTimer();
return returnChannel;
}
Aggregations