Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: 0.2.0
Fetching contributors…

Cannot retrieve contributors at this time

292 lines (214 sloc) 9.1 kb
<!DOCTYPE html>
<html>
<head>
<title>connFu Node.js package - DSL for creating real time voice applications using connFu platform</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" media="all" href="docco.css" />
<link rel="stylesheet" media="all" href="stylesheets/sh_style.css" />
<script type="text/javascript" src="javascripts/sh_main.min.js"></script>
<script type="text/javascript" src="javascripts/sh_javascript.min.js"></script>
<style type="text/css">
html {
background: #E4D9BE -webkit-gradient(radial, 50% 50%, 10, 50% 50%, 600, from(#e4d9be), to(#d5c49a));
background: #E4D9BE -moz-radial-gradient(circle , #e4d9be, #d5c49a 100%);
background: #E4D9BE radial-gradient(circle , #e4d9be, #d5c49a 100%);
}
.forkme {
position: absolute;
top: 0;
right: 0;
z-index: 1;
-webkit-transition-property: opacity;
-webkit-transition-duration: 0.2s;
-webkit-transition-timing-function: ease-out;
-moz-transition-property: opacity;
-moz-transition-duration: 0.2s;
-moz-transition-timing-function: ease-out;
}
.forkme:hover {
opacity: 0.6;
}
/** Build status img **/
h1 a img {
padding: 0 0 4px 15px;
}
#container {
width: 750px;
margin: 0 auto;
}
.powered {
border-top: 1px solid #999;
margin-top: 30px;
}
.powered span {
float: left;
padding: 20px 20px 0 0;
}
code {
background-color: #f1e0b6;
padding: 0 2px;
border: 1px solid #dab583;
}
pre code {
background-color: transparent;
padding: 0;
border: none;
}
pre {
margin: 25px 0;
padding: 5px 0 0 15px;
border-left: 5px solid #dab583;
color: #444;
font-weight: normal;
font-style: normal;
}
h2 {
margin-top: 30px;
border-bottom: 1px solid #999;
}
h3 em {
font-weight: normal;
font-size: 14px;
}
a, a:visited {
color: #d11e27;
}
a:hover {
text-decoration: none;
}
</style>
</head>
<body>
<a class="forkme" href="http://github.com/bluevialabs/connfu-node">
<img src="https://a248.e.akamai.net/assets.github.com/img/e6bef7a091f5f3138b8cd40bc3e114258dd68ddf/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub">
</a>
<div id="container">
<h1><img src="images/connfu-logo.png" alt="connFu"></h1><h1>connFu Node.js DSL <a href="http://travis-ci.org/bluevialabs/connfu-node"><img src="https://secure.travis-ci.org/bluevialabs/connfu-node.png" alt="Build Status" title="" /></a></h1>
<p>connfu package provides an easy way to get access to <a href="http://connfu.com">connFu platform</a> using Node.js</p>
<h2>How to install</h2>
<p>The eassiest way is by installing it from the <code>npm</code> repository:</p>
<pre><code>$ npm install connfu
</code></pre>
<p>If you'd prefer to install the latest master version of connFu, you can clone the <code>connfu-node</code> source repository
from GitHub and then install it using <code>npm</code>:</p>
<pre><code>$ git clone "https://github.com/bluevialabs/connfu-node.git"
$ npm install -g connfu-node/
</code></pre>
<h2>How to use it</h2>
<h3>Connecting to streams</h3>
<p>First, require <code>connfu</code> package:</p>
<pre><code>var connFu = require('connfu');
</code></pre>
<p>Next, create a basic application using your connFu API KEY:</p>
<pre><code>var app = connFu.createApp('&lt;your_api_key&gt;');
</code></pre>
<p>Then, attach some event handlers:</p>
<pre><code>app.on("voice", {
join: function(params){
console.log("The number " + params.from + " joined to the conference with number " + params.to);
},
leave: function(params){
console.log("The number " + params.from + " left the conference with number " + params.to);
}
});
</code></pre>
<p>Finally, just listen!</p>
<pre><code>app.listen();
</code></pre>
<h3>Using the CLI</h3>
<p>When you install connFu node package, you get a CLI that allows you to do some common tasks fast and easily:</p>
<p><img src="http://bluevialabs.github.com/connfu-node/images/screenshot_cli.png" alt="CLI interface" title="" /></p>
<h3>Sending commands</h3>
<p>The <code>connFu</code> package can also send commands to handle some aspects of the application:</p>
<pre><code>var connFu = require('connfu');
// Init application
var app = connFu.createApp('&lt;your_api_key&gt;');
// Create a voice channel with a UK number
app.commands.voice().create("conference", "uk", {welcome_message: "Welcome!"}, function(err, data){
// Add a number to the whitelist
app.commands.voice("conference").whitelist().create("+44xxxxxx", "rafeca", function(err, data){
// Update the name of the recently whitelisted number
app.commands.voice("conference").whitelist("+4444xxxxxx").update("the wizard");
});
});
/* (...) */
// Delete the voice channel
app.commands.voice("conference").delete();
</code></pre>
<p>For more thorough examples, look at the following examples</p>
<h2>Examples</h2>
<p><a href="http://bluevialabs.github.com/connfu-node/fancy-connfu-application.html">fancy-connfu-application.js</a> - Very simple application that prints the events received from the streaming API</p>
<p><a href="http://bluevialabs.github.com/connfu-node/growl-notifier.html">growl-notifier.coffee</a> - CoffeeScript application that notfies via Growl the received events</p>
<p><a href="http://bluevialabs.github.com/connfu-node/commands.html">commands.js</a> - Express.js application that exposes all the DSL commands to a RESTful interface</p>
<h2>Running Tests</h2>
<p>To run the test suite first invoke the following command within the repo, installing the development dependencies:</p>
<pre><code>$ npm install --dev
</code></pre>
<p>then run the tests:</p>
<pre><code>$ npm test
</code></pre>
<h2>License</h2>
<p>(The MIT License)</p>
<p>Copyright (c) 2011 Rafael Oleza &lt;roa@tid.es&gt;</p>
<p>Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:</p>
<p>The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<h2>Change Log</h2>
<h3>0.2.0 — <em>October 6, 2011</em></h3>
<ul>
<li>Added <code>connfu</code> CLI to allow fast and easy application manipulation </li>
</ul>
<h3>0.1.1 — <em>October 5, 2011</em></h3>
<ul>
<li><code>connfu-node</code> is now public</li>
<li>Improved documentation</li>
<li>Added <code>gh-pages</code> with a public web page that is generated automatically</li>
<li>Integration with Travis CI service</li>
</ul>
<h3>0.1.0 — <em>Sept 9, 2011</em></h3>
<ul>
<li>Added Twitter provisioning commands</li>
<li>Added multiple phone number provisioning commands</li>
<li>Added the new optional parameters to voice channels (welcome messages and privacy)</li>
<li>Fixed bug in getAllVoiceChannels() command</li>
<li>Updated connFu hostnames to the pre-release ones</li>
<li>Improved the example applications</li>
<li>Added a new CoffeeScript example application that shows events in Growl</li>
<li>Added inline documentation to example applications</li>
</ul>
<h3>0.0.4 — <em>August 24, 2011</em></h3>
<ul>
<li>Added the ability to send RSS commands via the connFu REST API</li>
<li>Standarized the format of the events data</li>
<li>Added autotest feature to ease the BDD development</li>
</ul>
<h3>0.0.3 — <em>July 28, 2011</em></h3>
<ul>
<li>Added the ability to send voice commands via the connFu REST API</li>
</ul>
<h3>0.0.2 — <em>July 27, 2011</em></h3>
<ul>
<li>Added a logging system to ease the debugging</li>
</ul>
<h3>0.0.1 — <em>July 26, 2011</em></h3>
<ul>
<li>Initial release</li>
</ul>
<p class="powered"><span>Powered by: </span><a href="http://bluevia.com" title="Bluevia Labs"><img src="images/bluevia-logo.png" alt="Bluevia Labs"></a>
</div>
<script type="text/javascript">sh_highlightDocument();</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.