]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
tweak
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 31 Dec 2008 19:14:52 +0000 (19:14 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 31 Dec 2008 19:14:52 +0000 (19:14 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11034 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/esl/fs_cli.c
libs/esl/fs_cli.conf

index bcbf9a0ee82669b3fc7ed4bae71c9c7f9b9fc8d6..fb5f1187b45fce291be8a81e0be171b3e410c455 100644 (file)
@@ -25,7 +25,7 @@ typedef struct {
        esl_port_t port;
        char pass[128];
        int debug;
-       char *console_fnkeys[12];
+       const char *console_fnkeys[12];
        char loglevel[128];
        int quiet;
 } cli_profile_t;
@@ -60,7 +60,7 @@ static HistEvent ev;
  */
 static unsigned char console_fnkey_pressed(int i)
 {
-       char *c;
+       const char *c;
 
        assert((i > 0) && (i <= 12));
 
@@ -75,7 +75,6 @@ static unsigned char console_fnkey_pressed(int i)
                return CC_REDISPLAY;
        }
 
-
        if (process_command(global_handle, c)) {
                running = thread_running = 0;
        }
@@ -367,6 +366,22 @@ static void print_banner(FILE *stream)
 }
 
 
+static void set_fn_keys(cli_profile_t *profile)
+{
+       profile->console_fnkeys[0] = "help";
+       profile->console_fnkeys[1] = "status";
+       profile->console_fnkeys[2] = "show channels";
+       profile->console_fnkeys[3] = "show calls";
+       profile->console_fnkeys[4] = "sofia status";
+       profile->console_fnkeys[5] = "reloadxml";
+       profile->console_fnkeys[6] = "/log console";
+       profile->console_fnkeys[7] = "/log debug";
+       profile->console_fnkeys[8] = "sofia status profile internal";
+       profile->console_fnkeys[9] = "fsctl pause";
+       profile->console_fnkeys[10] = "fsctl resume";
+       profile->console_fnkeys[11] = "version";
+}
+
 
 int main(int argc, char *argv[])
 {
@@ -420,7 +435,9 @@ int main(int argc, char *argv[])
        strncpy(internal_profile.pass, "ClueCon", sizeof(internal_profile.pass));
        strncpy(internal_profile.name, "internal", sizeof(internal_profile.name));
        internal_profile.port = 8021;
-       
+       set_fn_keys(&internal_profile);
+
+
        if (home) {
                snprintf(hfile, sizeof(hfile), "%s/.fs_cli_history", home);
                snprintf(cfile, sizeof(cfile), "%s/.fs_cli_conf", home);
@@ -503,6 +520,7 @@ int main(int argc, char *argv[])
                                esl_set_string(profiles[pcount].host, "localhost");
                                esl_set_string(profiles[pcount].pass, "ClueCon");
                                profiles[pcount].port = 8021;
+                               set_fn_keys(&profiles[pcount]);
                                esl_log(ESL_LOG_DEBUG, "Found Profile [%s]\n", profiles[pcount].name);
                                pcount++;
                        }
index fc62072b9de591936bc207d87e765e6b399246bc..34932df48aae0237dbf2a1d9666ee598279159b5 100644 (file)
@@ -13,7 +13,7 @@ key_f3 => show channels
 key_f4 => show calls
 key_f5 => sofia status
 key_f6 => reloadxml
-key_f7 => /nolog
+key_f7 => /log console
 key_f8 => /log debug
 key_f9 => sofia status profile internal
 key_f10 => fsctl pause