[asterisk-dev] MIXMONITOR - periodic beep is not present in RECORDING

Jonathan Rose jonathan.rose at motorolasolutions.com
Wed Jan 12 12:12:23 CST 2022


On Wed, Jan 12, 2022 at 12:08 PM bala murugan <fightwithme at gmail.com> wrote:

> Thanks jonathan ,
>
> I am ok in modifying the source and trying . I looked at the source
> audiohook.c:audio_audiohook_write_list() and i did see the below order
>
> 1)AST_LIST_TRAVERSE_SAFE_BEGIN(&audiohook_list->spy_list, audiohook, list)
> {
>
> *2) if* (!AST_LIST_EMPTY(&audiohook_list->whisper_list)) {
>
> *3) if* (!AST_LIST_EMPTY(&audiohook_list->manipulate_list)) {
>
> Are you saying moving this around as below will help  or what is the
> recommended move to try ?
> 1) *if* (!AST_LIST_EMPTY(&audiohook_list->manipulate_list)) {
> 2)*if* (!AST_LIST_EMPTY(&audiohook_list->whisper_list)) {
> 3)AST_LIST_TRAVERSE_SAFE_BEGIN(&audiohook_list->spy_list, audiohook, list)
> {
>
> Also you have mentioned unexpected consequences from moving these around
> , any idea what it would be? , will it mess the recording ?
> affect the call quality ? If you know the specific then it will help to
> see will it be worth trying .
>
> Also is there an existing patch available for the changes you mentioned?
>

Well, I have a patch that I've written in the past to do such a thing at
some point, but it was against Asterisk 1.6.2 so that probably isn't
something you want.

Assuming you are looking at master from https://gerrit.asterisk.org...

         /* ---Part_2: Send middle_frame to spy and manipulator lists.
>  middle_frame is guaranteed to be SLINEAR here.*/
>         /* Queue up signed linear frame to each spy */
>         AST_LIST_TRAVERSE_SAFE_BEGIN(&audiohook_list->spy_list, audiohook,
> list) {
>                 ast_audiohook_lock(audiohook);
>                 if (audiohook->status != AST_AUDIOHOOK_STATUS_RUNNING) {
>                         AST_LIST_REMOVE_CURRENT(list);
>                         removed = 1;
>                         ast_audiohook_update_status(audiohook,
> AST_AUDIOHOOK_STATUS_DONE);
>                         ast_audiohook_unlock(audiohook);
>                         if (ast_channel_is_bridged(chan)) {
>                                 ast_channel_set_unbridged_nolock(chan, 1);
>                         }
>                         continue;
>                 }
>                 audiohook_list_set_hook_rate(audiohook_list, audiohook,
> &internal_sample_rate);
>                 ast_audiohook_write_frame(audiohook, direction,
> middle_frame);
>                 ast_audiohook_unlock(audiohook);
>         }
>         AST_LIST_TRAVERSE_SAFE_END;


This is the spy block. We're going to swap this whole block for the
manipulate block

        /* Pass off frame to manipulate audiohooks */
>         if (!AST_LIST_EMPTY(&audiohook_list->manipulate_list)) {
>
> AST_LIST_TRAVERSE_SAFE_BEGIN(&audiohook_list->manipulate_list, audiohook,
> list) {
>                         ast_audiohook_lock(audiohook);
>                         if (audiohook->status !=
> AST_AUDIOHOOK_STATUS_RUNNING) {
>                                 AST_LIST_REMOVE_CURRENT(list);
>                                 removed = 1;
>                                 ast_audiohook_update_status(audiohook,
> AST_AUDIOHOOK_STATUS_DONE);
>                                 ast_audiohook_unlock(audiohook);
>                                 /* We basically drop all of our links to
> the manipulate audiohook and prod it to do it's own destructive things */
>                                 audiohook->manipulate_callback(audiohook,
> chan, NULL, direction);
>                                 if (ast_channel_is_bridged(chan)) {
>
> ast_channel_set_unbridged_nolock(chan, 1);
>                                 }
>                                 continue;
>                         }
>                         audiohook_list_set_hook_rate(audiohook_list,
> audiohook, &internal_sample_rate);
>                         /*
>                          * Feed in frame to manipulation.
>                          */
>                         if (!audiohook->manipulate_callback(audiohook,
> chan, middle_frame, direction)) {
>                                 /*
>                                  * XXX FAILURES ARE IGNORED XXX
>                                  * If the manipulation fails then the
> frame will be returned in its original state.
>                                  * Since there are potentially more
> manipulator callbacks in the list, no action should
>                                  * be taken here to exit early.
>                                  */
>                                 middle_frame_manipulated = 1;
>                         }
>                         ast_audiohook_unlock(audiohook);
>                 }
>                 AST_LIST_TRAVERSE_SAFE_END;
>         }


Just flip them and you should be golden.
-- 

*Jonathan R. Rose*Senior Systems Engineer
Emergency Call Handling
Motorola Solutions

email: jonathan.rose at motorolasolutions.com

-- 


*For more information on how and why we collect your personal 
information, please visit our Privacy Policy 
<https://www.motorolasolutions.com/en_us/about/privacy-policy.html?elqTrackId=8980d888905940e39a2613a7a3dcb0a7&elqaid=2786&elqat=2#privacystatement>.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20220112/2e29baa2/attachment-0001.html>


More information about the asterisk-dev mailing list