42 lines
1.2 KiB
Go
42 lines
1.2 KiB
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// DBCall is a model that stores raw 'call' payloads from GenesysCloud websockets.
|
|
//
|
|
// - The ExtractLive function handles the conversion from JSON data (map) into formatted JSON string.
|
|
//
|
|
// Table Schema:
|
|
//
|
|
// Primary Key: Id
|
|
// Indexes: ConnectedTime, DisconnectedTime, Id, ParticipantId
|
|
// JSON Fields: DisconnectReasons, Other, Self
|
|
type DBCall struct {
|
|
AfterCallWorkRequired bool
|
|
Confined bool
|
|
ConnectedTime *time.Time `gorm:"index"`
|
|
Direction string
|
|
DisconnectReasons string `gorm:"type:json"`
|
|
DisconnectType string
|
|
DisconnectedTime *time.Time `gorm:"index"`
|
|
Held bool
|
|
Id string `gorm:"primaryKey;index"`
|
|
InitialState string
|
|
Muted bool
|
|
Other string `gorm:"type:json"`
|
|
ParticipantId string `gorm:"foreignKey;index"`
|
|
PeerId string
|
|
Provider string
|
|
Recording bool
|
|
RecordingState string
|
|
SecurePause bool
|
|
Self string `gorm:"type:json"`
|
|
State string
|
|
}
|
|
|
|
func (DBCall) TableName() string {
|
|
return "gc_calls"
|
|
}
|