From c10e7e9b8251fa776711687707a60fc9e25368a9 Mon Sep 17 00:00:00 2001 From: cloudwebrtc Date: Sat, 20 Mar 2021 08:52:51 +0800 Subject: [PATCH] Fix Expires refersh for Register. --- pkg/ua/register.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/ua/register.go b/pkg/ua/register.go index ebddef8..d4ad7e5 100644 --- a/pkg/ua/register.go +++ b/pkg/ua/register.go @@ -63,6 +63,11 @@ func (r *Register) SendRegister(expires uint32) error { cseq, _ := (*r.request).CSeq() cseq.SeqNo++ cseq.MethodName = sip.REGISTER + + (*r.request).RemoveHeader("Expires") + // replace Expires header. + expiresHeader := sip.Expires(expires) + (*r.request).AppendHeader(&expiresHeader) } var authorizer *auth.ClientAuthorizer = nil