]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_dahdi: Warn if nonexistent cadence is requested.
authorNaveen Albert <asterisk@phreaknet.org>
Thu, 2 Nov 2023 20:51:22 +0000 (16:51 -0400)
committerNaveen Albert <asterisk@phreaknet.org>
Tue, 7 Nov 2023 14:31:51 +0000 (14:31 +0000)
If attempting to ring a channel using a nonexistent cadence,
emit a warning, before falling back to the default cadence.

Resolves: #409

channels/chan_dahdi.c

index d15b664b7917a4a92bd11eb16a6daf10f33cc4fb..473ec17549926d175ff2fc3dd47c612f5db56cd2 100644 (file)
@@ -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;