Permalink
Browse files

Merge branch 'release-4.6-updates'

Conflicts:
	sipXconfig/neoconf/src/org/sipfoundry/sipxconfig/setting/XmlEscapeValueFilter.java
	sipXpolycom/src/org/sipfoundry/sipxconfig/phone/polycom/PolycomPhone.java
  • Loading branch information...
2 parents f4e62d1 + d9721ec commit eb7e3ddb674bbb2480e2b4c735aa8f702e27e3b0 Cristi Ciuc Starasciuc committed Dec 19, 2012
Showing with 144 additions and 134 deletions.
  1. +36 −52 sipXcommserverLib/src/sipdb/SubscribeDB.cpp
  2. +2 −2 sipXconfig/neoconf/test/org/sipfoundry/sipxconfig/setting/XmlEscapeValueFilterTest.java
  3. +4 −0 sipXconfig/web/context/WEB-INF/admin/AboutDialog.jwc
  4. +4 −0 sipXconfig/web/context/WEB-INF/admin/commserver/BundlePanel.jwc
  5. +4 −0 sipXconfig/web/context/WEB-INF/admin/commserver/LocationsPanel.jwc
  6. +4 −0 sipXconfig/web/context/WEB-INF/backup/RestoreForm.jwc
  7. +4 −0 sipXconfig/web/context/WEB-INF/backup/RestoreUpload.jwc
  8. +2 −2 sipXconfig/web/context/WEB-INF/openacd/OpenAcdServerPage.html
  9. +25 −0 sipXconfig/web/src/org/sipfoundry/sipxconfig/site/common/JarMessagesSource.java
  10. +12 −0 sipXconfig/web/src/org/sipfoundry/sipxconfig/site/openacd/OpenAcdServerPage.java
  11. +2 −1 sipXivr/bin/Makefile.am
  12. 0 {sipXpbx → sipXivr}/bin/voicemail_clean.in
  13. +16 −0 sipXivr/etc/sipxivr.cf
  14. +1 −0 sipXivr/sipxivr.spec.in
  15. +0 −3 sipXpolycom/src/org/sipfoundry/sipxconfig/phone/polycom/PolycomPhone.java
  16. +0 −1 sipXportLib/sipxportlib.spec.in
  17. +4 −14 sipXproxy/lib/authplugins/NatTraversalAgent/MediaRelay.cpp
  18. +1 −2 sipXproxy/lib/authplugins/NatTraversalAgent/MediaRelay.h
  19. +7 −9 sipXproxy/lib/authplugins/NatTraversalAgent/NatTraversalAgent.cpp
  20. +8 −2 sipXproxy/lib/authplugins/NatTraversalAgent/NatTraversalAgent.h
  21. +0 −9 sipXproxy/lib/authplugins/NatTraversalAgent/NatTraversalAgentDataTypes.h
  22. +4 −21 sipXproxy/lib/authplugins/NatTraversalAgent/SessionContext.cpp
  23. +2 −3 sipXregistry/lib/redirect_plugins/SipRedirectorAliasDB.cpp
  24. +1 −12 sipXregistry/lib/redirect_plugins/SipRedirectorFallback.cpp
  25. +1 −1 sipXrls/src/ResourceListFileReader.cpp
@@ -60,63 +60,47 @@ void SubscribeDB::upsert (
"callId" << callId.str() <<
"eventTypeKey" << eventTypeKey.str());
- if (notifyCseq)
+ mongo::BSONObjBuilder objBuilder;
+ objBuilder.append(Subscription::component_fld(), component.str());
+ objBuilder.append(Subscription::uri_fld(), uri.str());
+ objBuilder.append(Subscription::callId_fld(), callId.str());
+ objBuilder.append(Subscription::contact_fld(), contact.str());
+ objBuilder.append(Subscription::expires_fld(), expires);
+ objBuilder.append(Subscription::subscribeCseq_fld(), subscribeCseq);
+ objBuilder.append(Subscription::eventTypeKey_fld(), eventTypeKey.str());
+ objBuilder.append(Subscription::eventType_fld(), eventType.str());
+ objBuilder.append(Subscription::id_fld(), id.str());
+ objBuilder.append(Subscription::toUri_fld(), toUri.str());
+ objBuilder.append(Subscription::fromUri_fld(), fromUri.str());
+ objBuilder.append(Subscription::key_fld(), key.str());
+
+ //do not include RecordRoute if was not provided, because it will delete existing entry
+ if (!recordRoute.isNull())
{
- 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();
+ objBuilder.append(Subscription::recordRoute_fld(), recordRoute.str());
}
- else
+
+ // do not include the notifysequence in the update if it is zero
+ if (notifyCseq)
{
- //
- // 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();
+ objBuilder.append(Subscription::notifyCseq_fld(), notifyCseq);
}
+ objBuilder.append(Subscription::accept_fld(), accept.str());
+ objBuilder.append(Subscription::version_fld(),version);
+
+ mongo::BSONObjBuilder opBuilder;
+ opBuilder.append("$set", objBuilder.obj());
+
+ mongo::BSONObj update = opBuilder.obj();
+
+ 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();
}
@@ -37,7 +37,7 @@ public void testFilterXml() {
SettingValueImpl sv = new SettingValueImpl("<xml />");
assertEquals("&lt;xml /&gt;", filter.filter(sv).getValue());
- sv = new SettingValueImpl("Bolek&Lolek");
- assertEquals("Bolek&amp;Lolek", filter.filter(sv).getValue());
+ sv = new SettingValueImpl("Bölek&Lolek");
+ assertEquals("Bölek&amp;Lolek", filter.filter(sv).getValue());
}
}
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE component-specification PUBLIC "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
+ "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
+<component-specification/>
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE component-specification PUBLIC "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
+ "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
+<component-specification/>
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE component-specification PUBLIC "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
+ "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
+<component-specification/>
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE component-specification PUBLIC "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
+ "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
+<component-specification/>
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE component-specification PUBLIC "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
+ "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
+<component-specification/>
@@ -47,7 +47,7 @@
<form jwcid="@Form" delegate="bean:validator">
<fieldset jwcid="agentDialplanListener@setting/SettingsFieldset" settings="ognl:settings.settings"
groupToDisplay="agent_configuration"
- settingsToHide="openacd-config,log_level,log_dir,freeswitch_media_manager,C_NODE,DIAL_STRING" />
+ settingsToHide="ognl:settingsToHideAgentDialStrings" />
<ul jwcid="@common/FormActions" callback="ognl:callback" listener="listener:apply"/>
</form>
<span jwcid="@openacd/OpenAcdCommands"/>
@@ -56,7 +56,7 @@
<form jwcid="@Form" delegate="bean:validator">
<fieldset jwcid="@setting/SettingsFieldset" settings="ognl:settings.settings"
groupToDisplay="openacd-config" renderGroupTitle="false"
- settingsToHide="log_dir,freeswitch_media_manager,C_NODE,DIAL_STRING,agent_configuration,DIALPLAN_LISTENER" />
+ settingsToHide="ognl:settingsToHide" />
<ul jwcid="@common/FormActions" callback="ognl:callback" listener="listener:apply"/>
</form>
</span>
@@ -16,10 +16,13 @@
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Locale;
+import java.util.Map;
import java.util.Properties;
+import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -38,6 +41,8 @@
"context:/WEB-INF/admin/language.properties");
private JarMessagesSourceContext m_context;
private URLClassLoader m_jarClassLoader;
+ private Map<Locale, Properties> m_globalProps = new HashMap<Locale, Properties>();
+ private String m_globalFile = "WEB-INF/sipXconfig-web_%s.properties";
public void setContext(JarMessagesSourceContext context) {
m_context = context;
@@ -124,7 +129,27 @@ private Properties loadMessagesFromJar(Resource resource, Locale locale) {
} catch (IOException ioe) {
LOG.error("Error loading localized messages.", ioe);
return null;
+ } finally {
+ IOUtils.closeQuietly(stream);
}
+
+ if (m_globalProps.get(locale) == null) {
+ Properties globalMessages = new Properties();
+ try {
+ String globalFile = String.format(m_globalFile, locale.getLanguage());
+ stream = m_jarClassLoader.getResourceAsStream(globalFile);
+ if (stream != null) {
+ globalMessages.load(stream);
+ }
+ m_globalProps.put(locale, globalMessages);
+ } catch (IOException ioe) {
+ LOG.error("Error loading global localized messages", ioe);
+ } finally {
+ IOUtils.closeQuietly(stream);
+ }
+ }
+ messages.putAll(m_globalProps.get(locale));
+
return messages;
}
@@ -31,8 +31,11 @@
import org.sipfoundry.sipxconfig.openacd.OpenAcdSettings;
public abstract class OpenAcdServerPage extends PageWithCallback implements PageBeginRenderListener {
+
public static final String PAGE = "openacd/OpenAcdServerPage";
+ private static final String SETTINGS_TO_HIDE = "log_dir,freeswitch_media_manager,C_NODE,DIAL_STRING";
+
@InjectObject("spring:locationsManager")
public abstract LocationsManager getLocationsManager();
@@ -72,4 +75,13 @@ public void pageBeginRender(PageEvent event) {
public void apply(IRequestCycle cycle) {
getOpenAcdContext().saveSettings(getSettings());
}
+
+ public String getSettingsToHide() {
+ return SETTINGS_TO_HIDE + ",agent_configuration,DIALPLAN_LISTENER";
+ }
+
+ public String getSettingsToHideAgentDialStrings() {
+ return SETTINGS_TO_HIDE + ",openacd-config,agent-webui-enabled,agent-webui-port"
+ + ",agent-webui-sslenabled,agent-webui-sslport,log_level";
+ }
}
@@ -11,7 +11,8 @@ initd_SCRIPTS = \
bindir = @SIPX_BINDIR@
bin_SCRIPTS = \
- sipxivr-archive
+ sipxivr-archive \
+ voicemail_clean
$(bin_SCRIPTS) $(initd_SCRIPTS) : % : %.in Makefile
@$(call SearchAndReplace,$<,$@,ivr_PKGS)
@@ -22,6 +22,7 @@ bundle agent sipxivr {
"any" usebundle => "sync_moh_prompts";
any::
"any" usebundle => "sipxivr_logwatcher";
+ "any" usebundle => "sipxivr_vm_cleanup";
"any" usebundle => "sipxivr_running";
}
@@ -127,6 +128,21 @@ bundle agent sipxivr_running {
args => "restart";
}
+# Install cron schedules for vm cleanup
+bundle agent sipxivr_vm_cleanup {
+ vars:
+ # execute it every day after midnight
+ "cron" string => "10 0 * * * $(sipx.SIPX_BINDIR)/voicemail_clean > /dev/null";
+ "cron_id" string => ".*/voicemail_clean .*"; #regex
+
+ methods:
+ sipxivr::
+ "any" usebundle => add_crontab("$(cron_id)", "$(sipx.SIPXPBXUSER)", "$(cron)");
+
+ !sipxivr::
+ "any" usebundle => remove_crontab("$(cron_id)", "$(sipx.SIPXPBXUSER)");
+}
+
body copy_from copy_prompts(server,file) {
servers => { "$(server)" };
source => "$(file)";
@@ -53,6 +53,7 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/sipxivr-archive
+%attr(755,root,root) %{_bindir}/voicemail_clean
%dir %attr(755,sipx,sipx) %{_datadir}/sipxecs
%dir %attr(755,sipx,sipx) %{_datadir}/sipxecs/schema
%attr(755,root,root) %{_sysconfdir}/init.d/sipxivr
@@ -35,7 +35,6 @@
import org.sipfoundry.sipxconfig.device.ProfileContext;
import org.sipfoundry.sipxconfig.device.ProfileFilter;
import org.sipfoundry.sipxconfig.device.ProfileLocation;
-import org.sipfoundry.sipxconfig.feature.FeatureManager;
import org.sipfoundry.sipxconfig.phone.Line;
import org.sipfoundry.sipxconfig.phone.LineInfo;
import org.sipfoundry.sipxconfig.phone.Phone;
@@ -228,7 +227,6 @@ public void copy(InputStream in, OutputStream out) throws IOException {
}
}
- @Override
public String getAdditionalPhoneSettings() {
List<String> settings = new ArrayList<String>();
addSetting(settings, MB_PROXY, MB_IDLE_DISPLAY_HOME_PAGE, MB_IDLE_DISPLAY_REFRESH, MB_MAIN_HOME_PAGE,
@@ -237,7 +235,6 @@ public String getAdditionalPhoneSettings() {
return StringUtils.join(settings, COMMA);
}
- @Override
public void setAdditionalPhoneSettings(String additionalSettings) {
List<String> settings = Arrays.asList(StringUtils.split(additionalSettings, COMMA));
settings = Arrays.asList(StringUtils.split(additionalSettings, COMMA));
@@ -110,7 +110,6 @@ rm -rf $RPM_BUILD_ROOT
%doc README ChangeLog %name.configlog
%attr(755,root,root) %{_bindir}/syslogviewer
%attr(755,root,root) %{_bindir}/sipx-upgrade
-%attr(755,root,root) %{_libdir}/libsipXport.la
%attr(755,root,root) %{_libdir}/libsipXport.so*
%attr(755,root,root) %{_bindir}/sipx-config
@@ -1276,8 +1276,7 @@ int MediaBridgePair::compareTo(UtlContainable const *rhs ) const
AsynchMediaRelayRequestSender::AsynchMediaRelayRequestSender( MediaRelay* pOwningMediaRelay ) :
OsServerTask( "AsynchMediaRelayRequestSender-%d" ),
- mpOwningMediaRelay( pOwningMediaRelay ),
- _enableAsyncOperations(false)
+ mpOwningMediaRelay( pOwningMediaRelay )
{
}
@@ -1515,21 +1514,12 @@ void AsynchMediaRelayRequestSender::queryBridgeStatistics( const UtlString& cont
postMessageIfStarted( message );
}
-OsStatus AsynchMediaRelayRequestSender::postMessageIfStarted( OsMsg& rMsg,
+OsStatus AsynchMediaRelayRequestSender::postMessageIfStarted( const OsMsg& rMsg,
const OsTime& rTimeout,
UtlBoolean sentFromISR )
{
- if (_enableAsyncOperations)
- {
- OsStatus result = ( isStarted() ? postMessage( rMsg, rTimeout, sentFromISR ) : OS_TASK_NOT_STARTED );
- return result;
- }
- else
- {
- if (isStarted())
- handleMessage(rMsg);
- return OS_SUCCESS;
- }
+ OsStatus result = ( isStarted() ? postMessage( rMsg, rTimeout, sentFromISR ) : OS_TASK_NOT_STARTED );
+ return result;
}
AsynchMediaRelayMsg::AsynchMediaRelayMsg( EventSubType eventSubType,
@@ -138,12 +138,11 @@ 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( OsMsg& rMsg,
+ OsStatus postMessageIfStarted( const 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 eb7e3dd

Please sign in to comment.