From: Glen A. <gle...@gm...> - 2011-01-07 04:00:20
|
Hello List, First of all, thank you for this awesome library. However, I seem to be having trouble using the xmpppy client when sending messages to the app engine's xmpp client. I am not getting any errors. The messages just aren't arriving there. Sending messages from app engine's client to the sl4a client works. Sending messages to and from google talk's client to and from the sl4a client works as well. Any help would be greatly appreciated. import xmpp, time _SERVER = 'talk.google.com', 5223 commandByXMPP() def commandByXMPP(): global xmppUsername xmppUsername = 'gar...@gm...' global xmppPassword xmppPassword = 'obscured' global xmppClient global operator operator = "cel...@ap..." jid = xmpp.protocol.JID(xmppUsername) xmppClient = xmpp.Client(jid.getDomain(), debug=[]) xmppClient.connect(server=_SERVER) xmppClient.RegisterHandler('message', XMPP_message_cb) auth = xmppClient.auth(jid.getNode(), xmppPassword, 'botty') xmppClient.sendInitPresence() start=time.time() i=0 outputToOperator("starting") while time.time()-start<15: print "tick" xmppClient.Process(1) i=i+1 if i % 10 == 0: outputToOperator("hello") outputToOperator("exiting") def XMPP_message_cb(session, message): jid = xmpp.protocol.JID(message.getFrom()) command = message.getBody() print command def outputToOperator(msg): print "Outputting "+msg+" to " + operator xmppClient.send(xmpp.Message(operator, msg)) |