diff options
author | martinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-05-15 22:16:26 +0000 |
---|---|---|
committer | martinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b> | 2003-05-15 22:16:26 +0000 |
commit | e74e5f7785c5d3482ed0b453a9abaac29de3efc8 (patch) | |
tree | b48500f0e0ec3143bcbe66a1ca300fc3ea9ec872 /channels/chan_zap.c | |
parent | e70c0bfbb0674a32d61cd7111482d03d91cc27bd (diff) |
Don't send INFORMATION messages unless we got SETUP_ACKNOWLEDGE
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1024 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_zap.c')
-rwxr-xr-x | channels/chan_zap.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 1619cd13b..505bb7724 100755 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -439,6 +439,7 @@ static struct zt_pvt { #ifdef PRI_EVENT_PROCEEDING int proceeding; #endif + int setup_ack; /* wheter we received SETUP_ACKNOWLEDGE or not */ #endif #ifdef ZAPATA_R2 int r2prot; @@ -669,11 +670,15 @@ static int zt_digit(struct ast_channel *ast, char digit) index = zt_get_index(ast, p, 0); if (index == SUB_REAL) { #ifdef ZAPATA_PRI +#ifdef PRI_EVENT_SETUP_ACK + if (p->sig == SIG_PRI && ast->_state == AST_STATE_DIALING && p->setup_ack && !p->proceeding) { +#else #ifdef PRI_EVENT_PROCEEDING if (p->sig == SIG_PRI && ast->_state == AST_STATE_DIALING && !p->proceeding) { #else if (p->sig == SIG_PRI && ast->_state == AST_STATE_DIALING) { #endif +#endif if (!pri_grab(p, p->pri)) pri_information(p->pri->pri,p->call,digit); else @@ -1592,6 +1597,9 @@ static int zt_hangup(struct ast_channel *ast) #ifdef PRI_EVENT_PROCEEDING p->proceeding = 0; #endif +#ifdef PRI_EVENT_SETUP_ACK + p->setup_ack = 0; +#endif if (p->dsp) { ast_dsp_free(p->dsp); p->dsp = NULL; @@ -5861,6 +5869,18 @@ static void *pri_dchannel(void *vpri) } } break; +#ifdef PRI_EVENT_SETUP_ACK + case PRI_EVENT_SETUP_ACK: + chan = e->setup_ack.channel; + if ((chan < 1) || (chan > pri->channels)) { + ast_log(LOG_WARNING, "Received SETUP_ACKNOWLEDGE on strange channel %d span %d\n", chan, pri->span); + } else if (!pri->pvt[chan]) { + ast_log(LOG_WARNING, "Received SETUP_ACKNOWLEDGE on unconfigured channel %d span %d\n", chan, pri->span); + } else { + pri->pvt[chan]->setup_ack = 1; + } + break; +#endif default: ast_log(LOG_DEBUG, "Event: %d\n", e->e); } |