Copyright © 2003 FhG FOKUS
search(re)search_append(re, txt)replace(re, txt)replace_all(re, txt)subst('/re/repl/flags')subst_uri('/re/repl/flags')subst_user('/re/repl/flags')append_to_reply(txt)append_hf(hf)append_urihf(prefix, suffix)is_present_hf(hf_name)append_time()search usagesearch_append usagereplace usagereplace_all usagesubst usagesubst_uri usagesubst usageappend_to_reply usageappend_hf usageappend_urihf usageis_present_hf usageappend_time usageThis is mostly an example module. It implements text based operation (search, replace, append a.s.o).
search ignores folded lines. For example, search("(From|f):.*@foo.bar") doesn't match the following From header field:
From: medabeda <sip:medameda@foo.bar>;tag=1234
The following modules must be loaded before this module:
No dependencies on other OpenSER modules.
The following libraries or applications must be installed before running OpenSER with this module loaded:
None.
search(re)Searches for the re in the message.
Meaning of the parameters is as follows:
re - Regular expression.
search_append(re, txt)Searches for the first match of re and appends txt after it.
Meaning of the parameters is as follows:
re - Regular expression.
txt - String to be appended.
replace(re, txt)Replaces the first occurrence of re with txt.
Meaning of the parameters is as follows:
re - Regular expression.
txt - String.
replace_all(re, txt)Replaces all occurrence of re with txt.
Meaning of the parameters is as follows:
re - Regular expression.
txt - String.
subst('/re/repl/flags')Replaces re with repl (sed or perl like).
Meaning of the parameters is as follows:
'/re/repl/flags' - sed like regular expression. flags can be a combination of i (case insensitive), g (global) or s (match newline don't treat it as end of line).
subst_uri('/re/repl/flags')Runs the re substitution on the message uri (like subst but works only on the uri)
Meaning of the parameters is as follows:
'/re/repl/flags' - sed like regular expression. flags can be a combination of i (case insensitive), g (global) or s (match newline don't treat it as end of line).
subst_user('/re/repl/flags')Runs the re substitution on the message uri (like subst_uri but works only on the user portion of the uri)
Meaning of the parameters is as follows:
'/re/repl/flags' - sed like regular expression. flags can be a combination of i (case insensitive), g (global) or s (match newline don't treat it as end of line).
append_to_reply(txt)Append txt to the reply.
Meaning of the parameters is as follows:
txt - String.
append_hf(hf)Appends txt after the last header field.
Meaning of the parameters is as follows:
hf - Header field to be appended.
append_urihf(prefix, suffix)Append header field name with original Request-URI in middle.
Meaning of the parameters is as follows:
prefix - string (usually at least header field name).
suffix - string (usually at least line terminator).
is_present_hf(hf_name)Return true if a header field is present in message.
![]() | Takes header field names "as is" and doesn't distinguish compact names. |
Meaning of the parameters is as follows:
hf_name - Header field name.
append_time()Adds a time header to the message. Header format is: "Date: %a, %d %b %Y %H:%M:%S GMT", with the legend:
%a abbreviated week of day name (locale)
%d day of month as decimal number
%b abbreviated month name (locale)
%Y year with century
%H hour
%M minutes
%S seconds
Return true if a header was succesfully appended
Search functions are applied to the original request, i.e., they ignore all changes resulting from message processing in OPENSER script.
Take a look at http://openser.org/.
First at all check if your question was already answered on one of our mailing lists:
User Mailing List - http://openser.org/mailman/listinfo/users
Developer Mailing List - http://openser.org/mailman/listinfo/devel
E-mails regarding any stable OpenSER release should be sent to
<users@openser.org> and e-mails regarding development versions
should be sent to <devel@openser.org>.
If you want to keep the mail private, send it to
<team@openser.org>.
Please follow the guidelines provided at: http://openser.org/bugs.