Re: [SR-Users] Forward reply in onreply_route

2022-06-28 Thread Alex Balashov

> On Jun 28, 2022, at 10:06 AM, Olle E. Johansson  wrote:
> 
> I don’t know how to do it that way, but I would add stuff to mqueue and 
> process it asynchronously in the background.

+1 — I think this is the way to go. Just push the workload off to some other 
async routine.

-- 
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/


__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Forward reply in onreply_route

2022-06-28 Thread Emmanuel BUU


Le 28/06/2022 à 15:54, Carsten Bock a écrit :

Hi,

Question:
Is there a way to forward a reply from the reply route and do other 
stuff afterward? We are currently doing operations on a 183 reply and 
it would be useful if we could forward the reply before continuing to 
process other stuff.


High-Level example:

/route {
  t_on_reply("REPLY");
  t_relay();
}

onreply_route[REPLY] {
  // Forward the reply to the Caller
  t_relay(); // Does not work, as t_relay is only allowed in request 
and failure-routes


  // Do other fancy stuff, e.g. a DB Update or anything else
}/

Any ideas?

I would use *http_async_query()* in the onreply route, delegate some of 
the DB update an other stuff to an HTTP server. And if there is a need 
to further interact with K, there is a way to specify an HTTP reply 
route that will be called asynchronously.


See : HTTP_ASYNC_CLIENT Module (kamailio.org) 




Thanks,
Carsten




--
Carsten Bock I CTO & Founder

ng-voice GmbH

Trostbrücke 1 I 20457 Hamburg I Germany
T +49 179 2021244 I www.ng-voice.com 

Registry Office at Local Court Hamburg, HRB 120189
Managing Directors: Dr. David Bachmann, Carsten Bock


__
Kamailio - Users Mailing List - Non Commercial Discussions
   *sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
   *https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Forward reply in onreply_route

2022-06-28 Thread Daniel-Constantin Mierla
I think that what Olle suggested is a good solution.

Otherwise, for tm onreply_route, using t_reply() can make tm generate
its own reply and you can use it to overwrite the incoming reply, but I
am not sure it works for 200ok -- for 300 or greater should be ok-ish
all the time, unless you want to propagate all headers coming in the
received reply.

For core (stateless processing) reply_route, there is:

  -
https://www.kamailio.org/docs/modules/stable/modules/sl.html#sl.f.sl_forward_reply

But then be sure you also use drop not to send the incoming reply as well.

Maybe for tm onreply_route, a variant of t_reply() without parameters
can be added, and in such case the incoming reply is forward without any
change in code and reason text. But could be a little bit tricky/risky,
because the state of transaction is updated when the reply is sent out,
setting it in terminated state, and the timer ticks till it is going to
be destroyed in about 5 secs (with default params).

Cheers,
Daniel

On 28.06.22 16:06, Olle E. Johansson wrote:
>
>
>> On 28 Jun 2022, at 15:54, Carsten Bock  wrote:
>>
>> Hi,
>>
>> Question:
>> Is there a way to forward a reply from the reply route and do other
>> stuff afterward? We are currently doing operations on a 183 reply and
>> it would be useful if we could forward the reply before continuing to
>> process other stuff.
>>
>> High-Level example:
>>
>> /route {
>>   t_on_reply("REPLY");
>>   t_relay();
>> }
>>
>> onreply_route[REPLY] {
>>   // Forward the reply to the Caller
>>   t_relay(); // Does not work, as t_relay is only allowed in request
>> and failure-routes
>>  
>>   // Do other fancy stuff, e.g. a DB Update or anything else
>> }/
>>
>> Any ideas?
> I don’t know how to do it that way, but I would add stuff to mqueue
> and process it asynchronously in the background.
>
> /O
>>
>> Thanks,
>> Carsten
>>
>>
>>
>>
>> --
>> Carsten Bock I CTO & Founder
>>
>> ng-voice GmbH
>>
>> Trostbrücke 1 I 20457 Hamburg I Germany
>> T +49 179 2021244 I www.ng-voice.com 
>>
>> Registry Office at Local Court Hamburg, HRB 120189
>> Managing Directors: Dr. David Bachmann, Carsten Bock
>> __
>> Kamailio - Users Mailing List - Non Commercial Discussions
>>  * sr-users@lists.kamailio.org
>> Important: keep the mailing list in the recipients, do not reply only
>> to the sender!
>> Edit mailing list options or unsubscribe:
>>  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>
> __
> Kamailio - Users Mailing List - Non Commercial Discussions
>   * sr-users@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:
>   * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - Online: June 20-23, 2022
  * https://www.asipto.com/sw/kamailio-advanced-training-online/
__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Forward reply in onreply_route

2022-06-28 Thread Olle E. Johansson


> On 28 Jun 2022, at 15:54, Carsten Bock  wrote:
> 
> Hi,
> 
> Question:
> Is there a way to forward a reply from the reply route and do other stuff 
> afterward? We are currently doing operations on a 183 reply and it would be 
> useful if we could forward the reply before continuing to process other stuff.
> 
> High-Level example:
> 
> route {
>   t_on_reply("REPLY");
>   t_relay();
> }
> 
> onreply_route[REPLY] {
>   // Forward the reply to the Caller
>   t_relay(); // Does not work, as t_relay is only allowed in request and 
> failure-routes
>   
>   // Do other fancy stuff, e.g. a DB Update or anything else
> }
> 
> Any ideas?
I don’t know how to do it that way, but I would add stuff to mqueue and process 
it asynchronously in the background.

/O
> 
> Thanks,
> Carsten
> 
> 
> 
> 
> --
> Carsten Bock I CTO & Founder
> 
> ng-voice GmbH
> Trostbrücke 1 I 20457 Hamburg I Germany
> T +49 179 2021244 I www.ng-voice.com 
> Registry Office at Local Court Hamburg, HRB 120189
> Managing Directors: Dr. David Bachmann, Carsten Bock
> __
> Kamailio - Users Mailing List - Non Commercial Discussions
>  * sr-users@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:
>  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Forward reply in onreply_route

2022-06-28 Thread Carsten Bock
Hi,

Question:
Is there a way to forward a reply from the reply route and do other stuff
afterward? We are currently doing operations on a 183 reply and it would be
useful if we could forward the reply before continuing to process other
stuff.

High-Level example:











*route {  t_on_reply("REPLY");  t_relay();}onreply_route[REPLY] {  //
Forward the reply to the Caller  t_relay(); // Does not work, as t_relay is
only allowed in request and failure-routes// Do other fancy stuff, e.g.
a DB Update or anything else}*

Any ideas?

Thanks,
Carsten




--
Carsten Bock I CTO & Founder

ng-voice GmbH

Trostbrücke 1 I 20457 Hamburg I Germany
T +49 179 2021244 I www.ng-voice.com

Registry Office at Local Court Hamburg, HRB 120189
Managing Directors: Dr. David Bachmann, Carsten Bock
__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio 5.5 STIR SHAKEN private key buffer size error

2022-06-28 Thread Daniel-Constantin Mierla
Note that kamailio has another module that offer StIR/SHAKEN
capabilities, respectively the secsipid module. You can try to use it,
this one I maintain and if there is any issue found, I am going to fix it.

All the best,
Daniel

On 28.06.22 04:41, Maharaja Azhagiah wrote:
> Thank you very much, Muhammad
>
> I tried reducing the SSL key bit length to 1024 but the buffer is
> still less than the key size. Hence, I submitted an issue with
> signalwire. I appreciate your help. 
>
> Regards
>
> *Maharaja Azhagiah*
>
>
>
>
>
>
> On Mon, Jun 27, 2022 at 10:05 PM M S  wrote:
>
> This error is  seems to come from libstirshaken
> 
> (https://github.com/signalwire/libstirshaken/blob/master/include/stir_shaken.h
> line 46) and has nothing to do with Kamailio. Please open a bug
> with signalwire who owns and maintains this library.
>
> Per my understanding this library is bit old and uses many
> deprecated functions and needs updating. As a general rule of
> thumb, in PEM format, the private key size in bytes is roughly 80%
> (4/5) of key size in bits e.g. 4096 bit private key size would be
> roughly,
>
> (4096 * 4) / 5 ~= 3277 byes
>
> which is too big for allowed size (2000 byes) in libstirshaken.
> So, either increasing the allowed size in libstirshaken OR
> reducing your SSL key bit length to e.g. 1024 may work.
>
> Thank you.
>
> --
> Muhammad Shahzad Shafi
> Tel: +49 176 99 83 10 85
>
>
>
> On Mon, Jun 27, 2022 at 11:07 PM Maharaja Azhagiah
>  wrote:
>
> Hi,
>
> I am trying STIR/SHAKEN using libstirshaken in Kamailio 5.5.
>
> I used a self signed certificate as this is just a test in the
> local docker environment. However, when I try to add identity
> with private key (stirshaken_add_identity_with_key), I get
> "[error_code: 447] Buffer for key from file
> /tmp/cert/private.pem too short (2000 <= 3247)"
>
> I have tried using 2048 and 4096 size
>
> root@5907e44bd056:/tmp/cert# openssl rsa -in private.pem -text
> -noout | grep "Private-Key"
> RSA Private-Key: (4096 bit, 2 primes)
>
> Could you tell me what is wrong with the certificate?
>
> Kamailio version:
>
> root@5907e44bd056:/usr/local/kamailio/etc/kamailio# kamailio -v
> version: kamailio 5.5.4 (x86_64/linux) 469465
>
> Error:
>
>  0(404) ERROR: {1 30587 INVITE
> NzIhM1-2YABveZZ1mPvs3m3tw8K7meSq} stirshaken
> [stirshaken_mod.c:761]: ki_stirshaken_add_identity_with_key():
> Failed to load private key
>  0(404) DEBUG: {1 30587 INVITE
> NzIhM1-2YABveZZ1mPvs3m3tw8K7meSq} stirshaken
> [stirshaken_mod.c:117]: stirshaken_print_error_details():
> failure details:
>  0(404) DEBUG: {1 30587 INVITE
> NzIhM1-2YABveZZ1mPvs3m3tw8K7meSq} stirshaken
> [stirshaken_mod.c:118]: stirshaken_print_error_details():
> failure reason is: src/stir_shaken_ssl.c:2112: [error_code:
> 447] Buffer for key from file /tmp/cert/private.pem too short
> (2000 <= 3247)
>  0(404) DEBUG: {1 30587 INVITE
> NzIhM1-2YABveZZ1mPvs3m3tw8K7meSq} stirshaken
> [stirshaken_mod.c:119]: stirshaken_print_error_details():
> failure error code is: 447
>  0(404) ERROR: {1 30587 INVITE
> NzIhM1-2YABveZZ1mPvs3m3tw8K7meSq} 

Re: [SR-Users] Phones are not getting registered. Is my setup correct?

2022-06-28 Thread Farhan Sahariar (CSSD)
Thank you. Appreciate it.


From: Henning Westerholt 
Sent: Monday, June 27, 2022 1:09 PM
To: Farhan Sahariar (CSSD) ; Kamailio (SER) - 
Users Mailing List 
Subject: RE: Phones are not getting registered. Is my setup correct?

Hello,

it depends on your distribution. Use eg. “yum” for red hat based, and “apt” for 
Debian based.

Cheers,

Henning

--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com

From: Farhan Sahariar (CSSD) 
mailto:farhan.sahar...@leads-bd.com>>
Sent: Monday, June 27, 2022 9:00 AM
To: Henning Westerholt mailto:h...@gilawa.com>>; Kamailio 
(SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Subject: Re: Phones are not getting registered. Is my setup correct?

Hi,

Thank you for your reply.

Will try that. What is the command to update the kamailio version!



Best Regards,
Farhan Sahariar
Assistant Manager
Customer Support Services Division
LEADS Corporation Ltd.

From: Henning Westerholt mailto:h...@gilawa.com>>
Sent: Monday, June 27, 2022 12:31:03 PM
To: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Cc: Farhan Sahariar (CSSD) 
mailto:farhan.sahar...@leads-bd.com>>
Subject: RE: Phones are not getting registered. Is my setup correct?


Hello,



not sure what this „Goautodial” is about. Maybe you should contact their 
support.



About the Kamailio, you can check the kamailio cfg with “kamailio -c” on the 
command line, to see if there is an error in the cfg. You can also get probably 
some information in the log files.

You should update your kamailio version, the one you use is really old.



Cheers,



Henning



--

Henning Westerholt – https://skalatan.de/blog/

Kamailio services – https://gilawa.com



From: sr-users 
mailto:sr-users-boun...@lists.kamailio.org>>
 On Behalf Of Farhan Sahariar (CSSD)
Sent: Sunday, June 26, 2022 12:38 PM
To: sr-users@lists.kamailio.org
Subject: [SR-Users] Phones are not getting registered. Is my setup correct?



Hi,



I have just installed Goautodial v4.



I have followed all the guide to register a phone but this does not work.



Is kamailio the reason. I am new to linux need help.



[root@vaglxc01 ~]# systemctl status kamailio

● kamailio.service - Kamailio (OpenSER) - the Open Source SIP Server

   Loaded: loaded (/usr/lib/systemd/system/kamailio.service; enabled; vendor 
preset: disabled)

   Active: failed (Result: start-limit) since Sun 2022-06-26 16:11:41 +06; 
10min ago

  Process: 1545 ExecStart=/usr/sbin/kamailio -DD -P 
/var/run/kamailio/kamailio.pid -f $CFGFILE -m $SHM_MEMORY -M $PKG_MEMORY 
(code=exited, status=255)

Main PID: 1545 (code=exited, status=255)



Jun 26 16:11:41 vaglxc01.goautodial.com systemd[1]: Unit kamailio.service 
entered failed state.

Jun 26 16:11:41 vaglxc01.goautodial.com systemd[1]: kamailio.service failed.

Jun 26 16:11:41 vaglxc01.goautodial.com systemd[1]: kamailio.service holdoff 
time over, scheduling restart.

Jun 26 16:11:41 vaglxc01.goautodial.com systemd[1]: start request repeated too 
quickly for kamailio.service

Jun 26 16:11:41 vaglxc01.goautodial.com systemd[1]: Failed to start Kamailio 
(OpenSER) - the Open Source SIP Server.

Jun 26 16:11:41 vaglxc01.goautodial.com systemd[1]: Unit kamailio.service 
entered failed state.

Jun 26 16:11:41 vaglxc01.goautodial.com systemd[1]: kamailio.service failed.

Jun 26 16:11:47 vaglxc01.goautodial.com systemd[1]: start request repeated too 
quickly for kamailio.service

Jun 26 16:11:47 vaglxc01.goautodial.com systemd[1]: Failed to start Kamailio 
(OpenSER) - the Open Source SIP Server.

Jun 26 16:11:47 vaglxc01.goautodial.com systemd[1]: kamailio.service failed.

[root@vaglxc01 ~]# kamailio -version

version: kamailio 5.0.7 (x86_64/linux) 743c2d

flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, 
DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, 
F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, 
USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES

ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, 
MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB

poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.

id: 743c2d

compiled on 03:02:32 Aug 26 2018 with gcc 4.8.5







Best regards,

Farhan Sahariar

Assistant Manager

Customer Support Services Division

LEADS Corporation Limited

[Description: Description: Green Living Slogan_Email]


__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Phones are not getting registered. Is my setup correct?

2022-06-28 Thread Farhan Sahariar (CSSD)
Hi,

Thank you for your reply.

Will try that. What is the command to update the kamailio version!



Best Regards,
Farhan Sahariar
Assistant Manager
Customer Support Services Division
LEADS Corporation Ltd.

From: Henning Westerholt 
Sent: Monday, June 27, 2022 12:31:03 PM
To: Kamailio (SER) - Users Mailing List 
Cc: Farhan Sahariar (CSSD) 
Subject: RE: Phones are not getting registered. Is my setup correct?


Hello,



not sure what this „Goautodial” is about. Maybe you should contact their 
support.



About the Kamailio, you can check the kamailio cfg with “kamailio -c” on the 
command line, to see if there is an error in the cfg. You can also get probably 
some information in the log files.

You should update your kamailio version, the one you use is really old.



Cheers,



Henning



--

Henning Westerholt – https://skalatan.de/blog/

Kamailio services – https://gilawa.com



From: sr-users  On Behalf Of Farhan 
Sahariar (CSSD)
Sent: Sunday, June 26, 2022 12:38 PM
To: sr-users@lists.kamailio.org
Subject: [SR-Users] Phones are not getting registered. Is my setup correct?



Hi,



I have just installed Goautodial v4.



I have followed all the guide to register a phone but this does not work.



Is kamailio the reason. I am new to linux need help.



[root@vaglxc01 ~]# systemctl status kamailio

● kamailio.service - Kamailio (OpenSER) - the Open Source SIP Server

   Loaded: loaded (/usr/lib/systemd/system/kamailio.service; enabled; vendor 
preset: disabled)

   Active: failed (Result: start-limit) since Sun 2022-06-26 16:11:41 +06; 
10min ago

  Process: 1545 ExecStart=/usr/sbin/kamailio -DD -P 
/var/run/kamailio/kamailio.pid -f $CFGFILE -m $SHM_MEMORY -M $PKG_MEMORY 
(code=exited, status=255)

Main PID: 1545 (code=exited, status=255)



Jun 26 16:11:41 vaglxc01.goautodial.com systemd[1]: Unit kamailio.service 
entered failed state.

Jun 26 16:11:41 vaglxc01.goautodial.com systemd[1]: kamailio.service failed.

Jun 26 16:11:41 vaglxc01.goautodial.com systemd[1]: kamailio.service holdoff 
time over, scheduling restart.

Jun 26 16:11:41 vaglxc01.goautodial.com systemd[1]: start request repeated too 
quickly for kamailio.service

Jun 26 16:11:41 vaglxc01.goautodial.com systemd[1]: Failed to start Kamailio 
(OpenSER) - the Open Source SIP Server.

Jun 26 16:11:41 vaglxc01.goautodial.com systemd[1]: Unit kamailio.service 
entered failed state.

Jun 26 16:11:41 vaglxc01.goautodial.com systemd[1]: kamailio.service failed.

Jun 26 16:11:47 vaglxc01.goautodial.com systemd[1]: start request repeated too 
quickly for kamailio.service

Jun 26 16:11:47 vaglxc01.goautodial.com systemd[1]: Failed to start Kamailio 
(OpenSER) - the Open Source SIP Server.

Jun 26 16:11:47 vaglxc01.goautodial.com systemd[1]: kamailio.service failed.

[root@vaglxc01 ~]# kamailio -version

version: kamailio 5.0.7 (x86_64/linux) 743c2d

flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, 
DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, 
F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, 
USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES

ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, 
MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB

poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.

id: 743c2d

compiled on 03:02:32 Aug 26 2018 with gcc 4.8.5







Best regards,

Farhan Sahariar

Assistant Manager

Customer Support Services Division

LEADS Corporation Limited

[Description: Description: Green Living Slogan_Email]


__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users