Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

more fixes to master branch

  • Loading branch information...
commit c70e086f6bb54923fcdbc0cd99f2c50a01bf7320 1 parent d6fabbb
Cristi Starasciuc authored
View
26 sipXbridge/src/main/java/org/sipfoundry/sipxbridge/AccountManagerImpl.java
@@ -102,6 +102,22 @@ boolean checkSipxecsLineid(ArrayList<String> ids, SipURI uri) {
return false;
}
+ //Check if the SIP Uri points back to sipxbridge address:port.
+ boolean uriContainsBridgeAddress(SipURI sipUri)
+ {
+ int uriPort = sipUri.getPort();
+ String uriHost = sipUri.getHost();
+
+ //compare with both bridge addresses: local and external
+ boolean isBridgeAddress = bridgeConfiguration.getLocalAddress().equals(uriHost) ||
+ bridgeConfiguration.getExternalAddress().equals(uriHost);
+ //compare with both bridge ports: local and external
+ boolean isBridgePort = ((bridgeConfiguration.getLocalPort() == uriPort) ||
+ (bridgeConfiguration.getExternalPort() == uriPort));
+
+ return (isBridgeAddress && isBridgePort);
+ }
+
/**
* Get the outbound ITSP account for a specific outbund SipURI.
*/
@@ -176,7 +192,14 @@ ItspAccountInfo getAccount(Request request) {
}
}
}
-
+ /*
+ * Check if the outbound request domain:ipaddress:port points back to sipxbridge
+ * address:port. This should not be allowed as it will lead to an INVITE looping
+ * in sipxbridge and overloading cpu.
+ */
+ if (uriContainsBridgeAddress(sipUri)) {
+ return null;
+ } else {
String userName = ((SipURI) ((FromHeader) request.getHeader(FromHeader.NAME)).getAddress().getURI())
.getUser();
@@ -196,6 +219,7 @@ ItspAccountInfo getAccount(Request request) {
accountFound.setRegisterOnInitialization(false);
this.addItspAccount(accountFound);
return accountFound;
+ }
} finally {
if ( logger.isDebugEnabled() ) logger.debug("getItspAccount: returning " + accountFound);
}
View
12 sipXbridge/src/main/java/org/sipfoundry/sipxbridge/CallControlManager.java
@@ -519,6 +519,18 @@ private void processInvite(RequestEvent requestEvent) {
itspAccount = Gateway.getAccountManager().getItspAccount(inboundVias);
}
+ /**
+ * Do not allow processing request without a valid itsp account
+ */
+ if (null == itspAccount)
+ {
+ Response response = SipUtilities.createResponse(serverTransaction,
+ Response.LOOP_DETECTED);
+ serverTransaction.sendResponse(response);
+
+ return;
+ }
+
/*
* Look at the Dialog context. The B2BUA structure tracks the call and is pointed to
* by the dialog application data.
View
17 sipXbridge/src/main/java/org/sipfoundry/sipxbridge/SipListenerImpl.java
@@ -427,6 +427,23 @@ public void processRequest(RequestEvent requestEvent) {
Iterator inboundVias = request.getHeaders(ViaHeader.NAME);
itspAccount = Gateway.getAccountManager().getItspAccount(inboundVias);
}
+
+ /**
+ * Do not allow processing request without a valid itsp account
+ */
+ if (null == itspAccount)
+ {
+ ServerTransaction st = requestEvent.getServerTransaction();
+ if ( st == null ) {
+ st = provider.getNewServerTransaction(requestEvent.getRequest());
+ }
+
+ Response response = SipUtilities.createResponse(st, Response.LOOP_DETECTED);
+ st.sendResponse(response);
+
+ return;
+ }
+
if ( !request.getMethod().equals(Request.ACK) && itspAccount != null && ! itspAccount.isEnabled() ) {
ServerTransaction st = requestEvent.getServerTransaction();
View
10 sipXcommons/src/main/java/org/sipfoundry/commons/mongo/MongoConstants.java
@@ -56,8 +56,14 @@
static final String JOB_TITLE = "jbttl";
static final String JOB_DEPT = "jbdpt";
static final String COMPANY_NAME = "cmpnm";
+ static final String CONTACT_NAME = "ctcnm";
+ static final String CONTACT_JOB = "ctcjb";
+ static final String CONTACT_WORK_PHONE_NUMBER = "ctcwph";
+ static final String CONTACT_CELL_PHONE_NUMBER = "ctccell";
+ static final String CONTACT_EMAIL = "ctcemail";
static final String ASSISTANT_NAME = "astnm";
static final String ASSISTANT_PHONE = "astph";
+ static final String ASSISTANT_EMAIL = "astemail";
static final String FAX_NUMBER = "fax";
static final String LOCATION = "loctn"; // this is different than loc field in user
// location db
@@ -75,6 +81,8 @@
static final String OFFICE_STATE = "ostate";
static final String OFFICE_ZIP = "ozip";
static final String OFFICE_DESIGNATION = "odsgn";
+ static final String OFFICE_PHONE_NUMBER = "cmpph";
+ static final String OFFICE_FAX_NUMBER = "cmpfax";
static final String CONF_ENTRY_IM = "cnfentry";
static final String CONF_EXIT_IM = "cnfexit";
static final String LEAVE_MESSAGE_BEGIN_IM = "lvmsgbeg";
@@ -146,4 +154,6 @@
static final String GROUP_RESOURCE = "grprsc";
static final String PLAY_DEFAULT_VM = "defvmopt";
static final String MY_BUDDY_GROUP = "imbot";
+ // OpenAcd
+ static final String URL_POPUP = "urlpop";
}
Please sign in to comment.
Something went wrong with that request. Please try again.