Hi Noah,

Hope you are well?

Realistically do you think you will be able to spend some time on this or do 
you think I need to look at other options in the short term?

I guess the primary requirements for me are being able to use these modules 
which require database interaction (mainly Permissions,userloc,dispatcher).

I have started to work through it but I am pondering if in the short term I 
need to focus on a support database and look to migrate when available.

Thanks!

Jon



Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Jonathan Hunter<mailto:hunter...@hotmail.com>
Sent: 22 February 2021 11:20
To: Henning Westerholt<mailto:h...@skalatan.de>; Noah 
Mehl<mailto:noahm...@gmail.com>
Cc: Kamailio (SER) - Users Mailing List<mailto:sr-users@lists.kamailio.org>
Subject: Re: [SR-Users] Cockroachdb and kamailio 5.4

Hi Noah and Henning,

Thank you for your responses, I am currently digesting them!

If I can be of any help testing/working on this please let me know as Im very 
keen to implement it so will review and also happy to take direction as I will 
be testing this week on it.

Thanks again

Jon

Sent from 
Mail<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D550986&data=04%7C01%7C%7Cfd34312b504a4723068008d8d723ebe4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637495896580748983%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=wfJ2SNI115vi8gpeFb1bs%2BYTLSGCc6BMCZjG9AzMXNk%3D&reserved=0>
 for Windows 10

From: Henning Westerholt<mailto:h...@skalatan.de>
Sent: 22 February 2021 07:44
To: Noah Mehl<mailto:noahm...@gmail.com>; Jonathan 
Hunter<mailto:hunter...@hotmail.com>
Cc: Kamailio (SER) - Users Mailing List<mailto:sr-users@lists.kamailio.org>
Subject: RE: Cockroachdb and kamailio 5.4

Hi Noah,

sure – let me give you some pointers. So basically, the SQL files are generated 
from the XSL infrastructure in the quoted directory. This file e.g. is for 
postgres:
https://github.com/kamailio/kamailio/blob/5.4/doc/stylesheets/dbschema/xsl/postgres.xsl<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkamailio%2Fkamailio%2Fblob%2F5.4%2Fdoc%2Fstylesheets%2Fdbschema%2Fxsl%2Fpostgres.xsl&data=04%7C01%7C%7Cfd34312b504a4723068008d8d723ebe4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637495896580748983%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=133XFlkVh6RSwjeJJR9rNgxJda%2BHp6kwwCiqjxEBrCc%3D&reserved=0>

You basically need to copy it to a new file and adapt the types in it to the 
cockroachdb types. If you execute “make dbschema” in the kamailio source tree, 
it will generate all the SQL files. Then you could generate the appropriate SQL 
files also for your database and it will stay in sync after future changes. 
There might be also a small extension necessary in the Makefile, but we can 
have a look to this later on.

About the questions why the SQL files are then also checked in after creation – 
because otherwise everybody needs to install the xstl dependencies just for 
installing Kamailio.

About the rand()/random() topic – I did not find anything in the LCR module as 
well. It might be obsolete. I would consider dropping this, maybe after asking 
on the sr-dev list for this again.

Cheers,

Henning

--
Henning Westerholt – 
https://skalatan.de/blog/<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fskalatan.de%2Fblog%2F&data=04%7C01%7C%7Cfd34312b504a4723068008d8d723ebe4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637495896580758973%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=WyJLH7SRrx2P0DQ8qBV6qof%2FByJvrQ%2B1q%2FKCqlkANXc%3D&reserved=0>
Kamailio services – 
https://gilawa.com<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgilawa.com%2F&data=04%7C01%7C%7Cfd34312b504a4723068008d8d723ebe4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637495896580768968%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ecql4Cf5n%2B%2Fw6sVxJHMphXwNT82g3NwXzH8D%2FNvbSBk%3D&reserved=0>

From: Noah Mehl <noahm...@gmail.com>
Sent: Sunday, February 21, 2021 8:47 PM
To: Jonathan Hunter <hunter...@hotmail.com>
Cc: Henning Westerholt <h...@skalatan.de>; Kamailio (SER) - Users Mailing List 
<sr-users@lists.kamailio.org>
Subject: Re: Cockroachdb and kamailio 5.4

Jon,

I’m not sure what would get my branch accepted.  Henning mentioned on 9/16/2020 
that the .sql files are generated from XML/XLST scripts, I have found: 
https://github.com/kamailio/kamailio/tree/5.4/doc/stylesheets/dbschema<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkamailio%2Fkamailio%2Ftree%2F5.4%2Fdoc%2Fstylesheets%2Fdbschema&data=04%7C01%7C%7Cfd34312b504a4723068008d8d723ebe4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637495896580768968%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=1Oy2Tr%2B0G4vqj5hsWV6FBVJrDjomsF48hQwwtmg%2FGzY%3D&reserved=0>
 which was updated just 3 days ago.  However, I don’t understand how this is 
used to generate the .sql files for Postgres. I’m also confused as to why the 
.sql files are checked into the repository if they’re generated?  Henning, can 
you point me in the right direction?

That being said, this is what’s changed in the 
branch<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkamailio%2Fkamailio%2Fcompare%2F5.4...reperio%3Acockroachdb-compat%3Fexpand%3D1&data=04%7C01%7C%7Cfd34312b504a4723068008d8d723ebe4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637495896580778968%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ImCDuX5GeAQ%2B5oexw1OIRcIDgjJ4e81JazzyLL8fPoQ%3D&reserved=0>:

kamdbctl.pgsql

- I’ve updated the psql command for my preferences regarding output
- I’ve made the function checking more verbose
- I’ve added the gen_random_uuid() function (by adding pgcrypto to Postgres, 
it’s native in CockroachDB), this isn’t required, but we are using UUID for 
usrloc in production
- I’ve updated the GRANT commands so they’re compatible with both Postgres and 
CockroachDB

Some things to note:

- concat() is native to CockroachDB, so the CREATE FUNCTION is only necessary 
for Postgres
- rand() is the native function name in MySQL, but random() is the function 
name in Postgres and CockroachDB.  This is where I’m most concerned because the 
file says it’s used in the lcr module, but I cannot find where it is used.  
Does anyone know how to ascertain this?  Anyways, they’re the same function, so 
it’s a little silly to require a CREATE FUNCTION duplicating the exact 
functionality of an existing native function.

The rest of the changes have to do with modifying the create statements to not 
use SERIAL, but use the more verbose SEQUENCE + nextval().  It’s identical in 
practice, so there’s 0 risk there.

I think overall risk is low for the branch, as the branch only changes the 
utility that creates the DBs.  As for production use, it’s worked great for us, 
there have been no issues.

~Noah

On Feb 18, 2021, at 2:45 PM, Jonathan Hunter 
<hunter...@hotmail.com<mailto:hunter...@hotmail.com>> wrote:

Hi Noah,

Hope you are well?

I work as a consultant for a company in the UK, and I am building a new hosted 
telephony platform for them in docker initially, and as we are deploying across 
multiple servers they want to use cockroachdb to allow easy management of a 
cluster environment.

I could see from your posts you got it working using your own branch, and I 
wondered what changes you made to make things work correctly and what would be 
needed to get the kamailio dev’s to accept it into the main stream of code? 
(Happy to help here where I can).

Unless you will maintain your branch forever 😊 Or are the changes small so its 
not too much of a concern? I just want to assess the risk really, and like you 
I think mainly we will just be using userloc and dispatcher for DB interaction 
so its positive to hear they work fine.  We would also be using rtpengine, 
routing data will be done via API so that should be fine. FYI Id like to run 
kamailio 5.4 initially.

I see your comments about table creation (in previous posts), that is the 
initial problem I am seeing when trying to use postgres based commands direct 
from a pgdump to create the kamailio database structure, does your branch 
contain all the creation scripts for the db/tables that I can use for testing?

Thanks again in advance  for the response!

Jon

Sent from 
Mail<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D550986&data=04%7C01%7C%7Cfd34312b504a4723068008d8d723ebe4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637495896580778968%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=fexlfwpfymUb4KPDFBe0P5yPAyhyN6qHQeiRUxRnEnM%3D&reserved=0>
 for Windows 10

From: Henning Westerholt<mailto:h...@skalatan.de>
Sent: 17 February 2021 16:18
To: Kamailio (SER) - Users Mailing List<mailto:sr-users@lists.kamailio.org>
Cc: Jonathan Hunter<mailto:hunter...@hotmail.com>; Noah 
Mehl<mailto:noahm...@gmail.com>
Subject: RE: Cockroachdb and kamailio 5.4

Hi Jonathan,

no – I do not think that there has been more work done so far, apart from the 
discussion that you referenced below.
If you are also interested in getting this forward, why not reaching out to the 
other guy starting this discussion earlier? Just to see if you can maybe join 
forces to get something of this work into a pull request for review and later a 
possible merge into our code base.

Cheers,

Henning

--
Henning Westerholt – 
https://skalatan.de/blog/<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fskalatan.de%2Fblog%2F&data=04%7C01%7C%7Cfd34312b504a4723068008d8d723ebe4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637495896580788959%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=tWewhClNesvM5Ir9mQTGN%2BzLqn5rX9AiXR7PiL1ShwE%3D&reserved=0>
Kamailio services – 
https://gilawa.com<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgilawa.com%2F&data=04%7C01%7C%7Cfd34312b504a4723068008d8d723ebe4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637495896580788959%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=LfQkbi385L8IeF31Y31%2Bj%2FWjsQotV9Sl9ONa1GSGWms%3D&reserved=0>

From: sr-users 
<sr-users-boun...@lists.kamailio.org<mailto:sr-users-boun...@lists.kamailio.org>>
 On Behalf Of Jonathan Hunter
Sent: Wednesday, February 17, 2021 1:59 PM
To: Kamailio (SER) - Users Mailing List 
<sr-users@lists.kamailio.org<mailto:sr-users@lists.kamailio.org>>
Subject: [SR-Users] Cockroachdb and kamailio 5.4

Hi Guys,

Hope all are well?

We are looking to implement kamailio with cockroachdb due to the advantages it 
gives us in terms of postgres management and clustering.

I can see from a previous string 
http://sip-router.1086192.n5.nabble.com/CockroachDB-and-Kamailio-td189233.html<https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsip-router.1086192.n5.nabble.com%2FCockroachDB-and-Kamailio-td189233.html&data=04%7C01%7C%7Cfd34312b504a4723068008d8d723ebe4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637495896580798955%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=W0EHwyhP6MED5bk0kz4ujts571Gd1eOsoKv8pwPaGVY%3D&reserved=0>
 that someone has attempted this and even created their own branch.

Has any further work been done on this, and if so has anyone got any 
advice/tips relating to it? As I am nervous about potentially using a branch 
and not a general release of kamailio moving forwards.

I appreciate you cant support all database types but I would just be interested 
to hear people’s thoughts on the topic.

Many thanks!

Jon

Sent from 
Mail<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D550986&data=04%7C01%7C%7Cfd34312b504a4723068008d8d723ebe4%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637495896580808947%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=QKTdRVK1GWNKxl%2FzoJdwA35Ex0rChkdtt9bqW95ubKU%3D&reserved=0>
 for Windows 10



_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

Reply via email to