Re: [sr-dev] [kamailio/kamailio] db_redis: Implement db_redis generic db driver (#1432)
Hi @miconda, I've improved the module with the suggestions you made: * utilize xml schema definitions and load them from files to avoid having to define them as mod params * allow multiple keys mod params definitions to make config more readable * reconnect improvements * documentation fixes and improvements -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/1432#issuecomment-365275003___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] db_redis: Implement db_redis generic db driver (#1432)
@agranig pushed 1 commit. 609c350 db_redis: Use schema files and improve keys def -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/kamailio/kamailio/pull/1432/files/53e746b5c527fa542e4b2b7353af5a3b4042d7d2..609c35077886b090b62f7515f5c18c9887696a89 ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] db_redis: Implement db_redis generic db driver (#1432)
Merged #1432. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/1432#event-1473375435___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:56ad1423: db_redis: Use schema files and improve keys def
Module: kamailio Branch: master Commit: 56ad14236c02af1c82e3bdbcf1f85bb6f0efd728 URL: https://github.com/kamailio/kamailio/commit/56ad14236c02af1c82e3bdbcf1f85bb6f0efd728 Author: Andreas Granig <agra...@sipwise.com> Committer: Andreas Granig <agra...@sipwise.com> Date: 2018-02-13T16:37:42+01:00 db_redis: Use schema files and improve keys def * Auto-generate schema files for redis from xml specs and use them in module instead of having to define them as mod params. * Allow key definition line by line with multiple "keys" mod params. * Fetch table versions from schema to avoid having to populate them in Redis. * Fix reconnection issues on connection drops when Redis takes longer to start. * Fix documentation formatting issues. --- Added: doc/stylesheets/dbschema_k/xsl/db_redis.xsl Added: utils/kamctl/db_redis/kamailio/acc Added: utils/kamctl/db_redis/kamailio/acc_cdrs Added: utils/kamctl/db_redis/kamailio/active_watchers Added: utils/kamctl/db_redis/kamailio/address Added: utils/kamctl/db_redis/kamailio/aliases Added: utils/kamctl/db_redis/kamailio/carrier_name Added: utils/kamctl/db_redis/kamailio/carrierfailureroute Added: utils/kamctl/db_redis/kamailio/carrierroute Added: utils/kamctl/db_redis/kamailio/cpl Added: utils/kamctl/db_redis/kamailio/dbaliases Added: utils/kamctl/db_redis/kamailio/dialog Added: utils/kamctl/db_redis/kamailio/dialog_vars Added: utils/kamctl/db_redis/kamailio/dialplan Added: utils/kamctl/db_redis/kamailio/dispatcher Added: utils/kamctl/db_redis/kamailio/domain Added: utils/kamctl/db_redis/kamailio/domain_attrs Added: utils/kamctl/db_redis/kamailio/domain_name Added: utils/kamctl/db_redis/kamailio/domainpolicy Added: utils/kamctl/db_redis/kamailio/dr_gateways Added: utils/kamctl/db_redis/kamailio/dr_groups Added: utils/kamctl/db_redis/kamailio/dr_gw_lists Added: utils/kamctl/db_redis/kamailio/dr_rules Added: utils/kamctl/db_redis/kamailio/globalblacklist Added: utils/kamctl/db_redis/kamailio/grp Added: utils/kamctl/db_redis/kamailio/htable Added: utils/kamctl/db_redis/kamailio/imc_members Added: utils/kamctl/db_redis/kamailio/imc_rooms Added: utils/kamctl/db_redis/kamailio/lcr_gw Added: utils/kamctl/db_redis/kamailio/lcr_rule Added: utils/kamctl/db_redis/kamailio/lcr_rule_target Added: utils/kamctl/db_redis/kamailio/location Added: utils/kamctl/db_redis/kamailio/location_attrs Added: utils/kamctl/db_redis/kamailio/matrix Added: utils/kamctl/db_redis/kamailio/missed_calls Added: utils/kamctl/db_redis/kamailio/mohqcalls Added: utils/kamctl/db_redis/kamailio/mohqueues Added: utils/kamctl/db_redis/kamailio/mtree Added: utils/kamctl/db_redis/kamailio/mtrees Added: utils/kamctl/db_redis/kamailio/pdt Added: utils/kamctl/db_redis/kamailio/pl_pipes Added: utils/kamctl/db_redis/kamailio/presentity Added: utils/kamctl/db_redis/kamailio/pua Added: utils/kamctl/db_redis/kamailio/purplemap Added: utils/kamctl/db_redis/kamailio/re_grp Added: utils/kamctl/db_redis/kamailio/rls_presentity Added: utils/kamctl/db_redis/kamailio/rls_watchers Added: utils/kamctl/db_redis/kamailio/rtpengine Added: utils/kamctl/db_redis/kamailio/rtpproxy Added: utils/kamctl/db_redis/kamailio/sca_subscriptions Added: utils/kamctl/db_redis/kamailio/silo Added: utils/kamctl/db_redis/kamailio/sip_trace Added: utils/kamctl/db_redis/kamailio/speed_dial Added: utils/kamctl/db_redis/kamailio/subscriber Added: utils/kamctl/db_redis/kamailio/topos_d Added: utils/kamctl/db_redis/kamailio/topos_t Added: utils/kamctl/db_redis/kamailio/trusted Added: utils/kamctl/db_redis/kamailio/uacreg Added: utils/kamctl/db_redis/kamailio/uid_credentials Added: utils/kamctl/db_redis/kamailio/uid_domain Added: utils/kamctl/db_redis/kamailio/uid_domain_attrs Added: utils/kamctl/db_redis/kamailio/uid_global_attrs Added: utils/kamctl/db_redis/kamailio/uid_uri Added: utils/kamctl/db_redis/kamailio/uid_uri_attrs Added: utils/kamctl/db_redis/kamailio/uid_user_attrs Added: utils/kamctl/db_redis/kamailio/uri Added: utils/kamctl/db_redis/kamailio/userblacklist Added: utils/kamctl/db_redis/kamailio/usr_preferences Added: utils/kamctl/db_redis/kamailio/version Added: utils/kamctl/db_redis/kamailio/watchers Added: utils/kamctl/db_redis/kamailio/xcap Modified: src/lib/srdb1/schema/Makefile Modified: src/modules/db_redis/README Modified: src/modules/db_redis/db_redis_mod.c Modified: src/modules/db_redis/db_redis_mod.h Modified: src/modules/db_redis/doc/db_redis.xml Modified: src/modules/db_redis/doc/db_redis_admin.xml Modified: src/modules/db_redis/redis_connection.c Modified: src/modules/db_redis/redis_dbase.c Modified: src/modules/db_redis/redis_table.c Modified: src/modules/db_redis/redis_table.h --- Diff: https://github.com/kamailio/kamailio/commit/56ad14236c02af1c82e3bdbcf1f85bb6f0efd728.diff Patch: https://github.com/kamailio/kamailio/commit/56ad14236c02af1c82e3bdbcf1f85bb6f0efd728.patch ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://list
[sr-dev] git:master:53e746b5: db_redis: Implement db_redis generic db driver
Module: kamailio Branch: master Commit: 53e746b5c527fa542e4b2b7353af5a3b4042d7d2 URL: https://github.com/kamailio/kamailio/commit/53e746b5c527fa542e4b2b7353af5a3b4042d7d2 Author: Andreas Granig <agra...@sipwise.com> Committer: Andreas Granig <agra...@sipwise.com> Date: 2018-02-08T15:54:02+01:00 db_redis: Implement db_redis generic db driver This module implements a generic db driver for kamailio. It requires a "schema" and "key" definition of "tables" and corresponding keys for redis in the kamailio config file, otherwise it's supposed to work with every module. Implemented methods are query (w/o order-by), insert, update, delete. Tested with usrloc and acc. --- Added: src/modules/db_redis/Makefile Added: src/modules/db_redis/README Added: src/modules/db_redis/db_redis_mod.c Added: src/modules/db_redis/db_redis_mod.h Added: src/modules/db_redis/doc/Makefile Added: src/modules/db_redis/doc/db_redis.xml Added: src/modules/db_redis/doc/db_redis_admin.xml Added: src/modules/db_redis/redis_connection.c Added: src/modules/db_redis/redis_connection.h Added: src/modules/db_redis/redis_dbase.c Added: src/modules/db_redis/redis_dbase.h Added: src/modules/db_redis/redis_table.c Added: src/modules/db_redis/redis_table.h Modified: src/Makefile.groups --- Diff: https://github.com/kamailio/kamailio/commit/53e746b5c527fa542e4b2b7353af5a3b4042d7d2.diff Patch: https://github.com/kamailio/kamailio/commit/53e746b5c527fa542e4b2b7353af5a3b4042d7d2.patch ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:e727ddce: db_redis: Install redis schema along with module
Module: kamailio Branch: master Commit: e727ddcef5113c5235d8d2dde9da86a8c2d2b4bb URL: https://github.com/kamailio/kamailio/commit/e727ddcef5113c5235d8d2dde9da86a8c2d2b4bb Author: Andreas Granig <agra...@sipwise.com> Committer: Andreas Granig <agra...@sipwise.com> Date: 2018-02-14T15:38:03+01:00 db_redis: Install redis schema along with module --- Modified: src/modules/db_redis/Makefile Modified: utils/kamctl/Makefile --- Diff: https://github.com/kamailio/kamailio/commit/e727ddcef5113c5235d8d2dde9da86a8c2d2b4bb.diff Patch: https://github.com/kamailio/kamailio/commit/e727ddcef5113c5235d8d2dde9da86a8c2d2b4bb.patch --- diff --git a/src/modules/db_redis/Makefile b/src/modules/db_redis/Makefile index 58ecd04d36..c4aa0d0731 100644 --- a/src/modules/db_redis/Makefile +++ b/src/modules/db_redis/Makefile @@ -35,3 +35,8 @@ SERLIBPATH=../../lib SER_LIBS=$(SERLIBPATH)/srdb2/srdb2 $(SERLIBPATH)/srdb1/srdb1 include ../../Makefile.modules + +install-redis-scripts: $(bin_prefix)/$(bin_dir) + REDISON=yes $(MAKE) -C ../../../utils/kamctl/ install-modules + +install-scripts: install-redis-scripts diff --git a/utils/kamctl/Makefile b/utils/kamctl/Makefile index 3804d70dc7..9736cf2895 100644 --- a/utils/kamctl/Makefile +++ b/utils/kamctl/Makefile @@ -264,7 +264,18 @@ install-modules: $(bin_prefix)/$(bin_dir) fi ;\ done ; \ fi - + # install Redis stuff + if [ "$(REDISON)" = "yes" ]; then \ + mkdir -p $(data_prefix)/$(data_dir)/db_redis/kamailio ; \ + for FILE in $(wildcard db_redis/kamailio/*) ; do \ + if [ -f $$FILE ] ; then \ + $(INSTALL_TOUCH) $$FILE \ + $(data_prefix)/$(data_dir)/db_redis/kamailio/`basename "$$FILE"` ; \ + $(INSTALL_CFG) $$FILE \ + $(data_prefix)/$(data_dir)/db_redis/kamailio/`basename "$$FILE"` ; \ + fi ;\ + done ; \ + fi $(cfg_prefix)/$(cfg_dir): mkdir -p $(cfg_prefix)/$(cfg_dir) ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] db_redis: Implement db_redis generic db driver (#1432)
@agranig pushed 1 commit. 2378fb9 db_redis: Fix missed freeing redis reply objects -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/kamailio/kamailio/pull/1432/files/dcb86110b481a32071d1b87a7c6066dbc8ce810c..2378fb9371a5ccd564c0b06d6d80d9fb7dfbb6f5 ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] db_redis: Implement db_redis generic db driver (#1432)
@agranig pushed 1 commit. dcb8611 db_redis: Cleanups and fixes -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/kamailio/kamailio/pull/1432/files/aab86a5595b4b6294d9a1073321d623520f3fc0c..dcb86110b481a32071d1b87a7c6066dbc8ce810c ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] redis support into usrloc (#1137)
JFYI, there is another generic implementation available as of today at https://github.com/agranig/kamailio/tree/agranig/db_redis/src/modules/db_redis. It's currently undergoing internal reviews, I'll send a pull request in a couple of days. Compared to Surendra's implementation, it's supposed to work with any module (incl. usrloc), if the module is properly configured (see README). There is still lots of room for improvement, focus was on proof-of-concept to get it working and stable. There'll be a talk by me at Kamailio World presenting the module and benchmarking results. @ngvoice @ManuelBothner -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/1137#issuecomment-363763399___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:fd9fe3a6: db_redis: re-do appended commands after reconnect
Module: kamailio Branch: master Commit: fd9fe3a677cde97dbf00ef965c45e5b6a495edf7 URL: https://github.com/kamailio/kamailio/commit/fd9fe3a677cde97dbf00ef965c45e5b6a495edf7 Author: Andreas Granig <agra...@sipwise.com> Committer: Andreas Granig <agra...@sipwise.com> Date: 2018-02-20T11:12:57+01:00 db_redis: re-do appended commands after reconnect Since hiredis sends out the pipelined command only after calling redisGetReply(), we need a mechamism to queue up all appended commands, so we can re-queue them once the connection is re-established. This commit introduces a redis command queue used for pipelined commands to re-do all appended commands in case of a connection drop (which typically happens in db-mode write-through with very low traffic, where redis would close the connection due to inactivity). --- Modified: src/modules/db_redis/redis_connection.c Modified: src/modules/db_redis/redis_connection.h Modified: src/modules/db_redis/redis_dbase.c Modified: src/modules/db_redis/redis_dbase.h Modified: src/modules/db_redis/redis_table.h --- Diff: https://github.com/kamailio/kamailio/commit/fd9fe3a677cde97dbf00ef965c45e5b6a495edf7.diff Patch: https://github.com/kamailio/kamailio/commit/fd9fe3a677cde97dbf00ef965c45e5b6a495edf7.patch ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] db_redis: Implement db_redis generic db driver (#1432)
Try redis://password@host:port/db and let me know if it works for you. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/1432#issuecomment-367418291___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:c9f2aa71: db_redis: Align schema with usrloc expires_type default
Module: kamailio Branch: master Commit: c9f2aa71b2e0d4a4f71b3da92f97306e86f93eea URL: https://github.com/kamailio/kamailio/commit/c9f2aa71b2e0d4a4f71b3da92f97306e86f93eea Author: Andreas Granig <agra...@sipwise.com> Committer: Andreas Granig <agra...@sipwise.com> Date: 2018-03-08T15:54:24+01:00 db_redis: Align schema with usrloc expires_type default Since expires_type is DATETIME by default, use "time" type in upstream schema for location table. --- Modified: src/modules/db_redis/doc/db_redis_admin.xml Modified: utils/kamctl/db_redis/kamailio/location --- Diff: https://github.com/kamailio/kamailio/commit/c9f2aa71b2e0d4a4f71b3da92f97306e86f93eea.diff Patch: https://github.com/kamailio/kamailio/commit/c9f2aa71b2e0d4a4f71b3da92f97306e86f93eea.patch --- diff --git a/src/modules/db_redis/doc/db_redis_admin.xml b/src/modules/db_redis/doc/db_redis_admin.xml index 168bd500d4..f57fa8064e 100644 --- a/src/modules/db_redis/doc/db_redis_admin.xml +++ b/src/modules/db_redis/doc/db_redis_admin.xml @@ -189,4 +189,17 @@ modparam("auth_db", "db_url", DBURL_AUTH) + + + Module specific considerations + + usrloc + + If you set "expires_type" to "1" in order to use BIGINT instead of DATETIME, + make sure to update your location schema file and change the type of "expires" + and "last_modified" from "time" to "int". + + + + diff --git a/utils/kamctl/db_redis/kamailio/location b/utils/kamctl/db_redis/kamailio/location index 9ca18f2fb0..7c0ea2ab81 100644 --- a/utils/kamctl/db_redis/kamailio/location +++ b/utils/kamctl/db_redis/kamailio/location @@ -1,2 +1,2 @@ -id/int,ruid/string,username/string,domain/string,contact/string,received/string,path/string,expires/int,q/double,callid/string,cseq/int,last_modified/int,flags/int,cflags/int,user_agent/string,socket/string,methods/int,instance/string,reg_id/int,server_id/int,connection_id/int,keepalive/int,partition/int, +id/int,ruid/string,username/string,domain/string,contact/string,received/string,path/string,expires/time,q/double,callid/string,cseq/int,last_modified/time,flags/int,cflags/int,user_agent/string,socket/string,methods/int,instance/string,reg_id/int,server_id/int,connection_id/int,keepalive/int,partition/int, 9 ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:62d7c838: db_redis: Fix removal of correct queued command
Module: kamailio Branch: master Commit: 62d7c838b5bcef04c3445b9eb9c6d73402f2b02f URL: https://github.com/kamailio/kamailio/commit/62d7c838b5bcef04c3445b9eb9c6d73402f2b02f Author: Andreas Granig <agra...@sipwise.com> Committer: Andreas Granig <agra...@sipwise.com> Date: 2018-02-27T17:55:48+01:00 db_redis: Fix removal of correct queued command When calling db_redis_get_reply, remove oldest queued command instead of newest. --- Modified: src/modules/db_redis/redis_connection.c --- Diff: https://github.com/kamailio/kamailio/commit/62d7c838b5bcef04c3445b9eb9c6d73402f2b02f.diff Patch: https://github.com/kamailio/kamailio/commit/62d7c838b5bcef04c3445b9eb9c6d73402f2b02f.patch --- diff --git a/src/modules/db_redis/redis_connection.c b/src/modules/db_redis/redis_connection.c index c0a6c383d1..564350316b 100644 --- a/src/modules/db_redis/redis_connection.c +++ b/src/modules/db_redis/redis_connection.c @@ -98,28 +98,6 @@ static redis_key_t* db_redis_shift_query(km_redis_con_t *con) { return query; } -static redis_key_t* db_redis_pop_query(km_redis_con_t *con) { -redis_command_t **current; -redis_command_t *prev; -redis_key_t *query; - -current = >command_queue; -if (!*current) -return NULL; - -do { -query = (*current)->query; -prev = *current; -*current = (*current)->next; -} while (*current); - -prev->next = NULL; -pkg_free(*current); -*current = NULL; - -return query; -} - int db_redis_connect(km_redis_con_t *con) { struct timeval tv; redisReply *reply; @@ -388,8 +366,8 @@ int db_redis_get_reply(km_redis_con_t *con, void **reply) { con->append_counter--; } } else { -LM_DBG("get_reply successful, popping query\n"); -query = db_redis_pop_query(con); +LM_DBG("get_reply successful, removing query\n"); +query = db_redis_shift_query(con); db_redis_key_free(); con->append_counter--; } ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:b62d6235: db_redis: Update schema definition
Module: kamailio Branch: master Commit: b62d623578737a85dd18cacc66f4e71232b463aa URL: https://github.com/kamailio/kamailio/commit/b62d623578737a85dd18cacc66f4e71232b463aa Author: Andreas Granig <agra...@sipwise.com> Committer: Andreas Granig <agra...@sipwise.com> Date: 2018-03-01T09:59:34+01:00 db_redis: Update schema definition --- Modified: utils/kamctl/db_redis/kamailio/lcr_rule Modified: utils/kamctl/db_redis/kamailio/location Modified: utils/kamctl/db_redis/kamailio/presentity Modified: utils/kamctl/db_redis/kamailio/rtpengine Modified: utils/kamctl/db_redis/kamailio/subscriber Modified: utils/kamctl/db_redis/kamailio/uacreg --- Diff: https://github.com/kamailio/kamailio/commit/b62d623578737a85dd18cacc66f4e71232b463aa.diff Patch: https://github.com/kamailio/kamailio/commit/b62d623578737a85dd18cacc66f4e71232b463aa.patch --- diff --git a/utils/kamctl/db_redis/kamailio/lcr_rule b/utils/kamctl/db_redis/kamailio/lcr_rule index 97eb9bed6e..b34558ce87 100644 --- a/utils/kamctl/db_redis/kamailio/lcr_rule +++ b/utils/kamctl/db_redis/kamailio/lcr_rule @@ -1,2 +1,2 @@ -id/int,lcr_id/int,prefix/string,from_uri/string,request_uri/string,stopper/int,enabled/int, -2 +id/int,lcr_id/int,prefix/string,from_uri/string,request_uri/string,mt_tvalue/string,stopper/int,enabled/int, +3 diff --git a/utils/kamctl/db_redis/kamailio/location b/utils/kamctl/db_redis/kamailio/location index cacabc7827..9ca18f2fb0 100644 --- a/utils/kamctl/db_redis/kamailio/location +++ b/utils/kamctl/db_redis/kamailio/location @@ -1,2 +1,2 @@ id/int,ruid/string,username/string,domain/string,contact/string,received/string,path/string,expires/int,q/double,callid/string,cseq/int,last_modified/int,flags/int,cflags/int,user_agent/string,socket/string,methods/int,instance/string,reg_id/int,server_id/int,connection_id/int,keepalive/int,partition/int, -8 +9 diff --git a/utils/kamctl/db_redis/kamailio/presentity b/utils/kamctl/db_redis/kamailio/presentity index bc2ee48d14..214539497d 100644 --- a/utils/kamctl/db_redis/kamailio/presentity +++ b/utils/kamctl/db_redis/kamailio/presentity @@ -1,2 +1,2 @@ -id/int,username/string,domain/string,event/string,etag/string,expires/int,received_time/int,body/string,sender/string,priority/int, -4 +id/int,username/string,domain/string,event/string,etag/string,expires/int,received_time/int,body/string,sender/string,priority/int,ruid/string, +5 diff --git a/utils/kamctl/db_redis/kamailio/rtpengine b/utils/kamctl/db_redis/kamailio/rtpengine index ec0479c2bb..b3ebac8c27 100644 --- a/utils/kamctl/db_redis/kamailio/rtpengine +++ b/utils/kamctl/db_redis/kamailio/rtpengine @@ -1,2 +1,2 @@ -setid/int,url/string,weight/int,disabled/int, +id/int,setid/int,url/string,weight/int,disabled/int,stamp/int, 1 diff --git a/utils/kamctl/db_redis/kamailio/subscriber b/utils/kamctl/db_redis/kamailio/subscriber index 0126ec30c2..912a3e 100644 --- a/utils/kamctl/db_redis/kamailio/subscriber +++ b/utils/kamctl/db_redis/kamailio/subscriber @@ -1,2 +1,2 @@ -id/int,username/string,domain/string,password/string,email_address/string,ha1/string,ha1b/string,rpid/string, -6 +id/int,username/string,domain/string,password/string,ha1/string,ha1b/string,email_address/string,rpid/string, +7 diff --git a/utils/kamctl/db_redis/kamailio/uacreg b/utils/kamctl/db_redis/kamailio/uacreg index 9dd23848e3..383fa88c43 100644 --- a/utils/kamctl/db_redis/kamailio/uacreg +++ b/utils/kamctl/db_redis/kamailio/uacreg @@ -1,2 +1,2 @@ -id/int,l_uuid/string,l_username/string,l_domain/string,r_username/string,r_domain/string,realm/string,auth_username/string,auth_password/string,auth_proxy/string,expires/int,flags/int,reg_delay/int, -2 +id/int,l_uuid/string,l_username/string,l_domain/string,r_username/string,r_domain/string,realm/string,auth_username/string,auth_password/string,auth_ha1/string,auth_proxy/string,expires/int,flags/int,reg_delay/int, +3 ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:0729d9fc: db_redis: Force table scan if no query keys given
Module: kamailio Branch: master Commit: 0729d9fc2cde7caf3e21b3e609cd26b24e38c19b URL: https://github.com/kamailio/kamailio/commit/0729d9fc2cde7caf3e21b3e609cd26b24e38c19b Author: Andreas Granig <agra...@sipwise.com> Committer: Andreas Granig <agra...@sipwise.com> Date: 2018-04-05T11:18:47+02:00 db_redis: Force table scan if no query keys given --- Modified: src/modules/db_redis/redis_dbase.c --- Diff: https://github.com/kamailio/kamailio/commit/0729d9fc2cde7caf3e21b3e609cd26b24e38c19b.diff Patch: https://github.com/kamailio/kamailio/commit/0729d9fc2cde7caf3e21b3e609cd26b24e38c19b.patch --- diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c index 8914264249..9b6aac85b4 100644 --- a/src/modules/db_redis/redis_dbase.c +++ b/src/modules/db_redis/redis_dbase.c @@ -1744,6 +1744,7 @@ int db_redis_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op, } else { LM_DBG("no columns given to build query keys, falling back to full table scan\n"); keys_count = 0; +do_table_scan = 1; } if (db_redis_perform_query(_h, con, _k, _v, query_ops, _c, _n, _nc, _r, ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:cc6865cd: db_redis: Fix scanning large tables
Module: kamailio Branch: master Commit: cc6865cd7d0fc48709acd7685d315eb5575e45bd URL: https://github.com/kamailio/kamailio/commit/cc6865cd7d0fc48709acd7685d315eb5575e45bd Author: Andreas Granig <agra...@sipwise.com> Committer: Andreas Granig <agra...@sipwise.com> Date: 2018-04-11T17:28:32+02:00 db_redis: Fix scanning large tables * When querying large tables (e.g. pre-loading location by usrloc), make sure to use O(1) when adding keys by prepending them to list. * Increase batch size of redis scan command to reduce number of redis queries. * Batch creation of DB_ROW entries to free up memory allocated by redis in heap regularly. * Fix more issues reported by coverity. --- Modified: src/modules/db_redis/redis_connection.c Modified: src/modules/db_redis/redis_dbase.c Modified: src/modules/db_redis/redis_table.c --- Diff: https://github.com/kamailio/kamailio/commit/cc6865cd7d0fc48709acd7685d315eb5575e45bd.diff Patch: https://github.com/kamailio/kamailio/commit/cc6865cd7d0fc48709acd7685d315eb5575e45bd.patch ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] db_redis: fix compilation warning (#1495)
agranig approved this pull request. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/1495#pullrequestreview-110413756___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:22bd6ca0: db_redis: Fix various pointer and memory issues
Module: kamailio Branch: master Commit: 22bd6ca04dd20951a20aca77ec9a8cb46cdf73f9 URL: https://github.com/kamailio/kamailio/commit/22bd6ca04dd20951a20aca77ec9a8cb46cdf73f9 Author: Andreas Granig <agra...@sipwise.com> Committer: Andreas Granig <agra...@sipwise.com> Date: 2018-03-19T17:42:39+01:00 db_redis: Fix various pointer and memory issues Issues discovered by coverity: * Fix mem leaks in error handling * Fix potential null pointer deref * Fix potential out-of-memory cases --- Modified: src/modules/db_redis/redis_connection.c Modified: src/modules/db_redis/redis_dbase.c Modified: src/modules/db_redis/redis_table.c --- Diff: https://github.com/kamailio/kamailio/commit/22bd6ca04dd20951a20aca77ec9a8cb46cdf73f9.diff Patch: https://github.com/kamailio/kamailio/commit/22bd6ca04dd20951a20aca77ec9a8cb46cdf73f9.patch ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] dialplan: implement Iterative dialplan matching (#764)
Hey, yes, absolutely interested, just didn’t get around following up on this further! -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/764#issuecomment-421971269___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] db_redis: fix schema (#1919)
agranig approved this pull request. +2, looks good to me -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/1919#pullrequestreview-221542757___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] db_redis: add support for native redis cluster (#1997)
Hey, unfortunately it doesn’t support it yet, and it’s not clear yet when I can address this, as I don’t have immediate needs for it. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/1997#issuecomment-507402841___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] db_redis: fix broken pipe issue, if redis server with timeout setting. (#2791)
Thanks for the patch, looks good! I'll take care merging it. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/2791#issuecomment-869429213___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] mqtt: Add tls_alpn module option (PR #3261)
@agranig commented on this pull request. > @@ -324,6 +324,27 @@ modparam("mqtt", "ca_path", "/etc/ssl/certs") ... modparam("mqtt", "tls_method", "tlsv1.3") +... + + + + + tls_alpn (str) + +Used to set the TLS ALPN option for cases where one TLS port is used to share multiple services. Prominent +example is AWS IoT, where you have to set the tls_alpn to "mqtt" to be able to connect +via MQTT. + + + + Default value is NULL, where no ALPN is set on the TLS connection. Is there actually good practice on how to document a param which has no default value (aka is NULL)? I'm finding quite some old modules having it documented like this, see https://www.kamailio.org/docs/modules/devel/modules/auth_db.html#auth_db.p.load_credentials for example. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3261#discussion_r994245839 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] [kamailio/kamailio] mqtt: Add tls_alpn module option (PR #3261)
This is used when a service (like AWS IoT Core) uses one TLS port for multiple services (like https and mqtt), so you have to set the ALPN to mqtt to be able to connect kamailio. !-- Kamailio Pull Request Template -- !-- IMPORTANT: - for detailed contributing guidelines, read: https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md - pull requests must be done to master branch, unless they are backports of fixes from master branch to a stable branch - backports to stable branches must be done with git cherry-pick -x ... - code is contributed under BSD for core and main components (tm, sl, auth, tls) - code is contributed GPLv2 or a compatible license for the other components - GPL code is contributed with OpenSSL licensing exception -- Pre-Submission Checklist !-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -- !-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-- !-- If youre unsure about any of these, dont hesitate to ask on sr-dev mailing list -- - [x] Commit message has the format required by CONTRIBUTING guide - [x] Commits are split per component (core, individual modules, libs, utils, ...) - [x] Each component has a single commit (if not, squash them into one commit) - [x] No commits to README files for modules (changes must be done to docbook files in `doc/` subfolder, the README file is autogenerated) Type Of Change - [ ] Small bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds new functionality) - [ ] Breaking change (fix or feature that would change existing functionality) Checklist: !-- Go over all points below, and after creating the PR, tick the checkboxes that apply -- - [ ] PR should be backported to stable branches - [x] Tested changes locally - [ ] Related to issue # (replace with an open issue number) Description !-- Describe your changes in detail -- Some services use ALPN to have one single TLS port serving multiple protocols, in order to avoid additional round-trips for negotiating TLS connections. https://en.wikipedia.org/wiki/Application-Layer_Protocol_Negotiation has the details. One of those services using ALPN is AWS IoT Core, which allows components to send messages both via HTTP and MQTT to AWS for further processing (e.g. logging, analysis, storage to db etc). This patch enables kamailio to communicate with this service by allowing the kamailio admin to set the mqtt.so module mod-param *tls_alpn* to *mqtt*. You can view, comment on, or merge this pull request online at: https://github.com/kamailio/kamailio/pull/3261 -- Commit Summary -- * mqtt: Add tls_alpn module option -- File Changes -- M src/modules/mqtt/doc/mqtt_admin.xml (21) M src/modules/mqtt/mqtt_dispatch.c (13) M src/modules/mqtt/mqtt_dispatch.h (3) M src/modules/mqtt/mqtt_mod.c (5) -- Patch Links -- https://github.com/kamailio/kamailio/pull/3261.patch https://github.com/kamailio/kamailio/pull/3261.diff -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3261 You are receiving this because you are subscribed to this thread. Message ID: kamailio/kamailio/pull/3...@github.com ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] mqtt: Add tls_alpn module option (PR #3261)
@agranig pushed 1 commit. bf5cf64f1daf8f0c8062e32d116c5da357fe516d mqtt: Add tls_alpn module option -- View it on GitHub: https://github.com/kamailio/kamailio/pull/3261/files/43981e28e4fa48f6f6f69af1594f671742d1e4cf..bf5cf64f1daf8f0c8062e32d116c5da357fe516d You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] mqtt: Add tls_alpn module option (PR #3261)
@agranig commented on this pull request. > @@ -324,6 +324,27 @@ modparam("mqtt", "ca_path", "/etc/ssl/certs") ... modparam("mqtt", "tls_method", "tlsv1.3") +... + + + + + tls_alpn (str) + +Used to set the TLS ALPN option for cases where one TLS port is used to share multiple services. Prominent +example is AWS IoT, where you have to set the tls_alpn to "mqtt" to be able to connect +via MQTT. + + + + Default value is NULL, where no ALPN is set on the TLS connection. I'd propose to do this in a second step to not mix commits. So I'm going to amend the current one, and in a second pull request change the wording of all mod params regarding NULL -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3261#discussion_r994237590 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] mqtt: Add tls_alpn module option (PR #3261)
@agranig commented on this pull request. > @@ -324,6 +324,27 @@ modparam("mqtt", "ca_path", "/etc/ssl/certs") ... modparam("mqtt", "tls_method", "tlsv1.3") +... + + + + + tls_alpn (str) + +Used to set the TLS ALPN option for cases where one TLS port is used to share multiple services. Prominent +example is AWS IoT, where you have to set the tls_alpn to "mqtt" to be able to connect +via MQTT. + + + + Default value is NULL, where no ALPN is set on the TLS connection. Alright. So, I will keep the docs for this commit as-is with the NULL, so it's consistent with the documentation of the other params in this module. In parallel, I've prepared another PR on top of this one, which changes the docs of all module parameters at once, changing the wording from NULL to `Default value is that option is not set ([description of implication this has, e.g. random id or no auth or whatever])`. Agreed? -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3261#discussion_r994281090 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] mqtt: Add tls_alpn module option (PR #3261)
@agranig commented on this pull request. > @@ -324,6 +324,27 @@ modparam("mqtt", "ca_path", "/etc/ssl/certs") ... modparam("mqtt", "tls_method", "tlsv1.3") +... + + + + + tls_alpn (str) + +Used to set the TLS ALPN option for cases where one TLS port is used to share multiple services. Prominent +example is AWS IoT, where you have to set the tls_alpn to "mqtt" to be able to connect +via MQTT. + + + + Default value is NULL, where no ALPN is set on the TLS connection. Ok. The wording is taken from other params in this module (see https://www.kamailio.org/docs/modules/devel/modules/mqtt.html#mqtt.p.id). So we could say "The default is that his modparam is not set, which means that no TLS ALPN is used"? -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3261#discussion_r994231540 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] mqtt: Add tls_alpn module option (PR #3261)
@agranig commented on this pull request. > @@ -324,6 +324,27 @@ modparam("mqtt", "ca_path", "/etc/ssl/certs") ... modparam("mqtt", "tls_method", "tlsv1.3") +... + + + + + tls_alpn (str) + +Used to set the TLS ALPN option for cases where one TLS port is used to share multiple services. Prominent +example is AWS IoT, where you have to set the tls_alpn to "mqtt" to be able to connect +via MQTT. + + + + Default value is NULL, where no ALPN is set on the TLS connection. It's a bit of a rabbit hole. https://www.kamailio.org/docs/modules/devel/modules/dispatcher.html#dispatcher.p.db_url is one of the most famous ones I guess. Any good example how to properly document a non-set behavior, so it's consistent? -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3261#discussion_r994249789 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] mqtt: Add tls_alpn module option (PR #3261)
Merged #3261 into master. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3261#event-7582729588 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] git:master:2bb8b568: mqtt: Add tls_alpn module option
Module: kamailio Branch: master Commit: 2bb8b5689c3064bd0ad1da80bdcfa36f29d2b8e3 URL: https://github.com/kamailio/kamailio/commit/2bb8b5689c3064bd0ad1da80bdcfa36f29d2b8e3 Author: Andreas Granig Committer: Andreas Granig Date: 2022-10-13T17:42:47+02:00 mqtt: Add tls_alpn module option This is used when a service (like AWS IoT Core) uses one TLS port for multiple services (like https and mqtt), so you have to set the ALPN to 'mqtt' to be able to connect kamailio. --- Modified: src/modules/mqtt/doc/mqtt_admin.xml Modified: src/modules/mqtt/mqtt_dispatch.c Modified: src/modules/mqtt/mqtt_dispatch.h Modified: src/modules/mqtt/mqtt_mod.c --- Diff: https://github.com/kamailio/kamailio/commit/2bb8b5689c3064bd0ad1da80bdcfa36f29d2b8e3.diff Patch: https://github.com/kamailio/kamailio/commit/2bb8b5689c3064bd0ad1da80bdcfa36f29d2b8e3.patch ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] Re: [kamailio/kamailio] topos: add enable_register_publish (PR #3766)
Interested in that one, as I by chance have an immediate need for it. Will test it today. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-1991461000 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] topos: add enable_register_publish (PR #3766)
I tested it for REGISTER, and it seems to break if the registrar sends e.g. a 4xx with no contact back, causing the log line ``` ERROR: topos [tps_storage.c:1407]: tps_db_load_dialog(): invalid dlg uuid provided ``` Is this something you've experienced, @toharish ? -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-1991720869 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] topos: add enable_register_publish (PR #3766)
> I tested it for REGISTER, and it seems to break if the registrar sends e.g. a > 4xx with no contact back, causing the log line > > ``` > ERROR: topos [tps_storage.c:1407]: tps_db_load_dialog(): invalid dlg uuid > provided > ``` > > Is this something you've experienced, @toharish ? Thinking of it: if the Contact is not handled by topos, where is the lookup key `cparam_name` stored? Could it be that this only works with `contact_mode=2`? If so, could you please provide a full example to reprooduce it? -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-1992001900 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] topos: add enable_register_publish (PR #3766)
> ERROR: topos [tps_storage.c:1407]: tps_db_load_dialog(): invalid dlg uuid > provided ,This error was noticed before the last commit > [[9769806](https://github.com/kamailio/kamailio/commit/9769806b96148a2ede4612605c6d4af047c137f7)]. > After this update it was fine. I have tested with more than 135000 active > registrations and many failures. I'm also getting this with your latest commit. Do you have a bare minimum config that works for you, so I can verify? Also, I've tested with contact_mode=1 too, but for an INVITE, topos adds a `tps=btpsh-`, do you do this manually? -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-1992310266 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] topos: add enable_register_publish (PR #3766)
Would love to get this merged, but didn't succeed testing it successfully on my machine. Maybe I did something wrong? A second pair of eyes would be highly appreciated. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-2172759113 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org