Closed waghangad closed 7 years ago
You can write a Jabber client for ejabberd using the same Python libraries than for any other Jabber server. So, simply search for "Python Jabber library", or "Python XMPP library", or similar
I searched there are lot of libraries like aioxmpp, headstok,jabber.py, pyxmpp, pyxmpp2, sleekmpp, twisted words, xmpp-psn, xmpppy but no one given the actual code or API to connect to xmpp server the only library I got is pyejabberd with proper code and explaination.But in compatibility its shows that its not compatible for ejabberd 2.1.11 please help.
Ahh, you are asking a library to execute ejabberd commands. You can execute ejabberd commands using XMLRPC queries, simply enable ejabberd_xmlrpc, and use any python XMLRPC library. Example usage:
import xmlrpclib server_url = 'http://127.0.0.1:4560' server = xmlrpclib.ServerProxy(server_url) EJABBERD_XMLRPC_LOGIN = {'user': 'user1', 'server': 'localhost', 'password': 'mypass11', 'admin': True} def ejabberdctl1(command, data): fn = getattr(server, command) return fn(data) def ejabberdctl2(command, data): fn = getattr(server, command) return fn(EJABBERD_XMLRPC_LOGIN, data) print "" result = ejabberdctl1('srg_get_info', {'group':'group1', 'host':'localhost'}) print result
Traceback (most recent call last):
File "F:\XMPP\WORKSPACE\FirstPython\example\Second.py", line 9, in <module>
import xmlrpclib
File "F:\abc\xmlrpclib-1.0.1\xmlrpclib.py", line 169
MAXINT = 2L**31-1
^
SyntaxError: invalid syntax
Got this error
That's a problem related to that library. It works for me, but apparently it isn't recommended for newer Python versions: http://stackoverflow.com/questions/22538535/how-to-make-downloaded-python-libs-work-on-windows
I successfully created and deleted user in ejabberd using above code but Im not able to create MUC room please help
@waghangad Any update on this. I'm also having this issue.
@iamscottweber OS? Ejabberd version? Logs?
Given how old the issue is, it is probably best to start with a new ticket describing the issue. It is very likely the problem will be different.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
ejabberd 2.1.11
ubuntu 14.04
apt-get -y install ejabberd
Not getting any library and code to connect xmpp server through python (frappe)