public ClientTransaction createNonInviteClientTransaction(
SipRequest sipRequest, String branchId,
ClientTransactionUser clientTransactionUser) {
//8.1.2
SipURI destinationUri = RequestManager.getDestinationUri(sipRequest,
logger);
//TODO if header route is present, addrspec = toproute.nameaddress.addrspec
String transport = RFC3261.TRANSPORT_UDP;
Hashtable<String, String> params = destinationUri.getUriParameters();
if (params != null) {
String reqUriTransport = params.get(RFC3261.PARAM_TRANSPORT);
if (reqUriTransport != null) {
transport = reqUriTransport;
}
}
int port = destinationUri.getPort();
if (port == SipURI.DEFAULT_PORT) {
port = RFC3261.TRANSPORT_DEFAULT_PORT;
}
SipURI sipUri = userAgent.getConfig().getOutboundProxy();
if (sipUri == null) {
sipUri = destinationUri;
}
InetAddress inetAddress;
try {
inetAddress = InetAddress.getByName(sipUri.getHost());
} catch (UnknownHostException e) {
logger.error("unknown host: " + sipUri.getHost(), e);
return null;
}
ClientTransaction clientTransaction = transactionManager
.createClientTransaction(sipRequest, inetAddress, port, transport,
branchId, clientTransactionUser);