[prev in list] [next in list] [prev in thread] [next in thread]
List: serusers
Subject: [SR-Users] Re: enum queries using Kamailio in asynchronous mode ?
From: Henning Westerholt via sr-users <sr-users () lists ! kamailio ! org>
Date: 2023-12-19 9:08:26
Message-ID: DB7PR07MB388231E4D9F616EAAADEEFACBF97A () DB7PR07MB3882 ! eurprd07 ! prod ! outlook ! com
[Download RAW message or body]
[Attachment #2 (text/plain)]
Hello,
if a server dependency is not available at all, you will get problems in your \
Kamailio, regardless of you are using synchronous or asynchronous operations. With \
asynchronous operations you will get into some memory exhaustion situation after some \
time due to the waiting requests. You probably want to think about short timeouts and \
then having a fail-safe logic that allows to continue (with limited functionality) \
when the enum server is not available.
Cheers,
Henning
From: Chaigneau, Nicolas <nicolas.chaigneau@capgemini.com>
Sent: Dienstag, 19. Dezember 2023 09:55
To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>; Henning \
Westerholt <hw@gilawa.com>
Subject: RE: enum queries using Kamailio in asynchronous mode ?
I'm not sure how to do that though…
If I do something like this:
...
async_workers_group="name=enum;workers=4;nonblock=0;usleep=0"
...
request_route {
...
async_task_route("ENUM", "enum");
...
}
route[ENUM] {
# query enum servers here
# then proceed with the remaining of the routing logic
...
}
...
This can still block all async workers… and then my Kamailio would also become \
blocked ? Am I missing something ?
Regards,
Nicolas.
De : Chaigneau, Nicolas via sr-users \
<sr-users@lists.kamailio.org<mailto:sr-users@lists.kamailio.org>> Envoyé : mardi 19 \
décembre 2023 09:19 À : Henning Westerholt; Kamailio (SER) - Users Mailing List
Cc : Chaigneau, Nicolas
Objet : [SR-Users] Re: enum queries using Kamailio in asynchronous mode ?
Thanks Henning!
The async module seems a good solution indeed, I'll look into this.
Regards,
Nicolas.
De : Henning Westerholt <hw@gilawa.com<mailto:hw@gilawa.com>>
Envoyé : mardi 19 décembre 2023 09:10
À : Kamailio (SER) - Users Mailing List
Cc : Chaigneau, Nicolas
Objet : RE: enum queries using Kamailio in asynchronous mode ?
Hello,
the enum module seems to execute its queries synchronously indeed.
Asynchronous execution could be added to the module or as another module. Maybe also \
adding some configurable timeout values to not block the server in case of errors \
would be also sufficient. You can also look at the async module to see if maybe this \
is an easier solution: https://www.kamailio.org/docs/modules/devel/modules/async.html
Cheers,
Henning
From: Chaigneau, Nicolas via sr-users \
<sr-users@lists.kamailio.org<mailto:sr-users@lists.kamailio.org>>
Sent: Freitag, 15. Dezember 2023 10:37
To: Kamailio (SER) - Users Mailing List \
<sr-users@lists.kamailio.org<mailto:sr-users@lists.kamailio.org>>
Cc: Chaigneau, Nicolas \
<nicolas.chaigneau@capgemini.com<mailto:nicolas.chaigneau@capgemini.com>>
Subject: [SR-Users] enum queries using Kamailio in asynchronous mode ?
Hello,
I will need to perform enum queries from Kamailio.
I see that there is a module for that:
https://www.kamailio.org/docs/modules/devel/modules/enum.html
However, I'm worried that if the enum server is unresponsive, this could block all \
workers… I don't think the module can handle an asynchronous mode ? I see that we \
have a specific module for HTTP async: \
https://www.kamailio.org/docs/modules/devel/modules/http_async_client.html
Has anyone had to implement this kind of need with enum in Kamailio ?
Thanks.
Regards,
Nicolas.
This message contains information that may be privileged or confidential and is the \
property of the Capgemini Group. It is intended only for the person to whom it is \
addressed. If you are not the intended recipient, you are not authorized to read, \
print, retain, copy, disseminate, distribute, or use this message or any part \
thereof. If you receive this message in error, please notify the sender immediately \
and delete all copies of this message.
[Attachment #3 (text/html)]
<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span \
style="mso-fareast-language:EN-US">Hello,<o:p></o:p></span></p> <p \
class="MsoNormal"><span \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">if a server \
dependency is not available at all, you will get problems in your Kamailio, \
regardless of you are using synchronous or asynchronous operations. With asynchronous \
operations you will get into some memory exhaustion situation after some time due to \
the waiting requests.<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-GB" \
style="mso-fareast-language:EN-US">You probably want to think about short timeouts \
and then having a fail-safe logic that allows to continue (with limited \
functionality) when the enum server is not available.<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-GB" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-GB" \
style="mso-fareast-language:EN-US">Cheers,<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-GB" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-GB" \
style="mso-fareast-language:EN-US">Henning<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-GB" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <div \
style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt"> <div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm \
0cm;font-size:pt"> <p class="MsoNormal"><b><span lang="EN-GB">From:</span></b><span \
lang="EN-GB"> Chaigneau, Nicolas <nicolas.chaigneau@capgemini.com> <br>
<b>Sent:</b> Dienstag, 19. Dezember 2023 09:55<br>
<b>To:</b> Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>; \
Henning Westerholt <hw@gilawa.com><br> <b>Subject:</b> RE: enum queries using \
Kamailio in asynchronous mode ?<o:p></o:p></span></p> </div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">I'm not \
sure how to do that though…<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US" style="mso-fareast-language:EN-US">If I do something like \
this:<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p class="MsoNormal" \
style="margin-left:35.4pt"><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas;color:black">...<o:p></o:p></span></p> \
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas;color:black">async_workers_group="name=enum;workers=4;nonblock=0;usleep=0"<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas;color:black">...<o:p></o:p></span></p> \
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas;color:black">request_route \
{<o:p></o:p></span></p> <p class="MsoNormal" style="margin-left:35.4pt"><span \
lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black"> \
...<o:p></o:p></span></p> <p class="MsoNormal" style="margin-left:35.4pt"><span \
lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black"> \
async_task_route("ENUM", "enum");<o:p></o:p></span></p> <p \
class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas;color:black"> \
...<o:p></o:p></span></p> <p class="MsoNormal" style="margin-left:35.4pt"><span \
lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas;color:black">route[ENUM] \
{<o:p></o:p></span></p> <p class="MsoNormal" style="margin-left:35.4pt"><span \
lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black"> # \
query enum servers here<o:p></o:p></span></p> <p class="MsoNormal" \
style="margin-left:35.4pt"><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas;color:black"> # then proceed \
with the remaining of the routing logic<o:p></o:p></span></p> <p class="MsoNormal" \
style="margin-left:35.4pt"><span lang="EN-US" \
style="font-size:10.0pt;font-family:Consolas;color:black"> \
...<o:p></o:p></span></p> <p class="MsoNormal" style="margin-left:35.4pt"><span \
lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black">}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="FR" \
style="font-size:10.0pt;font-family:Consolas;color:black">...</span><span lang="FR" \
style="color:black"><o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">This can \
still block all async workers… and then my Kamailio would also become blocked \
?<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US">Am I missing something ?<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US">Regards,<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US">Nicolas.<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="FR">De :</span></b><span lang="FR"> \
Chaigneau, Nicolas via sr-users <<a \
href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>> <br>
<b>Envoyé :</b> mardi 19 décembre 2023 09:19<br>
<b>À :</b> Henning Westerholt; Kamailio (SER) - Users Mailing List<br>
<b>Cc :</b> Chaigneau, Nicolas<br>
<b>Objet :</b> [SR-Users] Re: enum queries using Kamailio in asynchronous mode \
?<o:p></o:p></span></p> </div>
</div>
<p class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Thanks \
Henning!<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US">The async module seems a good solution indeed, \
I'll look into this.<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US">Regards,<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="FR" \
style="mso-fareast-language:EN-US">Nicolas.<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="FR" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="FR">De :</span></b><span lang="FR"> Henning \
Westerholt <<a href="mailto:hw@gilawa.com">hw@gilawa.com</a>> <br>
<b>Envoyé :</b> mardi 19 décembre 2023 09:10<br>
<b>À :</b> Kamailio (SER) - Users Mailing List<br>
<b>Cc :</b> Chaigneau, Nicolas<br>
<b>Objet :</b> RE: enum queries using Kamailio in asynchronous mode \
?<o:p></o:p></span></p> <p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<p class="MsoNormal"><span \
style="mso-fareast-language:EN-US">Hello,<o:p></o:p></span></p> <p \
class="MsoNormal"><span \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">the enum \
module seems to execute its queries synchronously indeed. <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-GB" style="mso-fareast-language:EN-US">Asynchronous \
execution could be added to the module or as another module. Maybe also adding some \
configurable timeout values to not block the server in case of errors would be also \
sufficient. You can also look at the async module to see if maybe this is an easier \
solution:<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-GB" \
style="mso-fareast-language:EN-US"><a \
href="https://www.kamailio.org/docs/modules/devel/modules/async.html">https://www.kamailio.org/docs/modules/devel/modules/async.html</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-GB" \
style="mso-fareast-language:EN-US">Cheers,<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-GB" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-GB" \
style="mso-fareast-language:EN-US">Henning<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-GB" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <div \
style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt"> <div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm \
0cm;font-size:pt"> <p class="MsoNormal"><b><span lang="EN-GB">From:</span></b><span \
lang="EN-GB"> Chaigneau, Nicolas via sr-users <<a \
href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>> <br>
<b>Sent:</b> Freitag, 15. Dezember 2023 10:37<br>
<b>To:</b> Kamailio (SER) - Users Mailing List <<a \
href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>><br> \
<b>Cc:</b> Chaigneau, Nicolas <<a \
href="mailto:nicolas.chaigneau@capgemini.com">nicolas.chaigneau@capgemini.com</a>><br>
<b>Subject:</b> [SR-Users] enum queries using Kamailio in asynchronous mode \
?<o:p></o:p></span></p> </div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span lang="EN-US">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I will need to perform enum queries from \
Kamailio.<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"><o:p> </o:p></span></p> <p class="MsoNormal"><span lang="EN-US">I \
see that there is a module for that:<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"><a href="https://www.kamailio.org/docs/modules/devel/modules/enum.html">h \
ttps://www.kamailio.org/docs/modules/devel/modules/enum.html</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">However, I'm worried that if the enum server \
is unresponsive, this could block all workers…<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US">I don't think the module can handle an \
asynchronous mode ? I see that we have a specific module for HTTP \
async:<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US"><a \
href="https://www.kamailio.org/docs/modules/devel/modules/http_async_client.html">http \
s://www.kamailio.org/docs/modules/devel/modules/http_async_client.html</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Has anyone had to implement this kind of need \
with enum in Kamailio ?<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"><o:p> </o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"><o:p> </o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">Thanks.<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"><o:p> </o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">Regards,<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">Nicolas.<o:p></o:p></span></p> </div>
</div>
<p><span lang="FR" style="font-size:7.0pt">This message contains information that may \
be privileged or confidential and is the property of the Capgemini Group. It is \
intended only for the person to whom it is addressed. If you are not the intended \
recipient, you are not authorized to read, print, retain, copy, disseminate, \
distribute, or use this message or any part thereof. If you receive this message in \
error, please notify the sender immediately and delete all copies of this \
message.<o:p></o:p></span></p> </div>
</div>
</body>
</html>
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-leave@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
--===============0344422867==--
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic