Asterisk - The Open Source Telephony Project  GIT-master-1b41629
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. More...
 
void ast_uninstall_music_functions (void)
 

Detailed Description

Music on hold handling.

Definition in file musiconhold.h.

Function Documentation

◆ ast_install_music_functions()

void ast_install_music_functions ( int(*)(struct ast_channel *, const char *, const char *)  start_ptr,
void(*)(struct ast_channel *)  stop_ptr,
void(*)(struct ast_channel *)  cleanup_ptr 
)

Definition at line 7749 of file channel.c.

References ast_moh_cleanup_ptr, ast_moh_start_ptr, and ast_moh_stop_ptr.

Referenced by load_module(), and reload().

7752 {
7753  ast_moh_start_ptr = start_ptr;
7754  ast_moh_stop_ptr = stop_ptr;
7755  ast_moh_cleanup_ptr = cleanup_ptr;
7756 }
static int(* ast_moh_start_ptr)(struct ast_channel *, const char *, const char *)
Definition: channel.c:7745
static void(* ast_moh_stop_ptr)(struct ast_channel *)
Definition: channel.c:7746
static void(* ast_moh_cleanup_ptr)(struct ast_channel *)
Definition: channel.c:7747

◆ ast_moh_cleanup()

void ast_moh_cleanup ( struct ast_channel chan)

Definition at line 7781 of file channel.c.

References ast_moh_cleanup_ptr.

Referenced by ast_channel_destructor().

7782 {
7783  if (ast_moh_cleanup_ptr)
7784  ast_moh_cleanup_ptr(chan);
7785 }
static void(* ast_moh_cleanup_ptr)(struct ast_channel *)
Definition: channel.c:7747

◆ ast_moh_start()

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 7765 of file channel.c.

References ast_moh_start_ptr, and ast_verb.

Referenced by alsa_indicate(), app_control_moh_start(), app_exec(), ast_ari_bridges_start_moh(), ast_bridge_channel_playfile(), ast_unreal_indicate(), chan_pjsip_indicate(), channel_do_masquerade(), conf_moh_start(), conf_moh_unsuspend(), conf_start_moh(), console_indicate(), dahdi_indicate(), dial_exec_full(), handle_setmusic(), iax2_indicate(), jingle_indicate(), limits_interval_playback(), mgcp_indicate(), misdn_indication(), moh_handle_digit(), monitor_dial(), ooh323_indicate(), oss_indicate(), participant_entertainment_start(), phone_indicate(), play_moh_exec(), queue_exec(), retrydial_exec(), rna(), say_periodic_announcement(), say_position(), sip_indicate(), skinny_indicate(), start_moh_exec(), unistim_indicate(), and valid_priv_reply().

7766 {
7767  if (ast_moh_start_ptr)
7768  return ast_moh_start_ptr(chan, mclass, interpclass);
7769 
7770  ast_verb(3, "Music class %s requested but no musiconhold loaded.\n", mclass ? mclass : (interpclass ? interpclass : "default"));
7771 
7772  return -1;
7773 }
static int(* ast_moh_start_ptr)(struct ast_channel *, const char *, const char *)
Definition: channel.c:7745
#define ast_verb(level,...)
Definition: logger.h:455

◆ ast_moh_stop()

void ast_moh_stop ( struct ast_channel chan)

◆ ast_uninstall_music_functions()

void ast_uninstall_music_functions ( void  )

Definition at line 7758 of file channel.c.

References ast_moh_cleanup_ptr, ast_moh_start_ptr, ast_moh_stop_ptr, and NULL.

Referenced by unload_module().

7759 {
7763 }
static int(* ast_moh_start_ptr)(struct ast_channel *, const char *, const char *)
Definition: channel.c:7745
#define NULL
Definition: resample.c:96
static void(* ast_moh_stop_ptr)(struct ast_channel *)
Definition: channel.c:7746
static void(* ast_moh_cleanup_ptr)(struct ast_channel *)
Definition: channel.c:7747