]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_chanspy.c: resolving the issue with audiohook direction read
authorTinet-mucw <mucw@ti-net.com.cn>
Fri, 30 Aug 2024 05:45:32 +0000 (13:45 +0800)
committerAsterisk Development Team <asteriskteam@digium.com>
Thu, 12 Sep 2024 18:46:27 +0000 (18:46 +0000)
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 e98127d540621c4fc07afa10a0a51333472f38c4)

apps/app_broadcast.c
apps/app_chanspy.c

index de4b81db310791fd42e6b30b73e9ccb8185458bf..7ab646af03eddfe91371903c2518649ec9f92e2a 100644 (file)
@@ -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);
index bc799e64d97589e94443b2d4253085bb9689399e..f6907a5e033ebe549baeb9d1078de6da52326397 100644 (file)
@@ -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);