status=switch_core_media_bug_add(session,"avmd",NULL,avmd_callback,avmd_session,0,flags,&bug);/* Add a media bug that allows me to intercept the reading leg of the audio stream */
if(status!=SWITCH_STATUS_SUCCESS){/* If adding a media bug fails exit */
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session),SWITCH_LOG_ERROR,"Failed to add media bug!\n");
gotoend;
}
/* Set the avmd tag to detect an existing avmd media bug */
switch_channel_set_private(channel,"_avmd_",bug);
/* OK */
switch_channel_set_private(channel,"_avmd_",bug);/* Set the avmd tag to detect an existing avmd media bug */
avmd_session=(avmd_session_t*)switch_core_session_alloc(fs_session,sizeof(avmd_session_t));/* Allocate memory attached to this FreeSWITCH session for use in the callback routine and to store state information */
/* Add a media bug that allows me to intercept the
* reading leg of the audio stream */
status=switch_core_media_bug_add(
fs_session,
"avmd",
NULL,
avmd_callback,
avmd_session,
0,
flags,
&bug
);
/* If adding a media bug fails exit */
if(status!=SWITCH_STATUS_SUCCESS){
status=switch_core_media_bug_add(fs_session,"avmd",NULL,avmd_callback,avmd_session,0,flags,&bug);/* Add a media bug that allows me to intercept the reading leg of the audio stream */
if(status!=SWITCH_STATUS_SUCCESS){/* If adding a media bug fails exit */