aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-12-07 20:38:43 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-12-07 20:38:43 +0000
commit4d714a548871e5858faa4d7b9bdb0ffebccde161 (patch)
treeb4a1d4ac13b7ad2896d52e705bc10dc76563c489 /include
parentb64c7117dddd2cd4dba0a24a3ba60166ee0167c4 (diff)
Big diet for struct ast_channel
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4399 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rwxr-xr-xinclude/asterisk/channel.h48
1 files changed, 19 insertions, 29 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index f78c3c158..7c129f73c 100755
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -39,7 +39,6 @@ extern "C" {
#define AST_CHANNEL_NAME 80
-#define AST_CHANNEL_MAX_STACK 32
#define MAX_LANGUAGE 20
@@ -94,8 +93,6 @@ struct ast_channel {
void *generatordata;
/*! Current active data generator */
struct ast_generator *generator;
- /*! Whether or not the generator should be interrupted by write */
- int writeinterrupt;
/*! Who are we bridged to, if we're bridged Do not access directly,
use ast_bridged_channel(chan) */
@@ -104,21 +101,15 @@ struct ast_channel {
struct ast_channel *dialed;
/*! Who called us? */
struct ast_channel *dialing;
- /*! Reverse the dialed link (0 false, 1 true) */
- int reversedialed;
/*! Channel that will masquerade as us */
struct ast_channel *masq;
/*! Who we are masquerading as */
struct ast_channel *masqr;
/*! Call Detail Record Flags */
int cdrflags;
- /*! Whether or not we're blocking */
- int blocking;
/*! Whether or not we have been hung up... Do not set this value
directly, use ast_softhangup */
int _softhangup;
- /*! Non-zero if this is a zombie channel */
- int zombie;
/*! Non-zero, set to actual time when channel is to be hung up */
time_t whentohangup;
/*! If anyone is blocking, this is them */
@@ -133,8 +124,6 @@ struct ast_channel {
/*! Data passed to current application */
char *data;
- /*! Has an exception been detected */
- int exception;
/*! Which fd had an event detected on */
int fdno;
/*! Schedule context */
@@ -159,9 +148,6 @@ struct ast_channel {
int _state;
/*! Number of rings so far */
int rings;
- /*! Current level of application */
- int stack;
-
/*! Kinds of data this channel can natively handle */
int nativeformats;
@@ -184,21 +170,14 @@ struct ast_channel {
char exten[AST_MAX_EXTENSION];
/* Current extension priority */
int priority;
- /*! Application information -- see assigned numbers */
- void *app[AST_CHANNEL_MAX_STACK];
/*! Any/all queued DTMF characters */
char dtmfq[AST_MAX_EXTENSION];
- /*! Are DTMF digits being deferred */
- int deferdtmf;
/*! DTMF frame */
struct ast_frame dtmff;
/*! Private channel implementation details */
struct ast_channel_pvt *pvt;
-
- /*! Jump buffer used for returning from applications */
- jmp_buf jmp[AST_CHANNEL_MAX_STACK];
-
+ /*! PBX private structure */
struct ast_pbx *pbx;
/*! Set BEFORE PBX is started to determine AMA flags */
int amaflags;
@@ -238,28 +217,39 @@ struct ast_channel {
unsigned int pickupgroup;
/*! channel flags of AST_FLAG_ type */
- int flag;
+ int flags;
/*! For easy linking */
struct ast_channel *next;
};
-#define AST_FLAG_DIGITAL 1 /* if the call is a digital ISDN call */
+#define AST_FLAG_DIGITAL (1 << 0) /* if the call is a digital ISDN call */
+#define AST_FLAG_DEFER_DTMF (1 << 1) /* if dtmf should be deferred */
+#define AST_FLAG_WRITE_INT (1 << 2) /* if write should be interrupt generator */
+#define AST_FLAG_BLOCKING (1 << 3) /* if we are blocking */
+#define AST_FLAG_ZOMBIE (1 << 4) /* if we are a zombie */
+#define AST_FLAG_EXCEPTION (1 << 5) /* if there is a pending exception */
static inline int ast_test_flag(struct ast_channel *chan, int mode)
{
- return chan->flag & mode;
+ return chan->flags & mode;
}
static inline void ast_set_flag(struct ast_channel *chan, int mode)
{
- chan->flag |= mode;
+ chan->flags |= mode;
}
static inline void ast_clear_flag(struct ast_channel *chan, int mode)
{
- chan->flag &= ~mode;
+ chan->flags &= ~mode;
+}
+
+static inline void ast_copy_flags(struct ast_channel *dest, struct ast_channel *src, int flags)
+{
+ dest->flags &= ~flags;
+ dest->flags |= (src->flags & flags);
}
static inline void ast_set2_flag(struct ast_channel *chan, int value, int mode)
@@ -894,13 +884,13 @@ static inline int ast_select(int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds,
#endif
#define CHECK_BLOCKING(c) { \
- if ((c)->blocking) {\
+ if (ast_test_flag(c, AST_FLAG_BLOCKING)) {\
ast_log(LOG_WARNING, "Thread %ld Blocking '%s', already blocked by thread %ld in procedure %s\n", (long) pthread_self(), (c)->name, (long) (c)->blocker, (c)->blockproc); \
CRASH; \
} else { \
(c)->blocker = pthread_self(); \
(c)->blockproc = __PRETTY_FUNCTION__; \
- c->blocking = -1; \
+ ast_set_flag(c, AST_FLAG_BLOCKING); \
} }
extern unsigned int ast_get_group(char *s);