File size: 1,713 Bytes
1366db9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# bot_definitions.py
"""Definitions of different bot types for the bot registry."""

from bot_registry import BotRegistry, BotType
from bot_runner_helpers import (
    create_call_transfer_settings,
    create_simple_dialin_settings,
    create_simple_dialout_settings,
)

# Create and configure the bot registry
bot_registry = BotRegistry()

# Register bot types
bot_registry.register(
    BotType(
        name="call_transfer",
        settings_creator=create_call_transfer_settings,
        required_settings=["dialin_settings"],
        incompatible_with=["simple_dialin", "simple_dialout", "voicemail_detection"],
        auto_add_settings={"dialin_settings": {}},
    )
)

bot_registry.register(
    BotType(
        name="simple_dialin",
        settings_creator=create_simple_dialin_settings,
        required_settings=["dialin_settings"],
        incompatible_with=["call_transfer", "simple_dialout", "voicemail_detection"],
        auto_add_settings={"dialin_settings": {}},
    )
)

bot_registry.register(
    BotType(
        name="simple_dialout",
        settings_creator=create_simple_dialout_settings,
        required_settings=["dialout_settings"],
        incompatible_with=["call_transfer", "simple_dialin", "voicemail_detection"],
        auto_add_settings={"dialout_settings": [{}]},
    )
)

bot_registry.register(
    BotType(
        name="voicemail_detection",
        settings_creator=lambda body: body.get(
            "voicemail_detection", {}
        ),  # No creator function in original code
        required_settings=["dialout_settings"],
        incompatible_with=["call_transfer", "simple_dialin", "simple_dialout"],
        auto_add_settings={"dialout_settings": [{}]},
    )
)