New upstream version 5.7.0

mr11.4 upstream/5.7.0
Victor Seva 3 years ago
parent 75b4eefc66
commit 8acbb26d60

14350
ChangeLog

File diff suppressed because it is too large Load Diff

@ -67,7 +67,7 @@ Requirements:
gcc >= 2.9x; 3.[12] recommended (it will work with older version
but it might require some options tweaking for best performance)
clang >= version 3.3
- bison or yacc (Berkley Yacc)
- bison or yacc (Berkeley Yacc)
- flex
- GNU make (on Linux this is the standard "make", on *BSD and Solaris it is
called "gmake") version >= 3.80 (recommended 3.81).
@ -181,7 +181,7 @@ OS Notes:
see README of the module you want to use
Kamailio have APT deb repositories that allow you to
install the binaries easily - see the web site for more details:
- http://kamailio.org
- https://kamailio.org
Cygwin (alpha state, partial support)
@ -332,7 +332,7 @@ are grouped based on Debian packaging rules. For example:
make mode=debug PROFILE=-pg all
- compile only the print module
make modules=modules/print modules
- compile by default only the print module, in debuging mode and with
- compile by default only the print module, in debugging mode and with
profiling:
make cfg modules=modules/print mode=debug PROFILE=-pg
make all
@ -511,14 +511,14 @@ A) Getting Help
This guide gives you instructions on how to set up the Kamailio
on your box quickly. In case the default configuration does not fly, please
check the documentation at the Kamailio web site
http://www.kamailio.org to learn how to configure Kamailio for your site.
https://www.kamailio.org to learn how to configure Kamailio for your site.
If the documentation does not resolve your problem you may try contacting
our user forum by E-mail at sr-users@lists.kamailio.org -- that is the
mailing list of the Kamailio community. To participate in the mailing list,
please subscribe at the following web address:
https://lists.kamailio.org/cgi-bin/mailman/listinfo
https://lists.kamailio.org/
B) Disclaimers
@ -537,7 +537,7 @@ C) Quick Start
1) Download an RPM or Debian package from the links on the wiki
https://www.kamailio.org/wiki/
https://www.kamailio.org/wikidocs/
If you don't use an rpm or debian based distribution, try our tar.gz'ed
binaries
@ -614,7 +614,7 @@ D) Kamailio With Persistent Data Storage
1) Download the package containing mysql support for Kamailio from the links
you find on:
https://www.kamailio.org/wiki/
https://www.kamailio.org/wikidocs/
(rpm and deb provided, most of the binary tar.gz distributions and the
solaris package include it; if it is not present you'll have to rebuild
@ -701,4 +701,4 @@ A: Use bug tracker at: https://github.com/kamailio/kamailio/issues
Q: Any F.A.Q. that could be helpful to check before reporting an issue?
A: See: https://www.kamailio.org/wiki/tutorials/faq/main
A: See: https://www.kamailio.org/wikidocs/tutorials/faq/main

@ -1,6 +1,6 @@
Kamailio v5.6
Kamailio v5.7
=============
https://www.kamailio.org
@ -121,7 +121,7 @@ documentation or other resources that could help the project.
For code contributions, follow the suggestions provided at:
* https://www.kamailio.org/wiki/devel/git-commit-guidelines
* https://www.kamailio.org/wikidocs/devel/git-commit-guidelines
The recommended way to contribute code is via pull requests to Kamailio
project on Github:

@ -31,7 +31,7 @@ Github pull requests are the recommended way to contribute to Kamailio source co
To keep a coherent and consistent history of the development, the commit messages format and content must follow the rules detailed at:
* https://www.kamailio.org/wiki/devel/github-contributions
* https://www.kamailio.org/wikidocs/devel/github-contributions
Contributions must conform with licensing rules of the Kamailio project.
@ -86,15 +86,15 @@ To report a bug or make a request for new features, use the Issues Page in the K
Mailing list for discussions regarding stable versions of Kamailio:
* **sr-users (at) lists.kamailio.org** - [sr-users web page](https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users)
* **sr-users (at) lists.kamailio.org** - [sr-users web page](https://lists.kamailio.org/mailman3/postorius/lists/sr-users.lists.kamailio.org/)
Mailing list for discussions regarding the development of Kamailio and the state of master (devel) branch:
* **sr-dev (at) lists.kamailio.org** - [sr-dev web page](https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev)
* **sr-dev (at) lists.kamailio.org** - [sr-dev web page](https://lists.kamailio.org/mailman3/postorius/lists/sr-dev.lists.kamailio.org/)
Mailing list for discussions with commercial purpose:
* **business (at) lists.kamailio.org** - [business web page](https://lists.kamailio.org/cgi-bin/mailman/listinfo/business)
* **business (at) lists.kamailio.org** - [business web page](https://lists.kamailio.org/mailman3/postorius/lists/business.lists.kamailio.org/)
For more information about the mailing lists, please see:

@ -9,7 +9,7 @@ Most of documentation for Kamailio can be found on the website:
* main index for documentation:
* https://www.kamailio.org/w/documentation/
* wiki site with cookbooks and tutorials:
* https://www.kamailio.org/wiki/
* https://www.kamailio.org/wikidocs/
* documentation for the modules in latest stable version:
* https://www.kamailio.org/docs/modules/stable/

@ -11,7 +11,7 @@
<!ENTITY kamailioconfig "kamailio.cfg">
<!ENTITY kamailioconfdir "/usr/local/etc/kamailio">
<!ENTITY kamwiki "https://www.kamailio.org/wiki/">
<!ENTITY kamwiki "https://www.kamailio.org/wikidocs/">
<!ENTITY kamwikilink "<ulink url='&kamwiki;'>&kamwiki;</ulink>">
<!ENTITY kamctl "kamctl">
<!ENTITY kamcli "kamcli">

@ -21,7 +21,7 @@ or enclosed in
are interpreted as comments.
.PP
This manual page is incomplete. For further information please see documentation on page
.I http://kamailio.org/wiki.
.I https://kamailio.org/wikidocs/.
.SH FILES
.I /etc/kamailio/kamailio.cfg

@ -7,16 +7,16 @@ notes for previous versions are posted below.
For releases after 3.1, please visit:
https://www.kamailio.org/wiki/features/new-in-5.2.x
https://www.kamailio.org/wiki/features/new-in-5.1.x
https://www.kamailio.org/wiki/features/new-in-5.0.x
http://www.kamailio.org/wiki/features/new-in-4.4.x
http://www.kamailio.org/wiki/features/new-in-4.3.x
http://www.kamailio.org/wiki/features/new-in-4.2.x
http://www.kamailio.org/wiki/features/new-in-4.1.x
http://www.kamailio.org/wiki/features/new-in-4.0.x
http://www.kamailio.org/wiki/features/new-in-3.3.x
http://www.kamailio.org/wiki/features/new-in-3.2.x
https://www.kamailio.org/wikidocs/features/new-in-5.2.x
https://www.kamailio.org/wikidocs/features/new-in-5.1.x
https://www.kamailio.org/wikidocs/features/new-in-5.0.x
https://www.kamailio.org/wikidocs/features/new-in-4.4.x
https://www.kamailio.org/wikidocs/features/new-in-4.3.x
https://www.kamailio.org/wikidocs/features/new-in-4.2.x
https://www.kamailio.org/wikidocs/features/new-in-4.1.x
https://www.kamailio.org/wikidocs/features/new-in-4.0.x
https://www.kamailio.org/wikidocs/features/new-in-3.3.x
https://www.kamailio.org/wikidocs/features/new-in-3.2.x
Earlier verisons are listed below.
===================================================

@ -49,7 +49,7 @@ my $patch_required="$0 requires a patched GCC:TranslationUnit, see the " .
# gcc name
my $gcc="gcc";
# default defines
my $c_defs="DNAME='\"kamailio\"' -DVERSION='\"5.1.0-dev3\"' -DARCH='\"x86_64\"' -DOS='linux_' -DOS_QUOTED='\"linux\"' -DCOMPILER='\"gcc 4.9.2\"' -D__CPU_x86_64 -D__OS_linux -DSER_VER=5001000 -DCFG_DIR='\"/usr/local/etc/kamailio/\"' -DRUN_DIR='\"/run/kamailio/\"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP -DDNS_IP_HACK -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLOCKLIST -DUSE_NAPTR -DWITH_XAVP -DMEM_JOIN_FREE -DF_MALLOC -DQ_MALLOC -DTLSF_MALLOC -DDBG_SR_MEMORY -DUSE_TLS -DTLS_HOOKS -DUSE_CORE_STATS -DSTATISTICS -DMALLOC_STATS -DWITH_AS_SUPPORT -DUSE_SCTP -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN -DHAVE_EPOLL -DHAVE_SIGIO_RT -DSIGINFO64_WORKARROUND -DUSE_FUTEX -DHAVE_SELECT";
my $c_defs="DNAME='\"kamailio\"' -DVERSION='\"5.1.0-dev3\"' -DARCH='\"x86_64\"' -DOS='linux_' -DOS_QUOTED='\"linux\"' -DCOMPILER='\"gcc 4.9.2\"' -D__CPU_x86_64 -D__OS_linux -DSER_VER=5001000 -DCFG_DIR='\"/usr/local/etc/kamailio/\"' -DRUN_DIR='\"/run/kamailio/\"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP -DDNS_IP_HACK -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLOCKLIST -DUSE_NAPTR -DWITH_XAVP -DMEM_JOIN_FREE -DF_MALLOC -DQ_MALLOC -DTLSF_MALLOC -DDBG_SR_MEMORY -DUSE_TLS -DTLS_HOOKS -DUSE_CORE_STATS -DSTATISTICS -DMALLOC_STATS -DWITH_AS_SUPPORT -DUSE_SCTP -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN -DHAVE_EPOLL -DHAVE_SIGIO_RT -DSIGINFO64_WORKAROUND -DUSE_FUTEX -DHAVE_SELECT";
# file with gcc syntax tree
my $file; #"tcp_options.c.001t.tu" ;
@ -128,7 +128,7 @@ Options:
C code.
-s | --src | --source - name of the source file, needed only if
the input file is in "raw" translation
unit format (--tu) and usefull to restrict
unit format (--tu) and useful to restrict
and speed-up the search.
--patch - show patches needed for the
GCC::TranslationUnit package.
@ -389,7 +389,7 @@ if (@cfg_defs > 0){
my $no=@cfg_default;
$i=0;
if ($no > 0 && @cfg_defs != $no) {
print(STDERR "WARNING: different array lenghts ($def_cfg_name($no) &&",
print(STDERR "WARNING: different array lengths ($def_cfg_name($no) &&",
" $cfg_var_name($(scalar @cfg_defs)))\n");
$no=0;
}

@ -39,7 +39,7 @@ my $patch_required="$0 requires a patched GCC:TranslationUnit, see the " .
# gcc name
my $gcc="gcc";
# default defines
my $c_defs="DNAME='\"kamailio\"' -DVERSION='\"5.1.0-dev3\"' -DARCH='\"x86_64\"' -DOS='linux_' -DOS_QUOTED='\"linux\"' -DCOMPILER='\"gcc 4.9.2\"' -D__CPU_x86_64 -D__OS_linux -DSER_VER=5001000 -DCFG_DIR='\"/usr/local/etc/kamailio/\"' -DRUN_DIR='\"/run/kamailio/\"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP -DDNS_IP_HACK -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLOCKLIST -DUSE_NAPTR -DWITH_XAVP -DMEM_JOIN_FREE -DF_MALLOC -DQ_MALLOC -DTLSF_MALLOC -DDBG_SR_MEMORY -DUSE_TLS -DTLS_HOOKS -DUSE_CORE_STATS -DSTATISTICS -DMALLOC_STATS -DWITH_AS_SUPPORT -DUSE_SCTP -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN -DHAVE_EPOLL -DHAVE_SIGIO_RT -DSIGINFO64_WORKARROUND -DUSE_FUTEX -DHAVE_SELECT";
my $c_defs="DNAME='\"kamailio\"' -DVERSION='\"5.1.0-dev3\"' -DARCH='\"x86_64\"' -DOS='linux_' -DOS_QUOTED='\"linux\"' -DCOMPILER='\"gcc 4.9.2\"' -D__CPU_x86_64 -D__OS_linux -DSER_VER=5001000 -DCFG_DIR='\"/usr/local/etc/kamailio/\"' -DRUN_DIR='\"/run/kamailio/\"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP -DDNS_IP_HACK -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLOCKLIST -DUSE_NAPTR -DWITH_XAVP -DMEM_JOIN_FREE -DF_MALLOC -DQ_MALLOC -DTLSF_MALLOC -DDBG_SR_MEMORY -DUSE_TLS -DTLS_HOOKS -DUSE_CORE_STATS -DSTATISTICS -DMALLOC_STATS -DWITH_AS_SUPPORT -DUSE_SCTP -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN -DHAVE_EPOLL -DHAVE_SIGIO_RT -DSIGINFO64_WORKAROUND -DUSE_FUTEX -DHAVE_SELECT";
# file with gcc syntax tree
my $file; #"tcp_options.c.001t.tu" ;
@ -116,7 +116,7 @@ Options:
C code.
-s | --src | --source - name of the source file, needed only if
the input file is in "raw" translation
unit format (--tu) and usefull to restrict
unit format (--tu) and useful to restrict
and speed-up the search.
--patch - show patches needed for the
GCC::TranslationUnit package.

@ -43,7 +43,7 @@ my $patch_required="$0 requires a patched GCC:TranslationUnit, see the " .
# gcc name
my $gcc="gcc";
# default defines
my $c_defs="DNAME='\"kamailio\"' -DVERSION='\"5.1.0-dev3\"' -DARCH='\"x86_64\"' -DOS='linux_' -DOS_QUOTED='\"linux\"' -DCOMPILER='\"gcc 4.9.2\"' -D__CPU_x86_64 -D__OS_linux -DSER_VER=5001000 -DCFG_DIR='\"/usr/local/etc/kamailio/\"' -DRUN_DIR='\"/run/kamailio/\"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP -DDNS_IP_HACK -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLOCKLIST -DUSE_NAPTR -DWITH_XAVP -DMEM_JOIN_FREE -DF_MALLOC -DQ_MALLOC -DTLSF_MALLOC -DDBG_SR_MEMORY -DUSE_TLS -DTLS_HOOKS -DUSE_CORE_STATS -DSTATISTICS -DMALLOC_STATS -DWITH_AS_SUPPORT -DUSE_SCTP -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN -DHAVE_EPOLL -DHAVE_SIGIO_RT -DSIGINFO64_WORKARROUND -DUSE_FUTEX -DHAVE_SELECT";
my $c_defs="DNAME='\"kamailio\"' -DVERSION='\"5.1.0-dev3\"' -DARCH='\"x86_64\"' -DOS='linux_' -DOS_QUOTED='\"linux\"' -DCOMPILER='\"gcc 4.9.2\"' -D__CPU_x86_64 -D__OS_linux -DSER_VER=5001000 -DCFG_DIR='\"/usr/local/etc/kamailio/\"' -DRUN_DIR='\"/run/kamailio/\"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP -DDNS_IP_HACK -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLOCKLIST -DUSE_NAPTR -DWITH_XAVP -DMEM_JOIN_FREE -DF_MALLOC -DQ_MALLOC -DTLSF_MALLOC -DDBG_SR_MEMORY -DUSE_TLS -DTLS_HOOKS -DUSE_CORE_STATS -DSTATISTICS -DMALLOC_STATS -DWITH_AS_SUPPORT -DUSE_SCTP -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN -DHAVE_EPOLL -DHAVE_SIGIO_RT -DSIGINFO64_WORKAROUND -DUSE_FUTEX -DHAVE_SELECT";
# file with gcc syntax tree
my $file;
@ -121,7 +121,7 @@ Options:
C code.
-s | --src | --source - name of the source file, needed only if
the input file is in "raw" translation
unit format (--tu) and usefull to restrict
unit format (--tu) and useful to restrict
and speed-up the search.
--patch - show patches needed for the
GCC::TranslationUnit package.

@ -40,7 +40,7 @@ my $patch_required="$0 requires a patched GCC:TranslationUnit, see the " .
# gcc name
my $gcc="gcc";
# default defines
my $c_defs="DNAME='\"kamailio\"' -DVERSION='\"5.1.0-dev3\"' -DARCH='\"x86_64\"' -DOS='linux_' -DOS_QUOTED='\"linux\"' -DCOMPILER='\"gcc 4.9.2\"' -D__CPU_x86_64 -D__OS_linux -DSER_VER=5001000 -DCFG_DIR='\"/usr/local/etc/kamailio/\"' -DRUN_DIR='\"/run/kamailio/\"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP -DDNS_IP_HACK -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLOCKLIST -DUSE_NAPTR -DWITH_XAVP -DMEM_JOIN_FREE -DF_MALLOC -DQ_MALLOC -DTLSF_MALLOC -DDBG_SR_MEMORY -DUSE_TLS -DTLS_HOOKS -DUSE_CORE_STATS -DSTATISTICS -DMALLOC_STATS -DWITH_AS_SUPPORT -DUSE_SCTP -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN -DHAVE_EPOLL -DHAVE_SIGIO_RT -DSIGINFO64_WORKARROUND -DUSE_FUTEX -DHAVE_SELECT";
my $c_defs="DNAME='\"kamailio\"' -DVERSION='\"5.1.0-dev3\"' -DARCH='\"x86_64\"' -DOS='linux_' -DOS_QUOTED='\"linux\"' -DCOMPILER='\"gcc 4.9.2\"' -D__CPU_x86_64 -D__OS_linux -DSER_VER=5001000 -DCFG_DIR='\"/usr/local/etc/kamailio/\"' -DRUN_DIR='\"/run/kamailio/\"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP -DDNS_IP_HACK -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLOCKLIST -DUSE_NAPTR -DWITH_XAVP -DMEM_JOIN_FREE -DF_MALLOC -DQ_MALLOC -DTLSF_MALLOC -DDBG_SR_MEMORY -DUSE_TLS -DTLS_HOOKS -DUSE_CORE_STATS -DSTATISTICS -DMALLOC_STATS -DWITH_AS_SUPPORT -DUSE_SCTP -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN -DHAVE_EPOLL -DHAVE_SIGIO_RT -DSIGINFO64_WORKAROUND -DUSE_FUTEX -DHAVE_SELECT";
# file with gcc syntax tree
my $file;
@ -120,7 +120,7 @@ Options:
C code.
-s | --src | --source - name of the source file, needed only if
the input file is in "raw" translation
unit format (--tu) and usefull to restrict
unit format (--tu) and useful to restrict
and speed-up the search.
--patch - show patches needed for the
GCC::TranslationUnit package.

@ -79,7 +79,7 @@ c_defs=-DNAME='\"kamailio\"' -DVERSION='\"5.1.0-dev3\"' -DARCH='\"x86_64\"' \
-DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL \
-DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM \
-DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN -DHAVE_EPOLL -DHAVE_SIGIO_RT \
-DSIGINFO64_WORKARROUND -DUSE_FUTEX -DHAVE_SELECT
-DSIGINFO64_WORKAROUND -DUSE_FUTEX -DHAVE_SELECT
# common makefile vars used in defs

@ -73,7 +73,7 @@ c_defs=-DNAME='\"kamailio\"' -DVERSION='\"5.1.0-dev3\"' -DARCH='\"x86_64\"' \
-DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL \
-DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM \
-DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN -DHAVE_EPOLL -DHAVE_SIGIO_RT \
-DSIGINFO64_WORKARROUND -DUSE_FUTEX -DHAVE_SELECT
-DSIGINFO64_WORKAROUND -DUSE_FUTEX -DHAVE_SELECT
# common makefile vars used in defs

@ -143,8 +143,8 @@ DNS Resolver Options
If set to yes - the additional part is checked against the search list.
The maximum time a DNS request can take (before failing) is:
(dns_retr_time*dns_retr_no) * (search_list_domains) If dns_try_ipv6 is yes,
mutliply it again by 2.
(dns_retr_time*dns_retr_no) * (search_list_domains). If dns_try_ipv6 is yes,
multiply it again by 2.
The option combination that produces the "fastest" DNS resolver config
(the "faster" in the sense that it gives up the quickest) is:
@ -159,7 +159,7 @@ DNS Resolver Options
server configured in /etc/resolv.conf, set the DNS resolver options in Kamailio's
config as in the above example and enable the DNS cache (in Kamailio).
Pay particular attention to dns_servers_no and dns_use_search_list. It's a
good idea to make sure you don't need / use the search list or more then one
good idea to make sure you don't need / use the search list or more than one
DNS server (to avoid unnecessary extra lookups).
@ -167,8 +167,9 @@ DNS Resolver Compile Options
----------------------------
USE_NAPTR - if defined the naptr lookup support will be compiled in.
NAPTR support still has to be enabled from Kamailio's config file (it's
off by default).
NAPTR support still has to be enabled from Kamailio's config file.
USE_NAPTR is defined by default. NAPTR support is disabled from the
config file by default.
DNS Cache and Failover Config Variables
@ -182,7 +183,7 @@ DNS Cache and Failover Config Variables
server.
Default: on.
use_dns_failover = on |off - if on and sending a request fails (due to not
use_dns_failover = on | off - if on and sending a request fails (due to not
being allowed from an onsend_route, send failure, blocklisted destination
or, when using tm, invite timeout), and the destination resolves to
multiple ip addresses and/or multiple SRV records, the send will be
@ -260,7 +261,7 @@ DNS Cache and Failover Config Variables
Default: no
dns_cache_init = on | off - if off, the DNS cache is not initialized
at startup and cannot be enabled runtime, that saves some memory.
at startup and cannot be enabled at runtime, that saves some memory.
Default: on
DNS Cache Compile Options
@ -301,7 +302,7 @@ DNS Cache Compile Options
If this option is not defined (experimental), everything in the AR
section will be added to the cache.
Note: To remove a compile options, edit Kamailio's Makefile.defs and remove it
Note: To remove a compile options, edit Kamailio's Makefile.defs and remove it
from DEFS list. To add a compile options add it to the make command line,
e.g.: make proper; make all extra_defs=-DUSE_DNS_FAILOVER
or for a permanent solution, edit Makefile.defs and add it to DEFS

@ -10,21 +10,21 @@ For example right now Kamailio uses the following locking methods, depending on
target system:
FAST_LOCK - fast inline assembly locks, defined in fast_lock.h. They are currently available for
x86, x86_64, sparc, sparc64, arm , armv6 (no smp mode supported yet), ppc, ppc64, mips, mips64
and alpha . In general if the assembly code exists for a given arhitecture and the compiler
and alpha . In general if the assembly code exists for a given architecture and the compiler
knows inline assembly (for example sun cc does not) FAST_LOCK is prefered. The main
advantage of using FAST_LOCK is very low memory overhead and extremely fast lock/unlock
operations (like 20 times faster then SYSV semaphores on linux & 40 times on solaris).
operations (like 20 times faster than SYSV semaphores on linux & 40 times on solaris).
The only thing that comes close to them are pthread mutexes (which are about 3-4 times slower).
PTHREAD_MUTEX - uses pthread_mutex_lock/unlock. They are quite fast but they work between
processes only on some systems (they do not work on linux).
POSIX_SEM - uses posix semaphores (sem_wait/sem_post). They are slower then the previous
methods but still way faster then SYSV sempahores. Unfortunately they also do not work on
POSIX_SEM - uses posix semaphores (sem_wait/sem_post). They are slower than the previous
methods but still way faster than SYSV semaphores. Unfortunately they also do not work on
all the systems (e.g. linux).
SYSV_SEM - this is the most portable but also the slowest locking method. Another problem is
that the number of semaphores that can be alocated by a process is limited. One also has to
that the number of semaphores that can be allocated by a process is limited. One also has to
free them before exiting.
@ -33,7 +33,7 @@ target system:
First of all you have to include locking.h. Then when compiling the code one or all of FAST_LOCK,
USE_PTHREAD_MUTEX, USE_PTHREAD_SEM or USE_SYSV_SEM must be defined (the Kamailio Makefile.defs takes
care of this, you should need to change it only for new arhitectures or compilers).
care of this, you should need to change it only for new architectures or compilers).
locking.h defines 2 new types: gen_lock_t and lock_set_t.

@ -78,7 +78,7 @@ Source files:
- for messages by modules:
PROC(PID) LEVEL: MODULE [FILE:LINE]: MESSAGE
- for messages by log(), xlog(), xdbg() script funcitons:
- for messages by log(), xlog(), xdbg() script functions:
PROC(PID) LEVEL: <script>: MESSAGE
PROC is the SER process number and PID is the linux process ID.

@ -1,5 +1,5 @@
Kamailio Module intialization description
Kamailio Module initialization description
===========================================
This document is a very brief overview on what possibilities are for a module

@ -3,7 +3,7 @@
# 2004.02.23 created (andrei)
Starting with the ser version 0.10.99-dev1, the parse headers api has been slighlty changed. The reason for this change was performance improvement (now gcc can optimze much better all the switches involving header types) and dramatically reducing the memory impact of switching to 64 bits flags.
Starting with the ser version 0.10.99-dev1, the parse headers api has been slightly changed. The reason for this change was performance improvement (now gcc can optimize much better all the switches involving header types) and dramatically reducing the memory impact of switching to 64 bits flags.
The header flags (HDR_xxx) have been split into header types (hdr_types_t) and header flags (hdr_flags_t). Instead of the old HDR_xxx use now HDR_xxx_T when the header type is required and HDR_xxx_F or HDR_T2F(HDR_xxx_T) when the corresponding header flag is needed (e.g. in the parse_headers() call).

@ -16,7 +16,7 @@ alias="t-online.de"
#user=ser
#group=ser
#open_fd_limit=1024 # sets the open file descriptors limit
mhomed=yes # usefull for multihomed hosts, small performance penalty
mhomed=yes # useful for multihomed hosts, small performance penalty
#disable_tcp=yes
tcp_accept_aliases=yes # accepts the tcp alias via option (see NEWS)
@ -131,7 +131,7 @@ modparam("pa", "ignore_408_on_notify", 1)
#modparam("presence_b2b", "presence_route", "<sip:127.0.0.1;transport=tcp;lr>")
modparam("presence_b2b", "presence_outbound_proxy", "sip:127.0.0.1;transport=tcp")
#modparam("presence_b2b", "presence_outbound_proxy", "sip:127.0.0.1")
# waiting time from error to new attepmt about SUBSCRIBE
# waiting time from error to new attempt about SUBSCRIBE
modparam("presence_b2b", "on_error_retry_time", 60)
# how long wait for NOTIFY with Subscription-Status=terminated after unsubscribe
modparam("presence_b2b", "wait_for_term_notify", 33)
@ -144,7 +144,7 @@ modparam("presence_b2b", "default_expiration", 3600)
# process internal subscriptions to presence events
modparam("presence_b2b", "handle_presence_subscriptions", 1)
#additional headers for presence
#modparam("presence_b2b", "additional_presence_headers", "P-Generated: yes\r\nP-Regenreated: no\r\n")
#modparam("presence_b2b", "additional_presence_headers", "P-Generated: yes\r\nP-Regenerated: no\r\n")
# randomized SUBSCRIBE requests?
modparam("presence_b2b", "max_subscribe_delay", 10)
@ -191,7 +191,7 @@ route{
# use different transport protocol
if (!method=="REGISTER") record_route();
# subsequent messages withing a dialog should take the
# subsequent messages within a dialog should take the
# path determined by record-routing
if (loose_route()) {
# mark routing logic in request
@ -314,7 +314,7 @@ route{
if (!have_flat_list()) {
# query_resource_list failed or was not called
# do standard RLS query acording to To/AOR
# do standard RLS query according to To/AOR
if (!query_rls_services()) {
log(1, "XCAP query failed\n");
t_reply("404", "No such list URI");

@ -43,7 +43,7 @@ rev_dns=no # (cmd. line: -R)
#group=ser
#disable_core=yes #disables core dumping
#open_fd_limit=1024 # sets the open file descriptors limit
#mhomed=yes # usefull for multihomed hosts, small performance penalty
#mhomed=yes # useful for multihomed hosts, small performance penalty
#disable_tcp=yes
#tcp_accept_aliases=yes # accepts the tcp alias via option (see NEWS)
@ -132,7 +132,7 @@ modparam("ctl", "fifo", "fifo:/tmp/ser_fifo")
# failed transactions (=negative responses) should be logged to
modparam("acc_db", "failed_transactions", 1)
# comment the next line if you dont want to have accounting to DB
# comment the next line if you don't want to have accounting to DB
modparam("acc_db", "log_flag", "FLAG_ACC")
# -- tm params --
@ -194,7 +194,7 @@ route{
route[FORWARD]
{
# here you could decide wether this call needs a RTP relay or not
# here you could decide whether this call needs a RTP relay or not
# send it out now; use stateful forwarding as it works reliably
# even for UDP2TCP
@ -252,7 +252,7 @@ route[RPC]
route[RR]
{
# subsequent messages withing a dialog should take the
# subsequent messages within a dialog should take the
# path determined by record-routing
if (loose_route()) {
# mark routing logic in request
@ -282,7 +282,7 @@ route[RR]
# particularly good if upstream and downstream entities
# use different transport protocol
# if the inital INVITE got the ACC flag store this in
# if the initial INVITE got the ACC flag store this in
# an RR AVP cookie. this is more for demonstration purpose
if (isflagset(FLAG_ACC)) {
$account = "yes";
@ -303,7 +303,7 @@ route[DOMAIN]
# domain]
lookup_domain("$td", "@to.uri.host");
# we dont know the domain of the caller and also not
# we don't know the domain of the caller and also not
# the domain of the callee -> somone uses our proxy as
# a relay
if (!$t.did && !$f.did) {
@ -443,7 +443,7 @@ route[INBOUND]
if (lookup_contacts("location")) {
append_hf("P-hint: usrloc applied\r\n");
# we set the TM module timers according to the prefences
# we set the TM module timers according to the preferences
# of the callee (avoid too long ringing of his phones)
# Note1: timer values have to be in ms now!
# Note2: this makes even more sense if you switch to a voicemail

@ -30,7 +30,7 @@ storing rules for authorization of instant messages.
<!-- ******************** Documents ********************* -->
<section id="docs"><title>Instant message authorization documents</title>
<para>Instant message authorization document is XML document formated according
<para>Instant message authorization document is XML document formatted according
to the schema defined in <xref linkend="common_auth"/>. It inherits the MIME
type of common policy documents defined there - application/auth-policy+xml.
</para>
@ -142,7 +142,7 @@ xmlns:im="urn:iptel:xml:ns:im-rules">
<section><title>Usage with XCAP</title>
<para>This document defines <quote>im-rules</quote> as unique application usage
ID (AUID) requiered by XCAP specification.
ID (AUID) required by XCAP specification.
</para>
<section><title>Naming conventions</title>

@ -56,7 +56,7 @@ no prefix parameter given - default value is used: /usr/local/)
</para></listitem>
<listitem><para>Compile and install SIP-router with presence modules. Common
libraries should be compiled automaticaly - it may fail in the case of
libraries should be compiled automatically - it may fail in the case of
unsatisfied library dependencies. You need to install all external libraries
introduced in <xref linkend="pres.dependencies"/></para>
<para><userinput>cd sip_router</userinput></para>

@ -65,7 +65,7 @@ libraries. Their interface is described in standalone documents.
<section><title>Persistence</title>
<para>Modules can store their status (working data) into database. This data is
automatically reloaded on startup, so it is possible to restart SIP-router and
clients don't note it. Established SIP dialogs are stored in database too.</para>
clients don't note it. Established SIP dialogs are stored in a database too.</para>
<para>Details about database storage are described for each module separately in
module documentation.

@ -27,7 +27,7 @@
<listitem><para>The XCAP module is incompatible with TLS module due to Openssl
initialization!</para>
<para>XCAP module uses libcurl for HTTP communication and libcurl is using
libopenssl internaly. But the TLS module needs some extra openssl initialization which
libopenssl internally. But the TLS module needs some extra openssl initialization which
is not working when libcurl initializes Openssl by itself.</para>
<para>Thanks Samuel (samu60@gmail.com) for pointing this out.</para></listitem>
@ -41,7 +41,7 @@ to do this or that, you can:
<itemizedlist>
<listitem><para>Try to search for similar problem in mailing lists on
<ulink url="http://www.sip-router.org/">SIP-router's main page</ulink> or in
<ulink url="http://lists.kamailio.org/cgi-bin/mailman/listinfo/">list archives</ulink>.
<ulink url="https://lists.kamailio.org/mailman3/hyperkitty/">list archives</ulink>.
</para></listitem>
<listitem><para>Send an email to <ulink

@ -24,7 +24,7 @@ data. From the SIP_ROUTER's point of view these items are interesting:
<para>Definition of authorization documents and theirs usage is specified in <xref
linkend="pres_draft_common_auth"/> and especially for presence purposes in <xref
linkend="pres_draft_auth"/>. Both documents are quite common and in SIP_ROUTER's
presence modules implemented only partialy. For more information about XCAP
presence modules implemented only partially. For more information about XCAP
authorization see details in <xref linkend="pa.xcap"/>.</para>
</section> <!-- XCAP authorization -->
@ -46,7 +46,7 @@ there. Such customer may simply watch presence state of
<para>Lists of users - more common resource lists - are defined in <xref
linkend="pres_draft_rls"/> and their usage with SIP in <xref
linkend="pres_draft_rls_sip"/>. These lists are partialy implemented in <link
linkend="pres_draft_rls_sip"/>. These lists are partially implemented in <link
linkend="pres_rls">RLS module</link>.
For more information about resource lists see details in <xref
linkend="rls.xcap"/>.</para>
@ -393,7 +393,7 @@ Alias /xcap-root /var/simulated-xcap-root
<example><title>Simple (and dangerous) cgi-script for upload</title>
<para>This code is written in C and it is able to create directories if needed, but its usage in
presented form is realy unsafe! You have to compile it and put into directory
presented form is really unsafe! You have to compile it and put into directory
with other CGI scripts.</para>
<programlisting><![CDATA[
#include <stdio.h>

@ -38,7 +38,7 @@
transport independent way (called the rpc module api) and one for
implementing RPC transports.
The RPC transports are implemented by writting a RPC transport module.
The RPC transports are implemented by writing a RPC transport module.
The most used transport modules are ctl , xmlrpc and jsonrpc-s .
ctl implements a proprietary fast and space efficient RPC encoding over

@ -36,16 +36,16 @@
for implementing RPC transports.
</para>
<para>
The RPC transports are implemented by writting a RPC
The RPC transports are implemented by writing a RPC
transport module. The most used transport modules are
<ulink url='http://www.kamailio.org/docs/modules/devel/modules/ctl/ctl.html'>
<ulink url='https://www.kamailio.org/docs/modules/devel/modules/ctl/ctl.html'>
<emphasis>ctl</emphasis>
</ulink>,
<ulink url='http://www.kamailio.org/docs/modules/devel/modules/xmlrpc/xmlrpc.html'>
<ulink url='https://www.kamailio.org/docs/modules/devel/modules/xmlrpc/xmlrpc.html'>
<emphasis>xmlrpc</emphasis>
</ulink>
and
<ulink url='http://www.kamailio.org/docs/modules/devel/modules/jsonrpc-s/jsonrpc-s.html'>
<ulink url='https://www.kamailio.org/docs/modules/devel/modules/jsonrpc-s/jsonrpc-s.html'>
<emphasis>jsonrpc-s</emphasis>
</ulink>.
</para>
@ -911,7 +911,7 @@ static void rpc_register(rpc_t* rpc, void *ctx)
<section id="rpc.xmlrpc_examples">
<title>Examples using xmlrpc</title>
<para>See the <varname>xmlrpc</varname> module documentation:
<ulink url='http://www.kamailio.org/docs/modules/devel/modules/xmlrpc.html'>modules/xmlrpc/README</ulink>.
<ulink url='https://www.kamailio.org/docs/modules/devel/modules/xmlrpc.html'>modules/xmlrpc/README</ulink>.
</para>
</section>

@ -146,7 +146,7 @@ c_defsX=-DNAME='\"kamailio\"' -DVERSION='\"5.1.0-dev3\"' -DARCH='\"x86_64\"' \
-DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL \
-DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM \
-DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN -DHAVE_EPOLL -DHAVE_SIGIO_RT \
-DSIGINFO64_WORKARROUND -DUSE_FUTEX -DHAVE_SELECT
-DSIGINFO64_WORKAROUND -DUSE_FUTEX -DHAVE_SELECT
c_defs=$(subst ^^,='\",$(subst ",\"',$(subst =",^^,$(shell $(MAKE) -s -C ../../../src printcdefs))))

@ -79,7 +79,7 @@ RPC Exports for core
<section id="core.info"><title>core.info</title>
<para>
Verbose info, including version number, compile flags,
compiler,repository hash a.s.o.
compiler, repository hash a.s.o.
</para>
<para>
</para>

@ -11,7 +11,7 @@ RPC Exports for malloc_test
<section id="mt.mem_alloc"><title>mt.mem_alloc</title>
<para>
Allocates the specified number of bytes (debugging/test
function).Use b|k|m|g to specify the desired size unit
function). Use b|k|m|g to specify the desired size unit
</para>
<para>
</para>
@ -22,8 +22,8 @@ RPC Exports for malloc_test
Frees the specified number of bytes, previously allocated by
one of the other malloc_test functions (e.g. mt.mem_alloc or
the script mt_mem_alloc). Use b|k|m|g to specify the desired
size unit.Returns the number of bytes freed (can be higher or
smaller then the requested size)
size unit. Returns the number of bytes freed (can be higher or
smaller than the requested size)
</para>
<para>
</para>
@ -36,7 +36,7 @@ RPC Exports for malloc_test
chunks exists, it will fail. Make sure mt.mem_used is non 0 or
call mt.mem_alloc prior to calling this function. Returns the
difference in bytes (&lt;0 if bytes were freed, &gt;0 if more
bytes were allocated).Use b|k|m|g to specify the desired size
bytes were allocated). Use b|k|m|g to specify the desired size
unit
</para>
<para>
@ -57,7 +57,7 @@ RPC Exports for malloc_test
<para>
Takes 4 parameters: min, max, total_size and an optional unit
(b|k|m|g). It will allocate total_size memory, in pieces of
random size betweenmin .. max (inclusive).
random size between min .. max (inclusive).
</para>
<para>
</para>
@ -71,7 +71,7 @@ RPC Exports for malloc_test
for test_time ms. At a random interval between min_interval and
max_interval ms. it will allocate a memory chunk with random
size, between min and max. Each time total_size is reached, it
will free all the memory allocated and start again.Returns the
will free all the memory allocated and start again. Returns the
test id (integer)
</para>
<para>
@ -81,7 +81,7 @@ RPC Exports for malloc_test
<section id="mt.mem_test_stop"><title>mt.mem_test_stop</title>
<para>
Takes 1 parameter: the test id. It will stop the corresponding
test.Note: the test is stopped, but not destroyed.
test. Note: the test is stopped, but not destroyed.
</para>
<para>
</para>

@ -13,7 +13,7 @@ RPC Exports for malloc_test
one of the other malloc_test functions (e.g. mt.mem_alloc or
the script mt_mem_alloc). Use b|k|m|g to specify the desired
size unit.Returns the number of bytes freed (can be higher or
smaller then the requested size)
smaller than the requested size)
3. mt.mem_realloc
Reallocates the specified number of bytes from a pre-allocated
@ -31,7 +31,7 @@ RPC Exports for malloc_test
5. mt.mem_rnd_alloc
Takes 4 parameters: min, max, total_size and an optional unit
(b|k|m|g). It will allocate total_size memory, in pieces of
random size betweenmin .. max (inclusive).
random size between min .. max (inclusive).
6. mt.mem_test_start
Takes 7 parameters: min, max, total_size, min_interval,

@ -75,7 +75,7 @@ c_defs=-DNAME='\"kamailio\"' -DVERSION='\"5.1.0-dev3\"' -DARCH='\"x86_64\"' \
-DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL \
-DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM \
-DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN -DHAVE_EPOLL -DHAVE_SIGIO_RT \
-DSIGINFO64_WORKARROUND -DUSE_FUTEX -DHAVE_SELECT
-DSIGINFO64_WORKAROUND -DUSE_FUTEX -DHAVE_SELECT
# common makefile vars used in defs

@ -243,7 +243,7 @@ root@localhost"/usr/local/src/freeradius-0.9.1# make install
File <filename>/usr/local/etc/raddb/clients.conf</filename>
contains description of RADIUS clients that are allowed to
use the server. For each of the clients you need to specify
it's hostname or IP address and also a shared secret. The
its hostname or IP address and also a shared secret. The
shared secret must be the same string you configured in
radiusclient library.
</simpara>

@ -65,7 +65,7 @@
<section id="bind_dbmod">
<title><function>bind_dbmod</function></title>
<para>
This function is special, it's only purpose is to call
This function is special, its only purpose is to call
<function>find_export</function> function in the
<acronym>SER</acronym> core and find addresses of all other
functions (starting with db_ prefix). This function

@ -48,9 +48,9 @@
<para>
We did some performance measurement and 32-bit parsing is about 3 times
faster for a typical <acronym>SIP</acronym> message than corresponding
automaton comparing byte by byte. Performance may vary depending on the
automation comparing byte by byte. Performance may vary depending on the
message size, parsed header fields and header fields type. Test showed
that it was always as fast as corresponding 1-byte comparing automaton.
that it was always as fast as corresponding 1-byte comparing automation.
</para>
<para>
Since comparison must be case insensitive in case of header field

@ -34,14 +34,14 @@
compiler knows inline assembly (for example sun cc does
not) FAST_LOCK is preferred. The main advantage of using
FAST_LOCK is very low memory overhead and extremely fast
lock/unlock operations (like 20 times faster then SYSV
lock/unlock operations (like 20 times faster than SYSV
semaphores on linux &amp; 40 times on solaris). The only thing
that comes close to them are pthread mutexes (which are
about 3-4 times slower).
</simpara>
</listitem>
<listitem>
<simpara><emphasis>PHTREAD_MUTEX</emphasis></simpara>
<simpara><emphasis>PTHREAD_MUTEX</emphasis></simpara>
<simpara>
Uses pthread_mutex_lock/unlock. They are quite fast but
they work between processes only on some systems (they do
@ -53,7 +53,7 @@
<simpara>
Uses posix semaphores
(<function>sem_wait</function>/<function>sem_post</function>). They
are slower then the previous methods but still way faster
are slower than the previous methods but still way faster
then SYSV semaphores. Unfortunately they also do not work
on all the systems (e.g. linux).
</simpara>

@ -87,7 +87,7 @@
<structname>cmd_export_t</structname> structure. Structures
describing all exported functions are arranged into an array and
pointer to the array is then passed to the core. The last element
of the array must contain 0 in all it's fields, this element serves
of the array must contain 0 in all its fields, this element serves
as the mark telling the core that this is the very last element and
it must stop scanning the array.
</para>
@ -241,7 +241,7 @@ typedef int (*cmd_function)(struct sip_msg*, char*, char*);
<structname>param_export_t</structname> structure. Structures
describing all exported parameters are arranged into an array and
pointer to the array is then passed to the core. The last element
of the array must contain 0 in all it's fields, this element serves
of the array must contain 0 in all its fields, this element serves
as the mark telling the core that this is the very last element and
it must stop scanning the array (This is same as in array of
exported functions).
@ -315,7 +315,7 @@ typedef struct param_export_ param_export_t;
<emphasis>after</emphasis> the main process forks. The function
will be called for each child separately. The function should
perform initialization that is specific for each child. For example
each child process might open it's own database connection to avoid
each child process might open its own database connection to avoid
locking of a single connection shared by many processes. Such
connections can be opened in the per-child initialization
function. The function accepts one parameter which is rank
@ -527,7 +527,7 @@ struct module_exports exports = {
As the next step, list of all previously loaded
modules will be searched for the same module. If
such module is found, it means, that user is trying
to load the same module twice. In such case an
to load the same module twice. In such case a
warning will be issued and server will abort.
</para>
</listitem>

@ -35,7 +35,7 @@
struct module_exports{
char* name; /* null terminated module name */
char** cmd_names; /* cmd names registered
* by this modules */
* by this module */
cmd_function* cmd_pointers; /* pointers to the
* corresponding functions */
int* param_no; /* number of parameters used by
@ -48,7 +48,7 @@ struct module_exports{
* (size of cmd_{names,pointers}
*/
char** param_names; /* parameter names registered
* by this modules */
* by this module */
modparam_t* param_types; /* Type of parameters */
void** param_pointers; /* Pointers to the corresponding
* memory locations */

@ -75,7 +75,7 @@ struct msg_start {
<structfield>method_value</structfield> - Parsed
method. Field method which is of type <type>str</type> will
be converted to integer and stored here. This is good for
comparison, integer comparison is much faster then string
comparison, integer comparison is much faster than string
comparison.
</para>
</listitem>

@ -29,7 +29,7 @@
The routing engine can be found in file <filename>action.c</filename>.
</para>
<para>
The main function is <function>run_actions.</function> The function
The main function is <function>run_actions</function>. The function
accepts two parameters. The first parameter is list of actions to be
processed (Remember, the config file gets translated into array of
linked lists. Each linked list in the array represents one "route" part

@ -53,7 +53,7 @@ int <function>select_function_name</function>(str* res, struct select *s, struct
<para>
<emphasis>FIXUP CALL:</emphasis>
If you set FIXUP_CALL flag for the final
function, the fixup call will be done immediatelly after function resolution.
function, the fixup call will be done immediately after function resolution.
Such call is indicated with res==NULL &amp;&amp; msg==NULL. Such call can convert any of
the select's parameter into internal data (can hold one pointer), if you do
that, set param_type to SEL_PARAM_DATA.
@ -75,7 +75,7 @@ int <function>select_function_name</function>(str* res, struct select *s, struct
</para>
<para>The table is representation of tree (or oriented graph if you want), where
first column represents current (up-to now) resolved function (starting with NULL),
next two columns define if next parameter is integer or particullar string, next
next two columns define if next parameter is integer or particular string, next
column is new resolved function which will be tested in next round and the last
column is set of flags.
</para>
@ -132,7 +132,7 @@ TODO:
<para>
<emphasis>NOTE:</emphasis> The tables are inserted into the beginning of the
list, so the core's table (and thus parseable names and definitions) can be
overrided by module's function, if it is defined with the same name. To
overridden by module's function, if it is defined with the same name. To
avoid such situation, the best practice is to start module's select with the
module's name. E.g in our example code both select functions start
with @test...

@ -16,7 +16,7 @@
<para>
The <function>main</function> function in file
<filename>main.c</filename> is the first function called upon server
startup. It's purpose is to initialize the server and enter main
startup. Its purpose is to initialize the server and enter main
loop. The server initialization will be described in the following
sections.
</para>
@ -196,7 +196,7 @@
Structure of the configuration file is described using
grammar. Grammar is a set of rules describing valid 'order' or
'combination' of tokens. If the file isn't conformable with
it's grammar, it is syntactically invalid and cannot be further
its grammar, it is syntactically invalid and cannot be further
processed. In that case an error will be issued and the server
will be aborted.
</para>
@ -377,7 +377,7 @@ cmd = "forward" "(" host ")" { $$ = mk_action(FORWARD_T, STRING_ST, NUMBER_ST, $
</para>
</listitem>
<listitem>
<para>Reply-route statement has it's own array of linked-lists.</para>
<para>Reply-route statement has its own array of linked-lists.</para>
</listitem>
</itemizedlist>
</para>
@ -685,7 +685,7 @@ module_stm = "loadmodule" STRING
</itemizedlist>
<para>
The following initialization will be performed in dont fork
The following initialization will be performed in dont_fork
mode. (look into function <function>main_loop</function> in
file <filename>main.c</filename>.
</para>
@ -703,7 +703,7 @@ module_stm = "loadmodule" STRING
</listitem>
<listitem>
<para>
Call <function>init_child(0).</function> The function
Call <function>init_child(0)</function>. The function
performs per-child specific initialization of all
loaded modules. A module can be initialized though
<function>mod_init</function> function. The function

@ -1189,7 +1189,7 @@ Warning: 392 216.87.144.203:5060 "Noisy feedback tells: pid=19604
<simpara>
It is possible there are some magic options in domain/usrloc/auth_db/
registrar/auth modules you need to turn on to enable multidomain
operation--I don't remember these by heart, hopefuly some people
operation--I don't remember these by heart, hopefully some people
on the mailing list do.
</simpara>
</answer>

@ -114,7 +114,7 @@
</listitem>
<listitem>
<para>
bison or yacc (Berkley yacc)
bison or yacc (Berkeley yacc)
</para>
</listitem>
<listitem>
@ -225,8 +225,8 @@
export SIP_DOMAIN="foo.bar"
</screen>
<para>
If you wont the system to created this variable automatically, you need to add the
line
If you do not want the system to create this variable automatically, you need
to add the line
</para>
<screen>
export SIP_DOMAIN="foo.bar"
@ -754,7 +754,7 @@ Up time: 132711 [sec]
Transaction Statistics
Current: 0 (2 waiting) Total: 46 (0 local)
Replied localy: 37
Replied locally: 37
Completion status 6xx: 0, 5xx: 0, 4xx: 23, 3xx: 0,2xx: 22
Stateless Server Statistics

@ -715,7 +715,7 @@ From: controller
To: caller
SDP: on hold
#2 calling user answes
#2 calling user answers
200 OK
From: controller
To: caller

@ -216,7 +216,7 @@ TABLE_NAME
<para>
This function sends a raw query directly to the database driver
without trying to understand the command. This command <emphasis>MUST
NOT</emphasis> generate any response.Otherwise, the database driver
NOT</emphasis> generate any response. Otherwise, the database driver
can block or desynchronize (depending of the driver).
Its syntax is:
<programlisting>

@ -625,9 +625,9 @@ if (uri=~"^sip:[0-79][0-9]*@") { # ... forward to gateways then;
<title>Rewriting URIs</title>
<programlisting>
if (uri=~"dan@foo.bar") {
rewriteuri("sip:bla@somewherelse.com")
rewriteuri("sip:bla@somewhereelse.com")
# forward statelessly to the destination in current URI, i.e.,
# to sip:bla@somewherelese.com:5060
# to sip:bla@somewhereelse.com:5060
forward( uri:host, uri:port);
}
</programlisting>

@ -80,7 +80,7 @@ Up time: 38481 [sec]
Transaction Statistics
Current: 0 (0 waiting) Total: 606 (0 local)
Replied localy: 34
Replied locally: 34
Completion status 6xx: 0, 5xx: 1, 4xx: 86, 3xx: 0,2xx: 519
Stateless Server Statistics

@ -238,9 +238,9 @@
<title>Proxy Server Usage</title>
<simpara>
A typical configuration is that each centrally administered entity (a
company, for instance) has it's own SIP proxy server which is used by all
company, for instance) has its own SIP proxy server which is used by all
user agents in the entity. Let's suppose that there are two companies A and
B and each of them has it's own proxy server. <xref linkend="companies"/>
B and each of them has its own proxy server. <xref linkend="companies"/>
shows how a session invitation from employee Joe in company A will reach
employee Bob in company B.
</simpara>
@ -415,7 +415,7 @@ a=fmtp:101 0-16
identifier and will be described in <xref linkend="sip_dialogs"/>.
</simpara>
<simpara>
Call-ID header field is a dialog identifier and it's purpose is to identify messages
Call-ID header field is a dialog identifier and its purpose is to identify messages
belonging to the same call. Such messages have the same Call-ID identifier. CSeq is
used to maintain order of requests. Because requests can be sent over an unreliable
transport that can re-order messages, a sequence number must be present in the
@ -644,7 +644,7 @@ Warning: 392 195.37.77.101:5060 "Noisy feedback tells:
request or response comes, a stateful entity tries to associate the request (or
response) to existing transactions. To be able to do it it must extract a unique
transaction identifier from the message and compare it to identifiers of all
existing transactions. If such a transaction exists then it's state gets updated
existing transactions. If such a transaction exists then its state gets updated
from the message.
</simpara>
<simpara>
@ -868,7 +868,7 @@ Warning: 392 195.37.77.101:5060 "Noisy feedback tells:
<title>Session Termination</title>
<simpara>
Session termination is accomplished by sending a BYE request within dialog
established bye INVITE. BYE messages are sent directly from one user agent to
established by INVITE. BYE messages are sent directly from one user agent to
the other unless a proxy on the path of the INVITE request indicated that it
wishes to stay on the path by using record routing (see <xref
linkend="record_routing"/>.
@ -938,7 +938,7 @@ Warning: 392 195.37.77.101:5060 "Noisy feedback tells:
little bit different way. The Request-URI is no more overwritten, it always
contains URI of the destination user agent. If there are any Route header
field in a message, than the message is sent to the URI from the topmost
Route header field. This is significant change--Request-URI doesn't
Route header field. This is a significant change--Request-URI doesn't
necessarily contain URI to which the request will be sent. In fact, loose
routing is very similar to IP source routing.
</simpara>

@ -65,7 +65,7 @@ net.ipv4.tcp_mem
net.ipv4.tcp_rmem
net.ipv4.tcp_wmem
Note: sysctl -w net.ipv4.route.flush=1 - enusre that immediatly subsequent
Note: sysctl -w net.ipv4.route.flush=1 - ensure that immediately subsequent
connections use the values
1.6 Other sysctl that might affect tcp connection rate or the maximum number

@ -150,7 +150,7 @@ protection mechanism to avoid the above race.
4.5 timer_allow_del
-------------------
Marks a timer as "to be deleted when the handler ends", usefull when the timer handler
Marks a timer as "to be deleted when the handler ends", useful when the timer handler
knows it won't prolong the timer anymore (it will return 0) and will do some time
consuming work. Calling this function will cause simultaneous timer_dels to return
immediately (they won't wait anymore for the timer handle to finish).

@ -6,7 +6,7 @@
#
# Direct your questions about this file to: <sr-users@lists.kamailio.org>
#
# Refer to the Core CookBook at https://www.kamailio.org/wiki/
# Refer to the Core CookBook at https://www.kamailio.org/wikidocs/
# for an explanation of possible statements, functions and parameters.
#
# Note: the comments can be:
@ -93,6 +93,9 @@
# block if more than 16 requests in 2 seconds and ban for 300 seconds)
# - define WITH_ANTIFLOOD
#
# *** To load htable module execute:
# - define WITH_HTABLE
#
# *** To block 3XX redirect replies execute:
# - define WITH_BLOCK3XX
#
@ -148,6 +151,11 @@ import_file "kamailio-local.cfg"
#!define MULTIDOMAIN 0
#!endif
#!ifdef WITH_ANTIFLOOD
# - hash table 'ipban' used to store blocked IP addresses
#!trydef WITH_HTABLE
#!endif
# - flags
# FLT_ - per transaction (message) flags
#!define FLT_ACC 1
@ -315,8 +323,11 @@ loadmodule "rtpproxy.so"
loadmodule "tls.so"
#!endif
#!ifdef WITH_ANTIFLOOD
#!ifdef WITH_HTABLE
loadmodule "htable.so"
#!endif
#!ifdef WITH_ANTIFLOOD
loadmodule "pike.so"
#!endif
@ -482,11 +493,15 @@ modparam("tls", "config", "/usr/local/etc/kamailio/tls.cfg")
modparam("pike", "sampling_time_unit", 2)
modparam("pike", "reqs_density_per_unit", 16)
modparam("pike", "remove_latency", 4)
#!endif
#!ifdef WITH_HTABLE
# ----- htable params -----
#!ifdef WITH_ANTIFLOOD
/* ip ban htable with autoexpire after 5 minutes */
modparam("htable", "htable", "ipban=>size=8;autoexpire=300;")
#!endif
#!endif
#!ifdef WITH_DEBUG
# ----- debugger params -----
@ -558,7 +573,7 @@ request_route {
if ($rU==$null) {
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
sl_send_reply("484", "Address Incomplete");
exit;
}
@ -611,7 +626,7 @@ route[REQINIT] {
exit;
}
if (!pike_check_req()) {
xlog("L_ALERT","ALERT: pike blocking $rm from $fu (IP:$si:$sp)\n");
xlog("L_ALERT", "ALERT: pike blocking $rm from $fu (IP:$si:$sp)\n");
$sht(ipban=>$si) = 1;
exit;
}
@ -624,12 +639,12 @@ route[REQINIT] {
}
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
exit;
}
if(is_method("OPTIONS") && uri==myself && $rU==$null) {
sl_send_reply("200","Keepalive");
sl_send_reply("200", "Keepalive");
exit;
}
@ -643,7 +658,7 @@ route[REQINIT] {
route[WITHINDLG] {
if (!has_totag()) return;
# sequential request withing a dialog should
# sequential request within a dialog should
# take the path determined by record-routing
if (loose_route()) {
route(DLGURI);
@ -678,7 +693,7 @@ route[WITHINDLG] {
exit;
}
}
sl_send_reply("404","Not here");
sl_send_reply("404", "Not here");
exit;
}
@ -806,7 +821,7 @@ route[AUTH] {
# if caller is not local subscriber, then check if it calls
# a local destination, otherwise deny, not an open relay here
if (from_uri!=myself && uri!=myself) {
sl_send_reply("403","Not relaying");
sl_send_reply("403", "Not relaying");
exit;
}
@ -814,7 +829,7 @@ route[AUTH] {
# authentication not enabled - do not relay at all to foreign networks
if(uri!=myself) {
sl_send_reply("403","Not relaying");
sl_send_reply("403", "Not relaying");
exit;
}
@ -839,7 +854,7 @@ route[NATDETECT] {
return;
}
# RTPProxy control and signaling updates for NAT traversal
# RTP relaying management and signaling updates for NAT traversal
route[NATMANAGE] {
#!ifdef WITH_NAT
if (is_request()) {
@ -1034,7 +1049,7 @@ failure_route[MANAGE_FAILURE] {
#!ifdef WITH_BLOCK3XX
# block call redirect based on 3xx replies.
if (t_check_status("3[0-9][0-9]")) {
t_reply("404","Not found");
t_reply("404", "Not found");
exit;
}
#!endif
@ -1042,7 +1057,7 @@ failure_route[MANAGE_FAILURE] {
#!ifdef WITH_BLOCK401407
# block call redirect based on 401, 407 replies.
if (t_check_status("401|407")) {
t_reply("404","Not found");
t_reply("404", "Not found");
exit;
}
#!endif

@ -274,7 +274,7 @@ route[INIT]
# initial sanity checks -- messages with
# max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_reply("483","Too Many Hops");
sl_reply("483", "Too Many Hops");
drop;
}
@ -328,7 +328,7 @@ route[RPC]
route[RR]
{
# subsequent messages withing a dialog should take the
# subsequent messages within a dialog should take the
# path determined by record-routing
if (loose_route()) {
# mark routing logic in request

@ -34,7 +34,7 @@ route{
};
# user found, forward to his current uri now; if any
# forwarding error occurs (e.g., busy or cancelled recevied
# from downstream), proceed to reply_route[1]
# from downstream), proceed to failure_route[1]
t_on_failure("1");
if (!t_relay()) {
sl_reply_error();

@ -155,14 +155,14 @@ modparam("jsonrpcs", "pretty_format", 1)
modparam("rr", "enable_full_lr", 1)
# -- cdp params --
modparam("cdp","config_file","/etc/kamailio_icscf/icscf.xml")
modparam("cdp", "config_file", "/etc/kamailio_icscf/icscf.xml")
# ----- icscf params -----
# Comment the following line to enable realm routing
#!ifdef CXDX_FORCED_PEER
modparam("ims_icscf", "cxdx_forced_peer", CXDX_FORCED_PEER)
#!endif
modparam("ims_icscf","cxdx_dest_realm", NETWORKNAME)
modparam("ims_icscf", "cxdx_dest_realm", NETWORKNAME)
# DB-URL, where information about S-CSCF-Server can be found:
#!ifdef DB_URL2
@ -173,11 +173,11 @@ modparam("ims_icscf", "db_url", DB_URL)
#!ifdef PEERING
# Route which is executed, in case HSS returned "User-Unknown" on LIR request
modparam("ims_icscf","route_lir_user_unknown", "lir_term_user_unknown")
modparam("ims_icscf", "route_lir_user_unknown", "lir_term_user_unknown")
#!endif
#!ifdef FALLBACK_AUTH
# Route which is executed, in case HSS returned "User-Unknown" on UAR request
modparam("ims_icscf","route_uar_user_unknown", "uar_term_user_unknown")
modparam("ims_icscf", "route_uar_user_unknown", "uar_term_user_unknown")
#!endif
#!ifdef WITH_TLS
@ -255,7 +255,7 @@ route{
# Shouldn't get here unless missconfigured (add more methods as initial) or
# somebody is routing unknown messages
append_to_reply("Allow: INVITE,SUBSCRIBE,MESSAGE,INFO,PUBLISH,CANCEL\r\n");
send_reply("406","Initial Request Method not allowed at the I-CSCF");
send_reply("406", "Initial Request Method not allowed at the I-CSCF");
break;
}
}
@ -279,7 +279,7 @@ route[REQINIT] {
setflag(FLT_CAPTURE);
#!endif
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
exit;
}
if(!sanity_check("1511", "7")) {
@ -351,7 +351,7 @@ route[register]
t_on_reply("register_reply");
t_on_failure("register_failure");
if (!t_relay()) {
send_reply("500","Error forwarding towards S-CSCF");
send_reply("500", "Error forwarding towards S-CSCF");
}
} else {
#no S-CSCF list therefore must do UAR
@ -359,7 +359,7 @@ route[register]
I_scscf_drop();
# Do an asynchronous UAR:
#0=REG/DEREG; 1=REG+Capabilities
if (!I_perform_user_authorization_request("REG_UAR_REPLY","0")) {
if (!I_perform_user_authorization_request("REG_UAR_REPLY", "0")) {
send_reply("500", "Error in Request");
}
}
@ -426,7 +426,7 @@ failure_route[register_failure]
t_on_reply("register_reply");
t_on_failure("register_failure");
if (!t_relay()) {
t_reply("500","Error forwarding towards next S-CSCF");
t_reply("500", "Error forwarding towards next S-CSCF");
break;
}
break;
@ -461,7 +461,7 @@ route[LIR_REPLY] {
t_on_reply("initial_request_reply");
t_on_failure("initial_request_failure");
if (!t_relay()) {
t_reply("500","Error forwarding towards S-CSCF");
t_reply("500", "Error forwarding towards S-CSCF");
break;
}
break;
@ -503,7 +503,7 @@ failure_route[initial_request_failure]
t_on_reply("initial_request_reply");
t_on_failure("initial_request_failure");
if (!t_relay()) {
t_reply("500","Error forwarding towards next S-CSCF");
t_reply("500", "Error forwarding towards next S-CSCF");
break;
}
break;
@ -537,25 +537,25 @@ route[lir_term_user_unknown]
t_on_reply("initial_request_reply");
t_on_failure("initial_request_failure");
if (!t_relay()) {
t_reply("500","Error forwarding to external domain");
t_reply("500", "Error forwarding to external domain");
exit;
};
exit;
} else {
t_reply("604","Does not exist anywhere - HSS User Unknown");
t_reply("604", "Does not exist anywhere - HSS User Unknown");
exit;
};
} else {
# we received a request for our domain (non-tel), but HSS said "User Unknown"
if ($rd != NETWORKNAME) {
t_reply("604","Does not exist anywhere - HSS User Unknown");
t_reply("604", "Does not exist anywhere - HSS User Unknown");
exit;
} else {
# try to forward non-tel request to other domain
t_on_reply("Initial_Request_reply");
t_on_failure("Initial_Request_failure");
if (!t_relay()) {
t_reply("500","Error forwarding to external domain");
t_reply("500", "Error forwarding to external domain");
exit;
};
exit;
@ -621,7 +621,7 @@ route[uar_term_user_unknown]
t_on_reply("register_reply");
t_on_failure("register_failure");
if (!t_relay()) {
t_reply("500","Error forwarding towards S-CSCF");
t_reply("500", "Error forwarding towards S-CSCF");
break;
}
break;

@ -274,12 +274,12 @@ modparam("htable", "htable", "a=>size=8;autoexpire=20")
modparam("htable", "htable", "natping=>size=8;autoexpire=600000;")
modparam("htable", "htable", "natpingfail=>size=8;autoexpire=600000;")
#!ifdef DB_URL2
modparam("sqlops","sqlcon","pcscf=>cluster://cluster1")
modparam("sqlops", "sqlcon", "pcscf=>cluster://cluster1")
#!else
modparam("sqlops","sqlcon", SQLOPS_DBURL)
modparam("sqlops", "sqlcon", SQLOPS_DBURL)
#!endif
modparam("uac","restore_mode","none")
modparam("uac", "restore_mode", "none")
# ----------------- Settings for RTimer ---------------
# time interval set to 10 seconds
@ -379,7 +379,7 @@ modparam("ims_ipsec_pcscf", "ipsec_server_port", IPSEC_SERVER_PORT)
#!ifdef WITH_RX
# -- CDP params --
modparam("cdp","config_file","/etc/kamailio_pcscf/pcscf.xml")
modparam("cdp", "config_file", "/etc/kamailio_pcscf/pcscf.xml")
# -- diameter_rx params --
modparam("ims_qos", "rx_dest_realm", "NETWORKNAME")
#!endif
@ -474,11 +474,11 @@ route {
t_check_trans();
if (is_method("UPDATE")) {
send_reply("403","Forbidden - Target refresh outside dialog not allowed");
send_reply("403", "Forbidden - Target refresh outside dialog not allowed");
break;
}
if (is_method("BYE|PRACK")) {
send_reply("403","Forbidden - Originating subsequent requests outside dialog not allowed");
send_reply("403", "Forbidden - Originating subsequent requests outside dialog not allowed");
break;
}
@ -682,14 +682,14 @@ route[REQINIT] {
exit;
}
if (!pike_check_req()) {
xlog("L_ALERT","ALERT: pike blocking $rm from $fu (IP:$si:$sp, $ua)\n");
xlog("L_ALERT", "ALERT: pike blocking $rm from $fu (IP:$si:$sp, $ua)\n");
xlog("Blocking traffic from $si\n");
$sht(ipban=>$si) = 1;
exit;
}
}
if ((uri == myself) && is_method("INVITE|REGISTER")) {
xlog("L_ALERT","ALERT: Request to myself: $ru from $fu (IP:$si:$sp, $ua), Blocking\n");
xlog("L_ALERT", "ALERT: Request to myself: $ru from $fu (IP:$si:$sp, $ua), Blocking\n");
xlog("Blocking traffic from $si\n");
$sht(ipban=>$si) = 1;
exit;
@ -697,7 +697,7 @@ route[REQINIT] {
#!endif
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
exit;
}
@ -744,7 +744,7 @@ route[WITHINDLG] {
$ru = $sht(contact=>$ci);
}
# sequential request withing a dialog should
# sequential request within a dialog should
# take the path determined by record-routing
if (loose_route()) {
if ($route_uri =~ "sip:mt@.*") {
@ -771,7 +771,7 @@ route[WITHINDLG] {
exit;
}
}
sl_send_reply("404","Not here");
sl_send_reply("404", "Not here");
}
exit;
}
@ -789,7 +789,7 @@ failure_route[SBC_failure] {
else
$sht(failedauth=>$si) = 1;
if ($sht(failedauth=>$si) > 10) {
xlog("L_ALERT","ALERT: blocking $rm from $fu (IP:$si:$sp), more than 5 failed auth requests!\n");
xlog("L_ALERT", "ALERT: blocking $rm from $fu (IP:$si:$sp), more than 5 failed auth requests!\n");
xlog("Blocking traffic from $si\n");
$sht(ipban=>$si) = 1;
}
@ -819,10 +819,10 @@ route[NOTIFY]
{
xlog("L_DBG", "IMS: INSIDE NOTIFY\n");
if (reginfo_handle_notify("location")) {
send_reply("200","OK - P-CSCF processed notification");
send_reply("200", "OK - P-CSCF processed notification");
break;
} else {
t_reply("500","Error encountered while processing notification");
t_reply("500", "Error encountered while processing notification");
break;
}
}

@ -9,7 +9,7 @@ route[MO]
# Process route headers, if any:
loose_route();
if (!pcscf_is_registered("location")) {
send_reply("403","Forbidden - You must register first with a S-CSCF");
send_reply("403", "Forbidden - You must register first with a S-CSCF");
exit;
}
@ -32,7 +32,7 @@ route[MO]
if (!pcscf_follows_service_routes("location")){
#Variant 1 - deny access to the network
#send_reply("400","Bad Request - Not following indicated service routes");
#send_reply("400", "Bad Request - Not following indicated service routes");
#break;
#Variant 2 - enforce routes and let the dialog continue
@ -110,12 +110,12 @@ onreply_route[MO_reply] {
drop();
}
xlog("L_DBG","Diameter: Orig authorizing media via Rx\n");
xlog("L_DBG", "Diameter: Orig authorizing media via Rx\n");
$avp(FTAG_CUSTOM_AVP)=$ft;
$avp(TTAG_CUSTOM_AVP)=$tt;
$avp(CALLID_CUSTOM_AVP)=$ci;
$var(aarret) = Rx_AAR("MO_aar_reply","orig","",-1);
$var(aarret) = Rx_AAR("MO_aar_reply", "orig", "", -1);
xlog("L_DBG", "AAR return code is $var(aarret)\n");
switch ($var(aarret)) {
@ -145,7 +145,7 @@ route[MO_aar_reply]
#this is async so to know status we have to check the reply avp
switch ($avp(s:aar_return_code)) {
case 1:
xlog("L_DBG", "Diameter: Orig AAR success on media authorization\n");
xlog("L_DBG", "Diameter: Orig AAR success on media authorization\n");
break;
default:
xlog("L_ERR", "IMS: AAR failed Orig\n");
@ -153,7 +153,7 @@ route[MO_aar_reply]
xlog("L_ERR", "IMS: ftag: "+ "$avp(FTAG_CUSTOM_AVP)");
xlog("L_ERR", "IMS: callid: "+ "$avp(CALLID_CUSTOM_AVP)");
#comment this if you want to allow even if Rx fails
if(dlg_get("$avp(CALLID_CUSTOM_AVP)","$avp(FTAG_CUSTOM_AVP)","$avp(TTAG_CUSTOM_AVP)")){
if(dlg_get("$avp(CALLID_CUSTOM_AVP)", "$avp(FTAG_CUSTOM_AVP)", "$avp(TTAG_CUSTOM_AVP)")){
dlg_terminate("all", "Sorry no QoS available");
exit;
}
@ -183,12 +183,12 @@ onreply_route[MO_indialog_reply] {
}
xlog("L_DBG", "IMS: ORIG_SUBSEQUENT reply. This is a 200 OK to a re-INVITE\n");
xlog("L_DBG","Diameter: Orig authorizing media via Rx\n");
xlog("L_DBG", "Diameter: Orig authorizing media via Rx\n");
$avp(FTAG_CUSTOM_AVP)=$ft;
$avp(TTAG_CUSTOM_AVP)=$tt;
$avp(CALLID_CUSTOM_AVP)=$ci;
$var(aarret) = Rx_AAR("MO_indialog_aar_reply","orig","",-1);
$var(aarret) = Rx_AAR("MO_indialog_aar_reply", "orig", "", -1);
xlog("L_DBG", "AAR return code is $var(aarret)\n");
switch ($var(aarret)) {
@ -226,7 +226,7 @@ route[MO_indialog_aar_reply]
xlog("L_ERR", "IMS: ftag: "+ "$avp(FTAG_CUSTOM_AVP)");
xlog("L_ERR", "IMS: callid: "+ "$avp(CALLID_CUSTOM_AVP)");
#comment this if you want to allow even if Rx fails
if(dlg_get("$avp(CALLID_CUSTOM_AVP)","$avp(FTAG_CUSTOM_AVP)","$avp(TTAG_CUSTOM_AVP)")){
if(dlg_get("$avp(CALLID_CUSTOM_AVP)", "$avp(FTAG_CUSTOM_AVP)", "$avp(TTAG_CUSTOM_AVP)")){
dlg_terminate("all", "Sorry no QoS available");
exit;
}

@ -25,12 +25,12 @@ onreply_route[MT_reply] {
drop();
}
xlog("L_DBG","Diameter: Term authorizing media via Rx\n");
xlog("L_DBG", "Diameter: Term authorizing media via Rx\n");
$avp(FTAG_CUSTOM_AVP)=$ft;
$avp(TTAG_CUSTOM_AVP)=$tt;
$avp(CALLID_CUSTOM_AVP)=$ci;
$var(aarret) = Rx_AAR("MT_aar_reply","term","",-1);
$var(aarret) = Rx_AAR("MT_aar_reply", "term", "", -1);
xlog("L_DBG", "AAR return code is $var(aarret)\n");
switch ($var(aarret)) {
@ -70,7 +70,7 @@ route[MT_aar_reply]
xlog("L_ERR", "IMS: ftag: "+ "$avp(FTAG_CUSTOM_AVP)");
xlog("L_ERR", "IMS: callid: "+ "$avp(CALLID_CUSTOM_AVP)");
#comment this if you want to allow even if Rx fails
if(dlg_get("$avp(CALLID_CUSTOM_AVP)","$avp(FTAG_CUSTOM_AVP)","$avp(TTAG_CUSTOM_AVP)")){
if(dlg_get("$avp(CALLID_CUSTOM_AVP)", "$avp(FTAG_CUSTOM_AVP)", "$avp(TTAG_CUSTOM_AVP)")){
dlg_terminate("all", "Sorry no QoS available");
exit;
}
@ -99,12 +99,12 @@ onreply_route[MT_indialog_reply] {
}
xlog("L_DBG", "IMS: TERM_SUBSEQUENT reply. This is a 200 OK to a re-INVITE\n");
xlog("L_DBG","Diameter: Term authorizing media via Rx\n");
xlog("L_DBG", "Diameter: Term authorizing media via Rx\n");
$avp(FTAG_CUSTOM_AVP)=$ft;
$avp(TTAG_CUSTOM_AVP)=$tt;
$avp(CALLID_CUSTOM_AVP)=$ci;
$var(aarret) = Rx_AAR("MT_indialog_aar_reply","term","",-1);
$var(aarret) = Rx_AAR("MT_indialog_aar_reply", "term", "", -1);
xlog("L_DBG", "AAR return code is $var(aarret)\n");
switch ($var(aarret)) {
@ -142,7 +142,7 @@ route[MT_indialog_aar_reply]
xlog("L_ERR", "IMS: ftag: "+ "$avp(FTAG_CUSTOM_AVP)");
xlog("L_ERR", "IMS: callid: "+ "$avp(CALLID_CUSTOM_AVP)");
#comment this if you want to allow even if Rx fails
if(dlg_get("$avp(CALLID_CUSTOM_AVP)","$avp(FTAG_CUSTOM_AVP)","$avp(TTAG_CUSTOM_AVP)")){
if(dlg_get("$avp(CALLID_CUSTOM_AVP)", "$avp(FTAG_CUSTOM_AVP)", "$avp(TTAG_CUSTOM_AVP)")){
dlg_terminate("all", "Sorry no QoS available");
exit;
}

@ -25,7 +25,7 @@ route[REGISTER] {
$ru = "sip:"+$rU+"@"+$rd;
#!ifdef WITH_RX
xlog("L_DBG","Subscribing to signalling bearer status\n");
xlog("L_DBG", "Subscribing to signalling bearer status\n");
Rx_AAR_Register("REG_AAR_REPLY", "location");
switch ($retcode) {
@ -187,7 +187,7 @@ failure_route[REGISTER_failure]
else
$sht(failedauth=>$si) = 1;
if ($sht(failedauth=>$si) > 10) {
xlog("L_ALERT","ALERT: blocking $rm from $fu (IP:$si:$sp), more than 5 failed auth requests!\n");
xlog("L_ALERT", "ALERT: blocking $rm from $fu (IP:$si:$sp), more than 5 failed auth requests!\n");
xlog("Blocking traffic from $si\n");
$sht(ipban=>$si) = 1;
}
@ -195,7 +195,7 @@ failure_route[REGISTER_failure]
}
#!endif
if (t_check_status("408")) {
send_reply("504","Server Time-Out");
send_reply("504", "Server Time-Out");
update_stat("register_failed", "+1");
exit;
}

@ -235,7 +235,7 @@ modparam("ims_registrar_scscf", "subscription_min_expires", 3700)
modparam("ims_registrar_scscf", "subscription_max_expires", 605800)
# -- CDP params --
modparam("cdp","config_file","/etc/kamailio_scscf/scscf.xml")
modparam("cdp", "config_file", "/etc/kamailio_scscf/scscf.xml")
# -- ims_dialog params --
modparam("ims_dialog", "dlg_flag", FLT_DIALOG)
@ -275,7 +275,7 @@ modparam("ims_auth", "cxdx_dest_realm", NETWORKNAME)
modparam("ims_auth", "av_check_only_impu", 1)
#modparam("ims_auth", "auth_data_timeout", 5)
modparam("ims_auth","auth_used_vector_timeout", 300)
modparam("ims_auth", "auth_used_vector_timeout", 300)
# -- ims_registrar_scscf params --
#!ifdef WITH_DEBUG
@ -289,7 +289,7 @@ modparam("ims_registrar_scscf", "max_expires", 604800)
#!endif
modparam("ims_registrar_scscf", "use_path", 1)
modparam("ims_registrar_scscf", "support_wildcardPSI",1)
modparam("ims_registrar_scscf", "user_data_xsd","/etc/kamailio_scscf/CxDataType_Rel7.xsd")
modparam("ims_registrar_scscf", "user_data_xsd", "/etc/kamailio_scscf/CxDataType_Rel7.xsd")
modparam("ims_registrar_scscf", "scscf_name", URI)
modparam("ims_registrar_scscf", "scscf_name", URI)
modparam("ims_registrar_scscf", "cxdx_dest_realm", NETWORKNAME)
@ -330,14 +330,14 @@ modparam("ims_charging", "ro_forced_peer", RO_FORCED_PEER);
modparam("ims_charging", "destination_host", RO_DESTINATION);
modparam("ims_charging", "destination_realm", NETWORKNAME);
modparam("ims_charging","service_context_id_root", RO_ROOT);
modparam("ims_charging","service_context_id_ext", RO_EXT);
modparam("ims_charging","service_context_id_mnc", RO_MNC);
modparam("ims_charging","service_context_id_mcc", RO_MCC);
modparam("ims_charging","service_context_id_release", RO_RELEASE);
modparam("ims_charging", "service_context_id_root", RO_ROOT);
modparam("ims_charging", "service_context_id_ext", RO_EXT);
modparam("ims_charging", "service_context_id_mnc", RO_MNC);
modparam("ims_charging", "service_context_id_mcc", RO_MCC);
modparam("ims_charging", "service_context_id_release", RO_RELEASE);
modparam("ims_charging","interim_update_credits",30);
modparam("ims_charging","timer_buffer",5);
modparam("ims_charging", "interim_update_credits",30);
modparam("ims_charging", "timer_buffer",5);
#!endif
# ----- enum params -----
@ -438,7 +438,7 @@ route {
exit;
}
} else {
sl_send_reply("403","Forbidden - Domain not served");
sl_send_reply("403", "Forbidden - Domain not served");
exit();
}
route(term);
@ -448,7 +448,7 @@ route {
route[UNREG_SAR_REPLY]
{
xlog("L_DBG","saa_return code is $avp(s:saa_return_code)\n");
xlog("L_DBG", "saa_return code is $avp(s:saa_return_code)\n");
switch ($avp(s:saa_return_code)){
case 1: #success
xlog("L_DBG", "SAR success - will route message\n");
@ -487,7 +487,7 @@ route[REQINIT] {
#!endif
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
exit;
}
@ -526,7 +526,7 @@ route[PUBLISH]
{
if (!t_newtran()) {
#absorb retransmissions
sl_reply("500","Could not create transaction");
sl_reply("500", "Could not create transaction");
exit;
}
@ -538,14 +538,14 @@ route[PUBLISH]
break;
case -1: #failure
xlog("L_ERR", "Publish reg failure - sending 500 Error now\n");
t_reply("500","Server Error publishing subscription");
t_reply("500", "Server Error publishing subscription");
break;
default:
xlog("L_ERR", "Unknown return code from publish reg event alue is [$var(ret)]\n");
break;
}
} else {
t_reply("403","Forbidden to PUBLISH");
t_reply("403", "Forbidden to PUBLISH");
exit;
}
}
@ -557,7 +557,7 @@ route[SUBSCRIBE]
{
if (!t_newtran()) {
#absorb retransmissions
sl_reply("500","Could not create transaction");
sl_reply("500", "Could not create transaction");
exit;
}
@ -569,7 +569,7 @@ route[SUBSCRIBE]
exit;
}
if (!can_subscribe_to_reg("location")){
t_reply("403","Forbidden to SUBSCRIBE");
t_reply("403", "Forbidden to SUBSCRIBE");
exit;
}
}else{
@ -583,7 +583,7 @@ route[SUBSCRIBE]
break;
case -1: #failure
xlog("L_ERR", "Subscribe to reg failure - sending 500 Error now\n");
t_reply("500","Server Error saving subscription");
t_reply("500", "Server Error saving subscription");
break;
case -2: #error
xlog("L_ERR", "Subscribe to reg error sending notify - 200 OK so subscription already sent\n");
@ -597,7 +597,7 @@ route[SUBSCRIBE]
route[SUBSCRIBE_UNREG_SAR_REPLY]
{
xlog("L_DBG","saa_return code is $avp(s:saa_return_code)\n");
xlog("L_DBG", "saa_return code is $avp(s:saa_return_code)\n");
switch ($avp(s:saa_return_code)){
case 1: #success
xlog("L_DBG", "SAR success - will process subscribe\n");
@ -609,7 +609,7 @@ route[SUBSCRIBE_UNREG_SAR_REPLY]
break;
case -1: #failure
xlog("L_ERR", "Subscribe to reg failure - sending 500 Error now\n");
t_reply("500","Server Error saving subscription");
t_reply("500", "Server Error saving subscription");
break;
case -2: #error
xlog("L_ERR", "Subscribe to reg error sending notify - 200 OK so subscription already sent\n");
@ -619,21 +619,21 @@ route[SUBSCRIBE_UNREG_SAR_REPLY]
break;
}
}else{
t_reply("403","Forbidden to SUBSCRIBE");
t_reply("403", "Forbidden to SUBSCRIBE");
exit;
}
break;
case -1: #failure
xlog("L_ERR", "SAR failure - Sending 403 Forbidden\n");
t_reply("403","Forbidden to SUBSCRIBE");
t_reply("403", "Forbidden to SUBSCRIBE");
break;
case -2: #error
xlog("L_ERR", "SAR error - Sending 403 Forbidden\n");
t_reply("403","Forbidden to SUBSCRIBE");
t_reply("403", "Forbidden to SUBSCRIBE");
break;
default:
xlog("L_ERR", "Unknown return code from SAR, value is [$avp(s:saa_return_code)] - sending 403 Forbidden\n");
t_reply("403","Forbidden to SUBSCRIBE");
t_reply("403", "Forbidden to SUBSCRIBE");
break;
}
exit;
@ -695,7 +695,7 @@ route[REGISTER] {
exit;
} else {
#user has not been authenticated. Lets send a challenge via 401 Unauthorized
xlog("L_DBG","About to challenge! auth_ims\n");
xlog("L_DBG", "About to challenge! auth_ims\n");
ims_www_challenge("REG_MAR_REPLY", "$td", "$var(alg)");
exit;
}
@ -704,11 +704,11 @@ route[REGISTER] {
# We need to check if this user is registered or not
if (!impu_registered("location")) {
xlog("L_ERR", "Not REGISTERED\n");
save("PRE_REG_SAR_REPLY","location");
save("PRE_REG_SAR_REPLY", "location");
exit;
} else {
isc_match_filter_reg("1","location");
save("REG_SAR_REPLY","location");
isc_match_filter_reg("1", "location");
save("REG_SAR_REPLY", "location");
exit;
}
}
@ -717,7 +717,7 @@ route[REGISTER] {
route[REG_MAR_REPLY]
{
#this is async so to know status we have to check the reply avp
xlog("L_DBG","maa_return code is $avp(s:maa_return_code)\n");
xlog("L_DBG", "maa_return code is $avp(s:maa_return_code)\n");
switch ($avp(s:maa_return_code)){
case 1: #success
@ -740,13 +740,13 @@ route[REG_MAR_REPLY]
route[PRE_REG_SAR_REPLY]
{
xlog("L_DBG","saa_return code is $avp(s:saa_return_code)\n");
xlog("L_DBG", "saa_return code is $avp(s:saa_return_code)\n");
#this is async so to know status we have to check the reply avp
xlog("L_DBG","saa_return code (for scscf_save on register) is $avp(s:saa_return_code)\n");
xlog("L_DBG", "saa_return code (for scscf_save on register) is $avp(s:saa_return_code)\n");
switch ($avp(s:saa_return_code)){
case 1: #success
xlog("L_DBG", "SAR success - 200 response sent from module\n");
isc_match_filter_reg("0","location");
isc_match_filter_reg("0", "location");
exit;
case -1: #failure
xlog("L_ERR", "SAR failure - error response sent from module\n");
@ -763,9 +763,9 @@ route[PRE_REG_SAR_REPLY]
route[REG_SAR_REPLY]
{
xlog("L_DBG","saa_return code is $avp(s:saa_return_code)\n");
xlog("L_DBG", "saa_return code is $avp(s:saa_return_code)\n");
#this is async so to know status we have to check the reply avp
xlog("L_DBG","saa_return code (for scscf_save on register) is $avp(s:saa_return_code)\n");
xlog("L_DBG", "saa_return code (for scscf_save on register) is $avp(s:saa_return_code)\n");
switch ($avp(s:saa_return_code)){
case 1: #success
xlog("L_DBG", "SAR success - 200 response sent from module\n");
@ -803,12 +803,12 @@ route[apply_privacy]
######################################################################
route[orig]
{
xlog("L_DBG","Enter orig route\n");
xlog("L_DBG", "Enter orig route\n");
set_dlg_profile("orig");
# we MAYBE need something like this to check if a user is barred
# if (S_originating_barred()){
# sl_send_reply("403","Forbidden - Originating Public Identity barred");
# sl_send_reply("403", "Forbidden - Originating Public Identity barred");
# exit;
# }
@ -835,14 +835,14 @@ route[orig]
#!ifdef WITH_RO
# before we allow call - lets check credit
if (is_method("INVITE")) {
xlog("L_DBG","Sending initial CCR Request for call\n");
xlog("L_DBG", "Sending initial CCR Request for call\n");
$var(cc_ret) = Ro_CCR("CHARGING_CCR_ORIG_REPLY", "orig", 30, "0", "0");
if ($var(cc_ret) < 0) {
xlog("L_ERR","CCR Request failure\n");
sl_send_reply("402","Payment required");
xlog("L_ERR", "CCR Request failure\n");
sl_send_reply("402", "Payment required");
exit;
}
xlog("L_DBG","CCR Request success\n");
xlog("L_DBG", "CCR Request success\n");
exit;
}
#!endif
@ -863,7 +863,7 @@ route[FINAL_ORIG]
route[CHARGING_CCR_ORIG_REPLY]
{
xlog("L_DBG","cca_return code is $avp(s:cca_return_code)\n");
xlog("L_DBG", "cca_return code is $avp(s:cca_return_code)\n");
switch ($avp(s:cca_return_code)){
case 1: #success
@ -886,7 +886,7 @@ route[CHARGING_CCR_ORIG_REPLY]
send_reply("486", "Line limit exceeded");
break;
default:
send_reply("402","Payment required ($avp(s:cca_result_code))");
send_reply("402", "Payment required ($avp(s:cca_result_code))");
break;
}
case -2: #error
@ -907,7 +907,7 @@ route[CHARGING_CCR_ORIG_REPLY]
######################################################################
onreply_route[orig_reply]
{
xlog("L_DBG","Orig reply\n");
xlog("L_DBG", "Orig reply\n");
route(apply_privacy);
break;
@ -918,7 +918,7 @@ onreply_route[orig_reply]
######################################################################
route[orig_subsequent]
{
xlog("L_DBG","Orig_Subsequent\n");
xlog("L_DBG", "Orig_Subsequent\n");
if (!is_method("ACK")) {
t_on_reply("orig_subsequent_reply");
@ -931,7 +931,7 @@ route[orig_subsequent]
######################################################################
onreply_route[orig_subsequent_reply]
{
xlog("L_DBG","Orig_Subsequent_reply\n");
xlog("L_DBG", "Orig_Subsequent_reply\n");
route(apply_privacy);
break;
}
@ -941,12 +941,12 @@ onreply_route[orig_subsequent_reply]
######################################################################
failure_route[isc_orig_failure]
{
xlog("L_DBG","ISC_Orig_failure\n");
xlog("L_DBG", "ISC_Orig_failure\n");
if (t_check_status("(408)|(5..)")){
t_on_failure("isc_orig_failure");
if (isc_match_filter("orig","location")){
xlog("L_DBG","ISC_Orig_failure - msg was fwded to AS\n");
if (isc_match_filter("orig", "location")){
xlog("L_DBG", "ISC_Orig_failure - msg was fwded to AS\n");
exit;
}
@ -966,13 +966,13 @@ failure_route[isc_orig_failure]
######################################################################
route[term]
{
xlog("L_DBG","Term\n");
xlog("L_DBG", "Term\n");
set_dlg_profile("term");
#we need something like this to check if a user is barred
# if (S_terminating_barred()){
# sl_send_reply("404","Not Found - Terminating user barred");
# sl_send_reply("404", "Not Found - Terminating user barred");
# exit;
# }
@ -983,23 +983,23 @@ route[term]
}
# check if dialog saved as fwded to AS
if (isc_match_filter("term","location")){
if (isc_match_filter("term", "location")){
t_on_failure("isc_term_failure");
xlog("L_DBG","Term - msg was fwded to AS\n");
xlog("L_DBG", "Term - msg was fwded to AS\n");
exit;
}
#!ifdef WITH_RO_TERM
# before we allow call - lets check credit
if (is_method("INVITE")) {
xlog("L_DBG","Sending initial CCR Request for call\n");
xlog("L_DBG", "Sending initial CCR Request for call\n");
$var(cc_ret) = Ro_CCR("CHARGING_CCR_TERM_REPLY", "term", 30, "0", "0");
if ($var(cc_ret) < 0) {
xlog("L_ERR","CCR Request failure\n");
sl_send_reply("402","Payment required");
xlog("L_ERR", "CCR Request failure\n");
sl_send_reply("402", "Payment required");
exit;
}
xlog("L_DBG","CCR Request success\n");
xlog("L_DBG", "CCR Request success\n");
exit;
}
#!endif
@ -1013,7 +1013,7 @@ route[FINAL_TERM] {
sl_reply_error();
exit;
}
t_reply("404","Not Found - destination user not found on this S-CSCF");
t_reply("404", "Not Found - destination user not found on this S-CSCF");
exit;
}
} else {
@ -1022,7 +1022,7 @@ route[FINAL_TERM] {
sl_reply_error();
exit;
}
t_reply("404","Not Found - destination user not found on this S-CSCF");
t_reply("404", "Not Found - destination user not found on this S-CSCF");
exit;
}
route(apply_privacy);
@ -1033,7 +1033,7 @@ route[FINAL_TERM] {
route[CHARGING_CCR_TERM_REPLY]
{
xlog("L_DBG","cca_return code is $avp(s:cca_return_code)\n");
xlog("L_DBG", "cca_return code is $avp(s:cca_return_code)\n");
switch ($avp(s:cca_return_code)){
case 1: #success
@ -1056,7 +1056,7 @@ route[CHARGING_CCR_TERM_REPLY]
send_reply("486", "Line limit exceeded");
break;
default:
send_reply("402","Payment required ($avp(s:cca_result_code))");
send_reply("402", "Payment required ($avp(s:cca_result_code))");
break;
}
case -2: #error
@ -1077,22 +1077,22 @@ route[CHARGING_CCR_TERM_REPLY]
######################################################################
failure_route[isc_term_failure]
{
xlog("L_DBG","ISC_term_failure\n");
xlog("L_DBG", "ISC_term_failure\n");
if (t_check_status("(408)|(5..)")){
t_on_failure("isc_term_failure");
if (isc_match_filter("term","location")){
xlog("L_DBG","Term - msg was fwded to AS\n");
if (isc_match_filter("term", "location")){
xlog("L_DBG", "Term - msg was fwded to AS\n");
exit;
}
if (lookup("location")) {
if (uri==myself) {
t_reply("404","Not Found - destination user not found on this S-CSCF");
t_reply("404", "Not Found - destination user not found on this S-CSCF");
exit;
}
} else {
t_reply("404","Not Found - destination user not found on this S-CSCF");
t_reply("404", "Not Found - destination user not found on this S-CSCF");
exit;
}
t_relay();
@ -1104,7 +1104,7 @@ failure_route[isc_term_failure]
######################################################################
route[term_subsequent]
{
xlog("L_DBG","term_subsequent\n");
xlog("L_DBG", "term_subsequent\n");
route(apply_privacy);
t_relay();
}
@ -1119,7 +1119,7 @@ route[PSTN_handling]
# $fu: sip:test@foo.com
# becomes $ru: sip:+34999888777@foo.com;user=phone
if (!tel2sip("$ru", "$fd", "$ru"))
xlog("L_WARN","Failed to convert $ru to a sip:-URI - M=$rm R=$ru F=$fu T=$tu IP=$si:$sp ID=$ci\n\n");
xlog("L_WARN", "Failed to convert $ru to a sip:-URI - M=$rm R=$ru F=$fu T=$tu IP=$si:$sp ID=$ci\n\n");
if ($rU =~ "\+[0-9]+") {
# Now let's check, if the number can be found in ENUM:
@ -1157,7 +1157,7 @@ route[PSTN]
if ($var(has_trf) == 0) {
if (!ds_select_domain("1", "4")) {
xlog("L_WARN","No PSTN-Gateways available - M=$rm R=$ru F=$fu T=$tu IP=$si:$sp ID=$ci\n\n");
xlog("L_WARN", "No PSTN-Gateways available - M=$rm R=$ru F=$fu T=$tu IP=$si:$sp ID=$ci\n\n");
send_reply("503", "Service not available");
exit;
}
@ -1183,7 +1183,7 @@ failure_route[TRF_failure] {
if (t_branch_timeout() || t_check_status("[5-6]..")) {
$du = $null;
if (!ds_select_domain("1", "4")) {
xlog("L_WARN","No PSTN-Gateways available - M=$rm R=$ru F=$fu T=$tu IP=$si:$sp ID=$ci\n\n");
xlog("L_WARN", "No PSTN-Gateways available - M=$rm R=$ru F=$fu T=$tu IP=$si:$sp ID=$ci\n\n");
send_reply("503", "Service not available");
exit;
}

@ -148,7 +148,7 @@ route{
# initial sanity checks -- messages with
# max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
exit;
};
@ -164,7 +164,7 @@ route{
if (!is_method("REGISTER"))
record_route();
# subsequent messages withing a dialog should take the
# subsequent messages within a dialog should take the
# path determined by record-routing
if (loose_route()) {
# mark routing logic in request

@ -35,7 +35,7 @@ route{
# filter too old messages
if (!mf_process_maxfwd_header("10")) {
log("LOG: Too many hops\n");
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
exit;
};
if (msg:len >= 2048 ) {
@ -59,7 +59,7 @@ route{
# record-route INVITES to make sure BYEs will visit our server too
if (method=="INVITE") record_route();
# forward the request statefuly now; (we need *stateful* forwarding,
# forward the request statefully now; (we need *stateful* forwarding,
# because the stateful mode correlates requests with replies and
# drops retranmissions; otherwise, we would have to report on
# every single message received)

@ -42,7 +42,7 @@ route{
# wait until timer hits
seturi("sip:nobody@kamailio.org");
append_branch("sip:parallel@kamailio.org:9");
# if we do not get a positive reply, continue at reply_route[1]
# if we do not get a positive reply, continue at failure_route[1]
t_on_failure("1");
# forward the request to all destinations in destination set now
t_relay();
@ -51,8 +51,8 @@ route{
failure_route[1] {
# forwarding failed -- try again at another destination
append_branch("sip:nonsense@kamailio.org");
log(1,"first redirection\n");
# if this alternative destination fails too, proceed to reply_route[2]
log(1, "first redirection\n");
# if this alternative destination fails too, proceed to failure_route[2]
t_on_failure("2");
t_relay();
}

@ -50,7 +50,7 @@ modparam("tm", "wt_timer", 10 )
route{
if ( !mf_process_maxfwd_header("10") )
{
sl_send_reply("483","To Many Hops");
sl_send_reply("483", "To Many Hops");
exit;
};
@ -131,7 +131,7 @@ failure_route[1] {
exit;
};
log(1,"MSILO: the downstream UA does not support MESSAGE requests ...\n");
log(1, "MSILO: the downstream UA does not support MESSAGE requests ...\n");
# we have changed the R-URI with the contact address -- ignore it now
if (m_store("$avp(i:11)"))
{

@ -88,8 +88,8 @@ modparam("usrloc", "db_mode", 0)
modparam("rr", "enable_full_lr", 1)
# !! Nathelper
modparam("usrloc","nat_bflag",6)
modparam("nathelper","sipping_bflag",8)
modparam("usrloc", "nat_bflag", 6)
modparam("nathelper", "sipping_bflag", 8)
modparam("nathelper", "ping_nated_only", 1) # Ping only clients behind NAT
# ------------------------- request routing logic -------------------
@ -101,7 +101,7 @@ route{
# initial sanity checks -- messages with
# max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
exit;
};
if (msg:len >= 2048 ) {
@ -147,7 +147,7 @@ route{
# use different transport protocol
if (!is_method("REGISTER")) record_route();
# subsequent messages withing a dialog should take the
# subsequent messages within a dialog should take the
# path determined by record-routing
if (loose_route()) {
# mark routing logic in request

@ -23,7 +23,7 @@ loadmodule "uri.so"
# ----------------- setting module-specific parameters ---------------
modparam("auth_db", "db_url","mysql://kamailio:kamailiorw@localhost/kamailio")
modparam("auth_db", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio")
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")
@ -44,7 +44,7 @@ route{
# filter too old messages
if (!mf_process_maxfwd_header("10")) {
log("LOG: Too many hops\n");
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
exit;
};
if (msg:len >= 2048 ) {

@ -39,7 +39,7 @@ route{
# initial sanity checks -- messages with
# max_forwars==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
exit;
};
if (msg:len >= 2048 ) {

@ -26,7 +26,7 @@ route{
# initial sanity checks -- messages with
# max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
exit;
};
if (msg:len >= 2048 ) {
@ -41,8 +41,7 @@ route{
log(1, "forwarding now to primary destination\n");
if (method=="INVITE") {
rewriteuri("sip:xxx@192.168.2.16:5064");
# if transaction broken, try other an alternative
# route
# if transaction is broken, try an alternative route
t_on_failure("1");
# if a provisional came, stop alternating
t_on_reply("1");

@ -17,7 +17,7 @@ var FLB_NATSIPPING=7
// equivalent of request_route{}
function ksr_request_route()
{
// KSR.sl.sl_send_reply(100,"Intelligent trying");
// KSR.sl.sl_send_reply(100, "Intelligent trying");
// KSR.info("===== request - from kamailio javascript script\n");
// per request initial checks
@ -34,11 +34,6 @@ function ksr_request_route()
return;
}
// handle requests within SIP dialogs
ksr_route_withindlg();
// -- only initial requests (no To tag)
// handle retransmissions
if (!KSR.is_ACK()) {
if (KSR.tmx.t_precheck_trans()>0) {
@ -48,6 +43,11 @@ function ksr_request_route()
if (KSR.tm.t_check_trans()==0) { return; }
}
// handle requests within SIP dialogs
ksr_route_withindlg();
// -- only initial requests (no To tag)
// authentication
ksr_route_auth();
@ -135,25 +135,26 @@ function ksr_route_reqinit()
if (KSR.corex.has_user_agent()>0) {
var UA = KSR.kx.gete_ua();
if (UA.indexOf("friendly")>=0 || UA.indexOf("scanner")>=0
|| UA.indexOf("sipcli")>=0 || UA.indexOf("sipvicious")>=0) {
|| UA.indexOf("sipcli")>=0 || UA.indexOf("sipvicious")>=0
|| UA.indexOf("VaxSIPUserAgent")>=0 || UA.indexOf("pplsip")>= 0) {
KSR.sl.sl_send_reply(200, "OK");
KSR.x.exit();
}
}
if (KSR.maxfwd.process_maxfwd(10) < 0) {
KSR.sl.sl_send_reply(483,"Too Many Hops");
KSR.sl.sl_send_reply(483, "Too Many Hops");
KSR.x.exit();
}
if (KSR.is_OPTIONS()
&& KSR.is_myself_ruri()
&& KSR.corex.has_ruri_user() < 0) {
KSR.sl.sl_send_reply(200,"Keepalive");
KSR.sl.sl_send_reply(200, "Keepalive");
KSR.x.exit();
}
if (KSR.sanity.sanity_check(1511, 7)<0) {
if (KSR.sanity.sanity_check(17895, 7)<0) {
KSR.err("Malformed SIP message from "
+ KSR.kx.get_srcip() + ":" + KSR.kx.get_srcport() + "\n");
KSR.x.exit();
@ -166,7 +167,7 @@ function ksr_route_withindlg()
{
if (KSR.siputils.has_totag()<0) { return; }
// sequential request withing a dialog should
// sequential request within a dialog should
// take the path determined by record-routing
if (KSR.rr.loose_route()>0) {
ksr_route_dlguri();
@ -265,7 +266,7 @@ function ksr_route_auth()
// a local destination, otherwise deny, not an open relay here
if ((!KSR.is_myself_furi())
&& (!KSR.is_myself_ruri())) {
KSR.sl.sl_send_reply(403,"Not relaying");
KSR.sl.sl_send_reply(403, "Not relaying");
KSR.x.exit();
}

@ -120,7 +120,7 @@ function ksr_request_route()
if KSR.corex.has_ruri_user() < 0 then
-- request with no Username in RURI
KSR.sl.sl_send_reply(484,"Address Incomplete");
KSR.sl.sl_send_reply(484, "Address Incomplete");
return 1;
end
@ -184,20 +184,21 @@ function ksr_route_reqinit()
end
local ua = KSR.kx.gete_ua();
if string.find(ua, "friendly") or string.find(ua, "scanner")
or string.find(ua, "sipcli") or string.find(ua, "sipvicious") then
or string.find(ua, "sipcli") or string.find(ua, "sipvicious")
or string.find(ua, "VaxSIPUserAgent") or string.find(ua, "pplsip") then
KSR.sl.sl_send_reply(200, "OK");
KSR.x.exit();
end
if KSR.maxfwd.process_maxfwd(10) < 0 then
KSR.sl.sl_send_reply(483,"Too Many Hops");
KSR.sl.sl_send_reply(483, "Too Many Hops");
KSR.x.exit();
end
if KSR.is_OPTIONS()
and KSR.is_myself_ruri()
and KSR.corex.has_ruri_user() < 0 then
KSR.sl.sl_send_reply(200,"Keepalive");
KSR.sl.sl_send_reply(200, "Keepalive");
KSR.x.exit();
end
@ -214,7 +215,7 @@ end
function ksr_route_withindlg()
if KSR.siputils.has_totag()<0 then return 1; end
-- sequential request withing a dialog should
-- sequential request within a dialog should
-- take the path determined by record-routing
if KSR.rr.loose_route()>0 then
ksr_route_dlguri();
@ -314,7 +315,7 @@ function ksr_route_auth()
-- a local destination, otherwise deny, not an open relay here
if (not KSR.is_myself_furi())
and (not KSR.is_myself_ruri()) then
KSR.sl.sl_send_reply(403,"Not relaying");
KSR.sl.sl_send_reply(403, "Not relaying");
KSR.x.exit();
end

@ -20,18 +20,20 @@ request_route {
exit;
}
# handle retransmissions
if (!is_method("ACK")) {
if(t_precheck_trans()) {
t_check_trans();
exit;
}
t_check_trans();
}
# handle requests within SIP dialogs
route(WITHINDLG);
### only initial requests (no To tag)
# handle retransmissions
if(t_precheck_trans()) {
t_check_trans();
exit;
}
t_check_trans();
# authentication
route(AUTH);
@ -56,7 +58,7 @@ request_route {
if ($rU==$null) {
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
sl_send_reply("484", "Address Incomplete");
exit;
}
@ -86,8 +88,14 @@ route[RELAY] {
# Per SIP request initial checks
route[REQINIT] {
# no connect for sending replies
set_reply_no_connect();
# enforce symmetric signaling
# - send back replies to the source address of request
force_rport();
#!ifdef WITH_ANTIFLOOD
# flood dection from same IP and traffic ban for a while
# flood detection from same IP and traffic ban for a while
# be sure you exclude checking trusted peers, such as pstn gateways
# - local host excluded (e.g., loop to self)
if(src_ip!=myself) {
@ -97,29 +105,30 @@ route[REQINIT] {
exit;
}
if (!pike_check_req()) {
xlog("L_ALERT","ALERT: pike blocking $rm from $fu (IP:$si:$sp)\n");
xlog("L_ALERT", "ALERT: pike blocking $rm from $fu (IP:$si:$sp)\n");
$sht(ipban=>$si) = 1;
exit;
}
}
if($ua =~ "friendly-scanner") {
sl_send_reply("200", "OK");
#!endif
if($ua =~ "friendly|scanner|sipcli|sipvicious|VaxSIPUserAgent|pplsip") {
# silent drop for scanners - uncomment next line if want to reply
# sl_send_reply("200", "OK");
exit;
}
#!endif
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
exit;
}
if(is_method("OPTIONS") && uri==myself && $rU==$null) {
sl_send_reply("200","Keepalive");
sl_send_reply("200", "Keepalive");
exit;
}
if(!sanity_check("1511", "7")) {
xlog("Malformed SIP message from $si:$sp\n");
if(!sanity_check("17895", "7")) {
xlog("Malformed SIP request from $si:$sp\n");
exit;
}
}
@ -128,7 +137,7 @@ route[REQINIT] {
route[WITHINDLG] {
if (!has_totag()) return;
# sequential request withing a dialog should
# sequential request within a dialog should
# take the path determined by record-routing
if (loose_route()) {
route(DLGURI);
@ -229,7 +238,7 @@ route[AUTH] {
# if caller is not local subscriber, then check if it calls
# a local destination, otherwise deny, not an open relay here
if (from_uri!=myself && uri!=myself) {
sl_send_reply("403","Not relaying");
sl_send_reply("403", "Not relaying");
exit;
}

@ -106,7 +106,7 @@ class kamailio:
if KSR.corex.has_ruri_user() < 0 :
# request with no Username in RURI
KSR.sl.sl_send_reply(484,"Address Incomplete")
KSR.sl.sl_send_reply(484, "Address Incomplete")
return 1
@ -158,18 +158,19 @@ class kamailio:
if KSR.corex.has_user_agent() > 0 :
ua = KSR.pv.gete("$ua")
if (ua.find("friendly")!=-1 or ua.find("scanner")!=-1
or ua.find("sipcli")!=-1 or ua.find("sipvicious")!=-1) :
or ua.find("sipcli")!=-1 or ua.find("sipvicious")!=-1
or ua.find("VaxSIPUserAgent")!=-1 or ua.find("pplsip")!=-1) :
KSR.sl.sl_send_reply(200, "Processed")
return -255
if KSR.maxfwd.process_maxfwd(10) < 0 :
KSR.sl.sl_send_reply(483,"Too Many Hops")
KSR.sl.sl_send_reply(483, "Too Many Hops")
return -255
if (KSR.is_OPTIONS()
and KSR.is_myself_ruri()
and KSR.corex.has_ruri_user() < 0) :
KSR.sl.sl_send_reply(200,"Keepalive")
KSR.sl.sl_send_reply(200, "Keepalive")
return -255
if KSR.sanity.sanity_check(17895, 7)<0 :
@ -183,7 +184,7 @@ class kamailio:
if KSR.siputils.has_totag()<0 :
return 1
# sequential request withing a dialog should
# sequential request within a dialog should
# take the path determined by record-routing
if KSR.rr.loose_route()>0 :
if self.ksr_route_dlguri(msg)==-255 :
@ -276,7 +277,7 @@ class kamailio:
# if caller is not local subscriber, then check if it calls
# a local destination, otherwise deny, not an open relay here
if (not KSR.is_myself_furi()) and (not KSR.is_myself_ruri()) :
KSR.sl.sl_send_reply(403,"Not relaying")
KSR.sl.sl_send_reply(403, "Not relaying")
return -255
return 1

@ -0,0 +1,381 @@
## Kamailio - equivalent of routing blocks in Python
##
## KSR - the new dynamic object exporting Kamailio functions
## Router - the old object exporting Kamailio functions
##
## Relevant remarks:
## * return code -255 is used to propagate the 'exit' behaviour to the
## parent route block function. The alternative is to use the native
## Python function sys.exit() (or exit()) -- it throws an exception that
## is caught by Kamailio and prevents the stop of the interpreter.
import sys
import KSR as KSR
# global variables corresponding to defined values (e.g., flags) in kamailio.cfg
FLT_ACC=1
FLT_ACCMISSED=2
FLT_ACCFAILED=3
FLT_NATS=5
FLB_NATB=6
FLB_NATSIPPING=7
# SIP request routing
# -- equivalent of request_route{}
def ksr_request_route():
# KSR.info("===== request - from kamailio python script\n")
# KSR.info("===== method [%s] r-uri [%s]\n" % (KSR.pv.get("$rm"),KSR.pv.get("$ru")))
# per request initial checks
if ksr_route_reqinit()==-255 :
return 1
# NAT detection
if ksr_route_natdetect()==-255 :
return 1
# CANCEL processing
if KSR.is_CANCEL() :
if KSR.tm.t_check_trans()>0 :
ksr_route_relay()
return 1
# handle retransmissions
if not KSR.is_ACK() :
if KSR.tmx.t_precheck_trans()>0 :
KSR.tm.t_check_trans()
return 1
if KSR.tm.t_check_trans()==0 :
return 1
# handle requests within SIP dialogs
if ksr_route_withindlg()==-255 :
return 1
# -- only initial requests (no To tag)
# authentication
if ksr_route_auth()==-255 :
return 1
# record routing for dialog forming requests (in case they are routed)
# - remove preloaded route headers
KSR.hdr.remove("Route")
if KSR.is_method_in("IS") :
KSR.rr.record_route()
# account only INVITEs
if KSR.is_INVITE() :
KSR.setflag(FLT_ACC); # do accounting
# dispatch requests to foreign domains
if ksr_route_sipout()==-255 :
return 1
# # requests for my local domains
# handle registrations
if ksr_route_registrar()==-255 :
return 1
if KSR.corex.has_ruri_user() < 0 :
# request with no Username in RURI
KSR.sl.sl_send_reply(484, "Address Incomplete")
return 1
# user location service
ksr_route_location()
return 1
# wrapper around tm relay function
def ksr_route_relay():
# enable additional event routes for forwarded requests
# - serial forking, RTP relaying handling, a.s.o.
if KSR.is_method_in("IBSU") :
if KSR.tm.t_is_set("branch_route")<0 :
KSR.tm.t_on_branch("ksr_branch_manage")
if KSR.is_method_in("ISU") :
if KSR.tm.t_is_set("onreply_route")<0 :
KSR.tm.t_on_reply("ksr_onreply_manage")
if KSR.is_INVITE() :
if KSR.tm.t_is_set("failure_route")<0 :
KSR.tm.t_on_failure("ksr_failure_manage")
if KSR.tm.t_relay()<0 :
KSR.sl.sl_reply_error()
return -255
# Per SIP request initial checks
def ksr_route_reqinit():
# no connect for sending replies
KSR.set_reply_no_connect()
# enforce symmetric signaling
# send back replies to the source address of request
KSR.force_rport()
if not KSR.is_myself_srcip() :
srcip = KSR.kx.get_srcip()
if KSR.htable.sht_match_name("ipban", "eq", srcip) > 0 :
# ip is already blocked
KSR.dbg("request from blocked IP - " + KSR.kx.get_method()
+ " from " + KSR.kx.get_furi() + " (IP:"
+ srcip + ":" + str(KSR.pv.get("$sp")) + ")\n")
return -255
if KSR.pike.pike_check_req()<0 :
KSR.err("ALERT: pike blocking " + KSR.kx.get_method()
+ " from " + KSR.kx.get_furi() + " (IP:"
+ srcip + ":" + str(KSR.pv.get("$sp")) + ")\n")
KSR.htable.sht_seti("ipban", srcip, 1)
return -255
if KSR.corex.has_user_agent() > 0 :
ua = KSR.kx.gete_ua()
if (ua.find("friendly")!=-1 or ua.find("scanner")!=-1
or ua.find("sipcli")!=-1 or ua.find("sipvicious")!=-1
or ua.find("VaxSIPUserAgent")!=-1 or ua.find("pplsip")!=-1) :
KSR.sl.sl_send_reply(200, "Processed")
return -255
if KSR.maxfwd.process_maxfwd(10) < 0 :
KSR.sl.sl_send_reply(483, "Too Many Hops")
return -255
if (KSR.is_OPTIONS()
and KSR.is_myself_ruri()
and KSR.corex.has_ruri_user() < 0) :
KSR.sl.sl_send_reply(200, "Keepalive")
return -255
if KSR.sanity.sanity_check(17895, 7)<0 :
KSR.err("Malformed SIP message from "
+ KSR.pv.get("$si") + ":" + str(KSR.pv.get("$sp")) +"\n")
return -255
# Handle requests within SIP dialogs
def ksr_route_withindlg():
if KSR.siputils.has_totag()<0 :
return 1
# sequential request withing a dialog should
# take the path determined by record-routing
if KSR.rr.loose_route()>0 :
if ksr_route_dlguri()==-255 :
return -255
if KSR.is_BYE() :
# do accounting ...
KSR.setflag(FLT_ACC)
# ... even if the transaction fails
KSR.setflag(FLT_ACCFAILED)
elif KSR.is_ACK() :
# ACK is forwarded statelessly
if ksr_route_natmanage()==-255 :
return -255
elif KSR.is_NOTIFY() :
# Add Record-Route for in-dialog NOTIFY as per RFC 6665.
KSR.rr.record_route()
ksr_route_relay()
return -255
if KSR.is_ACK() :
if KSR.tm.t_check_trans() >0 :
# no loose-route, but stateful ACK
# must be an ACK after a 487
# or e.g. 404 from upstream server
ksr_route_relay()
return -255
else:
# ACK without matching transaction ... ignore and discard
return -255
KSR.sl.sl_send_reply(404, "Not here")
return -255
# Handle SIP registrations
def ksr_route_registrar():
if not KSR.is_REGISTER() :
return 1
if KSR.isflagset(FLT_NATS) :
KSR.setbflag(FLB_NATB)
# do SIP NAT pinging
KSR.setbflag(FLB_NATSIPPING)
if KSR.registrar.save("location", 0)<0 :
KSR.sl.sl_reply_error()
return -255
# User location service
def ksr_route_location():
rc = KSR.registrar.lookup("location")
if rc<0 :
KSR.tm.t_newtran()
if rc==-1 or rc==-3 :
KSR.sl.send_reply(404, "Not Found")
return -255
elif rc==-2 :
KSR.sl.send_reply(405, "Method Not Allowed")
return -255
# when routing via usrloc, log the missed calls also
if KSR.is_INVITE() :
KSR.setflag(FLT_ACCMISSED)
ksr_route_relay()
return -255
# IP authorization and user uthentication
def ksr_route_auth():
if not KSR.is_REGISTER() :
if KSR.permissions.allow_source_address(1)>0 :
# source IP allowed
return 1
if KSR.is_REGISTER() or KSR.is_myself_furi() :
# authenticate requests
if KSR.auth_db.auth_check(KSR.pv.get("$fd"), "subscriber", 1)<0 :
KSR.auth.auth_challenge(KSR.pv.get("$fd"), 0)
return -255
# user authenticated - remove auth header
if not KSR.is_method_in("RP") :
KSR.auth.consume_credentials()
# if caller is not local subscriber, then check if it calls
# a local destination, otherwise deny, not an open relay here
if (not KSR.is_myself_furi()) and (not KSR.is_myself_ruri()) :
KSR.sl.sl_send_reply(403, "Not relaying")
return -255
return 1
# Caller NAT detection
def ksr_route_natdetect():
KSR.force_rport()
if KSR.nathelper.nat_uac_test(19)>0 :
if KSR.is_REGISTER() :
KSR.nathelper.fix_nated_register()
elif KSR.siputils.is_first_hop()>0 :
KSR.nathelper.set_contact_alias()
KSR.setflag(FLT_NATS)
return 1
# RTPProxy control
def ksr_route_natmanage():
if KSR.siputils.is_request()>0 :
if KSR.siputils.has_totag()>0 :
if KSR.rr.check_route_param("nat=yes")>0 :
KSR.setbflag(FLB_NATB)
if (not (KSR.isflagset(FLT_NATS) or KSR.isbflagset(FLB_NATB))) :
return 1
KSR.rtpproxy.rtpproxy_manage("co")
if KSR.siputils.is_request()>0 :
if not KSR.siputils.has_totag() :
if KSR.tmx.t_is_branch_route()>0 :
KSR.rr.add_rr_param(";nat=yes")
if KSR.siputils.is_reply()>0 :
if KSR.isbflagset(FLB_NATB) :
KSR.nathelper.set_contact_alias()
return 1
# URI update for dialog requests
def ksr_route_dlguri():
if not KSR.isdsturiset() :
KSR.nathelper.handle_ruri_alias()
return 1
# Routing to foreign domains
def ksr_route_sipout():
if KSR.is_myself_ruri() :
return 1
KSR.hdr.append("P-Hint: outbound\r\n")
ksr_route_relay()
return -255
# Manage outgoing branches
# -- equivalent of branch_route[...]{}
def ksr_branch_manage():
KSR.dbg("new branch ["+ str(KSR.pv.get("$T_branch_idx"))
+ "] to "+ KSR.pv.get("$ru") + "\n")
ksr_route_natmanage()
return 1
# Manage incoming replies
# -- equivalent of onreply_route[...]{}
def ksr_onreply_manage():
KSR.dbg("incoming reply\n")
scode = KSR.pv.get("$rs")
if scode>100 and scode<299 :
ksr_route_natmanage()
return 1
# Manage failure routing cases
# -- equivalent of failure_route[...]{}
def ksr_failure_manage():
if ksr_route_natmanage()==-255 : return 1
if KSR.tm.t_is_canceled()>0 :
return 1
return 1
# SIP response handling
# -- equivalent of reply_route{}
def ksr_reply_route():
KSR.dbg("response handling - python script\n")
if KSR.sanity.sanity_check(17604, 6)<0 :
KSR.err("Malformed SIP response from "
+ KSR.pv.get("$si") + ":" + str(KSR.pv.get("$sp")) +"\n")
KSR.set_drop()
return -255
return 1
# global helper function for debugging purposes
def dumpObj(obj):
for attr in dir(obj):
KSR.info("obj.%s = %s\n" % (attr, getattr(obj, attr)))

@ -28,8 +28,6 @@ def ksr_request_route()
return
end
ksr_route_withindlg()
# Retransmissions
if !KSR.is_ACK() then
if KSR::TMX.t_precheck_trans() > 0 then
@ -39,7 +37,12 @@ def ksr_request_route()
return if KSR::TM.t_check_trans() == 0
end
# Auth
# Handle requests within SIP dialogs
ksr_route_withindlg()
# -- only initial requests (no To tag)
# Authentication
ksr_route_auth()
# Record routing for dialog forming requests (in case they are routed)
@ -56,36 +59,16 @@ def ksr_request_route()
# Registrations
ksr_route_registrar()
# USRLOC
ksr_route_location()
return
end
def ksr_route_reqinit()
if KSR::COREX.has_user_agent() > 0 then
ua = KSR::PV.gete("$ua");
if ua.include? 'friendly' or ua.include? 'scanner'
or ua.include? 'sipcli' or ua.include? 'sipvicious' then
KSR::SL.sl_send_reply(200, "OK");
exit
end
end
if KSR::MAXFWD.process_maxfwd(10) < 0 then
KSR::SL.sl_send_reply(483,"Too Many Hops");
exit
if KSR::COREX.has_ruri_user() < 0 then
# request with no Username in RURI
KSR::SL.sl_send_reply(484, "Address Incomplete");
return;
end
if KSR.is_OPTIONS() and KSR.is_myself_ruri() and KSR::COREX.has_ruri_user() < 0 then
KSR::SL.sl_send_reply(200, "Keepalive");
exit
end
# User location service
ksr_route_location()
if KSR::SANITY.sanity_check(1511, 7) < 0 then
KSR.err("Malformed SIP message from #{KSR::PV.get('$si')}:#{KSR::PV.get('$sp')}\n");
exit
end
return
end
def ksr_route_relay()
@ -112,6 +95,57 @@ def ksr_route_relay()
exit
end
def ksr_route_reqinit()
# no connect for sending replies
KSR.set_reply_no_connect();
# enforce symmetric signaling
# send back replies to the source address of request
KSR.force_rport();
if !KSR.is_myself_srcip() then
srcip = KSR::KX.get_srcip();
if KSR::HTABLE.sht_match_name("ipban", "eq", srcip) > 0 then
# ip is already blocked
KSR.dbg("request from blocked IP - " + KSR::KX.get_method() +
" from " + KSR::KX.get_furi() + " (IP:" +
srcip + ":" + KSR::KX.get_srcport() + ")\n");
exit;
end
if KSR::PIKE.pike_check_req() < 0 then
KSR.err("ALERT: pike blocking " + KSR.kx.get_method() +
" from " + KSR::KX.get_furi() + " (IP:" +
srcip + ":" + KSR.kx.get_srcport() + ")\n");
KSR::HTABLE.sht_seti("ipban", srcip, 1);
exit;
end
end
if KSR::COREX.has_user_agent() > 0 then
ua = KSR::PV.gete("$ua");
if ua.include? 'friendly' or ua.include? 'scanner' or
ua.include? 'sipcli' or ua.include? 'sipvicious' or
ua.include? 'VaxSIPUserAgent' or ua.include? 'pplsip' then
KSR::SL.sl_send_reply(200, "OK");
exit
end
end
if KSR::MAXFWD.process_maxfwd(10) < 0 then
KSR::SL.sl_send_reply(483, "Too Many Hops");
exit
end
if KSR.is_OPTIONS() and KSR.is_myself_ruri() and KSR::COREX.has_ruri_user() < 0 then
KSR::SL.sl_send_reply(200, "Keepalive");
exit
end
if KSR::SANITY.sanity_check(17895, 7) < 0 then
KSR.err("Malformed SIP message from #{KSR::PV.get('$si')}:#{KSR::PV.get('$sp')}\n");
exit
end
end
def ksr_route_withindlg()
return if KSR::SIPUTILS.has_totag() < 0
@ -162,7 +196,7 @@ def ksr_route_auth()
# if caller is not local subscriber, then check if it calls
# a local destination, otherwise deny, not an open relay here
if !KSR.is_myself_furi() && !KSR.is_myself_ruri() then
KSR::SL.sl_send_reply(403,"Not relaying")
KSR::SL.sl_send_reply(403, "Not relaying")
exit
end

@ -20,7 +20,7 @@ local FLAGS = {
// equivalent of request_route{}
function ksr_request_route()
{
// KSR.sl.sl_send_reply(100,"Intelligent trying");
// KSR.sl.sl_send_reply(100, "Intelligent trying");
// KSR.info("===== request - from kamailio SQLang script\n");
// per request initial checks
@ -138,21 +138,22 @@ function ksr_route_reqinit()
local UA = KSR.pv.get("$ua");
// if (sipscanregex.match(UA)) {
if (UA.find("friendly")!=null || UA.find("scanner")!=null
|| UA.find("sipcli")!=null || UA.find("sipvicious")!=null) {
|| UA.find("sipcli")!=null || UA.find("sipvicious")!=null
|| UA.find("VaxSIPUserAgent")!= null || UA.find("pplsip")!= null) {
KSR.sl.sl_send_reply(200, "OK");
KSR.x.exit();
}
}
if (KSR.maxfwd.process_maxfwd(10) < 0) {
KSR.sl.sl_send_reply(483,"Too Many Hops");
KSR.sl.sl_send_reply(483, "Too Many Hops");
KSR.x.exit();
}
if (KSR.is_OPTIONS()
&& KSR.is_myself_ruri()
&& KSR.corex.has_ruri_user() < 0) {
KSR.sl.sl_send_reply(200,"Keepalive");
KSR.sl.sl_send_reply(200, "Keepalive");
KSR.x.exit();
}
@ -169,7 +170,7 @@ function ksr_route_withindlg()
{
if (KSR.siputils.has_totag()<0) { return; }
// sequential request withing a dialog should
// sequential request within a dialog should
// take the path determined by record-routing
if (KSR.rr.loose_route()>0) {
ksr_route_dlguri();
@ -268,7 +269,7 @@ function ksr_route_auth()
// a local destination, otherwise deny, not an open relay here
if ((!KSR.is_myself_furi())
&& (!KSR.is_myself_ruri())) {
KSR.sl.sl_send_reply(403,"Not relaying");
KSR.sl.sl_send_reply(403, "Not relaying");
KSR.x.exit();
}

@ -6,7 +6,7 @@
#
# Direct your questions about this file to: <sr-users@lists.kamailio.org>
#
# Refer to the Core CookBook at http://www.kamailio.org/wiki/
# Refer to the Core CookBook at https://www.kamailio.org/wikidocs/
# for an explanation of possible statements, functions and parameters.
#
# Several features can be enabled using '#!define WITH_FEATURE' directives:
@ -112,28 +112,55 @@ memlog=5
#!ifdef WITH_CFGLUA
log_prefix="LUA {$rm}: "
#!else
#!define KEMIENGINE "lua"
#!define KEMIMODULE "app_lua"
#!define KEMILOAD "/usr/local/etc/kamailio/kamailio-basic-kemi-lua.lua"
#!endif
#!ifdef WITH_CFGPYTHON
log_prefix="PY2 {$rm}: "
#!else
#!define KEMIENGINE "python"
#!define KEMIMODULE "app_python"
#!define KEMILOAD "/usr/local/etc/kamailio/kamailio-basic-kemi-python.py"
#!endif
#!ifdef WITH_CFGPYTHON3
log_prefix="PY3 {$rm}: "
#!else
#!define KEMIENGINE "python"
#!define KEMIMODULE "app_python3"
#!define KEMILOAD "/usr/local/etc/kamailio/kamailio-basic-kemi-python.py"
#!endif
#!ifdef WITH_CFGPYTHON3S
log_prefix="PY8 {$rm}: "
#!define KEMIENGINE "python"
#!define KEMIMODULE "app_python3s"
#!define KEMILOAD "/usr/local/etc/kamailio/kamailio-basic-kemi-python3s.py"
#!endif
#!ifdef WITH_CFGJSDT
log_prefix="JSC {$rm}: "
#!else
#!define KEMIENGINE "jsdt"
#!define KEMIMODULE "app_jsdt"
#!define KEMILOAD "/usr/local/etc/kamailio/kamailio-basic-kemi-jsdt.js"
#!endif
#!ifdef WITH_CFGSQLANG
log_prefix="SQL {$rm}: "
#!else
#!ifdef WITH_CFGJRUBY
log_prefix="RUB {$rm}: "
#!else
log_prefix="NAT {$rm}: "
#!endif
#!endif
#!endif
#!define KEMIENGINE "sqlang"
#!define KEMIMODULE "app_sqlang"
#!define KEMILOAD "/usr/local/etc/kamailio/kamailio-basic-kemi-sqlang.sq"
#!endif
#!ifdef WITH_CFGRUBY
log_prefix="RUB {$rm}: "
#!define KEMIENGINE "ruby"
#!define KEMIMODULE "app_ruby"
#!define KEMILOAD "/usr/local/etc/kamailio/kamailio-basic-kemi-ruby.rb"
#!endif
#!ifndef KEMIENGINE
log_prefix="NAT {$rm}: "
#!endif
latency_cfg_log=2
@ -226,28 +253,8 @@ loadmodule "htable.so"
loadmodule "pike.so"
#!endif
#!ifdef WITH_CFGLUA
loadmodule "app_lua.so"
#!endif
#!ifdef WITH_CFGPYTHON
loadmodule "app_python.so"
#!endif
#!ifdef WITH_CFGPYTHON3
loadmodule "app_python3.so"
#!endif
#!ifdef WITH_CFGJSDT
loadmodule "app_jsdt.so"
#!endif
#!ifdef WITH_CFGRUBY
loadmodule "app_ruby.so"
#!endif
#!ifdef WITH_CFGSQLANG
loadmodule "app_sqlang.so"
#!ifdef KEMIENGINE
loadmodule KEMIMODULE
#!endif
# ----------------- setting module-specific parameters ---------------
@ -381,45 +388,11 @@ modparam("pike", "remove_latency", 4)
modparam("htable", "htable", "ipban=>size=8;autoexpire=300;")
#!endif
#!ifdef WITH_CFGPYTHON
modparam("app_python", "load", "/usr/local/etc/kamailio/kamailio-basic-kemi-python.py")
cfgengine "python"
#!else
#!ifdef WITH_CFGPYTHON3
modparam("app_python3", "load", "/usr/local/etc/kamailio/kamailio-basic-kemi-python.py")
cfgengine "python"
#!else
#!ifdef WITH_CFGLUA
modparam("app_lua", "load", "/usr/local/etc/kamailio/kamailio-basic-kemi-lua.lua")
cfgengine "lua"
#!else
#!ifdef WITH_CFGJSDT
modparam("app_jsdt", "load", "/usr/local/etc/kamailio/kamailio-basic-kemi-jsdt.js")
cfgengine "jsdt"
#!else
#!ifdef WITH_CFGSQLANG
modparam("app_sqlang", "load", "/usr/local/etc/kamailio/kamailio-basic-kemi-sqlang.sq")
cfgengine "sqlang"
#!else
#!ifdef WITH_CFGRUBY
modparam("app_ruby", "load", "/usr/local/etc/kamailio/kamailio-basic-kemi-ruby.rb")
cfgengine "ruby"
#!ifdef KEMIENGINE
modparam(KEMIMODULE, "load", KEMILOAD)
cfgengine KEMIENGINE
#!else
cfgengine "native"
include_file "/usr/local/etc/kamailio/kamailio-basic-kemi-native.cfg"
#!endif
#!endif
#!endif
#!endif
#!endif
#!endif

@ -32,7 +32,7 @@ route{
# filter too old messages
if (!mf_process_maxfwd_header("10")) {
log("LOG: Too many hops\n");
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
break;
};
if (len_gt( max_len )) {
@ -50,7 +50,7 @@ route{
# record-route INVITES to make sure BYEs will visit our server too
if (method=="INVITE") record_route();
# forward the request statefuly now; (we need *stateful* forwarding,
# forward the request statefully now; (we need *stateful* forwarding,
# because the stateful mode correlates requests with replies and
# drops retranmissions; otherwise, we would have to report on
# every single message received)

@ -9,7 +9,7 @@ loadmodule "modules/tm/tm.so"
# ----------------- setting module-specific parameters ---------------
route{
# if we do not get a positive reply, continue at reply_route[2]
# if we do not get a positive reply, continue at failure_route[2]
t_on_failure("2");
# forward the request to all destinations in destination set now
t_relay();

@ -71,7 +71,7 @@ route{
# initial sanity checks -- messages with
# max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
break;
};
if (len_gt( max_len )) {

@ -6,7 +6,7 @@
#
# Direct your questions about this file to: <sr-users@lists.kamailio.org>
#
# Refer to the Core CookBook at https://www.kamailio.org/wiki/
# Refer to the Core CookBook at https://www.kamailio.org/wikidocs/
# for an explanation of possible statements, functions and parameters.
#
@ -201,7 +201,7 @@ request_route {
if ($rU==$null) {
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
sl_send_reply("484", "Address Incomplete");
exit;
}
@ -251,12 +251,12 @@ route[REQINIT] {
}
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
exit;
}
if(is_method("OPTIONS") && uri==myself && $rU==$null) {
sl_send_reply("200","Keepalive");
sl_send_reply("200", "Keepalive");
exit;
}
@ -270,7 +270,7 @@ route[REQINIT] {
route[WITHINDLG] {
if (!has_totag()) return;
# sequential request withing a dialog should
# sequential request within a dialog should
# take the path determined by record-routing
if (loose_route()) {
if (is_method("BYE")) {
@ -296,7 +296,7 @@ route[WITHINDLG] {
exit;
}
}
sl_send_reply("404","Not here");
sl_send_reply("404", "Not here");
exit;
}

@ -6,7 +6,7 @@
#
# Direct your questions about this file to: <sr-users@lists.kamailio.org>
#
# Refer to the Core CookBook at https://www.kamailio.org/wiki/
# Refer to the Core CookBook at https://www.kamailio.org/wikidocs/
# for an explanation of possible statements, functions and parameters.
#
@ -175,7 +175,7 @@ request_route {
if ($rU==$null) {
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
sl_send_reply("484", "Address Incomplete");
exit;
}
@ -215,12 +215,12 @@ route[REQINIT] {
}
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
exit;
}
if(is_method("OPTIONS") && uri==myself && $rU==$null) {
sl_send_reply("200","Keepalive");
sl_send_reply("200", "Keepalive");
exit;
}
@ -234,7 +234,7 @@ route[REQINIT] {
route[WITHINDLG] {
if (!has_totag()) return;
# sequential request withing a dialog should
# sequential request within a dialog should
# take the path determined by record-routing
if (loose_route()) {
if (is_method("BYE")) {
@ -260,7 +260,7 @@ route[WITHINDLG] {
exit;
}
}
sl_send_reply("404","Not here");
sl_send_reply("404", "Not here");
exit;
}

@ -37,8 +37,8 @@ modparam("usrloc", "db_mode", 0)
# -- msilo params --
modparam("msilo","db_url","mysql://user:xxx@127.0.0.1/msilo")
modparam("msilo","registrar","sip:registrar@mydomain.com")
modparam("msilo", "db_url", "mysql://user:xxx@127.0.0.1/msilo")
modparam("msilo", "registrar", "sip:registrar@mydomain.com")
# -- tm params --
@ -50,7 +50,7 @@ modparam("tm", "wt_timer", 10 )
route{
if ( !mf_process_maxfwd_header("10") )
{
sl_send_reply("483","To Many Hops");
sl_send_reply("483", "To Many Hops");
drop();
};
@ -126,7 +126,7 @@ failure_route[1] {
break;
};
log(1,"MSILO: the downstream UA does not support MESSAGE requests ...\n");
log(1, "MSILO: the downstream UA does not support MESSAGE requests ...\n");
# we have changed the R-URI with the contact address -- ignore it now
if (m_store("1"))
{

@ -94,7 +94,7 @@ route{
# initial sanity checks -- messages with
# max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
break;
};
if (msg:len >= max_len ) {
@ -137,7 +137,7 @@ route{
# use different transport protocol
if (!method=="REGISTER") record_route();
# subsequent messages withing a dialog should take the
# subsequent messages within a dialog should take the
# path determined by record-routing
if (loose_route()) {
# mark routing logic in request

@ -38,7 +38,7 @@ route{
# wait until timer hits
seturi("sip:nobody@iptel.org");
append_branch("sip:parallel@iptel.org:9");
# if we do not get a positive reply, continue at reply_route[1]
# if we do not get a positive reply, continue at failure_route[1]
t_on_failure("1");
# forward the request to all destinations in destination set now
t_relay();
@ -47,8 +47,8 @@ route{
failure_route[1] {
# forwarding failed -- try again at another destination
append_branch("sip:nonsense@iptel.org");
log(1,"first redirection\n");
# if this alternative destination fails too, proceed to reply_route[2]
log(1, "first redirection\n");
# if this alternative destination fails too, proceed to failure_route[2]
t_on_failure("2");
t_relay();
}

@ -20,7 +20,7 @@ loadmodule "modules/uri/uri.so"
# ----------------- setting module-specific parameters ---------------
modparam("auth_db", "db_url","mysql://ser:heslo@localhost/ser")
modparam("auth_db", "db_url", "mysql://ser:heslo@localhost/ser")
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")
@ -41,7 +41,7 @@ route{
# filter too old messages
if (!mf_process_maxfwd_header("10")) {
log("LOG: Too many hops\n");
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
break;
};
if (len_gt( max_len )) {

@ -36,7 +36,7 @@ route{
# initial sanity checks -- messages with
# max_forwars==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
break;
};
if (len_gt( max_len )) {

@ -23,7 +23,7 @@ route{
# initial sanity checks -- messages with
# max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
break;
};
if (len_gt( max_len )) {
@ -38,8 +38,7 @@ route{
log(1, "forwarding now to primary destination\n");
if (method=="INVITE") {
rewriteuri("sip:xxx@192.168.2.16:5064");
# if transaction broken, try other an alternative
# route
# if transaction is broken, try an alternative route
t_on_failure("1");
# if a provisional came, stop alternating
t_on_reply("1");

@ -4,7 +4,7 @@
# this example shows usage of ser as user agent
# server which does some functionality (in this
# example, 'log' is used to print a notification
# on a new transaction) and behaves statefuly
# on a new transaction) and behaves statefully
# (e.g., it retransmits replies on request
# retransmissions)

@ -31,7 +31,7 @@ loadmodule "/home/srouter/sip_router/modules/vm/vm.so"
# ----------------- setting module-specific parameters ---------------
modparam("vm", "db_url","mysql://ser:heslo@dbhost/ser")
modparam("vm", "db_url", "mysql://ser:heslo@dbhost/ser")
# ------------------------- request routing logic -------------------
@ -43,7 +43,7 @@ route{
# initial sanity checks -- messages with
# max_forwars==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
break;
};
if (len_gt( max_len )) {
@ -63,23 +63,23 @@ route{
if (!t_newtran()) {
log("could not create new transaction\n");
sl_send_reply("500","could not create new transaction");
sl_send_reply("500", "could not create new transaction");
break;
};
t_reply("100","Trying -- just wait a minute !");
t_reply("100", "Trying -- just wait a minute !");
if(method=="INVITE"){
log("**************** vm start - begin ******************\n");
if(!vm("/tmp/am_fifo","voicemail")){
if(!vm("/tmp/am_fifo", "voicemail")){
log("could not contact the answer machine\n");
t_reply("500","could not contact the answer machine");
t_reply("500", "could not contact the answer machine");
};
log("**************** vm start - end ******************\n");
} else if(method=="BYE"){
log("**************** vm end - begin ******************\n");
if(!vm("/tmp/am_fifo","bye")){
if(!vm("/tmp/am_fifo", "bye")){
log("could not contact the answer machine\n");
t_reply("500","could not contact the answer machine");
t_reply("500", "could not contact the answer machine");
};
log("**************** vm end - end ******************\n");
};

@ -48,7 +48,7 @@ route{
# initial sanity checks -- messages with
# max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
break;
};
if (len_gt( max_len )) {

@ -92,7 +92,7 @@ modparam("acc", "log_level", 1)
# that is the flag for which we will account -- don't forget to
# set the same one :-)
modparam("acc", "acc_flag", 1 )
# we are interested only in succesful transactions
# we are interested only in successful transactions
modparam("acc", "failed_transactions", 0 )
# -- tm params --
@ -112,7 +112,7 @@ route{
log("LOG: Checking maxfwd\n");
if (!mf_process_maxfwd_header("10")) {
log("LOG: Too many hops\n");
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
break;
};

@ -68,7 +68,7 @@ route{
log("Checking maxfwd\n");
if (!mf_process_maxfwd_header("10")) {
log("Too many hops\n");
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
break;
};

@ -59,7 +59,7 @@ route{
log("LOG: Checking maxfwd\n");
if (!mf_process_maxfwd_header("0")) {
log("LOG: Too many hops\n");
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
break;
};
@ -87,7 +87,7 @@ route{
# t_relay();
# t_relay_to("iptel.org","5060");
# t_relay_to("iptel.org", "5060");
# forward( uri:host, uri:port );
# strip(9);
# t_relay_to( "localhost", "9" );

@ -32,12 +32,12 @@ loadmodule "../sip_router/modules/jabber/jabber.so"
# ----------------- setting module-specific parameters ---------------
# -- sms params --
modparam("sms","modems","Falcom [d=/dev/ttyS0;b=9600;p=9254;m=new;l=10;r=2]")
modparam("sms","networks","D1[c=491710765000;m=10]")
modparam("sms","links","Falcom[D1]")
modparam("sms","domain","iptel.org")
modparam("sms","max_sms_parts",3)
modparam("sms","use_contact",1)
modparam("sms", "modems", "Falcom [d=/dev/ttyS0;b=9600;p=9254;m=new;l=10;r=2]")
modparam("sms", "networks", "D1[c=491710765000;m=10]")
modparam("sms", "links", "Falcom[D1]")
modparam("sms", "domain", "iptel.org")
modparam("sms", "max_sms_parts", 3)
modparam("sms", "use_contact", 1)
# -- tm params --
modparam("tm", "fr_timer", 10 )
@ -45,13 +45,13 @@ modparam("tm", "fr_inv_timer", 10 )
modparam("tm", "wt_timer", 10 )
# -- jabber params --
modparam("jabber","db_url","sql://s2jgw:47s2jgw11@127.0.0.1/sip_jab")
modparam("jabber","jaddress","bat.iptel.org")
modparam("jabber","jport",5222)
modparam("jabber","workers",2)
modparam("jabber","max_jobs",10)
modparam("jabber","delay_time",15)
modparam("jabber","cache_time",1800)
modparam("jabber", "db_url", "sql://s2jgw:47s2jgw11@127.0.0.1/sip_jab")
modparam("jabber", "jaddress", "bat.iptel.org")
modparam("jabber", "jport", 5222)
modparam("jabber", "workers", 2)
modparam("jabber", "max_jobs", 10)
modparam("jabber", "delay_time", 15)
modparam("jabber", "cache_time", 1800)
# ------------------------- request routing logic -------------------
@ -64,7 +64,7 @@ route{
log("LOG: Checking maxfwd\n");
if (!mf_process_maxfwd_header("10")) {
log("LOG: Too many hops\n");
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
break;
};
@ -87,13 +87,13 @@ route{
log("MESSAGE received -> sending as JABBER\n");
if (jab_send_message())
{
sl_send_reply("202","Accepted");
sl_send_reply("202", "Accepted");
}else{
sl_send_reply("502","Bad gateway");
sl_send_reply("502", "Bad gateway");
};
}else{
log("NON_Message request received for JABBER gateway->dropt!\n");
sl_send_reply("501","Not implemented");
sl_send_reply("501", "Not implemented");
};
# transaction conclude it -- junk it now (it will
# stay there until WAIT timer hits)
@ -112,14 +112,14 @@ route{
!( uri=~"iptel.org" | uri=~"195\.37\.77\.100" ))
{
log("SER:Forbidden request: wrong src_ip or req_uri\n");
sl_send_reply("403","Forbidden");
sl_send_reply("403", "Forbidden");
break;
};
#accept only MESSAGE requests
if (!method=="MESSAGE")
{
sl_send_reply("501","Not Implemented");
sl_send_reply("501", "Not Implemented");
break;
};

@ -44,7 +44,7 @@ route{
log("LOG: Checking maxfwd\n");
if (!mf_process_maxfwd_header("10")) {
log("LOG: Too many hops\n");
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
break;
};

@ -42,7 +42,7 @@ route{
log("LOG: Checking maxfwd\n");
if (!mf_process_maxfwd_header("10")) {
log("LOG: Too many hops\n");
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
break;
};

@ -61,7 +61,7 @@ route{
log("Checking maxfwd\n");
if (!mf_process_maxfwd_header("10")) {
log("Too many hops\n");
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
break;
};
@ -204,12 +204,12 @@ route{
}else{
if ( cpl_is_response_reject() ) {
log("SER: reject");
sl_send_reply("603","I am not available!");
sl_send_reply("603", "I am not available!");
break;
}else if ( cpl_is_response_redirect() ) {
log("SER : redirect\n");
cpl_update_contact();
sl_send_reply("302","Moved temporarily");
sl_send_reply("302", "Moved temporarily");
break;
};
};

@ -53,7 +53,7 @@ route{
# log("LOG: Checking maxfwd\n");
# if (!mf_process_maxfwd_header("0")) {
# log("LOG: Too many hops\n");
# sl_send_reply("483","Too Many Hops");
# sl_send_reply("483", "Too Many Hops");
# break;
# };

@ -33,12 +33,12 @@ loadmodule "../sip_router/modules/sms/sms.so"
# ----------------- setting module-specific parameters ---------------
# -- sms params --
modparam("sms","modems","Falcom [d=/dev/ttyS0;b=9600;p=9254;m=new;l=10;r=2]")
modparam("sms","networks","D1[c=491710765000;m=10]")
modparam("sms","links","Falcom[D1]")
modparam("sms","domain","iptel.org")
modparam("sms","max_sms_parts",3)
modparam("sms","use_contact",1)
modparam("sms", "modems", "Falcom [d=/dev/ttyS0;b=9600;p=9254;m=new;l=10;r=2]")
modparam("sms", "networks", "D1[c=491710765000;m=10]")
modparam("sms", "links", "Falcom[D1]")
modparam("sms", "domain", "iptel.org")
modparam("sms", "max_sms_parts", 3)
modparam("sms", "use_contact", 1)
# -- tm params --
@ -62,7 +62,7 @@ route{
log("LOG: Checking maxfwd\n");
if (!mf_process_maxfwd_header("10")) {
log("LOG: Too many hops\n");
sl_send_reply("483","Too Many Hops");
sl_send_reply("483", "Too Many Hops");
break;
};
@ -71,14 +71,14 @@ route{
!( uri=~"iptel.org" | uri=~"195\.37\.77\.100" ))
{
log("SER:Forbidden request: wrong src_ip or req_uri\n");
sl_send_reply("403","Forbidden");
sl_send_reply("403", "Forbidden");
break;
};
#accept only MESSAGE requests
if (!method=="MESSAGE")
{
sl_send_reply("501","Not Implemented");
sl_send_reply("501", "Not Implemented");
break;
};

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save