From 57eaefb3263d2dc7d7f8f35dd9477072e697473b Mon Sep 17 00:00:00 2001 From: Benjamin Pracht Date: Tue, 19 Nov 2024 12:55:30 -0800 Subject: [PATCH 1/2] try not reusing callid --- pkg/sip/outbound.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/sip/outbound.go b/pkg/sip/outbound.go index 96ddd18..0501ddf 100644 --- a/pkg/sip/outbound.go +++ b/pkg/sip/outbound.go @@ -721,12 +721,12 @@ func (c *sipOutbound) attemptInvite(ctx context.Context, prev *sip.Request, dest ctx, span := tracer.Start(ctx, "sipOutbound.attemptInvite") defer span.End() req := sip.NewRequest(sip.INVITE, to.Address) - if prev != nil { + /* if prev != nil { if cid := prev.CallID(); cid != nil { req.RemoveHeader("Call-ID") req.AppendHeader(cid) } - } + }*/ req.SetDestination(dest) req.SetBody(offer) req.AppendHeader(to) From 7c129adabfcc9476870c5b5bdbadaf3eeb319990 Mon Sep 17 00:00:00 2001 From: Benjamin Pracht Date: Tue, 19 Nov 2024 13:34:45 -0800 Subject: [PATCH 2/2] Disable call ID reuse across auth attempts --- pkg/sip/outbound.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/sip/outbound.go b/pkg/sip/outbound.go index 0501ddf..a9df96d 100644 --- a/pkg/sip/outbound.go +++ b/pkg/sip/outbound.go @@ -721,12 +721,15 @@ func (c *sipOutbound) attemptInvite(ctx context.Context, prev *sip.Request, dest ctx, span := tracer.Start(ctx, "sipOutbound.attemptInvite") defer span.End() req := sip.NewRequest(sip.INVITE, to.Address) - /* if prev != nil { + + const reuseCallID = false // FIXME some service may require the call ID to be kept between auth attempts, but Telnyx requires it to change + + if reuseCallID && prev != nil { if cid := prev.CallID(); cid != nil { req.RemoveHeader("Call-ID") req.AppendHeader(cid) } - }*/ + } req.SetDestination(dest) req.SetBody(offer) req.AppendHeader(to)