From 61d1d0ee339b84e8351cf9d966472bf9da0ad4b6 Mon Sep 17 00:00:00 2001 From: Danny Lloyd Date: Fri, 12 Jul 2024 07:27:12 -0500 Subject: [PATCH] chan_simpleusb / chan_usbradio: Modify cos operation 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 2ce10c0..6d38aeb 100644 --- a/channels/chan_simpleusb.c +++ b/channels/chan_simpleusb.c @@ -2260,6 +2260,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 f390174..021a4a9 100644 --- a/channels/chan_usbradio.c +++ b/channels/chan_usbradio.c @@ -2266,6 +2266,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) { @@ -2277,6 +2284,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))) {