0

I am very interested to start working on IVRs project. After some researches I have discovered the somleng project (https://medium.com/@dwilkie_34546/somleng-an-open-source-twilio-clone-a297062b340d). I have tried to install the full packages on ubuntu 14.04 using docker but the freeswitch was not working and the adhearsion could not connect to it. I have decided then to install every components individually:adhearsion-twilio, freeswitch,twilreapi. I have configured mod-rayo and every individual test seems to work fine. I have started the twilreapi and initial the following call:

curl -XPOST http://localhost:3000/api/2010-04-01/Accounts/35af2347-5656-44fb-ba83-2d1bdd9c593b/Calls.json -d "Method=GET" -d "Url=http://demo.twilio.com/docs/voice.xml" -d "To=+85510202101" -d "From=1234" -u '35af2347-5656-44fb-ba83-2d1bdd9c593b:0c5388fa8fafaa8f73c62ee13e57030c1d4e3c01361f5b2445e844ae6f4f1c19'

and I have this response:

{"to":"+85510202101","from":"1234","status":"queued","sid":"fcfcbd36-3186-4e78-8099-91956ebb2fc5","account_sid":"35af2347-5656-44fb-ba83-2d1bdd9c593b","uri":"/api/2010-04-01/Accounts/35af2347-5656-44fb-ba83-2d1bdd9c593b/Calls/fcfcbd36-3186-4e78-8099-91956ebb2fc5","date_created":"Tue, 19 Dec 2017 10:12:13 +0000","date_updated":"Tue, 19 Dec 2017 10:12:13 +0000","api_version":"2010-04-01","annotation":null,"answered_by":null,"caller_name":null,"direction":"outbound-api","duration":null,"end_time":null,"forwarded_from":null,"from_formatted":"+1 (234) ","group_sid":null,"parent_call_sid":null,"phone_number_sid":null,"price":null,"price_unit":null,"start_time":null,"subresource_uris":{},"to_formatted":"+855 10 202 101"}

But I dont see any logs activities at the adhearsion side or freeswitch. Is it normal?

My other question is this: pratically how can I initiate a call and get response from this plate form using rapidpro or any softphone (I have installed X-lite and test it with freeswitch, it worked fine).


Hi @dwilkie, thank for your help. I have been able to install and to test all the five components with docker after uninstalling the first somleng project. Now I try to connect to rapidpro. I went to these steps: 1. Get the ip address of the twilreapi docker container to be able to build the API url. I have used docker ps command 2. add a twiML api channel with Number: 1234 TwiML REST API Host: http://172.18.0.6:3000 Role: Voice the the account sid and the account token But after the validation on rapidpro I have this message

" To finish configuring your TwiML REST API channel you'll need to add the following URL in your TwiML REST API instance.

TwiML REST API Host The endpoint which will receive Twilio API requests for this channel http://172.18.0.6:3000 Request URL Incoming messages for this channel will be sent to this endpoint. https://temba.ngrok.io/handlers/twiml_api/ff560773-3421-48a3-a241-c492c78dbcc4 " I have ignored this message and build a voice flow in rapidpro. but when I start the flow in rapidpro I dont see any log info at the twilreapi_1/somleng side but when I use the rapidpro simulator to test the flow I have this message " twilreapi_1 | Started POST "/2010-04-01/Accounts/8461e585-9d4f-4f6e-9847-dddc9594f190/Calls.json" for 172.18.0.1 at 2017-12-28 14:13:03 +0000 twilreapi_1 |
twilreapi_1 | ActionController::RoutingError (No route matches [POST] "/2010-04-01/Accounts/8461e585-9d4f-4f6e-9847-dddc9594f190/Calls.json"): twilreapi_1 |
twilreapi_1 | actionpack (5.1.3) lib/action_dispatch/middleware/debug_exceptions.rb:63:in call' twilreapi_1 | actionpack (5.1.3) lib/action_dispatch/middleware/show_exceptions.rb:31:incall' twilreapi_1 | railties (5.1.3) lib/rails/rack/logger.rb:36:in call_app' twilreapi_1 | railties (5.1.3) lib/rails/rack/logger.rb:24:inblock in call' twilreapi_1 | activesupport (5.1.3) lib/active_support/tagged_logging.rb:69:in block in tagged' twilreapi_1 | activesupport (5.1.3) lib/active_support/tagged_logging.rb:26:intagged' twilreapi_1 | activesupport (5.1.3) lib/active_support/tagged_logging.rb:69:in tagged' twilreapi_1 | railties (5.1.3) lib/rails/rack/logger.rb:24:incall' twilreapi_1 | actionpack (5.1.3) lib/action_dispatch/middleware/remote_ip.rb:79:in call' twilreapi_1 | actionpack (5.1.3) lib/action_dispatch/middleware/request_id.rb:25:incall' twilreapi_1 | rack (2.0.3) lib/rack/method_override.rb:22:in call' twilreapi_1 | rack (2.0.3) lib/rack/runtime.rb:22:incall' twilreapi_1 | activesupport (5.1.3) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in call' twilreapi_1 | actionpack (5.1.3) lib/action_dispatch/middleware/executor.rb:12:incall' twilreapi_1 | actionpack (5.1.3) lib/action_dispatch/middleware/static.rb:125:in call' twilreapi_1 | rack (2.0.3) lib/rack/sendfile.rb:111:incall' twilreapi_1 | railties (5.1.3) lib/rails/engine.rb:522:in call' twilreapi_1 | puma (3.9.1) lib/puma/configuration.rb:224:incall' twilreapi_1 | puma (3.9.1) lib/puma/server.rb:602:in handle_request' twilreapi_1 | puma (3.9.1) lib/puma/server.rb:435:inprocess_client' twilreapi_1 | puma (3.9.1) lib/puma/server.rb:299:in block in run' twilreapi_1 | puma (3.9.1) lib/puma/thread_pool.rb:120:inblock in spawn_thread' "

1 Answers1

0

The GETTING STARTED guide for Somleng describes how to get started with docker and docker-compose. The docker-compose configuration file contains 5 services, Twilreapi (Open Source Implementation of Twilio's REST API), Somleng-Adhearsion (Adhearsion Application configured for Somleng), FreeSWITCH configuration (configuration files for FreeSWITCH optimized for Somleng), Linphone (A docker image for Linphone - a softphone) and CURL.

The instructions in the GETTING STARTED guide show you how to bring up the services and make a test call through the REST API. There are also instructions on how to test an incoming call.

Once you have the services booted using Docker, you should be able to setup a RapidPro channel and point it the the REST API endpoint.

dwilkie
  • 583
  • 1
  • 4
  • 9
  • Hi @dwilkie, thank for your help. I have been able to install and to test all the five components with docker after uninstalling the first somleng project and used RapidPro TwiML REST API channel. And used http://twimldockerip:3000/api/2010-04-01 with 1234 as phone number. But when I try to test the flow I get this message that says " no route matchies api/2010-04-01/....' . Any help? – Gérard Bisama Jan 12 '18 at 12:39
  • No route matches [POST] "/2010-04-01/Accounts/8461e585-9d4f-4f6e-9847-dddc9594f190/Calls.json" the correct URL should be something like: "/api/2010-04-01/Accounts/8461e585-9d4f-4f6e-9847-dddc9594f190/Calls.json" – dwilkie Jan 19 '18 at 09:35
  • Hi @dwilkie, thanks again for your help. I have been able to connect RapidPro to twiML channel. As you said the problem was on the url: I have used http://twilreapiIP:3000/api and the channel works when I test the call with simulator. I expect to get the simbox very soon so I can test in the real environment. I will not hesitate to ask again some question if needed. Thanks – Gérard Bisama Jan 25 '18 at 08:27