pipobscure / NodeJS-AsteriskManager

NodeJS Asterisk Manager API
Other
246 stars 102 forks source link

Keep connected #27

Closed andreabianco closed 9 years ago

andreabianco commented 9 years ago

Hello! I'm started using your library from my application. I want that the connection to Asterisk Manager keeps connected in case of errors or service restart.It's possible? I see ami.js and I found the function ManagerKeepConnected but I can't use it.

igorescobar commented 9 years ago

I recommend you to use it together with forever or pm2. It will do the trick to keep your app up and running no matter what!

andreabianco commented 9 years ago

I don't want my app running forever, but I want that the connection with the manager of Asterisk (done by your application) is always on. For example: restart of the service.

igorescobar commented 9 years ago

We already have a ManagerKeepConnected method inside of our ami take a look into the implementation: https://github.com/pipobscure/NodeJS-AsteriskManager/blob/master/lib/ami.js#L189

igorescobar commented 9 years ago

You can always use the reconnect method in case of any errors though.