sip-router
8 years agoMerge branch 'master' into treimann/master_tm-extend-callbacks
Timo Reimann [Wed, 21 Dec 2011 19:01:06 +0000 (20:01 +0100)]
Merge branch 'master' into treimann/master_tm-extend-callbacks

* master: (201 commits)
  modules: bunch of READMEs regenerated to be sync'ed with docbook
  modules: coherent naming of Statistics section in docbook
  sl: regenerated the readme
  sl: documented exported statistics
  core/tcp: define option TCP_CLONE_RCVBUF to turn off/on tcp rcv buffer cloning
  pdt(k): added rpc command pdt.reload
  pdt(k): MI commands can be disabled via define PDT_NO_MI
  pdt(k): updates to documentation
  pdt: refactored prefix-domain translation
  tcp: fix for ENOTCONN on newer FreeBSDs
  dialplan: added fnmatch (2) matching operator
  core/tcp: init max_tls_connections in tcp options check
  core/tcp: proper init of parameter tls_max_connections
  textopsx: added fnmatch(value, expr, flags) function
  core: added function to help fixup of PVE, string and expressions
  registrar(k): maintaining one contact per AoR has priority over max_contacts
  lib/srdb1: Enable non-pooled database connections to be defined.
  modules_k/presence: Added additional return value to pres_auth_status() for polite-block
  tls: new parameter 'renegotiation' to enable/disable client renegotiation
  tls: use pkg-config to get cflags and libs for compilation
  ...

8 years agomodules: bunch of READMEs regenerated to be sync'ed with docbook
Daniel-Constantin Mierla [Tue, 20 Dec 2011 23:46:25 +0000 (00:46 +0100)]
modules: bunch of READMEs regenerated to be sync'ed with docbook

8 years agomodules: coherent naming of Statistics section in docbook
Daniel-Constantin Mierla [Tue, 20 Dec 2011 23:44:35 +0000 (00:44 +0100)]
modules: coherent naming of Statistics section in docbook

- it is easier to generate alphabetic indexes

8 years agosl: regenerated the readme
Daniel-Constantin Mierla [Tue, 20 Dec 2011 23:29:50 +0000 (00:29 +0100)]
sl: regenerated the readme

8 years agosl: documented exported statistics
Daniel-Constantin Mierla [Tue, 20 Dec 2011 23:29:14 +0000 (00:29 +0100)]
sl: documented exported statistics

8 years agocore/tcp: define option TCP_CLONE_RCVBUF to turn off/on tcp rcv buffer cloning
Daniel-Constantin Mierla [Tue, 20 Dec 2011 21:34:26 +0000 (22:34 +0100)]
core/tcp: define option TCP_CLONE_RCVBUF to turn off/on tcp rcv buffer cloning

- cloning is on by default, to be safe for topoh and msg_apply_changes()

8 years agopdt(k): added rpc command pdt.reload
Elena-Ramona Modroiu [Tue, 20 Dec 2011 20:49:36 +0000 (21:49 +0100)]
pdt(k): added rpc command pdt.reload

- reload database records to pdt cache

8 years agopdt(k): MI commands can be disabled via define PDT_NO_MI
Elena-Ramona Modroiu [Tue, 20 Dec 2011 20:39:05 +0000 (21:39 +0100)]
pdt(k): MI commands can be disabled via define PDT_NO_MI

8 years agopdt(k): updates to documentation
Elena-Ramona Modroiu [Tue, 20 Dec 2011 17:09:49 +0000 (18:09 +0100)]
pdt(k): updates to documentation

- new function pd_translate(dsomain, rmode)

8 years agopdt: refactored prefix-domain translation
Elena-Ramona Modroiu [Tue, 20 Dec 2011 16:58:42 +0000 (17:58 +0100)]
pdt: refactored prefix-domain translation

- use internally a function that can take the source domain as parameter
- new function to config pd_translate(sdomain, flags) to allow source
  domain to be given from config file

8 years agotcp: fix for ENOTCONN on newer FreeBSDs
Andrei Pelinescu-Onciul [Tue, 22 Nov 2011 11:55:39 +0000 (12:55 +0100)]
tcp: fix for ENOTCONN on newer FreeBSDs

Newer FreeBSDs return ENOTCONN instead of EAGAIN/EWOULDBLOCK when
trying to send on a non-blocking socket which is not yet fully
connected (the connect is still pending).

Reported-by: Dmitry Petrakoff dimon dprs-consulting com
8 years agodialplan: added fnmatch (2) matching operator
Daniel-Constantin Mierla [Tue, 20 Dec 2011 10:27:14 +0000 (11:27 +0100)]
dialplan: added fnmatch (2) matching operator

- if match_op=2, the matching of the rule is done using fnmatch function
  which does shell-like pattern matching

8 years agocore/tcp: init max_tls_connections in tcp options check
Daniel-Constantin Mierla [Tue, 20 Dec 2011 08:20:40 +0000 (09:20 +0100)]
core/tcp: init max_tls_connections in tcp options check

8 years agocore/tcp: proper init of parameter tls_max_connections
Daniel-Constantin Mierla [Mon, 19 Dec 2011 23:33:39 +0000 (00:33 +0100)]
core/tcp: proper init of parameter tls_max_connections

- the fixup function was setting to tcp value

8 years agotextopsx: added fnmatch(value, expr, flags) function
Daniel-Constantin Mierla [Mon, 19 Dec 2011 21:08:57 +0000 (22:08 +0100)]
textopsx: added fnmatch(value, expr, flags) function

- shell-style pattern matching (via file selection wildcards), using C
  function fnmatch()

8 years agocore: added function to help fixup of PVE, string and expressions
Daniel-Constantin Mierla [Mon, 19 Dec 2011 20:58:24 +0000 (21:58 +0100)]
core: added function to help fixup of PVE, string and expressions

- existing function could convert single pv PVE in PVAR, which can cause
  troubles as PVE value should be always zero terminated

8 years agoregistrar(k): maintaining one contact per AoR has priority over max_contacts
Daniel-Constantin Mierla [Mon, 19 Dec 2011 12:18:54 +0000 (13:18 +0100)]
registrar(k): maintaining one contact per AoR has priority over max_contacts

- when using save() with the flags to keep only one contact per AoR,
  max_contacts limit is no longer applied, as it is not matching the
  demants of save() when max_contacts=1
- partch by Walter Doekes, closes FS#192

8 years agolib/srdb1: Enable non-pooled database connections to be defined.
pd [Sun, 18 Dec 2011 21:13:19 +0000 (21:13 +0000)]
lib/srdb1: Enable non-pooled database connections to be defined.

- Kamailio pools database connections, but sometimes this causes
  problems.  For example, we (Crocodile) observed an issue with
  many different queries happening on the same connection while
  using db_fetch_next().
- This change enables you to specify a DB connection as non-pooled
  by putting a '*' at the start of the DB URL in kamailio.cfg.
- Feature added by Paul Pankhurst @ Crocodile RCS

8 years agomodules_k/presence: Added additional return value to pres_auth_status() for polite...
pd [Sun, 18 Dec 2011 21:08:45 +0000 (21:08 +0000)]
modules_k/presence: Added additional return value to pres_auth_status() for polite-block

- pres_auth_status() currently returns just the status of presence relationship.
- However, polite-block consists of a combination of status and reason,
  a polite-blocked watcher has ACTIVE status but a reason of polite-block.
  This means that even though blocked, when just checking based on status,
  polite-blocked watchers appear to be authorised.
- After this change pres_auth_status() returns a magic value of 5 when
  a watcher is polite-blocked.
- Feature added by Hugh Waite @ Crocodile RCS.

8 years agotls: new parameter 'renegotiation' to enable/disable client renegotiation
Daniel-Constantin Mierla [Sat, 17 Dec 2011 21:22:04 +0000 (22:22 +0100)]
tls: new parameter 'renegotiation' to enable/disable client renegotiation

- default is 0 (renegotiation disabled), to protect against SSL
  renegotiation attack
- can be enabled by setting it to 1

8 years agotls: use pkg-config to get cflags and libs for compilation
Daniel-Constantin Mierla [Sat, 17 Dec 2011 20:32:22 +0000 (21:32 +0100)]
tls: use pkg-config to get cflags and libs for compilation

8 years agortimer: updates to readme for interval attribute
Daniel-Constantin Mierla [Fri, 16 Dec 2011 21:33:56 +0000 (22:33 +0100)]
rtimer: updates to readme for interval attribute

8 years agotextopsx: documented keep_hf() function
Daniel-Constantin Mierla [Fri, 16 Dec 2011 21:30:08 +0000 (22:30 +0100)]
textopsx: documented keep_hf() function

8 years agotextopsx: added keep_hf("regexp")
Daniel-Constantin Mierla [Fri, 16 Dec 2011 19:50:50 +0000 (20:50 +0100)]
textopsx: added keep_hf("regexp")

- remove headers that don't match the regular expression regexp
- several header are ignored always (thus not removed): Via, From, To,
  Call-ID, CSeq, Content-Lenght, Content-Type, Max-Forwards, Contact,
  Route, Record-Route -- these can be removed one by one with
  remove_hf()
- the new function helps reducing the size of the sip message, by
  removing not mandatory headers

8 years agortimer: exec interval can be in microsecods
Daniel-Constantin Mierla [Fri, 16 Dec 2011 12:46:57 +0000 (13:46 +0100)]
rtimer: exec interval can be in microsecods

- value of interval parameter can be ended in 'u' to tell is a
  microsecond based interval
- for each timer running on micro-seconds interval, a new micro-second
  timer process is started (no option to use an existing timer with same
  precision)

8 years agoMakefile: devel version increased to 3.3.0-dev3
Daniel-Constantin Mierla [Fri, 16 Dec 2011 12:18:09 +0000 (13:18 +0100)]
Makefile: devel version increased to 3.3.0-dev3

8 years agolib/binrpc: fixed compile warnings
Daniel-Constantin Mierla [Fri, 16 Dec 2011 12:17:22 +0000 (13:17 +0100)]
lib/binrpc: fixed compile warnings

- reported by Juha Heinanen

8 years agopv: new transformation class 'line'
Daniel-Constantin Mierla [Fri, 16 Dec 2011 12:10:57 +0000 (13:10 +0100)]
pv: new transformation class 'line'

- {line.count} - return number of lines in PV
- {line.at,pos} - return the line at position pos
- {line.sw,exp} - return the line starting with 'exp'

8 years agopv: use a pool of buffers for transformations
Daniel-Constantin Mierla [Thu, 15 Dec 2011 17:58:02 +0000 (18:58 +0100)]
pv: use a pool of buffers for transformations

- currently 4 slots - safer for chained string transformations that need
  the local buffer

8 years agopv: take in cosideration escaped chars for s.rm transformation
Daniel-Constantin Mierla [Thu, 15 Dec 2011 17:37:03 +0000 (18:37 +0100)]
pv: take in cosideration escaped chars for s.rm transformation

8 years agopv: added s.rm transformation
Daniel-Constantin Mierla [Thu, 15 Dec 2011 16:54:21 +0000 (17:54 +0100)]
pv: added s.rm transformation

- {s.rm,match} - remove occurrences of 'match' from PV
- 'match' can be static string or variable

8 years agopv: added transformations for trim, right trim and left trim
Daniel-Constantin Mierla [Thu, 15 Dec 2011 15:19:18 +0000 (16:19 +0100)]
pv: added transformations for trim, right trim and left trim

- remove whitespaces (' ', '\t', '\r', '\n') from start or end of a string value

8 years agocore: added rpc commands to list listen sockets and name aliases
Daniel-Constantin Mierla [Thu, 15 Dec 2011 12:03:00 +0000 (13:03 +0100)]
core: added rpc commands to list listen sockets and name aliases

- core.sockets_list
- core.aliases_list

8 years agocore: merged proto id to name functions
Daniel-Constantin Mierla [Thu, 15 Dec 2011 12:01:51 +0000 (13:01 +0100)]
core: merged proto id to name functions

8 years agocore/timer: added support for basic mili-second timers
Daniel-Constantin Mierla [Wed, 14 Dec 2011 22:18:36 +0000 (23:18 +0100)]
core/timer: added support for basic mili-second timers

- renamed second-based timer functions from dummy to basic

8 years agotls: rpc tls.info prints the limit and opened tls connections
Daniel-Constantin Mierla [Tue, 13 Dec 2011 22:08:50 +0000 (23:08 +0100)]
tls: rpc tls.info prints the limit and opened tls connections

8 years agocore/tcp/tls: added tls_max_connections global parameter
Daniel-Constantin Mierla [Tue, 13 Dec 2011 22:01:48 +0000 (23:01 +0100)]
core/tcp/tls: added tls_max_connections global parameter

- set a limit to active tls connections
- its management is done in tcp code, as tls is encryption layer over
  tcp
- tls connections are still counted as tcp connections, thus this limit
  cannot exceed tcp_max_connections
- default value 2048
- core.tcp_options lists also the tls connections number

8 years agocore: added core.tcp_list rpc command
Daniel-Constantin Mierla [Tue, 13 Dec 2011 14:02:02 +0000 (15:02 +0100)]
core: added core.tcp_list rpc command

- print details about tcp connections

8 years agotls: do TLS pre-init operations at the time of loading module
Daniel-Constantin Mierla [Tue, 13 Dec 2011 12:00:50 +0000 (13:00 +0100)]
tls: do TLS pre-init operations at the time of loading module

- makes sure that it sets the memory managing functions and the locks
  before other modules may start using libssl
- reported by √ėyvind Kolbu, FS#183

8 years agomodules_k/siputils: removed unused sip_msg* param from is_uri_user_e164()
Juha Heinanen [Sun, 11 Dec 2011 07:26:45 +0000 (09:26 +0200)]
modules_k/siputils: removed unused sip_msg* param from is_uri_user_e164()

8 years agoasync: readme file was regenerated
Daniel-Constantin Mierla [Sat, 10 Dec 2011 23:05:46 +0000 (00:05 +0100)]
async: readme file was regenerated

8 years agoasync: fixed broken docbook crated in previous commit
Daniel-Constantin Mierla [Sat, 10 Dec 2011 23:04:47 +0000 (00:04 +0100)]
async: fixed broken docbook crated in previous commit

8 years agoasync: cfg functions cannot be used in branch_route
Daniel-Constantin Mierla [Sat, 10 Dec 2011 23:02:14 +0000 (00:02 +0100)]
async: cfg functions cannot be used in branch_route

- that routing block is processing outgoing brnaches, not requests
- reported by Jasmin Schnatterbeck, FS#190

8 years agomodules_k/pua: Some of the functions in pua_db.c did not completely replicate the...
pd [Thu, 8 Dec 2011 22:05:35 +0000 (22:05 +0000)]
modules_k/pua: Some of the functions in pua_db.c did not completely replicate the behaviour of the original hash-table functions

- This caused a variety of problems during RLS client testing.
- Fixes by Paul Pankhurst @ Crocodile RCS

8 years agomodules_k/pua: Temporary dialogs did not contain all of the required fields.
pd [Thu, 8 Dec 2011 22:03:35 +0000 (22:03 +0000)]
modules_k/pua: Temporary dialogs did not contain all of the required fields.

- Temporary dialogs are created when a SUBSCRIBE is sent to handle the timing
  issue that means that NOTIFYs can be processed before 200 OKs (the real
  dialog is created on 200 OK).
- Not every required field was filled in for the temporary dialogs so dialog
  searches were failing and duplicate dialogs created.

8 years agomodules_k/presence, modules_k/pua, modules_k/rls: Changed rls_update_subs() to not...
pd [Thu, 8 Dec 2011 22:01:06 +0000 (22:01 +0000)]
modules_k/presence, modules_k/pua, modules_k/rls: Changed rls_update_subs() to not send unnecessary back-end re-SUBSCRIBEs.

- The initial implementation sent a re-SUBSCRIBE for each existing back-end
  dialog and create new back-end dialogs as required (depending on the contents
  of the updated resource-list) documents.
- This was very wasteful, so this version only sends the new SUBSCRIBEs

8 years agomodules_k/pua: Fixed some dialog output levels
pd [Thu, 8 Dec 2011 21:55:35 +0000 (21:55 +0000)]
modules_k/pua: Fixed some dialog output levels

8 years agomodules_k/rls: Added lock for rls_update_subs() in DB only mode
pd [Thu, 8 Dec 2011 21:50:05 +0000 (21:50 +0000)]
modules_k/rls: Added lock for rls_update_subs() in DB only mode

- If a client updates the same resource-list document multiple times in quick
  succession rls_update_subs() might overlap for the same dialogs.
- This was causing problems in DB only mode so a lock has been added.
- Not a problem when the hash-table is used as each row has locks.
- Problem identified and fix defined by me.
- Fix implemented by Hugh Waite @ Crocodile RCS

8 years agomodules_k/rls: removed unnecessary waitn_time <= 0 check
pd [Thu, 8 Dec 2011 21:47:54 +0000 (21:47 +0000)]
modules_k/rls: removed unnecessary waitn_time <= 0 check

- This was checked twice one immediately after the other.  The second check
  would never fail.

8 years agomodules_k/rls: Fixed some diagnostics that had typos and were at the wrong levels
pd [Thu, 8 Dec 2011 21:46:48 +0000 (21:46 +0000)]
modules_k/rls: Fixed some diagnostics that had typos and were at the wrong levels

8 years agomodules_k/rls: Memory allocation problem for NOTIFY bodies
pd [Thu, 8 Dec 2011 21:40:20 +0000 (21:40 +0000)]
modules_k/rls: Memory allocation problem for NOTIFY bodies

- A few problems here:
  - The actual allocated buffer size was not used in the calculations in
    constr_multipart_body
  - The buffer pointer was copied to a local variable and not copied back after
    a realloc in constr_mulitpart_body().  This resulted in a double free when
    the realloc moved the buffer.
  - The length of the data in string buffer was never copied back to the str in
    constr_multipart_body().
  - In both constr_multipart_body() and resource_notify.c when the buffer does
    not contain enough space another 2048 bytes is allocated.  This is
    regardless of how much more space is actually needed.  So if 4096 bytes
    were needed 2048 bytes would be allocated and then the end of the buffer
    would be overwritten by 4096 bytes of data.
  - Problem found and diagnosed during testing at Crocodile RCS
  - Fix implemented by Hugh Waite @ Crocodile RCS

8 years agomodules_k/presence: Authorisation requests not working in DB only mode
pd [Thu, 8 Dec 2011 21:30:51 +0000 (21:30 +0000)]
modules_k/presence: Authorisation requests not working in DB only mode

- The code behind pres_update_watchers() seemed to be missed when the presence
  DB only work was done.
- pres_update_watchers() continued to work when the hash-table was used but not
  in DB only mode.
- Problem and fix identified during testing @ Crocodile RCS
- Fix implemented by Paul Pankhurst @ Crocodile RCS

8 years agomodules_k/xcap_server: Changed the XCAP server so that existing documents are updated...
pd [Thu, 8 Dec 2011 21:23:12 +0000 (21:23 +0000)]
modules_k/xcap_server: Changed the XCAP server so that existing documents are updated instead of deleted and inserted

- Affects XCAP PUT and XCAP partial DELETE
- Some RLS clients send multiple HTTP updates in very close succession.  One
  client has even been observed to upload an identical document several times
  in a row.
- I use rls_update_subs() when any resource-list related document is uploaded.
  With Kamailio being multi-process and the client re-uploading an indentical
  document several times with no time between I was frequently hitting the
  window where rls_update_subs() was called after the DB delete for the second
  upload but before the insert happened.
- Now the DB put operation checks for the presence of a document and does an
  insert only if the document does not exist.  It does an update if the
  document does exist.

8 years agomodules_k/rr: Exported record_route_advertised_address function to config file
pd [Thu, 8 Dec 2011 21:19:25 +0000 (21:19 +0000)]
modules_k/rr: Exported record_route_advertised_address function to config file

- Exported the C API function to the config file
- CHange by Hugh Waite @ Crocodile RCS

8 years agoxmlrpc: Removed define for Solaris compilations
Jason Penton [Wed, 7 Dec 2011 12:32:45 +0000 (14:32 +0200)]
xmlrpc: Removed define for Solaris compilations
 - This define breaks on Solaris and is not required

8 years agomodules_k/msilo: removed debug statement
Juha Heinanen [Wed, 7 Dec 2011 07:16:20 +0000 (09:16 +0200)]
modules_k/msilo: removed debug statement

8 years agomodules_k/msilo: added storage of extra SIP headers from AVP
Juha Heinanen [Wed, 7 Dec 2011 05:53:28 +0000 (07:53 +0200)]
modules_k/msilo: added storage of extra SIP headers from AVP

8 years agomodules_k/siputils: faster implementation of is_uri_user_e164 test
Juha Heinanen [Sun, 4 Dec 2011 11:42:16 +0000 (13:42 +0200)]
modules_k/siputils: faster implementation of is_uri_user_e164 test

8 years agocore/tcp: clone received message over tcp in local buffer
Daniel-Constantin Mierla [Fri, 2 Dec 2011 12:05:55 +0000 (13:05 +0100)]
core/tcp: clone received message over tcp in local buffer

- receive_msg() got pointer inside tcp stream as rcv buffer, linking it to
  msg->buf, but there are places where the content of msg->buf is
  changed (topoh, msg_apply_changes) which can result in corruption of
  tcp stream content
- added a wrapper function receive_tcp_msg() to clone the content and
  have same behaviour as for udp or sctp
- reported by Hugh Waite, FS#185

8 years agotm: safety check to be sure t_release() is executed in request_route
Daniel-Constantin Mierla [Fri, 2 Dec 2011 10:55:28 +0000 (11:55 +0100)]
tm: safety check to be sure t_release() is executed in request_route

- t_release() is intended for request_route block, but can be executed
  from other types of root routing block via subroute, causing a crash
- the fix ensures the root routing block is request_route
- reported by Jose Luis Millan, closes FS#184

8 years agocore: Solaris fix for using libcurl
Jason Penton [Fri, 2 Dec 2011 06:41:29 +0000 (08:41 +0200)]
core: Solaris fix for using libcurl
 - Require this fix on solaris for any dynamic loading of modules that use libcurl.
   See comment above fix for more details

8 years agodialog(k): give dir parameter to get_dlg()
Daniel-Constantin Mierla [Thu, 1 Dec 2011 23:37:18 +0000 (00:37 +0100)]
dialog(k): give dir parameter to get_dlg()

- initialized to DLG_DIR_NONE to fix accessing NULL pointer for
  searching dialog by msg attributes
- patch by Jasmin Schnatterbeck

8 years agomodules/lcr: fixed testing of transport protocol by to_gw functions
Juha Heinanen [Thu, 1 Dec 2011 10:00:32 +0000 (12:00 +0200)]
modules/lcr: fixed testing of transport protocol by to_gw functions

- Test failed when transport protocol is taken from Request-URI and
  there is not any.

8 years agorls(k): regenerated the readme file
Daniel-Constantin Mierla [Thu, 1 Dec 2011 08:55:57 +0000 (09:55 +0100)]
rls(k): regenerated the readme file

8 years agopresence(k): regenerated the readme
Daniel-Constantin Mierla [Thu, 1 Dec 2011 08:55:33 +0000 (09:55 +0100)]
presence(k): regenerated the readme

8 years agopresence(k): documented fetch_rows parameter
Daniel-Constantin Mierla [Thu, 1 Dec 2011 08:55:10 +0000 (09:55 +0100)]
presence(k): documented fetch_rows parameter

8 years agorls(k): documented fetch_rows parameter
Daniel-Constantin Mierla [Thu, 1 Dec 2011 08:54:42 +0000 (09:54 +0100)]
rls(k): documented fetch_rows parameter

8 years agorls(k): option load db records in chunks
Daniel-Constantin Mierla [Thu, 1 Dec 2011 08:49:22 +0000 (09:49 +0100)]
rls(k): option load db records in chunks

- cope better with large number of db records
- new parameter fetch_rows (default value 500)

8 years agopresence(k): option to fetch records from db in chunks
Daniel-Constantin Mierla [Thu, 1 Dec 2011 08:20:01 +0000 (09:20 +0100)]
presence(k): option to fetch records from db in chunks

- can cope with large number of db records
- new parameter fetch_rows (default value 500)

8 years agopua: regenerated the readme file
Daniel-Constantin Mierla [Wed, 30 Nov 2011 18:00:30 +0000 (19:00 +0100)]
pua: regenerated the readme file

8 years agopua: documente fetch_rows parameter
Daniel-Constantin Mierla [Wed, 30 Nov 2011 18:00:11 +0000 (19:00 +0100)]
pua: documente fetch_rows parameter

8 years agodialog(k): disable unused functionunref_new_dialog()
Daniel-Constantin Mierla [Wed, 30 Nov 2011 17:57:21 +0000 (18:57 +0100)]
dialog(k): disable unused functionunref_new_dialog()

- get rid of compliler warning

8 years agodialog(k): safety check for lookup in dialog table at shutdown
Daniel-Constantin Mierla [Fri, 25 Nov 2011 23:32:23 +0000 (00:32 +0100)]
dialog(k): safety check for lookup in dialog table at shutdown
(cherry picked from commit 017ea5779710223df8f5a28829f77eff8395affc)

8 years agodialog(k): refactored dlg ref counting
Daniel-Constantin Mierla [Mon, 21 Nov 2011 22:52:43 +0000 (23:52 +0100)]
dialog(k): refactored dlg ref counting

- dlg pointer is no longer stored in tm callbacks parameter and ref
  counting for these kind of needs was removed
- the internal id (hash entry, dlg id) is given now to tm callbacks. The
  callbacks will do dlg lookup to get the structure
- there are longer-time persistent ref counting for:
  * storing dlg structure in dialog hash table
  * keeping dlg in timer list
  * waiting for the reply of BYE to destroy dialog structure
- all the other ref countings are for short time, only for the period of
  doing specific processing
- the new ref counting is safer in relation with tm callbacks and avoids
  tight dependecy which may have been easily broken by future tm changes
(cherry picked from commit 9ba4ee25e32368a9c17c3f86784a52a97b748b93)

8 years agoparser: remove old URI parser and structure
Daniel-Constantin Mierla [Wed, 30 Nov 2011 14:19:35 +0000 (15:19 +0100)]
parser: remove old URI parser and structure

8 years agopua: load records from database in chunks
Daniel-Constantin Mierla [Wed, 30 Nov 2011 14:18:23 +0000 (15:18 +0100)]
pua: load records from database in chunks

- use fetch result capability from database connector
- new module parameter fetch_rows (default 500)
- reported by Laura Testi

8 years agolib/srdb1: helper functions to handle easier fetch capability
Daniel-Constantin Mierla [Wed, 30 Nov 2011 14:17:46 +0000 (15:17 +0100)]
lib/srdb1: helper functions to handle easier fetch capability

8 years agotm: proper increment of lightweight parsing for call-id
Daniel-Constantin Mierla [Tue, 29 Nov 2011 10:58:45 +0000 (11:58 +0100)]
tm: proper increment of lightweight parsing for call-id

- a pretty much harmless fix to increment with 3 instead of 7 when
  parsing Call-ID name in lightweight parser
- reported and patch by Walter Doekes, FS#168

8 years agosanity: allow doing the checks in reply routes
Daniel-Constantin Mierla [Tue, 29 Nov 2011 10:36:36 +0000 (11:36 +0100)]
sanity: allow doing the checks in reply routes

- use wrapper function for sending replies, to skip doing it for SIP
  replies
- reported by Bayan Towfiq, FS#177

8 years agodoc/rpc: updated function prototypes and names
Daniel-Constantin Mierla [Sat, 26 Nov 2011 08:51:18 +0000 (09:51 +0100)]
doc/rpc: updated function prototypes and names

8 years agodoc/rpc_list: updates to the files with list of rpc commands
Daniel-Constantin Mierla [Fri, 25 Nov 2011 23:21:53 +0000 (00:21 +0100)]
doc/rpc_list: updates to the files with list of rpc commands

8 years agodoc/rpc_list: added note about duplicated names for modules
Daniel-Constantin Mierla [Fri, 25 Nov 2011 23:20:29 +0000 (00:20 +0100)]
doc/rpc_list: added note about duplicated names for modules

8 years agodoc/rpc_list: regenerated the files with the list of rpc commands
Daniel-Constantin Mierla [Fri, 25 Nov 2011 22:49:45 +0000 (23:49 +0100)]
doc/rpc_list: regenerated the files with the list of rpc commands

8 years agodoc/rpc_list: take the C compile flags from core makefile
Daniel-Constantin Mierla [Fri, 25 Nov 2011 22:48:10 +0000 (23:48 +0100)]
doc/rpc_list: take the C compile flags from core makefile

8 years agoMakefile: option to print C compile flags
Daniel-Constantin Mierla [Fri, 25 Nov 2011 22:46:31 +0000 (23:46 +0100)]
Makefile: option to print C compile flags

- print with no EOL the module interface flag in Makefile.modules

8 years agodoc/rpc_list: get module interface to extract the list of rpc commands
Daniel-Constantin Mierla [Fri, 25 Nov 2011 17:39:14 +0000 (18:39 +0100)]
doc/rpc_list: get module interface to extract the list of rpc commands

8 years agoMakefile.modules: printmiface - new target to print module interface define
Daniel-Constantin Mierla [Fri, 25 Nov 2011 17:38:24 +0000 (18:38 +0100)]
Makefile.modules: printmiface - new target to print module interface define

8 years agoparser: don't free on error To param linked in to_body struct
Daniel-Constantin Mierla [Thu, 24 Nov 2011 16:22:26 +0000 (17:22 +0100)]
parser: don't free on error To param linked in to_body struct

- if a To header parameter was already linked in to_body struct, don't
  free if there is a parsing error for it later, it will be freed by
  free_to_params()
- reported by Bayan Towfiq in FS#180

8 years agotextops(k): free only pkg body lumps for set_body()
Daniel-Constantin Mierla [Thu, 24 Nov 2011 14:30:15 +0000 (15:30 +0100)]
textops(k): free only pkg body lumps for set_body()

- if set_body() is used in failure_route, it should not destroy
  completely the lumps cloned in tm, just ignore them and free the ones
  added in failure_route before execution of itself
- reported by Brandon Armstead, FS#181

8 years agotm: backup/restore lump lists for faked requests
Daniel-Constantin Mierla [Thu, 24 Nov 2011 14:28:04 +0000 (15:28 +0100)]
tm: backup/restore lump lists for faked requests

- some cfg functions that can be used in failure_route can destroy the
  head of lump lists, thus better backup before and restore after failure_route
  execution

8 years agocore: better check for cloned lumps in shared memory
Daniel-Constantin Mierla [Thu, 24 Nov 2011 14:26:47 +0000 (15:26 +0100)]
core: better check for cloned lumps in shared memory

- bitwise test for LUMPFLAG_SHMEM

8 years agocore: save and restore branch_iterator in print_dset
Daniel-Constantin Mierla [Thu, 24 Nov 2011 11:56:28 +0000 (12:56 +0100)]
core: save and restore branch_iterator in print_dset

- safe usage in branch_route where branch_interator is used to add the
  new brnaches, but some variables can change it if used in config
  branch_route
- closes FS#182, reported by Pawel Sternal

8 years agodialog(k): destroy dlg structure first time ref counter gets to 0
Daniel-Constantin Mierla [Tue, 22 Nov 2011 10:30:56 +0000 (11:30 +0100)]
dialog(k): destroy dlg structure first time ref counter gets to 0

- reported by Bayan Towfix, FS#173

8 years agopv: use msg pid to check the integrity of cached time
Daniel-Constantin Mierla [Tue, 22 Nov 2011 10:30:02 +0000 (11:30 +0100)]
pv: use msg pid to check the integrity of cached time

- safer when dealing with async or failure processing

8 years agoDoc fixes for reg_timer_interval patch. I'll try not to break things
Alex Balashov [Mon, 21 Nov 2011 12:10:21 +0000 (07:10 -0500)]
Doc fixes for reg_timer_interval patch.  I'll try not to break things
again.

8 years agoFixed equivocation of STR_PARAM / INT_PARAM for reg_timer_interval patch.
Alex Balashov [Mon, 21 Nov 2011 11:21:24 +0000 (06:21 -0500)]
Fixed equivocation of STR_PARAM / INT_PARAM for reg_timer_interval patch.

8 years agoAdded reg_timer_interval modparam to uac to allow user to regulate the
Alex Balashov - Diminuendo-2 [Mon, 21 Nov 2011 11:13:05 +0000 (06:13 -0500)]
Added reg_timer_interval modparam to uac to allow user to regulate the
frequency with which registrations are renewed and otherwise managed.
Previously, this has been hardcoded to 90 seconds.

8 years agomodules_k/rr: Added new (C-API) function to add Record-Route based on advertised...
pd [Sun, 20 Nov 2011 22:09:57 +0000 (22:09 +0000)]
modules_k/rr: Added new (C-API) function to add Record-Route based on advertised address

- You can already do something similar with record_route_preset, but that
  function has some disadvantages.  Double record-routing doesn't work and you
  can't subsequently add parameters to the Record-Route header.  This new
  function doesn't have these disadvantages.
- Currently this is not exported to the configuration file.  This may be worth
  doing in the future.
- Feature added by Hugh Waite @ Crocodile RCS

8 years agomodules/app_lua, modules_k/siputils, modules_k/uac: Added siputils.is_uri_user_e164...
pd [Sun, 20 Nov 2011 22:05:14 +0000 (22:05 +0000)]
modules/app_lua, modules_k/siputils, modules_k/uac: Added siputils.is_uri_user_e164 and uac.replace_from to app_lua

8 years agomodules_k/pua, modules_k/rls: Several debug, PostgreSQL, and DB only fixes to PUA...
pd [Sun, 20 Nov 2011 21:55:28 +0000 (21:55 +0000)]
modules_k/pua, modules_k/rls: Several debug, PostgreSQL, and DB only fixes to PUA and RLS

- A number of small tweaks and fixes