<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;p&gt;I am working on some significant enhancements to the current architecture and trying to plan how to make it flexible. Some of the changes include:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Embedding gnokii directly using the Rubynokii library and libgnokii directly&lt;/li&gt;
	&lt;li&gt;Handling multi-message &amp;#8220;sessions&amp;#8221;&lt;/li&gt;
	&lt;li&gt;Handling authorization&lt;/li&gt;
	&lt;li&gt;Other features&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Embedding gnokii&lt;/h2&gt;
&lt;p&gt;This should be a pretty easy challenge as most of the work is already handled by &amp;#8220;Rubynokii&amp;#8221;=http://github.com/thyagarajan/rubynokii/tree/master (Github). The primary challenges are initializing and finalizing the bus and port for the connected cell-phone. In the standalone console application this is easy, however in the daemon this is more difficult as the daemons gem does not support setup and teardown modes. To work around this, the daemon will handle two additional command line parameters: &amp;#8220;connect&amp;#8221; and &amp;#8220;disconnect&amp;#8221;. If it receives either of these it will perform the appropriate server commands and exit.&lt;/p&gt;
&lt;h2&gt;Handling multi-message &amp;#8220;sessions&amp;#8221;&lt;/h2&gt;
&lt;p&gt;Initial implementation is already underway and is simple. As a message comes in the handler needs to check to see if the incoming message is a command. Based on the command, the handler will handle the text.&lt;/p&gt;
&lt;p&gt;If there is no session currently:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Check for a template name (the example template is &amp;#8220;&lt;span class=&quot;caps&quot;&gt;HTC&lt;/span&gt;&amp;#8221; for &lt;span class=&quot;caps&quot;&gt;HIV&lt;/span&gt; Testing and Counseling)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If the template name is found in the list of templates, a new &amp;#8220;entry&amp;#8221; is started and the first question is added and sent as a reply. If the template requires a person identifier to be associated with it, the first question should be to enter the person identifier.&lt;/p&gt;
&lt;p&gt;If their is an existing session (based on whether or not there is an active &amp;#8220;entry&amp;#8221; that has not timed-out), then you need to check for a session command:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Cancel&lt;/li&gt;
	&lt;li&gt;Skip&lt;/li&gt;
	&lt;li&gt;Help&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If the command is &amp;#8220;cancel&amp;#8221; then the entry is marked as canceled and the handler exits. If the command is &amp;#8220;skip&amp;#8221; then the question is skipped and the next question is sent as a reply (it may be possible to add a &lt;ins&gt;allow_skip&lt;/ins&gt; flag to the question). If the command is &amp;#8220;help&amp;#8221; then a more advanced &amp;#8220;help&amp;#8221; text is sent (possibly multi-part) if it is available, otherwise &amp;#8220;no help available&amp;#8221; is sent.&lt;/p&gt;
&lt;p&gt;If there is an existing session and the incoming message is not a command then it is assumed to be an answer. Answer validation should be available based on a set of common classes (numeric validator, cell validator, weight validator, person identifier validator, etc.) If the answer is validated then it is saved and the next question is asked of the client. (/Note/: do we need answer parsers for multi-answer responses or should this be saved for another layer).&lt;/p&gt;
&lt;h2&gt;Authorization&lt;/h2&gt;
&lt;p&gt;In addition to &amp;#8220;Workers&amp;#8221; using the system, we will probably want to allow each &amp;#8220;Person&amp;#8221; to access their own content. They may want to do this to check their appointments, get drug/prescription information and may other commands. Because of this we have to allow for the registration of people and their cell phone numbers. Because phones are often shared patients should also need to enter their identifier so that the correct information is given. This raises [[security]] concerns as the identifier might be associated with a particular person based on eavesdropping.&lt;/p&gt;
&lt;h2&gt;Other features&lt;/h2&gt;
&lt;p&gt;Trying ot to lose focus I have held off on the following features. I wanted to list them here for reference. Please add any that you would like to see:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Daily broadcast messages&lt;/li&gt;
	&lt;li&gt;Groups and group messages&lt;/li&gt;
	&lt;li&gt;Giveaways/Contests&lt;/li&gt;
	&lt;li&gt;Self registering (no worker needed)&lt;/li&gt;
&lt;/ul&gt;</body>
  <created-at type="datetime">2008-10-31T10:00:02-07:00</created-at>
  <id type="integer">74810</id>
  <permalink>future</permalink>
  <repository-id type="integer">67852</repository-id>
  <title>Future</title>
  <updated-at type="datetime">2008-10-31T10:11:14-07:00</updated-at>
  <user-id type="integer">4064</user-id>
</wiki>
