This is good news. But how to install everything? I’m sorry I’m not familiar with this. Do I install this on my raspberry pi that also host my HA? What’s the command to run? Thanks.
Yeah, that’s the challenge with this integration… Unfortunately, the sip2mqtt project depends on the pjsip Python module, which isn’t available from pip and normally requires to be manually built and installed from sourcecode. I’ve included a link to my Dockerfile to facilitate this but for folks not familiar to Docker and containers, this will be a bit challenging and probably outside the scope of this thread. That being said, I’ve migrated all my HA infrastructure using Docker and I haven’t looked back since.
You can actually run HAS Docker on a Raspberry Pi but I opted not to due to the memory requirements from the number of containers I run in my setup. If you’re planning on running only HAS and this Python script, you have two options available to you.
Run your setup using two separate Docker containers (one for HAS, the other for sip2mqtt)
Download, build, and install the pjsip Python module on your Raspberry pi and run sip2mqtt alongside of HAS. Interestingly, you can get most of the steps to doing that manually by looking at the Dockerfile
One more option to add to this list. Hass.io runs on your Pi using Docker. This sounds exactly like what you may need to get this up and running quickly on a Pi.
Hi @MartyTremblay, I’ve been looking for a good Voip SIP notifier on Home Assistant for a bit and fount this thread.
I was trying to pull your pjsip-docker container from dockerhub on my UnRaid server to use in conjunction with Hass.io, but I’ve been having some trouble. I’m kinda new with UnRaid and Docker in general.
Could you provide some simple guidance as to how to pull the container? It would be greatly appreciated.
Thanks!
Happy to help. Can you tell me what kind of issues you’re having? I don’t know anything about UnRaid but I can’t imagine it being all that different. Is the device an Intel-based CPU?
Also, I’ve been half-seriously working on building a HA native Python component to do the same thing but having issues of my own. Perhaps I’ll post my code to see if there’s anyone having experience with asynchronous Python willing to contribute and help
Thanks for the quick reply!
unRAID is a server OS (like Synology for example) that has docker baked in.
It’s more ui based when it comes to docker containers though, so I haven’t really learned how to pull non unRAID based containers.
I tried adding your container but it says that it’s a private repo and I don’t have permission.
It’s not listed in docker hub either so I can’t pull it there.
I saw that container when searching earlier and tried to pull it but when I do, I get the following error:
root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='pjsip-docker' --net='bridge' -e TZ="America/New_York" -e HOST_OS="unRAID" 'retrohunter/pjsip-docker'
Unable to find image 'retrohunter/pjsip-docker:latest' locally
/usr/bin/docker: Error response from daemon: manifest for retrohunter/pjsip-docker:latest not found.
See '/usr/bin/docker run --help'.
The command failed.
I also mapped ‘/opt’ and added sip2mqtt.py to a sub directory named sip2mqtt.
Getting closer.
Now do I have to edit the sip2mqtt.py to include my mqtt parameters or do I add them as variables in the container?
ok, built a new version and deployed to Docker Hub. Pull the latest image using the --pull directive to force an update. Then run with the following docker command.
Sorry Marty, I’m still having some problems.
I don’t even know how to start to explain. I wish I knew more about docker.
Also, by chance, does it have to be MQTT_DOMAIN instead of MQTT_ADDRESS? My logs keep asking for that instead.
I entered my credentials in Post Arguments and ended up with this in the logs:
Traceback (most recent call last):
File "/opt/sip2mqtt/sip2mqtt.py", line 209, in <module>
main(sys.argv[1:])
File "/opt/sip2mqtt/sip2mqtt.py", line 157, in main
broker.connect(args.mqtt_domain, args.mqtt_port, args.mqtt_keepalive)
File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 768, in connect
return self.reconnect()
File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 895, in reconnect
sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0))
File "/usr/lib/python2.7/socket.py", line 571, in create_connection
raise err
socket.error: [Errno 111] Connection refused
I am using my local hassio mosquitto broker and entered the ip (-a192.168.85.40).
Funny, I also use toronto3.voip.ms. Love voip.ms.