Can't receive automated xmpp-messages

asked 2014-08-24 21:26:00 +0200

knutella gravatar image

updated 2015-01-20 10:21:06 +0200

eric gravatar image

Hi guys,

since a couple of days i try to send automated status-messages from my server to my Jolla via the native xmpp-client. So i set up an own ejabberd server and registered a couple of users there. Using this setup, the hand-written communication between the clients works as fine as it should, including the Jolla.

The problem appears, when sending automated messages using the python-xmpp-package. Whit a very simple 'n' short test-script I'm able to send a message f.e. to a pidgin-client on pc, or to an android-client running on my Jolla. But sending messages to the native xmpp-client fails - which means, I just don't receive any message there. The online status of my "auto_user" is shown there as green however until the script ends.

import xmpp, time

uname='auto_user'
passw='1234'
to='knutella@myjabberserver.org'
msg='whoop-da-loop'

client=xmpp.Client('myjabberserver.org')
client.connect(server=('myjabberserver.org',5222))
client.auth(uname, passw)
client.sendInitPresence()
time.sleep(10)
message=xmpp.Message(to, msg)
client.send(message)
time.sleep(30)

All users are registered and validated within each other, so I have no clue, what it could be. I'm grateful for any ideas!

edit retag flag offensive close delete

Comments

PS: I'd like to add, that the ejabberd-log didn't gave me any further hint too - but I guess, since I'm new to all that I might not understand it fully.

knutella ( 2014-08-24 21:28:05 +0200 )edit

Try sending message with type="chat"

smoku ( 2014-08-25 16:14:24 +0200 )edit

@smoku: Great snakes! Thanks for the hint smoku, its working now! For those, who are interested: I added the line message.setAttr('type', 'chat') before the client.send(message) `

knutella ( 2014-08-25 18:28:15 +0200 )edit