sip-router
11 years agoStrip, prefix, rewriteuser, ... all the SET_* actions preserve the
Miklos Tirpak [Tue, 10 Mar 2009 16:26:35 +0000 (16:26 +0000)]
Strip, prefix, rewriteuser, ... all the SET_* actions preserve the
original URI scheme unless the host name is rewritten. If the host name
is set, then tel: and tels: URIs are converted to sip: or sips:, and the
user=phone parameter is added.

A script function, userphone(), is introduced: It adds the "user=phone"
parameter to a sip: or sips: RURI if the param is not yet present.
(Does not change tel: and tels: URIs).

(Patch has been created with cooperation with Michal Matyska.)
Fixes SER-435.

11 years agocore: check & fix Content-Length when sending on tcp
Andrei Pelinescu-Onciul [Mon, 9 Mar 2009 13:47:48 +0000 (13:47 +0000)]
core: check & fix Content-Length when sending on tcp

- automatically check & fix wrong Content-Length before forwarding
  on tcp or tls

11 years agotcp: config option for the async write block size
Andrei Pelinescu-Onciul [Mon, 9 Mar 2009 13:45:49 +0000 (13:45 +0000)]
tcp: config option for the async write block size

 - the block size used for the async writes can now be configured
   both from ser.cfg (tcp_wq_blk_size) and at runtime. This value
   has only a little performance impact and only when writes are
   delayed.  Small values are safer (big values on proxies that
   open thousands of connections over slow links would eat up a
   lot of memory). For now it's main use is debugging.

11 years agotcp: config option for the read buffer size
Andrei Pelinescu-Onciul [Mon, 9 Mar 2009 13:45:28 +0000 (13:45 +0000)]
tcp: config option for the read buffer size

- the read buffer size can now be configured both at runtime and
  from ser.cfg (tcp_rd_buf_size). A high value will help
  performance for tcp connections with lots of traffic, however it
  will increase the memory consumption. As a rule of thumb use
  high values(e.g. 32768, 65536) on servers which open only a few
  tcp connections and have very heavy traffic on them and a low
  value (e.g. 4096, 2048) on servers that are expected to have
  lots of open connections (50k - 100k+). Note also that this
  value will also limit the maximum sip datagram size that can be
  received on tcp. The default value is 4096.

11 years agotcp: dyn. config fix for tcp_con_lifetime
Andrei Pelinescu-Onciul [Mon, 9 Mar 2009 13:39:10 +0000 (13:39 +0000)]
tcp: dyn. config fix for tcp_con_lifetime

- cfg.set_delayed_int didn't work (fixup tried to modify another
  config variable which doesn't work with cfg.set_delayed*)

11 years agotcp: diff. connect timeout for async & states cleanup
Andrei Pelinescu-Onciul [Fri, 6 Mar 2009 16:54:10 +0000 (16:54 +0000)]
tcp: diff. connect timeout for async & states cleanup

- async mode will now honour tcp_connect_timeout (up to now it
  used tcp_send_timeout also for connects)
- internal states cleanup (dropped S_CONN_PENDING, fixed
  S_CONN_ACCEPT->S_CONN_OK transition a.s.o)

11 years agotcp: config option to disable active connects
Andrei Pelinescu-Onciul [Thu, 5 Mar 2009 17:21:30 +0000 (17:21 +0000)]
tcp: config option to disable active connects

- added new config option to disable active connects. If set ser
  will only accept new connection, it will not actively open new
  ones.
  The option can be set both in ser.cfg (tcp_no_connect=yes) or
  at runtime (sercmd cfg.set_now_int tcp no_connect 1).

11 years agotcp: async mode on by default
Andrei Pelinescu-Onciul [Thu, 5 Mar 2009 17:21:11 +0000 (17:21 +0000)]
tcp: async mode on by default

- async mode is now on by default (use tcp_async=no in the config
  to disable it)
- renamed tcp_buf_write/TCP_BUF_WRITE into tcp_async/TCP_ASYNC in
  the code

11 years agotcp: enable runtime changing for most of the cfg vars
Andrei Pelinescu-Onciul [Thu, 5 Mar 2009 17:20:53 +0000 (17:20 +0000)]
tcp: enable runtime changing for most of the cfg vars

- following tcp config variables can now be changes at runtime:
  connect_timeout, send_timeout, connection_lifetime,
  max_connections (can be decreased, it cannot be increased more
  then the startup value), conn_wq_max, wq_max, crlf_ping,
  accept_aliases, alias_flags, new_conn_alias_flags.
- the following variables can be changes but they will affect only
  new connections opened by ser: delayed_ack, syncnt, linger2,
  keepalive, keepidle, keepintvl, keepcnt
  (for the ser.cfg equivalent, just add tcp_ in front of the
  variable name; for help and grep NEWS)

- updated core.tcp_options to dump all the tcp config options

11 years agotcp: use dynamic config framework, part 2
Andrei Pelinescu-Onciul [Thu, 5 Mar 2009 17:20:42 +0000 (17:20 +0000)]
tcp: use dynamic config framework, part 2

- added tcp_connect_timeout, tcp_send_timeout,
  tcp_connection_lifetime, tcp_max_connections, tcp_accept_aliases
  to the config framework.

- added 2 new tcp related variables: tcp alias_flags and tcp
  new_conn_alias_flags

11 years agotcp: use dynamic config framework, part 1
Andrei Pelinescu-Onciul [Thu, 5 Mar 2009 17:20:22 +0000 (17:20 +0000)]
tcp: use dynamic config framework, part 1

- all tcp config variables from tcp_options.h migrated to the
  dynamic configuration framework. For now all are read only, but
  write support will come soon where it makes sense.
  E.g.: (with the cfg_rpc module loaded)
  $ sercmd cfg.help tcp async
  async mode for writes and connects
  (parameter type is integer)

  $ sercmd cfg.get tcp async
  0

11 years agotest: updated parse uri test program
Andrei Pelinescu-Onciul [Wed, 4 Mar 2009 20:56:21 +0000 (20:56 +0000)]
test: updated parse uri test program

11 years agosctp: rpc info command
Andrei Pelinescu-Onciul [Wed, 4 Mar 2009 20:56:11 +0000 (20:56 +0000)]
sctp: rpc info command

- added core.sctp_info which returns some very general sctp
  information (opened associations, tracked ones, total
  associations opened from startup).
  E.g.:
  $ sercmd core.sctp_info
{
opened_connections: 0
tracked_connections: 0
total_connections: 50007
}

11 years agosctp: connection reuse & connection tracking
Andrei Pelinescu-Onciul [Wed, 4 Mar 2009 20:56:00 +0000 (20:56 +0000)]
sctp: connection reuse & connection tracking

- support for sctp connection tracking and true sctp connection
  reuse for replies.
  We need this to support reply connection reuse with asymmetric
  sctp peers (while there is no reason not to use the same port on
  sctp for sending and receiving messages and it should be
  strongly discouraged to do so, we never now with what
  implementation we'll have to deal).
  What  makes this particularly complex is the not-yet-complete
  sctp API, the slight but important behaviour
  differences between its linux, freebsd and solaris
  implementations and the fact that is more geared towards serial
  single threaded application rather then parallel-processing
  multi-process or multi-threaded ones.

- keep track of the number of active and tracked sctp connections

- blacklist moved into sctp_handles_assoc_change()

11 years agosctp: empty sctp_handle_assoc_change added
Andrei Pelinescu-Onciul [Wed, 4 Mar 2009 20:55:44 +0000 (20:55 +0000)]
sctp: empty  sctp_handle_assoc_change added

11 years agoregfree() function call is added to free the memory allocated by regcomp().
Miklos Tirpak [Tue, 3 Mar 2009 12:46:40 +0000 (12:46 +0000)]
regfree() function call is added to free the memory allocated by regcomp().

11 years agoReplace explicit flag values with bit shifts for better readability
Jan Janak [Mon, 2 Mar 2009 21:42:09 +0000 (21:42 +0000)]
Replace explicit flag values with bit shifts for better readability

11 years agosctp: direct blacklist support
Andrei Pelinescu-Onciul [Fri, 27 Feb 2009 21:15:27 +0000 (21:15 +0000)]
sctp: direct blacklist support

- blacklist support at the sctp level. If sctp_send_retries are
  used, the blacklist will work only for send (using
  SCTP_SEND_FAILED notifications). If sctp_send_retries is not
  used (default), there are 2 possible blacklist reasons: SEND or
  CONNECT (assoc. failed to be opened).

11 years agoSupport for MESSAGE and OPTIONS method types are added to the parser.
Miklos Tirpak [Fri, 27 Feb 2009 09:01:42 +0000 (09:01 +0000)]
Support for MESSAGE and OPTIONS method types are added to the parser.

11 years agolog/dbg: level is not limited anymore
Andrei Pelinescu-Onciul [Thu, 26 Feb 2009 23:14:12 +0000 (23:14 +0000)]
log/dbg: level is not limited anymore

The recent changes to LOG() added a new limitation: the log level
was restricted to one of the L_ macros. Using another level (e.g.
L_DBG+1) would trigger an assert(). Now any level is allowed. If
the level is not among the defined range (L_ALERT - L_DBG), the
prefix will be skipped (e.g. "DBG") and the syslog level will be
set to either the L_ALERT or the L_DBG one. This fixes problems
with log() from the script, or when using a very high debug level
and something like memdbg=7.

11 years agoconfig: tcp_async alias for tcp_buf_write
Andrei Pelinescu-Onciul [Thu, 26 Feb 2009 23:13:59 +0000 (23:13 +0000)]
config: tcp_async alias for tcp_buf_write

- tcp_buf_write was not the best choosen name, so tcp_async was added as an
  alias for it

11 years agotcp: async write timeout fixes
Andrei Pelinescu-Onciul [Thu, 26 Feb 2009 23:13:44 +0000 (23:13 +0000)]
tcp: async write timeout fixes

- fixed a wrong write timeout test on connection-read-release
 (TICKS_LE instead of TICKS_GE)

- fixed initial write timeout after connection creation (the
  timeout was ended up set to tcp_con_lifetime instead of
  tcp_wq_timeout)

11 years agotcp: blacklist at tcp level if possible
Andrei Pelinescu-Onciul [Thu, 26 Feb 2009 23:13:22 +0000 (23:13 +0000)]
tcp: blacklist at tcp level if possible

- automatically blacklist destinations if connecting to them fails
  (BLST_ERR_CONNECT) or send fails (BLST_ERR_SEND), either due to a
  protocol error (RST, protocol level timeout a.s.o), or because
  of a ser level send/connect timeout.
 Note: in this cases the sip_msg parameter of the blacklist will
 be null (since in general the message triggering the error is not
 known), so if you register a blacklist callback you should make
 sure it works with null sip_msgs too.

- if a connection is in a connect pending state (S_CONN_CONNECT)
  and something is read on it, move it into established state
  (S_CONN_OK). This can happen only in tcp async mode.

- fix transition directly to S_CONN_OK from S_CONN_PENDING (should go
  through S_CONN_CONNECT first)

11 years agoblst: another blacklist dest. function version
Andrei Pelinescu-Onciul [Thu, 26 Feb 2009 23:09:22 +0000 (23:09 +0000)]
blst: another blacklist dest. function version

- added dst_blacklist_su(), which is a variant of dst_blacklist_add()
 (different way of passing the blacklist target)

11 years agocfg_size macro renamed to cfg_sizeof to avoid a conflict with one of the
Jan Janak [Thu, 26 Feb 2009 11:39:37 +0000 (11:39 +0000)]
cfg_size macro renamed to cfg_sizeof to avoid a conflict with one of the
functions in libconfuse, this library is used by one of the kamailio modules.

Acked by Miklos Tirpak.

11 years agotcp: fix compilation problem on solaris (FIONREAD)
Andrei Pelinescu-Onciul [Mon, 16 Feb 2009 17:20:17 +0000 (17:20 +0000)]
tcp: fix compilation problem on solaris (FIONREAD)

- on solaris include <sys/filio.h> if present, else define BSD_COMP before
 including ioctl.h.

Reported-by: Vance Shipley vances at motivity ca.
11 years agocore: fix bad level name in new LOG()
Andrei Pelinescu-Onciul [Mon, 16 Feb 2009 15:35:56 +0000 (15:35 +0000)]
core: fix bad level name in new LOG()

- the syslog LOG_() used log_level_info[(level)].name (which
  produced a wrong log level) instead of LOG_LEVEL2NAME(level)
- coding style fixes ( lines < 80 chars)

11 years agot_check_status() checks also the blind UACs if t_pick_branch()
Miklos Tirpak [Wed, 28 Jan 2009 14:49:55 +0000 (14:49 +0000)]
t_check_status() checks also the blind UACs if t_pick_branch()
fails to determine the picked branch in failure_route.
Closes SER-434.

11 years agoDocumenting t_lookup_cancel() script function.
Miklos Tirpak [Tue, 20 Jan 2009 12:45:20 +0000 (12:45 +0000)]
Documenting t_lookup_cancel() script function.

11 years agoRemoving set_t() from t_lookup_cancel() function, and introducing
Miklos Tirpak [Tue, 20 Jan 2009 10:38:50 +0000 (10:38 +0000)]
Removing set_t() from t_lookup_cancel() function, and introducing
an optional parameter. See the bug report SER-432.

11 years agoupdated udp_mtu handling code - fixes SER-433
Michal Matyska [Mon, 19 Jan 2009 15:47:25 +0000 (15:47 +0000)]
updated udp_mtu handling code - fixes SER-433

- call apply lumps with the original send_info, so the lumps are generated the same way their length was calculated, so there is no buffer overflow.
- this has also the expected and wanted side-effect that the record route is done as the outgoing path would be UDP (do not insert double record-route header)

11 years agodocumenting t_is_expired() function
Miklos Tirpak [Fri, 16 Jan 2009 09:47:58 +0000 (09:47 +0000)]
documenting t_is_expired() function

11 years agot_is_expired() script function is introduced.
Miklos Tirpak [Fri, 16 Jan 2009 09:24:49 +0000 (09:24 +0000)]
t_is_expired() script function is introduced.
It returns true if the transaction lifetime timer has already been
expired.

11 years ago* logging API updated (see doc/logging-api.txt for details)
Ondrej Martinek [Tue, 6 Jan 2009 17:14:12 +0000 (17:14 +0000)]
* logging API updated (see doc/logging-api.txt for details)

  - LOG(LEVEL, FMT, ARGS...) and the short macro corresponding to
    LEVEL level made eqvivalent (eg. LOG(L_DBG, FMT, ARGS...) and
    DBG(FMT, ARGS...) prints always the same message)

  - changed the format of log messages produced by the macros
    to include the log level, module name, filename, line (if applicable)

  - added new, internal LOG_(LEVEL, PREFIX, FORMAT, ARGS...) macro

  - removed DPrint() and DEBUG() macros, L_DEFAULT log level and dprint()
    function

!!!
!!! IMPORTANT! READ ME!
!!!

These changes (mainly the first two) require reformating of the most log
messages in SER core and module source files.  This step can be done
automatically by running "scripts/logging/fix-logs-all" script BUT it
was NOT originally performed because it would have generated too many
changes in CVS which was discouraged by Andrei.  Instead, the developers
are expected to run it when ready.

11 years ago- AS support disabled by default.
Bogdan Pintea [Mon, 5 Jan 2009 21:32:26 +0000 (21:32 +0000)]
- AS support disabled by default.
- added forgotten define guards for a mem free specific to AS support code
  only.

11 years agoWhen building the route set of ACKs for local UACs, only the reply is now
Bogdan Pintea [Mon, 5 Jan 2009 21:26:44 +0000 (21:26 +0000)]
When building the route set of ACKs for local UACs, only the reply is now
evaluated; this is insufficient, since replies to in-dialog requests normally
miss the route set. The patch fixes that: evals INVITE, if this was in-dialog;
otherwise, the reply (since the req. doesn't have yet complete route set).

Add support for the SASI if'ace, adding the implemenation for two more TM API
functions:
- t_get_canceled_ident(): returns the hash coordinates (bucket/index) of the
  transaction the currently processed CANCEL is targeting
- ack_local_uac(): allow generating the ACKs for 2xx'ed locally originated
  INVITEs - new headers and body can now also be appended to it.

Fully closes #SER-346.

11 years agoIn case the AVP is a regexp, an allocation is required to build an AVP
Bogdan Pintea [Sun, 4 Jan 2009 15:34:54 +0000 (15:34 +0000)]
In case the AVP is a regexp, an allocation is required to build an AVP
"ident". The patch adds the functionality to free it.

Closes #SER-344.

11 years agoCurrently, SER matches E2E ACKs only if there is an equality between From HF
Bogdan Pintea [Sun, 4 Jan 2009 15:27:39 +0000 (15:27 +0000)]
Currently, SER matches E2E ACKs only if there is an equality between From HF
in INVITE and ACK. While this is pretty safe, there are UAs that do mess small
things, like display name, or some bigger ones, like URI, in generated ACK.
However, matching over the full URI (or worse, HF) is not needed and was even
intended for deprecation (see 1st comment of 3261#Sec. 12.2.1.1).
The applied patch should boost a bit the matching flexibility - only compare
the tag.

Closes #SER-419.

11 years agoThe calculate_routeset_length() produces an invalid result in the case
Bogdan Pintea [Sun, 4 Jan 2009 15:02:11 +0000 (15:02 +0000)]
The calculate_routeset_length() produces an invalid result in the case
dlg_t.hooks.last_route is set (and .first_route not).
Applied patch fixes that (and should hopefully be a bit cleaner).

Closes #SER-421.

11 years ago'memapp' and 'append_mem_block' are now both only used in source
Bogdan Pintea [Sun, 4 Jan 2009 14:58:36 +0000 (14:58 +0000)]
'memapp' and 'append_mem_block' are now both only used in source
t_msgbuilder.c. Applied patch removes the definition of both from .h.: memapp
moved to .c, append_mem_block only left in .c.
(Interestingly, gcc complained over different definitions, but accepted same
definition twice, for same identifier.)

Closes #SER-422.

11 years ago"Route :" prefix (and separator) is used some more time across the
Bogdan Pintea [Sun, 4 Jan 2009 14:52:42 +0000 (14:52 +0000)]
"Route :" prefix (and separator) is used some more time across the
source. It was defined 3 times (with a small variation). Applied patch
moves the definition to global config.h.

Closes #SER-420.

11 years agoscript: udp_mtu fallback script config & commands
Andrei Pelinescu-Onciul [Thu, 18 Dec 2008 16:09:16 +0000 (16:09 +0000)]
script: udp_mtu fallback script config & commands

new config variables:
 - udp_mtu = number  - size in bytes after which fallback to
   another protocol will be attempted. Default 0 (off),
   recommended 1300.
 - udp_mtu_try_proto = TCP|TLS|SCTP|UDP - protocol to fallback to.
   Default: UDP (off).
 - force_rport = yes|no - global force_rport().

new script commands:
 - udp_mtu_try_proto(TCP|TLS|SCTP|UDP) - like udp_mtu_try_proto
   above but works on a per packet basis and not globally.

Author: Andrei Pelinescu-Onciul <andrei@iptel.org>

11 years agocore: forward: tcp fallback for big udp packets
Andrei Pelinescu-Onciul [Thu, 18 Dec 2008 16:06:03 +0000 (16:06 +0000)]
core: forward: tcp fallback for big udp packets

- support for tcp, tls or sctp fallback for udp forwarded requests
  that end up bigger then udp_mtu (configurable, disabled by
  default). For such messages only the Via is changed (for example
  the original built for udp Record-Route is kept untouched so
  that subsequent messages in the dialog will use udp if smaller
  then udp_mtu).
- udp_mtu and udp_mtu_try_proto (fallback proto) can be changed at
  runtime via the cfg framework
  (e.g. sercmd cfg.set_now_int core udp_mtu 1300;
        cfg.set_now_int core udp_mtu_try_proto 2 )
- force_rport can now be set globally using the config framework
  (e.g. sercmd cfg.set_now_int core force_rport 1 )

Author: Andrei Pelinescu-Onciul <andrei@iptel.org>

11 years agodns: fix build warnings when compiling without ipv6
Andrei Pelinescu-Onciul [Tue, 16 Dec 2008 14:35:55 +0000 (14:35 +0000)]
dns: fix build warnings when compiling without ipv6

Author: Vance Shipley <vances@motivity.ca>
Committer: Andrei Pelinescu-Onciul <andrei@iptel.org>

11 years agocore: fix build on Darwin
Andrei Pelinescu-Onciul [Tue, 16 Dec 2008 14:34:04 +0000 (14:34 +0000)]
core: fix build on Darwin

Author: Alfred Heggestad <aeh@db.org>
Committer: Andrei Pelinescu-Onciul <andrei@iptel.org>

11 years agodoc: tcp tunning update
Andrei Pelinescu-Onciul [Tue, 16 Dec 2008 14:30:48 +0000 (14:30 +0000)]
doc: tcp tunning update

- update with epoll tunning for kernels >= 2.6.27.8

Author: Andrei Pelinescu-Onciul <andrei@iptel.org>

11 years agosctp: SO_REUSEADDR on the sctp sockets
Andrei Pelinescu-Onciul [Fri, 12 Dec 2008 23:25:39 +0000 (23:25 +0000)]
sctp: SO_REUSEADDR on the sctp sockets

Reported-by: Michal Matyska, michal.matyska at iptel org
11 years agotcp: fix for async write
Andrei Pelinescu-Onciul [Fri, 12 Dec 2008 23:02:45 +0000 (23:02 +0000)]
tcp: fix for async write

- fixed bug in _wbufq_add() which caused packet corruption when
  multiple packets with size < default buffer size where queued.

Reported-by: Vaclav Kubart, vaclav.kubart at iptel org
Tested-by: Vaclav Kubart, vaclav.kubart at iptel org
11 years agoanother switch where PROTO_SCTP was missing - added case
Michal Matyska [Thu, 11 Dec 2008 19:12:41 +0000 (19:12 +0000)]
another switch where PROTO_SCTP was missing - added case

11 years agosctp protocol decoded in RPC dst_blacklist.view
Michal Matyska [Tue, 9 Dec 2008 14:09:22 +0000 (14:09 +0000)]
sctp protocol decoded in RPC dst_blacklist.view

so it does not show unknown protocol anymore

11 years agoclean up whitespace in makefile
Alfred E. Heggestad [Mon, 8 Dec 2008 12:26:39 +0000 (12:26 +0000)]
clean up whitespace in makefile

11 years agoadded README.prefix_route
Alfred E. Heggestad [Mon, 8 Dec 2008 10:36:46 +0000 (10:36 +0000)]
added README.prefix_route

11 years agoUse explicit comparison with NULL, it's more clear and shuts off gcc,
Maxim Sobolev [Mon, 8 Dec 2008 06:16:52 +0000 (06:16 +0000)]
Use explicit comparison with NULL, it's more clear and shuts off gcc,
which otherwise compain that condition is always true when argument is
pointer to the struct allocated on stack.

11 years agoFix warnings on LP64 plarforms out there (all 64-bit amd64/emt64 unixes
Maxim Sobolev [Mon, 8 Dec 2008 06:11:39 +0000 (06:11 +0000)]
Fix warnings on LP64 plarforms out there (all 64-bit amd64/emt64 unixes
and linuxes) where sizeof(*void) != sizeof(int).

11 years agoadded new module prefix_route
Alfred E. Heggestad [Sat, 6 Dec 2008 22:09:13 +0000 (22:09 +0000)]
added new module prefix_route

11 years agoupdate RPM spec file
Alfred E. Heggestad [Sat, 6 Dec 2008 21:49:27 +0000 (21:49 +0000)]
update RPM spec file

11 years agot_suspend() and t_continue() functions have been documented.
Miklos Tirpak [Fri, 5 Dec 2008 13:59:35 +0000 (13:59 +0000)]
t_suspend() and t_continue() functions have been documented.

11 years agodns: naptr local preferences fix
Andrei Pelinescu-Onciul [Wed, 3 Dec 2008 23:41:13 +0000 (23:41 +0000)]
dns: naptr local preferences fix

- in some cases the local preference for a protocol
  (dns_{udp,tcp,sctp,tls}_pref) was ignored (depending on the
  order of the records).

Reported-by: Vladimir Broz, vbroz at iptel org
Tested-by: Vladimir Broz, vbroz at iptel org
11 years agomore type punning warnings fixed
Andrei Pelinescu-Onciul [Fri, 28 Nov 2008 15:24:15 +0000 (15:24 +0000)]
more type punning warnings fixed

11 years agoavp: warning fixes & more sane usr_avp struct
Andrei Pelinescu-Onciul [Fri, 28 Nov 2008 15:24:01 +0000 (15:24 +0000)]
avp: warning fixes & more sane usr_avp struct

- type punning warning fixed (both for =-Wstrict-aliasing and
   -Wstrict-aliasing=2)
- replaced usr_avp->data with a union (more sane, looks better)

11 years agodns cache: fixed missing sctp SRV queries
Andrei Pelinescu-Onciul [Fri, 28 Nov 2008 10:41:40 +0000 (10:41 +0000)]
dns cache: fixed missing sctp SRV queries

- added missing support for sctp SRV queries

11 years agodns: fixed missing sctp SRV queries
Andrei Pelinescu-Onciul [Tue, 25 Nov 2008 19:15:05 +0000 (19:15 +0000)]
dns: fixed missing sctp SRV queries

- support for sctp SRV queries was missing

11 years agodoc/NEWS: minor update
Andrei Pelinescu-Onciul [Sun, 16 Nov 2008 18:29:06 +0000 (18:29 +0000)]
doc/NEWS: minor update

- added missing sigio_rt poll method to tcp_poll_method

11 years agomakefile: exclude_modules updated
Andrei Pelinescu-Onciul [Thu, 13 Nov 2008 16:24:41 +0000 (16:24 +0000)]
makefile: exclude_modules updated

- modules no longer on CVS removed
- add some presence modules to list of not compilable modules (pa & rls
 problems with the new DB API)

(see SER-415)

Reported-by: Bogdan Pintea <pintea@iptego.de>
Author: Bogdan Pintea <pintea@iptego.de>
Committer: Andrei Pelinescu-Onciul <andrei@iptel.org>

11 years agomakefile: fix group_modules
Andrei Pelinescu-Onciul [Thu, 13 Nov 2008 16:23:32 +0000 (16:23 +0000)]
makefile: fix group_modules

- make cfg group_include="standard presence"; make all did not make the
presence modules because the excluded list was re-evaluated.
(see SER-415)

Reported-by: Bogdan Pintea <pintea@iptego.de>
11 years agot_suspend() and t_continue() functions are introduced.
Miklos Tirpak [Mon, 10 Nov 2008 12:47:02 +0000 (12:47 +0000)]
t_suspend() and t_continue() functions are introduced.

These fuctions can be used by other modules to implement
asynchronous actions: t_suspend() saves the transaction, returns its
identifiers, and t_continue() continues the SIP request processing.
(The transaction processing does not continue from the same point
in the script, a separate route block defined by the parameter of
t_continue() is executed instead. The reply lock is held during the
route block execution.) FR timer is ticking while the
transaction is suspended, and the transaction's failure route is
executed if t_continue() is not called in time.

Missing: msg lumps are saved by t_suspend() and are not updated by
the subsequent t_relay(). This means that the modifications made
between them are lost.

11 years agosctp: minor fix for sctp_send_reties fixup
Andrei Pelinescu-Onciul [Fri, 7 Nov 2008 21:07:21 +0000 (21:07 +0000)]
sctp: minor fix for sctp_send_reties fixup

- the value too high check was done only if compiled without sctp support
(#ifndef USE_SCTP instead of USE_SCTP)

11 years agotypo fixed
Michal Matyska [Fri, 7 Nov 2008 17:29:46 +0000 (17:29 +0000)]
typo fixed

11 years agosctp: new config option: sctp_send_retries
Andrei Pelinescu-Onciul [Fri, 7 Nov 2008 14:53:35 +0000 (14:53 +0000)]
sctp: new config option: sctp_send_retries

- new ser.cfg option sctp_send_retries + doc

11 years agosctp: send retries option and unordered fix
Andrei Pelinescu-Onciul [Fri, 7 Nov 2008 14:53:04 +0000 (14:53 +0000)]
sctp: send retries option and unordered fix

- added a new option for forcing send retries by attempting to re-open
 the association (useful for example when a peer reboots or performs a
 failover to another host, to avoid loosing the current association send
 queue)
- fix: SCTP_UNORDERED properly set

11 years agosctp: minor spelling & comments changes
Andrei Pelinescu-Onciul [Fri, 7 Nov 2008 14:52:40 +0000 (14:52 +0000)]
sctp: minor spelling & comments changes

12 years agoFixed: IP address in Warning header was not 3261 ABNF compliant
Nils Ohlmeier [Wed, 29 Oct 2008 23:03:22 +0000 (23:03 +0000)]
Fixed: IP address in Warning header was not 3261 ABNF compliant
       (discovered at SIPit23)

12 years agocore: typo fix in ip_addr_loopback()
Andrei Pelinescu-Onciul [Thu, 23 Oct 2008 11:22:19 +0000 (11:22 +0000)]
core: typo fix in ip_addr_loopback()

- compiling ser without -DUSE_IPV6 used to fail because of a misplaced
bracket

12 years agodns: comment addition
Andrei Pelinescu-Onciul [Thu, 23 Oct 2008 11:21:59 +0000 (11:21 +0000)]
dns: comment addition

12 years agoDon't malloc zero-byte string if the replacement string is empty.
Maxim Sobolev [Tue, 21 Oct 2008 03:21:38 +0000 (03:21 +0000)]
Don't malloc zero-byte string if the replacement string is empty.

Sponsored by:   Sippy Software, Inc.
Debugging:      mpatrol

12 years agoIn MDStringArray() don't call MD5Update() on empty elements of array. This
Maxim Sobolev [Tue, 21 Oct 2008 03:10:47 +0000 (03:10 +0000)]
In MDStringArray() don't call MD5Update() on empty elements of array. This
doesn't change checksum, but could cause memory copy to be called with
zero length and/or NULL source/destination.

Sponsored by:   Sippy Software, Inc.
Debugging:      mpatrol

12 years agoIn get_to_uid() throw an error when username is empty. Judging by the
Maxim Sobolev [Tue, 21 Oct 2008 03:05:33 +0000 (03:05 +0000)]
In get_to_uid() throw an error when username is empty. Judging by the
fact that the get_to_uid() is trying to do zero-byte copy and underlying
consumers doing other nasty things such as trying to allocate 0-byte
memory buffer nobody expects this condition to happen.

Sponsored by:   Sippy Software, Inc.
Debugging:      mpatrol

12 years agodns: fix bug when using srv failover, ipv4 and ipv6
Andrei Pelinescu-Onciul [Fri, 17 Oct 2008 19:30:07 +0000 (19:30 +0000)]
dns: fix bug when using srv failover, ipv4 and ipv6

- fix crash during ipv4->ipv6 fallback when doing srv failover and when
listening on both ipv4 and ipv6 addresses (the hostname used in the
 AAAA fallback lookup was null).

Reported by: Nils Ohlmeier <nils@iptel.org>.

12 years agoipv6: avoid using as default socket a loopback addr.
Andrei Pelinescu-Onciul [Thu, 16 Oct 2008 18:02:50 +0000 (18:02 +0000)]
ipv6: avoid using as default socket a loopback addr.

- prefer non-loopback and non-multicast addresses as default sockets for ipv6

12 years agocore: attempt harder to filter loopback addresses
Andrei Pelinescu-Onciul [Thu, 16 Oct 2008 15:17:44 +0000 (15:17 +0000)]
core: attempt harder to filter loopback addresses

- on startup detect not only loopback interfaces (e.g. -l lo) but also
ipv4 and ipv6 loopback addresses (e.g. 127.0.0.1, ::1). This helps filtering
 them out when choosing the default socket for each of the protocols.

12 years agocore: don't force a socket if the dst af is different
Andrei Pelinescu-Onciul [Wed, 15 Oct 2008 14:13:56 +0000 (14:13 +0000)]
core: don't force a socket if the dst af is different

- get_send_socket() will now ignore a forced send socket if the destination
 address family is different from the forced socket (e.g. force ipv6 but
 attempt to send to ipv4). A non-obvious example of a scenario triggering
 this bug is registering over ipv4 an ipv6 contact.
 Reported by: Nils Ohlmeier <nils@iptel.org>

12 years agocore: fix socket list iteration
Andrei Pelinescu-Onciul [Wed, 15 Oct 2008 10:27:47 +0000 (10:27 +0000)]
core: fix socket list iteration

- socket list iteration didn't work properly on ser startup when some
of the protocols where compile-time disabled (no support for them compiled).
Symptomps: ser -l lo -f ser.cfg  prints a BUG message and doesn't start.
- small socket list related cleanups

12 years agosctp: if SCTP support not compiled, next_proto() shouldn't return SCTP
Andrei Pelinescu-Onciul [Tue, 14 Oct 2008 14:13:14 +0000 (14:13 +0000)]
sctp: if SCTP support not compiled, next_proto() shouldn't return SCTP

- minor fix: if no SCTP support was compiled, init_proto_order() didn't
 remove PROTO_SCTP references and this caused a BUG message on ser start

12 years agoCFG_READONLY flag is introduced. Variables marked with this flag
Miklos Tirpak [Mon, 13 Oct 2008 14:09:18 +0000 (14:09 +0000)]
CFG_READONLY flag is introduced. Variables marked with this flag
can be stored in the configuration framework even if they are read-only.

12 years agosctp: if USE_COMP, set comp to none
Andrei Pelinescu-Onciul [Thu, 9 Oct 2008 07:32:59 +0000 (07:32 +0000)]
sctp: if USE_COMP, set comp to none

12 years agosctp: more compatibility changes with old sctp versions
Andrei Pelinescu-Onciul [Tue, 7 Oct 2008 11:23:49 +0000 (11:23 +0000)]
sctp: more compatibility changes with old sctp versions

- warn about missing sctp sockopt at compile time too
- fow now ignore sctp adaption layer events (not supported by lksctp
1.0.6 which unfortunately is still widely used)

12 years agosctp: suggest kernel upgrade if not all the sctp options are supported
Andrei Pelinescu-Onciul [Tue, 7 Oct 2008 11:23:23 +0000 (11:23 +0000)]
sctp: suggest kernel upgrade if not all the sctp options are supported

12 years agosctp: command line options fix
Andrei Pelinescu-Onciul [Tue, 7 Oct 2008 11:22:56 +0000 (11:22 +0000)]
sctp: command line options fix

- some sctp options were untreated in the first getopt() switch, causing ser
to immediately abort() if the options were used

12 years agosctp: support for older sctp libraries and autoclose fix
Andrei Pelinescu-Onciul [Tue, 7 Oct 2008 11:22:43 +0000 (11:22 +0000)]
sctp: support for older sctp libraries and autoclose fix

- try to compile even if the used sctp library doesn't support all the
 sctp socket options that we would like to set, but warn about it both at
 compile time and each time ser is started
- ser -V will print a list of unsupported sctp options (due to missing
support in the sctp library/*.h files that ser was compiled against)
- fix: the autoclose sctp socket option was not properly set (paste typo)

12 years agosctp: added sctp_enable and sctp auto mode
Andrei Pelinescu-Onciul [Tue, 7 Oct 2008 11:22:05 +0000 (11:22 +0000)]
sctp: added sctp_enable and sctp auto mode

- added a new ser.cfg option: sctp_enable = 0|1|2. 0 means disable
 (equivalent with sctp_disable=yes), 1 enable (sctp_disable=no) and
  2 is auto mode (sctp enabled only if supported by the OS).
- sctp is now by default in auto enable mode: enabled if supported by the OS

12 years agodns_*_preference updated to include sctp
Andrei Pelinescu-Onciul [Tue, 7 Oct 2008 11:21:32 +0000 (11:21 +0000)]
dns_*_preference updated to include sctp

12 years agosctp: set TOS and ignore unsuported socket options
Andrei Pelinescu-Onciul [Wed, 1 Oct 2008 17:32:36 +0000 (17:32 +0000)]
sctp: set TOS and ignore unsuported socket options

- set TOS
- ignore non-critical unsuported socket options for better compatibility with
older kernels (e.g. 2.6.18 does not support SCTP_FRAGMENT_INTERLEAVE or
 SCTP_PARTIAL_DELIVERY_POINT)

12 years agosctp: init function for one-to-one sockets
Andrei Pelinescu-Onciul [Wed, 1 Oct 2008 17:32:06 +0000 (17:32 +0000)]
sctp: init function for one-to-one sockets

12 years agosctp: cleanup
Andrei Pelinescu-Onciul [Wed, 1 Oct 2008 17:30:57 +0000 (17:30 +0000)]
sctp: cleanup

sctp_init_sock() broken into several functions (sctp_init_su,
sctp_init_sock_opt_common, sctp_bind_sock), to allow for code reuse
with a future sctp one-to-one implementation.

12 years agoenable is renamed to enabled
Miklos Tirpak [Mon, 15 Sep 2008 15:53:44 +0000 (15:53 +0000)]
enable is renamed to enabled

12 years agoenable is renamed to enabled (enable is a keyword)
Miklos Tirpak [Mon, 15 Sep 2008 15:51:44 +0000 (15:51 +0000)]
enable is renamed to enabled (enable is a keyword)

12 years agoadding debconf options for disabling replication, which were already there but someon...
Pavel Kasparek [Mon, 15 Sep 2008 15:25:10 +0000 (15:25 +0000)]
adding debconf options for disabling replication, which were already there but someone deleted them

12 years agotypo fixed
Pavel Kasparek [Mon, 15 Sep 2008 14:40:47 +0000 (14:40 +0000)]
typo fixed

12 years agoDebian packaging - another attempt to make compilation and installation of modules...
Pavel Kasparek [Mon, 15 Sep 2008 14:24:10 +0000 (14:24 +0000)]
Debian packaging - another attempt to make compilation and installation of modules work again: reverting back to using of group_include and adding cleaning of saved config and saved module list before every call to make

12 years agoDebian packaging - added make modules
Pavel Kasparek [Mon, 15 Sep 2008 13:43:57 +0000 (13:43 +0000)]
Debian packaging - added make modules