Open Source Training Seminar FreePBX Paid Support

Ticket #2703 (closed Bugs: fixed)

Opened 6 months ago

Last modified 2 months ago

"stop gracefully" deprecated in Asterisk 1.6

Reported by: drmessano Assigned to: pnlarsson
Priority: minor Milestone: 2.5
Component: Asterisk Configuration Version: 2.4-branch
Keywords: Cc:
Confirmation: Need testing SVN Revision (if applicable):
Backend Engine: Asterisk 1.6 Backend Engine Version:

Description

The asterisk -rx "stop gracefully" command in freepbx_engine no longer works in Asterisk 1.6.

I have created a patch that adds an asterisk -rx "core stop gracefully" above the previous command. This should handle both 1.2 and 1.4/1.6.

Attachments

freepbx_engine.diff (362 bytes) - added by drmessano on 02/22/08 17:30:34.

Change History

02/22/08 17:30:34 changed by drmessano

  • attachment freepbx_engine.diff added.

(follow-up: ↓ 2 ) 02/23/08 11:37:23 changed by drmessano

I understand how it is supposed to work. This is what is showing in the table:

No such command 'show uptime' (type 'help' for help)

(in reply to: ↑ 1 ) 02/23/08 11:40:36 changed by drmessano

OOPS: Commented wrong ticket

02/23/08 15:26:17 changed by pnlarsson

  • engine changed from All to Asterisk 1.6.
  • confirmation changed from Unreviewed to Confirmed.
  • component changed from Core to Asterisk Configuration.
  • priority changed from major to minor.
  • milestone changed from Cut Line to 2.4.
  • owner changed from p_lindheimer to pnlarsson.

stop gracefully works in 1.6. It's labeled as deprecated, so we should sort it out. But the patch does this to 1.2:

ast12fbx24:~# amportal stop



STOPPING ASTERISK
No such command 'core' (type 'help' for help)
Verbosity is at least 3

Disconnected from Asterisk server
Asterisk Stopped

STOPPING FOP SERVER

So lets make thoose errors go away.

02/23/08 15:26:43 changed by pnlarsson

  • summary changed from "stop gracefully" no longer works in Asterisk 1.6 to "stop gracefully" deprecated in Asterisk 1.6.

07/02/08 13:48:31 changed by lazytt

Philippe - is the error really such a big deal? or is there a simple way to check the asterisk version?

07/02/08 14:52:48 changed by p_lindheimer

  • confirmation changed from Confirmed to Need testing.

How about:

Index: freepbx_engine
===================================================================
--- freepbx_engine      (revision 5835)
+++ freepbx_engine      (working copy)
@@ -135,7 +135,8 @@
 pid_length=`pidof asterisk|awk '{print length($0)}'`
        if [ "$pid_length" != "0" -a "$pid_length" != "" ]
                then
-                       /usr/sbin/asterisk -rx "stop gracefully"
+                       /usr/sbin/asterisk -rx "core stop gracefully" | grep -v "No such command"
+                       /usr/sbin/asterisk -rx "stop gracefully" | grep -v -E "No such command|deprecated"
                        echo "Asterisk Stopped"
                fi
 }

The first will get rid of errors coming form 1.2, the second will get rid of the deprecated message coming from 1.4 and the error that I suspect will come for 1.6 since I'm assuming the old syntax is gone?

That would be my suggestion, if someone wants to try it out and say if it works we can go for it

Now ... didn't I recall another ticket about stop gracefully going away or am I just imagining that?

07/05/08 14:57:06 changed by lazytt

The 'proper' way to handle this (besides checking for the asterisk version - which is an unnecessary pain when such a simple solution is avalible) would probably be as follows:

Index: amp_conf/bin/freepbx_engine
===================================================================
--- amp_conf/bin/freepbx_engine (revision 5877)
+++ amp_conf/bin/freepbx_engine (working copy)
@@ -135,7 +135,8 @@
 pid_length=`pidof asterisk|awk '{print length($0)}'`
        if [ "$pid_length" != "0" -a "$pid_length" != "" ]
                then
-                       /usr/sbin/asterisk -rx "stop gracefully"
+                       /usr/sbin/asterisk -rx "stop gracefully" > /dev/null
+                       /usr/sbin/asterisk -rx "core stop gracefully" > /dev/null
                        echo "Asterisk Stopped"
                fi
 }

07/07/08 23:38:20 changed by p_lindheimer

pnlarsson - can you test my patch on 1.6? It should be fine but I don't have 1.6 loaded to try. (or drmessano if you could try it since you reported it if you have a 1.6 system, would be great).

07/10/08 15:25:43 changed by pnlarsson

I tested the /dev/null patch with 1.6 and it's ok. No warnings at all.

root@lisa:~# amportal stop



STOPPING ASTERISK
Asterisk Stopped

07/10/08 17:31:29 changed by p_lindheimer

pnlarsson, I was hoping you could test the first patch I posted:

-  /usr/sbin/asterisk -rx "stop gracefully"
+  /usr/sbin/asterisk -rx "core stop gracefully" | grep -v "No such command"
+  /usr/sbin/asterisk -rx "stop gracefully" | grep -v -E "No such command|deprecated"

since it would allow some output if appropriate.

07/10/08 20:14:35 changed by p_lindheimer

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

r5987 - checking the first one in.

Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads