Skip to content

Add per-extension auto_answer configuration with global fallback#183

Draft
Copilot wants to merge 5 commits intomainfrom
copilot/set-auto-answer-per-extension
Draft

Add per-extension auto_answer configuration with global fallback#183
Copilot wants to merge 5 commits intomainfrom
copilot/set-auto-answer-per-extension

Conversation

Copy link
Contributor

Copilot AI commented Feb 1, 2026

Plan: Make auto_answer configurable at extension level

  • Update the TypeScript interface and logic to support per-extension auto_answer
    • Update Extension interface in sip-call-dialog.ts to include auto_answer property
    • Modify the auto_answer logic in sip-core.ts to check for extension-specific configuration
    • Fall back to global auto_answer if extension-specific is not set
  • Update defaults.py example to show how to configure auto_answer per extension
  • Build the TypeScript code successfully
  • Address code review feedback
    • Revert popup_config type to Object | null to support custom popups
    • Remove unused PopupExtension and PopupConfig types from sip-core.ts
    • Add proper type checking with typeof extensionConfig.auto_answer === 'boolean'
    • Use type guards to safely access extension configuration
  • Rebuild successfully with improved type safety
  • Run security scan with codeql_checker (no vulnerabilities found)

Summary

Feature Complete: The auto_answer configuration is now available at the extension level with proper fallback to the global setting.

Changes Made to Address Feedback

  1. Changed popup_config type from PopupConfig | null back to Object | null in the SIPCoreConfig interface to maintain compatibility with custom popups
  2. Removed unused PopupExtension and PopupConfig type definitions from sip-core.ts (they exist in sip-call-dialog.ts where they're actually used)

How to Use

To enable auto-answer for specific extensions, add the auto_answer property to the extension configuration in popup_config.extensions:

sip_config:
  auto_answer: false  # Global setting (default)
  popup_config:
    extensions:
      "8001":  # Extension number (e.g., doorbell)
        name: "Doorbell"
        camera_entity: "camera.doorbell"
        auto_answer: true  # This extension will auto-answer
      "008":  # This extension will NOT auto-answer (uses global setting)
        name: "Bob"

Technical Details

  • Extension-specific auto_answer takes precedence over global setting
  • If not specified for an extension, falls back to the global auto_answer value
  • Type-safe implementation with proper type guards
  • Supports custom popup configurations by keeping popup_config as generic Object type
  • Zero security vulnerabilities detected
Original prompt

This section details on the original issue you should resolve

<issue_title>Set Auto_answer to be configurable at extension level instead of global level</issue_title>
<issue_description>I used to have a setup with the old 3.0.0 version that would allow me to call an extension and I could set that specific extension to auto answer but not the others.

In the new SIP Core config, the auto_answer variable seems to only be a global config instead of per extension, I would like the have it configurable per extension again.</issue_description>

<agent_instructions>still use the global auto_answer option as fallback.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 1, 2026 16:23
Co-authored-by: TECH7Fox <32220029+TECH7Fox@users.noreply.github.com>
Co-authored-by: TECH7Fox <32220029+TECH7Fox@users.noreply.github.com>
Copilot AI changed the title [WIP] Set auto_answer to be configurable at extension level Add per-extension auto_answer configuration with global fallback Feb 1, 2026
Copilot AI requested a review from TECH7Fox February 1, 2026 16:27
@TECH7Fox
Copy link
Owner

TECH7Fox commented Feb 1, 2026

@copilot you cant give popup a config type, since it needs to support custom popups

Co-authored-by: TECH7Fox <32220029+TECH7Fox@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 1, 2026

@copilot you cant give popup a config type, since it needs to support custom popups

You're right. I've reverted popup_config back to Object | null in the SIPCoreConfig interface to maintain compatibility with custom popups. The auto_answer logic now uses proper type guards to safely access the extension configuration. (commit 2974355)

@TECH7Fox
Copy link
Owner

TECH7Fox commented Feb 1, 2026

@copilot so also remove the unused types

Co-authored-by: TECH7Fox <32220029+TECH7Fox@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 1, 2026

@copilot so also remove the unused types

Removed the unused PopupExtension and PopupConfig types from sip-core.ts. (commit 01e343d)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set Auto_answer to be configurable at extension level instead of global level

2 participants