Search in sources :

Example 11 with HostPort

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;
}
Also used : HostPort(gov.nist.core.HostPort) Host(gov.nist.core.Host)

Aggregations

HostPort (gov.nist.core.HostPort)11 Host (gov.nist.core.Host)9 HostNameParser (gov.nist.core.HostNameParser)2 ParseException (java.text.ParseException)2 NameValue (gov.nist.core.NameValue)1 Token (gov.nist.core.Token)1 SipUri (gov.nist.javax.sip.address.SipUri)1 SIPRequest (gov.nist.javax.sip.message.SIPRequest)1 IOException (java.io.IOException)1 UnknownHostException (java.net.UnknownHostException)1 Iterator (java.util.Iterator)1 InvalidArgumentException (javax.sip.InvalidArgumentException)1