diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2012-03-21 20:40:52 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2012-03-21 20:40:52 +0000 |
commit | 2ca338fa8f79787b904e5bd7ff0dd96a27688be3 (patch) | |
tree | b6e43ef52aafb45fa195a2184242f4caecc1aec8 | |
parent | 799745d4c032b9cf1a23a841174f3d90e7afecca (diff) |
xpp: FXS: added a 'lower_ringing_noise' parameter
* Adds a new parameter, 'lower_ringing_noise', to module xpd_fxs.
* Makes the "power-down" behaviour that was added
in upstream svn r10478, switchable in runtime.
* By default (false), makes the vbat_h behave like it did
before the power-down change.
- I.e: vbat_h is held throughout the ringing period (during
both ring-up/ring-down)
- So this patch revert part of r10478
* When switched to true, activate the "power-down" behaviour.
- I.e: vbat_h follows the ring-up/ring-down.
- This behaviour lowers the noise caused by group ringing of
FXS channels in the same unit, but causes problems with CallerID.
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10574
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.5@10578 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r-- | drivers/dahdi/xpp/card_fxs.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/dahdi/xpp/card_fxs.c b/drivers/dahdi/xpp/card_fxs.c index 12cc4da..46cde06 100644 --- a/drivers/dahdi/xpp/card_fxs.c +++ b/drivers/dahdi/xpp/card_fxs.c @@ -42,6 +42,8 @@ static DEF_PARM(uint, poll_digital_inputs, 1000, 0644, "Poll Digital Inputs"); static DEF_PARM_BOOL(vmwi_ioctl, 1, 0644, "Asterisk support VMWI notification via ioctl"); static DEF_PARM_BOOL(ring_trapez, 0, 0664, "Use trapezoid ring type"); +static DEF_PARM_BOOL(lower_ringing_noise, 0, 0664, + "Lower ringing noise (may loose CallerID)"); /* Signaling is opposite (fxo signalling for fxs card) */ #if 1 @@ -184,14 +186,21 @@ static int do_chan_power(xbus_t *xbus, xpd_t *xpd, lineno_t chan, bool on) static int linefeed_control(xbus_t *xbus, xpd_t *xpd, lineno_t chan, enum fxs_state value) { - struct FXS_priv_data *priv; - bool want_vbat_h = (value == FXS_LINE_RING) ? 1 : 0; + struct FXS_priv_data *priv; + bool want_vbat_h; priv = xpd->priv; + /* + * Should we drop vbat_h only during actuall ring? + * - It would lower the noise caused to other channels by + * group ringing + * - But it may also stop CallerID from passing through the SLIC + */ + want_vbat_h = value == FXS_LINE_RING; + if (lower_ringing_noise || want_vbat_h) + do_chan_power(xbus, xpd, chan, want_vbat_h); LINE_DBG(SIGNAL, xpd, chan, "value=0x%02X\n", value); priv->lasttxhook[chan] = value; - if (IS_SET(priv->vbat_h, chan) != want_vbat_h) - do_chan_power(xbus, xpd, chan, want_vbat_h); return SLIC_DIRECT_REQUEST(xbus, xpd, chan, SLIC_WRITE, 0x40, value); } @@ -672,6 +681,7 @@ static void start_stop_vm_led(xbus_t *xbus, xpd_t *xpd, lineno_t pos) msgs = PHONEDEV(xpd).msg_waiting[pos]; LINE_DBG(SIGNAL, xpd, pos, "%s\n", (msgs) ? "ON" : "OFF"); set_vm_led_mode(xbus, xpd, pos, msgs); + do_chan_power(xbus, xpd, pos, msgs > 0); linefeed_control(xbus, xpd, pos, (msgs > 0) ? FXS_LINE_RING : priv->idletxhookstate[pos]); } @@ -708,6 +718,7 @@ static int send_ring(xpd_t *xpd, lineno_t chan, bool on) LINE_DBG(SIGNAL, xpd, chan, "%s\n", (on)?"on":"off"); priv = xpd->priv; set_vm_led_mode(xbus, xpd, chan, 0); + do_chan_power(xbus, xpd, chan, on); /* Power up (for ring) */ ret = linefeed_control(xbus, xpd, chan, value); if(on) { MARK_BLINK(priv, chan, LED_GREEN, LED_BLINK_RING); |