drachtio / drachtio-freeswitch-modules

A collection of open-sourced freeswitch modules that I use in various drachtio applications
MIT License
176 stars 119 forks source link

undefined symbol: google_speech_cleanup** #54

Closed kkbhanu closed 3 years ago

kkbhanu commented 3 years ago

Hi Deve, compiled mod_google_transcribe perfectly and at the time of loading module in FS1.10.3 got following error any clues on this?

2021-01-01 01:54:05.273406 [CRIT] switch_loadable_module.c:1785 Error Loading module /usr/local/freeswitch/mod/mod_google_transcribe.so /usr/local/freeswitch/mod/mod_google_transcribe.so: undefined symbol: google_speech_cleanup

got following error too undefined symbol: _ZTVN6google5cloud6speech2v16Speech4StubE**

davehorton commented 3 years ago

that is strange, it is defined here:

https://github.com/davehorton/drachtio-freeswitch-modules/blob/9dd97afd483d644fdd2ec8e4997d370fa1edbb29/modules/mod_google_transcribe/google_glue.cpp#L281

which should have been compiled into the module

The other error though indicates that the google libraries were not compiled into the freeswitch core. I build these using an ansible script that builds the googleapis into freeswitch in order to enable their use in this module

kkbhanu commented 3 years ago

yes dave, it has defined in the google_glue.cpp but still it is not able lo use in mod_google_transcribe.c any suggestions to compile it ?

davehorton commented 3 years ago

it works with my ansible script, so I suggest using that.

kkbhanu commented 3 years ago

hi Dave, followed ansible script and still same issue i am facing. anything wrong in this.

root@office:/usr/local# ansible-playbook /usr/src/ansible-role-fsmrf/install.yml Include the grpc modules (mod_google_transcribe, mod_google_tts, mod_dialogflow)? [False]: true

PLAY [webservers] ****

TASK [Gathering Facts] *** ok: [192.168.0.15]

TASK [ansible-role-fsmrf : update apt-cache] ***** ok: [192.168.0.15]

TASK [ansible-role-fsmrf : install build dependencies] *** ok: [192.168.0.15]

TASK [ansible-role-fsmrf : install libtool-bin] ** ok: [192.168.0.15]

TASK [ansible-role-fsmrf : git configure] **** changed: [192.168.0.15]

TASK [ansible-role-fsmrf : check out freeswitch code] **** changed: [192.168.0.15]

TASK [ansible-role-fsmrf : check out libfvad] **** ok: [192.168.0.15]

TASK [ansible-role-fsmrf : check out lws code] *** ok: [192.168.0.15]

TASK [ansible-role-fsmrf : check out drachtio freeswitch modules] **** ok: [192.168.0.15]

TASK [ansible-role-fsmrf : copy mod_audio_fork into place] *** changed: [192.168.0.15]

TASK [ansible-role-fsmrf : copy Makefile.am, configure.ac etc into place] **** changed: [192.168.0.15] => (item={'src': 'configure.ac.lws', 'dest': '/usr/local/src/freeswitch//configure.ac'}) changed: [192.168.0.15] => (item={'src': 'Makefile.am.lws', 'dest': '/usr/local/src/freeswitch//Makefile.am'}) changed: [192.168.0.15] => (item={'src': 'modules.conf.in.lws', 'dest': '/usr/local/src/freeswitch//build/modules.conf.in'}) changed: [192.168.0.15] => (item={'src': 'modules.conf.vanilla.xml.lws', 'dest': '/usr/local/src/freeswitch//conf/vanilla/autoload_configs/modules.conf.xml'})

TASK [ansible-role-fsmrf : patch mod_opusfile] *** changed: [192.168.0.15] => (item={'src': 'mod_opusfile.c.patch', 'dest': '/usr/local/src/freeswitch//src/mod/formats/mod_opusfile/mod_opusfile.c'})

TASK [ansible-role-fsmrf : build libwebsockets] ** changed: [192.168.0.15]

TASK [ansible-role-fsmrf : build libfvad] **** changed: [192.168.0.15]

TASK [ansible-role-fsmrf : include_tasks] **** skipping: [192.168.0.15]

TASK [ansible-role-fsmrf : bootstrap] **** changed: [192.168.0.15]

TASK [ansible-role-fsmrf : Freeswitch configuration (with extra modules)] **** skipping: [192.168.0.15]

TASK [ansible-role-fsmrf : Freeswitch configuration (without extra modules)] ***** changed: [192.168.0.15]

TASK [ansible-role-fsmrf : FreeSwitch make] ** changed: [192.168.0.15]

TASK [ansible-role-fsmrf : FreeSwitch install] *** changed: [192.168.0.15]

TASK [ansible-role-fsmrf : make sounds] ** changed: [192.168.0.15]

TASK [ansible-role-fsmrf : Copy acl.conf file] *** changed: [192.168.0.15]

TASK [ansible-role-fsmrf : Copy event_socket.conf file] ** changed: [192.168.0.15]

TASK [ansible-role-fsmrf : Remove unused dialplans and profiles] ***** changed: [192.168.0.15] => (item=sip_profiles/external.xml) changed: [192.168.0.15] => (item=sip_profiles/external) changed: [192.168.0.15] => (item=sip_profiles/internal.xml) changed: [192.168.0.15] => (item=sip_profiles/external-ipv6.xml) changed: [192.168.0.15] => (item=sip_profiles/external-ipv6) changed: [192.168.0.15] => (item=sip_profiles/internal-ipv6.xml) changed: [192.168.0.15] => (item=dialplan/default.xml) changed: [192.168.0.15] => (item=dialplan/default) changed: [192.168.0.15] => (item=dialplan/features.xml) changed: [192.168.0.15] => (item=dialplan/public.xml) changed: [192.168.0.15] => (item=dialplan/public) changed: [192.168.0.15] => (item=dialplan/skinny-patterns.xml) changed: [192.168.0.15] => (item=dialplan/skinny-patterns)

TASK [ansible-role-fsmrf : Copy dialplan] **** changed: [192.168.0.15]

TASK [ansible-role-fsmrf : Copy ipv4 sip profile] **** changed: [192.168.0.15]

TASK [ansible-role-fsmrf : Copy ipv6 sip profile] **** changed: [192.168.0.15]

TASK [ansible-role-fsmrf : change rtp-start-port] **** changed: [192.168.0.15]

TASK [ansible-role-fsmrf : change rtp-end-port] ** changed: [192.168.0.15]

TASK [ansible-role-fsmrf : reorder codecs so PCMU is first and no video] ***** changed: [192.168.0.15]

TASK [ansible-role-fsmrf : reorder codecs so PCMU is first and no video] ***** changed: [192.168.0.15]

TASK [ansible-role-fsmrf : set-exec public IPs (aws)] **** skipping: [192.168.0.15]

TASK [ansible-role-fsmrf : set-exec public IPs (gcp)] **** skipping: [192.168.0.15]

TASK [ansible-role-fsmrf : set-exec public IPs (azure)] ** skipping: [192.168.0.15]

TASK [ansible-role-fsmrf : set-exec public IPs (digital_ocean)] ** skipping: [192.168.0.15]

TASK [ansible-role-fsmrf : bind rtp to cloud IPs] **** skipping: [192.168.0.15]

TASK [ansible-role-fsmrf : unmask freeswitch service] **** changed: [192.168.0.15]

TASK [ansible-role-fsmrf : install freeswitch.service] *** ok: [192.168.0.15]

TASK [ansible-role-fsmrf : reload systemctl] ***** changed: [192.168.0.15]

TASK [ansible-role-fsmrf : enable freeswitch service] **** changed: [192.168.0.15]

TASK [ansible-role-fsmrf : log files management] ***** ok: [192.168.0.15]

TASK [ansible-role-fsmrf : file] ***** ok: [192.168.0.15]

TASK [ansible-role-fsmrf : remove source code] *** skipping: [192.168.0.15] => (item=/usr/local/src/freeswitch) skipping: [192.168.0.15] => (item=/usr/local/src/drachtio-freeswitch-modules) skipping: [192.168.0.15] => (item=/usr/local/src/grpc) skipping: [192.168.0.15] => (item=/usr/local/src/)

PLAY RECAP *** 192.168.0.15 : ok=35 changed=25 unreachable=0 failed=0

image

davehorton commented 3 years ago

this line indicates the additional modules were not built:

TASK [ansible-role-fsmrf : Freeswitch configuration (with extra modules)] ************************************************************************************************
skipping: [192.168.0.15]

make sure your playbook looks something like this:

$ more freeswitch.yml
---
- hosts: all
  become: yes
  vars_prompt:
    - name: "build_with_extra"
      prompt: "Include the extra modules (mod_aws_transcribe, mod_google_transcribe, mod_google_tts, mod_dialogflow)?"
      private: no
      default: false
    - name: "cloud_provider"
      prompt: "Cloud provider: aws, gcp, azure, digital_ocean"
      private: no
      default: none

  roles:
    - ansible-role-fsmrf

Also, make sure that LD_LIBRARY_PATH includes "/usr/local/lib"

ayuraj575 commented 3 years ago

dave the problem is we are unable to integrate googleapi libraries in your module i.e it is not loading in fs console I have installed grpc ,googleapi, and protobuf from this link --https://github.com/GoogleCloudPlatform/cpp-samples/issues/98 can u please give us a way to install libraries and use it the error is undefined symbol: _ZTVN6google5cloud6speech2v16Speech4StubE**

davehorton commented 3 years ago

It is not finding the google libraries. It seems like you built them separately from freeswitch. See my ansible script above for how I build freeswitch to include those libraries. Also, make sure that LD_LIBRARY_PATH includes "/usr/local/lib"

ayuraj575 commented 3 years ago

include $(top_srcdir)/build/modmake.rulesam MODNAME=mod_google_transcribe depend: cp ./deps/. /usr/local/lib mod_LTLIBRARIES = mod_google_transcribe.la mod_google_transcribe_la_SOURCES = mod_google_transcribe.c google_glue.cpp mod_google_transcribe_la_CFLAGS = $(AM_CFLAGS) mod_google_transcribe_la_CXXFLAGS = -I/usr/src/googleapis-c1a601690b7fdfc2ca7a070038546321102b5f0b/gens/google/cloud/speech/v1 $(AM_CXXFLAGS) -std=c++11 mod_google_transcribe_la_LIBADD = $(switch_builddir)/libfreeswitch.la mod_google_transcribe_la_CXXFLAGS = -L/usr/local/lib/ -labsl -lgpr -lgrpc -lprotobuf -lprototac -lre2 mod_google_transcribe_la_LDFLAGS = -avoid-version -module -no-undefined -shared pkg-config --libs grpc++ grpc protobuf gpr

above is my Makefile.am of the module

davehorton commented 3 years ago

I cannot troubleshoot your specific approach for compiling this module and the supported libraries needed. I just don't have the time to do that. If you want to build it as I do -- using my ansible script -- I can help with that.

ayuraj575 commented 3 years ago

Hi dave ...I just want to ask you why u are not using traditional freeswitch method of asr creation like with the asr functions and all U are creating tts engine with traditional freeswitch method so why not asr also And also I am working on creating asr interface to create asr via using traditional freeswitch method of asr making ...is it possible or not ??

davehorton commented 3 years ago

what you describe as the "traditional" asr approach is based on a protocol called MRCP. This is an older, more complex protocol that has been rapidly overtaken by modern speech services from the likes of google, AWS and others. It would be rather difficult to take these newer services and wrap an MRCP interface around them. I have no interest in doing so - you are welcome to try. MRCP is fading out in terms of popularity, only really supported by legacy vendors these day.