Asterisk - The Open Source Telephony Project  21.4.1
Functions
musiconhold.h File Reference

Music on hold handling. More...

Go to the source code of this file.

Functions

void ast_install_music_functions (int(*start_ptr)(struct ast_channel *, const char *, const char *), void(*stop_ptr)(struct ast_channel *), void(*cleanup_ptr)(struct ast_channel *))
 
void ast_moh_cleanup (struct ast_channel *chan)
 
int ast_moh_start (struct ast_channel *chan, const char *mclass, const char *interpclass)
 Turn on music on hold on a given channel. More...
 
void ast_moh_stop (struct ast_channel *chan)
 Turn off music on hold on a given channel.
 
void ast_uninstall_music_functions (void)
 

Detailed Description

Music on hold handling.

Definition in file musiconhold.h.

Function Documentation

int ast_moh_start ( struct ast_channel chan,
const char *  mclass,
const char *  interpclass 
)

Turn on music on hold on a given channel.

Parameters
chanThe channel structure that will get music on hold
mclassThe class to use if the musicclass is not currently set on the channel structure. NULL and the empty string are equivalent.
interpclassThe class to use if the musicclass is not currently set on the channel structure or in the mclass argument. NULL and the empty string are equivalent.
Return values
Zeroon success
non-zeroon failure

Definition at line 7766 of file channel.c.

Referenced by ast_ari_bridges_start_moh(), ast_bridge_channel_playfile(), ast_unreal_indicate(), chan_pjsip_indicate(), channel_do_masquerade(), conf_moh_start(), dial_exec_full(), jingle_indicate(), monitor_dial(), queue_exec(), rna(), and say_periodic_announcement().

7767 {
7768  if (ast_moh_start_ptr)
7769  return ast_moh_start_ptr(chan, mclass, interpclass);
7770 
7771  ast_verb(3, "Music class %s requested but no musiconhold loaded.\n", mclass ? mclass : (interpclass ? interpclass : "default"));
7772 
7773  return -1;
7774 }