Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
cookbooks:core-cookbook:devel [2011/07/05 09:32] 85.178.69.40 |
cookbooks:core-cookbook:devel [2013/01/11 14:48] (current) alexh [workdir] |
||
---|---|---|---|
Line 55: | Line 55: | ||
Available directives: | Available directives: | ||
* #!define NAME - define a keyword | * #!define NAME - define a keyword | ||
+ | * #!define NAME VALUE - define a keyword with value | ||
* #!ifdef NAME - check if a keyword is defined | * #!ifdef NAME - check if a keyword is defined | ||
* #!ifndef - check if a keyword is not defined | * #!ifndef - check if a keyword is not defined | ||
Line 113: | Line 114: | ||
</ | </ | ||
+ | * you can define values for IDs | ||
+ | |||
+ | <code c> | ||
+ | #!define MYINT 123 | ||
+ | #!define MYSTR " | ||
+ | </ | ||
+ | |||
+ | * defined IDs are replaced at startup, during config parsing, e.g.,: | ||
+ | |||
+ | <code c> | ||
+ | $var(x) = 100 + MYINT; | ||
+ | </ | ||
+ | |||
+ | * is interpreted as: | ||
+ | |||
+ | <code c> | ||
+ | $var(x) = 100 + 123; | ||
+ | </ | ||
+ | |||
+ | * you can have multi-line defined IDs | ||
+ | |||
+ | <code c> | ||
+ | #!define IDLOOP $var(i) = 0; \ | ||
+ | while($var(i)< | ||
+ | xlog(" | ||
+ | $var(i) = $var(i) + 1; \ | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | * then in routing block | ||
+ | |||
+ | <code c> | ||
+ | route { | ||
+ | ... | ||
+ | IDLOOP | ||
+ | ... | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | * number of allowed defines is now set to 256 | ||
+ | |||
+ | * notes: | ||
+ | * multilines defines are reduced to single line, so line counter should be fine | ||
+ | * column counter goes inside the define value, but you have to omit the ' | ||
+ | * text on the same line as the directive will cause problems. Keep the directive lines clean and only comment on a line before or after. | ||
+ | |||
+ | ==== subst ==== | ||
+ | |||
+ | * perform substitutions inside the strings of config (note that define is replacing only IDs - alphanumeric tokens not enclosed in quotes) | ||
+ | * #!subst offers an easy way to search and replace inside strings before cfg parsing. E.g.,: | ||
+ | |||
+ | <code c> | ||
+ | #!subst "/ | ||
+ | </ | ||
+ | |||
+ | * flags is optional and can be: ' | ||
+ | |||
+ | Example: | ||
+ | |||
+ | <code c> | ||
+ | #!subst "/ | ||
+ | modparam(" | ||
+ | </ | ||
+ | |||
+ | * will do the substitution of db password in db_url parameter value | ||
+ | |||
+ | ==== substdef ==== | ||
+ | |||
+ | <code c> | ||
+ | #!subst "/ | ||
+ | </ | ||
+ | |||
+ | Similar to **subst**, but in addition it adds a **#!define ID subst**. | ||
===== Core Keywords ===== | ===== Core Keywords ===== | ||
Line 423: | Line 497: | ||
+ | ==== corelog ==== | ||
+ | |||
+ | Set the debug level used to print some log messages from core, which might become annoying and don't represent critical errors. For example, such case is failure to parse incoming traffic from the network as SIP message, due to someone sending invalid content. | ||
+ | |||
+ | Default value is -1 (L_ERR). | ||
+ | |||
+ | Example of usage: | ||
+ | |||
+ | < | ||
+ | corelog=1 | ||
+ | </ | ||
==== debug ==== | ==== debug ==== | ||
Line 653: | Line 738: | ||
maxbuffer=65536 | maxbuffer=65536 | ||
+ | | ||
+ | ==== sql_buffer_size ==== | ||
+ | |||
+ | The size in bytes of the SQL buffer created for data base queries. For database drivers that use the core db_query library, this will be maximum size object that can be written or read from a database. Default value is 65535. | ||
+ | |||
+ | Example of usage: | ||
+ | |||
+ | sql_buffer_size=131070 | ||
==== max_while_loops ==== | ==== max_while_loops ==== | ||
Line 783: | Line 876: | ||
port=5080 | port=5080 | ||
+ | |||
+ | ==== pv_buffer_size ==== | ||
+ | |||
+ | The size in bytes of internal buffer to print dynamic strings with pseudo-variables inside. The default value is 1024. | ||
+ | |||
+ | Example of usage: | ||
+ | |||
+ | < | ||
+ | pv_buffer_size=2048 | ||
+ | </ | ||
+ | |||
+ | ==== pv_buffer_slots ==== | ||
+ | |||
+ | The number of internal buffer slots to print dynamic strings with pseudo-variables inside. The default value is 10. | ||
+ | |||
+ | Example of usage: | ||
+ | |||
+ | < | ||
+ | pv_buffer_slots=12 | ||
+ | </ | ||
==== reply_to_via ==== | ==== reply_to_via ==== | ||
Line 908: | Line 1021: | ||
user_agent_header=" | user_agent_header=" | ||
</ | </ | ||
+ | |||
+ | ==== version_table ==== | ||
+ | Set the name of the table holding the table version. Usefull if the proxy is sharing a database within a project and during upgrades. Default value is " | ||
+ | |||
+ | Example of usage: | ||
+ | |||
+ | | ||
==== workdir ==== | ==== workdir ==== | ||
Line 1121: | Line 1241: | ||
| | ||
+ | |||
+ | |||
+ | ==== tcp_accept_no_cl ==== | ||
+ | |||
+ | Control whether to throw or not error when there is no Content-Length header for requests received over TCP. It is required to be set to **yes** for XCAP traffic sent over HTTP/1.1 which does not use Content-Length header, but splits large bodies in many chunks. The module **sanity** can be used then to restrict this permission to HTTP traffic only, testing in route block in order to stay RFC3261 compliant about this mandatory header for SIP requests over TCP. | ||
+ | |||
+ | Default value is **no**. | ||
+ | |||
+ | <code c> | ||
+ | tcp_accept_no_cl=yes | ||
+ | </ | ||
==== tcp_async ==== | ==== tcp_async ==== | ||
Line 1487: | Line 1618: | ||
==== real_time ==== | ==== real_time ==== | ||
- | Sets real time priority for all the ser processes, or the timers (bitmaks). | + | Sets real time priority for all the ser processes, or the timers (bitmask). |
| | ||
1 - the " | 1 - the " | ||
Line 1556: | Line 1687: | ||
Without parameter, the function copies the current URI into a new branch. Thus, leaving the main branch (the URI) for further manipulation. | Without parameter, the function copies the current URI into a new branch. Thus, leaving the main branch (the URI) for further manipulation. | ||
- | With a parameter, the function copies the URI in the parameter into a new branch. Thus, the current URI is not manipulated. Note: append_branch(uri) still copies the destination URI, which is usually | + | With a parameter, the function copies the URI in the parameter into a new branch. Thus, the current URI is not manipulated. Note: append_branch(uri) still copies the destination URI, which is usually |
Note that it's not possible to append a new branch in " | Note that it's not possible to append a new branch in " |