From: Tinet-mucw Date: Fri, 30 Aug 2024 05:45:32 +0000 (+0800) Subject: app_chanspy.c: resolving the issue with audiohook direction read X-Git-Tag: 20.10.0-rc1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81f2d13e206ba5875fea1fc1972c2f207e3a0370;p=thirdparty%2Fasterisk.git app_chanspy.c: resolving the issue with audiohook direction read ChanSpy(${channel}, qEoS): When chanspy spy the direction read, reading frame is often failed when reading direction read audiohook. because chanspy only read audiohook direction read; write_factory_ms will greater than 100ms soon, then ast_slinfactory_flush will being called, then direction read will fail. Resolves: #861 (cherry picked from commit 6e47295800def96419ba12c7b3e9517835ef38ac) --- diff --git a/apps/app_broadcast.c b/apps/app_broadcast.c index de4b81db31..7ab646af03 100644 --- a/apps/app_broadcast.c +++ b/apps/app_broadcast.c @@ -249,6 +249,7 @@ static int start_spying(struct ast_autochan *autochan, const char *spychan_name, ast_debug(1, "Attaching spy channel %s to %s\n", spychan_name, ast_channel_name(autochan->chan)); if (ast_test_flag(flags, OPTION_READONLY)) { + ast_audiohook_set_frame_feed_direction(audiohook, AST_AUDIOHOOK_DIRECTION_READ); ast_set_flag(audiohook, AST_AUDIOHOOK_MUTE_WRITE); } else { ast_set_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC); diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index ed2212317c..985699ed50 100644 --- a/apps/app_chanspy.c +++ b/apps/app_chanspy.c @@ -570,6 +570,7 @@ static int start_spying(struct ast_autochan *autochan, const char *spychan_name, spychan_name, ast_channel_name(autochan->chan)); if (ast_test_flag(flags, OPTION_READONLY)) { + ast_audiohook_set_frame_feed_direction(audiohook, AST_AUDIOHOOK_DIRECTION_READ); ast_set_flag(audiohook, AST_AUDIOHOOK_MUTE_WRITE); } else { ast_set_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC);