Skip to content

Commit bd4ac71

Browse files
committed
Sending Request terminated status when Call is cancelled
1 parent 79de1f3 commit bd4ac71

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pkg/sip/inbound.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ func (c *inboundCall) closeWithCancelled() {
933933
c.state.DeferUpdate(func(info *livekit.SIPCallInfo) {
934934
info.DisconnectReason = livekit.DisconnectReason_CLIENT_INITIATED
935935
})
936-
c.close(false, CallHangup, "cancelled")
936+
c.close(false, CallCancelled, "cancelled")
937937
}
938938

939939
func (c *inboundCall) closeWithHangup() {
@@ -1289,7 +1289,6 @@ func (c *sipInbound) StartRinging() {
12891289
case r := <-cancels:
12901290
close(c.cancelled)
12911291
_ = tx.Respond(sip.NewResponseFromRequest(r, sip.StatusOK, "OK", nil))
1292-
c.RespondAndDrop(sip.StatusRequestTerminated, "Request Terminated")
12931292
return
12941293
case <-ticker.C:
12951294
}

pkg/sip/participant.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ func (v CallStatus) Attribute() string {
6868
return "active"
6969
case CallHangup:
7070
return "hangup"
71+
case CallCancelled:
72+
return "cancelled"
7173
}
7274
}
7375

@@ -89,6 +91,8 @@ func (v CallStatus) SIPStatus() (sip.StatusCode, string) {
8991
switch v {
9092
default:
9193
return sip.StatusBusyHere, "Rejected"
94+
case CallCancelled:
95+
return sip.StatusRequestTerminated, "RequestTerminated"
9296
case callMediaFailed:
9397
return sip.StatusNotAcceptableHere, "MediaFailed"
9498
}
@@ -101,6 +105,7 @@ const (
101105
CallRinging
102106
CallAutomation
103107
CallActive
108+
CallCancelled
104109
CallHangup
105110
callUnavailable
106111
callRejected

0 commit comments

Comments
 (0)