Ast_writestream Code Question

Hi,
In main/file.c there is a block of code starting on line 256:

        for (cur = trf; cur; cur = AST_LIST_NEXT(cur, frame_list)) {
          if ((res = fs->fmt->write(fs, trf))) {
            ast_log(LOG_WARNING, "Translated frame write failed\n");
            break;
          }
        }

Any coders familiar with Asterisk out there that can tell me how to add the name of the channel to the LOG_WARNING line? It would be a tremendous help in troubleshooting.

The function does not get passed “struct ast_channel *chan” so ast_channel_name(chan) would not work.

We get:
int ast_writestream(struct ast_filestream *fs, struct ast_frame *f)

File streams are not inherently tied to channels (and in fact are used in multiple places without channels), and as a result that information is not stored or available on them. You would have to alter/extend the API to store such information and call that in various places.

1 Like

Ah bummer. Thanks for the response!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.