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: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:
 </code> </code>
  
 +  * you can define values for IDs
 +
 +<code c>
 +#!define MYINT 123
 +#!define MYSTR "xyz"
 +</code>
 +
 +  * defined IDs are replaced at startup, during config parsing, e.g.,:
 +
 +<code c>
 +$var(x) = 100 + MYINT;
 +</code>
 +
 +  * is interpreted as:
 +
 +<code c>
 +$var(x) = 100 + 123;
 +</code>
 +
 +  * you can have multi-line defined IDs
 +
 +<code c>
 +#!define IDLOOP $var(i) = 0; \
 +                while($var(i)<5) { \
 +                    xlog("++++ $var(i)\n"); \
 +                    $var(i) = $var(i) + 1; \
 +                }
 +</code>
 +
 +  * then in routing block
 +
 +<code c>
 +route {
 +    ...
 +    IDLOOP
 +    ...
 +}
 +</code>
 +
 +  * 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 '\' and CR for the accurate inside-define position
 +    * 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 "/regexp/subst/flags"
 +</code>
 +
 +  * flags is optional and can be: 'i' - ignore case; 'g' - global replacement
 +
 +Example:
 +
 +<code c>
 +#!subst "/DBPASSWD/xyz/"
 +modparam("acc", "db_url", "mysql://user:DBPASSWD@localhost/db")
 +</code>
 +
 +  * will do the substitution of db password in db_url parameter value
 +
 +==== substdef ====
 +
 +<code c>
 +#!subst "/ID/subst/"
 +</code>
 +
 +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:
 +
 +<code>
 +corelog=1
 +</code> 
 ==== 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:
 +
 +<code>
 +pv_buffer_size=2048
 +</code>
 +
 +==== 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:
 +
 +<code>
 +pv_buffer_slots=12
 +</code>
  
 ==== reply_to_via ==== ==== reply_to_via ====
Line 908: Line 1021:
 user_agent_header="User-Agent: My Super SIP Server" user_agent_header="User-Agent: My Super SIP Server"
 </code> </code>
 +
 +==== 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 "version".
 +
 +Example of usage:
 +
 +     table_version=sr_table_version
  
 ==== workdir ==== ==== workdir ====
Line 1121: Line 1241:
  
    tcp_accept_aliases= yes|no    tcp_accept_aliases= yes|no
 +
 +
 +==== 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
 +</code>
  
 ==== 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). 
      Possible values:    - off      Possible values:    - off
                         1  - the "fast" timer                         1  - the "fast" timer
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 nto what you want. Thus it is better to call append_branch without parameter and then modify the main branch.+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 not what you want. Thus it is better to call append_branch without parameter and then modify the main branch.
  
 Note that it's not possible to append a new branch in "on_failure_route" block if a 6XX response has been previously received (it would be against RFC 3261). Note that it's not possible to append a new branch in "on_failure_route" block if a 6XX response has been previously received (it would be against RFC 3261).

Navigation

Wiki

Other

QR Code
QR Code cookbooks:core-cookbook:devel (generated for current page)