Permalink
Browse files

Merge remote-tracking branch 'origin/release-4.6'

Conflicts:
	OpenACD
  • Loading branch information...
2 parents 7de3c0c + ac31ac8 commit 07f532dfdb4732ca273d1d516d12474f832b4632 @ezuce-admin ezuce-admin committed Nov 27, 2012
Showing with 393 additions and 179 deletions.
  1. +1 −1 OpenACD
  2. +3 −1 sipXcommserverLib/src/persist/SipPersistentSubscriptionMgr.cpp
  3. +56 −24 sipXcommserverLib/src/sipdb/SubscribeDB.cpp
  4. +2 −1 sipXconfig/etc/sipxpbx/sipxregistrar/sipxregistrar.properties
  5. +5 −1 sipXconfig/etc/sipxpbx/sipxregistrar/sipxregistrar.xml
  6. +1 −1 sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/commserver/commserver.beans.xml
  7. +5 −1 sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/commserver/imdb/imdb.beans.xml
  8. +17 −10 sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/openacd/OpenAcdConfiguration.java
  9. +5 −2 sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/openacd/OpenAcdReplicationProvider.java
  10. +2 −1 sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/openacd/OpenAcdReplicationProviderImpl.java
  11. +1 −0 sipXconfig/neoconf/test/org/sipfoundry/sipxconfig/registrar/expected-registrar-config
  12. +1 −0 sipXconfig/neoconf/test/org/sipfoundry/sipxconfig/registrar/expected-registrar-config-with-plugins
  13. +3 −0 sipXconfig/web/src/org/sipfoundry/sipxconfig/api/UserBuilder.java
  14. +9 −0 sipXivr/src/org/sipfoundry/voicemail/VmEslRequestController.java
  15. +22 −6 sipXproxy/etc/sipxproxy.cf
  16. +14 −4 sipXproxy/lib/authplugins/NatTraversalAgent/MediaRelay.cpp
  17. +2 −1 sipXproxy/lib/authplugins/NatTraversalAgent/MediaRelay.h
  18. +9 −7 sipXproxy/lib/authplugins/NatTraversalAgent/NatTraversalAgent.cpp
  19. +2 −8 sipXproxy/lib/authplugins/NatTraversalAgent/NatTraversalAgent.h
  20. +9 −0 sipXproxy/lib/authplugins/NatTraversalAgent/NatTraversalAgentDataTypes.h
  21. +21 −4 sipXproxy/lib/authplugins/NatTraversalAgent/SessionContext.cpp
  22. +16 −7 sipXpublisher/include/statusserver/MwiPluginQueue.h
  23. +3 −2 sipXpublisher/src/statusserver/SubscribeServerThread.cpp
  24. +16 −5 sipXregistry/lib/redirect_plugins/SipRedirectorAliasDB.cpp
  25. +1 −0 sipXregistry/lib/redirect_plugins/SipRedirectorAliasDB.h
  26. +0 −13 sipXrelay/sipxrelay.cf
  27. +20 −9 sipXrls/src/ContactSet.cpp
  28. +4 −2 sipXrls/src/ContactSet.h
  29. +2 −1 sipXrls/src/ResourceCached.cpp
  30. +14 −3 sipXrls/src/ResourceCached.h
  31. +82 −19 sipXsupervisor/bin/sipxecs-setup.in
  32. +2 −4 sipXsupervisor/etc/iptables.erb
  33. +42 −41 sipXtackLib/src/net/SipClient.cpp
  34. +1 −0 sipXtackLib/src/net/SipSubscribeClient.cpp
Submodule OpenACD updated 61 files
+8 −1 Makefile
+2 −1 config/app.config
+11 −2 include/call.hrl
+ rebar
+7 −6 rebar.config
+24 −0 scripts/openacd
+310 −181 src/agent.erl
+37 −36 src/agent_auth.erl
+44 −44 src/agent_auth_mnesia.erl
+21 −21 src/agent_channel.erl
+2 −4 src/agent_dialplan_connection.erl
+2 −2 src/agent_dialplan_listener.erl
+4 −4 src/agent_dummy_connection.erl
+224 −209 src/agent_manager.erl
+9 −9 src/agent_tcp_client.erl
+17 −17 src/agent_tcp_connection.erl
+30 −30 src/agent_tcp_listener.erl
+547 −541 src/agent_web_connection.erl
+79 −79 src/agent_web_listener.erl
+1,377 −815 src/call_queue.erl
+58 −57 src/call_queue_config.erl
+363 −363 src/call_queue_config_mnesia.erl
+20 −20 src/cdr.erl
+4 −4 src/cdr_csv.erl
+8 −8 src/cdr_dets.erl
+3 −3 src/cdr_odbc.erl
+858 −859 src/cook.erl
+14 −14 src/cpx.erl
+431 −54 src/cpx_agent_connection.erl
+269 −269 src/cpx_agent_event.erl
+10 −10 src/cpx_agent_tcp_client.erl
+584 −409 src/cpx_agent_tcp_connection.erl
+102 −102 src/cpx_agent_tcp_listener.erl
+54 −54 src/cpx_hooks.erl
+10 −10 src/cpx_middle_supervisor.erl
+61 −61 src/cpx_monitor.erl
+2 −2 src/cpx_monitor_grapher.erl
+128 −128 src/cpx_monitor_kgb_eventlog.erl
+2 −2 src/cpx_monitor_kgb_odbc.erl
+171 −168 src/cpx_monitor_odbc_supervisor.erl
+45 −45 src/cpx_monitor_passive.erl
+232 −232 src/cpx_supervisor.erl
+168 −168 src/cpx_web_management.erl
+2 −2 src/cpxlog.erl
+1 −1 src/cpxlog_error_logger_redirect.erl
+1 −1 src/cpxlog_terminal.erl
+64 −27 src/dispatch_manager.erl
+317 −311 src/dispatcher.erl
+174 −174 src/email_media.erl
+5 −5 src/email_media_manager.erl
+2 −2 src/email_media_session.erl
+3 −3 src/gen_cdr_dumper.erl
+158 −158 src/gen_media.erl
+3 −3 src/integration.erl
+3 −3 src/integration_file.erl
+15 −15 src/protobuf_util.erl
+298 −298 src/queue_manager.erl
+11 −11 src/sip_bot.erl
+25 −25 src/sip_bot_manager.erl
+43 −44 src/supervisor_web_connection.erl
+40 −35 src/util.erl
@@ -201,7 +201,9 @@ UtlBoolean SipPersistentSubscriptionMgr::updateDialogInfo(
accept.data());
mDB.upsert(mComponent, requestUri, callId, contactEntry, expires,
subscribeCseq, eventTypeKey, eventType, "", to, from,
- resourceId, route, 1, accept, 0);
+ resourceId, route,
+ isNew, // set the current notify cseq. true(1) for new dialogs and false(0) for refresh
+ accept, 0);
}
Os::Logger::instance().log(FAC_SIP, PRI_DEBUG,
@@ -60,30 +60,62 @@ void SubscribeDB::upsert (
"callId" << callId.str() <<
"eventTypeKey" << eventTypeKey.str());
- mongo::BSONObj update = BSON("$set" << BSON(
- Subscription::component_fld() << component.str() <<
- Subscription::uri_fld() << uri.str() <<
- Subscription::callId_fld() << callId.str() <<
- Subscription::contact_fld() << contact.str() <<
- Subscription::expires_fld() << expires <<
- Subscription::subscribeCseq_fld() << subscribeCseq <<
- Subscription::eventTypeKey_fld() << eventTypeKey.str() <<
- Subscription::eventType_fld() << eventType.str() <<
- Subscription::id_fld() << id.str() <<
- Subscription::toUri_fld() << toUri.str() <<
- Subscription::fromUri_fld() << fromUri.str() <<
- Subscription::key_fld() << key.str() <<
- Subscription::recordRoute_fld() << recordRoute.str() <<
- Subscription::notifyCseq_fld() << notifyCseq <<
- Subscription::accept_fld() << accept.str() <<
- Subscription::version_fld() << version));
-
- mongo::ScopedDbConnection conn(_info.getConnectionString());
- conn->update(_info.getNS(), query, update, true, false);
- conn->ensureIndex("node.subscription", BSON( "expires" << 1 ));
- conn->ensureIndex("node.subscription", BSON( "key" << 1 ));
- conn->ensureIndex("node.subscription", BSON( "toUri" << 1 ));
- conn.done();
+ if (notifyCseq)
+ {
+ mongo::BSONObj update = BSON("$set" << BSON(
+ Subscription::component_fld() << component.str() <<
+ Subscription::uri_fld() << uri.str() <<
+ Subscription::callId_fld() << callId.str() <<
+ Subscription::contact_fld() << contact.str() <<
+ Subscription::expires_fld() << expires <<
+ Subscription::subscribeCseq_fld() << subscribeCseq <<
+ Subscription::eventTypeKey_fld() << eventTypeKey.str() <<
+ Subscription::eventType_fld() << eventType.str() <<
+ Subscription::id_fld() << id.str() <<
+ Subscription::toUri_fld() << toUri.str() <<
+ Subscription::fromUri_fld() << fromUri.str() <<
+ Subscription::key_fld() << key.str() <<
+ Subscription::recordRoute_fld() << recordRoute.str() <<
+ Subscription::notifyCseq_fld() << notifyCseq <<
+ Subscription::accept_fld() << accept.str() <<
+ Subscription::version_fld() << version));
+
+ mongo::ScopedDbConnection conn(_info.getConnectionString());
+ conn->update(_info.getNS(), query, update, true, false);
+ conn->ensureIndex("node.subscription", BSON( "expires" << 1 ));
+ conn->ensureIndex("node.subscription", BSON( "key" << 1 ));
+ conn->ensureIndex("node.subscription", BSON( "toUri" << 1 ));
+ conn.done();
+ }
+ else
+ {
+ //
+ // do not include the notifysequence in the update if it is zero
+ //
+ mongo::BSONObj update = BSON("$set" << BSON(
+ Subscription::component_fld() << component.str() <<
+ Subscription::uri_fld() << uri.str() <<
+ Subscription::callId_fld() << callId.str() <<
+ Subscription::contact_fld() << contact.str() <<
+ Subscription::expires_fld() << expires <<
+ Subscription::subscribeCseq_fld() << subscribeCseq <<
+ Subscription::eventTypeKey_fld() << eventTypeKey.str() <<
+ Subscription::eventType_fld() << eventType.str() <<
+ Subscription::id_fld() << id.str() <<
+ Subscription::toUri_fld() << toUri.str() <<
+ Subscription::fromUri_fld() << fromUri.str() <<
+ Subscription::key_fld() << key.str() <<
+ Subscription::recordRoute_fld() << recordRoute.str() <<
+ Subscription::accept_fld() << accept.str() <<
+ Subscription::version_fld() << version));
+
+ mongo::ScopedDbConnection conn(_info.getConnectionString());
+ conn->update(_info.getNS(), query, update, true, false);
+ conn->ensureIndex("node.subscription", BSON( "expires" << 1 ));
+ conn->ensureIndex("node.subscription", BSON( "key" << 1 ));
+ conn->ensureIndex("node.subscription", BSON( "toUri" << 1 ));
+ conn.done();
+ }
removeAllExpired();
}
@@ -86,4 +86,5 @@ registrar-config.SIP_REGISTRAR.MWI.UA.CISCO.label=
registrar-config.SIP_REGISTRAR.MWI.UA.CISCO.description=
registrar-config.SIP_REDIRECT.140-FALLBACK.ALLOW_UNBOUND.label=Allow Unbound
registrar-config.SIP_REDIRECT.140-FALLBACK.ALLOW_UNBOUND.description=If checked, applications that know the shared secret will be allowed to make external calls
-
+registrar-config.SIP_REGISTRAR_ADD_DIVERSION.label=Add Diversion Headers
+registrar-config.SIP_REGISTRAR_ADD_DIVERSION.description=If checked, redirection through user forwards will be preserved as diversion headers containing the original URI.
@@ -146,7 +146,11 @@
<setting name="SIP_REDIRECT.140-FALLBACK.ALLOW_UNBOUND" advanced="yes">
<type refid="yesNo"/>
<value>N</value>
- </setting>
+ </setting>
+ <setting name="SIP_REGISTRAR_ADD_DIVERSION" advanced="yes">
+ <type refid="yesNo"/>
+ <value>N</value>
+ </setting>
</group>
<group name="userparam" advanced="yes">
<setting name="SIP_REDIRECT.090-USERPARAM.STRIP_ALL" advanced="yes">
@@ -41,7 +41,7 @@
</bean>
<bean id="sipxReplicationContextImpl" class="org.sipfoundry.sipxconfig.commserver.SipxReplicationContextImpl">
- <property name="replicationManager" ref="replicationManagerImpl" />
+ <property name="replicationManager" ref="replicationManager" />
<property name="locationsManager" ref="locationsManager" />
<property name="jobContext" ref="jobContext" />
</bean>
@@ -68,7 +68,11 @@
class="org.sipfoundry.sipxconfig.commserver.imdb.OpenAcd">
</bean>
- <alias name="replicationManagerImpl" alias="replicationManager"/>
+ <bean id="replicationManager" class="org.springframework.aop.framework.ProxyFactoryBean" parent="abstractDao">
+ <property name="proxyInterfaces" value="org.sipfoundry.sipxconfig.commserver.imdb.ReplicationManager"/>
+ <property name="target" ref="replicationManagerImpl"/>
+ </bean>
+
<bean id="replicationManagerImpl" class="org.sipfoundry.sipxconfig.commserver.imdb.ReplicationManagerImpl" parent="abstractDaoImpl">
<property name="locationsManager" ref="locationsManager" />
<property name="auditLogContext" ref="auditLogContext" />
@@ -27,12 +27,15 @@
import org.sipfoundry.sipxconfig.cfgmgt.ConfigManager;
import org.sipfoundry.sipxconfig.cfgmgt.ConfigProvider;
import org.sipfoundry.sipxconfig.cfgmgt.ConfigRequest;
-import org.sipfoundry.sipxconfig.cfgmgt.PostConfigListener;
import org.sipfoundry.sipxconfig.common.Replicable;
import org.sipfoundry.sipxconfig.commserver.Location;
import org.sipfoundry.sipxconfig.commserver.SipxReplicationContext;
+import org.sipfoundry.sipxconfig.feature.FeatureChangeRequest;
+import org.sipfoundry.sipxconfig.feature.FeatureChangeValidator;
+import org.sipfoundry.sipxconfig.feature.FeatureListener;
+import org.sipfoundry.sipxconfig.feature.FeatureManager;
-public class OpenAcdConfiguration implements ConfigProvider, PostConfigListener {
+public class OpenAcdConfiguration implements ConfigProvider, FeatureListener {
private OpenAcdContext m_openAcdContext;
private OpenAcdReplicationProvider m_openAcdReplicationProvider;
private SipxReplicationContext m_sipxReplicationContext;
@@ -61,15 +64,7 @@ public void replicate(ConfigManager manager, ConfigRequest request) throws IOExc
IOUtils.closeQuietly(w);
}
}
- }
- @Override
- public void postReplicate(ConfigManager manager, ConfigRequest request) throws IOException {
- if (request.applies(OpenAcdContext.FEATURE)) {
- for (Replicable openAcdObject : m_openAcdReplicationProvider.getReplicables()) {
- m_sipxReplicationContext.generate(openAcdObject);
- }
- }
}
public void setOpenAcdContext(OpenAcdContext openAcdContext) {
@@ -84,4 +79,16 @@ public void setSipxReplicationContext(SipxReplicationContext sipxReplicationCont
m_sipxReplicationContext = sipxReplicationContext;
}
+ @Override
+ public void featureChangePrecommit(FeatureManager manager, FeatureChangeValidator validator) {
+ }
+
+ @Override
+ public void featureChangePostcommit(FeatureManager manager, FeatureChangeRequest request) {
+ if (request.getAllNewlyEnabledFeatures().contains(OpenAcdContext.FEATURE)) {
+ for (Replicable openAcdObject : m_openAcdReplicationProvider.getReplicables()) {
+ m_sipxReplicationContext.generate(openAcdObject);
+ }
+ }
+ }
}
@@ -7,8 +7,11 @@
*/
package org.sipfoundry.sipxconfig.openacd;
-import org.sipfoundry.sipxconfig.common.ReplicableProvider;
+import java.util.List;
-public interface OpenAcdReplicationProvider extends ReplicableProvider {
+import org.sipfoundry.sipxconfig.common.Replicable;
+
+public interface OpenAcdReplicationProvider {
+ List<Replicable> getReplicables();
}
@@ -20,9 +20,10 @@
import java.util.List;
import org.sipfoundry.sipxconfig.common.Replicable;
+import org.sipfoundry.sipxconfig.common.ReplicableProvider;
import org.sipfoundry.sipxconfig.feature.FeatureManager;
-public class OpenAcdReplicationProviderImpl implements OpenAcdReplicationProvider {
+public class OpenAcdReplicationProviderImpl implements ReplicableProvider, OpenAcdReplicationProvider {
private OpenAcdContext m_openAcdContext;
private FeatureManager m_featureManager;
@@ -23,6 +23,7 @@ SIP_REDIRECT_AUTHORITY_LEVEL.997-SUBSCRIBE : 100
SIP_REDIRECT_AUTHORITY_LEVEL.998-TIMEOFDAY : 100
SIP_REDIRECT_AUTHORITY_LEVEL.999-AUTHROUTER : 100
SIP_REDIRECT.140-FALLBACK.ALLOW_UNBOUND : Y
+SIP_REGISTRAR_ADD_DIVERSION : N
SIP_REDIRECT.100-PICKUP.ORBIT_FILENAME : $(sipx.SIPX_CONFDIR)/orbits.xml
SIP_REDIRECT.130-MAPPING.MAPPING_RULES_FILENAME : $(sipx.SIPX_CONFDIR)/mappingrules.xml
SIP_REDIRECT.140-FALLBACK.MAPPING_RULES_FILENAME : $(sipx.SIPX_CONFDIR)/fallbackrules.xml
@@ -23,6 +23,7 @@ SIP_REDIRECT_AUTHORITY_LEVEL.997-SUBSCRIBE : 100
SIP_REDIRECT_AUTHORITY_LEVEL.998-TIMEOFDAY : 100
SIP_REDIRECT_AUTHORITY_LEVEL.999-AUTHROUTER : 100
SIP_REDIRECT.140-FALLBACK.ALLOW_UNBOUND : N
+SIP_REGISTRAR_ADD_DIVERSION : N
SIP_REDIRECT.100-PICKUP.ORBIT_FILENAME : $(sipx.SIPX_CONFDIR)/orbits.xml
SIP_REDIRECT.130-MAPPING.MAPPING_RULES_FILENAME : $(sipx.SIPX_CONFDIR)/mappingrules.xml
SIP_REDIRECT.140-FALLBACK.MAPPING_RULES_FILENAME : $(sipx.SIPX_CONFDIR)/fallbackrules.xml
@@ -50,6 +50,9 @@ public void toApiObject(Object apiObject, Object myObject, Set properties) {
api.setPermissions(permNames.toArray(new String[permNames.size()]));
}
}
+ if (properties.contains(BRANCH_NAME) && my.getBranch() != null) {
+ api.setBranchName(my.getBranch().getName());
+ }
}
public void toMyObject(Object myObject, Object apiObject, Set properties) {
@@ -310,6 +310,15 @@ private void parseDiversionHeader(Hashtable<String, String> parameters) {
String[] subParms = divHeader.split(";");
String ocn = null;
+ //
+ // Ignore internal sipx diversion headers as indicated by sipxfwd
+ // parameter.
+ //
+ for (String param : subParms) {
+ if (param.startsWith("sipxfwd="))
+ return;
+ }
+
// Look for the OCN format <tel:3948809>
if (ocn == null) {
ocn = getOcn(divHeader, "<tel:");
View
@@ -52,7 +52,6 @@ bundle agent sipxproxy_config {
"authrules.xml",
"fallbackrules.xml",
"forwardingrules.xml",
- "nattraversalrules.xml",
"sipxbridge.xml"
};
@@ -72,6 +71,13 @@ bundle agent sipxproxy_config {
perms => m("644"),
copy_from => copy_from_cfdata("$(sipx.location_id)/$(xml_file)"),
classes => if_repaired("restart_sipxproxy_and_registrar");
+
+ "$(sipx.SIPX_CONFDIR)/nattraversalrules.xml"
+ comment => "install NAT traversal rules $(this.promiser)",
+ create => "true",
+ perms => m("644"),
+ copy_from => copy_from_cfdata("$(sipx.location_id)/nattraversalrules.xml"),
+ classes => if_repaired("redeploy_nat");
}
bundle edit_line sipXproxy_config_contents() {
@@ -138,15 +144,25 @@ bundle agent sipxproxy_running {
comment => "restart sipxproxy",
args => "restart";
- restart_sipxproxy_and_registrar.sipxproxy::
+ redeploy_nat.sipxrelay::
+ "$(sipx.SIPX_SERVICEDIR)/sipxrelay"
+ comment => "redeploy NAT config - restart sipxrelay",
+ args => "restart";
+
+ (restart_sipxproxy_and_registrar|redeploy_nat).sipxproxy::
"$(sipx.SIPX_SERVICEDIR)/sipxproxy"
- comment => "restart sipxproxy",
+ comment => "dialplan or NAT config redeploy - restart sipxproxy",
args => "restart";
- restart_sipxproxy_and_registrar.sipxregistrar::
+ (restart_sipxproxy_and_registrar|redeploy_nat).sipxregistrar::
"$(sipx.SIPX_SERVICEDIR)/sipxregistrar"
- comment => "restart sipxregistrar",
+ comment => "dialplan or NAT config redeploy -restart sipxregistrar",
+ args => "restart";
+
+ redeploy_nat.sipxbridge::
+ "$(sipx.SIPX_SERVICEDIR)/sipxbridge"
+ comment => "redeploy NAT config - restart sipxbridge",
args => "restart";
-
+
}
@@ -1276,7 +1276,8 @@ int MediaBridgePair::compareTo(UtlContainable const *rhs ) const
AsynchMediaRelayRequestSender::AsynchMediaRelayRequestSender( MediaRelay* pOwningMediaRelay ) :
OsServerTask( "AsynchMediaRelayRequestSender-%d" ),
- mpOwningMediaRelay( pOwningMediaRelay )
+ mpOwningMediaRelay( pOwningMediaRelay ),
+ _enableAsyncOperations(false)
{
}
@@ -1514,12 +1515,21 @@ void AsynchMediaRelayRequestSender::queryBridgeStatistics( const UtlString& cont
postMessageIfStarted( message );
}
-OsStatus AsynchMediaRelayRequestSender::postMessageIfStarted( const OsMsg& rMsg,
+OsStatus AsynchMediaRelayRequestSender::postMessageIfStarted( OsMsg& rMsg,
const OsTime& rTimeout,
UtlBoolean sentFromISR )
{
- OsStatus result = ( isStarted() ? postMessage( rMsg, rTimeout, sentFromISR ) : OS_TASK_NOT_STARTED );
- return result;
+ if (_enableAsyncOperations)
+ {
+ OsStatus result = ( isStarted() ? postMessage( rMsg, rTimeout, sentFromISR ) : OS_TASK_NOT_STARTED );
+ return result;
+ }
+ else
+ {
+ if (isStarted())
+ handleMessage(rMsg);
+ return OS_SUCCESS;
+ }
}
AsynchMediaRelayMsg::AsynchMediaRelayMsg( EventSubType eventSubType,
@@ -138,11 +138,12 @@ class AsynchMediaRelayRequestSender : public OsServerTask
void setSymTimeout( const UtlString& controllerHandle, const UtlString& symId, int timeout );
void ping( const UtlString& controllerHandle );
void queryBridgeStatistics( const UtlString& controllerHandle, const UtlString& bridgeId, void* opaqueData );
- OsStatus postMessageIfStarted( const OsMsg& rMsg,
+ OsStatus postMessageIfStarted( OsMsg& rMsg,
const OsTime& rTimeout=OsTime::OS_INFINITY,
UtlBoolean sentFromISR=FALSE );
private:
+ bool _enableAsyncOperations;
MediaRelay* mpOwningMediaRelay;
UtlString mReferenceSymmitronInstanceHandle;
};
Oops, something went wrong.

0 comments on commit 07f532d

Please sign in to comment.