Skip to content

Conversation

@cbailes78
Copy link

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.

Adding SCCP and IAX channels.
Adding SCCP and IAX channels
@TECH7Fox TECH7Fox changed the title Cbailes78 patch 1 Add SCCP and IAX Channels Feb 21, 2024
@cbailes78
Copy link
Author

cbailes78 commented Feb 21, 2024 via email

@TECH7Fox
Copy link
Owner

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.

@PripyatAutomations
Copy link

Any progress on SCCP? Just installed the integration and seeing my PJSIP device but not my SCCP phones.

@cbailes78
Copy link
Author

cbailes78 commented Feb 20, 2025

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.

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,
Chris.

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.

3 participants