New upstream version 5.8.1

mr12.4 upstream/5.8.1
Victor Seva 2 years ago
parent 4abdbda9f9
commit bedfb412c1

@ -1,4 +1,7 @@
---
Language: Json
BasedOnStyle: llvm
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -4
@ -87,4 +90,3 @@ Standard: Cpp11
TabWidth: 4
UseTab: Always
...

@ -0,0 +1,17 @@
FROM mcr.microsoft.com/devcontainers/base:bookworm
# utils packages
RUN apt-get update && \
export DEBIAN_FRONTEND=noninteractive && \
apt-get -y install --no-install-recommends \
apt-utils dialog clang-format clang pbuilder
# bookworm packaging
RUN mkdir -p /usr/local/src/pkg
COPY bookworm /usr/local/src/pkg/debian
# get build dependences
RUN cd /usr/local/src/pkg/ && \
/usr/lib/pbuilder/pbuilder-satisfydepends-experimental
# clean
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

@ -0,0 +1,38 @@
{
/* For format details, see https://aka.ms/devcontainer.json. For config options, see the
* README at: https://github.com/devcontainers/templates/tree/main/src/debian
*/
"name": "Debian",
"build": {
"cacheFrom": "ghcr.io/kamailio/kamailio-5.8-devcontainer",
"context": "../pkg/kamailio/deb",
"dockerfile": "Dockerfile"
},
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/wxw-matt/devcontainer-features/command_runner:0": {},
"ghcr.io/devcontainers/features/github-cli:1": {}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
5060
],
// Configure tool-specific properties.
"customizations": {
"vscode": {
"settings": {},
"extensions": [
"ms-vscode.cpptools-extension-pack",
"GitHub.vscode-github-actions",
"eamodio.gitlens",
"xaver.clang-format"
]
}
},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
"remoteUser": "root"
}

@ -0,0 +1,14 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: check-xml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-merge-conflict
- id: mixed-line-ending
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v15.0.7
hooks:
- id: clang-format

@ -0,0 +1,2 @@
# workflows changes need admin approval
.github/workflows/ @kamailio/admin

18786
ChangeLog

File diff suppressed because it is too large Load Diff

@ -155,7 +155,7 @@ OS Notes:
Solaris 10
----------
As above; you can use Solaris's yacc instead of bison. You might also
As above; you can use Solaris' yacc instead of bison. You might also
need gtar and ginstall. If you don't have ginstall you can use Solaris
install, just make sure it's in the PATH (it's usually in /usr/sbin) and
add INSTALL=install either to the environment or to the make command line

@ -1,6 +1,6 @@
Kamailio v5.7
Kamailio v5.8
=============
https://www.kamailio.org

@ -2,6 +2,7 @@
[![Build Status](https://github.com/kamailio/kamailio/actions/workflows/main.yml/badge.svg)](https://github.com/kamailio/kamailio/actions)
[![Code Triage Badge](https://www.codetriage.com/kamailio/kamailio/badges/users.svg)](https://www.codetriage.com/kamailio/kamailio)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
Project Website:
@ -100,13 +101,6 @@ For more information about the mailing lists, please see:
* https://www.kamailio.org/w/mailing-lists/
### IRC Channel
An open IRC discussion channel is managed by the community:
* irc server: irc.freenode.net
* irc channel: #kamailio
### Matrix Channel
An open Matrix discussion channel is managed by the community:
@ -121,9 +115,4 @@ News:
* https://www.kamailio.org/w/category/news/
* Twitter @kamailio
## Travis-CI - Testing Build Environment
* [travis-ci](https://travis-ci.org/kamailio/kamailio/builds/)
* [docker build](/test/travis/README.md)
**Thank you for flying Kamailio!**

@ -20,7 +20,7 @@
<!-- Try the system wide catalogs as the last step before reverting to
using the value of system identifiers and URI references from the
documents being processed (they usualy contain HTTP URIs). -->
documents being processed (they usually contain HTTP URIs). -->
<delegatePublic publicIdStartString="" catalog="file:///etc/xml/catalog"/>
<delegateURI uriStartString="" catalog="file:///etc/xml/catalog"/>

@ -66,7 +66,7 @@
in this step. -->
<xsl:value-of select="concat($fullpath, ' ')"/>
<!-- Traverse the file being included and search for more depencencies
<!-- Traverse the file being included and search for more dependencies
in that file and other files included from there. -->
<xsl:apply-templates select="document(@href)" mode="subroot">
<!-- Extract the directory name from $fullpath and set it as a new
@ -106,6 +106,6 @@
<xsl:text> </xsl:text>
</xsl:template>
<!-- Supress all other output -->
<!-- Suppress all other output -->
<xsl:template match="text()|@*" mode="subroot"/>
</xsl:stylesheet>

@ -19,9 +19,9 @@
<!ENTITY kamailiohome "https://www.kamailio.org/">
<!ENTITY kamailiobugs "https://github.com/kamailio/kamailio/issues">
<!ENTITY kamailiohelp "https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">
<!ENTITY kamailiousers "https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">
<!ENTITY kamailiodev "https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev">
<!ENTITY kamailiohelp "https://lists.kamailio.org/mailman3/postorius/lists/sr-users.lists.kamailio.org/">
<!ENTITY kamailiousers "https://lists.kamailio.org/mailman3/postorius/lists/sr-users.lists.kamailio.org/">
<!ENTITY kamailiodev "https://lists.kamailio.org/mailman3/postorius/lists/sr-dev.lists.kamailio.org/">
<!ENTITY kamailiodbdocs "https://www.kamailio.org/docs/db-tables/kamailio-db-devel.html">
<!ENTITY kamailiohomelink "<ulink url='&kamailiohome;'>&kamailiohome;</ulink>">
@ -54,8 +54,8 @@
<!ENTITY serhome "https://www.kamailio.org">
<!ENTITY serbugs "https://github.com/kamailio/kamailio/issues">
<!ENTITY serusers "https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">
<!ENTITY serdev "https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev">
<!ENTITY serusers "https://lists.kamailio.org/mailman3/postorius/lists/sr-users.lists.kamailio.org/">
<!ENTITY serdev "https://lists.kamailio.org/mailman3/postorius/lists/sr-dev.lists.kamailio.org/">
<!ENTITY serhomelink "<ulink url='&serhome;'>&serhome;</ulink>">
<!ENTITY serbugslink "<ulink url='&serbugs;'>&serbugs;</ulink>">

@ -5,7 +5,7 @@
<!-- Generate chunked output when building all the documentation -->
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk.xsl"/>
<!-- Commmon XHTML customization -->
<!-- Common XHTML customization -->
<xsl:import href="html.common.xsl"/>
<!-- Chunking -->

@ -16,7 +16,7 @@
* The documentation can be generated using doxygen by running "make doxygen"
*
* \section Other information
* If you want other informaiton about Kamailio, please visit http://www.kamailio.org
* If you want other information about Kamailio, please visit https://www.kamailio.org
*
* \section License Kamailio license
* Kamailio is free software; you can redistribute it and/or modify

@ -36,7 +36,7 @@ see
.PP
Full documentation on kamailio, including configuration guidelines, FAQs and
licensing conditions, is available at
.I http://kamailio.org.
.I https://kamailio.org.
.PP
For reporting bugs see
.I

@ -6,7 +6,7 @@
This is a short ser history based mainly on my memory and my old mail archive. I've tried to mention only the important events. I'm sure I have missed a lot of things and/or people. If this is your case, please don't feel offended, send me an email and I will straighten things up.
Three years ago on 4 September 2001 I committed the first working ser version on a private cvs. In fact I started writting ser 2 days before, on 2nd September.
Three years ago on 4 September 2001 I committed the first working ser version on a private cvs. In fact I started writing ser 2 days before, on 2nd September.
I was supposed to write some kind of sip glue for a Cisco PSTN gateway in 1 week, but of course I did it in the last 2 days :-)
At that time the config looked like:
@ -20,7 +20,7 @@ At that time the config looked like:
A short time after this Jiri began testing the code and requesting new features.2 weeks later I completely changed the config format bringing it pretty close to what we have today. At the time Jiri stronlgy disagreed with the ideea arguing that the new config would increase code complexity too much and would severely
impact performance. The final argument was: I already wrote the code and it works :-)
In Octomber 2001 I made some changes to ser routing language bringing it to what we still use today.
In October 2001 I made some changes to ser routing language bringing it to what we still use today.
In the next months I've created the module interface, the first two modules (print and textops) and I've added the shared memory support (this involved the creation of ser's own malloc library which proved to be much faster for ser's memory usage patterns than standards malloc implementations).
During the same period Bogdan and Jan joined me and Jiri also began writing code.
In December 2001 Bogdan announced that tm was up and running (after a sleepless night).
@ -28,12 +28,12 @@ At the beginning of 2002 we were joined by Daniel. Jan introduced the mysql, usr
Ser first public appearance was at the April 2002 Sipit. We ran it on a pda an still managed to be faster than the testing tools that were used against us :-)
In May 2002 ser got ipv6 support.
In August 2002 Nils commited sipsak to berlios (very useful testing tool).
In August 2002 Nils committed sipsak to berlios (very useful testing tool).
In September 2002 ser went public: it was GPL'ed and the cvs tree was moved to berlios. During the same month Jiri introduced the FIFO interface, Karel committed serweb and we had the first GPL'ed release: ser 0.8.8.
In December 2002 ser got its first big external contribution: the enum module, written by Juha Heinanen.
In January 2003 Raphael commited sems on berlios.
In January 2003 Raphael committed sems on berlios.
In February 2003 ser got tcp support.
Sometime during the 2003 spring ser got the permissions module from Miklos Tirpak and nathelper from Maxim Sobolev.
In August 2003, Uli commited isdngw to sems.
In August 2003, Uli committed isdngw to sems.
All the rest is too new to be in the history :-)

@ -69,7 +69,7 @@ new config variables:
udp4_raw can be used on Linux and FreeBSD. For other BSDs and Darwin
one must compile with -DUSE_RAW_SOCKS.
On Linux one should also set udp4_raw_mtu if the MTU on any network
interface that could be used for sending is smaller then 1500.
interface that could be used for sending is smaller than 1500.
Can be set at runtime as long as sr was started with enough privileges
(core.udp4_raw).
- udp4_raw_mtu - MTU value used for UDP IPv4 packets when udp4_raw is
@ -215,7 +215,7 @@ core:
defined expr - returns true if expr is defined, and false if not.
Note: only a standalone avp or pvar can be
undefined, everything else is defined.
strlen(expr) - returns the lenght of expr evaluated as string.
strlen(expr) - returns the length of expr evaluated as string.
strempty(expr) - returns true if expr evaluates to the empty
string (equivalent to expr=="").
e.g.: if (defined $v && !strempty($v)) $len=strlen($v);
@ -374,7 +374,7 @@ modules:
- t_relay_to renamed to t_relay_to_avp (undocumented function)
- t_relay() can now also take host and port parameters (e.g.
t_relay(host, port)), behaving like a statefull
forwad(host, port) version (forward to host:port using the same
forward(host, port) version (forward to host:port using the same
protocol on which the message was received)
- t_relay_to_udp(), t_relay_to_tcp() and t_relay_to_tls() work
now even with no parameters: in this case the message is
@ -400,7 +400,7 @@ modules:
reply arrives on such a branch
- noisy_ctimer is now 1 (on) by default
- added maximum transaction lifetime - a transaction is not
allowed to be active longer then this interval. See
allowed to be active longer than this interval. See
t_set_max_lifetime(), max_inv_lifetime and max_noninv_lifetime.
- support for changing the retransmission intervals on the fly,
on a per transaction basis (it is enabled if tm is compiled
@ -497,7 +497,7 @@ core:
(can be changed at runtime, e.g.
sercmd cfg.set_now_int tcp connection_lifetime 180 )
- fallback to tcp or other congestion controlled transport
protocol if a forwarded udp sip request is greater then
protocol if a forwarded udp sip request is greater than
udp_mtu (config). Default off. See udp_mtu and
udp_mtu_try_proto.
- sctp support (one-to-many, work in progress, for now linux
@ -528,7 +528,7 @@ new config variables:
maximum datagram size that can be received over tcp.
Default: 4096, can be changed at runtime.
tcp_wq_blk_size = block size used for tcp async writes. It should be big
enough to hold a few datagrams. If it's smaller then a
enough to hold a few datagrams. If it's smaller than a
datagram (in fact a tcp write()) size, it will be rounded
up. It has no influenced on the number of datagrams
queued (for that see tcp_conn_wq_max or tcp_wq_max).
@ -539,7 +539,7 @@ new config variables:
Default: no, can be changed at runtime.
udp_mtu = number - fallback to another protocol (udp_mtu_try_proto must be
set also either globally or per packet) if the constructed
request size is greater then udp_mtu.
request size is greater than udp_mtu.
Recommended size: 1300. Default: 0 (off).
udp_mtu_try_proto = TCP|TLS|SCTP|UDP - if udp_mtu !=0 and udp forwarded
request size (after adding all the "local" headers) >
@ -618,17 +618,17 @@ new config variables:
associations.
sctp_srto_max = milliseconds - maximum value of the retransmission timeout
(RTO) (default: OS specific).
WARNING: values lower then the sctp sack_delay will cause lots of
WARNING: values lower than the sctp sack_delay will cause lots of
retransmissions and connection instability (see sctp_srto_min for more
details).
Can be changed at runtime (sctp srto_max) but it will affect only new
associations.
sctp_srto_min = milliseconds - minimum value of the retransmission timeout
(RTO) (default: OS specific).
WARNING: values lower then the sctp sack_delay of any peer might cause
WARNING: values lower than the sctp sack_delay of any peer might cause
retransmissions and possible interoperability problems. According to the
standard the sack_delay should be between 200 and 500 ms, so avoid trying
values lower then 500 ms unless you control all the possible sctp peers
values lower than 500 ms unless you control all the possible sctp peers
and you do make sure their sack_delay is higher or their sack_freq is 1.
Can be changed at runtime (sctp srto_min) but it will affect only new
associations.
@ -653,8 +653,8 @@ new config variables:
associations.
sctp_sack_delay = milliseconds - delay until an ACK is generated after
receiving a packet. Default: OS specific.
WARNING: a value higher then srto_min can cause a lot of retransmissions
(and strange problems). A value higher then srto_max will result in very
WARNING: a value higher than srto_min can cause a lot of retransmissions
(and strange problems). A value higher than srto_max will result in very
high connections instability. According to the standard the sack_delay
value should be between 200 and 500 ms.
Can be changed at runtime (sctp sack_delay) but it will affect only new
@ -891,7 +891,7 @@ core:
- default log level switched to 0 (only messages < L_WARN will be printed
by default)
- separate memdbg log level which controls the memory/malloc related
debug messages (to see them ser must be compiled with malloc debuging:
debug messages (to see them ser must be compiled with malloc debugging:
-DDBG_QM_MALLOC or -DDBG_FM_MALLOC and memdbg must be <= debug )
- added named routes: names can be used instead of numbers in all the
route commads or route declarations. route(number) is equivalent to
@ -915,7 +915,7 @@ core:
a route reaches its end without executing a return statement, it returns 1.
If return is used in the top level route is equivalent with exit [val].
- drop /exit [n] now will end the script execution
exit n will exit with code n (usefull in onreply/onsend routes where
exit n will exit with code n (useful in onreply/onsend routes where
if script code !=0 a reply is generated/the message is sent or to force
script errors)
- added $? which can be used to check the return code of the last executed
@ -956,14 +956,14 @@ core:
(see below dns_* and man resolv.conf(6)).
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.
If dns_try_ipv6 is yes, multiply it again by 2.
The fastest possible dns config (max 1s):
dns_try_ipv6=no
dns_retr_time=1
dns_retr_no=1
dns_use_search_list=no
- default on reply route added: onreply_route {.. } will add a default
onreply route that will be executed for any reply (usefull to catch
onreply route that will be executed for any reply (useful to catch
replies without using tm)
- branch_routes added (tm triggered), only a very limited number of commands
are available (see tm docs)
@ -1013,7 +1013,7 @@ new config variables:
fact search "" (so even if the search list is empty/missing there will
still be 2 dns queries, eg. foo+'.' and foo+""+'.')
tcp_connection_lifetime = value (s) - how long the lifetime of a
tcp connection will be exteneded after an IO event (accept, connect,
tcp connection will be extended after an IO event (accept, connect,
read, write). Default: 120 s.
tcp_poll_method = poll|select|sigio_rt|epoll_et|epoll-lt|kqueue|devpoll -
poll method used (by default the best one for the current OS is selected)
@ -1040,7 +1040,7 @@ WARNING: - older 0.10.99-dev version (< 0.10.99-dev46) returned a 480 reply
general:
- gcc 4.0 support
- mutlicast options are set for all the sockets
- multicast options are set for all the sockets
- mediaproxy: memory leak, unchecked memory allocations
- postgress: some bugs and cleanups (compiles cleanly now)
- tm: shm cloned lumps (SER-55)
@ -1084,7 +1084,7 @@ modules:
- TM has a new parameter: restart_fr_on_each_reply. If set (default)
fr_inv timer will be restarted for each provisional reply, if not set
it will be restarted only for the first reply and for replies >=180
(but only if increasing, eg.: 180, 181 ...). Usefull when dealing with bad
(but only if increasing, eg.: 180, 181 ...). Useful when dealing with bad
UAs that re-transmit 180s.
- TM saves the avp list into transactions, and make it available into
callbacks, failure and reply routes.
@ -1096,7 +1096,7 @@ modules:
email value from DB (as VM), TM looks for the "email" attribute to get the
value.
vm() function was replaced with t_write_req()
vm_reply() fifo functions was replcated by TM with t_reply() fifo function
vm_reply() fifo functions was replaced by TM with t_reply() fifo function
NOTE!! because current version of SEMS/AA try to send reply via vm_reply,
it will not work with the TM version.
- xlog - printing the body of any header by specifying the name; new
@ -1106,7 +1106,7 @@ modules:
new modules:
- avp / avp_db / avp_radius - load and check avps per caller or callee
- avpops - flexible module for operations with avps and database, introducing
a pseudo-varible support in SER configuration file
a pseudo-variable support in SER configuration file
- cpl-c - implementation of Call Processing Language
- dispatcher - implements a dispatcher for incoming requests using hashes
over parts of the request to select the destination
@ -1143,7 +1143,7 @@ core:
- avp (Attribute-Value Pair) support added
- avp alias support added
- multicast support added (see mcast_loopback & mcast_ttl)
- saving of procces group id enabled, if the -G option is specified
- saving of process group id enabled, if the -G option is specified
(a safe way to quickly kill all ser processes)
- core dump-ing is enabled by default, see also disable_core_dump
- protocol and port can be specified in the alias and listen lines, e.g.:
@ -1196,7 +1196,7 @@ core:
log_facility = LOG_LOCAL0
if ser logs to syslog, you can control the facility for logging. Very
useful when you want to divert all ser logs to a different log file.
See man page syslog(3) for more detailes.
See man page syslog(3) for more details.
unix_sock = "/tmp/ser.sock"
The name of the socket the unixsock server should listen on.
unix_sock_children = 1
@ -1212,7 +1212,7 @@ core:
force_tcp_alias()
force_tcp_alias(port)
adds a tcp port alias for the current connection (if tcp).
Usefull if you want to send all the trafic to port_alias through
Useful if you want to send all the traffic to port_alias through
the same connection this request came from [it could help
for firewall or nat traversal].
With no parameters adds the port from the message via as the alias.
@ -1288,7 +1288,7 @@ auth_db:
Bug fixes
=========
- memory leak in digest credentials parser fixed
- authenticathion ha1 didn't include domain if username was of the form
- authentication ha1 didn't include domain if username was of the form
user@domain and calculate_ha1 was set to yes (modules/auth_db)
- tm reply processing race condition (modules/tm), special thanks go to
Dong Liu
@ -1355,7 +1355,7 @@ Changes to use of ser scripts
About Multiple Transport Support
--------------------------------
SER now suports multiple transport protocols: UDP and TCP. As there
SER now supports multiple transport protocols: UDP and TCP. As there
may be UAs which support only either protocol and cannot speak to
each other directly, we recommend to alway record-route SIP requests,
to keep the transport-translating SER in path. Also, if a destination
@ -1390,7 +1390,7 @@ auth module:
authentication
- auth_radius contains functions needed for radius authentication
- group module contains group membership checking functions
- group_radius contains radius group membeship checking functions
- group_radius contains radius group membership checking functions
- is_in_group has been renamed to is_user_in and places to groups
module
- check_to and check_from have been moved to the uri module
@ -1404,7 +1404,7 @@ exec module:
------------
- exec_uri and exec_user have been obsoleted by exec_dset;
exec_dset is identical to exec_uri in capabilities; it
additionaly passes content of request elements (header
additionally passes content of request elements (header
fields and URI parts) in environment variables; users of
exec_user can use exec_dset now and use the "URI_USER"
variable to learn user part of URI
@ -1444,7 +1444,7 @@ rr module:
- a new option, "enable_full_lr" can be set to make life
with misimplemented UAs easier and put LR in from "lr=on"
- rr module can insert two Record-Route header fields when
necesarry (disconnected networks, UDP->TCP and so on)
necessary (disconnected networks, UDP->TCP and so on)
tm module:
----------

@ -21,7 +21,7 @@ x [mem] investigate: keep an used/unused flag per fragment, on free
check if neighboring frags were not used and if so defragment
- [timer] multiple timers? at least ticks should no be affected by the amount
of work done in the timer handlers
- [tcp] ser intiated tcp connections use INADDR_ANY (they should be bound first
- [tcp] ser initiated tcp connections use INADDR_ANY (they should be bound first
to some ip/port ?function of the dest?)
- [tcp] need to confirm fd receipt after send_fd, before closing it (this might
happen in tcp_send new conn.) (see FreeBSD send BUGS for more info)
@ -65,7 +65,7 @@ x extend listen and alias to include port numbers and protocol:
tcp foo.bar:5063, udp foo.bar:5062, foo2.bar
x added set_advertised_{address,port} -- was: add force_via, force_srcip a.s.o
(the advertised addresses should be overwritable from the script).
x ? add force_outbound_socket(ip)? (choose an apropriate socket from the
x ? add force_outbound_socket(ip)? (choose an appropriate socket from the
listen list for sending the msg; works on udp only)
release:
@ -102,7 +102,7 @@ not so critical:
x replace remaining mallocs/frees at least in msg_translator.c
- add $(INCLUDES) to the Makefiles
x make ser suncc ready
- fix parse_cseq!!! (it doesnt parse 1234\n INVITE a.s.o)
- fix parse_cseq!!! (it doesn't parse 1234\n INVITE a.s.o)
x fix 0 parameter module f. call
x better Via parsing (handle ' ' in uri, eg: foo.bar : 1234 ; received=) and
ipv6 addresses ([fec0:aa::01]).
@ -148,7 +148,7 @@ x command line switch for checking the config file syntax
- config file version (a la sendmail)
0 loop detection
- cfg. file reload
- flags for using names or ip adresses in Via ?
- flags for using names or ip addresses in Via ?
- escape char injection/printing fix (verify all log/printed messages
for terminal escapes and remove them)
@ -202,7 +202,7 @@ tm optimizations:
- inline/macro/drop for: get_tm_table, set_kr, lock_hash, unlock_hash,
set_t, get_t
- replace snprintfs int build_uac_request, *_dlg
- fix the huge param no. in this functions (use structs if neccessary):
- fix the huge param no. in this functions (use structs if necessary):
build_uac_request, build_uac_request_dlg, t_uac, t_uac_dlg
- uri2proxy - t_uac_dlg => extra malloc/free (no üroxy needed here)

@ -3,8 +3,8 @@ Kamailio git commit rules
1. Changing other people's code:
--------------------------------
- send a patch to the code/module mantainer and/or sr-dev
(don't commit changes to code you don't own if you don't have the mantainer's approval)
- send a patch to the code/module maintainer and/or sr-dev
(don't commit changes to code you don't own if you don't have the maintainer's approval)
Exceptions:
a. compilation (this includes warning) fixes
b. bug fixes
@ -25,4 +25,4 @@ Exceptions:
linux, freebsd, netbsd, openbsd, solaris >= 8; x86, ultrasparc, strongarm;
gcc 4.x, icc, sun cc >=5.3). It should also compile on gcc 2.95 and 3.x.
- the code must be tested or the change trivial enough
- the code should compile without warnings on all the arhitectures (with some exceptions)
- the code should compile without warnings on all the architectures (with some exceptions)

@ -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_WORKAROUND -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_NAPT -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" ;

@ -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_WORKAROUND -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_NAPT -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" ;

@ -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_WORKAROUND -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 -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;

@ -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_WORKAROUND -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_NAPT -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;

@ -64,7 +64,7 @@
<!-- Try the system wide catalogs as the last step before reverting
to using the value of system identifiers and URI references
from the documents being processed (they usualy contain HTTP
from the documents being processed (they usually contain HTTP
URIs).
-->
<delegatePublic publicIdStartString="" catalog="file:///etc/xml/catalog"/>

@ -114,8 +114,8 @@
<xsl:apply-templates select="version"/>
<!-- this is not exactly what we want for db_berkeley, as the version data gets
appended to the actual table file, and no to the 'version' table.
But its not possible (at least with XSL 1.0, AFAIK) to append data to a
file. So it's much more easier to do this in the Makefile -->
But it is not possible (at least with XSL 1.0, AFAIK) to append data to a
file. So it's much easier to do this in the Makefile -->
</xsl:document>
</xsl:template>

@ -46,8 +46,8 @@
<xsl:apply-templates select="version"/>
<!-- this is not exactly what we want for dbtext, as the version data gets
appended to the actual table file, and no to the 'version' table.
But its not possible (at least with XSL 1.0, AFAIK) to append data to a
file. So it's much more easier to do this in the Makefile -->
But it is not possible (at least with XSL 1.0, AFAIK) to append data to a
file. So it's much easier to do this in the Makefile -->
</xsl:document>
</xsl:template>

@ -46,8 +46,8 @@
<xsl:apply-templates select="version"/>
<!-- this is not exactly what we want for dbtext, as the version data gets
appended to the actual table file, and no to the 'version' table.
But its not possible (at least with XSL 1.0, AFAIK) to append data to a
file. So it's much more easier to do this in the Makefile -->
But it is not possible (at least with XSL 1.0, AFAIK) to append data to a
file. So it's much easier to do this in the Makefile -->
</xsl:document>
</xsl:template>

@ -138,7 +138,7 @@
<xsl:if test="autoincrement">
<xsl:text> AUTO_INCREMENT</xsl:text>
</xsl:if>
<!-- PRIMARY KEY column defintion -->
<!-- PRIMARY KEY column definition -->
<xsl:if test="primary">
<xsl:text> PRIMARY KEY</xsl:text>
</xsl:if>

@ -39,7 +39,7 @@
</xsl:variable>
<xsl:text>&#x9;&lt;!-- </xsl:text>
<xsl:value-of select="$table.name"/>
<xsl:text> provisionning --&gt;&#xa;</xsl:text>
<xsl:text> provisioning --&gt;&#xa;</xsl:text>
<xsl:text>&#x9;&lt;mod&gt;&lt;mod_name&gt;</xsl:text>
<xsl:value-of select="$table.name"/>
<xsl:text>&lt;/mod_name&gt;&#xa;</xsl:text>

@ -72,7 +72,7 @@ c_defs=-DNAME='\"kamailio\"' -DVERSION='\"5.1.0-dev3\"' -DARCH='\"x86_64\"' \
-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 \
-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 \

@ -66,7 +66,7 @@ c_defs=-DNAME='\"kamailio\"' -DVERSION='\"5.1.0-dev3\"' -DARCH='\"x86_64\"' \
-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 \
-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 \

@ -283,7 +283,7 @@ route[RR]
# use different transport protocol
# if the initial INVITE got the ACC flag store this in
# an RR AVP cookie. this is more for demonstration purpose
# an RR AVP cookie. This is more for demonstration purpose
if (isflagset(FLAG_ACC)) {
$account = "yes";
setavpflag($account, "dialog_cookie");

@ -18,7 +18,7 @@ more information see <xref linkend="pres.known_problems"/>.
</section>
<section id="pres.dependencies"><title>Dependencies</title>
<para>Presence module dependecies may be found in sections <link
<para>Presence module dependencies may be found in sections <link
linkend="pa.dependencies">PA module dependencies</link> and <link
linkend="rls.dependencies">RLS module dependencies</link>. These modules depend
on common libraries which have their own dependencies as mentioned below.

@ -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 a database too.</para>
clients don't notice 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.
@ -85,7 +85,7 @@ rules may be found in <xref linkend="pres_draft_common_auth"/> and
<para>Only XCAP storage of authorization rules is supported at this moment. It is
<emphasis>not fully implemented</emphasis> now - only basic rule conditions, no sphere
and time conditions. Transformations defined in <xref linkend="pres_draft_auth"/> are
ignored. Maybe, that in the
ignored. Maybe, in the
future it will be possible to use other variants like webdav or storing
authorization rules in SIP-router's own database.</para>

@ -139,7 +139,7 @@ c_defsX=-DNAME='\"kamailio\"' -DVERSION='\"5.1.0-dev3\"' -DARCH='\"x86_64\"' \
-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 \
-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 \

@ -68,7 +68,7 @@ c_defs=-DNAME='\"kamailio\"' -DVERSION='\"5.1.0-dev3\"' -DARCH='\"x86_64\"' \
-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 \
-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 \

@ -259,7 +259,7 @@
route statement.
</para>
<para>
As we have mentioned already, there can be more that one
As we have mentioned already, there can be more than one
route statement in the config file. One of them is main
(without number), the other are additional. This command
makes it possible to execute an additional route statement.

@ -32,7 +32,7 @@ usage:
serctl mail &lt;username&gt; .................... send an email to a user
serctl alias show [&lt;alias&gt;] ............... show aliases
serctl alias rm &lt;alias&gt; ................... remove an alias
serctl alias add &lt;alias&gt; &lt;uri&gt; ............ add an aliases
serctl alias add &lt;alias&gt; &lt;uri&gt; ............ add an alias
* access control lists *
serctl acl show [&lt;username&gt;] .............. show user membership

@ -1,6 +1,6 @@
#!KAMAILIO
#
# Kamailio SIP Server v5.7 - default configuration script
# Kamailio SIP Server v5.8 - default configuration script
# - web: https://www.kamailio.org
# - git: https://github.com/kamailio/kamailio
#
@ -220,6 +220,14 @@ enable_tls=yes
/* upper limit for TLS connections */
tls_max_connections=2048
/* For OpenSSL 3 integration
* functions calling libssl3 can be invoked in a transient thread
* 0: disable threaded calls
* 1: use thread executors for process#0 only
* 2: no thread executors, but use atfork handler to reset thread-locals to NULL
* 3: use thread executors for all processes */
tls_threads_mode=1
#!endif
/* set it to yes to enable sctp and load sctp.so module */
@ -257,6 +265,12 @@ voicemail.srv_port = "5060" desc "VoiceMail Port"
/* set paths to location of modules */
# mpath="/usr/local/lib/kamailio/modules/"
# when using TLS with OpenSSL it is recommended to load this module
# first so that OpenSSL is initialized correctly
#!ifdef WITH_TLS
loadmodule "tls.so"
#!endif
#!ifdef WITH_MYSQL
loadmodule "db_mysql.so"
#!endif
@ -319,10 +333,6 @@ loadmodule "rtpproxy.so"
#!endif
#!endif
#!ifdef WITH_TLS
loadmodule "tls.so"
#!endif
#!ifdef WITH_HTABLE
loadmodule "htable.so"
#!endif

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

@ -2,7 +2,7 @@
Project Website:
* http://www.kamailio.org
* https://www.kamailio.org
## Database Structure

@ -1,10 +1,10 @@
#!KAMAILIO
#
# This config file implements the basic I-CSCF functionality
# - web: http://www.kamailio.org
# - web: https://www.kamailio.org
# - git: http://sip-router.org
#
# Refer to the Core CookBook at http://www.kamailio.org/dokuwiki/doku.php
# Refer to the Core CookBook at https://www.kamailio.org/w/documentation/
# for an explanation of possible statements, functions and parameters.
#
# Direct your questions about this file to: <sr-users@lists.kamailio.org>.

@ -2,7 +2,7 @@
Project Website:
* http://www.kamailio.org
* https://www.kamailio.org
## Database Structure

@ -2,10 +2,10 @@
# TelcoSuite (V3) Proxy-CSCF
#
# Kamailio SIP Server
# - web: http://www.kamailio.org
# - web: https://www.kamailio.org
# - git: http://sip-router.org
#
# Refer to the Core CookBook at http://www.kamailio.org/dokuwiki/doku.php
# Refer to the Core CookBook at https://www.kamailio.org/w/documentation/
# for an explanation of possible statements, functions and parameters.
#

@ -1,4 +1,4 @@
# IP-Adress for incoming SIP-Traffic, in the following format:
# IP-Address for incoming SIP-Traffic, in the following format:
# SIP / UDP
listen=udp:0.0.0.0:5060

@ -1,5 +1,5 @@
######################################################################
# Originating, Intial Requests
# Originating, Initial Requests
######################################################################
route[MO]
{

@ -446,7 +446,7 @@ use_default_signature=yes
# optional parameter: unhandled_reply_loglevel={error|warn|info|debug|no}
#
# the default application logic implemented in the applications is to stop
# the session right after sending BYE, without waiting for a reply. this
# the session right after sending BYE, without waiting for a reply. This
# leads to many log entries of the form
# ERROR: [b6fa6bb0] handleSipMsg (AmSipDispatcher.cpp:48): unhandled
# reply: [code:200;phrase:[OK];... ]

@ -2,7 +2,7 @@
Project Website:
* http://www.kamailio.org
* https://www.kamailio.org
## Database Structure

@ -1,10 +1,10 @@
#!KAMAILIO
#
# This config file implements the basic P-CSCF functionality
# - web: http://www.kamailio.org
# - web: https://www.kamailio.org
# - git: http://sip-router.org
#
# Refer to the Core CookBook at http://www.kamailio.org/dokuwiki/doku.php
# Refer to the Core CookBook at https://www.kamailio.org/w/documentation/
# for an explanation of possible statements, functions and parameters.
#
# Direct your questions about this file to: <sr-users@lists.kamailio.org>.
@ -799,7 +799,7 @@ route[apply_privacy]
}
######################################################################
# Originating, Intial Requests
# Originating, Initial Requests
######################################################################
route[orig]
{

@ -25,7 +25,7 @@ alias=scscf.mnc001.mcc001.3gppnetwork.org
##!define DB_URL "con1=>mysql://scscf:heslo@127.0.0.1/scscf"
##!define DB_URL2 "con2=>mysql://scscf:heslo@127.0.0.1/scscf"
# Select Authorization Algorhithm:
# Select Authorization Algorithm:
##!define REG_AUTH_DEFAULT_ALG "AKAv1-MD5"
##!define REG_AUTH_DEFAULT_ALG "AKAv2-MD5"
##!define REG_AUTH_DEFAULT_ALG "MD5"

@ -1,6 +1,6 @@
# $Id$
#
# Sample config for MySQL accouting with Kamailio 1.2.0
# Sample config for MySQL accounting with Kamailio 1.2.0
#
# - mysql module must be compiled and installed
#

@ -1,7 +1,7 @@
#
# $Id$
#
# example: accounting calls to nummerical destinations
# example: accounting calls to numerical destinations
#
# ------------------ module loading ----------------------------------

@ -28,7 +28,7 @@
# with Cisco 7960, Mitel 5055, Grandstream and Pingtel; Windows
# Messenger does not support REFER. Never tested on solaris.
# Some cisco 7960 images don't work (in particular, POS30202
# doesnt, POS3-03-8-21 does)
# doesn't, POS3-03-8-21 does)
#
# History:
# --------
@ -132,7 +132,7 @@ fifo_job="$!"
# initiate dummy INVITE with pre-3261 "on-hold"
# (note the dots -- they mean in order of appearance:
# outbound uri, end of headers, end of body; eventualy
# outbound uri, end of headers, end of body; eventually
# the FIFO request must be terminated with an empty line)
#cat <<EOF
cat > $FIFO <<EOF

@ -61,7 +61,7 @@ failure_route[2] {
# try out the last resort destination
append_branch("sip:foo@kamailio.org");
log(1, "second redirection\n");
# we no more call t_on_negative here; if this destination
# we no more call t_on_failure here; if this destination
# fails too, transaction will complete
t_relay();
}

@ -7,7 +7,7 @@
# you will also have to install Maxim's RTP proxy. The proxy is enforced
# if one of the parties is behind a NAT.
#
# If you have an endpoing in the public internet which is known to
# If you have an endpoint in the public internet which is known to
# support symmetric RTP (Cisco PSTN gateway or voicemail, for example),
# then you don't have to force RTP proxy. If you don't want to enforce
# RTP proxy for some destinations than simply use t_relay() instead of

@ -37,7 +37,7 @@ modparam("auth", "secret", "alsdkhglaksdhfkloiwr")
route{
# initial sanity checks -- messages with
# max_forwars==0, or excessively long requests
# max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483", "Too Many Hops");
exit;

@ -2,7 +2,7 @@
# $Id$
#
This examle illustrate how to use ser's FIFO interface
This example illustrates how to use ser's FIFO interface
to initate sending an instant message from a webpage.
To enable this example, you need

@ -340,7 +340,7 @@ end
-- RTPProxy control
function ksr_route_natmanage()
if not KSR.rtpproxy then
if not KSR.rtpproxy and not KSR.rtpengine then
return 1;
end
if KSR.siputils.is_request()>0 then
@ -354,7 +354,19 @@ function ksr_route_natmanage()
return 1;
end
KSR.rtpproxy.rtpproxy_manage("co");
if KSR.kx.ifdef('WITH_RTPENGINE') then
if KSR.nathelper.nat_uac_test(8)>0 then
KSR.rtpengine.rtpengine_manage("replace-origin replace-session-connection SIP-source-address");
else
KSR.rtpengine.rtpengine_manage("replace-origin replace-session-connection");
end
else
if KSR.nathelper.nat_uac_test(8)>0 then
KSR.rtpproxy.rtpproxy_manage("co");
else
KSR.rtpproxy.rtpproxy_manage("cor");
end
end
if KSR.siputils.is_request()>0 then
if KSR.siputils.has_totag()<0 then

@ -176,7 +176,7 @@ def ksr_route_withindlg()
exit
end
# IP authorization and user authenticaton
# IP authorization and user authentication
def ksr_route_auth()
if !KSR.is_REGISTER() then
# source IP allowed
@ -225,7 +225,7 @@ def ksr_route_natmanage()
end
end
end
#KSR.info("Natmange - returning if NAT flags set")
#KSR.info("Natmanage - returning if NAT flags set")
return if !KSR.isflagset($FLT_NATS) and !KSR.isbflagset($FLB_NATB)
#KSR.info("Natmanage - RTPPROXY from here on")
KSR::RTPPROXY::RTPPROXY_manage("co");

@ -1,7 +1,7 @@
#!KAMAILIO
#
# Kamailio SIP Server v5.0 - default configuration script
# - web: http://www.kamailio.org
# - web: https://www.kamailio.org
# - git: http://sip-router.org
#
# Direct your questions about this file to: <sr-users@lists.kamailio.org>
@ -39,6 +39,12 @@
# rtpproxy -l _your_public_ip_ -s udp:localhost:7722
# - option for NAT SIP OPTIONS keepalives: WITH_NATSIPPING
#
# *** To use RTPEngine (instead of RTPProxy) for nat traversal execute:
# - define WITH_RTPENGINE
# - install RTPEngine: https://github.com/sipwise/rtpengine
# - start RTPEngine:
# rtpengine --listen-ng=127.0.0.1:2223 ...
#
# *** To enable TLS support execute:
# - adjust CFGDIR/tls.cfg as needed
# - define WITH_TLS
@ -237,8 +243,12 @@ loadmodule "permissions.so"
#!ifdef WITH_NAT
loadmodule "nathelper.so"
#!ifdef WITH_RTPENGINE
loadmodule "rtpengine.so"
#!else
loadmodule "rtpproxy.so"
#!endif
#!endif
#!ifdef WITH_TLS
loadmodule "tls.so"
@ -352,8 +362,13 @@ modparam("permissions", "db_mode", 1)
#!ifdef WITH_NAT
#!ifdef WITH_RTPENGINE
# ----- rtpengine params -----
modparam("rtpengine", "rtpengine_sock", "udp:127.0.0.1:2223")
#!else
# ----- rtpproxy params -----
modparam("rtpproxy", "rtpproxy_sock", "udp:127.0.0.1:7722")
#!endif
# ----- nathelper params -----
modparam("nathelper", "natping_interval", 30)

@ -1,7 +1,7 @@
#
# $Id$
#
# example: accounting calls to nummerical destinations
# example: accounting calls to numerical destinations
#
# ------------------ module loading ----------------------------------

@ -82,7 +82,7 @@ listen=udp:IPADDR_THISNODE:5060
####### Custom Parameters #########
/* These parameters can be modified runtime via RPC interface
/* These parameters can be modified at runtime via RPC interface
* - see the documentation of 'cfg_rpc' module.
*
* Format: group.id = value 'desc' description
@ -142,7 +142,7 @@ modparam("rr", "append_fromtag", 0)
modparam("acc", "early_media", 0)
modparam("acc", "report_ack", 0)
modparam("acc", "report_cancels", 0)
/* by default ww do not adjust the direct of the sequential requests.
/* by default we do not adjust the direct of the sequential requests.
* if you enable this parameter, be sure the enable "append_fromtag"
* in "rr" module */
modparam("acc", "detect_direction", 0)

@ -56,7 +56,7 @@ children=2
####### Custom Parameters #########
/* These parameters can be modified runtime via RPC interface
/* These parameters can be modified at runtime via RPC interface
* - see the documentation of 'cfg_rpc' module.
*
* Format: group.id = value 'desc' description
@ -116,7 +116,7 @@ modparam("rr", "append_fromtag", 0)
modparam("acc", "early_media", 0)
modparam("acc", "report_ack", 0)
modparam("acc", "report_cancels", 0)
/* by default ww do not adjust the direct of the sequential requests.
/* by default we do not adjust the direct of the sequential requests.
* if you enable this parameter, be sure the enable "append_fromtag"
* in "rr" module */
modparam("acc", "detect_direction", 0)

@ -7,7 +7,7 @@
# you will also have to install Maxim's RTP proxy. The proxy is enforced
# if one of the parties is behind a NAT.
#
# If you have an endpoing in the public internet which is known to
# If you have an endpoint in the public internet which is known to
# support symmetric RTP (Cisco PSTN gateway or voicemail, for example),
# then you don't have to force RTP proxy. If you don't want to enforce
# RTP proxy for some destinations than simply use t_relay() instead of

@ -4,7 +4,7 @@
# example script showing both types of forking;
# incoming message is forked in parallel to
# 'nobody' and 'parallel', if no positive reply
# appears with final_response timer, nonsense
# appears within final_response timer, nonsense
# is retried (serial forking); than, destination
# 'foo' is given last chance
@ -57,7 +57,7 @@ failure_route[2] {
# try out the last resort destination
append_branch("sip:foo@iptel.org");
log(1, "second redirection\n");
# we no more call t_on_negative here; if this destination
# we no more call t_on_failure here; if this destination
# fails too, transaction will complete
t_relay();
}

@ -34,7 +34,7 @@ modparam("auth", "secret", "alsdkhglaksdhfkloiwr")
route{
# initial sanity checks -- messages with
# max_forwars==0, or excessively long requests
# max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483", "Too Many Hops");
break;

@ -76,7 +76,7 @@ loadmodule "/usr/local/lib/sip-router/modules/domain.so"
modparam("usrloc|acc|auth_db|group|msilo", "db_url", "sql://sip-router:heslo@localhost/sip-router")
# -- usrloc params --
/* 0 -- dont use mysql, 1 -- write_through, 2--write_back */
/* 0 -- don't use mysql, 1 -- write_through, 2 -- write_back */
modparam("usrloc", "db_mode", 2)
modparam("usrloc", "timer_interval", 10)
@ -187,7 +187,7 @@ route {
# anti-spam -- if somene claims to belong to our domain in From,
# challenge him (skip REGISTERs -- we will chalenge them later)
# challenge him (skip REGISTERs -- we will challenge them later)
if (search("(From|F):.*@SER_HOST_REGEX")) {
# invites forwarded to other domains, like FWD may cause subsequent
# request to come from there but have iptel in From -> verify
@ -297,8 +297,8 @@ route {
break;
};
# some UACs might be fooled by Contacts our UACs generate to make MSN
# happy (web-im, e.g.) -- tell its urneachable
# some UACs might be fooled by Contacts our UACs generated to make MSN
# happy (web-im, e.g.) -- tell it is unreachable
if (uri =~ "sip:daemon@") {
sl_send_reply("410", "Daemon is gone");
break;
@ -317,7 +317,7 @@ route {
break;
};
# Remove leading + if it is a number begining with +
# Remove leading + if it is a number beginning with +
if (uri =~ "^[a-zA-Z]+:\+[0-9]+@") {
strip(1);
prefix("00");
@ -372,7 +372,7 @@ route {
}
#
# Forcing media relay if necesarry
# Forcing media relay if necessary
#
route[NAT_ROUTE] {
if (uri=~"[@:](192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.)" && !search("^Route:")) {
@ -384,7 +384,7 @@ route[NAT_ROUTE] {
force_rtp_proxy();
append_hf("P-RTP-Proxy: YES\r\n");
};
append_hf("P-NATed-Calee: Yes\r\n");
append_hf("P-NATed-Callee: Yes\r\n");
};
# nat processing of replies; apply to all transactions (for example,

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

@ -77,7 +77,7 @@ route{
if (! t_newtran())
{
# retransmit whatever we have
# it's useless to do any retransmision, because we haven't
# it's useless to do any retransmission, because we haven't
# sent any statefull reply. (bogdan)
#t_retransmit_reply();
break;
@ -142,7 +142,7 @@ route{
if (! t_newtran())
{
# retransmit whatever we have
# it's useless to do any retransmision, because we haven't
# it's useless to do any retransmission, because we haven't
# sent any statefull reply. (bogdan)
#t_retransmit_reply();
break;

@ -197,7 +197,7 @@ route{
/* added by Bogdan for cpl demo - Dorgham request*/
if (uri=~"sip:test@.*" && method=="INVITE")
{
log("SER : runing CPL!! :)\n");
log("SER : running CPL!! :)\n");
if ( !cpl_run_script() )
{
log("SER : Error during running CPL script!\n");

@ -60,7 +60,7 @@ route{
# UAS script implementation
# if that is not a new transaction... (t_newtran is a new
# function which atomicaly adds a transaction if there is
# function which atomically adds a transaction if there is
# none)
if (! t_newtran()) {
# retransmit whatever we have

@ -99,7 +99,7 @@ route{
if (! t_newtran())
{
# retransmit whatever we have
# it's useless to do any retransmision, because we haven't
# it's useless to do any retransmission, because we haven't
# sent any statefull reply. (bogdan)
#t_retransmit_reply();
break;

@ -180,7 +180,7 @@ route{
/* added by Bogdan for cpl demo - Dorgham request*/
if (uri=~"sip:test@.*" && method=="INVITE")
{
log("SER : runing CPL!! :)\n");
log("SER : running CPL!! :)\n");
if ( !cpl_run_script() )
{
log("SER : Error during running CPL script!\n");

@ -100,7 +100,7 @@ route{
# - we need it for calls from gateways (otherwise, subsequent
# requests from the other # party will attempt to contact gateway
# directly through blocked ports)
# - we need it for Windows Messanger's IM sessions to cross
# - we need it for Windows Messenger's IM sessions to cross
# firewalls -- we force all MESSAGEs to go via our server
# to avoid blocking port numbers (some firewalls can do
# standard SIP but are puzzled by Microsoft's proprietary
@ -135,7 +135,7 @@ route{
log("LOG Request is REGISTER\n");
# prohibit attempts to grab someone else's To address
# using valid credentials; the only exception is the user
# 'replciator' permitted to generate 3-rd party registrations
# 'replicator' permitted to generate 3-rd party registrations
# update Contact database
log("LOG: REGISTER is authorized, saving location\n");

@ -1,7 +1,7 @@
#!KAMAILIO
#
# Kamailio SIP Server v5.1 - default basic configuration script
# - web: http://www.kamailio.org
# - web: https://www.kamailio.org
# - git: http://sip-router.org
#
# Direct your questions about this file to: <sr-users@lists.kamailio.org>

@ -1,7 +1,7 @@
#!KAMAILIO
#
# Kamailio SIP Server v5.1 - default advanced configuration script
# - web: http://www.kamailio.org
# - web: https://www.kamailio.org
# - git: http://sip-router.org
#
# Direct your questions about this file to: <sr-users@lists.kamailio.org>
@ -194,7 +194,7 @@ tcp_accept_no_cl=yes
####### Custom Parameters #########
# These parameters can be modified runtime via RPC interface
# These parameters can be modified at runtime via RPC interface
# - see the documentation of 'cfg_rpc' module.
#
# Format: group.id = value 'desc' description
@ -360,7 +360,7 @@ modparam("registrar", "gruu_enabled", 0)
modparam("acc", "early_media", 0)
modparam("acc", "report_ack", 0)
modparam("acc", "report_cancels", 0)
/* by default ww do not adjust the direct of the sequential requests.
/* by default we do not adjust the direct of the sequential requests.
if you enable this parameter, be sure the enable "append_fromtag"
in "rr" module */
modparam("acc", "detect_direction", 0)
@ -862,7 +862,7 @@ route[PSTN] {
#!ifdef WITH_PSTN
# check if PSTN GW IP is defined
if (strempty($sel(cfg_get.pstn.gw_ip))) {
xlog("SCRIPT: PSTN rotuing enabled but pstn.gw_ip not defined\n");
xlog("SCRIPT: PSTN routing enabled but pstn.gw_ip not defined\n");
return;
}
@ -919,7 +919,7 @@ route[TOVOICEMAIL] {
# check if VoiceMail server IP is defined
if (strempty($sel(cfg_get.voicemail.srv_ip))) {
xlog("SCRIPT: VoiceMail rotuing enabled but IP not defined\n");
xlog("SCRIPT: VoiceMail routing enabled but IP not defined\n");
return;
}
if($avp(oexten)==$null)

@ -50,7 +50,7 @@ rev_dns=no # (cmd. line: -R)
#group=sip-router
#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)
sip_warning=yes

@ -91,7 +91,7 @@
# from untrusted sources, such as the user agents or foreign proxy
# servers
# * refined DB use (e.g., flatstore for acc)
# * miscellanous:
# * miscellaneous:
# - dialog module for monitoring purposes
# - more extensive logging using xlog (controlled by gflags/gAVPs)
# * leveraging 2.1 features:
@ -181,7 +181,7 @@ rev_dns=no # (cmd. line: -R)
#group=sip-router
#disable_core=yes # disables core dumping
#open_files_limit=20480 # sets the open file descriptors limit
#mhomed=yes # usefull for multihomed hosts, small performance
#mhomed=yes # useful for multihomed hosts, small performance
# penalty
disable_tcp=no # be conservative about enabling TCP -- it can
# degrade performance a lot
@ -268,7 +268,7 @@ tls_enable=yes
#!endif
# -------------------- Custom Parameters ------------------------------------
# These parameters can be modified runtime via RPC interface,
# These parameters can be modified at runtime via RPC interface,
# read the documentation of cfg_rpc module.
# Session Timer parameters, RFC 4028
@ -521,7 +521,7 @@ modparam("tm", "restart_fr_on_each_reply", 0)
# -- xmlrpc --
#!ifdef WITH_XMLRPC
# Use a sub-route. This is a lot safer then relying on the request method
# Use a sub-route. This is a lot safer than relying on the request method
# to distinguish HTTP from SIP
modparam("xmlrpc", "route", "XMLRPC");
#!endif
@ -596,7 +596,7 @@ route
# to PSTN. If email-like URIs are used, having a URI alias for
# processing incoming PSTN-to-ip requests may be useful, too.
# Important: the script is assuming one global pstn-gw for all
# domains! Failure to allow gw_ip to be a domain-specic attribute
# domains! Failure to allow gw_ip to be a domain-specific attribute
# would result in security gaps (onsend_route checks only for one
# gateway).
@ -642,12 +642,12 @@ route
route(INBOUND);
# There is SIP user for the called address. Before trying PSTN,
# you may have to convert the adress, for instance by using
# you may have to convert the address, for instance by using
# ENUM.
#route(ENUM);
# Last resort: if none of the previous route has found
# the recepient, try PSTN.
# the recipient, try PSTN.
route(PSTN);
# nothing matched
@ -807,14 +807,14 @@ route[UAC_NAT_DETECTION]
# - mismatch of transport IP and IP in Via
# - mismatch of transport port and port in Via
# in all other cases we skip the port test, because lots of clients
# do not correctly advertise their emphemeral port number in their Via
# do not correctly advertise their ephemeral port number in their Via
# header in case of reliable transports (although they are not behind
# a NAT).
# Warning: if you are dealing with SIP implementations which are
# running on public IP and do as-symmertic signaling for whatever
# running on public IP and do as-symmetric signaling for whatever
# reason the following check will make their signaling symmetric.
# If you need to support as-symmertic signaling reduce the following
# If you need to support as-symmetric signaling reduce the following
# nat_uac_test for UDP to "3" or even "1".
if ((proto == UDP && nat_uac_test("19")) ||
(nat_uac_test("3")) ||
@ -881,9 +881,9 @@ route[UAS_NAT_DETECTION]
# IP address into the Contact header, but "forget" about the port.
# Warning: if you are dealing with SIP implementations which are
# running on public IP and do as-symmertic signaling for whatever
# running on public IP and do as-symmetric signaling for whatever
# reason the following check will make their signaling symmetric.
# If you need to support as-symmertic signaling reduce the following
# If you need to support as-symmetric signaling reduce the following
# nat_uac_test for UDP to just "1".
if ( (proto == UDP && nat_uac_test("33")) ||
(nat_uac_test("1") ||
@ -982,7 +982,7 @@ route[PROCESS_ROUTES]
route(SESSION_TIMER);
}
# Some broken devices overide the dialog route set with the
# Some broken devices override the dialog route set with the
# Record-Route headers from each in-dialog request. So, we
# better add Record-Route headers again. If we call
# record_route() after loose_route(), the AVP cookies are
@ -1348,7 +1348,7 @@ route[INBOUND]
if (isflagset(FLAG_NAT_REG)) {
setflag(FLAG_NAT); /* client was behind NAT when made registration */
}
# 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
@ -1363,7 +1363,7 @@ route[INBOUND]
}
# This enables session timer support as long as one side
# supports it. If you want to have session timmer support
# supports it. If you want to have session timer support
# only for calls from your PSTN gateway but not between pure
# VoIP calls you can remove the comment marks from the if
# clause in the next line and closing bracket below.
@ -1496,7 +1496,7 @@ route[SESSION_TIMER]
eval_oper("(int)", -1);
eval_oper(">=", -2);
# Let's check for the Suported header.
# Let's check for the Supported header.
if (hf_value_exists("Supported", "timer")) {
# The UAC supports Session-Timer, so we
# only need to take a look at the values

@ -14,7 +14,7 @@ alias="test-domain.com"
#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)
@ -108,7 +108,7 @@ modparam("pa", "timer_interval", 10)
# route for generated SUBSCRIBE requests for presence
modparam("presence_b2b", "presence_route", "<sip:127.0.0.1;transport=tcp;lr>")
# 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)
@ -229,7 +229,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");

@ -7,7 +7,7 @@ port=5060
children=2
alias="test-domain.com"
mhomed=yes # usefull for multihomed hosts, small performance penalty
mhomed=yes # useful for multihomed hosts, small performance penalty
#tcp_accept_aliases=yes # accepts the tcp alias via option (see NEWS)
#tcp_poll_method="sigio_rt"
@ -142,7 +142,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
query_rls_services();
}

@ -28,7 +28,7 @@
# with Cisco 7960, Mitel 5055, Grandstream and Pingtel; Windows
# Messenger does not support REFER. Never tested on solaris.
# Some cisco 7960 images don't work (in particular, POS30202
# doesnt, POS3-03-8-21 does)
# doesn't, POS3-03-8-21 does)
#
# History:
# --------
@ -129,7 +129,7 @@ fifo_job="$!"
# initiate dummy INVITE with pre-3261 "on-hold"
# (note the dots -- they mean in order of appearance:
# outbound uri, end of headers, end of body; eventualy
# outbound uri, end of headers, end of body; eventually
# the FIFO request must be terminated with an empty line)
cat > $FIFO <<EOF

@ -6,8 +6,8 @@
#
# This script uses sipsak (http://sipsak.berlios.de) to test if a
# SIP server is still responding to requests and will send messages
# to the developers. It is configured for the iptel.org enviroment.
# PLEASE adapt it to your local enviroment.
# to the developers. It is configured for the iptel.org environment.
# PLEASE adapt it to your local environment.
#
NOTIFY=sr@iptel.org
@ -38,7 +38,7 @@ if [ -e $LOCKF ] ; then
if [ ! -e $LOCKF ] ; then
echo "This is a reminder !!!" > $TMP
echo "The lockfile $LOCKF" >> $TMP
echo "was just removed because ist was older then $LOCK_TIMEOUT minutes." >> $TMP
echo "was just removed because it was older than $LOCK_TIMEOUT minutes." >> $TMP
echo "But if you receive this mail the cause of this error still exists or respawned." >> $TMP
SERR_SUBJECT="serresponse reminder"
fi
@ -124,7 +124,7 @@ if [ ! -e $LOCKF ] ; then
done
else
echo "unconfigured serresponse executed on ${HOSTN}." > $TMP
echo "Warning: This script if configured for the iptel.org enviroment."
echo "Warning: This script is configured for the iptel.org environment."
echo " Please configure it to your local settings first."
echo
echo "If you do not press CTRL-C within 2 seconds an informational message"

@ -2,7 +2,7 @@
# $Id$
#
This examle illustrate how to use ser's FIFO interface
This example illustrates how to use ser's FIFO interface
to initate sending an instant message from a webpage.
To enable this example, you need

@ -198,7 +198,7 @@ tcp_rd_buf_size=16384
####### Custom Parameters #########
/* These parameters can be modified runtime via RPC interface
/* These parameters can be modified at runtime via RPC interface
* - see the documentation of 'cfg_rpc' module.
*
* Format: group.id = value 'desc' description
@ -350,7 +350,7 @@ modparam("registrar", "gruu_enabled", 0)
modparam("acc", "early_media", 0)
modparam("acc", "report_ack", 0)
modparam("acc", "report_cancels", 0)
/* by default ww do not adjust the direct of the sequential requests.
/* by default we do not adjust the direct of the sequential requests.
* if you enable this parameter, be sure the enable "append_fromtag"
* in "rr" module */
modparam("acc", "detect_direction", 0)

@ -13,65 +13,64 @@
#include "../parser/parse_identityinfo.h"
#include "../parser/parse_disposition.h"
int LLVMFuzzerInitialize(int *argc, char ***argv)
{
ksr_hname_init_index();
return 0;
int LLVMFuzzerInitialize(int *argc, char ***argv) {
ksr_hname_init_index();
return 0;
}
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
sip_msg_t orig_inv = {};
orig_inv.buf = (char *)data;
orig_inv.len = size;
int
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
sip_msg_t orig_inv = { };
orig_inv.buf = (char*)data;
orig_inv.len = size;
if(size >= 4 * BUF_SIZE) {
/* test with larger message than core accepts, but not indefinitely large */
return 0;
}
if(size >= 4*BUF_SIZE) {
/* test with larger message than core accepts, but not indefinitely large */
return 0;
}
if(parse_msg(orig_inv.buf, orig_inv.len, &orig_inv) < 0) {
goto cleanup;
}
if (parse_msg(orig_inv.buf, orig_inv.len, &orig_inv) < 0) {
goto cleanup;
}
parse_headers(&orig_inv, HDR_EOH_F, 0);
parse_headers(&orig_inv, HDR_EOH_F, 0);
parse_sdp(&orig_inv);
parse_sdp(&orig_inv);
parse_from_header(&orig_inv);
parse_from_header(&orig_inv);
parse_from_uri(&orig_inv);
parse_from_uri(&orig_inv);
parse_to_header(&orig_inv);
parse_to_header(&orig_inv);
parse_to_uri(&orig_inv);
parse_to_uri(&orig_inv);
parse_contact_headers(&orig_inv);
parse_contact_headers(&orig_inv);
parse_refer_to_header(&orig_inv);
parse_refer_to_header(&orig_inv);
parse_pai_header(&orig_inv);
parse_pai_header(&orig_inv);
parse_diversion_header(&orig_inv);
parse_diversion_header(&orig_inv);
parse_privacy(&orig_inv);
parse_privacy(&orig_inv);
parse_content_disposition(&orig_inv);
parse_content_disposition(&orig_inv);
parse_identityinfo_header(&orig_inv);
parse_identityinfo_header(&orig_inv);
parse_record_route_headers(&orig_inv);
parse_record_route_headers(&orig_inv);
parse_route_headers(&orig_inv);
parse_route_headers(&orig_inv);
str uri;
get_src_uri(&orig_inv, 0, &uri);
str uri;
get_src_uri(&orig_inv, 0, &uri);
str ssock;
get_src_address_socket(&orig_inv, &ssock);
str ssock;
get_src_address_socket(&orig_inv, &ssock);
cleanup:
free_sip_msg(&orig_inv);
free_sip_msg(&orig_inv);
return 0;
return 0;
}

@ -2,13 +2,13 @@
#include "../config.h"
#include "../parser/parse_uri.c"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
struct sip_uri uri;
if(size >= BUF_SIZE) {
/* test with larger message than core accepts, but not indefinitely large */
return 0;
}
parse_uri(data, size, &uri);
return 0;
int
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
struct sip_uri uri;
if(size >= BUF_SIZE) {
/* test with larger message than core accepts, but not indefinitely large */
return 0;
}
parse_uri(data, size, &uri);
return 0;
}

@ -38,7 +38,7 @@ DESCRIPTION
actions.
The database template for SER dbtext database is stored in dbtext_template
directory which can usualy be found in /var/lib/ser (depending on
directory which can usually be found in /var/lib/ser (depending on
installation). You can use the template to create SER database manually if
you cannot or do not want to use this shell wrapper.

@ -52,7 +52,7 @@ DESCRIPTION
section COMMANDS for brief overview of supported actions.
The SQL definition of tables and initial data within SER database is stored
in a separate files which can be usualy found under /usr/local/share/ser
in a separate files which can be usually found under /usr/local/share/ser
(depending on installation). You can use those files to create SER database
manually if you cannot or do not want to use this shell wrapper.
@ -97,7 +97,7 @@ COMMANDS
that the tables are empty.
update-data
Update initial data in the database. This command deletes vendor-controled
Update initial data in the database. This command deletes vendor-controlled
rows from the database and replaces them with new data.

@ -33,7 +33,7 @@ Usage: $COMMAND create [database]
for SER and SERWeb. In addition to that two users are created, one with
read/write permissions and one with read-only permissions.
Commmand 'drop' deletes database named '${DBNAME}' and associated users.
Command 'drop' deletes database named '${DBNAME}' and associated users.
Command 'backup' Dumps the contents of the database in <file>. If no
database name is provided on the command line then the default '${DBNAME}'
@ -84,7 +84,7 @@ db_load() #pars: <database name> <filename>
# Drop SER database
db_drop()
{
# Drop dabase
# Drop database
# Revoke user permissions
echo "Dropping database $1"

@ -230,7 +230,7 @@ modparam("usrloc|acc|auth_db|group|msilo|uri", "db_url",
"$SER_SQL_URI")
# -- usrloc params --
/* 0 -- dont use mysql, 1 -- write_through, 2--write_back */
/* 0 -- don't use mysql, 1 -- write_through, 2 -- write_back */
modparam("usrloc", "db_mode", 2)
modparam("usrloc", "timer_interval", 10)
@ -283,7 +283,7 @@ route{
};
# Make sure that requests dont advertise addresses
# Make sure that requests don't advertise addresses
# from private IP space (RFC1918) in Contact HF
# (note: does not match with folded lines)
if (search("^(Contact|m): .*@(192\.168\.|10\.|172\.16)")) {
@ -294,13 +294,13 @@ route{
&& !( src_ip==192.168.0.0/16 ||
src_ip==10.0.0.0/8 || src_ip==172.16.0.0/12 )) {
log("LOG: Someone trying to register from private IP again\n");
sl_send_reply("479", "We dont accept private IP contacts" );
sl_send_reply("479", "We don't accept private IP contacts" );
break;
};
};
# anti-spam -- if somene claims to belong to our domain in From,
# challenge him (skip REGISTERs -- we will chalenge them later)
# challenge him (skip REGISTERs -- we will challenge them later)
if (search("(From|F):.*$SER_DOMAIN_TEST_RE")) {
# invites forwarded to other domains, like FWD may cause subsequent
# request to come from there but have iptel in From -> verify
@ -374,7 +374,7 @@ route{
# avoid stealing incoming calls
if (method=="REGISTER") {
# Make sure that user's dont register infinite loops
# Make sure that users don't register infinite loops
# (note: does not match with folded lines)
if (search("^(Contact|m): .*@$SER_DOMAIN_TEST_RE")) {
log(1, "LOG: alert: someone trying to set aor==contact\n");
@ -407,8 +407,8 @@ route{
break;
};
# some UACs might be fooled by Contacts our UACs generate to make MSN
# happy (web-im, e.g.) -- tell its urneachable
# some UACs might be fooled by Contacts our UACs generated to make MSN
# happy (web-im, e.g.) -- tell it is unreachable
if (uri=~"sip:daemon@" ) {
sl_send_reply("410", "daemon is gone");
break;
@ -422,7 +422,7 @@ route{
};
} else {
# aliases (take precedences over PSTN number; provisioning interface
# is set up to assinge aliases beginning with 8)
# is set up to assign aliases beginning with 8)
lookup("aliases");
};
@ -471,7 +471,7 @@ route[2] {
# routing logic for inbound requests aliased outbound; unlike
# with real outbound requests we do not force authentication
# as these calls are server by our server and we do not want
# to disqualify unathenticated request originatiors from other
# to disqualify unauthenticated request originatiors from other
# domains
route[5] {
append_hf("P-hint: ALIASED-OUTBOUND\r\n");

@ -19,10 +19,10 @@ Return values can be injected through the dictionary \_mock\_data
```python
#set retun value for all calls to the function
#set return value for all calls to the function
_mock_data[module][function] = value
#set retun value for specific parameters being passed
#set return value for specific parameters being passed
_mock_data[module][function][param_value] = value
#call the function myFunc when func is passed, return of myFunc will

@ -14,15 +14,18 @@ from collections import defaultdict
#python 3.2 doesnt support types.Union
noUnion = False
reserved_keywords = {"async"}
def printMocReturn(module_name, func, indent):
param_names = []
param_list = []
param_signature = ""
if (func['params'] != 'none'):
if func['params'] is not None and func['params'] != 'none':
param_list = func['params'].split(", ")
i = 0
for param in param_list:
for _ in param_list:
param_names.append("param"+str(i))
i = i + 1
@ -56,13 +59,13 @@ def printDefaultReturn(func, indent):
for i in range(indent):
prefix = prefix+"\t"
if(func['ret'] == "bool"):
if func['ret'] == "bool":
print(prefix + "return True")
elif(func['ret'] == "int"):
elif func['ret'] == "int":
print(prefix + "return 1")
elif (func['ret'] == "str"):
elif func['ret'] == "str":
print(prefix + "return \"\"")
elif (func['ret'] == "xval"):
elif func['ret'] == "xval":
print(prefix + "return None")
else:
print(prefix + "return")
@ -78,38 +81,39 @@ def printFunction(module_name, func, indent):
log_format_params = "%s"
if indent > 0:
params = "self"
param_list = []
if(func['params']!="none"):
if func['params'] is not None and func['params'] != "none":
param_list = func['params'].split(", ")
i = 0
for param in param_list:
for _ in param_list:
if params != "":
params = params + ", "
params = params + "param" + str(i) + ": " + param_list[i]
log_params = log_params + ", param" + str(i)
log_format_params = log_format_params + ", %s"
i = i+1
if len(param_list) > 0:
log_params = "(" + log_params + ")"
prefix = ""
for i in range(indent):
prefix = prefix+"\t"
if(func['ret'] == "bool"):
if indent > 0:
print(prefix + "@staticmethod")
if func['ret'] == "bool":
print(prefix + "def " + func['name'] +"("+params+") -> bool:")
elif(func['ret'] == "int"):
elif func['ret'] == "int":
print(prefix + "def " + func['name'] +"("+params+") -> int:")
elif (func['ret'] == "str"):
elif func['ret'] == "str":
print(prefix + "def " + func['name'] + "(" + params + ") -> int:")
elif(func['ret'] == "xval"):
elif func['ret'] == "xval":
if noUnion:
print(prefix + "def " + func['name'] + "(" + params + "):")
else:
print(prefix + "def " + func['name'] +"("+params+") -> Union[int,str]:")
print(prefix + "def " + func['name'] +"("+params+") -> Union[int, str, None]:")
else:
print(prefix + "def " + func['name'] +"("+params+"):")
print(prefix + "\tprint(\"Calling " + log_format_params + "\" % ("+log_params+"))")
print(prefix + "\tprint(\"Calling " + log_format_params + "\" % "+log_params+")")
printMocReturn(module_name, func, indent+1)
print("")
@ -128,8 +132,10 @@ if len(sys.argv) > 2:
if not noUnion:
print("from typing import Union")
print("import sys")
print("import types")
print("_mock_data={}")
print("_mock_data = {}")
print("")
with open(sys.argv[1]) as f:
data = json.load(f)
@ -177,6 +183,7 @@ if "pv" not in classes:
for module_name, module in classes.items():
if module_name != "":
print("")
print("class " + module_name.capitalize() + ":")
for func in module:
@ -188,7 +195,10 @@ for func in classes['']:
for module_name in classes.keys():
if module_name != "":
print(module_name + " = "+module_name.capitalize()+"()")
if module_name in reserved_keywords:
print("setattr(sys.modules[__name__], '" + module_name + "', " + module_name.capitalize() + "())")
else:
print(module_name + " = "+module_name.capitalize()+"()")
print("")

@ -2,6 +2,13 @@
import KSR
# this assumes you have your mock KSR.py in the local directory e.g. /test/
# and your kemi code is in ../conf/kamailio.py
sys.path.insert(0, "../conf/")
import kamailio as kamailio
#return sip:hello@world only if $ru is passed to pv.get
KSR._mock_data['pv']['get'] = {}
KSR._mock_data['pv']['get']['$ru'] = "sip:hello@world"
@ -22,6 +29,11 @@ def appendHeader(param0: str):
KSR._mock_data['hdr']['append'] = appendHeader
KSR.hdr.append("X-HDR: my-header")
k = kamailio.kamailio()
k.ksr_request_route(None) # Call the kemi script, the mock implementations will be called
# Validate the results
if appendCalled:
print("hdr.append successfully called!")
else:

@ -41,89 +41,87 @@
// XML elements in result
// they MUST NOT have a number on the tail
// because pike uses it for "row" numbering
static const char *const MAX_HITS = "max_hits";
static const char *const IP_ADDR = "ip_addr";
static const char *const LEAF_HITS_PREV = "leaf_hits_prev";
static const char *const LEAF_HITS_CURR = "leaf_hits_curr";
static const char *const EXPIRES = "expires";
static const char *const STATUS = "status";
static const char *const NUMBER_OF_ROWS = "number_of_rows";
static const char * const MAX_HITS = "max_hits";
static const char * const IP_ADDR = "ip_addr";
static const char * const LEAF_HITS_PREV = "leaf_hits_prev";
static const char * const LEAF_HITS_CURR = "leaf_hits_curr";
static const char * const EXPIRES = "expires";
static const char * const STATUS = "status";
static const char * const NUMBER_OF_ROWS = "number_of_rows";
#define IP_ADDR_MAX_LENGTH 40
#define STATUS_MAX_LENGTH 10
typedef struct TopItem
{
char ip_addr[IP_ADDR_MAX_LENGTH];
in_addr_t ipv4_addr; /* uint32_t */
struct in6_addr ipv6_addr;
unsigned short leaf_hits[2];
unsigned int expires;
#define STATUS_MAX_LENGTH 10
typedef struct TopItem {
char ip_addr[IP_ADDR_MAX_LENGTH];
in_addr_t ipv4_addr; /* uint32_t */
struct in6_addr ipv6_addr;
unsigned short leaf_hits[2];
unsigned int expires;
char status[STATUS_MAX_LENGTH];
int num_of_ips; /* number of IP addresses in aggregated result */
int num_of_ips; /* number of IP addresses in aggregated result */
} TopItem;
int compare_TopItem_hits(const void *left, const void *right)
int compare_TopItem_hits(const void* left, const void *right)
{
TopItem *li = (TopItem *)left;
TopItem *ri = (TopItem *)right;
return li->leaf_hits[0] + li->leaf_hits[1] - ri->leaf_hits[0]
- ri->leaf_hits[1];
return li->leaf_hits[0] + li->leaf_hits[1] - ri->leaf_hits[0] - ri->leaf_hits[1];
}
/** Compare function to qsort array in reverse order (biger first) */
int compare_TopItem_hits_reverse(const void *left, const void *right)
/** Compare function to qsort array in reverse order (bigger first) */
int compare_TopItem_hits_reverse(const void* left, const void *right)
{
return compare_TopItem_hits(right, left);
}
int compare_TopItem_ipv4_addr(const void *item1, const void *item2)
{
return ((TopItem *)item1)->ipv4_addr - ((TopItem *)item2)->ipv4_addr;
return ((TopItem*)item1)->ipv4_addr - ((TopItem*)item2)->ipv4_addr;
}
/**
* @return concatenated string in newly allocated memory
*/
static char *concat(const char *name, int index)
static char *concat( const char *name, int index )
{
char *ptr;
int rv;
rv = asprintf(&ptr, "%s%d", name, index);
if(rv == -1)
if ( rv == -1 )
return 0;
return ptr;
}
static void strfree(char *ptr)
static void strfree( char *ptr )
{
if(ptr)
if (ptr)
free(ptr);
}
static void die_if_fault_occurred(xmlrpc_env *env)
static void die_if_fault_occurred (xmlrpc_env *env)
{
if(env->fault_occurred) {
fprintf(stderr, "XML-RPC Fault: %s (%d)\n", env->fault_string,
env->fault_code);
if (env->fault_occurred) {
fprintf(stderr, "XML-RPC Fault: %s (%d)\n",
env->fault_string, env->fault_code);
exit(1);
}
}
/** @return 0 if everything is OK, 1 otherwise */
static int fault_occurred(xmlrpc_env *env)
static int fault_occurred (xmlrpc_env *env)
{
if(env->fault_occurred) {
fprintf(stderr, "XML-RPC Fault: %s (%d)\n", env->fault_string,
env->fault_code);
if (env->fault_occurred) {
fprintf(stderr, "XML-RPC Fault: %s (%d)\n",
env->fault_string, env->fault_code);
return 1;
}
return 0;
}
static void die_if_fault_occurred_line(xmlrpc_env *env, int line)
static void die_if_fault_occurred_line (xmlrpc_env *env, int line)
{
if(env->fault_occurred)
if (env->fault_occurred)
fprintf(stderr, "LINE: %d\n", line);
die_if_fault_occurred(env);
}
@ -131,26 +129,23 @@ static void die_if_fault_occurred_line(xmlrpc_env *env, int line)
void print_help()
{
printf("\n");
if(isatty(1))
printf("usage: \033[1mpike_top <ser addr>:<port> [--hot|--warm|--all] "
"[--mask]\033[0m\n");
if ( isatty(1) )
printf("usage: \033[1mpike_top <ser addr>:<port> [--hot|--warm|--all] [--mask]\033[0m\n");
else
printf("usage: pike_top <ser addr>:<port> [--hot|--warm|--all] "
"[--mask] [--ipleaf|--inner]\n");
printf("usage: pike_top <ser addr>:<port> [--hot|--warm|--all] [--mask] [--ipleaf|--inner]\n");
printf("\n");
printf("\toptions:\n"
"\t\t--hot ... show hot IP leaves\n"
"\t\t--all ... show all IP leaves\n"
"\t\t--mask ... aggregate results regarding IP mask length\n"
"\t\t (default 32, i.e. not aggregate)\n"
"\t\t IPv4 only at this time\n\n"
"\t\t\tdefault is to show HOT nodes\n\n");
if(isatty(1))
printf("You can use \033[1mwatch\033[0m(1) utility for periodical "
"output.\n\n");
"\t\t--hot ... show hot IP leaves\n"
"\t\t--all ... show all IP leaves\n"
"\t\t--mask ... aggregate results regarding IP mask length\n"
"\t\t (default 32, i.e. not aggregate)\n"
"\t\t IPv4 only at this time\n\n"
"\t\t\tdefault is to show HOT nodes\n\n");
if ( isatty(1) )
printf("You can use \033[1mwatch\033[0m(1) utility for periodical output.\n\n");
else
printf("You can use watch(1) utility for periodical output.\n\n");
/*
/*
printf("Note:\n"
"It is a question if reporting warm nodes is useful and if yes, how to report\n"
"them. I feel that should be more welcome to report parents of warm nodes,\n"
@ -159,36 +154,39 @@ void print_help()
}
/* Following options are conforming to definition of node status defined in pike/ip_tree.h */
#define OPT_WARM 1
#define OPT_HOT 2
#define OPT_ALL 3
#define OPT_WARM 1
#define OPT_HOT 2
#define OPT_ALL 3
/**
* @param options ORed cmdline options
* @return position of first non option parameter
*/
int process_options(int argc, char *argv[], int *options, int *mask_length)
{
static struct option long_options[] = {{"hot", 0, 0, 'h'},
/* {"warm", 0, 0, 'w'}, */
{"all", 0, 0, 'a'}, {"mask", 0, 0, 'm'}, {"help", 0, 0, '?'},
{0, 0, 0, 0}};
static struct option long_options[] = {
{"hot", 0, 0, 'h'},
/* {"warm", 0, 0, 'w'}, */
{"all", 0, 0, 'a'},
{"mask", 0, 0, 'm'},
{"help", 0, 0, '?'},
{0,0,0,0}
};
int c, index, counter;
*options = 0;
counter = 0;
while((c = getopt_long(argc, argv, "hwam:", long_options, &index)) != -1) {
switch(c) {
while ( (c=getopt_long(argc, argv, "hwam:", long_options, &index)) != -1 ) {
switch (c) {
case 'h':
*options = OPT_HOT;
++counter;
break;
/* case 'w':
/* case 'w':
*options = OPT_WARM;
++counter;
break;
*/
case 'a':
*/ case 'a':
*options = OPT_ALL;
++counter;
break;
@ -203,13 +201,13 @@ int process_options(int argc, char *argv[], int *options, int *mask_length)
break;
}
}
if(counter > 1) {
fprintf(stderr, "ERROR: Node type selectors are exlusive, only one of "
if ( counter > 1 ) {
fprintf(stderr, "ERROR: Node type selectors are exclusive, only one of "
"them can be used\n");
print_help();
exit(1);
}
if(*options == 0)
if ( *options == 0 )
*options = OPT_HOT;
return optind;
@ -222,19 +220,18 @@ int process_options(int argc, char *argv[], int *options, int *mask_length)
* @param rv returned value
* @return 1 if succeed and 0 otherwise
*/
int get_int_from_struct_by_name(
xmlrpc_value *structP, const char *element_name, int *rv)
int get_int_from_struct_by_name(xmlrpc_value *structP, const char *element_name, int *rv)
{
xmlrpc_env env;
xmlrpc_env_init(&env);
xmlrpc_value *valueP;
xmlrpc_struct_find_value(&env, structP, element_name, &valueP);
if(env.fault_occurred)
if ( env.fault_occurred )
goto error;
xmlrpc_read_int(&env, valueP, rv);
if(env.fault_occurred)
if ( env.fault_occurred )
goto error1;
xmlrpc_DECREF(valueP);
@ -251,9 +248,8 @@ error:
* @param rv contains newly allocated string or NULL if fails
* @return 1 if succeed and 0 otherwise
*/
/* FIXME terminates the programm if it fails */
int get_string_from_struct_by_name(
xmlrpc_value *structP, const char *element_name, char **rv)
/* FIXME terminates the programme if it fails */
int get_string_from_struct_by_name(xmlrpc_value *structP, const char *element_name, char **rv)
{
xmlrpc_env env;
xmlrpc_env_init(&env);
@ -281,8 +277,7 @@ int get_int_from_struct_by_idx(xmlrpc_value *structP, int index, int *rv)
xmlrpc_value *keyP;
xmlrpc_value *valueP;
xmlrpc_struct_read_member(&env, structP, index, &keyP,
&valueP); /* increment refcount of returned values */
xmlrpc_struct_read_member(&env, structP, index, &keyP, &valueP); /* increment refcount of returned values */
die_if_fault_occurred_line(&env, __LINE__);
xmlrpc_read_int(&env, valueP, rv);
die_if_fault_occurred_line(&env, __LINE__);
@ -290,20 +285,17 @@ int get_int_from_struct_by_idx(xmlrpc_value *structP, int index, int *rv)
return 1;
}
enum _value_type
{
enum _value_type {
TYPE_NOT_DEF = 0,
TYPE_INTEGER = 1,
TYPE_STRING = 2
TYPE_STRING = 2
};
typedef enum _value_type value_type;
struct _key_value_pair
{
struct _key_value_pair {
char *key;
value_type type;
union value
{
union value {
int integer;
char *string;
void *value;
@ -312,10 +304,10 @@ struct _key_value_pair
typedef struct _key_value_pair key_value_pair;
void key_value_pair_cleanup(key_value_pair *kvp)
{
if(kvp && kvp->key) {
if (kvp && kvp->key) {
free(kvp->key);
}
if(kvp && kvp->type == TYPE_STRING && kvp->value.string) {
if (kvp && kvp->type == TYPE_STRING && kvp->value.string) {
free(kvp->value.string);
}
kvp->key = 0;
@ -329,7 +321,7 @@ void key_value_pair_cleanup(key_value_pair *kvp)
* @param rv pointer to key_value_pair
* @return 1 if succeed and 0 otherwise
*/
/* FIXME terminates the programm if it fails */
/* FIXME terminates the programme if it fails */
int get_struct_item_by_idx(xmlrpc_value *structP, int index, key_value_pair *rv)
{
xmlrpc_env env;
@ -339,12 +331,11 @@ int get_struct_item_by_idx(xmlrpc_value *structP, int index, key_value_pair *rv)
int length;
const char *string;
xmlrpc_struct_read_member(&env, structP, index, &keyP,
&valueP); /* increment refcount of returned values */
xmlrpc_struct_read_member(&env, structP, index, &keyP, &valueP); /* increment refcount of returned values */
die_if_fault_occurred_line(&env, __LINE__);
xmlrpc_read_string(&env, keyP, (const char **)&rv->key);
/* handle value type */
switch(xmlrpc_value_type(valueP)) {
switch ( xmlrpc_value_type(valueP) ) {
case XMLRPC_TYPE_INT:
xmlrpc_read_int(&env, valueP, &rv->value.integer);
die_if_fault_occurred_line(&env, __LINE__);
@ -352,19 +343,16 @@ int get_struct_item_by_idx(xmlrpc_value *structP, int index, key_value_pair *rv)
break;
case XMLRPC_TYPE_STRING:
xmlrpc_read_string(&env, valueP, &string);
printf("get_struct_item_by_idx: ptr = %p, string value = '%s'\n",
string, string);
printf("get_struct_item_by_idx: ptr = %p, string value = '%s'\n", string, string);
die_if_fault_occurred_line(&env, __LINE__);
rv->value.string = (char *)string;
rv->type = TYPE_STRING;
break;
default:
fprintf(stderr,
"Wrong type of return value in key: '%s', exiting...\n",
rv->key);
fprintf(stderr, "Wrong type of return value in key: '%s', exiting...\n", rv->key);
exit(1);
}
xmlrpc_DECREF(keyP); /* decrement refcount */
xmlrpc_DECREF(keyP); /* decrement refcount */
xmlrpc_DECREF(valueP);
die_if_fault_occurred_line(&env, __LINE__);
/* FIXME add error handling */
@ -384,7 +372,7 @@ int read_row(xmlrpc_value *structP, int index, TopItem *top_item)
char *string = 0;
elem = concat(IP_ADDR, index);
if(!get_string_from_struct_by_name(structP, elem, &string))
if ( ! get_string_from_struct_by_name(structP, elem, &string) )
goto error;
strncpy(top_item->ip_addr, string, sizeof(top_item->ip_addr));
free(string);
@ -392,25 +380,22 @@ int read_row(xmlrpc_value *structP, int index, TopItem *top_item)
free(elem);
elem = concat(LEAF_HITS_PREV, index);
if(!get_int_from_struct_by_name(
structP, elem, (unsigned int *)&top_item->leaf_hits[0]))
if ( ! get_int_from_struct_by_name(structP, elem, (unsigned int *)&top_item->leaf_hits[0]) )
goto error;
free(elem);
elem = concat(LEAF_HITS_CURR, index);
if(!get_int_from_struct_by_name(
structP, elem, (unsigned int *)&top_item->leaf_hits[1]))
if ( ! get_int_from_struct_by_name(structP, elem, (unsigned int *)&top_item->leaf_hits[1]) )
goto error;
free(elem);
elem = concat(EXPIRES, index);
if(!get_int_from_struct_by_name(
structP, elem, (unsigned int *)&top_item->expires))
if ( ! get_int_from_struct_by_name(structP, elem, (unsigned int *)&top_item->expires) )
goto error;
free(elem);
elem = concat(STATUS, index);
if(!get_string_from_struct_by_name(structP, elem, &string))
if ( ! get_string_from_struct_by_name(structP, elem, &string) )
goto error;
strncpy(top_item->status, string, sizeof(top_item->status));
free(string);
@ -419,7 +404,7 @@ int read_row(xmlrpc_value *structP, int index, TopItem *top_item)
return 1;
error:
if(string)
if ( string )
free(string);
free(elem);
@ -430,41 +415,37 @@ void print_row(TopItem *ti)
{
char *fmt;
if(!ti) {
printf("%-15s %10s %10s %10s %-10s\n", "IP address", "HITS PREV",
"HITS CURR", "EXPIRES", "STATUS");
if ( ! ti ) {
printf("%-15s %10s %10s %10s %-10s\n", "IP address", "HITS PREV", "HITS CURR", "EXPIRES", "STATUS");
return;
}
if(strlen(ti->ip_addr) > 15) // IPv6 addr
if ( strlen(ti->ip_addr) > 15 ) // IPv6 addr
fmt = "%s\n %10d %10d %10d %-10s\n";
else
fmt = "%-15s %10d %10d %10d %-10s\n";
printf(fmt, ti->ip_addr, ti->leaf_hits[0], ti->leaf_hits[1], ti->expires,
ti->status);
printf(fmt, ti->ip_addr, ti->leaf_hits[0], ti->leaf_hits[1], ti->expires, ti->status);
}
void print_row_agg(TopItem *ti) /* IPv4 only */
void print_row_agg(TopItem *ti) /* IPv4 only */
{
char *fmt;
if(!ti) {
printf("%-15s %10s %10s %5s\n", "IP address", "HITS PREV", "HITS CURR",
"COUNT");
if ( ! ti ) {
printf("%-15s %10s %10s %5s\n", "IP address", "HITS PREV", "HITS CURR", "COUNT");
return;
}
fmt = "%-15s %10d %10d %5d\n";
printf(fmt, ti->ip_addr, ti->leaf_hits[0], ti->leaf_hits[1],
ti->num_of_ips);
printf(fmt, ti->ip_addr, ti->leaf_hits[0], ti->leaf_hits[1], ti->num_of_ips);
}
uint32_t mask(int msklen)
uint32_t mask( int msklen )
{
if(msklen)
return 0xffffffff ^ ((1 << (32 - msklen)) - 1);
if ( msklen )
return 0xffffffff ^ ((1 << (32-msklen)) - 1);
else
return 0;
}
@ -474,54 +455,54 @@ void print_rows(TopItem *root, int nmemb, int mask_length)
int i;
void (*print_function)(TopItem *);
if(mask_length == 32)
if (mask_length == 32)
print_function = print_row;
else
print_function = print_row_agg;
print_function(0);
for(i = 0; i < nmemb; ++i, ++root) {
for ( i = 0; i < nmemb; ++i, ++root ) {
print_function(root);
}
}
int main(int argc, char *argv[])
int main( int argc, char *argv[] )
{
xmlrpc_env env;
xmlrpc_value *resultP;
xmlrpc_value *keyP;
xmlrpc_value *valueP;
xmlrpc_value * resultP;
xmlrpc_value * keyP;
xmlrpc_value * valueP;
int struct_size;
int i, j;
size_t length;
const char *str_key_value;
xmlrpc_int int_key_value;
const char * str_key_value;
xmlrpc_int int_key_value;
unsigned int max_hits = 0;
unsigned int rows = 0;
int rv;
char *uri;
int options; /* what kind of nodes should be processed */
int uri_pos; /* position of first non option argument */
int options; /* what kind of nodes should be processed */
int uri_pos; /* position of first non option argument */
char stropts[16];
int pos = 0;
int mask_length = 32; /* 32 means NO aggregate */
int pos = 0;
int mask_length = 32; /* 32 means NO aggregate */
if(argc - 1 < 1) {
if (argc-1 < 1) {
print_help();
exit(0);
}
uri_pos = process_options(argc, argv, &options, &mask_length);
switch(options) {
switch (options) {
case OPT_HOT:
sprintf(stropts, "HOT");
break;
sprintf(stropts, "HOT");
break;
case OPT_ALL:
sprintf(stropts, "ALL");
break;
sprintf(stropts, "ALL");
break;
case OPT_WARM:
sprintf(stropts, "WARM");
break;
sprintf(stropts, "WARM");
break;
}
printf("Nodes = %s\n", stropts);
printf("Mask = /%d\n", mask_length);
@ -538,12 +519,14 @@ int main(int argc, char *argv[])
const char * const format, ...);
*/
asprintf(&uri, "http://%s/RPC2", argv[uri_pos]);
resultP = xmlrpc_client_call(&env, uri, "pike.top", "(s)", stropts);
resultP = xmlrpc_client_call(&env, uri,
"pike.top",
"(s)", stropts);
free(uri);
die_if_fault_occurred_line(&env, __LINE__);
/* parse returned structure */
if(xmlrpc_value_type(resultP) != XMLRPC_TYPE_STRUCT) {
if ( xmlrpc_value_type(resultP) != XMLRPC_TYPE_STRUCT ) {
printf("unexpected result - should be structure\n");
xmlrpc_env_clean(&env);
xmlrpc_client_cleanup();
@ -552,84 +535,80 @@ int main(int argc, char *argv[])
struct_size = xmlrpc_struct_size(&env, resultP);
die_if_fault_occurred_line(&env, __LINE__);
// printf("Struct size: %d\n", struct_size);
// printf("Struct size: %d\n", struct_size);
if(!get_int_from_struct_by_name(resultP, MAX_HITS, &max_hits)) {
fprintf(stderr, "ERROR: %s not foung in result\n", MAX_HITS);
exit(1);
if ( ! get_int_from_struct_by_name(resultP, MAX_HITS, &max_hits) ) {
fprintf(stderr, "ERROR: %s not found in result\n", MAX_HITS);
exit (1);
}
printf("max_hits = %d\n", max_hits);
if(!get_int_from_struct_by_name(resultP, NUMBER_OF_ROWS, &rows)) {
fprintf(stderr, "ERROR: %s not foung in result\n", NUMBER_OF_ROWS);
exit(1);
if ( ! get_int_from_struct_by_name(resultP, NUMBER_OF_ROWS, &rows) ) {
fprintf(stderr, "ERROR: %s not found in result\n", NUMBER_OF_ROWS);
exit (1);
}
printf("rows = %d\n", rows);
TopItem top_items[rows];
TopItem *item; /* tmp item ptr */
TopItem *result_items = top_items; /* if no aggregation use this */
TopItem *item; /* tmp item ptr */
TopItem *result_items = top_items; /* if no aggregation use this */
memset(top_items, 0, sizeof(top_items));
/* aggregated values */
if(rows == 0)
if ( rows == 0 )
return 0;
for(i = 0, item = top_items; i < rows; ++i, ++item) {
if(!read_row(resultP, i, item)) {
for ( i = 0, item = top_items; i < rows; ++i, ++item ) {
if ( ! read_row(resultP, i, item) ) {
fprintf(stderr, "ERROR: while reading row number %d\n", i);
}
/* fill in ipv4 addr */
// printf("item[%d].ip_addr = %s, len = %d\n", i, item->ip_addr, strlen(item->ip_addr));
// printf("item[%d].ip_addr = %s, len = %d\n", i, item->ip_addr, strlen(item->ip_addr));
rv = inet_pton(AF_INET, item->ip_addr, &item->ipv4_addr);
if(rv > 0) {
// printf("IPv4 addr: %x\n", item->ipv4_addr);
if ( rv > 0 ) {
// printf("IPv4 addr: %x\n", item->ipv4_addr);
} else {
fprintf(stderr,
"IP conversion failed - not an IPv4 address: '%s'\n",
item->ip_addr); /* conversion failed from any reason */
fprintf(stderr, "IP conversion failed - not an IPv4 address: '%s'\n", item->ip_addr); /* conversion failed from any reason */
printf("item[%d].ipv4_addr = %x\n", i, item->ipv4_addr);
}
}
assert(rows > 0);
assert( rows > 0 );
/* if IP mask length is shorter than 32 then aggregate list according to the mask */
if(mask_length < 32) {
if ( mask_length < 32 ) {
uint32_t ip_mask = htonl(mask(mask_length));
qsort(top_items, rows, sizeof(TopItem),
compare_TopItem_ipv4_addr); /* sort by IPv4 */
qsort(top_items, rows, sizeof(TopItem), compare_TopItem_ipv4_addr); /* sort by IPv4 */
/* skip items without ipv4 address */
i = 0; /* index of non aggregated items */
while(!top_items[i].ipv4_addr && i < rows) {
printf("Skip item[%d] - do not has IPv4 address: %s\n", i,
top_items[i].ip_addr);
i = 0; /* index of non aggregated items */
while (!top_items[i].ipv4_addr && i < rows ) {
printf("Skip item[%d] - do not has IPv4 address: %s\n", i, top_items[i].ip_addr);
memset(&top_items[i], 0, sizeof(TopItem));
++i;
}
j = 0; /* index of aggregated items */
if(i == 0)
j = 0; /* index of aggregated items */
if ( i == 0 )
++i;
top_items[0].ipv4_addr &= ip_mask;
top_items[0].num_of_ips = 1;
inet_ntop(AF_INET, &top_items[0].ipv4_addr, top_items[0].ip_addr,
sizeof(top_items[0].ip_addr));
while(i < rows) {
inet_ntop(AF_INET, &top_items[0].ipv4_addr, top_items[0].ip_addr, sizeof(top_items[0].ip_addr));
while ( i < rows ) {
top_items[i].ipv4_addr &= ip_mask;
if(top_items[j].ipv4_addr == top_items[i].ipv4_addr) {
if ( top_items[j].ipv4_addr == top_items[i].ipv4_addr ) {
top_items[j].leaf_hits[0] += top_items[i].leaf_hits[0];
top_items[j].leaf_hits[1] += top_items[i].leaf_hits[1];
++(top_items[j].num_of_ips);
++i;
} else {
}
else {
++j;
top_items[j] = top_items[i];
top_items[j].num_of_ips = 1;
inet_ntop(AF_INET, &top_items[j].ipv4_addr,
top_items[j].ip_addr, sizeof(top_items[j].ip_addr));
inet_ntop(AF_INET, &top_items[j].ipv4_addr, top_items[j].ip_addr, sizeof(top_items[j].ip_addr));
++i;
}
}
@ -638,7 +617,7 @@ int main(int argc, char *argv[])
qsort(top_items, rows, sizeof(TopItem), compare_TopItem_hits_reverse);
print_rows(top_items, rows, mask_length);
print_rows( top_items, rows, mask_length );
/* Dispose of our result value. */
xmlrpc_DECREF(resultP);

@ -69,7 +69,7 @@ function report()
cat > $REP << EOF
first line ... time spent in tested procedure
second line (yyrestart) ... total time
third line (receive_msg) ... numer of calls
third line (receive_msg) ... number of calls
% cumulative self self total
time seconds seconds calls ms/call ms/call name
EOF

@ -25,6 +25,7 @@
*/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
@ -44,8 +45,8 @@
#include <signal.h>
static char *version = "protoshoot 0.4";
static char *help_msg = "\
static char *version="protoshoot 0.4";
static char* help_msg="\
Usage: protoshoot -f file -d address -p port -c count [-v]\n\
Options:\n\
-f file file with the content of the udp packet (max 65k)\n\
@ -68,23 +69,17 @@ Options:\n\
#define BUF_SIZE 65535
enum protos
{
PROTO_NONE,
PROTO_UDP,
PROTO_TCP,
PROTO_SCTP
};
enum protos { PROTO_NONE, PROTO_UDP, PROTO_TCP, PROTO_SCTP };
int main(int argc, char **argv)
int main (int argc, char** argv)
{
int fd;
int sock;
char c;
int n, r;
char *tmp;
int n,r;
char* tmp;
char buf[BUF_SIZE];
struct hostent *he;
struct hostent* he;
struct sockaddr_in addr;
int count;
@ -105,76 +100,76 @@ int main(int argc, char **argv)
int err;
/* init */
count = 1;
verbose = 0;
fname = 0;
dst = "127.0.0.1";
port = 5060;
usec = 0;
throttle = 0;
random_sleep = 0;
proto = PROTO_UDP;
tcp_rst = 0;
con_no = 1;
sctp_o2o = 0;
err = 0;
count=1;
verbose=0;
fname=0;
dst="127.0.0.1";
port=5060;
usec=0;
throttle=0;
random_sleep=0;
proto=PROTO_UDP;
tcp_rst=0;
con_no=1;
sctp_o2o=0;
err=0;
opterr = 0;
while((c = getopt(argc, argv, "f:c:d:p:s:t:n:rTS1RvhV")) != -1) {
switch(c) {
opterr=0;
while ((c=getopt(argc,argv, "f:c:d:p:s:t:n:rTS1RvhV"))!=-1){
switch(c){
case 'f':
fname = optarg;
fname=optarg;
break;
case 'v':
verbose++;
break;
case 'd':
dst = optarg;
dst=optarg;
break;
case 'p':
port = strtol(optarg, &tmp, 10);
if((tmp == 0) || (*tmp)) {
port=strtol(optarg, &tmp, 10);
if ((tmp==0)||(*tmp)){
fprintf(stderr, "bad port number: -p %s\n", optarg);
goto error;
}
break;
case 'c':
count = strtol(optarg, &tmp, 10);
if((tmp == 0) || (*tmp)) {
count=strtol(optarg, &tmp, 10);
if ((tmp==0)||(*tmp)){
fprintf(stderr, "bad count: -c %s\n", optarg);
goto error;
}
break;
case 's':
usec = strtol(optarg, &tmp, 10);
if((tmp == 0) || (*tmp)) {
usec=strtol(optarg, &tmp, 10);
if ((tmp==0)||(*tmp)){
fprintf(stderr, "bad count: -c %s\n", optarg);
goto error;
}
break;
case 't':
throttle = strtol(optarg, &tmp, 10);
if((tmp == 0) || (*tmp)) {
throttle=strtol(optarg, &tmp, 10);
if ((tmp==0)||(*tmp)){
fprintf(stderr, "bad count: -c %s\n", optarg);
goto error;
}
break;
case 'n':
con_no = strtol(optarg, &tmp, 10);
if((tmp == 0) || (*tmp) || (con_no < 1)) {
con_no=strtol(optarg, &tmp, 10);
if ((tmp==0)||(*tmp)||(con_no<1)){
fprintf(stderr, "bad count: -c %s\n", optarg);
goto error;
}
break;
case 'r':
random_sleep = 1;
random_sleep=1;
break;
case 'T':
proto = PROTO_TCP;
proto=PROTO_TCP;
break;
case 'S':
#ifdef USE_SCTP
proto = PROTO_SCTP;
proto=PROTO_SCTP;
#else
fprintf(stderr, "sctp not supported (recompile with "
"-DUSE_SCTP)\n");
@ -182,10 +177,10 @@ int main(int argc, char **argv)
#endif /* USE_SCTP */
break;
case '1':
sctp_o2o = 1;
sctp_o2o=1;
break;
case 'R':
tcp_rst = 1;
tcp_rst=1;
break;
case 'V':
printf("version: %s\n", version);
@ -197,85 +192,84 @@ int main(int argc, char **argv)
exit(0);
break;
case '?':
if(isprint(optopt))
if (isprint(optopt))
fprintf(stderr, "Unknown option '-%c'\n", optopt);
else
fprintf(stderr, "Unknown character '\\x%x'\n", optopt);
goto error;
case ':':
fprintf(stderr, "Option '-%c' requires an argument.\n", optopt);
fprintf(stderr, "Option '-%c' requires an argument.\n",
optopt);
goto error;
break;
default:
abort();
abort();
}
}
/* check if all the required params are present */
if(fname == 0) {
if (fname==0){
fprintf(stderr, "Missing -f file\n");
exit(-1);
}
if(dst == 0) {
if (dst==0){
fprintf(stderr, "Missing destination (-d ...)\n");
exit(-1);
}
if(port == 0) {
if(port==0){
fprintf(stderr, "Missing port number (-p port)\n");
exit(-1);
} else if(port < 0) {
}else if(port<0){
fprintf(stderr, "Invalid port number (-p %d)\n", port);
exit(-1);
}
if(count == 0) {
if(count==0){
fprintf(stderr, "Missing packet count (-c number)\n");
exit(-1);
} else if(count < 0) {
}else if(count<0){
fprintf(stderr, "Invalid packet count (-c %d)\n", count);
exit(-1);
}
if(proto == PROTO_UDP || (proto == PROTO_SCTP && !sctp_o2o))
con_no = 1;
if (proto==PROTO_UDP || (proto==PROTO_SCTP && !sctp_o2o)) con_no=1;
/* ignore sigpipe */
if(signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
if (signal(SIGPIPE, SIG_IGN)==SIG_ERR){
fprintf(stderr, "failed to ignore SIGPIPE: %s\n", strerror(errno));
exit(-1);
}
/* open packet file */
fd = open(fname, O_RDONLY);
if(fd < 0) {
fd=open(fname, O_RDONLY);
if (fd<0){
fprintf(stderr, "ERROR: loading packet-file(%s): %s\n", fname,
strerror(errno));
goto error;
}
n = read(fd, buf, BUF_SIZE);
if(n < 0) {
n=read(fd, buf, BUF_SIZE);
if (n<0){
fprintf(stderr, "ERROR: reading file(%s): %s\n", fname,
strerror(errno));
goto error;
}
if(verbose)
printf("read %d bytes from file %s\n", n, fname);
if (verbose) printf("read %d bytes from file %s\n", n, fname);
close(fd);
/* resolve destination */
he = gethostbyname(dst);
if(he == 0) {
he=gethostbyname(dst);
if (he==0){
fprintf(stderr, "ERROR: could not resolve %s\n", dst);
goto error;
}
/* open socket*/
addr.sin_family = he->h_addrtype;
addr.sin_port = htons(port);
addr.sin_family=he->h_addrtype;
addr.sin_port=htons(port);
#ifdef HAVE_SOCKADDR_SA_LEN
addr.sin_len = sizeof(struct sockaddr_in);
addr.sin_len=sizeof(struct sockaddr_in);
#endif
memcpy(&addr.sin_addr.s_addr, he->h_addr_list[0], he->h_length);
for(k = 0; k < con_no; k++) {
switch(proto) {
for (k=0; k<con_no; k++){
switch(proto){
case PROTO_UDP:
sock = socket(he->h_addrtype, SOCK_DGRAM, 0);
break;
@ -285,112 +279,100 @@ int main(int argc, char **argv)
#ifdef USE_SCTP
case PROTO_SCTP:
sock = socket(he->h_addrtype,
sctp_o2o ? SOCK_STREAM : SOCK_SEQPACKET, IPPROTO_SCTP);
sctp_o2o?SOCK_STREAM:SOCK_SEQPACKET,
IPPROTO_SCTP);
break;
#endif /* USE_SCTP */
default:
fprintf(stderr, "BUG: unkown proto %d\n", proto);
goto error;
}
if(sock == -1) {
if (sock==-1){
fprintf(stderr, "ERROR: socket: %s\n", strerror(errno));
goto error;
}
if(proto == PROTO_TCP) {
t = 1;
if(setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &t, sizeof(t)) < 0) {
if (proto==PROTO_TCP){
t=1;
if (setsockopt(sock, IPPROTO_TCP , TCP_NODELAY, &t, sizeof(t))<0){
fprintf(stderr, "ERROR: could not disable Nagle: %s\n",
strerror(errno));
strerror(errno));
}
if(tcp_rst) {
t_linger.l_onoff = 1;
t_linger.l_linger = 0;
if(setsockopt(sock, SOL_SOCKET, SO_LINGER, &t_linger,
sizeof(t_linger))
< 0) {
if (tcp_rst){
t_linger.l_onoff=1;
t_linger.l_linger=0;
if (setsockopt(sock, SOL_SOCKET, SO_LINGER, &t_linger,
sizeof(t_linger))<0){
fprintf(stderr, "ERROR: could not set SO_LINGER: %s\n",
strerror(errno));
strerror(errno));
}
}
}
#ifdef USE_SCTP
else if(proto == PROTO_SCTP) {
t = 1;
if(setsockopt(sock, IPPROTO_SCTP, SCTP_NODELAY, &t, sizeof(t))
< 0) {
else if (proto==PROTO_SCTP){
t=1;
if (setsockopt(sock, IPPROTO_SCTP, SCTP_NODELAY, &t, sizeof(t))<0){
fprintf(stderr, "ERROR: could not disable Nagle: %s\n",
strerror(errno));
strerror(errno));
}
}
#endif /* USE_SCTP */
if(
if (
#ifdef USE_SCTP
(proto != PROTO_SCTP || sctp_o2o) &&
(proto!=PROTO_SCTP || sctp_o2o) &&
#endif /* USE_SCTP */
(connect(sock, (struct sockaddr *)&addr,
sizeof(struct sockaddr))
!= 0)) {
(connect(sock, (struct sockaddr*) &addr,
sizeof(struct sockaddr))!=0)){
fprintf(stderr, "ERROR: connect: %s\n", strerror(errno));
goto error;
}
/* flood loop */
t = throttle;
for(r = 0; r < count; r++) {
if((verbose > 1) && ((r % 1000) == 999)) {
putchar('.');
fflush(stdout);
}
t=throttle;
for (r=0; r<count; r++){
if ((verbose>1)&&((r%1000)==999)){ putchar('.'); fflush(stdout); }
#ifdef USE_SCTP
if(proto == PROTO_SCTP && !sctp_o2o) {
if(sctp_sendmsg(sock, buf, n, (struct sockaddr *)&addr,
sizeof(struct sockaddr), 0, SCTP_UNORDERED, 0, 0, 0)
== -1) {
if (proto==PROTO_SCTP && !sctp_o2o){
if (sctp_sendmsg(sock, buf, n, (struct sockaddr*) &addr,
sizeof(struct sockaddr), 0, SCTP_UNORDERED,
0, 0, 0)==-1){
fprintf(stderr, "Error(%d): send: %s\n", err,
strerror(errno));
err++;
;
err++;;
}
} else
}else
#endif /* USE_SCTP */
{
if(send(sock, buf, n, 0) == -1) {
if (send(sock, buf, n, 0)==-1) {
fprintf(stderr, "Error(%d): send: %s\n", err,
strerror(errno));
err++;
;
err++;;
}
}
if(usec) {
if (usec){
t--;
if(t == 0) {
usleep(random_sleep ? (unsigned long)((double)usec * rand()
/ RAND_MAX)
: usec);
t = throttle;
if (t==0){
usleep(random_sleep?
(unsigned long)((double)usec*rand()/RAND_MAX):usec);
t=throttle;
}
}
}
close(sock);
if((verbose) && (k % 1000 == 999)) {
putchar('#');
fflush(stdout);
}
if ((verbose) && (k%1000==999)) { putchar('#'); fflush(stdout); }
}
if(proto == PROTO_TCP || proto == PROTO_SCTP) {
if (proto==PROTO_TCP || proto==PROTO_SCTP){
printf("\n%d packets sent on %d %s connections (%d on each of them),"
" %d bytes each => total %d bytes\n",
count * con_no - err, con_no,
(proto == PROTO_TCP) ? "tcp" : "sctp", count, n,
(con_no * count - err) * n);
} else {
" %d bytes each => total %d bytes\n",
count*con_no-err, con_no, (proto==PROTO_TCP)?"tcp":"sctp",
count, n,
(con_no*count-err)*n);
}else{
printf("\n%d packets sent, %d bytes each => total %d bytes\n",
count - err, n, n * (count - err));
count-err, n, n*(count-err));
}
if(err)
printf("%d errors\n", err);
if (err) printf("%d errors\n", err);
exit(0);
error:

@ -81,7 +81,7 @@ $debugfilecolors=$options{c};
unlink $filedebug if(defined $filedebug);
#open PIPE
open(PIPE,"$ngrep $ngrep_flags |") or die "Can't run '$ngrep' programm: $!\n";
open(PIPE,"$ngrep $ngrep_flags |") or die "Can't run '$ngrep' programme: $!\n";
select(PIPE); $| = 1; # make unbuffered
select(STDOUT); $| = 1; # make unbuffered

@ -4,7 +4,7 @@
# Maintainer: Nathan Angelacos <nangel@alpinelinux.org>
pkgname=kamailio
pkgver=5.7.4
pkgver=5.8.1
pkgrel=0
# If building from a git snapshot, specify the gitcommit
@ -27,7 +27,7 @@ depends="gawk"
options="!check"
makedepends="bison db-dev flex freeradius-client-dev expat-dev
lksctp-tools-dev perl-dev postgresql-dev python3-dev
pcre-dev mariadb-dev libxml2-dev curl-dev unixodbc-dev
pcre2-dev mariadb-dev libxml2-dev curl-dev unixodbc-dev
confuse-dev ncurses-dev sqlite-dev lua-dev openldap-dev openssl-dev
net-snmp-dev libuuid libev-dev jansson-dev json-c-dev libevent-dev
linux-headers libmemcached-dev rabbitmq-c-dev hiredis-dev
@ -79,7 +79,7 @@ _mod_list_dbuid="db2_ops uid_auth_db uid_avp_db uid_domain uid_gflags \
# - modules for devel purposes
_mod_list_devel="misctest print print_lib"
# - modules depending on pcre3 library
# - modules depending on pcre2 library
_mod_list_pcre="dialplan lcr regex"
# - modules depending on radius client library
@ -131,7 +131,7 @@ _mod_list_purple="purple"
_mod_list_memcached="memcached"
# - modules depending on openssl library
_mod_list_tls="auth_identity crypto tls"
_mod_list_tls="crypto tls"
# - modules depending on openssl library
_mod_list_outbound="outbound"
@ -227,9 +227,6 @@ _mod_list_jansson="acc_json jansson janssonrpcc"
# - modules depending on libm
_mod_list_jsdt="app_jsdt"
# - modules depending on sqlang
_mod_list_sqlang="app_sqlang"
# - modules depending on rabbitmq
_mod_list_rabbitmq="rabbitmq"
@ -251,7 +248,7 @@ for _i in db postgres sqlite dbtext mysql \
cpl xml unixodbc snmpstats xmpp carrierroute \
ldap utils tls presence lua ims outbound debugger \
extras json websocket authephemeral mongodb\
uuid ev memcached redis geoip2 jansson sqlang sipdump \
uuid ev memcached redis geoip2 jansson sipdump \
jsdt http_async kazoo rabbitmq sctp radius perl \
python3 ruby; do
@ -557,11 +554,6 @@ ruby() {
"$_mod_list_ruby"
}
sqlang() {
_generic_pkg "Squirrel Language (SQLang) for Kamailio" \
"$_mod_list_sqlang"
}
rabbitmq() {
_generic_pkg "RabbitMQ related modules for Kamailio" \
"$_mod_list_rabbitmq"

@ -1,72 +1,41 @@
kamailio (5.7.4) unstable; urgency=medium
kamailio (5.8.1) unstable; urgency=medium
* version set 5.7.4
* version set 5.8.1
-- Victor Seva <vseva@debian.org> Thu, 18 Jan 2024 10:29:35 +0100
-- Victor Seva <vseva@debian.org> Wed, 03 Apr 2024 08:21:53 +0200
kamailio (5.7.3) unstable; urgency=medium
kamailio (5.8.0) unstable; urgency=medium
* version set 5.7.3
* version set 5.8.0
-- Victor Seva <vseva@debian.org> Fri, 17 Nov 2023 09:50:31 +0100
-- Victor Seva <vseva@debian.org> Thu, 07 Mar 2024 11:40:20 +0100
kamailio (5.7.2) unstable; urgency=medium
kamailio (5.8.0~rc0) unstable; urgency=medium
* version set 5.7.2
* version set 5.8.0~rc0
-- Victor Seva <vseva@debian.org> Wed, 27 Sep 2023 08:44:32 +0200
-- Victor Seva <vseva@debian.org> Fri, 23 Feb 2024 20:04:35 +0100
kamailio (5.7.1) unstable; urgency=medium
kamailio (5.8.0~pre0) unstable; urgency=medium
* version set 5.7.1
* version set 5.8.0~pre0
-- Victor Seva <vseva@debian.org> Wed, 28 Jun 2023 09:35:54 +0200
-- Victor Seva <vseva@debian.org> Fri, 02 Feb 2024 15:20:05 +0100
kamailio (5.7.0) unstable; urgency=medium
kamailio (5.8.0~dev2) unstable; urgency=medium
* version set 5.7.0
* version set 5.8.0~dev2
-- Victor Seva <vseva@debian.org> Tue, 16 May 2023 12:57:51 +0200
-- Victor Seva <vseva@debian.org> Tue, 05 Dec 2023 12:04:06 +0100
kamailio (5.7.0~rc0) unstable; urgency=medium
kamailio (5.8.0~dev1) unstable; urgency=medium
* version set 5.7.0~rc0
* version set 5.8.0~dev1
-- Victor Seva <vseva@debian.org> Thu, 04 May 2023 21:41:57 +0200
-- Victor Seva <vseva@debian.org> Wed, 28 Jun 2023 15:03:56 +0200
kamailio (5.7.0~pre0) unstable; urgency=medium
kamailio (5.8.0~dev0) unstable; urgency=medium
* version set 5.7.0~pre0
-- Victor Seva <vseva@debian.org> Mon, 17 Apr 2023 09:08:01 +0200
kamailio (5.7.0~dev4) unstable; urgency=medium
* version set 5.7.0~dev4
-- Victor Seva <vseva@debian.org> Mon, 17 Apr 2023 09:07:10 +0200
kamailio (5.7.0~dev3) unstable; urgency=medium
* version set 5.7.0~dev3
-- Victor Seva <vseva@debian.org> Tue, 10 Jan 2023 14:07:12 +0100
kamailio (5.7.0~dev2) unstable; urgency=medium
* version set 5.7.0~dev2
-- Victor Seva <vseva@debian.org> Mon, 28 Nov 2022 11:54:03 +0100
kamailio (5.7.0~dev1) unstable; urgency=medium
* version set 5.7.0~dev1
-- Victor Seva <vseva@debian.org> Sun, 28 Aug 2022 22:36:28 +0200
kamailio (5.7.0~dev0) unstable; urgency=medium
* version set 5.7.0~dev0
-- Victor Seva <vseva@debian.org> Thu, 05 May 2022 12:47:44 +0200
* version set 5.8.0~dev0
-- Victor Seva <vseva@debian.org> Thu, 04 May 2023 21:45:08 +0200

@ -31,7 +31,7 @@ Build-Depends:
libmono-2.0-dev [amd64 armel armhf i386 mipsel kfreebsd-amd64 kfreebsd-i386 ppc64 ppc64el s390x],
libmosquitto-dev,
libncurses5-dev,
libpcre3-dev,
libpcre2-dev,
libperl-dev,
libphonenumber-dev (>= 7),
libpq-dev,

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

Loading…
Cancel
Save