Ruby Example Code
Overview
-
A very basic Ruby code sample that will allows to send a fax to the Multitech Fax Finder device using API interface.
Prerequisites
- This should work on any Ruby version 1.8.6 or newer. This was tested with Ruby Interpreter 1.9.2-p0 RubyInstaller on Windows at http://www.ruby-lang.org/en/downloads/ (Please test this)
- Download the Ruby sample source code SendFax-Ruby.zip here. (Use CGIT instead)
Notes: The SendFax-Ruby.zip contained two files:
- sendfax.rb.
- schedule.xml.
Modify schedule.xml
Load the schedule.xml file into your favorite editor, find the section below, and modify the fax number to point to your recipient fax number:
<recipient>
...
<fax_number>5138 </fax_number>
</recipient>
Save it.
Run sendfax.rb
Change the script so that it takes parameters for hostname and username and password.
Then just say to run it from the command line like:
ruby sendfax.rb ip_address username password
Now, if you web into your FaxFinder device and go to Status & Log -> Fax Status, you should be able to see the Fax Finder is sending out a fax.