more ivr stuff (not done)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@693 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2006-02-28 02:08:42 +00:00
parent 5938cee550
commit bdd2223542
13 changed files with 362 additions and 91 deletions
+5
View File
@@ -104,6 +104,11 @@ SWITCH_DECLARE(int) switch_buffer_write(switch_buffer *buffer, void *data, size_
* \return int size of buffer, or 0 if unable to toss that much data
*/
SWITCH_DECLARE(int) switch_buffer_toss(switch_buffer *buffer, size_t datalen);
/*! \brief Remove all data from the buffer
* \param buffer any buffer of type switch_buffer
*/
SWITCH_DECLARE(void) switch_buffer_zero(switch_buffer *buffer);
/** @} */
+1 -1
View File
@@ -743,7 +743,7 @@ SWITCH_DECLARE(switch_status) switch_core_file_write(switch_file_handle *fh, voi
\param whence the indicator (see traditional seek)
\return SWITCH_STATUS_SUCCESS with cur_pos adjusted to new position
*/
SWITCH_DECLARE(switch_status) switch_core_file_seek(switch_file_handle *fh, unsigned int *cur_pos, unsigned int samples, int whence);
SWITCH_DECLARE(switch_status) switch_core_file_seek(switch_file_handle *fh, unsigned int *cur_pos, int64_t samples, int whence);
/*!
\brief Close an open file handle
+2
View File
@@ -85,6 +85,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_collect_digits_count(switch_core_sessio
/*!
\brief play a file from the disk to the session
\param session the session to play the file too
\param pointer to file handle to use (NULL for builtin one)
\param file the path to the file
\param timer_name the name of a timer to use input will be absorbed (NULL to time off the session input).
\param dtmf_callback code to execute if any dtmf is dialed during the playback
@@ -94,6 +95,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_collect_digits_count(switch_core_sessio
\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) switch_ivr_play_file(switch_core_session *session,
switch_file_handle *fh,
char *file,
char *timer_name,
switch_dtmf_callback_function dtmf_callback,
+5 -1
View File
@@ -245,7 +245,7 @@ struct switch_file_interface {
/*! function to write from the file */
switch_status (*file_write)(switch_file_handle *, void *data, size_t *len);
/*! function to seek to a certian position in the file */
switch_status (*file_seek)(switch_file_handle *, unsigned int *cur_pos, unsigned int samples, int whence);
switch_status (*file_seek)(switch_file_handle *, unsigned int *cur_pos, int64_t samples, int whence);
/*! list of supported file extensions */
char **extens;
const struct switch_file_interface *next;
@@ -273,10 +273,14 @@ struct switch_file_handle {
int seekable;
/*! the sample count of the file */
unsigned int sample_count;
/*! the speed of the file playback*/
int speed;
/*! the handle's memory pool */
switch_memory_pool *memory_pool;
/*! private data for the format module to store handle specific info */
void *private_info;
int64_t pos;
switch_buffer *audio_buffer;
};
+2
View File
@@ -319,6 +319,7 @@ SWITCH_FILE_DATA_INT = (1 << 4) - Read data in ints
SWITCH_FILE_DATA_FLOAT = (1 << 5) - Read data in floats
SWITCH_FILE_DATA_DOUBLE = (1 << 6) - Read data in doubles
SWITCH_FILE_DATA_RAW = (1 << 7) - Read data as is
SWITCH_FILE_PAUSE = (1 << 8) - Pause
</pre>
*/
typedef enum {
@@ -330,6 +331,7 @@ typedef enum {
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_flag;
typedef enum {