TECH7Fox / asterisk-hass-integration

Asterisk integration for Home Assistant
60 stars 14 forks source link

Integration it does not show anything #100

Closed brunopiras closed 5 months ago

brunopiras commented 6 months ago

Hello everyone,

I installed the integration in homeassistant, configured the AMI management in asterisk but in home assistant, I don't see any endpoint (I only use SIP).

manager.conf

`[general] enabled = yes webenabled = yes

port = 5038 bindaddr = 192.168.1.2

debug = on ; enable some debugging info in AMI messages (default off). ; Also accessible through the "manager debug" CLI command.

[bruno] secret = xxxxxxxxxx deny = 0.0.0.0/0.0.0.0 permit = 192.168.1.2/255.255.255.255 read = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate,message write = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate,message writetimeout = 5000 displayconnects = yes ; Display on CLI user login/logoff`

CLI debug:

`<-- Examining AMI event: --> Event: Registry Privilege: system,all SequenceNumber: 164 File: manager.c Line: 1864 Func: manager_default_msg_cb ChannelType: SIP Username: XXXXXXX Domain: xxxxxxx.voip.ms Status: Registered

<-- Examining AMI event: --> Event: MessageWaiting Privilege: call,all SequenceNumber: 165 File: manager_mwi.c Line: 144 Func: mwi_update_cb Mailbox: xxxxxx@SIP_Remote Waiting: 0 New: 0 Old: 0

<-- Examining AMI event: --> Event: Registry Privilege: system,all SequenceNumber: 166 File: manager.c Line: 1864 Func: manager_default_msg_cb ChannelType: SIP Username: XXXXXXXXXX Domain: xxxxxxxxxx.voip.ms Status: Registered`

Home Assistant Logs:

2024-05-07 13:31:52.730 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration asterisk which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-05-07 13:32:08.528 DEBUG (MainThread) [custom_components.asterisk] Login response: Response: Success 2024-05-07 13:32:08.530 DEBUG (Thread-4 (listen)) [custom_components.asterisk] Creating SIP device: Event : PeerEntry -> {'ActionID': '1', 'Channeltype': 'SIP', 'ObjectName': '190', 'ChanObjectType': 'peer', 'IPaddress': '192.168.1.XX', 'IPport': '5956', 'Dynamic': 'yes', 'AutoForcerport': 'yes', 'Forcerport': 'no', 'AutoComedia': 'no', 'Comedia': 'no', 'VideoSupport': 'yes', 'TextSupport': 'yes', 'ACL': 'no', 'Status': 'OK (6 ms)', 'RealtimeDevice': 'no', 'Description': 'Videocitofono', 'Accountcode': ''} 2024-05-07 13:32:08.530 DEBUG (Thread-4 (listen)) [custom_components.asterisk] Creating SIP device: Event : PeerEntry -> {'ActionID': '1', 'Channeltype': 'SIP', 'ObjectName': '191', 'ChanObjectType': 'peer', 'IPaddress': '192.168.1.XX', 'IPport': '5060', 'Dynamic': 'yes', 'AutoForcerport': 'yes', 'Forcerport': 'no', 'AutoComedia': 'no', 'Comedia': 'no', 'VideoSupport': 'no', 'TextSupport': 'yes', 'ACL': 'no', 'Status': 'OK (17 ms)', 'RealtimeDevice': 'no', 'Description': 'Telefono Cucina', 'Accountcode': ''} 2024-05-07 13:32:08.530 DEBUG (Thread-4 (listen)) [custom_components.asterisk] Creating SIP device: Event : PeerEntry -> {'ActionID': '1', 'Channeltype': 'SIP', 'ObjectName': '192', 'ChanObjectType': 'peer', 'IPaddress': '192.168.1.XX', 'IPport': '5060', 'Dynamic': 'yes', 'AutoForcerport': 'yes', 'Forcerport': 'no', 'AutoComedia': 'no', 'Comedia': 'no', 'VideoSupport': 'no', 'TextSupport': 'yes', 'ACL': 'no', 'Status': 'OK (9 ms)', 'RealtimeDevice': 'no', 'Description': 'Telefono soppalco', 'Accountcode': ''} 2024-05-07 13:32:08.530 DEBUG (Thread-4 (listen)) [custom_components.asterisk] Creating SIP device: Event : PeerEntry -> {'ActionID': '1', 'Channeltype': 'SIP', 'ObjectName': '193', 'ChanObjectType': 'peer', 'IPaddress': '192.168.1.XX', 'IPport': '5062', 'Dynamic': 'yes', 'AutoForcerport': 'yes', 'Forcerport': 'no', 'AutoComedia': 'no', 'Comedia': 'no', 'VideoSupport': 'no', 'TextSupport': 'yes', 'ACL': 'no', 'Status': 'OK (82 ms)', 'RealtimeDevice': 'no', 'Description': 'Telefono Garage', 'Accountcode': ''} 2024-05-07 13:32:08.531 DEBUG (Thread-4 (listen)) [custom_components.asterisk] Creating SIP device: Event : PeerEntry -> {'ActionID': '1', 'Channeltype': 'SIP', 'ObjectName': '194', 'ChanObjectType': 'peer', 'IPaddress': '-none-', 'IPport': '0', 'Dynamic': 'yes', 'AutoForcerport': 'no', 'Forcerport': 'yes', 'AutoComedia': 'no', 'Comedia': 'yes', 'VideoSupport': 'yes', 'TextSupport': 'yes', 'ACL': 'no', 'Status': 'UNKNOWN', 'RealtimeDevice': 'no', 'Description': 'Iphone Bruno', 'Accountcode': ''} 2024-05-07 13:32:08.531 DEBUG (Thread-4 (listen)) [custom_components.asterisk] Creating SIP device: Event : PeerEntry -> {'ActionID': '1', 'Channeltype': 'SIP', 'ObjectName': '195', 'ChanObjectType': 'peer', 'IPaddress': '-none-', 'IPport': '0', 'Dynamic': 'yes', 'AutoForcerport': 'no', 'Forcerport': 'yes', 'AutoComedia': 'no', 'Comedia': 'yes', 'VideoSupport': 'yes', 'TextSupport': 'yes', 'ACL': 'no', 'Status': 'UNKNOWN', 'RealtimeDevice': 'no', 'Description': 'Iphone Gioia', 'Accountcode': ''} 2024-05-07 13:32:08.531 DEBUG (Thread-4 (listen)) [custom_components.asterisk] Creating SIP device: Event : PeerEntry -> {'ActionID': '1', 'Channeltype': 'SIP', 'ObjectName': '196', 'ChanObjectType': 'peer', 'IPaddress': '-none-', 'IPport': '0', 'Dynamic': 'yes', 'AutoForcerport': 'no', 'Forcerport': 'yes', 'AutoComedia': 'no', 'Comedia': 'yes', 'VideoSupport': 'yes', 'TextSupport': 'yes', 'ACL': 'no', 'Status': 'UNKNOWN', 'RealtimeDevice': 'no', 'Description': 'Zte', 'Accountcode': ''} 2024-05-07 13:32:08.531 DEBUG (Thread-4 (listen)) [custom_components.asterisk] Creating SIP device: Event : PeerEntry -> {'ActionID': '1', 'Channeltype': 'SIP', 'ObjectName': 'ol-out', 'ChanObjectType': 'peer', 'IPaddress': '77.239.XX.XX', 'IPport': '5062', 'Dynamic': 'no', 'AutoForcerport': 'yes', 'Forcerport': 'no', 'AutoComedia': 'no', 'Comedia': 'no', 'VideoSupport': 'no', 'TextSupport': 'no', 'ACL': 'no', 'Status': 'OK (57 ms)', 'RealtimeDevice': 'no', 'Description': 'Linea Casa', 'Accountcode': ''} 2024-05-07 13:32:08.531 DEBUG (Thread-4 (listen)) [custom_components.asterisk] Creating SIP device: Event : PeerEntry -> {'ActionID': '1', 'Channeltype': 'SIP', 'ObjectName': 'voipms', 'ChanObjectType': 'peer', 'IPaddress': '208.100.XX.XX', 'IPport': '5060', 'Dynamic': 'no', 'AutoForcerport': 'yes', 'Forcerport': 'no', 'AutoComedia': 'no', 'Comedia': 'no', 'VideoSupport': 'no', 'TextSupport': 'no', 'ACL': 'no', 'Status': 'OK (55 ms)', 'RealtimeDevice': 'no', 'Description': 'Cell. USA 9046XXXXX', 'Accountcode': ''} 2024-05-07 13:32:08.531 DEBUG (Thread-4 (listen)) [custom_components.asterisk] Creating SIP device: Event : PeerEntry -> {'ActionID': '1', 'Channeltype': 'SIP', 'ObjectName': 'voipms_100', 'ChanObjectType': 'peer', 'IPaddress': '208.100.XX.XX', 'IPport': '5060', 'Dynamic': 'no', 'AutoForcerport': 'yes', 'Forcerport': 'no', 'AutoComedia': 'no', 'Comedia': 'no', 'VideoSupport': 'no', 'TextSupport': 'no', 'ACL': 'no', 'Status': 'OK (59 ms)', 'RealtimeDevice': 'no', 'Description': 'Int. USA', 'Accountcode': ''} 2024-05-07 13:32:08.531 DEBUG (Thread-4 (listen)) [custom_components.asterisk] SIP loaded. 2024-05-07 13:32:08.537 DEBUG (MainThread) [custom_components.asterisk] PJSIP module not loaded. Skipping PJSIP devices.

But there's not entities.

Logs at load integration:

024-05-07 16:22:46.085 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry AMI 192.168.1.2:5038 for binary_sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 772, in async_unload result = await component.async_unload_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/binary_sensor/__init__.py", line 240, in async_unload_entry return await component.async_unload_entry(entry) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 200, in async_unload_entry raise ValueError("Config entry was never loaded!") ValueError: Config entry was never loaded! 2024-05-07 16:22:46.086 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry AMI 192.168.1.2:5038 for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 772, in async_unload result = await component.async_unload_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 140, in async_unload_entry return await component.async_unload_entry(entry) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 200, in async_unload_entry raise ValueError("Config entry was never loaded!") ValueError: Config entry was never loaded!

Any help??

Thanks

brunopiras commented 5 months ago

Solved myself, in the asterisk integration need to use a domain name instead of an ip address strangely enough.