Ticket #5595 (closed Bugs: fixed)

Opened 1 year ago

Last modified 1 year ago

End Point Manager "Reboot this brand" button does not reboot phones

Reported by: TimMillerDyck Assigned to: tm1000
Priority: minor Milestone: 2.10
Component: Endpoint Manager (OSS) Version: 2.10-branch
Keywords: reboot phone Cc:
Confirmation: Confirmed Distro:
Backend Engine: Asterisk 1.8 Distro Ver:
Backend Ver: SVN Revision (if applicable):

Description

Testing with FreePBX 2.10 rc1.1 with Endpoint Manager 2.10.3.2 and an Aastra 6731i.

Steps to reproduce: - Global Phone Options > select "Aastra" and then click "Reboot This Brand" button - GUI displays "Rebooted all Aastra phones" at the top - phone does not reboot

Asterisk console (asterisk -r -vvvvvvvv) does not show any output when the button is clicked.

However, if I select the specific phone, enable "Reboot Phones" below the "Rebuild Configs for Selected Phones" button and click the "Rebuild Configs for Selected Phones" button, the phone _does_ reboot and the following displays in the Asterisk console:

[2012-02-18 11:34:45] WARNING[22389]: chan_sip.c:18523 sip_cli_notify: it is not necessary to specify Content-Length in sip_notify.conf, ignoring -- Remote UNIX connection disconnected

As a separate item, it would be convenient to have a "Reboot Selected Phones" button so just a single phone can be easily rebooted.

Thanks so much for End Point Manager. The template system is such a time-saver!

-Tim Miller Dyck

Change History

03/07/12 12:30:45 changed by tm1000

  • status changed from new to assigned.

06/07/12 19:01:56 changed by tm1000

  • status changed from assigned to closed.
  • resolution set to fixed.

In asterisk 1.8+ you have to specify a bind address. Otherwise sip-notify packets come from the address '0.0.0.0' and therefore the phones will not accept a reboot option

06/12/12 11:43:12 changed by TimMillerDyck

Hi tm1000,

I retested with endpointman-2.10.4.1.tgz and FreePBX Distro 1.813.210.58-1.

However, I am seeing the same no-rebooting behavior with the "Reboot This Brand" button:

Steps to reproduce: - Global Phone Options > select "Aastra" and then click "Reboot This Brand" button - GUI displays "Rebooted all Aastra phones" at the top - phone does not reboot

Regards,
Tim Miller Dyck

06/12/12 11:49:21 changed by tm1000

It appears you didn't read my response at all. Please confirm......

06/12/12 14:21:41 changed by TimMillerDyck

Hi, sorry, I thought your comment was referring to a change you had made in EndPoint? Manager somehow.

Are you are referring to the global Asterisk setting "bindaddr" in sip.conf? This was previously unset in my case. I changed the setting by entering the Asterisk server IP address in Settings > Asterisk SIP Settings > Advanced General Settings > Bind Address and restarted Asterisk. bindaddr is now set in sip_general_additional.conf.

However, the reboot did not occur still.

I did some more looking into this, and there appears to be two other things going on.

1. I learned that on an Aastra phone, "sip notify aastra-check-cfg" will only reboot the phone if the phone configuration files are different from what the phone already has (as per http://fonality.com/trixbox/forums/vendor-moderated-forums/aastra-endpoints/cmd-line-restart ). Touching the file to update the timestamp was not enough. However, echo "">>/tftpboot/(MAC).cfg and then issuing "sip notify aastra-check-cfg" from the Asterisk command interface successfully rebooted the phone.

2. On my system, End Point Manager is trying to issue "sip notify aastra-check-cfg" when the "Reboot This Brand" button is clicked, but the command is not working due to the following:

In /var/www/html/admin/modules/_ep_phone_modules/endpoint/aastra/base.php the line

exec($this->engine_location . " -rx 'sip notify aastra-check-cfg " . $this->settings['line'][0]['username'] . "'");

is submitting the sip notify. However, $this->engine_location and $this->settings['line'][0]['username'] are both blank when the command is executed. /var/log/httpd/error_log is recording "sh: -rx: command not found".

When I manually set these values and added a blank line to the phone TFTP config file, the "Reboot This Brand" button worked to reboot a test Aastra phone.

--- base.php.orig       2012-05-10 02:55:41.000000000 -0400
+++ base.php    2012-06-12 14:03:04.000000000 -0400
@@ -13,6 +13,16 @@

     function reboot() {
         if (($this->engine == "asterisk") AND ($this->system == "unix")) {
+            if (empty($this->engine_location)) {
+                if ($this->engine == 'asterisk') {
+                    $this->engine_location = 'asterisk';
+                } elseif ($this->engine == 'freeswitch') {
+                    $this->engine_location = 'freeswitch';
+                }
+            }
+            if (empty($this->settings['line'][0]['username'])) {
+                $this->settings['line'][0]['username'] = '302';
+            }
             exec($this->engine_location . " -rx 'sip notify aastra-check-cfg " . $this->settings['line'][0]['username'] . "'");
         }
     }
@@ -81,4 +91,4 @@
         }
     }

-}
\ No newline at end of file
+}

Maybe some class is not being instantiated as expected?

Happy to test further as per your input.

Regards, Tim Miller Dyck

06/13/12 14:44:51 changed by tm1000

  • status changed from closed to reopened.
  • resolution deleted.

It's really impossible for '$this->settingsline?[0]username?' to be blank. If that was the case your phone would never register. Anyways I believe you about the engine_location and I will look into it.

06/13/12 14:45:45 changed by tm1000

  • confirmation changed from Unreviewed to Pending.
  • milestone changed from Undetermined to 2.10.

06/14/12 13:33:33 changed by tm1000

  • status changed from reopened to closed.
  • confirmation changed from Pending to Confirmed.
  • resolution set to fixed.

Fixed in 2.10.4.2

06/14/12 15:36:25 changed by TimMillerDyck

Thanks for the quick fix! Aastra phone reboots are working now with 2.10.4.2.

-Tim