Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Augmenting Web Services with SMS and XMPP <ul><li>Adding Channels such as SMS and XMPP to traditional HTTP services </li><...
About Me <ul><li>Sam Keen [email_address] , @samkeen </li></ul><ul><li>Originally a Java (J2EE) developer Escaped that for...
Talk Summary <ul><li>Advantages of adding these channels </li></ul><ul><li>Overview of SMS and XMPP </li></ul><ul><li>Expl...
Motivation Laziness
Why (users) <ul><li>The mobile generation is growing accustomed to  passive aggressive connectivity </li></ul><ul><li>Mobi...
Why (devices) <ul><li>More and more, Web sites services are accessed through mobile devices </li></ul><ul><li>Device capab...
Why SMS <ul><li>Low Attention Requirement </li></ul><ul><li>All modern phone support it </li></ul>Even this phone has SMS ...
SMS Downside
SMS Downside <ul><li>Some might say: “SMS is controlled by Evil Empires” </li></ul><ul><li>$$$ to implement on your own </...
Why XMPP <ul><li>Open Standard </li></ul><ul><li>Its all about the X (extendable) </li></ul><ul><ul><li>Presence, multi-us...
Why XMPP It makes SMS look like:
Extapi <ul><li>Centralized Service and Channel Adaption Manager </li></ul><ul><li>Currently Implemented as a PHP LAMP stac...
What Extapi Needs to do <ul><li>Map given request params to a common set of values for a given channel </li></ul><ul><li>p...
Architecture Goal Web Service X HTTP Users
Architecture Goal Web Service X XMPP SMS Channel N HTTP Users
Architecture Channels SMS XMPP Services Trimet Twitter Service X Channel X Extapi App Server Clients HTTP
Architecture Channels SMS XMPP Services Trimet Twitter Service X Channel X Clients HTTP
Extapi Structure MVC Container Aabot App Static Vendor Extapi Built in the style of a Vendor plugin.  Currently within the...
Channels <ul><li>Purpose is to take and existing protocol (XMPP, SMS), and convert to HTTP.  Then forward the message to t...
Implementing an SMS Channel <ul><ul><li>Shortcode Shares: Multiple users share a single shortcode managed by a Shortcode s...
SMS Shortcode SharesFREE! There are concessions to be made for all the “Freeness”
<ul><li>SMS SS will typically append ~20 char teaser  ads  to client bound messages </li></ul>SMS Shortcode SharesFREE! Th...
<ul><li>SMS SS will typically append ~20 char teaser  ads  to client bound messages </li></ul><ul><li>Your app context liv...
SMS Shortcode Shares <ul><li>They blackbox the entire telco infrastructure </li></ul><ul><li>Provide a familiar HTTP API i...
Shortcode Share Architecture Extapi (or any web app) mobile carrier Users Short Code Share HTTP HTTP
Shortcode Shares <ul><li>Textmarks: Mature, feature rich </li></ul><ul><li>Zeep: New kid on the block </li></ul><ul><li>Do...
Dotgo <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?><cmrl xmlns:dotgo=&quot; http://dotgo.com/cmrl/1.0 &quot;>...
Channel: XMPP <ul><li>Many Server Choices:   http://xmpp.org/software/servers.shtml </li></ul><ul><li>I chose the Hometown...
Example XMPP Channel Architecture Users Extapi XMPP Server (Openfire) X2Http Plugin HTTP XMPP
X2Http Openfire plugin
Example: TransitTracker ® Currently offers web access, WAP, and IVR These all require the user to be highly engaged with t...
SMS & XMPP added to TransitTracker ® <ul><li>Less attention required, input stop id and then your device has all sorts of ...
Trimet over SMS
Trimet over XMPP
Yes It Is Alpha code
Review: What Extapi Needs to do <ul><li>Map given request params to a common set of values for a given channel </li></ul><...
Extapi: Base Class for a channel Extapi Channels class Extapi_Channel_Base /** * @return boolean */ public function have_r...
Extapi: Base Class for a Service Extapi Service class Extapi_Service_Base public abstract function parse_request_statement...
<ul><li>private function  sms_receiver() { </li></ul><ul><li>$this ->use_layout =  false ; </li></ul><ul><li>$requesting_c...
<ul><li>private function  sms_receiver() { </li></ul><ul><li>$this->use_layout = false; </li></ul><ul><li>$requesting_chan...
<ul><li>private function  sms_receiver() { </li></ul><ul><li>$this->use_layout = false; </li></ul><ul><li>$requesting_chan...
<ul><li>private function  sms_receiver() { </li></ul><ul><li>$this->use_layout = false; </li></ul><ul><li>$requesting_chan...
<ul><li>private function  xmpp_receiver() { </li></ul><ul><li>$this ->use_layout =  false ; </li></ul><ul><li>$requesting_...
<ul><li>private function  xmpp_receiver() { </li></ul><ul><li>$this->use_layout = false; </li></ul><ul><li>$requesting_cha...
<ul><li>private function  xmpp_receiver() { </li></ul><ul><li>$this->use_layout = false; </li></ul><ul><li>$requesting_cha...
<ul><li>private function  xmpp_receiver() { </li></ul><ul><li>$this->use_layout = false; </li></ul><ul><li>$requesting_cha...
Talking to Machines <ul><li>Examples so far have been very limited,  our statement to the Machine is just a number </li></...
Bridge Language <ul><li>A bridge language helps the machine by adding ‘token markers’ and limiting the vocabulary set </li...
HAMDL <ul><li>Bridge language meant to be an open standard to help unify some of these ‘pico formats’ </li></ul><ul><li>Ma...
Future <ul><li>Channels </li></ul><ul><ul><li>OpenCV visual channel </li></ul></ul><ul><ul><li>barcode channel </li></ul><...
Sources <ul><li>XMPP:  http://xmpp.org / </li></ul><ul><li>XMPP Servers:  http://xmpp.org/software/servers.shtml </li></ul...
Upcoming SlideShare
Loading in …5
×

Augmenting Web Services with SMS and XMPP

5,423 views

Published on

Adding Channels such as SMS and XMPP to traditional HTTP services

Published in: Technology, Business
  • Be the first to comment

Augmenting Web Services with SMS and XMPP

  1. 1. Augmenting Web Services with SMS and XMPP <ul><li>Adding Channels such as SMS and XMPP to traditional HTTP services </li></ul>
  2. 2. About Me <ul><li>Sam Keen [email_address] , @samkeen </li></ul><ul><li>Originally a Java (J2EE) developer Escaped that for PHP ~2003 </li></ul><ul><li>Founded and have been running PDXPHP for about 4 years </li></ul><ul><li>currently employed at finedesigngroup.com/ </li></ul>
  3. 3. Talk Summary <ul><li>Advantages of adding these channels </li></ul><ul><li>Overview of SMS and XMPP </li></ul><ul><li>Explain Extapi (my take on implementing these channels) </li></ul><ul><li>Example Service: Trimet TransitTracker ® </li></ul><ul><li>Teaching humans to speak Machine: HAMDL </li></ul><ul><li>Future </li></ul>
  4. 4. Motivation Laziness
  5. 5. Why (users) <ul><li>The mobile generation is growing accustomed to passive aggressive connectivity </li></ul><ul><li>Mobile users are loosely engaged with services </li></ul><ul><li>For many services, users want information and do not want ‘experience’ to get in the way </li></ul>
  6. 6. Why (devices) <ul><li>More and more, Web sites services are accessed through mobile devices </li></ul><ul><li>Device capability </li></ul><ul><ul><li>A subset of devices have data access ability </li></ul></ul><ul><ul><li>Of those devices, a small percentage provide an acceptable degree of usability </li></ul></ul>
  7. 7. Why SMS <ul><li>Low Attention Requirement </li></ul><ul><li>All modern phone support it </li></ul>Even this phone has SMS ability
  8. 8. SMS Downside
  9. 9. SMS Downside <ul><li>Some might say: “SMS is controlled by Evil Empires” </li></ul><ul><li>$$$ to implement on your own </li></ul><ul><li>Very limited capability </li></ul>SMS
  10. 10. Why XMPP <ul><li>Open Standard </li></ul><ul><li>Its all about the X (extendable) </li></ul><ul><ul><li>Presence, multi-user chat, SOAP over XMPP, Jingle (voice, video, file) , oauth over XMPP, ... </li></ul></ul><ul><li>http://xmpp.org/extensions/ </li></ul><ul><li>Ease of implementation </li></ul>
  11. 11. Why XMPP It makes SMS look like:
  12. 12. Extapi <ul><li>Centralized Service and Channel Adaption Manager </li></ul><ul><li>Currently Implemented as a PHP LAMP stack </li></ul><ul><li>Enables you to extend the number of channels available to a web service </li></ul><ul><li>Goal is to enable new services and channels by way of configuration (little or no code) </li></ul>
  13. 13. What Extapi Needs to do <ul><li>Map given request params to a common set of values for a given channel </li></ul><ul><li>parse/authenticate request </li></ul><ul><li>make the request to the target web service </li></ul><ul><li>parse the response from the web service </li></ul><ul><li>sent the response back through the channel to the client </li></ul>
  14. 14. Architecture Goal Web Service X HTTP Users
  15. 15. Architecture Goal Web Service X XMPP SMS Channel N HTTP Users
  16. 16. Architecture Channels SMS XMPP Services Trimet Twitter Service X Channel X Extapi App Server Clients HTTP
  17. 17. Architecture Channels SMS XMPP Services Trimet Twitter Service X Channel X Clients HTTP
  18. 18. Extapi Structure MVC Container Aabot App Static Vendor Extapi Built in the style of a Vendor plugin. Currently within the Aabot MVC container. Can also be adapted for containers such as CakePHP Channels Services
  19. 19. Channels <ul><li>Purpose is to take and existing protocol (XMPP, SMS), and convert to HTTP. Then forward the message to the Extapi server </li></ul><ul><li>So after querying a http web service Extapi can then send replies back through the channel via HTTP, or short circuit directly to the originator if it can speak the originating protocol. </li></ul>
  20. 20. Implementing an SMS Channel <ul><ul><li>Shortcode Shares: Multiple users share a single shortcode managed by a Shortcode share company </li></ul></ul><ul><li>Shortcode Shares are the cheapest, bi-directional, most reliable way to get started. </li></ul>
  21. 21. SMS Shortcode SharesFREE! There are concessions to be made for all the “Freeness”
  22. 22. <ul><li>SMS SS will typically append ~20 char teaser ads to client bound messages </li></ul>SMS Shortcode SharesFREE! There are concessions to be made for all the “Freeness”
  23. 23. <ul><li>SMS SS will typically append ~20 char teaser ads to client bound messages </li></ul><ul><li>Your app context lives under a keyword on the provider’s shortcode ex: you text “ myapp my message ” to shortcode 123456 rather than just texting “ my message ” to shortcode 123456 </li></ul>SMS Shortcode SharesFREE! There are concessions to be made for all the “Freeness”
  24. 24. SMS Shortcode Shares <ul><li>They blackbox the entire telco infrastructure </li></ul><ul><li>Provide a familiar HTTP API interface to the developer </li></ul><ul><li>They manage user registration and opt out </li></ul>There are also benefits
  25. 25. Shortcode Share Architecture Extapi (or any web app) mobile carrier Users Short Code Share HTTP HTTP
  26. 26. Shortcode Shares <ul><li>Textmarks: Mature, feature rich </li></ul><ul><li>Zeep: New kid on the block </li></ul><ul><li>Dotgo: Different Beast </li></ul>A Few Options
  27. 27. Dotgo <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?><cmrl xmlns:dotgo=&quot; http://dotgo.com/cmrl/1.0 &quot;> <match pattern=&quot;*&quot;> <engine href=&quot; http://example.com/servic e.php &quot;/> OR <message> <content>Hello world!</content> </message> </match></cmrl>
  28. 28. Channel: XMPP <ul><li>Many Server Choices: http://xmpp.org/software/servers.shtml </li></ul><ul><li>I chose the Hometown crew: Openfire </li></ul><ul><ul><li>very easy to setup </li></ul></ul><ul><ul><li>easy to extend (if you know a little Java) </li></ul></ul><ul><ul><li>Well documented and supported </li></ul></ul><ul><ul><li>Lots of example Plugin code </li></ul></ul>
  29. 29. Example XMPP Channel Architecture Users Extapi XMPP Server (Openfire) X2Http Plugin HTTP XMPP
  30. 30. X2Http Openfire plugin
  31. 31. Example: TransitTracker ® Currently offers web access, WAP, and IVR These all require the user to be highly engaged with the service
  32. 32. SMS & XMPP added to TransitTracker ® <ul><li>Less attention required, input stop id and then your device has all sorts of ways to alert you with the reply </li></ul><ul><li>SMS has wide reach, XMPP has decent reach + extended capability </li></ul>
  33. 33. Trimet over SMS
  34. 34. Trimet over XMPP
  35. 35. Yes It Is Alpha code
  36. 36. Review: What Extapi Needs to do <ul><li>Map given request params to a common set of values for a given channel </li></ul><ul><li>Parse/Authenticate request </li></ul><ul><li>make the request to the target web service </li></ul><ul><li>parse the response from the web service </li></ul><ul><li>sent the response back through the channel to the client </li></ul>
  37. 37. Extapi: Base Class for a channel Extapi Channels class Extapi_Channel_Base /** * @return boolean */ public function have_required_request_params() /** * @return boolean */public abstract function authenticate_request();
  38. 38. Extapi: Base Class for a Service Extapi Service class Extapi_Service_Base public abstract function parse_request_statement();public abstract function act_on_request_statement();public abstract function gather_feedback();
  39. 39. <ul><li>private function sms_receiver() { </li></ul><ul><li>$this ->use_layout = false ; </li></ul><ul><li>$requesting_channel = $this ->next_request_segment_value(); </li></ul><ul><li>header( 'Content-type: text/plain' , true ); </li></ul><ul><li>$sms_channel = Util_VendorFactory::get_instance( 'extapi/channel/' </li></ul><ul><ul><li>. $requesting_channel ); </li></ul></ul><ul><li>if ( $sms_channel && $sms_channel ->have_required_request_params() </li></ul><ul><ul><li>&& $sms_channel ->authenticate_request()) { </li></ul></ul><ul><li>ENV::load_vendor_file( 'Extapi/Service/Tmet' ); </li></ul><ul><li>$tmet_service = new Extapi_Service_Tmet( $sms_channel ); </li></ul><ul><li>$tmet_service ->parse_request_statement(); </li></ul><ul><li>$tmet_service ->act_on_request_statement(); </li></ul><ul><li>if ( $tmet_service ->has_feedback()) { </li></ul><ul><li>$arrivals = $tmet_service ->gather_feedback(); </li></ul><ul><li>$this ->payload->arrivals = array_get_else( $arrivals , 'arrivals' ); </li></ul><ul><li>$this ->payload->transit_stop = array_get_else( $arrivals , 'transit_stop' ); </li></ul><ul><li>$this ->payload->query_time = array_get_else( $arrivals , 'query_time' ); </li></ul><ul><li>} else { </li></ul><ul><li>$this ->viewless(); </li></ul><ul><li>} </li></ul><ul><li>} else { </li></ul><ul><li>if (! $sms_channel ) { </li></ul><ul><li>ENV:: $log ->error(__METHOD__. ' Util_VendorFactory::get_instance ... </li></ul><ul><ul><li>} else { </li></ul></ul><ul><li>ENV:: $log ->notice(__METHOD__. ' Required components were not ... </li></ul><ul><ul><li>} </li></ul></ul><ul><li>$this ->viewless(); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  40. 40. <ul><li>private function sms_receiver() { </li></ul><ul><li>$this->use_layout = false; </li></ul><ul><li>$requesting_channel = $this ->next_request_segment_value(); </li></ul><ul><li>header('Content-type: text/plain',true); </li></ul><ul><li>$sms_channel = Util_VendorFactory::get_instance( 'extapi/channel/' </li></ul><ul><ul><li>. $requesting_channel ); </li></ul></ul><ul><li>if ($sms_channel && $sms_channel->have_required_request_params() </li></ul><ul><ul><li>&& $sms_channel->authenticate_request()) { </li></ul></ul><ul><li>ENV::load_vendor_file('Extapi/Service/Tmet'); </li></ul><ul><li>$tmet_service = new Extapi_Service_Tmet($sms_channel); </li></ul><ul><li>$tmet_service->parse_request_statement(); </li></ul><ul><li>$tmet_service->act_on_request_statement(); </li></ul><ul><li>if ($tmet_service->has_feedback()) { </li></ul><ul><li>$arrivals = $tmet_service->gather_feedback(); </li></ul><ul><li>$this->payload->arrivals = array_get_else($arrivals,'arrivals'); </li></ul><ul><li>$this->payload->transit_stop = array_get_else($arrivals,'transit_stop'); </li></ul><ul><li>$this->payload->query_time = array_get_else($arrivals,'query_time'); </li></ul><ul><li>} else { </li></ul><ul><li>$this->viewless(); </li></ul><ul><li>} </li></ul><ul><li>} else { </li></ul><ul><li>if (! $sms_channel) { </li></ul><ul><li>ENV::$log->error(__METHOD__.' Util_VendorFactory::get_instance ... </li></ul><ul><ul><li>} else { </li></ul></ul><ul><li>ENV::$log->notice(__METHOD__.' Required components were not ... </li></ul><ul><ul><li>} </li></ul></ul><ul><li>$this->viewless(); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  41. 41. <ul><li>private function sms_receiver() { </li></ul><ul><li>$this->use_layout = false; </li></ul><ul><li>$requesting_channel = $this->next_request_segment_value(); </li></ul><ul><li>header('Content-type: text/plain',true); </li></ul><ul><li>$sms_channel = Util_VendorFactory::get_instance('extapi/channel/' </li></ul><ul><ul><li>.$requesting_channel); </li></ul></ul><ul><li>if ( $sms_channel && $sms_channel ->have_required_request_params() </li></ul><ul><ul><li>&& $sms_channel ->authenticate_request()) { </li></ul></ul><ul><li>ENV::load_vendor_file('Extapi/Service/Tmet'); </li></ul><ul><li>$tmet_service = new Extapi_Service_Tmet($sms_channel); </li></ul><ul><li>$tmet_service->parse_request_statement(); </li></ul><ul><li>$tmet_service->act_on_request_statement(); </li></ul><ul><li>if ($tmet_service->has_feedback()) { </li></ul><ul><li>$arrivals = $tmet_service->gather_feedback(); </li></ul><ul><li>$this->payload->arrivals = array_get_else($arrivals,'arrivals'); </li></ul><ul><li>$this->payload->transit_stop = array_get_else($arrivals,'transit_stop'); </li></ul><ul><li>$this->payload->query_time = array_get_else($arrivals,'query_time'); </li></ul><ul><li>} else { </li></ul><ul><li>$this->viewless(); </li></ul><ul><li>} </li></ul><ul><li>} else { </li></ul><ul><li>if (! $sms_channel) { </li></ul><ul><li>ENV::$log->error(__METHOD__.' Util_VendorFactory::get_instance ... </li></ul><ul><ul><li>} else { </li></ul></ul><ul><li>ENV::$log->notice(__METHOD__.' Required components were not ... </li></ul><ul><ul><li>} </li></ul></ul><ul><li>$this->viewless(); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  42. 42. <ul><li>private function sms_receiver() { </li></ul><ul><li>$this->use_layout = false; </li></ul><ul><li>$requesting_channel = $this->next_request_segment_value(); </li></ul><ul><li>header('Content-type: text/plain',true); </li></ul><ul><li>$sms_channel = Util_VendorFactory::get_instance('extapi/channel/' </li></ul><ul><ul><li>.$requesting_channel); </li></ul></ul><ul><li>if ($sms_channel && $sms_channel->have_required_request_params() </li></ul><ul><ul><li>&& $sms_channel->authenticate_request()) { </li></ul></ul><ul><li>ENV::load_vendor_file( 'Extapi/Service/Tmet' ); </li></ul><ul><li>$tmet_service = new Extapi_Service_Tmet( $sms_channel ); </li></ul><ul><li>$tmet_service ->parse_request_statement(); </li></ul><ul><li>$tmet_service ->act_on_request_statement(); </li></ul><ul><li>if ( $tmet_service ->has_feedback()) { </li></ul><ul><li>$arrivals = $tmet_service ->gather_feedback(); </li></ul><ul><li>$this ->payload->arrivals = array_get_else( $arrivals , 'arrivals' ); </li></ul><ul><li>$this ->payload->transit_stop = array_get_else( $arrivals , 'transit_stop' ); </li></ul><ul><li>$this ->payload->query_time = array_get_else( $arrivals , 'query_time' ); </li></ul><ul><li>} else { </li></ul><ul><li>$this ->viewless(); </li></ul><ul><li>} </li></ul><ul><li>} else { </li></ul><ul><li>if (! $sms_channel) { </li></ul><ul><li>ENV::$log->error(__METHOD__.' Util_VendorFactory::get_instance ... </li></ul><ul><ul><li>} else { </li></ul></ul><ul><li>ENV::$log->notice(__METHOD__.' Required components were not ... </li></ul><ul><ul><li>} </li></ul></ul><ul><li>$this->viewless(); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  43. 43. <ul><li>private function xmpp_receiver() { </li></ul><ul><li>$this ->use_layout = false ; </li></ul><ul><li>$requesting_channel = $this ->next_request_segment_value(); </li></ul><ul><li>$xmpp_channel = Util_VendorFactory::get_instance( 'extapi/channel/' </li></ul><ul><ul><li>. $requesting_channel ); </li></ul></ul><ul><li>if ( $xmpp_channel && $xmpp_channel ->have_required_request_params() </li></ul><ul><ul><li>&& $xmpp_channel ->authenticate_request()) { </li></ul></ul><ul><li>ENV::load_vendor_file( 'Extapi/Service/Tmet' ); </li></ul><ul><li>$tmet_service = new Extapi_Service_Tmet( $xmpp_channel ); </li></ul><ul><li>$tmet_service ->parse_request_statement(); </li></ul><ul><li>$tmet_service ->act_on_request_statement(); </li></ul><ul><li>if ( $tmet_service ->has_feedback()) { </li></ul><ul><li>$arrivals = $tmet_service ->gather_feedback(); </li></ul><ul><li>$this ->payload->arrivals = $arrivals ; </li></ul><ul><li>} else { </li></ul><ul><li>$this ->viewless(); </li></ul><ul><li>} </li></ul><ul><li>} else { </li></ul><ul><li>if (! $xmpp_channel ) { </li></ul><ul><li>ENV:: $log ->error(__METHOD__. ' Util_VendorFactory::get_instance failed for </li></ul><ul><ul><ul><ul><li>[extapi/channel/' . $requesting_channel . ']' ); </li></ul></ul></ul></ul><ul><li>} else { </li></ul><ul><li>ENV:: $log ->notice(__METHOD__. ' Required components were not found </li></ul><ul><ul><ul><ul><li>and/or authentcation failed for this request' ); </li></ul></ul></ul></ul><ul><li>} </li></ul><ul><li>$this ->viewless(); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  44. 44. <ul><li>private function xmpp_receiver() { </li></ul><ul><li>$this->use_layout = false; </li></ul><ul><li>$requesting_channel = $this ->next_request_segment_value(); </li></ul><ul><li>$xmpp_channel = Util_VendorFactory::get_instance( 'extapi/channel/' </li></ul><ul><ul><li>. $requesting_channel ); </li></ul></ul><ul><li>if ($xmpp_channel && $xmpp_channel->have_required_request_params() </li></ul><ul><ul><li>&& $xmpp_channel->authenticate_request()) { </li></ul></ul><ul><li>ENV::load_vendor_file('Extapi/Service/Tmet'); </li></ul><ul><li>$tmet_service = new Extapi_Service_Tmet($xmpp_channel); </li></ul><ul><li>$tmet_service->parse_request_statement(); </li></ul><ul><li>$tmet_service->act_on_request_statement(); </li></ul><ul><li>if ($tmet_service->has_feedback()) { </li></ul><ul><li>$arrivals = $tmet_service->gather_feedback(); </li></ul><ul><li>$this->payload->arrivals = $arrivals; </li></ul><ul><li>} else { </li></ul><ul><li>$this->viewless(); </li></ul><ul><li>} </li></ul><ul><li>} else { </li></ul><ul><li>if (! $xmpp_channel) { </li></ul><ul><li>ENV::$log->error(__METHOD__.' Util_VendorFactory::get_instance failed for </li></ul><ul><ul><ul><ul><li>[extapi/channel/'.$requesting_channel.']'); </li></ul></ul></ul></ul><ul><li>} else { </li></ul><ul><li>ENV::$log->notice(__METHOD__.' Required components were not found </li></ul><ul><ul><ul><ul><li>and/or authentcation failed for this request'); </li></ul></ul></ul></ul><ul><li>} </li></ul><ul><li>$this->viewless(); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  45. 45. <ul><li>private function xmpp_receiver() { </li></ul><ul><li>$this->use_layout = false; </li></ul><ul><li>$requesting_channel = $this->next_request_segment_value(); </li></ul><ul><li>$xmpp_channel = Util_VendorFactory::get_instance('extapi/channel/' </li></ul><ul><ul><li>.$requesting_channel); </li></ul></ul><ul><li>if ( $xmpp_channel && $xmpp_channel ->have_required_request_params() </li></ul><ul><ul><li>&& $xmpp_channel ->authenticate_request()) { </li></ul></ul><ul><li>ENV::load_vendor_file('Extapi/Service/Tmet'); </li></ul><ul><li>$tmet_service = new Extapi_Service_Tmet($xmpp_channel); </li></ul><ul><li>$tmet_service->parse_request_statement(); </li></ul><ul><li>$tmet_service->act_on_request_statement(); </li></ul><ul><li>if ($tmet_service->has_feedback()) { </li></ul><ul><li>$arrivals = $tmet_service->gather_feedback(); </li></ul><ul><li>$this->payload->arrivals = $arrivals; </li></ul><ul><li>} else { </li></ul><ul><li>$this->viewless(); </li></ul><ul><li>} </li></ul><ul><li>} else { </li></ul><ul><li>if (! $xmpp_channel) { </li></ul><ul><li>ENV::$log->error(__METHOD__.' Util_VendorFactory::get_instance failed for </li></ul><ul><ul><ul><ul><li>[extapi/channel/'.$requesting_channel.']'); </li></ul></ul></ul></ul><ul><li>} else { </li></ul><ul><li>ENV::$log->notice(__METHOD__.' Required components were not found </li></ul><ul><ul><ul><ul><li>and/or authentcation failed for this request'); </li></ul></ul></ul></ul><ul><li>} </li></ul><ul><li>$this->viewless(); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  46. 46. <ul><li>private function xmpp_receiver() { </li></ul><ul><li>$this->use_layout = false; </li></ul><ul><li>$requesting_channel = $this->next_request_segment_value(); </li></ul><ul><li>$xmpp_channel = Util_VendorFactory::get_instance('extapi/channel/' </li></ul><ul><ul><li>.$requesting_channel); </li></ul></ul><ul><li>if ($xmpp_channel && $xmpp_channel->have_required_request_params() </li></ul><ul><ul><li>&& $xmpp_channel->authenticate_request()) { </li></ul></ul><ul><li>ENV::load_vendor_file( 'Extapi/Service/Tmet' ); </li></ul><ul><li>$tmet_service = new Extapi_Service_Tmet( $xmpp_channel ); </li></ul><ul><li>$tmet_service ->parse_request_statement(); </li></ul><ul><li>$tmet_service ->act_on_request_statement(); </li></ul><ul><li>if ( $tmet_service ->has_feedback()) { </li></ul><ul><li>$arrivals = $tmet_service ->gather_feedback(); </li></ul><ul><li>$this ->payload->arrivals = $arrivals ; </li></ul><ul><li>} else { </li></ul><ul><li>$this ->viewless(); </li></ul><ul><li>} </li></ul><ul><li>} else { </li></ul><ul><li>if (! $xmpp_channel) { </li></ul><ul><li>ENV::$log->error(__METHOD__.' Util_VendorFactory::get_instance failed for </li></ul><ul><ul><ul><ul><li>[extapi/channel/'.$requesting_channel.']'); </li></ul></ul></ul></ul><ul><li>} else { </li></ul><ul><li>ENV::$log->notice(__METHOD__.' Required components were not found </li></ul><ul><ul><ul><ul><li>and/or authentcation failed for this request'); </li></ul></ul></ul></ul><ul><li>} </li></ul><ul><li>$this->viewless(); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  47. 47. Talking to Machines <ul><li>Examples so far have been very limited, our statement to the Machine is just a number </li></ul><ul><li>How do we have ‘dialogue’ with machines? </li></ul><ul><li>Invest millions in Natural Language Processing? OR have an intermediary language to bridge the gap between Natural Language (English, French, Spanish, etc) and Programming languages. </li></ul>
  48. 48. Bridge Language <ul><li>A bridge language helps the machine by adding ‘token markers’ and limiting the vocabulary set </li></ul><ul><li>Twitter is an example: @samkeen is at #phpworks </li></ul><ul><li>Many other examples, some cataloged at http://microformats.org/wiki/picoformats </li></ul>
  49. 49. HAMDL <ul><li>Bridge language meant to be an open standard to help unify some of these ‘pico formats’ </li></ul><ul><li>Major goal is accessibility : device and human </li></ul><ul><ul><li>Ease of use for limited capability devices </li></ul></ul><ul><ul><li>Ease of use for limited capability humans </li></ul></ul><ul><li>http://hamdl.pbwiki.com/ </li></ul>
  50. 50. Future <ul><li>Channels </li></ul><ul><ul><li>OpenCV visual channel </li></ul></ul><ul><ul><li>barcode channel </li></ul></ul><ul><ul><li>More NLP for HAMDL </li></ul></ul>
  51. 51. Sources <ul><li>XMPP: http://xmpp.org / </li></ul><ul><li>XMPP Servers: http://xmpp.org/software/servers.shtml </li></ul><ul><li>Openfire: http://www.igniterealtime.org/projects/openfire/index.jsp </li></ul><ul><li>Extapi: http://code.google.com/p/extapi </li></ul><ul><li>HAMDL: http://hamdl.pbwiki.com / </li></ul>

×