Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0122b01037 | |||
| d8d857e82e | |||
| ab6b36c12c | |||
| f69b849ed7 | |||
| 3e103f18a5 | |||
| 746a492cd4 | |||
| c76a900b19 |
@@ -2,12 +2,9 @@ package models
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type DBCall struct {
|
type DBCall struct {
|
||||||
gorm.Model
|
|
||||||
AfterCallWorkRequired bool
|
AfterCallWorkRequired bool
|
||||||
Confined bool
|
Confined bool
|
||||||
ConnectedTime *time.Time `gorm:"index"`
|
ConnectedTime *time.Time `gorm:"index"`
|
||||||
|
|||||||
@@ -2,12 +2,9 @@ package models
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type DBConversation struct {
|
type DBConversation struct {
|
||||||
gorm.Model
|
|
||||||
Address *string
|
Address *string
|
||||||
DivisionIds *string `gorm:"type:json"`
|
DivisionIds *string `gorm:"type:json"`
|
||||||
End *time.Time `gorm:"index"`
|
End *time.Time `gorm:"index"`
|
||||||
|
|||||||
@@ -2,12 +2,9 @@ package models
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type DBParticipant struct {
|
type DBParticipant struct {
|
||||||
gorm.Model
|
|
||||||
Address *string
|
Address *string
|
||||||
Attributes *string `gorm:"type:json"`
|
Attributes *string `gorm:"type:json"`
|
||||||
ConnectedTime *time.Time `gorm:"index"`
|
ConnectedTime *time.Time `gorm:"index"`
|
||||||
|
|||||||
16
models/queue_log.go
Normal file
16
models/queue_log.go
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
package models
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
|
type DBQueueLog struct {
|
||||||
|
Queue string `gorm:"primaryKey"`
|
||||||
|
ConversationId string `gorm:"primaryKey"`
|
||||||
|
Start time.Time `gorm:"index"`
|
||||||
|
End time.Time `gorm:"index"`
|
||||||
|
Duration float64
|
||||||
|
Result string `gorm:"type:json"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (DBQueueLog) TableName() string {
|
||||||
|
return "gc_queue_logs"
|
||||||
|
}
|
||||||
@@ -1,5 +1,10 @@
|
|||||||
package models
|
package models
|
||||||
|
|
||||||
|
type AnalyticsConversationWithAttributesQuery struct {
|
||||||
|
Conversations []AnalyticsConversationWithAttributes `json:"conversations"`
|
||||||
|
Cursor *string `json:"cursor"`
|
||||||
|
}
|
||||||
|
|
||||||
type AnalyticsConversationWithAttributes struct {
|
type AnalyticsConversationWithAttributes struct {
|
||||||
ConversationEnd string `json:"conversationEnd"`
|
ConversationEnd string `json:"conversationEnd"`
|
||||||
ConversationId string `json:"conversationId"`
|
ConversationId string `json:"conversationId"`
|
||||||
|
|||||||
@@ -2,12 +2,9 @@ package models
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type DBSegment struct {
|
type DBSegment struct {
|
||||||
gorm.Model
|
|
||||||
Id string `gorm:"primaryKey;index"`
|
Id string `gorm:"primaryKey;index"`
|
||||||
Conference bool
|
Conference bool
|
||||||
DisconnectType string
|
DisconnectType string
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
package models
|
package models
|
||||||
|
|
||||||
import "gorm.io/gorm"
|
|
||||||
|
|
||||||
type DBSession struct {
|
type DBSession struct {
|
||||||
gorm.Model
|
|
||||||
Ani string
|
Ani string
|
||||||
Direction string
|
Direction string
|
||||||
Dnis string
|
Dnis string
|
||||||
|
|||||||
@@ -33,8 +33,6 @@ func ExtractWithoutAttributes(base models.AnalyticsConversationWithoutAttributes
|
|||||||
}
|
}
|
||||||
divisionIdsBytesStr := string(divisionIdsBytes)
|
divisionIdsBytesStr := string(divisionIdsBytes)
|
||||||
|
|
||||||
currentTime := time.Now()
|
|
||||||
|
|
||||||
conversation := models.DBConversation{
|
conversation := models.DBConversation{
|
||||||
DivisionIds: &divisionIdsBytesStr,
|
DivisionIds: &divisionIdsBytesStr,
|
||||||
End: endTime,
|
End: endTime,
|
||||||
@@ -43,7 +41,6 @@ func ExtractWithoutAttributes(base models.AnalyticsConversationWithoutAttributes
|
|||||||
MinRFactor: &base.MediaStatsMinConversationRFactor,
|
MinRFactor: &base.MediaStatsMinConversationRFactor,
|
||||||
OriginatingDirection: &base.OriginatingDirection,
|
OriginatingDirection: &base.OriginatingDirection,
|
||||||
Start: startTime,
|
Start: startTime,
|
||||||
SemiLiveUpdate: ¤tTime,
|
|
||||||
}
|
}
|
||||||
var participants []models.DBParticipant
|
var participants []models.DBParticipant
|
||||||
var sessions []models.DBSession
|
var sessions []models.DBSession
|
||||||
@@ -129,7 +126,6 @@ func ExtractWithoutAttributes(base models.AnalyticsConversationWithoutAttributes
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ExtractLive(base models.NotificationConversationWithAttributes) (models.DBConversation, []models.DBParticipant, []models.DBCall) {
|
func ExtractLive(base models.NotificationConversationWithAttributes) (models.DBConversation, []models.DBParticipant, []models.DBCall) {
|
||||||
currentTime := time.Now()
|
|
||||||
|
|
||||||
conversation := models.DBConversation{
|
conversation := models.DBConversation{
|
||||||
Id: base.Id,
|
Id: base.Id,
|
||||||
@@ -138,7 +134,6 @@ func ExtractLive(base models.NotificationConversationWithAttributes) (models.DBC
|
|||||||
RecordingState: &base.RecordingState,
|
RecordingState: &base.RecordingState,
|
||||||
SecurePause: &base.SecurePause,
|
SecurePause: &base.SecurePause,
|
||||||
UtilizationLabelId: &base.UtilizationLabelId,
|
UtilizationLabelId: &base.UtilizationLabelId,
|
||||||
LiveUpdate: ¤tTime,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var participants []models.DBParticipant
|
var participants []models.DBParticipant
|
||||||
@@ -284,8 +279,6 @@ func ExtractWithAttributes(base models.AnalyticsConversationWithAttributes) (mod
|
|||||||
}
|
}
|
||||||
divisionIdsBytesStr := string(divisionIdsBytes)
|
divisionIdsBytesStr := string(divisionIdsBytes)
|
||||||
|
|
||||||
currentTime := time.Now()
|
|
||||||
|
|
||||||
conversation := models.DBConversation{
|
conversation := models.DBConversation{
|
||||||
DivisionIds: &divisionIdsBytesStr,
|
DivisionIds: &divisionIdsBytesStr,
|
||||||
End: endTime,
|
End: endTime,
|
||||||
@@ -294,7 +287,6 @@ func ExtractWithAttributes(base models.AnalyticsConversationWithAttributes) (mod
|
|||||||
MinRFactor: &base.MediaStatsMinConversationRFactor,
|
MinRFactor: &base.MediaStatsMinConversationRFactor,
|
||||||
OriginatingDirection: &base.OriginatingDirection,
|
OriginatingDirection: &base.OriginatingDirection,
|
||||||
Start: startTime,
|
Start: startTime,
|
||||||
JobUpdate: ¤tTime,
|
|
||||||
}
|
}
|
||||||
var participants []models.DBParticipant
|
var participants []models.DBParticipant
|
||||||
var sessions []models.DBSession
|
var sessions []models.DBSession
|
||||||
|
|||||||
Reference in New Issue
Block a user