Add VoIP webhook connector for call logging, notifications, and optional click-to-call; align brand to Montact.

This commit is contained in:
2026-09-27 08:47:11 +03:30
parent 26085b54a9
commit db65b55660
17 changed files with 1385 additions and 14 deletions
+6 -6
View File
@@ -6,18 +6,18 @@
export const brand = {
id: 'montact',
name: 'Montact',
nameFa: 'منتکت',
nameFa: 'مُنتَکت',
fullName: 'Montact CRM',
company: 'Mentech',
taglineFa: 'نرم‌افزار مدیریت ارتباط با مشتری',
logo: '/brand/logo.png',
askPlaceholderFa: 'از منتکت بپرس...',
askLabelFa: 'از منتکت بپرس',
askPlaceholderFa: 'از مُنتَکت بپرس...',
askLabelFa: 'از مُنتَکت بپرس',
memoryEn: 'Montact Memory',
aiName: 'Montact AI',
aiNameFa: 'دستیار هوشمند منتکت',
suggestionPrefixFa: 'پیشنهاد منتکت:',
reminderPrefixFa: 'یادآوری منتکت:',
aiNameFa: 'دستیار هوشمند مُنتَکت',
suggestionPrefixFa: 'پیشنهاد مُنتَکت:',
reminderPrefixFa: 'یادآوری مُنتَکت:',
filePrefix: 'montact',
} as const;
+78 -1
View File
@@ -122,7 +122,8 @@ export type OrgModuleKey =
| "public_api"
| "sms_campaigns"
| "teams"
| "woocommerce";
| "woocommerce"
| "voip";
export const ORG_MODULE_KEYS: OrgModuleKey[] = [
"customers",
@@ -155,6 +156,7 @@ export const ORG_MODULE_KEYS: OrgModuleKey[] = [
"sms_campaigns",
"teams",
"woocommerce",
"voip",
];
export const ORG_MODULE_LABELS: Record<OrgModuleKey, string> = {
@@ -188,6 +190,7 @@ export const ORG_MODULE_LABELS: Record<OrgModuleKey, string> = {
sms_campaigns: "پیامک گروهی",
teams: "تیم‌ها و دیدپذیری",
woocommerce: "ووکامرس",
voip: "تلفن سازمانی",
};
export const ORG_MODULE_GROUPS: Array<{
@@ -228,6 +231,7 @@ export const ORG_MODULE_GROUPS: Array<{
"reports",
"saved_views",
"woocommerce",
"voip",
],
},
{
@@ -3203,3 +3207,76 @@ export interface WooCommerceOrderLinkDto {
currency: string;
syncedAt: string;
}
/* ——— تلفن سازمانی / VoIP ——— */
export type VoipCallDirection = "inbound" | "outbound";
export type VoipCallStatus =
| "ringing"
| "answered"
| "missed"
| "completed"
| "failed";
export interface VoipConnectionDto {
id: string;
label: string;
enabled: boolean;
webhookSecretSet: boolean;
/** قالب URL برای شروع تماس؛ {number} جایگزین می‌شود */
clickToCallUrl: string | null;
lastEventAt: string | null;
lastError: string | null;
callCount: number;
createdAt: string;
updatedAt: string;
}
export interface CreateVoipConnectionRequest {
label: string;
webhookSecret?: string;
clickToCallUrl?: string | null;
enabled?: boolean;
}
export interface UpdateVoipConnectionRequest {
label?: string;
webhookSecret?: string | null;
clickToCallUrl?: string | null;
enabled?: boolean;
}
export interface VoipCallLogDto {
id: string;
direction: VoipCallDirection;
status: VoipCallStatus | string;
fromNumber: string | null;
toNumber: string | null;
personId: string | null;
personName: string | null;
activityId: string | null;
durationSec: number | null;
startedAt: string;
syncedAt: string;
}
export interface VoipClickToCallRequest {
number: string;
personId?: string;
}
export interface VoipWebhookEvent {
/** شناسه یکتای تماس در سانترال */
callId: string;
direction: VoipCallDirection;
status: VoipCallStatus | string;
from?: string;
to?: string;
startedAt?: string;
endedAt?: string;
durationSec?: number;
/** برای سازگاری با فیلدهای رایج دیگر */
caller?: string;
callee?: string;
}