|
xPLSiri
(tonyt-siri) - last updated 04/01/2012 (Change
Log)
This application is a transparent Proxy
Server for the iPhone 4S Siri that allows recognised text phrases to be
injected onto your xPL network and standard, or xPL created responses, to be
sent to the iPhone in place of Siri responses (for configured phrases).
Below is an example using an xPL generated response.
I decided to have a go at writing
this in VB.NET after seeing recently that it was possible to create a Proxy
for Siri
and finding a basic
protocol layout

IMPORTANT: Use of
this program is entirely at your own risk. Don't forget Apple have
the ability to block iPhone's/User's where they think their system is being
abused. They may also close the loophole that makes this application
possible.
The application uses ionic.zlib.dll from
the
DotNetZip
package to unpack and re-pack the compressed information and
System.Runtime.Serialization.Plists.dll to process binary PLists. When
accepting the licence/usage conditions when installing this application you
are also accepting the terms for these items.
Requirements
Windows Operating System (Tested on
Server 2003 and Windows 7)
Exclusive use of Port 443 (SSL) [and Port 53 (DNS) if in-built DNS server
activated]
xPL Hub
How it Works
The Proxy accepts connections from the iPhone and makes a connection to
the Siri server. It passes all information back and forth between them
transparently other than when it has a need to replace a Siri server
response with it's own response to the iPhone (it does unpack/repack the
data so it can access it and inject replacement replies)
Any recognised speech, it chooses the
phrase with the highest confidence rating, is processed as follows:
If "limittolist" is set to False then the recognised phrase with the highest
confidence is always sent on to the xPL network
If "limittolist" is set to True then only those phrases that match
configured phrases are sent onto the xPL network
Siri still works normally for Phrases
that are not in xPLSiri configured phrases list
For items that are configured in the list
of Phrases the following applies:
When a phrase is matched an xPL trigger message of schema siri.basic (see
below) is sent
The response from siri to the iphone is overridden and xPLSiri sends the
text/voice to the iphone as "Ok, <phrase>."
So for "office light on" the iPhone responds "Ok, office light on." instead
of the reply from siri
If you prepend a configured phrase with "#" (e.g. #office light on) then the
trigger message also contains an "id"
If within 3 seconds your xpl network responds with a command message of
schema siri.basic (see below)
which includes the unique "ID" from the trigger message (or ID=*) then the standard
response will be overridden with the reply
siri.basic Schema
Type: xpl-Trig
command=<recognised phrase>
confidence=<numeric value>
[id=<unique guiid>] - only for #tagged configured phrases
Type: xpl-cmnd
response=<phrase to send to iphone>
id=<unique guiid from xpl-trig message> or *
A simple vb script example using a custom response is:
sub tonyt_siri_hapc_trigger(msg)
select case ucase(xpl.getparam(msg,"{SCHEMA}",True))
case "SIRI.BASIC"
select case
ucase(xpl.getparam(msg,"TEXT",True))
case "OFFICE LIGHT ON"
call
xpl.sendmsg("xpl-cmnd","medusa-xplcm11.hapc","x10.basic","device=D11" &
chr(10) & "command=on")
call
xpl.sendmsg("xpl-cmnd","tonyt-siri.hapc","siri.basic","response=The office
light is now on" & chr(10) & "id=" & xpl.getparam(msg,"ID",True))
case "OFFICE LIGHT OFF"
call
xpl.sendmsg("xpl-cmnd","medusa-xplcm11.hapc","x10.basic","device=D11" &
chr(10) & "command=off")
call
xpl.sendmsg("xpl-cmnd","tonyt-siri.hapc","siri.basic","response=The office
light is now off" & chr(10) & "id=" & xpl.getparam(msg,"ID",True))
end select
end select
end sub
Installation
Installation is a little complicated and should be done as follows:
a) Install xPLSiri application (don't start the
service yet though)
b) Create necessary SSL certificates.
See ssl.txt in xPLSiri program folder for a transcript
of how to do this (e.g. C:\Program Files\xPL\xPLSiri\ssl.txt)
c) Copy Guzzoni.p12 to the xPLSiri program folder
d) Email CA.crt to your iPhone as an attachment and install the certificate
on the phone
e) Configure DNS
Configuring the DNS is the trickiest part
depending on your network, but the DNS server built-in to xPLSiri makes this
quite simple
xPLSiri now has a
built-in DNS server
If xPLSiri is installed on a machine with no other DNS server
installed then skip this section on setting up a DNS server and just
configure the xPL configuration item "siridnsip" with the IP address of the
machine that xPLSiri is installed on and it will start the built-in DNS
server. This will relay all DNS queries the iPhone 4S makes to the
configured DNS servers of the machine xPLSiri is installed on, except for
guzzoni.apple.com.
Alternatively, the way I initially set
mine up was:
As I wasn't using the DNS server on my Server 2003 system I
Installed the DNS service
Created a new DNS Zone called guzzoni.apple.com
Created a new 'A' Host in the zone. I left the 'name' blank and set the IP
to IP address of the system running xPLSiri (the same system in this case)
Also I setup the forwarders in the properties of the DNS server to my normal
DNS server(s)
It's imperative the system running xPLSiri doesn't use
this DNS server as it won't be able to find the real Siri server!
f) Manually edit the DNS server setting in the wireless settings of your
home network on the iPhone to the IP of your DNS server
g) Start the xPLSiri service and configure it in your xPL manager software
i.e. set the instance name, set "limittolist" to True or False as required,
configure the required xPL Phrases
xPLSiri
Download
Change Log
04/01/2012 - Added xPLMyHouse Device and
Image files to installation and allow ID=* in response
04/01/2012 - Bug Fix - Add correct DNS
Response for when host not resolved
02/01/2012 - Added Bult-in DNS (Relay)
Server
01/01/2012 - Initial Release
Source Code
As the source code for this software
could be used to abuse Apples systems (e.g. attempting to use Siri without an iPhone 4S)
it will not be made available
|