From 7, 6 Years ago, written in Plain Text.
- view diff
Embed
  1. seven@seven:~/workspace/blade/docker/freeswitch-lab-docker/freeswitch-lab/src/mod/asr_tts/mod_gcloud$ git diff .
  2. diff --git a/src/mod/asr_tts/mod_gcloud/Makefile.am b/src/mod/asr_tts/mod_gcloud/Makefile.am
  3. index c005450cff..e4c99b97d5 100644
  4. --- a/src/mod/asr_tts/mod_gcloud/Makefile.am
  5. +++ b/src/mod/asr_tts/mod_gcloud/Makefile.am
  6. @@ -17,7 +17,7 @@ GOOGLEAPIS_CCS = $(GOOGLEAPIS_API_CCS) $(GOOGLEAPIS_RPC_CCS) \
  7.      $(GOOGLEAPIS_LONGRUNNING_CCS) $(GOOGLEAPIS_SPEECH_CCS) $(GOOGLEAPIS_TYPE_CCS)
  8.  
  9.  mod_LTLIBRARIES     = mod_gcloud.la
  10. -mod_gcloud_la_SOURCES   = gcloud_dialog_rest.c curl_req.c gcloud_dialog_grpc.cc mod_gcloud.c \
  11. +mod_gcloud_la_SOURCES   = gcloud_dialog_rest.c curl_req.c tt.cc mod_gcloud.c \
  12.  google/longrunning/operations.grpc.pb.cc \
  13.  google/longrunning/operations.pb.cc \
  14.  google/type/latlng.grpc.pb.cc \
  15. diff --git a/src/mod/asr_tts/mod_gcloud/mod_gcloud.c b/src/mod/asr_tts/mod_gcloud/mod_gcloud.c
  16. index 2ce9ce6520..84e9df9e65 100644
  17. --- a/src/mod/asr_tts/mod_gcloud/mod_gcloud.c
  18. +++ b/src/mod/asr_tts/mod_gcloud/mod_gcloud.c
  19. @@ -203,6 +203,13 @@ SWITCH_STANDARD_API(token_function)
  20.  }
  21.  
  22.  
  23. +SWITCH_STANDARD_API(tt_function)
  24. +{
  25. +    tt();
  26. +    return SWITCH_STATUS_SUCCESS;
  27. +}
  28. +
  29. +
  30.  SWITCH_MODULE_LOAD_FUNCTION(gcloud_load)
  31.  {
  32.      switch_api_interface_t *api_interface;
  33. @@ -225,9 +232,11 @@ SWITCH_MODULE_LOAD_FUNCTION(gcloud_load)
  34.      }
  35.  
  36.      SWITCH_ADD_API(api_interface, "gcloud_token", "GCloud token request", token_function, "");
  37. +switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "tttt\n");
  38. +    SWITCH_ADD_API(api_interface, "tt", "tt", tt_function, "");
  39.  
  40.      gcloud_dialog_rest_load(module_interface, pool);
  41. -    gcloud_dialog_grpc_load(module_interface, pool);
  42. +    // gcloud_dialog_grpc_load(module_interface, pool);
  43.  
  44.      /* indicate that the module should continue to be loaded */
  45.      return SWITCH_STATUS_SUCCESS;
  46. @@ -238,7 +247,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(gcloud_shutdown)
  47.      switch_scheduler_del_task_group("gcloud");
  48.  
  49.      gcloud_dialog_rest_shutdown();
  50. -    gcloud_dialog_grpc_shutdown();
  51. +    // gcloud_dialog_grpc_shutdown();
  52.  
  53.      return SWITCH_STATUS_UNLOAD;
  54.  }
  55. diff --git a/src/mod/asr_tts/mod_gcloud/mod_gcloud.h b/src/mod/asr_tts/mod_gcloud/mod_gcloud.h
  56. index 6afb615546..ff36767c9d 100644
  57. --- a/src/mod/asr_tts/mod_gcloud/mod_gcloud.h
  58. +++ b/src/mod/asr_tts/mod_gcloud/mod_gcloud.h
  59. @@ -32,8 +32,10 @@ SWITCH_DECLARE(switch_status_t) gcloud_dialog_rest_shutdown SWITCH_MODULE_SHUTDO
  60.  extern "C" {
  61.  #endif
  62.  
  63. -SWITCH_DECLARE(switch_status_t) gcloud_dialog_grpc_load SWITCH_MODULE_LOAD_ARGS;
  64. -SWITCH_DECLARE(switch_status_t) gcloud_dialog_grpc_shutdown SWITCH_MODULE_SHUTDOWN_ARGS;
  65. +// SWITCH_DECLARE(switch_status_t) gcloud_dialog_grpc_load SWITCH_MODULE_LOAD_ARGS;
  66. +// SWITCH_DECLARE(switch_status_t) gcloud_dialog_grpc_shutdown SWITCH_MODULE_SHUTDOWN_ARGS;
  67. +
  68. +SWITCH_DECLARE(int) tt();
  69.  
  70.  #ifdef __cplusplus
  71.  }
  72. diff --git a/src/mod/asr_tts/mod_gcloud/t.mk b/src/mod/asr_tts/mod_gcloud/t.mk
  73. index 643d5b3b3b..ecbabdbd67 100644
  74. --- a/src/mod/asr_tts/mod_gcloud/t.mk
  75. +++ b/src/mod/asr_tts/mod_gcloud/t.mk
  76. @@ -9,8 +9,10 @@ GOOGLEAPIS_SPEECH_CCS = $(shell find \
  77.      $(GOOGLEAPIS_GENS_PATH)/google/cloud/dialogflow -name '*.pb.cc')
  78.  GOOGLEAPIS_LONGRUNNING_CCS = $(shell find \
  79.      $(GOOGLEAPIS_GENS_PATH)/google/longrunning -name '*.pb.cc')
  80. +GOOGLEAPIS_LOGGING_CCS = $(shell find \
  81. +    $(GOOGLEAPIS_GENS_PATH)/google/logging -name '*.pb.cc')
  82.  GOOGLEAPIS_CCS = $(GOOGLEAPIS_API_CCS) $(GOOGLEAPIS_RPC_CCS) \
  83. -    $(GOOGLEAPIS_LONGRUNNING_CCS) $(GOOGLEAPIS_SPEECH_CCS) $(GOOGLEAPIS_TYPE_CCS)
  84. +    $(GOOGLEAPIS_LONGRUNNING_CCS) $(GOOGLEAPIS_SPEECH_CCS) $(GOOGLEAPIS_TYPE_CCS) $(GOOGLEAPIS_LOGGING_CCS)
  85.  
  86.  HOST_SYSTEM = $(shell uname | cut -f 1 -d_)
  87.  SYSTEM ?= $(HOST_SYSTEM)
  88. @@ -36,7 +38,7 @@ googleapis.ar: $(GOOGLEAPIS_CCS:.cc=.o)
  89.      ar r $@ $?
  90.  
  91.  t: t.cc googleapis.ar
  92. -    g++ $(CXXFLAGS) $(CPPFLAGS) -o t $(LDFLAGS) $^
  93. +    g++ $(CXXFLAGS) $(CPPFLAGS) -o t $(LDFLAGS) $^ /usr/local/lib/libprotobuf.a
  94.  
  95.  clean:
  96.      rm -f *.o t googleapis.ar $(GOOGLEAPIS_CCS:.cc=.o)