Hi,
I'm trying to update the user presence based on the status of the IP phone of the user.
The idea is:
- When the SIP Server receive a call to the IP phone it will update the XMPP user presence.
- When the call hangup, it will update again the XMPP user presence.
I tried using ejabberdctl with the command, but didn't worked:
ejabberdctl set_presence nivaldo unity.local 4713450754257555570104 available away Saiu 0
I enabled the REST API and tried using this shell script, but didn't worked:
#!/bin/sh curl -X POST -H "Cache-Control: no-cache" -d '{ "user": "nivaldo", "host": "unity.local", "resource": "4713450754257555570104", "type": "available", "show": "away", "status": "Saiu", "priority": "0" }' "http://127.0.0.1:5280/api/set_presence"
How can i update the user presence using an external component?
I execute a command similar
I execute a command similar to yours, indicating an existing XMPP session (a user is already connected there):
Then the connected client receives:
If I configure loglevel to 5, then I see in the logs:
Hi, Did your clients received
Hi,
Did your clients received the presence and updated the user presence?
I have this at the logs too, but the presence is not updated on the user clients, neither at the server side.
[root@unity bin]# ./ejabberdctl get_presence junior unity.local
junior@unity.local/MacBook-Pro-de-Nivaldo available
[root@unity bin]# ./ejabberdctl set_presence junior unity.local MacBook-Pro-de-Nivaldo available away Saiu 0
[root@unity bin]# ./ejabberdctl get_presence junior unity.local
junior@unity.local/MacBook-Pro-de-Nivaldo available
At the log i receive the same messages, the only diference is the last line 19:00:58.742 [debug] user1@localhost/tka1 acknowledged 16 of 16 stanzas:
2017-06-24 11:42:20.853 [debug] <0.307.0>@ejabberd_access_permissions:handle_call:139 Command 'set_presence' execution allowed by rule 'API used from localhost allows all calls' (CallerInfo=#{caller_module => ejabberd_ctl})
2017-06-24 11:42:20.853 [debug] <0.686.0>@ejabberd_commands:do_execute_command:633 Executing command mod_admin_extra:set_presence with Args=[<<"junior">>,<<"unity.local">>,<<"MacBook-Pro-de-Nivaldo">>,<<"available">>,<<"away">>,<<"Saiu">>,<<"0">>]
2017-06-24 11:42:20.853 [debug] <0.646.0>@mod_client_state:filter_other:291 Won't add stanza for junior@unity.local/MacBook-Pro-de-Nivaldo to CSI queue
2017-06-24 11:42:20.853 [debug] <0.646.0>@mod_client_state:dequeue_sender:330 Flushing packets of junior@unity.local from CSI queue of junior@unity.local/MacBook-Pro-de-Nivaldo
2017-06-24 11:42:20.853 [debug] <0.646.0>@ejabberd_socket:send:216 (tls|<0.645.0>) Send XML on stream = <<"0awaySaiu">>
Do i need to change any configuration at the server side?
Thanks!
Ah, you are right, that
Ah, you are right, that doesn't work correctly in recent ejabberd. I've written and tested this patch. Can you test it?
Hi, I applied the patch at
Hi,
I applied the patch at version 17.06. It worked!
Thanks! :)
Ok, I've comitted the patch
Ok, I've comitted the patch to git:https://github.com/processone/ejabberd/commit/aaef1a14b4f79c42f5943fd914...