sip-router
10 years agoMerge commit 'ser_mysql/master' into mysql
Jan Janak [Fri, 13 Feb 2009 00:20:29 +0000 (01:20 +0100)]
Merge commit 'ser_mysql/master' into mysql

* commit 'ser_mysql/master': (138 commits)
  - fixed a crash in mysql_stmt_fetch when the statement does not exist
  - mysql versions < 5.0 do not support MYSQL_DATA_TRUNCATED
  - buffer size increased to 1024
  - put doxygen docs in correct group
  - support for 'last_id' getopt, which retrieves the unique id of the last
  - Support for fetching all data to the client at once
  - check_result_columns renamed to check_result
  - better check of the return value of mysql_stmt_result_metadata
  - reordered included header files for better detection of missing headers
  added non equal operator to DB API and mysql module
  - a couple of minor bug fixes backported from internal verion
  - dispose driver-specific driver properly on error
  - re-submit compiled queries to the server upon reconnect
  added doxygen comment to deal with these files
  updated update_params() to work with 3 sets of params
  added common prefix 'mysql:' into INFOs
  more descriptive comments
  removed forgotten abort() from error handler.
  added doxygen comment
  Preparation for implementation of UPDATE db statement.
  ...

10 years agoHeader file conditional macros renamed (DB_ -> DB1).
Jan Janak [Thu, 12 Feb 2009 19:28:11 +0000 (20:28 +0100)]
Header file conditional macros renamed (DB_ -> DB1).

All macros protecting header files against multiple inclusions have been
renamed to make sure that there are no conflicts with header fields from srdb2
library.

10 years agoDoxygen group renamed from db to db1.
Jan Janak [Thu, 12 Feb 2009 19:23:56 +0000 (20:23 +0100)]
Doxygen group renamed from db to db1.

10 years agoUpdated the value of \file doxygen tags.
Jan Janak [Thu, 12 Feb 2009 19:23:12 +0000 (20:23 +0100)]
Updated the value of \file doxygen tags.

Since we moved files in lib/srdb1 from another directory we also needed
to update the doxygen \file tags.

10 years agoRenamed type names (DB_ -> DB1_) in comments and documentation.
Jan Janak [Thu, 12 Feb 2009 19:22:10 +0000 (20:22 +0100)]
Renamed type names (DB_ -> DB1_) in comments and documentation.

10 years agoDatabase type enum values (such as DB_INT) renamed to DB1_*.
Jan Janak [Thu, 12 Feb 2009 19:21:15 +0000 (20:21 +0100)]
Database type enum values (such as DB_INT) renamed to DB1_*.

Both database libraries define the same database value type names. We
need to rename them in one of the libraries so that both libraries can
be used at the same time. Here we chose to rename the enum values in
libsrdb1 to DB1_*. The same change needs to be done in SER modules
using this version of the database library.

10 years agoRenamed db_res_t to db1_res_t in doxygen documentation.
Jan Janak [Thu, 12 Feb 2009 19:18:57 +0000 (20:18 +0100)]
Renamed db_res_t to db1_res_t in doxygen documentation.

10 years agoRenamed db_res_t to db1_res_t to avoid conflicts with libsrdb2.
Jan Janak [Thu, 12 Feb 2009 19:16:40 +0000 (20:16 +0100)]
Renamed db_res_t to db1_res_t to avoid conflicts with libsrdb2.

10 years agoRename db_con_t to db1_con_t in doxygen documentation.
Jan Janak [Thu, 12 Feb 2009 19:15:29 +0000 (20:15 +0100)]
Rename db_con_t to db1_con_t in doxygen documentation.

10 years agoRename db_con_t to db1_con_t to avoid conflicts with libsrdb2.
Jan Janak [Thu, 12 Feb 2009 19:14:43 +0000 (20:14 +0100)]
Rename db_con_t to db1_con_t to avoid conflicts with libsrdb2.

Both libraries libsrdb1 and libsrdb2 contain the data structure
db_con_t and in one if them the data structure needs to be renamed so
that both libraries can be used from one SER module at the same time.

10 years agoAdded *~ to the list of files ignored by git.
Jan Janak [Thu, 12 Feb 2009 15:34:16 +0000 (16:34 +0100)]
Added *~ to the list of files ignored by git.

Files with *~ suffix are created by emacs to hold a backup copy of the
file being edited.

10 years agoFixing relative paths to SER headers.
Jan Janak [Thu, 12 Feb 2009 15:33:31 +0000 (16:33 +0100)]
Fixing relative paths to SER headers.

After moving the database library from SER 2.0 into lib/srdb2 it was
necessary to update all the relative paths to SER header fiels.

Also adding a new Makefile suitable for building the library.

10 years agoChanged the path to ser include files.
Jan Janak [Thu, 12 Feb 2009 15:26:34 +0000 (16:26 +0100)]
Changed the path to ser include files.

After moving the database library into lib/srdb1 subdirectory it is
necessary to update the relative paths to ser header files.

10 years agoMerge commit 'kam/trunk'
Jan Janak [Thu, 12 Feb 2009 13:13:51 +0000 (14:13 +0100)]
Merge commit 'kam/trunk'

* commit 'kam/trunk': (219 commits)
  - add one debug probe for SQL NULL values, like for the other datatypes
  * Hostname of gateway should default to NULL.
  - new column to dispatcher table to hold priority
  * Introduced optional aliveness checking of gateways.  Contributed by
  - partial revert of commit rev5359 for db_mysql module
  - remove obselete DB example directory, the Makefile don't work and the source
  - prevent problems when a DB modules (like db_postgres) first calls
  - small indention fix
  - revert commit rev5415
  - move one DBG probe to the beginning of the free, to catch later problems
  - add group functionality to read content from specified sections
  - port from opensips, commit 4977, 4988, credits to Dan Pascu
  - port from opensips, commit 4889
  - port from opensips, commit 4990, credits to Dan Pascu
  - unify common rows and row allocation functionality in the DB API core
  - change behaviour of db_str2val, this now copy strings
  - avoid potential read overflow on non NULL terminated string
  - move db_mysql and db_unixodbc str2val implementation to the DB core,
  - fix a bunch of doxygen errors (mostly in modules, some in the core)
  - finish refactoring of carrierroute module
  ...

10 years agoSER 2.0 database api moved to lib/srdb2.
Jan Janak [Thu, 12 Feb 2009 13:11:53 +0000 (14:11 +0100)]
SER 2.0 database api moved to lib/srdb2.

10 years ago- add one debug probe for SQL NULL values, like for the other datatypes
Henning Westerholt [Mon, 26 Jan 2009 18:07:14 +0000 (18:07 +0000)]
- add one debug probe for SQL NULL values, like for the other datatypes

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5518 689a6050-402a-0410-94f2-e92a70836424

10 years ago* Hostname of gateway should default to NULL.
Juha Heinanen [Sat, 17 Jan 2009 03:26:18 +0000 (03:26 +0000)]
* Hostname of gateway should default to NULL.
* Improved descriptions.

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5478 689a6050-402a-0410-94f2-e92a70836424

10 years ago- new column to dispatcher table to hold priority
Daniel-Constantin Mierla [Wed, 14 Jan 2009 11:54:41 +0000 (11:54 +0000)]
- new column to dispatcher table to hold priority
- regenerated scripts to create the table

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5457 689a6050-402a-0410-94f2-e92a70836424

10 years ago* Introduced optional aliveness checking of gateways. Contributed by
Juha Heinanen [Tue, 6 Jan 2009 10:32:43 +0000 (10:32 +0000)]
* Introduced optional aliveness checking of gateways.  Contributed by
  Alexandr S. Dubovikov.

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5424 689a6050-402a-0410-94f2-e92a70836424

10 years ago- partial revert of commit rev5359 for db_mysql module
Henning Westerholt [Mon, 5 Jan 2009 18:29:35 +0000 (18:29 +0000)]
- partial revert of commit rev5359 for db_mysql module
- generalize db_str2val function in the DB API core, the string copying
  behaviour can now configured (its done for db_postgres, db_unixodbc,
  not done for db_mysql like in the 1.3, 1.4 branches)
- still TODO: fix NULL case in db_unixodbc, try to fix double copying

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5423 689a6050-402a-0410-94f2-e92a70836424

10 years ago- remove obselete DB example directory, the Makefile don't work and the source
Henning Westerholt [Mon, 5 Jan 2009 15:48:23 +0000 (15:48 +0000)]
- remove obselete DB example directory, the Makefile don't work and the source
  won't compile anymore since release 1.2.0 or so

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5419 689a6050-402a-0410-94f2-e92a70836424

10 years ago- prevent problems when a DB modules (like db_postgres) first calls
Henning Westerholt [Mon, 5 Jan 2009 15:42:12 +0000 (15:42 +0000)]
- prevent problems when a DB modules (like db_postgres) first calls
  db_free_row (because of some problems in the data processing), and
  then later db_free_result
- this could cause a double free, and also a crash because of null pointer
- reported from Bayan Towfiq, bayan at flowroute dot com
- fix also a similar problem in the db_free_columns function

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5418 689a6050-402a-0410-94f2-e92a70836424

10 years ago- small indention fix
Henning Westerholt [Mon, 5 Jan 2009 15:27:12 +0000 (15:27 +0000)]
- small indention fix

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5417 689a6050-402a-0410-94f2-e92a70836424

10 years ago- revert commit rev5415
Henning Westerholt [Mon, 5 Jan 2009 15:22:18 +0000 (15:22 +0000)]
- revert commit rev5415
- contains one unrelated change

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5416 689a6050-402a-0410-94f2-e92a70836424

10 years ago- move one DBG probe to the beginning of the free, to catch later problems
Henning Westerholt [Mon, 5 Jan 2009 15:19:36 +0000 (15:19 +0000)]
- move one DBG probe to the beginning of the free, to catch later problems
- extend one DBG probe to also log the number of rows, small indention fix

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5415 689a6050-402a-0410-94f2-e92a70836424

10 years ago- add group functionality to read content from specified sections
Henning Westerholt [Mon, 5 Jan 2009 12:27:49 +0000 (12:27 +0000)]
- add group functionality to read content from specified sections
  of the mysql config to the db_mysql module, db_url examples:
  * mysql://user:pass@[group]host:port/db or
  * mysql://user:pass@[group]/db or
  * mysql://[group]/db
- existing functionality is not changed, this is backward compatible
- check usernames for NULL before comparing in DB API, otherwise
  it would segfault when only a group name is specified
- patch from Andreas Granig, agranig at sipwise dot com, closes #1815631

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5413 689a6050-402a-0410-94f2-e92a70836424

10 years agoMerge commit 'origin/daniel/pv'
Andrei Pelinescu-Onciul [Fri, 19 Dec 2008 13:57:57 +0000 (14:57 +0100)]
Merge commit 'origin/daniel/pv'

* commit 'origin/daniel/pv':
  fix add/lookup pv name
  fix pv&t lookup due to signness
  pv api updates
  - list of PVs types syncronized with Kamailio

Conflicts:
pvapi.c

10 years agoscript engine: minor fix
Andrei Pelinescu-Onciul [Fri, 19 Dec 2008 13:40:52 +0000 (14:40 +0100)]
script engine: minor fix

- warning fixes and minor rval_expr_eval_rvint() fix

10 years agoMerge commit 'origin/andrei/script_vars'
Andrei Pelinescu-Onciul [Fri, 19 Dec 2008 13:32:32 +0000 (14:32 +0100)]
Merge commit 'origin/andrei/script_vars'

* commit 'origin/andrei/script_vars': (30 commits)
  script parsing: helper function updated & moved
  script engine: different operators for int and str +
  script engine: keep file pos. info when optimizing
  script engine: optimize op($v, ct) where ct=0 or 1
  script engine: optimize $v - ct
  script engine: pvar & avp fixes
  script: fix pvar parsing
  script parsing: better expression error reporting
  script parsing: expression type checking on startup
  script engine: rve_check_type() extended
  pvars: silent version for pv_parse_spec
  script parsing: better error reporting
  script parsing: fix line/column counting in strings
  script parsing: support for breaking strings
  script engine: more rvalue optimizations
  script engine: better debugging info
  core: new command line option (debugging)
  script engine: rvalue fixes & cleanup
  script engine: expression optimizations
  script parsing: fixed wrong operators in expr.
  ...

10 years agoMerge commit 'origin/andrei/fixups'
Andrei Pelinescu-Onciul [Fri, 19 Dec 2008 13:30:14 +0000 (14:30 +0100)]
Merge commit 'origin/andrei/fixups'

* commit 'origin/andrei/fixups':
  avp: comments fix
  fixups: added kamailio compatible fixups
  fixups: support for PVE & PVS in get_*_fparam()
  fixups: fix param function using a param type mask
  fixups: generic fixups work now on kamailio pvars
  select: comments for parse_select()
  avp: minor fixes & comments
  sr_module: identing and whitespace

10 years agoMerge commit 'origin/ser_core_cvs'
Andrei Pelinescu-Onciul [Fri, 19 Dec 2008 13:24:50 +0000 (14:24 +0100)]
Merge commit 'origin/ser_core_cvs'

* commit 'origin/ser_core_cvs':
  dns: fix build warnings when compiling without ipv6
  core: fix build on Darwin
  doc: tcp tunning update
  sctp: SO_REUSEADDR on the sctp sockets
  tcp: fix for async write
  another switch where PROTO_SCTP was missing - added case
  sctp protocol decoded in RPC dst_blacklist.view
  clean up whitespace in makefile
  added README.prefix_route
  Use explicit comparison with NULL, it's more clear and shuts off gcc,
  Fix warnings on LP64 plarforms out there (all 64-bit amd64/emt64 unixes
  added new module prefix_route
  update RPM spec file
  t_suspend() and t_continue() functions have been documented.
  dns: naptr local preferences fix
  more type punning warnings fixed
  avp: warning fixes & more sane usr_avp struct
  dns cache: fixed missing sctp SRV queries
  dns: fixed missing sctp SRV queries

10 years agoscript parsing: helper function updated & moved andrei/script_vars
Andrei Pelinescu-Onciul [Fri, 19 Dec 2008 13:20:41 +0000 (14:20 +0100)]
script parsing: helper function updated & moved

- helper function for computing the file position of an expression

10 years agoscript engine: different operators for int and str +
Andrei Pelinescu-Onciul [Thu, 18 Dec 2008 13:46:05 +0000 (14:46 +0100)]
script engine: different operators for int and str +

- different operators for integer + (RVE_IPLUS_OP) and str plus
  (RVE_CONCAT_OP). The generic plus (RVE_PLUS_OP) is still
  present, the new operators are only used in internal
  optimizations (see below) for now.
- if an expression involving the generic '+' is always of type int
  or str, replace the generic '+' with the interger or string
  version (makes further optimizations possible).

10 years agoscript engine: keep file pos. info when optimizing
Andrei Pelinescu-Onciul [Thu, 18 Dec 2008 12:33:57 +0000 (13:33 +0100)]
script engine: keep file pos. info when optimizing

- try to keep a reasonable value for an optimized rv. expression
  script file position
- fix file position in debugging messages

10 years agoscript engine: optimize op($v, ct) where ct=0 or 1
Andrei Pelinescu-Onciul [Thu, 18 Dec 2008 11:51:50 +0000 (12:51 +0100)]
script engine: optimize op($v, ct) where ct=0 or 1

- optimize: $v*0->0,  0*$v->0, $v*1->$v 1*$v->$v
            $v/1->$v, 0/$v->0
            $v-0->$v
            $v&0->0,  0&$v->0
            $v|0->$v, 0|$v->$v
            $v&&0->0, 0&&$v->0, $v&&1->$v, 1&&$v->$v
            $v||1->1, 1||$v->1, $v||0->$v, 0||$v->$v
            $v+0->$v, 0+$v->$v if typeof(expression) is int (forced
             by the context)
- fix runtime && and ||:
            0 && expr -> don't evaluate expr, return 0
            1 || expr -> don't evaluate expr, return 1

10 years agoscript engine: optimize $v - ct
Andrei Pelinescu-Onciul [Thu, 18 Dec 2008 08:45:06 +0000 (09:45 +0100)]
script engine: optimize $v - ct

- $v - ct transformed into $v + (-ct) which is easier to optimize
  further

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

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

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

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

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

- update with epoll tunning for kernels >= 2.6.27.8

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

10 years agofix add/lookup pv name
Daniel-Constantin Mierla [Tue, 16 Dec 2008 11:11:47 +0000 (13:11 +0200)]
fix add/lookup pv name

10 years agoscript engine: pvar & avp fixes
Andrei Pelinescu-Onciul [Tue, 16 Dec 2008 11:06:23 +0000 (12:06 +0100)]
script engine: pvar & avp fixes

- fix avp type flags in assignments (not always set/reset)
- always look first for the integer value of a pvar (since and int
  pvar can also have a str value)
- don't destroy the pvar values before using them (typo)

10 years agoscript: fix pvar parsing
Andrei Pelinescu-Onciul [Tue, 16 Dec 2008 11:03:44 +0000 (12:03 +0100)]
script: fix pvar parsing

- fix parsing for pvars with multiple '('

10 years agoscript parsing: better expression error reporting
Andrei Pelinescu-Onciul [Mon, 15 Dec 2008 22:13:20 +0000 (23:13 +0100)]
script parsing: better expression error reporting

- report bad expression position on type mismatch
e.g.:
 *** PARSE ERROR *** (42,8-18): bad expression: type
     mismatch: str instead of int at (42,16)

10 years agoscript parsing: expression type checking on startup
Andrei Pelinescu-Onciul [Mon, 15 Dec 2008 20:24:47 +0000 (21:24 +0100)]
script parsing: expression type checking on startup

- check expressions type and report errors at script parsing time
- yyerror() uses now a printf style format

10 years agoscript engine: rve_check_type() extended
Andrei Pelinescu-Onciul [Mon, 15 Dec 2008 20:22:09 +0000 (21:22 +0100)]
script engine: rve_check_type() extended

- extended rve_check_type() to return also the subexpression for
  which the check failed, its type and the expected type.

10 years ago- port from opensips, commit 4977, 4988, credits to Dan Pascu
Henning Westerholt [Mon, 15 Dec 2008 17:12:34 +0000 (17:12 +0000)]
- port from opensips, commit 4977, 4988, credits to Dan Pascu
- move variable declaration, remove unneeded variable 'prefix'
- test for failure in memory allocation

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5365 689a6050-402a-0410-94f2-e92a70836424

10 years ago- port from opensips, commit 4889
Henning Westerholt [Mon, 15 Dec 2008 16:56:10 +0000 (16:56 +0000)]
- port from opensips, commit 4889
- remove (small) memory leak in DB module bind

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5364 689a6050-402a-0410-94f2-e92a70836424

10 years ago- port from opensips, commit 4990, credits to Dan Pascu
Henning Westerholt [Mon, 15 Dec 2008 16:41:36 +0000 (16:41 +0000)]
- port from opensips, commit 4990, credits to Dan Pascu
- remove unnecessary check during mem free in API bind

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5363 689a6050-402a-0410-94f2-e92a70836424

10 years ago- unify common rows and row allocation functionality in the DB API core
Henning Westerholt [Mon, 15 Dec 2008 16:33:22 +0000 (16:33 +0000)]
- unify common rows and row allocation functionality in the DB API core

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5362 689a6050-402a-0410-94f2-e92a70836424

10 years ago- change behaviour of db_str2val, this now copy strings
Henning Westerholt [Mon, 15 Dec 2008 15:07:12 +0000 (15:07 +0000)]
- change behaviour of db_str2val, this now copy strings
- this change was necessary because in some circumstances the memory that is
  returned from the database driver is used by some other means too fast,
  causes crashed or wrong results later on, this bug is timing related
- this means for mysql and unixodbc that the performance will be decreased a
  bit, postgres already copied the string, so here nothing change
- add a new function to DB core API, db_val2str that, usable to convert
  numerical values to a string, and common things like NULL values conversion,
  parameter checks
- convert mysql, postgres and unixodbc module to use this new function
- convert postgres function to use the core db_str2val function, the copying
  is now done at a different place, cleanup the code somewhat
- remove unnecessary assignment if a NULL value is encountered in postgres
- TODO: fix NULL handling and double copying that is done now for unixodbc

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5359 689a6050-402a-0410-94f2-e92a70836424

10 years ago- avoid potential read overflow on non NULL terminated string
Henning Westerholt [Mon, 15 Dec 2008 10:30:13 +0000 (10:30 +0000)]
- avoid potential read overflow on non NULL terminated string
  port from opensips (#4980), credits to Dan Pascu

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5355 689a6050-402a-0410-94f2-e92a70836424

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

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

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

Reported-by: Vaclav Kubart, vaclav.kubart at iptel org
Tested-by: Vaclav Kubart, vaclav.kubart at iptel org
10 years agopvars: silent version for pv_parse_spec
Andrei Pelinescu-Onciul [Fri, 12 Dec 2008 13:20:55 +0000 (14:20 +0100)]
pvars: silent version for pv_parse_spec

- added a silent version for pv_parse_spec (pv_parse_spec2()), so
  that the script parsing fallback from pvars to avps for
  ambiguous identifiers can happen without a ton of error messages

10 years agoscript parsing: better error reporting
Andrei Pelinescu-Onciul [Fri, 12 Dec 2008 12:58:37 +0000 (13:58 +0100)]
script parsing: better error reporting

- more informative parse error messages for expression/rvalues
- account for the possibility of having a multi line token when
  reporting an error message
- fixed ending column number in error messages

10 years agoscript parsing: fix line/column counting in strings
Andrei Pelinescu-Onciul [Fri, 12 Dec 2008 11:55:02 +0000 (12:55 +0100)]
script parsing: fix line/column counting in strings

- added startline which contains the starting line for a token
 (some tokens can span multiple lines).
- string tokens are now correctly reported (startline and
  startcolumn always point at the beginning)

10 years agoanother switch where PROTO_SCTP was missing - added case
Michal Matyska [Thu, 11 Dec 2008 19:12:41 +0000 (19:12 +0000)]
another switch where PROTO_SCTP was missing - added case

10 years agoscript parsing: support for breaking strings
Andrei Pelinescu-Onciul [Thu, 11 Dec 2008 18:39:40 +0000 (19:39 +0100)]
script parsing: support for breaking strings

- strings can now be split 'C' style (e.g. "foo_bar" is equivalent
  with "foo" "_" "bar"). Whitespace and new lines are allowed
  in-between.

10 years agoscript engine: more rvalue optimizations
Andrei Pelinescu-Onciul [Thu, 11 Dec 2008 18:30:41 +0000 (19:30 +0100)]
script engine: more rvalue optimizations

- optimize:
    ($v * a) * b  -> $v * (a * b) if '*' is associative
    (a * $v) * b  -> (a * b) * $v if '*' is assoc. and commutative
    a * ($v * b)  -> (a * b) * $v if '*' is assoc. and commutative
    a * (b * $v)  -> (a * b) * $v if '*' is associative
  where a & b are constants, $v is a var (pvar or avp) and '*' is
  the operator.

- special hacks for optimizing '+' ('+' is a special case because
  in the current form it can work both with strings and ints which
  combined with the dynamic typed vars make it very hard to
  optimize)

10 years agoscript engine: better debugging info
Andrei Pelinescu-Onciul [Thu, 11 Dec 2008 18:27:24 +0000 (19:27 +0100)]
script engine: better debugging info

10 years ago- move db_mysql and db_unixodbc str2val implementation to the DB core,
Henning Westerholt [Wed, 10 Dec 2008 18:41:09 +0000 (18:41 +0000)]
- move db_mysql and db_unixodbc str2val implementation to the DB core,
  remove the duplicated implementation in the modules
  (preparation for query copy problem)
- introduced a small regression for the unixodbc in the NULL value handling
  that needs to be fixed

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5322 689a6050-402a-0410-94f2-e92a70836424

10 years agocore: new command line option (debugging)
Andrei Pelinescu-Onciul [Wed, 10 Dec 2008 13:52:12 +0000 (14:52 +0100)]
core: new command line option (debugging)

- new command line option controlling the script optimization
  level: -O (e.g. -O0 - no optimizations). By default the
  optimization level is set to maximum (2 for now).
- renamed sctp max process number command line option from -O to -Q

10 years agoscript engine: rvalue fixes & cleanup
Andrei Pelinescu-Onciul [Wed, 10 Dec 2008 13:50:36 +0000 (14:50 +0100)]
script engine: rvalue fixes & cleanup

- fixed rval_str_add2()
- more functions are now "public"
- support for optimization levels

10 years agoscript engine: expression optimizations
Andrei Pelinescu-Onciul [Wed, 10 Dec 2008 13:43:58 +0000 (14:43 +0100)]
script engine: expression optimizations

- optimizations for logical expressions
  (  exp(rval(v)) -> exp(v), exp_elem(x, rval(v)) -> exp_elem(x, v) )
- comp_rve() fix

10 years agoscript parsing: fixed wrong operators in expr.
Andrei Pelinescu-Onciul [Wed, 10 Dec 2008 13:42:08 +0000 (14:42 +0100)]
script parsing: fixed wrong operators in expr.

10 years agofix pv&t lookup due to signness
Daniel-Constantin Mierla [Tue, 9 Dec 2008 16:12:53 +0000 (18:12 +0200)]
fix pv&t lookup due to signness

- added missing functions from K

10 years agoscript parsing: rvalues instead of expr.
Andrei Pelinescu-Onciul [Tue, 9 Dec 2008 15:18:49 +0000 (16:18 +0100)]
script parsing: rvalues instead of expr.

- expressions are now evaluated in terms of rvalues
- more operators
- operator precedence
- cleanup
- NUMBER is now always positive (added intno which can be
  negative)

10 years agoscript engine: rvalue support in logical expr.
Andrei Pelinescu-Onciul [Tue, 9 Dec 2008 15:15:21 +0000 (16:15 +0100)]
script engine: rvalue support in logical expr.

-  hard coded expressions elements (e.g. method==xxx) support now
 rvalues as operands (e.g. uri=="sip:"+$a)
- small cleanups

10 years agoscript engine: more operators supported
Andrei Pelinescu-Onciul [Tue, 9 Dec 2008 15:13:03 +0000 (16:13 +0100)]
script engine: more operators supported

- support for more operators
- more helper functions
- small fixes

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

so it does not show unknown protocol anymore

10 years agokamailio compatibility, add str_strcmp and str_casecmp functions
Henning Westerholt [Mon, 8 Dec 2008 17:13:57 +0000 (18:13 +0100)]
kamailio compatibility, add str_strcmp and str_casecmp functions

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

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

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

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

10 years agopv api updates
Daniel-Constantin Mierla [Sat, 6 Dec 2008 22:55:08 +0000 (00:55 +0200)]
pv api updates

- fix the transformations hash table size
- complete the functions in PV&T API

10 years agoMerge branch 'master' of ssh://git.sip-router.org/sip-router into daniel
Daniel-Constantin Mierla [Sat, 6 Dec 2008 22:51:26 +0000 (00:51 +0200)]
Merge branch 'master' of ssh://git.sip-router.org/sip-router into daniel

* 'master' of ssh://git.sip-router.org/sip-router:
  kamailio compatibility, add shm_strdup and pkg_strdup implementation

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

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

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

10 years ago- fix a bunch of doxygen errors (mostly in modules, some in the core)
Henning Westerholt [Thu, 4 Dec 2008 18:12:33 +0000 (18:12 +0000)]
- fix a bunch of doxygen errors (mostly in modules, some in the core)
- credits belongs to Frederick Bullik, frederick dot bullik at 1und1 dot de

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5299 689a6050-402a-0410-94f2-e92a70836424

10 years agoscript engine: lvalue/rvalue assignment and fixups
Andrei Pelinescu-Onciul [Thu, 4 Dec 2008 00:12:46 +0000 (01:12 +0100)]
script engine: lvalue/rvalue assignment and fixups

10 years agoscript: lvalue = rvalue expression support
Andrei Pelinescu-Onciul [Thu, 4 Dec 2008 00:10:12 +0000 (01:10 +0100)]
script: lvalue = rvalue expression support

- lvalue = rvalue op rvalue ...

10 years agoscript: pvar name parsing fix
Andrei Pelinescu-Onciul [Thu, 4 Dec 2008 00:05:32 +0000 (01:05 +0100)]
script: pvar name parsing fix

- fix parsing pvar names of the form $pvar(...)

10 years agoscript engine: generalised lvalues & rvalues
Andrei Pelinescu-Onciul [Wed, 3 Dec 2008 23:47:29 +0000 (00:47 +0100)]
script engine: generalised lvalues & rvalues

- support for rvalues (anything that can appear on the right side
  of an assignment). For now an rvalue can be an avp, pvar,
  select, number, string, logical expression or script command.
  rvalues expressions are also supported (rvalue operator rvalue
  ...).
  Evaluation of integer rvalue expression is highly optimized.
  For performance reasons the rvalue expressions are completely
  separated from the logical expressions (eval_elem/eval_expr).
- rvalue expression fixup (apart for normal fixup stuff will also
  optimize away simple expressions, like 2+3 or "a" + "b").
- support for more general lvalues (anything in the left side of
  an assignment operator). For now an lvalue is either an avp or a
  script pvar. lvalue = rvalue_expression.
  Direct assignments (lvalue to avp or pvar) are optimised.

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

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

Reported-by: Vladimir Broz, vbroz at iptel org
Tested-by: Vladimir Broz, vbroz at iptel org
10 years agokamailio compatibility, add shm_strdup and pkg_strdup implementation
Henning Westerholt [Tue, 2 Dec 2008 15:05:48 +0000 (16:05 +0100)]
kamailio compatibility, add shm_strdup and pkg_strdup implementation

10 years agoscript: ser, kamailio and max compat mode support
Andrei Pelinescu-Onciul [Sat, 29 Nov 2008 16:12:16 +0000 (17:12 +0100)]
script: ser, kamailio and max compat mode support

- script mode can be switched between ser compatible, kamailio
  compatible and max compatibility (compatible with both as much as
  possible), using #!SER, #!KAMAILIO or #!ALL on the first line
  (#!OPENSER and #!MAXCOMPAT are also allowed)

10 years agoscript: more error messages on EOF
Andrei Pelinescu-Onciul [Sat, 29 Nov 2008 14:58:14 +0000 (15:58 +0100)]
script: more error messages on EOF

10 years agoscript: basic support for parsing pvar names
Andrei Pelinescu-Onciul [Fri, 28 Nov 2008 19:24:04 +0000 (20:24 +0100)]
script: basic support for parsing pvar names

- parse pvar names and try to guess on ambiguous pvar/avps identifiers
 (e.g.: $foo)

10 years agomore type punning warnings fixed
Andrei Pelinescu-Onciul [Fri, 28 Nov 2008 15:24:15 +0000 (15:24 +0000)]
more type punning warnings fixed

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

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

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

- added missing support for sctp SRV queries

10 years ago- list of PVs types syncronized with Kamailio
Daniel-Constantin Mierla [Thu, 27 Nov 2008 22:13:47 +0000 (00:13 +0200)]
- list of PVs types syncronized with Kamailio

10 years agoMerge commit 'origin/henning/trie' henning/trie_mods
Henning Westerholt [Thu, 27 Nov 2008 13:00:30 +0000 (14:00 +0100)]
Merge commit 'origin/henning/trie'

* commit 'origin/henning/trie':
  add trie to library directory
  add SHM_MEM_ERROR and PKG_MEM_ERROR logging macros to mem.h

10 years agoavp: comments fix andrei/fixups
Andrei Pelinescu-Onciul [Thu, 27 Nov 2008 12:55:24 +0000 (13:55 +0100)]
avp: comments fix

-  parse_avp_indent comments: 'g' it's an avp "class" and not a "track"

Reported-by: Jan Janak, jan at iptel.org
10 years agofixups: added kamailio compatible fixups
Andrei Pelinescu-Onciul [Thu, 27 Nov 2008 01:46:50 +0000 (02:46 +0100)]
fixups: added kamailio compatible fixups

- added kamailio compatible fixups (e.g. fixup_str_str), which use
 ser fix_param() underneath
- added kamailio compatible macros for gparam_t (which is now fparam_t)
 and fixup_get_[si]value() (to get_{int,str}_value)

10 years agofixups: support for PVE & PVS in get_*_fparam()
Andrei Pelinescu-Onciul [Thu, 27 Nov 2008 01:34:09 +0000 (02:34 +0100)]
fixups: support for PVE & PVS in get_*_fparam()

- get_str_fparam() and get_int_fparam() support now FPARAM_PVE & FPARAM_PVS

10 years agofixups: fix param function using a param type mask
Andrei Pelinescu-Onciul [Thu, 27 Nov 2008 00:47:23 +0000 (01:47 +0100)]
fixups: fix param function using a param type mask

- added generic fix_param_type(types_mask, param) function which will
 try all the types specified in the mask in sequence, until if manages
 to convert the param to the corresponding type, or it finishes iterating
 through the types.
      (e.g. fix_param_types(FPARAM_AVP|FPARAM_SELECT|FPARAM_STR, param))
- changed FPARAM_* order such that more generic types are at the end
 (types having less chance of failing a conversion, like FPARAM_STR)

10 years agofixups: generic fixups work now on kamailio pvars
Andrei Pelinescu-Onciul [Thu, 27 Nov 2008 00:30:26 +0000 (01:30 +0100)]
fixups: generic fixups work now on kamailio pvars

- fix_param() supports now FPARAM_PVS and FPARAM_PVE
  (kamailio GPARAM_TYPE_PVS and GPARAM_TYPE_PVE)
- added fparam_free_contents() which frees the contents of a fparam_t