Skip to content

Commit cfbfd3f

Browse files
committed
usrloc: Silence ERR logs on failed contact DEL packets
1 parent 360a165 commit cfbfd3f

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

modules/usrloc/ul_cluster.c

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -870,18 +870,27 @@ static int receive_ucontact_delete(bin_packet_t *packet)
870870
if (get_urecord(domain, &aor, &record) != 0) {
871871
LM_INFO("failed to fetch local urecord - ignoring request "
872872
"(ci: '%.*s')\n", callid.len, callid.s);
873-
unlock_udomain(domain, &aor);
874873
goto out;
875874
}
876875

877876
/* simply specify a higher cseq and completely avoid any complications */
878877
rc = get_ucontact(record, &contact_str, &callid, cseq + 1, &cmatch,
879878
&contact);
880-
if (rc != 0 && rc != 2) {
881-
LM_ERR("contact '%.*s' not found: (ci: '%.*s')\n", contact_str.len,
879+
switch (rc) {
880+
case -2:
881+
case -1:
882+
/* the DEL packet is too old (same or lower CSeq) */
883+
LM_ERR("contact '%.*s' found, but DEL too old: (rc: %d, ci: '%.*s')\n",
884+
contact_str.len, contact_str.s, rc, callid.len, callid.s);
885+
goto out;
886+
break;
887+
888+
case 1:
889+
LM_DBG("contact '%.*s' already deleted: (ci: '%.*s')\n", contact_str.len,
882890
contact_str.s, callid.len, callid.s);
883-
unlock_udomain(domain, &aor);
884-
goto error;
891+
goto out;
892+
break;
893+
default:;
885894
}
886895

887896
if (skip_replicated_db_ops)
@@ -894,9 +903,8 @@ static int receive_ucontact_delete(bin_packet_t *packet)
894903
goto error;
895904
}
896905

897-
unlock_udomain(domain, &aor);
898-
899906
out:
907+
unlock_udomain(domain, &aor);
900908
free_pkg_str_list(cmatch.match_params);
901909
return 0;
902910

0 commit comments

Comments
 (0)