[SR-Users] Re: Kamailio integration with REST services

2024-08-29 Thread Henning Westerholt via sr-users
). Cheers, Henning > -Original Message- > From: Alex Balashov via sr-users > Sent: Dienstag, 27. August 2024 14:13 > To: Kamailio (SER) - Users Mailing List > Cc: Alex Balashov > Subject: [SR-Users] Re: Kamailio integration with REST services > > > > On Aug

[SR-Users] Re: Kamailio integration with REST services

2024-08-27 Thread Fred Posner via sr-users
> On Aug 27, 2024, at 8:18 AM, Sergio Charrua via sr-users > wrote: > > Thanks Fred! > > >... but you’re really hacking kamailio to be an http api server... > > Actually it will be a HTTP Client...kamailio will send requests to an HTTPS > REST Service that requires authentication, returning a

[SR-Users] Re: Kamailio integration with REST services

2024-08-27 Thread Alexandru Covalschi via sr-users
You may consider writing the entire routing script in python as well - check out KEMI. вт, 27 авг. 2024 г. в 15:38, Sergio Charrua via sr-users < sr-users@lists.kamailio.org>: > Thanks Fred! > > >... but you’re really hacking kamailio to be an http api server... > > Actually it will be a HTTP Cli

[SR-Users] Re: Kamailio integration with REST services

2024-08-27 Thread Sergio Charrua via sr-users
Thanks Fred! >... but you’re really hacking kamailio to be an http api server... Actually it will be a HTTP Client...kamailio will send requests to an HTTPS REST Service that requires authentication, returning a JWT token if authentication is OK. Then, with the Token, Kamailio will make another H

[SR-Users] Re: Kamailio integration with REST services

2024-08-27 Thread Alexandru Covalschi via sr-users
Hi, You can use a $shv() variable to store the key. To track it you can use rtimer or just don't track it at lll, but just renew at 403. There are other ways tho, these are what I use вт, 27 авг. 2024 г. в 14:25, Sergio Charrua via sr-users < sr-users@lists.kamailio.org>: > Hi all! > > I need to

[SR-Users] Re: Kamailio integration with REST services

2024-08-27 Thread Alex Balashov via sr-users
> On Aug 27, 2024, at 7:57 AM, Henning Westerholt via sr-users > wrote: > > htable would be individual per server. It's worth pointing out that htable can be replicated via DMQ. This might seem like needless pedantry, but I've used this to successful effect in number of places to remove de

[SR-Users] Re: Kamailio integration with REST services

2024-08-27 Thread Sergio Charrua via sr-users
Thanks Henning, I did take a look at the JWT module, prior posting to the ML, but it seems to me that it requires a private key (.pem) which I won't have access to, hence the only way to authenticate is to send a HTTPS request to an URL with the login and password in it Or am I missing somethi

[SR-Users] Re: Kamailio integration with REST services

2024-08-27 Thread Mojtaba via sr-users
Hi, The Htable module might be useful. Also you could set expire time validation for 24h. Best regards. Mojtaba On Tue, Aug 27, 2024, 14:56 Sergio Charrua via sr-users < sr-users@lists.kamailio.org> wrote: > Hi all! > > I need to integrate a REST Service with Kamailio. Integration is easy, not >

[SR-Users] Re: Kamailio integration with REST services

2024-08-27 Thread Alex Balashov via sr-users
> On Aug 27, 2024, at 7:54 AM, Fred Posner via sr-users > wrote: > > In theory I assume you could use the JWT and other modules to help do what > you are looking for, but you’re really hacking kamailio to be an http api > server at that point and although it may be able to do it quite well, i

[SR-Users] Re: Kamailio integration with REST services

2024-08-27 Thread Henning Westerholt via sr-users
Hello, don’t looked into the details, but the kamailio jwt module has a verify function (https://www.kamailio.org/docs/modules/stable/modules/jwt.html) Regarding storage, you can easily store them in a DB table with sqlops, or in htable in memory with automatic 24h expiry, just two options. The

[SR-Users] Re: Kamailio integration with REST services

2024-08-27 Thread Fred Posner via sr-users
> On Aug 27, 2024, at 6:58 AM, Sergio Charrua via sr-users > wrote: > > Hi all! > > I need to integrate a REST Service with Kamailio. Integration is easy, not a > problem, but my concern is that the REST Services has a JWT token > authentication required for each request, common to many (it

[SR-Users] Re: Kamailio integration with REST services

2024-08-27 Thread Alex Balashov via sr-users
> On Aug 27, 2024, at 6:58 AM, Sergio Charrua via sr-users > wrote: > > My question is: > - how to save the token for use during 24h, on all calls/sessions, without > the need to authenticate on every call? > - how to detect the token has expired and re-authenticate? The `htable` module can