[asterisk-dev] Audiohooks question ast_framehook_list_read_event AST_FRAME_NULL

Matt Fredrickson creslin at digium.com
Wed Sep 7 15:43:26 CDT 2016


This is a really late response, but...

On Thu, Aug 25, 2016 at 9:24 AM, Gabriel Ortiz Lour
<ortiz.admin at gmail.com> wrote:
> Hi all,
>   Having trouble trying to understand why AMD is receiving just
> AST_FRAME_NULL and failing to analise audio. It seams only to happen when I
> use a Local proxy channel, and only in one server I have (many others, same
> software, no issue).
>
>   Digging trought the code I came to the piece of code bellow.
>
>   My question is (sorry if is a dumb one):
>   - The code is iterating trough all the audiohooks on the channel, calling
> its callback with the AST_FRAMEHOOK_EVENT_READ and receiving an "ast_frame"
> pointer as a return.
>
>   - There can be many framehooks in the list, right? So wouldn't just the
> last received frame of all the framehook interfaces in the channels
> "framehooks" list be returned to the caller?

Last received frame, or potentially a list of frames.

>   Little more info on the issue:
> - I use the "M" Dial option to lauch AMD on the channel
> - If I dont use Originate (CLI or AMI) the issue dont happen, this is why
> I've related it to Local channels

I don't think any framehooks are used by app AMD, so unless you're
enabling them somewhere else it might be a dead end.  There's a
possibility that you're heading in the wrong direction by looking at
that code, and you might look more into the Local channel interaction
with the underlying channel.

Hope that helps a bit,
Matthew Fredrickson

>
> Thanks in advance,
> Gabriel Ortiz
>
>
> static struct ast_frame *framehook_list_push_event(struct ast_framehook_list
> *framehooks, struct ast_frame *frame, enum ast_framehook_event event)
> {
> struct ast_framehook *framehook;
>
> if (!framehooks) {
> return frame;
> }
>
> AST_LIST_TRAVERSE_SAFE_BEGIN(&framehooks->list, framehook, list) {
> if (framehook->detach_and_destroy_me) {
> /* this guy is signaled for destruction */
> AST_LIST_REMOVE_CURRENT(list);
> framehook_detach_and_destroy(framehook);
> } else {
> frame = framehook->i.event_cb(framehook->chan, frame, event,
> framehook->i.data);
> }
> }
> AST_LIST_TRAVERSE_SAFE_END;
> return frame;
> }
>
> struct ast_frame *ast_framehook_list_read_event(struct ast_framehook_list
> *framehooks, struct ast_frame *frame)
> {
> return framehook_list_push_event(framehooks, frame,
> AST_FRAMEHOOK_EVENT_READ);
> }
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev



-- 
Matthew Fredrickson
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA



More information about the asterisk-dev mailing list