some blag

March 14, 2010

Hessian

Filed under: misc — andrew @ 10:03 pm

Hessian is a binary protocol designed with communication between web services in mind. It can be used to do some interesting things, but here’s a pointless example instead.

On the server side (running in Resin in my case; with Resin you will also need a resin-web.xml):
public class HessianThing extends HessianServlet {
public String insult(String name)
{
return "silly " + name;
}
}

On the client side (Ruby here):
c = HessianClient.new("http://localhost:8080/hessianthing")
puts c.insult("you")

Outputs: “silly you”

The server interface’s (or implementation’s) javadoc is all that is needed for a protocol specification.

July 18, 2008

Gajim Asterisk AMI Script

Filed under: misc, ohdearhereallywrotethat — andrew @ 7:27 pm

Following in the great Siman’s footsteps, I have written a script that is actually useful*.

What script, you ask? A script to place a call, using Asterisk’s AMI, if Gajim receives a message while you are away. If someone calls you and your status is not online, the script will call the phone number you provided and let you know the name of the person that has messaged you and their message. Festival is used to perform the text-to-speech function.

A working Festival installation is required, using the Perl AGI method. It can easily be modified to use the Festival() command instead if desired. pyst is also required for communicating with the AMI.

The script is located at this git repository.

* Please negate when reading.

Powered by WordPress