This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
cookbooks:4.0.x:core:cfg [2013/06/26 08:16] poing [Modify Parameter Procedure] |
cookbooks:4.0.x:core:cfg [2013/06/26 09:39] (current) poing [Configuration Directives] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | <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!**</ | + | ^ |
- 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.\\ \\ **</ | + | ^ |
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, **// | It closely resembles the PHP style, **// | ||
- | It can be confusing seeing the C-Style Control Directives ([[cfg# | + | It can be confusing seeing the C-Style Control Directives ([[cfg# |
- | < | + | ^ Examples: |
+ | |Block Comment:< | ||
/* This is a ... | /* This is a ... | ||
- | block comment */ | + | block comment */</ |
- | // this is NOT a line comment | + | |<fc # |
- | # this is a line comment | + | |Line Comment:< |
- | #!c_style_directive | + | |**< |
- | </ | + | |
----- | ----- | ||
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. | ||
- | < | + | ^ Examples: |
+ | |< | ||
configuration_directive_a | configuration_directive_a | ||
configuration_directive_b; | configuration_directive_b; | ||
configuration_directive_c; | configuration_directive_c; | ||
configuration_directive_e; | configuration_directive_e; | ||
- | </ | + | </ |
----- | ----- | ||
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 | # |
| Apache-Like Name/Value Pairs | name " | | Apache-Like Name/Value Pairs | name " | ||
| Normal Name/Value Pairs | name=value | Delimited by an equals sign | | | Normal Name/Value Pairs | name=value | Delimited by an equals sign | | ||
Line 86: | Line 86: | ||
* #!substdef | * #!substdef | ||
- | < | + | ^ Example: |
+ | |< | ||
#!define MODULE_NAME | #!define MODULE_NAME | ||
#!ifdef MODULE_NAME | #!ifdef MODULE_NAME | ||
- | .. set directives .. | + | ".. set directives .." |
#!else | #!else | ||
- | .. set alternate directives .. | + | ".. set alternate directives .." |
#!endif | #!endif | ||
- | </ | + | </ |
----- | ----- | ||
==== Apache Name/Value Pairs ==== | ==== Apache Name/Value Pairs ==== | ||
- | | + | ^ Syntax |
+ | | <code c>name " | ||
<fc # | <fc # | ||
- | | + | ^ Examples |
- | loadmodule " | + | |< |
- | include_file " | + | loadmodule " |
- | import_file "/ | + | loadmodule " |
+ | include_file " | ||
+ | import_file "/ | ||
+ | </ | ||
- | ----- | + | ------- |
==== Normal Name/Value Pairs ==== | ==== Normal Name/Value Pairs ==== | ||
- | | + | These name/value pairs are normally |
- | (delimited by an equals | + | |
- | [[../core# | + | ^ Syntax: | |
+ | |<code c> | ||
- | < | + | <fc # |
+ | Check the [[../ | ||
+ | |||
+ | ^ Examples: | ||
+ | |< | ||
memdbg=5 | memdbg=5 | ||
memlog=5 | memlog=5 | ||
Line 124: | Line 134: | ||
auto_aliases=no | auto_aliases=no | ||
alias=" | alias=" | ||
- | </ | + | </ |
- | ----- | + | |
+ | ------ | ||
==== Modify Parameter Procedure ==== | ==== Modify Parameter Procedure ==== | ||
- | < | + | The modify parameter is similar to other types programming procedure.\\ |
+ | You call the procedure and it modifies the defined modules parameter. | ||
+ | |||
+ | ^ Syntax: | ||
+ | | <code c> | ||
+ | |||
+ | <fc # | ||
+ | |||
+ | See the [[http:// | ||
+ | |||
+ | ^ Examples: | ||
+ | |< | ||
modparam(" | modparam(" | ||
modparam(" | modparam(" | ||
modparam(" | modparam(" | ||
modparam(" | modparam(" | ||
- | </ | + | </ |
----- | ----- | ||
==== 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> | ||
+ | route(REQINIT); | ||
+ | route(NATDETECT); | ||
+ | |||
+ | # CANCEL ?? | ||
+ | if (is_method(" | ||
+ | exit; | ||
+ | } | ||
+ | |||
+ | # OTHER SCRIPT CODE HERE | ||
+ | }</ |