<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>OpenVBX Blog &#187; account</title>
	<atom:link href="http://blog.openvbx.org/tag/account/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.openvbx.org</link>
	<description></description>
	<lastBuildDate>Fri, 27 Apr 2012 20:44:03 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Twilio Connect &amp; Presence in OpenVBX</title>
		<link>http://blog.openvbx.org/2011/09/twilio-connect-presence-in-openvbx/</link>
		<comments>http://blog.openvbx.org/2011/09/twilio-connect-presence-in-openvbx/#comments</comments>
		<pubDate>Wed, 21 Sep 2011 20:11:15 +0000</pubDate>
		<dc:creator>Shawn Parker</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[account]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[billing]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[connect]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[minify]]></category>
		<category><![CDATA[mysqli]]></category>
		<category><![CDATA[openvbx]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[presence]]></category>
		<category><![CDATA[twilio]]></category>

		<guid isPermaLink="false">http://blog.openvbx.org/?p=766</guid>
		<description><![CDATA[If you haven&#8217;t heard yet, Twilio Conference is in full swing and we here at Twilio just announced the availability of Twilio Connect and Presence for Twilio Client. Two fantastic additions to the Twilio family of products. Available today as well is an updated preview of OpenVBX 1.1 that includes support for both Connect &#038; [...]]]></description>
				<content:encoded><![CDATA[<p>If you haven&#8217;t heard yet, Twilio Conference is in full swing and we here at Twilio just announced the availability of <a href="http://www.twilio.com/api/connect">Twilio Connect</a> and <a href="http://www.twilio.com/docs/client/device#presence-handler">Presence for Twilio Client</a>. Two fantastic additions to the Twilio family of products.</p>
<p>Available today as well is an updated preview of OpenVBX 1.1 that includes support for both Connect &#038; Presence. You can now offer service based on OpenVBX without having to directly bill clients for usage and your plugins can listen to Presence events to better help your users communicate.</p>
<p><span id="more-766"></span></p>
<h3 id="connect">Twilio Connect</h3>
<p><a href="http://blog.openvbx.org/wp-content/uploads/2011/09/twilio-connect-button.png"><img src="http://blog.openvbx.org/wp-content/uploads/2011/09/twilio-connect-button.png" alt="" title="twilio-connect-button" width="423" height="86" class="aligncenter size-full wp-image-771" /></a></p>
<p>With Twilio Connect you can sign up new Tenants to communicate using your OpenVBX install but not have to deal with the billing. All of that is passed on to the Tenant&#8217;s Twilio account.</p>
<p>To use Twilio Connect simply go to your <a href="https://www.twilio.com/user/account">Twilio Account</a>, click on the Apps sub-navigation item and then again on the Connect Apps tab. Here you can create a Connect Application that other Twilio Account holders can connect to via your OpenVBX install.</p>
<p>Enter a Name and a Company Name. In the required URL fields simply enter the base url to your OpenVBX install. When you save your credentials in OpenVBX these will be updated for you. After saving the information copy the Connect Application Sid that is provided.</p>
<p>Back in your OpenVBX install navigate to the Settings section and click on The Twilio Account tab. Enter your Connect App Sid in the space provided. You&#8217;ll now be given the choice to create new Tenants using Twilio Connect as the billing mechanism.</p>
<div class="notice">
<p>At this time there is no way to convert existing tenants. This functionality is being explored for the near future.</p>
</div>
<p>When a newly created Connect enabled Tenant signs in for the first time they&#8217;ll be promted to authenticate to your application. If they do not yet have a Twilio Account they&#8217;ll be able to set one up right there.</p>
<p>Upon acceptance of the Connect agreement they&#8217;ll be granted access to your OpenVBX install. If they ever revoke access to your account they&#8217;ll be denied access after log-in to OpenVBX, but the Tenant Administrator will be able to re-connect the Application and pick up right where they left off.</p>
<p>And that&#8217;s it. There&#8217;s no special UI, no special permissions to manage. Your Connect Tenants work just like your regular Tenants.</p>
<h3 id="presence">Twilio Client Presence</h3>
<p><a href="http://blog.openvbx.org/wp-content/uploads/2011/09/openvbx-presence-screenshot.jpg"><img src="http://blog.openvbx.org/wp-content/uploads/2011/09/openvbx-presence-screenshot.jpg" alt="" title="openvbx-presence-screenshot" width="695" height="319" class="aligncenter size-full wp-image-780" /></a></p>
<p>With the addition of Presence to Twilio Client OpenVBX can now be smarter about how it connects you to other users in the OpenVBX install. </p>
<p>The Call button in the interface now not only allows you to dial numbers, but it also reveals a list of users in your install and provides a quick dial button for each user. If that user is online with Twilio Client they&#8217;ll be dialed in their browser. If they&#8217;re not online they&#8217;ll be contacted using their primary device.</p>
<h3 id="other-changes">Other Changes</h3>
<p>While Twilio Connect &#038; Presence are the big announcments with this preview there are a few other underlying changes. </p>
<p>This release builds on the previous preview that replaced the internal API communication with Twilio as well as replacing the TwiML generation process. These changes are most likely breaking changes for many plugin developers. We encourage all plugin developers to test against this new code.</p>
<p>This new preview also replaces the use of pre-compiled CSS &#038; Javascript assets with <a href="http://code.google.com/p/minify/">Minify.php</a>. This was done to help make us more compatible and enable OpenVBX to runn well in many different environments. Another blog post is forthcoming to explain the benefits of this new approach and how to get your customized OpenVBX install to add its own assets and gain the benefit of minified Javascript and CSS delivery.</p>
<p>We&#8217;ve also upgrade the installer to use <a href="http://us.php.net/mysqli">MySQLi driver in PHP</a> when available. This should be invisible behind the scenes.</p>
<h3 id="download-preview">Downloading the Preview</h3>
<div class="notice">
<p>This code should not be run in production and is meant for developers to ready their code for a major change. This code may contain bugs that adversely affect data and should not be run in production. Work on a copy of your install and be sure to back up the database first.</p>
</div>
<p>The preview version is located in the GitHub repository in the <a href="https://github.com/twilio/OpenVBX/tree/develop">develop branch</a>. You can check out or branch the preview or simply download the <a href="https://github.com/twilio/OpenVBX/tarball/develop">tarball</a> or the <a href="https://github.com/twilio/OpenVBX/zipball/develop">zip file</a>.</p>
<p>We&#8217;re working hard to test all cases and squash any remaining bugs, but with our goal of supporting many different hosting environments we are constantly encountering areas where we can improve OpenVBX&#8217;s compatibilty. We encourage you to help us by testing OpenVBX on different environments and submitting your bug reports.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.openvbx.org/2011/09/twilio-connect-presence-in-openvbx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Twilio-PHP REST API library available in OpenVBX preview release</title>
		<link>http://blog.openvbx.org/2011/09/new-twilio-php-rest-api-library-preview-release/</link>
		<comments>http://blog.openvbx.org/2011/09/new-twilio-php-rest-api-library-preview-release/#comments</comments>
		<pubDate>Wed, 07 Sep 2011 17:07:36 +0000</pubDate>
		<dc:creator>Shawn Parker</dc:creator>
				<category><![CDATA[Beta]]></category>
		<category><![CDATA[Releases]]></category>
		<category><![CDATA[account]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[helper]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[openvbx]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[response]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[twiml]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[version]]></category>

		<guid isPermaLink="false">http://blog.openvbx.org/?p=741</guid>
		<description><![CDATA[A preview release of OpenVBX v1.1 containing the new Twilio-PHP REST API helper library is now available in GitHub. With streamlined interfaces, this new helper library makes it easier than ever to access the Twilio API from within OpenVBX. In this post I&#8217;ll walk through the changes that were made in OpenVBX and provide examples [...]]]></description>
				<content:encoded><![CDATA[<p>A preview release of OpenVBX v1.1 containing the new <a href="https://github.com/twilio/twilio-php">Twilio-PHP REST API</a> helper library is now available in GitHub.  With streamlined interfaces, this new helper library makes it easier than ever to access the Twilio API from within OpenVBX. </p>
<p>In this post I&#8217;ll walk through the changes that were made in OpenVBX and provide examples of how to work with the new functionality.</p>
<p><span id="more-741"></span></p>
<h3 id="services-twilio">Services_Twilio</h3>
<p>The new <code>Services_Twilio</code> library replaces <code>TwilioRestClient</code>.  <code>Services_Twilio</code> is accessed via the <code>OpenVBX</code> convenience wrapper. To get a copy of an account object simply use <code>OpenVBX::getAccount()</code>. The account object is automatically returned for the current account or tenant sub-account.</p>
<p>Let&#8217;s see it in action. Here&#8217;s how to send an SMS message using the new library:</p>
<p><code class="php">
<pre>&lt;?php

$from = '+19990001111';
$to = '+19992223333';
$message = 'SMS Message Content';

$account = OpenVBX::getAccount();
$account->sms_message-&gt;create($from, $to, $message);

?&gt;</pre>
<p></code></p>
<p>Documentation on using the <code>Services_Twilio</code> library can be found in the <a href="http://readthedocs.org/docs/twilio-php/en/latest/">User Guide</a>.</p>
<h3 id="twiml-response">TwimlResponse</h3>
<p>TwimlResponse replaces TwilioRestResponse and provides an interface to Services_Twilio_Twiml as provided by the Services_Twilio library.</p>
<p>TwimlResponse acts the same as Services_Twilio_Twiml as well as provides a helper respond() method that mimics the old Respond method on TwilioRestResponse.</p>
<p>Here is how to generate a TwiML response with TwimlResponse:</p>
<p><code class="php">
<pre>&lt;?php

$response = new TwimlResponse;
$response-&gt;say('I am a robot, you want to talk to a human.');
$response-&gt;dial('+14158675309');
$response-&gt;respond();

?&gt;</pre>
<p></code></p>
<p>Documentation on generating TwiML can be found in the <a href="http://readthedocs.org/docs/twilio-php/en/latest/usage/twiml.html">Services_Twilio_Twiml TwiML Guide</a>.</p>
<h3 id="deprecated-get-verb-for-value">Deprecated Method AudioSpeechPickerWidget::getVerbForValue()</h3>
<p>The new method of constructing responses required a change to the way that the <code>AudioSpeechPickerWidget</code> object is used to help build TwiML responses.</p>
<p>Getting <code>AudioSpeechPickerWidget</code> values now looks like:</p>
<p><code class="php">
<pre>&lt;?php

$response = new TwimlResponse;

$prompt = AppletInstance::getAudioSpeechPickerValue('prompt');
AudioSpeechPickerWidget::setVerbForvalue($prompt, $response);

$response-&gt;respond();

?&gt;</pre>
<p></code></p>
<h3 id="request-validation">Request Validation</h3>
<p>All requests from Twilio are now validated using the <code>HTTP_X_TWILIO_SIGNATURE</code> signature that is passed along with Twilio Requests. This validation is provided through the new <code>Services_Twilio_RequestValidator</code> object.</p>
<p>If you&#8217;re responding to requests outside of the <code>Twiml</code> or <code>AudioFiles</code> Controllers then you should validate the requests before you process them. Validating a Twilio Request is as easy as:</p>
<p><code class="php">
<pre>&lt;?php

validate_rest_request();

?&gt;</pre>
<p></code></p>
<p>TwiML will automatically be generated to respond with an error message. If you&#8217;d like more control over the process you can do that as well:</p>
<p><code class="php">
<pre>&lt;?php

if (!OpenVBX::validateRequest()) {
	// failure notice
}
else {
	// authenticated code
}

?&gt;</pre>
<p></code></p>
<h3 id="new-helper-file">New Helper File</h3>
<p>A new helper file has been included with OpenVBX to provide some easy access to validating requests and cleaning digits that come in with requests. So, to combine both helper functions in to a single example we&#8217;ll process a response from Twilio in which a user entered Digits in response to a prompt:</p>
<p><code class="php">
<pre>&lt;?php

// if the request is forged it'll be stopped here
validate_rest_request();

$ci =&amp; get_instance();
$digits = clean_digits($ci-&gt;input-&gt;get_post('Digits'));

$response = new TwimlResponse;

switch ($digits) {
	case 1:
		// handle user entering 1
		$response-&gt;say('You entered one');
		break;
	case '*':
		// handle user entering the star symbol
		$response-&gt;say('You entered star');
		break;
	default:
		// default fallback for unexpected response
		$response-&gt;say("I'm sorry, I don't understand your response.");
		break;
}

$response-&gt;respond();
?&gt;</pre>
<p></code></p>
<h3 id="upgrading-your-code">Upgrading to the New Twilio PHP Library</h3>
<p>Since the new library required significant code changes, the old libraries have been deprecated but left in place instead of being removed. This means that your existing code should continue to work even if you don&#8217;t upgrade your plugins right away. The older libraries are slated for removal in a future version, but no date has been set.</p>
<div class="notice">
<p>Use of the old library will trigger a PHP <code>E_WARNING</code> message. If your application is set to display error messages (and it really should not be in production) these warnings will break your TwiML responses.</p>
</div>
<h3 id="php-version-requirement">PHP Version Requirement</h3>
<p>Support for PHP versions earlier than 5.2 will be dropped in Version 1.1.</p>
<div class="notice">
<p>This version of OpenVBX will not install or upgrade on older versions of PHP.</p>
</div>
<p>If you want to continue using future versions of OpenVBX and are running a version less than 5.2 you&#8217;ll need to talk to your Hosting Provider about upgrading your PHP Version. Most hosts are receptive about doing so if you&#8217;re currently on an older version.</p>
<h3 id="test-coverage">Test Coverage</h3>
<p>Beginning with Version 1.1 we&#8217;re creating integration tests using <a href="http://www.foostack.com/foostack/">fooStack</a> &amp; <a href="https://github.com/sebastianbergmann/phpunit/">PHPUnit</a>. These test will live in <code>/OpenVBX/tests</code>. Integration tests are starting with Applets as they are the most critical part of the system to test when things change. Code coverage is low at the moment but we&#8217;re pushing hard to get this increased quickly.</p>
<p>Due to the challenges of integration testing with a framework stack like CodeIgniter, we require Reflection functionality introduced in PHP 5.3 in order to run tests. The tests will refuse to run on earlier versions of PHP.</p>
<p>Also, due to restrictions on setting up the test environment for proper operation, the tests can only be executed by opening <code>/OpenVBX/tests/AllTests.php</code>.</p>
<h3 id="download-preview">Downloading the Preview</h3>
<div class="notice">
<p>Work on a copy of your install and be sure to back up the database first. This code should not be run in production and is meant for developers to ready their code for a major change. This code may contain bugs that adversely affect data and should not be run in production.</p>
<p><b>This will break the TwiML delivery in your plugins as well as cause deprecation notices on your API calls to Twilio.</b></p>
</div>
<p>The preview version is located in the GitHub repository in the <a href="https://github.com/twilio/OpenVBX/tree/develop">develop branch</a>. You can check out or branch the preview or simply download the <a href="https://github.com/twilio/OpenVBX/tarball/develop">tarball</a> or the <a href="https://github.com/twilio/OpenVBX/zipball/develop">zip file</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.openvbx.org/2011/09/new-twilio-php-rest-api-library-preview-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
