Error on PubSub node - 409 error

I have quite strange issue, may be someone from the openfire community can help me out.
I am integrated Asterisk with openfire.

Asterisk can successfully create the pubsub node but I can see one error. Not sure how to resolve this.

Here are some logs from Asterisk. 2 asterisk servers will update those logs. They both are added as a buddy of each other. It will be hard to do any fix on Asterisk side, is there anyway we can find out the root cause? may be someone have faced this issue before? 1 1 whitelist

ERROR[30833]: res_xmpp.c:1398 xmpp_pubsub_handle_error: Error performing operation on PubSub node SIP/mysipuser, 409.

I’m not sure what the first line of the output is. Is that some kind of command or node configuration output?

From this error, it’s not clear what is being attempted, other than ‘something with pubsub’.

I’m assuming that res_xmpp is this file from the Asterisk source code? The line number of the error does not seem to match up with the latest state of that code.

Hi guus,
here are the full logs:-

<iq type="result" id="aanml" from="" to=""/>
<iq type="error" id="aanmk" from="" to="">
<pubsub xmlns="">
<create node="SIP/mysipuser"/><configure><x xmlns="jabber:x:data" type="submit">
<field var="FORM_TYPE" type="hidden"><value></value></field>
<field var="FORM_TYPE" type="hidden"><value></value></field>
<field var="pubsub#deliver_payloads"><value>1</value></field>
<field var="pubsub#persist_items"><value>1</value></field>
<field var="pubsub#access_model"><value>whitelist</value></field></x></configure></pubsub>
<error code="409" type="cancel"><conflict xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>

ERROR[30833]: res_xmpp.c:1398 xmpp_pubsub_handle_error: Error performing operation on PubSub node SIP/mysipuser, 409.

Regarding Asterisk res_xmpp.c, I am using asterisk-11.18.0.tar.gz
The file name is res/res_xmpp.c

If I replay the request from the error message, it seems to work for me on Openfire 4.7.4. I tried it in two ways:

  • using a public Pubsub service: to=""
  • using a PEP service to=""

Both worked. A Pubsub node was created, and I got a non-error response back.

Are you using the latest version of Openfire? What kind of error messages are logged in Openfire when you try this?

I am using Openfire 4.7.4, build 51b9db9
I have not checked openfire logs. The one I sent are Asterisk ones.

Upon closer inspection, I noticed that the error code is conflict. It is likely that you’re trying to create a new pubsub node while a node of that name already exists in that service.

I have disabled the auto-create in the Asterisk.
Here are some more logs from Asterisk. This will give you an idea what’s been sent to openfire and whats received from openfire.

<iq to='' from='' type='set' id='aaaal'><pubsub xmlns=''><publish node='device_state'><item id='SIP/mysipuser'><state xmlns='' eid='00:00:00:00:00:00' cachable='0'>INVALID</state></item></publish><publish-options><x xmlns='jabber:x:data' type='submit'><field var='FORM_TYPE' type='hidden'><value></value></field><field var='pubsub#persist_items'><value>0</value></field></x></publish-options></pubsub></iq>
[2023-04-18 14:55:58.744] <------------->
[2023-04-18 14:55:59.047]

[2023-04-18 14:55:59.047] <--- XMPP received from 'asterisk' --->

[2023-04-18 14:55:59.047] <iq type="error" id="aaaak" from="" to=""><pubsub xmlns=""><publish node="device_state"><item id="SIP/mysipuser"><state xmlns="" eid="00:00:00:00:00:00" cachable="0">INVALID</state></item></publish><publish-options><x xmlns="jabber:x:data" type="submit"><field var="FORM_TYPE" type="hidden"><value></value></field><field var="pubsub#persist_items"><value>0</value></field></x></publish-options></pubsub><error code="409" type="cancel"><conflict xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><precondition-not-met xmlns=""/></error></iq>
[2023-04-18 14:55:59.047] <------------->
[2023-04-18 14:55:59.047] ERROR[28619]: res_xmpp.c:1397 xmpp_pubsub_handle_error: Error performing operation on PubSub node device_state, 409.

So Asterisk is try to publish something, and Openfire is rejecting that. Again, Openfire debug logs would probably be helpful here.