@@ -870,18 +870,27 @@ static int receive_ucontact_delete(bin_packet_t *packet)
870
870
if (get_urecord (domain , & aor , & record ) != 0 ) {
871
871
LM_INFO ("failed to fetch local urecord - ignoring request "
872
872
"(ci: '%.*s')\n" , callid .len , callid .s );
873
- unlock_udomain (domain , & aor );
874
873
goto out ;
875
874
}
876
875
877
876
/* simply specify a higher cseq and completely avoid any complications */
878
877
rc = get_ucontact (record , & contact_str , & callid , cseq + 1 , & cmatch ,
879
878
& 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 ,
882
890
contact_str .s , callid .len , callid .s );
883
- unlock_udomain (domain , & aor );
884
- goto error ;
891
+ goto out ;
892
+ break ;
893
+ default :;
885
894
}
886
895
887
896
if (skip_replicated_db_ops )
@@ -894,9 +903,8 @@ static int receive_ucontact_delete(bin_packet_t *packet)
894
903
goto error ;
895
904
}
896
905
897
- unlock_udomain (domain , & aor );
898
-
899
906
out :
907
+ unlock_udomain (domain , & aor );
900
908
free_pkg_str_list (cmatch .match_params );
901
909
return 0 ;
902
910
0 commit comments