Functions
<function moreinfo="none">msg_apply_changes()</function> Use this function to apply changes performed on SIP request content. Be careful when using this function; due to special handling of changes done to SIP message buffer so far, using this function might change the behaviour of your config. Do test your config properly! This function can be used from REQUEST_ROUTE. <function>msg_apply_changes()</function> usage ... append_hf("My-Header: yes\r\n"); if(msg_apply_changes()) { # msg buffer has a new content if(is_present_hf("My-Header")) { # will get here always } } ...
<function>change_reply_status(code, reason)</function> Intercept a SIP reply (in an onreply_route) and change its status code and reason phrase prior to propogating it. Meaning of the parameters is as follows: code - Status code. reason - Reason phrase. This function can be used from ONREPLY_ROUTE. <function>change_reply_status</function> usage ... onreply_route { if (@status == "603") { change_reply_status(404, "Not Found"); exit; } } ...
<function moreinfo="none">remove_body()</function> Use this function to remove body of SIP requests or replies. This function can be used from ANY_ROUTE. <function>remove_body()</function> usage ... remove_body(); ...
<function moreinfo="none">keep_hf(regexp)</function> Remove headers that don't match the regular expression regexp. Several header are ignored always (thus not removed): Via, From, To, Call-ID, CSeq, Content-Lenght, Content-Type, Max-Forwards, Contact, Route, Record-Route -- these can be removed one by one with remove_hf(). This function can be used from ANY_ROUTE. <function>keep_hf()</function> usage ... keep_hf("User-Agent"); ...
<function moreinfo="none">fnmatch(value, expr [, flags])</function> Match the value against the expr using the shell-style pattern for file name matching (see man page for C function fnmatch()). It is known to be faster and uses less-memory than regexp. Parameters flags is optional and can be 'i' to do case insensitive matching. This function can be used from ANY_ROUTE. <function>fnmatch()</function> usage ... if(fnmatch("$rU", "123*")) { ... } ...