aboutsummaryrefslogtreecommitdiffstats
path: root/channels/sig_pri.c
diff options
context:
space:
mode:
authorrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2011-01-25 17:58:00 +0000
committerrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2011-01-25 17:58:00 +0000
commit249675f01156189fcbc4540bed534cbf634832e2 (patch)
tree499850d8134de75af8b2dfeae4ded166f73f19cb /channels/sig_pri.c
parent33fdd3466379b4b1af9b03c3e4572e75e4f177b1 (diff)
Merged revisions 303771 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r303771 | rmudgett | 2011-01-25 11:49:20 -0600 (Tue, 25 Jan 2011) | 54 lines Merged revisions 303769 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r303769 | rmudgett | 2011-01-25 11:42:42 -0600 (Tue, 25 Jan 2011) | 47 lines Merged revisions 303765 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r303765 | rmudgett | 2011-01-25 11:36:50 -0600 (Tue, 25 Jan 2011) | 40 lines Sending out unnecessary PROCEEDING messages breaks overlap dialing. Issue #16789 was a good idea. Unfortunately, it breaks overlap dialing through Asterisk. There is not enough information available at this point to know if dialing is complete. The ast_exists_extension(), ast_matchmore_extension(), and ast_canmatch_extension() calls are not adequate to detect a dial through extension pattern of "_9!". Workaround is to use the dialplan Proceeding() application early in non-dial through extensions. * Effectively revert issue #16789. * Allow outgoing overlap dialing to hear dialtone and other early media. A PROGRESS "inband-information is now available" message is now sent after the SETUP_ACKNOWLEDGE message for non-digital calls. An AST_CONTROL_PROGRESS is now generated for incoming SETUP_ACKNOWLEDGE messages for non-digital calls. * Handling of the AST_CONTROL_CONGESTION in chan_dahdi/sig_pri was inconsistent with the cause codes. * Added better protection from sending out of sequence messages by combining several flags into a single enum value representing call progress level. * Added diagnostic messages for deferred overlap digits handling corner cases. (closes issue #17085) Reported by: shawkris (closes issue #18509) Reported by: wimpy Patches: issue18509_early_media_v1.8_v3.patch uploaded by rmudgett (license 664) Expanded upon issue18509_early_media_v1.8_v3.patch to include analog and SS7 because of backporting requirements. Tested by: wimpy, rmudgett ........ ................ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@303772 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/sig_pri.c')
-rw-r--r--channels/sig_pri.c207
1 files changed, 153 insertions, 54 deletions
diff --git a/channels/sig_pri.c b/channels/sig_pri.c
index a858ef20f..27e5dcf0b 100644
--- a/channels/sig_pri.c
+++ b/channels/sig_pri.c
@@ -1242,12 +1242,9 @@ static int pri_fixup_principle(struct sig_pri_span *pri, int principle, q931_cal
new_chan->waiting_for_aoce = old_chan->waiting_for_aoce;
new_chan->holding_aoce = old_chan->holding_aoce;
#endif /* defined(HAVE_PRI_AOC_EVENTS) */
- new_chan->alerting = old_chan->alerting;
new_chan->alreadyhungup = old_chan->alreadyhungup;
new_chan->isidlecall = old_chan->isidlecall;
- new_chan->proceeding = old_chan->proceeding;
new_chan->progress = old_chan->progress;
- new_chan->setup_ack = old_chan->setup_ack;
new_chan->outgoing = old_chan->outgoing;
new_chan->digital = old_chan->digital;
#if defined(HAVE_PRI_CALL_WAITING)
@@ -1259,12 +1256,9 @@ static int pri_fixup_principle(struct sig_pri_span *pri, int principle, q931_cal
old_chan->waiting_for_aoce = 0;
old_chan->holding_aoce = 0;
#endif /* defined(HAVE_PRI_AOC_EVENTS) */
- old_chan->alerting = 0;
old_chan->alreadyhungup = 0;
old_chan->isidlecall = 0;
- old_chan->proceeding = 0;
old_chan->progress = 0;
- old_chan->setup_ack = 0;
old_chan->outgoing = 0;
old_chan->digital = 0;
#if defined(HAVE_PRI_CALL_WAITING)
@@ -1272,6 +1266,8 @@ static int pri_fixup_principle(struct sig_pri_span *pri, int principle, q931_cal
#endif /* defined(HAVE_PRI_CALL_WAITING) */
/* More stuff to transfer to the new channel. */
+ new_chan->call_level = old_chan->call_level;
+ old_chan->call_level = SIG_PRI_CALL_LEVEL_IDLE;
#if defined(HAVE_PRI_REVERSE_CHARGE)
new_chan->reverse_charging_indication = old_chan->reverse_charging_indication;
#endif /* defined(HAVE_PRI_REVERSE_CHARGE) */
@@ -1632,12 +1628,28 @@ static void *pri_ss_thread(void *data)
/* Start the real PBX */
ast_copy_string(chan->exten, exten, sizeof(chan->exten));
sig_pri_dsp_reset_and_flush_digits(p);
- if (p->pri->overlapdial & DAHDI_OVERLAPDIAL_INCOMING) {
+#if defined(ISSUE_16789)
+ /*
+ * Conditionaled out this code to effectively revert the Mantis
+ * issue 16789 change. It breaks overlap dialing through
+ * Asterisk. There is not enough information available at this
+ * point to know if dialing is complete. The
+ * ast_exists_extension(), ast_matchmore_extension(), and
+ * ast_canmatch_extension() calls are not adequate to detect a
+ * dial through extension pattern of "_9!".
+ *
+ * Workaround is to use the dialplan Proceeding() application
+ * early on non-dial through extensions.
+ */
+ if ((p->pri->overlapdial & DAHDI_OVERLAPDIAL_INCOMING)
+ && !ast_matchmore_extension(chan, chan->context, exten, 1, p->cid_num)) {
sig_pri_lock_private(p);
- if (p->pri->pri) {
+ if (p->pri->pri) {
if (!pri_grab(p, p->pri)) {
+ if (p->call_level < SIG_PRI_CALL_LEVEL_PROCEEDING) {
+ p->call_level = SIG_PRI_CALL_LEVEL_PROCEEDING;
+ }
pri_proceeding(p->pri->pri, p->call, PVT_TO_CHANNEL(p), 0);
- p->proceeding = 1;
pri_rel(p->pri);
} else {
ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->pri->span);
@@ -1645,6 +1657,7 @@ static void *pri_ss_thread(void *data)
}
sig_pri_unlock_private(p);
}
+#endif /* defined(ISSUE_16789) */
sig_pri_set_echocanceller(p, 1);
ast_setstate(chan, AST_STATE_RING);
@@ -5696,13 +5709,14 @@ static void *pri_dchannel(void *vpri)
/* Setup law */
if (e->ring.complete || !(pri->overlapdial & DAHDI_OVERLAPDIAL_INCOMING)) {
/* Just announce proceeding */
- pri->pvts[chanpos]->proceeding = 1;
+ pri->pvts[chanpos]->call_level = SIG_PRI_CALL_LEVEL_PROCEEDING;
pri_proceeding(pri->pri, e->ring.call, PVT_TO_CHANNEL(pri->pvts[chanpos]), 0);
+ } else if (pri->switchtype == PRI_SWITCH_GR303_TMC) {
+ pri->pvts[chanpos]->call_level = SIG_PRI_CALL_LEVEL_CONNECT;
+ pri_answer(pri->pri, e->ring.call, PVT_TO_CHANNEL(pri->pvts[chanpos]), 1);
} else {
- if (pri->switchtype != PRI_SWITCH_GR303_TMC)
- pri_need_more_info(pri->pri, e->ring.call, PVT_TO_CHANNEL(pri->pvts[chanpos]), 1);
- else
- pri_answer(pri->pri, e->ring.call, PVT_TO_CHANNEL(pri->pvts[chanpos]), 1);
+ pri->pvts[chanpos]->call_level = SIG_PRI_CALL_LEVEL_OVERLAP;
+ pri_need_more_info(pri->pri, e->ring.call, PVT_TO_CHANNEL(pri->pvts[chanpos]), 1);
}
/* Start PBX */
@@ -5786,6 +5800,21 @@ static void *pri_dchannel(void *vpri)
sig_pri_handle_subcmds(pri, chanpos, e->e, e->ring.channel,
e->ring.subcmds, e->ring.call);
+ if (!pri->pvts[chanpos]->digital
+ && !pri->pvts[chanpos]->no_b_channel) {
+ /*
+ * Call has a channel.
+ * Indicate that we are providing dialtone.
+ */
+ pri->pvts[chanpos]->progress = 1;/* No need to send plain PROGRESS again. */
+#ifdef HAVE_PRI_PROG_W_CAUSE
+ pri_progress_with_cause(pri->pri, e->ring.call,
+ PVT_TO_CHANNEL(pri->pvts[chanpos]), 1, -1);/* no cause at all */
+#else
+ pri_progress(pri->pri, e->ring.call,
+ PVT_TO_CHANNEL(pri->pvts[chanpos]), 1);
+#endif
+ }
}
if (c && !ast_pthread_create_detached(&threadid, NULL, pri_ss_thread, pri->pvts[chanpos])) {
ast_verb(3, "Accepting overlap call from '%s' to '%s' on channel %d/%d, span %d\n",
@@ -5944,7 +5973,9 @@ static void *pri_dchannel(void *vpri)
sig_pri_cc_generic_check(pri, chanpos, AST_CC_CCNR);
sig_pri_set_echocanceller(pri->pvts[chanpos], 1);
pri_queue_control(pri, chanpos, AST_CONTROL_RINGING);
- pri->pvts[chanpos]->alerting = 1;
+ if (pri->pvts[chanpos]->call_level < SIG_PRI_CALL_LEVEL_ALERTING) {
+ pri->pvts[chanpos]->call_level = SIG_PRI_CALL_LEVEL_ALERTING;
+ }
if (
#ifdef PRI_PROGRESS_MASK
@@ -6031,11 +6062,11 @@ static void *pri_dchannel(void *vpri)
sig_pri_lock_private(pri->pvts[chanpos]);
sig_pri_handle_subcmds(pri, chanpos, e->e, e->proceeding.channel,
e->proceeding.subcmds, e->proceeding.call);
- if (!pri->pvts[chanpos]->proceeding) {
+ if (pri->pvts[chanpos]->call_level < SIG_PRI_CALL_LEVEL_PROCEEDING) {
+ pri->pvts[chanpos]->call_level = SIG_PRI_CALL_LEVEL_PROCEEDING;
ast_debug(1, "Queuing frame from PRI_EVENT_PROCEEDING on channel %d/%d span %d\n",
pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset,pri->span);
pri_queue_control(pri, chanpos, AST_CONTROL_PROCEEDING);
- pri->pvts[chanpos]->proceeding = 1;
}
if (!pri->pvts[chanpos]->progress
&& !pri->pvts[chanpos]->no_b_channel
@@ -6170,7 +6201,9 @@ static void *pri_dchannel(void *vpri)
#endif /* defined(HAVE_PRI_CALL_WAITING) */
sig_pri_handle_subcmds(pri, chanpos, e->e, e->answer.channel,
e->answer.subcmds, e->answer.call);
- pri->pvts[chanpos]->proceeding = 1;
+ if (pri->pvts[chanpos]->call_level < SIG_PRI_CALL_LEVEL_CONNECT) {
+ pri->pvts[chanpos]->call_level = SIG_PRI_CALL_LEVEL_CONNECT;
+ }
sig_pri_open_media(pri->pvts[chanpos]);
pri_queue_control(pri, chanpos, AST_CONTROL_ANSWER);
/* Enable echo cancellation if it's not on already */
@@ -6593,16 +6626,36 @@ static void *pri_dchannel(void *vpri)
} else {
chanpos = pri_fixup_principle(pri, chanpos, e->setup_ack.call);
if (chanpos > -1) {
+ unsigned int len;
+
sig_pri_lock_private(pri->pvts[chanpos]);
sig_pri_handle_subcmds(pri, chanpos, e->e, e->setup_ack.channel,
e->setup_ack.subcmds, e->setup_ack.call);
- pri->pvts[chanpos]->setup_ack = 1;
+ if (pri->pvts[chanpos]->call_level < SIG_PRI_CALL_LEVEL_OVERLAP) {
+ pri->pvts[chanpos]->call_level = SIG_PRI_CALL_LEVEL_OVERLAP;
+ }
+
/* Send any queued digits */
- for (x = 0;x < strlen(pri->pvts[chanpos]->dialdest); x++) {
+ len = strlen(pri->pvts[chanpos]->dialdest);
+ for (x = 0; x < len; ++x) {
ast_debug(1, "Sending pending digit '%c'\n", pri->pvts[chanpos]->dialdest[x]);
pri_information(pri->pri, pri->pvts[chanpos]->call,
pri->pvts[chanpos]->dialdest[x]);
}
+
+ if (!pri->pvts[chanpos]->progress
+ && (pri->overlapdial & DAHDI_OVERLAPDIAL_OUTGOING)
+ && !pri->pvts[chanpos]->digital
+ && !pri->pvts[chanpos]->no_b_channel) {
+ /*
+ * Call has a channel.
+ * Indicate for overlap dialing that dialtone may be present.
+ */
+ pri_queue_control(pri, chanpos, AST_CONTROL_PROGRESS);
+ pri->pvts[chanpos]->progress = 1;/* Claim to have seen inband-information */
+ sig_pri_set_dialing(pri->pvts[chanpos], 0);
+ sig_pri_open_media(pri->pvts[chanpos]);
+ }
sig_pri_unlock_private(pri->pvts[chanpos]);
} else
ast_log(LOG_WARNING, "Unable to move channel %d!\n", e->setup_ack.channel);
@@ -6738,10 +6791,8 @@ int sig_pri_hangup(struct sig_pri_chan *p, struct ast_channel *ast)
ast_atomic_fetchadd_int(&p->pri->num_call_waiting_calls, -1);
}
#endif /* defined(HAVE_PRI_CALL_WAITING) */
- p->proceeding = 0;
+ p->call_level = SIG_PRI_CALL_LEVEL_IDLE;
p->progress = 0;
- p->alerting = 0;
- p->setup_ack = 0;
p->cid_num[0] = '\0';
p->cid_subaddr[0] = '\0';
p->cid_name[0] = '\0';
@@ -7302,6 +7353,8 @@ int sig_pri_call(struct sig_pri_chan *p, struct ast_channel *ast, char *rdest, i
ast_log(LOG_WARNING, "Unable to setup CC recall call to device %s\n",
device_name);
ao2_ref(monitor, -1);
+ pri_destroycall(p->pri->pri, p->call);
+ p->call = NULL;
pri_rel(p->pri);
pri_sr_free(sr);
return -1;
@@ -7318,10 +7371,13 @@ int sig_pri_call(struct sig_pri_chan *p, struct ast_channel *ast, char *rdest, i
if (core_id == -1 && pri_setup(p->pri->pri, p->call, sr)) {
ast_log(LOG_WARNING, "Unable to setup call to %s (using %s)\n",
c + p->stripmsd + dp_strip, dialplan2str(p->pri->dialplan));
+ pri_destroycall(p->pri->pri, p->call);
+ p->call = NULL;
pri_rel(p->pri);
pri_sr_free(sr);
return -1;
}
+ p->call_level = SIG_PRI_CALL_LEVEL_SETUP;
pri_sr_free(sr);
ast_setstate(ast, AST_STATE_DIALING);
sig_pri_set_dialing(p, 1);
@@ -7339,11 +7395,16 @@ int sig_pri_indicate(struct sig_pri_chan *p, struct ast_channel *chan, int condi
chan->hangupcause = AST_CAUSE_USER_BUSY;
chan->_softhangup |= AST_SOFTHANGUP_DEV;
res = 0;
- } else if (!p->progress && p->pri && !p->outgoing) {
- if (p->pri->pri) {
+ break;
+ }
+ res = sig_pri_play_tone(p, SIG_PRI_TONE_BUSY);
+ if (p->call_level < SIG_PRI_CALL_LEVEL_ALERTING && !p->outgoing) {
+ chan->hangupcause = AST_CAUSE_USER_BUSY;
+ p->progress = 1;/* No need to send plain PROGRESS after this. */
+ if (p->pri && p->pri->pri) {
if (!pri_grab(p, p->pri)) {
#ifdef HAVE_PRI_PROG_W_CAUSE
- pri_progress_with_cause(p->pri->pri,p->call, PVT_TO_CHANNEL(p), 1, PRI_CAUSE_USER_BUSY); /* cause = 17 */
+ pri_progress_with_cause(p->pri->pri, p->call, PVT_TO_CHANNEL(p), 1, chan->hangupcause);
#else
pri_progress(p->pri->pri,p->call, PVT_TO_CHANNEL(p), 1);
#endif
@@ -7352,13 +7413,12 @@ int sig_pri_indicate(struct sig_pri_chan *p, struct ast_channel *chan, int condi
ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->pri->span);
}
}
- p->progress = 1;
- res = sig_pri_play_tone(p, SIG_PRI_TONE_BUSY);
}
break;
case AST_CONTROL_RINGING:
- if ((!p->alerting) && p->pri && !p->outgoing && (chan->_state != AST_STATE_UP)) {
- if (p->pri->pri) {
+ if (p->call_level < SIG_PRI_CALL_LEVEL_ALERTING && !p->outgoing) {
+ p->call_level = SIG_PRI_CALL_LEVEL_ALERTING;
+ if (p->pri && p->pri->pri) {
if (!pri_grab(p, p->pri)) {
pri_acknowledge(p->pri->pri,p->call, PVT_TO_CHANNEL(p),
p->no_b_channel || p->digital ? 0 : 1);
@@ -7367,7 +7427,6 @@ int sig_pri_indicate(struct sig_pri_chan *p, struct ast_channel *chan, int condi
ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->pri->span);
}
}
- p->alerting = 1;
}
res = sig_pri_play_tone(p, SIG_PRI_TONE_RINGTONE);
if (chan->_state != AST_STATE_UP) {
@@ -7377,12 +7436,12 @@ int sig_pri_indicate(struct sig_pri_chan *p, struct ast_channel *chan, int condi
break;
case AST_CONTROL_PROCEEDING:
ast_debug(1,"Received AST_CONTROL_PROCEEDING on %s\n",chan->name);
- if (!p->proceeding && p->pri && !p->outgoing) {
- if (p->pri->pri) {
+ if (p->call_level < SIG_PRI_CALL_LEVEL_PROCEEDING && !p->outgoing) {
+ p->call_level = SIG_PRI_CALL_LEVEL_PROCEEDING;
+ if (p->pri && p->pri->pri) {
if (!pri_grab(p, p->pri)) {
pri_proceeding(p->pri->pri,p->call, PVT_TO_CHANNEL(p),
p->no_b_channel || p->digital ? 0 : 1);
- p->proceeding = 1;
if (!p->no_b_channel && !p->digital) {
sig_pri_set_dialing(p, 0);
}
@@ -7398,8 +7457,10 @@ int sig_pri_indicate(struct sig_pri_chan *p, struct ast_channel *chan, int condi
case AST_CONTROL_PROGRESS:
ast_debug(1,"Received AST_CONTROL_PROGRESS on %s\n",chan->name);
sig_pri_set_digital(p, 0); /* Digital-only calls isn't allowing any inband progress messages */
- if (!p->progress && !p->alerting && p->pri && !p->outgoing && !p->no_b_channel) {
- if (p->pri->pri) {
+ if (!p->progress && p->call_level < SIG_PRI_CALL_LEVEL_ALERTING && !p->outgoing
+ && !p->no_b_channel) {
+ p->progress = 1;/* No need to send plain PROGRESS again. */
+ if (p->pri && p->pri->pri) {
if (!pri_grab(p, p->pri)) {
#ifdef HAVE_PRI_PROG_W_CAUSE
pri_progress_with_cause(p->pri->pri,p->call, PVT_TO_CHANNEL(p), 1, -1); /* no cause at all */
@@ -7411,22 +7472,45 @@ int sig_pri_indicate(struct sig_pri_chan *p, struct ast_channel *chan, int condi
ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->pri->span);
}
}
- p->progress = 1;
}
/* don't continue in ast_indicate */
res = 0;
break;
case AST_CONTROL_CONGESTION:
- chan->hangupcause = AST_CAUSE_CONGESTION;
if (p->priindication_oob || p->no_b_channel) {
- chan->hangupcause = AST_CAUSE_SWITCH_CONGESTION;
+ /* There are many cause codes that generate an AST_CONTROL_CONGESTION. */
+ switch (chan->hangupcause) {
+ case AST_CAUSE_USER_BUSY:
+ case AST_CAUSE_NORMAL_CLEARING:
+ case 0:/* Cause has not been set. */
+ /* Supply a more appropriate cause. */
+ chan->hangupcause = AST_CAUSE_SWITCH_CONGESTION;
+ break;
+ default:
+ break;
+ }
chan->_softhangup |= AST_SOFTHANGUP_DEV;
res = 0;
- } else if (!p->progress && p->pri && !p->outgoing) {
- if (p->pri->pri) {
+ break;
+ }
+ res = sig_pri_play_tone(p, SIG_PRI_TONE_CONGESTION);
+ if (p->call_level < SIG_PRI_CALL_LEVEL_ALERTING && !p->outgoing) {
+ /* There are many cause codes that generate an AST_CONTROL_CONGESTION. */
+ switch (chan->hangupcause) {
+ case AST_CAUSE_USER_BUSY:
+ case AST_CAUSE_NORMAL_CLEARING:
+ case 0:/* Cause has not been set. */
+ /* Supply a more appropriate cause. */
+ chan->hangupcause = AST_CAUSE_SWITCH_CONGESTION;
+ break;
+ default:
+ break;
+ }
+ p->progress = 1;/* No need to send plain PROGRESS after this. */
+ if (p->pri && p->pri->pri) {
if (!pri_grab(p, p->pri)) {
#ifdef HAVE_PRI_PROG_W_CAUSE
- pri_progress_with_cause(p->pri->pri,p->call, PVT_TO_CHANNEL(p), 1, PRI_CAUSE_SWITCH_CONGESTION); /* cause = 42 */
+ pri_progress_with_cause(p->pri->pri, p->call, PVT_TO_CHANNEL(p), 1, chan->hangupcause);
#else
pri_progress(p->pri->pri,p->call, PVT_TO_CHANNEL(p), 1);
#endif
@@ -7435,8 +7519,6 @@ int sig_pri_indicate(struct sig_pri_chan *p, struct ast_channel *chan, int condi
ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->pri->span);
}
}
- p->progress = 1;
- res = sig_pri_play_tone(p, SIG_PRI_TONE_CONGESTION);
}
break;
case AST_CONTROL_HOLD:
@@ -7561,7 +7643,9 @@ int sig_pri_answer(struct sig_pri_chan *p, struct ast_channel *ast)
p->aoc_s_request_invoke_id_valid = 0;
}
#endif /* defined(HAVE_PRI_AOC_EVENTS) */
- p->proceeding = 1;
+ if (p->call_level < SIG_PRI_CALL_LEVEL_CONNECT) {
+ p->call_level = SIG_PRI_CALL_LEVEL_CONNECT;
+ }
sig_pri_set_dialing(p, 0);
sig_pri_open_media(p);
res = pri_answer(p->pri->pri, p->call, 0, !p->digital);
@@ -7690,22 +7774,37 @@ int sig_pri_available(struct sig_pri_chan **pvt, int is_specific_channel)
* functions should handle it normally (generate inband DTMF) */
int sig_pri_digit_begin(struct sig_pri_chan *pvt, struct ast_channel *ast, char digit)
{
- if ((ast->_state == AST_STATE_DIALING) && !pvt->proceeding) {
- if (pvt->setup_ack) {
+ if (ast->_state == AST_STATE_DIALING) {
+ if (pvt->call_level < SIG_PRI_CALL_LEVEL_OVERLAP) {
+ unsigned int len;
+
+ len = strlen(pvt->dialdest);
+ if (len < sizeof(pvt->dialdest) - 1) {
+ ast_debug(1, "Queueing digit '%c' since setup_ack not yet received\n",
+ digit);
+ pvt->dialdest[len++] = digit;
+ pvt->dialdest[len] = '\0';
+ } else {
+ ast_log(LOG_WARNING,
+ "Span %d: Deferred digit buffer overflow for digit '%c'.\n",
+ pvt->pri->span, digit);
+ }
+ return 0;
+ }
+ if (pvt->call_level < SIG_PRI_CALL_LEVEL_PROCEEDING) {
if (!pri_grab(pvt, pvt->pri)) {
pri_information(pvt->pri->pri, pvt->call, digit);
pri_rel(pvt->pri);
} else {
ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", pvt->pri->span);
}
- } else if (strlen(pvt->dialdest) < sizeof(pvt->dialdest) - 1) {
- int res;
- ast_debug(1, "Queueing digit '%c' since setup_ack not yet received\n", digit);
- res = strlen(pvt->dialdest);
- pvt->dialdest[res++] = digit;
- pvt->dialdest[res] = '\0';
+ return 0;
+ }
+ if (pvt->call_level < SIG_PRI_CALL_LEVEL_CONNECT) {
+ ast_log(LOG_WARNING,
+ "Span %d: Digit '%c' may be ignored by peer. (Call level:%d)\n",
+ pvt->pri->span, digit, pvt->call_level);
}
- return 0;
}
return 1;
}