mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 12:42:02 +00:00
spring cleaning
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4795 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -90,7 +90,9 @@
|
||||
#include <switch_stun.h>
|
||||
#include <switch_log.h>
|
||||
#include <switch_xml.h>
|
||||
|
||||
#include <switch_core_event_hook.h>
|
||||
#include <switch_scheduler.h>
|
||||
#include <libteletone.h>
|
||||
|
||||
/** \mainpage FreeSWITCH
|
||||
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||
|
||||
+111
-116
@@ -40,25 +40,22 @@
|
||||
#define SWITCH_APR_H
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
/*
|
||||
The pieces of apr we allow ppl to pass around between modules we typedef into our namespace and wrap all the functions
|
||||
any other apr code should be as hidden as possible.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup switch_apr Brought To You By APR
|
||||
* @ingroup FREESWITCH
|
||||
* @{
|
||||
*/
|
||||
|
||||
*/
|
||||
/**
|
||||
* @defgroup switch_memory_pool Memory Pool Functions
|
||||
* @ingroup switch_apr
|
||||
* @{
|
||||
*/
|
||||
/** The fundamental pool type */
|
||||
typedef struct apr_pool_t switch_memory_pool_t;
|
||||
typedef struct apr_pool_t switch_memory_pool_t;
|
||||
|
||||
|
||||
/**
|
||||
@@ -81,12 +78,12 @@ SWITCH_DECLARE(void) switch_pool_clear(switch_memory_pool_t *p);
|
||||
/**
|
||||
* Structure for referencing dynamic objects
|
||||
*/
|
||||
typedef struct apr_dso_handle_t switch_dso_handle_t;
|
||||
typedef struct apr_dso_handle_t switch_dso_handle_t;
|
||||
|
||||
/**
|
||||
* Structure for referencing symbols from dynamic objects
|
||||
*/
|
||||
typedef void * switch_dso_handle_sym_t;
|
||||
typedef void *switch_dso_handle_sym_t;
|
||||
|
||||
/**
|
||||
* Load a DSO library.
|
||||
@@ -96,8 +93,8 @@ typedef void * switch_dso_handle_sym_t;
|
||||
* @bug We aught to provide an alternative to RTLD_GLOBAL, which
|
||||
* is the only supported method of loading DSOs today.
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_dso_load(switch_dso_handle_t **res_handle,
|
||||
const char *path, switch_memory_pool_t *ctx);
|
||||
SWITCH_DECLARE(switch_status_t) switch_dso_load(switch_dso_handle_t **res_handle,
|
||||
const char *path, switch_memory_pool_t *ctx);
|
||||
|
||||
/**
|
||||
* Close a DSO library.
|
||||
@@ -111,9 +108,8 @@ SWITCH_DECLARE(switch_status_t) switch_dso_unload(switch_dso_handle_t *handle);
|
||||
* @param handle handle to load the symbol from.
|
||||
* @param symname Name of the symbol to load.
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_dso_sym(switch_dso_handle_sym_t *ressym,
|
||||
switch_dso_handle_t *handle,
|
||||
const char *symname);
|
||||
SWITCH_DECLARE(switch_status_t) switch_dso_sym(switch_dso_handle_sym_t * ressym,
|
||||
switch_dso_handle_t *handle, const char *symname);
|
||||
|
||||
/**
|
||||
* Report more information when a DSO function fails.
|
||||
@@ -146,10 +142,10 @@ SWITCH_DECLARE(char *) switch_copy_string(char *dst, const char *src, switch_siz
|
||||
*/
|
||||
|
||||
/** Abstract type for hash tables. */
|
||||
typedef struct apr_hash_t switch_hash_t;
|
||||
typedef struct apr_hash_t switch_hash_t;
|
||||
|
||||
/** Abstract type for scanning hash tables. */
|
||||
typedef struct apr_hash_index_t switch_hash_index_t;
|
||||
typedef struct apr_hash_index_t switch_hash_index_t;
|
||||
|
||||
/**
|
||||
* When passing a key to switch_hashfunc_default, this value can be
|
||||
@@ -208,40 +204,40 @@ SWITCH_DECLARE(switch_memory_pool_t *) switch_hash_pool_get(switch_hash_t *ht);
|
||||
*/
|
||||
|
||||
/** number of microseconds since 00:00:00 january 1, 1970 UTC */
|
||||
typedef int64_t switch_time_t;
|
||||
typedef int64_t switch_time_t;
|
||||
|
||||
/** number of microseconds in the interval */
|
||||
typedef int64_t switch_interval_time_t;
|
||||
typedef int64_t switch_interval_time_t;
|
||||
|
||||
/**
|
||||
* a structure similar to ANSI struct tm with the following differences:
|
||||
* - tm_usec isn't an ANSI field
|
||||
* - tm_gmtoff isn't an ANSI field (it's a bsdism)
|
||||
*/
|
||||
typedef struct switch_time_exp_t {
|
||||
/** microseconds past tm_sec */
|
||||
int32_t tm_usec;
|
||||
/** (0-61) seconds past tm_min */
|
||||
int32_t tm_sec;
|
||||
/** (0-59) minutes past tm_hour */
|
||||
int32_t tm_min;
|
||||
/** (0-23) hours past midnight */
|
||||
int32_t tm_hour;
|
||||
/** (1-31) day of the month */
|
||||
int32_t tm_mday;
|
||||
/** (0-11) month of the year */
|
||||
int32_t tm_mon;
|
||||
/** year since 1900 */
|
||||
int32_t tm_year;
|
||||
/** (0-6) days since sunday */
|
||||
int32_t tm_wday;
|
||||
/** (0-365) days since jan 1 */
|
||||
int32_t tm_yday;
|
||||
/** daylight saving time */
|
||||
int32_t tm_isdst;
|
||||
/** seconds east of UTC */
|
||||
int32_t tm_gmtoff;
|
||||
} switch_time_exp_t;
|
||||
typedef struct switch_time_exp_t {
|
||||
/** microseconds past tm_sec */
|
||||
int32_t tm_usec;
|
||||
/** (0-61) seconds past tm_min */
|
||||
int32_t tm_sec;
|
||||
/** (0-59) minutes past tm_hour */
|
||||
int32_t tm_min;
|
||||
/** (0-23) hours past midnight */
|
||||
int32_t tm_hour;
|
||||
/** (1-31) day of the month */
|
||||
int32_t tm_mday;
|
||||
/** (0-11) month of the year */
|
||||
int32_t tm_mon;
|
||||
/** year since 1900 */
|
||||
int32_t tm_year;
|
||||
/** (0-6) days since sunday */
|
||||
int32_t tm_wday;
|
||||
/** (0-365) days since jan 1 */
|
||||
int32_t tm_yday;
|
||||
/** daylight saving time */
|
||||
int32_t tm_isdst;
|
||||
/** seconds east of UTC */
|
||||
int32_t tm_gmtoff;
|
||||
} switch_time_exp_t;
|
||||
|
||||
SWITCH_DECLARE(switch_time_t) switch_time_make(switch_time_t sec, int32_t usec);
|
||||
|
||||
@@ -268,9 +264,7 @@ SWITCH_DECLARE(switch_status_t) switch_time_exp_gmt_get(switch_time_t *result, s
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_strftime(char *s,
|
||||
switch_size_t *retsize,
|
||||
switch_size_t max,
|
||||
const char *format,
|
||||
switch_time_exp_t *tm);
|
||||
switch_size_t max, const char *format, switch_time_exp_t *tm);
|
||||
|
||||
/**
|
||||
* switch_rfc822_date formats dates in the RFC822
|
||||
@@ -320,7 +314,7 @@ SWITCH_DECLARE(void) switch_sleep(switch_interval_time_t t);
|
||||
*/
|
||||
|
||||
/** Opaque thread-local mutex structure */
|
||||
typedef struct apr_thread_mutex_t switch_mutex_t;
|
||||
typedef struct apr_thread_mutex_t switch_mutex_t;
|
||||
|
||||
/** Lock Flags */
|
||||
#define SWITCH_MUTEX_DEFAULT 0x0 /**< platform-optimal lock behavior */
|
||||
@@ -344,8 +338,7 @@ typedef struct apr_thread_mutex_t switch_mutex_t;
|
||||
*
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_mutex_init(switch_mutex_t **lock,
|
||||
unsigned int flags,
|
||||
switch_memory_pool_t *pool);
|
||||
unsigned int flags, switch_memory_pool_t *pool);
|
||||
|
||||
|
||||
/**
|
||||
@@ -385,10 +378,10 @@ SWITCH_DECLARE(switch_status_t) switch_mutex_trylock(switch_mutex_t *lock);
|
||||
*/
|
||||
|
||||
/** Opaque structure used for the rwlock */
|
||||
typedef struct apr_thread_rwlock_t switch_thread_rwlock_t;
|
||||
typedef struct apr_thread_rwlock_t switch_thread_rwlock_t;
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_thread_rwlock_create(switch_thread_rwlock_t **rwlock,
|
||||
switch_memory_pool_t *pool);
|
||||
switch_memory_pool_t *pool);
|
||||
SWITCH_DECLARE(switch_status_t) switch_thread_rwlock_destroy(switch_thread_rwlock_t *rwlock);
|
||||
SWITCH_DECLARE(switch_memory_pool_t *) switch_thread_rwlock_pool_get(switch_thread_rwlock_t *rwlock);
|
||||
SWITCH_DECLARE(switch_status_t) switch_thread_rwlock_rdlock(switch_thread_rwlock_t *rwlock);
|
||||
@@ -412,7 +405,7 @@ SWITCH_DECLARE(switch_status_t) switch_thread_rwlock_unlock(switch_thread_rwlock
|
||||
*/
|
||||
|
||||
/** Opaque structure for thread condition variables */
|
||||
typedef struct apr_thread_cond_t switch_thread_cond_t;
|
||||
typedef struct apr_thread_cond_t switch_thread_cond_t;
|
||||
|
||||
/**
|
||||
* Create and initialize a condition variable that can be used to signal
|
||||
@@ -453,7 +446,8 @@ SWITCH_DECLARE(switch_status_t) switch_thread_cond_wait(switch_thread_cond_t *co
|
||||
* will wake up before this time, otherwise the error APR_TIMEUP
|
||||
* is returned.
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_thread_cond_timedwait(switch_thread_cond_t *cond, switch_mutex_t *mutex, switch_interval_time_t timeout);
|
||||
SWITCH_DECLARE(switch_status_t) switch_thread_cond_timedwait(switch_thread_cond_t *cond, switch_mutex_t *mutex,
|
||||
switch_interval_time_t timeout);
|
||||
|
||||
/**
|
||||
* Signals a single thread, if one exists, that is blocking on the given
|
||||
@@ -488,9 +482,10 @@ SWITCH_DECLARE(switch_status_t) switch_thread_cond_destroy(switch_thread_cond_t
|
||||
|
||||
/** we represent a UUID as a block of 16 bytes. */
|
||||
|
||||
typedef struct {
|
||||
unsigned char data[16]; /**< the actual UUID */
|
||||
} switch_uuid_t;
|
||||
typedef struct {
|
||||
unsigned char data[16];
|
||||
/**< the actual UUID */
|
||||
} switch_uuid_t;
|
||||
|
||||
/** UUIDs are formatted as: 00112233-4455-6677-8899-AABBCCDDEEFF */
|
||||
#define SWITCH_UUID_FORMATTED_LENGTH 36
|
||||
@@ -501,20 +496,20 @@ typedef struct {
|
||||
* be at least APR_UUID_FORMATTED_LENGTH + 1 bytes long to hold
|
||||
* the formatted UUID and a null terminator
|
||||
* @param uuid The UUID to format
|
||||
*/
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_uuid_format(char *buffer, const switch_uuid_t *uuid);
|
||||
|
||||
/**
|
||||
* Generate and return a (new) UUID
|
||||
* @param uuid The resulting UUID
|
||||
*/
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_uuid_get(switch_uuid_t *uuid);
|
||||
|
||||
/**
|
||||
* Parse a standard-format string into a UUID
|
||||
* @param uuid The resulting UUID
|
||||
* @param uuid_str The formatted UUID
|
||||
*/
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_uuid_parse(switch_uuid_t *uuid, const char *uuid_str);
|
||||
|
||||
/** @} */
|
||||
@@ -526,7 +521,7 @@ SWITCH_DECLARE(switch_status_t) switch_uuid_parse(switch_uuid_t *uuid, const cha
|
||||
*/
|
||||
|
||||
/** Opaque structure used for queue API */
|
||||
typedef struct apr_queue_t switch_queue_t;
|
||||
typedef struct apr_queue_t switch_queue_t;
|
||||
|
||||
/**
|
||||
* create a FIFO queue
|
||||
@@ -534,9 +529,8 @@ typedef struct apr_queue_t switch_queue_t;
|
||||
* @param queue_capacity maximum size of the queue
|
||||
* @param a pool to allocate queue from
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_queue_create(switch_queue_t **queue,
|
||||
unsigned int queue_capacity,
|
||||
switch_memory_pool_t *pool);
|
||||
SWITCH_DECLARE(switch_status_t) switch_queue_create(switch_queue_t **queue,
|
||||
unsigned int queue_capacity, switch_memory_pool_t *pool);
|
||||
|
||||
/**
|
||||
* pop/get an object from the queue, blocking if the queue is already empty
|
||||
@@ -603,17 +597,17 @@ SWITCH_DECLARE(switch_status_t) switch_queue_trypush(switch_queue_t *queue, void
|
||||
*/
|
||||
|
||||
/** Structure for referencing files. */
|
||||
typedef struct apr_file_t switch_file_t;
|
||||
typedef struct apr_file_t switch_file_t;
|
||||
|
||||
typedef int32_t switch_fileperms_t;
|
||||
typedef int switch_seek_where_t;
|
||||
typedef int32_t switch_fileperms_t;
|
||||
typedef int switch_seek_where_t;
|
||||
|
||||
/**
|
||||
* @defgroup switch_file_permissions File Permissions flags
|
||||
* @ingroup switch_file_io
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
#define SWITCH_FPROT_USETID 0x8000 /**< Set user id */
|
||||
#define SWITCH_FPROT_UREAD 0x0400 /**< Read by user */
|
||||
#define SWITCH_FPROT_UWRITE 0x0200 /**< Write by user */
|
||||
@@ -690,7 +684,8 @@ typedef int switch_seek_where_t;
|
||||
* @remark If perm is SWITCH_FPROT_OS_DEFAULT and the file is being created,
|
||||
* appropriate default permissions will be used.
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_file_open(switch_file_t **newf, const char *fname, int32_t flag, switch_fileperms_t perm, switch_memory_pool_t *pool);
|
||||
SWITCH_DECLARE(switch_status_t) switch_file_open(switch_file_t **newf, const char *fname, int32_t flag,
|
||||
switch_fileperms_t perm, switch_memory_pool_t *pool);
|
||||
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_file_seek(switch_file_t *thefile, switch_seek_where_t where, int64_t *offset);
|
||||
@@ -757,16 +752,16 @@ SWITCH_DECLARE(switch_status_t) switch_file_exists(const char *filename);
|
||||
*/
|
||||
|
||||
/** Opaque Thread structure. */
|
||||
typedef struct apr_thread_t switch_thread_t;
|
||||
typedef struct apr_thread_t switch_thread_t;
|
||||
|
||||
/** Opaque Thread attributes structure. */
|
||||
typedef struct apr_threadattr_t switch_threadattr_t;
|
||||
typedef struct apr_threadattr_t switch_threadattr_t;
|
||||
|
||||
/**
|
||||
* The prototype for any APR thread worker functions.
|
||||
* typedef void *(SWITCH_THREAD_FUNC *switch_thread_start_t)(switch_thread_t*, void*);
|
||||
*/
|
||||
typedef void *(SWITCH_THREAD_FUNC *switch_thread_start_t)(switch_thread_t*, void*);
|
||||
typedef void *(SWITCH_THREAD_FUNC * switch_thread_start_t) (switch_thread_t *, void *);
|
||||
|
||||
//APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr, switch_size_t stacksize)
|
||||
SWITCH_DECLARE(switch_status_t) switch_threadattr_stacksize_set(switch_threadattr_t *attr, switch_size_t stacksize);
|
||||
@@ -793,7 +788,9 @@ SWITCH_DECLARE(switch_status_t) switch_threadattr_detach_set(switch_threadattr_t
|
||||
* @param data Any data to be passed to the starting function
|
||||
* @param cont The pool to use
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_thread_create(switch_thread_t **new_thread, switch_threadattr_t *attr, switch_thread_start_t func, void *data, switch_memory_pool_t *cont);
|
||||
SWITCH_DECLARE(switch_status_t) switch_thread_create(switch_thread_t **new_thread, switch_threadattr_t *attr,
|
||||
switch_thread_start_t func, void *data,
|
||||
switch_memory_pool_t *cont);
|
||||
|
||||
/** @} */
|
||||
|
||||
@@ -829,16 +826,16 @@ SWITCH_DECLARE(switch_status_t) switch_thread_create(switch_thread_t **new_threa
|
||||
#endif
|
||||
|
||||
/** A structure to represent sockets */
|
||||
typedef struct apr_socket_t switch_socket_t;
|
||||
typedef struct apr_socket_t switch_socket_t;
|
||||
|
||||
/** Freeswitch's socket address type, used to ensure protocol independence */
|
||||
typedef struct apr_sockaddr_t switch_sockaddr_t;
|
||||
typedef struct apr_sockaddr_t switch_sockaddr_t;
|
||||
|
||||
typedef enum {
|
||||
SWITCH_SHUTDOWN_READ, /**< no longer allow read request */
|
||||
SWITCH_SHUTDOWN_WRITE, /**< no longer allow write requests */
|
||||
SWITCH_SHUTDOWN_READWRITE /**< no longer allow read or write requests */
|
||||
} switch_shutdown_how_e;
|
||||
typedef enum {
|
||||
SWITCH_SHUTDOWN_READ, /**< no longer allow read request */
|
||||
SWITCH_SHUTDOWN_WRITE, /**< no longer allow write requests */
|
||||
SWITCH_SHUTDOWN_READWRITE /**< no longer allow read or write requests */
|
||||
} switch_shutdown_how_e;
|
||||
|
||||
/**
|
||||
* @defgroup IP_Proto IP Protocol Definitions for use when creating sockets
|
||||
@@ -859,7 +856,8 @@ typedef enum {
|
||||
* @param protocol The protocol of the socket (e.g., SWITCH_PROTO_TCP).
|
||||
* @param pool The pool to use
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_create(switch_socket_t **new_sock, int family, int type, int protocol, switch_memory_pool_t *pool);
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_create(switch_socket_t **new_sock, int family, int type,
|
||||
int protocol, switch_memory_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Shutdown either reading, writing, or both sides of a socket.
|
||||
@@ -874,13 +872,13 @@ SWITCH_DECLARE(switch_status_t) switch_socket_create(switch_socket_t **new_sock,
|
||||
* @remark This does not actually close the socket descriptor, it just
|
||||
* controls which calls are still valid on the socket.
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_shutdown(switch_socket_t *sock, switch_shutdown_how_e how);
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_shutdown(switch_socket_t *sock, switch_shutdown_how_e how);
|
||||
|
||||
/**
|
||||
* Close a socket.
|
||||
* @param sock The socket to close
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_close(switch_socket_t *sock);
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_close(switch_socket_t *sock);
|
||||
|
||||
/**
|
||||
* Bind the socket to its associated port
|
||||
@@ -889,7 +887,7 @@ SWITCH_DECLARE(switch_status_t) switch_socket_close(switch_socket_t *sock);
|
||||
* @remark This may be where we will find out if there is any other process
|
||||
* using the selected port.
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_bind(switch_socket_t *sock, switch_sockaddr_t *sa);
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_bind(switch_socket_t *sock, switch_sockaddr_t *sa);
|
||||
|
||||
/**
|
||||
* Listen to a bound socket for connections.
|
||||
@@ -898,7 +896,7 @@ SWITCH_DECLARE(switch_status_t) switch_socket_bind(switch_socket_t *sock, switch
|
||||
* listen queue. If this value is less than zero, the listen
|
||||
* queue size is set to zero.
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_listen(switch_socket_t *sock, int32_t backlog);
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_listen(switch_socket_t *sock, int32_t backlog);
|
||||
|
||||
/**
|
||||
* Accept a new connection request
|
||||
@@ -908,7 +906,8 @@ SWITCH_DECLARE(switch_status_t) switch_socket_listen(switch_socket_t *sock, int3
|
||||
* @param sock The socket we are listening on.
|
||||
* @param connection_pool The pool for the new socket.
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_accept(switch_socket_t **new_sock, switch_socket_t *sock, switch_memory_pool_t *pool);
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_accept(switch_socket_t **new_sock, switch_socket_t *sock,
|
||||
switch_memory_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Issue a connection request to a socket either on the same machine
|
||||
@@ -916,12 +915,12 @@ SWITCH_DECLARE(switch_status_t) switch_socket_accept(switch_socket_t **new_sock,
|
||||
* @param sock The socket we wish to use for our side of the connection
|
||||
* @param sa The address of the machine we wish to connect to.
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_connect(switch_socket_t *sock, switch_sockaddr_t *sa);
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_connect(switch_socket_t *sock, switch_sockaddr_t *sa);
|
||||
|
||||
SWITCH_DECLARE(uint16_t) switch_sockaddr_get_port(switch_sockaddr_t *sa);
|
||||
SWITCH_DECLARE(char *) switch_get_addr(char *buf, switch_size_t len, switch_sockaddr_t *in);
|
||||
SWITCH_DECLARE(int32_t) switch_sockaddr_get_family(switch_sockaddr_t *sa);
|
||||
SWITCH_DECLARE(switch_status_t) switch_sockaddr_ip_get(char **addr, switch_sockaddr_t *sa);
|
||||
SWITCH_DECLARE(uint16_t) switch_sockaddr_get_port(switch_sockaddr_t *sa);
|
||||
SWITCH_DECLARE(char *) switch_get_addr(char *buf, switch_size_t len, switch_sockaddr_t *in);
|
||||
SWITCH_DECLARE(int32_t) switch_sockaddr_get_family(switch_sockaddr_t *sa);
|
||||
SWITCH_DECLARE(switch_status_t) switch_sockaddr_ip_get(char **addr, switch_sockaddr_t *sa);
|
||||
|
||||
|
||||
/**
|
||||
@@ -947,7 +946,9 @@ SWITCH_DECLARE(switch_status_t) switch_sockaddr_ip_get(char **addr, switch_socka
|
||||
* </PRE>
|
||||
* @param p The pool for the apr_sockaddr_t and associated storage.
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_sockaddr_info_get(switch_sockaddr_t **sa, const char *hostname, int32_t family, switch_port_t port, int32_t flags, switch_memory_pool_t *pool);
|
||||
SWITCH_DECLARE(switch_status_t) switch_sockaddr_info_get(switch_sockaddr_t **sa, const char *hostname,
|
||||
int32_t family, switch_port_t port, int32_t flags,
|
||||
switch_memory_pool_t *pool);
|
||||
|
||||
/**
|
||||
* Send data over a network.
|
||||
@@ -966,7 +967,7 @@ SWITCH_DECLARE(switch_status_t) switch_sockaddr_info_get(switch_sockaddr_t **sa,
|
||||
* APR_EINTR is never returned.
|
||||
* </PRE>
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_send(switch_socket_t *sock, const char *buf, switch_size_t *len);
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_send(switch_socket_t *sock, const char *buf, switch_size_t *len);
|
||||
|
||||
/**
|
||||
* @param sock The socket to send from
|
||||
@@ -975,7 +976,8 @@ SWITCH_DECLARE(switch_status_t) switch_socket_send(switch_socket_t *sock, const
|
||||
* @param buf The data to send
|
||||
* @param len The length of the data to send
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_sendto(switch_socket_t *sock, switch_sockaddr_t *where, int32_t flags, const char *buf, switch_size_t *len);
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_sendto(switch_socket_t *sock, switch_sockaddr_t *where,
|
||||
int32_t flags, const char *buf, switch_size_t *len);
|
||||
|
||||
/**
|
||||
* @param from The apr_sockaddr_t to fill in the recipient info
|
||||
@@ -985,11 +987,9 @@ SWITCH_DECLARE(switch_status_t) switch_socket_sendto(switch_socket_t *sock, swit
|
||||
* @param len The length of the available buffer
|
||||
*
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_recvfrom(switch_sockaddr_t *from,
|
||||
switch_socket_t *sock,
|
||||
int32_t flags,
|
||||
char *buf,
|
||||
size_t *len);
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_recvfrom(switch_sockaddr_t *from,
|
||||
switch_socket_t *sock,
|
||||
int32_t flags, char *buf, size_t *len);
|
||||
|
||||
|
||||
/**
|
||||
@@ -1011,7 +1011,7 @@ SWITCH_DECLARE(switch_status_t) switch_socket_recvfrom(switch_sockaddr_t *from,
|
||||
* APR_EINTR is never returned.
|
||||
* </PRE>
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_recv(switch_socket_t *sock, char *buf, switch_size_t *len);
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_recv(switch_socket_t *sock, char *buf, switch_size_t *len);
|
||||
|
||||
/**
|
||||
* Setup socket options for the specified socket
|
||||
@@ -1035,7 +1035,7 @@ SWITCH_DECLARE(switch_status_t) switch_socket_recv(switch_socket_t *sock, char *
|
||||
* </PRE>
|
||||
* @param on Value for the option.
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_opt_set(switch_socket_t *sock, int32_t opt, int32_t on);
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_opt_set(switch_socket_t *sock, int32_t opt, int32_t on);
|
||||
|
||||
/**
|
||||
* Setup socket timeout for the specified socket
|
||||
@@ -1048,7 +1048,7 @@ SWITCH_DECLARE(switch_status_t) switch_socket_opt_set(switch_socket_t *sock, int
|
||||
* t < 0 -- read and write calls block
|
||||
* </PRE>
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_timeout_set(switch_socket_t *sock, switch_interval_time_t t);
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_timeout_set(switch_socket_t *sock, switch_interval_time_t t);
|
||||
|
||||
/**
|
||||
* Join a Multicast Group
|
||||
@@ -1059,7 +1059,8 @@ SWITCH_DECLARE(switch_status_t) switch_socket_timeout_set(switch_socket_t *sock,
|
||||
* @param source Source Address to accept transmissions from (non-NULL
|
||||
* implies Source-Specific Multicast)
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_mcast_join(switch_socket_t *sock, switch_sockaddr_t *join, switch_sockaddr_t *iface, switch_sockaddr_t *source);
|
||||
SWITCH_DECLARE(switch_status_t) switch_mcast_join(switch_socket_t *sock, switch_sockaddr_t *join,
|
||||
switch_sockaddr_t *iface, switch_sockaddr_t *source);
|
||||
|
||||
|
||||
|
||||
@@ -1071,10 +1072,10 @@ SWITCH_DECLARE(switch_status_t) switch_mcast_join(switch_socket_t *sock, switch_
|
||||
* @{
|
||||
*/
|
||||
/** Poll descriptor set. */
|
||||
typedef struct apr_pollfd_t switch_pollfd_t;
|
||||
typedef struct apr_pollfd_t switch_pollfd_t;
|
||||
|
||||
/** Opaque structure used for pollset API */
|
||||
typedef struct apr_pollset_t switch_pollset_t;
|
||||
typedef struct apr_pollset_t switch_pollset_t;
|
||||
|
||||
/**
|
||||
* Poll options
|
||||
@@ -1100,10 +1101,8 @@ typedef struct apr_pollset_t switch_pollset_t;
|
||||
* platforms; the apr_pollset_create() call will fail with
|
||||
* APR_ENOTIMPL on platforms where it is not supported.
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_pollset_create(switch_pollset_t **pollset,
|
||||
uint32_t size,
|
||||
switch_memory_pool_t *p,
|
||||
uint32_t flags);
|
||||
SWITCH_DECLARE(switch_status_t) switch_pollset_create(switch_pollset_t **pollset,
|
||||
uint32_t size, switch_memory_pool_t *p, uint32_t flags);
|
||||
|
||||
/**
|
||||
* Add a socket or file descriptor to a pollset
|
||||
@@ -1122,8 +1121,7 @@ SWITCH_DECLARE(switch_status_t) switch_pollset_create(switch_pollset_t **pollset
|
||||
* allowed for implementations where option (1) is impossible
|
||||
* or impractical.
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_pollset_add(switch_pollset_t *pollset,
|
||||
const switch_pollfd_t *descriptor);
|
||||
SWITCH_DECLARE(switch_status_t) switch_pollset_add(switch_pollset_t *pollset, const switch_pollfd_t *descriptor);
|
||||
|
||||
/**
|
||||
* Poll the sockets in the poll structure
|
||||
@@ -1138,10 +1136,8 @@ SWITCH_DECLARE(switch_status_t) switch_pollset_add(switch_pollset_t *pollset,
|
||||
* This is a blocking call, and it will not return until either a
|
||||
* socket has been signalled, or the timeout has expired.
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_poll(switch_pollfd_t *aprset,
|
||||
int32_t numsock,
|
||||
int32_t *nsds,
|
||||
switch_interval_time_t timeout);
|
||||
SWITCH_DECLARE(switch_status_t) switch_poll(switch_pollfd_t *aprset,
|
||||
int32_t numsock, int32_t *nsds, switch_interval_time_t timeout);
|
||||
|
||||
/*!
|
||||
\brief Create a set of file descriptors to poll
|
||||
@@ -1151,9 +1147,10 @@ SWITCH_DECLARE(switch_status_t) switch_poll(switch_pollfd_t *aprset,
|
||||
\param pool the memory pool to use
|
||||
\return SWITCH_STATUS_SUCCESS when successful
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_create_pollfd(switch_pollfd_t **poll, switch_socket_t *sock, int16_t flags, switch_memory_pool_t *pool);
|
||||
SWITCH_DECLARE(switch_status_t) switch_socket_create_pollfd(switch_pollfd_t **poll, switch_socket_t *sock,
|
||||
int16_t flags, switch_memory_pool_t *pool);
|
||||
|
||||
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
@@ -1162,10 +1159,8 @@ SWITCH_DECLARE(switch_status_t) switch_socket_create_pollfd(switch_pollfd_t **po
|
||||
/** @} */
|
||||
/** @} */
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
@@ -36,22 +36,20 @@
|
||||
#ifndef SWITCH_BITPACK_H
|
||||
#define SWITCH_BITPACK_H
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
#include <switch.h>
|
||||
|
||||
#ifdef DEBUG_BITS
|
||||
static char bb[80] = "";
|
||||
static inline char *print_bits(switch_byte_t byte, char *x)
|
||||
{
|
||||
|
||||
int i,j = 0;
|
||||
x[j++] = '[';
|
||||
for (i=7;i>=0;i--) {
|
||||
x[j++] = (byte & (1 << i)) ? '1' : '0';
|
||||
}
|
||||
x[j++] = ']';
|
||||
x[j++] = '\0';
|
||||
return x;
|
||||
int i, j = 0;
|
||||
x[j++] = '[';
|
||||
for (i = 7; i >= 0; i--) {
|
||||
x[j++] = (byte & (1 << i)) ? '1' : '0';
|
||||
}
|
||||
x[j++] = ']';
|
||||
x[j++] = '\0';
|
||||
return x;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -63,8 +61,8 @@ static inline char *print_bits(switch_byte_t byte, char *x)
|
||||
\{
|
||||
*/
|
||||
|
||||
static const uint8_t SWITCH_BITPACKED_MASKS[] = {0, 1, 3, 7, 15, 31, 63, 127, 255};
|
||||
static const uint8_t SWITCH_REVERSE_BITPACKED_MASKS[] = {255, 254, 252, 248, 240, 224, 192, 128};
|
||||
static const uint8_t SWITCH_BITPACKED_MASKS[] = { 0, 1, 3, 7, 15, 31, 63, 127, 255 };
|
||||
static const uint8_t SWITCH_REVERSE_BITPACKED_MASKS[] = { 255, 254, 252, 248, 240, 224, 192, 128 };
|
||||
|
||||
/*!
|
||||
\brief Initialize a bitpack object
|
||||
@@ -74,8 +72,11 @@ static const uint8_t SWITCH_REVERSE_BITPACKED_MASKS[] = {255, 254, 252, 248, 240
|
||||
\param buflen the length of the storage buffer
|
||||
\param mode RFC3551 or AAL2 mode (curse you backwards folks)
|
||||
*/
|
||||
DoxyDefine(void switch_bitpack_init(switch_bitpack_t *pack, int32_t bitlen, switch_byte_t *buf, uint32_t buflen, switch_bitpack_mode_t mode))
|
||||
static inline int8_t switch_bitpack_init(switch_bitpack_t *pack, switch_byte_t bitlen, switch_byte_t *buf, uint32_t buflen, switch_bitpack_mode_t mode)
|
||||
DoxyDefine(void
|
||||
switch_bitpack_init(switch_bitpack_t *pack, int32_t bitlen, switch_byte_t *buf, uint32_t buflen,
|
||||
switch_bitpack_mode_t mode))
|
||||
static inline int8_t switch_bitpack_init(switch_bitpack_t *pack, switch_byte_t bitlen, switch_byte_t *buf,
|
||||
uint32_t buflen, switch_bitpack_mode_t mode)
|
||||
{
|
||||
if (!pack || (bitlen > SWITCH_BITS_PER_BYTE) || !buf || !buflen) {
|
||||
return -1;
|
||||
@@ -94,7 +95,7 @@ static inline int8_t switch_bitpack_init(switch_bitpack_t *pack, switch_byte_t b
|
||||
|
||||
static inline void pack_check_over(switch_bitpack_t *pack)
|
||||
{
|
||||
switch_byte_t this_byte = pack->this_byte;
|
||||
switch_byte_t this_byte = pack->this_byte;
|
||||
|
||||
if (pack->over) {
|
||||
pack->bits_cur = pack->over;
|
||||
@@ -117,7 +118,7 @@ static inline void pack_check_over(switch_bitpack_t *pack)
|
||||
|
||||
pack->bytes++;
|
||||
pack->over = pack->under = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -125,14 +126,14 @@ static inline void pack_check_over(switch_bitpack_t *pack)
|
||||
\param pack the pack/unpack object
|
||||
*/
|
||||
DoxyDefine(int8_t switch_bitpack_done(switch_bitpack_t *pack))
|
||||
static inline int8_t switch_bitpack_done(switch_bitpack_t *pack)
|
||||
static inline int8_t switch_bitpack_done(switch_bitpack_t *pack)
|
||||
{
|
||||
|
||||
if (pack->bits_cur && pack->bits_cur < SWITCH_BITS_PER_BYTE) {
|
||||
pack->bytes++;
|
||||
if (pack->mode == SWITCH_BITPACK_MODE_AAL2) {
|
||||
*pack->cur <<= SWITCH_BITS_PER_BYTE - pack->bits_cur;
|
||||
}
|
||||
*pack->cur <<= SWITCH_BITS_PER_BYTE - pack->bits_cur;
|
||||
}
|
||||
}
|
||||
|
||||
if (pack->over) {
|
||||
@@ -149,11 +150,11 @@ static inline int8_t switch_bitpack_done(switch_bitpack_t *pack)
|
||||
\return -1 if the buffer is full otherwise 0
|
||||
*/
|
||||
DoxyDefine(int8_t switch_bitpack_out(switch_bitpack_t *unpack, switch_byte_t in))
|
||||
static inline int8_t switch_bitpack_out(switch_bitpack_t *unpack, switch_byte_t in)
|
||||
static inline int8_t switch_bitpack_out(switch_bitpack_t *unpack, switch_byte_t in)
|
||||
{
|
||||
switch_byte_t this_byte;
|
||||
|
||||
if ((uint32_t)(unpack->cur - unpack->buf) > unpack->buflen) {
|
||||
if ((uint32_t) (unpack->cur - unpack->buf) > unpack->buflen) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -163,7 +164,7 @@ static inline int8_t switch_bitpack_out(switch_bitpack_t *unpack, switch_byte_t
|
||||
|
||||
|
||||
pack_check_over(unpack);
|
||||
while(unpack->bits_cur <= SWITCH_BITS_PER_BYTE) {
|
||||
while (unpack->bits_cur <= SWITCH_BITS_PER_BYTE) {
|
||||
switch_byte_t next = unpack->bits_cur + unpack->frame_bits;
|
||||
switch_byte_t under_in;
|
||||
switch_byte_t mask;
|
||||
@@ -220,20 +221,20 @@ static inline int8_t switch_bitpack_out(switch_bitpack_t *unpack, switch_byte_t
|
||||
\return -1 if the buffer is full otherwise 0
|
||||
*/
|
||||
DoxyDefine(int8_t switch_bitpack_in(switch_bitpack_t *pack, switch_byte_t in))
|
||||
static inline int8_t switch_bitpack_in(switch_bitpack_t *pack, switch_byte_t in)
|
||||
static inline int8_t switch_bitpack_in(switch_bitpack_t *pack, switch_byte_t in)
|
||||
{
|
||||
int next = pack->bits_cur + pack->frame_bits;
|
||||
|
||||
if ((uint32_t)(pack->cur - pack->buf) > pack->buflen) {
|
||||
if ((uint32_t) (pack->cur - pack->buf) > pack->buflen) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
pack->bits_tot += pack->frame_bits;
|
||||
|
||||
if (next > SWITCH_BITS_PER_BYTE) {
|
||||
switch_byte_t a = 0, b = 0, rem, nxt;
|
||||
rem = SWITCH_BITS_PER_BYTE - pack->bits_cur;
|
||||
nxt = pack->frame_bits - rem ;
|
||||
nxt = pack->frame_bits - rem;
|
||||
if (pack->mode == SWITCH_BITPACK_MODE_RFC3551) {
|
||||
a = in & SWITCH_BITPACKED_MASKS[rem];
|
||||
b = in >> rem;
|
||||
@@ -250,7 +251,7 @@ static inline int8_t switch_bitpack_in(switch_bitpack_t *pack, switch_byte_t in)
|
||||
pack->cur++;
|
||||
*pack->cur |= b;
|
||||
pack->bits_cur = nxt;
|
||||
|
||||
|
||||
}
|
||||
pack->bytes++;
|
||||
|
||||
@@ -259,14 +260,14 @@ static inline int8_t switch_bitpack_in(switch_bitpack_t *pack, switch_byte_t in)
|
||||
if (pack->mode == SWITCH_BITPACK_MODE_RFC3551) {
|
||||
in <<= pack->shiftby;
|
||||
*pack->cur |= in;
|
||||
pack->shiftby = (switch_byte_t)(pack->shiftby + pack->frame_bits);
|
||||
pack->shiftby = (switch_byte_t) (pack->shiftby + pack->frame_bits);
|
||||
} else {
|
||||
*pack->cur <<= pack->frame_bits;
|
||||
*pack->cur |= in;
|
||||
}
|
||||
|
||||
if (next == SWITCH_BITS_PER_BYTE) {
|
||||
pack->cur++;
|
||||
pack->cur++;
|
||||
pack->bytes++;
|
||||
pack->bits_cur = pack->shiftby = 0;
|
||||
} else {
|
||||
@@ -276,11 +277,11 @@ static inline int8_t switch_bitpack_in(switch_bitpack_t *pack, switch_byte_t in)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
///\}
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
#include <switch.h>
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
/**
|
||||
* @defgroup switch_buffer Buffer Routines
|
||||
* @ingroup core1
|
||||
@@ -50,8 +49,7 @@ SWITCH_BEGIN_EXTERN_C
|
||||
* and I think it can be optimized under the hood as we go using bucket brigades and/or ring buffering techniques.
|
||||
* @{
|
||||
*/
|
||||
|
||||
struct switch_buffer;
|
||||
struct switch_buffer;
|
||||
|
||||
|
||||
/*! \brief Allocate a new switch_buffer
|
||||
@@ -60,7 +58,8 @@ struct switch_buffer;
|
||||
* \param max_len length required by the buffer
|
||||
* \return status
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_buffer_create(switch_memory_pool_t *pool, switch_buffer_t **buffer, switch_size_t max_len);
|
||||
SWITCH_DECLARE(switch_status_t) switch_buffer_create(switch_memory_pool_t *pool, switch_buffer_t **buffer,
|
||||
switch_size_t max_len);
|
||||
|
||||
/*! \brief Allocate a new dynamic switch_buffer
|
||||
* \param buffer returned pointer to the new buffer
|
||||
@@ -71,8 +70,7 @@ SWITCH_DECLARE(switch_status_t) switch_buffer_create(switch_memory_pool_t *pool,
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_buffer_create_dynamic(switch_buffer_t **buffer,
|
||||
switch_size_t blocksize,
|
||||
switch_size_t start_len,
|
||||
switch_size_t max_len);
|
||||
switch_size_t start_len, switch_size_t max_len);
|
||||
|
||||
/*! \brief Get the length of a switch_buffer_t
|
||||
* \param buffer any buffer of type switch_buffer_t
|
||||
@@ -129,9 +127,7 @@ SWITCH_DECLARE(void) switch_buffer_destroy(switch_buffer_t **buffer);
|
||||
/** @} */
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
@@ -56,10 +56,9 @@
|
||||
#include <switch.h>
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
/*! \brief Call Specific Data
|
||||
*/
|
||||
struct switch_caller_profile {
|
||||
struct switch_caller_profile {
|
||||
/*! The Call's User Name */
|
||||
char *username;
|
||||
/*! The name of the dialplan */
|
||||
@@ -129,9 +128,7 @@ struct switch_caller_extension {
|
||||
\return a new extension object allocated from the session's memory pool
|
||||
*/
|
||||
SWITCH_DECLARE(switch_caller_extension_t *) switch_caller_extension_new(switch_core_session_t *session,
|
||||
char *extension_name,
|
||||
char *extension_number
|
||||
);
|
||||
char *extension_name, char *extension_number);
|
||||
|
||||
/*!
|
||||
\brief Add an application (instruction) to the given extension
|
||||
@@ -142,8 +139,7 @@ SWITCH_DECLARE(switch_caller_extension_t *) switch_caller_extension_new(switch_c
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_caller_extension_add_application(switch_core_session_t *session,
|
||||
switch_caller_extension_t *caller_extension,
|
||||
char *application_name,
|
||||
char *extra_data);
|
||||
char *application_name, char *extra_data);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -188,9 +184,9 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_new(switch_memor
|
||||
\param session session associated with the profile (bound by scope)
|
||||
\param tocopy the existing profile
|
||||
*/
|
||||
|
||||
|
||||
SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_clone(switch_core_session_t *session,
|
||||
switch_caller_profile_t *tocopy);
|
||||
switch_caller_profile_t *tocopy);
|
||||
|
||||
/*!
|
||||
\brief Add headers to an existing event in regards to a specific profile
|
||||
@@ -199,14 +195,12 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_clone(switch_cor
|
||||
\param event the event to add the information to
|
||||
*/
|
||||
|
||||
SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile_t *caller_profile, char *prefix, switch_event_t *event);
|
||||
SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile_t *caller_profile, char *prefix,
|
||||
switch_event_t *event);
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
@@ -40,9 +40,7 @@
|
||||
|
||||
#include <switch.h>
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
struct switch_channel_timetable {
|
||||
SWITCH_BEGIN_EXTERN_C struct switch_channel_timetable {
|
||||
switch_time_t created;
|
||||
switch_time_t answered;
|
||||
switch_time_t hungup;
|
||||
@@ -76,17 +74,16 @@ SWITCH_DECLARE(uint8_t) switch_channel_ready(switch_channel_t *channel);
|
||||
|
||||
|
||||
SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_state(switch_channel_t *channel,
|
||||
const char *file,
|
||||
const char *func,
|
||||
int line,
|
||||
switch_channel_state_t state);
|
||||
const char *file,
|
||||
const char *func,
|
||||
int line, switch_channel_state_t state);
|
||||
|
||||
/*!
|
||||
\brief Set the current state of a channel
|
||||
\param channel channel to set state of
|
||||
\param state new state
|
||||
\return current state of channel after application of new state
|
||||
*/
|
||||
*/
|
||||
#define switch_channel_set_state(channel, state) switch_channel_perform_set_state(channel, __FILE__, __SWITCH_FUNC__, __LINE__, state)
|
||||
|
||||
/*!
|
||||
@@ -133,9 +130,8 @@ SWITCH_DECLARE(switch_status_t) switch_channel_alloc(switch_channel_t **channel,
|
||||
\param flags the initial channel flags
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_init(switch_channel_t *channel,
|
||||
switch_core_session_t *session,
|
||||
switch_channel_state_t state,
|
||||
uint32_t flags);
|
||||
switch_core_session_t *session,
|
||||
switch_channel_state_t state, uint32_t flags);
|
||||
|
||||
/*!
|
||||
\brief Fire A presence event for the channel
|
||||
@@ -156,7 +152,8 @@ SWITCH_DECLARE(void) switch_channel_uninit(switch_channel_t *channel);
|
||||
\param channel channel to assign the profile to
|
||||
\param caller_profile the profile to assign
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_channel_set_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile);
|
||||
SWITCH_DECLARE(void) switch_channel_set_caller_profile(switch_channel_t *channel,
|
||||
switch_caller_profile_t *caller_profile);
|
||||
|
||||
/*!
|
||||
\brief Retrive the given channel's caller profile
|
||||
@@ -170,7 +167,8 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_caller_profile(swit
|
||||
\param channel channel to assign the profile to
|
||||
\param caller_profile the profile to assign
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_channel_set_originator_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile);
|
||||
SWITCH_DECLARE(void) switch_channel_set_originator_caller_profile(switch_channel_t *channel,
|
||||
switch_caller_profile_t *caller_profile);
|
||||
|
||||
/*!
|
||||
\brief Retrive the given channel's originator caller profile
|
||||
@@ -184,7 +182,8 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_originator_caller_p
|
||||
\param channel channel to assign the profile to
|
||||
\param caller_profile the profile to assign
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_channel_set_originatee_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile);
|
||||
SWITCH_DECLARE(void) switch_channel_set_originatee_caller_profile(switch_channel_t *channel,
|
||||
switch_caller_profile_t *caller_profile);
|
||||
|
||||
/*!
|
||||
\brief Retrive the given channel's originatee caller profile
|
||||
@@ -208,7 +207,8 @@ SWITCH_DECLARE(char *) switch_channel_get_uuid(switch_channel_t *channel);
|
||||
\param value the vaule of the variable
|
||||
\returns SWITCH_STATUS_SUCCESS if successful
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_set_variable(switch_channel_t *channel, const char *varname, const char *value);
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_set_variable(switch_channel_t *channel, const char *varname,
|
||||
const char *value);
|
||||
|
||||
/*!
|
||||
\brief Set a variable on a given channel, without duplicating the value from the session pool.
|
||||
@@ -217,7 +217,8 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_variable(switch_channel_t *ch
|
||||
\param value the vaule of the variable (MUST BE ALLOCATED FROM THE SESSION POOL ALREADY)
|
||||
\returns SWITCH_STATUS_SUCCESS if successful
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_set_variable_nodup(switch_channel_t *channel, const char *varname, char *value);
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_set_variable_nodup(switch_channel_t *channel, const char *varname,
|
||||
char *value);
|
||||
|
||||
/*!
|
||||
\brief Retrieve a variable from a given channel
|
||||
@@ -234,14 +235,16 @@ SWITCH_DECLARE(char *) switch_channel_get_variable(switch_channel_t *channel, ch
|
||||
* pool is NULL, then an internal, non-thread-safe iterator is used.
|
||||
* @remark Use switch_hash_next and switch_hash_this with this function to iterate all the channel variables
|
||||
*/
|
||||
SWITCH_DECLARE(switch_hash_index_t *) switch_channel_variable_first(switch_channel_t *channel, switch_memory_pool_t *pool);
|
||||
SWITCH_DECLARE(switch_hash_index_t *) switch_channel_variable_first(switch_channel_t *channel,
|
||||
switch_memory_pool_t *pool);
|
||||
|
||||
/*!
|
||||
\brief Assign a caller extension to a given channel
|
||||
\param channel channel to assign extension to
|
||||
\param caller_extension extension to assign
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_channel_set_caller_extension(switch_channel_t *channel, switch_caller_extension_t *caller_extension);
|
||||
SWITCH_DECLARE(void) switch_channel_set_caller_extension(switch_channel_t *channel,
|
||||
switch_caller_extension_t *caller_extension);
|
||||
|
||||
/*!
|
||||
\brief Retrieve caller extension from a given channel
|
||||
@@ -280,14 +283,10 @@ SWITCH_DECLARE(void) switch_channel_set_state_flag(switch_channel_t *channel, sw
|
||||
SWITCH_DECLARE(void) switch_channel_clear_flag(switch_channel_t *channel, switch_channel_flag_t flags);
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t *channel,
|
||||
const char *file,
|
||||
const char *func,
|
||||
int line);
|
||||
const char *file, const char *func, int line);
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_answered(switch_channel_t *channel,
|
||||
const char *file,
|
||||
const char *func,
|
||||
int line);
|
||||
const char *file, const char *func, int line);
|
||||
|
||||
/*!
|
||||
\brief Answer a channel (initiate/acknowledge a successful connection)
|
||||
@@ -311,9 +310,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_answered(switch_chan
|
||||
#define switch_channel_mark_pre_answered(channel) switch_channel_perform_mark_pre_answered(channel, __FILE__, __SWITCH_FUNC__, __LINE__)
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_perform_ring_ready(switch_channel_t *channel,
|
||||
const char *file,
|
||||
const char *func,
|
||||
int line);
|
||||
const char *file, const char *func, int line);
|
||||
/*!
|
||||
\brief Send Ringing message to a channel
|
||||
\param channel channel to ring
|
||||
@@ -323,32 +320,26 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_ring_ready(switch_channel
|
||||
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_perform_pre_answer(switch_channel_t *channel,
|
||||
const char *file,
|
||||
const char *func,
|
||||
int line);
|
||||
const char *file, const char *func, int line);
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_pre_answered(switch_channel_t *channel,
|
||||
const char *file,
|
||||
const char *func,
|
||||
int line);
|
||||
const char *file, const char *func, int line);
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_ring_ready(switch_channel_t *channel,
|
||||
const char *file,
|
||||
const char *func,
|
||||
int line);
|
||||
const char *file, const char *func, int line);
|
||||
|
||||
/*!
|
||||
\brief Indicate progress on a channel to attempt early media
|
||||
\param channel channel to pre-answer
|
||||
\return SWITCH_STATUS_SUCCESS
|
||||
*/
|
||||
*/
|
||||
#define switch_channel_pre_answer(channel) switch_channel_perform_pre_answer(channel, __FILE__, __SWITCH_FUNC__, __LINE__)
|
||||
|
||||
/*!
|
||||
\brief Indicate a channel is ready to provide ringback
|
||||
\param channel channel
|
||||
\return SWITCH_STATUS_SUCCESS
|
||||
*/
|
||||
*/
|
||||
#define switch_channel_mark_ring_ready(channel) switch_channel_perform_mark_ring_ready(channel, __FILE__, __SWITCH_FUNC__, __LINE__)
|
||||
|
||||
/*!
|
||||
@@ -357,14 +348,16 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_ring_ready(switch_ch
|
||||
\param state_handler table of state handler functions
|
||||
\return the index number/priority of the table negative value indicates failure
|
||||
*/
|
||||
SWITCH_DECLARE(int) switch_channel_add_state_handler(switch_channel_t *channel, const switch_state_handler_table_t *state_handler);
|
||||
SWITCH_DECLARE(int) switch_channel_add_state_handler(switch_channel_t *channel,
|
||||
const switch_state_handler_table_t *state_handler);
|
||||
|
||||
/*!
|
||||
\brief clear a state handler table from a given channel
|
||||
\param channel channel from which to clear the state handler table
|
||||
\param state_handler table of state handler functions
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_channel_clear_state_handler(switch_channel_t *channel, const switch_state_handler_table_t *state_handler);
|
||||
SWITCH_DECLARE(void) switch_channel_clear_state_handler(switch_channel_t *channel,
|
||||
const switch_state_handler_table_t *state_handler);
|
||||
|
||||
/*!
|
||||
\brief Retrieve an state handler tablefrom a given channel at given index level
|
||||
@@ -372,7 +365,8 @@ SWITCH_DECLARE(void) switch_channel_clear_state_handler(switch_channel_t *channe
|
||||
\param index the index of the state handler table (start from 0)
|
||||
\return given channel's state handler table at given index or NULL if requested index does not exist.
|
||||
*/
|
||||
SWITCH_DECLARE(const switch_state_handler_table_t *) switch_channel_get_state_handler(switch_channel_t *channel, int index);
|
||||
SWITCH_DECLARE(const switch_state_handler_table_t *) switch_channel_get_state_handler(switch_channel_t *channel,
|
||||
int index);
|
||||
|
||||
/*!
|
||||
\brief Set private data on channel
|
||||
@@ -407,11 +401,10 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_name(switch_channel_t *channe
|
||||
SWITCH_DECLARE(char *) switch_channel_get_name(switch_channel_t *channel);
|
||||
|
||||
|
||||
SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_hangup(switch_channel_t *channel,
|
||||
const char *file,
|
||||
const char *func,
|
||||
int line,
|
||||
switch_call_cause_t hangup_cause);
|
||||
SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_hangup(switch_channel_t *channel,
|
||||
const char *file,
|
||||
const char *func,
|
||||
int line, switch_call_cause_t hangup_cause);
|
||||
|
||||
/*!
|
||||
\brief Hangup a channel flagging it's state machine to end
|
||||
@@ -478,9 +471,7 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel
|
||||
/** @} */
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
@@ -58,24 +58,22 @@
|
||||
|
||||
#include <switch.h>
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
typedef struct switch_config switch_config_t;
|
||||
SWITCH_BEGIN_EXTERN_C typedef struct switch_config switch_config_t;
|
||||
|
||||
/*! \brief A simple file handle representing an open configuration file **/
|
||||
struct switch_config {
|
||||
/*! FILE stream buffer to the opened file */
|
||||
FILE *file;
|
||||
FILE *file;
|
||||
/*! path to the file */
|
||||
char *path;
|
||||
char *path;
|
||||
/*! current category */
|
||||
char category[256];
|
||||
char category[256];
|
||||
/*! current section */
|
||||
char section[256];
|
||||
char section[256];
|
||||
/*! buffer of current line being read */
|
||||
char buf[1024];
|
||||
char buf[1024];
|
||||
/*! current line number in file */
|
||||
int lineno;
|
||||
int lineno;
|
||||
/*! current category number in file */
|
||||
int catno;
|
||||
/*! current section number in file */
|
||||
@@ -107,11 +105,8 @@ SWITCH_DECLARE(void) switch_config_close_file(switch_config_t *cfg);
|
||||
SWITCH_DECLARE(int) switch_config_next_pair(switch_config_t *cfg, char **var, char **val);
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
@@ -51,9 +51,6 @@ SWITCH_BEGIN_EXTERN_C
|
||||
s.alloc_len = SWITCH_CMD_CHUNK_LEN;\
|
||||
s.alloc_chunk = SWITCH_CMD_CHUNK_LEN;\
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
\brief A simple comand loop that reads input from the terminal
|
||||
*/
|
||||
@@ -62,16 +59,16 @@ SWITCH_DECLARE(void) switch_console_loop(void);
|
||||
/*!
|
||||
\brief A method akin to printf that allows you to redirect output to a specific console "channel"
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_console_printf(switch_text_channel_t channel, const char *file, const char *func, int line, const char *fmt, ...) PRINTF_FUNCTION(5,6);
|
||||
SWITCH_DECLARE(void) switch_console_printf(switch_text_channel_t channel, const char *file, const char *func, int line,
|
||||
const char *fmt, ...) PRINTF_FUNCTION(5, 6);
|
||||
|
||||
/*!
|
||||
\brief A method akin to printf for dealing with api streams
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_console_stream_write(switch_stream_handle_t *handle, const char *fmt, ...) PRINTF_FUNCTION(2,3);
|
||||
SWITCH_DECLARE(switch_status_t) switch_console_stream_write(switch_stream_handle_t *handle, const char *fmt,
|
||||
...) PRINTF_FUNCTION(2, 3);
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
+129
-248
@@ -41,43 +41,41 @@
|
||||
#include <switch.h>
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
#define SWITCH_MAX_CORE_THREAD_SESSION_OBJS 128
|
||||
#define SWITCH_MAX_STREAMS 128
|
||||
|
||||
struct switch_core_time_duration {
|
||||
uint32_t mms;
|
||||
uint32_t ms;
|
||||
uint32_t sec;
|
||||
uint32_t min;
|
||||
uint32_t hr;
|
||||
struct switch_core_time_duration {
|
||||
uint32_t mms;
|
||||
uint32_t ms;
|
||||
uint32_t sec;
|
||||
uint32_t min;
|
||||
uint32_t hr;
|
||||
uint32_t day;
|
||||
uint32_t yr;
|
||||
};
|
||||
|
||||
/*! \brief A message object designed to allow unlike technologies to exchange data */
|
||||
struct switch_core_session_message {
|
||||
/*! uuid of the sender (for replies)*/
|
||||
/*! uuid of the sender (for replies) */
|
||||
char *from;
|
||||
/*! enumeration of the type of message */
|
||||
switch_core_session_message_types_t message_id;
|
||||
|
||||
/*! optional numeric arg*/
|
||||
/*! optional numeric arg */
|
||||
int numeric_arg;
|
||||
/*! optional string arg*/
|
||||
/*! optional string arg */
|
||||
char *string_arg;
|
||||
/*! optional string arg*/
|
||||
/*! optional string arg */
|
||||
switch_size_t string_arg_size;
|
||||
/*! optional arbitrary pointer arg */
|
||||
void *pointer_arg;
|
||||
/*! optional arbitrary pointer arg's size */
|
||||
switch_size_t pointer_arg_size;
|
||||
|
||||
/*! optional numeric reply*/
|
||||
/*! optional numeric reply */
|
||||
int numeric_reply;
|
||||
/*! optional string reply*/
|
||||
/*! optional string reply */
|
||||
char *string_reply;
|
||||
/*! optional string reply*/
|
||||
/*! optional string reply */
|
||||
switch_size_t string_reply_size;
|
||||
/*! optional arbitrary pointer reply */
|
||||
void *pointer_reply;
|
||||
@@ -96,7 +94,7 @@ struct switch_core_thread_session {
|
||||
/*! array of void pointers to pass mutiple data objects */
|
||||
void *objs[SWITCH_MAX_CORE_THREAD_SESSION_OBJS];
|
||||
/*! a pointer to a memory pool if the thread has it's own pool */
|
||||
switch_input_callback_function_t input_callback;
|
||||
switch_input_callback_function_t input_callback;
|
||||
switch_memory_pool_t *pool;
|
||||
};
|
||||
|
||||
@@ -104,16 +102,6 @@ struct switch_core_session;
|
||||
struct switch_core_runtime;
|
||||
struct switch_core_port_allocator;
|
||||
|
||||
struct switch_core_scheduler_task {
|
||||
time_t created;
|
||||
time_t runtime;
|
||||
uint32_t cmd_id;
|
||||
char *group;
|
||||
void *cmd_arg;
|
||||
uint32_t task_id;
|
||||
};
|
||||
|
||||
|
||||
/*!
|
||||
\defgroup core1 Core Library
|
||||
\ingroup FREESWITCH
|
||||
@@ -125,47 +113,6 @@ struct switch_core_scheduler_task {
|
||||
///\{
|
||||
|
||||
|
||||
///\defgroup sched1 Scheduler
|
||||
///\ingroup core1
|
||||
///\{
|
||||
|
||||
|
||||
/*!
|
||||
\brief Schedule a task in the future
|
||||
\param runtime the time in epoch seconds to execute the task.
|
||||
\param func the callback function to execute when the task is executed.
|
||||
\param desc an arbitrary description of the task.
|
||||
\param group a group id tag to link multiple tasks to a single entity.
|
||||
\param cmd_id an arbitrary index number be used in the callback.
|
||||
\param cmd_arg user data to be passed to the callback.
|
||||
\param flags flags to alter behaviour
|
||||
\return the id of the task
|
||||
*/
|
||||
SWITCH_DECLARE(uint32_t) switch_core_scheduler_add_task(time_t task_runtime,
|
||||
switch_core_scheduler_func_t func,
|
||||
char *desc,
|
||||
char *group,
|
||||
uint32_t cmd_id,
|
||||
void *cmd_arg,
|
||||
switch_scheduler_flag_t flags);
|
||||
|
||||
/*!
|
||||
\brief Delete a scheduled task
|
||||
\param task_id the id of the task
|
||||
\return SWITCH_STATUS_SUCCESS if the task was deleted.
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_scheduler_del_task_id(uint32_t task_id);
|
||||
|
||||
/*!
|
||||
\brief Delete a scheduled task based on the group name
|
||||
\param group the group name
|
||||
\return SWITCH_STATUS_SUCCESS if any tasks were deleted
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_scheduler_del_task_group(char *group);
|
||||
|
||||
|
||||
///\}
|
||||
|
||||
/*!
|
||||
\brief Add a media bug to the session
|
||||
\param session the session to add the bug to
|
||||
@@ -178,8 +125,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_scheduler_del_task_group(char *group
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_bug_add(switch_core_session_t *session,
|
||||
switch_media_bug_callback_t callback,
|
||||
void *user_data,
|
||||
switch_media_bug_flag_t flags,
|
||||
switch_media_bug_t **new_bug);
|
||||
switch_media_bug_flag_t flags, switch_media_bug_t **new_bug);
|
||||
/*!
|
||||
\brief Obtain private data from a media bug
|
||||
\param bug the bug to get the data from
|
||||
@@ -208,6 +154,12 @@ SWITCH_DECLARE(void) switch_core_media_bug_set_replace_frame(switch_media_bug_t
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove(switch_core_session_t *session, switch_media_bug_t **bug);
|
||||
|
||||
/*!
|
||||
\brief Close and destroy a media bug
|
||||
\param bug bug to remove
|
||||
\return SWITCH_STATUS_SUCCESS if the operation was a success
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_bug_close(switch_media_bug_t **bug);
|
||||
/*!
|
||||
\brief Remove all media bugs from the session
|
||||
\param session the session to remove the bugs from
|
||||
@@ -296,9 +248,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_destroy(void);
|
||||
|
||||
#ifdef SWITCH_DEBUG_RWLOCKS
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_perform_read_lock(switch_core_session_t *session,
|
||||
const char *file,
|
||||
const char *func,
|
||||
int line);
|
||||
const char *file, const char *func, int line);
|
||||
#endif
|
||||
|
||||
/*!
|
||||
@@ -315,9 +265,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_lock(switch_core_sessio
|
||||
|
||||
#ifdef SWITCH_DEBUG_RWLOCKS
|
||||
SWITCH_DECLARE(void) switch_core_session_perform_write_lock(switch_core_session_t *session,
|
||||
const char *file,
|
||||
const char *func,
|
||||
int line);
|
||||
const char *file, const char *func, int line);
|
||||
#endif
|
||||
|
||||
/*!
|
||||
@@ -332,9 +280,7 @@ SWITCH_DECLARE(void) switch_core_session_write_lock(switch_core_session_t *sessi
|
||||
|
||||
#ifdef SWITCH_DEBUG_RWLOCKS
|
||||
SWITCH_DECLARE(void) switch_core_session_perform_rwunlock(switch_core_session_t *session,
|
||||
const char *file,
|
||||
const char *func,
|
||||
int line);
|
||||
const char *file, const char *func, int line);
|
||||
#endif
|
||||
|
||||
/*!
|
||||
@@ -479,7 +425,8 @@ SWITCH_DECLARE(switch_memory_pool_t *) switch_core_session_get_pool(switch_core_
|
||||
\param pool the pool to use for the allocation (a new one will be used if NULL)
|
||||
\return the newly created session
|
||||
*/
|
||||
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request(const switch_endpoint_interface_t *endpoint_interface, switch_memory_pool_t **pool);
|
||||
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request(const switch_endpoint_interface_t
|
||||
*endpoint_interface, switch_memory_pool_t **pool);
|
||||
|
||||
/*!
|
||||
\brief Destroy a session and return the memory pool to the core
|
||||
@@ -500,7 +447,8 @@ SWITCH_DECLARE(uint32_t) switch_core_session_count(void);
|
||||
\param pool the pool to use
|
||||
\return the newly created session
|
||||
*/
|
||||
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_by_name(char *endpoint_name, switch_memory_pool_t **pool);
|
||||
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_request_by_name(char *endpoint_name,
|
||||
switch_memory_pool_t **pool);
|
||||
|
||||
/*!
|
||||
\brief Launch the session thread (state machine) on a given session
|
||||
@@ -535,9 +483,8 @@ SWITCH_DECLARE(char *) switch_core_get_uuid(void);
|
||||
|
||||
#ifdef SWITCH_DEBUG_RWLOCKS
|
||||
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_perform_locate(char *uuid_str,
|
||||
const char *file,
|
||||
const char *func,
|
||||
int line);
|
||||
const char *file,
|
||||
const char *func, int line);
|
||||
#endif
|
||||
|
||||
/*!
|
||||
@@ -578,7 +525,8 @@ SWITCH_DECLARE(void) switch_core_session_hupall(switch_call_cause_t cause);
|
||||
\param message the switch_core_session_message_t object to send
|
||||
\return the status returned by the message handler
|
||||
*/
|
||||
SWITCH_DECLARE (switch_status_t) switch_core_session_message_send(char *uuid_str, switch_core_session_message_t *message);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_message_send(char *uuid_str,
|
||||
switch_core_session_message_t *message);
|
||||
|
||||
/*!
|
||||
\brief Queue a message on a session
|
||||
@@ -586,7 +534,8 @@ SWITCH_DECLARE (switch_status_t) switch_core_session_message_send(char *uuid_str
|
||||
\param message the message to queue
|
||||
\return SWITCH_STATUS_SUCCESS if the message was queued
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_queue_message(switch_core_session_t *session, switch_core_session_message_t *message);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_queue_message(switch_core_session_t *session,
|
||||
switch_core_session_message_t *message);
|
||||
|
||||
/*!
|
||||
\brief Queue an indication message on a session
|
||||
@@ -594,7 +543,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_queue_message(switch_core_se
|
||||
\param indication the indication message to queue
|
||||
\return SWITCH_STATUS_SUCCESS if the message was queued
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_queue_indication(switch_core_session_t *session, switch_core_session_message_types_t indication);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_queue_indication(switch_core_session_t *session,
|
||||
switch_core_session_message_types_t indication);
|
||||
|
||||
/*!
|
||||
\brief DE-Queue an message on a given session
|
||||
@@ -602,7 +552,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_queue_indication(switch_core
|
||||
\param message the de-queued message
|
||||
\return the SWITCH_STATUS_SUCCESS if the message was de-queued
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_message(switch_core_session_t *session, switch_core_session_message_t **message);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_message(switch_core_session_t *session,
|
||||
switch_core_session_message_t **message);
|
||||
|
||||
/*!
|
||||
\brief Flush a message queue on a given session
|
||||
@@ -625,7 +576,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_event_send(char *uuid_str, s
|
||||
\param event the event to receive
|
||||
\return the status returned by the handler
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_receive_event(switch_core_session_t *session, switch_event_t **event);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_receive_event(switch_core_session_t *session,
|
||||
switch_event_t **event);
|
||||
|
||||
/*!
|
||||
\brief Retrieve private user data from a session
|
||||
@@ -671,7 +623,8 @@ SWITCH_DECLARE(int) switch_core_session_get_stream_count(switch_core_session_t *
|
||||
\param func a function to execute in the thread
|
||||
\param obj an arguement
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_core_session_launch_thread(switch_core_session_t *session, void *(*func)(switch_thread_t *, void *), void *obj);
|
||||
SWITCH_DECLARE(void) switch_core_session_launch_thread(switch_core_session_t *session,
|
||||
void *(*func) (switch_thread_t *, void *), void *obj);
|
||||
|
||||
/*!
|
||||
\brief Signal a thread using a thread session to terminate
|
||||
@@ -685,7 +638,8 @@ SWITCH_DECLARE(void) switch_core_thread_session_end(switch_core_thread_session_t
|
||||
\param stream_id which logical media channel to use
|
||||
\param thread_session the thread_session to use
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_core_service_session(switch_core_session_t *session, switch_core_thread_session_t *thread_session, int stream_id);
|
||||
SWITCH_DECLARE(void) switch_core_service_session(switch_core_session_t *session,
|
||||
switch_core_thread_session_t *thread_session, int stream_id);
|
||||
|
||||
/*!
|
||||
\brief Request an outgoing session spawned from an existing session using a desired endpoing module
|
||||
@@ -715,7 +669,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_answer_channel(switch_core_s
|
||||
\param message the message to recieve
|
||||
\return the status returned by the message handler
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_receive_message(switch_core_session_t *session, switch_core_session_message_t *message);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_receive_message(switch_core_session_t *session,
|
||||
switch_core_session_message_t *message);
|
||||
|
||||
/*!
|
||||
\brief Queue an event on a given session
|
||||
@@ -739,7 +694,8 @@ SWITCH_DECLARE(int32_t) switch_core_session_event_count(switch_core_session_t *s
|
||||
\param event the de-queued event
|
||||
\return the SWITCH_STATUS_SUCCESS if the event was de-queued
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_event(switch_core_session_t *session, switch_event_t **event);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_event(switch_core_session_t *session,
|
||||
switch_event_t **event);
|
||||
|
||||
/*!
|
||||
\brief Queue a private event on a given session
|
||||
@@ -747,7 +703,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_event(switch_core_se
|
||||
\param event the event to queue
|
||||
\return the status returned by the message handler
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_queue_private_event(switch_core_session_t *session, switch_event_t **event);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_queue_private_event(switch_core_session_t *session,
|
||||
switch_event_t **event);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -763,7 +720,8 @@ SWITCH_DECLARE(int32_t) switch_core_session_private_event_count(switch_core_sess
|
||||
\param event the de-queued event
|
||||
\return the SWITCH_STATUS_SUCCESS if the event was de-queued
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_private_event(switch_core_session_t *session, switch_event_t **event);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_private_event(switch_core_session_t *session,
|
||||
switch_event_t **event);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -774,7 +732,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_private_event(switch
|
||||
\param stream_id which logical media channel to use
|
||||
\return SWITCH_STATUS_SUCCESS a the frame was read
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout, int stream_id);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_session_t *session, switch_frame_t **frame,
|
||||
int timeout, int stream_id);
|
||||
|
||||
/*!
|
||||
\brief Reset the buffers and resampler on a session
|
||||
@@ -790,14 +749,14 @@ SWITCH_DECLARE(void) switch_core_session_reset(switch_core_session_t *session);
|
||||
\param stream_id which logical media channel to use
|
||||
\return SWITCH_STATUS_SUCCESS a the frame was written
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout, int stream_id);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_session_t *session, switch_frame_t *frame,
|
||||
int timeout, int stream_id);
|
||||
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_perform_kill_channel(switch_core_session_t *session,
|
||||
const char *file,
|
||||
const char *func,
|
||||
int line,
|
||||
switch_signal_t sig);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_perform_kill_channel(switch_core_session_t *session,
|
||||
const char *file,
|
||||
const char *func,
|
||||
int line, switch_signal_t sig);
|
||||
/*!
|
||||
\brief Send a signal to a channel
|
||||
\param session session to send signal to
|
||||
@@ -813,7 +772,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_perform_kill_channel(switch_
|
||||
\param stream_id which logical media channel to use
|
||||
\return SWITCH_STATUS_SUCCESS if data is available for read within timeframe specified
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_waitfor_read(switch_core_session_t *session, int timeout, int stream_id);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_waitfor_read(switch_core_session_t *session, int timeout,
|
||||
int stream_id);
|
||||
|
||||
/*!
|
||||
\brief Wait for a session to be ready for output
|
||||
@@ -822,7 +782,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_waitfor_read(switch_core_ses
|
||||
\param stream_id which logical media channel to use
|
||||
\return SWITCH_STATUS_SUCCESS if the session is available for write within timeframe specified
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_waitfor_write(switch_core_session_t *session, int timeout, int stream_id);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_waitfor_write(switch_core_session_t *session, int timeout,
|
||||
int stream_id);
|
||||
|
||||
/*!
|
||||
\brief Send DTMF to a session
|
||||
@@ -832,91 +793,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_waitfor_write(switch_core_se
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_send_dtmf(switch_core_session_t *session, char *dtmf);
|
||||
|
||||
/*!
|
||||
\brief Add an event hook to be executed when a session requests an outgoing extension
|
||||
\param session session to bind hook to
|
||||
\param outgoing_channel hook to bind
|
||||
\return SWITCH_STATUS_SUCCESS on suceess
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_add_event_hook_outgoing(switch_core_session_t *session, switch_outgoing_channel_hook_t outgoing_channel);
|
||||
///\}
|
||||
|
||||
///\defgroup shooks Session Hook Callbacks
|
||||
///\ingroup core1
|
||||
///\{
|
||||
/*!
|
||||
\brief Add an event hook to be executed when a session answers a channel
|
||||
\param session session to bind hook to
|
||||
\param answer_channel hook to bind
|
||||
\return SWITCH_STATUS_SUCCESS on suceess
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_add_event_hook_answer_channel(switch_core_session_t *session, switch_answer_channel_hook_t answer_channel);
|
||||
|
||||
/*!
|
||||
\brief Add an event hook to be executed when a session sends a message
|
||||
\param session session to bind hook to
|
||||
\param receive_message hook to bind
|
||||
\return SWITCH_STATUS_SUCCESS on suceess
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_add_event_hook_receive_message(switch_core_session_t *session, switch_receive_message_hook_t receive_message);
|
||||
|
||||
/*!
|
||||
\brief Add an event hook to be executed when a session reads a frame
|
||||
\param session session to bind hook to
|
||||
\param read_frame hook to bind
|
||||
\return SWITCH_STATUS_SUCCESS on suceess
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_add_event_hook_read_frame(switch_core_session_t *session, switch_read_frame_hook_t read_frame);
|
||||
|
||||
/*!
|
||||
\brief Add an event hook to be executed when a session writes a frame
|
||||
\param session session to bind hook to
|
||||
\param write_frame hook to bind
|
||||
\return SWITCH_STATUS_SUCCESS on suceess
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_add_event_hook_write_frame(switch_core_session_t *session, switch_write_frame_hook_t write_frame);
|
||||
|
||||
/*!
|
||||
\brief Add an event hook to be executed when a session kills a channel
|
||||
\param session session to bind hook to
|
||||
\param kill_channel hook to bind
|
||||
\return SWITCH_STATUS_SUCCESS on suceess
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_add_event_hook_kill_channel(switch_core_session_t *session, switch_kill_channel_hook_t kill_channel);
|
||||
|
||||
/*!
|
||||
\brief Add an event hook to be executed when a session waits for a read event
|
||||
\param session session to bind hook to
|
||||
\param waitfor_read hook to bind
|
||||
\return SWITCH_STATUS_SUCCESS on suceess
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_add_event_hook_waitfor_read(switch_core_session_t *session, switch_waitfor_read_hook_t waitfor_read);
|
||||
|
||||
/*!
|
||||
\brief Add an event hook to be executed when a session waits for a write event
|
||||
\param session session to bind hook to
|
||||
\param waitfor_write hook to bind
|
||||
\return SWITCH_STATUS_SUCCESS on suceess
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_add_event_hook_waitfor_write(switch_core_session_t *session, switch_waitfor_write_hook_t waitfor_write);
|
||||
|
||||
/*!
|
||||
\brief Add an event hook to be executed when a session sends dtmf
|
||||
\param session session to bind hook to
|
||||
\param send_dtmf hook to bind
|
||||
\return SWITCH_STATUS_SUCCESS on suceess
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_add_event_hook_send_dtmf(switch_core_session_t *session, switch_send_dtmf_hook_t send_dtmf);
|
||||
|
||||
/*!
|
||||
\brief Add an event hook to be executed when a session receives a state change signal
|
||||
\param session session to bind hook to
|
||||
\param state_change hook to bind
|
||||
\return SWITCH_STATUS_SUCCESS on suceess
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_add_event_hook_state_change(switch_core_session_t *session,
|
||||
switch_answer_channel_hook_t state_change);
|
||||
///\}
|
||||
|
||||
///\defgroup hashf Hash Functions
|
||||
///\ingroup core1
|
||||
@@ -984,7 +862,8 @@ SWITCH_DECLARE(void *) switch_core_hash_find(switch_hash_t *hash, const char *ke
|
||||
\param pool the memory pool to use for allocation
|
||||
\return
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_timer_init(switch_timer_t *timer, char *timer_name, int interval, int samples, switch_memory_pool_t *pool);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_timer_init(switch_timer_t *timer, char *timer_name, int interval,
|
||||
int samples, switch_memory_pool_t *pool);
|
||||
|
||||
/*!
|
||||
\brief Wait for one cycle on an existing timer
|
||||
@@ -1031,14 +910,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_timer_destroy(switch_timer_t *timer)
|
||||
\param pool the memory pool to use
|
||||
\return SWITCH_STATUS_SUCCESS if the handle is allocated
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_codec_init(switch_codec_t *codec,
|
||||
char *codec_name,
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_codec_init(switch_codec_t *codec,
|
||||
char *codec_name,
|
||||
char *fmtp,
|
||||
uint32_t rate,
|
||||
int ms,
|
||||
int channels,
|
||||
uint32_t rate,
|
||||
int ms,
|
||||
int channels,
|
||||
uint32_t flags,
|
||||
const switch_codec_settings_t *codec_settings,
|
||||
const switch_codec_settings_t *codec_settings,
|
||||
switch_memory_pool_t *pool);
|
||||
|
||||
/*!
|
||||
@@ -1056,14 +935,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_init(switch_codec_t *codec,
|
||||
\note encoded_data_len will be rewritten to the in-use size of encoded_data
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_codec_encode(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);
|
||||
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);
|
||||
|
||||
/*!
|
||||
\brief Decode data using a codec handle
|
||||
@@ -1080,14 +958,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_encode(switch_codec_t *codec,
|
||||
\note decoded_data_len will be rewritten to the in-use size of decoded_data
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_codec_decode(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_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);
|
||||
|
||||
/*!
|
||||
\brief Destroy an initalized codec handle
|
||||
@@ -1102,7 +979,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_destroy(switch_codec_t *codec)
|
||||
\param codec the codec to add
|
||||
\return SWITCH_STATUS_SUCCESS if successful
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_set_read_codec(switch_core_session_t *session, switch_codec_t *codec);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_set_read_codec(switch_core_session_t *session,
|
||||
switch_codec_t *codec);
|
||||
|
||||
/*!
|
||||
\brief Retrieve the read codec from a given session
|
||||
@@ -1117,7 +995,8 @@ SWITCH_DECLARE(switch_codec_t *) switch_core_session_get_read_codec(switch_core_
|
||||
\param codec the codec to add
|
||||
\return SWITCH_STATUS_SUCCESS if successful
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_set_write_codec(switch_core_session_t *session, switch_codec_t *codec);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_session_set_write_codec(switch_core_session_t *session,
|
||||
switch_codec_t *codec);
|
||||
|
||||
/*!
|
||||
\brief Retrieve the write codec from a given session
|
||||
@@ -1177,12 +1056,10 @@ SWITCH_DECLARE(void) switch_core_db_test_reactive(switch_core_db_t *db, char *te
|
||||
\return SWITCH_STATUS_SUCCESS if the file is opened
|
||||
\note the loadable module used is chosen based on the file extension
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_file_open(switch_file_handle_t *fh,
|
||||
char *file_path,
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_file_open(switch_file_handle_t *fh,
|
||||
char *file_path,
|
||||
uint8_t channels,
|
||||
uint32_t rate,
|
||||
unsigned int flags,
|
||||
switch_memory_pool_t *pool);
|
||||
uint32_t rate, unsigned int flags, switch_memory_pool_t *pool);
|
||||
/*!
|
||||
\brief Read media from a file handle
|
||||
\param fh the file handle to read from (must be initilized by you memset all 0 for read, fill in channels and rate for write)
|
||||
@@ -1209,7 +1086,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_write(switch_file_handle_t *fh,
|
||||
\param whence the indicator (see traditional seek)
|
||||
\return SWITCH_STATUS_SUCCESS with cur_pos adjusted to new position
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_file_seek(switch_file_handle_t *fh, unsigned int *cur_pos, int64_t samples, int whence);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_file_seek(switch_file_handle_t *fh, unsigned int *cur_pos, int64_t samples,
|
||||
int whence);
|
||||
|
||||
/*!
|
||||
\brief Set metadata to the desired string
|
||||
@@ -1218,7 +1096,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_seek(switch_file_handle_t *fh,
|
||||
\param string the string to add
|
||||
\return SWITCH_STATUS_SUCCESS with cur_pos adjusted to new position
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_file_set_string(switch_file_handle_t *fh, switch_audio_col_t col, const char *string);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_file_set_string(switch_file_handle_t *fh, switch_audio_col_t col,
|
||||
const char *string);
|
||||
|
||||
/*!
|
||||
\brief get metadata of the desired string
|
||||
@@ -1227,7 +1106,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_set_string(switch_file_handle_t
|
||||
\param string pointer to the string to fetch
|
||||
\return SWITCH_STATUS_SUCCESS with cur_pos adjusted to new position
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_file_get_string(switch_file_handle_t *fh, switch_audio_col_t col, const char **string);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_file_get_string(switch_file_handle_t *fh, switch_audio_col_t col,
|
||||
const char **string);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -1251,12 +1131,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_close(switch_file_handle_t *fh)
|
||||
\param pool the pool to use (NULL for new pool)
|
||||
\return SWITCH_STATUS_SUCCESS if the handle is opened
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_speech_open(switch_speech_handle_t *sh,
|
||||
char *module_name,
|
||||
char *voice_name,
|
||||
unsigned int rate,
|
||||
switch_speech_flag_t *flags,
|
||||
switch_memory_pool_t *pool);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_speech_open(switch_speech_handle_t *sh,
|
||||
char *module_name,
|
||||
char *voice_name,
|
||||
unsigned int rate,
|
||||
switch_speech_flag_t *flags, switch_memory_pool_t *pool);
|
||||
/*!
|
||||
\brief Feed text to the TTS module
|
||||
\param sh the speech handle to feed
|
||||
@@ -1264,7 +1143,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_speech_open(switch_speech_handle_t *
|
||||
\param flags flags in/out for fine tuning
|
||||
\return SWITCH_STATUS_SUCCESS with len adjusted to the bytes written if successful
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_speech_feed_tts(switch_speech_handle_t *sh, char *text, switch_speech_flag_t *flags);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_speech_feed_tts(switch_speech_handle_t *sh, char *text,
|
||||
switch_speech_flag_t *flags);
|
||||
|
||||
/*!
|
||||
\brief Flush TTS audio on a given handle
|
||||
@@ -1305,11 +1185,10 @@ SWITCH_DECLARE(void) switch_core_speech_float_param_tts(switch_speech_handle_t *
|
||||
\param flags flags in/out for fine tuning
|
||||
\return SWITCH_STATUS_SUCCESS with len adjusted to the bytes written if successful
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_speech_read_tts(switch_speech_handle_t *sh,
|
||||
void *data,
|
||||
switch_size_t *datalen,
|
||||
uint32_t *rate,
|
||||
switch_speech_flag_t *flags);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_speech_read_tts(switch_speech_handle_t *sh,
|
||||
void *data,
|
||||
switch_size_t *datalen,
|
||||
uint32_t * rate, switch_speech_flag_t *flags);
|
||||
/*!
|
||||
\brief Close an open speech handle
|
||||
\param sh the speech handle to close
|
||||
@@ -1334,9 +1213,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_open(switch_asr_handle_t *ah,
|
||||
char *module_name,
|
||||
char *codec,
|
||||
int rate,
|
||||
char *dest,
|
||||
switch_asr_flag_t *flags,
|
||||
switch_memory_pool_t *pool);
|
||||
char *dest, switch_asr_flag_t *flags, switch_memory_pool_t *pool);
|
||||
|
||||
/*!
|
||||
\brief Close an asr handle
|
||||
@@ -1354,7 +1231,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_close(switch_asr_handle_t *ah, s
|
||||
\param flags flags to influence behaviour
|
||||
\return SWITCH_STATUS_SUCCESS
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_asr_feed(switch_asr_handle_t *ah, void *data, unsigned int len, switch_asr_flag_t *flags);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_asr_feed(switch_asr_handle_t *ah, void *data, unsigned int len,
|
||||
switch_asr_flag_t *flags);
|
||||
|
||||
/*!
|
||||
\brief Check an asr handle for results
|
||||
@@ -1371,7 +1249,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_check_results(switch_asr_handle_
|
||||
\param flags flags to influence behaviour
|
||||
\return SWITCH_STATUS_SUCCESS
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_asr_get_results(switch_asr_handle_t *ah, char **xmlstr, switch_asr_flag_t *flags);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_asr_get_results(switch_asr_handle_t *ah, char **xmlstr,
|
||||
switch_asr_flag_t *flags);
|
||||
|
||||
/*!
|
||||
\brief Load a grammar to an asr handle
|
||||
@@ -1420,12 +1299,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_asr_resume(switch_asr_handle_t *ah);
|
||||
\param pool the pool to use (NULL for new pool)
|
||||
\return SWITCH_STATUS_SUCCESS if the handle is opened
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_directory_open(switch_directory_handle_t *dh,
|
||||
char *module_name,
|
||||
char *source,
|
||||
char *dsn,
|
||||
char *passwd,
|
||||
switch_memory_pool_t *pool);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_directory_open(switch_directory_handle_t *dh,
|
||||
char *module_name,
|
||||
char *source,
|
||||
char *dsn, char *passwd, switch_memory_pool_t *pool);
|
||||
|
||||
/*!
|
||||
\brief Query a directory handle
|
||||
@@ -1471,6 +1348,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_directory_close(switch_directory_han
|
||||
*/
|
||||
SWITCH_DECLARE(FILE *) switch_core_data_channel(switch_text_channel_t channel);
|
||||
|
||||
/*!
|
||||
\brief Determines if the core is ready to take calls
|
||||
\return SWITCH_TRUE or SWITCH_FALSE
|
||||
*/
|
||||
SWITCH_DECLARE(switch_bool_t) switch_core_ready(void);
|
||||
|
||||
/*!
|
||||
\brief Execute a management operation.
|
||||
\param relative_oid the relative oid of the operation.
|
||||
@@ -1481,8 +1364,7 @@ SWITCH_DECLARE(FILE *) switch_core_data_channel(switch_text_channel_t channel);
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_management_exec(char *relative_oid,
|
||||
switch_management_action_t action,
|
||||
char *data,
|
||||
switch_size_t datalen);
|
||||
char *data, switch_size_t datalen);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -1522,7 +1404,7 @@ SWITCH_DECLARE(switch_time_t) switch_core_uptime(void);
|
||||
\param val the command arguement (if needed)
|
||||
\return 0 on success nonzero on error
|
||||
*/
|
||||
SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, uint32_t *val);
|
||||
SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, uint32_t * val);
|
||||
|
||||
/*!
|
||||
\brief Get the output console
|
||||
@@ -1532,7 +1414,8 @@ SWITCH_DECLARE(FILE *) switch_core_get_console(void);
|
||||
/*!
|
||||
\brief Launch a thread
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_core_launch_thread(void *(*func)(switch_thread_t *, void*), void *obj, switch_memory_pool_t *pool);
|
||||
SWITCH_DECLARE(void) switch_core_launch_thread(void *(*func) (switch_thread_t *, void *), void *obj,
|
||||
switch_memory_pool_t *pool);
|
||||
|
||||
/*!
|
||||
\brief Initiate Globals
|
||||
@@ -1553,9 +1436,7 @@ SWITCH_DECLARE(uint8_t) switch_core_session_compare(switch_core_session_t *a, sw
|
||||
*/
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
@@ -36,28 +36,24 @@
|
||||
#define SWITCH_CORE_DB_H
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
/**
|
||||
* @defgroup switch_sqlite_top Brought To You By SQLite
|
||||
* @ingroup FREESWITCH
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup switch_core_db Database Routines
|
||||
* @ingroup switch_sqlite_top
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Each open database is represented by an instance of the
|
||||
* following opaque structure.
|
||||
*/
|
||||
|
||||
typedef struct sqlite3 switch_core_db_t;
|
||||
typedef struct sqlite3 switch_core_db_t;
|
||||
typedef struct sqlite3_stmt switch_core_db_stmt_t;
|
||||
|
||||
typedef int (*switch_core_db_callback_func_t)(void *pArg, int argc, char **argv, char **columnNames);
|
||||
typedef int (*switch_core_db_callback_func_t) (void *pArg, int argc, char **argv, char **columnNames);
|
||||
|
||||
/*
|
||||
** These are special value for the destructor that is passed in as the
|
||||
@@ -71,7 +67,7 @@ typedef int (*switch_core_db_callback_func_t)(void *pArg, int argc, char **argv,
|
||||
** The typedef is necessary to work around problems in certain
|
||||
** C++ compilers.
|
||||
*/
|
||||
typedef void (*switch_core_db_destructor_type_t)(void*);
|
||||
typedef void (*switch_core_db_destructor_type_t) (void *);
|
||||
#define SWITCH_CORE_DB_STATIC ((switch_core_db_destructor_type_t)0)
|
||||
#define SWITCH_CORE_DB_TRANSIENT ((switch_core_db_destructor_type_t)-1)
|
||||
|
||||
@@ -144,14 +140,14 @@ SWITCH_DECLARE(int) switch_core_db_open(const char *filename, switch_core_db_t *
|
||||
*
|
||||
* Return the value as UTF-8 text.
|
||||
*/
|
||||
SWITCH_DECLARE(const unsigned char *)switch_core_db_column_text(switch_core_db_stmt_t *stmt, int iCol);
|
||||
SWITCH_DECLARE(const unsigned char *) switch_core_db_column_text(switch_core_db_stmt_t *stmt, int iCol);
|
||||
|
||||
/**
|
||||
* The first parameter is a compiled SQL statement. This function returns
|
||||
* the column heading for the Nth column of that statement, where N is the
|
||||
* second function parameter. The string returned is UTF-8.
|
||||
*/
|
||||
SWITCH_DECLARE(const char *)switch_core_db_column_name(switch_core_db_stmt_t *stmt, int N);
|
||||
SWITCH_DECLARE(const char *) switch_core_db_column_name(switch_core_db_stmt_t *stmt, int N);
|
||||
|
||||
/**
|
||||
* Return the number of columns in the result set returned by the compiled
|
||||
@@ -168,7 +164,7 @@ SWITCH_DECLARE(int) switch_core_db_column_count(switch_core_db_stmt_t *pStmt);
|
||||
* The string "not an error" is returned when the most recent API call was
|
||||
* successful.
|
||||
*/
|
||||
SWITCH_DECLARE(const char *)switch_core_db_errmsg(switch_core_db_t *db);
|
||||
SWITCH_DECLARE(const char *) switch_core_db_errmsg(switch_core_db_t *db);
|
||||
|
||||
/**
|
||||
* A function to executes one or more statements of SQL.
|
||||
@@ -212,9 +208,7 @@ SWITCH_DECLARE(const char *)switch_core_db_errmsg(switch_core_db_t *db);
|
||||
*/
|
||||
SWITCH_DECLARE(int) switch_core_db_exec(switch_core_db_t *db,
|
||||
const char *sql,
|
||||
switch_core_db_callback_func_t callback,
|
||||
void *data,
|
||||
char **errmsg);
|
||||
switch_core_db_callback_func_t callback, void *data, char **errmsg);
|
||||
|
||||
/**
|
||||
* This function is called to delete a compiled
|
||||
@@ -256,9 +250,7 @@ SWITCH_DECLARE(int) switch_core_db_finalize(switch_core_db_stmt_t *pStmt);
|
||||
*/
|
||||
SWITCH_DECLARE(int) switch_core_db_prepare(switch_core_db_t *db,
|
||||
const char *zSql,
|
||||
int nBytes,
|
||||
switch_core_db_stmt_t **ppStmt,
|
||||
const char **pzTail);
|
||||
int nBytes, switch_core_db_stmt_t **ppStmt, const char **pzTail);
|
||||
|
||||
/**
|
||||
* After an SQL query has been compiled with a call to either
|
||||
@@ -375,7 +367,8 @@ SWITCH_DECLARE(int) switch_core_db_bind_int64(switch_core_db_stmt_t *pStmt, int
|
||||
* an switch_core_db_prepare() or sqlite3_reset(). Unbound parameterss are
|
||||
* interpreted as NULL.
|
||||
*/
|
||||
SWITCH_DECLARE(int) switch_core_db_bind_text(switch_core_db_stmt_t *pStmt, int i, const char *zData, int nData, switch_core_db_destructor_type_t xDel);
|
||||
SWITCH_DECLARE(int) switch_core_db_bind_text(switch_core_db_stmt_t *pStmt, int i, const char *zData, int nData,
|
||||
switch_core_db_destructor_type_t xDel);
|
||||
|
||||
/**
|
||||
* In the SQL strings input to switch_core_db_prepare(),
|
||||
@@ -451,14 +444,13 @@ SWITCH_DECLARE(int64_t) switch_core_db_last_insert_rowid(switch_core_db_t *db);
|
||||
*
|
||||
* The return value of this routine is the same as from switch_core_db_exec().
|
||||
*/
|
||||
SWITCH_DECLARE(int) switch_core_db_get_table(
|
||||
switch_core_db_t *db, /* An open database */
|
||||
const char *sql, /* SQL to be executed */
|
||||
char ***resultp, /* Result written to a char *[] that this points to */
|
||||
int *nrow, /* Number of result rows written here */
|
||||
int *ncolumn, /* Number of result columns written here */
|
||||
char **errmsg /* Error msg written here */
|
||||
);
|
||||
SWITCH_DECLARE(int) switch_core_db_get_table(switch_core_db_t *db, /* An open database */
|
||||
const char *sql, /* SQL to be executed */
|
||||
char ***resultp, /* Result written to a char *[] that this points to */
|
||||
int *nrow, /* Number of result rows written here */
|
||||
int *ncolumn, /* Number of result columns written here */
|
||||
char **errmsg /* Error msg written here */
|
||||
);
|
||||
|
||||
/**
|
||||
* Call this routine to free the memory that sqlite3_get_table() allocated.
|
||||
@@ -471,36 +463,36 @@ SWITCH_DECLARE(void) switch_core_db_free_table(char **result);
|
||||
SWITCH_DECLARE(void) switch_core_db_free(char *z);
|
||||
|
||||
/** Return values for switch_core_db_exec() and switch_core_db_step()*/
|
||||
#define SWITCH_CORE_DB_OK 0 /* Successful result */
|
||||
#define SWITCH_CORE_DB_OK 0 /* Successful result */
|
||||
/* beginning-of-error-codes */
|
||||
#define SWITCH_CORE_DB_ERROR 1 /* SQL error or missing database */
|
||||
#define SWITCH_CORE_DB_INTERNAL 2 /* NOT USED. Internal logic error in SQLite */
|
||||
#define SWITCH_CORE_DB_PERM 3 /* Access permission denied */
|
||||
#define SWITCH_CORE_DB_ABORT 4 /* Callback routine requested an abort */
|
||||
#define SWITCH_CORE_DB_BUSY 5 /* The database file is locked */
|
||||
#define SWITCH_CORE_DB_LOCKED 6 /* A table in the database is locked */
|
||||
#define SWITCH_CORE_DB_NOMEM 7 /* A malloc() failed */
|
||||
#define SWITCH_CORE_DB_READONLY 8 /* Attempt to write a readonly database */
|
||||
#define SWITCH_CORE_DB_INTERRUPT 9 /* Operation terminated by switch_core_db_interrupt()*/
|
||||
#define SWITCH_CORE_DB_IOERR 10 /* Some kind of disk I/O error occurred */
|
||||
#define SWITCH_CORE_DB_CORRUPT 11 /* The database disk image is malformed */
|
||||
#define SWITCH_CORE_DB_NOTFOUND 12 /* NOT USED. Table or record not found */
|
||||
#define SWITCH_CORE_DB_FULL 13 /* Insertion failed because database is full */
|
||||
#define SWITCH_CORE_DB_CANTOPEN 14 /* Unable to open the database file */
|
||||
#define SWITCH_CORE_DB_PROTOCOL 15 /* Database lock protocol error */
|
||||
#define SWITCH_CORE_DB_EMPTY 16 /* Database is empty */
|
||||
#define SWITCH_CORE_DB_SCHEMA 17 /* The database schema changed */
|
||||
#define SWITCH_CORE_DB_TOOBIG 18 /* NOT USED. Too much data for one row */
|
||||
#define SWITCH_CORE_DB_CONSTRAINT 19 /* Abort due to contraint violation */
|
||||
#define SWITCH_CORE_DB_MISMATCH 20 /* Data type mismatch */
|
||||
#define SWITCH_CORE_DB_MISUSE 21 /* Library used incorrectly */
|
||||
#define SWITCH_CORE_DB_NOLFS 22 /* Uses OS features not supported on host */
|
||||
#define SWITCH_CORE_DB_AUTH 23 /* Authorization denied */
|
||||
#define SWITCH_CORE_DB_FORMAT 24 /* Auxiliary database format error */
|
||||
#define SWITCH_CORE_DB_RANGE 25 /* 2nd parameter to switch_core_db_bind out of range */
|
||||
#define SWITCH_CORE_DB_NOTADB 26 /* File opened that is not a database file */
|
||||
#define SWITCH_CORE_DB_ROW 100 /* switch_core_db_step() has another row ready */
|
||||
#define SWITCH_CORE_DB_DONE 101 /* switch_core_db_step() has finished executing */
|
||||
#define SWITCH_CORE_DB_ERROR 1 /* SQL error or missing database */
|
||||
#define SWITCH_CORE_DB_INTERNAL 2 /* NOT USED. Internal logic error in SQLite */
|
||||
#define SWITCH_CORE_DB_PERM 3 /* Access permission denied */
|
||||
#define SWITCH_CORE_DB_ABORT 4 /* Callback routine requested an abort */
|
||||
#define SWITCH_CORE_DB_BUSY 5 /* The database file is locked */
|
||||
#define SWITCH_CORE_DB_LOCKED 6 /* A table in the database is locked */
|
||||
#define SWITCH_CORE_DB_NOMEM 7 /* A malloc() failed */
|
||||
#define SWITCH_CORE_DB_READONLY 8 /* Attempt to write a readonly database */
|
||||
#define SWITCH_CORE_DB_INTERRUPT 9 /* Operation terminated by switch_core_db_interrupt() */
|
||||
#define SWITCH_CORE_DB_IOERR 10 /* Some kind of disk I/O error occurred */
|
||||
#define SWITCH_CORE_DB_CORRUPT 11 /* The database disk image is malformed */
|
||||
#define SWITCH_CORE_DB_NOTFOUND 12 /* NOT USED. Table or record not found */
|
||||
#define SWITCH_CORE_DB_FULL 13 /* Insertion failed because database is full */
|
||||
#define SWITCH_CORE_DB_CANTOPEN 14 /* Unable to open the database file */
|
||||
#define SWITCH_CORE_DB_PROTOCOL 15 /* Database lock protocol error */
|
||||
#define SWITCH_CORE_DB_EMPTY 16 /* Database is empty */
|
||||
#define SWITCH_CORE_DB_SCHEMA 17 /* The database schema changed */
|
||||
#define SWITCH_CORE_DB_TOOBIG 18 /* NOT USED. Too much data for one row */
|
||||
#define SWITCH_CORE_DB_CONSTRAINT 19 /* Abort due to contraint violation */
|
||||
#define SWITCH_CORE_DB_MISMATCH 20 /* Data type mismatch */
|
||||
#define SWITCH_CORE_DB_MISUSE 21 /* Library used incorrectly */
|
||||
#define SWITCH_CORE_DB_NOLFS 22 /* Uses OS features not supported on host */
|
||||
#define SWITCH_CORE_DB_AUTH 23 /* Authorization denied */
|
||||
#define SWITCH_CORE_DB_FORMAT 24 /* Auxiliary database format error */
|
||||
#define SWITCH_CORE_DB_RANGE 25 /* 2nd parameter to switch_core_db_bind out of range */
|
||||
#define SWITCH_CORE_DB_NOTADB 26 /* File opened that is not a database file */
|
||||
#define SWITCH_CORE_DB_ROW 100 /* switch_core_db_step() has another row ready */
|
||||
#define SWITCH_CORE_DB_DONE 101 /* switch_core_db_step() has finished executing */
|
||||
/* end-of-error-codes */
|
||||
|
||||
|
||||
@@ -547,12 +539,10 @@ SWITCH_DECLARE(void) switch_core_db_free(char *z);
|
||||
* should always use %q instead of %s when inserting text into a string
|
||||
* literal.
|
||||
*/
|
||||
SWITCH_DECLARE(char *)switch_mprintf(const char *zFormat,...);
|
||||
SWITCH_DECLARE(char *) switch_mprintf(const char *zFormat, ...);
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
+13
-10
@@ -61,9 +61,8 @@
|
||||
#include <switch.h>
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
/*! \brief An event Header */
|
||||
struct switch_event_header{
|
||||
struct switch_event_header {
|
||||
/*! the header name */
|
||||
char *name;
|
||||
/*! the header value */
|
||||
@@ -139,7 +138,8 @@ SWITCH_DECLARE(switch_status_t) switch_event_shutdown(void);
|
||||
\param subclass_name the subclass name for custom event (only valid when event_id is SWITCH_EVENT_CUSTOM)
|
||||
\return SWITCH_STATUS_SUCCESS on success
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_event_create_subclass(switch_event_t **event, switch_event_types_t event_id, const char *subclass_name);
|
||||
SWITCH_DECLARE(switch_status_t) switch_event_create_subclass(switch_event_t **event, switch_event_types_t event_id,
|
||||
const char *subclass_name);
|
||||
|
||||
/*!
|
||||
\brief Set the priority of an event
|
||||
@@ -172,7 +172,9 @@ SWITCH_DECLARE(char *) switch_event_get_body(switch_event_t *event);
|
||||
\param fmt the value of the header (varargs see standard sprintf family)
|
||||
\return SWITCH_STATUS_SUCCESS if the header was added
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_event_add_header(switch_event_t *event, switch_stack_t stack, const char *header_name, const char *fmt, ...) PRINTF_FUNCTION(4,5);
|
||||
SWITCH_DECLARE(switch_status_t) switch_event_add_header(switch_event_t *event, switch_stack_t stack,
|
||||
const char *header_name, const char *fmt,
|
||||
...) PRINTF_FUNCTION(4, 5);
|
||||
|
||||
/*!
|
||||
\brief Destroy an event
|
||||
@@ -197,7 +199,8 @@ SWITCH_DECLARE(switch_status_t) switch_event_dup(switch_event_t **event, switch_
|
||||
\param user_data optional private data to pass to the event handlers
|
||||
\return
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_event_fire_detailed(char *file, char *func, int line, switch_event_t **event, void *user_data);
|
||||
SWITCH_DECLARE(switch_status_t) switch_event_fire_detailed(char *file, char *func, int line, switch_event_t **event,
|
||||
void *user_data);
|
||||
|
||||
/*!
|
||||
\brief Bind an event callback to a specific event
|
||||
@@ -208,7 +211,8 @@ SWITCH_DECLARE(switch_status_t) switch_event_fire_detailed(char *file, char *fun
|
||||
\param user_data optional user specific data to pass whenever the callback is invoked
|
||||
\return SWITCH_STATUS_SUCCESS if the event was binded
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_event_bind(char *id, switch_event_types_t event, char *subclass_name, switch_event_callback_t callback, void *user_data);
|
||||
SWITCH_DECLARE(switch_status_t) switch_event_bind(char *id, switch_event_types_t event, char *subclass_name,
|
||||
switch_event_callback_t callback, void *user_data);
|
||||
|
||||
/*!
|
||||
\brief Render the name of an event id enumeration
|
||||
@@ -251,7 +255,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_serialize(switch_event_t *event, ch
|
||||
\return the xml object if the operation was successful
|
||||
\note the body supplied by this function will supersede an existing body the event may have
|
||||
*/
|
||||
SWITCH_DECLARE(switch_xml_t) switch_event_xmlize(switch_event_t *event, const char *fmt, ...) PRINTF_FUNCTION(2,3);
|
||||
SWITCH_DECLARE(switch_xml_t) switch_event_xmlize(switch_event_t *event, const char *fmt, ...) PRINTF_FUNCTION(2, 3);
|
||||
|
||||
/*!
|
||||
\brief Determine if the event system has been initilized
|
||||
@@ -266,7 +270,8 @@ SWITCH_DECLARE(switch_status_t) switch_event_running(void);
|
||||
\return SWITCH_STATUS_SUCCESS if the body was added to the event
|
||||
\note the body parameter can be shadowed by the switch_event_reserve_subclass_detailed function
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_event_add_body(switch_event_t *event, const char *fmt, ...) PRINTF_FUNCTION(2,3);
|
||||
SWITCH_DECLARE(switch_status_t) switch_event_add_body(switch_event_t *event, const char *fmt, ...) PRINTF_FUNCTION(2,
|
||||
3);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -311,9 +316,7 @@ SWITCH_DECLARE(void) switch_event_deliver(switch_event_t **event);
|
||||
///\}
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
@@ -39,16 +39,15 @@
|
||||
#include <switch.h>
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
/*! \brief An abstraction of a data frame */
|
||||
struct switch_frame {
|
||||
struct switch_frame {
|
||||
/*! a pointer to the codec information */
|
||||
switch_codec_t *codec;
|
||||
/*! the originating source of the frame */
|
||||
const char *source;
|
||||
/*! the raw packet */
|
||||
void *packet;
|
||||
/*! the size of the raw packet when applicable*/
|
||||
/*! the size of the raw packet when applicable */
|
||||
uint32_t packetlen;
|
||||
/*! the frame data */
|
||||
void *data;
|
||||
@@ -69,9 +68,7 @@ struct switch_frame {
|
||||
};
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
+112
-114
@@ -42,7 +42,6 @@
|
||||
#include <switch.h>
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
/**
|
||||
* @defgroup switch_ivr IVR Library
|
||||
* @ingroup core1
|
||||
@@ -50,8 +49,6 @@ SWITCH_BEGIN_EXTERN_C
|
||||
* building blocks for a higher level IVR interface.
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\brief Generate an XML CDR report.
|
||||
\param session the session to get the data from.
|
||||
@@ -59,7 +56,7 @@ SWITCH_BEGIN_EXTERN_C
|
||||
\return SWITCH_STATUS_SUCCESS if successful
|
||||
\note on success the xml object must be freed
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_generate_xml_cdr(switch_core_session_t *session, switch_xml_t *xml_cdr);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_generate_xml_cdr(switch_core_session_t *session, switch_xml_t * xml_cdr);
|
||||
|
||||
/*!
|
||||
\brief Parse command from an event
|
||||
@@ -89,8 +86,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session,
|
||||
\return SWITCH_STATUS_SUCCESS to keep the collection moving.
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_callback(switch_core_session_t *session,
|
||||
switch_input_args_t *args,
|
||||
uint32_t timeout);
|
||||
switch_input_args_t *args, uint32_t timeout);
|
||||
|
||||
/*!
|
||||
\brief Wait for specified number of DTMF digits, untile terminator is received or until the channel hangs up.
|
||||
@@ -108,8 +104,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_count(switch_core_sess
|
||||
uint32_t buflen,
|
||||
uint32_t maxdigits,
|
||||
const char *terminators,
|
||||
char *terminator,
|
||||
uint32_t timeout);
|
||||
char *terminator, uint32_t timeout);
|
||||
|
||||
/*!
|
||||
\brief Engage background Speech detection on a session
|
||||
@@ -124,9 +119,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_count(switch_core_sess
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech(switch_core_session_t *session,
|
||||
char *mod_name,
|
||||
char *grammar,
|
||||
char *path,
|
||||
char *dest,
|
||||
switch_asr_handle_t *ah);
|
||||
char *path, char *dest, switch_asr_handle_t *ah);
|
||||
|
||||
/*!
|
||||
\brief Stop background Speech detection on a session
|
||||
@@ -156,7 +149,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_resume_detect_speech(switch_core_sess
|
||||
\param path the grammar path
|
||||
\return SWITCH_STATUS_SUCCESS if all is well
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_load_grammar(switch_core_session_t *session, char *grammar, char *path);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_load_grammar(switch_core_session_t *session, char *grammar,
|
||||
char *path);
|
||||
|
||||
/*!
|
||||
\brief Unload a grammar on a background speech detection handle
|
||||
@@ -173,7 +167,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_c
|
||||
\param fh file handle to use (NULL for builtin one)
|
||||
\return SWITCH_STATUS_SUCCESS if all is well
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t *session, char *file, switch_file_handle_t *fh);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t *session, char *file,
|
||||
switch_file_handle_t *fh);
|
||||
|
||||
/*!
|
||||
\brief Stop Recording a session
|
||||
@@ -198,9 +193,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_stop_inband_dtmf_session(switch_core_
|
||||
\note passing a NULL dtmf_callback nad a not NULL buf indicates to copy any dtmf to buf and stop playback.
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *session,
|
||||
switch_file_handle_t *fh,
|
||||
char *file,
|
||||
switch_input_args_t *args);
|
||||
switch_file_handle_t *fh, char *file, switch_input_args_t *args);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -216,10 +209,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
|
||||
\note passing a NULL dtmf_callback nad a not NULL buf indicates to copy any dtmf to buf and stop recording.
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *session,
|
||||
switch_file_handle_t *fh,
|
||||
char *file,
|
||||
switch_input_args_t *args,
|
||||
uint32_t limit);
|
||||
switch_file_handle_t *fh,
|
||||
char *file, switch_input_args_t *args, uint32_t limit);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -239,23 +230,21 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
|
||||
\note to test for digit capture failure look for \\0 in the first position of the buffer
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_play_and_get_digits(switch_core_session_t *session,
|
||||
uint32_t min_digits,
|
||||
uint32_t max_digits,
|
||||
uint32_t max_tries,
|
||||
uint32_t timeout,
|
||||
char* valid_terminators,
|
||||
char* audio_file,
|
||||
char* bad_input_audio_file,
|
||||
void* digit_buffer,
|
||||
uint32_t digit_buffer_length,
|
||||
char* digits_regex);
|
||||
uint32_t min_digits,
|
||||
uint32_t max_digits,
|
||||
uint32_t max_tries,
|
||||
uint32_t timeout,
|
||||
char *valid_terminators,
|
||||
char *audio_file,
|
||||
char *bad_input_audio_file,
|
||||
void *digit_buffer,
|
||||
uint32_t digit_buffer_length, char *digits_regex);
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session_t *session,
|
||||
switch_speech_handle_t *sh,
|
||||
switch_codec_t *codec,
|
||||
switch_timer_t *timer,
|
||||
char *text,
|
||||
switch_input_args_t *args);
|
||||
switch_speech_handle_t *sh,
|
||||
switch_codec_t *codec,
|
||||
switch_timer_t *timer,
|
||||
char *text, switch_input_args_t *args);
|
||||
|
||||
/*!
|
||||
\brief Speak given text with given tts engine
|
||||
@@ -269,12 +258,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session
|
||||
\param buflen the len of buf
|
||||
\return SWITCH_STATUS_SUCCESS if all is well
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *session,
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *session,
|
||||
char *tts_name,
|
||||
char *voice_name,
|
||||
uint32_t rate,
|
||||
char *text,
|
||||
switch_input_args_t *args);
|
||||
uint32_t rate, char *text, switch_input_args_t *args);
|
||||
|
||||
/*!
|
||||
\brief Make an outgoing call
|
||||
@@ -308,11 +295,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
||||
\param peer_session_data data to pass to the DTMF callback for peer_session
|
||||
\return SWITCH_STATUS_SUCCESS if all is well
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_session_t *session,
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_session_t *session,
|
||||
switch_core_session_t *peer_session,
|
||||
switch_input_callback_function_t dtmf_callback,
|
||||
void *session_data,
|
||||
void *peer_session_data);
|
||||
void *session_data, void *peer_session_data);
|
||||
|
||||
/*!
|
||||
\brief Bridge Signalling from one session to another
|
||||
@@ -320,7 +306,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
|
||||
\param peer_session the other session
|
||||
\return SWITCH_STATUS_SUCCESS if all is well
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_signal_bridge(switch_core_session_t *session, switch_core_session_t *peer_session);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_signal_bridge(switch_core_session_t *session,
|
||||
switch_core_session_t *peer_session);
|
||||
|
||||
/*!
|
||||
\brief Transfer an existing session to another location
|
||||
@@ -329,7 +316,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_signal_bridge(switch_core_session_t *
|
||||
\param dialplan the new dialplan (OPTIONAL, may be NULL)
|
||||
\param context the new context (OPTIONAL, may be NULL)
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(switch_core_session_t *session, char *extension, char *dialplan, char *context);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(switch_core_session_t *session, char *extension,
|
||||
char *dialplan, char *context);
|
||||
|
||||
/*!
|
||||
\brief Transfer an existing session to another location in the future
|
||||
@@ -340,7 +328,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(switch_core_session_
|
||||
\param context the new context (OPTIONAL, may be NULL)
|
||||
\return the id of the task
|
||||
*/
|
||||
SWITCH_DECLARE(uint32_t) switch_ivr_schedule_transfer(time_t runtime, char *uuid, char *extension, char *dialplan, char *context);
|
||||
SWITCH_DECLARE(uint32_t) switch_ivr_schedule_transfer(time_t runtime, char *uuid, char *extension, char *dialplan,
|
||||
char *context);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -351,7 +340,8 @@ SWITCH_DECLARE(uint32_t) switch_ivr_schedule_transfer(time_t runtime, char *uuid
|
||||
\param bleg hangup up the B-Leg if possible
|
||||
\return the id of the task
|
||||
*/
|
||||
SWITCH_DECLARE(uint32_t) switch_ivr_schedule_hangup(time_t runtime, char *uuid, switch_call_cause_t cause, switch_bool_t bleg);
|
||||
SWITCH_DECLARE(uint32_t) switch_ivr_schedule_hangup(time_t runtime, char *uuid, switch_call_cause_t cause,
|
||||
switch_bool_t bleg);
|
||||
|
||||
/*!
|
||||
\brief Bridge two existing sessions
|
||||
@@ -413,7 +403,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_unhold(switch_core_session_t *session
|
||||
\param flags flags to send to the request (SMF_ECHO_BRIDGED to send the broadcast to both sides of the call)
|
||||
\return the id of the task
|
||||
*/
|
||||
SWITCH_DECLARE(uint32_t) switch_ivr_schedule_broadcast(time_t runtime, char *uuid, char *path, switch_media_flag_t flags);
|
||||
SWITCH_DECLARE(uint32_t) switch_ivr_schedule_broadcast(time_t runtime, char *uuid, char *path,
|
||||
switch_media_flag_t flags);
|
||||
|
||||
/*!
|
||||
\brief Signal the session to broadcast audio
|
||||
@@ -431,22 +422,24 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(char *uuid, char *path, swi
|
||||
\param var the name of the variable to transfer (NULL for all)
|
||||
\return SWITCH_STATUS_SUCCESS if all is well
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_transfer_variable(switch_core_session_t *sessa, switch_core_session_t *sessb, char *var);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_transfer_variable(switch_core_session_t *sessa, switch_core_session_t *sessb,
|
||||
char *var);
|
||||
|
||||
|
||||
/******************************************************************************************************/
|
||||
|
||||
struct switch_ivr_digit_stream_parser;
|
||||
typedef struct switch_ivr_digit_stream_parser switch_ivr_digit_stream_parser_t;
|
||||
struct switch_ivr_digit_stream;
|
||||
typedef struct switch_ivr_digit_stream switch_ivr_digit_stream_t;
|
||||
struct switch_ivr_digit_stream_parser;
|
||||
typedef struct switch_ivr_digit_stream_parser switch_ivr_digit_stream_parser_t;
|
||||
struct switch_ivr_digit_stream;
|
||||
typedef struct switch_ivr_digit_stream switch_ivr_digit_stream_t;
|
||||
/*!
|
||||
\brief Create a digit stream parser object
|
||||
\param pool the pool to use for the new hash
|
||||
\param parser a pointer to the object pointer
|
||||
\return SWITCH_STATUS_SUCCESS if all is well
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_parser_new(switch_memory_pool_t *pool, switch_ivr_digit_stream_parser_t **parser);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_parser_new(switch_memory_pool_t *pool,
|
||||
switch_ivr_digit_stream_parser_t **parser);
|
||||
|
||||
/*!
|
||||
\brief Destroy a digit stream parser object
|
||||
@@ -461,7 +454,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_parser_destroy(switch_iv
|
||||
\param stream a pointer to the stream object pointer
|
||||
\return NULL if no match found or consumer data that was associated with a given digit string when matched
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_new(switch_ivr_digit_stream_parser_t *parser, switch_ivr_digit_stream_t **stream);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_new(switch_ivr_digit_stream_parser_t *parser,
|
||||
switch_ivr_digit_stream_t **stream);
|
||||
|
||||
/*!
|
||||
\brief Destroys a digit stream object
|
||||
@@ -477,7 +471,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_destroy(switch_ivr_digit
|
||||
\param data consumer data attached to this digit string
|
||||
\return SWITCH_STATUS_SUCCESS if all is well
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_parser_set_event(switch_ivr_digit_stream_parser_t *parser, char *digits, void *data);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_parser_set_event(switch_ivr_digit_stream_parser_t *parser,
|
||||
char *digits, void *data);
|
||||
|
||||
/*!
|
||||
\brief Delete a string to action mapping
|
||||
@@ -485,7 +480,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_parser_set_event(switch_
|
||||
\param digits the digit string to be removed from the map
|
||||
\return SWITCH_STATUS_SUCCESS if all is well
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_parser_del_event(switch_ivr_digit_stream_parser_t *parser, char *digits);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_parser_del_event(switch_ivr_digit_stream_parser_t *parser,
|
||||
char *digits);
|
||||
|
||||
/*!
|
||||
\brief Feed digits collected into the stream for event match testing
|
||||
@@ -493,7 +489,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_parser_del_event(switch_
|
||||
\param digit a digit to collect and test against the map of digit strings
|
||||
\return NULL if no match found or consumer data that was associated with a given digit string when matched
|
||||
*/
|
||||
SWITCH_DECLARE(void *) switch_ivr_digit_stream_parser_feed(switch_ivr_digit_stream_parser_t *parser, switch_ivr_digit_stream_t *stream, char digit);
|
||||
SWITCH_DECLARE(void *) switch_ivr_digit_stream_parser_feed(switch_ivr_digit_stream_parser_t *parser,
|
||||
switch_ivr_digit_stream_t *stream, char digit);
|
||||
|
||||
/*!
|
||||
\brief Reset the collected digit stream to nothing
|
||||
@@ -508,7 +505,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_reset(switch_ivr_digit_s
|
||||
\param digit the terminator digit
|
||||
\return SWITCH_STATUS_SUCCESS if all is well
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_parser_set_terminator(switch_ivr_digit_stream_parser_t *parser, char digit);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_parser_set_terminator(switch_ivr_digit_stream_parser_t *parser,
|
||||
char digit);
|
||||
|
||||
|
||||
/******************************************************************************************************/
|
||||
@@ -524,28 +522,29 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_parser_set_terminator(sw
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
SWITCH_IVR_MENU_FLAG_FALLTOMAIN = (1 << 0),
|
||||
SWITCH_IVR_MENU_FLAG_FREEPOOL = (1 << 1),
|
||||
SWITCH_IVR_MENU_FLAG_STACK = (1 << 2),
|
||||
} switch_ivr_menu_flags;
|
||||
typedef enum {
|
||||
SWITCH_IVR_MENU_FLAG_FALLTOMAIN = (1 << 0),
|
||||
SWITCH_IVR_MENU_FLAG_FREEPOOL = (1 << 1),
|
||||
SWITCH_IVR_MENU_FLAG_STACK = (1 << 2),
|
||||
} switch_ivr_menu_flags;
|
||||
/* Actions are either set in switch_ivr_menu_bind_function or returned by a callback */
|
||||
typedef enum {
|
||||
SWITCH_IVR_ACTION_DIE, /* Exit the menu. */
|
||||
SWITCH_IVR_ACTION_EXECMENU, /* Goto another menu in the stack. */
|
||||
SWITCH_IVR_ACTION_EXECAPP, /* Execute an application. */
|
||||
SWITCH_IVR_ACTION_PLAYSOUND, /* Play a sound. */
|
||||
SWITCH_IVR_ACTION_SAYTEXT, /* say text. */
|
||||
SWITCH_IVR_ACTION_SAYPHRASE, /* say a phrase macro. */
|
||||
SWITCH_IVR_ACTION_BACK, /* Go back 1 menu. */
|
||||
SWITCH_IVR_ACTION_TOMAIN, /* Go back to the top level menu. */
|
||||
SWITCH_IVR_ACTION_TRANSFER, /* Transfer caller to another ext. */
|
||||
SWITCH_IVR_ACTION_NOOP, /* No operation */
|
||||
} switch_ivr_action_t;
|
||||
struct switch_ivr_menu;
|
||||
typedef switch_ivr_action_t switch_ivr_menu_action_function_t(struct switch_ivr_menu *, char *, char *, size_t, void *);
|
||||
typedef struct switch_ivr_menu switch_ivr_menu_t;
|
||||
typedef struct switch_ivr_menu_action switch_ivr_menu_action_t;
|
||||
typedef enum {
|
||||
SWITCH_IVR_ACTION_DIE, /* Exit the menu. */
|
||||
SWITCH_IVR_ACTION_EXECMENU, /* Goto another menu in the stack. */
|
||||
SWITCH_IVR_ACTION_EXECAPP, /* Execute an application. */
|
||||
SWITCH_IVR_ACTION_PLAYSOUND, /* Play a sound. */
|
||||
SWITCH_IVR_ACTION_SAYTEXT, /* say text. */
|
||||
SWITCH_IVR_ACTION_SAYPHRASE, /* say a phrase macro. */
|
||||
SWITCH_IVR_ACTION_BACK, /* Go back 1 menu. */
|
||||
SWITCH_IVR_ACTION_TOMAIN, /* Go back to the top level menu. */
|
||||
SWITCH_IVR_ACTION_TRANSFER, /* Transfer caller to another ext. */
|
||||
SWITCH_IVR_ACTION_NOOP, /* No operation */
|
||||
} switch_ivr_action_t;
|
||||
struct switch_ivr_menu;
|
||||
typedef switch_ivr_action_t switch_ivr_menu_action_function_t(struct switch_ivr_menu *, char *, char *, size_t,
|
||||
void *);
|
||||
typedef struct switch_ivr_menu switch_ivr_menu_t;
|
||||
typedef struct switch_ivr_menu_action switch_ivr_menu_action_t;
|
||||
/******************************************************************************************************/
|
||||
|
||||
/*!
|
||||
@@ -564,19 +563,17 @@ typedef struct switch_ivr_menu_action switch_ivr_menu_action_t;
|
||||
*\param pool memory pool (NULL to create one)
|
||||
*\return SWITCH_STATUS_SUCCESS if the menu was created
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_init(switch_ivr_menu_t **new_menu,
|
||||
switch_ivr_menu_t *main,
|
||||
const char *name,
|
||||
const char *greeting_sound,
|
||||
const char *short_greeting_sound,
|
||||
const char *exit_sound,
|
||||
const char *invalid_sound,
|
||||
const char *tts_engine,
|
||||
const char *tts_voice,
|
||||
const char *phrase_lang,
|
||||
int timeout,
|
||||
int max_failures,
|
||||
switch_memory_pool_t *pool);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_init(switch_ivr_menu_t **new_menu,
|
||||
switch_ivr_menu_t *main,
|
||||
const char *name,
|
||||
const char *greeting_sound,
|
||||
const char *short_greeting_sound,
|
||||
const char *exit_sound,
|
||||
const char *invalid_sound,
|
||||
const char *tts_engine,
|
||||
const char *tts_voice,
|
||||
const char *phrase_lang,
|
||||
int timeout, int max_failures, switch_memory_pool_t *pool);
|
||||
|
||||
/*!
|
||||
*\brief switch_ivr_menu_bind_action: Bind a keystroke to an action.
|
||||
@@ -586,7 +583,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_menu_init(switch_ivr_menu_t **new_men
|
||||
*\param bind KeyStrokes to bind the action to.
|
||||
*\return SWUTCH_STATUS_SUCCESS if the action was binded
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_bind_action(switch_ivr_menu_t *menu, switch_ivr_action_t ivr_action, const char *arg, const char *bind);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_bind_action(switch_ivr_menu_t *menu,
|
||||
switch_ivr_action_t ivr_action, const char *arg,
|
||||
const char *bind);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -600,7 +599,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_menu_bind_action(switch_ivr_menu_t *m
|
||||
*\note The function returns an switch_ivr_action_t enum of what you want to do. and looks to your buffer for args.
|
||||
*\return SWUTCH_STATUS_SUCCESS if the function was binded
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_bind_function(switch_ivr_menu_t *menu, switch_ivr_menu_action_function_t *function, const char *arg, const char *bind);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_bind_function(switch_ivr_menu_t *menu,
|
||||
switch_ivr_menu_action_function_t * function,
|
||||
const char *arg, const char *bind);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -611,17 +612,18 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_menu_bind_function(switch_ivr_menu_t
|
||||
*\param obj A void pointer to an object you want to make avaliable to your callback functions that you may have binded with switch_ivr_menu_bind_function.
|
||||
*\return SWITCH_STATUS_SUCCESS if all is well
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_execute(switch_core_session_t *session, switch_ivr_menu_t *stack, char *name, void *obj);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_execute(switch_core_session_t *session, switch_ivr_menu_t *stack,
|
||||
char *name, void *obj);
|
||||
|
||||
/*!
|
||||
*\brief free a stack of menu objects.
|
||||
*\param stack The top level menu you wish to destroy.
|
||||
*\return SWITCH_STATUS_SUCCESS if the object was a top level menu and it was freed
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_free(switch_ivr_menu_t *stack);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_free(switch_ivr_menu_t *stack);
|
||||
|
||||
struct switch_ivr_menu_xml_ctx;
|
||||
typedef struct switch_ivr_menu_xml_ctx switch_ivr_menu_xml_ctx_t;
|
||||
struct switch_ivr_menu_xml_ctx;
|
||||
typedef struct switch_ivr_menu_xml_ctx switch_ivr_menu_xml_ctx_t;
|
||||
/*!
|
||||
*\brief Build a menu stack from an xml source
|
||||
*\param xml_menu_ctx The XML menu parser context previously created by switch_ivr_menu_stack_xml_init
|
||||
@@ -630,10 +632,9 @@ typedef struct switch_ivr_menu_xml_ctx switch_ivr_menu_xml_ctx_t;
|
||||
*\param xml_menu The xml Menu source of the menu to be created
|
||||
*\return SWITCH_STATUS_SUCCESS if all is well
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_xml_build(switch_ivr_menu_xml_ctx_t *xml_menu_ctx,
|
||||
switch_ivr_menu_t **menu_stack,
|
||||
switch_xml_t xml_menus,
|
||||
switch_xml_t xml_menu);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_xml_build(switch_ivr_menu_xml_ctx_t *xml_menu_ctx,
|
||||
switch_ivr_menu_t **menu_stack,
|
||||
switch_xml_t xml_menus, switch_xml_t xml_menu);
|
||||
|
||||
/*!
|
||||
*\param xml_menu_ctx The XML menu parser context previously created by switch_ivr_menu_stack_xml_init
|
||||
@@ -641,28 +642,25 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_xml_build(switch_ivr_menu_
|
||||
*\param function The menu function callback that will be executed when menu digits are bound to this name
|
||||
*\return SWITCH_STATUS_SUCCESS if all is well
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_xml_add_custom(switch_ivr_menu_xml_ctx_t *xml_menu_ctx,
|
||||
char *name,
|
||||
switch_ivr_menu_action_function_t *function);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_xml_add_custom(switch_ivr_menu_xml_ctx_t *xml_menu_ctx,
|
||||
char *name,
|
||||
switch_ivr_menu_action_function_t * function);
|
||||
|
||||
/*!
|
||||
*\param xml_menu_ctx A pointer of a XML menu parser context to be created
|
||||
*\param pool memory pool (NULL to create one)
|
||||
*\return SWITCH_STATUS_SUCCESS if all is well
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_xml_init(switch_ivr_menu_xml_ctx_t **xml_menu_ctx, switch_memory_pool_t *pool);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_xml_init(switch_ivr_menu_xml_ctx_t **xml_menu_ctx,
|
||||
switch_memory_pool_t *pool);
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *session,
|
||||
char *macro_name,
|
||||
char *data,
|
||||
char *lang,
|
||||
switch_input_args_t *args);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *session,
|
||||
char *macro_name,
|
||||
char *data, char *lang, switch_input_args_t *args);
|
||||
/** @} */
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
@@ -44,15 +44,13 @@
|
||||
#include <switch.h>
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
/*!
|
||||
\defgroup mods Loadable Module Functions
|
||||
\ingroup core1
|
||||
\{
|
||||
*/
|
||||
|
||||
/*! \brief The abstraction of a loadable module */
|
||||
struct switch_loadable_module_interface {
|
||||
struct switch_loadable_module_interface {
|
||||
/*! the name of the module */
|
||||
const char *module_name;
|
||||
/*! the table of endpoints the module has implmented */
|
||||
@@ -76,7 +74,7 @@ struct switch_loadable_module_interface {
|
||||
/*! the table of chat interfaces the module has implmented */
|
||||
const switch_chat_interface_t *chat_interface;
|
||||
/*! the table of say interfaces the module has implmented */
|
||||
const switch_say_interface_t *say_interface;
|
||||
const switch_say_interface_t *say_interface;
|
||||
/*! the table of asr interfaces the module has implmented */
|
||||
const switch_asr_interface_t *asr_interface;
|
||||
/*! the table of management interfaces the module has implmented */
|
||||
@@ -125,9 +123,9 @@ SWITCH_DECLARE(switch_dialplan_interface_t *) switch_loadable_module_get_dialpla
|
||||
\note only use this function if you are making a module that in turn gateways module loading to another technology
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_loadable_module_build_dynamic(char *filename,
|
||||
switch_module_load_t switch_module_load,
|
||||
switch_module_runtime_t switch_module_runtime,
|
||||
switch_module_shutdown_t switch_module_shutdown);
|
||||
switch_module_load_t switch_module_load,
|
||||
switch_module_runtime_t switch_module_runtime,
|
||||
switch_module_shutdown_t switch_module_shutdown);
|
||||
|
||||
/*!
|
||||
\brief Retrieve the timer interface by it's registered name
|
||||
@@ -206,8 +204,8 @@ SWITCH_DECLARE(switch_management_interface_t *) switch_loadable_module_get_manag
|
||||
\param arraylen the max size in elements of the array
|
||||
\return the number of elements added to the array
|
||||
*/
|
||||
SWITCH_DECLARE(int) switch_loadable_module_get_codecs(switch_memory_pool_t *pool, const switch_codec_implementation_t **array,
|
||||
int arraylen);
|
||||
SWITCH_DECLARE(int) switch_loadable_module_get_codecs(switch_memory_pool_t *pool,
|
||||
const switch_codec_implementation_t **array, int arraylen);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -230,7 +228,8 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(const switch_codec_
|
||||
\param stream stream for output
|
||||
\return the status returned by the API call
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_api_execute(char *cmd, char *arg, switch_core_session_t *session, switch_stream_handle_t *stream);
|
||||
SWITCH_DECLARE(switch_status_t) switch_api_execute(char *cmd, char *arg, switch_core_session_t *session,
|
||||
switch_stream_handle_t *stream);
|
||||
|
||||
|
||||
|
||||
@@ -250,7 +249,8 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_load_module(char *dir, ch
|
||||
\param filename the path to the module's dll or so file
|
||||
\return SWITCH_STATUS_SUCCESS on a successful load
|
||||
*/
|
||||
SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface, char *filename);
|
||||
SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_module_interface_t **module_interface,
|
||||
char *filename);
|
||||
SWITCH_MOD_DECLARE(switch_status_t) switch_module_reload(void);
|
||||
SWITCH_MOD_DECLARE(switch_status_t) switch_module_pause(void);
|
||||
SWITCH_MOD_DECLARE(switch_status_t) switch_module_resume(void);
|
||||
@@ -266,9 +266,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_shutdown(void);
|
||||
///\}
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
@@ -41,35 +41,32 @@
|
||||
#include <switch.h>
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
///\defgroup log Logger Routines
|
||||
///\ingroup core1
|
||||
///\{
|
||||
|
||||
|
||||
/*! \brief Log Data
|
||||
*/
|
||||
typedef struct {
|
||||
typedef struct {
|
||||
/*! The complete log message */
|
||||
char *data;
|
||||
/*! The file where the message originated */
|
||||
/*! The file where the message originated */
|
||||
char *file;
|
||||
/*! The line number where the message originated */
|
||||
/*! The line number where the message originated */
|
||||
uint32_t line;
|
||||
/*! The function where the message originated */
|
||||
/*! The function where the message originated */
|
||||
char *func;
|
||||
/*! The log level of the message */
|
||||
/*! The log level of the message */
|
||||
switch_log_level_t level;
|
||||
/*! The time when the log line was sent */
|
||||
switch_time_t timestamp;
|
||||
/*! A pointer to where the actual content of the message starts (skipping past the preformatted portion) */
|
||||
/*! A pointer to where the actual content of the message starts (skipping past the preformatted portion) */
|
||||
char *content;
|
||||
|
||||
/* To maintain abi, only add new elements to the end of this struct and do not delete any elements */
|
||||
|
||||
} switch_log_node_t;
|
||||
|
||||
typedef switch_status_t (*switch_log_function_t)(const switch_log_node_t *node, switch_log_level_t level);
|
||||
typedef switch_status_t (*switch_log_function_t) (const switch_log_node_t *node, switch_log_level_t level);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -97,7 +94,8 @@ SWITCH_DECLARE(switch_status_t) switch_log_shutdown(void);
|
||||
\param ... variable args
|
||||
\note there are channel macros to supply the first 4 parameters
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_log_printf(switch_text_channel_t channel, const char *file, const char *func, int line, switch_log_level_t level, const char *fmt, ...) PRINTF_FUNCTION(6,7);
|
||||
SWITCH_DECLARE(void) switch_log_printf(switch_text_channel_t channel, const char *file, const char *func, int line,
|
||||
switch_log_level_t level, const char *fmt, ...) PRINTF_FUNCTION(6, 7);
|
||||
|
||||
/*!
|
||||
\brief Shut down the logging engine
|
||||
@@ -121,9 +119,7 @@ SWITCH_DECLARE(switch_log_level_t) switch_log_str2level(const char *str);
|
||||
|
||||
///\}
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
@@ -42,10 +42,9 @@
|
||||
#include <switch.h>
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
/*! \brief A table of functions to execute at various states
|
||||
*/
|
||||
struct switch_state_handler_table {
|
||||
struct switch_state_handler_table {
|
||||
/*! executed when the state changes to init */
|
||||
switch_state_handler_t on_init;
|
||||
/*! executed when the state changes to ring */
|
||||
@@ -54,13 +53,13 @@ struct switch_state_handler_table {
|
||||
switch_state_handler_t on_execute;
|
||||
/*! executed when the state changes to hangup */
|
||||
switch_state_handler_t on_hangup;
|
||||
/*! executed when the state changes to loopback*/
|
||||
/*! executed when the state changes to loopback */
|
||||
switch_state_handler_t on_loopback;
|
||||
/*! executed when the state changes to transmit*/
|
||||
/*! executed when the state changes to transmit */
|
||||
switch_state_handler_t on_transmit;
|
||||
/*! executed when the state changes to hold*/
|
||||
/*! executed when the state changes to hold */
|
||||
switch_state_handler_t on_hold;
|
||||
/*! executed when the state changes to hibernate*/
|
||||
/*! executed when the state changes to hibernate */
|
||||
switch_state_handler_t on_hibernate;
|
||||
};
|
||||
|
||||
@@ -75,133 +74,34 @@ struct switch_stream_handle {
|
||||
switch_event_t *event;
|
||||
};
|
||||
|
||||
/*! \brief Node in which to store custom outgoing channel callback hooks */
|
||||
struct switch_io_event_hook_outgoing_channel {
|
||||
/*! the outgoing channel callback hook*/
|
||||
switch_outgoing_channel_hook_t outgoing_channel;
|
||||
struct switch_io_event_hook_outgoing_channel *next;
|
||||
};
|
||||
struct switch_io_event_hooks;
|
||||
|
||||
/*! \brief Node in which to store custom answer channel callback hooks */
|
||||
struct switch_io_event_hook_answer_channel {
|
||||
/*! the answer channel callback hook*/
|
||||
switch_answer_channel_hook_t answer_channel;
|
||||
struct switch_io_event_hook_answer_channel *next;
|
||||
};
|
||||
|
||||
/*! \brief Node in which to store custom receive message callback hooks */
|
||||
struct switch_io_event_hook_receive_message {
|
||||
/*! the answer channel callback hook*/
|
||||
switch_receive_message_hook_t receive_message;
|
||||
struct switch_io_event_hook_receive_message *next;
|
||||
};
|
||||
|
||||
/*! \brief Node in which to store custom receive message callback hooks */
|
||||
struct switch_io_event_hook_receive_event {
|
||||
/*! the answer channel callback hook*/
|
||||
switch_receive_event_hook_t receive_event;
|
||||
struct switch_io_event_hook_receive_event *next;
|
||||
};
|
||||
|
||||
/*! \brief Node in which to store custom read frame channel callback hooks */
|
||||
struct switch_io_event_hook_read_frame {
|
||||
/*! the read frame channel callback hook*/
|
||||
switch_read_frame_hook_t read_frame;
|
||||
struct switch_io_event_hook_read_frame *next;
|
||||
};
|
||||
|
||||
/*! \brief Node in which to store custom write_frame channel callback hooks */
|
||||
struct switch_io_event_hook_write_frame {
|
||||
/*! the write_frame channel callback hook*/
|
||||
switch_write_frame_hook_t write_frame;
|
||||
struct switch_io_event_hook_write_frame *next;
|
||||
};
|
||||
|
||||
/*! \brief Node in which to store custom kill channel callback hooks */
|
||||
struct switch_io_event_hook_kill_channel {
|
||||
/*! the kill channel callback hook*/
|
||||
switch_kill_channel_hook_t kill_channel;
|
||||
struct switch_io_event_hook_kill_channel *next;
|
||||
};
|
||||
|
||||
/*! \brief Node in which to store custom waitfor read channel callback hooks */
|
||||
struct switch_io_event_hook_waitfor_read {
|
||||
/*! the waitfor read channel callback hook*/
|
||||
switch_waitfor_read_hook_t waitfor_read;
|
||||
struct switch_io_event_hook_waitfor_read *next;
|
||||
};
|
||||
|
||||
/*! \brief Node in which to store custom waitfor write channel callback hooks */
|
||||
struct switch_io_event_hook_waitfor_write {
|
||||
/*! the waitfor write channel callback hook*/
|
||||
switch_waitfor_write_hook_t waitfor_write;
|
||||
struct switch_io_event_hook_waitfor_write *next;
|
||||
};
|
||||
|
||||
/*! \brief Node in which to store custom send dtmf channel callback hooks */
|
||||
struct switch_io_event_hook_send_dtmf {
|
||||
/*! the send dtmf channel callback hook*/
|
||||
switch_send_dtmf_hook_t send_dtmf;
|
||||
struct switch_io_event_hook_send_dtmf *next;
|
||||
};
|
||||
|
||||
/*! \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;
|
||||
};
|
||||
|
||||
/*! \brief A table of lists of io_event_hooks to store the event hooks associated with a session */
|
||||
struct switch_io_event_hooks {
|
||||
/*! a list of outgoing channel hooks */
|
||||
switch_io_event_hook_outgoing_channel_t *outgoing_channel;
|
||||
/*! a list of answer channel hooks */
|
||||
switch_io_event_hook_answer_channel_t *answer_channel;
|
||||
/*! a list of receive message hooks */
|
||||
switch_io_event_hook_receive_message_t *receive_message;
|
||||
/*! a list of queue message hooks */
|
||||
switch_io_event_hook_receive_event_t *receive_event;
|
||||
/*! a list of read frame hooks */
|
||||
switch_io_event_hook_read_frame_t *read_frame;
|
||||
/*! a list of write frame hooks */
|
||||
switch_io_event_hook_write_frame_t *write_frame;
|
||||
/*! a list of kill channel hooks */
|
||||
switch_io_event_hook_kill_channel_t *kill_channel;
|
||||
/*! a list of wait for read hooks */
|
||||
switch_io_event_hook_waitfor_read_t *waitfor_read;
|
||||
/*! a list of wait for write hooks */
|
||||
switch_io_event_hook_waitfor_write_t *waitfor_write;
|
||||
/*! a list of send dtmf hooks */
|
||||
switch_io_event_hook_send_dtmf_t *send_dtmf;
|
||||
/*! a list of state change hooks */
|
||||
switch_io_event_hook_state_change_t *state_change;
|
||||
};
|
||||
|
||||
/*! \brief A table of i/o routines that an endpoint interface can implement */
|
||||
struct switch_io_routines {
|
||||
/*! creates an outgoing session from given session, caller profile */
|
||||
switch_call_cause_t (*outgoing_channel)(switch_core_session_t *, switch_caller_profile_t *, switch_core_session_t **, switch_memory_pool_t **);
|
||||
switch_call_cause_t (*outgoing_channel) (switch_core_session_t *, switch_caller_profile_t *,
|
||||
switch_core_session_t **, switch_memory_pool_t **);
|
||||
/*! answers the given session's channel */
|
||||
switch_status_t (*answer_channel)(switch_core_session_t *);
|
||||
switch_status_t (*answer_channel) (switch_core_session_t *);
|
||||
/*! read a frame from a session */
|
||||
switch_status_t (*read_frame)(switch_core_session_t *, switch_frame_t **, int, switch_io_flag_t, int);
|
||||
switch_status_t (*read_frame) (switch_core_session_t *, switch_frame_t **, int, switch_io_flag_t, int);
|
||||
/*! write a frame to a session */
|
||||
switch_status_t (*write_frame)(switch_core_session_t *, switch_frame_t *, int, switch_io_flag_t, int);
|
||||
switch_status_t (*write_frame) (switch_core_session_t *, switch_frame_t *, int, switch_io_flag_t, int);
|
||||
/*! send a kill signal to the session's channel */
|
||||
switch_status_t (*kill_channel)(switch_core_session_t *, int);
|
||||
switch_status_t (*kill_channel) (switch_core_session_t *, int);
|
||||
/*! wait for the session's channel to be ready to read audio */
|
||||
switch_status_t (*waitfor_read)(switch_core_session_t *, int, int);
|
||||
switch_status_t (*waitfor_read) (switch_core_session_t *, int, int);
|
||||
/*! wait for the session's channel to be ready to write audio */
|
||||
switch_status_t (*waitfor_write)(switch_core_session_t *, int, int);
|
||||
switch_status_t (*waitfor_write) (switch_core_session_t *, int, int);
|
||||
/*! send a string of DTMF digits to a session's channel */
|
||||
switch_status_t (*send_dtmf)(switch_core_session_t *, char *);
|
||||
/*! receive a message from another session*/
|
||||
switch_status_t (*receive_message)(switch_core_session_t *, switch_core_session_message_t *);
|
||||
/*! queue a message for another session*/
|
||||
switch_status_t (*receive_event)(switch_core_session_t *, switch_event_t *);
|
||||
switch_status_t (*send_dtmf) (switch_core_session_t *, char *);
|
||||
/*! receive a message from another session */
|
||||
switch_status_t (*receive_message) (switch_core_session_t *, switch_core_session_message_t *);
|
||||
/*! queue a message for another session */
|
||||
switch_status_t (*receive_event) (switch_core_session_t *, switch_event_t *);
|
||||
/*! change a sessions channel state */
|
||||
switch_status_t (*state_change)(switch_core_session_t *);
|
||||
switch_status_t (*state_change) (switch_core_session_t *);
|
||||
};
|
||||
|
||||
/*! \brief Abstraction of an module endpoint interface
|
||||
@@ -250,15 +150,15 @@ struct switch_timer_interface {
|
||||
/*! the name of the interface */
|
||||
const char *interface_name;
|
||||
/*! function to allocate the timer */
|
||||
switch_status_t (*timer_init)(switch_timer_t *);
|
||||
switch_status_t (*timer_init) (switch_timer_t *);
|
||||
/*! function to wait for one cycle to pass */
|
||||
switch_status_t (*timer_next)(switch_timer_t *);
|
||||
switch_status_t (*timer_next) (switch_timer_t *);
|
||||
/*! function to step the timer one step */
|
||||
switch_status_t (*timer_step)(switch_timer_t *);
|
||||
switch_status_t (*timer_step) (switch_timer_t *);
|
||||
/*! function to check if the current step has expired */
|
||||
switch_status_t (*timer_check)(switch_timer_t *);
|
||||
switch_status_t (*timer_check) (switch_timer_t *);
|
||||
/*! function to deallocate the timer */
|
||||
switch_status_t (*timer_destroy)(switch_timer_t *);
|
||||
switch_status_t (*timer_destroy) (switch_timer_t *);
|
||||
const struct switch_timer_interface *next;
|
||||
};
|
||||
|
||||
@@ -276,19 +176,19 @@ struct switch_file_interface {
|
||||
/*! the name of the interface */
|
||||
const char *interface_name;
|
||||
/*! function to open the file */
|
||||
switch_status_t (*file_open)(switch_file_handle_t *, char *file_path);
|
||||
switch_status_t (*file_open) (switch_file_handle_t *, char *file_path);
|
||||
/*! function to close the file */
|
||||
switch_status_t (*file_close)(switch_file_handle_t *);
|
||||
switch_status_t (*file_close) (switch_file_handle_t *);
|
||||
/*! function to read from the file */
|
||||
switch_status_t (*file_read)(switch_file_handle_t *, void *data, switch_size_t *len);
|
||||
switch_status_t (*file_read) (switch_file_handle_t *, void *data, switch_size_t *len);
|
||||
/*! function to write from the file */
|
||||
switch_status_t (*file_write)(switch_file_handle_t *, void *data, switch_size_t *len);
|
||||
switch_status_t (*file_write) (switch_file_handle_t *, void *data, switch_size_t *len);
|
||||
/*! function to seek to a certian position in the file */
|
||||
switch_status_t (*file_seek)(switch_file_handle_t *, unsigned int *cur_pos, int64_t samples, int whence);
|
||||
switch_status_t (*file_seek) (switch_file_handle_t *, unsigned int *cur_pos, int64_t samples, int whence);
|
||||
/*! function to set meta data */
|
||||
switch_status_t (*file_set_string)(switch_file_handle_t *fh, switch_audio_col_t col, const char *string);
|
||||
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);
|
||||
switch_status_t (*file_get_string) (switch_file_handle_t *fh, switch_audio_col_t col, const char **string);
|
||||
/*! list of supported file extensions */
|
||||
char **extens;
|
||||
const struct switch_file_interface *next;
|
||||
@@ -316,7 +216,7 @@ struct switch_file_handle {
|
||||
int seekable;
|
||||
/*! the sample count of the file */
|
||||
unsigned int sample_count;
|
||||
/*! the speed of the file playback*/
|
||||
/*! the speed of the file playback */
|
||||
int speed;
|
||||
/*! the handle's memory pool */
|
||||
switch_memory_pool_t *memory_pool;
|
||||
@@ -325,8 +225,8 @@ struct switch_file_handle {
|
||||
char *handler;
|
||||
int64_t pos;
|
||||
switch_buffer_t *audio_buffer;
|
||||
uint32_t thresh;
|
||||
uint32_t silence_hits;
|
||||
uint32_t thresh;
|
||||
uint32_t silence_hits;
|
||||
};
|
||||
|
||||
/*! \brief Abstract interface to an asr module */
|
||||
@@ -334,27 +234,23 @@ 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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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;
|
||||
};
|
||||
|
||||
@@ -364,11 +260,11 @@ struct switch_asr_handle {
|
||||
const switch_asr_interface_t *asr_interface;
|
||||
/*! flags to control behaviour */
|
||||
uint32_t flags;
|
||||
/*! The Name*/
|
||||
/*! The Name */
|
||||
char *name;
|
||||
/*! The Codec*/
|
||||
/*! The Codec */
|
||||
char *codec;
|
||||
/*! The Rate*/
|
||||
/*! The Rate */
|
||||
uint32_t rate;
|
||||
char *grammar;
|
||||
/*! the handle's memory pool */
|
||||
@@ -382,24 +278,20 @@ struct switch_speech_interface {
|
||||
/*! the name of the interface */
|
||||
const char *interface_name;
|
||||
/*! function to open the speech interface */
|
||||
switch_status_t (*speech_open)(switch_speech_handle_t *sh,
|
||||
char *voice_name,
|
||||
int rate,
|
||||
switch_speech_flag_t *flags);
|
||||
switch_status_t (*speech_open) (switch_speech_handle_t *sh,
|
||||
char *voice_name, int rate, switch_speech_flag_t *flags);
|
||||
/*! function to close the speech interface */
|
||||
switch_status_t (*speech_close)(switch_speech_handle_t *, switch_speech_flag_t *flags);
|
||||
/*! function to feed audio to the ASR*/
|
||||
switch_status_t (*speech_feed_tts)(switch_speech_handle_t *sh, char *text, switch_speech_flag_t *flags);
|
||||
/*! function to read audio from the TTS*/
|
||||
switch_status_t (*speech_read_tts)(switch_speech_handle_t *sh,
|
||||
void *data,
|
||||
switch_size_t *datalen,
|
||||
uint32_t *rate,
|
||||
switch_speech_flag_t *flags);
|
||||
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);
|
||||
void (*speech_float_param_tts)(switch_speech_handle_t *sh, char *param, double val);
|
||||
switch_status_t (*speech_close) (switch_speech_handle_t *, switch_speech_flag_t *flags);
|
||||
/*! function to feed audio to the ASR */
|
||||
switch_status_t (*speech_feed_tts) (switch_speech_handle_t *sh, char *text, switch_speech_flag_t *flags);
|
||||
/*! function to read audio from the TTS */
|
||||
switch_status_t (*speech_read_tts) (switch_speech_handle_t *sh,
|
||||
void *data,
|
||||
switch_size_t *datalen, uint32_t * rate, switch_speech_flag_t *flags);
|
||||
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);
|
||||
void (*speech_float_param_tts) (switch_speech_handle_t *sh, char *param, double val);
|
||||
|
||||
const struct switch_speech_interface *next;
|
||||
};
|
||||
@@ -411,9 +303,9 @@ struct switch_speech_handle {
|
||||
const switch_speech_interface_t *speech_interface;
|
||||
/*! flags to control behaviour */
|
||||
uint32_t flags;
|
||||
/*! The Name*/
|
||||
/*! The Name */
|
||||
char *name;
|
||||
/*! The Rate*/
|
||||
/*! The Rate */
|
||||
uint32_t rate;
|
||||
uint32_t speed;
|
||||
char voice[80];
|
||||
@@ -429,7 +321,7 @@ struct switch_say_interface {
|
||||
/*! the name of the interface */
|
||||
const char *interface_name;
|
||||
/*! function to pass down to the module */
|
||||
switch_say_callback_t say_function;
|
||||
switch_say_callback_t say_function;
|
||||
const struct switch_say_interface *next;
|
||||
};
|
||||
|
||||
@@ -438,7 +330,7 @@ struct switch_chat_interface {
|
||||
/*! the name of the interface */
|
||||
const char *interface_name;
|
||||
/*! function to open the directory interface */
|
||||
switch_status_t (*chat_send)(char *proto, char *from, char *to, char *subject, char *body, char *hint);
|
||||
switch_status_t (*chat_send) (char *proto, char *from, char *to, char *subject, char *body, char *hint);
|
||||
const struct switch_chat_interface *next;
|
||||
};
|
||||
|
||||
@@ -447,7 +339,8 @@ 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);
|
||||
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;
|
||||
};
|
||||
|
||||
@@ -456,16 +349,16 @@ struct switch_directory_interface {
|
||||
/*! the name of the interface */
|
||||
const char *interface_name;
|
||||
/*! function to open the directory interface */
|
||||
switch_status_t (*directory_open)(switch_directory_handle_t *dh, char *source, char *dsn, char *passwd);
|
||||
switch_status_t (*directory_open) (switch_directory_handle_t *dh, char *source, char *dsn, char *passwd);
|
||||
/*! function to close the directory interface */
|
||||
switch_status_t (*directory_close)(switch_directory_handle_t *dh);
|
||||
switch_status_t (*directory_close) (switch_directory_handle_t *dh);
|
||||
/*! function to query the directory interface */
|
||||
switch_status_t (*directory_query)(switch_directory_handle_t *dh, char *base, char *query);
|
||||
switch_status_t (*directory_query) (switch_directory_handle_t *dh, char *base, char *query);
|
||||
/*! function to advance to the next record */
|
||||
switch_status_t (*directory_next)(switch_directory_handle_t *dh);
|
||||
switch_status_t (*directory_next) (switch_directory_handle_t *dh);
|
||||
/*! function to advance to the next name/value pair in the current record */
|
||||
switch_status_t (*directory_next_pair)(switch_directory_handle_t *dh, char **var, char **val);
|
||||
|
||||
switch_status_t (*directory_next_pair) (switch_directory_handle_t *dh, char **var, char **val);
|
||||
|
||||
const struct switch_directory_interface *next;
|
||||
};
|
||||
|
||||
@@ -534,7 +427,7 @@ struct switch_codec {
|
||||
switch_codec_settings_t codec_settings;
|
||||
/*! flags to modify behaviour */
|
||||
uint32_t flags;
|
||||
/*! the handle's memory pool*/
|
||||
/*! the handle's memory pool */
|
||||
switch_memory_pool_t *memory_pool;
|
||||
/*! private data for the codec module to store handle specific info */
|
||||
void *private_info;
|
||||
@@ -569,29 +462,25 @@ struct switch_codec_implementation {
|
||||
/*! max number of frames to send in one network packet */
|
||||
int max_frames_per_packet;
|
||||
/*! function to initialize a codec handle using this implementation */
|
||||
switch_status_t (*init)(switch_codec_t *, switch_codec_flag_t, const switch_codec_settings_t *codec_settings);
|
||||
switch_status_t (*init) (switch_codec_t *, switch_codec_flag_t, const switch_codec_settings_t *codec_settings);
|
||||
/*! function to encode raw data into encoded data */
|
||||
switch_status_t (*encode)(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);
|
||||
switch_status_t (*encode) (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);
|
||||
/*! function to decode encoded data into raw data */
|
||||
switch_status_t (*decode)(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_status_t (*decode) (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);
|
||||
/*! deinitalize a codec handle using this implementation */
|
||||
switch_status_t (*destroy)(switch_codec_t *);
|
||||
switch_status_t (*destroy) (switch_codec_t *);
|
||||
const struct switch_codec_implementation *next;
|
||||
};
|
||||
|
||||
@@ -635,9 +524,7 @@ struct switch_api_interface {
|
||||
};
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
@@ -35,23 +35,17 @@
|
||||
#define SWITCH_PLATFORM_H
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
#ifdef __ICC
|
||||
#pragma warning (disable:810 869 981 279 1469 188)
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define SWITCH_VA_NONE "%s", ""
|
||||
#ifdef _MSC_VER
|
||||
#define __SWITCH_FUNC__ __FUNCTION__
|
||||
#else
|
||||
#define __SWITCH_FUNC__ (const char *)__func__
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
|
||||
/* disable the following warnings
|
||||
* C4100: The formal parameter is not referenced in the body of the function. The unreferenced parameter is ignored.
|
||||
* C4200: Non standard extension C zero sized array
|
||||
@@ -64,8 +58,7 @@ SWITCH_BEGIN_EXTERN_C
|
||||
* C4610: struct can never be instantiated - user defined constructor required
|
||||
*/
|
||||
#pragma warning(disable:4100 4200 4204 4706 4819 4132 4510 4512 4610 4996)
|
||||
|
||||
#if (_MSC_VER >= 1400) // VC8+
|
||||
#if (_MSC_VER >= 1400) // VC8+
|
||||
#ifndef _CRT_SECURE_NO_DEPRECATE
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
@@ -73,30 +66,27 @@ SWITCH_BEGIN_EXTERN_C
|
||||
#define _CRT_NONSTDC_NO_DEPRECATE
|
||||
#endif
|
||||
#endif // VC8+
|
||||
|
||||
#if _MSC_VER < 1300
|
||||
#ifndef __FUNCTION__
|
||||
#define __FUNCTION__ ""
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#undef inline
|
||||
#define inline __inline
|
||||
|
||||
#ifndef uint32_t
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
typedef __int8 int8_t;
|
||||
typedef __int16 int16_t;
|
||||
typedef __int32 int32_t;
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned long in_addr_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
typedef __int8 int8_t;
|
||||
typedef __int16 int16_t;
|
||||
typedef __int32 int32_t;
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned long in_addr_t;
|
||||
#endif
|
||||
typedef int pid_t;
|
||||
typedef int uid_t;
|
||||
typedef int gid_t;
|
||||
typedef int pid_t;
|
||||
typedef int uid_t;
|
||||
typedef int gid_t;
|
||||
#define PACKED
|
||||
#include <io.h>
|
||||
#define strcasecmp(s1, s2) stricmp(s1, s2)
|
||||
@@ -116,7 +106,6 @@ typedef int gid_t;
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#endif // _MSC_VER
|
||||
|
||||
#ifndef __LITTLE_ENDIAN
|
||||
#define __LITTLE_ENDIAN 1234
|
||||
#endif
|
||||
@@ -130,9 +119,7 @@ typedef int gid_t;
|
||||
#define __BYTE_ORDER __LITTLE_ENDIAN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
#if defined(SWITCH_CORE_DECLARE_STATIC)
|
||||
#define SWITCH_DECLARE(type) type __stdcall
|
||||
#define SWITCH_DECLARE_NONSTD(type) type __cdecl
|
||||
@@ -146,7 +133,6 @@ typedef int gid_t;
|
||||
#define SWITCH_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl
|
||||
#define SWITCH_DECLARE_DATA __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#if defined(SWITCH_MOD_DECLARE_STATIC)
|
||||
#define SWITCH_MOD_DECLARE(type) type __cdecl
|
||||
#elif defined(MOD_EXPORTS)
|
||||
@@ -169,35 +155,32 @@ typedef int gid_t;
|
||||
#define SWITCH_DECLARE_DATA
|
||||
#define SWITCH_THREAD_FUNC
|
||||
#endif
|
||||
|
||||
#ifdef DOXYGEN
|
||||
#define DoxyDefine(x) x
|
||||
#else
|
||||
#define DoxyDefine(x)
|
||||
#endif
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
#define PRINTF_FUNCTION(fmtstr,vars) __attribute__((format(printf,fmtstr,vars)))
|
||||
#else
|
||||
#define PRINTF_FUNCTION(fmtstr,vars)
|
||||
#endif
|
||||
|
||||
#ifdef SWITCH_INT32
|
||||
typedef SWITCH_INT32 switch_int32_t;
|
||||
typedef SWITCH_INT32 switch_int32_t;
|
||||
#else
|
||||
typedef int32_t switch_int32_t;
|
||||
typedef int32_t switch_int32_t;
|
||||
#endif
|
||||
|
||||
#ifdef SWITCH_SIZE_T
|
||||
typedef SWITCH_SIZE_T switch_size_t;
|
||||
typedef SWITCH_SIZE_T switch_size_t;
|
||||
#else
|
||||
typedef uintptr_t switch_size_t;
|
||||
typedef uintptr_t switch_size_t;
|
||||
#endif
|
||||
|
||||
#ifdef SWITCH_SSIZE_T
|
||||
typedef SWITCH_SSIZE_T switch_ssize_t;
|
||||
typedef SWITCH_SSIZE_T switch_ssize_t;
|
||||
#else
|
||||
typedef intptr_t switch_ssize_t;
|
||||
typedef intptr_t switch_ssize_t;
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -245,7 +228,6 @@ typedef intptr_t switch_ssize_t;
|
||||
#define SWITCH_TIME_T_FMT SWITCH_INT64_T_FMT
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
/* these includes must be outside the extern "C" block on windows or it will break compatibility with c++ modules*/
|
||||
#ifdef WIN32
|
||||
/* Has windows.h already been included? If so, our preferences don't matter,
|
||||
@@ -257,7 +239,6 @@ SWITCH_END_EXTERN_C
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#ifndef _WIN32_WINNT
|
||||
|
||||
/* Restrict the server to a subset of Windows NT 4.0 header files by default
|
||||
*/
|
||||
#define _WIN32_WINNT 0x0400
|
||||
@@ -288,19 +269,13 @@ SWITCH_END_EXTERN_C
|
||||
#endif /* !_WINDOWS_ */
|
||||
#include <process.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE (!FALSE)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
@@ -35,32 +35,28 @@
|
||||
#define SWITCH_REGEX_H
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
/**
|
||||
* @defgroup switch_regex
|
||||
* @ingroup FREESWITCH
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef struct real_pcre switch_regex_t;
|
||||
typedef struct real_pcre switch_regex_t;
|
||||
|
||||
SWITCH_DECLARE(switch_regex_t *) switch_regex_compile(const char *pattern,
|
||||
int options,
|
||||
const char **errorptr,
|
||||
int *erroroffset,
|
||||
const unsigned char *tables);
|
||||
int *erroroffset, const unsigned char *tables);
|
||||
|
||||
SWITCH_DECLARE(int) switch_regex_copy_substring(const char *subject,
|
||||
int *ovector,
|
||||
int stringcount,
|
||||
int stringnumber,
|
||||
char *buffer,
|
||||
int size);
|
||||
int stringcount, int stringnumber, char *buffer, int size);
|
||||
|
||||
SWITCH_DECLARE(void) switch_regex_free(void *data);
|
||||
|
||||
SWITCH_DECLARE(int) switch_regex_perform(char *field, char *expression, switch_regex_t **new_re, int *ovector, uint32_t olen);
|
||||
SWITCH_DECLARE(void) switch_perform_substitution(switch_regex_t *re, int match_count, char *data, char *field_data, char *substituted, uint32_t len, int *ovector);
|
||||
SWITCH_DECLARE(int) switch_regex_perform(char *field, char *expression, switch_regex_t **new_re, int *ovector,
|
||||
uint32_t olen);
|
||||
SWITCH_DECLARE(void) switch_perform_substitution(switch_regex_t *re, int match_count, char *data, char *field_data,
|
||||
char *substituted, uint32_t len, int *ovector);
|
||||
|
||||
/*!
|
||||
\brief Function to evaluate an expression against a string
|
||||
@@ -78,9 +74,7 @@ SWITCH_DECLARE(switch_status_t) switch_regex_match(char *target, char *expressio
|
||||
/** @} */
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
@@ -45,15 +45,13 @@
|
||||
|
||||
#include <switch.h>
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
/*!
|
||||
\defgroup resamp Audio Resample Functions
|
||||
\ingroup core1
|
||||
\{
|
||||
*/
|
||||
|
||||
/*! \brief An audio resampling handle */
|
||||
typedef struct {
|
||||
typedef struct {
|
||||
/*! a pointer to store the resampler object */
|
||||
void *resampler;
|
||||
/*! the rate to resample from in hz */
|
||||
@@ -87,11 +85,9 @@ typedef struct {
|
||||
\return SWITCH_STATUS_SUCCESS if the handle was created
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_resample_create(switch_audio_resampler_t **new_resampler,
|
||||
int from_rate,
|
||||
switch_size_t from_size,
|
||||
int to_rate,
|
||||
uint32_t to_size,
|
||||
switch_memory_pool_t *pool);
|
||||
int from_rate,
|
||||
switch_size_t from_size,
|
||||
int to_rate, uint32_t to_size, switch_memory_pool_t *pool);
|
||||
|
||||
/*!
|
||||
\brief Destroy an existing resampler handle
|
||||
@@ -109,7 +105,8 @@ SWITCH_DECLARE(void) switch_resample_destroy(switch_audio_resampler_t *resampler
|
||||
\param last parameter denoting the last sample is being resampled
|
||||
\return the used size of dst
|
||||
*/
|
||||
SWITCH_DECLARE(uint32_t) switch_resample_process(switch_audio_resampler_t *resampler, float *src, int srclen, float *dst, uint32_t dstlen, int last);
|
||||
SWITCH_DECLARE(uint32_t) switch_resample_process(switch_audio_resampler_t *resampler, float *src, int srclen,
|
||||
float *dst, uint32_t dstlen, int last);
|
||||
|
||||
/*!
|
||||
\brief Convert an array of floats to an array of shorts
|
||||
@@ -172,9 +169,7 @@ SWITCH_DECLARE(void) switch_change_sln_volume(int16_t *data, uint32_t samples, i
|
||||
///\}
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
+37
-45
@@ -39,17 +39,13 @@
|
||||
#define SWITCH_RTP_H
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
#define SWITCH_RTP_MAX_BUF_LEN 16384
|
||||
|
||||
///\defgroup rtp RTP (RealTime Transport Protocol)
|
||||
///\ingroup core1
|
||||
///\{
|
||||
typedef void (*switch_rtp_invalid_handler_t)(switch_rtp_t *rtp_session,
|
||||
switch_socket_t *sock,
|
||||
void *data,
|
||||
switch_size_t datalen,
|
||||
switch_sockaddr_t *from_addr);
|
||||
typedef void (*switch_rtp_invalid_handler_t) (switch_rtp_t *rtp_session,
|
||||
switch_socket_t *sock,
|
||||
void *data, switch_size_t datalen, switch_sockaddr_t *from_addr);
|
||||
|
||||
/*!
|
||||
\brief Initilize the RTP System
|
||||
@@ -77,15 +73,13 @@ SWITCH_DECLARE(switch_port_t) switch_rtp_request_port(void);
|
||||
\param pool a memory pool to use for the session
|
||||
\return the new RTP session or NULL on failure
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t)switch_rtp_create(switch_rtp_t **new_rtp_session,
|
||||
switch_payload_t payload,
|
||||
uint32_t samples_per_interval,
|
||||
uint32_t ms_per_packet,
|
||||
switch_rtp_flag_t flags,
|
||||
char *crypto_key,
|
||||
char *timer_name,
|
||||
const char **err,
|
||||
switch_memory_pool_t *pool);
|
||||
SWITCH_DECLARE(switch_status_t) switch_rtp_create(switch_rtp_t **new_rtp_session,
|
||||
switch_payload_t payload,
|
||||
uint32_t samples_per_interval,
|
||||
uint32_t ms_per_packet,
|
||||
switch_rtp_flag_t flags,
|
||||
char *crypto_key,
|
||||
char *timer_name, const char **err, switch_memory_pool_t *pool);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -104,18 +98,16 @@ SWITCH_DECLARE(switch_status_t)switch_rtp_create(switch_rtp_t **new_rtp_session,
|
||||
\param pool a memory pool to use for the session
|
||||
\return the new RTP session or NULL on failure
|
||||
*/
|
||||
SWITCH_DECLARE(switch_rtp_t *)switch_rtp_new(char *rx_host,
|
||||
switch_port_t rx_port,
|
||||
char *tx_host,
|
||||
switch_port_t tx_port,
|
||||
switch_payload_t payload,
|
||||
uint32_t samples_per_interval,
|
||||
uint32_t ms_per_packet,
|
||||
switch_rtp_flag_t flags,
|
||||
char *crypto_key,
|
||||
char *timer_name,
|
||||
const char **err,
|
||||
switch_memory_pool_t *pool);
|
||||
SWITCH_DECLARE(switch_rtp_t *) switch_rtp_new(char *rx_host,
|
||||
switch_port_t rx_port,
|
||||
char *tx_host,
|
||||
switch_port_t tx_port,
|
||||
switch_payload_t payload,
|
||||
uint32_t samples_per_interval,
|
||||
uint32_t ms_per_packet,
|
||||
switch_rtp_flag_t flags,
|
||||
char *crypto_key,
|
||||
char *timer_name, const char **err, switch_memory_pool_t *pool);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -125,7 +117,8 @@ SWITCH_DECLARE(switch_rtp_t *)switch_rtp_new(char *rx_host,
|
||||
\param port the remote port
|
||||
\param err pointer for error messages
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_rtp_set_remote_address(switch_rtp_t *rtp_session, char *host, switch_port_t port, const char **err);
|
||||
SWITCH_DECLARE(switch_status_t) switch_rtp_set_remote_address(switch_rtp_t *rtp_session, char *host, switch_port_t port,
|
||||
const char **err);
|
||||
|
||||
/*!
|
||||
\brief Assign a local address to the RTP session
|
||||
@@ -135,7 +128,8 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_set_remote_address(switch_rtp_t *rtp_
|
||||
\param err pointer for error messages
|
||||
\note this call also binds the RTP session's socket to the new address
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_rtp_set_local_address(switch_rtp_t *rtp_session, char *host, switch_port_t port, const char **err);
|
||||
SWITCH_DECLARE(switch_status_t) switch_rtp_set_local_address(switch_rtp_t *rtp_session, char *host, switch_port_t port,
|
||||
const char **err);
|
||||
|
||||
/*!
|
||||
\brief Kill the socket on an existing RTP session
|
||||
@@ -189,14 +183,15 @@ SWITCH_DECLARE(void) switch_rtp_clear_flag(switch_rtp_t *rtp_session, switch_rtp
|
||||
\param rtp_session the RTP session to retrieve the socket from
|
||||
\return the socket from the RTP session
|
||||
*/
|
||||
SWITCH_DECLARE(switch_socket_t *)switch_rtp_get_rtp_socket(switch_rtp_t *rtp_session);
|
||||
SWITCH_DECLARE(switch_socket_t *) switch_rtp_get_rtp_socket(switch_rtp_t *rtp_session);
|
||||
|
||||
/*!
|
||||
\brief Set the default samples per interval for a given RTP session
|
||||
\param rtp_session the RTP session to set the samples per interval on
|
||||
\param samples_per_interval the new default samples per interval
|
||||
*/
|
||||
SWITCH_DECLARE(void) switch_rtp_set_default_samples_per_interval(switch_rtp_t *rtp_session, uint16_t samples_per_interval);
|
||||
SWITCH_DECLARE(void) switch_rtp_set_default_samples_per_interval(switch_rtp_t *rtp_session,
|
||||
uint16_t samples_per_interval);
|
||||
|
||||
/*!
|
||||
\brief Get the default samples per interval for a given RTP session
|
||||
@@ -237,7 +232,8 @@ SWITCH_DECLARE(void) switch_rtp_set_invald_handler(switch_rtp_t *rtp_session, sw
|
||||
\param flags flags
|
||||
\return the number of bytes read
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_rtp_read(switch_rtp_t *rtp_session, void *data, uint32_t *datalen, switch_payload_t *payload_type, switch_frame_flag_t *flags);
|
||||
SWITCH_DECLARE(switch_status_t) switch_rtp_read(switch_rtp_t *rtp_session, void *data, uint32_t * datalen,
|
||||
switch_payload_t *payload_type, switch_frame_flag_t *flags);
|
||||
|
||||
/*!
|
||||
\brief Queue RFC2833 DTMF data into an RTP Session
|
||||
@@ -282,9 +278,8 @@ SWITCH_DECLARE(switch_size_t) switch_rtp_dequeue_dtmf(switch_rtp_t *rtp_session,
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_rtp_zerocopy_read(switch_rtp_t *rtp_session,
|
||||
void **data,
|
||||
uint32_t *datalen,
|
||||
switch_payload_t *payload_type,
|
||||
switch_frame_flag_t *flags);
|
||||
uint32_t * datalen,
|
||||
switch_payload_t *payload_type, switch_frame_flag_t *flags);
|
||||
|
||||
/*!
|
||||
\brief Read data from a given RTP session without copying
|
||||
@@ -303,7 +298,8 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp
|
||||
\param flags frame flags
|
||||
\return the number of bytes written
|
||||
*/
|
||||
SWITCH_DECLARE(int) switch_rtp_write(switch_rtp_t *rtp_session, void *data, uint32_t datalen, uint32_t ts, switch_frame_flag_t *flags);
|
||||
SWITCH_DECLARE(int) switch_rtp_write(switch_rtp_t *rtp_session, void *data, uint32_t datalen, uint32_t ts,
|
||||
switch_frame_flag_t *flags);
|
||||
|
||||
/*!
|
||||
\brief Enable VAD on an RTP Session
|
||||
@@ -313,7 +309,8 @@ SWITCH_DECLARE(int) switch_rtp_write(switch_rtp_t *rtp_session, void *data, uint
|
||||
\param flags flags for control
|
||||
\return SWITCH_STAUTS_SUCCESS on success
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_rtp_enable_vad(switch_rtp_t *rtp_session, switch_core_session_t *session, switch_codec_t *codec, switch_vad_flag_t flags);
|
||||
SWITCH_DECLARE(switch_status_t) switch_rtp_enable_vad(switch_rtp_t *rtp_session, switch_core_session_t *session,
|
||||
switch_codec_t *codec, switch_vad_flag_t flags);
|
||||
|
||||
/*!
|
||||
\brief Disable VAD on an RTP Session
|
||||
@@ -349,10 +346,7 @@ SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp_t *rtp_session,
|
||||
uint16_t datalen,
|
||||
uint8_t m,
|
||||
switch_payload_t payload,
|
||||
uint32_t ts,
|
||||
uint16_t mseq,
|
||||
uint32_t ssrc,
|
||||
switch_frame_flag_t *flags);
|
||||
uint32_t ts, uint16_t mseq, uint32_t ssrc, switch_frame_flag_t *flags);
|
||||
|
||||
/*!
|
||||
\brief Retrieve the SSRC from a given RTP session
|
||||
@@ -387,16 +381,14 @@ SWITCH_DECLARE(void) switch_rtp_set_cng_pt(switch_rtp_t *rtp_session, switch_pay
|
||||
\param rtp_session the RTP session to retrieve the data from
|
||||
\return the pointer to the private data
|
||||
*/
|
||||
SWITCH_DECLARE(void *)switch_rtp_get_private(switch_rtp_t *rtp_session);
|
||||
SWITCH_DECLARE(void *) switch_rtp_get_private(switch_rtp_t *rtp_session);
|
||||
|
||||
/*!
|
||||
\}
|
||||
*/
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
+120
-228
@@ -36,26 +36,22 @@
|
||||
#define SWITCH_SQLITE_H
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
#include <sqlite3.h>
|
||||
|
||||
/**
|
||||
* @defgroup switch_sqlite_top Brought To You By SQLite
|
||||
* @ingroup FREESWITCH
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup switch_sqlite Database Routines
|
||||
* @ingroup switch_sqlite_top
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Each open sqlite database is represented by an instance of the
|
||||
* following opaque structure.
|
||||
*/
|
||||
typedef sqlite3 switch_core_db_t;
|
||||
typedef sqlite3 switch_core_db_t;
|
||||
typedef sqlite3_stmt switch_core_db_stmt_t;
|
||||
/**
|
||||
* Aggregate functions use the following routine to allocate
|
||||
@@ -67,17 +63,15 @@ typedef sqlite3_stmt switch_core_db_stmt_t;
|
||||
*
|
||||
* The buffer allocated is freed automatically by SQLite.
|
||||
*/
|
||||
DoxyDefine(void *switch_core_db_aggregate_context(sqlite3_context*, int nBytes);)
|
||||
DoxyDefine(void *switch_core_db_aggregate_context(sqlite3_context *, int nBytes);)
|
||||
#define switch_core_db_aggregate_context sqlite3_aggregate_context
|
||||
|
||||
/**
|
||||
* /return the number of calls to xStep for a particular
|
||||
* aggregate function instance. The current call to xStep counts so this
|
||||
* routine always returns at least 1.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_aggregate_count(sqlite3_context*);)
|
||||
DoxyDefine(int switch_core_db_aggregate_count(sqlite3_context *);)
|
||||
#define switch_core_db_aggregate_count sqlite3_aggregate_count
|
||||
|
||||
/**
|
||||
* In the SQL strings input to switch_core_db_prepare(),
|
||||
* one or more literals can be replace by parameters "?" or ":AAA" or
|
||||
@@ -106,9 +100,8 @@ DoxyDefine(int switch_core_db_aggregate_count(sqlite3_context*);)
|
||||
* an switch_core_db_prepare() or sqlite3_reset(). Unbound parameterss are
|
||||
* interpreted as NULL.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));)
|
||||
DoxyDefine(int switch_core_db_bind_blob(sqlite3_stmt *, int, const void *, int n, void (*)(void *));)
|
||||
#define switch_core_db_bind_blob sqlite3_bind_blob
|
||||
|
||||
/**
|
||||
* In the SQL strings input to switch_core_db_prepare(),
|
||||
* one or more literals can be replace by parameters "?" or ":AAA" or
|
||||
@@ -129,9 +122,8 @@ DoxyDefine(int switch_core_db_bind_blob(sqlite3_stmt*, int, const void*, int n,
|
||||
* an switch_core_db_prepare() or sqlite3_reset(). Unbound parameterss are
|
||||
* interpreted as NULL.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_bind_double(sqlite3_stmt*, int, double);)
|
||||
DoxyDefine(int switch_core_db_bind_double(sqlite3_stmt *, int, double);)
|
||||
#define switch_core_db_bind_double sqlite3_bind_double
|
||||
|
||||
/**
|
||||
* In the SQL strings input to switch_core_db_prepare(),
|
||||
* one or more literals can be replace by parameters "?" or ":AAA" or
|
||||
@@ -152,9 +144,8 @@ DoxyDefine(int switch_core_db_bind_double(sqlite3_stmt*, int, double);)
|
||||
* an switch_core_db_prepare() or sqlite3_reset(). Unbound parameterss are
|
||||
* interpreted as NULL.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_bind_int(sqlite3_stmt*, int, int);)
|
||||
DoxyDefine(int switch_core_db_bind_int(sqlite3_stmt *, int, int);)
|
||||
#define switch_core_db_bind_int sqlite3_bind_int
|
||||
|
||||
/**
|
||||
* In the SQL strings input to switch_core_db_prepare(),
|
||||
* one or more literals can be replace by parameters "?" or ":AAA" or
|
||||
@@ -175,9 +166,8 @@ DoxyDefine(int switch_core_db_bind_int(sqlite3_stmt*, int, int);)
|
||||
* an switch_core_db_prepare() or sqlite3_reset(). Unbound parameterss are
|
||||
* interpreted as NULL.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_bind_int64(sqlite3_stmt*, int, sqlite_int64);)
|
||||
DoxyDefine(int switch_core_db_bind_int64(sqlite3_stmt *, int, sqlite_int64);)
|
||||
#define switch_core_db_bind_int64 sqlite3_bind_int64
|
||||
|
||||
/**
|
||||
* In the SQL strings input to switch_core_db_prepare(),
|
||||
* one or more literals can be replace by parameters "?" or ":AAA" or
|
||||
@@ -198,9 +188,8 @@ DoxyDefine(int switch_core_db_bind_int64(sqlite3_stmt*, int, sqlite_int64);)
|
||||
* an switch_core_db_prepare() or sqlite3_reset(). Unbound parameterss are
|
||||
* interpreted as NULL.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_bind_null(sqlite3_stmt*, int);)
|
||||
DoxyDefine(int switch_core_db_bind_null(sqlite3_stmt *, int);)
|
||||
#define switch_core_db_bind_null sqlite3_bind_null
|
||||
|
||||
/**
|
||||
* In the SQL strings input to switch_core_db_prepare(),
|
||||
* one or more literals can be replace by parameters "?" or ":AAA" or
|
||||
@@ -229,9 +218,8 @@ DoxyDefine(int switch_core_db_bind_null(sqlite3_stmt*, int);)
|
||||
* an switch_core_db_prepare() or sqlite3_reset(). Unbound parameterss are
|
||||
* interpreted as NULL.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_bind_text(sqlite3_stmt*, int, const char*, int n, void(*)(void*));)
|
||||
DoxyDefine(int switch_core_db_bind_text(sqlite3_stmt *, int, const char *, int n, void (*)(void *));)
|
||||
#define switch_core_db_bind_text sqlite3_bind_text
|
||||
|
||||
/**
|
||||
* In the SQL strings input to switch_core_db_prepare(),
|
||||
* one or more literals can be replace by parameters "?" or ":AAA" or
|
||||
@@ -260,9 +248,8 @@ DoxyDefine(int switch_core_db_bind_text(sqlite3_stmt*, int, const char*, int n,
|
||||
* an switch_core_db_prepare() or sqlite3_reset(). Unbound parameterss are
|
||||
* interpreted as NULL.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));)
|
||||
DoxyDefine(int switch_core_db_bind_text16(sqlite3_stmt *, int, const void *, int, void (*)(void *));)
|
||||
#define switch_core_db_bind_text16 sqlite3_bind_text16
|
||||
|
||||
/**
|
||||
* In the SQL strings input to switch_core_db_prepare(),
|
||||
* one or more literals can be replace by parameters "?" or ":AAA" or
|
||||
@@ -283,24 +270,21 @@ DoxyDefine(int switch_core_db_bind_text16(sqlite3_stmt*, int, const void*, int,
|
||||
* an switch_core_db_prepare() or sqlite3_reset(). Unbound parameterss are
|
||||
* interpreted as NULL.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_bind_value(sqlite3_stmt*, int, const sqlite3_value*);)
|
||||
DoxyDefine(int switch_core_db_bind_value(sqlite3_stmt *, int, const sqlite3_value *);)
|
||||
#define switch_core_db_bind_value sqlite3_bind_value
|
||||
|
||||
/**
|
||||
* @return The number of parameters in a compiled SQL statement.
|
||||
* @remark This routine was added to support DBD::SQLite.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_bind_parameter_count(sqlite3_stmt*);)
|
||||
DoxyDefine(int switch_core_db_bind_parameter_count(sqlite3_stmt *);)
|
||||
#define switch_core_db_bind_parameter_count sqlite3_bind_parameter_count
|
||||
|
||||
/**
|
||||
* @return the index of a parameter with the given name. If no parameter with the
|
||||
* given name is found, return 0.
|
||||
* @remark The name must match exactly.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_bind_parameter_index(sqlite3_stmt*, const char *zName);)
|
||||
DoxyDefine(int switch_core_db_bind_parameter_index(sqlite3_stmt *, const char *zName);)
|
||||
#define switch_core_db_bind_parameter_index sqlite3_bind_parameter_index
|
||||
|
||||
/**
|
||||
* @return the name of the i-th parameter.
|
||||
* @remark Ordinary parameters "?" are
|
||||
@@ -308,9 +292,8 @@ DoxyDefine(int switch_core_db_bind_parameter_index(sqlite3_stmt*, const char *zN
|
||||
* $VVV the complete text of the parameter name is returned, including
|
||||
* the initial ":" or "$". NULL is returned if the index is out of range.
|
||||
*/
|
||||
DoxyDefine(const char *switch_core_db_bind_parameter_name(sqlite3_stmt*, int);)
|
||||
DoxyDefine(const char *switch_core_db_bind_parameter_name(sqlite3_stmt *, int);)
|
||||
#define switch_core_db_bind_parameter_name sqlite3_bind_parameter_name
|
||||
|
||||
/**
|
||||
* This routine identifies a callback function that is invoked
|
||||
* whenever an attempt is made to open a database table that is
|
||||
@@ -333,9 +316,8 @@ DoxyDefine(const char *switch_core_db_bind_parameter_name(sqlite3_stmt*, int);)
|
||||
* data structures out from under the executing query and will
|
||||
* probably result in a coredump.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_busy_handler(switch_core_db*, int(*)(void*,int), void*);)
|
||||
DoxyDefine(int switch_core_db_busy_handler(switch_core_db *, int (*)(void *, int), void *);)
|
||||
#define switch_core_db_busy_handler sqlite3_busy_handler
|
||||
|
||||
/**
|
||||
* This routine sets a busy handler that sleeps for a while when a
|
||||
* table is locked. The handler will sleep multiple times until
|
||||
@@ -346,9 +328,8 @@ DoxyDefine(int switch_core_db_busy_handler(switch_core_db*, int(*)(void*,int), v
|
||||
* Calling this routine with an argument less than or equal to zero
|
||||
* turns off all busy handlers.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_busy_timeout(switch_core_db*, int ms);)
|
||||
DoxyDefine(int switch_core_db_busy_timeout(switch_core_db *, int ms);)
|
||||
#define switch_core_db_busy_timeout sqlite3_busy_timeout
|
||||
|
||||
/**
|
||||
* This function returns the number of database rows that were changed
|
||||
* (or inserted or deleted) by the most recent called sqlite3_exec().
|
||||
@@ -369,9 +350,8 @@ DoxyDefine(int switch_core_db_busy_timeout(switch_core_db*, int ms);)
|
||||
* table. To get an accurate count of the number of rows deleted, use
|
||||
* "DELETE FROM table WHERE 1" instead.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_changes(switch_core_db*);)
|
||||
DoxyDefine(int switch_core_db_changes(switch_core_db *);)
|
||||
#define switch_core_db_changes sqlite3_changes
|
||||
|
||||
/**
|
||||
* A function to close the database.
|
||||
*
|
||||
@@ -385,7 +365,6 @@ DoxyDefine(int switch_core_db_changes(switch_core_db*);)
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_close(switch_core_db *);)
|
||||
#define switch_core_db_close sqlite3_close
|
||||
|
||||
/**
|
||||
* To avoid having to register all collation sequences before a database
|
||||
* can be used, a single callback function may be registered with the
|
||||
@@ -405,13 +384,10 @@ DoxyDefine(int switch_core_db_close(switch_core_db *);)
|
||||
* The collation sequence is returned to SQLite by a collation-needed
|
||||
* callback using the sqlite3_create_collation() API, described above.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_collation_needed(
|
||||
switch_core_db*,
|
||||
void*,
|
||||
void(*)(void*,switch_core_db*,int eTextRep,const char*)
|
||||
);)
|
||||
DoxyDefine(int switch_core_db_collation_needed(switch_core_db *,
|
||||
void *, void (*)(void *, switch_core_db *, int eTextRep, const char *)
|
||||
);)
|
||||
#define switch_core_db_collation_needed sqlite3_collation_needed
|
||||
|
||||
/**
|
||||
* The next group of routines returns information about the information
|
||||
* in a single column of the current result row of a query.
|
||||
@@ -453,9 +429,8 @@ DoxyDefine(int switch_core_db_collation_needed(
|
||||
*
|
||||
* @return the value of a BLOB.
|
||||
*/
|
||||
DoxyDefine(const void *switch_core_db_column_blob(sqlite3_stmt *stmt, int iCol);)
|
||||
DoxyDefine(const void *switch_core_db_column_blob(sqlite3_stmt * stmt, int iCol);)
|
||||
#define switch_core_db_column_blob sqlite3_column_blob
|
||||
|
||||
/**
|
||||
* The next group of routines returns information about the information
|
||||
* in a single column of the current result row of a query. In every
|
||||
@@ -497,9 +472,8 @@ DoxyDefine(const void *switch_core_db_column_blob(sqlite3_stmt *stmt, int iCol);
|
||||
* TEXT value represented as UTF-8. The "\000" terminator is included in the
|
||||
* byte count for TEXT values.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_column_bytes(sqlite3_stmt*, int iCol);)
|
||||
DoxyDefine(int switch_core_db_column_bytes(sqlite3_stmt *, int iCol);)
|
||||
#define switch_core_db_column_bytes sqlite3_column_bytes
|
||||
|
||||
/**
|
||||
* The next group of routines returns information about the information
|
||||
* in a single column of the current result row of a query. In every
|
||||
@@ -541,9 +515,8 @@ DoxyDefine(int switch_core_db_column_bytes(sqlite3_stmt*, int iCol);)
|
||||
* TEXT value represented as UTF-16. The "\u0000" terminator is included in
|
||||
* the byte count for TEXT values.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_column_bytes16(sqlite3_stmt*, int iCol);)
|
||||
DoxyDefine(int switch_core_db_column_bytes16(sqlite3_stmt *, int iCol);)
|
||||
#define switch_core_db_column_bytes16 sqlite3_column_bytes16
|
||||
|
||||
/**
|
||||
* The next group of routines returns information about the information
|
||||
* in a single column of the current result row of a query. In every
|
||||
@@ -583,9 +556,8 @@ DoxyDefine(int switch_core_db_column_bytes16(sqlite3_stmt*, int iCol);)
|
||||
*
|
||||
* Return a FLOAT value.
|
||||
*/
|
||||
DoxyDefine(double switch_core_db_column_double(sqlite3_stmt*, int iCol);)
|
||||
DoxyDefine(double switch_core_db_column_double(sqlite3_stmt *, int iCol);)
|
||||
#define switch_core_db_column_double sqlite3_column_double
|
||||
|
||||
/**
|
||||
* The next group of routines returns information about the information
|
||||
* in a single column of the current result row of a query. In every
|
||||
@@ -626,9 +598,8 @@ DoxyDefine(double switch_core_db_column_double(sqlite3_stmt*, int iCol);)
|
||||
* Return an INTEGER value in the host computer's native integer representation.
|
||||
* This might be either a 32- or 64-bit integer depending on the host.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_column_int(sqlite3_stmt*, int iCol);)
|
||||
DoxyDefine(int switch_core_db_column_int(sqlite3_stmt *, int iCol);)
|
||||
#define switch_core_db_column_int sqlite3_column_int
|
||||
|
||||
/**
|
||||
* The next group of routines returns information about the information
|
||||
* in a single column of the current result row of a query. In every
|
||||
@@ -668,9 +639,8 @@ DoxyDefine(int switch_core_db_column_int(sqlite3_stmt*, int iCol);)
|
||||
*
|
||||
* Return an INTEGER value as a 64-bit signed integer.
|
||||
*/
|
||||
DoxyDefine(sqlite_int64 switch_core_db_column_int64(sqlite3_stmt*, int iCol);)
|
||||
DoxyDefine(sqlite_int64 switch_core_db_column_int64(sqlite3_stmt *, int iCol);)
|
||||
#define switch_core_db_column_int64 sqlite3_column_int64
|
||||
|
||||
/**
|
||||
* The next group of routines returns information about the information
|
||||
* in a single column of the current result row of a query. In every
|
||||
@@ -710,9 +680,8 @@ DoxyDefine(sqlite_int64 switch_core_db_column_int64(sqlite3_stmt*, int iCol);)
|
||||
*
|
||||
* Return the value as UTF-8 text.
|
||||
*/
|
||||
DoxyDefine(const unsigned char *switch_core_db_column_text(sqlite3_stmt*, int iCol);)
|
||||
DoxyDefine(const unsigned char *switch_core_db_column_text(sqlite3_stmt *, int iCol);)
|
||||
#define switch_core_db_column_text sqlite3_column_text
|
||||
|
||||
/**
|
||||
* The next group of routines returns information about the information
|
||||
* in a single column of the current result row of a query. In every
|
||||
@@ -752,9 +721,8 @@ DoxyDefine(const unsigned char *switch_core_db_column_text(sqlite3_stmt*, int iC
|
||||
*
|
||||
* Return the value as UTF-16 text.
|
||||
*/
|
||||
DoxyDefine(const void *switch_core_db_column_text16(sqlite3_stmt*, int iCol);)
|
||||
DoxyDefine(const void *switch_core_db_column_text16(sqlite3_stmt *, int iCol);)
|
||||
#define switch_core_db_column_text16 sqlite3_column_text16
|
||||
|
||||
/**
|
||||
* The next group of routines returns information about the information
|
||||
* in a single column of the current result row of a query. In every
|
||||
@@ -795,25 +763,22 @@ DoxyDefine(const void *switch_core_db_column_text16(sqlite3_stmt*, int iCol);)
|
||||
* ReturnS the datatype of the result. This is one of
|
||||
* SQLITE_INTEGER, SQLITE_FLOAT, SQLITE_TEXT, SQLITE_BLOB, or SQLITE_NULL.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_column_type(sqlite3_stmt*, int iCol);)
|
||||
DoxyDefine(int switch_core_db_column_type(sqlite3_stmt *, int iCol);)
|
||||
#define switch_core_db_column_type sqlite3_column_type
|
||||
|
||||
/**
|
||||
* The first parameter is a compiled SQL statement. This function returns
|
||||
* the column heading for the Nth column of that statement, where N is the
|
||||
* second function parameter. The string returned is UTF-8.
|
||||
*/
|
||||
DoxyDefine(const char *switch_core_db_column_name(sqlite3_stmt*,int);)
|
||||
DoxyDefine(const char *switch_core_db_column_name(sqlite3_stmt *, int);)
|
||||
#define switch_core_db_column_name sqlite3_column_name
|
||||
|
||||
/**
|
||||
* Return the number of columns in the result set returned by the compiled
|
||||
* SQL statement. This routine returns 0 if pStmt is an SQL statement
|
||||
* that does not return data (for example an UPDATE).
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_column_count(sqlite3_stmt *pStmt);)
|
||||
DoxyDefine(int switch_core_db_column_count(sqlite3_stmt * pStmt);)
|
||||
#define switch_core_db_column_count sqlite3_column_count
|
||||
|
||||
/**
|
||||
* The first parameter is a compiled SQL statement. If this statement
|
||||
* is a SELECT statement, the Nth column of the returned result set
|
||||
@@ -834,7 +799,6 @@ DoxyDefine(int switch_core_db_column_count(sqlite3_stmt *pStmt);)
|
||||
*/
|
||||
DoxyDefine(const char *switch_core_db_column_decltype(sqlite3_stmt *, int i);)
|
||||
#define switch_core_db_column_decltype sqlite3_column_decltype
|
||||
|
||||
/**
|
||||
* The first parameter is a compiled SQL statement. If this statement
|
||||
* is a SELECT statement, the Nth column of the returned result set
|
||||
@@ -853,9 +817,8 @@ DoxyDefine(const char *switch_core_db_column_decltype(sqlite3_stmt *, int i);)
|
||||
* result column (i==1), and a NULL pointer for the first result column
|
||||
* (i==0).
|
||||
*/
|
||||
DoxyDefine(const void *switch_core_db_column_decltype16(sqlite3_stmt*,int);)
|
||||
DoxyDefine(const void *switch_core_db_column_decltype16(sqlite3_stmt *, int);)
|
||||
#define switch_core_db_column_decltype16 sqlite3_column_decltype16
|
||||
|
||||
/**
|
||||
* Register a callback function to be invoked whenever a new transaction
|
||||
* is committed. The pArg argument is passed through to the callback.
|
||||
@@ -869,9 +832,8 @@ DoxyDefine(const void *switch_core_db_column_decltype16(sqlite3_stmt*,int);)
|
||||
*
|
||||
****** THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ******
|
||||
*/
|
||||
DoxyDefine(void *switch_core_db_commit_hook(switch_core_db*, int(*)(void*), void*);)
|
||||
DoxyDefine(void *switch_core_db_commit_hook(switch_core_db *, int (*)(void *), void *);)
|
||||
#define switch_core_db_commit_hook sqlite3_commit_hook
|
||||
|
||||
/**
|
||||
* This functions return true if the given input string comprises
|
||||
* one or more complete SQL statements. The parameter must be a nul-terminated
|
||||
@@ -883,7 +845,6 @@ DoxyDefine(void *switch_core_db_commit_hook(switch_core_db*, int(*)(void*), void
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_complete(const char *sql);)
|
||||
#define switch_core_db_complete sqlite3_complete
|
||||
|
||||
/**
|
||||
* This function is used to add new collation sequences to the
|
||||
* sqlite3 handle specified as the first argument.
|
||||
@@ -909,15 +870,12 @@ DoxyDefine(int switch_core_db_complete(const char *sql);)
|
||||
* the first string is less than, equal to, or greater than the second
|
||||
* string. i.e. (STRING1 - STRING2).
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_create_collation(
|
||||
switch_core_db*,
|
||||
const char *zName,
|
||||
int eTextRep,
|
||||
void*,
|
||||
int(*xCompare)(void*,int,const void*,int,const void*)
|
||||
);)
|
||||
DoxyDefine(int switch_core_db_create_collation(switch_core_db *,
|
||||
const char *zName,
|
||||
int eTextRep,
|
||||
void *, int (*xCompare) (void *, int, const void *, int, const void *)
|
||||
);)
|
||||
#define switch_core_db_create_collation sqlite3_create_collation
|
||||
|
||||
/**
|
||||
* The following function is used to add user functions or aggregates
|
||||
* implemented in C to the SQL langauge interpreted by SQLite. The
|
||||
@@ -951,18 +909,16 @@ DoxyDefine(int switch_core_db_create_collation(
|
||||
* xFunc and an xFinal, or an xStep but no xFinal, SQLITE_ERROR is
|
||||
* returned.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_create_function(
|
||||
switch_core_db *,
|
||||
const char *zFunctionName,
|
||||
int nArg,
|
||||
int eTextRep,
|
||||
void*,
|
||||
void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
|
||||
void (*xStep)(sqlite3_context*,int,sqlite3_value**),
|
||||
void (*xFinal)(sqlite3_context*)
|
||||
);)
|
||||
DoxyDefine(int switch_core_db_create_function(switch_core_db *,
|
||||
const char *zFunctionName,
|
||||
int nArg,
|
||||
int eTextRep,
|
||||
void *,
|
||||
void (*xFunc) (sqlite3_context *, int, sqlite3_value **),
|
||||
void (*xStep) (sqlite3_context *, int, sqlite3_value **),
|
||||
void (*xFinal) (sqlite3_context *)
|
||||
);)
|
||||
#define switch_core_db_create_function sqlite3_create_function
|
||||
|
||||
/**
|
||||
* Return the number of values in the current row of the result set.
|
||||
*
|
||||
@@ -972,18 +928,16 @@ DoxyDefine(int switch_core_db_create_function(
|
||||
* error code, or before switch_core_db_step() has been called on a
|
||||
* compiled SQL statement, this routine returns zero.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_data_count(sqlite3_stmt *pStmt);)
|
||||
DoxyDefine(int switch_core_db_data_count(sqlite3_stmt * pStmt);)
|
||||
#define switch_core_db_data_count sqlite3_data_count
|
||||
|
||||
/**
|
||||
* Return the sqlite3* database handle to which the prepared statement given
|
||||
* in the argument belongs. This is the same database handle that was
|
||||
* the first argument to the switch_core_db_prepare() that was used to create
|
||||
* the statement in the first place.
|
||||
*/
|
||||
DoxyDefine(switch_core_db *switch_core_db_db_handle(sqlite3_stmt*);)
|
||||
DoxyDefine(switch_core_db * switch_core_db_db_handle(sqlite3_stmt *);)
|
||||
#define switch_core_db_db_handle sqlite3_db_handle
|
||||
|
||||
/**
|
||||
** Return the error code for the most recent switch_core_db_* API call associated
|
||||
** with switch_core_db handle 'db'. SQLITE_OK is returned if the most recent
|
||||
@@ -999,9 +953,8 @@ DoxyDefine(switch_core_db *switch_core_db_db_handle(sqlite3_stmt*);)
|
||||
** code returned by this function is associated with the same error as
|
||||
** the strings returned by sqlite3_errmsg() and sqlite3_errmsg16().
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_errcode(switch_core_db *db);)
|
||||
DoxyDefine(int switch_core_db_errcode(switch_core_db * db);)
|
||||
#define switch_core_db_errcode sqlite3_errcode
|
||||
|
||||
/**
|
||||
* Return a pointer to a UTF-8 encoded string describing in english the
|
||||
* error condition for the most recent sqlite3_* API call. The returned
|
||||
@@ -1010,9 +963,8 @@ DoxyDefine(int switch_core_db_errcode(switch_core_db *db);)
|
||||
* The string "not an error" is returned when the most recent API call was
|
||||
* successful.
|
||||
*/
|
||||
DoxyDefine(const char *switch_core_db_errmsg(switch_core_db*);)
|
||||
DoxyDefine(const char *switch_core_db_errmsg(switch_core_db *);)
|
||||
#define switch_core_db_errmsg sqlite3_errmsg
|
||||
|
||||
/**
|
||||
* A function to executes one or more statements of SQL.
|
||||
*
|
||||
@@ -1053,15 +1005,13 @@ DoxyDefine(const char *switch_core_db_errmsg(switch_core_db*);)
|
||||
* behavior can be modified somewhat using the sswitch_core_db_busy_handler()
|
||||
* and switch_core_db_busy_timeout() functions below.)
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_exec(
|
||||
switch_core_db*, /* An open database */
|
||||
const char *sql, /* SQL to be executed */
|
||||
sqlite3_callback, /* Callback function */
|
||||
void *, /* 1st argument to callback function */
|
||||
char **errmsg /* Error msg written here */
|
||||
);)
|
||||
DoxyDefine(int switch_core_db_exec(switch_core_db *, /* An open database */
|
||||
const char *sql, /* SQL to be executed */
|
||||
sqlite3_callback, /* Callback function */
|
||||
void *, /* 1st argument to callback function */
|
||||
char **errmsg /* Error msg written here */
|
||||
);)
|
||||
#define switch_core_db_exec sqlite3_exec
|
||||
|
||||
/**
|
||||
* Return TRUE (non-zero) if the statement supplied as an argument needs
|
||||
* to be recompiled. A statement needs to be recompiled whenever the
|
||||
@@ -1071,9 +1021,8 @@ DoxyDefine(int switch_core_db_exec(
|
||||
* added or changed.
|
||||
*
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_expired(sqlite3_stmt*);)
|
||||
DoxyDefine(int switch_core_db_expired(sqlite3_stmt *);)
|
||||
#define switch_core_db_expired sqlite3_expired
|
||||
|
||||
/**
|
||||
* This function is called to delete a compiled
|
||||
* SQL statement obtained by a previous call to switch_core_db_prepare().
|
||||
@@ -1088,24 +1037,21 @@ DoxyDefine(int switch_core_db_expired(sqlite3_stmt*);)
|
||||
* rolled back and transactions cancelled, depending on the circumstances,
|
||||
* and the result code returned will be SQLITE_ABORT.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_finalize(sqlite3_stmt *pStmt);)
|
||||
DoxyDefine(int switch_core_db_finalize(sqlite3_stmt * pStmt);)
|
||||
#define switch_core_db_finalize sqlite3_finalize
|
||||
|
||||
/**
|
||||
* Call this routine to free the memory that sqlite3_get_table() allocated.
|
||||
*/
|
||||
DoxyDefine(void switch_core_db_free_table(char **result);)
|
||||
#define switch_core_db_free_table sqlite3_free_table
|
||||
|
||||
/**
|
||||
* Test to see whether or not the database connection is in autocommit
|
||||
* mode. Return TRUE if it is and FALSE if not. Autocommit mode is on
|
||||
* by default. Autocommit is disabled by a BEGIN statement and reenabled
|
||||
* by the next COMMIT or ROLLBACK.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_get_autocommit(switch_core_db*);)
|
||||
DoxyDefine(int switch_core_db_get_autocommit(switch_core_db *);)
|
||||
#define switch_core_db_get_autocommit sqlite3_get_autocommit
|
||||
|
||||
/**
|
||||
* The following function may be used by scalar user functions to
|
||||
* associate meta-data with argument values. If the same value is passed to
|
||||
@@ -1125,9 +1071,8 @@ DoxyDefine(int switch_core_db_get_autocommit(switch_core_db*);)
|
||||
* expressions that are constant at compile time. This includes literal
|
||||
* values and SQL variables.
|
||||
*/
|
||||
DoxyDefine(void *switch_core_db_get_auxdata(sqlite3_context*, int);)
|
||||
DoxyDefine(void *switch_core_db_get_auxdata(sqlite3_context *, int);)
|
||||
#define switch_core_db_get_auxdata sqlite3_get_auxdata
|
||||
|
||||
/**
|
||||
* The following function may be used by scalar user functions to
|
||||
* associate meta-data with argument values. If the same value is passed to
|
||||
@@ -1149,9 +1094,8 @@ DoxyDefine(void *switch_core_db_get_auxdata(sqlite3_context*, int);)
|
||||
* expressions that are constant at compile time. This includes literal
|
||||
* values and SQL variables.
|
||||
*/
|
||||
DoxyDefine(void switch_core_db_set_auxdata(sqlite3_context*, int, void*, void (*)(void*));)
|
||||
DoxyDefine(void switch_core_db_set_auxdata(sqlite3_context *, int, void *, void (*)(void *));)
|
||||
#define switch_core_db_set_auxdata sqlite3_set_auxdata
|
||||
|
||||
/**
|
||||
* This next routine is really just a wrapper around sqlite3_exec().
|
||||
* Instead of invoking a user-supplied callback for each row of the
|
||||
@@ -1193,16 +1137,14 @@ DoxyDefine(void switch_core_db_set_auxdata(sqlite3_context*, int, void*, void (*
|
||||
*
|
||||
* The return value of this routine is the same as from switch_core_db_exec().
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_get_table(
|
||||
switch_core_db*, /* An open database */
|
||||
const char *sql, /* SQL to be executed */
|
||||
char ***resultp, /* Result written to a char *[] that this points to */
|
||||
int *nrow, /* Number of result rows written here */
|
||||
int *ncolumn, /* Number of result columns written here */
|
||||
char **errmsg /* Error msg written here */
|
||||
);)
|
||||
DoxyDefine(int switch_core_db_get_table(switch_core_db *, /* An open database */
|
||||
const char *sql, /* SQL to be executed */
|
||||
char ***resultp, /* Result written to a char *[] that this points to */
|
||||
int *nrow, /* Number of result rows written here */
|
||||
int *ncolumn, /* Number of result columns written here */
|
||||
char **errmsg /* Error msg written here */
|
||||
);)
|
||||
#define switch_core_db_get_table sqlite3_get_table
|
||||
|
||||
/**
|
||||
* This function is called to recover from a malloc() failure that occured
|
||||
* within the SQLite library. Normally, after a single malloc() fails the
|
||||
@@ -1224,16 +1166,14 @@ DoxyDefine(int switch_core_db_get_table(
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_global_recover();)
|
||||
#define switch_core_db_global_recover sqlite3_global_recover
|
||||
|
||||
/** This function causes any pending database operation to abort and
|
||||
* return at its earliest opportunity. This routine is typically
|
||||
* called in response to a user action such as pressing "Cancel"
|
||||
* or Ctrl-C where the user wants a long query operation to halt
|
||||
* immediately.
|
||||
*/
|
||||
DoxyDefine(void switch_core_db_interrupt(switch_core_db*);)
|
||||
DoxyDefine(void switch_core_db_interrupt(switch_core_db *);)
|
||||
#define switch_core_db_interrupt sqlite3_interrupt
|
||||
|
||||
/**
|
||||
* Each entry in an SQLite table has a unique integer key. (The key is
|
||||
* the value of the INTEGER PRIMARY KEY column if there is such a column,
|
||||
@@ -1243,9 +1183,8 @@ DoxyDefine(void switch_core_db_interrupt(switch_core_db*);)
|
||||
*
|
||||
* This function is similar to the mysql_insert_id() function from MySQL.
|
||||
*/
|
||||
DoxyDefine(sqlite_int64 switch_core_db_last_insert_rowid(switch_core_db*);)
|
||||
DoxyDefine(sqlite_int64 switch_core_db_last_insert_rowid(switch_core_db *);)
|
||||
#define switch_core_db_last_insert_rowid sqlite3_last_insert_rowid
|
||||
|
||||
/**
|
||||
* Open the sqlite database file "filename". The "filename" is UTF-8
|
||||
* encoded. An sqlite3* handle is returned in *ppDb, even
|
||||
@@ -1261,12 +1200,10 @@ DoxyDefine(sqlite_int64 switch_core_db_last_insert_rowid(switch_core_db*);)
|
||||
* with the switch_core_db* handle should be released by passing it to
|
||||
* switch_core_db_close() when it is no longer required.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_open(
|
||||
const char *filename, /* Database filename (UTF-8) */
|
||||
switch_core_db **ppDb /* OUT: SQLite db handle */
|
||||
);)
|
||||
DoxyDefine(int switch_core_db_open(const char *filename, /* Database filename (UTF-8) */
|
||||
switch_core_db ** ppDb /* OUT: SQLite db handle */
|
||||
);)
|
||||
#define switch_core_db_open sqlite3_open
|
||||
|
||||
/**
|
||||
* To execute an SQL query, it must first be compiled into a byte-code
|
||||
* program using the following routine.
|
||||
@@ -1289,15 +1226,13 @@ DoxyDefine(int switch_core_db_open(
|
||||
*
|
||||
* On success, SQLITE_OK is returned. Otherwise an error code is returned.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_prepare(
|
||||
sqlite3 *db, /* Database handle */
|
||||
const char *zSql, /* SQL statement, UTF-8 encoded */
|
||||
int nBytes, /* Length of zSql in bytes. */
|
||||
sqlite3_stmt **ppStmt, /* OUT: Statement handle */
|
||||
const char **pzTail /* OUT: Pointer to unused portion of zSql */
|
||||
);)
|
||||
DoxyDefine(int switch_core_db_prepare(sqlite3 * db, /* Database handle */
|
||||
const char *zSql, /* SQL statement, UTF-8 encoded */
|
||||
int nBytes, /* Length of zSql in bytes. */
|
||||
sqlite3_stmt ** ppStmt, /* OUT: Statement handle */
|
||||
const char **pzTail /* OUT: Pointer to unused portion of zSql */
|
||||
);)
|
||||
#define switch_core_db_prepare sqlite3_prepare
|
||||
|
||||
/**
|
||||
* Register a function for tracing SQL command evaluation. The function registered by
|
||||
* switch_core_db_profile() runs at the end of each SQL statement and includes
|
||||
@@ -1306,10 +1241,9 @@ DoxyDefine(int switch_core_db_prepare(
|
||||
* The sqlite3_profile() API is currently considered experimental and
|
||||
* is subject to change.
|
||||
*/
|
||||
DoxyDefine(void *switch_core_db_profile(switch_core_db*,
|
||||
void(*xProfile)(void*,const char*,sqlite_uint64), void*);)
|
||||
DoxyDefine(void *switch_core_db_profile(switch_core_db *,
|
||||
void (*xProfile) (void *, const char *, sqlite_uint64), void *);)
|
||||
#define switch_core_db_profile sqlite3_profile
|
||||
|
||||
/**
|
||||
* This routine configures a callback function - the progress callback - that
|
||||
* is invoked periodically during long running calls to switch_core_db_exec(),
|
||||
@@ -1336,9 +1270,8 @@ DoxyDefine(void *switch_core_db_profile(switch_core_db*,
|
||||
*
|
||||
****** THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ******
|
||||
*/
|
||||
DoxyDefine(void switch_core_db_progress_handler(switch_core_db*, int, int(*)(void*), void*);)
|
||||
DoxyDefine(void switch_core_db_progress_handler(switch_core_db *, int, int (*)(void *), void *);)
|
||||
#define switch_core_db_progress_handler sqlite3_progress_handler
|
||||
|
||||
/**
|
||||
* The switch_core_db_reset() function is called to reset a compiled SQL
|
||||
* statement obtained by a previous call to switch_core_db_prepare()
|
||||
@@ -1346,93 +1279,80 @@ DoxyDefine(void switch_core_db_progress_handler(switch_core_db*, int, int(*)(voi
|
||||
* Any SQL statement variables that had values bound to them using
|
||||
* the switch_core_db_bind_*() API retain their values.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_reset(sqlite3_stmt *pStmt);)
|
||||
DoxyDefine(int switch_core_db_reset(sqlite3_stmt * pStmt);)
|
||||
#define switch_core_db_reset sqlite3_reset
|
||||
|
||||
/**
|
||||
* User-defined functions invoke this routine in order to
|
||||
* set their return value.
|
||||
*/
|
||||
DoxyDefine(void switch_core_db_result_blob(sqlite3_context*, const void*, int, void(*)(void*));)
|
||||
DoxyDefine(void switch_core_db_result_blob(sqlite3_context *, const void *, int, void (*)(void *));)
|
||||
#define switch_core_db_result_blob sqlite3_result_blob
|
||||
|
||||
/**
|
||||
* User-defined functions invoke this routine in order to
|
||||
* set their return value.
|
||||
*/
|
||||
DoxyDefine(void switch_core_db_result_double(sqlite3_context*, double);)
|
||||
DoxyDefine(void switch_core_db_result_double(sqlite3_context *, double);)
|
||||
#define switch_core_db_result_double sqlite3_result_double
|
||||
|
||||
/**
|
||||
* User-defined functions invoke this routine in order to
|
||||
* set their return value.
|
||||
*/
|
||||
DoxyDefine(void switch_core_db_result_error(sqlite3_context*, const char*, int);)
|
||||
DoxyDefine(void switch_core_db_result_error(sqlite3_context *, const char *, int);)
|
||||
#define switch_core_db_result_error sqlite3_result_error
|
||||
|
||||
/**
|
||||
* User-defined functions invoke this routine in order to
|
||||
* set their return value.
|
||||
*/
|
||||
DoxyDefine(void switch_core_db_result_error16(sqlite3_context*, const void*, int);)
|
||||
DoxyDefine(void switch_core_db_result_error16(sqlite3_context *, const void *, int);)
|
||||
#define switch_core_db_result_error16 sqlite3_result_error16
|
||||
|
||||
/**
|
||||
* User-defined functions invoke this routine in order to
|
||||
* set their return value.
|
||||
*/
|
||||
DoxyDefine(void switch_core_db_result_int(sqlite3_context*, int);)
|
||||
DoxyDefine(void switch_core_db_result_int(sqlite3_context *, int);)
|
||||
#define switch_core_db_result_int sqlite3_result_int
|
||||
|
||||
/**
|
||||
* User-defined functions invoke this routine in order to
|
||||
* set their return value.
|
||||
*/
|
||||
DoxyDefine(void switch_core_db_result_int64(sqlite3_context*, sqlite_int64);)
|
||||
DoxyDefine(void switch_core_db_result_int64(sqlite3_context *, sqlite_int64);)
|
||||
#define switch_core_db_result_int64 sqlite3_result_int64
|
||||
|
||||
/**
|
||||
* User-defined functions invoke this routine in order to
|
||||
* set their return value.
|
||||
*/
|
||||
DoxyDefine(void switch_core_db_result_null(sqlite3_context*);)
|
||||
DoxyDefine(void switch_core_db_result_null(sqlite3_context *);)
|
||||
#define switch_core_db_result_null sqlite3_result_null
|
||||
|
||||
/**
|
||||
* User-defined functions invoke this routine in order to
|
||||
* set their return value.
|
||||
*/
|
||||
DoxyDefine(void switch_core_db_result_text(sqlite3_context*, const char*, int, void(*)(void*));)
|
||||
DoxyDefine(void switch_core_db_result_text(sqlite3_context *, const char *, int, void (*)(void *));)
|
||||
#define switch_core_db_result_text sqlite3_result_text
|
||||
|
||||
/**
|
||||
* User-defined functions invoke this routine in order to
|
||||
* set their return value.
|
||||
*/
|
||||
DoxyDefine(void switch_core_db_result_text16(sqlite3_context*, const void*, int, void(*)(void*));)
|
||||
DoxyDefine(void switch_core_db_result_text16(sqlite3_context *, const void *, int, void (*)(void *));)
|
||||
#define switch_core_db_result_text16 sqlite3_result_text16
|
||||
|
||||
/**
|
||||
* User-defined functions invoke this routine in order to
|
||||
* set their return value.
|
||||
*/
|
||||
DoxyDefine(void switch_core_db_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));)
|
||||
DoxyDefine(void switch_core_db_result_text16le(sqlite3_context *, const void *, int, void (*)(void *));)
|
||||
#define switch_core_db_result_text16le sqlite3_result_text16le
|
||||
|
||||
/**
|
||||
* User-defined functions invoke this routine in order to
|
||||
* set their return value.
|
||||
*/
|
||||
DoxyDefine(void switch_core_db_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));)
|
||||
DoxyDefine(void switch_core_db_result_text16be(sqlite3_context *, const void *, int, void (*)(void *));)
|
||||
#define switch_core_db_result_text16be sqlite3_result_text16be
|
||||
|
||||
/**
|
||||
* User-defined functions invoke this routine in order to
|
||||
* set their return value.
|
||||
*/
|
||||
DoxyDefine(void switch_core_db_result_value(sqlite3_context*, sqlite3_value*);)
|
||||
DoxyDefine(void switch_core_db_result_value(sqlite3_context *, sqlite3_value *);)
|
||||
#define switch_core_db_result_value sqlite3_result_value
|
||||
|
||||
/**
|
||||
* This routine registers a callback with the SQLite library. The
|
||||
* callback is invoked (at compile-time, not at run-time) for each
|
||||
@@ -1441,13 +1361,10 @@ DoxyDefine(void switch_core_db_result_value(sqlite3_context*, sqlite3_value*);)
|
||||
* SQL statement should be aborted with an error and SQLITE_IGNORE
|
||||
* if the column should be treated as a NULL value.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_set_authorizer(
|
||||
switch_core_db*,
|
||||
int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
|
||||
void *pUserData
|
||||
);)
|
||||
DoxyDefine(int switch_core_db_set_authorizer(switch_core_db *,
|
||||
int (*xAuth) (void *, int, const char *, const char *, const char *,
|
||||
const char *), void *pUserData);)
|
||||
#define switch_core_db_set_authorizer sqlite3_set_authorizer
|
||||
|
||||
/**
|
||||
* After an SQL query has been compiled with a call to either
|
||||
* switch_core_db_prepare(), then this function must be
|
||||
@@ -1480,9 +1397,8 @@ DoxyDefine(int switch_core_db_set_authorizer(
|
||||
* SQLITE_DONE. Or it could be the case the the same database connection
|
||||
* is being used simulataneously by two or more threads.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_step(sqlite3_stmt*);)
|
||||
DoxyDefine(int switch_core_db_step(sqlite3_stmt *);)
|
||||
#define switch_core_db_step sqlite3_step
|
||||
|
||||
/**
|
||||
* If the following global variable is made to point to a
|
||||
* string which is the name of a directory, then all temporary files
|
||||
@@ -1493,9 +1409,8 @@ DoxyDefine(int switch_core_db_step(sqlite3_stmt*);)
|
||||
* Once switch_core_db_open() has been called, changing this variable will invalidate
|
||||
* the current temporary database, if any.
|
||||
*/
|
||||
DoxyDefine(extern char *switch_core_db_temp_directory;)
|
||||
DoxyDefine(extern char *switch_core_db_temp_directory;)
|
||||
#define switch_core_db_temp_directory sqlite3_temp_directory
|
||||
|
||||
/**
|
||||
* This function returns the number of database rows that have been
|
||||
* modified by INSERT, UPDATE or DELETE statements since the database handle
|
||||
@@ -1512,17 +1427,15 @@ DoxyDefine(extern char *switch_core_db_temp_directory;)
|
||||
* table. To get an accurate count of the number of rows deleted, use
|
||||
* "DELETE FROM table WHERE 1" instead.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_total_changes(switch_core_db*);)
|
||||
DoxyDefine(int switch_core_db_total_changes(switch_core_db *);)
|
||||
#define switch_core_db_total_changes sqlite3_total_changes
|
||||
|
||||
/**
|
||||
* Register a function for tracing SQL command evaluation. The function
|
||||
* registered is invoked at the first switch_core_db_step()
|
||||
* for the evaluation of an SQL statement.
|
||||
*/
|
||||
DoxyDefine(void *switch_core_db_trace(switch_core_db*, void(*xTrace)(void*,const char*), void*);)
|
||||
DoxyDefine(void *switch_core_db_trace(switch_core_db *, void (*xTrace) (void *, const char *), void *);)
|
||||
#define switch_core_db_trace sqlite3_trace
|
||||
|
||||
/**
|
||||
* Move all bindings from the first prepared statement over to the second.
|
||||
* This routine is useful, for example, if the first prepared statement
|
||||
@@ -1530,17 +1443,15 @@ DoxyDefine(void *switch_core_db_trace(switch_core_db*, void(*xTrace)(void*,const
|
||||
* the second prepared statement then all of the bindings transfered over
|
||||
* to the second statement before the first statement is finalized.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*);)
|
||||
DoxyDefine(int switch_core_db_transfer_bindings(sqlite3_stmt *, sqlite3_stmt *);)
|
||||
#define switch_core_db_transfer_bindings sqlite3_transfer_bindings
|
||||
|
||||
/**
|
||||
* The pUserData parameter to the switch_core_db_create_function()
|
||||
* routine used to register user functions is available to
|
||||
* the implementation of the function using this call.
|
||||
*/
|
||||
DoxyDefine(void *switch_core_db_user_data(sqlite3_context*);)
|
||||
DoxyDefine(void *switch_core_db_user_data(sqlite3_context *);)
|
||||
#define switch_core_db_user_data sqlite3_user_data
|
||||
|
||||
/**
|
||||
* returns information about parameters to
|
||||
* a user-defined function. Function implementations use this routines
|
||||
@@ -1549,9 +1460,8 @@ DoxyDefine(void *switch_core_db_user_data(sqlite3_context*);)
|
||||
* sqlite3_value* pointer instead of an sqlite3_stmt* and an integer
|
||||
* column number.
|
||||
*/
|
||||
DoxyDefine(const void *switch_core_db_value_blob(sqlite3_value*);)
|
||||
DoxyDefine(const void *switch_core_db_value_blob(sqlite3_value *);)
|
||||
#define switch_core_db_value_blob sqlite3_value_blob
|
||||
|
||||
/**
|
||||
* returns information about parameters to
|
||||
* a user-defined function. Function implementations use this routines
|
||||
@@ -1560,9 +1470,8 @@ DoxyDefine(const void *switch_core_db_value_blob(sqlite3_value*);)
|
||||
* sqlite3_value* pointer instead of an sqlite3_stmt* and an integer
|
||||
* column number.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_value_bytes(sqlite3_value*);)
|
||||
DoxyDefine(int switch_core_db_value_bytes(sqlite3_value *);)
|
||||
#define switch_core_db_value_bytes sqlite3_value_bytes
|
||||
|
||||
/**
|
||||
* returns information about parameters to
|
||||
* a user-defined function. Function implementations use this routines
|
||||
@@ -1571,9 +1480,8 @@ DoxyDefine(int switch_core_db_value_bytes(sqlite3_value*);)
|
||||
* sqlite3_value* pointer instead of an sqlite3_stmt* and an integer
|
||||
* column number.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_value_bytes16(sqlite3_value*);)
|
||||
DoxyDefine(int switch_core_db_value_bytes16(sqlite3_value *);)
|
||||
#define switch_core_db_value_bytes16 sqlite3_value_bytes16
|
||||
|
||||
/**
|
||||
* returns information about parameters to
|
||||
* a user-defined function. Function implementations use this routines
|
||||
@@ -1582,9 +1490,8 @@ DoxyDefine(int switch_core_db_value_bytes16(sqlite3_value*);)
|
||||
* sqlite3_value* pointer instead of an sqlite3_stmt* and an integer
|
||||
* column number.
|
||||
*/
|
||||
DoxyDefine(double switch_core_db_value_double(sqlite3_value*);)
|
||||
DoxyDefine(double switch_core_db_value_double(sqlite3_value *);)
|
||||
#define switch_core_db_value_double sqlite3_value_double
|
||||
|
||||
/**
|
||||
* returns information about parameters to
|
||||
* a user-defined function. Function implementations use this routines
|
||||
@@ -1593,9 +1500,8 @@ DoxyDefine(double switch_core_db_value_double(sqlite3_value*);)
|
||||
* sqlite3_value* pointer instead of an sqlite3_stmt* and an integer
|
||||
* column number.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_value_int(sqlite3_value*);)
|
||||
DoxyDefine(int switch_core_db_value_int(sqlite3_value *);)
|
||||
#define switch_core_db_value_int sqlite3_value_int
|
||||
|
||||
/**
|
||||
* returns information about parameters to
|
||||
* a user-defined function. Function implementations use this routines
|
||||
@@ -1604,9 +1510,8 @@ DoxyDefine(int switch_core_db_value_int(sqlite3_value*);)
|
||||
* sqlite3_value* pointer instead of an sqlite3_stmt* and an integer
|
||||
* column number.
|
||||
*/
|
||||
DoxyDefine(sqlite_int64 switch_core_db_value_int64(sqlite3_value*);)
|
||||
DoxyDefine(sqlite_int64 switch_core_db_value_int64(sqlite3_value *);)
|
||||
#define switch_core_db_value_int64 sqlite3_value_int64
|
||||
|
||||
/**
|
||||
* returns information about parameters to
|
||||
* a user-defined function. Function implementations use this routines
|
||||
@@ -1615,9 +1520,8 @@ DoxyDefine(sqlite_int64 switch_core_db_value_int64(sqlite3_value*);)
|
||||
* sqlite3_value* pointer instead of an sqlite3_stmt* and an integer
|
||||
* column number.
|
||||
*/
|
||||
DoxyDefine(const unsigned char *switch_core_db_value_text(sqlite3_value*);)
|
||||
DoxyDefine(const unsigned char *switch_core_db_value_text(sqlite3_value *);)
|
||||
#define switch_core_db_value_text sqlite3_value_text
|
||||
|
||||
/**
|
||||
* returns information about parameters to
|
||||
* a user-defined function. Function implementations use this routines
|
||||
@@ -1626,9 +1530,8 @@ DoxyDefine(const unsigned char *switch_core_db_value_text(sqlite3_value*);)
|
||||
* sqlite3_value* pointer instead of an sqlite3_stmt* and an integer
|
||||
* column number.
|
||||
*/
|
||||
DoxyDefine(const void *switch_core_db_value_text16(sqlite3_value*);)
|
||||
DoxyDefine(const void *switch_core_db_value_text16(sqlite3_value *);)
|
||||
#define switch_core_db_value_text16 sqlite3_value_text16
|
||||
|
||||
/**
|
||||
* returns information about parameters to
|
||||
* a user-defined function. Function implementations use this routines
|
||||
@@ -1637,9 +1540,8 @@ DoxyDefine(const void *switch_core_db_value_text16(sqlite3_value*);)
|
||||
* sqlite3_value* pointer instead of an sqlite3_stmt* and an integer
|
||||
* column number.
|
||||
*/
|
||||
DoxyDefine(const void *switch_core_db_value_text16be(sqlite3_value*);)
|
||||
DoxyDefine(const void *switch_core_db_value_text16be(sqlite3_value *);)
|
||||
#define switch_core_db_value_text16be sqlite3_value_text16be
|
||||
|
||||
/**
|
||||
* returns information about parameters to
|
||||
* a user-defined function. Function implementations use this routines
|
||||
@@ -1648,9 +1550,8 @@ DoxyDefine(const void *switch_core_db_value_text16be(sqlite3_value*);)
|
||||
* sqlite3_value* pointer instead of an sqlite3_stmt* and an integer
|
||||
* column number.
|
||||
*/
|
||||
DoxyDefine(const void *switch_core_db_value_text16le(sqlite3_value*);)
|
||||
DoxyDefine(const void *switch_core_db_value_text16le(sqlite3_value *);)
|
||||
#define switch_core_db_value_text16le sqlite3_value_text16le
|
||||
|
||||
/**
|
||||
* returns information about parameters to
|
||||
* a user-defined function. Function implementations use this routines
|
||||
@@ -1659,10 +1560,8 @@ DoxyDefine(const void *switch_core_db_value_text16le(sqlite3_value*);)
|
||||
* sqlite3_value* pointer instead of an sqlite3_stmt* and an integer
|
||||
* column number.
|
||||
*/
|
||||
DoxyDefine(int switch_core_db_value_type(sqlite3_value*);)
|
||||
DoxyDefine(int switch_core_db_value_type(sqlite3_value *);)
|
||||
#define switch_core_db_value_type sqlite3_value_type
|
||||
|
||||
|
||||
/**
|
||||
* This routine is a variant of the "sprintf()" from the
|
||||
* standard C library. The resulting string is written into memory
|
||||
@@ -1704,10 +1603,9 @@ DoxyDefine(int switch_core_db_value_type(sqlite3_value*);)
|
||||
* should always use %q instead of %s when inserting text into a string
|
||||
* literal.
|
||||
*/
|
||||
DoxyDefine(char *switch_core_db_mprintf(const char*,...);)
|
||||
DoxyDefine(char *switch_core_db_mprintf(const char *, ...);)
|
||||
#define switch_core_db_mprintf sqlite3_mprintf
|
||||
#define switch_mprintf sqlite3_mprintf
|
||||
|
||||
/**
|
||||
* This routine is a variant of the "sprintf()" from the
|
||||
* standard C library. The resulting string is written into memory
|
||||
@@ -1749,9 +1647,8 @@ DoxyDefine(char *switch_core_db_mprintf(const char*,...);)
|
||||
* should always use %q instead of %s when inserting text into a string
|
||||
* literal.
|
||||
*/
|
||||
DoxyDefine(char *switch_core_db_vmprintf(const char*, va_list);)
|
||||
DoxyDefine(char *switch_core_db_vmprintf(const char *, va_list);)
|
||||
#define switch_core_db_vmprintf sqlite3_vmprintf
|
||||
|
||||
/**
|
||||
* This routine is a variant of the "sprintf()" from the
|
||||
* standard C library. The resulting string is written into memory
|
||||
@@ -1793,22 +1690,17 @@ DoxyDefine(char *switch_core_db_vmprintf(const char*, va_list);)
|
||||
* should always use %q instead of %s when inserting text into a string
|
||||
* literal.
|
||||
*/
|
||||
DoxyDefine(char *switch_core_db_snprintf(int,char*,const char*, ...);)
|
||||
DoxyDefine(char *switch_core_db_snprintf(int, char *, const char *, ...);)
|
||||
#define switch_core_db_snprintf sqlite3_snprintf
|
||||
|
||||
/**
|
||||
* call this routine to free memory malloced by a call to switch_core_db_mprintf, switch_core_db_vmprintf, or switch_core_db_snprintf
|
||||
*/
|
||||
DoxyDefine(void switch_core_db_free(char *z);)
|
||||
#define switch_core_db_free sqlite3_free
|
||||
|
||||
/** @} */
|
||||
/** @} */
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
+59
-63
@@ -38,59 +38,57 @@
|
||||
#define _SWITCH_STUN_PARSER_H
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
#define SWITCH_STUN_DEFAULT_PORT 3478
|
||||
#define SWITCH_STUN_PACKET_MIN_LEN 20
|
||||
|
||||
typedef enum {
|
||||
SWITCH_STUN_BINDING_REQUEST = 0x0001,
|
||||
SWITCH_STUN_BINDING_RESPONSE = 0x0101,
|
||||
SWITCH_STUN_BINDING_ERROR_RESPONSE = 0x0111,
|
||||
SWITCH_STUN_SHARED_SECRET_REQUEST = 0x0002,
|
||||
SWITCH_STUN_SHARED_SECRET_RESPONSE = 0x0102,
|
||||
SWITCH_STUN_SHARED_SECRET_ERROR_RESPONSE = 0x0112,
|
||||
SWITCH_STUN_ALLOCATE_REQUEST = 0x0003,
|
||||
SWITCH_STUN_ALLOCATE_RESPONSE = 0x0103,
|
||||
SWITCH_STUN_ALLOCATE_ERROR_RESPONSE = 0x0113,
|
||||
SWITCH_STUN_SEND_REQUEST = 0x0004,
|
||||
SWITCH_STUN_SEND_RESPONSE = 0x0104,
|
||||
SWITCH_STUN_SEND_ERROR_RESPONSE = 0x0114,
|
||||
SWITCH_STUN_DATA_INDICATION = 0x0115
|
||||
typedef enum {
|
||||
SWITCH_STUN_BINDING_REQUEST = 0x0001,
|
||||
SWITCH_STUN_BINDING_RESPONSE = 0x0101,
|
||||
SWITCH_STUN_BINDING_ERROR_RESPONSE = 0x0111,
|
||||
SWITCH_STUN_SHARED_SECRET_REQUEST = 0x0002,
|
||||
SWITCH_STUN_SHARED_SECRET_RESPONSE = 0x0102,
|
||||
SWITCH_STUN_SHARED_SECRET_ERROR_RESPONSE = 0x0112,
|
||||
SWITCH_STUN_ALLOCATE_REQUEST = 0x0003,
|
||||
SWITCH_STUN_ALLOCATE_RESPONSE = 0x0103,
|
||||
SWITCH_STUN_ALLOCATE_ERROR_RESPONSE = 0x0113,
|
||||
SWITCH_STUN_SEND_REQUEST = 0x0004,
|
||||
SWITCH_STUN_SEND_RESPONSE = 0x0104,
|
||||
SWITCH_STUN_SEND_ERROR_RESPONSE = 0x0114,
|
||||
SWITCH_STUN_DATA_INDICATION = 0x0115
|
||||
} switch_stun_message_t;
|
||||
|
||||
typedef enum {
|
||||
SWITCH_STUN_ATTR_MAPPED_ADDRESS = 0x0001, /* Address */
|
||||
SWITCH_STUN_ATTR_RESPONSE_ADDRESS = 0x0002, /* Address */
|
||||
SWITCH_STUN_ATTR_CHANGE_REQUEST = 0x0003, /* UInt32 */
|
||||
SWITCH_STUN_ATTR_SOURCE_ADDRESS = 0x0004, /* Address */
|
||||
SWITCH_STUN_ATTR_CHANGED_ADDRESS = 0x0005, /* Address */
|
||||
SWITCH_STUN_ATTR_USERNAME = 0x0006, /* ByteString, multiple of 4 bytes */
|
||||
SWITCH_STUN_ATTR_PASSWORD = 0x0007, /* ByteString, multiple of 4 bytes */
|
||||
SWITCH_STUN_ATTR_MESSAGE_INTEGRITY = 0x0008, /* ByteString, 20 bytes */
|
||||
SWITCH_STUN_ATTR_ERROR_CODE = 0x0009, /* ErrorCode */
|
||||
SWITCH_STUN_ATTR_UNKNOWN_ATTRIBUTES = 0x000a, /* UInt16List */
|
||||
SWITCH_STUN_ATTR_REFLECTED_FROM = 0x000b, /* Address */
|
||||
SWITCH_STUN_ATTR_TRANSPORT_PREFERENCES = 0x000c, /* TransportPrefs */
|
||||
SWITCH_STUN_ATTR_LIFETIME = 0x000d, /* UInt32 */
|
||||
SWITCH_STUN_ATTR_ALTERNATE_SERVER = 0x000e, /* Address */
|
||||
SWITCH_STUN_ATTR_MAGIC_COOKIE = 0x000f, /* ByteString, 4 bytes */
|
||||
SWITCH_STUN_ATTR_BANDWIDTH = 0x0010, /* UInt32 */
|
||||
SWITCH_STUN_ATTR_DESTINATION_ADDRESS = 0x0011, /* Address */
|
||||
SWITCH_STUN_ATTR_SOURCE_ADDRESS2 = 0x0012, /* Address */
|
||||
SWITCH_STUN_ATTR_DATA = 0x0013, /* ByteString */
|
||||
SWITCH_STUN_ATTR_OPTIONS = 0x8001 /* UInt32 */
|
||||
SWITCH_STUN_ATTR_MAPPED_ADDRESS = 0x0001, /* Address */
|
||||
SWITCH_STUN_ATTR_RESPONSE_ADDRESS = 0x0002, /* Address */
|
||||
SWITCH_STUN_ATTR_CHANGE_REQUEST = 0x0003, /* UInt32 */
|
||||
SWITCH_STUN_ATTR_SOURCE_ADDRESS = 0x0004, /* Address */
|
||||
SWITCH_STUN_ATTR_CHANGED_ADDRESS = 0x0005, /* Address */
|
||||
SWITCH_STUN_ATTR_USERNAME = 0x0006, /* ByteString, multiple of 4 bytes */
|
||||
SWITCH_STUN_ATTR_PASSWORD = 0x0007, /* ByteString, multiple of 4 bytes */
|
||||
SWITCH_STUN_ATTR_MESSAGE_INTEGRITY = 0x0008, /* ByteString, 20 bytes */
|
||||
SWITCH_STUN_ATTR_ERROR_CODE = 0x0009, /* ErrorCode */
|
||||
SWITCH_STUN_ATTR_UNKNOWN_ATTRIBUTES = 0x000a, /* UInt16List */
|
||||
SWITCH_STUN_ATTR_REFLECTED_FROM = 0x000b, /* Address */
|
||||
SWITCH_STUN_ATTR_TRANSPORT_PREFERENCES = 0x000c, /* TransportPrefs */
|
||||
SWITCH_STUN_ATTR_LIFETIME = 0x000d, /* UInt32 */
|
||||
SWITCH_STUN_ATTR_ALTERNATE_SERVER = 0x000e, /* Address */
|
||||
SWITCH_STUN_ATTR_MAGIC_COOKIE = 0x000f, /* ByteString, 4 bytes */
|
||||
SWITCH_STUN_ATTR_BANDWIDTH = 0x0010, /* UInt32 */
|
||||
SWITCH_STUN_ATTR_DESTINATION_ADDRESS = 0x0011, /* Address */
|
||||
SWITCH_STUN_ATTR_SOURCE_ADDRESS2 = 0x0012, /* Address */
|
||||
SWITCH_STUN_ATTR_DATA = 0x0013, /* ByteString */
|
||||
SWITCH_STUN_ATTR_OPTIONS = 0x8001 /* UInt32 */
|
||||
} switch_stun_attribute_t;
|
||||
|
||||
typedef enum {
|
||||
SWITCH_STUN_ERROR_BAD_REQUEST = 400,
|
||||
SWITCH_STUN_ERROR_UNAUTHORIZED = 401,
|
||||
SWITCH_STUN_ERROR_UNKNOWN_ATTRIBUTE = 420,
|
||||
SWITCH_STUN_ERROR_STALE_CREDENTIALS = 430,
|
||||
SWITCH_STUN_ERROR_INTEGRITY_CHECK_FAILURE = 431,
|
||||
SWITCH_STUN_ERROR_MISSING_USERNAME = 432,
|
||||
SWITCH_STUN_ERROR_USE_TLS = 433,
|
||||
SWITCH_STUN_ERROR_SERVER_ERROR = 500,
|
||||
SWITCH_STUN_ERROR_GLOBAL_FAILURE = 600
|
||||
SWITCH_STUN_ERROR_BAD_REQUEST = 400,
|
||||
SWITCH_STUN_ERROR_UNAUTHORIZED = 401,
|
||||
SWITCH_STUN_ERROR_UNKNOWN_ATTRIBUTE = 420,
|
||||
SWITCH_STUN_ERROR_STALE_CREDENTIALS = 430,
|
||||
SWITCH_STUN_ERROR_INTEGRITY_CHECK_FAILURE = 431,
|
||||
SWITCH_STUN_ERROR_MISSING_USERNAME = 432,
|
||||
SWITCH_STUN_ERROR_USE_TLS = 433,
|
||||
SWITCH_STUN_ERROR_SERVER_ERROR = 500,
|
||||
SWITCH_STUN_ERROR_GLOBAL_FAILURE = 600
|
||||
} switch_stun_error_t;
|
||||
|
||||
typedef enum {
|
||||
@@ -138,7 +136,7 @@ SWITCH_DECLARE(void) switch_stun_random_string(char *buf, uint16_t len, char *se
|
||||
\param len the length of the data
|
||||
\return a stun packet pointer to buf to use as an access point
|
||||
*/
|
||||
SWITCH_DECLARE(switch_stun_packet_t *)switch_stun_packet_parse(uint8_t *buf, uint32_t len);
|
||||
SWITCH_DECLARE(switch_stun_packet_t *) switch_stun_packet_parse(uint8_t * buf, uint32_t len);
|
||||
|
||||
/*!
|
||||
\brief Obtain a printable string form of a given value
|
||||
@@ -146,7 +144,7 @@ SWITCH_DECLARE(switch_stun_packet_t *)switch_stun_packet_parse(uint8_t *buf, uin
|
||||
\param value the value to look up
|
||||
\return a sring version of value
|
||||
*/
|
||||
SWITCH_DECLARE(const char *)switch_stun_value_to_name(int32_t type, uint32_t value);
|
||||
SWITCH_DECLARE(const char *) switch_stun_value_to_name(int32_t type, uint32_t value);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -156,7 +154,8 @@ SWITCH_DECLARE(const char *)switch_stun_value_to_name(int32_t type, uint32_t val
|
||||
\param port the port
|
||||
\return true or false
|
||||
*/
|
||||
SWITCH_DECLARE(uint8_t) switch_stun_packet_attribute_get_mapped_address(switch_stun_packet_attribute_t *attribute, char *ipstr, uint16_t *port);
|
||||
SWITCH_DECLARE(uint8_t) switch_stun_packet_attribute_get_mapped_address(switch_stun_packet_attribute_t *attribute,
|
||||
char *ipstr, uint16_t * port);
|
||||
|
||||
/*!
|
||||
\brief Extract a username from a packet attribute
|
||||
@@ -165,7 +164,8 @@ SWITCH_DECLARE(uint8_t) switch_stun_packet_attribute_get_mapped_address(switch_s
|
||||
\param len the maximum size of the username buffer
|
||||
\return a pointer to the username or NULL
|
||||
*/
|
||||
SWITCH_DECLARE(char *)switch_stun_packet_attribute_get_username(switch_stun_packet_attribute_t *attribute, char *username, uint16_t len);
|
||||
SWITCH_DECLARE(char *) switch_stun_packet_attribute_get_username(switch_stun_packet_attribute_t *attribute,
|
||||
char *username, uint16_t len);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -175,10 +175,8 @@ SWITCH_DECLARE(char *)switch_stun_packet_attribute_get_username(switch_stun_pack
|
||||
\param buf a pointer to data to use for the packet
|
||||
\return a pointer to a ready-to-use stun packet
|
||||
*/
|
||||
SWITCH_DECLARE(switch_stun_packet_t *)switch_stun_packet_build_header(switch_stun_message_t type,
|
||||
char *id,
|
||||
uint8_t *buf
|
||||
);
|
||||
SWITCH_DECLARE(switch_stun_packet_t *) switch_stun_packet_build_header(switch_stun_message_t type,
|
||||
char *id, uint8_t * buf);
|
||||
|
||||
/*!
|
||||
\brief Add a username packet attribute
|
||||
@@ -187,7 +185,8 @@ SWITCH_DECLARE(switch_stun_packet_t *)switch_stun_packet_build_header(switch_stu
|
||||
\param ulen the length of the username
|
||||
\return true or false
|
||||
*/
|
||||
SWITCH_DECLARE(uint8_t) switch_stun_packet_attribute_add_username(switch_stun_packet_t *packet, char *username, uint16_t ulen);
|
||||
SWITCH_DECLARE(uint8_t) switch_stun_packet_attribute_add_username(switch_stun_packet_t *packet, char *username,
|
||||
uint16_t ulen);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -197,7 +196,8 @@ SWITCH_DECLARE(uint8_t) switch_stun_packet_attribute_add_username(switch_stun_pa
|
||||
\param port the port of the mapped address
|
||||
\return true or false
|
||||
*/
|
||||
SWITCH_DECLARE(uint8_t) switch_stun_packet_attribute_add_binded_address(switch_stun_packet_t *packet, char *ipstr, uint16_t port);
|
||||
SWITCH_DECLARE(uint8_t) switch_stun_packet_attribute_add_binded_address(switch_stun_packet_t *packet, char *ipstr,
|
||||
uint16_t port);
|
||||
|
||||
/*!
|
||||
\brief Perform a stun lookup
|
||||
@@ -209,12 +209,10 @@ SWITCH_DECLARE(uint8_t) switch_stun_packet_attribute_add_binded_address(switch_s
|
||||
\param pool the memory pool to use
|
||||
\return SUCCESS or FAIL
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_stun_lookup (char **ip,
|
||||
switch_port_t *port,
|
||||
char *stunip,
|
||||
switch_port_t stunport,
|
||||
char **err,
|
||||
switch_memory_pool_t *pool);
|
||||
SWITCH_DECLARE(switch_status_t) switch_stun_lookup(char **ip,
|
||||
switch_port_t *port,
|
||||
char *stunip,
|
||||
switch_port_t stunport, char **err, switch_memory_pool_t *pool);
|
||||
|
||||
|
||||
|
||||
@@ -241,9 +239,7 @@ SWITCH_DECLARE(switch_status_t) switch_stun_lookup (char **ip,
|
||||
///\}
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
+97
-137
@@ -36,9 +36,7 @@
|
||||
|
||||
#include <switch.h>
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
#define SWITCH_SEQ_ESC "\033["
|
||||
|
||||
/* Ansi Control character suffixes */
|
||||
#define SWITCH_SEQ_HOME_CHAR 'H'
|
||||
#define SWITCH_SEQ_HOME_CHAR_STR "H"
|
||||
@@ -48,11 +46,9 @@ SWITCH_BEGIN_EXTERN_C
|
||||
#define SWITCH_SEQ_CLEARSCR_CHAR0 '2'
|
||||
#define SWITCH_SEQ_CLEARSCR_CHAR1 'J'
|
||||
#define SWITCH_SEQ_CLEARSCR_CHAR "2J"
|
||||
|
||||
#define SWITCH_SEQ_DEFAULT_COLOR SWITCH_SEQ_ESC SWITCH_SEQ_END_COLOR /* Reset to Default fg/bg color */
|
||||
#define SWITCH_SEQ_AND_COLOR ";" /* To add multiple color definitions */
|
||||
#define SWITCH_SEQ_END_COLOR "m" /* To end color definitions */
|
||||
|
||||
#define SWITCH_SEQ_DEFAULT_COLOR SWITCH_SEQ_ESC SWITCH_SEQ_END_COLOR /* Reset to Default fg/bg color */
|
||||
#define SWITCH_SEQ_AND_COLOR ";" /* To add multiple color definitions */
|
||||
#define SWITCH_SEQ_END_COLOR "m" /* To end color definitions */
|
||||
/* Foreground colors values */
|
||||
#define SWITCH_SEQ_F_BLACK "30"
|
||||
#define SWITCH_SEQ_F_RED "31"
|
||||
@@ -62,7 +58,6 @@ SWITCH_BEGIN_EXTERN_C
|
||||
#define SWITCH_SEQ_F_MAGEN "35"
|
||||
#define SWITCH_SEQ_F_CYAN "36"
|
||||
#define SWITCH_SEQ_F_WHITE "37"
|
||||
|
||||
/* Background colors values */
|
||||
#define SWITCH_SEQ_B_BLACK "40"
|
||||
#define SWITCH_SEQ_B_RED "41"
|
||||
@@ -72,7 +67,6 @@ SWITCH_BEGIN_EXTERN_C
|
||||
#define SWITCH_SEQ_B_MAGEN "45"
|
||||
#define SWITCH_SEQ_B_CYAN "46"
|
||||
#define SWITCH_SEQ_B_WHITE "47"
|
||||
|
||||
/* Preset escape sequences - Change foreground colors only */
|
||||
#define SWITCH_SEQ_FBLACK SWITCH_SEQ_ESC SWITCH_SEQ_F_BLACK SWITCH_SEQ_END_COLOR
|
||||
#define SWITCH_SEQ_FRED SWITCH_SEQ_ESC SWITCH_SEQ_F_RED SWITCH_SEQ_END_COLOR
|
||||
@@ -82,7 +76,6 @@ SWITCH_BEGIN_EXTERN_C
|
||||
#define SWITCH_SEQ_FMAGEN SWITCH_SEQ_ESC SWITCH_SEQ_F_MAGEN SWITCH_SEQ_END_COLOR
|
||||
#define SWITCH_SEQ_FCYAN SWITCH_SEQ_ESC SWITCH_SEQ_F_CYAN SWITCH_SEQ_END_COLOR
|
||||
#define SWITCH_SEQ_FWHITE SWITCH_SEQ_ESC SWITCH_SEQ_F_WHITE SWITCH_SEQ_END_COLOR
|
||||
|
||||
#define SWITCH_SEQ_BBLACK SWITCH_SEQ_ESC SWITCH_SEQ_B_BLACK SWITCH_SEQ_END_COLOR
|
||||
#define SWITCH_SEQ_BRED SWITCH_SEQ_ESC SWITCH_SEQ_B_RED SWITCH_SEQ_END_COLOR
|
||||
#define SWITCH_SEQ_BGREEN SWITCH_SEQ_ESC SWITCH_SEQ_B_GREEN SWITCH_SEQ_END_COLOR
|
||||
@@ -91,21 +84,17 @@ SWITCH_BEGIN_EXTERN_C
|
||||
#define SWITCH_SEQ_BMAGEN SWITCH_SEQ_ESC SWITCH_SEQ_B_MAGEN SWITCH_SEQ_END_COLOR
|
||||
#define SWITCH_SEQ_BCYAN SWITCH_SEQ_ESC SWITCH_SEQ_B_CYAN SWITCH_SEQ_END_COLOR
|
||||
#define SWITCH_SEQ_BWHITE SWITCH_SEQ_ESC SWITCH_SEQ_B_WHITE SWITCH_SEQ_END_COLOR
|
||||
|
||||
/* Preset escape sequences */
|
||||
#define SWITCH_SEQ_HOME SWITCH_SEQ_ESC SWITCH_SEQ_HOME_CHAR_STR
|
||||
#define SWITCH_SEQ_CLEARLINE SWITCH_SEQ_ESC SWITCH_SEQ_CLEARLINE_CHAR_STR
|
||||
#define SWITCH_SEQ_CLEARLINEEND SWITCH_SEQ_ESC SWITCH_SEQ_CLEARLINEEND_CHAR
|
||||
#define SWITCH_SEQ_CLEARSCR SWITCH_SEQ_ESC SWITCH_SEQ_CLEARSCR_CHAR SWITCH_SEQ_HOME
|
||||
|
||||
#ifdef WIN32
|
||||
#define SWITCH_PATH_SEPARATOR "\\"
|
||||
#else
|
||||
#define SWITCH_PATH_SEPARATOR "/"
|
||||
#endif
|
||||
|
||||
#define SWITCH_URL_SEPARATOR "://"
|
||||
|
||||
#define SWITCH_ENDPOINT_DISPOSITION_VARIABLE "endpoint_disposition"
|
||||
#define SWITCH_EXPORT_VARS_VARIABLE "export_vars"
|
||||
#define SWITCH_R_SDP_VARIABLE "switch_r_sdp"
|
||||
@@ -122,11 +111,10 @@ SWITCH_BEGIN_EXTERN_C
|
||||
#define SWITCH_REMOTE_MEDIA_PORT_VARIABLE "remote_media_port"
|
||||
#define SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE "hangup_after_bridge"
|
||||
#define SWITCH_MAX_FORWARDS_VARIABLE "max_forwards"
|
||||
|
||||
#define SWITCH_SPEECH_KEY "speech"
|
||||
#define SWITCH_UUID_BRIDGE "uuid_bridge"
|
||||
#define SWITCH_BITS_PER_BYTE 8
|
||||
typedef uint8_t switch_byte_t;
|
||||
typedef uint8_t switch_byte_t;
|
||||
|
||||
typedef enum {
|
||||
SWITCH_FALSE = 0,
|
||||
@@ -137,7 +125,7 @@ typedef enum {
|
||||
SSM_NA,
|
||||
SSM_PRONOUNCED,
|
||||
SSM_ITERATED,
|
||||
SSM_COUNTED
|
||||
SSM_COUNTED
|
||||
} switch_say_method_t;
|
||||
|
||||
typedef enum {
|
||||
@@ -242,12 +230,12 @@ typedef enum {
|
||||
} switch_caller_profile_flag_t;
|
||||
|
||||
typedef enum {
|
||||
SWITCH_AUDIO_COL_STR_TITLE = 0x01,
|
||||
SWITCH_AUDIO_COL_STR_COPYRIGHT = 0x02,
|
||||
SWITCH_AUDIO_COL_STR_SOFTWARE = 0x03,
|
||||
SWITCH_AUDIO_COL_STR_ARTIST = 0x04,
|
||||
SWITCH_AUDIO_COL_STR_COMMENT = 0x05,
|
||||
SWITCH_AUDIO_COL_STR_DATE = 0x06
|
||||
SWITCH_AUDIO_COL_STR_TITLE = 0x01,
|
||||
SWITCH_AUDIO_COL_STR_COPYRIGHT = 0x02,
|
||||
SWITCH_AUDIO_COL_STR_SOFTWARE = 0x03,
|
||||
SWITCH_AUDIO_COL_STR_ARTIST = 0x04,
|
||||
SWITCH_AUDIO_COL_STR_COMMENT = 0x05,
|
||||
SWITCH_AUDIO_COL_STR_DATE = 0x06
|
||||
} switch_audio_col_t;
|
||||
|
||||
typedef enum {
|
||||
@@ -269,10 +257,10 @@ typedef enum {
|
||||
</pre>
|
||||
*/
|
||||
typedef enum {
|
||||
SWITCH_VAD_FLAG_TALKING = ( 1 << 0 ),
|
||||
SWITCH_VAD_FLAG_EVENTS_TALK = ( 1 << 1 ),
|
||||
SWITCH_VAD_FLAG_EVENTS_NOTALK = ( 1 << 2 ),
|
||||
SWITCH_VAD_FLAG_CNG = ( 1 << 3)
|
||||
SWITCH_VAD_FLAG_TALKING = (1 << 0),
|
||||
SWITCH_VAD_FLAG_EVENTS_TALK = (1 << 1),
|
||||
SWITCH_VAD_FLAG_EVENTS_NOTALK = (1 << 2),
|
||||
SWITCH_VAD_FLAG_CNG = (1 << 3)
|
||||
} switch_vad_flag_t;
|
||||
|
||||
#define SWITCH_RTP_CNG_PAYLOAD 13
|
||||
@@ -299,7 +287,7 @@ typedef enum {
|
||||
</pre>
|
||||
*/
|
||||
typedef enum {
|
||||
SWITCH_RTP_FLAG_NOBLOCK = ( 1 << 0),
|
||||
SWITCH_RTP_FLAG_NOBLOCK = (1 << 0),
|
||||
SWITCH_RTP_FLAG_IO = (1 << 1),
|
||||
SWITCH_RTP_FLAG_USE_TIMER = (1 << 2),
|
||||
SWITCH_RTP_FLAG_TIMER_RECLOCK = (1 << 3),
|
||||
@@ -308,8 +296,8 @@ typedef enum {
|
||||
SWITCH_RTP_FLAG_RAW_WRITE = (1 << 6),
|
||||
SWITCH_RTP_FLAG_GOOGLEHACK = (1 << 7),
|
||||
SWITCH_RTP_FLAG_VAD = (1 << 8),
|
||||
SWITCH_RTP_FLAG_BREAK = ( 1 << 9),
|
||||
SWITCH_RTP_FLAG_MINI = ( 1 << 10),
|
||||
SWITCH_RTP_FLAG_BREAK = (1 << 9),
|
||||
SWITCH_RTP_FLAG_MINI = (1 << 10),
|
||||
SWITCH_RTP_FLAG_DATAWAIT = (1 << 11),
|
||||
SWITCH_RTP_FLAG_BUGGY_2833 = (1 << 12),
|
||||
SWITCH_RTP_FLAG_PASS_RFC2833 = (1 << 13),
|
||||
@@ -453,7 +441,7 @@ typedef enum {
|
||||
typedef enum {
|
||||
SWITCH_LOG_CONSOLE = 8,
|
||||
SWITCH_LOG_DEBUG = 7,
|
||||
SWITCH_LOG_INFO = 6,
|
||||
SWITCH_LOG_INFO = 6,
|
||||
SWITCH_LOG_NOTICE = 5,
|
||||
SWITCH_LOG_WARNING = 4,
|
||||
SWITCH_LOG_ERROR = 3,
|
||||
@@ -512,7 +500,7 @@ typedef enum {
|
||||
CS_HOLD,
|
||||
CS_HIBERNATE,
|
||||
CS_HANGUP,
|
||||
CS_DONE
|
||||
CS_DONE
|
||||
} switch_channel_state_t;
|
||||
|
||||
|
||||
@@ -544,25 +532,25 @@ CF_RING_READY = (1 << 18) - Channel is ready to send ringback
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
CF_ANSWERED = (1 << 0),
|
||||
CF_OUTBOUND = (1 << 1),
|
||||
CF_EARLY_MEDIA = (1 << 2),
|
||||
CF_ORIGINATOR = (1 << 3),
|
||||
CF_TRANSFER = (1 << 4),
|
||||
CF_ACCEPT_CNG = (1 << 5),
|
||||
CF_LOCK_THREAD = (1 << 6),
|
||||
CF_BRIDGED = (1 << 7),
|
||||
CF_HOLD = (1 << 8),
|
||||
CF_SERVICE = (1 << 9),
|
||||
CF_TAGGED = (1 << 10),
|
||||
CF_WINNER = (1 << 11),
|
||||
CF_CONTROLLED = (1 << 12),
|
||||
CF_NOMEDIA = (1 << 13),
|
||||
CF_SUSPEND = (1 << 14),
|
||||
CF_EVENT_PARSE = (1 << 15),
|
||||
CF_REPEAT_STATE = (1 << 16),
|
||||
CF_GEN_RINGBACK = (1 << 17),
|
||||
CF_RING_READY = (1 << 18)
|
||||
CF_ANSWERED = (1 << 0),
|
||||
CF_OUTBOUND = (1 << 1),
|
||||
CF_EARLY_MEDIA = (1 << 2),
|
||||
CF_ORIGINATOR = (1 << 3),
|
||||
CF_TRANSFER = (1 << 4),
|
||||
CF_ACCEPT_CNG = (1 << 5),
|
||||
CF_LOCK_THREAD = (1 << 6),
|
||||
CF_BRIDGED = (1 << 7),
|
||||
CF_HOLD = (1 << 8),
|
||||
CF_SERVICE = (1 << 9),
|
||||
CF_TAGGED = (1 << 10),
|
||||
CF_WINNER = (1 << 11),
|
||||
CF_CONTROLLED = (1 << 12),
|
||||
CF_NOMEDIA = (1 << 13),
|
||||
CF_SUSPEND = (1 << 14),
|
||||
CF_EVENT_PARSE = (1 << 15),
|
||||
CF_REPEAT_STATE = (1 << 16),
|
||||
CF_GEN_RINGBACK = (1 << 17),
|
||||
CF_RING_READY = (1 << 18)
|
||||
} switch_channel_flag_t;
|
||||
|
||||
|
||||
@@ -600,7 +588,7 @@ typedef enum {
|
||||
SWITCH_SIG_NONE,
|
||||
SWITCH_SIG_KILL,
|
||||
SWITCH_SIG_XFER,
|
||||
SWITCH_SIG_BREAK
|
||||
SWITCH_SIG_BREAK
|
||||
} switch_signal_t;
|
||||
|
||||
/*!
|
||||
@@ -618,14 +606,14 @@ SWITCH_CODEC_FLAG_PASSTHROUGH = (1 << 7) - Passthrough only
|
||||
</pre>
|
||||
*/
|
||||
typedef enum {
|
||||
SWITCH_CODEC_FLAG_ENCODE = (1 << 0),
|
||||
SWITCH_CODEC_FLAG_DECODE = (1 << 1),
|
||||
SWITCH_CODEC_FLAG_SILENCE_START = (1 << 2),
|
||||
SWITCH_CODEC_FLAG_SILENCE_STOP = (1 << 3),
|
||||
SWITCH_CODEC_FLAG_SILENCE = (1 << 4),
|
||||
SWITCH_CODEC_FLAG_FREE_POOL = (1 << 5),
|
||||
SWITCH_CODEC_FLAG_AAL2 = (1 << 6),
|
||||
SWITCH_CODEC_FLAG_PASSTHROUGH = (1 << 7)
|
||||
SWITCH_CODEC_FLAG_ENCODE = (1 << 0),
|
||||
SWITCH_CODEC_FLAG_DECODE = (1 << 1),
|
||||
SWITCH_CODEC_FLAG_SILENCE_START = (1 << 2),
|
||||
SWITCH_CODEC_FLAG_SILENCE_STOP = (1 << 3),
|
||||
SWITCH_CODEC_FLAG_SILENCE = (1 << 4),
|
||||
SWITCH_CODEC_FLAG_FREE_POOL = (1 << 5),
|
||||
SWITCH_CODEC_FLAG_AAL2 = (1 << 6),
|
||||
SWITCH_CODEC_FLAG_PASSTHROUGH = (1 << 7)
|
||||
} switch_codec_flag_t;
|
||||
|
||||
|
||||
@@ -641,12 +629,12 @@ SWITCH_SPEECH_FLAG_PAUSE = (1 << 4) - Pause toggle for playback
|
||||
</pre>
|
||||
*/
|
||||
typedef enum {
|
||||
SWITCH_SPEECH_FLAG_NONE = 0,
|
||||
SWITCH_SPEECH_FLAG_HASTEXT = (1 << 0),
|
||||
SWITCH_SPEECH_FLAG_PEEK = (1 << 1),
|
||||
SWITCH_SPEECH_FLAG_FREE_POOL = (1 << 2),
|
||||
SWITCH_SPEECH_FLAG_BLOCKING = (1 << 3),
|
||||
SWITCH_SPEECH_FLAG_PAUSE = (1 << 4)
|
||||
SWITCH_SPEECH_FLAG_NONE = 0,
|
||||
SWITCH_SPEECH_FLAG_HASTEXT = (1 << 0),
|
||||
SWITCH_SPEECH_FLAG_PEEK = (1 << 1),
|
||||
SWITCH_SPEECH_FLAG_FREE_POOL = (1 << 2),
|
||||
SWITCH_SPEECH_FLAG_BLOCKING = (1 << 3),
|
||||
SWITCH_SPEECH_FLAG_PAUSE = (1 << 4)
|
||||
|
||||
} switch_speech_flag_t;
|
||||
|
||||
@@ -662,12 +650,12 @@ SWITCH_ASR_FLAG_AUTO_RESUME = (1 << 4) - Auto Resume
|
||||
</pre>
|
||||
*/
|
||||
typedef enum {
|
||||
SWITCH_ASR_FLAG_NONE = 0,
|
||||
SWITCH_ASR_FLAG_DATA = (1 << 0),
|
||||
SWITCH_ASR_FLAG_FREE_POOL = (1 << 1),
|
||||
SWITCH_ASR_FLAG_CLOSED = (1 << 2),
|
||||
SWITCH_ASR_FLAG_FIRE_EVENTS = (1 << 3),
|
||||
SWITCH_ASR_FLAG_AUTO_RESUME = (1 << 4)
|
||||
SWITCH_ASR_FLAG_NONE = 0,
|
||||
SWITCH_ASR_FLAG_DATA = (1 << 0),
|
||||
SWITCH_ASR_FLAG_FREE_POOL = (1 << 1),
|
||||
SWITCH_ASR_FLAG_CLOSED = (1 << 2),
|
||||
SWITCH_ASR_FLAG_FIRE_EVENTS = (1 << 3),
|
||||
SWITCH_ASR_FLAG_AUTO_RESUME = (1 << 4)
|
||||
} switch_asr_flag_t;
|
||||
|
||||
/*!
|
||||
@@ -678,7 +666,7 @@ SWITCH_DIRECTORY_FLAG_FREE_POOL = (1 << 0) - Free interface's pool on destruct
|
||||
</pre>
|
||||
*/
|
||||
typedef enum {
|
||||
SWITCH_DIRECTORY_FLAG_FREE_POOL = (1 << 0),
|
||||
SWITCH_DIRECTORY_FLAG_FREE_POOL = (1 << 0),
|
||||
|
||||
} switch_directory_flag_t;
|
||||
|
||||
@@ -708,7 +696,7 @@ SWITCH_TIMER_FLAG_FREE_POOL = (1 << 0) - Free timer's pool on destruction
|
||||
</pre>
|
||||
*/
|
||||
typedef enum {
|
||||
SWITCH_TIMER_FLAG_FREE_POOL = (1 << 0),
|
||||
SWITCH_TIMER_FLAG_FREE_POOL = (1 << 0),
|
||||
} switch_timer_flag_t;
|
||||
|
||||
|
||||
@@ -747,18 +735,18 @@ SWITCH_FILE_OPEN = (1 << 11) - File is open
|
||||
</pre>
|
||||
*/
|
||||
typedef enum {
|
||||
SWITCH_FILE_FLAG_READ = (1 << 0),
|
||||
SWITCH_FILE_FLAG_WRITE = (1 << 1),
|
||||
SWITCH_FILE_FLAG_FREE_POOL = (1 << 2),
|
||||
SWITCH_FILE_DATA_SHORT = (1 << 3),
|
||||
SWITCH_FILE_DATA_INT = (1 << 4),
|
||||
SWITCH_FILE_DATA_FLOAT = (1 << 5),
|
||||
SWITCH_FILE_DATA_DOUBLE = (1 << 6),
|
||||
SWITCH_FILE_DATA_RAW = (1 << 7),
|
||||
SWITCH_FILE_PAUSE = (1 << 8),
|
||||
SWITCH_FILE_NATIVE = (1 << 9),
|
||||
SWITCH_FILE_SEEK = (1 << 10),
|
||||
SWITCH_FILE_OPEN = (1 << 11)
|
||||
SWITCH_FILE_FLAG_READ = (1 << 0),
|
||||
SWITCH_FILE_FLAG_WRITE = (1 << 1),
|
||||
SWITCH_FILE_FLAG_FREE_POOL = (1 << 2),
|
||||
SWITCH_FILE_DATA_SHORT = (1 << 3),
|
||||
SWITCH_FILE_DATA_INT = (1 << 4),
|
||||
SWITCH_FILE_DATA_FLOAT = (1 << 5),
|
||||
SWITCH_FILE_DATA_DOUBLE = (1 << 6),
|
||||
SWITCH_FILE_DATA_RAW = (1 << 7),
|
||||
SWITCH_FILE_PAUSE = (1 << 8),
|
||||
SWITCH_FILE_NATIVE = (1 << 9),
|
||||
SWITCH_FILE_SEEK = (1 << 10),
|
||||
SWITCH_FILE_OPEN = (1 << 11)
|
||||
} switch_file_flag_t;
|
||||
|
||||
typedef enum {
|
||||
@@ -951,19 +939,8 @@ typedef struct switch_codec_implementation switch_codec_implementation_t;
|
||||
typedef struct switch_buffer switch_buffer_t;
|
||||
typedef struct switch_codec_settings switch_codec_settings_t;
|
||||
|
||||
typedef struct switch_io_event_hook_outgoing_channel switch_io_event_hook_outgoing_channel_t;
|
||||
typedef struct switch_io_event_hook_answer_channel switch_io_event_hook_answer_channel_t;
|
||||
typedef struct switch_io_event_hook_receive_message switch_io_event_hook_receive_message_t;
|
||||
typedef struct switch_io_event_hook_receive_event switch_io_event_hook_receive_event_t;
|
||||
typedef struct switch_io_event_hook_read_frame switch_io_event_hook_read_frame_t;
|
||||
typedef struct switch_io_event_hook_write_frame switch_io_event_hook_write_frame_t;
|
||||
typedef struct switch_io_event_hook_kill_channel switch_io_event_hook_kill_channel_t;
|
||||
typedef struct switch_io_event_hook_waitfor_read switch_io_event_hook_waitfor_read_t;
|
||||
typedef struct switch_io_event_hook_waitfor_write switch_io_event_hook_waitfor_write_t;
|
||||
typedef struct switch_io_event_hook_send_dtmf switch_io_event_hook_send_dtmf_t;
|
||||
typedef struct switch_io_event_hook_state_change switch_io_event_hook_state_change_t;
|
||||
|
||||
typedef struct switch_io_routines switch_io_routines_t;
|
||||
typedef struct switch_io_event_hooks switch_io_event_hooks_t;
|
||||
typedef struct switch_speech_handle switch_speech_handle_t;
|
||||
typedef struct switch_asr_handle switch_asr_handle_t;
|
||||
typedef struct switch_directory_handle switch_directory_handle_t;
|
||||
@@ -982,43 +959,30 @@ typedef struct switch_chat_interface switch_chat_interface_t;
|
||||
typedef struct switch_management_interface switch_management_interface_t;
|
||||
typedef struct switch_core_port_allocator switch_core_port_allocator_t;
|
||||
typedef struct switch_media_bug switch_media_bug_t;
|
||||
typedef switch_bool_t (*switch_media_bug_callback_t)(switch_media_bug_t *, void *, switch_abc_type_t);
|
||||
typedef void (*switch_application_function_t)(switch_core_session_t *, char *);
|
||||
typedef void (*switch_event_callback_t)(switch_event_t *);
|
||||
typedef switch_caller_extension_t *(*switch_dialplan_hunt_function_t)(switch_core_session_t *, void *);
|
||||
typedef struct switch_core_scheduler_task switch_core_scheduler_task_t;
|
||||
typedef void (*switch_core_scheduler_func_t)(switch_core_scheduler_task_t *task);
|
||||
typedef switch_status_t (*switch_state_handler_t)(switch_core_session_t *);
|
||||
typedef switch_status_t (*switch_outgoing_channel_hook_t)(switch_core_session_t *, switch_caller_profile_t *, switch_core_session_t *);
|
||||
typedef switch_status_t (*switch_answer_channel_hook_t)(switch_core_session_t *);
|
||||
typedef switch_status_t (*switch_receive_message_hook_t)(switch_core_session_t *, switch_core_session_message_t *);
|
||||
typedef switch_status_t (*switch_receive_event_hook_t)(switch_core_session_t *, switch_event_t *);
|
||||
typedef switch_status_t (*switch_read_frame_hook_t)(switch_core_session_t *, switch_frame_t **, int, switch_io_flag_t, int);
|
||||
typedef switch_status_t (*switch_write_frame_hook_t)(switch_core_session_t *, switch_frame_t *, int, switch_io_flag_t, int);
|
||||
typedef switch_status_t (*switch_kill_channel_hook_t)(switch_core_session_t *, int);
|
||||
typedef switch_status_t (*switch_waitfor_read_hook_t)(switch_core_session_t *, int, int);
|
||||
typedef switch_status_t (*switch_waitfor_write_hook_t)(switch_core_session_t *, int, int);
|
||||
typedef switch_status_t (*switch_send_dtmf_hook_t)(switch_core_session_t *, char *);
|
||||
typedef switch_status_t (*switch_state_change_hook_t)(switch_core_session_t *);
|
||||
typedef switch_bool_t (*switch_media_bug_callback_t) (switch_media_bug_t *, void *, switch_abc_type_t);
|
||||
typedef void (*switch_application_function_t) (switch_core_session_t *, char *);
|
||||
typedef void (*switch_event_callback_t) (switch_event_t *);
|
||||
typedef switch_caller_extension_t *(*switch_dialplan_hunt_function_t) (switch_core_session_t *, void *);
|
||||
typedef struct switch_scheduler_task switch_scheduler_task_t;
|
||||
typedef void (*switch_scheduler_func_t) (switch_scheduler_task_t *task);
|
||||
typedef switch_status_t (*switch_state_handler_t) (switch_core_session_t *);
|
||||
typedef struct switch_stream_handle switch_stream_handle_t;
|
||||
typedef switch_status_t (*switch_stream_handle_write_function_t)(switch_stream_handle_t *handle, const char *fmt, ...);
|
||||
typedef switch_status_t (*switch_api_function_t)(char *in, switch_core_session_t *session, switch_stream_handle_t *stream);
|
||||
typedef switch_status_t (*switch_input_callback_function_t)(switch_core_session_t *session,
|
||||
void *input,
|
||||
switch_input_type_t input_type,
|
||||
void *buf,
|
||||
unsigned int buflen);
|
||||
typedef switch_status_t (*switch_stream_handle_write_function_t) (switch_stream_handle_t *handle, const char *fmt, ...);
|
||||
typedef switch_status_t (*switch_api_function_t) (char *in, switch_core_session_t *session,
|
||||
switch_stream_handle_t *stream);
|
||||
typedef switch_status_t (*switch_input_callback_function_t) (switch_core_session_t *session, void *input,
|
||||
switch_input_type_t input_type, void *buf,
|
||||
unsigned int buflen);
|
||||
typedef struct switch_say_interface switch_say_interface_t;
|
||||
typedef struct {
|
||||
switch_input_callback_function_t input_callback;
|
||||
void *buf;
|
||||
uint32_t buflen;
|
||||
switch_input_callback_function_t input_callback;
|
||||
void *buf;
|
||||
uint32_t buflen;
|
||||
} switch_input_args_t;
|
||||
typedef switch_status_t (*switch_say_callback_t)(switch_core_session_t *session,
|
||||
char *tosay,
|
||||
switch_say_type_t type,
|
||||
switch_say_method_t method,
|
||||
switch_input_args_t *args);
|
||||
typedef switch_status_t (*switch_say_callback_t) (switch_core_session_t *session,
|
||||
char *tosay,
|
||||
switch_say_type_t type,
|
||||
switch_say_method_t method, switch_input_args_t *args);
|
||||
typedef switch_status_t (*switch_module_load_t) (switch_loadable_module_interface_t **, char *);
|
||||
typedef switch_status_t (*switch_module_reload_t) (void);
|
||||
typedef switch_status_t (*switch_module_pause_t) (void);
|
||||
@@ -1028,12 +992,10 @@ typedef switch_status_t (*switch_module_runtime_t) (void);
|
||||
typedef switch_status_t (*switch_module_shutdown_t) (void);
|
||||
typedef struct switch_xml *switch_xml_t;
|
||||
typedef struct switch_core_time_duration switch_core_time_duration_t;
|
||||
typedef switch_xml_t (*switch_xml_search_function_t)(const char *section,
|
||||
typedef switch_xml_t(*switch_xml_search_function_t) (const char *section,
|
||||
const char *tag_name,
|
||||
const char *key_name,
|
||||
const char *key_value,
|
||||
const char *params,
|
||||
void *user_data);
|
||||
const char *key_value, const char *params, void *user_data);
|
||||
|
||||
/* things we don't deserve to know about */
|
||||
/*! \brief A channel */
|
||||
@@ -1046,9 +1008,7 @@ struct switch_media_bug;
|
||||
struct switch_ivr_digit_stream_parser;
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
@@ -41,24 +41,19 @@
|
||||
#include <switch.h>
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
#define switch_bytes_per_frame(rate, interval) ((uint32_t)((float)rate / (1000.0f / (float)interval)))
|
||||
|
||||
#define SWITCH_SMAX 32767
|
||||
#define SWITCH_SMIN -32768
|
||||
#define switch_normalize_to_16bit(n) if (n > SWITCH_SMAX) n = SWITCH_SMAX / 2; else if (n < SWITCH_SMIN) n = SWITCH_SMIN / 2;
|
||||
|
||||
#define switch_codec2str(codec,buf,len) snprintf(buf, len, "%s@%uk@%ui", \
|
||||
codec->implementation->iananame, \
|
||||
codec->implementation->samples_per_second, \
|
||||
codec->implementation->microseconds_per_frame / 1000)
|
||||
|
||||
#ifdef WIN32
|
||||
#define switch_is_file_path(file) (*(file +1) == ':' || *file == '/' || strstr(file, SWITCH_URL_SEPARATOR))
|
||||
#else
|
||||
#define switch_is_file_path(file) ((*file == '/') || strstr(file, SWITCH_URL_SEPARATOR))
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\brief Evaluate the truthfullness of a string expression
|
||||
\param expr a string expression
|
||||
@@ -69,7 +64,6 @@ SWITCH_BEGIN_EXTERN_C
|
||||
!strcasecmp(expr, "on") ||\
|
||||
!strcasecmp(expr, "true") ||\
|
||||
atoi(expr))) ? SWITCH_TRUE : SWITCH_FALSE
|
||||
|
||||
/*!
|
||||
\brief find local ip of the box
|
||||
\param buf the buffer to write the ip adress found into
|
||||
@@ -242,7 +236,8 @@ SWITCH_DECLARE(int) switch_socket_waitfor(switch_pollfd_t *poll, int ms);
|
||||
SWITCH_DECLARE(const char *) switch_cut_path(const char *in);
|
||||
|
||||
SWITCH_DECLARE(char *) switch_string_replace(const char *string, const char *search, const char *replace);
|
||||
SWITCH_DECLARE(switch_status_t) switch_string_match(const char *string, size_t string_len, const char *search, size_t search_len);
|
||||
SWITCH_DECLARE(switch_status_t) switch_string_match(const char *string, size_t string_len, const char *search,
|
||||
size_t search_len);
|
||||
|
||||
#define SWITCH_READ_ACCEPTABLE(status) (status == SWITCH_STATUS_SUCCESS || status == SWITCH_STATUS_BREAK)
|
||||
SWITCH_DECLARE(size_t) switch_url_encode(char *url, char *buf, size_t len);
|
||||
@@ -258,9 +253,7 @@ SWITCH_DECLARE(char *) switch_url_decode(char *s);
|
||||
#endif
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
#endif
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
+35
-40
@@ -62,40 +62,38 @@
|
||||
///\ingroup core1
|
||||
///\{
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
|
||||
#define SWITCH_XML_BUFSIZE 1024 // size of internal memory buffers
|
||||
|
||||
typedef enum {
|
||||
SWITCH_XML_ROOT = (1 << 0), // root
|
||||
SWITCH_XML_NAMEM = (1 << 1), // name is malloced
|
||||
SWITCH_XML_TXTM = (1 << 2), // txt is malloced
|
||||
SWITCH_XML_DUP = (1 << 3) // attribute name and value are strduped
|
||||
#define SWITCH_XML_BUFSIZE 1024 // size of internal memory buffers
|
||||
typedef enum {
|
||||
SWITCH_XML_ROOT = (1 << 0), // root
|
||||
SWITCH_XML_NAMEM = (1 << 1), // name is malloced
|
||||
SWITCH_XML_TXTM = (1 << 2), // txt is malloced
|
||||
SWITCH_XML_DUP = (1 << 3) // attribute name and value are strduped
|
||||
} switch_xml_flag_t;
|
||||
|
||||
/*! \brief A representation of an XML tree */
|
||||
struct switch_xml {
|
||||
/*! tag name */
|
||||
char *name;
|
||||
char *name;
|
||||
/*! tag attributes { name, value, name, value, ... NULL } */
|
||||
char **attr;
|
||||
char **attr;
|
||||
/*! tag character content, empty string if none */
|
||||
char *txt;
|
||||
/*! path to free on destroy*/
|
||||
char *free_path;
|
||||
char *txt;
|
||||
/*! path to free on destroy */
|
||||
char *free_path;
|
||||
/*! tag offset from start of parent tag character content */
|
||||
switch_size_t off;
|
||||
switch_size_t off;
|
||||
/*! next tag with same name in this section at this depth */
|
||||
switch_xml_t next;
|
||||
/*! next tag with different name in same section and depth*/
|
||||
switch_xml_t sibling;
|
||||
switch_xml_t next;
|
||||
/*! next tag with different name in same section and depth */
|
||||
switch_xml_t sibling;
|
||||
/*! next tag, same section and depth, in original order */
|
||||
switch_xml_t ordered;
|
||||
/*! head of sub tag list, NULL if none*/
|
||||
switch_xml_t child;
|
||||
/*! parent tag, NULL if current tag is root tag*/
|
||||
switch_xml_t parent;
|
||||
switch_xml_t ordered;
|
||||
/*! head of sub tag list, NULL if none */
|
||||
switch_xml_t child;
|
||||
/*! parent tag, NULL if current tag is root tag */
|
||||
switch_xml_t parent;
|
||||
/*! flags */
|
||||
uint32_t flags;
|
||||
uint32_t flags;
|
||||
};
|
||||
|
||||
///\brief Given a string of xml data and its length, parses it and creates an switch_xml
|
||||
@@ -118,13 +116,13 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_parse_fd(int fd);
|
||||
///\param file a file to parse
|
||||
///\return a formated xml node or NULL
|
||||
SWITCH_DECLARE(switch_xml_t) switch_xml_parse_file(const char *file);
|
||||
|
||||
|
||||
///\brief Wrapper for switch_xml_parse_str() that accepts a file stream. Reads the entire
|
||||
///\ stream into memory and then parses it. For xml files, use switch_xml_parse_file()
|
||||
///\ or switch_xml_parse_fd()
|
||||
///\param fp a FILE pointer to parse
|
||||
///\return an xml node or NULL
|
||||
SWITCH_DECLARE(switch_xml_t) switch_xml_parse_fp(FILE *fp);
|
||||
SWITCH_DECLARE(switch_xml_t) switch_xml_parse_fp(FILE * fp);
|
||||
|
||||
///\brief returns the first child tag (one level deeper) with the given name or NULL
|
||||
///\ if not found
|
||||
@@ -139,7 +137,8 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_child(switch_xml_t xml, const char *name
|
||||
///\param attrname the attribute name
|
||||
///\param value the value
|
||||
///\return an xml node or NULL
|
||||
SWITCH_DECLARE(switch_xml_t) switch_xml_find_child(switch_xml_t node, const char *childname, const char *attrname, const char *value);
|
||||
SWITCH_DECLARE(switch_xml_t) switch_xml_find_child(switch_xml_t node, const char *childname, const char *attrname,
|
||||
const char *value);
|
||||
|
||||
///\brief returns the next tag of the same name in the same section and depth or NULL
|
||||
///\ if not found
|
||||
@@ -152,7 +151,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_find_child(switch_xml_t node, const char
|
||||
///\param xml the xml node
|
||||
///\param idx the index
|
||||
///\return an xml node or NULL
|
||||
switch_xml_t switch_xml_idx(switch_xml_t xml, int idx);
|
||||
switch_xml_t switch_xml_idx(switch_xml_t xml, int idx);
|
||||
|
||||
///\brief returns the name of the given tag
|
||||
///\param xml the xml node
|
||||
@@ -184,7 +183,7 @@ SWITCH_DECLARE(const char *) switch_xml_attr_soft(switch_xml_t xml, const char *
|
||||
///\ Returns NULL if not found.
|
||||
///\param xml the xml node
|
||||
///\return an xml node or NULL
|
||||
SWITCH_DECLARE(switch_xml_t) switch_xml_get(switch_xml_t xml, ...);
|
||||
SWITCH_DECLARE(switch_xml_t) switch_xml_get(switch_xml_t xml,...);
|
||||
|
||||
///\brief Converts an switch_xml structure back to xml. Returns a string of xml data that
|
||||
///\ must be freed.
|
||||
@@ -203,7 +202,7 @@ SWITCH_DECLARE(const char **) switch_xml_pi(switch_xml_t xml, const char *target
|
||||
///\param xml the xml node
|
||||
///\note in the case of the root node the readlock will be lifted
|
||||
SWITCH_DECLARE(void) switch_xml_free(switch_xml_t xml);
|
||||
|
||||
|
||||
///\brief returns parser error message or empty string if none
|
||||
///\param xml the xml node
|
||||
///\return the error string or nothing
|
||||
@@ -224,7 +223,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_new(const char *name);
|
||||
///\param name the name of the tag
|
||||
///\param off the offset
|
||||
///\return an xml node or NULL
|
||||
switch_xml_t switch_xml_add_child(switch_xml_t xml, const char *name, switch_size_t off);
|
||||
switch_xml_t switch_xml_add_child(switch_xml_t xml, const char *name, switch_size_t off);
|
||||
|
||||
///\brief wrapper for switch_xml_add_child() that strdup()s name
|
||||
///\param xml the xml node
|
||||
@@ -237,7 +236,7 @@ switch_xml_t switch_xml_add_child(switch_xml_t xml, const char *name, switch_siz
|
||||
///\param xml the xml node
|
||||
///\param txt the text
|
||||
///\return an xml node or NULL
|
||||
switch_xml_t switch_xml_set_txt(switch_xml_t xml, const char *txt);
|
||||
switch_xml_t switch_xml_set_txt(switch_xml_t xml, const char *txt);
|
||||
|
||||
///\brief wrapper for switch_xml_set_txt() that strdup()s txt
|
||||
///\ sets the character content for the given tag and returns the tag
|
||||
@@ -316,16 +315,14 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate(const char *section,
|
||||
const char *tag_name,
|
||||
const char *key_name,
|
||||
const char *key_value,
|
||||
switch_xml_t *root,
|
||||
switch_xml_t *node,
|
||||
const char *params);
|
||||
|
||||
switch_xml_t * root, switch_xml_t * node, const char *params);
|
||||
|
||||
///\brief open a config in the core registry
|
||||
///\param file_path the name of the config section e.g. modules.conf
|
||||
///\param node a pointer to point to the node if it is found
|
||||
///\param params optional URL formatted params to pass to external gateways
|
||||
///\return the root xml node associated with the current request or NULL
|
||||
SWITCH_DECLARE(switch_xml_t) switch_xml_open_cfg(const char *file_path, switch_xml_t *node, const char *params);
|
||||
SWITCH_DECLARE(switch_xml_t) switch_xml_open_cfg(const char *file_path, switch_xml_t * node, const char *params);
|
||||
|
||||
///\brief bind a search function to an external gateway
|
||||
///\param function the search function to bind
|
||||
@@ -333,7 +330,8 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_open_cfg(const char *file_path, switch_x
|
||||
///\param user_data a pointer to private data to be used during the callback
|
||||
///\return SWITCH_STATUS_SUCCESS if successful
|
||||
///\note gateway functions will be executed in the order they were binded until a success is found else the root registry will be used
|
||||
SWITCH_DECLARE(switch_status_t) switch_xml_bind_search_function(switch_xml_search_function_t function, switch_xml_section_t sections, void *user_data);
|
||||
SWITCH_DECLARE(switch_status_t) switch_xml_bind_search_function(switch_xml_search_function_t function,
|
||||
switch_xml_section_t sections, void *user_data);
|
||||
|
||||
///\brief parse a string for a list of sections
|
||||
///\param str a | delimited list of section names
|
||||
@@ -341,11 +339,8 @@ SWITCH_DECLARE(switch_status_t) switch_xml_bind_search_function(switch_xml_searc
|
||||
SWITCH_DECLARE(switch_xml_section_t) switch_xml_parse_section_string(const char *str);
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
///\}
|
||||
|
||||
#endif // _SWITCH_XML_H
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
||||
Reference in New Issue
Block a user