I’m giving a shot of making an Asterisk binding for OH3.
It’s using the same asterisk library as the old OH1 Asterisk binding but I’ve updated it to the newest version, so it should be compatible with at least Asterisk versions 10 till 16.
It currently supports 3 channel types, a Call type which will give the current in progress Call, a String type with will give the external number of the call and a switch type which will be on when a call is in progress.
For all channels you can define an extension, so it will only monitor calls to/from that extension.
The switch channel also supports defining the external number, direction(incoming/outgoing) and state (dialing,ringing,active), so you can configure the conditions when you want to have the switch be ON
I’ve seen that the OH1 plugin also supports DTMF digits to switch things, but I don’t know if anyone still wants that.
I still want to add some events so you can use it in rules.
To use it you need to enable the Asterisk Management Interface in your asterisk servers manager.conf
No the configuration is different, it uses the things and items concepts of openHAB 2 now.
Currently I configured it only through the openHAB ui, having it show numbers in items and turn items on and off based on the call state. by adding them to the switch channel. That should also all be available through the files config, but I didn’t check the syntax yet
Well it’s kind of active, it does what I want at the moment, so I’m not actively working on it, but I still want to add some events to it if I have some time. But if someone is missing something just post it here, maybe I can add it.
Hey, I still use your binding on openhab 4.1.0M4 and it could give some troubles on my system. Is there a possibility to update the binding to 4.1.0? Thx in advance :)!
My treads are rizing and they keep on rizing. so i asked in a blog and the first thing they said that the use of old bindig files could be problematic. So I want to be sure that the binding isn’t the problem.
I didn’t know that we could use the old Asterisk binding in OH4.
I just need to know that the phone is ringing (I’m using Asterisk in the doorbell, so I can use this info to OH rules). How can I install this? Is there a better option?
You can try just dropping the jar from the start post in the addons folder and see if it works.
The snapcast plugin needed a version bump in the pom.xml and a rebuild, don’t know if this one also needs that to work, I guess @TomV knows. (Otherwise I’ll take a look at it next month)
if I knew how to rebuild i would love to do it! But don’t know how, so i will be very patient.
@ Jcurado i’m on OH4 and the binding works but it could give some troubles on your system. That’s why i asked if it’s possible to rebuild for oh4.
Well if it is indeed causing the issue with your CPU threads I suspect it needs some more work than only a recompile. Still have to upgrade my openHAB to 4, work was taking a bit over last half or the year, should be a bit more manageable in the near future, then I’ll upgrade it and make a OH4 version
It looks like actually everything still works when using the old plugin with openHab 4, except it doesn’t list the binding anymore, so you can’t make a new Thing anymore. (so it keeps working if you upgrade from an older openHab, but you can’t add new ones)
I’ll take a look if I can fix it, have to setup my development environment for openHab 4 first.