Skip to main content

Running inside GNU Screen

About

Use the multi-window 'screen' program to attach/detach from FreeSWITCH.

Click here to expand Table of Contents

Running FreeSWITCH In Screen (Linux/Unix/BSD/OSX)

Some have asked about how to "attach" to a running FreeSWITCH process in a manner similar to that of Asterisk's asterisk -r command. One option for those running FreeSWITCH in a Linux/Unix environment is to use the handy screen utility, courtesy of GNU. (See http://www.gnu.org/software/screen/)

Starting FreeSWITCH In Screen

Make sure that FreeSWITCH is not running, then do this:

screen -d -m -S freeswitch /usr/local/freeswitch/bin/freeswitch

This will launch FreeSWITCH as a daemon in an attachable screen. Confirm that FreeSWITCH is running:

screen -ls

There is a screen on:
2652.freeswitch (Attached)
1 Socket in /var/run/screen/S-root.

Attaching to a Running FreeSWITCH Process

This is the cool part! From a terminal session simply launch screen:

screen -r

Or, if multiple processes have been started with screen, specify the FreeSWITCH process:

screen -r freeswitch

Detaching From a Running FreeSWITCH Process

To detach from the FreeSWITCH "screen" simply press Ctrl-A then Ctrl-D, after which you will see:

[detached]

...and you will be returned to your terminal session.

Terminating a FreeSWITCH Process in Screen

To terminate a FreeSWITCH session that is running in a screen simply use the -stop switch from the Linux/Unix command prompt:

freeswitch -stop

You can also issue the command fsctl shutdown from an XML-RPC session or from fs_cli.