XMPP Sending Messages by Location Criteria

I am writing a custom service using the XMPP protocol, ejabberd server and PostGis spatial database. I also write clients to the service, so I have full control.

Alice user goes online and must publish information for certain user objects that are in the immediate vicinity. Thus, the Alice user login creates a pubsub node, I want other proximity objects to be automatically subscribed to the Alice node.

When Alice comes to the Internet, I need to automatically request postgis about objects in the immediate vicinity and automatically sign them on Alice.

In what form would you recommend?

Thanks Eylon

+3
source share
2 answers

There is no existing standard for this, but the XEP-0060 can be expanded to accomplish this.

In the developed system, I allowed to subscribe to the radius of the + point within the node. This is done using subscription options , for example:

<iq type='set'
    from='francisco@denmark.lit/barracks'
    to='pubsub.shakespeare.lit'
    id='sub1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <subscribe node='princely_musings' jid='francisco@denmark.lit'/>
    <options>
      <x xmlns='jabber:x:data' type='submit'>
        <field var='FORM_TYPE' type='hidden'>
          <value>http://jabber.org/protocol/pubsub#subscribe_options</value>
        </field>
        <field var='location#latitude'><value>52.231</value></field>
        <field var='location#longitude'><value>-1.49</value></field>
        <field var='location#radius'><value>10</value></field>
      </x>
    </options>
  </pubsub>
</iq>

Then I set up the pubsub service to filter notifications according to the scope in the subscription options. Things really get complicated when objects move around a location, and you need to emulate a rollback when an item previously published to a client goes beyond its subscription area.

, - , ( ), , , ejabberd. , , , .

0

ejabberd, , , . XMPP / curomt.

0

All Articles