aboutsummaryrefslogtreecommitdiffstats
path: root/asterisk.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2000-10-25 23:22:50 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2000-10-25 23:22:50 +0000
commiteee751655bec69ae8b185f27ab01517e8668e650 (patch)
tree438ab8052bda6e28dda9bf4775227b752056bac3 /asterisk.c
parent388072a264fafebfaf52611b486f2c415505b6d1 (diff)
Version 0.1.4 from FTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@218 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'asterisk.c')
-rwxr-xr-xasterisk.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/asterisk.c b/asterisk.c
index 4addf889c..de86f561b 100755
--- a/asterisk.c
+++ b/asterisk.c
@@ -48,6 +48,19 @@ static void urg_handler(int num)
return;
}
+static void set_title(char *text)
+{
+ /* Set an X-term or screen title */
+ if (getenv("TERM") && strstr(getenv("TERM"), "xterm"))
+ fprintf(stdout, "\033]2;%s\007", text);
+}
+
+static void set_icon(char *text)
+{
+ if (getenv("TERM") && strstr(getenv("TERM"), "xterm"))
+ fprintf(stdout, "\033]1;%s\007", text);
+}
+
static int set_priority(int pri)
{
struct sched_param sched;
@@ -210,6 +223,10 @@ int main(int argc, char *argv[])
if (option_console) {
/* Console stuff now... */
/* Register our quit function */
+ char title[256];
+ set_icon("Asterisk");
+ snprintf(title, sizeof(title), "Asterisk Console (pid %d)", getpid());
+ set_title(title);
ast_cli_register(&quit);
consolethread = pthread_self();
if (strlen(filename))