gather 2833 into RTP core and a few tweaks

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1351 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2006-05-04 17:51:53 +00:00
parent 81c4e9f959
commit 23d6224dab
8 changed files with 304 additions and 232 deletions
+37 -1
View File
@@ -228,6 +228,38 @@ SWITCH_DECLARE(void) switch_rtp_set_invald_handler(switch_rtp_t *rtp_session, sw
*/
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
\param rtp_session the rtp session to use
\param digits the digit string to queue
\param duration the duration of the dtmf
*/
SWITCH_DECLARE(switch_status_t) switch_rtp_queue_rfc2833(switch_rtp_t *rtp_session, char *digits, uint32_t duration);
/*!
\brief Test for presence of DTMF on a given RTP session
\param rtp_session session to test
\return number of digits in the queue
*/
SWITCH_DECLARE(switch_size_t) switch_rtp_has_dtmf(switch_rtp_t *rtp_session);
/*!
\brief Queue DTMF on a given RTP session
\param rtp_session RTP session to queue DTMF to
\param dtmf string of digits to queue
\return SWITCH_STATUS_SUCCESS if successful
*/
SWITCH_DECLARE(switch_status_t) switch_rtp_queue_dtmf(switch_rtp_t *rtp_session, char *dtmf);
/*!
\brief Retrieve DTMF digits from a given RTP session
\param rtp_session RTP session to retrieve digits from
\param dtmf buffer to write dtmf to
\param len max size in bytes of the buffer
\return number of bytes read into the buffer
*/
SWITCH_DECLARE(switch_size_t) switch_rtp_dequeue_dtmf(switch_rtp_t *rtp_session, char *dtmf, switch_size_t len);
/*!
\brief Read data from a given RTP session without copying
\param rtp_session the RTP session to read from
@@ -237,7 +269,11 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_read(switch_rtp_t *rtp_session, void
\param flags flags
\return the number of bytes read
*/
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);
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);
/*!
\brief Read data from a given RTP session without copying
+3
View File
@@ -517,6 +517,8 @@ typedef enum {
SWITCH_EVENT_TALK - Talking Detected
SWITCH_EVENT_NOTALK - Not Talking Detected
SWITCH_EVENT_SESSION_CRASH - Session Crashed
SWITCH_EVENT_MODULE_LOAD - Module was loaded
SWITCH_EVENT_DTMF - DTMF was sent
SWITCH_EVENT_ALL - All events at once
</pre>
@@ -543,6 +545,7 @@ typedef enum {
SWITCH_EVENT_NOTALK,
SWITCH_EVENT_SESSION_CRASH,
SWITCH_EVENT_MODULE_LOAD,
SWITCH_EVENT_DTMF,
SWITCH_EVENT_ALL
} switch_event_types_t;
+7
View File
@@ -85,6 +85,13 @@ SWITCH_DECLARE(char) switch_rfc2833_to_char(int event);
*/
SWITCH_DECLARE(unsigned char) switch_char_to_rfc2833(char key);
/*!
\brief determine if a character is a valid DTMF key
\param key the key to test
\return TRUE or FALSE
*/
#define is_dtmf(key) ((key > 47 && key < 58) || (key > 64 && key < 69) || (key > 96 && key < 101) || key == 35 || key == 42)
/*!
\brief Duplicate a string
*/