Using SIP stack within Asterisk to reboot phones – Possible?

Home » Asterisk Users » Using SIP stack within Asterisk to reboot phones – Possible?
Asterisk Users 9 Comments

Hi Everyone,

I use Asterisk for regularPBX use it’s made for. But I want to take it a bit
further and use it at cmmand level to be able to send SIP notifies to
restart a phone or take advantage of a phone’s UPnP capabilities. Is
Asterisk capable of that? If so, what is a simple SIP reboot message like
and how can I invoke it from a Asterisk CLI?

If Asterisk is not the best tool for this purpose what is a very simple to
implement SIP stack out there that can do this?


9 thoughts on - Using SIP stack within Asterisk to reboot phones – Possible?

  • Lots of good info and pointers so far. But do keep in mind that not all
    phones will automatically reboot just because you sent it a “check-sync” or
    “resync” event with the “sip notify” command.

    I vaguely remember that for e.g. the Polycoms some other condition had to be
    true: either the phone’s config file on the ftp/tftp server had to have a
    newer time-stamp than the one that was downloaded during the phone’s last
    boot, or a config option had to be set to a non-default value to make the
    phone reboot unconditionally upon receiving the SIP notify, regardless of
    the config file’s modification date.

  • Thanks Kai-Uwe and everyone else. I have seen all those examples and I am
    exploring the sip_notify.conf file now which makes things more clear to me.

    However, when sending a SIP notify to a phone that is not registered to
    Asterisk via it’s IP address should I expect to receive a success of fail
    packet back or that is not how SIP Notify works?

    *sip notify aastra-check-cfg*
    *Sending NOTIFY of type ‘aastra-check-cfg’ to ‘’*
    That is all I see and the phone is not restarted. There might be a few
    things different about Aastra phones to get them accept SIP Notifies and I
    would like to hear your experience about it and what features and notifies
    are available to me as it pretains particulary to Aastra phones.

    P.S. Are these SIP notifies anything different than simple HTTP get or XML
    push and receive or do they require a sip stack or a program like Asterisk
    and it’s much more complicated than I think? I want to get a simple page
    where some phone controls can be done without relying on a heavy program
    like Asterisk but again if it get’s too complicated I won’t mind using
    Asterisk for this purpose. Just want to know my options.

    Thanks again,

  • Maybe it’s just me being a 1.2 Luddite, but I’d rather not have to explain
    to my boss that I crashed the production server because of a bug or
    because I was ‘trying something out’ and forgot which server I was on.

    Any chance sipsak or sipp can handle this task? I reboot my aging SPA3K
    using an http request via wget.

  • I’ve never worked with Aastras, so don’t have any additional data over
    what’s been said by others. Also, I’ve never sent the SIP “check-sync”
    notify to a phone that wasn’t already registered with the asterisk server
    the SIP notify was sent from. My best *guess* would be that actual behavior
    of the phones in that case might vary (based on manufacturer and/or firmware
    version). Some might ignore the notify, others *may* accept it *if* the
    asterisk server was their provisioning server previously, some might even
    blindly accept it.

    The actual payload/content of the Notify is configured in the
    sip_notify.conf file. My version (running does not have anything
    specific to Aastra in it, so I would try all the other ones to see if one of
    them works. If none work, I’d go search for some Aastra administrator
    documentation (or provisioning guide, or some such). As you can see from the
    file, the payload itself is not complex at all. For Polycoms as an example,
    the “Event” field in the SIP NOTIFY header is set to “check-sync”. That’s
    all there is to it.

    The SIP Notify we’re talking about here is a simple SIP event being sent to
    the phone by asterisk. Best to use a packet sniffer, or you could turn on
    SIP debug in asterisk for a single peer and send it the “notify”. The
    behavior I see with my Polycoms makes it appear as if there is no
    “handshake” between asterisk and the phone at all for these. The phone
    reboots as soon as I send the notify. Even more, asterisk does a few
    retransmissions of the notify packet, so it might’ve expected a SIP response
    from the phone (which the phone did not send).

    Lastly, to state “the obvious”, the SIP Notify itself does not convey any
    configuration data to the phone at all. It only tells the phone to “go check
    your config”. So to help with your provisioning scenario, you’d have to
    update/modify the original config data/files for the phone on the
    provisioning server, then trigger the phone to reboot (or reload). From all
    I’ve seen with Polycoms and Ciscos, you’ll set up a phone’s provisioning
    server through your DHCP server (or manually on the phone). The SIP Notify
    will cause the phone to go back to that provisioning server and re-load the
    latest config data.

  • Dnia Mon, 27 Dec 2010 14:30:37 -0500
    Bruce B napisał(a):

    I have the same problem with SPA508G and I think that there a bug in
    authorization – when I set “Auth Resync-Reboot: No”, I’m able to
    reset the phone.

    When I set “Auth Resync-Reboot: Yes”, I can see, that the phone is
    receiving notify in syslog and try to do auth:

    Dec 28 09:02:03 *.*.*.* [1]SipNotifyCmd 8
    Dec 28 09:02:03 *.*.*.* SIP: Challenge NOTIFY

    On asterisk I can see:

    0.000000 asterisk -> phone SIP Request: NOTIFY

    0.012148 phone -> asterisk
    SIP Status: 401 Unauthorized

    As far i know, asterisk should continue digest authorization
    process at this point.


  • 2010/12/27 Bruce B

    Why would you need to restart a phone that is not registered yet ?
    For me, the first thing a SIP phone will try to do is to register itself,
    and then somehow restart.