Skip to content

Commit 2974355

Browse files
CopilotTECH7Fox
andcommitted
Revert popup_config type to Object to support custom popups
Co-authored-by: TECH7Fox <32220029+TECH7Fox@users.noreply.github.com>
1 parent 7aa01ff commit 2974355

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/sip-core.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export interface SIPCoreConfig {
6868
/** Output configuration */
6969
out: String;
7070
auto_answer: boolean;
71-
popup_config: PopupConfig | null;
71+
popup_config: Object | null;
7272
popup_override_component: string | null;
7373
/**
7474
* Whether to use video in SIP calls.
@@ -553,11 +553,14 @@ export class SIPCore {
553553
let shouldAutoAnswer = this.config.auto_answer; // Default to global setting
554554

555555
// Check if there's an extension-specific auto_answer setting
556-
if (this.config.popup_config?.extensions?.[callerExtension]) {
557-
const extensionConfig = this.config.popup_config.extensions[callerExtension];
558-
if (typeof extensionConfig.auto_answer === 'boolean') {
559-
shouldAutoAnswer = extensionConfig.auto_answer;
560-
console.info(`Using extension-specific auto_answer for ${callerExtension}: ${shouldAutoAnswer}`);
556+
if (this.config.popup_config && typeof this.config.popup_config === 'object') {
557+
const popupConfig = this.config.popup_config as any;
558+
if (popupConfig.extensions?.[callerExtension]) {
559+
const extensionConfig = popupConfig.extensions[callerExtension];
560+
if (typeof extensionConfig.auto_answer === 'boolean') {
561+
shouldAutoAnswer = extensionConfig.auto_answer;
562+
console.info(`Using extension-specific auto_answer for ${callerExtension}: ${shouldAutoAnswer}`);
563+
}
561564
}
562565
}
563566

0 commit comments

Comments
 (0)