User Tools

Site Tools


cookbooks:4.0.x:core:cfg

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
cookbooks:4.0.x:core:cfg [2013/06/26 09:00]
poing [Comments]
cookbooks:4.0.x:core:cfg [2013/06/26 09:39] (current)
poing [Configuration Directives]
Line 1: Line 1:
-<fc #FF0000>**This is a work in progress**</fc> 
- 
 ====== The Configuration File ====== ====== The Configuration File ======
  
Line 18: Line 16:
  
 There are five (5) types of configuration directives used with Kamailio.\\  There are five (5) types of configuration directives used with Kamailio.\\ 
-<fc #AA0000>**Each type of configuration directive uses its own syntax!**</fc>+^  <fc #800000>**Each type of configuration directive uses its own syntax!**</fc>  |
  
   - C-Style Control Directives   - C-Style Control Directives
Line 30: Line 28:
 ==== Comments ==== ==== Comments ====
  
-<fc #FF0000>**The first thing you should understand is the comment syntax used in the configuration file.\\ \\ **</fc>+^  <fc #800000>**The first thing you should understand is the comment syntax used in the configuration file.**</fc>  | 
 Comments in the configuration file are a mixture of C-Style (**not C++**) and scripting language syntaxes.\\  Comments in the configuration file are a mixture of C-Style (**not C++**) and scripting language syntaxes.\\ 
 It closely resembles the PHP style, **//except//** you **can not use** double-slash ( ⁄ ⁄ ) for line comments.  Only the hash (#) may be used for line comments.\\ \\  It closely resembles the PHP style, **//except//** you **can not use** double-slash ( ⁄ ⁄ ) for line comments.  Only the hash (#) may be used for line comments.\\ \\ 
Line 39: Line 38:
 /* This is a ... /* This is a ...
    block comment */</code>  |    block comment */</code>  |
-|<fc #FF0000>**Not a Comment:**</fc><code> // this is NOT a line comment </code>|+|<fc #800000>**Not a Comment:**</fc><code> // this is NOT a line comment </code>|
 |Line Comment:<code c># this is a line comment </code>| |Line Comment:<code c># this is a line comment </code>|
-|**<fc #FF0000>Valid Configuration Directive:</fc>**<code>#!c_style_directive</code>|+|**<fc #800000>Valid Configuration Directive:</fc>**<code>#!c_style_directive</code>|
  
 ----- -----
Line 53: Line 52:
 The general use is to allow for comments or additional configuration directives be placed on the same line. The general use is to allow for comments or additional configuration directives be placed on the same line.
  
-<code>+^ Examples: 
 +|<code>
 configuration_directive_a configuration_directive_a
 configuration_directive_b; configuration_directive_b;
 configuration_directive_c; configuration_directive_d configuration_directive_c; configuration_directive_d
 configuration_directive_e; # comment about the configuration directive configuration_directive_e; # comment about the configuration directive
-</code>+</code>|
  
 ----- -----
Line 66: Line 66:
  
 ^ Type ^ Format ^ Comment ^ ^ Type ^ Format ^ Comment ^
-| C-Style Control Directives | #!directive NAME VALUE | Begins with hash-bang (#!) |+| C-Style Control Directives | #!directive NAME VALUE ] ] | Begins with hash-bang (#!) |
 | Apache-Like Name/Value Pairs | name "value" | Delimited by a space & Value within quotes | | Apache-Like Name/Value Pairs | name "value" | Delimited by a space & Value within quotes |
 | Normal Name/Value Pairs | name=value | Delimited by an equals sign | | Normal Name/Value Pairs | name=value | Delimited by an equals sign |
Line 96: Line 96:
 #!endif #!endif
 </code>| </code>|
 +
 ----- -----
 ==== Apache Name/Value Pairs ==== ==== Apache Name/Value Pairs ====
Line 111: Line 112:
 import_file "/path/to/file_to_import.cfg" import_file "/path/to/file_to_import.cfg"
 </code>| </code>|
------  + 
 +-------
 ==== Normal Name/Value Pairs ==== ==== Normal Name/Value Pairs ====
 +
 +These name/value pairs are normally delimited by an equal sign.
  
 ^ Syntax: | ^ Syntax: |
 |<code c>name=value</code>| |<code c>name=value</code>|
- (delimited by an equals sign)  
  
-[[../core#core_parameters|core_parameters]]+<fc #FF0000>There are a couple situations where the value needs to be enclosed in quotes.</fc>\\  
 +Check the [[../core#core_parameters|core parameters]] for the required syntax.
  
 ^ Examples:  | ^ Examples:  |
Line 131: Line 135:
 alias="sip.mydomain.com" alias="sip.mydomain.com"
 </code>| </code>|
------+ 
 +------
 ==== Modify Parameter Procedure ==== ==== Modify Parameter Procedure ====
  
Line 141: Line 146:
      
 <fc #800000>Strings should be enclosed in quotes.</fc> <fc #800000>Strings should be enclosed in quotes.</fc>
 +
 +See the [[http://www.kamailio.org/docs/modules/4.0.x/|module documentation]] for support parameter settings.
  
 ^ Examples:  |   ^ Examples:  |  
Line 152: Line 159:
 ----- -----
 ==== Route Functions ==== ==== Route Functions ====
 +
 +I will not go into too much detail here, the scripting methods, functions, and procdedures should be covered elsewhere in this wiki.\\ 
 +
 +
 +^ Example:  |
 +|<code c>request_route {
 +        route(REQINIT); # Request Initial
 +        route(NATDETECT); # NAT Detection
 +
 +        # CANCEL ??
 +        if (is_method("CANCEL")) {
 +         exit;
 +        }
 +
 +        # OTHER SCRIPT CODE HERE
 +}</code>|
cookbooks/4.0.x/core/cfg.1372230005.txt.gz · Last modified: 2013/06/26 09:00 by poing