[Asterisk-Dev] Interrupted playback of messages (ast_waitstream)
Lars Sundqvist
lars.sundqvist at algitech.com
Mon Nov 14 11:48:00 MST 2005
Spent the day tracking down a problem with randomly interrupted messages
(playback/background) and thought i would share my results if someone
else has similar problems.
file.c:ast_waitstream streams a file until a dtmf tone that matches a
character in char* parameter breakon is received.
To determine if the DTMF tone matches breakon, strchr is used and thats
where the problem lies, strchr matches any character in the string
INCLUDING the \0 char.
In the system i was debugging there is some random noise coming in from
PSTN which is detected as DTMF characters with value 0 (0, not '0') and
with the current code in ast_waitstream that breaks the playback and
asterisk instead waits for further dtmf input.
Fixed it by ignoring any dtmf with value 0.
Seems like a bug in ast_waitstream to me, but then this is the first
time i had a look at the asterisk code...maybe the bug lies elsewhere
and the dtmf with value 0 never should reach that far.
/Lasse
Lars Sundqvist
Algitech Consulting AB
More information about the asterisk-dev
mailing list