mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 20:51:58 +00:00
Adding bugs to the core
This is the primary commit to add bugs to the core (media bugs that is)
Media bugs are kind of like what ChanSpy is in Asterisk only cooler (I wrote ChanSpy too so I can say that)
Here is an example of using them to record a call by the higher level switch_ivr functionality passed
up to the dialplan via mod_playback.
The call will be recorded while the some.wav plays then stop for the rest of the call (when some_other.wav plays)
The bugs may have bugs since this is 1 day's work so happy hunting ......
<extension name="42">
<condition field="destination_number" expression="^42$">
<action application="set" data="RECORD_TITLE=recording test"/>
<action application="set" data="RECORD_ARTIST=FreeSWITCH"/>
<action application="record_session" data="/tmp/rtest.wav"/>
<action application="playback" data="/tmp/some.wav"/>
<action application="stop_record_session" data="/tmp/rtest.wav"/>
<action application="playback" data="/tmp/some_other.wav"/>
</condition>
</extension>
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2588 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -107,6 +107,50 @@ struct switch_core_port_allocator;
|
||||
\{
|
||||
*/
|
||||
|
||||
|
||||
///\defgroup pa1 Media Bugs
|
||||
///\ingroup core1
|
||||
///\{
|
||||
|
||||
/*!
|
||||
\brief Add a media bug to the session
|
||||
\param session the session to add the bug to
|
||||
\param callback a callback for events
|
||||
\param user_data arbitrary user data
|
||||
\param new_bug pointer to assign new bug to
|
||||
\return SWITCH_STATUS_SUCCESS if the operation was a success
|
||||
*/
|
||||
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_t **new_bug);
|
||||
|
||||
|
||||
/*!
|
||||
\brief Remove a media bug from the session
|
||||
\param session the session to remove the bug from
|
||||
\param bug bug to remove
|
||||
\return SWITCH_STATUS_SUCCESS if the operation was a success
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove(switch_core_session_t *session, switch_media_bug_t **bug);
|
||||
|
||||
/*!
|
||||
\brief Remove all media bugs from the session
|
||||
\param session the session to remove the bugs from
|
||||
\return SWITCH_STATUS_SUCCESS if the operation was a success
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove_all(switch_core_session_t *session);
|
||||
|
||||
/*!
|
||||
\brief Read a frame from the bug
|
||||
\param bug the bug to read from
|
||||
\param frame the frame to write the data to
|
||||
\return the amount of data
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *bug, switch_frame_t *frame);
|
||||
|
||||
///\}
|
||||
|
||||
///\defgroup pa1 Port Allocation
|
||||
///\ingroup core1
|
||||
///\{
|
||||
@@ -119,7 +163,10 @@ struct switch_core_port_allocator;
|
||||
\param new pointer for the return value
|
||||
\return SWITCH_STATUS_SUCCESS if the operation was a success
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_new(switch_port_t start, switch_port_t end, uint8_t inc, switch_core_port_allocator_t **new_allocator);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_new(switch_port_t start,
|
||||
switch_port_t end,
|
||||
uint8_t inc,
|
||||
switch_core_port_allocator_t **new_allocator);
|
||||
|
||||
/*!
|
||||
\brief Get a port from the port allocator
|
||||
|
||||
Reference in New Issue
Block a user