Files
asterisk/funcs/func_moh.c
Kevin P. Fleming a16ae226b6 use string fields for some stuff in ast_channel
const-ify some more APIs
remove 'type' field from ast_channel, in favor of the one in the channel's tech structure
allow string field module users to specify the 'chunk size' for pool allocations
update chan_alsa to be compatible with recent const-ification patches


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@9060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-02-01 23:05:28 +00:00

59 lines
1.5 KiB
C

/*
* Asterisk -- An open source telephony toolkit.
*
* Copyright (C) 1999 - 2005, Digium, Inc.
*
* Russell Bryant <russelb@clemson.edu>
*
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site, mailing lists and IRC
* channels for your use.
*
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2. See the LICENSE file
* at the top of the source tree.
*/
/*! \file
*
* \brief Functions for reading or setting the MusicOnHold class
*
* \author Russell Bryant <russelb@clemson.edu>
*/
#include <stdlib.h>
#include "asterisk.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/utils.h"
#include "asterisk/stringfields.h"
static char *function_moh_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)
{
ast_copy_string(buf, chan->musicclass, len);
return buf;
}
static void function_moh_write(struct ast_channel *chan, char *cmd, char *data, const char *value)
{
ast_string_field_set(chan, musicclass, value);
}
#ifndef BUILTIN_FUNC
static
#endif
struct ast_custom_function moh_function = {
.name = "MUSICCLASS",
.synopsis = "Read or Set the MusicOnHold class",
.syntax = "MUSICCLASS()",
.desc = "This function will read or set the music on hold class for a channel.\n",
.read = function_moh_read,
.write = function_moh_write,
};