diff options
author | rmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-10-30 23:26:41 +0000 |
---|---|---|
committer | rmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-10-30 23:26:41 +0000 |
commit | d9cdfa12c347deed2cb6e32f47c1fb34b29d120c (patch) | |
tree | 9e4bbc95fe97dbcf4fb2335896c75879f0f036f9 | |
parent | a0a297595288e5548b7786687ed7a06ce9753842 (diff) |
Cleanup some flags on DAHDI PRI channel hangup.
* Cleanup some flags on DAHDI PRI channel hangup. (sig_pri split)
* Make sure the outgoing flag is cleared if a new channel fails to get
created for outgoing calls.
* Remove some unused flags since sig_pri was split.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@226648 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_dahdi.c | 31 | ||||
-rw-r--r-- | channels/sig_pri.c | 9 |
2 files changed, 21 insertions, 19 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 40b2600c8..583408e43 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -981,27 +981,12 @@ struct dahdi_pvt { /*! \brief TRUE if the call has already gone/hungup */ unsigned int alreadyhungup:1; /*! - * \brief TRUE if this is an idle call - * \note Applies to PRI channels. - */ - unsigned int isidlecall:1; - /*! * \brief TRUE if call is in a proceeding state. * The call has started working its way through the network. */ unsigned int proceeding:1; /*! \brief TRUE if the call has seen progress through the network. */ unsigned int progress:1; - /*! - * \brief TRUE if this channel is being reset/restarted - * \note Applies to PRI channels. - */ - unsigned int resetting:1; - /*! - * \brief TRUE if this channel has received a SETUP_ACKNOWLEDGE - * \note Applies to PRI channels. - */ - unsigned int setup_ack:1; #endif /*! * \brief TRUE if SMDI (Simplified Message Desk Interface) is enabled @@ -5473,6 +5458,16 @@ static int dahdi_hangup(struct ast_channel *ast) sig_pri_hangup(p->sig_pvt, ast); p->subs[SUB_REAL].owner = NULL; p->owner = NULL; + p->ringt = 0;/* Probably not used in this mode. Reset anyway. */ + p->distinctivering = 0;/* Probably not used in this mode. Reset anyway. */ + p->confirmanswer = 0;/* Probably not used in this mode. Reset anyway. */ + p->outgoing = 0; + p->digital = 0; + p->faxhandled = 0; + p->pulsedial = 0;/* Probably not used in this mode. Reset anyway. */ + //p->proceeding = 0; + //p->progress = 0; + //p->alerting = 0; goto hangup_out; } #endif @@ -5617,7 +5612,6 @@ static int dahdi_hangup(struct ast_channel *ast) p->dialing = 0; p->progress = 0; p->alerting = 0; - p->setup_ack = 0; p->rlt = 0; #endif if (p->dsp) { @@ -8682,8 +8676,6 @@ static struct ast_channel *dahdi_new(struct dahdi_pvt *i, int state, int startpb pbx_builtin_setvar_helper(tmp, "TRANSFERCAPABILITY", ast_transfercapability2str(transfercapability)); if (transfercapability & AST_TRANS_CAP_DIGITAL) i->digital = 1; - /* Assume calls are not idle calls unless we're told differently */ - i->isidlecall = 0; i->alreadyhungup = 0; #endif /* clear the fake event in case we posted one before we had ast_channel */ @@ -12111,6 +12103,9 @@ static struct ast_channel *dahdi_request(const char *type, int format, const str } else { tmp = dahdi_new(p, AST_STATE_RESERVED, 0, p->owner ? SUB_CALLWAIT : SUB_REAL, 0, 0, requestor ? requestor->linkedid : ""); } + if (!tmp) { + p->outgoing = 0; + } /* Make special notes */ if (res > 1) { diff --git a/channels/sig_pri.c b/channels/sig_pri.c index 5db73c204..f369fa381 100644 --- a/channels/sig_pri.c +++ b/channels/sig_pri.c @@ -725,9 +725,16 @@ static struct ast_channel *sig_pri_new_ast_channel(struct sig_pri_chan *p, int s struct ast_channel *sig_pri_request(struct sig_pri_chan *p, enum sig_pri_law law, const struct ast_channel *requestor) { + struct ast_channel *ast; + ast_log(LOG_DEBUG, "%s %d\n", __FUNCTION__, p->channel); - return sig_pri_new_ast_channel(p, AST_STATE_RESERVED, 0, law, 0, p->exten, requestor); + p->outgoing = 1; + ast = sig_pri_new_ast_channel(p, AST_STATE_RESERVED, 0, law, 0, p->exten, requestor); + if (!ast) { + p->outgoing = 0; + } + return ast; } int pri_is_up(struct sig_pri_pri *pri) |