Add VoIP webhook connector for call logging, notifications, and optional click-to-call; align brand to Montact.
This commit is contained in:
@@ -199,6 +199,7 @@ model Organization {
|
||||
webhookEndpoints WebhookEndpoint[]
|
||||
smsCampaigns SmsCampaign[]
|
||||
wooCommerceConnections WooCommerceConnection[]
|
||||
voipConnections VoipConnection[]
|
||||
}
|
||||
|
||||
model User {
|
||||
@@ -1780,3 +1781,52 @@ model WooCommerceOrderLink {
|
||||
@@index([organizationId, syncedAt])
|
||||
@@index([invoiceId])
|
||||
}
|
||||
|
||||
/// اتصال تلفن سازمانی / سانترال (وبهوک عمومی)
|
||||
model VoipConnection {
|
||||
id String @id @default(cuid())
|
||||
organizationId String
|
||||
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
||||
label String
|
||||
enabled Boolean @default(true)
|
||||
webhookSecretCiphertext String?
|
||||
webhookSecretIv String?
|
||||
webhookSecretTag String?
|
||||
/// قالب URL شروع تماس؛ جای {number} شماره مینشیند
|
||||
clickToCallUrl String?
|
||||
lastEventAt DateTime?
|
||||
lastError String?
|
||||
calls VoipCallLog[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([organizationId, enabled])
|
||||
}
|
||||
|
||||
model VoipCallLog {
|
||||
id String @id @default(cuid())
|
||||
organizationId String
|
||||
connectionId String
|
||||
connection VoipConnection @relation(fields: [connectionId], references: [id], onDelete: Cascade)
|
||||
externalCallId String
|
||||
/// inbound | outbound
|
||||
direction String @default("inbound")
|
||||
/// ringing | answered | missed | completed | failed
|
||||
status String @default("completed")
|
||||
fromNumber String?
|
||||
toNumber String?
|
||||
personId String?
|
||||
activityId String?
|
||||
durationSec Int?
|
||||
startedAt DateTime @default(now())
|
||||
endedAt DateTime?
|
||||
rawPayload Json?
|
||||
syncedAt DateTime @default(now())
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([connectionId, externalCallId])
|
||||
@@index([organizationId, syncedAt])
|
||||
@@index([personId])
|
||||
@@index([activityId])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user