[Freeswitch-branches] [commit] r3562 - freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr

Freeswitch SVN mishehu at freeswitch.org
Wed Dec 6 22:33:55 EST 2006


Author: mishehu
Date: Wed Dec  6 22:33:51 2006
New Revision: 3562

Modified:
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/cdrcontainer.cpp
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/cdrcontainer.h
   freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mod_cdr.cpp

Log:
Added #ifdefs for code that requires the apr_queue_t enhancements that I made.

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/cdrcontainer.cpp
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/cdrcontainer.cpp	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/cdrcontainer.cpp	Wed Dec  6 22:33:51 2006
@@ -92,6 +92,7 @@
 	switch_console_printf(SWITCH_CHANNEL_LOG,"mod_cdr shutdown gracefully.");
 }
 
+#ifdef SWITCH_QUEUE_ENHANCED
 void CDRContainer::reload(switch_stream_handle_t *stream)
 {
 	// The queue can't be paused otherwise it will never be able to reload safely.
@@ -170,6 +171,7 @@
 	}
 
 }
+#endif
 
 void CDRContainer::active(switch_stream_handle_t *stream)
 {

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/cdrcontainer.h
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/cdrcontainer.h	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/cdrcontainer.h	Wed Dec  6 22:33:51 2006
@@ -58,9 +58,11 @@
 		~CDRContainer();
 		void add_cdr(switch_core_session_t *session);
 		void process_records();
+#ifdef SWITCH_QUEUE_ENHANCED
 		void reload(switch_stream_handle_t *stream);
 		void queue_pause(switch_stream_handle_t *stream);
 		void queue_resume(switch_stream_handle_t *stream);
+#endif
 		void active(switch_stream_handle_t *stream);
 		void available(switch_stream_handle_t *stream);
 	protected:

Modified: freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mod_cdr.cpp
==============================================================================
--- freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mod_cdr.cpp	(original)
+++ freeswitch/branches/mishehu/src/mod/event_handlers/mod_cdr/mod_cdr.cpp	Wed Dec  6 22:33:51 2006
@@ -152,22 +152,34 @@
 
 static switch_status_t modcdr_reload(char *dest=0, switch_core_session_t *isession=0, switch_stream_handle_t *stream=0)
 {
+#ifdef SWITCH_QUEUE_ENHANCED
 	switch_thread_rwlock_wrlock(cdr_rwlock);
 	newcdrcontainer->reload(stream);
 	switch_thread_rwlock_unlock(cdr_rwlock);
 	stream->write_function(stream, "XML Reloaded and mod_cdr reloaded.\n");
+#else
+	stream->write_function(stream,"modcdr_reload is only supported with the apr_queue_t enhancements and SWITCH_QUEUE_ENHANCED defined.\n");
+#endif
 	return SWITCH_STATUS_SUCCESS;
 }
 
 static switch_status_t modcdr_queue_pause(char *dest=0, switch_core_session_t *isession=0, switch_stream_handle_t *stream=0)
 {
+#ifdef SWITCH_QUEUE_ENHANCED
 	newcdrcontainer->queue_pause(stream);
+#else
+	stream->write_function(stream,"modcdr_queue_pause is only supported with the apr_queue_t enhancements and SWITCH_QUEUE_ENHANCED defined.\n");
+#endif
 	return SWITCH_STATUS_SUCCESS;
 }
 
 static switch_status_t modcdr_queue_resume(char *dest=0, switch_core_session_t *isession=0, switch_stream_handle_t *stream=0)
 {
+#ifdef SWITCH_QUEUE_ENHANCED
 	newcdrcontainer->queue_resume(stream);
+#else
+	stream->write_function(stream,"modcdr_queue_pause is only supported with the apr_queue_t enhancements and SWITCH_QUEUE_ENHANCED defined.\n");
+#endif
 	return SWITCH_STATUS_SUCCESS;
 }
 



More information about the Freeswitch-branches mailing list