[asterisk-commits] rmudgett: branch rmudgett/dahdi_facility r219799 - /team/rmudgett/dahdi_facil...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Sep 21 18:18:27 CDT 2009
Author: rmudgett
Date: Mon Sep 21 18:18:22 2009
New Revision: 219799
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=219799
Log:
Found some things that PRI hold pseudo channels cannot do.
* Pseudo channels cannot be natively bridged.
* DAHDI does not support DAHDI_AUDIOMODE on pseudo channels.
Work in progress.
Next need to handle transferring held calls.
Modified:
team/rmudgett/dahdi_facility/channels/chan_dahdi.c
Modified: team/rmudgett/dahdi_facility/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/dahdi_facility/channels/chan_dahdi.c?view=diff&rev=219799&r1=219798&r2=219799
==============================================================================
--- team/rmudgett/dahdi_facility/channels/chan_dahdi.c (original)
+++ team/rmudgett/dahdi_facility/channels/chan_dahdi.c Mon Sep 21 18:18:22 2009
@@ -4049,6 +4049,14 @@
if (p->echocancel.head.tap_length) {
switch (p->sig) {
case SIG_PRI_LIB_HANDLE_CASES:
+ if (((struct sig_pri_chan *) p->sig_pvt)->no_b_channel) {
+ /*
+ * PRI nobch pseudo channel. Does not need ec anyway.
+ * Does not handle ioctl(DAHDI_AUDIOMODE)
+ */
+ return;
+ }
+ /* Fall through */
case SIG_SS7:
x = 1;
res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_AUDIOMODE, &x);
@@ -4264,6 +4272,11 @@
x = muted;
switch (p->sig) {
case SIG_PRI_LIB_HANDLE_CASES:
+ if (((struct sig_pri_chan *) p->sig_pvt)->no_b_channel) {
+ /* PRI nobch pseudo channel. Does not handle ioctl(DAHDI_AUDIOMODE) */
+ break;
+ }
+ /* Fall through */
case SIG_SS7:
y = 1;
res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_AUDIOMODE, &y);
@@ -5329,8 +5342,7 @@
dahdi_setlinear(p->subs[SUB_REAL].dfd, 0);
law = DAHDI_LAW_DEFAULT;
res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_SETLAW, &law);
- if (p->sig)
- dahdi_disable_ec(p);
+ dahdi_disable_ec(p);
update_conf(p);
reset_conf(p);
sig_pri_hangup(p->sig_pvt, ast);
@@ -5908,6 +5920,12 @@
ast_dsp_set_digitmode(p->dsp, ((*cp) ? DSP_DIGITMODE_RELAXDTMF : DSP_DIGITMODE_DTMF) | p->dtmfrelax);
break;
case AST_OPTION_AUDIO_MODE: /* Set AUDIO mode (or not) */
+ if (dahdi_sig_pri_lib_handles(p->sig)
+ && ((struct sig_pri_chan *) p->sig_pvt)->no_b_channel) {
+ /* PRI nobch pseudo channel. Does not handle ioctl(DAHDI_AUDIOMODE) */
+ break;
+ }
+
cp = (char *) data;
if (!*cp) {
ast_debug(1, "Set option AUDIO MODE, value: OFF(0) on %s\n", chan->name);
@@ -6267,6 +6285,21 @@
ast_channel_unlock(c1);
ast_log(LOG_NOTICE, "Avoiding deadlock...\n");
return AST_BRIDGE_RETRY;
+ }
+
+ if ((dahdi_sig_pri_lib_handles(p0->sig)
+ && ((struct sig_pri_chan *) p0->sig_pvt)->no_b_channel)
+ || (dahdi_sig_pri_lib_handles(p1->sig)
+ && ((struct sig_pri_chan *) p1->sig_pvt)->no_b_channel)) {
+ /*
+ * PRI nobch channels (hold and call waiting) are equivalent to
+ * pseudo channels and cannot be done here.
+ */
+ ast_mutex_unlock(&p0->lock);
+ ast_mutex_unlock(&p1->lock);
+ ast_channel_unlock(c0);
+ ast_channel_unlock(c1);
+ return AST_BRIDGE_FAILED_NOWARN;
}
if ((oi0 == SUB_REAL) && (oi1 == SUB_REAL)) {
More information about the asterisk-commits
mailing list