sip-router
10 years agotm: no reason modparams if compiled with no cancelr. support
Andrei Pelinescu-Onciul [Fri, 13 Aug 2010 19:39:03 +0000 (21:39 +0200)]
tm: no reason modparams if compiled with no cancelr. support

Don't register cancel_reason modparams and script functions if
compiled with -DNO_CANCEL_REASON_SUPPORT.

10 years agotm: option to compile without reason support
Andrei Pelinescu-Onciul [Fri, 13 Aug 2010 15:20:26 +0000 (17:20 +0200)]
tm: option to compile without reason support

If compiled with -DNO_CANCEL_REASON_SUPPORT, the reason header
support will not be enabled.

10 years agotm: docs: reason header modparams and script function
Andrei Pelinescu-Onciul [Fri, 13 Aug 2010 10:30:26 +0000 (12:30 +0200)]
tm: docs: reason header modparams and script function

- docs for:
local_cancel_reason = 0|1
e2e_cancel_reason = 0|1
t_set_no_e2e_cancel_reason(0|1)
- regenerated README

10 years agotm: improved Reason support for E2E CANCELs
Andrei Pelinescu-Onciul [Sat, 13 Mar 2010 13:13:40 +0000 (14:13 +0100)]
tm: improved Reason support for E2E CANCELs

When generating CANCELs on-the-fly as response to a received
provisional reply on a branch of an E2E CANCELed transaction,
remember the Reason(s) from the original E2E CANCEL.
Up until now, the Reason was not remembered for branches where no
provisional replies were received (on these branches no CANCEL is
sent, unless cancel_b_method is set to 2 or at a later point a
provisional reply arrives).
Now each time an E2E CANCEL is received the Reason headers are
saved inside the INVITE transaction, for possible use in later
branch CANCEL generation (triggered by receiving a provisional
reply).

10 years agotm: fix Reason generation for on-the-fly branch CANCELs
Andrei Pelinescu-Onciul [Mon, 8 Mar 2010 21:54:55 +0000 (22:54 +0100)]
tm: fix Reason generation for on-the-fly branch CANCELs

For a canceled transaction, branches that have not received any
reply might not have any pre-generated cancel buffers (in case
cancel_b_method!=2). This could also happen when the first
provisional response on a branch arrives in the same time with the
event triggering the cancel (e.g. 2xx or 6xx on another branch,
e2e cancel or timeout).
In this cases, when generating the per-branch CANCEL for the first
time (triggered by a received provisional reply), use the final
transaction reply code as Reason. Note that this covers only the
final reply triggered CANCEL case (2xx or 6xx received, local
timeout or local script t_reply()) and it does not cover the e2e
CANCEL case, for which either no reason will be generated
(cancel_b_method == 1) or the reason might be 487
(cancel_b_method==0).

10 years agotm: CANCEL reason header on/off switches
Andrei Pelinescu-Onciul [Wed, 3 Mar 2010 13:57:43 +0000 (14:57 +0100)]
tm: CANCEL reason header on/off switches

Config support (both runtime and modparam) for turning on/off
Reason header support in locally generated or end-to-end
hop-by-hop CANCELs:
- local_cancel_reason =  0|1. Default 1 (on).
- e2e_cancel_reason= 0|1. (Default 1 (on).

End-to-end CANCEL reason header copy can also be turned on/off on
a per transaction basis: t_set_no_e2e_cancel_reason(0|1).
E.g.:
t_set_no_e2e_cancel_reason(1); # disable reason copy
t_relay();

t_set_no_e2e_cancel_reason(0) can be used to enable reason header
on a per transaction basis, if the default is disabled
(e2e_cancel_reason is set to 0).

10 years agotm: Reason header copy for received CANCELs
Andrei Pelinescu-Onciul [Tue, 2 Mar 2010 16:28:16 +0000 (17:28 +0100)]
tm: Reason header copy for received CANCELs

When canceling branches due to a received CANCEL, use the Reason
headers in the received CANCEL (all the Reason headers from the
received CANCEL will be copied in the generated CANCELs, see
RFC3326 for more details).

10 years agotm: Reason header generation for local CANCELs
Andrei Pelinescu-Onciul [Mon, 1 Mar 2010 17:40:19 +0000 (18:40 +0100)]
tm: Reason header generation for local CANCELs

When cancel-ing branches due to final reply, 2xx or 6xx, add a
Reason header (according to RFC3326).

E.g.: Reason: SIP;cause=200

Internal implementation notes: the branch_bm_t/cancel_bitmap
parameter of many of the reply and cancel functions was replaced
with a bigger structure that contains all the information
associated with the cancel: the cancel branch bitmap, the reason
and reason text (optional) or the  received cancel message (if
any).
Note that the current commit does not implement copying Reason
headers from a received CANCEL, it deals only with CANCEL
generated locally because of a final reply, 2xx or 6xx.

10 years agocore: msg_parse minor 64bit warning fix
Andrei Pelinescu-Onciul [Fri, 26 Feb 2010 14:21:50 +0000 (15:21 +0100)]
core: msg_parse minor 64bit warning fix

10 years agotm: experimental tm onreply_route final reply DROP support
Andrei Pelinescu-Onciul [Fri, 26 Feb 2010 14:10:49 +0000 (15:10 +0100)]
tm: experimental tm onreply_route final reply DROP support

Experimental support for dropping final replies from tm
onreply_route[]s. It's disabled by default (causes a small
performance hit and it's not needed in most cases).
To enable re-compile tm with -DTM_ONREPLY_FINAL_DROP_OK
(e.g. make cfg extra_defs=-DTM_ONREPLY_FINAL_DROP_OK; make all
 or make -C modules/tm extra_defs=-DTM_ONREPLY_FINAL_DROP_OK)

10 years agotls: TLS_MALLOC_DBG can now be set on make cfg
Andrei Pelinescu-Onciul [Fri, 26 Feb 2010 12:39:55 +0000 (13:39 +0100)]
tls: TLS_MALLOC_DBG can now be set on make cfg

Enabling tls extra malloc debugging info, does not require anymore
editing tls_init.c. It can be enabled at cfg time
(make cfg extra_defs=-DTLS_MALLOC_DBG) or at compile/re-compile
time ( make -C modules/tls clean;
       make -C modules/tls extra_defs=-DTLS_MALLOC_DBG).
When TLS_MALLOC_DBG is enabled, an extra warning will be printed
at compile time. NO_TLS_MALLOC_DBG takes precedence over
TLS_MALLOC_DBG.

10 years agouserblacklist(k): short term fix in the docs for redundant table definition
Henning Westerholt [Wed, 24 Feb 2010 16:04:54 +0000 (17:04 +0100)]
userblacklist(k): short term fix in the docs for redundant table definition

10 years agocfg parser: segfault on case RE parse error fix
Andrei Pelinescu-Onciul [Wed, 24 Feb 2010 14:13:12 +0000 (15:13 +0100)]
cfg parser: segfault on case RE parse error fix

Reported-by: Klaus Feichtinger klaus.feichtinger gmx net
10 years agoreg(k): fix compilation for kamailio flavour, reported from Daniel
Henning Westerholt [Wed, 24 Feb 2010 14:07:38 +0000 (15:07 +0100)]
reg(k): fix compilation for kamailio flavour, reported from Daniel

10 years agotls: disable kerberos more thoroughly [fix]
Andrei Pelinescu-Onciul [Tue, 23 Feb 2010 15:10:21 +0000 (16:10 +0100)]
tls: disable kerberos more thoroughly [fix]

Older openssl versions (< 0.9.8e release) have a bug in the
kerberos code (it uses the wrong malloc, for more details see
openssl bug # 1467). While there is already a workaround for this
openssl bug in the sr code (see commits 36cb8f & 560a42), in some
situations this workaround causes another bug (crash on connection
opening when openssl is compiled with kerberos support and
kerberos is enabled for key exchange).
The current fix will disable automatically all the ciphers containing
KRB5 if the openssl version is < 0.9.8e beta1 or it is between
0.9.9-dev and 0.9.9-beta1.
It iss equivalent to setting cipher_list to "<prev. value>:!KRB5".

Impact: this fix is needed only if openssl is compiled with
kerberos support and the version is < 0.9.8e. It also affects at
least CentOS users with openssl-0.9.8e-12.el5_4.1 (in the centos
openssl package they play some strange games with the version and
report 0.9.8b via SSLeay).

Tested-by: Klaus Darilion klaus.mailinglists at pernau.at
Reported-by: Klaus Darilion klaus.mailinglists at pernau.at
Reported-by: Andreas Rehbein rehbein at e-technik.org
Reported-by: Martin Koenig koenig starface.de
10 years agovarious modules: don't access route_type directly
Andrei Pelinescu-Onciul [Mon, 22 Feb 2010 18:45:14 +0000 (19:45 +0100)]
various modules: don't access route_type directly

route_type should be accessed only through get_route_type() or
is_route_type(FOO).
Replaced all the route_type==FOO_ROUTE with
is_route_type(FOO_ROUTE).

10 years agotmx(k): core & tm onreply route support
Andrei Pelinescu-Onciul [Mon, 22 Feb 2010 18:41:33 +0000 (19:41 +0100)]
tmx(k): core & tm onreply route support

- support for core onreply route (like for tm onreply route, but
  with extra t_unref).
- use get_route_type() instead of directly accessing route_type.

10 years agotm: t_check_status & t_reply main onreply_route fix
Andrei Pelinescu-Onciul [Mon, 22 Feb 2010 18:38:40 +0000 (19:38 +0100)]
tm: t_check_status & t_reply main onreply_route fix

- t_check_status: in some situations t_check_status left the
  transaction referenced when called from main onreply_route (e.g.
  t_check_status(); drop )
- t_reply: unref the transaction only when called from the main
  onreply_route and not from tm onreply route

10 years agotm: onreply_route: fix cleanup after DROP
Andrei Pelinescu-Onciul [Mon, 22 Feb 2010 17:01:26 +0000 (18:01 +0100)]
tm: onreply_route: fix cleanup after DROP

After a DROP in the onreply_route the avp lists where not restored
to their original values and the possible msg flags changes in the
script were dropped.

10 years agoNEWS: note about onreply_route changes & tm
Andrei Pelinescu-Onciul [Mon, 22 Feb 2010 17:00:30 +0000 (18:00 +0100)]
NEWS: note about onreply_route changes & tm

10 years agotm: t_reply can now be used from onreply_routes
Andrei Pelinescu-Onciul [Mon, 22 Feb 2010 16:50:40 +0000 (17:50 +0100)]
tm: t_reply can now be used from onreply_routes

t_reply can now be used both from the main onreply_route
(onreply_route{}) or from tm onreply_routes (onreply_route[x]{},
where x!=0).
In general it should be followed by a DROP. If not you might get
some log warning messages (but besides that nothing bad will
happen).

10 years agotm: _reply cleans up after itself
Andrei Pelinescu-Onciul [Mon, 22 Feb 2010 16:48:45 +0000 (17:48 +0100)]
tm: _reply cleans up after itself

The _reply() function now cleans possible added reply_lumps before
exiting. This allows using it not only from request or failure
route.

10 years agotm: restrict tm onreply_route commands to tm reply routes only
Andrei Pelinescu-Onciul [Mon, 22 Feb 2010 15:41:59 +0000 (16:41 +0100)]
tm: restrict tm onreply_route commands to tm reply routes only

- most tm onreply functions restricted to tm onreply routes only.
  They cannot be executed anymore from the  main/core
  onreply_route (some of them won't work and others would leave the
  transaction referenced).
- don't access route_type directly, but via get_route_type()

10 years agotm: tm onreply route has now TM_ONREPLY_ROUTE type
Andrei Pelinescu-Onciul [Mon, 22 Feb 2010 13:53:42 +0000 (14:53 +0100)]
tm: tm onreply route has now TM_ONREPLY_ROUTE type

10 years agocore: distinct core and tm onreply route tests
Andrei Pelinescu-Onciul [Mon, 22 Feb 2010 13:49:37 +0000 (14:49 +0100)]
core: distinct core and tm onreply route tests

- added TM_ONREPLY_ROUTE and CORE_ONREPLY_ROUTE to the possible
route types. This allows to distinguish between the main reply
route (executed by the core) and onreply routes executed by tm.
ONREPLY_ROUTE was changed to TM_ONREPLY_ROUTE|CORE_ONREPLY_ROUTE,
so that is_route_type(ONREPLY_ROUTE) will return true both for
 CORE_ONREPLY_ROUTE and TM_ONREPLY_ROUTE.

- onreply_route[0] {} is equivalent with onreply_route{}.

- use different route types when parsing the script for
 onreply_route{} (CORE_ONREPLY_ROUTE) and onreply_route[x]{},
  where x!=0 (TM_ONREPLY_ROUTE).

10 years agoMerge remote branch 'origin/andrei/blst_send_flags'
Andrei Pelinescu-Onciul [Fri, 19 Feb 2010 15:37:51 +0000 (16:37 +0100)]
Merge remote branch 'origin/andrei/blst_send_flags'

Support for blacklist ignore flags, both global and on a per
message basis.
E.g.:
per message:
if (method=~"MESSAGE")
blst_set_ignore(6);

global:
sercmd cfg.set_now_int core dst_blacklist_tcp_imask 16

* origin/andrei/blst_send_flags:
  NEWS: minor blacklist flag number correction
  tm: blacklist on 503 reply fixed for send flags
  NEWS: mentioned blacklist ignore masks
  core: cfg script support for blacklist ignore masks
  blst: global config variables for ignoring blacklist events
  blst: docs for blst_{set,clear}_ignore script functions
  blst: functions for ignoring blacklist events
  blst: use dst_blacklist_force_add
  tm: simplified blacklist add code
  blacklist: ignore mask support
  tm: updated to the new snd_flags_t structure
  core: send_flags preliminary blacklist support

Conflicts:
NEWS
cfg.lex
cfg.y
dst_blacklist.h

10 years agoNEWS: minor blacklist flag number correction
Andrei Pelinescu-Onciul [Fri, 19 Feb 2010 15:26:44 +0000 (16:26 +0100)]
NEWS: minor blacklist flag number correction

10 years agotm: blacklist on 503 reply fixed for send flags
Andrei Pelinescu-Onciul [Fri, 19 Feb 2010 14:35:57 +0000 (15:35 +0100)]
tm: blacklist on 503 reply fixed for send flags

Blacklisting the source of a 503 reply now obeys also the
blacklist ignore masks (both global and per message).
The ignore 503 blacklist flag can be set (and it will be obeyed)
in any route (be it main route, on branch, on send or the on_reply
route). E.g.: using blst_set_ignore(32) in the onsend_route for a
specific destination would cause the ignore 503 flag to be
inherited by the 503 reply (this is the only blacklist flag that
it's inherited this way).

10 years agoMerge remote branch 'origin/sr_3.0'
Andrei Pelinescu-Onciul [Fri, 19 Feb 2010 11:05:41 +0000 (12:05 +0100)]
Merge remote branch 'origin/sr_3.0'

The dst_uri fix (see FlySpray#37) and kamctl.

* origin/sr_3.0:
  core: avoid non-null 0-length dst_uri,  ruris and path
  tm: fake_req dst_uri and ruri copy fix
  utils/kamctl: removed unsupported commands to manage lcr gateways and routes

10 years agocore: PAI & PPI header names parser fixes
Andrei Pelinescu-Onciul [Fri, 19 Feb 2010 10:55:44 +0000 (11:55 +0100)]
core: PAI & PPI header names parser fixes

Changed to the usual "case" construct. This also fixes the case
when spaces were present between the header name and ':'
(e.g. "P-Preferred-Identity : ..." was not recognized).

10 years agocore: support for parsing the Reason header
Andrei Pelinescu-Onciul [Thu, 18 Feb 2010 20:20:07 +0000 (21:20 +0100)]
core: support for parsing the Reason header

10 years agocore: avoid non-null 0-length dst_uri, ruris and path
Andrei Pelinescu-Onciul [Wed, 17 Feb 2010 19:46:47 +0000 (20:46 +0100)]
core: avoid non-null 0-length dst_uri,  ruris and path

- a dst_uri or ruri that has 0 length should be equivalent to also
having a null corresponding char* pointer.  sip_msg_shm_clone()
will now clone this type of uris to (0,0).
- set_dst_uri() called with "" (a 0-length non-zero string) is now
  equivalent to reset_dst_uri().
- set_path_vector() called with "" is now equivalent with
  reset_path_vector().

10 years agotm: fake_req dst_uri and ruri copy fix
Andrei Pelinescu-Onciul [Wed, 17 Feb 2010 19:40:46 +0000 (20:40 +0100)]
tm: fake_req dst_uri and ruri copy fix

If the uris have 0 len but no 0 value (possible at least for a
manually set dst_uri), set the corresponding fake_req uri to 0,
thus avoiding a potentially disastrous free in free_faked_req().

Should close FS#37.

10 years agoModules/registrar : update stats even if -DSTATISTICS was not passed to the compiles...
Marius Zbihlei [Wed, 17 Feb 2010 11:57:05 +0000 (13:57 +0200)]
Modules/registrar : update stats even if -DSTATISTICS was not passed to the compiles(this was the default)

update_stat was called even if the statistics where not added to the stats framework.

10 years agoModules_k/registrar Other module variables added to configuration framework
Marius Zbihlei [Wed, 17 Feb 2010 11:52:48 +0000 (13:52 +0200)]
Modules_k/registrar Other module variables added to configuration framework

Also added callback that modify the statistics to reflect the changes via sercmd

10 years agoNEWS: mentioned blacklist ignore masks
Andrei Pelinescu-Onciul [Wed, 17 Feb 2010 09:00:57 +0000 (10:00 +0100)]
NEWS: mentioned blacklist ignore masks

10 years agocore: cfg script support for blacklist ignore masks
Andrei Pelinescu-Onciul [Wed, 17 Feb 2010 08:58:21 +0000 (09:58 +0100)]
core: cfg script support for blacklist ignore masks

The blacklist ignore mask can now be set from the script (not only
at runtime):
 dst_blacklist_udp_imask
 dst_blacklist_tcp_imask
 dst_blacklist_tls_imask
 dst_blacklist_sctp_imask

E.g. dst_blacklist_udp_imask=16

Possible values:
0 -disabled
2 - send error
4 - connect error
8 - icmp (reserverd for future use)
16 - transaction timeout
32 - administratively prohibited (manually set)

10 years agomodules_k:registrar Implementing cfg framework for registrar
Marius Zbihlei [Tue, 16 Feb 2010 14:32:16 +0000 (16:32 +0200)]
modules_k:registrar Implementing cfg framework for registrar

Started to implement cfg framework for registrar, having the possibility to change module paraments without restarting k/s

10 years agoblst: global config variables for ignoring blacklist events
Andrei Pelinescu-Onciul [Mon, 15 Feb 2010 20:37:28 +0000 (21:37 +0100)]
blst: global config variables for ignoring blacklist events

Blacklist events can now be ignored on a per protocol basis, by
setting the corresponding new config variable:
 dst_blacklist_udp_imask
 dst_blacklist_tcp_imask
 dst_blacklist_tls_imask
 dst_blacklist_sctp_imask

E.g.: sercmd cfg.set_now_int core dst_blacklist_tcp_imask 6
 (ignore send and connect errors on tcp when deciding whether or
  not to blacklist)

10 years agoMerge remote branch 'origin/daniel/xavp'
Andrei Pelinescu-Onciul [Mon, 15 Feb 2010 14:47:37 +0000 (15:47 +0100)]
Merge remote branch 'origin/daniel/xavp'

* origin/daniel/xavp:
  pv: export new PV class $xavp(name)
  core: introducing xavp (eXtended AVP)
  tm: set/reset head of xavps on TM events
  pv: new pv class $xavp(...)
  core: destroy xavp list once sip msg processing is done

Conflicts:
modules/tm/h_table.c
modules/tm/t_reply.c
modules/tm/uac.c
modules_k/pv/pv.c

10 years agoMerge remote branch 'origin/tmp/k3.0_sr_backports' into sr_3.0
Andrei Pelinescu-Onciul [Mon, 15 Feb 2010 12:25:03 +0000 (13:25 +0100)]
Merge remote branch 'origin/tmp/k3.0_sr_backports' into sr_3.0

* origin/tmp/k3.0_sr_backports:
  modules/mediaproxy: properly fix the IP in the RTCP line
  utils/kamctl: removed unsupported commands to manage lcr gateways and routes
  cfg.y: fix warnings introduced in previous commit
  core: added forward()
  Makefile: MEMDBG var to control mem debugging mode

10 years agomodules/mediaproxy: properly fix the IP in the RTCP line
Juha Heinanen [Thu, 11 Feb 2010 20:22:12 +0000 (22:22 +0200)]
modules/mediaproxy: properly fix the IP in the RTCP line

- Properly fix the IP in the RTCP line (if present in the SDP). Patch
  provided by Saul Ibarra Corretge.
(cherry picked from commit 2a95f9bf915cfc3cf11374f9b8f0f547d4eb4955)
(cherry picked from commit ef10212404b9bc5489683fc7429fee40b3495994)

10 years agoutils/kamctl: removed unsupported commands to manage lcr gateways and routes
Juha Heinanen [Wed, 10 Feb 2010 20:37:44 +0000 (22:37 +0200)]
utils/kamctl: removed unsupported commands to manage lcr gateways and routes
(cherry picked from commit d8d9165324f32e82f6e8cbb5e07f33ddd697cd1d)

10 years agocfg.y: fix warnings introduced in previous commit
Daniel-Constantin Mierla [Tue, 9 Feb 2010 10:32:02 +0000 (11:32 +0100)]
cfg.y: fix warnings introduced in previous commit
(cherry picked from commit 318ff6e6884641f3c9788b01e9ac3d859269be30)

10 years agocore: added forward()
Daniel-Constantin Mierla [Tue, 9 Feb 2010 10:23:50 +0000 (11:23 +0100)]
core: added forward()

- aliased forward() to forward(uri:host, uri:port)
- k 1.5.x compatibility
(cherry picked from commit 50237e89964b4fc8a4c8775076c1b75a05ee5e73)

10 years agoMakefile: MEMDBG var to control mem debugging mode
Daniel-Constantin Mierla [Mon, 8 Feb 2010 22:16:47 +0000 (23:16 +0100)]
Makefile: MEMDBG var to control mem debugging mode

- to compile with memory debugging
make MEMDBG=1 cfg; make ...
- default (for now): MEMDBG=1

10 years agodispatcher(k): basic framework for load dispatching
Daniel-Constantin Mierla [Fri, 12 Feb 2010 13:03:24 +0000 (14:03 +0100)]
dispatcher(k): basic framework for load dispatching

- a lightweight system to do a fair distrubution based on load
- no dependency on dialog, by using an internal table of active calls
  with minimal info, to keep the module suitable for small devices and
  have good performances
- not completed, requires xavp support for a compact info structure to
  be carried in transaction for each failover step

10 years agodialog(k): init local parameter
Daniel-Constantin Mierla [Fri, 12 Feb 2010 10:12:37 +0000 (11:12 +0100)]
dialog(k): init local parameter

- memset tm callback param to 0
- safety checks for MI cmd dlg match
- credits to Inaki Baz Castillo and Torben Friese

10 years agomodules/mediaproxy: properly fix the IP in the RTCP line
Juha Heinanen [Thu, 11 Feb 2010 20:22:12 +0000 (22:22 +0200)]
modules/mediaproxy: properly fix the IP in the RTCP line

- Properly fix the IP in the RTCP line (if present in the SDP). Patch
  provided by Saul Ibarra Corretge.

10 years agodispatcher(k): weight based distribution
Daniel-Constantin Mierla [Thu, 11 Feb 2010 14:20:36 +0000 (15:20 +0100)]
dispatcher(k): weight based distribution

- new algorithm 9 for weight based distribution
- new column to hold attributes per destination
- for weight based distribution you have to set for each address in
  destination set: weight=value, for example:

[setid address flags priority attributes]

2 sip:10.10.0.1:5080 0 2 weight=40
2 sip:10.10.0.2:5082 0 1 weight=60

- this will send 60% of the traffic to second address
- note that at startup the distribution is randomized, so traffic is
  directed to first or second desintation alternatively but keeping
  overall percentages

10 years agocore: use the prev. via branch id if it's 3261
Andrei Pelinescu-Onciul [Wed, 10 Feb 2010 20:48:00 +0000 (21:48 +0100)]
core: use the prev. via branch id if it's 3261

When computing the via branch value in syn_branch==0 mode, use the
previous via branch id and not the to_tag, from_tag, callid, ruri,
cseq number, via port and host, if the previous via branch id is
in rfc3261 format (begins with the magic cookie).
See  rfc3261/16.11 P116 for more informations.
To revert to the old behaviour, define BRANCH_IGNORE_3261_VIA.

10 years agocore: include only from/to tags when computing via branch value
Andrei Pelinescu-Onciul [Wed, 10 Feb 2010 20:30:11 +0000 (21:30 +0100)]
core: include only from/to tags when computing via branch value

- use only the to & from tags when computing the via branch value
  in syn_branch==0 mode. This should improve interoperability with
  broken implementations that don't keep the from & to headers
  unchanged. Defining BRANCH_INCLUDE_FROMTO_BODY will revert to
  the old behaviour.
- moved char_msg_val from parser/msg_parser.h to its own file
 (it has nothing to do with parsing).

10 years agocfg.y: fix warnings introduced in previous commit
Daniel-Constantin Mierla [Tue, 9 Feb 2010 10:32:02 +0000 (11:32 +0100)]
cfg.y: fix warnings introduced in previous commit
(cherry picked from commit 318ff6e6884641f3c9788b01e9ac3d859269be30)

10 years agocore: added forward()
Daniel-Constantin Mierla [Tue, 9 Feb 2010 10:23:50 +0000 (11:23 +0100)]
core: added forward()

- aliased forward() to forward(uri:host, uri:port)
- k 1.5.x compatibility
(cherry picked from commit 50237e89964b4fc8a4c8775076c1b75a05ee5e73)

10 years agoMEMDBG set to 1 (memory debugging on)
Daniel-Constantin Mierla [Wed, 10 Feb 2010 18:34:46 +0000 (19:34 +0100)]
MEMDBG set to 1 (memory debugging on)

- default for devel version

10 years agoMakefile: MEMDBG var to control mem debugging mode
Daniel-Constantin Mierla [Mon, 8 Feb 2010 22:16:47 +0000 (23:16 +0100)]
Makefile: MEMDBG var to control mem debugging mode

- to compile with memory debugging
make MEMDBG=1 cfg; make ...

10 years agoapp_python: added skeleton for docs
Daniel-Constantin Mierla [Wed, 10 Feb 2010 18:26:07 +0000 (19:26 +0100)]
app_python: added skeleton for docs

- needs to be filled in

10 years agomodules/lcr: added in docs missing install dependency on libpcre
Juha Heinanen [Wed, 10 Feb 2010 05:34:33 +0000 (07:34 +0200)]
modules/lcr: added in docs missing install dependency on libpcre

- Credits to Kris Amy.
(cherry picked from commit 0c7048297f590f140ae84efdcde8a392ef23527e)

10 years agomodules/lcr: added in docs missing install dependency on libpcre
Juha Heinanen [Wed, 10 Feb 2010 05:34:33 +0000 (07:34 +0200)]
modules/lcr: added in docs missing install dependency on libpcre

- Credits to Kris Amy.

10 years agomodules_k/permissions: group identifier must be positive integer
Juha Heinanen [Wed, 10 Feb 2010 05:15:24 +0000 (07:15 +0200)]
modules_k/permissions: group identifier must be positive integer

- Group Identifier in address permissions must have a positive integer
  value.
(cherry picked from commit c67e72eb16f277eeae16182e15e0e8ebf319dce0)

10 years agomodules_k/permissions: group identifier must be positive integer
Juha Heinanen [Wed, 10 Feb 2010 05:15:24 +0000 (07:15 +0200)]
modules_k/permissions: group identifier must be positive integer

- Group Identifier in address permissions must have a positive integer
  value.

10 years agomakefile: fixed parallel job support for several targets
Andrei Pelinescu-Onciul [Fri, 5 Feb 2010 20:22:47 +0000 (21:22 +0100)]
makefile: fixed parallel job support for several targets

Parallel job support (-jN) warning/support fixed for:
modules*-doc, modules*-readme, modules*-man, install-modules*.

10 years agomakefile: clean-modules fix for cleaning modules*/*/doc
Andrei Pelinescu-Onciul [Fri, 5 Feb 2010 20:21:20 +0000 (21:21 +0100)]
makefile: clean-modules fix for cleaning modules*/*/doc

- fixed wrong test for the existence of $(module)/doc/Makefile

10 years agomakefile.doc: be silent when cleaning
Andrei Pelinescu-Onciul [Fri, 5 Feb 2010 20:20:27 +0000 (21:20 +0100)]
makefile.doc: be silent when cleaning

10 years agotm: t_suspend() fixes
Miklos Tirpak [Wed, 11 Nov 2009 14:21:23 +0000 (15:21 +0100)]
tm: t_suspend() fixes

- t_suspend() and t_continue() checks whether a CANCEL
  has been processed before the transaction is suspended
  and before it continues to make sure that the
  suspend/continue is not done needlessly.
- t_continue() verifies that the suspended branch has not
  timed out yet.
- t_cancel_suspend() function is introduced:
  It can be used for revoking the suspension of the transaction.
  Useful when any failure occures after the transaction has been suspended
  and it turns out that the transaction should not have been
  suspended.

10 years agotm: new select functions
Miklos Tirpak [Wed, 11 Nov 2009 11:51:16 +0000 (12:51 +0100)]
tm: new select functions

New select functions have been introduced:
- @tm.uac.response_retransmission
Returns "1" if the response is a retransmission
otherwise "-1".
- @tm.uac.last_status
Returns the last saved status code of the current branch.
- @tm.uas.request.neg_ack_retransmission
Returns "1" if the negative ACK request is a retransmission
otherwise "-1".
Note: This select function can be used only for negative ACK messages
(ACK for >=300 responses), it should be enhanced in the future
to work on any type of requests.

10 years agotm: TMCB_E2EACK callback fix
Miklos Tirpak [Wed, 11 Nov 2009 11:24:50 +0000 (12:24 +0100)]
tm: TMCB_E2EACK callback fix

TMCB_E2EACK_RETR_IN was called instead of TMCB_E2EACK_IN
for the initial e2e-ACK message.

10 years agoxlog: API documentation added
Miklos Tirpak [Wed, 11 Nov 2009 10:52:07 +0000 (11:52 +0100)]
xlog: API documentation added

10 years agoxl-lib: shm memory support, regex back reference parsing, xbind
Miklos Tirpak [Wed, 11 Nov 2009 09:10:52 +0000 (10:10 +0100)]
xl-lib: shm memory support, regex back reference parsing, xbind

- xl-lib parser supports both pkg and shm memory
- new wrapper functions for the shm memory version:
    - xl_shm_parse_format()
    - xl_elog_shm_free_all()
- The parser can identify the regular expression back
  references (\1, \2, ...) and call a callback function
  to farther parse the back reference. Wraper functions
  for this:
    - xl_parse_format2()
    - xl_shm_parse_format2()
- xbind() module function has been introduced that
  can be used to bind to the xl API as opposed to
  search each exported function individually.

10 years agoselects: shm_free_select wrapper added
Miklos Tirpak [Mon, 9 Nov 2009 16:08:08 +0000 (17:08 +0100)]
selects: shm_free_select wrapper added

shm_free_select() function is added that frees the select
parsed by shm_parse_select().

10 years agodns_cahce: add_record function exported
Miklos Tirpak [Mon, 9 Nov 2009 15:35:29 +0000 (16:35 +0100)]
dns_cahce: add_record function exported

dns_cache_add_record() function has been separated
from the RPC interface so that it can be used also
from other places.

10 years agorename the 'class' variable -- reserved keyword in c++
Miklos Tirpak [Fri, 6 Nov 2009 16:35:12 +0000 (17:35 +0100)]
rename the 'class' variable -- reserved keyword in c++

10 years agoMakefile:modules fixed usage of -jN flag for modules(_k,_s)
Marius Zbihlei [Thu, 4 Feb 2010 13:06:54 +0000 (15:06 +0200)]
Makefile:modules fixed usage of -jN flag for modules(_k,_s)

Removed the @for construct (launched a new shell) with a @foreach construct which does a textual expansion
of the block in question (loop unrolling)

10 years agodebugger: removed completed task from to-do
Daniel-Constantin Mierla [Thu, 4 Feb 2010 19:50:36 +0000 (20:50 +0100)]
debugger: removed completed task from to-do

- fixed the description of inner command for dbg.bp

10 years agodebugger: more parameters exported to cfg
Daniel-Constantin Mierla [Thu, 4 Feb 2010 19:36:34 +0000 (20:36 +0100)]
debugger: more parameters exported to cfg

10 years agoMakefile: core stats enabled for kamailio flavor
Daniel-Constantin Mierla [Thu, 4 Feb 2010 12:02:11 +0000 (13:02 +0100)]
Makefile: core stats enabled for kamailio flavor

10 years agocore: unlikely() to test ev SREV_CFG_RUN_ACTION
Daniel-Constantin Mierla [Thu, 4 Feb 2010 11:30:47 +0000 (12:30 +0100)]
core: unlikely() to test ev SREV_CFG_RUN_ACTION

- test if the event is enabled before creating the parameter and
  executing the callback

10 years agocore: events: new function to test event enabled
Daniel-Constantin Mierla [Thu, 4 Feb 2010 11:26:30 +0000 (12:26 +0100)]
core: events: new function to test event enabled

- sr_event_enabled(type) returns true if a callback has been registered
  for respective event type

10 years agomqueue: fixed c&p errors in docs
Elena-Ramona Modroiu [Thu, 4 Feb 2010 11:57:02 +0000 (12:57 +0100)]
mqueue: fixed c&p errors in docs

10 years agomodules_k/siputils : Forgot to commit config.* files
Marius Zbihlei [Thu, 4 Feb 2010 09:24:36 +0000 (11:24 +0200)]
modules_k/siputils : Forgot to commit config.* files

I broke the build...

10 years agodebugger: new module for interactive cfg debugging
Daniel-Constantin Mierla [Wed, 3 Feb 2010 23:11:59 +0000 (00:11 +0100)]
debugger: new module for interactive cfg debugging

- print config execution path of a SIP message to logs
- interactive debugging for config, similar to gdb
- step-by-step execution of each action in the config file
- the SIP router process stops at cfg actions and waits for RPC commands
  to go to next one, evaluate a pseudo-variable, continue execution, etc.
- see README for more details

10 years agocore: new core event: SREV_CFG_RUN_ACTION
Daniel-Constantin Mierla [Wed, 3 Feb 2010 23:05:41 +0000 (00:05 +0100)]
core: new core event: SREV_CFG_RUN_ACTION

- it is fired for each action executed from configuration file
- parameters are current acction and sip message given as a void* array
  of two elements

10 years agocore: fire core event on each executed cfg action
Daniel-Constantin Mierla [Wed, 3 Feb 2010 23:04:24 +0000 (00:04 +0100)]
core: fire core event on each executed cfg action

- used for cfg execution tracing and interactive debugging (the new
module debugger)

10 years agoMerge remote branch 'origin/sr_3.0'
Andrei Pelinescu-Onciul [Wed, 3 Feb 2010 22:32:55 +0000 (23:32 +0100)]
Merge remote branch 'origin/sr_3.0'

* origin/sr_3.0:
  core: new param to give outbut buffer size
  core: use one buffer for int2str
  core: use dlflags to load modules
  uac(k): use header types for detection
  uac(k): proper test for send failure
  uac(k): set type for tm callback
  modules/mediaproxy: take boundary string from Content-Type header.
  core: stats events cbs are called only if USE_CORE_STATS is defined
  update drp_reqs statistics
  update drp_rpls statistics
  update fwd_rpls statistics
  update err_reqs statistics
  update err_rpls statistics
  update bad_URIs statistics
  update bad_msg_hdr statistics
  core: update fwd_reqs stat
  kex: support to update core stats via core events
  core: added new event SREV_CORE_STATS

10 years agoMerge remote branch 'origin/tmp/k3.0_sr_backports' into sr_3.0
Andrei Pelinescu-Onciul [Wed, 3 Feb 2010 22:09:26 +0000 (23:09 +0100)]
Merge remote branch 'origin/tmp/k3.0_sr_backports' into sr_3.0

statistics callback support (enabled only if compiled with
-DUSE_CORE_STATS) and latest kamailio 3.0 fixes

* origin/tmp/k3.0_sr_backports:
  core: new param to give outbut buffer size
  core: use one buffer for int2str
  core: use dlflags to load modules
  uac(k): use header types for detection
  uac(k): proper test for send failure
  uac(k): set type for tm callback
  core: stats events cbs are called only if USE_CORE_STATS is defined
  update drp_reqs statistics
  update drp_rpls statistics
  update fwd_rpls statistics
  update err_reqs statistics
  update err_rpls statistics
  update bad_URIs statistics
  update bad_msg_hdr statistics
  core: update fwd_reqs stat
  kex: support to update core stats via core events
  core: added new event SREV_CORE_STATS

10 years agocore: new param to give outbut buffer size
Daniel-Constantin Mierla [Tue, 2 Feb 2010 14:06:34 +0000 (15:06 +0100)]
core: new param to give outbut buffer size

- int2strbuf requires now outbut buffer size as parameter
- safer against misuses, suggested by Andrei Pelinescu-Onciul
- if size is less than INT2STR_MAX_LEN, return null pointer
(cherry picked from commit a765213ffa3769577dd7438c95737cb6b98bff74)

10 years agocore: use one buffer for int2str
Daniel-Constantin Mierla [Tue, 2 Feb 2010 12:23:03 +0000 (13:23 +0100)]
core: use one buffer for int2str

- static declaration inside ut.h function results in hard copy to many
  places, affecting acc detection of int to str conversions in buffer
- reported by Alex Balashov
(cherry picked from commit 229496c7170bcc85f517a4985f7ab4bad553c8d3)

10 years agocore: use dlflags to load modules
Daniel-Constantin Mierla [Sat, 30 Jan 2010 16:02:37 +0000 (17:02 +0100)]
core: use dlflags to load modules

- dlflags var used for dlopen function
(cherry picked from commit 055915a558a485cda17c9bb1c8e43aca12d116b5)

10 years agouac(k): use header types for detection
Daniel-Constantin Mierla [Sun, 24 Jan 2010 20:21:59 +0000 (21:21 +0100)]
uac(k): use header types for detection
(cherry picked from commit 369d7598244c60c2c8e4d601e166a03cb211128c)

10 years agouac(k): proper test for send failure
Daniel-Constantin Mierla [Sun, 24 Jan 2010 20:20:02 +0000 (21:20 +0100)]
uac(k): proper test for send failure
(cherry picked from commit 1479cd808ea8e5025bfa8400a257e3f89db4ab68)

10 years agouac(k): set type for tm callback
Daniel-Constantin Mierla [Sun, 24 Jan 2010 18:43:09 +0000 (19:43 +0100)]
uac(k): set type for tm callback

- requires to be TMCB_LOCAL_COMPLETED
(cherry picked from commit f4f9207f77883efa4dab67b3afe7c693585dc32c)

10 years agomodules_k/siptutils : Fixed small typo
Marius Zbihlei [Wed, 3 Feb 2010 12:25:18 +0000 (14:25 +0200)]
modules_k/siptutils : Fixed small typo

10 years agotest:unit Fixed unixodbc tests (tested with mysql connector)
Marius Zbihlei [Wed, 3 Feb 2010 12:19:51 +0000 (14:19 +0200)]
test:unit Fixed unixodbc tests (tested with mysql connector)

10 years agoModules_k/siputils : config framework implementation start
Marius Zbihlei [Mon, 1 Feb 2010 10:26:21 +0000 (12:26 +0200)]
Modules_k/siputils : config framework implementation start

Started for ring_timeout

10 years agodebian: Module xmlrpc was moved to "modules".
Jan Janak [Tue, 2 Feb 2010 20:54:42 +0000 (15:54 -0500)]
debian: Module xmlrpc was moved to "modules".

Update the packaging scripts.

10 years agocore: fix bogus gcc-4.4 warning
Andrei Pelinescu-Onciul [Tue, 2 Feb 2010 16:40:22 +0000 (17:40 +0100)]
core: fix bogus gcc-4.4 warning

10 years agoxlog(k): parameter to control printing cfg name
Elena-Ramona Modroiu [Tue, 2 Feb 2010 14:45:58 +0000 (15:45 +0100)]
xlog(k): parameter to control printing cfg name

- long_format set to 1 makes xlogl() and xdbgl() to print config file
  name before line number (useful for usage of 'include_file')

10 years agomqueue: new module offering memory queues
Elena-Ramona Modroiu [Tue, 2 Feb 2010 11:37:59 +0000 (12:37 +0100)]
mqueue: new module offering memory queues

- for usage in cfg file
- many queues can be defined
- one item in queue is a pair (key, value), both string
- functions to add and consume items in the queue
- fetching the oldest item makes it available to pseudo-variables
- example of usage: send tasks from SIP workers to a timer process
  (e.g., defined by rtimer module) that consumes them. Can be some time
  expensive operation, like email notification, etc.

10 years agocore:forward.c Small typo regarding tested socket
Marius Zbihlei [Tue, 2 Feb 2010 09:23:59 +0000 (11:23 +0200)]
core:forward.c Small typo regarding tested socket

10 years agocore: fix missing close() in get_out_socket()
Andrei Pelinescu-Onciul [Tue, 2 Feb 2010 09:09:15 +0000 (10:09 +0100)]
core: fix missing close() in get_out_socket()

- errorpath for EISCONN missed close()-ing the sockets
- added unlikely() on all the error checks