Asterisk Binding

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

The first alfa version is at Asterisk binding v0.1

Please give it a try and let me know what you think of it, or if you have any other things you need from an Asterisk binding.

4 Likes

hey! I’m going to try it. Is the configuration the same as before?

Bravo Eric
how did I miss this 5 months ago
Is the project still active?

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.

1 Like

Hi Eric,
Any plans to bring this Binding to openHAB 4 ?

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 :)!

I should update it yes, but had a lack of time this year, I hope to have some more time to look at it next months.

What troubles does it give on your system?

Hi Eric,

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?

Thanks,

João

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)

Thank you. I will try tomorrow evening and let you know.

if I knew how to rebuild i would love to do it! But don’t know how, so i will be very patient. :slight_smile:
@ 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

I tried to put the jar in addons folder on my OH4 systema but nothing happens. How did you manage to make it work?

Idd i don’t see the binding in my list either. But it is still working.

so there will idd more work then only a rebuild…

Same here. Drop the jar file in the addons folder and nothing happened

João

Maybe you can try to make a things file? I do not have experience with asterisk and manual adding it to openhab but i can try if i find the time…

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.

1 Like