Allow doing digital PRI to PRI calls automatically

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1868 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Martin Pycko
2003-12-18 23:42:10 +00:00
parent 9e996ceef8
commit f96c0762ff
3 changed files with 41 additions and 0 deletions
+2
View File
@@ -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);
+3
View File
@@ -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;
+36
View File
@@ -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) { \