Asterisk - The Open Source Telephony Project  21.4.1
Macros | Functions | Variables
app_festival.c File Reference

Connect to festival. More...

#include "asterisk.h"
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <signal.h>
#include <fcntl.h>
#include <ctype.h>
#include <errno.h>
#include "asterisk/file.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/md5.h"
#include "asterisk/config.h"
#include "asterisk/utils.h"
#include "asterisk/lock.h"
#include "asterisk/app.h"
#include "asterisk/endian.h"
#include "asterisk/format_cache.h"

Go to the source code of this file.

Macros

#define FESTIVAL_CONFIG   "festival.conf"
 
#define MAXFESTLEN   2048
 
#define MAXLEN   180
 

Functions

 AST_MODULE_INFO_STANDARD_EXTENDED (ASTERISK_GPL_KEY,"Simple Festival Interface")
 
static int festival_exec (struct ast_channel *chan, const char *vdata)
 
static int load_module (void)
 Load the module. More...
 
static int send_waveform_to_channel (struct ast_channel *chan, char *waveform, int length, char *intkeys)
 
static int send_waveform_to_fd (char *waveform, int length, int fd)
 
static char * socket_receive_file_to_buff (int fd, int *size)
 
static int unload_module (void)
 

Variables

static char * app = "Festival"
 

Detailed Description

Connect to festival.

Author
Christos Ricudis ricud.nosp@m.is@i.nosp@m.tc.au.nosp@m.th.g.nosp@m.r
ExtRef:
The Festival Speech Synthesis System - http://www.cstr.ed.ac.uk/projects/festival/

Definition in file app_festival.c.

Function Documentation

static int load_module ( void  )
static

Load the module.

Module loading including tests for configuration or dependencies. This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails tests return AST_MODULE_LOAD_FAILURE. If the module can not load the configuration file or other non-critical problem return AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.

Definition at line 563 of file app_festival.c.

References ast_config_destroy(), ast_config_load, AST_MODULE_LOAD_DECLINE, and ast_register_application_xml.

564 {
565  struct ast_flags config_flags = { 0 };
566  struct ast_config *cfg = ast_config_load(FESTIVAL_CONFIG, config_flags);
567  if (!cfg) {
568  ast_log(LOG_WARNING, "No such configuration file %s\n", FESTIVAL_CONFIG);
570  } else if (cfg == CONFIG_STATUS_FILEINVALID) {
571  ast_log(LOG_ERROR, "Config file " FESTIVAL_CONFIG " is in an invalid format. Aborting.\n");
573  }
574  ast_config_destroy(cfg);
575  return ast_register_application_xml(app, festival_exec);
576 }
#define ast_config_load(filename, flags)
Load a config file.
Module has failed to load, may be in an inconsistent state.
Definition: module.h:78
Structure used to handle boolean flags.
Definition: utils.h:199
void ast_config_destroy(struct ast_config *cfg)
Destroys a config.
Definition: extconf.c:1289
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
Definition: module.h:640