asterisk-tester

0
0
Source

Тестирование сценариев Asterisk dialplan и потоков звонков используя безопасные Local каналы. Использовать при тестировании логики маршрутизации звонков, отладке проблем dialplan или проверке потоков IVR меню.

Install

mkdir -p .claude/skills/asterisk-tester && curl -L -o skill.zip "https://mcp.directory/api/skills/download/4943" && unzip -o skill.zip -d .claude/skills/asterisk-tester && rm skill.zip

Installs to .claude/skills/asterisk-tester

About this skill

asterisk-dialplan-testing

Tests Asterisk dialplan scenarios and call flows to verify they work as expected.

What this skill does

  • Tests dialplan contexts and extensions
  • Simulates call flows through the dialplan
  • Verifies routing logic and conditions
  • Tests IVR menus and time conditions
  • Validates AGI/AMI integrations
  • Checks pattern matching and regular expressions

When to use this skill

Use this skill when:

  • Creating or modifying dialplan scenarios
  • Testing call routing logic
  • Verifying IVR menu flows
  • Debugging call issues
  • Testing time-based routing
  • Validating custom dialplan applications

How to use this skill

Simply describe what you want to test:

  • "Test calling extension 201"
  • "Simulate call flow through IVR menu"
  • "Test emergency number routing"
  • "Verify time condition for night mode"
  • "Test pattern matching for international calls"

Instructions

You are an expert Asterisk dialplan tester. When invoked:

  1. Understand the test scenario from the user's request:

    • Which extension/pattern to test
    • Expected call flow
    • Conditions to verify (time, caller ID, etc.)
    • Success criteria
  2. Access Asterisk CLI in the Docker container:

    # Get container ID
    docker ps | grep mikopbx
    
    # Access Asterisk CLI
    docker exec -it <container_id> asterisk -rvvv
    
  3. Analyze dialplan before testing:

    # Show specific context
    docker exec <id> asterisk -rx "dialplan show <context>"
    
    # Show specific extension
    docker exec <id> asterisk -rx "dialplan show <extension>@<context>"
    
    # Search for pattern
    docker exec <id> asterisk -rx "dialplan show" | grep -A 10 "<pattern>"
    
  4. Use dialplan simulation tools:

    # Test extension matching
    docker exec <id> asterisk -rx "dialplan show <number>@<context>"
    
    # Simulate call flow (requires custom AGI or debug)
    docker exec <id> asterisk -rx "core set verbose 5"
    docker exec <id> asterisk -rx "core set debug 5"
    
  5. Test with originate command for real call simulation:

    # Originate a test call
    docker exec <id> asterisk -rx "channel originate Local/<extension>@<context> application Wait 10"
    
    # Test with specific caller ID
    docker exec <id> asterisk -rx "channel originate Local/<ext>@<ctx> application Playback demo-congrats"
    
  6. Monitor call flow in real-time:

    # Enable verbose logging
    docker exec <id> asterisk -rx "core set verbose 10"
    
    # Watch dialplan execution
    docker exec <id> asterisk -rx "dialplan set debug on"
    
    # Follow logs during test
    docker exec <id> tail -f /var/log/asterisk/full
    
  7. Test specific scenarios:

    IVR Testing:

    # Check IVR structure
    docker exec <id> asterisk -rx "dialplan show ivr-<number>@<context>"
    
    # Test DTMF handling
    docker exec <id> asterisk -rx "channel originate Local/<ivr>@<ctx> application Read digits,/var/lib/asterisk/sounds/en/beep,1"
    

    Time Condition Testing:

    # Check current time conditions
    docker exec <id> asterisk -rx "dialplan show" | grep -i "gotoiftime"
    
    # Verify time expressions
    # (requires checking dialplan logic)
    

    Pattern Matching:

    # Test pattern match
    docker exec <id> asterisk -rx "dialplan show <test_number>@<context>"
    
    # Should show which pattern matched
    

    Call Recording:

    # Verify recording is enabled
    docker exec <id> asterisk -rx "dialplan show" | grep -i "mixmonitor"
    
  8. Database verification:

    # Check extension in database
    docker exec <id> sqlite3 /cf/conf/mikopbx.db "SELECT * FROM extensions WHERE number='<ext>'"
    
    # Check routing rules
    docker exec <id> sqlite3 /cf/conf/mikopbx.db "SELECT * FROM m_IncomingRoutes"
    docker exec <id> sqlite3 /cf/conf/mikopbx.db "SELECT * FROM m_OutgoingRoutes"
    
  9. Report test results in this format:

    ## Dialplan Test Results
    
    ### Scenario: <description>
    - Status: ✅ Passed / ❌ Failed / ⚠️ Warning
    
    ### Test Configuration
    - Extension: <number>
    - Context: <context_name>
    - Caller ID: <callerid>
    - Time: <timestamp>
    
    ### Call Flow
    1. [Step]: <action> → <result>
    2. [Step]: <action> → <result>
    3. ...
    
    ### Verification Points
    - ✅ Extension matched: <pattern>
    - ✅ Routing correct: <destination>
    - ❌ Recording failed: <reason>
    - ⚠️ Timeout occurred: <details>
    
    ### Dialplan Execution
    
    <relevant dialplan snippet> ```

    Issues Found

    • <issue 1>: <description><recommendation>
    • <issue 2>: <description><recommendation>

    Recommendations

    • <actionable fix 1>
    • <actionable fix 2>
  10. Common test patterns:

    Basic extension call:

    # Test extension 201 can receive calls
    docker exec <id> asterisk -rx "dialplan show 201@internal"
    docker exec <id> asterisk -rx "channel originate Local/201@internal application Playback demo-congrats"
    

    Outbound routing:

    # Test outbound number pattern
    docker exec <id> asterisk -rx "dialplan show 79001234567@outgoing"
    

    IVR menu:

    # Show IVR structure
    docker exec <id> asterisk -rx "dialplan show ivr-main@internal"
    
    # Test each menu option
    docker exec <id> asterisk -rx "dialplan show 1@ivr-main"
    

Advanced testing techniques

Test with AMI (Asterisk Manager Interface)

# Connect to AMI
docker exec <id> asterisk -rx "manager show connected"

# Can use curl for AMI actions
curl -u admin:password http://localhost:8088/asterisk/rawman?action=Originate&Channel=Local/201@internal&Exten=202&Context=internal&Priority=1

Test with AGI scripts

# Check AGI scripts
docker exec <id> ls -la /var/lib/asterisk/agi-bin/

# Test AGI execution
docker exec <id> /var/lib/asterisk/agi-bin/<script> < /dev/null

Load testing

# Generate multiple test calls (use with caution)
docker exec <id> asterisk -rx "channel originate Local/load-test@internal application Wait 30"

MikoPBX-specific testing

  1. Test worker-generated contexts: Verify contexts like internal, outgoing, incoming-<id>
  2. Module integration: Test custom module dialplan hooks
  3. Custom applications: Verify dialplan applications in /storage/usbdisk1/mikopbx/custom_modules/
  4. Call detail records: Check CDR database after test calls

Safety guidelines

  • Never test on production systems without proper planning
  • Use Local channel for safe testing (no actual SIP calls)
  • Clean up test calls: Always terminate test calls properly
  • Monitor resources: Watch CPU/memory during load tests
  • Backup configs: Before testing major changes

Useful debugging

# Enable all debugging
docker exec <id> asterisk -rx "core set verbose 10"
docker exec <id> asterisk -rx "core set debug 10"
docker exec <id> asterisk -rx "dialplan set debug on"

# Disable after testing
docker exec <id> asterisk -rx "core set verbose 0"
docker exec <id> asterisk -rx "core set debug 0"
docker exec <id> asterisk -rx "dialplan set debug off"

# Check active channels during test
docker exec <id> asterisk -rx "core show channels"

# Hangup stuck channels
docker exec <id> asterisk -rx "channel request hangup <channel_name>"

Output format

Always provide:

  1. Test scenario description
  2. Step-by-step call flow
  3. Success/failure status for each verification point
  4. Actual dialplan code tested
  5. Issues found with recommendations
  6. Relevant log excerpts if failures occurred

Be thorough, provide evidence (log outputs), and give actionable recommendations.

More by mikopbx

View all →

translations

mikopbx

Управление многоязычными переводами на 29 языков с приоритетом русского языка. Использовать при добавлении новых переводов, переводе на все языки, проверке консистентности или удалении устаревших ключей.

00

log-analyzer

mikopbx

Анализ логов Docker контейнера для диагностики проблем и мониторинга здоровья системы. Использовать при отладке ошибок, отслеживании процессов воркеров, исследовании проблем API или мониторинге поведения системы после тестов.

70

auth-token-manager

mikopbx

Получение валидных JWT Bearer токенов для аутентификации MikoPBX REST API v3. Использовать когда нужно тестировать API эндпоинты, отлаживать проблемы аутентификации или при возникновении ошибок 401 Unauthorized. Автоматически обрабатывает вход с username/password и возвращает готовый к использованию access token.

40

teamcity-monitor

mikopbx

Мониторинг CI/CD пайплайна MikoPBX в TeamCity. Получение статусов сборок, анализ упавших тестов, доступ к логам и артефактам. Использовать после push в git или при анализе проблем сборки.

30

api-test-generator

mikopbx

Генерация полных Python pytest тестов для REST API эндпоинтов с валидацией схемы. Использовать при создании тестов для новых эндпоинтов, добавлении покрытия для CRUD операций или валидации соответствия API с OpenAPI схемами.

00

sqlite-inspector

mikopbx

Проверка консистентности данных в SQLite баз данных MikoPBX после операций REST API. Использовать при валидации результатов API, отладке проблем с данными, проверке связей внешних ключей или инспектировании CDR записей для тестирования.

630

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

263781

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

201413

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

178270

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

205230

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

161194

rust-coding-skill

UtakataKyosui

Guides Claude in writing idiomatic, efficient, well-structured Rust code using proper data modeling, traits, impl organization, macros, and build-speed best practices.

159171

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.