Asterisk 12 - xmpp and presence

I’ve just upgraded to Asterisk 12.4.0 and I’m trying to get presence to work. I have also installed ejabberd which seems to work correctly with 2 Pidgin clients allowing both exchange of messages and presence.

Asterisk is another thing though.

my asterisk user is visible on ejabberd:
asterisk-xmpp (tls://
what’s bugging me at the moment although its probably not essential is a persistent error message from res_xmpp (to which I’ve added a few fields since the basic error msg is useless)
DEBUG[31258]: res_xmpp.c:3779 xmpp_client_thread: JABBER: Unknown 12 from ejabberd on localhost in state 8 with timeout 20
The normal error msg stops at Unknown.
This message repeats with timeout decrementing from 50 once a second.

Other error messages include, if I change presence on a client:
WARNING[31415]: res_pjsip_pubsub.c:1295 pubsub_on_rx_publish_request: No registered publish handler for event presence
[Jul 27 16:51:32] DEBUG[31415]: pjsip:0 <?>: endpoint .Response msg 489/PUBLISH/cseq=16 (tdta0xb7605250) created
[Jul 27 16:51:32] DEBUG[31415]: pjsip:0 <?>: tdta0xb7605250 .Destroying txdata Response msg 489/PUBLISH/cseq=16 (tdta0xb7605250)
[Jul 27 16:51:33] WARNING[31258]: res_xmpp.c:3766 xmpp_client_thread: JABBER: socket read error
[Jul 27 16:51:33]

I can’t find any clear and complete descriptions of configuring presence using xmpp. Can anyone help me?

I think I got this to work with the technology of the time on 1.something but things have moved on.

Best regards,
PS I have rebuilt iksemel and ejabberd from source just to be sure that there were no compatibility issues.