IBM-Cloud / phonebot

Slackbot using IBM Watson and Twilio to make phone calls via slack commands
MIT License
237 stars 31 forks source link

Issue with phonebot implementation. #15

Open amebasoft opened 8 years ago

amebasoft commented 8 years ago

Hi,

I am using phonebot with slack and having some issues. I configured twilio, watson (Speech to Text) on bluemix. I can see a phonebot icon on my slack channel. I can make calls to verified numbers using trial account but it does not recognize my voice, it is unable to convert speech to text.

Can i call using slack/phonebot from my pc. I mean i want talk to other user using my headphone mic.

How does the conferencing works ? Please suggest !

jthomas commented 8 years ago

Can you paste in the application logs? $ cf logs APP_NAME --recent

It should show us what's going on...

jthomas commented 8 years ago

Just to be clear, Phonebot can make phone calls, translate the slack channel text to speech and phone recipients speech to channel messages. It does NOT handle sending speech from your laptop to the phone callee.

amebasoft commented 8 years ago

Here is the log... capture

jthomas commented 8 years ago

It looks like the Watson service is failing to translate the speech, returning an empty WAV file. Can you test the service by saying a very simple phrase, slowly and clearly? Watson's service is only trained on a very general model, without customisation the ability to accurately detect real-time speech is very difficult.

amebasoft commented 8 years ago

Hi,

the watson demo works fine for me (http://text-to-speech-demo.mybluemix.net/). it recognize my voice. Why it doen't work with phonebot ?

amebasoft commented 8 years ago

https://speech-to-text-demo.mybluemix.net/?cm_mc_uid=31600402684414427120846&cm_mc_sid_50200000=1443624056

jthomas commented 8 years ago

The Speech To Text demo is using the web browser to capture a high-quality audio stream from your local microphone. Phonebot is receiving low-quality audio from a phone call handled by Twilio. It won't be as accurate I'm afraid. Can you try my suggestion above about speaking a simple phrase, slowly and clearly, over the phone call? We need to understand if the problem is with understanding the audio or something in your configuration.

amebasoft commented 8 years ago

I am trying to deploy on bluemix but it does not. Can you please check what is the issue after reviewing log. Started by user myphonebot Building remotely on jenkins-deploy-slave-7eb7888bc6c5 (.*Deploy) in workspace /home/jenkins/workspace/ae266b2c-743e-1384-acc7-e232041fe711/324aa599-02d6-4129-8956-cb0fc508e52e Unable to access upstream artifacts area /jenkins/jobs/ae266b2c-743e-1384-acc7-e232041fe711/jobs/cb7b8a58-f46e-42e4-8994-2fdefba8abc3/builds/2015-10-03_06-25-02/archive. Does source project archive artifacts? Downloading artifacts ... DOWNLOAD SUCCESSFUL Total time: 1 seconds [324aa599-02d6-4129-8956-cb0fc508e52e] $ /bin/bash /tmp/hudson162828077252339171.sh

Updating app phonebot-myphonebot-1127 in org gagan.deep@icucsolutions.com / space icontrol as gagan.deep@icucsolutions.com... OK

Using route phonebot-myphonebot-1127.mybluemix.net Uploading phonebot-myphonebot-1127... Uploading app files from: /home/jenkins/workspace/ae266b2c-743e-1384-acc7-e232041fe711/324aa599-02d6-4129-8956-cb0fc508e52e Uploading 67.1K, 24 files

Done uploading OK Binding service twilio to app phonebot-myphonebot-1127 in org gagan.deep@icucsolutions.com / space icontrol as gagan.deep@icucsolutions.com... OK Binding service speech_to_text to app phonebot-myphonebot-1127 in org gagan.deep@icucsolutions.com / space icontrol as gagan.deep@icucsolutions.com... OK Binding service slack_webhooks to app phonebot-myphonebot-1127 in org gagan.deep@icucsolutions.com / space icontrol as gagan.deep@icucsolutions.com... OK

Stopping app phonebot-myphonebot-1127 in org gagan.deep@icucsolutions.com / space icontrol as gagan.deep@icucsolutions.com... OK

Starting app phonebot-myphonebot-1127 in org gagan.deep@icucsolutions.com / space icontrol as gagan.deep@icucsolutions.com... -----> Downloaded app package (24K) -----> Downloaded app buildpack cache (7.7M) Cloning into '/tmp/buildpacks/nodejs-buildpack'... Submodule 'compile-extensions' (https://github.com/cf-buildpacks/compile-extensions.git) registered for path 'compile-extensions' Cloning into 'compile-extensions'... Submodule path 'compile-extensions': checked out '6f91ed772234bfa0433f467d41e86c8e712466b6' -------> Buildpack version 1.1.1 -----> Resetting git environment PRO TIP: Specify a node version in package.json See https://devcenter.heroku.com/articles/nodejs-support -----> Defaulting to latest stable node: 4.1.1 -----> Downloading and installing node -----> Restoring node_modules directory from cache -----> Pruning cached dependencies not specified in package.json -----> Installing dependencies

phonebot@1.0.0 install /tmp/staged/app node admin.js track -----> Caching node_modules directory for future builds -----> No Procfile found; Adding npm start to new Procfile -----> Adding SOX library support -----> Building runtime environment -----> Uploading droplet (20M)

0 of 1 instances running, 1 starting 0 of 1 instances running, 1 down 0 of 1 instances running, 1 down 0 of 1 instances running, 1 down 0 of 1 instances running, 1 down 0 of 1 instances running, 1 down 0 of 1 instances running, 1 starting 0 of 1 instances running, 1 down 0 of 1 instances running, 1 down 0 of 1 instances running, 1 down 0 of 1 instances running, 1 down 0 of 1 instances running, 1 down 0 of 1 instances running, 1 down 0 of 1 instances running, 1 down 0 of 1 instances running, 1 starting 0 of 1 instances running, 1 starting 0 of 1 instances running, 1 down 0 of 1 instances running, 1 down 0 of 1 instances running, 1 down 0 of 1 instances running, 1 down 0 of 1 instances running, 1 failing FAILED Start unsuccessful

TIP: use 'cf logs phonebot-myphonebot-1127 --recent' for more information Build step 'Execute shell' marked build as failure Finished: FAILURE

jthomas commented 8 years ago

Can you run the "cf logs phonebot-myphonebot-1127 --recent" command and paste the result in here? This will need to be run during the deployment. It will show what's going on with the application logs during startup.

Is this deployment issue always been true or just recently?

amebasoft commented 8 years ago

Here is the log.. Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\deepgags>cd\

C:>cd C:\Program Files (x86)\CloudFoundry

C:\Program Files (x86)\CloudFoundry>cf login API endpoint: https://api.ng.bluemix.net

Email> gagan.deep@icucsolutions.com

Password> Authenticating... OK

Targeted org gagan.deep@xxx.com

Space> xxxxxxxx Targeted space xxxxxxxx API endpoint: https://api.ng.bluemix.net (API version: 2.27.0) User: xxxxxxxx Org: xxxxxxxxx Space: xxxxxxx

2015-10-05T14:09:53.62+0530 [DEA/120] OUT Stopped app instance (index 0) with guid 6387b7e1-1534-46b2-988e-86685622fd27 2015-10-05T14:41:07.25+0530 [App/0] ERR at Module._compile (module.js:4 34:26) 2015-10-05T15:00:22.20+0530 [DEA/146] OUT Stopped app instance (index 0) with guid 6387b7e1-1534-46b2-988e-86685622fd27 2015-10-05T15:31:24.12+0530 [DEA/30] OUT Starting app instance (index 0) wit h guid 6387b7e1-1534-46b2-988e-86685622fd27 2015-10-05T15:31:37.04+0530 [App/0] ERR /home/vcap/app/routes/index.js: 21 2015-10-05T15:31:37.04+0530 [App/0] ERR host = twilio_account.url.replace (/http(s)?:\/\//, ''), 2015-10-05T15:31:37.04+0530 [App/0] ERR ^ 2015-10-05T15:31:37.04+0530 [App/0] ERR at Object.Module._extensions..j s (module.js:452:10) 2015-10-05T15:31:37.04+0530 [App/0] ERR at require (module.js:384:17) 2015-10-05T15:31:37.15+0530 [API/9] OUT App instance exited with guid 6387b 7e1-1534-46b2-988e-86685622fd27 payload: {"cc_partition"=>"default", "droplet"=> "6387b7e1-1534-46b2-988e-86685622fd27", "version"=>"d4ae7c13-1537-4688-9a71-0264 ee3726e9", "instance"=>"776ca51fd63848e0b80d89133b85fe65", "index"=>0, "reason"=

"CRASHED", "exit_status"=>1, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1444039297} 2015-10-05T15:50:51.51+0530 [DEA/84] OUT Stopping app instance (index 0) wit h guid 6387b7e1-1534-46b2-988e-86685622fd27 2015-10-05T15:56:39.39+0530 [DEA/1] OUT Starting app instance (index 0) wit h guid 6387b7e1-1534-46b2-988e-86685622fd27 2015-10-05T15:56:53.59+0530 [API/1] OUT App instance exited with guid 6387b 7e1-1534-46b2-988e-86685622fd27 payload: {"cc_partition"=>"default", "droplet"=> "6387b7e1-1534-46b2-988e-86685622fd27", "version"=>"d4ae7c13-1537-4688-9a71-0264 ee3726e9", "instance"=>"d2d2c758bd5c43b6937d5ff62f5f62dd", "index"=>0, "reason"= "CRASHED", "exit_status"=>-1, "exit_description"=>"failed to start", "crash_tim estamp"=>1444040813} 2015-10-05T16:16:02.06+0530 [DEA/56] OUT Removing crash for app with id 6387 b7e1-1534-46b2-988e-86685622fd27 2015-10-05T16:16:02.06+0530 [DEA/56] OUT Stopping app instance (index 0) wit h guid 6387b7e1-1534-46b2-988e-86685622fd27 2015-10-05T16:16:02.06+0530 [DEA/56] OUT Stopped app instance (index 0) with guid 6387b7e1-1534-46b2-988e-86685622fd27 2015-10-05T16:21:54.47+0530 [DEA/37] OUT Starting app instance (index 0) wit h guid 6387b7e1-1534-46b2-988e-86685622fd27 2015-10-05T16:22:07.75+0530 [App/0] ERR host = twilio_account.url.replace (/http(s)?:\/\//, ''), 2015-10-05T16:22:07.75+0530 [App/0] ERR ^ 2015-10-05T16:22:07.75+0530 [App/0] ERR TypeError: Cannot read property 're place' of undefined 2015-10-05T16:22:07.75+0530 [App/0] ERR at Object. (/home/vc ap/app/routes/index.js:21:28) 2015-10-05T16:22:07.75+0530 [App/0] ERR at Module._compile (module.js:4 34:26) 2015-10-05T16:22:07.75+0530 [App/0] ERR at Object.Module._extensions..j s (module.js:452:10) 2015-10-05T16:22:07.75+0530 [App/0] ERR at Module.load (module.js:355:3 2) 2015-10-05T16:22:07.75+0530 [App/0] ERR at Module.require (module.js:36 5:17) 2015-10-05T16:22:07.75+0530 [App/0] ERR at require (module.js:384:17) 2015-10-05T16:22:07.75+0530 [App/0] ERR at Module._compile (module.js:4 34:26) 2015-10-05T16:22:07.75+0530 [App/0] ERR at Object.Module._extensions..j s (module.js:452:10) 2015-10-05T16:22:07.77+0530 [App/0] OUT 2015-10-05T16:22:07.83+0530 [DEA/37] ERR Instance (index 0) failed to start accepting connections 2015-10-05T16:22:07.90+0530 [API/3] OUT App instance exited with guid 6387b 7e1-1534-46b2-988e-86685622fd27 payload: {"cc_partition"=>"default", "droplet"=> "6387b7e1-1534-46b2-988e-86685622fd27", "version"=>"d4ae7c13-1537-4688-9a71-0264 ee3726e9", "instance"=>"5fc0da4caf1a40369df36f700b379e74", "index"=>0, "reason"= "CRASHED", "exit_status"=>1, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1444042327} 2015-10-05T16:41:16.87+0530 [DEA/94] OUT Removing crash for app with id 6387 b7e1-1534-46b2-988e-86685622fd27 2015-10-05T16:41:16.87+0530 [DEA/94] OUT Stopping app instance (index 0) wit h guid 6387b7e1-1534-46b2-988e-86685622fd27 2015-10-05T16:41:16.87+0530 [DEA/94] OUT Stopped app instance (index 0) with guid 6387b7e1-1534-46b2-988e-86685622fd27 2015-10-05T16:47:09.57+0530 [DEA/54] OUT Starting app instance (index 0) wit h guid 6387b7e1-1534-46b2-988e-86685622fd27 2015-10-05T16:47:23.22+0530 [App/0] ERR host = twilio_account.url.replace (/http(s)?:\/\//, ''), 2015-10-05T16:47:23.22+0530 [App/0] ERR ^ 2015-10-05T16:47:23.22+0530 [App/0] ERR TypeError: Cannot read property 're place' of undefined 2015-10-05T16:47:23.22+0530 [App/0] ERR at Object. (/home/vc ap/app/routes/index.js:21:28) 2015-10-05T16:47:23.22+0530 [App/0] ERR at Module._compile (module.js:4 34:26) 2015-10-05T16:47:23.22+0530 [App/0] ERR at Object.Module._extensions..j s (module.js:452:10) 2015-10-05T16:47:23.22+0530 [App/0] ERR at Module.load (module.js:355:3 2) 2015-10-05T16:47:23.22+0530 [App/0] ERR at Function.Module._load (modul e.js:310:12) 2015-10-05T16:47:23.22+0530 [App/0] ERR at Module.require (module.js:36 5:17) 2015-10-05T16:47:23.22+0530 [App/0] ERR at require (module.js:384:17) 2015-10-05T16:47:23.22+0530 [App/0] ERR at Object. (/home/vc ap/app/app.js:10:1) 2015-10-05T16:47:23.22+0530 [App/0] ERR at Module._compile (module.js:4 34:26) 2015-10-05T16:47:23.22+0530 [App/0] ERR at Object.Module._extensions..j s (module.js:452:10) 2015-10-05T16:47:23.23+0530 [App/0] OUT 2015-10-05T16:47:23.29+0530 [DEA/54] ERR Instance (index 0) failed to start accepting connections 2015-10-05T16:47:23.36+0530 [API/1] OUT App instance exited with guid 6387b 7e1-1534-46b2-988e-86685622fd27 payload: {"cc_partition"=>"default", "droplet"=> "6387b7e1-1534-46b2-988e-86685622fd27", "version"=>"d4ae7c13-1537-4688-9a71-0264 ee3726e9", "instance"=>"edf149cbf7394f01949f0a010ed9cdf9", "index"=>0, "reason"= "CRASHED", "exit_status"=>1, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1444043843} 2015-10-05T16:47:23.39+0530 [API/0] OUT App instance exited with guid 6387b 7e1-1534-46b2-988e-86685622fd27 payload: {"cc_partition"=>"default", "droplet"=> "6387b7e1-1534-46b2-988e-86685622fd27", "version"=>"d4ae7c13-1537-4688-9a71-0264 ee3726e9", "instance"=>"edf149cbf7394f01949f0a010ed9cdf9", "index"=>0, "reason"= "CRASHED", "exit_status"=>1, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1444043843} 2015-10-05T17:06:22.13+0530 [DEA/4] OUT Removing crash for app with id 6387 b7e1-1534-46b2-988e-86685622fd27 2015-10-05T17:06:22.13+0530 [DEA/4] OUT Stopping app instance (index 0) wit h guid 6387b7e1-1534-46b2-988e-86685622fd27 2015-10-05T17:06:22.13+0530 [DEA/4] OUT Stopped app instance (index 0) with guid 6387b7e1-1534-46b2-988e-86685622fd27 2015-10-05T17:12:24.05+0530 [DEA/114] OUT Starting app instance (index 0) wit h guid 6387b7e1-1534-46b2-988e-86685622fd27 2015-10-05T17:12:36.22+0530 [App/0] ERR /home/vcap/app/routes/index.js: 21 2015-10-05T17:12:36.22+0530 [App/0] ERR host = twilio_account.url.replace (/http(s)?:\/\//, ''), 2015-10-05T17:12:36.22+0530 [App/0] ERR ^ 2015-10-05T17:12:36.22+0530 [App/0] ERR TypeError: Cannot read property 're place' of undefined 2015-10-05T17:12:36.22+0530 [App/0] ERR at Object. (/home/vc ap/app/routes/index.js:21:28) 2015-10-05T17:12:36.22+0530 [App/0] ERR at Module._compile (module.js:4 34:26) 2015-10-05T17:12:36.22+0530 [App/0] ERR at Object.Module._extensions..j s (module.js:452:10) 2015-10-05T17:12:36.22+0530 [App/0] ERR at Module.load (module.js:355:3 2) 2015-10-05T17:12:36.22+0530 [App/0] ERR at Function.Module._load (modul e.js:310:12) 2015-10-05T17:12:36.22+0530 [App/0] ERR at Module.require (module.js:36 5:17) 2015-10-05T17:12:36.22+0530 [App/0] ERR at require (module.js:384:17) 2015-10-05T17:12:36.22+0530 [App/0] ERR at Object. (/home/vc ap/app/app.js:10:1) 2015-10-05T17:12:36.22+0530 [App/0] ERR at Module._compile (module.js:4 34:26) 2015-10-05T17:12:36.22+0530 [App/0] ERR at Object.Module._extensions..j s (module.js:452:10) 2015-10-05T17:12:36.23+0530 [App/0] OUT 2015-10-05T17:12:36.29+0530 [DEA/114] ERR Instance (index 0) failed to start accepting connections 2015-10-05T17:12:36.32+0530 [API/1] OUT App instance exited with guid 6387b 7e1-1534-46b2-988e-86685622fd27 payload: {"cc_partition"=>"default", "droplet"=> "6387b7e1-1534-46b2-988e-86685622fd27", "version"=>"d4ae7c13-1537-4688-9a71-0264 ee3726e9", "instance"=>"6cb37094c1e54ced973675cd0e6bca6a", "index"=>0, "reason"= "CRASHED", "exit_status"=>1, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1444045356} 2015-10-05T17:12:36.32+0530 [API/9] OUT App instance exited with guid 6387b 7e1-1534-46b2-988e-86685622fd27 payload: {"cc_partition"=>"default", "droplet"=> "6387b7e1-1534-46b2-988e-86685622fd27", "version"=>"d4ae7c13-1537-4688-9a71-0264 ee3726e9", "instance"=>"6cb37094c1e54ced973675cd0e6bca6a", "index"=>0, "reason"= "CRASHED", "exit_status"=>1, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1444045356} 2015-10-05T17:25:47.26+0530 [API/2] OUT Updated app with guid 6387b7e1-1534 -46b2-988e-86685622fd27 ({"name"=>"phonebot-myphonebot-1127", "command"=>"PRIVAT E DATA HIDDEN", "memory"=>256, "buildpack"=>"https://github.com/jthomas/nodejs-b uildpack.git", "environment_json"=>"PRIVATE DATA HIDDEN"})

C:\Program Files (x86)\CloudFoundry>

jthomas commented 8 years ago

So I've found a bug in the documentation! When creating the Twilio service, the command should be this line: $ cf cups twilio -p '{"accountSID":"ACCOUNT_SID","authToken":"TOKEN", "url": "https://api.twilio.com"}'

It was missing the URL parameter which is causing the crash at startup. Can you update the command line and restage the application?

jthomas commented 8 years ago

Can you confirm this has fixed your issue? If so, we can close this issue.

andrewcbass commented 8 years ago

I keep getting "could not find service speech_to_text" when I do the final cf push.

From the dashboard, I have told it to bind the service speech to text, and it still won't load.

jthomas commented 8 years ago

If you manually create a service in the dashboard called "speech_to_text" and bind that to the app then restage does it work? I think the "free" plan for the speech to text service has gone away, I need to upgrade the manifest to reflect this.