2005-11-19 20:07:43 +00:00
|
|
|
/*
|
|
|
|
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
|
|
|
* Copyright (C) 2005/2006, Anthony Minessale II <anthmct@yahoo.com>
|
|
|
|
*
|
|
|
|
* Version: MPL 1.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Anthony Minessale II <anthmct@yahoo.com>
|
|
|
|
* Portions created by the Initial Developer are Copyright (C)
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Anthony Minessale II <anthmct@yahoo.com>
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* switch_module_interfaces.h -- Module Interface Definitions
|
|
|
|
*
|
|
|
|
*/
|
2006-01-02 17:28:59 +00:00
|
|
|
/*! \file switch_module_interfaces.h
|
|
|
|
\brief Module Interface Definitions
|
2006-01-05 21:03:22 +00:00
|
|
|
|
|
|
|
This module holds the definition of data abstractions used to implement various pluggable
|
|
|
|
interfaces and pluggable event handlers.
|
|
|
|
|
2006-01-01 15:23:12 +00:00
|
|
|
*/
|
2005-11-19 20:07:43 +00:00
|
|
|
#ifndef SWITCH_MODULE_INTERFACES_H
|
|
|
|
#define SWITCH_MODULE_INTERFACES_H
|
|
|
|
|
|
|
|
#include <switch.h>
|
|
|
|
|
2006-09-07 14:23:31 +00:00
|
|
|
SWITCH_BEGIN_EXTERN_C
|
2006-04-28 20:04:08 +00:00
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! \brief A table of functions to execute at various states
|
|
|
|
*/
|
2006-02-07 20:47:15 +00:00
|
|
|
struct switch_state_handler_table {
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! executed when the state changes to init */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_state_handler_t on_init;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! executed when the state changes to ring */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_state_handler_t on_ring;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! executed when the state changes to execute */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_state_handler_t on_execute;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! executed when the state changes to hangup */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_state_handler_t on_hangup;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! executed when the state changes to loopback*/
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_state_handler_t on_loopback;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! executed when the state changes to transmit*/
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_state_handler_t on_transmit;
|
2006-04-28 19:46:57 +00:00
|
|
|
/*! executed when the state changes to hold*/
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_state_handler_t on_hold;
|
2006-10-31 21:38:06 +00:00
|
|
|
/*! executed when the state changes to hibernate*/
|
|
|
|
switch_state_handler_t on_hibernate;
|
2005-11-19 20:07:43 +00:00
|
|
|
};
|
|
|
|
|
2006-05-10 15:47:54 +00:00
|
|
|
struct switch_stream_handle {
|
|
|
|
switch_stream_handle_write_function_t write_function;
|
|
|
|
void *data;
|
|
|
|
void *end;
|
|
|
|
switch_size_t data_size;
|
|
|
|
switch_size_t data_len;
|
2006-09-07 03:58:01 +00:00
|
|
|
switch_size_t alloc_len;
|
|
|
|
switch_size_t alloc_chunk;
|
2006-05-10 19:07:38 +00:00
|
|
|
switch_event_t *event;
|
2006-05-10 15:47:54 +00:00
|
|
|
};
|
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! \brief Node in which to store custom outgoing channel callback hooks */
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_io_event_hook_outgoing_channel {
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the outgoing channel callback hook*/
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_outgoing_channel_hook_t outgoing_channel;
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_io_event_hook_outgoing_channel *next;
|
|
|
|
};
|
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! \brief Node in which to store custom answer channel callback hooks */
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_io_event_hook_answer_channel {
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the answer channel callback hook*/
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_answer_channel_hook_t answer_channel;
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_io_event_hook_answer_channel *next;
|
|
|
|
};
|
|
|
|
|
2006-01-09 19:48:20 +00:00
|
|
|
/*! \brief Node in which to store custom receive message callback hooks */
|
|
|
|
struct switch_io_event_hook_receive_message {
|
|
|
|
/*! the answer channel callback hook*/
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_receive_message_hook_t receive_message;
|
2006-01-09 19:48:20 +00:00
|
|
|
struct switch_io_event_hook_receive_message *next;
|
|
|
|
};
|
|
|
|
|
2006-04-14 16:43:49 +00:00
|
|
|
/*! \brief Node in which to store custom receive message callback hooks */
|
2006-07-12 18:39:19 +00:00
|
|
|
struct switch_io_event_hook_receive_event {
|
2006-04-14 16:43:49 +00:00
|
|
|
/*! the answer channel callback hook*/
|
2006-07-12 18:39:19 +00:00
|
|
|
switch_receive_event_hook_t receive_event;
|
|
|
|
struct switch_io_event_hook_receive_event *next;
|
2006-04-14 16:43:49 +00:00
|
|
|
};
|
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! \brief Node in which to store custom read frame channel callback hooks */
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_io_event_hook_read_frame {
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the read frame channel callback hook*/
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_read_frame_hook_t read_frame;
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_io_event_hook_read_frame *next;
|
|
|
|
};
|
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! \brief Node in which to store custom write_frame channel callback hooks */
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_io_event_hook_write_frame {
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the write_frame channel callback hook*/
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_write_frame_hook_t write_frame;
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_io_event_hook_write_frame *next;
|
|
|
|
};
|
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! \brief Node in which to store custom kill channel callback hooks */
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_io_event_hook_kill_channel {
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the kill channel callback hook*/
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_kill_channel_hook_t kill_channel;
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_io_event_hook_kill_channel *next;
|
|
|
|
};
|
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! \brief Node in which to store custom waitfor read channel callback hooks */
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_io_event_hook_waitfor_read {
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the waitfor read channel callback hook*/
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_waitfor_read_hook_t waitfor_read;
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_io_event_hook_waitfor_read *next;
|
|
|
|
};
|
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! \brief Node in which to store custom waitfor write channel callback hooks */
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_io_event_hook_waitfor_write {
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the waitfor write channel callback hook*/
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_waitfor_write_hook_t waitfor_write;
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_io_event_hook_waitfor_write *next;
|
|
|
|
};
|
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! \brief Node in which to store custom send dtmf channel callback hooks */
|
2005-12-06 21:25:56 +00:00
|
|
|
struct switch_io_event_hook_send_dtmf {
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the send dtmf channel callback hook*/
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_send_dtmf_hook_t send_dtmf;
|
2005-12-06 21:25:56 +00:00
|
|
|
struct switch_io_event_hook_send_dtmf *next;
|
|
|
|
};
|
|
|
|
|
2007-03-27 00:40:53 +00:00
|
|
|
/*! \brief Node in which to store state change callback hooks */
|
|
|
|
struct switch_io_event_hook_state_change {
|
|
|
|
/*! the send dtmf channel callback hook*/
|
|
|
|
switch_state_change_hook_t state_change;
|
|
|
|
struct switch_io_event_hook_state_change *next;
|
|
|
|
};
|
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! \brief A table of lists of io_event_hooks to store the event hooks associated with a session */
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_io_event_hooks {
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! a list of outgoing channel hooks */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_io_event_hook_outgoing_channel_t *outgoing_channel;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! a list of answer channel hooks */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_io_event_hook_answer_channel_t *answer_channel;
|
2006-01-09 19:48:20 +00:00
|
|
|
/*! a list of receive message hooks */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_io_event_hook_receive_message_t *receive_message;
|
2006-04-14 16:43:49 +00:00
|
|
|
/*! a list of queue message hooks */
|
2006-07-12 18:39:19 +00:00
|
|
|
switch_io_event_hook_receive_event_t *receive_event;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! a list of read frame hooks */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_io_event_hook_read_frame_t *read_frame;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! a list of write frame hooks */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_io_event_hook_write_frame_t *write_frame;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! a list of kill channel hooks */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_io_event_hook_kill_channel_t *kill_channel;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! a list of wait for read hooks */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_io_event_hook_waitfor_read_t *waitfor_read;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! a list of wait for write hooks */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_io_event_hook_waitfor_write_t *waitfor_write;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! a list of send dtmf hooks */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_io_event_hook_send_dtmf_t *send_dtmf;
|
2007-03-27 00:40:53 +00:00
|
|
|
/*! a list of state change hooks */
|
|
|
|
switch_io_event_hook_state_change_t *state_change;
|
2005-11-19 20:07:43 +00:00
|
|
|
};
|
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! \brief A table of i/o routines that an endpoint interface can implement */
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_io_routines {
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! creates an outgoing session from given session, caller profile */
|
2007-03-02 23:38:01 +00:00
|
|
|
switch_call_cause_t (*outgoing_channel)(switch_core_session_t *, switch_caller_profile_t *, switch_core_session_t **, switch_memory_pool_t **);
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! answers the given session's channel */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*answer_channel)(switch_core_session_t *);
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! read a frame from a session */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*read_frame)(switch_core_session_t *, switch_frame_t **, int, switch_io_flag_t, int);
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! write a frame to a session */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*write_frame)(switch_core_session_t *, switch_frame_t *, int, switch_io_flag_t, int);
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! send a kill signal to the session's channel */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*kill_channel)(switch_core_session_t *, int);
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! wait for the session's channel to be ready to read audio */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*waitfor_read)(switch_core_session_t *, int, int);
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! wait for the session's channel to be ready to write audio */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*waitfor_write)(switch_core_session_t *, int, int);
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! send a string of DTMF digits to a session's channel */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*send_dtmf)(switch_core_session_t *, char *);
|
2006-01-09 19:48:20 +00:00
|
|
|
/*! receive a message from another session*/
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*receive_message)(switch_core_session_t *, switch_core_session_message_t *);
|
2006-04-14 16:43:49 +00:00
|
|
|
/*! queue a message for another session*/
|
2006-07-12 18:39:19 +00:00
|
|
|
switch_status_t (*receive_event)(switch_core_session_t *, switch_event_t *);
|
2007-03-27 00:40:53 +00:00
|
|
|
/*! change a sessions channel state */
|
|
|
|
switch_status_t (*state_change)(switch_core_session_t *);
|
2005-11-19 20:07:43 +00:00
|
|
|
};
|
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! \brief Abstraction of an module endpoint interface
|
2005-11-19 20:07:43 +00:00
|
|
|
This is the glue between the abstract idea of a "channel" and what is really going on under the
|
|
|
|
hood. Each endpoint module fills out one of these tables and makes it available when a channel
|
|
|
|
is created of it's paticular type.
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct switch_endpoint_interface {
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the interface's name */
|
2005-11-19 20:07:43 +00:00
|
|
|
const char *interface_name;
|
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! channel abstraction methods */
|
2006-04-29 23:43:28 +00:00
|
|
|
const switch_io_routines_t *io_routines;
|
2005-11-19 20:07:43 +00:00
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! state machine methods */
|
2006-04-29 06:05:03 +00:00
|
|
|
const switch_state_handler_table_t *state_handler;
|
2005-11-19 20:07:43 +00:00
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! private information */
|
2006-02-26 04:52:34 +00:00
|
|
|
void *private_info;
|
2005-11-19 20:07:43 +00:00
|
|
|
|
|
|
|
/* to facilitate linking */
|
|
|
|
const struct switch_endpoint_interface *next;
|
|
|
|
};
|
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! \brief Abstract handler to a timer module */
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_timer {
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! time interval expressed in milliseconds */
|
2005-11-19 20:07:43 +00:00
|
|
|
int interval;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! flags to control behaviour */
|
2006-03-30 23:02:50 +00:00
|
|
|
uint32_t flags;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! sample count to increment by on each cycle */
|
2005-11-19 20:07:43 +00:00
|
|
|
unsigned int samples;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! current sample count based on samples parameter */
|
2007-03-06 01:19:41 +00:00
|
|
|
uint32_t samplecount;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the timer interface provided from a loadable module */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_timer_interface_t *timer_interface;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the timer's memory pool */
|
2006-04-29 01:00:52 +00:00
|
|
|
switch_memory_pool_t *memory_pool;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! private data for loadable modules to store information */
|
2006-02-26 04:52:34 +00:00
|
|
|
void *private_info;
|
2005-11-19 20:07:43 +00:00
|
|
|
};
|
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! \brief A table of functions that a timer module implements */
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_timer_interface {
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the name of the interface */
|
2005-11-19 20:07:43 +00:00
|
|
|
const char *interface_name;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! function to allocate the timer */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*timer_init)(switch_timer_t *);
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! function to wait for one cycle to pass */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*timer_next)(switch_timer_t *);
|
2006-09-12 22:23:45 +00:00
|
|
|
/*! function to step the timer one step */
|
|
|
|
switch_status_t (*timer_step)(switch_timer_t *);
|
|
|
|
/*! function to check if the current step has expired */
|
2007-02-07 19:18:15 +00:00
|
|
|
switch_status_t (*timer_check)(switch_timer_t *);
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! function to deallocate the timer */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*timer_destroy)(switch_timer_t *);
|
2005-11-19 20:07:43 +00:00
|
|
|
const struct switch_timer_interface *next;
|
|
|
|
};
|
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! \brief Abstract interface to a dialplan module */
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_dialplan_interface {
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the name of the interface */
|
2005-11-19 20:07:43 +00:00
|
|
|
const char *interface_name;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the function to read an extension and set a channels dialpan */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_dialplan_hunt_function_t hunt_function;
|
2005-11-19 20:07:43 +00:00
|
|
|
const struct switch_dialplan_interface *next;
|
|
|
|
};
|
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! \brief Abstract interface to a file format module */
|
2005-12-26 19:58:42 +00:00
|
|
|
struct switch_file_interface {
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the name of the interface */
|
2005-12-26 19:58:42 +00:00
|
|
|
const char *interface_name;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! function to open the file */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*file_open)(switch_file_handle_t *, char *file_path);
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! function to close the file */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*file_close)(switch_file_handle_t *);
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! function to read from the file */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*file_read)(switch_file_handle_t *, void *data, switch_size_t *len);
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! function to write from the file */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*file_write)(switch_file_handle_t *, void *data, switch_size_t *len);
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! function to seek to a certian position in the file */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*file_seek)(switch_file_handle_t *, unsigned int *cur_pos, int64_t samples, int whence);
|
2006-07-25 22:37:52 +00:00
|
|
|
/*! function to set meta data */
|
|
|
|
switch_status_t (*file_set_string)(switch_file_handle_t *fh, switch_audio_col_t col, const char *string);
|
|
|
|
/*! function to get meta data */
|
|
|
|
switch_status_t (*file_get_string)(switch_file_handle_t *fh, switch_audio_col_t col, const char **string);
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! list of supported file extensions */
|
2005-12-27 18:46:12 +00:00
|
|
|
char **extens;
|
2005-12-26 19:58:42 +00:00
|
|
|
const struct switch_file_interface *next;
|
|
|
|
};
|
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! an abstract representation of a file handle (some parameters based on compat with libsndfile) */
|
2005-12-26 19:58:42 +00:00
|
|
|
struct switch_file_handle {
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the interface of the module that implemented the current file type */
|
2006-04-29 23:43:28 +00:00
|
|
|
const switch_file_interface_t *file_interface;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! flags to control behaviour */
|
2006-03-30 23:02:50 +00:00
|
|
|
uint32_t flags;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! a file descriptor if neceessary */
|
2005-12-26 19:58:42 +00:00
|
|
|
switch_file_t *fd;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! samples position of the handle */
|
2005-12-27 18:46:12 +00:00
|
|
|
unsigned int samples;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the current samplerate */
|
2006-04-09 00:10:13 +00:00
|
|
|
uint32_t samplerate;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the number of channels */
|
2006-04-09 00:10:13 +00:00
|
|
|
uint8_t channels;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! integer representation of the format */
|
2005-12-27 18:46:12 +00:00
|
|
|
unsigned int format;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! integer representation of the sections */
|
2005-12-27 18:46:12 +00:00
|
|
|
unsigned int sections;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! is the file seekable */
|
2005-12-27 18:46:12 +00:00
|
|
|
int seekable;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the sample count of the file */
|
2005-12-26 19:58:42 +00:00
|
|
|
unsigned int sample_count;
|
2006-02-28 02:08:42 +00:00
|
|
|
/*! the speed of the file playback*/
|
|
|
|
int speed;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the handle's memory pool */
|
2006-04-29 01:00:52 +00:00
|
|
|
switch_memory_pool_t *memory_pool;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! private data for the format module to store handle specific info */
|
2006-02-26 04:52:34 +00:00
|
|
|
void *private_info;
|
2007-03-15 00:36:14 +00:00
|
|
|
char *handler;
|
2006-02-28 02:08:42 +00:00
|
|
|
int64_t pos;
|
2006-04-29 06:05:03 +00:00
|
|
|
switch_buffer_t *audio_buffer;
|
2006-11-29 17:10:40 +00:00
|
|
|
uint32_t thresh;
|
|
|
|
uint32_t silence_hits;
|
2005-12-26 19:58:42 +00:00
|
|
|
};
|
|
|
|
|
2006-11-09 05:39:04 +00:00
|
|
|
/*! \brief Abstract interface to an asr module */
|
|
|
|
struct switch_asr_interface {
|
|
|
|
/*! the name of the interface */
|
|
|
|
const char *interface_name;
|
|
|
|
/*! function to open the asr interface */
|
|
|
|
switch_status_t (*asr_open)(switch_asr_handle_t *ah,
|
|
|
|
char *codec,
|
|
|
|
int rate,
|
|
|
|
char *dest,
|
|
|
|
switch_asr_flag_t *flags);
|
|
|
|
/*! function to load a grammar to the asr interface */
|
|
|
|
switch_status_t (*asr_load_grammar)(switch_asr_handle_t *ah, char *grammar, char *path);
|
|
|
|
/*! function to unload a grammar to the asr interface */
|
|
|
|
switch_status_t (*asr_unload_grammar)(switch_asr_handle_t *ah, char *grammar);
|
|
|
|
/*! function to close the asr interface */
|
|
|
|
switch_status_t (*asr_close)(switch_asr_handle_t *ah, switch_asr_flag_t *flags);
|
|
|
|
/*! function to feed audio to the ASR*/
|
|
|
|
switch_status_t (*asr_feed)(switch_asr_handle_t *ah, void *data, unsigned int len, switch_asr_flag_t *flags);
|
|
|
|
/*! function to resume the ASR*/
|
|
|
|
switch_status_t (*asr_resume)(switch_asr_handle_t *ah);
|
|
|
|
/*! function to pause the ASR*/
|
|
|
|
switch_status_t (*asr_pause)(switch_asr_handle_t *ah);
|
|
|
|
/*! function to read results from the ASR*/
|
|
|
|
switch_status_t (*asr_check_results)(switch_asr_handle_t *ah, switch_asr_flag_t *flags);
|
|
|
|
/*! function to read results from the ASR*/
|
|
|
|
switch_status_t (*asr_get_results)(switch_asr_handle_t *ah, char **xmlstr, switch_asr_flag_t *flags);
|
|
|
|
const struct switch_asr_interface *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*! an abstract representation of an asr speech interface. */
|
|
|
|
struct switch_asr_handle {
|
|
|
|
/*! the interface of the module that implemented the current speech interface */
|
|
|
|
const switch_asr_interface_t *asr_interface;
|
|
|
|
/*! flags to control behaviour */
|
|
|
|
uint32_t flags;
|
|
|
|
/*! The Name*/
|
|
|
|
char *name;
|
|
|
|
/*! The Codec*/
|
|
|
|
char *codec;
|
|
|
|
/*! The Rate*/
|
|
|
|
uint32_t rate;
|
|
|
|
char *grammar;
|
|
|
|
/*! the handle's memory pool */
|
|
|
|
switch_memory_pool_t *memory_pool;
|
|
|
|
/*! private data for the format module to store handle specific info */
|
|
|
|
void *private_info;
|
|
|
|
};
|
2005-12-26 19:58:42 +00:00
|
|
|
|
2006-01-27 16:43:57 +00:00
|
|
|
/*! \brief Abstract interface to a speech module */
|
|
|
|
struct switch_speech_interface {
|
|
|
|
/*! the name of the interface */
|
|
|
|
const char *interface_name;
|
|
|
|
/*! function to open the speech interface */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*speech_open)(switch_speech_handle_t *sh,
|
2006-02-26 20:23:23 +00:00
|
|
|
char *voice_name,
|
2006-03-02 21:05:07 +00:00
|
|
|
int rate,
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_speech_flag_t *flags);
|
2006-01-27 16:43:57 +00:00
|
|
|
/*! function to close the speech interface */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*speech_close)(switch_speech_handle_t *, switch_speech_flag_t *flags);
|
2006-01-27 16:43:57 +00:00
|
|
|
/*! function to feed audio to the ASR*/
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*speech_feed_tts)(switch_speech_handle_t *sh, char *text, switch_speech_flag_t *flags);
|
2006-01-27 16:43:57 +00:00
|
|
|
/*! function to read audio from the TTS*/
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*speech_read_tts)(switch_speech_handle_t *sh,
|
2006-01-27 16:43:57 +00:00
|
|
|
void *data,
|
2006-03-30 23:02:50 +00:00
|
|
|
switch_size_t *datalen,
|
2006-04-09 00:10:13 +00:00
|
|
|
uint32_t *rate,
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_speech_flag_t *flags);
|
2006-06-08 01:58:37 +00:00
|
|
|
void (*speech_flush_tts)(switch_speech_handle_t *sh);
|
|
|
|
void (*speech_text_param_tts)(switch_speech_handle_t *sh, char *param, char *val);
|
|
|
|
void (*speech_numeric_param_tts)(switch_speech_handle_t *sh, char *param, int val);
|
2006-06-08 19:22:54 +00:00
|
|
|
void (*speech_float_param_tts)(switch_speech_handle_t *sh, char *param, double val);
|
2006-01-27 16:43:57 +00:00
|
|
|
|
|
|
|
const struct switch_speech_interface *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*! an abstract representation of a asr/tts speech interface. */
|
|
|
|
struct switch_speech_handle {
|
|
|
|
/*! the interface of the module that implemented the current speech interface */
|
2006-04-29 23:43:28 +00:00
|
|
|
const switch_speech_interface_t *speech_interface;
|
2006-01-27 16:43:57 +00:00
|
|
|
/*! flags to control behaviour */
|
2006-03-30 23:02:50 +00:00
|
|
|
uint32_t flags;
|
2006-06-08 01:58:37 +00:00
|
|
|
/*! The Name*/
|
|
|
|
char *name;
|
|
|
|
/*! The Rate*/
|
|
|
|
uint32_t rate;
|
2006-06-08 19:22:54 +00:00
|
|
|
uint32_t speed;
|
|
|
|
char voice[80];
|
|
|
|
char engine[80];
|
2006-01-27 16:43:57 +00:00
|
|
|
/*! the handle's memory pool */
|
2006-04-29 01:00:52 +00:00
|
|
|
switch_memory_pool_t *memory_pool;
|
2006-01-27 16:43:57 +00:00
|
|
|
/*! private data for the format module to store handle specific info */
|
2006-02-26 04:52:34 +00:00
|
|
|
void *private_info;
|
2006-01-27 16:43:57 +00:00
|
|
|
};
|
|
|
|
|
2006-12-20 21:25:14 +00:00
|
|
|
/*! \brief Abstract interface to a say module */
|
|
|
|
struct switch_say_interface {
|
|
|
|
/*! the name of the interface */
|
|
|
|
const char *interface_name;
|
|
|
|
/*! function to pass down to the module */
|
2006-12-22 02:13:56 +00:00
|
|
|
switch_say_callback_t say_function;
|
2006-12-20 21:25:14 +00:00
|
|
|
const struct switch_say_interface *next;
|
|
|
|
};
|
2006-01-27 16:43:57 +00:00
|
|
|
|
2006-10-19 07:13:34 +00:00
|
|
|
/*! \brief Abstract interface to a chat module */
|
|
|
|
struct switch_chat_interface {
|
|
|
|
/*! the name of the interface */
|
|
|
|
const char *interface_name;
|
|
|
|
/*! function to open the directory interface */
|
2006-10-20 22:11:26 +00:00
|
|
|
switch_status_t (*chat_send)(char *proto, char *from, char *to, char *subject, char *body, char *hint);
|
2006-10-19 07:13:34 +00:00
|
|
|
const struct switch_chat_interface *next;
|
|
|
|
};
|
2006-02-09 16:28:49 +00:00
|
|
|
|
2007-03-07 18:34:22 +00:00
|
|
|
/*! \brief Abstract interface to a management module */
|
|
|
|
struct switch_management_interface {
|
|
|
|
/*! the name of the interface */
|
|
|
|
const char *relative_oid;
|
|
|
|
/*! function to open the directory interface */
|
|
|
|
switch_status_t (*management_function)(char *relative_oid, switch_management_action_t action, char *data, switch_size_t datalen);
|
|
|
|
const struct switch_management_interface *next;
|
|
|
|
};
|
|
|
|
|
2006-02-09 16:28:49 +00:00
|
|
|
/*! \brief Abstract interface to a directory module */
|
|
|
|
struct switch_directory_interface {
|
|
|
|
/*! the name of the interface */
|
|
|
|
const char *interface_name;
|
|
|
|
/*! function to open the directory interface */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*directory_open)(switch_directory_handle_t *dh, char *source, char *dsn, char *passwd);
|
2006-02-09 16:28:49 +00:00
|
|
|
/*! function to close the directory interface */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*directory_close)(switch_directory_handle_t *dh);
|
2006-02-09 16:28:49 +00:00
|
|
|
/*! function to query the directory interface */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*directory_query)(switch_directory_handle_t *dh, char *base, char *query);
|
2006-02-09 16:28:49 +00:00
|
|
|
/*! function to advance to the next record */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*directory_next)(switch_directory_handle_t *dh);
|
2006-02-09 16:28:49 +00:00
|
|
|
/*! function to advance to the next name/value pair in the current record */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*directory_next_pair)(switch_directory_handle_t *dh, char **var, char **val);
|
2006-02-09 16:28:49 +00:00
|
|
|
|
|
|
|
const struct switch_directory_interface *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*! an abstract representation of a directory interface. */
|
|
|
|
struct switch_directory_handle {
|
|
|
|
/*! the interface of the module that implemented the current directory interface */
|
2006-04-29 23:43:28 +00:00
|
|
|
const switch_directory_interface_t *directory_interface;
|
2006-02-09 16:28:49 +00:00
|
|
|
/*! flags to control behaviour */
|
2006-03-30 23:02:50 +00:00
|
|
|
uint32_t flags;
|
2006-02-09 16:28:49 +00:00
|
|
|
|
|
|
|
/*! the handle's memory pool */
|
2006-04-29 01:00:52 +00:00
|
|
|
switch_memory_pool_t *memory_pool;
|
2006-02-09 16:28:49 +00:00
|
|
|
/*! private data for the format module to store handle specific info */
|
2006-02-26 04:52:34 +00:00
|
|
|
void *private_info;
|
2006-02-09 16:28:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-11-19 20:07:43 +00:00
|
|
|
/* nobody has more setting than speex so we will let them set the standard */
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! \brief Various codec settings (currently only relevant to speex) */
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_codec_settings {
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! desired quality */
|
2005-11-19 20:07:43 +00:00
|
|
|
int quality;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! desired complexity */
|
2005-11-19 20:07:43 +00:00
|
|
|
int complexity;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! desired enhancement */
|
2005-11-19 20:07:43 +00:00
|
|
|
int enhancement;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! desired vad level */
|
2005-11-19 20:07:43 +00:00
|
|
|
int vad;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! desired vbr level */
|
2005-11-19 20:07:43 +00:00
|
|
|
int vbr;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! desired vbr quality */
|
2005-11-19 20:07:43 +00:00
|
|
|
float vbr_quality;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! desired abr level */
|
2005-11-19 20:07:43 +00:00
|
|
|
int abr;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! desired dtx setting */
|
2005-11-19 20:07:43 +00:00
|
|
|
int dtx;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! desired preprocessor settings */
|
2005-11-19 20:07:43 +00:00
|
|
|
int preproc;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! preprocessor vad settings */
|
2005-11-19 20:07:43 +00:00
|
|
|
int pp_vad;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! preprocessor gain control settings */
|
2005-11-19 20:07:43 +00:00
|
|
|
int pp_agc;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! preprocessor gain level */
|
2005-11-19 20:07:43 +00:00
|
|
|
float pp_agc_level;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! preprocessor denoise level */
|
2005-11-19 20:07:43 +00:00
|
|
|
int pp_denoise;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! preprocessor dereverb settings */
|
2005-11-19 20:07:43 +00:00
|
|
|
int pp_dereverb;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! preprocessor dereverb decay level */
|
2005-11-19 20:07:43 +00:00
|
|
|
float pp_dereverb_decay;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! preprocessor dereverb level */
|
2005-11-19 20:07:43 +00:00
|
|
|
float pp_dereverb_level;
|
|
|
|
};
|
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! an abstract handle to a codec module */
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_codec {
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the codec interface table this handle uses */
|
2006-04-29 23:43:28 +00:00
|
|
|
const switch_codec_interface_t *codec_interface;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the specific implementation of the above codec */
|
2006-04-29 06:05:03 +00:00
|
|
|
const switch_codec_implementation_t *implementation;
|
2006-10-09 02:24:43 +00:00
|
|
|
/*! fmtp line from remote sdp */
|
|
|
|
char *fmtp_in;
|
|
|
|
/*! fmtp line for local sdp */
|
|
|
|
char *fmtp_out;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! codec settings for this handle */
|
2006-04-29 06:05:03 +00:00
|
|
|
switch_codec_settings_t codec_settings;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! flags to modify behaviour */
|
2006-03-30 23:02:50 +00:00
|
|
|
uint32_t flags;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the handle's memory pool*/
|
2006-04-29 01:00:52 +00:00
|
|
|
switch_memory_pool_t *memory_pool;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! private data for the codec module to store handle specific info */
|
2006-02-26 04:52:34 +00:00
|
|
|
void *private_info;
|
2005-11-19 20:07:43 +00:00
|
|
|
};
|
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! \brief A table of settings and callbacks that define a paticular implementation of a codec */
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_codec_implementation {
|
2006-07-10 22:08:02 +00:00
|
|
|
/*! enumeration defining the type of the codec */
|
|
|
|
const switch_codec_type_t codec_type;
|
2006-06-23 20:14:29 +00:00
|
|
|
/*! the IANA code number */
|
|
|
|
switch_payload_t ianacode;
|
|
|
|
/*! the IANA code name */
|
|
|
|
char *iananame;
|
2006-10-09 02:24:43 +00:00
|
|
|
/*! default fmtp to send (can be overridden by the init function) */
|
|
|
|
char *fmtp;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! samples transferred per second */
|
2006-04-09 00:10:13 +00:00
|
|
|
uint32_t samples_per_second;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! bits transferred per second */
|
2005-11-19 20:07:43 +00:00
|
|
|
int bits_per_second;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! number of microseconds that denote one frame */
|
2005-11-19 20:07:43 +00:00
|
|
|
int microseconds_per_frame;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! number of samples that denote one frame */
|
2006-04-09 00:10:13 +00:00
|
|
|
uint32_t samples_per_frame;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! number of bytes that denote one frame decompressed */
|
2006-04-09 00:10:13 +00:00
|
|
|
uint32_t bytes_per_frame;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! number of bytes that denote one frame compressed */
|
2006-04-09 00:10:13 +00:00
|
|
|
uint32_t encoded_bytes_per_frame;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! number of channels represented */
|
2006-04-09 00:10:13 +00:00
|
|
|
uint8_t number_of_channels;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! number of frames to send in one netowrk packet */
|
2005-11-19 20:07:43 +00:00
|
|
|
int pref_frames_per_packet;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! max number of frames to send in one network packet */
|
2005-11-19 20:07:43 +00:00
|
|
|
int max_frames_per_packet;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! function to initialize a codec handle using this implementation */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*init)(switch_codec_t *, switch_codec_flag_t, const switch_codec_settings_t *codec_settings);
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! function to encode raw data into encoded data */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*encode)(switch_codec_t *codec,
|
2006-04-29 06:05:03 +00:00
|
|
|
switch_codec_t *other_codec,
|
2005-11-19 20:07:43 +00:00
|
|
|
void *decoded_data,
|
2006-04-09 00:10:13 +00:00
|
|
|
uint32_t decoded_data_len,
|
|
|
|
uint32_t decoded_rate,
|
2005-11-19 20:07:43 +00:00
|
|
|
void *encoded_data,
|
2006-04-09 00:10:13 +00:00
|
|
|
uint32_t *encoded_data_len,
|
|
|
|
uint32_t *encoded_rate,
|
2005-11-19 20:07:43 +00:00
|
|
|
unsigned int *flag);
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! function to decode encoded data into raw data */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*decode)(switch_codec_t *codec,
|
2006-04-29 06:05:03 +00:00
|
|
|
switch_codec_t *other_codec,
|
2005-11-19 20:07:43 +00:00
|
|
|
void *encoded_data,
|
2006-04-09 00:10:13 +00:00
|
|
|
uint32_t encoded_data_len,
|
|
|
|
uint32_t encoded_rate,
|
2005-11-19 20:07:43 +00:00
|
|
|
void *decoded_data,
|
2006-04-09 00:10:13 +00:00
|
|
|
uint32_t *decoded_data_len,
|
|
|
|
uint32_t *decoded_rate,
|
2005-11-19 20:07:43 +00:00
|
|
|
unsigned int *flag);
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! deinitalize a codec handle using this implementation */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_status_t (*destroy)(switch_codec_t *);
|
2005-11-19 20:07:43 +00:00
|
|
|
const struct switch_codec_implementation *next;
|
|
|
|
};
|
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! \brief Top level module interface to implement a series of codec implementations */
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_codec_interface {
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the name of the interface */
|
2005-11-19 20:07:43 +00:00
|
|
|
const char *interface_name;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! a list of codec implementations related to the codec */
|
2006-04-29 06:05:03 +00:00
|
|
|
const switch_codec_implementation_t *implementations;
|
2005-11-19 20:07:43 +00:00
|
|
|
const struct switch_codec_interface *next;
|
|
|
|
};
|
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! \brief A module interface to implement an application */
|
2005-11-19 20:07:43 +00:00
|
|
|
struct switch_application_interface {
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the name of the interface */
|
2005-11-19 20:07:43 +00:00
|
|
|
const char *interface_name;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! function the application implements */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_application_function_t application_function;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the long winded description of the application */
|
2005-11-19 20:07:43 +00:00
|
|
|
const char *long_desc;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the short and sweet description of the application */
|
2005-11-19 20:07:43 +00:00
|
|
|
const char *short_desc;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! an example of the application syntax */
|
2005-11-19 20:07:43 +00:00
|
|
|
const char *syntax;
|
2007-02-26 21:38:10 +00:00
|
|
|
/*! flags to control behaviour */
|
|
|
|
uint32_t flags;
|
2005-11-19 20:07:43 +00:00
|
|
|
const struct switch_application_interface *next;
|
|
|
|
};
|
|
|
|
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! \brief A module interface to implement an api function */
|
2005-12-09 19:23:04 +00:00
|
|
|
struct switch_api_interface {
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! the name of the interface */
|
2005-12-09 19:23:04 +00:00
|
|
|
const char *interface_name;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! a description of the api function */
|
2005-12-09 19:23:04 +00:00
|
|
|
const char *desc;
|
2006-01-05 21:03:22 +00:00
|
|
|
/*! function the api call uses */
|
2006-04-29 23:43:28 +00:00
|
|
|
switch_api_function_t function;
|
2007-02-26 21:38:10 +00:00
|
|
|
/*! an example of the api syntax */
|
2006-10-08 05:04:34 +00:00
|
|
|
const char *syntax;
|
2005-12-09 19:23:04 +00:00
|
|
|
const struct switch_api_interface *next;
|
|
|
|
};
|
|
|
|
|
2006-09-07 15:15:39 +00:00
|
|
|
SWITCH_END_EXTERN_C
|
2006-03-24 21:28:46 +00:00
|
|
|
|
2005-11-19 20:07:43 +00:00
|
|
|
#endif
|
2006-11-27 22:30:48 +00:00
|
|
|
|
|
|
|
/* For Emacs:
|
|
|
|
* Local Variables:
|
|
|
|
* mode:c
|
2007-02-09 02:36:03 +00:00
|
|
|
* indent-tabs-mode:t
|
2006-11-27 22:30:48 +00:00
|
|
|
* tab-width:4
|
|
|
|
* c-basic-offset:4
|
|
|
|
* End:
|
|
|
|
* For VIM:
|
|
|
|
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
|
|
|
|
*/
|