try {
// JvB: Transport from first entry in route set, or remote Contact
// if none
// Only used to find correct LP & create correct Via
SipURI uri4transport = null;
if (this.routeList != null && !this.routeList.isEmpty()) {
Route r = (Route) this.routeList.getFirst();
uri4transport = ((SipURI) r.getAddress().getURI());
} else { // should be !=null, checked above
uri4transport = ((SipURI) this.getRemoteTarget().getURI());
}
String transport = uri4transport.getTransportParam();
ListeningPointImpl lp;
if (transport != null) {
lp = (ListeningPointImpl) sipProvider
.getListeningPoint(transport);
} else {
if (uri4transport.isSecure()) { // JvB fix: also support TLS
lp = (ListeningPointImpl) sipProvider
.getListeningPoint(ListeningPoint.TLS);
} else {
lp = (ListeningPointImpl) sipProvider
.getListeningPoint(ListeningPoint.UDP);