diff --git a/sgx-catapult.rb b/sgx-catapult.rb index a9ab0ed0c8c1f0030dac963c4e29d93d953894ce..c561373e93d2111231060e1c0775879632c28fb6 100755 --- a/sgx-catapult.rb +++ b/sgx-catapult.rb @@ -33,7 +33,7 @@ require 'log4r' $stdout.sync = true -puts "Soprani.ca/SMS Gateway for XMPP - Catapult v0.024\n\n" +puts "Soprani.ca/SMS Gateway for XMPP - Catapult v0.025\n\n" if ARGV.size != 9 then puts "Usage: sgx-catapult.rb " + @@ -928,6 +928,13 @@ end EM.run do SGXcatapult.run + # required when using Prosody otherwise disconnects on 6-hour inactivity + EM.add_periodic_timer(3600) do + msg = Blather::Stanza::Iq::Ping.new(:get, 'localhost') + msg.from = ARGV[0] + SGXcatapult.write(msg) + end + server = Goliath::Server.new('0.0.0.0', ARGV[7].to_i) server.api = WebhookHandler.new server.app = Goliath::Rack::Builder.build(server.api.class, server.api)