FreeSWITCH API Documentation  1.7.0
switch_module_interfaces.h
Go to the documentation of this file.
1 /*
2  * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
3  * Copyright (C) 2005-2014, Anthony Minessale II <anthm@freeswitch.org>
4  *
5  * Version: MPL 1.1
6  *
7  * The contents of this file are subject to the Mozilla Public License Version
8  * 1.1 (the "License"); you may not use this file except in compliance with
9  * the License. You may obtain a copy of the License at
10  * http://www.mozilla.org/MPL/
11  *
12  * Software distributed under the License is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14  * for the specific language governing rights and limitations under the
15  * License.
16  *
17  * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
18  *
19  * The Initial Developer of the Original Code is
20  * Anthony Minessale II <anthm@freeswitch.org>
21  * Portions created by the Initial Developer are Copyright (C)
22  * the Initial Developer. All Rights Reserved.
23  *
24  * Contributor(s):
25  *
26  * Anthony Minessale II <anthm@freeswitch.org>
27  * Luke Dashjr <luke@openmethods.com> (OpenMethods, LLC)
28  *
29  *
30  * switch_module_interfaces.h -- Module Interface Definitions
31  *
32  */
33 /*! \file switch_module_interfaces.h
34  \brief Module Interface Definitions
35 
36  This module holds the definition of data abstractions used to implement various pluggable
37  interfaces and pluggable event handlers.
38 
39 */
40 #ifndef SWITCH_MODULE_INTERFACES_H
41 #define SWITCH_MODULE_INTERFACES_H
42 
43 #include <switch.h>
44 #include "switch_resample.h"
45 
47 /*! \brief A table of functions to execute at various states
48  */
49  typedef enum {
63 
65  /*! executed when the state changes to init */
67  /*! executed when the state changes to routing */
69  /*! executed when the state changes to execute */
71  /*! executed when the state changes to hangup */
73  /*! executed when the state changes to exchange_media */
75  /*! executed when the state changes to soft_execute */
77  /*! executed when the state changes to consume_media */
79  /*! executed when the state changes to hibernate */
81  /*! executed when the state changes to reset */
83  /*! executed when the state changes to park */
85  /*! executed when the state changes to reporting */
87  /*! executed when the state changes to destroy */
89  int flags;
90  void *padding[10];
91 };
92 
97  void *data;
98  void *end;
104 };
105 
106 struct switch_io_event_hooks;
108 
112 typedef switch_status_t (*switch_io_read_frame_t) (switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int);
113 typedef switch_status_t (*switch_io_write_frame_t) (switch_core_session_t *, switch_frame_t *, switch_io_flag_t, int);
114 typedef switch_status_t (*switch_io_kill_channel_t) (switch_core_session_t *, int);
115 typedef switch_status_t (*switch_io_send_dtmf_t) (switch_core_session_t *, const switch_dtmf_t *);
117 typedef switch_status_t (*switch_io_receive_event_t) (switch_core_session_t *, switch_event_t *);
118 typedef switch_status_t (*switch_io_state_change_t) (switch_core_session_t *);
119 typedef switch_status_t (*switch_io_state_run_t) (switch_core_session_t *);
120 typedef switch_status_t (*switch_io_read_video_frame_t) (switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int);
121 typedef switch_status_t (*switch_io_write_video_frame_t) (switch_core_session_t *, switch_frame_t *, switch_io_flag_t, int);
122 typedef switch_jb_t *(*switch_io_get_jb_t) (switch_core_session_t *, switch_media_type_t);
123 
124 typedef enum {
137 
138 /*! \brief A table of i/o routines that an endpoint interface can implement */
140  /*! creates an outgoing session from given session, caller profile */
142  /*! read a frame from a session */
144  /*! write a frame to a session */
146  /*! send a kill signal to the session's channel */
148  /*! send a string of DTMF digits to a session's channel */
150  /*! receive a message from another session */
152  /*! queue a message for another session */
154  /*! change a sessions channel state */
156  /*! read a video frame from a session */
158  /*! write a video frame to a session */
160  /*! change a sessions channel run state */
162  /*! get sessions jitterbuffer */
164  void *padding[10];
165 };
166 
167 /*! \brief Abstraction of an module endpoint interface
168  This is the glue between the abstract idea of a "channel" and what is really going on under the
169  hood. Each endpoint module fills out one of these tables and makes it available when a channel
170  is created of it's paticular type.
171 */
172 
174  /*! the interface's name */
175  const char *interface_name;
176 
177  /*! channel abstraction methods */
179 
180  /*! state machine methods */
182 
183  /*! private information */
185 
187  int refs;
189 
190  /* parent */
192 
193  /* to facilitate linking */
195 
197 
198 };
199 
200 /*! \brief Abstract handler to a timer module */
201 struct switch_timer {
202  /*! time interval expressed in milliseconds */
203  int interval;
204  /*! flags to control behaviour */
205  uint32_t flags;
206  /*! sample count to increment by on each cycle */
207  unsigned int samples;
208  /*! current sample count based on samples parameter */
209  uint32_t samplecount;
210  /*! the timer interface provided from a loadable module */
212  /*! the timer's memory pool */
213  switch_memory_pool_t *memory_pool;
214  /*! private data for loadable modules to store information */
216  /*! remaining time from last call to _check() */
219  uint64_t tick;
220 
221 };
222 
223 typedef enum {
231 
232 /*! \brief A table of functions that a timer module implements */
234  /*! the name of the interface */
235  const char *interface_name;
236  /*! function to allocate the timer */
238  /*! function to wait for one cycle to pass */
240  /*! function to step the timer one step */
242  /*! function to reset the timer */
244  /*! function to check if the current step has expired */
246  /*! function to deallocate the timer */
249  int refs;
253 };
254 
255 /*! \brief Abstract interface to a dialplan module */
257  /*! the name of the interface */
258  const char *interface_name;
259  /*! the function to read an extension and set a channels dialpan */
262  int refs;
266 };
267 
268 /*! \brief Abstract interface to a file format module */
270  /*! the name of the interface */
271  const char *interface_name;
272  /*! function to open the file */
273  switch_status_t (*file_open) (switch_file_handle_t *, const char *file_path);
274  /*! function to close the file */
276  /*! function to close the file */
278  /*! function to read from the file */
280  /*! function to write from the file */
282  /*! function to seek to a certian position in the file */
284  /*! function to write from the file */
286  /*! function to seek to a certian position in the file */
287  switch_status_t (*file_seek) (switch_file_handle_t *, unsigned int *cur_pos, int64_t samples, int whence);
288  /*! function to set meta data */
290  /*! function to get meta data */
292  /*! function to control the underlying tech of the file */
294  /*! list of supported file extensions */
295  char **extens;
297  int refs;
301 };
302 
303 typedef enum {
309 
310 typedef enum {
315 
316 typedef struct switch_mm_s {
318  int channels;
319  int keyint;
320  int ab;
321  int vb;
322  int vw;
323  int vh;
324  float fps;
325  float source_fps;
326  int vbuf;
330 } switch_mm_t;
331 
332 /*! an abstract representation of a file handle (some parameters based on compat with libsndfile) */
334  /*! the interface of the module that implemented the current file type */
336  /*! flags to control behaviour */
337  uint32_t flags;
338  /*! a file descriptor if neceessary */
340  /*! samples position of the handle */
341  unsigned int samples;
342  /*! the current samplerate */
343  uint32_t samplerate;
344  /*! the current native samplerate */
345  uint32_t native_rate;
346  /*! the number of channels */
347  uint32_t channels;
348  uint32_t real_channels;
349  /*! integer representation of the format */
350  unsigned int format;
351  /*! integer representation of the sections */
352  unsigned int sections;
353  /*! is the file seekable */
354  int seekable;
355  /*! the sample count of the file */
357  /*! the speed of the file playback */
358  int speed;
359  /*! the handle's memory pool */
360  switch_memory_pool_t *memory_pool;
361  /*! pre-buffer x bytes for streams */
362  uint32_t prebuf;
363  /*! private data for the format module to store handle specific info */
364  uint32_t interval;
366  char *handler;
367  int64_t pos;
370  uint32_t thresh;
371  uint32_t silence_hits;
372  uint32_t offset_pos;
375  int32_t vol;
381  unsigned char *pre_buffer_data;
383  const char *file;
384  const char *func;
385  int line;
386  char *file_path;
387  char *spool_path;
388  const char *prefix;
390  switch_event_t *params;
391  uint32_t cur_channels;
392  uint32_t cur_samplerate;
393  char *stream_name;
394  char *modname;
397  /*! total video duration, or total page in pdf*/
398  int64_t duration;
399  /*! current video position, or current page in pdf */
400  int64_t vpos;
401 };
402 
403 /*! \brief Abstract interface to an asr module */
405  /*! the name of the interface */
406  const char *interface_name;
407  /*! function to open the asr interface */
408  switch_status_t (*asr_open) (switch_asr_handle_t *ah, const char *codec, int rate, const char *dest, switch_asr_flag_t *flags);
409  /*! function to load a grammar to the asr interface */
410  switch_status_t (*asr_load_grammar) (switch_asr_handle_t *ah, const char *grammar, const char *name);
411  /*! function to unload a grammar to the asr interface */
413  /*! function to close the asr interface */
415  /*! function to feed audio to the ASR */
416  switch_status_t (*asr_feed) (switch_asr_handle_t *ah, void *data, unsigned int len, switch_asr_flag_t *flags);
417  /*! function to resume the ASR */
419  /*! function to pause the ASR */
421  /*! function to read results from the ASR */
423  /*! function to read results from the ASR */
425  /*! function to read result headers from the ASR */
427  /*! function to start ASR input timers */
429  void (*asr_text_param) (switch_asr_handle_t *ah, char *param, const char *val);
430  void (*asr_numeric_param) (switch_asr_handle_t *ah, char *param, int val);
431  void (*asr_float_param) (switch_asr_handle_t *ah, char *param, double val);
433  int refs;
437  /*! function to enable a grammar to the asr interface */
439  /*! function to disable a grammar to the asr interface */
441  /*! function to disable all grammars to the asr interface */
443  /*! function to feed DTMF to the ASR */
445 };
446 
447 /*! an abstract representation of an asr speech interface. */
449  /*! the interface of the module that implemented the current speech interface */
451  /*! flags to control behaviour */
452  uint32_t flags;
453  /*! The Name */
454  char *name;
455  /*! The Codec */
456  char *codec;
457  /*! The Rate */
458  uint32_t rate;
459  char *grammar;
460  /*! module specific param */
461  char *param;
462  /*! the handle's memory pool */
463  switch_memory_pool_t *memory_pool;
468  /*! the current samplerate */
469  uint32_t samplerate;
470  /*! the current native samplerate */
471  uint32_t native_rate;
472  /*! private data for the format module to store handle specific info */
474 };
475 
476 /*! \brief Abstract interface to a speech module */
478  /*! the name of the interface */
479  const char *interface_name;
480  /*! function to open the speech interface */
481  switch_status_t (*speech_open) (switch_speech_handle_t *sh, const char *voice_name, int rate, int channels, switch_speech_flag_t *flags);
482  /*! function to close the speech interface */
484  /*! function to feed audio to the ASR */
486  /*! function to read audio from the TTS */
489  void (*speech_text_param_tts) (switch_speech_handle_t *sh, char *param, const char *val);
490  void (*speech_numeric_param_tts) (switch_speech_handle_t *sh, char *param, int val);
491  void (*speech_float_param_tts) (switch_speech_handle_t *sh, char *param, double val);
493  int refs;
497 };
498 
499 
500 /*! an abstract representation of a tts speech interface. */
502  /*! the interface of the module that implemented the current speech interface */
504  /*! flags to control behaviour */
505  uint32_t flags;
506  /*! The Name */
507  char *name;
508  /*! The Rate */
509  uint32_t rate;
510  uint32_t speed;
511  uint32_t samples;
512  uint32_t channels;
513  uint32_t real_channels;
514  char voice[80];
515  char *engine;
516  /*! module specific param */
517  char *param;
518  /*! the handle's memory pool */
519  switch_memory_pool_t *memory_pool;
524  /*! the current samplerate */
525  uint32_t samplerate;
526  /*! the current native samplerate */
527  uint32_t native_rate;
528  /*! the number of channels */
529 
530  /*! private data for the format module to store handle specific info */
532 };
533 
534 /*! \brief Abstract interface to a say module */
536  /*! the name of the interface */
537  const char *interface_name;
538  /*! function to pass down to the module */
542  int refs;
546 };
547 
548 /*! \brief Abstract interface to a chat module */
550  /*! the name of the interface */
551  const char *interface_name;
552  /*! function to open the directory interface */
553  switch_status_t (*chat_send) (switch_event_t *message_event);
554 
556  int refs;
560 };
561 
562 /*! \brief Abstract interface to a management module */
564  /*! the name of the interface */
565  const char *relative_oid;
566  /*! function to open the directory interface */
569  int refs;
573 };
574 
575 /*! \brief Abstract interface to a limit module */
577  /*! name of the interface */
578  const char *interface_name;
579  /*! increment */
580  switch_status_t (*incr) (switch_core_session_t *session, const char *realm, const char *resource, const int max, const int interval);
581  /*! release */
582  switch_status_t (*release) (switch_core_session_t *session, const char *realm, const char *resource);
583  /*! usage for resource */
584  int (*usage) (const char *realm, const char *resource, uint32_t *rcount);
585  /*! reset counters */
587  /*! freform status */
588  char * (*status) (void);
589  /*! reset interval counter */
590  switch_status_t (*interval_reset) (const char *realm, const char *resource);
591  /* internal */
593  int refs;
597 };
598 
599 /*! \brief Abstract interface to a directory module */
601  /*! the name of the interface */
602  const char *interface_name;
603  /*! function to open the directory interface */
604  switch_status_t (*directory_open) (switch_directory_handle_t *dh, char *source, char *dsn, char *passwd);
605  /*! function to close the directory interface */
607  /*! function to query the directory interface */
608  switch_status_t (*directory_query) (switch_directory_handle_t *dh, char *base, char *query);
609  /*! function to advance to the next record */
611  /*! function to advance to the next name/value pair in the current record */
614  int refs;
618 };
619 
620 /*! an abstract representation of a directory interface. */
622  /*! the interface of the module that implemented the current directory interface */
624  /*! flags to control behaviour */
625  uint32_t flags;
626 
627  /*! the handle's memory pool */
628  switch_memory_pool_t *memory_pool;
629  /*! private data for the format module to store handle specific info */
631 };
632 
634  int unused;
635 };
636 
638  uint32_t bandwidth;
639  int32_t width;
640  int32_t height;
642 };
643 
647 };
648 
649 /*! an abstract handle of a fmtp parsed by codec */
651  /*! actual samples transferred per second for those who are not moron g722 RFC writers */
653  /*! bits transferred per second */
655  /*! number of microseconds of media in one packet (ptime * 1000) */
657  /*! stereo */
658  int stereo;
659  /*! private data for the codec module to store handle specific info */
661 
662 };
663 
665  uint32_t width; /* the picture width */
666  uint32_t height; /* the picture height */
667  uint8_t *planes[4]; /* pointer to the top left pixel for each plane */
668  uint32_t stride[4]; /* stride between rows for each plane */
669 };
670 
671 /*! an abstract handle to a codec module */
672 struct switch_codec {
673  /*! the codec interface table this handle uses */
675  /*! the specific implementation of the above codec */
677  /*! fmtp line from remote sdp */
678  char *fmtp_in;
679  /*! fmtp line for local sdp */
680  char *fmtp_out;
681  /*! flags to modify behaviour */
682  uint32_t flags;
683  /*! the handle's memory pool */
684  switch_memory_pool_t *memory_pool;
685  /*! private data for the codec module to store handle specific info */
690  switch_core_session_t *session;
692 };
693 
694 /*! \brief A table of settings and callbacks that define a paticular implementation of a codec */
696  /*! enumeration defining the type of the codec */
698  /*! the IANA code number */
700  /*! the IANA code name */
701  char *iananame;
702  /*! default fmtp to send (can be overridden by the init function) */
703  char *fmtp;
704  /*! samples transferred per second */
706  /*! actual samples transferred per second for those who are not moron g722 RFC writers */
708  /*! bits transferred per second */
710  /*! number of microseconds of media in one packet (ptime * 1000) */
712  /*! number of samples in one packet */
714  /*! number of bytes one packet will decompress to */
716  /*! number of encoded bytes in the RTP payload */
718  /*! number of channels represented */
720  /*! number of codec frames packetized into one packet */
722  /*! function to initialize a codec handle using this implementation */
724  /*! function to encode raw data into encoded data */
726  /*! function to decode encoded data into raw data */
728  /*! function to encode video raw data into encoded data */
730  /*! function to decode video encoded data into raw data */
732  /*! function to send control messages to the codec */
734  /*! deinitalize a codec handle using this implementation */
736  uint32_t codec_id;
737  uint32_t impl_id;
738  char *modname;
740 };
741 
742 /*! \brief Top level module interface to implement a series of codec implementations */
744  /*! the name of the interface */
745  const char *interface_name;
746  /*! a list of codec implementations related to the codec */
748  /*! function to decode a codec fmtp parameters */
750  uint32_t codec_id;
752  int refs;
754  char *modname;
757 };
758 
759 /*! \brief A module interface to implement an application */
761  /*! the name of the interface */
762  const char *interface_name;
763  /*! function the application implements */
765  /*! the long winded description of the application */
766  const char *long_desc;
767  /*! the short and sweet description of the application */
768  const char *short_desc;
769  /*! an example of the application syntax */
770  const char *syntax;
771  /*! flags to control behaviour */
772  uint32_t flags;
774  int refs;
778 };
779 
780 /*! \brief A module interface to implement a chat application */
782  /*! the name of the interface */
783  const char *interface_name;
784  /*! function the application implements */
786  /*! the long winded description of the application */
787  const char *long_desc;
788  /*! the short and sweet description of the application */
789  const char *short_desc;
790  /*! an example of the application syntax */
791  const char *syntax;
792  /*! flags to control behaviour */
793  uint32_t flags;
795  int refs;
799 };
800 
801 /*! \brief A module interface to implement an api function */
803  /*! the name of the interface */
804  const char *interface_name;
805  /*! a description of the api function */
806  const char *desc;
807  /*! function the api call uses */
809  /*! an example of the api syntax */
810  const char *syntax;
812  int refs;
816 };
817 
818 
819 /*! \brief A module interface to implement a json api function */
821  /*! the name of the interface */
822  const char *interface_name;
823  /*! a description of the api function */
824  const char *desc;
825  /*! function the api call uses */
827  /*! an example of the api syntax */
828  const char *syntax;
830  int refs;
834 };
835 
836 #define PROTECT_INTERFACE(_it) if (_it) {switch_mutex_lock(_it->reflock); switch_thread_rwlock_rdlock(_it->parent->rwlock); switch_thread_rwlock_rdlock(_it->rwlock); _it->refs++; _it->parent->refs++; switch_mutex_unlock(_it->reflock);} //if (!strcmp(_it->interface_name, "user")) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "+++++++++++LOCK %s %d/%d\n", _it->interface_name, _it->refs, _it->parent->refs);
837 #define UNPROTECT_INTERFACE(_it) if (_it) {switch_mutex_lock(_it->reflock); switch_thread_rwlock_unlock(_it->rwlock); switch_thread_rwlock_unlock(_it->parent->rwlock); _it->refs--; _it->parent->refs--; switch_mutex_unlock(_it->reflock);} //if (!strcmp(_it->interface_name, "user")) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "---------UNLOCK %s %d/%d\n", _it->interface_name, _it->refs, _it->parent->refs);
838 
839 #include "switch_frame.h"
840 
842  switch_core_session_t *session;
846 };
847 
849 #endif
850 /* For Emacs:
851  * Local Variables:
852  * mode:c
853  * indent-tabs-mode:t
854  * tab-width:4
855  * c-basic-offset:4
856  * End:
857  * For VIM:
858  * vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet:
859  */
struct switch_video_codec_settings video
switch_core_session_t * session
switch_state_handler_t on_consume_media
switch_status_t(* asr_unload_grammar)(switch_asr_handle_t *ah, const char *name)
uint8_t *(* switch_stream_handle_read_function_t)(switch_stream_handle_t *handle, int *len)
A module interface to implement an application.
switch_status_t(* release)(switch_core_session_t *session, const char *realm, const char *resource)
switch_state_handler_t on_soft_execute
struct switch_directory_interface * next
void(* speech_numeric_param_tts)(switch_speech_handle_t *sh, char *param, int val)
Call Specific Data.
Definition: switch_caller.h:73
switch_io_state_run_t state_run
Abstract interface to a limit module.
switch_codec_type_t
Codec types.
switch_status_t(* switch_io_state_run_t)(switch_core_session_t *)
switch_thread_rwlock_t * rwlock
switch_status_t(* switch_api_function_t)(_In_opt_z_ const char *cmd, _In_opt_ switch_core_session_t *session, _In_ switch_stream_handle_t *stream)
switch_say_callback_t say_function
switch_core_codec_destroy_func_t destroy
Abstraction of an module endpoint interface This is the glue between the abstract idea of a "channel"...
switch_stream_handle_raw_write_function_t raw_write_function
switch_call_cause_t(* switch_io_outgoing_channel_t)(switch_core_session_t *, switch_event_t *, switch_caller_profile_t *, switch_core_session_t **, switch_memory_pool_t **, switch_originate_flag_t, switch_call_cause_t *)
switch_directory_interface_t * directory_interface
uint32_t switch_io_flag_t
struct switch_management_interface * next
switch_file_interface_t * file_interface
switch_io_send_dtmf_t send_dtmf
switch_status_t(* file_command)(switch_file_handle_t *fh, switch_file_command_t command)
#define SWITCH_END_EXTERN_C
Definition: switch.h:43
switch_thread_rwlock_t * rwlock
switch_io_read_frame_t read_frame
uint32_t switch_speech_flag_t
#define SWITCH_RECOMMENDED_BUFFER_SIZE
Definition: switch_types.h:557
switch_status_t(* directory_next_pair)(switch_directory_handle_t *dh, char **var, char **val)
switch_bool_t
Definition: switch_types.h:405
switch_audio_col_t
Definition: switch_types.h:578
switch_loadable_module_interface_t * parent
switch_status_t(* chat_send)(switch_event_t *message_event)
switch_chat_application_function_t chat_application_function
switch_state_handler_name_t
A table of functions to execute at various states.
switch_loadable_module_interface_t * parent
Representation of an event.
Definition: switch_event.h:80
switch_status_t(* switch_chat_application_function_t)(switch_event_t *, const char *)
switch_loadable_module_interface_t * parent
A module interface to implement a chat application.
switch_codec_implementation_t * implementations
switch_status_t(* incr)(switch_core_session_t *session, const char *realm, const char *resource, const int max, const int interval)
switch_frame_t * cur_frame
switch_say_string_callback_t say_string_function
switch_io_routines_t * io_routines
switch_status_t(* interval_reset)(const char *realm, const char *resource)
switch_loadable_module_interface_t * parent
switch_jb_t *(* switch_io_get_jb_t)(switch_core_session_t *, switch_media_type_t)
struct switch_endpoint_interface * next
switch_io_receive_event_t receive_event
switch_status_t(* reset)(void)
switch_status_t(* switch_say_string_callback_t)(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, char **rstr)
Abstract interface to a chat module.
switch_status_t(* switch_io_read_frame_t)(switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int)
struct switch_audio_codec_settings audio
switch_core_codec_video_decode_func_t decode_video
switch_loadable_module_interface_t * parent
Abstract interface to a dialplan module.
switch_status_t(* switch_say_callback_t)(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, switch_input_args_t *args)
switch_status_t(* switch_io_write_video_frame_t)(switch_core_session_t *, switch_frame_t *, switch_io_flag_t, int)
uint32_t switch_originate_flag_t
Definition: switch_types.h:325
struct switch_speech_interface * next
A table of functions that a timer module implements.
switch_video_encode_speed_t
switch_status_t(* switch_io_kill_channel_t)(switch_core_session_t *, int)
switch_asr_interface_t * asr_interface
A table of i/o routines that an endpoint interface can implement.
switch_status_t(* switch_io_receive_event_t)(switch_core_session_t *, switch_event_t *)
Abstract handler to a timer module.
switch_memory_pool_t * memory_pool
switch_video_profile_t vprofile
switch_status_t(* switch_core_codec_video_encode_func_t)(switch_codec_t *codec, switch_frame_t *frame)
switch_state_handler_t on_destroy
switch_thread_rwlock_t * rwlock
switch_status_t(* file_write_video)(switch_file_handle_t *, switch_frame_t *frame)
switch_audio_resampler_t * resampler
switch_state_handler_t on_reporting
Abstract interface to an asr module.
switch_thread_rwlock_t * rwlock
switch_core_session_t * session
switch_status_t(* switch_io_receive_message_t)(switch_core_session_t *, switch_core_session_message_t *)
A message object designed to allow unlike technologies to exchange data.
Definition: switch_core.h:177
switch_memory_pool_t * memory_pool
uint8_t switch_byte_t
Definition: switch_types.h:246
Abstract interface to a file format module.
switch_status_t(* speech_feed_tts)(switch_speech_handle_t *sh, char *text, switch_speech_flag_t *flags)
switch_thread_rwlock_t * rwlock
switch_loadable_module_interface_t * parent
switch_video_read_flag_t
struct switch_json_api_interface * next
switch_loadable_module_interface_t * parent
switch_thread_rwlock_t * rwlock
switch_status_t(* file_open)(switch_file_handle_t *, const char *file_path)
struct switch_timer_interface * next
switch_memory_pool_t * memory_pool
switch_status_t(* switch_io_write_frame_t)(switch_core_session_t *, switch_frame_t *, switch_io_flag_t, int)
switch_status_t(* asr_open)(switch_asr_handle_t *ah, const char *codec, int rate, const char *dest, switch_asr_flag_t *flags)
switch_state_handler_table_t * state_handler
switch_status_t(* file_close)(switch_file_handle_t *)
switch_status_t(* asr_pause)(switch_asr_handle_t *ah)
switch_thread_rwlock_t * rwlock
switch_status_t(* switch_core_codec_encode_func_t)(switch_codec_t *codec, switch_codec_t *other_codec, void *decoded_data, uint32_t decoded_data_len, uint32_t decoded_rate, void *encoded_data, uint32_t *encoded_data_len, uint32_t *encoded_rate, unsigned int *flag)
void(* switch_application_function_t)(switch_core_session_t *, const char *)
int64_t switch_time_t
Definition: switch_apr.h:188
const switch_codec_implementation_t * implementation
switch_state_handler_t on_routing
switch_status_t(* timer_next)(switch_timer_t *)
Abstract interface to a speech module.
switch_loadable_module_interface_t * parent
A module interface to implement an api function.
switch_loadable_module_interface_t * parent
switch_dialplan_hunt_function_t hunt_function
switch_core_codec_decode_func_t decode
switch_codec_interface_t * codec_interface
switch_loadable_module_interface_t * parent
switch_timer_interface_t * timer_interface
struct switch_dialplan_interface * next
Abstract interface to a say module.
switch_memory_pool_t * memory_pool
switch_status_t(* timer_init)(switch_timer_t *)
void(* asr_text_param)(switch_asr_handle_t *ah, char *param, const char *val)
Abstract interface to a management module.
switch_memory_pool_t * memory_pool
struct switch_api_interface * next
switch_status_t(* switch_state_handler_t)(switch_core_session_t *)
switch_status_t(* timer_sync)(switch_timer_t *)
switch_status_t(* asr_load_grammar)(switch_asr_handle_t *ah, const char *grammar, const char *name)
int(* usage)(const char *realm, const char *resource, uint32_t *rcount)
struct switch_mm_s switch_mm_t
switch_speech_interface_t * speech_interface
struct apr_thread_rwlock_t switch_thread_rwlock_t
Definition: switch_apr.h:436
switch_loadable_module_interface_t * parent
switch_state_handler_t on_hangup
Top level module interface to implement a series of codec implementations.
switch_buffer_t * pre_buffer
switch_status_t(* asr_get_result_headers)(switch_asr_handle_t *ah, switch_event_t **headers, switch_asr_flag_t *flags)
switch_status_t(* switch_core_codec_destroy_func_t)(switch_codec_t *)
switch_application_function_t application_function
switch_status_t(* switch_core_codec_init_func_t)(switch_codec_t *, switch_codec_flag_t, const switch_codec_settings_t *codec_settings)
switch_status_t(* asr_resume)(switch_asr_handle_t *ah)
switch_status_t(* file_set_string)(switch_file_handle_t *fh, switch_audio_col_t col, const char *string)
switch_status_t(* asr_enable_grammar)(switch_asr_handle_t *ah, const char *name)
An abstraction of a data frame.
Definition: switch_frame.h:43
uintptr_t switch_size_t
switch_status_t(* switch_core_codec_control_func_t)(switch_codec_t *codec, switch_codec_control_command_t cmd, switch_codec_control_type_t ctype, void *cmd_data, switch_codec_control_type_t atype, void *cmd_arg, switch_codec_control_type_t *rtype, void **ret_data)
struct switch_codec_interface * next
struct switch_chat_interface * next
uint32_t switch_asr_flag_t
switch_status_t(* directory_close)(switch_directory_handle_t *dh)
switch_stream_handle_read_function_t read_function
struct switch_codec * next
switch_status_t(* file_write)(switch_file_handle_t *, void *data, switch_size_t *len)
switch_io_state_change_t state_change
struct switch_chat_application_interface * next
switch_state_handler_t on_execute
struct apr_file_t switch_file_t
Definition: switch_apr.h:685
switch_status_t(* file_read)(switch_file_handle_t *, void *data, switch_size_t *len)
switch_status_t(* switch_core_codec_decode_func_t)(switch_codec_t *codec, switch_codec_t *other_codec, void *encoded_data, uint32_t encoded_data_len, uint32_t encoded_rate, void *decoded_data, uint32_t *decoded_data_len, uint32_t *decoded_rate, unsigned int *flag)
switch_payload_t agreed_pt
switch_call_cause_t
switch_thread_rwlock_t * rwlock
char frame_data[SWITCH_RECOMMENDED_BUFFER_SIZE]
switch_status_t(* switch_io_state_change_t)(switch_core_session_t *)
switch_buffer_t * audio_buffer
void(* speech_flush_tts)(switch_speech_handle_t *sh)
switch_video_encode_speed_t vencspd
switch_io_routine_name_t
switch_status_t(* file_read_video)(switch_file_handle_t *, switch_frame_t *frame, switch_video_read_flag_t flags)
An audio resampling handle.
switch_core_recover_callback_t recover_callback
switch_audio_resampler_t * resampler
switch_io_write_frame_t write_frame
switch_stream_handle_write_function_t write_function
switch_status_t(* asr_close)(switch_asr_handle_t *ah, switch_asr_flag_t *flags)
struct apr_thread_mutex_t switch_mutex_t
Definition: switch_apr.h:314
switch_status_t
Common return values.
switch_core_codec_fmtp_parse_func_t parse_fmtp
switch_state_handler_t on_hibernate
switch_status_t(* asr_feed_dtmf)(switch_asr_handle_t *ah, const switch_dtmf_t *dtmf, switch_asr_flag_t *flags)
switch_status_t(* directory_open)(switch_directory_handle_t *dh, char *source, char *dsn, char *passwd)
switch_buffer_t * sp_audio_buffer
switch_thread_rwlock_t * rwlock
switch_file_command_t
switch_status_t(* switch_io_send_dtmf_t)(switch_core_session_t *, const switch_dtmf_t *)
switch_status_t(* switch_json_api_function_t)(const cJSON *json, _In_opt_ switch_core_session_t *session, cJSON **json_reply)
switch_caller_extension_t *(* switch_dialplan_hunt_function_t)(switch_core_session_t *, void *, switch_caller_profile_t *)
switch_status_t(* directory_query)(switch_directory_handle_t *dh, char *base, char *query)
Main Library Header.
switch_status_t(* speech_close)(switch_speech_handle_t *, switch_speech_flag_t *flags)
switch_status_t(* asr_start_input_timers)(switch_asr_handle_t *ah)
switch_thread_rwlock_t * rwlock
switch_status_t(* speech_read_tts)(switch_speech_handle_t *sh, void *data, switch_size_t *datalen, switch_speech_flag_t *flags)
switch_status_t(* switch_io_read_video_frame_t)(switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int)
void(* speech_text_param_tts)(switch_speech_handle_t *sh, char *param, const char *val)
switch_status_t(* switch_stream_handle_raw_write_function_t)(switch_stream_handle_t *handle, uint8_t *data, switch_size_t datalen)
void(* speech_float_param_tts)(switch_speech_handle_t *sh, char *param, double val)
switch_status_t(* timer_check)(switch_timer_t *, switch_bool_t)
switch_memory_pool_t * memory_pool
switch_io_read_video_frame_t read_video_frame
switch_io_receive_message_t receive_message
switch_core_codec_init_func_t init
void(* asr_numeric_param)(switch_asr_handle_t *ah, char *param, int val)
switch_io_kill_channel_t kill_channel
switch_status_t(* asr_disable_grammar)(switch_asr_handle_t *ah, const char *name)
struct switch_say_interface * next
switch_io_outgoing_channel_t outgoing_channel
int(* switch_core_recover_callback_t)(switch_core_session_t *session)
switch_status_t(* file_get_string)(switch_file_handle_t *fh, switch_audio_col_t col, const char **string)
switch_status_t(* file_truncate)(switch_file_handle_t *, int64_t offset)
struct switch_codec_implementation * next
switch_core_codec_encode_func_t encode
switch_status_t(* timer_destroy)(switch_timer_t *)
switch_status_t(* speech_open)(switch_speech_handle_t *sh, const char *voice_name, int rate, int channels, switch_speech_flag_t *flags)
switch_thread_rwlock_t * rwlock
struct apr_pool_t switch_memory_pool_t
struct switch_application_interface * next
switch_status_t(* switch_stream_handle_write_function_t)(switch_stream_handle_t *handle, const char *fmt,...)
A table of settings and callbacks that define a paticular implementation of a codec.
switch_io_write_video_frame_t write_video_frame
A module interface to implement a json api function.
switch_loadable_module_interface_t * parent
switch_status_t(* timer_step)(switch_timer_t *)
switch_loadable_module_interface_t * parent
switch_mutex_t * mutex
struct switch_limit_interface * next
switch_loadable_module_interface_t * parent
switch_core_codec_video_encode_func_t encode_video
Audio Resample Code.
switch_status_t(* asr_get_results)(switch_asr_handle_t *ah, char **xmlstr, switch_asr_flag_t *flags)
switch_status_t(* management_function)(char *relative_oid, switch_management_action_t action, char *data, switch_size_t datalen)
switch_loadable_module_interface_t * parent
Media Frame Structure.
switch_status_t(* switch_core_codec_video_decode_func_t)(switch_codec_t *codec, switch_frame_t *frame)
switch_audio_resampler_t * resampler
switch_status_t(* asr_check_results)(switch_asr_handle_t *ah, switch_asr_flag_t *flags)
switch_status_t(* directory_next)(switch_directory_handle_t *dh)
struct switch_file_interface * next
switch_thread_rwlock_t * rwlock
void(* asr_float_param)(switch_asr_handle_t *ah, char *param, double val)
switch_timer_func_name_t
switch_thread_rwlock_t * rwlock
switch_status_t(* switch_core_codec_fmtp_parse_func_t)(const char *fmtp, switch_codec_fmtp_t *codec_fmtp)
switch_state_handler_t on_exchange_media
switch_management_action_t
Definition: switch_types.h:449
switch_status_t(* asr_feed)(switch_asr_handle_t *ah, void *data, unsigned int len, switch_asr_flag_t *flags)
The abstraction of a loadable module.
uint8_t switch_payload_t
switch_status_t(* asr_disable_all_grammars)(switch_asr_handle_t *ah)
A table of lists of io_event_hooks to store the event hooks associated with a session.
switch_core_codec_control_func_t codec_control
Abstract interface to a directory module.
struct switch_asr_interface * next
#define SWITCH_BEGIN_EXTERN_C
Definition: switch.h:42
switch_loadable_module_interface_t * parent
switch_media_type_t
switch_status_t(* file_seek)(switch_file_handle_t *, unsigned int *cur_pos, int64_t samples, int whence)