SIP Doorbell, android tablet and HA integration

Hi Tommy,
Thank you so much for your response. I have made the changes as suggested, but I am still getting an error. I am woundering if it is to do with ssl? I am using NGINX manager in Hassio? The camera entity feed works in a picture card.

Not entirely sure, but the Doordroid Javascript code is of course running and trying to get the config from the lovelace.yaml and can’t find camera.gds, since you know that camera.gds works with other cards, then my suspicion is the lovelace.yaml file related to the doordroid-card may not be parsing properly and needs tweaking. Regarding the “chunk” error…I looked around and it seems I’m getting that exact same error too, but for a different card (and a different reason) yet the card is running in the web browser fine without any problem. I suspect its not your real problem but the symptom.

Thank you. Do you have any suggestions on how I could break this down or test it to try and get to the bottom of this.

Thank you for your help. It was my poor formatting in the Lovelace card. Just needed to take out the spaces. Now onto the SIP part.

image

For that part, just use my example above. If your PBX is correctly configured, then it works!

title: Surveillance
icon: mdi:bell
panel: true
path: gds
cards:
      - camera_entity: camera.gds
        style: |
            ha-card {
              display: block;
              margin-left: auto;
              margin-right: auto;
              width: 88%;
            }
        sip_settings:
          sip_password: MySecureStuff
          sip_server: MYPBX
          sip_username: '1003'
          sip_wss_url: 'wss://MyPBX:8089/ws'
        type: 'custom:doordroid-card'
        title: DoorDroid

sorry to trouble you again. I am not very clever when it comes to this stuff and too old.
I have FreePBX running on a RPI 3. I can make and receive video calls from/to the door station with my SIP extension. I think the next step is to install my trustred certificate from Duckdns. I am also using NGINX in HASSIO, if that makes any diffence. Any help would be appreciated.
Kind regards Mark

I am not young too… Never too old!
Yes, the next step is to run the “secure” versions of protocols, hence a trusted certificate. Both in HA and on Freepbx.
Have you look at the first messages in this thread with Tommy (end of March)? There was some additional details on the certificate part.
Have you already tried something?

Yes I have read and re-read this thread and Tommy’s questions and your answers. I know it is simple, but I just can’t see what to do. I have tried many things, from changing the mini-HTTP server settings, to coping certifictes, changes the http.conf file, and also following the instructions at https://wiki.asterisk.org/wiki/display/AST/WebRTC+tutorial+using+SIPML5. My concern is I have tried too many different things.

It is not that simple. Unfortunately.

  1. Make HA works with https, even for lan access. There are some tutos about this.
    Does it work? https://IP_Adress:8123 should work (potentially with some complain about the invalidity of the cert)
  2. Enable wss in Freepbx. I managed to do it (as I said after few hours of test/error) using the link you copied.
  3. Then glue things together. Again trial and error.

And if you have tried too many things, then you may have some leftovers in the various configurations.
As I am using VMs, it was easy to revert back to snapshot with a clean config. In your case with your Rpi it might be more difficult.

Thank you again for your quick response.
My HA is https and the certificate is letencrypt so no issues there. Internally and externally.
I know have FreePBX using https. One step closer
So I now need to enable wss in Freepbx.
I am making progress, even tough it is slow.

Hi all, I am making slow progress, but it is progress.
Just trying to understand how I “The configuration of the 1004 should look like this:”.
I am using FreePBX and I can’t see all the setting in the GUI. Should I edit a file directly?
Kind Regards
Mark

That looks like an excerpt from a dialplan file from asterisk.

No… You can do all this through freepbx interface. Most of it are the default value when you create an extension, with the exception of the usable codecs.
The result of the freepbx configuration is stored in a file called pjsip.endpoint.conf.
At the beginning of the file you can see:

;--------------------------------------------------------------------------------;
;          Do NOT edit this file as it is auto-generated by FreePBX.             ;
;--------------------------------------------------------------------------------;

So, editing it manually is not a good idea :slight_smile:

Thank you @Greengolfer for your prompt assistance. Can you please explain how I create the dial plan for the virtual ext 1003 in FreePBX? Do I do it through the GUI or editing the file directly?
If GUI could you please point me the right direction. I have spend lots of time googling, but no luck.

On your freepbx machine, in /etc/asterisk folder you have all the conf files that are created by the GUI.
You have the possibility to manually edit some on them that won’t be modified by the GUI and that are imported as part of the config.
That being said, the file you are looking for is extensions_override_freepbx.conf
The content of the file will then be:

[ext-local-custom]
exten => 1003,1,System(curl http://IP_HASS:1880/endpoint/wakeup_webrtc)
exten => 1003,n,Wait(3)
exten => 1003,n,RetryDial(wait.wav,1,10,PJSIP/1004)
exten => 1003,n,Hangup()

Once done, you’ll have to restart asterisk.

@greengolfer, Thank you again for your help. I think I am moving forward. I have one error left.
If appears to be an issue with the camera token. The camera streams fine through a picture glance card.
Any ideas or suggestions would be appeciated. I don’t really understand the path on the card?

Do you see the live camera image in a picture card (not the glance!)?
In lovelace something like:

title: Surveillance
icon: mdi:cctv
panel: true
cards:
      - type: picture-entity
        entity: camera.gds
        camera_view: live
        show_name: false
        show_state: false

Or something equivalent (not 100% sure about the yaml syntax here) is showing you the live feed?

The doordroid card will use the same method to show the feed.

Then the “path”, I guess it is the

path: gds

you are questioning? This is just the name of the view in lovelace. It can be anything.

Thank you for your quick reply. Yes I can see the camera view, with latency, in a picutre card. Sample card below. So that much works.

image

Please stop posting pictures of text files.

And can you show how the gds camera stream is declared (in text :slight_smile: ) in configuration.yaml?
Otherwise, I don’t really know… Sorry.