[asterisk-dev] Audiohooks question ast_framehook_list_read_event AST_FRAME_NULL

Gabriel Ortiz Lour ortiz.admin at gmail.com
Thu Aug 25 09:24:00 CDT 2016


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?

  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

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);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20160825/612c4388/attachment.html>


More information about the asterisk-dev mailing list