summaryrefslogtreecommitdiff
path: root/asterisk-espeak/build.patch
blob: 3a36e94692414412b47bee15cc327274f195955b (plain)
    1 diff -u -r asterisk-espeak-0.4.orig/app_espeak.c asterisk-espeak-0.4/app_espeak.c
    2 --- asterisk-espeak-0.4.orig/app_espeak.c	2011-07-19 16:37:51.109554567 +0900
    3 +++ asterisk-espeak-0.4/app_espeak.c	2011-07-19 17:10:38.136024568 +0900
    4 @@ -46,12 +46,16 @@
    5  #endif
    6  
    7  #include <stdio.h>
    8 -#include <asterisk/lock.h>
    9 +
   10 +#include <asterisk.h>
   11  #include <asterisk/file.h>
   12  #include <asterisk/logger.h>
   13  #include <asterisk/channel.h>
   14  #include <asterisk/pbx.h>
   15  #include <asterisk/module.h>
   16 +#include <asterisk/lock.h>
   17 +#include <asterisk/app.h>
   18 +#include <asterisk/config.h>
   19  #include <asterisk/translate.h>
   20  #include <asterisk/utils.h>
   21  #include <asterisk/md5.h>
   22 @@ -160,11 +164,16 @@
   23  #endif
   24  
   25      /* Config file stuff */
   26 +#if ASTERISK_VERSION == 8
   27 +    struct ast_flags config_flags = { 0 };
   28 +    cfg = ast_config_load(ESPEAK_CONFIG, config_flags);
   29 +#else
   30  #if ASTERISK_VERSION >= 2
   31      cfg = ast_config_load(ESPEAK_CONFIG);
   32  #else
   33      cfg = ast_load(ESPEAK_CONFIG);
   34  #endif
   35 +#endif
   36  
   37      if (!cfg) 
   38      {
   39 @@ -521,7 +530,23 @@
   40      return res;
   41  }
   42  
   43 -#if ASTERISK_VERSION == 4
   44 +#if ASTERISK_VERSION == 8
   45 +int unload_module(void)
   46 +{
   47 +    int res;
   48 +    res = ast_unregister_application(app);
   49 +    ast_module_user_hangup_all();
   50 +    return res; 
   51 +}
   52 +
   53 +static int load_module(void)
   54 +{
   55 +    return ast_register_application(app, espeak_exec, synopsis, descrip);
   56 +}
   57 +
   58 +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY,  "eSpeak TTS Interface");
   59 +
   60 +#elif ASTERISK_VERSION == 4
   61  static int unload_module(void)
   62  {
   63      int res;
   64 @@ -550,7 +575,6 @@
   65      return ast_register_application(app, espeak_exec, synopsis, descrip);
   66  }
   67  
   68 -
   69  char *description(void)
   70  {
   71      return tdesc;

Generated by cgit