<font size=2 face="sans-serif">I have been working with distributed device
states in Asterisk using XMPP attached to an OpenFire server. I have it
working well across two servers and want to roll it out across every server
in my company. All servers are Asterisk 11.6.0. I am running into a problem
that seems like it should be a bit easier to solve than it is seeming to
be. On the third server I am rolling into this solution, I get plenty of
the following:</font>
<br>
<br><font size=2 face="sans-serif"> res_xmpp.c:1398
xmpp_pubsub_handle_error: Error performing operation on PubSub node device_state,
403.</font>
<br>
<br><font size=2 face="sans-serif">So, basically, servers 1 and 2 continue
to hum along nicely updating their device state, but server 3 gets a 403
forbidden message when it tries to deal with device state. I believe this
has to do with the permissions set up on the device state node. I have
a small example that demonstrates the creation of a new node.</font>
<br>
<br><font size=2 face="sans-serif">In the Asterisk CLI, I ran 'xmpp create
collection asterisk test' on server 3, which was successful and can be
seen on servers 1 and 2 with 'xmpp list nodes asterisk'</font>
<br>
<br><font size=2 face="sans-serif">The debug output from server 3 for this
is as follows:</font>
<br>
<br><font size=2 face="sans-serif"><--- XMPP sent to 'asterisk' ---></font>
<br><font size=2 face="sans-serif"><iq to='pubsub.xmpp' from='server3@xmpp/astvoip3'
type='set' id='aaacy'></font>
<br><font size=2 face="sans-serif"> <pubsub xmlns='http://jabber.org/protocol/pubsub'></font>
<br><font size=2 face="sans-serif"> <create node='test'/></font>
<br><font size=2 face="sans-serif"> <configure></font>
<br><font size=2 face="sans-serif"> <x xmlns='jabber:x:data'
type='submit'></font>
<br><font size=2 face="sans-serif"> <field
var='FORM_TYPE' type='hidden'></font>
<br><font size=2 face="sans-serif"> <value></font><a href=http://jabber.org/protocol/pubsub#owner><font size=2 face="sans-serif">http://jabber.org/protocol/pubsub#owner</font></a><font size=2 face="sans-serif"></value></font>
<br><font size=2 face="sans-serif"> </field></font>
<br><font size=2 face="sans-serif"> <field
var='pubsub#node_type'></font>
<br><font size=2 face="sans-serif"> <value>collection</value></font>
<br><font size=2 face="sans-serif"> </field></font>
<br><font size=2 face="sans-serif"> <field
var='FORM_TYPE' type='hidden'></font>
<br><font size=2 face="sans-serif"> <value></font><a href=http://jabber.org/protocol/pubsub#node_config><font size=2 face="sans-serif">http://jabber.org/protocol/pubsub#node_config</font></a><font size=2 face="sans-serif"></value></font>
<br><font size=2 face="sans-serif"> </field></font>
<br><font size=2 face="sans-serif"> <field
var='pubsub#deliver_payloads'></font>
<br><font size=2 face="sans-serif"> <value>1</value></font>
<br><font size=2 face="sans-serif"> </field></font>
<br><font size=2 face="sans-serif"> <field
var='pubsub#persist_items'></font>
<br><font size=2 face="sans-serif"> <value>1</value></font>
<br><font size=2 face="sans-serif"> </field></font>
<br><font size=2 face="sans-serif"> <field
var='pubsub#access_model'></font>
<br><font size=2 face="sans-serif"> <value>whitelist</value></font>
<br><font size=2 face="sans-serif"> </field></font>
<br><font size=2 face="sans-serif"> </x></font>
<br><font size=2 face="sans-serif"> </configure></font>
<br><font size=2 face="sans-serif"> </pubsub></font>
<br><font size=2 face="sans-serif"></iq></font>
<br><font size=2 face="sans-serif"><-------------></font>
<br>
<br><font size=2 face="sans-serif"><--- XMPP sent to 'asterisk' ---></font>
<br><font size=2 face="sans-serif"><iq to='pubsub.xmpp' from='server3@xmpp/astvoip3'
type='set' id='aaacz'></font>
<br><font size=2 face="sans-serif"> <pubsub xmlns='http://jabber.org/protocol/pubsub#owner'></font>
<br><font size=2 face="sans-serif"> <affiliations node='test'></font>
<br><font size=2 face="sans-serif"> <affiliation
jid='server1@xmpp' affiliation='owner'/></font>
<br><font size=2 face="sans-serif"> <affiliation
jid='server2@xmpp' affiliation='owner'/></font>
<br><font size=2 face="sans-serif"> <affiliation
jid='server1@xmpp/astvoip1' affiliation='owner'/></font>
<br><font size=2 face="sans-serif"> <affiliation
jid='server2@xmpp/astvoip2' affiliation='owner'/></font>
<br><font size=2 face="sans-serif"> </affiliations></font>
<br><font size=2 face="sans-serif"> </pubsub></font>
<br><font size=2 face="sans-serif"></iq></font>
<br><font size=2 face="sans-serif"><-------------></font>
<br>
<br><font size=2 face="sans-serif">As we can see, the first message creates
the test node and sets the access model to whitelist, so only jids in the
whitelist are allowed to modify it. The second message then sets the appropriate
server 1 and server 2 jids to be owners, thus meeting the requirements
of the whitelist.</font>
<br>
<br><font size=2 face="sans-serif">Since these nodes are persistent, it
would appear that server 3 cannot properly access device_state because
it was never whitelisted when the node was created originally. I am fairly
certain that I can solve this by deleting all my nodes and letting them
be recreated, but that seems extreme as I put more servers into the system.
Any thoughts on a better way to handle xmpp and making sure new servers
can access the proper nodes? </font>
<br>
<br><font size=2 face="sans-serif"><br>
Kevin Larsen - Systems Analyst - Pioneer Balloon Company</font>