Asterisk - The Open Source Telephony Project GIT-master-f36a736
Enumerations | Functions | Variables
app_speech_utils.c File Reference

Speech Recognition Utility Applications. More...

#include "asterisk.h"
#include "asterisk/file.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/lock.h"
#include "asterisk/app.h"
#include "asterisk/speech.h"
Include dependency graph for app_speech_utils.c:

Go to the source code of this file.

Enumerations

enum  { SB_OPT_NOANSWER = (1 << 0) , SB_OPT_PARTIALRESULTS = (1 << 1) }
 

Functions

static void __reg_module (void)
 
static void __unreg_module (void)
 
struct ast_moduleAST_MODULE_SELF_SYM (void)
 
static void destroy_callback (void *data)
 Helper function used by datastores to destroy the speech structure upon hangup. More...
 
static struct ast_speech_resultfind_result (struct ast_speech_result *results, char *result_num)
 
static struct ast_speechfind_speech (struct ast_channel *chan)
 Helper function used to find the speech structure attached to a channel. More...
 
static int load_module (void)
 
static int speech_activate (struct ast_channel *chan, const char *data)
 SpeechActivateGrammar(Grammar Name) Dialplan Application. More...
 
static int speech_background (struct ast_channel *chan, const char *data)
 SpeechBackground(Sound File,Timeout) Dialplan Application. More...
 
static int speech_create (struct ast_channel *chan, const char *data)
 SpeechCreate() Dialplan Application. More...
 
static int speech_datastore_destroy (struct ast_channel *chan)
 
static int speech_deactivate (struct ast_channel *chan, const char *data)
 SpeechDeactivateGrammar(Grammar Name) Dialplan Application. More...
 
static int speech_destroy (struct ast_channel *chan, const char *data)
 SpeechDestroy() Dialplan Application. More...
 
static int speech_engine_read (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
 SPEECH_ENGINE() Dialplan Get Function. More...
 
static int speech_engine_write (struct ast_channel *chan, const char *cmd, char *data, const char *value)
 SPEECH_ENGINE() Dialplan Set Function. More...
 
static int speech_grammar (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
 SPEECH_GRAMMAR() Dialplan Function. More...
 
static int speech_load (struct ast_channel *chan, const char *vdata)
 SpeechLoadGrammar(Grammar Name,Path) Dialplan Application. More...
 
static int speech_processing_sound (struct ast_channel *chan, const char *data)
 SpeechProcessingSound(Sound File) Dialplan Application. More...
 
static int speech_read (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
 SPEECH() Dialplan Function. More...
 
static int speech_results_type_write (struct ast_channel *chan, const char *cmd, char *data, const char *value)
 SPEECH_RESULTS_TYPE() Dialplan Function. More...
 
static int speech_score (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
 SPEECH_SCORE() Dialplan Function. More...
 
static int speech_start (struct ast_channel *chan, const char *data)
 SpeechStart() Dialplan Application. More...
 
static int speech_streamfile (struct ast_channel *chan, const char *filename, const char *preflang)
 Helper function used by speech_background to playback a soundfile. More...
 
static int speech_text (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
 SPEECH_TEXT() Dialplan Function. More...
 
static int speech_unload (struct ast_channel *chan, const char *data)
 SpeechUnloadGrammar(Grammar Name) Dialplan Application. More...
 
static int unload_module (void)
 

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Dialplan Speech Applications" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .requires = "res_speech", }
 
static const struct ast_module_infoast_module_info = &__mod_info
 
static const struct ast_app_option speech_background_options [128] = { [ 'n' ] = { .flag = SB_OPT_NOANSWER }, [ 'p' ] = { .flag = SB_OPT_PARTIALRESULTS }, }
 
static const struct ast_datastore_info speech_datastore
 Static structure for datastore information. More...
 
static struct ast_custom_function speech_engine_function
 
static struct ast_custom_function speech_function
 
static struct ast_custom_function speech_grammar_function
 
static struct ast_custom_function speech_results_type_function
 
static struct ast_custom_function speech_score_function
 
static struct ast_custom_function speech_text_function
 

Detailed Description

Speech Recognition Utility Applications.

Author
Joshua Colp jcolp.nosp@m.@dig.nosp@m.ium.c.nosp@m.om

Definition in file app_speech_utils.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SB_OPT_NOANSWER 
SB_OPT_PARTIALRESULTS 

Definition at line 704 of file app_speech_utils.c.

704 {
705 SB_OPT_NOANSWER = (1 << 0),
706 SB_OPT_PARTIALRESULTS = (1 << 1),
707};
@ SB_OPT_NOANSWER
@ SB_OPT_PARTIALRESULTS

Function Documentation

◆ __reg_module()

static void __reg_module ( void  )
static

Definition at line 1028 of file app_speech_utils.c.

◆ __unreg_module()

static void __unreg_module ( void  )
static

Definition at line 1028 of file app_speech_utils.c.

◆ AST_MODULE_SELF_SYM()

struct ast_module * AST_MODULE_SELF_SYM ( void  )

Definition at line 1028 of file app_speech_utils.c.

◆ destroy_callback()

static void destroy_callback ( void *  data)
static

Helper function used by datastores to destroy the speech structure upon hangup.

Definition at line 274 of file app_speech_utils.c.

275{
276 struct ast_speech *speech = (struct ast_speech*)data;
277
278 if (speech == NULL) {
279 return;
280 }
281
282 /* Deallocate now */
283 ast_speech_destroy(speech);
284
285 return;
286}
#define NULL
Definition: resample.c:96
int ast_speech_destroy(struct ast_speech *speech)
Destroy a speech structure.
Definition: res_speech.c:251
void * data
Definition: speech.h:66

References ast_speech_destroy(), ast_speech::data, and NULL.

◆ find_result()

static struct ast_speech_result * find_result ( struct ast_speech_result results,
char *  result_num 
)
static

Definition at line 345 of file app_speech_utils.c.

346{
347 struct ast_speech_result *result = results;
348 char *tmp = NULL;
349 int nbest_num = 0, wanted_num = 0, i = 0;
350
351 if (!result) {
352 return NULL;
353 }
354
355 if ((tmp = strchr(result_num, '/'))) {
356 *tmp++ = '\0';
357 nbest_num = atoi(result_num);
358 wanted_num = atoi(tmp);
359 } else {
360 wanted_num = atoi(result_num);
361 }
362
363 do {
364 if (result->nbest_num != nbest_num)
365 continue;
366 if (i == wanted_num)
367 break;
368 i++;
369 } while ((result = AST_LIST_NEXT(result, list)));
370
371 return result;
372}
static int tmp()
Definition: bt_open.c:389
static PGresult * result
Definition: cel_pgsql.c:84
#define AST_LIST_NEXT(elm, field)
Returns the next entry in the list after the given entry.
Definition: linkedlists.h:439

References AST_LIST_NEXT, ast_speech_result::nbest_num, NULL, result, and tmp().

Referenced by speech_grammar(), speech_score(), and speech_text().

◆ find_speech()

static struct ast_speech * find_speech ( struct ast_channel chan)
static

Helper function used to find the speech structure attached to a channel.

Definition at line 295 of file app_speech_utils.c.

296{
297 struct ast_speech *speech = NULL;
298 struct ast_datastore *datastore = NULL;
299
300 if (!chan) {
301 return NULL;
302 }
303
304 ast_channel_lock(chan);
306 ast_channel_unlock(chan);
307 if (datastore == NULL) {
308 return NULL;
309 }
310 speech = datastore->data;
311
312 return speech;
313}
static const struct ast_datastore_info speech_datastore
Static structure for datastore information.
#define ast_channel_lock(chan)
Definition: channel.h:2968
#define ast_channel_unlock(chan)
Definition: channel.h:2969
struct ast_datastore * ast_channel_datastore_find(struct ast_channel *chan, const struct ast_datastore_info *info, const char *uid)
Find a datastore on a channel.
Definition: channel.c:2418
Structure for a data store object.
Definition: datastore.h:64
void * data
Definition: datastore.h:66

References ast_channel_datastore_find(), ast_channel_lock, ast_channel_unlock, ast_datastore::data, NULL, and speech_datastore.

Referenced by speech_activate(), speech_background(), speech_deactivate(), speech_engine_read(), speech_engine_write(), speech_grammar(), speech_load(), speech_processing_sound(), speech_read(), speech_results_type_write(), speech_score(), speech_start(), speech_text(), and speech_unload().

◆ load_module()

static int load_module ( void  )
static

Definition at line 1000 of file app_speech_utils.c.

1001{
1002 int res = 0;
1003
1004 res = ast_register_application_xml("SpeechCreate", speech_create);
1005 res |= ast_register_application_xml("SpeechLoadGrammar", speech_load);
1006 res |= ast_register_application_xml("SpeechUnloadGrammar", speech_unload);
1007 res |= ast_register_application_xml("SpeechActivateGrammar", speech_activate);
1008 res |= ast_register_application_xml("SpeechDeactivateGrammar", speech_deactivate);
1009 res |= ast_register_application_xml("SpeechStart", speech_start);
1010 res |= ast_register_application_xml("SpeechBackground", speech_background);
1011 res |= ast_register_application_xml("SpeechDestroy", speech_destroy);
1012 res |= ast_register_application_xml("SpeechProcessingSound", speech_processing_sound);
1019
1020 return res;
1021}
static int speech_unload(struct ast_channel *chan, const char *data)
SpeechUnloadGrammar(Grammar Name) Dialplan Application.
static struct ast_custom_function speech_engine_function
static struct ast_custom_function speech_score_function
static int speech_create(struct ast_channel *chan, const char *data)
SpeechCreate() Dialplan Application.
static struct ast_custom_function speech_results_type_function
static int speech_activate(struct ast_channel *chan, const char *data)
SpeechActivateGrammar(Grammar Name) Dialplan Application.
static int speech_start(struct ast_channel *chan, const char *data)
SpeechStart() Dialplan Application.
static int speech_load(struct ast_channel *chan, const char *vdata)
SpeechLoadGrammar(Grammar Name,Path) Dialplan Application.
static struct ast_custom_function speech_function
static int speech_destroy(struct ast_channel *chan, const char *data)
SpeechDestroy() Dialplan Application.
static int speech_processing_sound(struct ast_channel *chan, const char *data)
SpeechProcessingSound(Sound File) Dialplan Application.
static int speech_background(struct ast_channel *chan, const char *data)
SpeechBackground(Sound File,Timeout) Dialplan Application.
static int speech_deactivate(struct ast_channel *chan, const char *data)
SpeechDeactivateGrammar(Grammar Name) Dialplan Application.
static struct ast_custom_function speech_text_function
static struct ast_custom_function speech_grammar_function
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
Definition: module.h:640
#define ast_custom_function_register(acf)
Register a custom function.
Definition: pbx.h:1558

References ast_custom_function_register, ast_register_application_xml, speech_activate(), speech_background(), speech_create(), speech_deactivate(), speech_destroy(), speech_engine_function, speech_function, speech_grammar_function, speech_load(), speech_processing_sound(), speech_results_type_function, speech_score_function, speech_start(), speech_text_function, and speech_unload().

◆ speech_activate()

static int speech_activate ( struct ast_channel chan,
const char *  data 
)
static

SpeechActivateGrammar(Grammar Name) Dialplan Application.

Definition at line 641 of file app_speech_utils.c.

642{
643 int res = 0;
644 struct ast_speech *speech = find_speech(chan);
645
646 if (speech == NULL)
647 return -1;
648
649 /* Activate the grammar on the speech object */
650 res = ast_speech_grammar_activate(speech, data);
651
652 return res;
653}
static struct ast_speech * find_speech(struct ast_channel *chan)
Helper function used to find the speech structure attached to a channel.
int ast_speech_grammar_activate(struct ast_speech *speech, const char *grammar_name)
Activate a grammar on a speech structure.
Definition: res_speech.c:66

References ast_speech_grammar_activate(), ast_speech::data, find_speech(), and NULL.

Referenced by load_module().

◆ speech_background()

static int speech_background ( struct ast_channel chan,
const char *  data 
)
static

SpeechBackground(Sound File,Timeout) Dialplan Application.

Definition at line 715 of file app_speech_utils.c.

716{
717 unsigned int timeout = 0;
718 int res = 0, done = 0, started = 0, quieted = 0, max_dtmf_len = 0;
719 struct ast_speech *speech = find_speech(chan);
720 struct ast_frame *f = NULL;
721 RAII_VAR(struct ast_format *, oldreadformat, NULL, ao2_cleanup);
722 char dtmf[AST_MAX_EXTENSION] = "";
723 struct timeval start = { 0, 0 }, current;
724 char *parse, *filename_tmp = NULL, *filename = NULL, tmp[2] = "", dtmf_terminator = '#';
725 const char *tmp2 = NULL;
726 struct ast_flags options = { 0 };
728 AST_APP_ARG(soundfile);
729 AST_APP_ARG(timeout);
731 );
732
733 parse = ast_strdupa(data);
735
736 if (speech == NULL)
737 return -1;
738
739 if (!ast_strlen_zero(args.options)) {
740 char *options_buf = ast_strdupa(args.options);
742 }
743
744 /* If channel is not already answered, then answer it */
746 && ast_answer(chan)) {
747 return -1;
748 }
749
750 /* Record old read format */
751 oldreadformat = ao2_bump(ast_channel_readformat(chan));
752
753 /* Change read format to be signed linear */
754 if (ast_set_read_format(chan, speech->format))
755 return -1;
756
757 if (!ast_strlen_zero(args.soundfile)) {
758 /* Yay sound file */
759 filename_tmp = ast_strdupa(args.soundfile);
760 if (!ast_strlen_zero(args.timeout)) {
761 if ((timeout = atof(args.timeout) * 1000.0) == 0)
762 timeout = -1;
763 } else
764 timeout = 0;
765 }
766
767 /* See if the maximum DTMF length variable is set... we use a variable in case they want to carry it through their entire dialplan */
768 ast_channel_lock(chan);
769 if ((tmp2 = pbx_builtin_getvar_helper(chan, "SPEECH_DTMF_MAXLEN")) && !ast_strlen_zero(tmp2)) {
770 max_dtmf_len = atoi(tmp2);
771 }
772
773 /* See if a terminator is specified */
774 if ((tmp2 = pbx_builtin_getvar_helper(chan, "SPEECH_DTMF_TERMINATOR"))) {
775 if (ast_strlen_zero(tmp2))
776 dtmf_terminator = '\0';
777 else
778 dtmf_terminator = tmp2[0];
779 }
780 ast_channel_unlock(chan);
781
782 /* Before we go into waiting for stuff... make sure the structure is ready, if not - start it again */
783 if (speech->state == AST_SPEECH_STATE_NOT_READY || speech->state == AST_SPEECH_STATE_DONE) {
785 ast_speech_start(speech);
786 }
787
788 /* Ensure no streams are currently running */
789 ast_stopstream(chan);
790
791 /* Okay it's streaming so go into a loop grabbing frames! */
792 while (done == 0) {
793 /* If the filename is null and stream is not running, start up a new sound file */
794 if (!quieted
795 && ast_channel_streamid(chan) == -1
796 && ast_channel_timingfunc(chan) == NULL
797 && (filename = ast_strsep(&filename_tmp, '&', AST_STRSEP_STRIP | AST_STRSEP_TRIM))) {
798 /* Discard old stream information */
799 ast_stopstream(chan);
800 /* Start new stream */
801 speech_streamfile(chan, filename, ast_channel_language(chan));
802 }
803
804 /* Run scheduled stuff */
806
807 /* Yay scheduling */
809 if (res < 0)
810 res = 1000;
811
812 /* If there is a frame waiting, get it - if not - oh well */
813 if (ast_waitfor(chan, res) > 0) {
814 f = ast_read(chan);
815 if (f == NULL) {
816 /* The channel has hung up most likely */
817 done = 3;
818 break;
819 }
820 }
821
822 /* Do timeout check (shared between audio/dtmf) */
823 if ((!quieted || strlen(dtmf)) && started == 1) {
824 current = ast_tvnow();
825 if ((ast_tvdiff_ms(current, start)) >= timeout) {
826 done = 1;
827 if (f)
828 ast_frfree(f);
829 break;
830 }
831 }
832
833 /* Do checks on speech structure to see if it's changed */
834 ast_mutex_lock(&speech->lock);
835 if (ast_test_flag(speech, AST_SPEECH_QUIET)) {
836 if (ast_channel_stream(chan))
837 ast_stopstream(chan);
839 quieted = 1;
840 }
841 /* Check state so we can see what to do */
842 switch (speech->state) {
844 /* If audio playback has stopped do a check for timeout purposes */
845 if (ast_channel_streamid(chan) == -1 && ast_channel_timingfunc(chan) == NULL)
846 ast_stopstream(chan);
847 if (!quieted && ast_channel_stream(chan) == NULL && timeout && started == 0 && !filename_tmp) {
848 if (timeout == -1) {
849 done = 1;
850 if (f)
851 ast_frfree(f);
852 break;
853 }
854 start = ast_tvnow();
855 started = 1;
856 }
857 /* Write audio frame out to speech engine if no DTMF has been received */
858 if (!strlen(dtmf) && f != NULL && f->frametype == AST_FRAME_VOICE) {
859 ast_speech_write(speech, f->data.ptr, f->datalen);
860 }
861 break;
863 /* Cue up waiting sound if not already playing */
864 if (!strlen(dtmf)) {
865 if (ast_channel_stream(chan) == NULL) {
866 if (speech->processing_sound != NULL) {
867 if (strlen(speech->processing_sound) > 0 && strcasecmp(speech->processing_sound, "none")) {
869 }
870 }
871 } else if (ast_channel_streamid(chan) == -1 && ast_channel_timingfunc(chan) == NULL) {
872 ast_stopstream(chan);
873 if (speech->processing_sound != NULL) {
874 if (strlen(speech->processing_sound) > 0 && strcasecmp(speech->processing_sound, "none")) {
876 }
877 }
878 }
879 }
880 break;
882 /* Now that we are done... let's switch back to not ready state */
884 if (!strlen(dtmf)) {
885 /* Copy to speech structure the results, if available */
886 speech->results = ast_speech_results_get(speech);
887 /* Break out of our background too */
888 done = 1;
889 /* Stop audio playback */
890 if (ast_channel_stream(chan) != NULL) {
891 ast_stopstream(chan);
892 }
893 }
894 break;
895 default:
896 break;
897 }
898 ast_mutex_unlock(&speech->lock);
899
900 /* Deal with other frame types */
901 if (f != NULL) {
902 /* Free the frame we received */
903 switch (f->frametype) {
904 case AST_FRAME_DTMF:
905 if (dtmf_terminator != '\0' && f->subclass.integer == dtmf_terminator) {
906 done = 1;
907 } else {
908 quieted = 1;
909 if (ast_channel_stream(chan) != NULL) {
910 ast_stopstream(chan);
911 }
912 if (!started) {
913 /* Change timeout to be 5 seconds for DTMF input */
914 timeout = (ast_channel_pbx(chan) && ast_channel_pbx(chan)->dtimeoutms) ? ast_channel_pbx(chan)->dtimeoutms : 5000;
915 started = 1;
916 }
917 start = ast_tvnow();
918 snprintf(tmp, sizeof(tmp), "%c", f->subclass.integer);
919 strncat(dtmf, tmp, sizeof(dtmf) - strlen(dtmf) - 1);
920 /* If the maximum length of the DTMF has been reached, stop now */
921 if (max_dtmf_len && strlen(dtmf) == max_dtmf_len)
922 done = 1;
923 }
924 break;
926 switch (f->subclass.integer) {
928 /* Since they hung up we should destroy the speech structure */
929 done = 3;
930 default:
931 break;
932 }
933 default:
934 break;
935 }
936 ast_frfree(f);
937 f = NULL;
938 }
939 }
940
942 /* Copy to speech structure the results, even partial ones, if desired and available */
943 speech->results = ast_speech_results_get(speech);
944 } else if (!ast_strlen_zero(dtmf)) {
945 /* We sort of make a results entry */
946 speech->results = ast_calloc(1, sizeof(*speech->results));
947 if (speech->results != NULL) {
948 ast_speech_dtmf(speech, dtmf);
949 speech->results->score = 1000;
950 speech->results->text = ast_strdup(dtmf);
951 speech->results->grammar = ast_strdup("dtmf");
952 }
954 }
955
956 /* See if it was because they hung up */
957 if (done == 3) {
959 } else {
960 /* Channel is okay so restore read format */
961 ast_set_read_format(chan, oldreadformat);
962 }
963
964 return 0;
965}
static int speech_streamfile(struct ast_channel *chan, const char *filename, const char *preflang)
Helper function used by speech_background to playback a soundfile.
static const struct ast_app_option speech_background_options[128]
static int speech_datastore_destroy(struct ast_channel *chan)
#define ast_strdup(str)
A wrapper for strdup()
Definition: astmm.h:241
#define ast_strdupa(s)
duplicate a string in memory from the stack
Definition: astmm.h:298
#define ast_calloc(num, len)
A wrapper for calloc()
Definition: astmm.h:202
#define ao2_cleanup(obj)
Definition: astobj2.h:1934
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
Definition: astobj2.h:480
int ast_waitfor(struct ast_channel *chan, int ms)
Wait for input on a channel.
Definition: channel.c:3181
struct ast_frame * ast_read(struct ast_channel *chan)
Reads a frame.
Definition: channel.c:4276
int ast_set_read_format(struct ast_channel *chan, struct ast_format *format)
Sets read format on channel chan.
Definition: channel.c:5781
ast_timing_func_t ast_channel_timingfunc(const struct ast_channel *chan)
const char * ast_channel_language(const struct ast_channel *chan)
int ast_channel_streamid(const struct ast_channel *chan)
struct ast_sched_context * ast_channel_sched(const struct ast_channel *chan)
struct ast_filestream * ast_channel_stream(const struct ast_channel *chan)
struct ast_pbx * ast_channel_pbx(const struct ast_channel *chan)
int ast_answer(struct ast_channel *chan)
Answer a channel.
Definition: channel.c:2824
#define AST_MAX_EXTENSION
Definition: channel.h:134
struct ast_format * ast_channel_readformat(struct ast_channel *chan)
ast_channel_state
ast_channel states
Definition: channelstate.h:35
@ AST_STATE_UP
Definition: channelstate.h:42
int ast_stopstream(struct ast_channel *c)
Stops a stream.
Definition: file.c:222
#define AST_APP_ARG(name)
Define an application argument.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
int ast_app_parse_options(const struct ast_app_option *options, struct ast_flags *flags, char **args, char *optstr)
Parses a string containing application options and sets flags/arguments.
Definition: main/app.c:3066
#define AST_FRAME_DTMF
#define ast_frfree(fr)
@ AST_FRAME_VOICE
@ AST_FRAME_CONTROL
@ AST_CONTROL_HANGUP
#define ast_mutex_unlock(a)
Definition: lock.h:190
#define ast_mutex_lock(a)
Definition: lock.h:189
size_t current
Definition: main/cli.c:113
const char * pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name)
Return a pointer to the value of the corresponding channel variable.
int ast_sched_runq(struct ast_sched_context *con)
Runs the queue.
Definition: sched.c:786
int ast_sched_wait(struct ast_sched_context *con) attribute_warn_unused_result
Determines number of seconds until the next outstanding event to take place.
Definition: sched.c:433
int ast_speech_dtmf(struct ast_speech *speech, const char *dtmf)
Signal to the engine that DTMF was received.
Definition: res_speech.c:154
void ast_speech_start(struct ast_speech *speech)
Indicate to the speech engine that audio is now going to start being written.
Definition: res_speech.c:122
int ast_speech_write(struct ast_speech *speech, void *data, int len)
Write audio to the speech engine.
Definition: res_speech.c:144
int ast_speech_change_state(struct ast_speech *speech, int state)
Change state of a speech structure.
Definition: res_speech.c:278
@ AST_SPEECH_STATE_DONE
Definition: speech.h:42
@ AST_SPEECH_STATE_READY
Definition: speech.h:40
@ AST_SPEECH_STATE_NOT_READY
Definition: speech.h:39
@ AST_SPEECH_STATE_WAIT
Definition: speech.h:41
struct ast_speech_result * ast_speech_results_get(struct ast_speech *speech)
Get speech recognition results.
Definition: res_speech.c:90
@ AST_SPEECH_QUIET
Definition: speech.h:32
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Definition: strings.h:65
@ AST_STRSEP_TRIM
Definition: strings.h:256
@ AST_STRSEP_STRIP
Definition: strings.h:255
char * ast_strsep(char **s, const char sep, uint32_t flags)
Act like strsep but ignore separators inside quotes.
Definition: utils.c:1835
Structure used to handle boolean flags.
Definition: utils.h:199
Definition of a media format.
Definition: format.c:43
Data structure associated with a single frame of data.
struct ast_frame_subclass subclass
union ast_frame::@226 data
enum ast_frame_type frametype
int dtimeoutms
Definition: pbx.h:215
char * grammar
Definition: speech.h:119
char * processing_sound
Definition: speech.h:60
int state
Definition: speech.h:62
struct ast_format * format
Definition: speech.h:64
ast_mutex_t lock
Definition: speech.h:56
struct ast_speech_result * results
Definition: speech.h:68
int done
Definition: test_amihooks.c:48
const char * args
static struct test_options options
int64_t ast_tvdiff_ms(struct timeval end, struct timeval start)
Computes the difference (in milliseconds) between two struct timeval instances.
Definition: time.h:107
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
Definition: time.h:159
#define ast_test_flag(p, flag)
Definition: utils.h:63
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Definition: utils.h:941
#define ast_clear_flag(p, flag)
Definition: utils.h:77

References ao2_bump, ao2_cleanup, args, ast_answer(), AST_APP_ARG, ast_app_parse_options(), ast_calloc, ast_channel_language(), ast_channel_lock, ast_channel_pbx(), ast_channel_readformat(), ast_channel_sched(), ast_channel_stream(), ast_channel_streamid(), ast_channel_timingfunc(), ast_channel_unlock, ast_clear_flag, AST_CONTROL_HANGUP, AST_DECLARE_APP_ARGS, AST_FRAME_CONTROL, AST_FRAME_DTMF, AST_FRAME_VOICE, ast_frfree, AST_MAX_EXTENSION, ast_mutex_lock, ast_mutex_unlock, ast_read(), ast_sched_runq(), ast_sched_wait(), ast_set_read_format(), ast_speech_change_state(), ast_speech_dtmf(), AST_SPEECH_QUIET, ast_speech_results_get(), ast_speech_start(), AST_SPEECH_STATE_DONE, AST_SPEECH_STATE_NOT_READY, AST_SPEECH_STATE_READY, AST_SPEECH_STATE_WAIT, ast_speech_write(), AST_STANDARD_APP_ARGS, AST_STATE_UP, ast_stopstream(), ast_strdup, ast_strdupa, ast_strlen_zero(), ast_strsep(), AST_STRSEP_STRIP, AST_STRSEP_TRIM, ast_test_flag, ast_tvdiff_ms(), ast_tvnow(), ast_waitfor(), current, ast_frame::data, ast_frame::datalen, done, ast_pbx::dtimeoutms, find_speech(), ast_speech::format, ast_frame::frametype, ast_speech_result::grammar, ast_frame_subclass::integer, ast_speech::lock, NULL, options, pbx_builtin_getvar_helper(), ast_speech::processing_sound, ast_frame::ptr, RAII_VAR, ast_speech::results, SB_OPT_NOANSWER, SB_OPT_PARTIALRESULTS, ast_speech_result::score, speech_background_options, speech_datastore_destroy(), speech_streamfile(), ast_speech::state, ast_frame::subclass, ast_speech_result::text, and tmp().

Referenced by load_module().

◆ speech_create()

static int speech_create ( struct ast_channel chan,
const char *  data 
)
static

SpeechCreate() Dialplan Application.

Definition at line 556 of file app_speech_utils.c.

557{
558 struct ast_speech *speech = NULL;
559 struct ast_datastore *datastore = NULL;
560
561 /* Request a speech object */
563 if (speech == NULL) {
564 /* Not available */
565 pbx_builtin_setvar_helper(chan, "ERROR", "1");
566 return 0;
567 }
568
570 if (datastore == NULL) {
571 ast_speech_destroy(speech);
572 pbx_builtin_setvar_helper(chan, "ERROR", "1");
573 return 0;
574 }
575 pbx_builtin_setvar_helper(chan, "ERROR", NULL);
576 datastore->data = speech;
577 ast_channel_lock(chan);
578 ast_channel_datastore_add(chan, datastore);
579 ast_channel_unlock(chan);
580
581 return 0;
582}
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
Definition: channel.c:2404
struct ast_format_cap * ast_channel_nativeformats(const struct ast_channel *chan)
#define ast_datastore_alloc(info, uid)
Definition: datastore.h:85
int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
Add a variable to the channel variable stack, removing the most recently set value for the same name.
struct ast_speech * ast_speech_new(const char *engine_name, const struct ast_format_cap *formats)
Create a new speech structure.
Definition: res_speech.c:181

References ast_channel_datastore_add(), ast_channel_lock, ast_channel_nativeformats(), ast_channel_unlock, ast_datastore_alloc, ast_speech_destroy(), ast_speech_new(), ast_datastore::data, NULL, pbx_builtin_setvar_helper(), and speech_datastore.

Referenced by load_module().

◆ speech_datastore_destroy()

static int speech_datastore_destroy ( struct ast_channel chan)
static

Definition at line 324 of file app_speech_utils.c.

325{
326 struct ast_datastore *datastore;
327 int res;
328
329 ast_channel_lock(chan);
331 if (datastore) {
332 ast_channel_datastore_remove(chan, datastore);
333 }
334 ast_channel_unlock(chan);
335 if (datastore) {
336 ast_datastore_free(datastore);
337 res = 0;
338 } else {
339 res = -1;
340 }
341 return res;
342}
int ast_channel_datastore_remove(struct ast_channel *chan, struct ast_datastore *datastore)
Remove a datastore from a channel.
Definition: channel.c:2413
int ast_datastore_free(struct ast_datastore *datastore)
Free a data store object.
Definition: datastore.c:68

References ast_channel_datastore_find(), ast_channel_datastore_remove(), ast_channel_lock, ast_channel_unlock, ast_datastore_free(), NULL, and speech_datastore.

Referenced by speech_background(), and speech_destroy().

◆ speech_deactivate()

static int speech_deactivate ( struct ast_channel chan,
const char *  data 
)
static

SpeechDeactivateGrammar(Grammar Name) Dialplan Application.

Definition at line 626 of file app_speech_utils.c.

627{
628 int res = 0;
629 struct ast_speech *speech = find_speech(chan);
630
631 if (speech == NULL)
632 return -1;
633
634 /* Deactivate the grammar on the speech object */
635 res = ast_speech_grammar_deactivate(speech, data);
636
637 return res;
638}
int ast_speech_grammar_deactivate(struct ast_speech *speech, const char *grammar_name)
Deactivate a grammar on a speech structure.
Definition: res_speech.c:72

References ast_speech_grammar_deactivate(), ast_speech::data, find_speech(), and NULL.

Referenced by load_module().

◆ speech_destroy()

static int speech_destroy ( struct ast_channel chan,
const char *  data 
)
static

SpeechDestroy() Dialplan Application.

Definition at line 969 of file app_speech_utils.c.

970{
971 if (!chan) {
972 return -1;
973 }
974 return speech_datastore_destroy(chan);
975}

References speech_datastore_destroy().

Referenced by load_module().

◆ speech_engine_read()

static int speech_engine_read ( struct ast_channel chan,
const char *  cmd,
char *  data,
char *  buf,
size_t  len 
)
static

SPEECH_ENGINE() Dialplan Get Function.

Definition at line 466 of file app_speech_utils.c.

467{
468 struct ast_speech *speech = find_speech(chan);
469
470 if (!data || !speech) {
471 return -1;
472 }
473
474 return ast_speech_get_setting(speech, data, buf, len);
475}
char buf[BUFSIZE]
Definition: eagi_proxy.c:66
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
int ast_speech_get_setting(struct ast_speech *speech, const char *name, char *buf, size_t len)
Get an engine specific attribute.
Definition: res_speech.c:175

References ast_speech_get_setting(), buf, ast_speech::data, find_speech(), and len().

◆ speech_engine_write()

static int speech_engine_write ( struct ast_channel chan,
const char *  cmd,
char *  data,
const char *  value 
)
static

SPEECH_ENGINE() Dialplan Set Function.

Definition at line 452 of file app_speech_utils.c.

453{
454 struct ast_speech *speech = find_speech(chan);
455
456 if (data == NULL || speech == NULL) {
457 return -1;
458 }
459
460 ast_speech_change(speech, data, value);
461
462 return 0;
463}
int ast_speech_change(struct ast_speech *speech, const char *name, const char *value)
Change an engine specific attribute.
Definition: res_speech.c:169
int value
Definition: syslog.c:37

References ast_speech_change(), ast_speech::data, find_speech(), NULL, and value.

◆ speech_grammar()

static int speech_grammar ( struct ast_channel chan,
const char *  cmd,
char *  data,
char *  buf,
size_t  len 
)
static

SPEECH_GRAMMAR() Dialplan Function.

Definition at line 426 of file app_speech_utils.c.

428{
429 struct ast_speech_result *result = NULL;
430 struct ast_speech *speech = find_speech(chan);
431
432 if (data == NULL || speech == NULL || !(result = find_result(speech->results, data))) {
433 return -1;
434 }
435
436 if (result->grammar != NULL) {
437 ast_copy_string(buf, result->grammar, len);
438 } else {
439 buf[0] = '\0';
440 }
441
442 return 0;
443}
static struct ast_speech_result * find_result(struct ast_speech_result *results, char *result_num)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition: strings.h:425

References ast_copy_string(), buf, ast_speech::data, find_result(), find_speech(), len(), NULL, result, and ast_speech::results.

◆ speech_load()

static int speech_load ( struct ast_channel chan,
const char *  vdata 
)
static

SpeechLoadGrammar(Grammar Name,Path) Dialplan Application.

Definition at line 585 of file app_speech_utils.c.

586{
587 int res = 0;
588 struct ast_speech *speech = find_speech(chan);
589 char *data;
591 AST_APP_ARG(grammar);
592 AST_APP_ARG(path);
593 );
594
595 data = ast_strdupa(vdata);
597
598 if (speech == NULL)
599 return -1;
600
601 if (args.argc != 2)
602 return -1;
603
604 /* Load the grammar locally on the object */
605 res = ast_speech_grammar_load(speech, args.grammar, args.path);
606
607 return res;
608}
int ast_speech_grammar_load(struct ast_speech *speech, const char *grammar_name, const char *grammar)
Load a grammar on a speech structure (not globally)
Definition: res_speech.c:78

References args, AST_APP_ARG, AST_DECLARE_APP_ARGS, ast_speech_grammar_load(), AST_STANDARD_APP_ARGS, ast_strdupa, ast_speech::data, find_speech(), and NULL.

Referenced by load_module().

◆ speech_processing_sound()

static int speech_processing_sound ( struct ast_channel chan,
const char *  data 
)
static

SpeechProcessingSound(Sound File) Dialplan Application.

Definition at line 670 of file app_speech_utils.c.

671{
672 int res = 0;
673 struct ast_speech *speech = find_speech(chan);
674
675 if (speech == NULL)
676 return -1;
677
678 if (speech->processing_sound != NULL) {
679 ast_free(speech->processing_sound);
680 speech->processing_sound = NULL;
681 }
682
684
685 return res;
686}
#define ast_free(a)
Definition: astmm.h:180

References ast_free, ast_strdup, ast_speech::data, find_speech(), NULL, and ast_speech::processing_sound.

Referenced by load_module().

◆ speech_read()

static int speech_read ( struct ast_channel chan,
const char *  cmd,
char *  data,
char *  buf,
size_t  len 
)
static

SPEECH() Dialplan Function.

Definition at line 506 of file app_speech_utils.c.

508{
509 int results = 0;
510 struct ast_speech_result *result = NULL;
511 struct ast_speech *speech = find_speech(chan);
512 char tmp[128] = "";
513
514 /* Now go for the various options */
515 if (!strcasecmp(data, "status")) {
516 if (speech != NULL)
517 ast_copy_string(buf, "1", len);
518 else
519 ast_copy_string(buf, "0", len);
520 return 0;
521 }
522
523 /* Make sure we have a speech structure for everything else */
524 if (speech == NULL) {
525 return -1;
526 }
527
528 /* Check to see if they are checking for silence */
529 if (!strcasecmp(data, "spoke")) {
530 if (ast_test_flag(speech, AST_SPEECH_SPOKE))
531 ast_copy_string(buf, "1", len);
532 else
533 ast_copy_string(buf, "0", len);
534 } else if (!strcasecmp(data, "results")) {
535 /* Count number of results */
536 for (result = speech->results; result; result = AST_LIST_NEXT(result, list))
537 results++;
538 snprintf(tmp, sizeof(tmp), "%d", results);
540 } else {
541 buf[0] = '\0';
542 }
543
544 return 0;
545}
@ AST_SPEECH_SPOKE
Definition: speech.h:33

References ast_copy_string(), AST_LIST_NEXT, AST_SPEECH_SPOKE, ast_test_flag, buf, ast_speech::data, find_speech(), len(), NULL, result, ast_speech::results, and tmp().

◆ speech_results_type_write()

static int speech_results_type_write ( struct ast_channel chan,
const char *  cmd,
char *  data,
const char *  value 
)
static

SPEECH_RESULTS_TYPE() Dialplan Function.

Definition at line 484 of file app_speech_utils.c.

485{
486 struct ast_speech *speech = find_speech(chan);
487
488 if (data == NULL || speech == NULL)
489 return -1;
490
491 if (!strcasecmp(value, "normal"))
493 else if (!strcasecmp(value, "nbest"))
495
496 return 0;
497}
int ast_speech_change_results_type(struct ast_speech *speech, enum ast_speech_results_type results_type)
Change the type of results we want.
Definition: res_speech.c:308
@ AST_SPEECH_RESULTS_TYPE_NBEST
Definition: speech.h:47
@ AST_SPEECH_RESULTS_TYPE_NORMAL
Definition: speech.h:46

References ast_speech_change_results_type(), AST_SPEECH_RESULTS_TYPE_NBEST, AST_SPEECH_RESULTS_TYPE_NORMAL, ast_speech::data, find_speech(), NULL, and value.

◆ speech_score()

static int speech_score ( struct ast_channel chan,
const char *  cmd,
char *  data,
char *  buf,
size_t  len 
)
static

SPEECH_SCORE() Dialplan Function.

Definition at line 375 of file app_speech_utils.c.

377{
378 struct ast_speech_result *result = NULL;
379 struct ast_speech *speech = find_speech(chan);
380 char tmp[128] = "";
381
382 if (data == NULL || speech == NULL || !(result = find_result(speech->results, data))) {
383 return -1;
384 }
385
386 snprintf(tmp, sizeof(tmp), "%d", result->score);
387
389
390 return 0;
391}

References ast_copy_string(), buf, ast_speech::data, find_result(), find_speech(), len(), NULL, result, ast_speech::results, and tmp().

◆ speech_start()

static int speech_start ( struct ast_channel chan,
const char *  data 
)
static

SpeechStart() Dialplan Application.

Definition at line 656 of file app_speech_utils.c.

657{
658 int res = 0;
659 struct ast_speech *speech = find_speech(chan);
660
661 if (speech == NULL)
662 return -1;
663
664 ast_speech_start(speech);
665
666 return res;
667}

References ast_speech_start(), find_speech(), and NULL.

Referenced by load_module().

◆ speech_streamfile()

static int speech_streamfile ( struct ast_channel chan,
const char *  filename,
const char *  preflang 
)
static

Helper function used by speech_background to playback a soundfile.

Definition at line 689 of file app_speech_utils.c.

690{
691 struct ast_filestream *fs = NULL;
692
693 if (!(fs = ast_openstream(chan, filename, preflang)))
694 return -1;
695
696 if (ast_applystream(chan, fs))
697 return -1;
698
699 ast_playstream(fs);
700
701 return 0;
702}
struct ast_filestream * ast_openstream(struct ast_channel *chan, const char *filename, const char *preflang)
Opens stream for use in seeking, playing.
Definition: file.c:790
int ast_applystream(struct ast_channel *chan, struct ast_filestream *s)
Applies a open stream to a channel.
Definition: file.c:1057
int ast_playstream(struct ast_filestream *s)
Play a open stream on a channel.
Definition: file.c:1063
This structure is allocated by file.c in one chunk, together with buf_size and desc_size bytes of mem...
Definition: mod_format.h:101
char * filename
Definition: mod_format.h:107

References ast_applystream(), ast_openstream(), ast_playstream(), ast_filestream::filename, and NULL.

Referenced by speech_background().

◆ speech_text()

static int speech_text ( struct ast_channel chan,
const char *  cmd,
char *  data,
char *  buf,
size_t  len 
)
static

SPEECH_TEXT() Dialplan Function.

Definition at line 400 of file app_speech_utils.c.

402{
403 struct ast_speech_result *result = NULL;
404 struct ast_speech *speech = find_speech(chan);
405
406 if (data == NULL || speech == NULL || !(result = find_result(speech->results, data))) {
407 return -1;
408 }
409
410 if (result->text != NULL) {
411 ast_copy_string(buf, result->text, len);
412 } else {
413 buf[0] = '\0';
414 }
415
416 return 0;
417}

References ast_copy_string(), buf, ast_speech::data, find_result(), find_speech(), len(), NULL, result, and ast_speech::results.

◆ speech_unload()

static int speech_unload ( struct ast_channel chan,
const char *  data 
)
static

SpeechUnloadGrammar(Grammar Name) Dialplan Application.

Definition at line 611 of file app_speech_utils.c.

612{
613 int res = 0;
614 struct ast_speech *speech = find_speech(chan);
615
616 if (speech == NULL)
617 return -1;
618
619 /* Unload the grammar */
620 res = ast_speech_grammar_unload(speech, data);
621
622 return res;
623}
int ast_speech_grammar_unload(struct ast_speech *speech, const char *grammar_name)
Unload a grammar.
Definition: res_speech.c:84

References ast_speech_grammar_unload(), ast_speech::data, find_speech(), and NULL.

Referenced by load_module().

◆ unload_module()

static int unload_module ( void  )
static

Definition at line 977 of file app_speech_utils.c.

978{
979 int res = 0;
980
981 res = ast_unregister_application("SpeechCreate");
982 res |= ast_unregister_application("SpeechLoadGrammar");
983 res |= ast_unregister_application("SpeechUnloadGrammar");
984 res |= ast_unregister_application("SpeechActivateGrammar");
985 res |= ast_unregister_application("SpeechDeactivateGrammar");
986 res |= ast_unregister_application("SpeechStart");
987 res |= ast_unregister_application("SpeechBackground");
988 res |= ast_unregister_application("SpeechDestroy");
989 res |= ast_unregister_application("SpeechProcessingSound");
996
997 return res;
998}
int ast_unregister_application(const char *app)
Unregister an application.
Definition: pbx_app.c:392
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.

References ast_custom_function_unregister(), ast_unregister_application(), speech_engine_function, speech_function, speech_grammar_function, speech_results_type_function, speech_score_function, and speech_text_function.

Variable Documentation

◆ __mod_info

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Dialplan Speech Applications" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .requires = "res_speech", }
static

Definition at line 1028 of file app_speech_utils.c.

◆ ast_module_info

const struct ast_module_info* ast_module_info = &__mod_info
static

Definition at line 1028 of file app_speech_utils.c.

◆ speech_background_options

const struct ast_app_option speech_background_options[128] = { [ 'n' ] = { .flag = SB_OPT_NOANSWER }, [ 'p' ] = { .flag = SB_OPT_PARTIALRESULTS }, }
static

Definition at line 712 of file app_speech_utils.c.

Referenced by speech_background().

◆ speech_datastore

const struct ast_datastore_info speech_datastore
static
Initial value:
= {
.type = "speech",
.destroy = destroy_callback
}
static void destroy_callback(void *data)
Helper function used by datastores to destroy the speech structure upon hangup.

Static structure for datastore information.

Definition at line 289 of file app_speech_utils.c.

Referenced by find_speech(), speech_create(), and speech_datastore_destroy().

◆ speech_engine_function

struct ast_custom_function speech_engine_function
static
Initial value:
= {
.name = "SPEECH_ENGINE",
}
static int speech_engine_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
SPEECH_ENGINE() Dialplan Set Function.
static int speech_engine_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
SPEECH_ENGINE() Dialplan Get Function.

Definition at line 477 of file app_speech_utils.c.

Referenced by load_module(), and unload_module().

◆ speech_function

struct ast_custom_function speech_function
static
Initial value:
= {
.name = "SPEECH",
.read = speech_read,
.write = NULL,
}
static int speech_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
SPEECH() Dialplan Function.

Definition at line 547 of file app_speech_utils.c.

Referenced by load_module(), and unload_module().

◆ speech_grammar_function

struct ast_custom_function speech_grammar_function
static
Initial value:
= {
.name = "SPEECH_GRAMMAR",
.read = speech_grammar,
.write = NULL,
}
static int speech_grammar(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
SPEECH_GRAMMAR() Dialplan Function.

Definition at line 445 of file app_speech_utils.c.

Referenced by load_module(), and unload_module().

◆ speech_results_type_function

struct ast_custom_function speech_results_type_function
static
Initial value:
= {
.name = "SPEECH_RESULTS_TYPE",
.read = NULL,
}
static int speech_results_type_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
SPEECH_RESULTS_TYPE() Dialplan Function.

Definition at line 499 of file app_speech_utils.c.

Referenced by load_module(), and unload_module().

◆ speech_score_function

struct ast_custom_function speech_score_function
static
Initial value:
= {
.name = "SPEECH_SCORE",
.read = speech_score,
.write = NULL,
}
static int speech_score(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
SPEECH_SCORE() Dialplan Function.

Definition at line 393 of file app_speech_utils.c.

Referenced by load_module(), and unload_module().

◆ speech_text_function

struct ast_custom_function speech_text_function
static
Initial value:
= {
.name = "SPEECH_TEXT",
.read = speech_text,
.write = NULL,
}
static int speech_text(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
SPEECH_TEXT() Dialplan Function.

Definition at line 419 of file app_speech_utils.c.

Referenced by load_module(), and unload_module().