]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Remove unneeded uses of optional_api providers. 40/340/1
authorCorey Farrell <git@cfware.com>
Sat, 2 May 2015 23:58:40 +0000 (19:58 -0400)
committerCorey Farrell <git@cfware.com>
Sun, 3 May 2015 00:25:11 +0000 (20:25 -0400)
A few cases exist where headers of optional_api provders are included but
not needed.  This causes unneeded calls to ast_optional_api_use.

* Don't include optional_api.h from sip_api.h.
* Move 'struct ast_channel_monitor' to channel.h.
* Don't include monitor.h from chan_sip.c, channel.c or features.c.

The move of struct ast_channel_monitor is needed since channel.c depends on
it.  This has no effect on users of monitor.h since channel.h is included
from monitor.h.

ASTERISK-25051 #close
Reported by: Corey Farrell

Change-Id: I53ea65a9fc9693c89f8bcfd6120649bfcfbc3478

channels/chan_sip.c
include/asterisk/channel.h
include/asterisk/monitor.h
include/asterisk/sip_api.h
main/channel.c
main/features.c

index 3f9d9e7541219874f988b86ca39fe5b0791c7f11..1307a93427593e8a85ac18c563c0b36f03536263 100644 (file)
@@ -254,7 +254,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/astobj2.h"
 #include "asterisk/dnsmgr.h"
 #include "asterisk/devicestate.h"
-#include "asterisk/monitor.h"
 #include "asterisk/netsock2.h"
 #include "asterisk/localtime.h"
 #include "asterisk/abstract_jb.h"
index a120998823fe0661410483fbd1a366d5ae85d9f4..fe669efd12c29a4522d03a8fea287b85e6a3e40e 100644 (file)
@@ -3905,6 +3905,26 @@ enum ama_flags ast_channel_string2amaflag(const char *flag);
  */
 const char *ast_channel_amaflags2string(enum ama_flags flags);
 
+enum AST_MONITORING_STATE {
+       AST_MONITOR_RUNNING,
+       AST_MONITOR_PAUSED
+};
+
+/*! Responsible for channel monitoring data */
+struct ast_channel_monitor {
+       struct ast_filestream *read_stream;
+       struct ast_filestream *write_stream;
+       char read_filename[FILENAME_MAX];
+       char write_filename[FILENAME_MAX];
+       char filename_base[FILENAME_MAX];
+       char beep_id[64];
+       int filename_changed;
+       char *format;
+       int joinfiles;
+       enum AST_MONITORING_STATE state;
+       int (*stop)(struct ast_channel *chan, int need_lock);
+};
+
 /* ACCESSOR FUNTIONS */
 /*! \brief Set the channel name */
 void ast_channel_name_set(struct ast_channel *chan, const char *name);
index 6030221a2fe89d740460f255eb37e03b090c098f..377cb62f63ad253715a51f39162d366a2c5b5324 100644 (file)
 #include "asterisk/channel.h"
 #include "asterisk/optional_api.h"
 
-enum AST_MONITORING_STATE {
-       AST_MONITOR_RUNNING,
-       AST_MONITOR_PAUSED
-};
-
 /* Streams recording control */
 #define X_REC_IN       1
 #define X_REC_OUT      2
 #define X_JOIN         4
 
-/*! Responsible for channel monitoring data */
-struct ast_channel_monitor {
-       struct ast_filestream *read_stream;
-       struct ast_filestream *write_stream;
-       char read_filename[FILENAME_MAX];
-       char write_filename[FILENAME_MAX];
-       char filename_base[FILENAME_MAX];
-       char beep_id[64];
-       int filename_changed;
-       char *format;
-       int joinfiles;
-       enum AST_MONITORING_STATE state;
-       int (*stop)(struct ast_channel *chan, int need_lock);
-};
-
 /* Start monitoring a channel */
 AST_OPTIONAL_API(int, ast_monitor_start,
                 (struct ast_channel *chan, const char *format_spec,
index 2b8a3f2a1f1f20418925ec8fb9814bb4ae1dffd6..fddac16e05fb5b8031f04fe645a62ae27274d13c 100644 (file)
@@ -23,7 +23,6 @@
 extern "C" {
 #endif
 
-#include "asterisk/optional_api.h"
 #include "asterisk/config.h"
 
 #define AST_SIP_API_VERSION 1
index c56f3abe05fabdb691a6f31f79d332cfda5f75be..fa03f65e6fc2b0db92b88bdce2e73ce8373d6a4c 100644 (file)
@@ -53,7 +53,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/chanvars.h"
 #include "asterisk/linkedlists.h"
 #include "asterisk/indications.h"
-#include "asterisk/monitor.h"
 #include "asterisk/causes.h"
 #include "asterisk/callerid.h"
 #include "asterisk/utils.h"
index 2f04386929c09e535b1c94b97c49fdddf46ae56e..1810b1556db747e0159b480ab843dbe7f7baa941 100644 (file)
@@ -66,7 +66,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/utils.h"
 #include "asterisk/adsi.h"
 #include "asterisk/devicestate.h"
-#include "asterisk/monitor.h"
 #include "asterisk/audiohook.h"
 #include "asterisk/global_datastores.h"
 #include "asterisk/astobj2.h"