FreeSWITCH 1.2
上QQ阅读APP看书,第一时间看更新

Running FreeSWITCH in the background

In most cases, you will want FreeSWITCH to run in the background. In a Unix/Linux environment this is frequently called running as a daemon. In Windows this is called running as a service.

To launch FreeSWITCH as a daemon in Unix/Linux, execute the following command:

#>/usr/local/freeswitch/bin/freeswitch –nc

The various Linux and Unix distributions take different approaches to automatically running a daemon at system start up. Several initialization or init script examples are available on the FreeSWITCH wiki: wiki.freeswitch.org/wiki/Freeswitch_init. Consult the system administration documentation for your specific distribution for instructions on how to configure the init script to launch FreeSWITCH at system start up.

Windows requires just a few steps to have FreeSWITCH run as a service. They are as follows:

  1. Open a Windows command-line session (click on Start | Run, type cmd, and then click on the OK button).
  2. Change the directory into your FreeSWITCH installation directory, as follows:

    cd FreeSWITCH\freeswitch-1.2.1\Release

  3. Run freeswitchconsole.exe with the –install argument, as follows:
    freeswitchconsole –install FreeSWITCH
    
  4. The last step is to configure the service itself.

    If you are using Windows XP or Server 2003, open the services tool and click on Start | Control Panel | Administrative Tools | Services.

    Otherwise, if you are using later versions of Windows, simply type in Services in the Start menu's search textbox. Select the Services icon in the results bar.

    Alternatively, you can also bring up the Services MMC Console by entering Windows Key + R and typing in services.msc, and then click on OK.

    FreeSWITCH should now appear in the list of services:

  5. Right-click on FreeSWITCH and click on Start. The service will take a moment to start up.
  6. Confirm that the service is running by using the fs_cli.exe utility found in the Release folder.
  7. You will see a welcome screen and a command prompt. Issue the status command to confirm that the system is running.
  8. Type /exit to close the fs_cli.exe program.

You now have FreeSWITCH running as a service in Windows.

The fs_cli utility is discussed in greater detail in Chapter 10, Controlling FreeSWITCH Externally.