Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

About

Global variables can be used to share information between all channels. You can save anything in a global variable.

Keep in mind that multiple channels can access/change the information in a variable. You need to take care when saving sensitive data.

Here we provide a list of Global Variables that the FreeSWITCH core pre-defines and assigns a default value. You can override it in your configuration or from the API. The default for some of these are calculated dynamically.

 

Expand
titleClick here to expand Table of Contents
Panel
borderColorlightgray
bgColor#f7f7f7
borderWidth1
borderStyledotted

Table of Contents
maxLevel3
outlinetrue
indent1em
excludeAbout
stylenone
printablefalse

XML Configuration Examples

Preprocessor variables set in the XML configuration become global variables in FreeSWITCH.

set

...

Networking & SIP Related

Include Page
hostname
hostname

Include Page
local_ip_v4

...

local_ip_v4

...

exec-set

Sets a variable to the standard output of the executed command.

...

Include Page
local_ip_v6
local_ip_

...

get

Code Block
<param name="sip-port" value="$${external_sip_port}"/>

API examples

global_setvar

Code Block
freeswitch@localhost> global_setvar foo=1

+OK

...

Code Block
freeswitch@localhost> global_getvar foo

1

 

See Also

GetGlobalVariable

Global Variable local ip v4

SetGlobalVariable

Commands

JavaScript API Reference

Lua API Reference

 

v6

Include Page
local_mask_v4
local_mask_v4

Include Page
zrtp_enabled
zrtp_enabled

Include Page
nat_public_addr
nat_public_addr

Include Page
nat_private_addr
nat_private_addr

Include Page
nat_type
nat_type

Directories

These variables are used to set the default directory used by FreeSWITCH for certain files.


Include Page
base_dir
base_dir

Include Page
cache_dir
cache_dir

Include Page
certs_dir
certs_dir

Include Page
conf_dir
conf_dir

Include Page
db_dir
db_dir

Include Page
grammar_dir
grammar_dir

Include Page
htdocs_dir
htdocs_dir

Include Page
log_dir
log_dir

Include Page
mod_dir
mod_dir

Include Page
recordings_dir
recordings_dir

Include Page
run_dir
run_dir

Include Page
script_dir
script_dir

Include Page
sounds_dir
sounds_dir

 

Include Page
sound_prefix
sound_prefix

Include Page
storage_dir
storage_dir

 

 

Include Page
temp_dir
temp_dir

Others

Include Page
core_uuid
core_uuid

Include Page
switch_serial
switch_serial