From: Gábor L. <gop...@gm...> - 2013-01-04 16:05:07
|
Hi! My task is to do a Python script, what is registers a new user to a jabberd2 server and then assigns all users to this newly created user (roster-items). These things works separately (xmpp.features.register, ... roster.setItem ... ), but when I do a registration and right after that authenticate and set a roster item, that will not happen. Here is an example code: import sys import os import time import xmpp cl = xmpp.Client('jabber.digicpictures.local') cl.connect() xmpp.features.register(cl, 'jabber.digicpictures.local', {'username': 'teszt', 'password': 'teszt'}) cl.auth('teszt', 'teszt') cl.sendInitPresence() # This will not work, throws an exception (not authorized) # If the "xmpp.register" line deleted (and the user is exists) this # will NOT throw an exception roster = cl.getRoster() roster.setItem('teszt2@jabber.digicpictures.local', 'Teeeszt'); time.sleep(1) cl.disconnect() I attached the DEBUG output. The interesting lines are: DEBUG: dispatcher wait Waiting for ID:2 with timeout 25... DEBUG: bind error Binding failed: timeout expired. Why this is happening? I tried "time.sleep(5)" after register, but nothing. Can somebody help me, please? What is the problem or what I do wrong? Thank you! Gabor Laszlo -- László Gábor ( gopher ) http://dynart.info |