From 02e071812e3f6df73b52231840aa32e551123c37 Mon Sep 17 00:00:00 2001 From: Danny Lloyd Date: Tue, 16 Jul 2024 07:49:58 -0500 Subject: [PATCH] chan_simpleusb / chan_usbradio: Modify cos operation (#356) chan_simpleusb and chan_usbradio should not activate the receiver when the carrierfrom and ctcssfrom are set to no. This closes #329. --- channels/chan_simpleusb.c | 7 +++++++ channels/chan_usbradio.c | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/channels/chan_simpleusb.c b/channels/chan_simpleusb.c index 43ecc58..ffd586f 100644 --- a/channels/chan_simpleusb.c +++ b/channels/chan_simpleusb.c @@ -2228,6 +2228,13 @@ static struct ast_frame *simpleusb_read(struct ast_channel *c) sd = 1; } o->rx_ctcss_active = sd; + + /* Special case where cd and sd have been configured for no */ + if (o->rxcdtype == CD_IGNORE && o->rxsdtype == SD_IGNORE) { + cd = 0; + sd = 0; + } + /* Timer for how long TX has been unkeyed - used with txoffdelay */ if (o->txoffdelay) { if (o->txkeyed == 1) { diff --git a/channels/chan_usbradio.c b/channels/chan_usbradio.c index 839f8ab..23a9815 100644 --- a/channels/chan_usbradio.c +++ b/channels/chan_usbradio.c @@ -2235,6 +2235,13 @@ static struct ast_frame *usbradio_read(struct ast_channel *c) sd = 1; } o->rx_ctcss_active = sd; + + /* Special case where cd and sd have been configured for no */ + if (o->rxcdtype == CD_IGNORE && o->rxsdtype == SD_IGNORE) { + cd = 0; + sd = 0; + } + /* Timer for how long TX has been unkeyed - used with txoffdelay */ if (o->txoffdelay) { if (o->txkeyed == 1) { @@ -2246,6 +2253,8 @@ static struct ast_frame *usbradio_read(struct ast_channel *c) } } } + + /* Check conditions and set receiver active */ if (cd && sd) { //if(!o->rxkeyed)o->pmrChan->dd.b.doitnow=1; if (o->rxkeyed || ((o->txoffcnt >= o->txoffdelay) && (o->rxoncnt >= o->rxondelay))) {