Browse Source

Presence: semantical improvments to docs & rpc command name

Jake Greene 2 years ago
parent
commit
07f86a5227
2 changed files with 13 additions and 11 deletions
  1. 4 4
      src/modules/presence/doc/presence_admin.xml
  2. 9 7
      src/modules/presence/presence.c

+ 4 - 4
src/modules/presence/doc/presence_admin.xml

@@ -1286,13 +1286,13 @@ pres_update_watchers("sip:[email protected]", "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:[email protected]", "presence");
 	  </para>
 	  <programlisting  format="linespecific">
 ...
-&kamcmd; presence.htable_db_restore
+&kamcmd; presence.publish_cache_sync
 ...
 </programlisting>
     </section>

+ 9 - 7
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},