Expand AGISTATUS variable to include NOTFOUND which is set when the AGI file could...
[asterisk/asterisk.git] / res / res_speech.c
index 9957c22..67dce81 100644 (file)
@@ -105,16 +105,16 @@ int ast_speech_results_free(struct ast_speech_result *result)
                prev_result = current_result;
                /* Deallocate what we can */
                if (current_result->text != NULL) {
                prev_result = current_result;
                /* Deallocate what we can */
                if (current_result->text != NULL) {
-                       free(current_result->text);
+                       ast_free(current_result->text);
                        current_result->text = NULL;
                }
                if (current_result->grammar != NULL) {
                        current_result->text = NULL;
                }
                if (current_result->grammar != NULL) {
-                       free(current_result->grammar);
+                       ast_free(current_result->grammar);
                        current_result->grammar = NULL;
                }
                /* Move on and then free ourselves */
                current_result = current_result->next;
                        current_result->grammar = NULL;
                }
                /* Move on and then free ourselves */
                current_result = current_result->next;
-               free(prev_result);
+               ast_free(prev_result);
                prev_result = NULL;
        }
 
                prev_result = NULL;
        }
 
@@ -185,9 +185,9 @@ struct ast_speech *ast_speech_new(char *engine_name, int format)
        ast_speech_change_state(new_speech, AST_SPEECH_STATE_NOT_READY);
 
        /* Pass ourselves to the engine so they can set us up some more and if they error out then do not create a structure */
        ast_speech_change_state(new_speech, AST_SPEECH_STATE_NOT_READY);
 
        /* Pass ourselves to the engine so they can set us up some more and if they error out then do not create a structure */
-       if (engine->new(new_speech)) {
+       if (engine->create(new_speech)) {
                ast_mutex_destroy(&new_speech->lock);
                ast_mutex_destroy(&new_speech->lock);
-               free(new_speech);
+               ast_free(new_speech);
                new_speech = NULL;
        }
 
                new_speech = NULL;
        }
 
@@ -211,10 +211,10 @@ int ast_speech_destroy(struct ast_speech *speech)
 
        /* If a processing sound is set - free the memory used by it */
        if (speech->processing_sound)
 
        /* If a processing sound is set - free the memory used by it */
        if (speech->processing_sound)
-               free(speech->processing_sound);
+               ast_free(speech->processing_sound);
 
        /* Aloha we are done */
 
        /* Aloha we are done */
-       free(speech);
+       ast_free(speech);
 
        return res;
 }
 
        return res;
 }
@@ -251,7 +251,7 @@ int ast_speech_register(struct ast_speech_engine *engine)
        int res = 0;
 
        /* Confirm the engine meets the minimum API requirements */
        int res = 0;
 
        /* Confirm the engine meets the minimum API requirements */
-       if (!engine->new || !engine->write || !engine->destroy) {
+       if (!engine->create || !engine->write || !engine->destroy) {
                ast_log(LOG_WARNING, "Speech recognition engine '%s' did not meet minimum API requirements.\n", engine->name);
                return -1;
        }
                ast_log(LOG_WARNING, "Speech recognition engine '%s' did not meet minimum API requirements.\n", engine->name);
                return -1;
        }