XMPP as a console interface

Background: I'm trying to build an application which will serve as an XMPP-SMS gateway, so that I can use any Jabber client for text messaging. I already have the text messaging stuff implemented, as a Python application using the Twilio API. As such, I'd prefer my solution to be Python-based, although I'm willing to consider other solutions.

What I'd like to do is be able to have a Jabber server that allows authentication against an existing authorization scheme (for example, an existing SQLite database which stores user records as a username/bcrypt hash pair), and allow messaging such as the following:

  • If an incoming message comes from a phone number to the user, it sends a message to all connected resources of (user)@(app server) from (phone number)@(app server)
  • If the user sends a message to (phone number)@(app server) , it will get that message line and act accordingly to it (for example, send the message on, or act on a command from the user such as !block or !last 3 or whatever)
  • For bonus points, it'd be great if when a user connects, the server gets a notification of that and automatically sends a status update from, say, operator@(app server) with information about unread messages or the like.
  • The problem I'm running into is that all of the XMPP server implementations I can find are designed to be turn-key for supporting standard Jabber communications, but don't seem to have extensibility for the purpose of adding authentication mechanisms or "bot"-type functions, and if they do support bots, the bots have to register one or more identities up-front, and I'd rather not have to do that.

    I don't need to support federation or proxying or anything else - I just want to use XMPP as a notification mechanism so that I can get push-style messaging to my mobile devices without having to write clients specifically for them.

    I think the ideal thing for me would be an XMPP library for Python that can act as the basis of a very basic server, but does not provide any of the server functionality beyond the client-connection socket handling.

    So far I have checked out quite a few libraries (sleekxmpp, jabber.py, xmpppy, twisted-words) and server implementations (ejabberd, prosody) but I keep on running into a wall where either I can't find out how to do any more than a simple chatbot that connects to a pre-registered single identity, or everything is geared towards being a fully-functional federated node on the distributed Jabber chat system with fully-functional user registration and so on. But surely I'm missing something...

    链接地址: http://www.djcxy.com/p/94058.html

    上一篇: 将Jabber / XMPP与其他系统集成(认证,密码共享)

    下一篇: XMPP作为控制台界面