Coder Social home page Coder Social logo

fax-to-couchdb's Introduction

fax-to-couchdb

Lua script to insert faxes from Freeswitch into existing couchdb database.

How to use

  1. Ensure you have a proper couchdb instance running and working properly. This is your responsibility!
  2. git clone this project into a directory that freeswitch has permissions to.
  • suggestion: $${base_dir}/scripts/lua/fax-to-couchdb
  1. Install luchia, the couchdb library: https://thehunmonkgroup.github.com/luchia
  • You can (and should) use LuaRocks to install this library. On a Debian/Ubuntu system, this can be done like so: sudo apt-get install luarocks luarocks install luchia
  1. Use the example config file (example_config.lua) to set up your server settings. When you change it, save the file as config.lua.
  2. Create your fax extension (if you haven't already done so):
  • This is what mine looks like:
<include>
  <extension name="faxrx">
    <condition field="destination_number" expression="^faxrx$|^/*11$|^3000$">
      <action application="set" data="fax_enable_t38=true"/>
      <action application="set" data="fax_enable_t38_request=true"/>
      <action application="answer"/>
      <action application="playback" data="silence_stream://2000"/>
      <action application="rxfax" data="$${base_dir}/storage/fax/FAX-${uuid}.tif"/>
    </condition>
  </extension>
</include>
  1. Just before the answer application in our extension, we're going to insert this line:
      <action application="set" data="execute_on_fax_result=lua $${base_dir}/lua/fax-to-couchdb/fax-to-couchdb.lua 
         \\\${fax_filename} ${caller_id_name} ${caller_id_number} ${destination_number} \\\${fax_document_transferred_pages} 
         \\\${fax_result_code} \\\${fax_result_text} \\\${fax_transfer_rate} \\\${fax_ecm_used} \\\${fax_bad_rows} 
         ${uuid}"/>

I know, it's long. We're passing variables to the script using this so that we can store these in the database.

  1. Test, test, test. Should work just fine. If not, open up an issue on Github (http://github.com/bdfoster/fax-to-couchdb/issues).

Notes:

The test system used in the development of this script is a Debian-based system. It should work with all linux variants. I cannot guarentee that it will work with Windows anything, as I don't have a Windows-based machine available to me. If you have a suggestion that would make it work on Windows-based systems, open up an issue (using the URL above).

fax-to-couchdb's People

Contributors

bdfoster avatar

Stargazers

Ilya avatar M. Skenderian avatar Kawayi_Hide avatar  avatar Mike Oristian avatar

Watchers

James Cloos avatar  avatar

Forkers

nyfon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.