// Fetch port from request (use 5060 if port is missing)
int port = sipUri.getPort();
if (port != -1) {
// Fetch valid ports
SipBindingCtx sipBindingCtx = SipBindingResolver.instance()
.getActiveExternalContext();
TargetTuple[] tt = sipBindingCtx.getTargetTuples();
// Check if port in request is one of the valid ones
for (int i = 0; i < tt.length; i++) {
if (port == tt[i].getPort()) {
local = true;