Skip to content

Virtual KasaDaka

abaart edited this page Apr 21, 2016 · 15 revisions

There is a VirtualBox image of a Debian install with the KasaDaka installed and configured available for download.

You can download the image, and import it in to VirtualBox. Use the pre-installed software Linphone (click top-left Applications Menu-> Internet-> Linphone), to call the locally hosted KasaDaka at: kasadaka@127.0.0.1.

Username and password for the image: kasadaka

To access the services pre-installed on this image on your host, some ports are 'forwarded' to your host computer.

Service Source port (virtual) Host port
SSH 22 3022
HTTP 80 3080
Cliopatria 3020 3021
SIP (see note 2) 5060 3060
Flask Development mode 5000 3050

It is also possible to use a SIP client (LinPhone) on your host OS to call the KasaDaka: kasadaka@127.0.0.1:3060. Note: when the keypad does not work, check Send DTMFs as SIP info. Note2: when on the VU wireless network, some port forwarding may not work (usually SIP does not work well). If this is the case, resort to using the SIP client installed in the image itself.

####Radiomarche vs. Fertilizer use-case The image comes with the radiomarché use-case pre installed. However, for experimenting, a more simple use-case is the fertilizer use-case. To install this, run the following commands:
rm -R KasaDaka
git checkout https://github.com/biktorrr/KasaDaka.git
sudo reboot now

##Developing your own voice service ###Inner workings In order to start developing your own voice services, is it important to understand the inner workings of the KasaDaka. KasaDaka architecture

When a call is placed, the system executes the following steps (see figure 2):
Text in italics only takes place when setting up the call.

  1. Asterisk receives the call from the GSM dongle, answers the call, and connects it to VXI. Asterisk receives the user's input and forwards it to VXI.
  2. VXI requests the configured VoiceXML document from Apache. VXI requests the configured VoiceXML document from Apache. Together with the request, it sends the user input.
  3. Apache runs the Python program (based on Flask), in which data from the triple store has to be read or written. Python sends the SPARQL query to ClioPatria.
  4. ClioPatria runs the query on the data present, and sends the result of the query back to the Python program.
  5. Python renders the VoiceXML template. The dynamic data is now inserted in the VoiceXML document, and it is sent back to VXI.
  6. VXI starts interpreting the VoiceXML document. In the document there are references to audio files. It sends requests to Apache for the referenced files.
  7. Apache sends a request for the file to the file system.
  8. The file is read from the file system.
  9. Apache responds with the requested audio files.
  10. VXI puts all the audio files in the correct order and plays them back sequentially, sending the audio to the GSM dongle. This cycle repeats until the call is terminated.

###Coding your own service In order to implement your own service, at least the code generating the VoiceXML pages has to be changed, as well as the data in the triple store (Cliopatria). The templates used are explained in the Development Guide. Use the Cliopatria web-interface to remove the sample triples, and upload your own. (user/pass: kasadaka)

####Recommendations for creating your own service An easy way to get started, is to fork this GitHub Repository. Then you can just git checkout your own fork, and work from there. An easy guide on using Git. You can then choose to either edit your files in the VM, or checkout the repository on your own computer, and commit,push your changes; Then pulling them on the VM.

Some (other) tips:

  • Fork the KasaDaka repo, and checkout your own fork in /home/kasadaka/KasaDaka. This way you can quickly test your changes by just pulling them to the VM.
  • Access the generated VXML files in your browser at: 127.0.0.1/FlaskKasadaka/main.vxml
  • Use the Flask development mode. It will automatically reload the web server when it detects a change in the Python files.
  • You can also use a SQL database instead of Cliopatria, or use PHP instead of Python, etc.