From: Naveen Albert Date: Thu, 2 Nov 2023 20:51:22 +0000 (-0400) Subject: chan_dahdi: Warn if nonexistent cadence is requested. X-Git-Tag: 20.6.0-rc1~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e75aebc9bc0cc533aab74d2f743fe0e97a672fc8;p=thirdparty%2Fasterisk.git chan_dahdi: Warn if nonexistent cadence is requested. If attempting to ring a channel using a nonexistent cadence, emit a warning, before falling back to the default cadence. Resolves: #409 (cherry picked from commit 4b9a4483fc7b2d5518504435562e8acc63e085b9) --- diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 295ef5703d..d1a2faa2ac 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -2024,6 +2024,9 @@ static void my_set_cadence(void *pvt, int *cid_rings, struct ast_channel *ast) ast_log(LOG_WARNING, "Unable to set distinctive ring cadence %d on '%s': %s\n", p->distinctivering, ast_channel_name(ast), strerror(errno)); *cid_rings = cidrings[p->distinctivering - 1]; } else { + if (p->distinctivering > 0) { + ast_log(LOG_WARNING, "Cadence %d is not defined, falling back to default ring cadence\n", p->distinctivering); + } if (ioctl(p->subs[SUB_REAL].dfd, DAHDI_SETCADENCE, NULL)) ast_log(LOG_WARNING, "Unable to reset default ring on '%s': %s\n", ast_channel_name(ast), strerror(errno)); *cid_rings = p->sendcalleridafter;