Module: kamailio
Branch: master
Commit: 07f86a52271920bc36db3a32c6ffa18434372ebf
URL: 
https://github.com/kamailio/kamailio/commit/07f86a52271920bc36db3a32c6ffa18434372ebf

Author: Jake Greene <jacobgreene1...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2023-06-12T11:49:27+02:00

Presence: semantical improvments to docs & rpc command name

---

Modified: src/modules/presence/doc/presence_admin.xml
Modified: src/modules/presence/presence.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/07f86a52271920bc36db3a32c6ffa18434372ebf.diff
Patch: 
https://github.com/kamailio/kamailio/commit/07f86a52271920bc36db3a32c6ffa18434372ebf.patch

---

diff --git a/src/modules/presence/doc/presence_admin.xml 
b/src/modules/presence/doc/presence_admin.xml
index 41546d87d5b..22b20f1d46d 100644
--- a/src/modules/presence/doc/presence_admin.xml
+++ b/src/modules/presence/doc/presence_admin.xml
@@ -1286,13 +1286,13 @@ pres_update_watchers("sip:t...@kamailio.org", 
"presence");
     </section>
        
 <section>
-       <section id="presence.r.htable_db_restore">
+       <section id="presence.r.publish_cache_sync">
          <title>presence.htable_db_restore</title>
          <para>
-               Manually apply changes to the presenity table to the 
publ_cache.  
+               Synchronize changes made to the presentity table with the 
publish cache.
          </para>
          <para>
-               Name: <emphasis>presence.htable_db_restore</emphasis>
+               Name: <emphasis>presence.publish_cache_sync</emphasis>
          </para>
          <para>Parameters: <emphasis>none</emphasis></para>
          <para>
@@ -1300,7 +1300,7 @@ pres_update_watchers("sip:t...@kamailio.org", "presence");
          </para>
          <programlisting  format="linespecific">
 ...
-&kamcmd; presence.htable_db_restore
+&kamcmd; presence.publish_cache_sync
 ...
 </programlisting>
     </section>
diff --git a/src/modules/presence/presence.c b/src/modules/presence/presence.c
index bb4fc98a66c..4471f809dc1 100644
--- a/src/modules/presence/presence.c
+++ b/src/modules/presence/presence.c
@@ -1855,15 +1855,17 @@ static const char *rpc_presence_cleanup_doc[3] = {
                0};
 
 
-void rpc_presence_htable_db_restore(rpc_t *rpc, void *c)
+void rpc_presence_publish_cache_sync(rpc_t *rpc, void *ctx)
 {
-       LM_DBG("Restoring presence publ cache from database.\n");
-       pres_htable_db_restore();
+       LM_DBG("Synchronizing presentity table with the publish cache.\n");
+       if (pres_htable_db_restore() == -1 ) {
+               rpc->fault(ctx, 500, "Failed to sync presinity table with the 
publish cache.");
+       };
        return;
 }
 
-static const char *rpc_presence_htable_db_restore_doc[4] = {
-       "Sync publ_cache from database. Syncs changes made to presentity table 
with the publ_cache.",
+static const char *rpc_presence_publish_cache_sync_doc[4] = {
+       "Syncs changes made to presentity table with the publish cache.",
        0
 };
 
@@ -2133,8 +2135,8 @@ static const char *rpc_presence_watcher_list_doc[2] = {
 
 
 rpc_export_t presence_rpc[] = {
-               {"presence.htable_db_restore", rpc_presence_htable_db_restore, 
-                               rpc_presence_htable_db_restore_doc, 0},
+               {"presence.publish_cache_sync", 
rpc_presence_publish_cache_sync, 
+                               rpc_presence_publish_cache_sync_doc, 0},
                {"presence.cleanup", rpc_presence_cleanup, 
rpc_presence_cleanup_doc, 0},
                {"presence.refreshWatchers", rpc_presence_refresh_watchers,
                                rpc_presence_refresh_watchers_doc, 0},

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to