<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)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Microsoft YaHei UI";
        panose-1:2 11 5 3 2 2 4 2 2 4;}
@font-face
        {font-family:"\@Microsoft YaHei UI";}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
h3
        {mso-style-priority:9;
        mso-style-link:"Überschrift 3 Zchn";
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:13.5pt;
        font-family:"Calibri",sans-serif;
        font-weight:bold;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
code
        {mso-style-priority:99;
        font-family:"Courier New",serif;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New",serif;}
span.berschrift3Zchn
        {mso-style-name:"Überschrift 3 Zchn";
        mso-style-priority:9;
        mso-style-link:"Überschrift 3";
        font-family:"Calibri Light",sans-serif;
        color:#1F3763;}
span.HTMLVorformatiertZchn
        {mso-style-name:"HTML Vorformatiert Zchn";
        mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert";
        font-family:Consolas;}
span.sy0
        {mso-style-name:sy0;}
span.nu0
        {mso-style-name:nu0;}
span.E-MailFormatvorlage27
        {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 2.0cm 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 lang="EN-GB" style="mso-fareast-language:EN-US">Thanks for the update, great that you found a solution and reported back to the list.<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>
<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 Westerholt –
</span><span style="mso-fareast-language:EN-US"><a href="https://skalatan.de/blog/"><span lang="EN-GB" style="color:#0563C1">https://skalatan.de/blog/</span></a></span><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">Kamailio services –
</span><span style="mso-fareast-language:EN-US"><a href="https://gilawa.com/"><span lang="EN-GB" style="color:#0563C1">https://gilawa.com</span></a></span><span lang="EN-GB" style="mso-fareast-language:EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-GB" 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" style="margin-left:35.4pt"><b>From:</b> riffs@sina.cn <riffs@sina.cn>
<br>
<b>Sent:</b> Friday, December 2, 2022 7:40 AM<br>
<b>To:</b> Henning Westerholt <hw@gilawa.com><br>
<b>Cc:</b> sr-users <sr-users@lists.kamailio.org><br>
<b>Subject:</b> Re: RE: [SR-Users] uac_req_send() multi-process synchronization problem<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black">Thank you for your reply very much,Because this is my first mail list. Don't know need </span><span style="color:black">keep
 the list in CC. I'm sorry.</span><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="color:black">I foun a paramter from cookbooks. It feels like setting the tcp_accept_unique to 1 avoids this problem</span><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<h3 style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:10.65pt;margin-left:35.4pt" id="tcp_accept_unique">
<span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#333333">tcp_accept_unique<o:p></o:p></span></h3>
<div>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:16.8pt;margin-left:35.4pt">
<span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#333333">If set to 1, reject duplicate connections coming from same source IP and port.<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:16.8pt;margin-left:35.4pt">
<span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#333333">Default set to 0.<o:p></o:p></span></p>
<div style="mso-element:para-border-div;border:solid #CCCCCC 1.0pt;padding:8.0pt 12.0pt 8.0pt 12.0pt;background:#FBFAF9;margin-left:35.4pt;margin-right:0cm">
<pre style="margin-bottom:16.8pt;background:#FBFAF9;border:none;padding:0cm;box-shadow: rgb(204, 204, 204) 0px 0px 0.5em inset;border-radius: 2px;overflow-wrap: normal;overflow:auto"><span style="font-size:10.5pt;font-family:Consolas;color:#333333">tcp_accept_unique </span><span class="sy0"><span style="font-size:10.5pt;font-family:Consolas;color:#66CC66">=</span></span><span style="font-size:10.5pt;font-family:Consolas;color:#333333"> </span><span class="nu0"><span style="font-size:10.5pt;font-family:Consolas;color:#CC66CC">1</span></span><span style="font-size:10.5pt;font-family:Consolas;color:#333333"><o:p></o:p></span></pre>
</div>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black">tcp_accept_unique role in the source code:<o:p></o:p></span></p>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#333333">        </span>
<span style="font-size:12.0pt;font-family:Consolas;color:#4B69C6">if</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">(</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">tcp_accept_unique</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">)</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">{</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#333333">            </span>
<span style="font-size:12.0pt;font-family:Consolas;color:#4B69C6">if</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">(</span><b><span style="font-size:12.0pt;font-family:Consolas;color:#AA3731">tcpconn_exists</span></b><span style="font-size:12.0pt;font-family:Consolas;color:#777777">(</span><span style="font-size:12.0pt;font-family:Consolas;color:#9C5D27">0</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">,</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">&</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">tcpconn</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">-></span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">rcv</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">.</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">dst_ip</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">,</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">tcpconn</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">-></span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">rcv</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">.</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">dst_port</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">,</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#333333">                       
</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">&</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">tcpconn</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">-></span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">rcv</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">.</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">src_ip</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">,</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">tcpconn</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">-></span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">rcv</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">.</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">src_port</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">))</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">{</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#333333">               
</span><b><span style="font-size:12.0pt;font-family:Consolas;color:#AA3731">LM_ERR</span></b><span style="font-size:12.0pt;font-family:Consolas;color:#777777">("</span><span style="font-size:12.0pt;font-family:Consolas;color:#448C27">duplicated connection by
 local and remote addresses</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">\n");</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#333333">               
</span><b><span style="font-size:12.0pt;font-family:Consolas;color:#AA3731">_tcpconn_free</span></b><span style="font-size:12.0pt;font-family:Consolas;color:#777777">(</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">tcpconn</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">);</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#333333">               
</span><b><span style="font-size:12.0pt;font-family:Consolas;color:#AA3731">tcp_safe_close</span></b><span style="font-size:12.0pt;font-family:Consolas;color:#777777">(</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">new_sock</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">);</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#333333">               
</span><span style="font-size:12.0pt;font-family:Consolas;color:#4B69C6">return</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#9C5D27">1</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">;</span><i><span style="font-size:12.0pt;font-family:Consolas;color:#AAAAAA"> /* success, because the accept was
 successful */</span></i><span style="font-size:12.0pt;font-family:Consolas;color:#333333"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#333333">            </span>
<span style="font-size:12.0pt;font-family:Consolas;color:#777777">}</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#333333">        </span>
<span style="font-size:12.0pt;font-family:Consolas;color:#777777">}</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333"><o:p></o:p></span></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black">
<hr size="1" width="210" style="width:157.5pt" noshade="" style="color:#B5C4DF" align="left">
</span></div>
<div>
<div style="margin-left:7.5pt;margin-top:7.5pt;margin-right:7.5pt;margin-bottom:7.5pt">
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><a href="mailto:riffs@sina.cn">riffs@sina.cn</a><o:p></o:p></span></p>
</div>
</div>
</div>
<blockquote style="margin-left:6.0pt;margin-right:inherit">
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black"> <o:p></o:p></span></p>
</div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;background:#EFEFEF"><b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black">From:</span></b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black"> <a href="mailto:hw@gilawa.com">Henning
 Westerholt</a><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;background:#EFEFEF"><b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black">Date:</span></b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black"> 2022-12-01 18:23<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;background:#EFEFEF"><b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black">To:</span></b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black"> <a href="mailto:riffs@sina.cn">riffs@sina.cn</a><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;background:#EFEFEF"><b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black">CC:</span></b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black"> <a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;background:#EFEFEF"><b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black">Subject:</span></b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black"> RE: Re: [SR-Users]
 uac_req_send() multi-process synchronization problem<o:p></o:p></span></p>
</div>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="color:black;mso-fareast-language:EN-US">Hello,</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="color:black;mso-fareast-language:EN-US"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US">please keep the list in CC.
</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US">Not sure what you mean by multi-process safe. The functions are safe to use in a kamailio multi-process context, relevant sections should be protected
 by internal locks etc..</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US">Regarding query location manually by SQL client, its better to use the provided functions from the usrloc/registrar module instead.</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US">Cheers,</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US">Henning</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US"> </span><span style="color:black"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US">--
</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US">Henning Westerholt –
</span><span style="color:black;mso-fareast-language:EN-US"><a href="https://skalatan.de/blog/"><span lang="EN-GB" style="color:#0563C1">https://skalatan.de/blog/</span></a></span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US">Kamailio services –
</span><span style="color:black;mso-fareast-language:EN-US"><a href="https://gilawa.com/"><span lang="EN-GB" style="color:#0563C1">https://gilawa.com</span></a></span><span style="color:black"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US"> </span><span style="color:black"><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" style="margin-left:35.4pt"><b><span style="color:black">From:</span></b><span style="color:black">
<a href="mailto:riffs@sina.cn">riffs@sina.cn</a> <<a href="mailto:riffs@sina.cn">riffs@sina.cn</a>>
<br>
<b>Sent:</b> Thursday, December 1, 2022 10:47 AM<br>
<b>To:</b> Henning Westerholt <<a href="mailto:hw@gilawa.com">hw@gilawa.com</a>><br>
<b>Subject:</b> Re: Re: [SR-Users] uac_req_send() multi-process synchronization problem<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="color:black"> <o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black">To confirm that. Are reg_fetch_contacts and unregister_ruid multi-process safe?</span><span style="color:black"><o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<div class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black">
<hr size="1" width="210" style="width:157.5pt" noshade="" style="color:#A0A0A0" align="left">
</span></div>
</div>
<div>
<div style="margin-left:7.5pt;margin-top:7.5pt;margin-right:7.5pt;margin-bottom:7.5pt">
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><a href="mailto:riffs@sina.cn">riffs@sina.cn</a></span><span style="color:black"><o:p></o:p></span></p>
</div>
</div>
</div>
<blockquote style="margin-left:6.0pt;margin-right:inherit">
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
</div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;background:#EFEFEF"><b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black">From:</span></b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black"> <a href="mailto:riffs@sina.cn">riffs@sina.cn</a></span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;background:#EFEFEF"><b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black">Date:</span></b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black"> 2022-12-01 16:35</span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;background:#EFEFEF"><b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black">To:</span></b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black"> <a href="mailto:hw@gilawa.com">Henning
 Westerholt</a></span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;background:#EFEFEF"><b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black">Subject:</span></b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black"> Re: RE: [SR-Users]
 uac_req_send() multi-process synchronization problem</span><span style="color:black"><o:p></o:p></span></p>
</div>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black">Hello </span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black">Thank you for your reply very much.  My LOCATION is stored in the MYSQL database, and I also set the
</span><code><b><span style="font-size:10.0pt;color:black;background:#EFF8F8">event_callback</span></b></code><strong><span style="font-size:11.5pt;font-family:"Helvetica",sans-serif;color:black;background:#EFF8F8"> parameter of TCPOPS</span></strong><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black">.</span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#333333">modparam(</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">"</span><span style="font-size:12.0pt;font-family:Consolas;color:#448C27">tcpops</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">"</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">,
</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">"</span><span style="font-size:12.0pt;font-family:Consolas;color:#448C27">event_callback</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">"</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">,
</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">"</span><span style="font-size:12.0pt;font-family:Consolas;color:#448C27">ksr_tcpops_event</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">"</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">)</span><span style="color:black"><o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#333333"> </span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#333333">At the same time.I also deleted the contact inside the function</span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#4B69C6">function</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><b><span style="font-size:12.0pt;font-family:Consolas;color:#AA3731">ksr_tcpops_event</span></b><span style="font-size:12.0pt;font-family:Consolas;color:#777777">(</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">evname</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">)</span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#333333">    </span><span style="font-size:12.0pt;font-family:Consolas;color:#4B69C6">local</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">tcpconnid</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">=</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">KSR</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">.pv.</span><b><span style="font-size:12.0pt;font-family:Consolas;color:#AA3731">get</span></b><span style="font-size:12.0pt;font-family:Consolas;color:#333333">(</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">"</span><span style="font-size:12.0pt;font-family:Consolas;color:#448C27">$conid</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">"</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">)
</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">or</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">"</span><span style="font-size:12.0pt;font-family:Consolas;color:#448C27">0</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">"</span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#333333">       </span><span style="font-size:12.0pt;font-family:Consolas;color:#4B69C6">if</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333"> (</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">evname</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">==</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">"</span><span style="font-size:12.0pt;font-family:Consolas;color:#448C27">tcp:reset</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">" or</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">evname</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">==</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">"</span><span style="font-size:12.0pt;font-family:Consolas;color:#448C27">tcp:closed</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">"</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">)
</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">and</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333"> (</span><b><span style="font-size:12.0pt;font-family:Consolas;color:#AA3731">tonumber</span></b><span style="font-size:12.0pt;font-family:Consolas;color:#333333">(</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">tcpconnid</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">)
</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">~=</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#9C5D27">0</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">)  </span><span style="font-size:12.0pt;font-family:Consolas;color:#4B69C6">then</span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#333333">        </span>
<span style="font-size:12.0pt;font-family:Consolas;color:#4B69C6">local</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">sql</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">=</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><b><span style="font-size:12.0pt;font-family:Consolas;color:#AA3731">string.format</span></b><span style="font-size:12.0pt;font-family:Consolas;color:#333333">(</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">"</span><span style="font-size:12.0pt;font-family:Consolas;color:#448C27">select
 * from location where tcpconnid=%s</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">"</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">,
</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">tcpconnid</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">)</span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#333333">        </span>
<span style="font-size:12.0pt;font-family:Consolas;color:#4B69C6">local</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">count</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">,
</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">rows</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">=</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><b><span style="font-size:12.0pt;font-family:Consolas;color:#AA3731">execute_select</span></b><span style="font-size:12.0pt;font-family:Consolas;color:#333333">(</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">sql</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">)</span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#333333">        </span>
<span style="font-size:12.0pt;font-family:Consolas;color:#4B69C6">if</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">count</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">></span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#9C5D27">0</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#4B69C6">then</span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#777777"> </span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">           
</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">KSR</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">.registrar.</span><b><span style="font-size:12.0pt;font-family:Consolas;color:#AA3731">unregister_ruid</span></b><span style="font-size:12.0pt;font-family:Consolas;color:#333333">(</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">"</span><span style="font-size:12.0pt;font-family:Consolas;color:#448C27">location</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">"</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">,
</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">rows</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">[</span><span style="font-size:12.0pt;font-family:Consolas;color:#9C5D27">1</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">].contact,
</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">rows</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">[</span><span style="font-size:12.0pt;font-family:Consolas;color:#9C5D27">1</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">].ruid)</span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#333333">        </span>
<span style="font-size:12.0pt;font-family:Consolas;color:#4B69C6">end</span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#333333">    </span><span style="font-size:12.0pt;font-family:Consolas;color:#4B69C6">end</span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#333333">    </span><span style="font-size:12.0pt;font-family:Consolas;color:#4B69C6">return</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">
</span><span style="font-size:12.0pt;font-family:Consolas;color:#9C5D27">1</span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<span style="font-size:12.0pt;font-family:Consolas;color:#4B69C6">end</span><span style="color:black"><o:p></o:p></span></p>
</div>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black">When I use use_req_send(), I use the following sql statement to query location</span><span style="color:black"><o:p></o:p></span></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;line-height:16.5pt;background:whitesmoke">
<b><span style="font-size:12.0pt;font-family:Consolas;color:#AA3731">string.format</span></b><span style="font-size:12.0pt;font-family:Consolas;color:#333333">(</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">"</span><span style="font-size:12.0pt;font-family:Consolas;color:#448C27">select
 * from location where username='%s'</span><span style="font-size:12.0pt;font-family:Consolas;color:#777777">"</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">,
</span><span style="font-size:12.0pt;font-family:Consolas;color:#7A3E9D">reciever</span><span style="font-size:12.0pt;font-family:Consolas;color:#333333">)</span><span style="color:black"><o:p></o:p></span></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black">I think because the query sql is executed before the execution of unregister_ruid completes, the location of user A can still
 be queried.</span><span style="color:black"><o:p></o:p></span></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black">If unregister_ruid and reg_fetch_contacts are multi-process safe. I use reg_fetch_contacts query location to avoid this problem. Is
 that so?</span><span style="color:black"><o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black">thanks very much</span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<div class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black">
<hr size="1" width="210" style="width:157.5pt" noshade="" style="color:#A0A0A0" align="left">
</span></div>
</div>
<div>
<div style="margin-left:7.5pt;margin-top:7.5pt;margin-right:7.5pt;margin-bottom:7.5pt">
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><a href="mailto:riffs@sina.cn">riffs@sina.cn</a></span><span style="color:black"><o:p></o:p></span></p>
</div>
</div>
</div>
<blockquote style="margin-left:6.0pt;margin-right:inherit">
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><span style="font-size:10.5pt;font-family:"Microsoft YaHei UI",sans-serif;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
</div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;background:#EFEFEF"><b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black">From:</span></b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black"> <a href="mailto:hw@gilawa.com">Henning
 Westerholt</a></span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;background:#EFEFEF"><b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black">Date:</span></b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black"> 2022-11-30 18:18</span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;background:#EFEFEF"><b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black">To:</span></b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black"> <a href="mailto:sr-users@lists.kamailio.org">Kamailio
 (SER) - Users Mailing List</a></span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;background:#EFEFEF"><b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black">CC:</span></b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black"> <a href="mailto:riffs@sina.cn"><span style="font-family:"Microsoft YaHei UI",sans-serif">刘建峰</span></a></span><span style="color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;background:#EFEFEF"><b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black">Subject:</span></b><span style="font-size:9.0pt;font-family:"Tahoma",sans-serif;color:black"> RE: [SR-Users] uac_req_send()
 multi-process synchronization problem</span><span style="color:black"><o:p></o:p></span></p>
</div>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;text-align:justify"><span style="color:black;mso-fareast-language:EN-US">Hello,</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-align:justify"><span style="color:black;mso-fareast-language:EN-US"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-align:justify"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US">not sure if I fully understand the problem. But regarding another user is registered with the same IP address as a previous
 user, there are several mitigations.</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-align:justify"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-align:justify"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US">To give two options: you could choose a really short re-registration time, you could use TCP and when you lose the connection
 you delete the contact.</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-align:justify"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-align:justify"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US">Cheers,</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-align:justify"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-align:justify"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US">Henning</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-align:justify"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US"> </span><span style="color:black"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt;text-align:justify"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US">--
</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-align:justify"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US">Henning Westerholt –
</span><span style="color:black;mso-fareast-language:EN-US"><a href="https://skalatan.de/blog/"><span lang="EN-GB" style="color:#0563C1">https://skalatan.de/blog/</span></a></span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-align:justify"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US">Kamailio services –
</span><span style="color:black;mso-fareast-language:EN-US"><a href="https://gilawa.com/"><span lang="EN-GB" style="color:#0563C1">https://gilawa.com</span></a></span><span style="color:black"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="margin-left:35.4pt;text-align:justify"><span lang="EN-GB" style="color:black;mso-fareast-language:EN-US"> </span><span style="color:black"><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" style="margin-left:35.4pt;text-align:justify"><b><span style="color:black">From:</span></b><span style="color:black"> sr-users <<a href="mailto:sr-users-bounces@lists.kamailio.org">sr-users-bounces@lists.kamailio.org</a>>
<b>On Behalf Of </b>???<br>
<b>Sent:</b> Wednesday, November 30, 2022 2:57 AM<br>
<b>To:</b> <a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br>
<b>Subject:</b> [SR-Users] uac_req_send() multi-process synchronization problem<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:35.4pt;text-align:justify"><span style="font-size:10.5pt;font-family:DengXian;color:black"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-align:justify"><span lang="EN-US" style="font-size:10.5pt;font-family:DengXian;color:black;mso-fareast-language:ZH-CN">When I use uac_req_send() to send a MESSAGE to the client. Will the following occur? The
 result of the message sent to user A is that B has received it. From the logs, the address of user A in the location table is the same as the IP address and port of user B, and the information of user A in the location table is not deleted in time. I took
 the address of user A directly from the location table without using KSR.registrar.reg_fetch_contacts(). If I use KSR.registrar.reg_fetch_contacts() can this be avoided. This is a multi-process synchronization problem, after user A registers, the IP port information
 in the address is 172.16.22.222:12345, and then user A disconnects the link because of some abnormal conditions, but it is not normal to cancel the registration, the socket link has failed, but it has not had time to delete the location, at this time user
 B registers, whether will it get the same IP port information as user A 172.16.22.222 : 12345, if possible? User A's location still exists, Using KSR.registrar.reg_fetch_contacts() TO query user A's location, and then using uac_req_send() to send a message
 to user A, User B will receive the MESSAGE. Whether this problem occurs?</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-align:justify"><span lang="EN-US" style="font-size:10.5pt;font-family:DengXian;color:black;mso-fareast-language:ZH-CN"> </span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-align:justify"><span lang="ZH-CN" style="font-size:10.5pt;font-family:DengXian;color:black;mso-fareast-language:ZH-CN">从</span><span lang="EN-US" style="font-size:10.5pt;font-family:DengXian;color:black;mso-fareast-language:ZH-CN">
 Windows </span><span lang="ZH-CN" style="font-size:10.5pt;font-family:DengXian;color:black;mso-fareast-language:ZH-CN">版</span><span lang="EN-US" style="font-size:10.5pt;font-family:DengXian;color:black;mso-fareast-language:ZH-CN"><a href="https://go.microsoft.com/fwlink/?LinkId=550986"><span lang="ZH-CN">邮件</span></a></span><span lang="ZH-CN" style="font-size:10.5pt;font-family:DengXian;color:black;mso-fareast-language:ZH-CN">发送</span><span style="color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-align:justify"><span lang="EN-US" style="font-size:12.0pt;font-family:SimSun;color:black;mso-fareast-language:ZH-CN"> </span><span style="color:black"><o:p></o:p></span></p>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
</body>
</html>