sip-router
8 years agouserblacklist(k): fix some doc errors, pointed out from Daniel Vukicevic, daniel...
Henning Westerholt [Mon, 23 Apr 2012 16:21:46 +0000 (18:21 +0200)]
userblacklist(k): fix some doc errors, pointed out from Daniel Vukicevic, daniel at vukicevic dot com

8 years agoMerge branch 'master' of ssh://git.sip-router.org/sip-router
Peter Dunkley [Mon, 23 Apr 2012 16:17:20 +0000 (17:17 +0100)]
Merge branch 'master' of ssh://git.sip-router.org/sip-router

* 'master' of ssh://git.sip-router.org/sip-router:
  modules/lcr: Add support for R-URI matching.

8 years agomodules_k/rls: Added MI command to "clean" the rlsubs and rlpres entries
Peter Dunkley [Mon, 23 Apr 2012 16:15:34 +0000 (17:15 +0100)]
modules_k/rls: Added MI command to "clean" the rlsubs and rlpres entries

- This is similar to the clean MI command in presence
- Useful on multi-server systems where you don't want to run the timers
  and have each Kamailio instance try and clean.  The MI command allows
  you to kick of a clean on a specific server as required.

8 years agomodules/lcr: Add support for R-URI matching.
Richard Fuchs [Mon, 23 Apr 2012 16:08:39 +0000 (18:08 +0200)]
modules/lcr: Add support for R-URI matching.

- An additional request_uri column has been introduced. If other than
  NULL, it also needs to match beside prefix and from_uri in order
  for the rule to be selected.

8 years agolib/srdb1/schema, modules_k/presence, utils/kamctl: Added another field to active_wat...
Peter Dunkley [Mon, 23 Apr 2012 15:32:36 +0000 (16:32 +0100)]
lib/srdb1/schema, modules_k/presence, utils/kamctl: Added another field to active_watchers DB

- Added the updated_winfo field (part of the presence notifier
  fix) now to get in before the freeze.
- Also updated active_watchers table version.

8 years agomodules/db_postgres: Replaced init_nopool() with init2()
Peter Dunkley [Mon, 23 Apr 2012 11:39:53 +0000 (12:39 +0100)]
modules/db_postgres: Replaced init_nopool() with init2()

8 years agomodules/db_mysql, modules_k/db_oracle, modules_k/db_sqlite, modules_k/db_unixodbc...
Peter Dunkley [Mon, 23 Apr 2012 11:38:50 +0000 (12:38 +0100)]
modules/db_mysql, modules_k/db_oracle, modules_k/db_sqlite, modules_k/db_unixodbc: Reverted changes for non-pooled connections as no longer needed

- The original db_do_init() function is available so these modules
  don't need to be changed.

8 years agolib/srdb1: Cleaner implementation of non-pooled connections
Peter Dunkley [Mon, 23 Apr 2012 11:37:19 +0000 (12:37 +0100)]
lib/srdb1: Cleaner implementation of non-pooled connections

- Uses a new db_do_init2() function that takes a parameter to indicate
  pooling.
- This leaves the parameters for db_do_init() unchanged.

8 years agolib/srdb1/schema, modules_k/rls, utils/kamctl: Updated rls_watchers table version...
Peter Dunkley [Mon, 23 Apr 2012 10:58:40 +0000 (11:58 +0100)]
lib/srdb1/schema, modules_k/rls, utils/kamctl: Updated rls_watchers table version number

8 years agoFix various spelling errors.
Timo Reimann [Sun, 22 Apr 2012 11:06:34 +0000 (13:06 +0200)]
Fix various spelling errors.

- Credits to Victor Seva for providing the patch.

8 years agomodules_k/permissions: added allow_trusted() transport protocol value "any"
Juha Heinanen [Sat, 21 Apr 2012 17:17:40 +0000 (20:17 +0300)]
modules_k/permissions: added allow_trusted() transport protocol value "any"

- Transport protocol argument of allow_trusted() function call
  can now have value "any" meaning that any transport protocol is
  acceptable.

8 years agomodules/lcr: same gateway may now belong all lcr instances
Juha Heinanen [Fri, 20 Apr 2012 16:29:15 +0000 (19:29 +0300)]
modules/lcr: same gateway may now belong all lcr instances
- Gateways with special lcr instance id 0 belong to all normal lcr
  instances.

8 years agomodules/db_mysql, modules_k/db_oracle, modules_k/db_sqlite, modules_k/db_unixodbc...
Peter Dunkley [Fri, 20 Apr 2012 16:20:17 +0000 (17:20 +0100)]
modules/db_mysql, modules_k/db_oracle, modules_k/db_sqlite, modules_k/db_unixodbc: Updated to work with latest lib/srdb1

- db_do_init() in lib/srdb1 has an extra parameter to allow a unique
  (non-pooled) connection to be created.
- These DB modules do not yet support non-pooled connections so the
  init functions in the modules just call db_do_init() with the new
  parameter set to 0.

8 years agomodules/db_postgres: Added support for creating new non-pooled DB connections
Peter Dunkley [Fri, 20 Apr 2012 16:18:57 +0000 (17:18 +0100)]
modules/db_postgres: Added support for creating new non-pooled DB connections

- There is a new dbf.init_nopool() function to be used instead of the
  current dbf.init() when you want a unique (non-pooled) connection.

8 years agolib/srdb1: Changed the creation of non-pooled DB connections from being URL based...
Peter Dunkley [Fri, 20 Apr 2012 16:17:24 +0000 (17:17 +0100)]
lib/srdb1: Changed the creation of non-pooled DB connections from being URL based to function (C-code) based

8 years agolib/srdb1/schema, utils/kamctl: Updated db schemas for upcoming presence notifier...
Peter Dunkley [Fri, 20 Apr 2012 15:27:03 +0000 (16:27 +0100)]
lib/srdb1/schema, utils/kamctl: Updated db schemas for upcoming presence notifier development

- Added the new column to active_watchers so that the schemas don't
  change after the code freeze on Monday.

8 years agoMerge branch 'master' of ssh://git.sip-router.org/sip-router
Peter Dunkley [Fri, 20 Apr 2012 15:12:29 +0000 (16:12 +0100)]
Merge branch 'master' of ssh://git.sip-router.org/sip-router

* 'master' of ssh://git.sip-router.org/sip-router:
  dialog(k): table version in DB is 7
  htable(k): Implement "delete" mi/rpc function.
  tm: reset T if t_continue() resumes a canceled transaction

8 years agomodules_k/rls: Updated module documentation and changed use of BEGIN/COMMIT so it...
Peter Dunkley [Fri, 20 Apr 2012 15:11:48 +0000 (16:11 +0100)]
modules_k/rls: Updated module documentation and changed use of BEGIN/COMMIT so it only happens in database only mode

8 years agodialog(k): table version in DB is 7
Daniel-Constantin Mierla [Fri, 20 Apr 2012 14:14:18 +0000 (16:14 +0200)]
dialog(k): table version in DB is 7

- updated by Timo Reimann, but sources was still using 6

8 years agoMerge branch 'master' of ssh://git.sip-router.org/sip-router
Andreas Granig [Fri, 20 Apr 2012 14:01:53 +0000 (16:01 +0200)]
Merge branch 'master' of ssh://git.sip-router.org/sip-router

8 years agohtable(k): Implement "delete" mi/rpc function.
Richard Fuchs [Fri, 20 Apr 2012 13:59:28 +0000 (15:59 +0200)]
htable(k): Implement "delete" mi/rpc function.

- Lets you delete specific keys from an htable via the MI or
  RPC interface.

8 years agotm: reset T if t_continue() resumes a canceled transaction
Daniel-Constantin Mierla [Fri, 20 Apr 2012 13:35:49 +0000 (15:35 +0200)]
tm: reset T if t_continue() resumes a canceled transaction

- when the suspended transaction was already canceled, and t_continue
  was executed before transaction was destroyed, global variable T was
  left set, causing an extra unref by post script callback

8 years agomodules_k/pua: Fixed bug in pua_update_contact() in DB only mode
Peter Dunkley [Fri, 20 Apr 2012 13:28:18 +0000 (14:28 +0100)]
modules_k/pua: Fixed bug in pua_update_contact() in DB only mode

- This was updating the contact column when it should have been
  updating the remote_contact column.

8 years agomodules/db_postgres: Fixed copy-and-paste error in module documentation
Peter Dunkley [Fri, 20 Apr 2012 13:15:36 +0000 (14:15 +0100)]
modules/db_postgres: Fixed copy-and-paste error in module documentation

8 years agomodules_k/rls: Used db_begin() and db_commit() around blocks of related DB queries...
Peter Dunkley [Fri, 20 Apr 2012 13:00:22 +0000 (14:00 +0100)]
modules_k/rls: Used db_begin() and db_commit() around blocks of related DB queries and updates

- This makes these related sets of DB queries a single transaction.  As Klaus
  pointed out this if you don't do this you can get inconsistencies when using
  multiple presence servers.

8 years agolib/srdb1: Added db_begin()/db_commit()/db_rollback() wrapper functions
Peter Dunkley [Fri, 20 Apr 2012 12:56:37 +0000 (13:56 +0100)]
lib/srdb1: Added db_begin()/db_commit()/db_rollback() wrapper functions

- These are helper functions to enable blocks of DB queries/updates in
  modules to be handled as a single transaction.
- These functions wrap db_raw_query() and only perform the BEGIN/COMMIT/
  ROLLBACK when the db module supports raw_query().

8 years agohtable(k): Fix stale lock on errors.
Richard Fuchs [Fri, 20 Apr 2012 12:06:38 +0000 (14:06 +0200)]
htable(k): Fix stale lock on errors.

8 years agomodules_k/rls: RLS does not send NOTIFY requests when rls_watchers are cleaned in...
Peter Dunkley [Fri, 20 Apr 2012 10:43:41 +0000 (11:43 +0100)]
modules_k/rls: RLS does not send NOTIFY requests when rls_watchers are cleaned in DB only mode

- Fixed now.  The DB only clean function sets the updated flag.  The notifier
  process will detect that a record needs updated (and that its expires time
  is in the past) and send a terminated-state NOTIFY and delete the record.

8 years agopresence_xml: updates to docs to refer to embedded xcap server
Daniel-Constantin Mierla [Fri, 20 Apr 2012 07:42:39 +0000 (09:42 +0200)]
presence_xml: updates to docs to refer to embedded xcap server

8 years agoxcap_client: set table version to 4
Daniel-Constantin Mierla [Fri, 20 Apr 2012 07:28:44 +0000 (09:28 +0200)]
xcap_client: set table version to 4

- reported by Gnaneshwar Gatla

8 years agolib/srdb1/schema, utils/kamctl: Updated DB schemas for presence and RLS
Peter Dunkley [Thu, 19 Apr 2012 17:11:33 +0000 (18:11 +0100)]
lib/srdb1/schema, utils/kamctl: Updated DB schemas for presence and RLS

- New fields for from_user and from_domain as these may be different
  to the watcher_user and watcher_domain now.

8 years agomodules/app_lua: Updated to handle optional parameters to handle_subscribe() and...
Peter Dunkley [Thu, 19 Apr 2012 17:05:59 +0000 (18:05 +0100)]
modules/app_lua: Updated to handle optional parameters to handle_subscribe() and rls_handle_subscribe()

8 years agomodules_k/rls: Updated rls_handle_subscribe() so that an optional parameter can be...
Peter Dunkley [Thu, 19 Apr 2012 17:03:54 +0000 (18:03 +0100)]
modules_k/rls: Updated rls_handle_subscribe() so that an optional parameter can be used to specify watcher URI

- This is useful when you want to use a URI from another SIP header
  (for example, P-Asserted-Identity:) as the watcher URI.
- When the parameter is not used the From: URI is used as the
  watcher URI.

8 years agomodules_k/presence_xml: Updated to use watcher_user and watcher_domain fields in...
Peter Dunkley [Thu, 19 Apr 2012 16:59:26 +0000 (17:59 +0100)]
modules_k/presence_xml: Updated to use watcher_user and watcher_domain fields in subs_t

- Currently uses the from_user and from_domain fields which are no
  longer correct.

8 years agomodules_k/presence: Updated handle_subscribe() so that an optional parameter can...
Peter Dunkley [Thu, 19 Apr 2012 16:57:00 +0000 (17:57 +0100)]
modules_k/presence: Updated handle_subscribe() so that an optional parameter can be used to specify watcher URI

- This means that you can use URIs from different SIP headers
  (for example, P-Asserted-Identity:) as the watcher URI.
- If the parameter to handle_subscribe() is not use the From:
  URI is used as the watcher URI.

8 years agortpproxy: Updated README from xml doc.
Richard Fuchs [Thu, 19 Apr 2012 16:07:58 +0000 (18:07 +0200)]
rtpproxy: Updated README from xml doc.

8 years agortpproxy(k): Send Via branch to rtpproxy
Richard Fuchs [Thu, 19 Apr 2012 15:42:52 +0000 (17:42 +0200)]
rtpproxy(k): Send Via branch to rtpproxy

- Introduce force/unforce options "1" and "2" to optionally
  send first or second Via branch to rtpproxy, respectively.
  This can be used to stop only a specific branch in the rtp
  proxy, which is needed for complex serial looping scenarios
  where in a race condition a new branch is processed before
  a previous branch is cancelled, where the cancel would whipe
  the whole call from the rtp proxy instead of just the old
  branch, causing the subsequent rtp proxy lookup to fail.

8 years agocore: Move parse_via_header to correct place.
Richard Fuchs [Thu, 19 Apr 2012 15:38:29 +0000 (17:38 +0200)]
core: Move parse_via_header to correct place.

- Move parse_via_header(...) from select_core to parser
  to avoid compiler warnings when accessing it from modules.

8 years agousrloc(k): option to start own timer processes
Daniel-Constantin Mierla [Thu, 19 Apr 2012 08:53:49 +0000 (10:53 +0200)]
usrloc(k): option to start own timer processes

- new parameter timer_procs
- default is 0, meaning the core timer process is used (like so far)
- if >0, a number of basic sync timers are started
- each own timer will take care of syncronizing the usrloc records,
  selecting specific slots in the internal hash table (load balancing
  mechanism) - this mode is useful for handling lot of usrloc records

8 years agocore: added support for basic timer + interval sync
Daniel-Constantin Mierla [Thu, 19 Apr 2012 08:52:02 +0000 (10:52 +0200)]
core: added support for basic timer + interval sync

- new functions to start basic timers that will sync the interval after
  executing the task. Useful if the task is taking long, the process
  will skip the delay in the sleep value

8 years agocore: added timeval field inside sip_msg_t
Daniel-Constantin Mierla [Wed, 18 Apr 2012 17:54:41 +0000 (19:54 +0200)]
core: added timeval field inside sip_msg_t

- new parameter msg_time to set the timeval value at receive time (1
  (on) by default, set to 0 to disable)
- the value is set automatically at received time based if msg_time=1 or
  first time when it is accessed
- the field should bring coherence regarting time of the message - it
  should be the same no matter where is processed

8 years agopv: time PVs use the value from sip_msg_t structure
Daniel-Constantin Mierla [Wed, 18 Apr 2012 17:52:22 +0000 (19:52 +0200)]
pv: time PVs use the value from sip_msg_t structure

- it solves the time of the message coherence, by returning same value,
  no matter where is used
- reported by Klaus Darilion

8 years agousrloc(k): use correct domain column index
Daniel-Constantin Mierla [Wed, 18 Apr 2012 17:49:55 +0000 (19:49 +0200)]
usrloc(k): use correct domain column index

- issue added by previous commit, reported by Juha Heinanen

8 years agoparser: removed accept_disposition hdr hook from sip_msg_t
Daniel-Constantin Mierla [Wed, 18 Apr 2012 12:03:10 +0000 (14:03 +0200)]
parser: removed accept_disposition hdr hook from sip_msg_t

- it was not used at all, just hooked and cloned for no good reason

8 years agolib/srdb1, utils/kamctl: Updated rls_watchers table schema for RLS notifier changes
Peter Dunkley [Wed, 18 Apr 2012 16:36:02 +0000 (17:36 +0100)]
lib/srdb1, utils/kamctl: Updated rls_watchers table schema for RLS notifier changes

8 years agomodules_k/presence: Added new field to subs_t structure for the RLS notifier changes
Peter Dunkley [Wed, 18 Apr 2012 16:35:23 +0000 (17:35 +0100)]
modules_k/presence: Added new field to subs_t structure for the RLS notifier changes

8 years agomodules_k/rls: RLS full-state NOTIFY requests now sent by notifier process(es)
Peter Dunkley [Wed, 18 Apr 2012 16:29:32 +0000 (17:29 +0100)]
modules_k/rls: RLS full-state NOTIFY requests now sent by notifier process(es)

- Also modified the notifier process stuff to only work when in
  DB only mode.  This is because the full-state handling stuff
  in the notifier processes relies on DB only mode.
- Leaving the full-state stuff outside of the notifier process
  didn't work because there was a row update race between the
  notifier process and non-notifier process when full-state and non-
  full-state NOTIFY requests were generated at the same time.
- This ensures that (with default options) you get at most one NOTIFY
  (or set of NOTIFYs when splitting large NOTIFYs is enabled) per
  5s per watcher from RLS.
- It also helps spread out the NOTIFY generation load more evenly
  across time.

8 years agomodules_k/rls: rls_presentity table version checked on wrong DB connection
Peter Dunkley [Wed, 18 Apr 2012 16:24:48 +0000 (17:24 +0100)]
modules_k/rls: rls_presentity table version checked on wrong DB connection

8 years agomodules_k/rls: Some diagnostics at the wrong level
Peter Dunkley [Wed, 18 Apr 2012 16:23:59 +0000 (17:23 +0100)]
modules_k/rls: Some diagnostics at the wrong level

8 years agomodules_k/rls: srand() called frequently
Peter Dunkley [Wed, 18 Apr 2012 16:18:45 +0000 (17:18 +0100)]
modules_k/rls: srand() called frequently

- srand() was used to ensure that the instance IDs for use in
  RLS NOTIFY bodies were random, but consistent.
- The instance ID needs to be unique within a resource node in the
  NOTIFY body.  It does not have to be unique locally.  Although
  it needs to be unique it also needs to be repeatable as the same
  resource instance needs the same ID in subsequent NOTIFY requests.
- You will only get multiple instances for a resource when the
  back-end SUBSCRIBEs from RLS are forked.  Kamailio does not support
  this at the moment (the callback function in pua/send_subscribe.c
  is only called for the first final response) so we will only ever
  have one instance per resource.
- Because there is only one instance per resource the instance ID
  can just be a fixed string.  This will need to be changed if/when
  forking of back-end SUBSCRIBEs from PUA is supported.

8 years agomodules_k/rls: Fixed memory leak
Peter Dunkley [Wed, 18 Apr 2012 16:15:10 +0000 (17:15 +0100)]
modules_k/rls: Fixed memory leak

- The pkg memory allocated for route-sets when sendin NOTIFY requests
  was never freed.
- Fixed by Paul Pankhurst @ Crocodile RCS

8 years agopua_reginfo: propoer call-id buffer when constructing XML for reginfo
Daniel-Constantin Mierla [Tue, 17 Apr 2012 21:00:50 +0000 (23:00 +0200)]
pua_reginfo: propoer call-id buffer when constructing XML for reginfo

- patch by Stefan Sayer, FS#212

8 years agopua_reginfo: fix for state of the registration during unregister
Daniel-Constantin Mierla [Tue, 17 Apr 2012 20:55:35 +0000 (22:55 +0200)]
pua_reginfo: fix for state of the registration during unregister

- when unregistering a single contact, the state of the registration may
  be incorrectly reported .
- fix of a small inefficiency of repeatedly  calling time(2) in the same function.
- patch by Stefan Sayer, FS#213

8 years agomaxfwd(k): return -2 (false) if MF header cannot be processed
Daniel-Constantin Mierla [Tue, 17 Apr 2012 20:40:06 +0000 (22:40 +0200)]
maxfwd(k): return -2 (false) if MF header cannot be processed

- reported by Ladislav Jurak, FS#214

8 years agoregistrar(k): store +sip.instance always in contact structure
Daniel-Constantin Mierla [Tue, 17 Apr 2012 09:51:15 +0000 (11:51 +0200)]
registrar(k): store +sip.instance always in contact structure

- if it is provided, keep it, since it used either for gruu or outbound
  extensions
- mirror reg-id to contact in 200ok if provided in REGISTER
- updated the prototype of the usrloc function to match by instance

8 years agousrloc(k): handle reg-id Contact parameter defined by RFC5626
Daniel-Constantin Mierla [Tue, 17 Apr 2012 09:48:46 +0000 (11:48 +0200)]
usrloc(k): handle reg-id Contact parameter defined by RFC5626

- if reg-id is given in the Contact header, use it to match the usrloc
  record along with +sip.instance

8 years agosrdb1: new column reg_id to location and aliases tables
Daniel-Constantin Mierla [Tue, 17 Apr 2012 09:47:34 +0000 (11:47 +0200)]
srdb1: new column reg_id to location and aliases tables

- stores the value of reg-id Contact parameter defined by RFC5626

8 years agoparser: added hook for reg-id param of Contact header
Daniel-Constantin Mierla [Mon, 16 Apr 2012 22:16:52 +0000 (00:16 +0200)]
parser: added hook for reg-id param of Contact header

8 years agokcore: added outbound tag to Supported hdr parser
Daniel-Constantin Mierla [Mon, 16 Apr 2012 21:42:39 +0000 (23:42 +0200)]
kcore: added outbound tag to Supported hdr parser

8 years agoregistrar(k): add gruu parameters only when supported
Daniel-Constantin Mierla [Mon, 16 Apr 2012 21:05:40 +0000 (23:05 +0200)]
registrar(k): add gruu parameters only when supported

- check Supported header for gruu tag in order to ad pub/temp-gruu to
  the Contact header in 200ok

8 years agotmrec(k): fix week-day handling.
Andreas Granig [Mon, 16 Apr 2012 14:47:27 +0000 (16:47 +0200)]
tmrec(k): fix week-day handling.

- days of week need an offset of 1.

8 years agodebugger: safe wrapper around cfg name
Daniel-Constantin Mierla [Mon, 16 Apr 2012 12:03:14 +0000 (14:03 +0200)]
debugger: safe wrapper around cfg name

- some actions can be executed from inside the code, with no cfg file
  name attached to it -- that makes debugger crash on solaris while
  printing executed action details
- reported by Nathaniel

8 years agofixed compile time warnings
Daniel-Constantin Mierla [Mon, 16 Apr 2012 11:46:40 +0000 (13:46 +0200)]
fixed compile time warnings

- init vars and remove unused ones

8 years agousrloc(k): corrected non-gruu db insert with multidomain
Daniel-Constantin Mierla [Sun, 15 Apr 2012 20:44:52 +0000 (22:44 +0200)]
usrloc(k): corrected non-gruu db insert with multidomain

- if +sip.instance parameter in contact was missing and multidomain was
  enabled, then inserted values didn't match proper columns
- reported by Juha Heinanen

8 years agolib/srdb1: allow null for instance column in location
Daniel-Constantin Mierla [Sun, 15 Apr 2012 20:36:14 +0000 (22:36 +0200)]
lib/srdb1: allow null for instance column in location

8 years agoMakefile: version set to 3.3.0-dev8
Daniel-Constantin Mierla [Sun, 15 Apr 2012 10:23:02 +0000 (12:23 +0200)]
Makefile: version set to 3.3.0-dev8

8 years agoregistrar(k): fix of lookup condition for non-gruu addresses
Daniel-Constantin Mierla [Sun, 15 Apr 2012 10:17:21 +0000 (12:17 +0200)]
registrar(k): fix of lookup condition for non-gruu addresses

- reported by Juha Heinanen

8 years agosiputils: new function is_gruu(uri)
Daniel-Constantin Mierla [Sun, 15 Apr 2012 10:15:17 +0000 (12:15 +0200)]
siputils: new function is_gruu(uri)

- wrapper function to test quickly if a SIP URI indicates a GRUU
  address or not

8 years agoregistrar(k): added new parameter gruu_enabled
Daniel-Constantin Mierla [Fri, 13 Apr 2012 17:28:37 +0000 (19:28 +0200)]
registrar(k): added new parameter gruu_enabled

- makes possible to turn off GRUU handling for REGISTER

8 years agoregistrar(k): fixed warning introduced in previous commit
Daniel-Constantin Mierla [Fri, 13 Apr 2012 13:23:44 +0000 (15:23 +0200)]
registrar(k): fixed warning introduced in previous commit

8 years agolib/srdb1: extended definitions for location and aliases tables
Daniel-Constantin Mierla [Fri, 13 Apr 2012 12:51:20 +0000 (14:51 +0200)]
lib/srdb1: extended definitions for location and aliases tables

- new columns ruid and instance to deal with GRUU RFC5627

8 years agoregistrar(k): added initial support for GRUU - RFC 5627
Daniel-Constantin Mierla [Fri, 13 Apr 2012 12:45:06 +0000 (14:45 +0200)]
registrar(k): added initial support for GRUU - RFC 5627

- save() and lookup() recognize now the GRUU cases
- save() generates both pub-gruu and temp-gruu, sending them in the
  Contact headers for 200 reply
- lookup() will match on GRUU if it is the case, resulting to a Contact
  address only (no additional branches)

8 years agousrloc(k): new columns to store +sip.instance in record id
Daniel-Constantin Mierla [Fri, 13 Apr 2012 12:42:23 +0000 (14:42 +0200)]
usrloc(k): new columns to store +sip.instance in record id

- each usrloc contact has now an unique internal id, generated via SRUID
- the unique id is stored in 'ruid' field
- if the Contact header has +sip.instance parameter (GRUU RFC5627),
  store it in field 'instance'
- database schema was updated to reflect the two new columns
- more functions were exported via API to deal with GRUU cases

8 years agorr(k): don't match as myself URI with gr parameter
Daniel-Constantin Mierla [Fri, 13 Apr 2012 12:41:32 +0000 (14:41 +0200)]
rr(k): don't match as myself URI with gr parameter

- they point to a location contact

8 years agolib/kcore: parse Supported header recognize gruu
Daniel-Constantin Mierla [Fri, 13 Apr 2012 12:40:47 +0000 (14:40 +0200)]
lib/kcore: parse Supported header recognize gruu

8 years agoparser: added hook to gr (gruu) parameter in sip_uri_t
Daniel-Constantin Mierla [Fri, 13 Apr 2012 12:38:48 +0000 (14:38 +0200)]
parser: added hook to gr (gruu) parameter in sip_uri_t

- gr is specified by GRUU RFC5627

8 years agodb_cluster: allow permanent inactive connection
Daniel-Constantin Mierla [Wed, 11 Apr 2012 11:33:59 +0000 (13:33 +0200)]
db_cluster: allow permanent inactive connection

- activation time has to be set to 0 (to be possible via rpc commands)
- fix check of activation time based on inactive_interval parameter,
  reported by Juah Heinanen

8 years agolib/srutils: reinit root part of sruid when counter overflows
Daniel-Constantin Mierla [Wed, 11 Apr 2012 11:21:34 +0000 (13:21 +0200)]
lib/srutils: reinit root part of sruid when counter overflows

- avoid in this way very unlikely UIDs overlapping (when a pid has to
  give more than 2^32 UIDs)

8 years agodialog(k): if h_id overflows unsigned int, start from 1 again
Daniel-Constantin Mierla [Wed, 11 Apr 2012 10:11:13 +0000 (12:11 +0200)]
dialog(k): if h_id overflows unsigned int, start from 1 again

8 years agomodules/sipcapture: Fixed hep offset calculation
Marius Zbihlei [Wed, 11 Apr 2012 11:18:04 +0000 (14:18 +0300)]
modules/sipcapture: Fixed hep offset calculation

Problem reported by dkovik.

8 years agodb_cluster: fixed the return of a valid connection
Daniel-Constantin Mierla [Wed, 11 Apr 2012 09:03:50 +0000 (11:03 +0200)]
db_cluster: fixed the return of a valid connection

- a condition was not properly inverted in a previous commit
- reported by Juha Heinanen

8 years agomodules/lcr: print debug message in case from uri regex matching fails
Juha Heinanen [Wed, 11 Apr 2012 08:02:15 +0000 (11:02 +0300)]
modules/lcr:  print debug message in case from uri regex matching fails

8 years agondb_redis: support for redis array reply
Daniel-Constantin Mierla [Tue, 10 Apr 2012 21:23:12 +0000 (23:23 +0200)]
ndb_redis: support for redis array reply

- replies from redis holding arrays can be accessed now from config
  file, the values in array being accessible via index
- the size of the array is give as a new property of the reply
- patch by Vicente Hernando

8 years agodb_cluster: allow empty array in a priority slot
Daniel-Constantin Mierla [Tue, 10 Apr 2012 17:55:25 +0000 (19:55 +0200)]
db_cluster: allow empty array in a priority slot

8 years agomodules_k/presence: RFC 4827 (presence hard-state) support
Peter Dunkley [Tue, 10 Apr 2012 17:05:10 +0000 (18:05 +0100)]
modules_k/presence: RFC 4827 (presence hard-state) support

- Hard-state presence documents are stored as pidf-manipulation
  documents in the integrated XCAP server.
- When one of these documents is put/deleted/changed it can
  be "published" using the new pres_update_presentity() exported
  function.
- Because the original document is in XCAP a client can download
  it and manipulate it directly.
- Hard-state documents have an expiry time of -1 and never expire
  (the clean function in presence has been updated to make sure of
  this).
- The filename of the document is used as the ETag value in the
  presentity table.  This enables multiple hard-state documents
  (with different filenames) to be uploaded for each subscriber.
- Hard-state is useful for permanently setting an avatar, or an
  out-of-office message, etc.

8 years agomodules_k/xcap_server: Fixed a segmentation fault in xcap_server
Peter Dunkley [Tue, 10 Apr 2012 16:58:37 +0000 (17:58 +0100)]
modules_k/xcap_server: Fixed a segmentation fault in xcap_server

- This occurs when you try to modify (with xpath) an XML document
  that does not exist on the server.

8 years agomodules_k/xcap_server: Added $xcapuri(u=>uri_adoc) pvar
Peter Dunkley [Tue, 10 Apr 2012 16:57:25 +0000 (17:57 +0100)]
modules_k/xcap_server: Added $xcapuri(u=>uri_adoc) pvar

- This gives access to the adoc field in the internal xuri
  data-structure (the xuri without xpath).

8 years agoAdded new mode to sr_init that modifies the way the pseudo-random generator behaves
Marius Zbihlei [Tue, 10 Apr 2012 14:17:56 +0000 (17:17 +0300)]
Added new mode to sr_init that modifies the way the pseudo-random generator behaves

Now it can use a LFSR (Linear Feedback Shift Register) to generate pseudo random numbers

8 years agomodules:carrierroute fixed small compiler warning
Marius Zbihlei [Mon, 9 Apr 2012 08:52:18 +0000 (11:52 +0300)]
modules:carrierroute fixed small compiler warning

8 years agokex: new pv $sruid to return unique strings
Daniel-Constantin Mierla [Tue, 10 Apr 2012 10:20:58 +0000 (12:20 +0200)]
kex: new pv $sruid to return unique strings

- uses lib/srutils/sruid.{c,h} with prefix 'srid'

8 years agolib/srutils: added small api for internal unique id generator
Daniel-Constantin Mierla [Tue, 10 Apr 2012 10:18:35 +0000 (12:18 +0200)]
lib/srutils: added small api for internal unique id generator

- uses prefix, server id, timestamp, pid and a counter for an unique
  string

8 years agodb_cluster: documented inactive_interval parameter
Daniel-Constantin Mierla [Tue, 10 Apr 2012 08:40:23 +0000 (10:40 +0200)]
db_cluster: documented inactive_interval parameter

8 years agodb_cluster: if a db query fails, mark connection inactive
Daniel-Constantin Mierla [Mon, 9 Apr 2012 22:00:05 +0000 (00:00 +0200)]
db_cluster: if a db query fails, mark connection inactive

- default inactive time is 300sec
- value can be chanded via inactive_interval parameter

8 years agomsilo: set table before doing db query
Daniel-Constantin Mierla [Mon, 9 Apr 2012 14:33:44 +0000 (16:33 +0200)]
msilo: set table before doing db query

- cope with db_cluster module, reported by Juha Heinanen

8 years agomodules:tm Other function declaration fixes
Marius Zbihlei [Mon, 9 Apr 2012 08:41:42 +0000 (11:41 +0300)]
modules:tm Other function declaration fixes

Functions in C musn't be declered with an empty parameter list, as (...) is assumed by compiler, resulting in poorly optimized calls

8 years agocore: allow send() without parameters
Daniel-Constantin Mierla [Fri, 6 Apr 2012 12:42:44 +0000 (14:42 +0200)]
core: allow send() without parameters

- will use r-uri/dst-uri to send the msg buffer

8 years agomsrp: init dst info struct before parsing uri
Daniel-Constantin Mierla [Fri, 6 Apr 2012 12:09:30 +0000 (14:09 +0200)]
msrp: init dst info struct before parsing uri

8 years agomodules_k/rls: Made the number of notifier processes in RLS configurable
Peter Dunkley [Thu, 5 Apr 2012 22:27:46 +0000 (23:27 +0100)]
modules_k/rls: Made the number of notifier processes in RLS configurable

- Defaults to 1
- Configurable through a new modparam

8 years agomodules_k/pua: Fixed a DB only mode race condition found during soak testing
Peter Dunkley [Thu, 5 Apr 2012 22:24:01 +0000 (23:24 +0100)]
modules_k/pua: Fixed a DB only mode race condition found during soak testing

8 years agomodules_k/pua, modules_k/rls: Prevent RLS from performing multiple back-end subscript...
Peter Dunkley [Thu, 5 Apr 2012 22:21:39 +0000 (23:21 +0100)]
modules_k/pua, modules_k/rls: Prevent RLS from performing multiple back-end subscriptions to a presentity for a single RLS subscription