Skip to content

Commit ad3ba54

Browse files
authored
Add an option to proceed with the call if ACK is missing. (#457)
1 parent ae2ce6e commit ad3ba54

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

pkg/config/config.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ type Config struct {
103103
// internal
104104
ServiceName string `yaml:"-"`
105105
NodeID string // Do not provide, will be overwritten
106+
107+
// Experimental, these option might go away without notice.
108+
Experimental struct {
109+
IgnoreMissingACK bool `yaml:"ignore_missing_ack"`
110+
} `yaml:"experimental"`
106111
}
107112

108113
func NewConfig(confString string) (*Config, error) {

pkg/sip/inbound.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -617,14 +617,19 @@ func (c *inboundCall) handleInvite(ctx context.Context, req *sip.Request, trunkI
617617
headers = AttrsToHeaders(r.LocalParticipant.Attributes(), c.attrsToHdr, headers)
618618
}
619619
c.log.Infow("Accepting the call", "headers", headers)
620-
if err := c.cc.Accept(ctx, answerData, headers); err != nil {
621-
if errors.Is(err, errNoACK) {
620+
err := c.cc.Accept(ctx, answerData, headers)
621+
if errors.Is(err, errNoACK) {
622+
if !c.s.conf.Experimental.IgnoreMissingACK {
622623
c.log.Errorw("Call accepted, but no ACK received", err)
623624
c.close(true, callNoACK, "no-ack")
624-
} else {
625-
c.log.Errorw("Cannot accept the call", err)
626-
c.close(true, callAcceptFailed, "accept-failed")
625+
return false, err
627626
}
627+
c.log.Warnw("Call accepted, but no ACK received", err)
628+
err = nil // ignore
629+
}
630+
if err != nil {
631+
c.log.Errorw("Cannot accept the call", err)
632+
c.close(true, callAcceptFailed, "accept-failed")
628633
return false, err
629634
}
630635
c.media.EnableTimeout(true)

0 commit comments

Comments
 (0)