/* Add a media bug that allows me to intercept the
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 */
* reading leg of the audio stream */
if(status!=SWITCH_STATUS_SUCCESS){/* If adding a media bug fails exit */
status=switch_core_media_bug_add(
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session),SWITCH_LOG_ERROR,"Failed to add media bug!\n");
if(strcasecmp(command,"start")!=0){/* If we don't see the expected start exit */
/* If we don't see the expected start exit */
if(strcasecmp(command,"start")!=0){
stream->write_function(stream,"-ERR, did you mean\n"
stream->write_function(stream,"-ERR, did you mean\n"
" api avmd %s start ?\n-USAGE: %s\n\n",uuid,AVMD_SYNTAX);
" api avmd %s start ?\n-USAGE: %s\n\n",uuid,AVMD_SYNTAX);
gotoend;
gotoend;
}
}
/* Allocate memory attached to this FreeSWITCH session for
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 */
* use in the callback routine and to store state information */
/* Add a media bug that allows me to intercept the
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 */
* reading leg of the audio stream */
status=switch_core_media_bug_add(
if(status!=SWITCH_STATUS_SUCCESS){/* If adding a media bug fails exit */