plamoni / SiriProxy

A (tampering) proxy server for Apple's Siri
GNU General Public License v3.0
2.12k stars 343 forks source link

Forward request under certain conditions #503

Closed regcs closed 11 years ago

regcs commented 11 years ago

Hi,

is it possible to intercept with "listen_for" only under certain conditions?

What I want to to is something like:

listen_for /Test (.*)/i do |variable|

  if variable == ""

      # forward request to apple without doing anything

  else

      # execute own commands

      # complete request
      request_completed

  end

end

Best regards!

Deanmv commented 11 years ago

Doesn't SiriProxy grab data on the way back from the Guzzoni servers, meaning that it would have already been sent to Apple anyway?

regcs commented 11 years ago

Sorry, my description wasn't the best I suppose. What I want to do is to overwrite standard commands under certain conditions. For example I have made a plugin that searches wikipedia for information and presents the summary of the article. If I know want Siri to read it out loud, I want to be able to say something like "read it". This collides with other standard apple features of Siri of course. So ... I only want Siri to read the wikipedia information if I requested some recently. If I didn't then apple shall take care of the request. This is just one example of several things I want to accomplish. Hopefully that was more clear.

Any idea how to do this?

elvisimprsntr commented 11 years ago

I think you need to better understand how Siri and SiriProxy work together.

  1. The Phone sends voice capture packets to Apple
  2. The voice packets are returned as text along with the Siri response
  3. SiriProxy matches the test response based on your rules.
  4. If a match is found, SiriProxy will inject it's own response
  5. If no match is found, SiriProxy simply forwards the Siri response on.