ao2_cleanup(message);
}
+/*
+ * Called with `chan` locked.
+ */
static void moh_files_release(struct ast_channel *chan, void *data)
{
struct moh_files_state *state;
state->class = mohclass_unref(state->class, "Unreffing channel's music class upon deactivation of generator");
}
-static int ast_moh_files_next(struct ast_channel *chan)
+/*
+ * Called with `chan` locked.
+ */
+static int moh_files_next(struct ast_channel *chan)
{
struct moh_files_state *state = ast_channel_music_state(chan);
struct ast_vector_string *files;
return 0;
}
+/*
+ * Called with `chan` locked.
+ */
static struct ast_frame *moh_files_readframe(struct ast_channel *chan)
{
struct ast_frame *f;
f = ast_readframe(ast_channel_stream(chan));
if (!f) {
/* Either there was no file stream setup or we reached EOF. */
- if (!ast_moh_files_next(chan)) {
+ if (!moh_files_next(chan)) {
/*
* Either we resetup the previously saved file stream position
* or we started a new file stream.
* resetup file stream was saved at EOF when MOH was
* previously stopped.
*/
- if (!ast_moh_files_next(chan)) {
+ if (!moh_files_next(chan)) {
f = ast_readframe(ast_channel_stream(chan));
}
}
return f;
}
+/*
+ * Called with `chan` locked.
+ */
static void moh_files_write_format_change(struct ast_channel *chan, void *data)
{
struct moh_files_state *state = ast_channel_music_state(chan);
return res;
}
+/*
+ * Called with `chan` locked.
+ */
static void *moh_files_alloc(struct ast_channel *chan, void *params)
{
struct moh_files_state *state;
return moh;
}
+/*
+ * Called with `chan` locked.
+ */
static void moh_release(struct ast_channel *chan, void *data)
{
struct mohdata *moh = data;
ao2_cleanup(oldwfmt);
}
+/*
+ * Called with `chan` locked.
+ */
static void *moh_alloc(struct ast_channel *chan, void *params)
{
struct mohdata *res;
return 0;
}
+/*
+ * Called with `chan` UNLOCKED.
+ */
static void local_ast_moh_cleanup(struct ast_channel *chan)
{
struct moh_files_state *state = ast_channel_music_state(chan);
return var;
}
+/*
+ * Called with `chan` UNLOCKED.
+ */
static int local_ast_moh_start(struct ast_channel *chan, const char *mclass, const char *interpclass)
{
struct mohclass *mohclass = NULL;
return res;
}
+/*
+ * Called with `chan` UNLOCKED.
+ */
static void local_ast_moh_stop(struct ast_channel *chan)
{
ast_deactivate_generator(chan);