From 99a33fd8046b9d53b3429396c1f6f87850b9ca74 Mon Sep 17 00:00:00 2001 From: Benjamin Pracht Date: Thu, 31 Oct 2024 15:02:01 -0700 Subject: [PATCH 1/7] WiP --- pkg/sip/inbound.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkg/sip/inbound.go b/pkg/sip/inbound.go index 809c53d..9fe4cec 100644 --- a/pkg/sip/inbound.go +++ b/pkg/sip/inbound.go @@ -1064,12 +1064,29 @@ func (c *sipInbound) swapSrcDst(req *sip.Request) { req.AppendHeader((*sip.FromHeader)(c.to)) req.RemoveHeader("To") req.AppendHeader((*sip.ToHeader)(c.from)) + req.RemoveHeader("Via") + req.PrependHeader(c.generateViaHeader(req)) if route, ok := req.RecordRoute(); ok { req.RemoveHeader("Record-Route") req.AppendHeader(&sip.RouteHeader{Address: route.Address}) } } +func (c *sipInbound) generateViaHeader(req *sip.Request) *sip.ViaHeader { + newvia := &sip.ViaHeader{ + ProtocolName: "SIP", + ProtocolVersion: "2.0", + Transport: req.Transport(), + Host: c.s.sconf.SignalingIPLocal.String(), // This can be rewritten by transport layer + Port: c.s.conf.SIPPortListen, // This can be rewritten by transport layer + Params: sip.NewParams(), + } + // NOTE: Consider lenght of branch configurable + newvia.Params.Add("branch", sip.GenerateBranchN(16)) + + return newvia +} + func (c *sipInbound) setCSeq(req *sip.Request) { setCSeq(req, c.nextRequestCSeq) From 2ffeab86db50bf39ec489347ff3530704c9a98e4 Mon Sep 17 00:00:00 2001 From: Benjamin Pracht Date: Fri, 1 Nov 2024 10:56:36 -0700 Subject: [PATCH 2/7] Update sipgo --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 602608b..b4fd486 100644 --- a/go.mod +++ b/go.mod @@ -129,4 +129,4 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect ) -replace github.com/emiago/sipgo => github.com/livekit/sipgo v0.13.2-0.20240820220653-befde351a575 +replace github.com/emiago/sipgo => github.com/livekit/sipgo v0.13.2-0.20241101175057-8eb38293fc69 diff --git a/go.sum b/go.sum index 37b0f86..bead6bf 100644 --- a/go.sum +++ b/go.sum @@ -124,8 +124,8 @@ github.com/livekit/psrpc v0.6.1-0.20240924010758-9f0a4268a3b9 h1:33oBjGpVD9tYkDX github.com/livekit/psrpc v0.6.1-0.20240924010758-9f0a4268a3b9/go.mod h1:CQUBSPfYYAaevg1TNCc6/aYsa8DJH4jSRFdCeSZk5u0= github.com/livekit/server-sdk-go/v2 v2.2.2-0.20241015094126-b8538ae5d67b h1:R1GpKwVbSYsG08k5sIkNCukvnrkOE18R8IO1YeujR8o= github.com/livekit/server-sdk-go/v2 v2.2.2-0.20241015094126-b8538ae5d67b/go.mod h1:m2IukIyPCvJCdx04mdWIud9FoCBUAWc3526x3KgT8qY= -github.com/livekit/sipgo v0.13.2-0.20240820220653-befde351a575 h1:9On8gLpup6Hs9f679MO2jNtLZzpB901vSRKXzVmRP4w= -github.com/livekit/sipgo v0.13.2-0.20240820220653-befde351a575/go.mod h1:BY01/cjS7NQGCKAvgD+4FtIJ/8hPXwcDKnSan5uvklc= +github.com/livekit/sipgo v0.13.2-0.20241101175057-8eb38293fc69 h1:tRTNxD0N6R4lUJkuE5CxeEj0s5G6t+LzrLNgalAFN4U= +github.com/livekit/sipgo v0.13.2-0.20241101175057-8eb38293fc69/go.mod h1:BY01/cjS7NQGCKAvgD+4FtIJ/8hPXwcDKnSan5uvklc= github.com/mackerelio/go-osstat v0.2.4 h1:qxGbdPkFo65PXOb/F/nhDKpF2nGmGaCFDLXoZjJTtUs= github.com/mackerelio/go-osstat v0.2.4/go.mod h1:Zy+qzGdZs3A9cuIqmgbJvwbmLQH9dJvtio5ZjJTbdlQ= github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg= From 6e2baf92ee17b7269ce65dd3d650b73d4c9f460e Mon Sep 17 00:00:00 2001 From: Benjamin Pracht Date: Fri, 1 Nov 2024 12:27:06 -0700 Subject: [PATCH 3/7] Non local ips --- pkg/sip/inbound.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/sip/inbound.go b/pkg/sip/inbound.go index 9fe4cec..06a7807 100644 --- a/pkg/sip/inbound.go +++ b/pkg/sip/inbound.go @@ -1077,8 +1077,8 @@ func (c *sipInbound) generateViaHeader(req *sip.Request) *sip.ViaHeader { ProtocolName: "SIP", ProtocolVersion: "2.0", Transport: req.Transport(), - Host: c.s.sconf.SignalingIPLocal.String(), // This can be rewritten by transport layer - Port: c.s.conf.SIPPortListen, // This can be rewritten by transport layer + Host: c.s.sconf.SignalingIP.String(), // This can be rewritten by transport layer + Port: c.s.conf.SIPPort, // This can be rewritten by transport layer Params: sip.NewParams(), } // NOTE: Consider lenght of branch configurable From 8b21abdf2d22a01adef53c549c0dcd68f45d259f Mon Sep 17 00:00:00 2001 From: Benjamin Pracht Date: Mon, 4 Nov 2024 16:57:51 -0800 Subject: [PATCH 4/7] remove all via headers --- pkg/sip/inbound.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/sip/inbound.go b/pkg/sip/inbound.go index 06a7807..af10138 100644 --- a/pkg/sip/inbound.go +++ b/pkg/sip/inbound.go @@ -1064,7 +1064,9 @@ func (c *sipInbound) swapSrcDst(req *sip.Request) { req.AppendHeader((*sip.FromHeader)(c.to)) req.RemoveHeader("To") req.AppendHeader((*sip.ToHeader)(c.from)) - req.RemoveHeader("Via") + // Remove all Via headers + for req.RemoveHeader("Via") { + } req.PrependHeader(c.generateViaHeader(req)) if route, ok := req.RecordRoute(); ok { req.RemoveHeader("Record-Route") From 7d44e99582ab894df797b0ecb7a36a4a2e4cce95 Mon Sep 17 00:00:00 2001 From: Denys Smirnov Date: Thu, 24 Oct 2024 15:34:07 +0300 Subject: [PATCH 5/7] Switch to upstream sipgo parser. --- go.mod | 10 ++++++---- go.sum | 23 ++++++++++++++++++---- pkg/sip/client.go | 4 ++-- pkg/sip/inbound.go | 25 ++++++++++++------------ pkg/sip/outbound.go | 27 ++++++++++++------------- pkg/sip/protocol.go | 18 ++++++++--------- pkg/sip/protocol_test.go | 2 +- pkg/sip/server.go | 4 ++-- pkg/sip/service.go | 2 +- pkg/sip/service_test.go | 4 ++-- pkg/sip/types.go | 10 +++++----- pkg/siptest/client.go | 38 ++++++++++++++++++------------------ test/integration/sip_test.go | 2 +- 13 files changed, 92 insertions(+), 77 deletions(-) diff --git a/go.mod b/go.mod index 602608b..78d8ae9 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,6 @@ toolchain go1.22.8 require ( github.com/at-wat/ebml-go v0.17.1 - github.com/emiago/sipgo v0.13.1 github.com/frostbyte73/core v0.0.12 github.com/gotranspile/g722 v0.0.0-20240123003956-384a1bb16a19 github.com/icholy/digest v0.1.23 @@ -16,6 +15,7 @@ require ( github.com/livekit/protocol v1.27.1-0.20241025171050-32abc4d3e929 github.com/livekit/psrpc v0.6.1-0.20240924010758-9f0a4268a3b9 github.com/livekit/server-sdk-go/v2 v2.2.2-0.20241015094126-b8538ae5d67b + github.com/livekit/sipgo v0.13.2-0.20241021131531-e4db84deff2c github.com/mjibson/go-dsp v0.0.0-20180508042940-11479a337f12 github.com/ory/dockertest/v3 v3.10.0 github.com/pion/interceptor v0.1.37 @@ -56,6 +56,7 @@ require ( github.com/docker/docker v25.0.5+incompatible // indirect github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect + github.com/emiago/sipgo v0.24.1 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/gammazero/deque v0.2.1 // indirect github.com/go-jose/go-jose/v3 v3.0.3 // indirect @@ -63,7 +64,7 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/gobwas/httphead v0.1.0 // indirect github.com/gobwas/pool v0.2.1 // indirect - github.com/gobwas/ws v1.2.1 // indirect + github.com/gobwas/ws v1.4.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/cel-go v0.21.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect @@ -76,6 +77,8 @@ require ( github.com/lithammer/shortuuid/v4 v4.0.0 // indirect github.com/mackerelio/go-osstat v0.2.4 // indirect github.com/magefile/mage v1.15.0 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moby/term v0.5.0 // indirect github.com/nats-io/nats.go v1.36.0 // indirect @@ -102,6 +105,7 @@ require ( github.com/prometheus/procfs v0.12.0 // indirect github.com/puzpuzpuz/xsync/v3 v3.4.0 // indirect github.com/redis/go-redis/v9 v9.6.1 // indirect + github.com/rs/zerolog v1.33.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b // indirect github.com/stoewer/go-strcase v1.3.0 // indirect @@ -128,5 +132,3 @@ require ( google.golang.org/grpc v1.67.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) - -replace github.com/emiago/sipgo => github.com/livekit/sipgo v0.13.2-0.20240820220653-befde351a575 diff --git a/go.sum b/go.sum index 37b0f86..b43c924 100644 --- a/go.sum +++ b/go.sum @@ -32,6 +32,7 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/containerd/continuity v0.4.3 h1:6HVkalIp+2u1ZLH1J/pYX2oBVXlJZvh1X1A7bEZ9Su8= github.com/containerd/continuity v0.4.3/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= @@ -49,6 +50,8 @@ github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/emiago/sipgo v0.24.1 h1:RKy6NqVnvjgpLywo1sa4v+lwfEz5O5/0yk4Z8eek4XM= +github.com/emiago/sipgo v0.24.1/go.mod h1:UB0Ao5xk1b1TQisO29jmUDz0mXNINpHBR4YXsLbLXEs= github.com/envoyproxy/protoc-gen-validate v1.1.0 h1:tntQDh69XqOCOZsDz0lVJQez/2L6Uu2PdjCQwWCJ3bM= github.com/envoyproxy/protoc-gen-validate v1.1.0/go.mod h1:sXRDRVmzEbkM7CVcM06s9shE/m23dg3wzjl0UWqJ2q4= github.com/frostbyte73/core v0.0.12 h1:kySA8+Os6eqnPFoExD2T7cehjSAY1MRyIViL0yTy2uc= @@ -70,8 +73,9 @@ github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.2.1 h1:F2aeBZrm2NDsc7vbovKrWSogd4wvfAxg0FQ89/iqOTk= -github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= +github.com/gobwas/ws v1.4.0 h1:CTaoG1tojrh4ucGPcoJFiAQUAsEWekEWvLy7GsVNqGs= +github.com/gobwas/ws v1.4.0/go.mod h1:G3gNqMNtPppf5XUz7O4shetPpcZ1VJ7zt18dlUeakrc= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/google/cel-go v0.21.0 h1:cl6uW/gxN+Hy50tNYvI691+sXxioCnstFzLp2WO4GCI= @@ -124,12 +128,18 @@ github.com/livekit/psrpc v0.6.1-0.20240924010758-9f0a4268a3b9 h1:33oBjGpVD9tYkDX github.com/livekit/psrpc v0.6.1-0.20240924010758-9f0a4268a3b9/go.mod h1:CQUBSPfYYAaevg1TNCc6/aYsa8DJH4jSRFdCeSZk5u0= github.com/livekit/server-sdk-go/v2 v2.2.2-0.20241015094126-b8538ae5d67b h1:R1GpKwVbSYsG08k5sIkNCukvnrkOE18R8IO1YeujR8o= github.com/livekit/server-sdk-go/v2 v2.2.2-0.20241015094126-b8538ae5d67b/go.mod h1:m2IukIyPCvJCdx04mdWIud9FoCBUAWc3526x3KgT8qY= -github.com/livekit/sipgo v0.13.2-0.20240820220653-befde351a575 h1:9On8gLpup6Hs9f679MO2jNtLZzpB901vSRKXzVmRP4w= -github.com/livekit/sipgo v0.13.2-0.20240820220653-befde351a575/go.mod h1:BY01/cjS7NQGCKAvgD+4FtIJ/8hPXwcDKnSan5uvklc= +github.com/livekit/sipgo v0.13.2-0.20241021131531-e4db84deff2c h1:KquO53e0/2HPNnYf91w0MW+AbFGVvXRMnbvsxZ7sk/Y= +github.com/livekit/sipgo v0.13.2-0.20241021131531-e4db84deff2c/go.mod h1:nbNi0IsYn4tyY2ab7Rafvifty07miHYvgedPMKWbaI4= github.com/mackerelio/go-osstat v0.2.4 h1:qxGbdPkFo65PXOb/F/nhDKpF2nGmGaCFDLXoZjJTtUs= github.com/mackerelio/go-osstat v0.2.4/go.mod h1:Zy+qzGdZs3A9cuIqmgbJvwbmLQH9dJvtio5ZjJTbdlQ= github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg= github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mjibson/go-dsp v0.0.0-20180508042940-11479a337f12 h1:dd7vnTDfjtwCETZDrRe+GPYNLA1jBtbZeyfyE8eZCyk= @@ -210,6 +220,9 @@ github.com/redis/go-redis/v9 v9.6.1 h1:HHDteefn6ZkTtY5fGUE8tj8uy85AHk6zP7CpzIAM0 github.com/redis/go-redis/v9 v9.6.1/go.mod h1:0C0c6ycQsdpVNQpxb1njEQIqkx5UcsM8FJCQLgE9+RA= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b h1:gQZ0qzfKHQIybLANtM3mBXNUtOfsCFXeTsnBqCsx1KM= @@ -313,12 +326,14 @@ golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= diff --git a/pkg/sip/client.go b/pkg/sip/client.go index 274fe20..d499d9c 100644 --- a/pkg/sip/client.go +++ b/pkg/sip/client.go @@ -20,9 +20,9 @@ import ( "log/slog" "sync" - "github.com/emiago/sipgo" - "github.com/emiago/sipgo/sip" "github.com/frostbyte73/core" + "github.com/livekit/sipgo" + "github.com/livekit/sipgo/sip" "golang.org/x/exp/maps" "github.com/livekit/protocol/logger" diff --git a/pkg/sip/inbound.go b/pkg/sip/inbound.go index 00223d5..2349882 100644 --- a/pkg/sip/inbound.go +++ b/pkg/sip/inbound.go @@ -25,9 +25,9 @@ import ( "sync/atomic" "time" - "github.com/emiago/sipgo/sip" "github.com/frostbyte73/core" "github.com/icholy/digest" + "github.com/livekit/sipgo/sip" "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/logger" @@ -831,16 +831,15 @@ func (s *Server) newInbound(id LocalTag, contact URI, invite *sip.Request, invit cancelled: make(chan struct{}), referDone: make(chan error), // Do not buffer the channel to avoid reading a result for an old request } - c.from, _ = invite.From() + c.from = invite.From() if c.from != nil { c.tag, _ = getTagFrom(c.from.Params) } - c.to, _ = invite.To() - h, _ := invite.CSeq() - if h != nil { + c.to = invite.To() + if h := invite.CSeq(); h != nil { c.nextRequestCSeq = h.SeqNo + 1 } - if callID, _ := invite.CallID(); callID != nil { + if callID := invite.CallID(); callID != nil { c.callID = callID.Value() } return c @@ -1015,7 +1014,7 @@ func (c *sipInbound) setDestFromVia(r *sip.Response) { // // Thus, instead of relying on LB, we will contact the source IP directly (should be the first Via). // BYE will also copy the same destination address from our response to INVITE. - if h, ok := c.invite.Via(); ok && h.Host != "" { + if h := c.invite.Via(); h != nil && h.Host != "" { port := 5060 if h.Port != 0 { port = h.Port @@ -1060,10 +1059,10 @@ func (c *sipInbound) AcceptBye(req *sip.Request, tx sip.ServerTransaction) { } func (c *sipInbound) swapSrcDst(req *sip.Request) { - if contact, ok := c.invite.Contact(); ok { - req.Recipient = &contact.Address + if contact := c.invite.Contact(); contact != nil { + req.Recipient = contact.Address } else { - req.Recipient = &c.from.Address + req.Recipient = c.from.Address } req.SetSource(c.inviteOk.Source()) req.SetDestination(c.inviteOk.Destination()) @@ -1071,7 +1070,7 @@ func (c *sipInbound) swapSrcDst(req *sip.Request) { req.AppendHeader((*sip.FromHeader)(c.to)) req.RemoveHeader("To") req.AppendHeader((*sip.ToHeader)(c.from)) - if route, ok := req.RecordRoute(); ok { + if route := req.RecordRoute(); route != nil { req.RemoveHeader("Record-Route") req.AppendHeader(&sip.RouteHeader{Address: route.Address}) } @@ -1134,7 +1133,7 @@ func (c *sipInbound) newReferReq(transferTo string) (*sip.Request, error) { return nil, psrpc.NewErrorf(psrpc.FailedPrecondition, "can't transfer non established call") // call wasn't established } - from, _ := c.invite.From() + from := c.invite.From() if from == nil { return nil, psrpc.NewErrorf(psrpc.InvalidArgument, "no From URI in invite") } @@ -1144,7 +1143,7 @@ func (c *sipInbound) newReferReq(transferTo string) (*sip.Request, error) { c.setCSeq(req) c.swapSrcDst(req) - cseq, _ := req.CSeq() + cseq := req.CSeq() if cseq == nil { return nil, psrpc.NewErrorf(psrpc.Internal, "missing CSeq header in REFER request") } diff --git a/pkg/sip/outbound.go b/pkg/sip/outbound.go index 9ddc57d..c4cfead 100644 --- a/pkg/sip/outbound.go +++ b/pkg/sip/outbound.go @@ -23,9 +23,9 @@ import ( "sync" "time" - "github.com/emiago/sipgo/sip" "github.com/frostbyte73/core" "github.com/icholy/digest" + "github.com/livekit/sipgo/sip" "golang.org/x/exp/maps" "github.com/livekit/protocol/livekit" @@ -624,8 +624,8 @@ authLoop: if err != nil { return nil, err } - toHeader, ok := resp.To() - if !ok { + toHeader := resp.To() + if toHeader == nil { return nil, errors.New("no 'To' header on Response") } @@ -643,31 +643,30 @@ authLoop: } c.invite, c.inviteOk = req, resp - var ok bool - toHeader, ok = resp.To() - if !ok { + toHeader = resp.To() + if toHeader == nil { return nil, errors.New("no To header in INVITE response") } + var ok bool c.tag, ok = getTagFrom(toHeader.Params) if !ok { return nil, errors.New("no tag in To header in INVITE response") } - if callID, _ := c.invite.CallID(); callID != nil { + if callID := c.invite.CallID(); callID != nil { c.callID = callID.Value() } - h, _ := c.invite.CSeq() - if h != nil { + if h := c.invite.CSeq(); h != nil { c.nextRequestCSeq = h.SeqNo + 1 } - if cont, ok := resp.Contact(); ok { - req.Recipient = &cont.Address + if cont := resp.Contact(); cont != nil { + req.Recipient = cont.Address if req.Recipient.Port == 0 { req.Recipient.Port = 5060 } } - if recordRouteHeader, ok := resp.RecordRoute(); ok { + if recordRouteHeader := resp.RecordRoute(); recordRouteHeader != nil { req.AppendHeader(&sip.RouteHeader{Address: recordRouteHeader.Address}) } @@ -685,7 +684,7 @@ func (c *sipOutbound) AckInvite(ctx context.Context) error { func (c *sipOutbound) attemptInvite(ctx context.Context, dest string, to *sip.ToHeader, offer []byte, authHeaderName, authHeader string, headers Headers) (*sip.Request, *sip.Response, error) { ctx, span := tracer.Start(ctx, "sipOutbound.attemptInvite") defer span.End() - req := sip.NewRequest(sip.INVITE, &to.Address) + req := sip.NewRequest(sip.INVITE, to.Address) req.SetDestination(dest) req.SetBody(offer) req.AppendHeader(to) @@ -772,7 +771,7 @@ func (c *sipOutbound) transferCall(ctx context.Context, transferTo string) error req := NewReferRequest(c.invite, c.inviteOk, c.contact, transferTo) c.setCSeq(req) - cseq, _ := req.CSeq() + cseq := req.CSeq() if cseq == nil { c.mu.Unlock() diff --git a/pkg/sip/protocol.go b/pkg/sip/protocol.go index 20aabca..98c1e86 100644 --- a/pkg/sip/protocol.go +++ b/pkg/sip/protocol.go @@ -23,8 +23,8 @@ import ( "strings" "time" - "github.com/emiago/sipgo/sip" "github.com/livekit/psrpc" + "github.com/livekit/sipgo/sip" "github.com/pkg/errors" "github.com/livekit/sip/pkg/config" @@ -66,12 +66,12 @@ type Signaling interface { } func transportFromReq(req *sip.Request) Transport { - if to, _ := req.To(); to != nil { + if to := req.To(); to != nil { if tr, _ := to.Params.Get("transport"); tr != "" { return Transport(strings.ToLower(tr)) } } - if via, _ := req.Via(); via != nil { + if via := req.Via(); via != nil { return Transport(strings.ToLower(via.Transport)) } return "" @@ -116,7 +116,7 @@ func NewReferRequest(inviteRequest *sip.Request, inviteResponse *sip.Response, c sip.CopyHeaders("Via", inviteRequest, req) // if inviteResponse.IsSuccess() { // update branch, 2xx ACK is separate Tx - viaHop, _ := req.Via() + viaHop := req.Via() viaHop.Params.Add("branch", sip.GenerateBranch()) // } @@ -138,25 +138,25 @@ func NewReferRequest(inviteRequest *sip.Request, inviteResponse *sip.Response, c maxForwardsHeader := sip.MaxForwardsHeader(70) req.AppendHeader(&maxForwardsHeader) - if h, _ := inviteRequest.From(); h != nil { + if h := inviteRequest.From(); h != nil { sip.CopyHeaders("From", inviteRequest, req) } - if h, _ := inviteResponse.To(); h != nil { + if h := inviteResponse.To(); h != nil { sip.CopyHeaders("To", inviteResponse, req) } - if h, _ := inviteRequest.CallID(); h != nil { + if h := inviteRequest.CallID(); h != nil { sip.CopyHeaders("Call-ID", inviteRequest, req) } - if h, _ := inviteRequest.CSeq(); h != nil { + if h := inviteRequest.CSeq(); h != nil { sip.CopyHeaders("CSeq", inviteRequest, req) } req.AppendHeader(contactHeader) - cseq, _ := req.CSeq() + cseq := req.CSeq() cseq.SeqNo = cseq.SeqNo + 1 cseq.MethodName = sip.REFER diff --git a/pkg/sip/protocol_test.go b/pkg/sip/protocol_test.go index 421c93d..67b6c67 100644 --- a/pkg/sip/protocol_test.go +++ b/pkg/sip/protocol_test.go @@ -3,7 +3,7 @@ package sip import ( "testing" - "github.com/emiago/sipgo/sip" + "github.com/livekit/sipgo/sip" "github.com/stretchr/testify/require" ) diff --git a/pkg/sip/server.go b/pkg/sip/server.go index b57be6c..5ecddf4 100644 --- a/pkg/sip/server.go +++ b/pkg/sip/server.go @@ -26,10 +26,10 @@ import ( "sync" "time" - "github.com/emiago/sipgo" - "github.com/emiago/sipgo/sip" "github.com/frostbyte73/core" "github.com/icholy/digest" + "github.com/livekit/sipgo" + "github.com/livekit/sipgo/sip" "golang.org/x/exp/maps" "github.com/livekit/protocol/logger" diff --git a/pkg/sip/service.go b/pkg/sip/service.go index 123b120..d1924c0 100644 --- a/pkg/sip/service.go +++ b/pkg/sip/service.go @@ -23,7 +23,7 @@ import ( "sync/atomic" "time" - "github.com/emiago/sipgo" + "github.com/livekit/sipgo" "google.golang.org/protobuf/types/known/emptypb" "github.com/livekit/protocol/logger" diff --git a/pkg/sip/service_test.go b/pkg/sip/service_test.go index 7e2c9e9..ed9dc3c 100644 --- a/pkg/sip/service_test.go +++ b/pkg/sip/service_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "github.com/emiago/sipgo" - "github.com/emiago/sipgo/sip" + "github.com/livekit/sipgo" + "github.com/livekit/sipgo/sip" "github.com/livekit/mediatransportutil/pkg/rtcconfig" "github.com/livekit/protocol/logger" diff --git a/pkg/sip/types.go b/pkg/sip/types.go index 6c476da..d6bc651 100644 --- a/pkg/sip/types.go +++ b/pkg/sip/types.go @@ -20,9 +20,9 @@ import ( "net/netip" "strconv" - "github.com/emiago/sipgo/sip" "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/logger" + "github.com/livekit/sipgo/sip" ) type Headers []sip.Header @@ -144,8 +144,8 @@ type LocalTag string type RemoteTag string func getFromTag(r *sip.Request) (RemoteTag, error) { - from, ok := r.From() - if !ok { + from := r.From() + if from == nil { return "", errors.New("no From on Request") } tag, ok := getTagFrom(from.Params) @@ -156,8 +156,8 @@ func getFromTag(r *sip.Request) (RemoteTag, error) { } func getToTag(r *sip.Response) (RemoteTag, error) { - to, ok := r.To() - if !ok { + to := r.To() + if to == nil { return "", errors.New("no To on Response") } tag, ok := getTagFrom(to.Params) diff --git a/pkg/siptest/client.go b/pkg/siptest/client.go index f14eb92..3889f57 100644 --- a/pkg/siptest/client.go +++ b/pkg/siptest/client.go @@ -33,10 +33,10 @@ import ( "github.com/at-wat/ebml-go" "github.com/at-wat/ebml-go/webm" - "github.com/emiago/sipgo" - "github.com/emiago/sipgo/sip" "github.com/frostbyte73/core" "github.com/icholy/digest" + "github.com/livekit/sipgo" + "github.com/livekit/sipgo/sip" "github.com/pion/sdp/v3" "github.com/livekit/sip/pkg/audiotest" @@ -286,8 +286,8 @@ func (c *Client) Dial(ip string, uri string, number string, headers map[string]s return err } - toHeader, ok := resp.To() - if !ok { + toHeader := resp.To() + if toHeader == nil { return errors.New("no To header on Request") } @@ -308,14 +308,14 @@ func (c *Client) Dial(ip string, uri string, number string, headers map[string]s break } - if contactHeader, ok := resp.Contact(); ok { - req.Recipient = &contactHeader.Address + if contactHeader := resp.Contact(); contactHeader != nil { + req.Recipient = contactHeader.Address if req.Recipient.Port == 0 { req.Recipient.Port = 5060 } } - if recordRouteHeader, ok := resp.RecordRoute(); ok { + if recordRouteHeader := resp.RecordRoute(); recordRouteHeader != nil { req.AppendHeader(&sip.RouteHeader{Address: recordRouteHeader.Address}) } @@ -334,7 +334,7 @@ func (c *Client) Dial(ip string, uri string, number string, headers map[string]s c.inviteReq = req c.inviteResp = resp - if h, ok := req.CSeq(); ok { + if h := req.CSeq(); h != nil { c.lastCSeq.Store(h.SeqNo) } @@ -344,7 +344,7 @@ func (c *Client) Dial(ip string, uri string, number string, headers map[string]s } func (c *Client) attemptInvite(ip, uri, number string, offer []byte, authHeader string, headers map[string]string) (*sip.Request, *sip.Response, error) { - req := sip.NewRequest(sip.INVITE, &sip.Uri{User: number, Host: uri}) + req := sip.NewRequest(sip.INVITE, sip.Uri{User: number, Host: uri}) req.SetDestination(ip) req.SetBody(offer) req.AppendHeader(sip.NewHeader("Content-Type", "application/sdp")) @@ -378,7 +378,7 @@ func (c *Client) sendBye() { req.AppendHeader(sip.NewHeader("User-Agent", "LiveKit")) cseq := c.lastCSeq.Add(1) - cseqH, _ := req.CSeq() + cseqH := req.CSeq() cseqH.SeqNo = cseq tx, err := c.sipClient.TransactionRequest(req) @@ -402,12 +402,12 @@ func (c *Client) SendDTMF(digits string) error { } func (c *Client) SendNotify(eventReq *sip.Request, notifyStatus string) error { - var recipient *sip.Uri + var recipient sip.Uri - if contact, ok := eventReq.Contact(); ok { - recipient = &contact.Address - } else if from, ok := eventReq.From(); ok { - recipient = &from.Address + if contact := eventReq.Contact(); contact != nil { + recipient = contact.Address + } else if from := eventReq.From(); from != nil { + recipient = from.Address } else { return errors.New("missing destination address") } @@ -435,19 +435,19 @@ func (c *Client) SendNotify(eventReq *sip.Request, notifyStatus string) error { maxForwardsHeader := sip.MaxForwardsHeader(70) req.AppendHeader(&maxForwardsHeader) - if to, ok := eventReq.To(); ok { + if to := eventReq.To(); to != nil { req.AppendHeader((*sip.FromHeader)(to)) } else { return errors.New("missing To header in REFER request") } - if from, ok := eventReq.From(); ok { + if from := eventReq.From(); from != nil { req.AppendHeader((*sip.ToHeader)(from)) } else { return errors.New("missing From header in REFER request") } - if callId, ok := eventReq.CallID(); ok { + if callId := eventReq.CallID(); callId != nil { req.AppendHeader(callId) } @@ -465,7 +465,7 @@ func (c *Client) SendNotify(eventReq *sip.Request, notifyStatus string) error { req.SetSource(eventReq.Destination()) req.SetDestination(eventReq.Source()) - if eventCSeq, ok := eventReq.CSeq(); ok { + if eventCSeq := eventReq.CSeq(); eventCSeq != nil { req.AppendHeader(sip.NewHeader("Event", fmt.Sprintf("refer;id=%d", eventCSeq.SeqNo))) } else { return errors.New("missing CSeq header in REFER request") diff --git a/test/integration/sip_test.go b/test/integration/sip_test.go index 2199d13..53e3c6c 100644 --- a/test/integration/sip_test.go +++ b/test/integration/sip_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - sipgo "github.com/emiago/sipgo/sip" + sipgo "github.com/livekit/sipgo/sip" "github.com/stretchr/testify/require" "github.com/livekit/mediatransportutil/pkg/rtcconfig" From 6adf0660579851cd14d1c4c019dd90b2f86c7d93 Mon Sep 17 00:00:00 2001 From: Benjamin Pracht Date: Tue, 5 Nov 2024 16:30:18 -0800 Subject: [PATCH 6/7] test --- go.mod | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index b4fd486..91c00a9 100644 --- a/go.mod +++ b/go.mod @@ -129,4 +129,6 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect ) -replace github.com/emiago/sipgo => github.com/livekit/sipgo v0.13.2-0.20241101175057-8eb38293fc69 +replace github.com/emiago/sipgo => ../sipgo + +//replace github.com/emiago/sipgo => github.com/livekit/sipgo v0.13.2-0.20241101175057-8eb38293fc69 From 9c878b1606338689c8ceee667e0a5d7046aaf719 Mon Sep 17 00:00:00 2001 From: Benjamin Pracht Date: Wed, 6 Nov 2024 10:55:21 -0800 Subject: [PATCH 7/7] WiP --- go.mod | 2 +- go.sum | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 510be62..5fd93fa 100644 --- a/go.mod +++ b/go.mod @@ -133,6 +133,6 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect ) -replace github.com/emiago/sipgo => ../sipgo +replace github.com/livekit/sipgo => ../sipgo //replace github.com/emiago/sipgo => github.com/livekit/sipgo v0.13.2-0.20241101175057-8eb38293fc69 diff --git a/go.sum b/go.sum index f35516d..f4fe4a5 100644 --- a/go.sum +++ b/go.sum @@ -32,6 +32,7 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/containerd/continuity v0.4.3 h1:6HVkalIp+2u1ZLH1J/pYX2oBVXlJZvh1X1A7bEZ9Su8= github.com/containerd/continuity v0.4.3/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= @@ -49,6 +50,8 @@ github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/emiago/sipgo v0.24.1 h1:RKy6NqVnvjgpLywo1sa4v+lwfEz5O5/0yk4Z8eek4XM= +github.com/emiago/sipgo v0.24.1/go.mod h1:UB0Ao5xk1b1TQisO29jmUDz0mXNINpHBR4YXsLbLXEs= github.com/envoyproxy/protoc-gen-validate v1.1.0 h1:tntQDh69XqOCOZsDz0lVJQez/2L6Uu2PdjCQwWCJ3bM= github.com/envoyproxy/protoc-gen-validate v1.1.0/go.mod h1:sXRDRVmzEbkM7CVcM06s9shE/m23dg3wzjl0UWqJ2q4= github.com/frostbyte73/core v0.0.12 h1:kySA8+Os6eqnPFoExD2T7cehjSAY1MRyIViL0yTy2uc= @@ -72,6 +75,7 @@ github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.4.0 h1:CTaoG1tojrh4ucGPcoJFiAQUAsEWekEWvLy7GsVNqGs= github.com/gobwas/ws v1.4.0/go.mod h1:G3gNqMNtPppf5XUz7O4shetPpcZ1VJ7zt18dlUeakrc= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/google/cel-go v0.21.0 h1:cl6uW/gxN+Hy50tNYvI691+sXxioCnstFzLp2WO4GCI= @@ -124,12 +128,16 @@ github.com/livekit/psrpc v0.6.1-0.20240924010758-9f0a4268a3b9 h1:33oBjGpVD9tYkDX github.com/livekit/psrpc v0.6.1-0.20240924010758-9f0a4268a3b9/go.mod h1:CQUBSPfYYAaevg1TNCc6/aYsa8DJH4jSRFdCeSZk5u0= github.com/livekit/server-sdk-go/v2 v2.2.2-0.20241015094126-b8538ae5d67b h1:R1GpKwVbSYsG08k5sIkNCukvnrkOE18R8IO1YeujR8o= github.com/livekit/server-sdk-go/v2 v2.2.2-0.20241015094126-b8538ae5d67b/go.mod h1:m2IukIyPCvJCdx04mdWIud9FoCBUAWc3526x3KgT8qY= -github.com/livekit/sipgo v0.13.2-0.20241021131531-e4db84deff2c h1:KquO53e0/2HPNnYf91w0MW+AbFGVvXRMnbvsxZ7sk/Y= -github.com/livekit/sipgo v0.13.2-0.20241021131531-e4db84deff2c/go.mod h1:nbNi0IsYn4tyY2ab7Rafvifty07miHYvgedPMKWbaI4= github.com/mackerelio/go-osstat v0.2.4 h1:qxGbdPkFo65PXOb/F/nhDKpF2nGmGaCFDLXoZjJTtUs= github.com/mackerelio/go-osstat v0.2.4/go.mod h1:Zy+qzGdZs3A9cuIqmgbJvwbmLQH9dJvtio5ZjJTbdlQ= github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg= github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mjibson/go-dsp v0.0.0-20180508042940-11479a337f12 h1:dd7vnTDfjtwCETZDrRe+GPYNLA1jBtbZeyfyE8eZCyk= @@ -210,8 +218,13 @@ github.com/redis/go-redis/v9 v9.6.1 h1:HHDteefn6ZkTtY5fGUE8tj8uy85AHk6zP7CpzIAM0 github.com/redis/go-redis/v9 v9.6.1/go.mod h1:0C0c6ycQsdpVNQpxb1njEQIqkx5UcsM8FJCQLgE9+RA= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b h1:gQZ0qzfKHQIybLANtM3mBXNUtOfsCFXeTsnBqCsx1KM= +github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= @@ -311,12 +324,14 @@ golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=