Răsfoiți Sursa

presence: do not break on one notify sending failure

- try all of them, debug message with successful and failure counters
- GH #4118
Daniel-Constantin Mierla 7 luni în urmă
părinte
comite
65e51b7762
1 a modificat fișierele cu 9 adăugiri și 2 ștergeri
  1. 9 2
      src/modules/presence/notify.c

+ 9 - 2
src/modules/presence/notify.c

@@ -1557,6 +1557,8 @@ int query_db_notify(str *pres_uri, pres_ev_t *event, subs_t *watcher_subs)
 	subs_t *subs_array = NULL, *s = NULL;
 	str *notify_body = NULL, *aux_body = NULL;
 	int ret_code = -1;
+	int retOK = 0;
+	int retErr = 0;
 
 	subs_array = get_subs_dialog(pres_uri, event, NULL);
 	if(subs_array == NULL) {
@@ -1586,7 +1588,9 @@ int query_db_notify(str *pres_uri, pres_ev_t *event, subs_t *watcher_subs)
 					< 0) {
 				LM_ERR("Could not send notify for [event]=%.*s\n",
 						event->name.len, event->name.s);
-				goto done;
+				retErr++;
+			} else {
+				retOK++;
 			}
 
 			if(aux_body != NULL) {
@@ -1599,7 +1603,10 @@ int query_db_notify(str *pres_uri, pres_ev_t *event, subs_t *watcher_subs)
 		}
 	}
 
-	ret_code = 1;
+	LM_DBG("sent ok: %d - err: %d\n", retOK, retErr);
+	if(retOK > 0) {
+		ret_code = 1;
+	}
 
 done:
 	free_subs_list(subs_array, PKG_MEM_TYPE, 0);