<?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>Tyler Kline Consulting</title>
	<atom:link href="http://tylerkline.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://tylerkline.com</link>
	<description></description>
	<lastBuildDate>Fri, 21 Jan 2011 03:29:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>C# TwiML Library</title>
		<link>http://tylerkline.com/2011/01/20/c-twiml-library/</link>
		<comments>http://tylerkline.com/2011/01/20/c-twiml-library/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 02:52:30 +0000</pubDate>
		<dc:creator>Tyler Kline</dc:creator>
				<category><![CDATA[C# Development]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://tylerkline.com/?p=12</guid>
		<description><![CDATA[A project I am currently working on requires integration with Twilio for Voice/IVR capabilities. In addition to very competitive pricing, Twilio offers an extensive API for everything from provisioning numbers to call control.  They use their own custom markup, named TwiML, to handle the majority of the call control functions. I have thrown together a [...]]]></description>
			<content:encoded><![CDATA[<p>A project I am currently working on requires integration with <a href="http://www.twilio.com" target="_blank">Twilio </a>for Voice/IVR capabilities.  In addition to very competitive pricing, Twilio offers an extensive API for everything from provisioning numbers to call control.  They use their own custom markup, named <a href="http://www.twilio.com/docs/api/2010-04-01/twiml/" target="_blank">TwiML</a>, to handle the majority of the call control functions.</p>
<p>I have thrown together a small set of wrapper classes to speed the integration of TwiML, specifically when using ASP.NET on the backend.  The library is MIT Licensed, and if anyone is interested, I can throw a couple of quick samples together on usage.  I am currently not using every TwiML feature in my project (although all functions of the version 2010-04-01 API are supported), so I haven&#8217;t fully tested every inch of code, but I believe it&#8217;s solid.  If not, feel free to tweak as needed and drop me a note with any updates you make.  </p>
<p>Here&#8217;s a little sample of usage:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="csharp"><pre class="de1"><span class="kw1">using</span> <span class="co3">TwiMLSharp</span><span class="sy0">;</span>
&nbsp;
<span class="kw1">protected</span> <span class="kw4">void</span> Page_Load<span class="br0">&#40;</span><span class="kw4">object</span> sender, EventArgs e<span class="br0">&#41;</span>
<span class="br0">&#123;</span>
    <span class="co1">// Get a little info about the call, using the TwiMLRequest</span>
    TwiMLRequest request <span class="sy0">=</span> <span class="kw3">new</span> TwiMLRequest<span class="br0">&#40;</span>Request<span class="sy0">.</span><span class="me1">Form</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="kw4">string</span> caller <span class="sy0">=</span> request<span class="sy0">.</span><span class="kw1">From</span><span class="sy0">;</span>
&nbsp;
    <span class="co1">// Start a response</span>
    TwiMLResponse response <span class="sy0">=</span> <span class="kw3">new</span> TwiMLResponse<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
    <span class="co1">// Say something</span>
    response<span class="sy0">.</span><span class="me1">Say</span><span class="br0">&#40;</span><span class="st0">&quot;Hello, you are calling from &quot;</span> <span class="sy0">+</span> caller<span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
    <span class="co1">// Play a little tune</span>
    response<span class="sy0">.</span><span class="me1">Play</span><span class="br0">&#40;</span><span class="st0">&quot;http://mydomain.com/music.mp3&quot;</span>, <span class="kw1">null</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
    <span class="co1">// Dial out and attempt to transfer, to one of 2 possible numbers</span>
    Dial d <span class="sy0">=</span> response<span class="sy0">.</span><span class="me1">Dial</span><span class="br0">&#40;</span><span class="st0">&quot;http://gohereafter.com&quot;</span>, <span class="kw1">null</span>, <span class="nu0">5</span>, <span class="kw1">null</span>, <span class="kw1">null</span>, <span class="kw1">null</span><span class="br0">&#41;</span><span class="sy0">;</span>
    d<span class="sy0">.</span><span class="me1">Number</span><span class="br0">&#40;</span><span class="st0">&quot;+12125551234&quot;</span>, <span class="kw1">null</span>, <span class="kw1">null</span><span class="br0">&#41;</span><span class="sy0">;</span>
    d<span class="sy0">.</span><span class="me1">Number</span><span class="br0">&#40;</span><span class="st0">&quot;+12125559876&quot;</span>, <span class="kw1">null</span>, <span class="kw1">null</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
    <span class="co1">// Dump the XML to the page</span>
    Response<span class="sy0">.</span><span class="me1">Clear</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    Response<span class="sy0">.</span><span class="me1">Write</span><span class="br0">&#40;</span>response<span class="sy0">.</span><span class="me1">ToXML</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre></div></div></div></div></div></div></div>


<p><span style="font-family: monospace;"><br /></span></p>
<p>Without further adieu, I present <a href="http://tylerkline.com/wp-content/uploads/2011/01/TwiMLSharp.zip">TwiMLSharp</a></p>
<p> </p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/home/?status=C%23+TwiML+Library+http%3A%2F%2Ftylerkline.com%2F%3Fp%3D12" title="Post to Twitter"><img class="nothumb" src="http://tylerkline.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-micro4.png" alt="Post to Twitter" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://digg.com/submit?url=http://tylerkline.com/2011/01/20/c-twiml-library/&amp;title=C%23+TwiML+Library" title="Post to Digg"><img class="nothumb" src="http://tylerkline.com/wp-content/plugins/tweet-this/icons/en/digg/tt-digg-micro4.png" alt="Post to Digg" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://www.facebook.com/share.php?u=http://tylerkline.com/2011/01/20/c-twiml-library/&amp;t=C%23+TwiML+Library" title="Post to Facebook"><img class="nothumb" src="http://tylerkline.com/wp-content/plugins/tweet-this/icons/en/facebook/tt-facebook-micro4.png" alt="Post to Facebook" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://www.myspace.com/Modules/PostTo/Pages/?l=3&amp;u=http://tylerkline.com/2011/01/20/c-twiml-library/&amp;t=C%23+TwiML+Library" title="Post to MySpace"><img class="nothumb" src="http://tylerkline.com/wp-content/plugins/tweet-this/icons/en/myspace/tt-myspace-micro4.png" alt="Post to MySpace" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://tylerkline.com/2011/01/20/c-twiml-library/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
<enclosure url="http://mydomain.com/music.mp3" length="0" type="audio/mpeg" />
		</item>
	</channel>
</rss>

