Graceful Restart

Home » Asterisk Users » Graceful Restart
Asterisk Users 3 Comments

Hello,

Is there a way to detect, via cli or any other way, that Asterisk is in “graceful shutdown” mode, not accepting any new calls? Or to put the question a different way, how can I know that Asterisk has restarted again after the command “core restart graceful” in an automated way?

Best regards, Jan Blom

3 thoughts on - Graceful Restart

  • You can see if asterisk has been restarted by checking the number of calls processed. If almost zero, it has been restarted.

    “core show calls”

    Leandro

    2012/8/19 Jan Blom

  • Absolutely, but that requires statefull processing. Another way is to look at uptime.

    However, I was looking for a stateless way to automatically monitor a restart.

    Best regards, Jan

    From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Leandro Dardini Sent: den 19 augusti 2012 08:35
    To: Asterisk Users Mailing List – Non-Commercial Discussion Subject: Re: [asterisk-users] graceful restart

    You can see if asterisk has been restarted by checking the number of calls processed. If almost zero, it has been restarted.

    “core show calls”

    Leandro
    2012/8/19 Jan Blom >
    Hello,

    Is there a way to detect, via cli or any other way, that Asterisk is in “graceful shutdown” mode, not accepting any new calls? Or to put the question a different way, how can I know that Asterisk has restarted again after the command “core restart graceful” in an automated way?

    Best regards, Jan Blom

  • Monitor the events on the AMI, you should see the following:

    Event: Shutdown Privilege: system,all SequenceNumber: 0
    File: asterisk.c Line: 1773
    Func: really_quit Shutdown: Cleanly Restart: True

    Then you can build out your monitoring tools from it.