Kamailio Advanced Training
Click here for more details!

Learn how to build RTC services with Kamailio!

Saturday, April 17, 2010

Kamailio 3.0.x - DYK-01 - long strings

Break long strings

See also: Kamailio 3.0.x - DYK - Table of Content

You can break long strings in your config starting with Kamailio 3.0.0, by just closing the double quotes and opening new ones on the next line. For example:

xlog("this message is sent by caller [$fu], source address [$si], local interface [$ri], targeting user [$ru], server time [$Tf]\n");

Can be written as:

xlog("this message is sent by caller [$fu],"
" source address [$si], local interface [$ri],"
" targeting user [$ru], server time [$Tf]\n");

Super-duper for a guy like me liking old style 80 chars long line, config structure is much cleaner, easier to follow than with auto line wrapping.

It works everywhere in config, most used by me in xlog() and sql_query() functions. Enjoy!

1 comment:

  1. Thank you, Daniel! This is very helpful; I did not know this.

    ReplyDelete