-
-
Notifications
You must be signed in to change notification settings - Fork 19
Add SCCP and IAX Channels #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Adding SCCP and IAX channels.
Adding SCCP and IAX channels
|
Hi Jordy,
I had to gate the adding of the interfaces because SIP and IAX have
identical end-of-list responses (event.name == "PeerlistComplete").
Without this, it would try to add all IAPX interfaces as both SIP/nnn and
IAX/nnn. HA would recognise it had already been configured and stop the
addition of the IAX/nnn as duplicates. Net result wase the IAX channels
appeared as SIP.
Great work on the custom integration, it works like a charm.
All best,
Chris
…On Wed, Feb 21, 2024 at 1:40 AM Jordy Kuhne ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In custom_components/asterisk/__init__.py
<#97 (comment)>
:
> def devices_complete(event: Event, **kwargs):
sip_loaded = hass.data[DOMAIN][entry.entry_id][SIP_LOADED]
pjsip_loaded = hass.data[DOMAIN][entry.entry_id][PJSIP_LOADED]
- if event.name == "PeerlistComplete":
+ sccp_loaded = hass.data[DOMAIN][entry.entry_id][SCCP_LOADED]
+ iax_loaded = hass.data[DOMAIN][entry.entry_id][IAX_LOADED]
+ if sip_loaded == False and event.name == "PeerlistComplete":
Why did you add the sip_loaded == False here?
—
Reply to this email directly, view it on GitHub
<#97 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJAPNAIDKQGSORZV2ZZOWEDYUVGBBAVCNFSM6AAAAABDOKOPTWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQOJRHA4DMOBTGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
Hi @cbailes78, Thank you for the PR! I don't think that IAX and SCCP devices have events for some entities like the DTMF or Connected Line entity, so those entities would do nothing. Maybe have a check like here and here and only add certain entities if the device tech type actually has those events. And the same could be done for events that only IAX or SCCP devices have. (not sure if there are any though, can't quickly find anything in the docs) So for example something like: # in sensor.py / binary_sensor.py
for device in devices:
entities.append(DeviceStateSensor(hass, entry, device))
if device.tech == "SIP" or device.tech == "PJSIP":
entities.append(ConnectedLineSensor(hass, entry, device))
entities.append(DTMFSentSensor(hass, entry, device))
entities.append(DTMFReceivedSensor(hass, entry, device))Just a example. |
|
Any progress on SCCP? Just installed the integration and seeing my PJSIP device but not my SCCP phones. |
Hi @TECH7Fox, All device types have similar services, they all have connected line and dtmf. Be careful with connected line, it is usually the name of the trunk or internal number you are connected to. I wanted it to reflect the destination number regardless of whether it was an internal number or an external destination. All best, |
Hi Jordy,
Thank you for your excellent work on asterisk-hass-integration.
I have added SCCP and IAX channels to your excellent custom component. Please would you consider merging my pull request to help others.
Many thanks.
All best,
Chris.