]> git.ipfire.org Git - thirdparty/asterisk.git/commit
chan_dahdi: Don't append cadences on dahdi restart.
authorNaveen Albert <asterisk@phreaknet.org>
Sun, 27 Mar 2022 11:23:12 +0000 (11:23 +0000)
committerJoshua Colp <jcolp@sangoma.com>
Mon, 2 May 2022 13:56:27 +0000 (08:56 -0500)
commitaece339a22d702b7b16e87e961b25f2b40fc7b8a
treeaaaf65bdc1552f3ef99289960e332a71af2a57b1
parent2ba9ba349f8f2c6f72bd03ada4615c8b658c3029
chan_dahdi: Don't append cadences on dahdi restart.

Currently, if any custom ring cadences are specified, they are
appended to the array of cadences from wherever we left off
last time. This works properly the first time, but on subsequent
dahdi restarts, it means that the existing cadences are left
alone and (most likely) the same cadences are then re-added
afterwards. In short order, the cadence array gets maxed out
and the user begins seeing warnings that the array is full
and no more cadences may be added.

This buggy behavior persists until Asterisk is completely
restarted; however, if and when dahdi restart is run again,
then the same problem is reintroduced.

This fixes this behavior so that cadence parsing is more
idempotent, that is so running dahdi restart multiple times
starts adding cadences from the beginning, rather than from
wherever the last cadence was added.

As before, it is still not possible to revert to the default
cadences by simply removing all cadences in this manner, nor
is it possible to delete existing cadences. However, this
does make it possible to update existing cadences, which
was not possible before, and also ensures that the cadences
remain unchanged if the config remains unchanged.

ASTERISK-29990 #close

Change-Id: Ie32ea3e8a243b766756b1afce684d4a31ee7421d
channels/chan_dahdi.c
configs/samples/chan_dahdi.conf.sample
doc/CHANGES-staging/chan_dahdi_cadences.txt [new file with mode: 0644]