From ab6774d93d44290814e367ae556ff07ac0dc0879 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Fri, 2 May 2014 00:42:09 +0400 Subject: [PATCH] Fix CSeq comparison --- src/mod_sip_registrar.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod_sip_registrar.erl b/src/mod_sip_registrar.erl index 9325a1330..57c55be08 100644 --- a/src/mod_sip_registrar.erl +++ b/src/mod_sip_registrar.erl @@ -225,7 +225,7 @@ write_session(#sip_session{us = {U, S} = US, [#sip_session{bindings = Bindings}] -> case pop_previous_binding(SIPSocket, Bindings) of {ok, #binding{call_id = CallID, cseq = PrevCSeq}, _} - when PrevCSeq >= CSeq -> + when PrevCSeq > CSeq -> {error, cseq_out_of_order}; {ok, #binding{tref = Tref}, Bindings1} -> erlang:cancel_timer(Tref), @@ -255,7 +255,7 @@ delete_session(US, SIPSocket, CallID, CSeq) -> [#sip_session{bindings = Bindings}] -> case pop_previous_binding(SIPSocket, Bindings) of {ok, #binding{call_id = CallID, cseq = PrevCSeq}, _} - when PrevCSeq >= CSeq -> + when PrevCSeq > CSeq -> {error, cseq_out_of_order}; {ok, #binding{tref = TRef}, []} -> erlang:cancel_timer(TRef),