static mod_unimrcp_globals_t globals;
/**
- * Profile-specific configuration. This allows us to handle differing MRCP server behavior
- * on a per-profile basis
+ * Profile-specific configuration. This allows us to handle differing MRCP server behavior
+ * on a per-profile basis
*/
struct profile {
/** name of the profile */
#undef MOD_UNIMRCP_DEBUG_AUDIO_QUEUE
/**
- * Audio queue internals
+ * Audio queue internals
*/
struct audio_queue {
#ifdef MOD_UNIMRCP_DEBUG_AUDIO_QUEUE
static switch_status_t synth_channel_set_header(speech_channel_t *schannel, int id, char *val, mrcp_message_t *msg, mrcp_synth_header_t *synth_hdr);
/*********************************************************************************************************************************************
- * GRAMMAR : recognizer grammar management
+ * GRAMMAR : recognizer grammar management
*/
/**
*
* @param audio_queue the created queue
* @param name the name of this queue (for logging)
- * @param pool memory pool to allocate queue from
+ * @param pool memory pool to allocate queue from
* @return SWITCH_STATUS_SUCCESS if successful. SWITCH_STATUS_FALSE if unable to allocate queue
*/
static switch_status_t audio_queue_create(audio_queue_t ** audio_queue, const char *name, switch_memory_pool_t *pool)
/**
* Read from the audio queue
*
- * @param queue the queue to read from
+ * @param queue the queue to read from
* @param data the read data
* @param data_len the amount of data requested / actual amount of data read (returned)
* @param block 1 if blocking is allowed
* @return SWITCH_STATUS_SUCCESS
*/
static switch_status_t speech_channel_destroy(speech_channel_t *schannel)
-{
+{
if (schannel) {
/* Terminate the MRCP session if not already done */
if (schannel->mutex) {
/**
* Stop SPEAK/RECOGNIZE request on speech channel
- *
+ *
* @param schannel the channel
* @return SWITCH_STATUS_SUCCESS if successful
*/
}
/**
- * Use this function to set the current channel state without locking the
+ * Use this function to set the current channel state without locking the
* speech channel. Do this if you already have the speech channel locked.
- *
+ *
* @param schannel the channel
* @param state the new channel state
* @return SWITCH_STATUS_SUCCESS
} else {
name = switch_core_sprintf(sh->memory_pool, "TTS-%d", speech_channel_number);
}
-
+
/* Allocate the channel */
if (speech_channel_create(&schannel, name, SPEECH_CHANNEL_SYNTHESIZER, &globals.synth, (uint16_t) rate, sh->memory_pool) != SWITCH_STATUS_SUCCESS) {
status = SWITCH_STATUS_FALSE;
}
/**
- * Handle the UniMRCP responses sent to session terminate requests
+ * Handle the UniMRCP responses sent to session terminate requests
*
* @param application the MRCP application
* @param session the MRCP session
}
/**
- * Handle the UniMRCP responses sent to channel add requests
+ * Handle the UniMRCP responses sent to channel add requests
*
* @param application the MRCP application
* @param session the MRCP session
switch_mutex_lock(schannel->mutex);
if (!zstr(r->result)) {
*result = strdup(r->result);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) result:\n\n%s\n", schannel->name, *result);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) result:\n\n%s\n", schannel->name, *result ? *result : "");
r->result = NULL;
r->start_of_input = 0;
} else if (r->start_of_input) {
/**
* Flag that the recognizer channel timers are started
- * @param schannel the recognizer channel to flag
+ * @param schannel the recognizer channel to flag
*/
static switch_status_t recog_channel_set_timers_started(speech_channel_t *schannel)
{
} else {
name = switch_core_sprintf(ah->memory_pool, "ASR-%d", name, speech_channel_number);
}
-
+
/* Allocate the channel */
if (speech_channel_create(&schannel, name, SPEECH_CHANNEL_RECOGNIZER, &globals.recog, (uint16_t) rate, ah->memory_pool) != SWITCH_STATUS_SUCCESS) {
status = SWITCH_STATUS_FALSE;
* Process asr_feed request from FreeSWITCH
*
* @param ah the FreeSWITCH speech recognition handle
- * @return SWITCH_STATUS_SUCCESS if successful
+ * @return SWITCH_STATUS_SUCCESS if successful
*/
static switch_status_t recog_asr_feed(switch_asr_handle_t *ah, void *data, unsigned int len, switch_asr_flag_t *flags)
{
/**
* Process the XML configuration for this module
- * Uses the instructions[] defined in this module to process the configuration.
+ * Uses the instructions[] defined in this module to process the configuration.
*
* @return SWITCH_STATUS_SUCCESS if the configuration is OK
*/
/**
* set mod_unimrcp-specific profile configuration
- *
+ *
* @param profile the MRCP profile to configure
* @param param the param name
* @param val the param value
}
/**
- * set RTP config struct with param, val pair
+ * set RTP config struct with param, val pair
* @param client the MRCP client
* @param rtp_config the config struct to set
* @param param the param name
* @param param the param name
* @param val the param value
* @param pool memory pool to use
- * @return true if this param belongs to RTSP config
+ * @return true if this param belongs to RTSP config
*/
static int process_mrcpv1_config(rtsp_client_config_t *config, const char *param, const char *val, apr_pool_t *pool)
{
mrcp_profile_t *mprofile = NULL;
mpf_rtp_config_t *rtp_config = NULL;
profile_t *mod_profile = NULL;
- switch_xml_t default_params = NULL;
+ switch_xml_t default_params = NULL;
/* get profile attributes */
const char *name = apr_pstrdup(pool, switch_xml_attr(profile, "name"));
}
/**
- * Macro expands to: switch_status_t mod_unimrcp_load(switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool)
+ * Macro expands to: switch_status_t mod_unimrcp_load(switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool)
*/
SWITCH_MODULE_LOAD_FUNCTION(mod_unimrcp_load)
{
/**
* Called when the system shuts down
- * Macro expands to: switch_status_t mod_unimrcp_shutdown()
+ * Macro expands to: switch_status_t mod_unimrcp_shutdown()
*/
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_unimrcp_shutdown)
{
/**
* Create a parameter id
- *
+ *
* @param id the UniMRCP ID
* @return the pair
*/