[asterisk-commits] rmudgett: branch rmudgett/call_waiting r252750 - /team/rmudgett/call_waiting/...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Mar 15 18:43:27 CDT 2010
Author: rmudgett
Date: Mon Mar 15 18:43:23 2010
New Revision: 252750
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=252750
Log:
Don't send progress indication ie when no B channel is associated.
1) Cannot send PROGRESS message when no B channel is available. The point
of sending it is to indicate that there is an inband audio message.
2) PROCEEDING and ALERTING cannot send the progress indication ie because
that is setup to indicate an inband message.
3) Don't indicate AST_CONTROL_PROGRESS to bridged channel if no B channel
is associated with the call.
Modified:
team/rmudgett/call_waiting/channels/sig_pri.c
Modified: team/rmudgett/call_waiting/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/call_waiting/channels/sig_pri.c?view=diff&rev=252750&r1=252749&r2=252750
==============================================================================
--- team/rmudgett/call_waiting/channels/sig_pri.c (original)
+++ team/rmudgett/call_waiting/channels/sig_pri.c Mon Mar 15 18:43:23 2010
@@ -3514,46 +3514,40 @@
}
chanpos = pri_find_principle(pri, e->proceeding.channel, e->proceeding.call);
if (chanpos > -1) {
+ struct ast_frame f = { AST_FRAME_CONTROL, };
+
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]->progress)
+
+ if (e->proceeding.cause > -1) {
+ ast_verb(3, "PROGRESS with cause code %d received\n", e->proceeding.cause);
+
+ /* Work around broken, out of spec USER_BUSY cause in a progress message */
+ if (e->proceeding.cause == AST_CAUSE_USER_BUSY) {
+ if (pri->pvts[chanpos]->owner) {
+ ast_verb(3, "PROGRESS with 'user busy' received, signaling AST_CONTROL_BUSY instead of AST_CONTROL_PROGRESS\n");
+
+ pri->pvts[chanpos]->owner->hangupcause = e->proceeding.cause;
+ f.subclass.integer = AST_CONTROL_BUSY;
+ pri_queue_frame(pri->pvts[chanpos], &f, pri);
+ }
+ }
+ }
+
+ if (!pri->pvts[chanpos]->progress
+ && !pri->pvts[chanpos]->no_b_channel
#ifdef PRI_PROGRESS_MASK
- || (e->proceeding.progressmask & PRI_PROG_INBAND_AVAILABLE)
+ && (e->proceeding.progressmask & PRI_PROG_INBAND_AVAILABLE)
#else
- || (e->proceeding.progress == 8)
+ && e->proceeding.progress == 8
#endif
) {
- struct ast_frame f = { AST_FRAME_CONTROL, .subclass.integer = AST_CONTROL_PROGRESS, };
-
- if (e->proceeding.cause > -1) {
- ast_verb(3, "PROGRESS with cause code %d received\n", e->proceeding.cause);
-
- /* Work around broken, out of spec USER_BUSY cause in a progress message */
- if (e->proceeding.cause == AST_CAUSE_USER_BUSY) {
- if (pri->pvts[chanpos]->owner) {
- ast_verb(3, "PROGRESS with 'user busy' received, signaling AST_CONTROL_BUSY instead of AST_CONTROL_PROGRESS\n");
-
- pri->pvts[chanpos]->owner->hangupcause = e->proceeding.cause;
- f.subclass.integer = AST_CONTROL_BUSY;
- }
- }
- }
-
+ /* Bring voice path up */
ast_debug(1, "Queuing frame from PRI_EVENT_PROGRESS on channel %d/%d span %d\n",
pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset,pri->span);
+ f.subclass.integer = AST_CONTROL_PROGRESS;
pri_queue_frame(pri->pvts[chanpos], &f, pri);
- if (
-#ifdef PRI_PROGRESS_MASK
- e->proceeding.progressmask & PRI_PROG_INBAND_AVAILABLE
-#else
- e->proceeding.progress == 8
-#endif
- ) {
- /* Bring voice path up */
- f.subclass.integer = AST_CONTROL_PROGRESS;
- pri_queue_frame(pri->pvts[chanpos], &f, pri);
- }
pri->pvts[chanpos]->progress = 1;
sig_pri_set_dialing(pri->pvts[chanpos], 0);
}
@@ -3577,16 +3571,17 @@
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_frame(pri->pvts[chanpos], &f, pri);
- if (
+ if (!pri->pvts[chanpos]->no_b_channel
#ifdef PRI_PROGRESS_MASK
- e->proceeding.progressmask & PRI_PROG_INBAND_AVAILABLE
+ && (e->proceeding.progressmask & PRI_PROG_INBAND_AVAILABLE)
#else
- e->proceeding.progress == 8
+ && e->proceeding.progress == 8
#endif
) {
/* Bring voice path up */
f.subclass.integer = AST_CONTROL_PROGRESS;
pri_queue_frame(pri->pvts[chanpos], &f, pri);
+ pri->pvts[chanpos]->progress = 1;
}
pri->pvts[chanpos]->proceeding = 1;
sig_pri_set_dialing(pri->pvts[chanpos], 0);
@@ -4726,7 +4721,7 @@
switch (condition) {
case AST_CONTROL_BUSY:
- if (p->priindication_oob) {
+ if (p->priindication_oob || p->no_b_channel) {
chan->hangupcause = AST_CAUSE_USER_BUSY;
chan->_softhangup |= AST_SOFTHANGUP_DEV;
res = 0;
@@ -4751,7 +4746,8 @@
if ((!p->alerting) && p->pri && !p->outgoing && (chan->_state != AST_STATE_UP)) {
if (p->pri->pri) {
if (!pri_grab(p, p->pri)) {
- pri_acknowledge(p->pri->pri,p->call, PVT_TO_CHANNEL(p), !p->digital);
+ pri_acknowledge(p->pri->pri,p->call, PVT_TO_CHANNEL(p),
+ p->no_b_channel || p->digital ? 0 : 1);
pri_rel(p->pri);
} else {
ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->pri->span);
@@ -4770,7 +4766,8 @@
if (!p->proceeding && p->pri && !p->outgoing) {
if (p->pri->pri) {
if (!pri_grab(p, p->pri)) {
- pri_proceeding(p->pri->pri,p->call, PVT_TO_CHANNEL(p), !p->digital);
+ pri_proceeding(p->pri->pri,p->call, PVT_TO_CHANNEL(p),
+ p->no_b_channel || p->digital ? 0 : 1);
pri_rel(p->pri);
} else {
ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->pri->span);
@@ -4785,7 +4782,7 @@
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->pri && !p->outgoing) {
+ if (!p->progress && p->pri && !p->outgoing && !p->no_b_channel) {
if (p->pri->pri) {
if (!pri_grab(p, p->pri)) {
#ifdef HAVE_PRI_PROG_W_CAUSE
@@ -4805,7 +4802,7 @@
break;
case AST_CONTROL_CONGESTION:
chan->hangupcause = AST_CAUSE_CONGESTION;
- if (p->priindication_oob) {
+ if (p->priindication_oob || p->no_b_channel) {
chan->hangupcause = AST_CAUSE_SWITCH_CONGESTION;
chan->_softhangup |= AST_SOFTHANGUP_DEV;
res = 0;
More information about the asterisk-commits
mailing list