Permalink
Browse files

WHISTLE-1165 and WHISTLE-1141

  • Loading branch information...
1 parent 83a4839 commit 067b258ebf54183ff3b1ea2ba8854ef4dbf59bf9 @k-anderson k-anderson committed May 9, 2012
View
34 ecallmgr/ecallmgr_ctl
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+cd `dirname $0`/../utils/sup/
+echo
+echo "===================================[ This command has been depreciated!!! ]==================================="
+echo
+echo " We appologize for any inconvience, but hope that you find the 'sup' command a more flexable and usefull tool."
+echo " Its output and return value is much more conducive to scripting. We also plan to use it at the lowlevel"
+echo " for a series of much more user friendly scripts (comming shortly). Furthermore, the 'sup' command can"
+echo " connect to remote serves, meaning you can manage all your nodes from one system. More details are available"
+echo " on the 2600hz wiki! --Thank you"
+echo
+echo "Please make note of the following command replacements:"
+echo " * ecallmgr_ctl add_fs_node freeswitch@2600hz.com"
+echo " > $PWD/sup -n ecallmgr ecallmgr_maintenance add_fs_node freeswitch@2600hz.com"
+echo
+echo " * ecallmgr_ctl rm_fs_node freeswitch@2600hz.com"
+echo " > $PWD/sup -n ecallmgr ecallmgr_maintenance remove_fs_node freeswitch@2600hz.comp"
+echo
+echo " * ecallmgr_ctl status"
+echo " > $PWD/sup -n ecallmgr ecallmgr_maintenance list_fs_nodes"
+echo
+echo "New commands:"
+echo " * List technical details about the calls currently being processed by this ecallmgr"
+echo " > $PWD/sup -n ecallmgr ecallmgr_maintenance show_calls"
+echo
+echo " * List the freeswitch nodes that this ecallmgr is configured to connect to"
+echo " > $PWD/sup -n ecallmgr ecallmgr_config get fs_nodes"
+echo
+echo "To save yourself from having to type the full path each time you can run(per user):"
+echo " > $PWD/add_alias.sh"
+echo
+echo "=============================================================================================================="
+echo
View
BIN utils/command_bridge/command_bridge
Binary file not shown.
View
13 utils/sup/add_alias.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+cd `dirname $0`
+
+FILE=~/.bashrc
+
+if grep -q sup $FILE
+then
+ echo "'sup' alias already exists in $FILE"
+else
+ echo "adding 'sup' alias to $FILE"
+ echo "alias sup='$PWD/sup'" >> $FILE
+fi
View
0 utils/command_bridge/compile.sh → utils/sup/compile.sh
File renamed without changes.
View
0 utils/command_bridge/rebar.config → utils/sup/rebar.config
File renamed without changes.
View
4 ...command_bridge/src/command_bridge.app.src → utils/sup/src/sup.app.src
@@ -1,4 +1,4 @@
-{application, command_bridge,
+{application, sup,
[
{description, ""},
{vsn, "1"},
@@ -7,6 +7,6 @@
kernel,
stdlib
]},
- {mod, { command_bridge_app, []}},
+ {mod, { sup_app, []}},
{env, []}
]}.
View
13 utils/command_bridge/src/command_bridge.erl → utils/sup/src/sup.erl
@@ -7,7 +7,7 @@
%%% @contributors
%%% Karl Anderson
%%%------------------------------------------------------------------
--module(command_bridge).
+-module(sup).
-include_lib("whistle/include/wh_types.hrl").
@@ -32,6 +32,7 @@ main(CommandLineArgs, Loops) ->
main(CommandLineArgs, Loops + 1);
_Else ->
{ok, Options, Args} = parse_args(CommandLineArgs),
+ lists:member(help, Options) andalso display_help(1),
Verbose = proplists:get_value(verbose, Options) =/= undefined,
Target = get_target(Options, Verbose),
Module = list_to_atom(proplists:get_value(module, Options, "nomodule")),
@@ -113,7 +114,7 @@ get_host(Options) ->
-spec my_name/0 :: () -> atom().
my_name() ->
Localhost = net_adm:localhost(),
- list_to_atom("command_bridge_" ++ os:getpid() ++ "@" ++ Localhost).
+ list_to_atom("sup_" ++ os:getpid() ++ "@" ++ Localhost).
-spec parse_args/1 :: (string()) -> {'ok', proplist(), list()}.
parse_args(CommandLineArgs) ->
@@ -131,31 +132,31 @@ parse_args(CommandLineArgs) ->
print_no_setcookie() ->
io:format(standard_io, "Unable to automatically determine cookie~n", []),
io:format(standard_io, "Please provide the cookie of the node you are connecting to~n", []),
- io:format(standard_io, "\"./command_bridge -c <cookie>\"~n", []),
+ io:format(standard_io, "\"./sup -c <cookie>\"~n", []),
halt(1).
-spec print_ping_failed/2 :: (string(), string()) -> no_return().
print_ping_failed(Target, Cookie) ->
io:format(standard_io, "Failed to connect to service '~s' with cookie '~s'~n", [Target, Cookie]),
io:format(standard_io, " Possible fixes:~n", []),
io:format(standard_io, " * Ensure the whistle service you are trying to connect to is running on the host~n", []),
- io:format(standard_io, " * Ensure that you are using the same cookie as the whistle node, \"./command_bridge -c <cookie>\"~n", []),
+ io:format(standard_io, " * Ensure that you are using the same cookie as the whistle node, \"./sup -c <cookie>\"~n", []),
io:format(standard_io, " * Verify that the hostname being used is a whistle node~n", []),
halt(1).
-spec print_unresolvable_host/1 :: (string()) -> no_return().
print_unresolvable_host(Host) ->
io:format(standard_io, "If you can not run \"ping ~s\" then this program will not be able to connect.~n", [Host]),
io:format(standard_io, " Possible fixes:~n", []),
- io:format(standard_io, " * Use \"./command_bridge -h <hostname>\" argument of this script to specify a different host~n", []),
+ io:format(standard_io, " * Use \"./sup -h <hostname>\" argument of this script to specify a different host~n", []),
io:format(standard_io, " * Add \"{IP_OF_WHISTLE_NODE} ~s\" to your /etc/hosts file~n", [Host]),
io:format(standard_io, " * Create a DNS record for \"~s\"~n", [Host]),
halt(1).
-spec display_help/1 :: (non_neg_integer()) -> no_return().
display_help(Return) ->
OptSpecList = option_spec_list(),
- getopt:usage(OptSpecList, "command_bridge", "[args ...]"),
+ getopt:usage(OptSpecList, "sup", "[args ...]"),
erlang:halt(Return).
-spec option_spec_list/0 :: () -> proplist().
View
4 ...command_bridge/src/command_bridge_app.erl → utils/sup/src/sup_app.erl
@@ -1,4 +1,4 @@
--module(command_bridge_app).
+-module(sup_app).
-behaviour(application).
@@ -10,7 +10,7 @@
%% ===================================================================
start(_StartType, _StartArgs) ->
- command_bridge_sup:start_link().
+ sup_sup:start_link().
stop(_State) ->
ok.
View
2 ...command_bridge/src/command_bridge_sup.erl → utils/sup/src/sup_sup.erl
@@ -1,5 +1,5 @@
--module(command_bridge_sup).
+-module(sup_sup).
-behaviour(supervisor).
View
BIN utils/sup/sup
Binary file not shown.

0 comments on commit 067b258

Please sign in to comment.