aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xapps/app_dial.c2
-rwxr-xr-xchannels/chan_zap.c3
-rwxr-xr-xinclude/asterisk/channel.h36
3 files changed, 41 insertions, 0 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 533812a87..06073c2fd 100755
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -585,6 +585,8 @@ static int dial_exec(struct ast_channel *chan, void *data)
tmp->chan->callingpres = chan->callingpres;
/* Presense of ADSI CPE on outgoing channel follows ours */
tmp->chan->adsicpe = chan->adsicpe;
+ /* pass the digital flag */
+ ast_dup_flag(tmp->chan, chan, AST_FLAG_DIGITAL);
/* Place the call, but don't wait on the answer */
res = ast_call(tmp->chan, numsubst, 0);
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index fd5ea7f71..6cff248d7 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -1558,6 +1558,7 @@ static int zt_call(struct ast_channel *ast, char *rdest, int timeout)
ast_log(LOG_WARNING, "Unable to create call on channel %d\n", p->channel);
return -1;
}
+ p->digital = ast_test_flag(ast,AST_FLAG_DIGITAL);
if (pri_call(p->pri->pri, p->call, p->digital ? PRI_TRANS_CAP_DIGITAL : PRI_TRANS_CAP_SPEECH,
p->prioffset, p->pri->nodetype == PRI_NETWORK ? 0 : 1, 1, l, p->pri->dialplan - 1, n,
l ? (ast->restrictcid ? PRES_PROHIB_USER_NUMBER_PASSED_SCREEN : (p->use_callingpres ? ast->callingpres : PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN)) : PRES_NUMBER_NOT_AVAILABLE,
@@ -3914,6 +3915,8 @@ static struct ast_channel *zt_new(struct zt_pvt *i, int state, int startpbx, int
/* Assume calls are not idle calls unless we're told differently */
i->isidlecall = 0;
i->alreadyhungup = 0;
+ i->digital = ctype;
+ ast_set2_flag(tmp, ctype, AST_FLAG_DIGITAL);
#endif
/* clear the fake event in case we posted one before we had ast_chanenl */
i->fake_event = 0;
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index 13e97da7c..f0d998b68 100755
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -224,12 +224,48 @@ struct ast_channel {
unsigned int callgroup;
unsigned int pickupgroup;
+
+ /*! channel flags of AST_FLAG_ type */
+ int flag;
/*! For easy linking */
struct ast_channel *next;
};
+#define AST_FLAG_DIGITAL 1 /* if the call is a digital ISDN call */
+
+static inline int ast_test_flag(struct ast_channel *chan, int mode)
+{
+ return chan->flag & mode;
+}
+
+static inline void ast_set_flag(struct ast_channel *chan, int mode)
+{
+ chan->flag |= mode;
+}
+
+static inline void ast_clear_flag(struct ast_channel *chan, int mode)
+{
+ chan->flag &= ~mode;
+}
+
+static inline void ast_set2_flag(struct ast_channel *chan, int value, int mode)
+{
+ if (value)
+ ast_set_flag(chan, mode);
+ else
+ ast_clear_flag(chan, mode);
+}
+
+static inline void ast_dup_flag(struct ast_channel *dstchan, struct ast_channel *srcchan, int mode)
+{
+ if (ast_test_flag(srcchan, mode))
+ ast_set_flag(dstchan, mode);
+ else
+ ast_clear_flag(dstchan, mode);
+}
+
struct chanmon;
#define LOAD_OH(oh) { \