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

FS_CLI and Console, Controlling FreeSWITCH

There are so many ways to control FreeSWITCH in real time and make it to do what you want. You can write applications, scripts, have FreeSWITCH interact with databases and legacy systems... Whatever means you'll use to integrate your platform, you'll find yourself coming back now and then to the FreeSWITCH Command LIne (CLI). And a lot of FreeSWITCH admins use only CLI for their day to day tasks.

/usr/local/freeswitch/bin/freeswitch -u freeswitch -g freeswitch -c
  

If you start FreeSWITCH in foreground (eg, using the "-c " option), after a brief pause all the startup messages are scrolled away, and you end up at the command of the FreeSWITCH Console:

Much more often, let's say almost always if you're not debugging startup messages, you start FreeSWITCH in a different way, so it goes into background as a proper server (daemon), without a controlling terminal.

A production system is usually started like that:

    /usr/local/freeswitch/bin/freeswitch -u freeswitch -g freeswitch 
-nonat -ncwait

After some seconds, this command ends, we're told of the FreeSWITCH Process ID and then... nothing happens. Yes, is OK, FreeSWITCH is running in background and ready to accept and manage calls, and we can interact with it using the fs_cli utility, mimicking the native FreeSWITCH console.

    /usr/local/freeswitch/bin/fs_cli
    

Using fs_cli on a system where FreeSWITCH has already started brings us immediately in control: