Keep alive for an ARI application


#1

I am trying to create a keep alive method to ensure Asterisk did not disconnect from my ARI application (Asterisk 13). I can call /applications and check my application is listed. The problem is that this method also returns all channels attached to the application, and on my system there are usually more then 500 concurrent calls. Calling this method each minute seems too expensive.

Do you have any better idea?

Thanks,
Eyal Hasson.


#2

Well, I managed a simple solution where I check if the application is alive only if no event was received within last minute.


#3

Could use iniittab or upstart conf file depending on your distro. If the program dies, it will be automatically restarted.


#4

I am not sure I understand your suggestion - I was looking for a way to know when the web socket connection of my ARI application to asterisk has unexpectedly closed. Currently what I found working is whenever a minute passes without any event, I invoke /applications/my_ari_application to see it is still connected.


#5

My mistake. I was thinking that you wrote a separate program, which needs to be running, and that program was killing itself off. I see now.