RTS API Documentation  1.10.11
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  * Andrey Volk <andywolk@gmail.com>
29  *
30  *
31  * switch_module_interfaces.h -- Module Interface Definitions
32  *
33  */
34 /*! \file switch_module_interfaces.h
35  \brief Module Interface Definitions
36 
37  This module holds the definition of data abstractions used to implement various pluggable
38  interfaces and pluggable event handlers.
39 
40 */
41 #ifndef SWITCH_MODULE_INTERFACES_H
42 #define SWITCH_MODULE_INTERFACES_H
43 
44 #include <switch.h>
45 #include "switch_resample.h"
46 
48 /*! \brief A table of functions to execute at various states
49  */
50  typedef enum {
64 
66  /*! executed when the state changes to init */
68  /*! executed when the state changes to routing */
70  /*! executed when the state changes to execute */
72  /*! executed when the state changes to hangup */
74  /*! executed when the state changes to exchange_media */
76  /*! executed when the state changes to soft_execute */
78  /*! executed when the state changes to consume_media */
80  /*! executed when the state changes to hibernate */
82  /*! executed when the state changes to reset */
84  /*! executed when the state changes to park */
86  /*! executed when the state changes to reporting */
88  /*! executed when the state changes to destroy */
90  int flags;
91  void *padding[10];
92 };
93 
98  void *data;
99  void *end;
105 };
106 
107 struct switch_io_event_hooks;
109 
113 typedef switch_status_t (*switch_io_read_frame_t) (switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int);
114 typedef switch_status_t (*switch_io_write_frame_t) (switch_core_session_t *, switch_frame_t *, switch_io_flag_t, int);
115 typedef switch_status_t (*switch_io_kill_channel_t) (switch_core_session_t *, int);
116 typedef switch_status_t (*switch_io_send_dtmf_t) (switch_core_session_t *, const switch_dtmf_t *);
118 typedef switch_status_t (*switch_io_receive_event_t) (switch_core_session_t *, switch_event_t *);
119 typedef switch_status_t (*switch_io_state_change_t) (switch_core_session_t *);
120 typedef switch_status_t (*switch_io_state_run_t) (switch_core_session_t *);
121 typedef switch_status_t (*switch_io_read_video_frame_t) (switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int);
122 typedef switch_status_t (*switch_io_write_video_frame_t) (switch_core_session_t *, switch_frame_t *, switch_io_flag_t, int);
123 typedef switch_status_t (*switch_io_read_text_frame_t) (switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int);
124 typedef switch_status_t (*switch_io_write_text_frame_t) (switch_core_session_t *, switch_frame_t *, switch_io_flag_t, int);
125 typedef switch_jb_t *(*switch_io_get_jb_t) (switch_core_session_t *, switch_media_type_t);
126 
127 typedef enum {
142 
143 /*! \brief A table of i/o routines that an endpoint interface can implement */
145  /*! creates an outgoing session from given session, caller profile */
147  /*! read a frame from a session */
149  /*! write a frame to a session */
151  /*! send a kill signal to the session's channel */
153  /*! send a string of DTMF digits to a session's channel */
155  /*! receive a message from another session */
157  /*! queue a message for another session */
159  /*! change a sessions channel state */
161  /*! read a video frame from a session */
163  /*! write a video frame to a session */
165  /*! read a video frame from a session */
167  /*! write a video frame to a session */
169  /*! change a sessions channel run state */
171  /*! get sessions jitterbuffer */
173  void *padding[10];
174 };
175 
176 /*! \brief Abstraction of an module endpoint interface
177  This is the glue between the abstract idea of a "channel" and what is really going on under the
178  hood. Each endpoint module fills out one of these tables and makes it available when a channel
179  is created of it's paticular type.
180 */
181 
183  /*! the interface's name */
184  const char *interface_name;
185 
186  /*! channel abstraction methods */
188 
189  /*! state machine methods */
191 
192  /*! private information */
194 
196  int refs;
198 
199  /* parent */
201 
202  /* to facilitate linking */
204 
206 
207 };
208 
209 /*! \brief Abstract handler to a timer module */
210 struct switch_timer {
211  /*! time interval expressed in milliseconds */
212  int interval;
213  /*! flags to control behaviour */
214  uint32_t flags;
215  /*! sample count to increment by on each cycle */
216  unsigned int samples;
217  /*! current sample count based on samples parameter */
218  uint32_t samplecount;
220  /*! the timer interface provided from a loadable module */
222  /*! the timer's memory pool */
223  switch_memory_pool_t *memory_pool;
224  /*! private data for loadable modules to store information */
226  /*! remaining time from last call to _check() */
229  uint64_t tick;
230 
231 };
232 
233 typedef enum {
241 
242 /*! \brief A table of functions that a timer module implements */
244  /*! the name of the interface */
245  const char *interface_name;
246  /*! function to allocate the timer */
248  /*! function to wait for one cycle to pass */
250  /*! function to step the timer one step */
252  /*! function to reset the timer */
254  /*! function to check if the current step has expired */
256  /*! function to deallocate the timer */
259  int refs;
263 };
264 
265 /*! \brief Abstract interface to a dialplan module */
267  /*! the name of the interface */
268  const char *interface_name;
269  /*! the function to read an extension and set a channels dialpan */
272  int refs;
276 };
277 
278 /*! \brief Abstract interface to a file format module */
280  /*! the name of the interface */
281  const char *interface_name;
282  /*! function to open the file */
283  switch_status_t (*file_open) (switch_file_handle_t *, const char *file_path);
284  /*! function to close the file */
286  /*! function to close the file */
287  switch_status_t (*file_truncate) (switch_file_handle_t *, int64_t offset);
288  /*! function to read from the file */
289  switch_status_t (*file_read) (switch_file_handle_t *, void *data, switch_size_t *len);
290  /*! function to write from the file */
291  switch_status_t (*file_write) (switch_file_handle_t *, void *data, switch_size_t *len);
292  /*! function to seek to a certian position in the file */
294  /*! function to write from the file */
295  switch_status_t (*file_write_video) (switch_file_handle_t *, switch_frame_t *frame);
296  /*! function to seek to a certian position in the file */
297  switch_status_t (*file_seek) (switch_file_handle_t *, unsigned int *cur_pos, int64_t samples, int whence);
298  /*! function to set meta data */
299  switch_status_t (*file_set_string) (switch_file_handle_t *fh, switch_audio_col_t col, const char *string);
300  /*! function to get meta data */
301  switch_status_t (*file_get_string) (switch_file_handle_t *fh, switch_audio_col_t col, const char **string);
302  /*! function to pre close the file to read params */
303  switch_status_t (*file_pre_close) (switch_file_handle_t *fh);
304  /*! function to control the underlying tech of the file */
306  /*! list of supported file extensions */
307  char **extens;
309  int refs;
313 };
314 
315 /*! an abstract representation of a file handle (some parameters based on compat with libsndfile) */
317  /*! the interface of the module that implemented the current file type */
319  /*! flags to control behaviour */
320  uint32_t flags;
321  /*! a file descriptor if neceessary */
323  /*! samples position of the handle */
324  unsigned int samples;
325  /*! the current samplerate */
326  uint32_t samplerate;
327  /*! the current native samplerate */
328  uint32_t native_rate;
329  /*! the number of channels */
330  uint32_t channels;
331  uint32_t real_channels;
332  /*! integer representation of the format */
333  unsigned int format;
334  /*! integer representation of the sections */
335  unsigned int sections;
336  /*! is the file seekable */
337  int seekable;
338  /*! the sample count of the file */
340  /*! the speed of the file playback */
341  int speed;
342  /*! the handle's memory pool */
343  switch_memory_pool_t *memory_pool;
344  /*! pre-buffer x bytes for streams */
345  uint32_t prebuf;
346  /*! private data for the format module to store handle specific info */
347  uint32_t interval;
349  char *handler;
350  int64_t pos;
353  uint32_t thresh;
354  uint32_t silence_hits;
355  uint32_t offset_pos;
358  int32_t vol;
359  int32_t volgranular;
365  unsigned char *pre_buffer_data;
367  const char *file;
368  const char *func;
369  int line;
370  char *file_path;
371  char *spool_path;
372  const char *prefix;
374  switch_event_t *params;
375  uint32_t cur_channels;
376  uint32_t cur_samplerate;
377  char *stream_name;
378  char *modname;
381  /*! total video duration, or total page in pdf*/
382  int64_t duration;
383  /*! current video position, or current page in pdf */
384  int64_t vpos;
385  void *muxbuf;
387 };
388 
389 /*! \brief Abstract interface to an asr module */
391  /*! the name of the interface */
392  const char *interface_name;
393  /*! function to open the asr interface */
394  switch_status_t (*asr_open) (switch_asr_handle_t *ah, const char *codec, int rate, const char *dest, switch_asr_flag_t *flags);
395  /*! function to load a grammar to the asr interface */
396  switch_status_t (*asr_load_grammar) (switch_asr_handle_t *ah, const char *grammar, const char *name);
397  /*! function to unload a grammar to the asr interface */
398  switch_status_t (*asr_unload_grammar) (switch_asr_handle_t *ah, const char *name);
399  /*! function to close the asr interface */
401  /*! function to feed audio to the ASR */
402  switch_status_t (*asr_feed) (switch_asr_handle_t *ah, void *data, unsigned int len, switch_asr_flag_t *flags);
403  /*! function to resume the ASR */
405  /*! function to pause the ASR */
407  /*! function to read results from the ASR */
409  /*! function to read results from the ASR */
410  switch_status_t (*asr_get_results) (switch_asr_handle_t *ah, char **xmlstr, switch_asr_flag_t *flags);
411  /*! function to read result headers from the ASR */
412  switch_status_t (*asr_get_result_headers) (switch_asr_handle_t *ah, switch_event_t **headers, switch_asr_flag_t *flags);
413  /*! function to start ASR input timers */
414  switch_status_t (*asr_start_input_timers) (switch_asr_handle_t *ah);
415  void (*asr_text_param) (switch_asr_handle_t *ah, char *param, const char *val);
416  void (*asr_numeric_param) (switch_asr_handle_t *ah, char *param, int val);
417  void (*asr_float_param) (switch_asr_handle_t *ah, char *param, double val);
419  int refs;
423  /*! function to enable a grammar to the asr interface */
425  /*! function to disable a grammar to the asr interface */
427  /*! function to disable all grammars to the asr interface */
429  /*! function to feed DTMF to the ASR */
431 };
432 
433 /*! an abstract representation of an asr speech interface. */
435  /*! the interface of the module that implemented the current speech interface */
437  /*! flags to control behaviour */
438  uint32_t flags;
439  /*! The Name */
440  char *name;
441  /*! The Codec */
442  char *codec;
443  /*! The Rate */
444  uint32_t rate;
445  char *grammar;
446  /*! module specific param */
447  char *param;
448  /*! the handle's memory pool */
449  switch_memory_pool_t *memory_pool;
454  /*! the current samplerate */
455  uint32_t samplerate;
456  /*! the current native samplerate */
457  uint32_t native_rate;
458  /*! private data for the format module to store handle specific info */
460 };
461 
462 /*! \brief Abstract interface to a speech module */
464  /*! the name of the interface */
465  const char *interface_name;
466  /*! function to open the speech interface */
467  switch_status_t (*speech_open) (switch_speech_handle_t *sh, const char *voice_name, int rate, int channels, switch_speech_flag_t *flags);
468  /*! function to close the speech interface */
470  /*! function to feed audio to the ASR */
471  switch_status_t (*speech_feed_tts) (switch_speech_handle_t *sh, char *text, switch_speech_flag_t *flags);
472  /*! function to read audio from the TTS */
473  switch_status_t (*speech_read_tts) (switch_speech_handle_t *sh, void *data, switch_size_t *datalen, switch_speech_flag_t *flags);
474  void (*speech_flush_tts) (switch_speech_handle_t *sh);
475  void (*speech_text_param_tts) (switch_speech_handle_t *sh, char *param, const char *val);
476  void (*speech_numeric_param_tts) (switch_speech_handle_t *sh, char *param, int val);
477  void (*speech_float_param_tts) (switch_speech_handle_t *sh, char *param, double val);
479  int refs;
483 };
484 
485 
486 /*! an abstract representation of a tts speech interface. */
488  /*! the interface of the module that implemented the current speech interface */
490  /*! flags to control behaviour */
491  uint32_t flags;
492  /*! The Name */
493  char *name;
494  /*! The Rate */
495  uint32_t rate;
496  uint32_t speed;
497  uint32_t samples;
498  uint32_t channels;
499  uint32_t real_channels;
500  char voice[80];
501  char *engine;
502  /*! module specific param */
503  char *param;
504  /*! the handle's memory pool */
505  switch_memory_pool_t *memory_pool;
510  /*! the current samplerate */
511  uint32_t samplerate;
512  /*! the current native samplerate */
513  uint32_t native_rate;
514  /*! the number of channels */
515 
516  /*! private data for the format module to store handle specific info */
518 };
519 
520 /*! \brief Abstract interface to a say module */
522  /*! the name of the interface */
523  const char *interface_name;
524  /*! function to pass down to the module */
528  int refs;
532 };
533 
534 /*! \brief Abstract interface to a chat module */
536  /*! the name of the interface */
537  const char *interface_name;
538  /*! function to open the directory interface */
539  switch_status_t (*chat_send) (switch_event_t *message_event);
540 
542  int refs;
546 };
547 
548 /*! \brief Abstract interface to a management module */
550  /*! the name of the interface */
551  const char *relative_oid;
552  /*! function to open the directory interface */
553  switch_status_t (*management_function) (char *relative_oid, switch_management_action_t action, char *data, switch_size_t datalen);
555  int refs;
559 };
560 
561 /*! \brief Abstract interface to a limit module */
563  /*! name of the interface */
564  const char *interface_name;
565  /*! increment */
566  switch_status_t (*incr) (switch_core_session_t *session, const char *realm, const char *resource, const int max, const int interval);
567  /*! release */
568  switch_status_t (*release) (switch_core_session_t *session, const char *realm, const char *resource);
569  /*! usage for resource */
570  int (*usage) (const char *realm, const char *resource, uint32_t *rcount);
571  /*! reset counters */
572  switch_status_t (*reset) (void);
573  /*! freform status */
574  char * (*status) (void);
575  /*! reset interval counter */
576  switch_status_t (*interval_reset) (const char *realm, const char *resource);
577  /* internal */
579  int refs;
583 };
584 
585 /*! \brief Abstract interface to a directory module */
587  /*! the name of the interface */
588  const char *interface_name;
589  /*! function to open the directory interface */
590  switch_status_t (*directory_open) (switch_directory_handle_t *dh, char *source, char *dsn, char *passwd);
591  /*! function to close the directory interface */
592  switch_status_t (*directory_close) (switch_directory_handle_t *dh);
593  /*! function to query the directory interface */
594  switch_status_t (*directory_query) (switch_directory_handle_t *dh, char *base, char *query);
595  /*! function to advance to the next record */
597  /*! function to advance to the next name/value pair in the current record */
598  switch_status_t (*directory_next_pair) (switch_directory_handle_t *dh, char **var, char **val);
600  int refs;
604 };
605 
606 /*! an abstract representation of a directory interface. */
608  /*! the interface of the module that implemented the current directory interface */
610  /*! flags to control behaviour */
611  uint32_t flags;
612 
613  /*! the handle's memory pool */
614  switch_memory_pool_t *memory_pool;
615  /*! private data for the format module to store handle specific info */
617 };
618 
619 /*! \brief Abstract interface to a database module */
621  /*! the name of the interface */
622  const char *interface_name;
623  /*! flags indicating database specifics, see switch_database_flag_t */
624  uint32_t flags;
628  switch_status_t(*exec_detailed)(const char *file, const char *func, int line,
629  switch_database_interface_handle_t *dih, const char *sql, char **err);
630  switch_status_t(*exec_string)(switch_database_interface_handle_t *dih, const char *sql, char *resbuf, size_t len, char **err);
634  switch_status_t(*callback_exec_detailed)(const char *file, const char *func, int line,
635  switch_database_interface_handle_t *dih, const char *sql, switch_core_db_callback_func_t callback, void *pdata, char **err);
637 
638  /*! list of supported dsn prefixes */
639  char **prefixes;
641  int refs;
645 };
646 
647 /*! an abstract representation of a database interface. */
650  void *handle;
651 };
652 
654  int unused;
655 };
656 
658  uint32_t bandwidth;
659  int32_t width;
660  int32_t height;
662  uint8_t fps;
663  char config_profile_name[64];
664 };
665 
669 };
670 
671 /*! an abstract handle of a fmtp parsed by codec */
673  /*! actual samples transferred per second for those who are not moron g722 RFC writers */
675  /*! bits transferred per second */
677  /*! number of microseconds of media in one packet (ptime * 1000) */
679  /*! maximum ptime in ms */
681  /*! minimum ptime in ms */
683  /*! stereo, typically bidirectional */
684  int stereo;
685  /* sender properties (stereo) */
687  /*! private data for the codec module to store handle specific info */
689 
690 };
691 
693  uint32_t width; /* the picture width */
694  uint32_t height; /* the picture height */
695  uint8_t *planes[4]; /* pointer to the top left pixel for each plane */
696  uint32_t stride[4]; /* stride between rows for each plane */
697 };
698 
699 /*! an abstract handle to a codec module */
700 struct switch_codec {
701  /*! the codec interface table this handle uses */
703  /*! the specific implementation of the above codec */
705  /*! fmtp line from remote sdp */
706  char *fmtp_in;
707  /*! fmtp line for local sdp */
708  char *fmtp_out;
709  /*! flags to modify behaviour */
710  uint32_t flags;
711  /*! the handle's memory pool */
712  switch_memory_pool_t *memory_pool;
713  /*! private data for the codec module to store handle specific info */
718  switch_core_session_t *session;
720 };
721 
722 /*! \brief A table of settings and callbacks that define a paticular implementation of a codec */
724  /*! enumeration defining the type of the codec */
726  /*! the IANA code number */
728  /*! the IANA code name */
729  char *iananame;
730  /*! default fmtp to send (can be overridden by the init function) */
731  char *fmtp;
732  /*! samples transferred per second */
734  /*! actual samples transferred per second for those who are not moron g722 RFC writers */
736  /*! bits transferred per second */
738  /*! number of microseconds of media in one packet (ptime * 1000) */
740  /*! number of samples in one packet */
742  /*! number of bytes one packet will decompress to */
744  /*! number of encoded bytes in the RTP payload */
746  /*! number of channels represented */
748  /*! number of codec frames packetized into one packet */
750  /*! function to initialize a codec handle using this implementation */
752  /*! function to encode raw data into encoded data */
754  /*! function to decode encoded data into raw data */
756  /*! function to encode video raw data into encoded data */
758  /*! function to decode video encoded data into raw data */
760  /*! function to send control messages to the codec */
762  /*! deinitalize a codec handle using this implementation */
764  uint32_t codec_id;
765  uint32_t impl_id;
766  char *modname;
768 };
769 
770 /*! \brief Top level module interface to implement a series of codec implementations */
772  /*! the name of the interface */
773  const char *interface_name;
774  /*! a list of codec implementations related to the codec */
776  /*! function to decode a codec fmtp parameters */
778  uint32_t codec_id;
780  int refs;
782  char *modname;
785 };
786 
787 /*! \brief A module interface to implement an application */
789  /*! the name of the interface */
790  const char *interface_name;
791  /*! function the application implements */
793  /*! the long winded description of the application */
794  const char *long_desc;
795  /*! the short and sweet description of the application */
796  const char *short_desc;
797  /*! an example of the application syntax */
798  const char *syntax;
799  /*! flags to control behaviour */
800  uint32_t flags;
802  int refs;
806 };
807 
808 /*! \brief A module interface to implement a chat application */
810  /*! the name of the interface */
811  const char *interface_name;
812  /*! function the application implements */
814  /*! the long winded description of the application */
815  const char *long_desc;
816  /*! the short and sweet description of the application */
817  const char *short_desc;
818  /*! an example of the application syntax */
819  const char *syntax;
820  /*! flags to control behaviour */
821  uint32_t flags;
823  int refs;
827 };
828 
829 /*! \brief A module interface to implement an api function */
831  /*! the name of the interface */
832  const char *interface_name;
833  /*! a description of the api function */
834  const char *desc;
835  /*! function the api call uses */
837  /*! an example of the api syntax */
838  const char *syntax;
840  int refs;
844 };
845 
846 
847 /*! \brief A module interface to implement a json api function */
849  /*! the name of the interface */
850  const char *interface_name;
851  /*! a description of the api function */
852  const char *desc;
853  /*! function the api call uses */
855  /*! an example of the api syntax */
856  const char *syntax;
858  int refs;
862 };
863 
864 #define PROTECT_INTERFACE(_it) if (_it) {switch_thread_rwlock_rdlock(_it->parent->rwlock); switch_thread_rwlock_rdlock(_it->rwlock); switch_mutex_lock(_it->reflock); _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);
865 #define UNPROTECT_INTERFACE(_it) if (_it) {switch_mutex_lock(_it->reflock); _it->refs--; _it->parent->refs--; switch_mutex_unlock(_it->reflock); switch_thread_rwlock_unlock(_it->rwlock); switch_thread_rwlock_unlock(_it->parent->rwlock);} //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);
866 
867 #include "switch_frame.h"
868 
870  switch_core_session_t *session;
874 };
875 
877 #endif
878 /* For Emacs:
879  * Local Variables:
880  * mode:c
881  * indent-tabs-mode:t
882  * tab-width:4
883  * c-basic-offset:4
884  * End:
885  * For VIM:
886  * vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet:
887  */
struct switch_database_interface * next
switch_core_session_t * session
switch_state_handler_t on_consume_media
static switch_status_t timer_sync(switch_timer_t *timer)
Definition: switch_time.c:810
switch_status_t(* switch_io_read_frame_t)(switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int)
A module interface to implement an application.
static switch_status_t timer_init(switch_timer_t *timer)
Definition: switch_time.c:699
static switch_status_t timer_step(switch_timer_t *timer)
Definition: switch_time.c:775
switch_state_handler_t on_soft_execute
struct switch_directory_interface * next
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_thread_rwlock_t * rwlock
switch_say_callback_t say_function
switch_core_codec_destroy_func_t destroy
switch_status_t(* switch_io_write_frame_t)(switch_core_session_t *, switch_frame_t *, switch_io_flag_t, int)
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_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
#define SWITCH_END_EXTERN_C
Definition: switch.h:43
switch_thread_rwlock_t * rwlock
switch_caller_extension_t *(* switch_dialplan_hunt_function_t)(switch_core_session_t *, void *, switch_caller_profile_t *)
switch_io_read_frame_t read_frame
uint32_t switch_speech_flag_t
#define SWITCH_RECOMMENDED_BUFFER_SIZE
Definition: switch_types.h:590
switch_bool_t
Definition: switch_types.h:437
switch_audio_col_t
Definition: switch_types.h:613
switch_loadable_module_interface_t * parent
switch_chat_application_function_t chat_application_function
switch_status_t(* switch_io_receive_message_t)(switch_core_session_t *, switch_core_session_message_t *)
switch_status_t(* asr_disable_grammar)(switch_asr_handle_t *ah, const char *name)
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_loadable_module_interface_t * parent
A module interface to implement a chat application.
switch_codec_implementation_t * implementations
switch_frame_t * cur_frame
switch_say_string_callback_t say_string_function
switch_io_routines_t * io_routines
switch_loadable_module_interface_t * parent
switch_status_t(* switch_io_write_video_frame_t)(switch_core_session_t *, switch_frame_t *, switch_io_flag_t, int)
struct switch_endpoint_interface * next
switch_status_t(* switch_stream_handle_raw_write_function_t)(switch_stream_handle_t *handle, uint8_t *data, switch_size_t datalen)
switch_io_receive_event_t receive_event
switch_status_t(* switch_core_codec_fmtp_parse_func_t)(const char *fmtp, switch_codec_fmtp_t *codec_fmtp)
switch_status_t(* asr_enable_grammar)(switch_asr_handle_t *ah, const char *name)
Abstract interface to a chat module.
switch_cache_db_database_interface_options_t connection_options
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_core_codec_init_func_t)(switch_codec_t *, switch_codec_flag_t, const switch_codec_settings_t *codec_settings)
uint32_t switch_originate_flag_t
Definition: switch_types.h:335
struct switch_speech_interface * next
A table of functions that a timer module implements.
switch_asr_interface_t * asr_interface
A table of i/o routines that an endpoint interface can implement.
Abstract handler to a timer module.
switch_memory_pool_t * memory_pool
switch_state_handler_t on_destroy
switch_thread_rwlock_t * rwlock
switch_audio_resampler_t * resampler
switch_status_t(* switch_io_write_text_frame_t)(switch_core_session_t *, switch_frame_t *, switch_io_flag_t, int)
switch_io_read_text_frame_t read_text_frame
switch_state_handler_t on_reporting
Abstract interface to an asr module.
switch_thread_rwlock_t * rwlock
switch_status_t(* switch_json_api_function_t)(const cJSON *json, _In_opt_ switch_core_session_t *session, cJSON **json_reply)
switch_core_session_t * session
A message object designed to allow unlike technologies to exchange data.
Definition: switch_core.h:179
switch_memory_pool_t * memory_pool
uint8_t switch_byte_t
Definition: switch_types.h:256
Abstract interface to a file format module.
static switch_status_t timer_destroy(switch_timer_t *timer)
Definition: switch_time.c:944
switch_thread_rwlock_t * rwlock
switch_loadable_module_interface_t * parent
switch_status_t(* switch_chat_application_function_t)(switch_event_t *, const char *)
static switch_status_t timer_next(switch_timer_t *timer)
Definition: switch_time.c:840
switch_video_read_flag_t
struct switch_json_api_interface * next
void(* switch_application_function_t)(switch_core_session_t *, const char *)
switch_loadable_module_interface_t * parent
switch_thread_rwlock_t * rwlock
struct switch_timer_interface * next
switch_memory_pool_t * memory_pool
switch_status_t(* switch_stream_handle_write_function_t)(switch_stream_handle_t *handle, const char *fmt,...)
switch_state_handler_table_t * state_handler
static const char usage[]
Definition: switch.c:419
switch_thread_rwlock_t * rwlock
int64_t switch_time_t
Definition: switch_apr.h:188
const switch_codec_implementation_t * implementation
switch_state_handler_t on_routing
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
switch_status_t(* switch_core_codec_video_decode_func_t)(switch_codec_t *codec, switch_frame_t *frame)
const char *const string
Definition: switch_cJSON.h:162
Abstract interface to a say module.
switch_memory_pool_t * memory_pool
Abstract interface to a management module.
switch_status_t(* asr_feed_dtmf)(switch_asr_handle_t *ah, const switch_dtmf_t *dtmf, switch_asr_flag_t *flags)
switch_memory_pool_t * memory_pool
switch_status_t(* switch_state_handler_t)(switch_core_session_t *)
uint8_t *(* switch_stream_handle_read_function_t)(switch_stream_handle_t *handle, int *len)
struct switch_api_interface * next
switch_status_t(* switch_say_string_callback_t)(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, char **rstr)
switch_speech_interface_t * speech_interface
switch_status_t(* affected_rows)(switch_database_interface_handle_t *dih, int *affected_rows)
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_application_function_t application_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 *)
An abstraction of a data frame.
Definition: switch_frame.h:54
uintptr_t switch_size_t
struct switch_codec_interface * next
struct switch_chat_interface * next
uint32_t switch_asr_flag_t
switch_stream_handle_read_function_t read_function
struct switch_codec * next
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(* asr_disable_all_grammars)(switch_asr_handle_t *ah)
switch_io_state_change_t state_change
struct switch_chat_application_interface * next
int(* switch_core_db_callback_func_t)(void *pArg, int argc, char **argv, char **columnNames)
switch_state_handler_t on_execute
switch_payload_t agreed_pt
switch_call_cause_t
switch_thread_rwlock_t * rwlock
switch_buffer_t * audio_buffer
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)
static switch_status_t timer_check(switch_timer_t *timer, switch_bool_t step)
Definition: switch_time.c:903
struct fspr_thread_mutex_t switch_mutex_t
Definition: switch_apr.h:314
switch_io_routine_name_t
switch_status_t(* switch_core_codec_video_encode_func_t)(switch_codec_t *codec, switch_frame_t *frame)
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
Common return values.
switch_status_t(* switch_io_read_video_frame_t)(switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int)
switch_core_codec_fmtp_parse_func_t parse_fmtp
switch_jb_t *(* switch_io_get_jb_t)(switch_core_session_t *, switch_media_type_t)
switch_state_handler_t on_hibernate
switch_buffer_t * sp_audio_buffer
switch_thread_rwlock_t * rwlock
switch_file_command_t
Main Library Header.
switch_thread_rwlock_t * rwlock
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)
int(* switch_core_recover_callback_t)(switch_core_session_t *session)
switch_status_t(* switch_io_state_run_t)(switch_core_session_t *)
switch_memory_pool_t * memory_pool
struct fspr_file_t switch_file_t
Definition: switch_apr.h:685
switch_io_read_video_frame_t read_video_frame
switch_io_receive_message_t receive_message
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_core_codec_init_func_t init
switch_io_kill_channel_t kill_channel
struct switch_say_interface * next
switch_thread_rwlock_t * rwlock
switch_io_outgoing_channel_t outgoing_channel
struct switch_codec_implementation * next
switch_core_codec_encode_func_t encode
switch_thread_rwlock_t * rwlock
struct switch_application_interface * next
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_loadable_module_interface_t * parent
switch_mutex_t * mutex
struct switch_limit_interface * next
struct fspr_pool_t switch_memory_pool_t
const char *const name
Definition: switch_cJSON.h:250
switch_loadable_module_interface_t * parent
switch_core_codec_video_encode_func_t encode_video
switch_status_t(* switch_io_kill_channel_t)(switch_core_session_t *, int)
switch_status_t(* switch_io_receive_event_t)(switch_core_session_t *, switch_event_t *)
Audio Resample Code.
switch_loadable_module_interface_t * parent
switch_status_t(* switch_io_send_dtmf_t)(switch_core_session_t *, const switch_dtmf_t *)
Media Frame Structure.
switch_audio_resampler_t * resampler
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)
struct fspr_thread_rwlock_t switch_thread_rwlock_t
Definition: switch_apr.h:436
struct switch_file_interface * next
Abstract interface to a database module.
switch_thread_rwlock_t * rwlock
switch_timer_func_name_t
switch_thread_rwlock_t * rwlock
switch_state_handler_t on_exchange_media
switch_status_t(* switch_io_read_text_frame_t)(switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int)
switch_status_t(* switch_io_state_change_t)(switch_core_session_t *)
switch_management_action_t
Definition: switch_types.h:481
The abstraction of a loadable module.
uint8_t switch_payload_t
switch_io_write_text_frame_t write_text_frame
A table of lists of io_event_hooks to store the event hooks associated with a session.
switch_loadable_module_interface_t * parent
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(* switch_core_codec_destroy_func_t)(switch_codec_t *)