Mon Mar 31 07:40:55 2008

Asterisk developer's documentation


func_moh.c File Reference

Functions for reading or setting the MusicOnHold class. More...

#include "asterisk.h"
#include <stdio.h>
#include <stdlib.h>
#include "asterisk/module.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/utils.h"
#include "asterisk/stringfields.h"

Include dependency graph for func_moh.c:

Go to the source code of this file.

Functions

 AST_MODULE_INFO_STANDARD (ASTERISK_GPL_KEY,"Music-on-hold dialplan function")
static int load_module (void)
static int moh_read (struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
static int moh_write (struct ast_channel *chan, char *cmd, char *data, const char *value)
static int unload_module (void)

Variables

static int depwarning = 0
static struct ast_custom_function moh_function


Detailed Description

Functions for reading or setting the MusicOnHold class.

Author:
Russell Bryant <russelb@clemson.edu>

Definition in file func_moh.c.


Function Documentation

AST_MODULE_INFO_STANDARD ( ASTERISK_GPL_KEY  ,
"Music-on-hold dialplan function"   
)

static int load_module ( void   )  [static]

Definition at line 82 of file func_moh.c.

References ast_custom_function_register(), and moh_function.

00083 {
00084    return ast_custom_function_register(&moh_function);
00085 }

static int moh_read ( struct ast_channel chan,
char *  cmd,
char *  data,
char *  buf,
size_t  len 
) [static]

Definition at line 41 of file func_moh.c.

References ast_log(), and LOG_WARNING.

00043 {
00044    if (!depwarning) {
00045       depwarning = 1;
00046       ast_log(LOG_WARNING, "MUSICCLASS() is deprecated; use CHANNEL(musicclass) instead.\n");
00047    }
00048 
00049    ast_copy_string(buf, chan ? chan->musicclass : "", len);
00050 
00051    return 0;
00052 }

static int moh_write ( struct ast_channel chan,
char *  cmd,
char *  data,
const char *  value 
) [static]

Definition at line 54 of file func_moh.c.

References ast_log(), ast_string_field_set, LOG_WARNING, and musicclass.

00056 {
00057    if (!depwarning) {
00058       depwarning = 1;
00059       ast_log(LOG_WARNING, "MUSICCLASS() is deprecated; use CHANNEL(musicclass) instead.\n");
00060    }
00061 
00062    if (chan)
00063       ast_string_field_set(chan, musicclass, value);
00064 
00065    return 0;
00066 }

static int unload_module ( void   )  [static]

Definition at line 77 of file func_moh.c.

References ast_custom_function_unregister(), and moh_function.

00078 {
00079    return ast_custom_function_unregister(&moh_function);
00080 }


Variable Documentation

int depwarning = 0 [static]

Definition at line 39 of file func_moh.c.

struct ast_custom_function moh_function [static]

Definition at line 68 of file func_moh.c.

Referenced by load_module(), and unload_module().


Generated on Mon Mar 31 07:40:55 2008 for Asterisk - the Open Source PBX by  doxygen 1.5.1