sip-router
11 years agocore: increased verbosity of error log message
Nils Ohlmeier [Tue, 19 May 2009 00:18:59 +0000 (02:18 +0200)]
core: increased verbosity of error log message

- added size information to an error log message of the config
  framework

11 years agomake: excluded modules with radius dependency
Nils Ohlmeier [Tue, 19 May 2009 00:07:13 +0000 (02:07 +0200)]
make: excluded modules with radius dependency

- excluded and moved misc_radius and peering modules to the radius
  module group to allow to build the basic set of modules without
  dependency on radius library being installed.

11 years agocore: bug fix in PV printing related to static buffer
Henning Westerholt [Mon, 18 May 2009 17:29:30 +0000 (19:29 +0200)]
core: bug fix in PV printing related to static buffer

fix a bug in the PV printing (for k). The code allocated a static buffer, but
failed to proper initialize it with zero. Thus in certain cases old data from
previous PV evaluation is returned.
is returned

11 years agotest: further portings to sr and small extensions
Henning Westerholt [Mon, 18 May 2009 13:41:29 +0000 (15:41 +0200)]
test: further portings to sr and small extensions

11 years agotest: port dbtext default modules load and cr on postgres
Henning Westerholt [Thu, 14 May 2009 14:51:40 +0000 (16:51 +0200)]
test: port dbtext default modules load and cr on postgres

11 years agopv: propagation of assignment with $null
Daniel-Constantin Mierla [Fri, 15 May 2009 11:57:31 +0000 (14:57 +0300)]
pv: propagation of assignment with $null

11 years agopv: assignment with $null deletes the avp
Daniel-Constantin Mierla [Fri, 15 May 2009 11:42:21 +0000 (14:42 +0300)]
pv: assignment with $null deletes the avp

- $avp(x) = $null; - equivalent of $avp(x) = null; in K
- $(avp(x)[*]) = $null; - equivalent of $avp(x) := null; in K

11 years ago@ruri forces parsing the URI.
Miklos Tirpak [Fri, 15 May 2009 08:04:50 +0000 (10:04 +0200)]
@ruri forces parsing the URI.

The entire RURI value is rearly used as it is,
rather its subparts are important. The result of this
patch is that for example @ruri.user and @ruri.host
cause one parsing instead of two when the RURI has
not been parsed yet.

11 years agoAvoid parsing the Request URI when it is not necessary.
Miklos Tirpak [Fri, 15 May 2009 07:42:29 +0000 (09:42 +0200)]
Avoid parsing the Request URI when it is not necessary.

When @ruri.user was executed, the first select call set
the value of the URI in str format regardless of whether
or not it had already been parsed. The second function call
took the str value, and parsed the URI to get its user part.

This patch introduces a global pointer variable that can be set
to the already parsed URI being processed. Any nested select
function can check this pointer and access the parsed URI if
possible.

11 years ago* Added missing "goto err;" in a mod_init() error case.
Juha Heinanen [Fri, 15 May 2009 07:35:41 +0000 (10:35 +0300)]
* Added missing "goto err;" in a mod_init() error case.

11 years agopv: assignment to an avp with index '*'
Daniel-Constantin Mierla [Fri, 15 May 2009 07:25:58 +0000 (10:25 +0300)]
pv: assignment to an avp with index '*'

- $(avp(name)[*]) = val; - overwrites all avps with same name
- equivalent of $avp(name) := val; in K

11 years agocore script engine: support for rval expr. in return/drop
Andrei Pelinescu-Onciul [Thu, 14 May 2009 19:42:46 +0000 (21:42 +0200)]
core script engine: support for rval expr. in return/drop

11 years agocore script parser: allow expressions in return/drop
Andrei Pelinescu-Onciul [Thu, 14 May 2009 19:36:59 +0000 (21:36 +0200)]
core script parser: allow expressions in return/drop

Changed drop and return to allow expressions.
E.g.: return $foo+2

11 years agocore script parsing: better error & warning for while() & switch()
Andrei Pelinescu-Onciul [Thu, 14 May 2009 16:10:37 +0000 (18:10 +0200)]
core script parsing: better error & warning for while() & switch()

- while() checks in-line with the if() checks (warnings on
  non-int, parse error on invalid expression).
- switch() - throw a parse error if the switch() expression or
  body is invalid (type-wise)

11 years agotest: port carrierroute config load test to sr, add missing tmx mod to test 13
Henning Westerholt [Thu, 14 May 2009 14:25:59 +0000 (16:25 +0200)]
test: port carrierroute config load test to sr, add missing tmx mod to test 13

11 years agotest: port carrierroute DB load test to sr
Henning Westerholt [Thu, 14 May 2009 14:24:57 +0000 (16:24 +0200)]
test: port carrierroute DB load test to sr

11 years agotest: further adaptions for sr, test 12 still not work, missing return support
Henning Westerholt [Thu, 14 May 2009 11:04:26 +0000 (13:04 +0200)]
test: further adaptions for sr, test 12 still not work, missing return support

11 years agodocbook: Update the path to some modules.
Jan Janak [Wed, 13 May 2009 23:46:24 +0000 (01:46 +0200)]
docbook: Update the path to some modules.

This document includes some module documentation, but those particular
modules currenly live in modules_s directory.

11 years agodocbook: Update and add missing docbook Makefiles
Jan Janak [Wed, 13 May 2009 23:44:10 +0000 (01:44 +0200)]
docbook: Update and add missing docbook Makefiles

This change updates all the Makefiles used to process docbook documents
so that they work with the new docbook build system. It also adds some
missing Makefiles. Every directory containing docbook documentation
should have a Makefile so that it can be processed independently.

11 years agodocbook: Fixed docbook dependency generator
Jan Janak [Wed, 13 May 2009 20:11:18 +0000 (22:11 +0200)]
docbook: Fixed docbook dependency generator

Previous version of the XSL stylesheet that is used to generate dependencies
for docbook documents did not work properly with docbook files included from
other directories, it did not make dependencies relative to the top-level
file being processed, resulting in dependency files that cannot be satisfied.

This change fixes the stylesheet and makes all the depedendencies generated
by the stylesheet relative to the directory of the top-level docbook document
being processed.

In addition to that it fixes a small typo in the main docbook Makefile.

11 years agolcr: fix double free on error
Andrei Pelinescu-Onciul [Wed, 13 May 2009 17:15:24 +0000 (19:15 +0200)]
lcr: fix double free on error

On mod_init() error the lcr module did attempt to free twice all
the shared memory allocated vars (free_shared_memory() is called
twice on error, once when mod_init() fails and once when the
module destroy function is called).

11 years agocore: destroy RPCs on exit
Andrei Pelinescu-Onciul [Wed, 13 May 2009 17:14:57 +0000 (19:14 +0200)]
core: destroy RPCs on exit

11 years agolcr doc: re-gerenarated README
Andrei Pelinescu-Onciul [Wed, 13 May 2009 11:59:53 +0000 (13:59 +0200)]
lcr doc: re-gerenarated README

11 years agolcr doc: added RPC commands section
Andrei Pelinescu-Onciul [Wed, 13 May 2009 11:59:25 +0000 (13:59 +0200)]
lcr doc: added RPC commands section

11 years agolcr: added ser RPC support
Andrei Pelinescu-Onciul [Wed, 13 May 2009 11:52:51 +0000 (13:52 +0200)]
lcr: added ser RPC support

- copied & adapted lcr_rpc.[ch] from the ser version of lcr.
- register the rpc array from mod_init if RPC_SUPPORT is defined
 (defined by default in lcr_rpc.h unless lcr is compiled with
  -DNO_RPC_SUPPORT).
- init db for all the children if RPC_SUPPORT is defined
 (needed for xmlrpc which does not run in a separate process)
- moved some defines, structs and typedefs from lcr_mod.c to lcr_mod.h.

11 years agodoc: rpc doc updated
Andrei Pelinescu-Onciul [Wed, 13 May 2009 11:49:51 +0000 (13:49 +0200)]
doc: rpc doc updated

- added rpc_register_array(rpc_export_array)
- added rpc_register(rcp_export)
- regenerated ser_rpc.txt

11 years agorpc: added register function and switched to hash table
Andrei Pelinescu-Onciul [Mon, 11 May 2009 22:39:03 +0000 (00:39 +0200)]
rpc: added register function and switched to hash table

- rpc switched to hashtable
- added rpc register function, that can be called from modules not
  using ser module interface (e.g. kamailio or future sip-router
  module interface).

11 years agoMerge branch 'master' of ssh://tirpi@git.sip-router.org/sip-router
Miklos Tirpak [Wed, 13 May 2009 15:05:31 +0000 (17:05 +0200)]
Merge branch 'master' of ssh://tirpi@git.sip-router.org/sip-router

* 'master' of ssh://tirpi@git.sip-router.org/sip-router:
  refine registrar tests, bug #2790184, port from kamailio r5837

11 years ago@ruri.rn_user is introduced.
Miklos Tirpak [Wed, 13 May 2009 14:59:39 +0000 (16:59 +0200)]
@ruri.rn_user is introduced.

- The select call returns the value of "rn" parameter if exists, otherwise the user name of the URI. Visual separators are removed from
the user name if needed, and they are always removed from the "rn" parameter value.
- Nested function call, it works with any URI.

11 years agorefine registrar tests, bug #2790184, port from kamailio r5837
Henning Westerholt [Wed, 13 May 2009 13:25:52 +0000 (15:25 +0200)]
refine registrar tests, bug #2790184, port from kamailio r5837

11 years agoMerge branch 'master' of ssh://tirpi@git.sip-router.org/sip-router
Miklos Tirpak [Wed, 13 May 2009 13:06:07 +0000 (15:06 +0200)]
Merge branch 'master' of ssh://tirpi@git.sip-router.org/sip-router

* 'master' of ssh://tirpi@git.sip-router.org/sip-router:
  * Fixed pua module memory leak.  Credits to Anca Vamanu.
  fix k bug #2790184, crash related to uninitialized match_callid parameter

11 years ago@ruri.params["foo"] checks also the original sip: URI parameters
Miklos Tirpak [Wed, 13 May 2009 12:57:26 +0000 (14:57 +0200)]
@ruri.params["foo"] checks also the original sip: URI parameters

This patch increases the compatibility with non-standard implementations when the parameters are added to the end of the sip: URI
instead of the userinfo part in case of a tel: URI embedded in a sip: URI.
For example:
sip:123@domain;foo=bar;user=phone
instead of
sip:123;foo=bar@domain;user=phone

11 years ago* Fixed pua module memory leak. Credits to Anca Vamanu.
Juha Heinanen [Wed, 13 May 2009 12:39:09 +0000 (15:39 +0300)]
* Fixed pua module memory leak.  Credits to Anca Vamanu.

11 years agofix k bug #2790184, crash related to uninitialized match_callid parameter
Henning Westerholt [Wed, 13 May 2009 11:03:30 +0000 (13:03 +0200)]
fix k bug #2790184, crash related to uninitialized match_callid parameter

- reported from Inaki, port from kamailio r5835

11 years agotypo correction
Miklos Tirpak [Wed, 13 May 2009 06:51:27 +0000 (08:51 +0200)]
typo correction

11 years ago* Moved modules_k/utils to modules (it does not exist in s and contains
Juha Heinanen [Mon, 11 May 2009 15:17:17 +0000 (18:17 +0300)]
* Moved modules_k/utils to modules (it does not exist in s and contains
  functions that don't exist in s).

11 years agodoc: rpc struct_scan and struct_add example fixes
Andrei Pelinescu-Onciul [Mon, 11 May 2009 15:12:16 +0000 (17:12 +0200)]
doc: rpc struct_scan and struct_add example fixes

11 years agodoc: rpc txt version added
Andrei Pelinescu-Onciul [Mon, 11 May 2009 14:51:42 +0000 (16:51 +0200)]
doc: rpc txt version added

ser_rpc.txt generated from ser_rpc.xml added.

11 years agodoc: xmlrpc README added
Andrei Pelinescu-Onciul [Mon, 11 May 2009 14:51:05 +0000 (16:51 +0200)]
doc: xmlrpc README added

11 years agodoc: xmlrpc functions and params added
Andrei Pelinescu-Onciul [Mon, 11 May 2009 14:50:15 +0000 (16:50 +0200)]
doc: xmlrpc functions and params added

11 years agodoc: rpc docs split into rpc api and xmlrpc modules docs
Andrei Pelinescu-Onciul [Mon, 11 May 2009 13:59:54 +0000 (15:59 +0200)]
doc: rpc docs split into rpc api and xmlrpc modules docs

- doc/rpc/ser_rpc.xml split into ser_rpc.xml (that contains now
  only generic RPC documentation) and
  modules_s/xmlrpc/doc/xmlrpc.xml (that contains xmlrpc specific
  stuff).
- slight updates and fixes

11 years ago* Fixed bug in computing expires value for subscription dialogs.
Juha Heinanen [Mon, 11 May 2009 11:15:12 +0000 (14:15 +0300)]
* Fixed bug in computing expires value for subscription dialogs.
  Credits to Anca Vamanu.

11 years agodoc: rpc makefile migrated to the new doc make system
Andrei Pelinescu-Onciul [Sun, 10 May 2009 08:56:45 +0000 (10:56 +0200)]
doc: rpc makefile migrated to the new doc make system

11 years ago* Moved lcr module from modules_k to modules and removed it from modules_s.
Juha Heinanen [Sat, 9 May 2009 16:14:18 +0000 (19:14 +0300)]
* Moved lcr module from modules_k to modules and removed it from modules_s.

11 years agomi_xmlrpc: use PROC_NOCHLDINIT to fork process instead of 100
Daniel-Constantin Mierla [Mon, 11 May 2009 08:29:56 +0000 (11:29 +0300)]
mi_xmlrpc: use PROC_NOCHLDINIT to fork process instead of 100

- do not run modules' child init, MI commands register own proc init
  funtion

11 years agomi_datagram: use PROC_NOCHLDINIT to fork process instead of 100
Daniel-Constantin Mierla [Mon, 11 May 2009 08:28:39 +0000 (11:28 +0300)]
mi_datagram: use PROC_NOCHLDINIT to fork process instead of 100

- do not run modules' child init, MI commands register own proc init
  funtion

11 years agomi_fifo: fork process using PROC_NOCHLDINIT instead of 100
Daniel-Constantin Mierla [Mon, 11 May 2009 08:26:43 +0000 (11:26 +0300)]
mi_fifo: fork process using PROC_NOCHLDINIT instead of 100

- do not call modules' child init, MI commands register own proc init
  function

11 years agoRevert "* Moved lcr module from modules_k to modules and removed it from modules_s."
Juha Heinanen [Sun, 10 May 2009 09:40:06 +0000 (12:40 +0300)]
Revert "* Moved lcr module from modules_k to modules and removed it from modules_s."

This reverts commit a3f16850cd2a897710cb0a56174e9f64dcc77653.

11 years ago* Added note on how to generate README of a module.
Juha Heinanen [Sun, 10 May 2009 08:37:40 +0000 (11:37 +0300)]
* Added note on how to generate README of a module.

11 years ago* Moved lcr module from modules_k to modules and removed it from modules_s.
Juha Heinanen [Sat, 9 May 2009 16:14:18 +0000 (19:14 +0300)]
* Moved lcr module from modules_k to modules and removed it from modules_s.

11 years ago* Added support for adding extra headers into MESSAGEs sent out from
Juha Heinanen [Sat, 9 May 2009 16:03:52 +0000 (19:03 +0300)]
* Added support for adding extra headers into MESSAGEs sent out from
  silo by m_dump().

11 years agortimer: update to use the new sr core routes list
Daniel-Constantin Mierla [Fri, 8 May 2009 16:31:35 +0000 (18:31 +0200)]
rtimer: update to use the new sr core routes list

11 years agostatistics: use fixup_pvar_null()
Daniel-Constantin Mierla [Fri, 8 May 2009 06:15:12 +0000 (08:15 +0200)]
statistics: use fixup_pvar_null()

- fixup_pvar() replaced by fixup_pvar_null()

11 years agoutils: use fixup_pvar_null()
Daniel-Constantin Mierla [Fri, 8 May 2009 06:14:47 +0000 (08:14 +0200)]
utils: use fixup_pvar_null()

- fixup_pvar() replaced by fixup_pvar_null()

11 years agodialog: use fixup_pvar_null()
Daniel-Constantin Mierla [Fri, 8 May 2009 06:13:47 +0000 (08:13 +0200)]
dialog: use fixup_pvar_null()

- fixup_pvar() replaced by fixup_pvar_null()

11 years agocore: removed fixup_pvar(param) prototype
Daniel-Constantin Mierla [Fri, 8 May 2009 06:12:18 +0000 (08:12 +0200)]
core: removed fixup_pvar(param) prototype

- no longer implemented as standalone function
- use fixup_pvar_null(param, 1) instead

11 years agosercmd: doc added (README)
Andrei Pelinescu-Onciul [Thu, 7 May 2009 20:23:12 +0000 (22:23 +0200)]
sercmd: doc added (README)

11 years ago* Forward ported DB_CAP_FETCH usage from k 1.5.
Juha Heinanen [Thu, 7 May 2009 17:29:07 +0000 (20:29 +0300)]
* Forward ported DB_CAP_FETCH usage from k 1.5.

11 years agoctl(s): documentation added
Andrei Pelinescu-Onciul [Thu, 7 May 2009 16:48:34 +0000 (18:48 +0200)]
ctl(s): documentation added

11 years agotest: port r5833 from kamailio
Henning Westerholt [Thu, 7 May 2009 16:09:11 +0000 (18:09 +0200)]
test: port r5833 from kamailio

11 years agodialog(k): refine change ffcf29e66d, we need to take care only of PROC_MAIN
Henning Westerholt [Thu, 7 May 2009 13:26:38 +0000 (15:26 +0200)]
dialog(k): refine change ffcf29e66d, we need to take care only of PROC_MAIN

11 years agodialog(k): port db setup to different child_init behaviour on sr
Henning Westerholt [Thu, 7 May 2009 13:09:09 +0000 (15:09 +0200)]
dialog(k): port db setup to different child_init behaviour on sr

- port db setup to different child_init behaviour on sr, here child_init
  is called two times for PROC_MAIN
- don't open a DB connection in PROC_MAIN in DB_MODE_DELAYED
- don't close the connection during mod_destroy if nothing was opened

11 years agoMerge commit 'origin/ser_core_cvs'
Andrei Pelinescu-Onciul [Thu, 7 May 2009 12:55:01 +0000 (14:55 +0200)]
Merge commit 'origin/ser_core_cvs'

* commit 'origin/ser_core_cvs':
  core: log L_CRIT fix
  sctp: internal macro/hooks for sctp events
  sctp: internal macro-hooks for stats

Conflicts:
dprint.c
dprint.h

11 years agocore: log L_CRIT fix
Andrei Pelinescu-Onciul [Thu, 7 May 2009 11:50:41 +0000 (11:50 +0000)]
core: log L_CRIT fix

- don't add a "BUG" prefix to L_CRIT log messages (there are many
  L_CRIT messages that are not bugs, e.g. parse errors).
- added a new level L_BUG, special for BUG use (automatically adds
  a "BUG" prefix).

11 years agocore: PUBLISH and REFER recognized by first line parser
Daniel-Constantin Mierla [Wed, 6 May 2009 18:53:56 +0000 (20:53 +0200)]
core: PUBLISH and REFER recognized by first line parser

- still duplicity of getting the method - parse_metod() and macro by
  parsing first line

11 years agopresence: fixed bug in taking the parsed event structure
Daniel-Constantin Mierla [Wed, 6 May 2009 18:52:32 +0000 (20:52 +0200)]
presence: fixed bug in taking the parsed event structure

11 years agotest: port all registrar based tests (mysql, postgres, unixodbc) to sr
Henning Westerholt [Wed, 6 May 2009 16:55:33 +0000 (18:55 +0200)]
test: port all registrar based tests (mysql, postgres, unixodbc) to sr

11 years agotest: small fix in module check, return success when found in the first dir
Henning Westerholt [Wed, 6 May 2009 16:52:36 +0000 (18:52 +0200)]
test: small fix in module check, return success when found in the first dir

11 years agotest: small fixes for test 2, port test 1 and 4
Henning Westerholt [Wed, 6 May 2009 16:35:38 +0000 (18:35 +0200)]
test: small fixes for test 2, port test 1 and 4

11 years agocore script parsing: minor fix: " at the end of file
Andrei Pelinescu-Onciul [Wed, 6 May 2009 16:32:46 +0000 (18:32 +0200)]
core script parsing: minor fix: " at the end of file

Having a closing quote at the end of file generated a parse error.

Reported-by: Henning Westerholt <henning.westerholt@1und1.de>
11 years agotest: port test 2 to sr, comment non-working modules out
Henning Westerholt [Wed, 6 May 2009 16:26:49 +0000 (18:26 +0200)]
test: port test 2 to sr, comment non-working modules out

11 years agodispatcher(k): add 'struct tmb' to fix module loading after change 441ab3c9f2ca
Henning Westerholt [Wed, 6 May 2009 16:16:28 +0000 (18:16 +0200)]
dispatcher(k): add 'struct tmb' to fix module loading after change 441ab3c9f2ca

11 years agodoc: config migration
Andrei Pelinescu-Onciul [Wed, 6 May 2009 15:57:25 +0000 (17:57 +0200)]
doc: config migration

Added a config migration guide for ser 2.1 to sip-router.
The kamailio part is empty for now.

11 years agocfg: example configs migrated to sip-router
Andrei Pelinescu-Onciul [Wed, 6 May 2009 15:50:53 +0000 (17:50 +0200)]
cfg: example  configs migrated to sip-router

Ported ser example configs to sip-router:
- updated module path (now using loadpath)
- changed mysql module name to db_mysql
- replaced max_len in msg:len comparisons with 4096
- updated avp and selects non-empty checks:
  if($v)  -> if ($v!="")
  if(!$v) -> if (strempty($v)) or if ($v=="")

11 years agomake: fix the module path in installed cfg
Andrei Pelinescu-Onciul [Wed, 6 May 2009 15:48:05 +0000 (17:48 +0200)]
make: fix the module path in installed cfg

- fix: the module path is updated in the installed cfg and man
  pages (broken when the multiple modules were added).

11 years agocore script parsing: various small fixes
Andrei Pelinescu-Onciul [Wed, 6 May 2009 14:45:04 +0000 (16:45 +0200)]
core script parsing: various small fixes

- fix: allow "default" in a config var id (e.g. session_timer.default).
  It stopped working after default became a keyword (switch()).
- fix: allow negative number in selects (e.g. @eval.pop[-1])
- fix: allow negative number in function parameters
- fix setavpflag, resetavpflag, isavpflag and "simple" avp names

11 years agotest: adaption of kamailio specific scripts to sr, more generalization
Henning Westerholt [Wed, 6 May 2009 15:12:17 +0000 (17:12 +0200)]
test: adaption of kamailio specific scripts to sr, more generalization

11 years agoport from k r5751, fscanf can fail, fix warning related to recent glibc versions
Henning Westerholt [Wed, 6 May 2009 13:04:34 +0000 (15:04 +0200)]
port from k r5751, fscanf can fail, fix warning related to recent glibc versions

11 years agorefine 15e2e89e5d1e7f9dc6265c270153088596159ee5, remove instead comment out
Henning Westerholt [Wed, 6 May 2009 12:31:33 +0000 (14:31 +0200)]
refine 15e2e89e5d1e7f9dc6265c270153088596159ee5, remove instead comment out

11 years agocore: Consolidate append_str macro usage
Jan Janak [Wed, 6 May 2009 12:47:14 +0000 (14:47 +0200)]
core: Consolidate append_str macro usage

The definition of append_str macro was scattered across the source tree,
there were multiple definition of the macro, some of them with different
parameters.

This patch brings the definition of append_str macro into ut.h header
file and removes all other definitions from core and modules.

We chose the version with three parameters where the pointer and the
length of the source string are passed separately to the macro. This is
more flexible than passing both of them within one parameter as str
structure.

All references to append_mem_block have been removed because the same
operation can now be achieved with append_str. In addition to that we
updated parameters passed to append_str where needed, converting one
str parameter to <pointer,len> pair of parameters.

Some modules had yet another version of append_str defined, there we
renamed the macro to some other name to make sure that the local
definition does not conflict with the definition on ut.h

11 years agopresence_xml: disable bla support
Daniel-Constantin Mierla [Wed, 6 May 2009 12:09:47 +0000 (14:09 +0200)]
presence_xml: disable bla support

- needs review with latest spec updates
- potential issues with merging need to be reviewed as well

11 years agoMerge unit tests from kamailio trunk.
Jan Janak [Wed, 6 May 2009 10:08:08 +0000 (12:08 +0200)]
Merge unit tests from kamailio trunk.

* trunk: (126 commits)
  - extend test with one non-digit URI (bug #2694633)
  - fix isql function, remove column delimiter
  - add missing check for kamailio binary on start
  - fix NULL behaviour for db_unixodbc in module
  - add functionality for runtime message forwarding, this is useful
  - remove a few modules that need (now) external libraries
  - change functionality in cr_route, cr_prime_route to not store information
  - improve tests a bit for flags and mask matching
  - fix test description
  - move encode_contact, decode_contact and decode_contact_header function
  - add a new test for carrierroute, non-numerical matching mode
  - fix tests after removal of the uri module and the moving of the $shv vars
  - fix tests, add pv loadmodule..
  - remove options module from test after removal in the tree
  - add missing module and compile checks on start
  - add new utils module to test
  - finish renaming, fix module name in test
  - add new module 'utils', to hold various SIP message related functionality
  - extend registrar test for db_mysql and db_postgres: test also for contact
  - finish refactoring of carrierroute module
  ...

11 years agoSerial forking functions.
Jan Janak [Wed, 6 May 2009 09:17:17 +0000 (11:17 +0200)]
Serial forking functions.

This patch adds two new functions to tm module, t_load_contacts and
t_next_contacts which can be used to implement serial forking.

There are also two new parameters, fr_inv_timer_next and contacts_avp.
Parameter fr_inv_timer_next is similar to fr_inv_timer, the value
of this parameter is used for subsequent branches during serial forking.

The value of contacts_avp is the identifier of the AVP which contains
the list of contacts to be used for serial forking.

The serial forking functions originate from Kamailio where they were
implemented by Juha Heinanen.

11 years agoSplitting fix_sock_str into socket2str and fix_sock_str
Jan Janak [Wed, 6 May 2009 09:10:48 +0000 (11:10 +0200)]
Splitting fix_sock_str into socket2str and fix_sock_str

This patch splits fix_sock_str into two function, socket2str and
fix_sock_str. The function socket2str is exported and can be used
to print the socket into a pre-allocated memory buffer. Function
fix_sock_str allocates the memory buffer and calls socket2str
internally.

The primary consumer of this change is the serial forking code in
tm module.

This patch also defines a new macro called MAX_SOCKET_STR which
evaluates to the maximum size of textual representation of any
socket.

11 years agocore: better config parsing error messages
Andrei Pelinescu-Onciul [Tue, 5 May 2009 19:04:02 +0000 (21:04 +0200)]
core: better config parsing error messages

- on expression parsing error try to keep the number of parsing
  error messages low
- better if parse error reporting

11 years agocore: type casts support in the script
Andrei Pelinescu-Onciul [Tue, 5 May 2009 17:43:18 +0000 (19:43 +0200)]
core: type casts support in the script

Support for casts added: (int) and (str).
E.g.: (int)$v ; (str)$v+"test".

11 years agoscript parsing: if (non-int) not any longer an error
Andrei Pelinescu-Onciul [Tue, 5 May 2009 17:19:54 +0000 (19:19 +0200)]
script parsing: if (non-int) not any longer an error

An if expression that does not evaluate to int is not any longer
considered a parse error. It will generate a warning, but sr will
start.
This allows backward compatible if (@select) or if($avp).

11 years agocore expr eval: string == fix
Andrei Pelinescu-Onciul [Tue, 5 May 2009 17:17:12 +0000 (19:17 +0200)]
core expr eval: string == fix

- fixed typo which made == the same as != for strings
- minor optimizations debugging messages fixes

11 years agocore expr: optimizations fixes for $v op 0|1 -> $v
Andrei Pelinescu-Onciul [Tue, 5 May 2009 14:15:01 +0000 (16:15 +0200)]
core expr:  optimizations fixes for $v op 0|1 -> $v

- fix missing cast for the  $v <op> c -> $v optimizations
  (e.g. $v - 0 -> $v, 1 * $v -> $v): instead of replacing
  $v <op> c with $v use (type_of(<op>)) $v.  $v without the cast
  to the type produced by the operator is used now only when
  type_of($v)==type_of(<op>).
  E.g.: 1 * $v -> (int)$v
        1 * ($v/$w) -> $v/$w  ($v/$w produces always an int, so no
                               need for the cast)
  Bug example:  1*"2"+3 was optimized to "2"+3 == "23" instead of
  (int)"2"+3 == 5.

- better debugging messages

11 years agocore expr. eval: support for int & str casts
Andrei Pelinescu-Onciul [Tue, 5 May 2009 11:51:40 +0000 (13:51 +0200)]
core expr. eval: support for int & str casts

- new internal operators for force-casting to int or str
- fix int conversion failure for v1 str_concat v2

11 years agocore expr. eval: fix fixup/optimization bug
Andrei Pelinescu-Onciul [Mon, 4 May 2009 20:23:59 +0000 (22:23 +0200)]
core expr. eval: fix fixup/optimization bug

In some cases some ref'ed rvals were replaced in-place, messing up
the refcnt.

11 years agocore expr. eval: added bug catcher
Andrei Pelinescu-Onciul [Mon, 4 May 2009 20:02:49 +0000 (22:02 +0200)]
core expr. eval: added bug catcher

Added code for catching an easy to overlook bug (replacing in-line
a referenced rval during optimizing).

11 years agocore script engine: if switched to rval_expr
Andrei Pelinescu-Onciul [Mon, 4 May 2009 19:58:40 +0000 (21:58 +0200)]
core script engine: if switched to rval_expr

- switched if to use directly rval_expr
- warn on startup if "if" expression is constant
- fail to start if "if" expression evaluates to non-int

11 years agocore expr. eval: support for =~
Andrei Pelinescu-Onciul [Mon, 4 May 2009 19:09:23 +0000 (21:09 +0200)]
core expr. eval: support for =~

The match regular expression operator (=~) is now supported in
rval_exprs.

11 years agoMerge commit 'origin/andrei/type_conversion'
Andrei Pelinescu-Onciul [Mon, 4 May 2009 21:38:12 +0000 (23:38 +0200)]
Merge commit 'origin/andrei/type_conversion'

* commit 'origin/andrei/type_conversion':
  script parsing: fix bug in expression error checking
  core expr eval: various fixes
  news: update (new operators, expr. eval behaviour a.s.o.)
  core: new script operators: eq, ne, ieq, ine
  core expr eval: fix assoc., commut and 0 adding for +, ==
  core expr eval: minor ==/!= optimization
  core expr eval: internal == & != int and str only versions
  core expr eval: special handling for undef cmp expr
  core eval expr: cache undefined results too
  core expr eval:  str automatic conversion to int
  core expr eval: undef conversion to int and str
  core expr eval: defined @select

11 years agoa bunch of small refactorings in the dialog module
Henning Westerholt [Sun, 3 May 2009 21:25:05 +0000 (23:25 +0200)]
a bunch of small refactorings in the dialog module

- move populate_leg_info declaration to the proper header file
 - unify mostly identical dlg_seq_up_onreply, dlg_seq_down_onreply functions
 - make unref_new_dialog static, this is not used outside the implementation file
 - compact variable declarations in dlg_onroute and a few other functions
 - the get_dlg_tl_payload macro is only used once, integrate it into the code

11 years agoadd complete doxygen documentation for dlg_handlers.{c,h} in dialog module
Henning Westerholt [Sun, 3 May 2009 20:54:24 +0000 (22:54 +0200)]
add complete doxygen documentation for dlg_handlers.{c,h} in dialog module

11 years agosmall refactoring to decrease exported symbols signature
Henning Westerholt [Sun, 3 May 2009 18:07:53 +0000 (20:07 +0200)]
small refactoring to decrease exported symbols signature

- move unlink_unsafe_dlg function to header file, make them static
- move unref_dlg_unsafe, ref_dlg_unsafe macros to implementation file

11 years agocomplete doxygen documentation for dlg_hash header and implementation
Henning Westerholt [Sun, 3 May 2009 18:02:10 +0000 (20:02 +0200)]
complete doxygen documentation for dlg_hash header and implementation

11 years agospelling fix in documentation
Henning Westerholt [Sun, 3 May 2009 17:23:22 +0000 (19:23 +0200)]
spelling fix in documentation