<html 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=gb2312">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@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:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:DengXian;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
/* Page Definitions */
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="ZH-CN" link="blue" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">How can I receive this letter ?  </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:12.0pt"><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"> Windows 10 </span>版<span lang="EN-US"><a href="https://go.microsoft.com/fwlink/?LinkId=550986"><span lang="EN-US"><span lang="EN-US">邮件</span></span></a></span>应用</p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:12.0pt;font-family:SimSun"><o:p> </o:p></span></p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>发件人:</b> sr-docs <sr-docs-bounces@lists.kamailio.org> 代表 Ahmed Marsou <amarsou1988@gmail.com><br>
<b>发送时间:</b> Saturday, May 23, 2020 9:43:25 AM<br>
<b>收件人:</b> sr-docs@lists.kamailio.org <sr-docs@lists.kamailio.org><br>
<b>主题:</b> [SR-Docs] reg_fetch_contacts ipv6 received parameter empty</font>
<div> </div>
</div>
<div>
<div dir="ltr">Hi guys;
<div>Im using "REGISTRAR MODULE" to control the users login by device. </div>
<div>        </div>
<div>if (af==INET6){<br>
            reg_fetch_contacts("location", "$fu", "existingContact");<br>
            xlog("L_INFO","****************$si******************************");<br>
            xlog("L_INFO","****************$(hdr(Call-ID){s.substr,0,4})******************************");<br>
            if ( $(ulc(existingContact=>user_agent)[0]) =~ "SPI/v") && ($(hdr(Call-ID){s.substr,0,4}) != "TTCN") {<br>
                    $var(oldDeviceId) = $(ulc(existingContact=>callid)[0]{s.substr,9,0});<br>
                    $var(newDeviceId) = $(hdr(Call-ID){s.substr,9,0});<br>
                    if($var(oldDeviceId) !=  $var(newDeviceId) ){<br>
                            xlog("L_INFO","New device id is different:warn previous user another user overide him");<br>
                            $var(address) = $(ulc(existingContact=>received){s.substr,9,0});<br>
                            $var(ruri) = $(var(address){s.substr,4,0});<br>
                         #$var(ruri) = "[" + $var(address)+ "]" + ":" + $sp + ";" + "transport" + "=" + $proto;<br>
                         #Send a SIP Request signalling the problem and its reason on the body<br>
                            xlog("L_INFO","****************** $var(address)***************************");<br>
                            $uac_req(method)="MESSAGE";<br>
                            $uac_req(ruri) = "sip:"+ $au + "@" + $var(ruri);<br>
                            $uac_req(furi) = "sip:kamailio@sip_domain";<br>
                            $uac_req(turi) = $fu;<br>
                            $uac_req(hdrs)="Max-Forwards: 70\r\nEvent: reg\r\nContent-Type: text/plain\r\nAccept-Contact:*;+g.ext.app.registration\r\n";<br>
                            $uac_req(body)="Already registered with another device id";<br>
                            uac_req_send();<br>
                        }<br>
            }<br>
</div>
<div>So as you can see Im trynig to get the variable  $var(address) from  reg_fetch_contacts but is working for ipv4 unfortunatly not for ipv6. For ipv6 it give me '0'.</div>
<div>Somthing is happening related to "[" "]". </div>
<div>How can I solve this problem?</div>
<div>Thank you.</div>
<div><br>
</div>
<div>OS: Centos 7</div>
<div>KAMILIO: version: kamailio 4.4.7 (x86_64/linux) 35d8ab</div>
<br>
</div>
</div>
</body>
</html>