<div dir="ltr"><div><div dir="auto">Not exactly an answer to your specific question, but it might help solve your problem in a different way... </div><div dir="auto"><br></div><div dir="auto">If you using the registrar module with save()... you might be able to take advantage in some way of the flags 0x04:</div></div><div><br></div><div><a href="https://kamailio.org/docs/modules/5.3.x/modules/registrar.html#registrar.f.save">https://kamailio.org/docs/modules/5.3.x/modules/registrar.html#registrar.f.save</a><br></div><div><br></div><div><i>"0x04 - store and maintain one contact per AoR. If there are other contact addresses for AoR not matching current registration, remove them. This mode ensures one contact per AoR (user)."<br></i><br></div><div><br></div><div>Regarding "received", I would think that you have it on IPV4 because the UA is probably behind NAT, and you are adding it in config script, with IPv6, there is no NAT, and --most likely-- you are not adding it, thus it's not saved to the database. Check if you are using fix_nated_register() somewhere in your config file.. For IPv6 it might be easier if you just pull the IP from the Contact info.</div><div><br></div><div><br></div><div>Sorry if this isn't very helpful, I'm guessing a little based on the info you provided :)</div><div><br></div><div>Cheers, </div><div>Joel.</div><div><br></div><div><br></div></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 2, 2020 at 4:46 PM Ahmed Marsou <<a href="mailto:amarsou1988@gmail.com" target="_blank">amarsou1988@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi;<div>I'm using the received parameter to send a MESSAGE to unregsiter the first user that is registered to register the second one.</div><div>Using: </div><div><b>modparam("usrloc", "received_column"</b></div><div><b>modparam("registrar|nathelper", "received_avp",<br></b></div><div><b><br></b></div><div>and when I do a:</div><div>select received from location;<br></div><div>as you can see is null.</div><div>+----------+<br>| received |<br>+----------+<br>| NULL     |<br>+----------+<br></div><div><br></div><div>In IPV4 is working fine, but in IPV6 is not. Can you tell me how can I get this value?</div><div>Im going crazy with that.</div><div><br></div><div>                reg_fetch_contacts("location", "$fu", "existingContact");<br>                if( $(ulc(existingContact=>user_agent)[0]) =~ "SPI/v"){<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=><b>received</b>)[0]);<br>                                $var(ruri) = $(var(address){s.substr,4,0});<br>                                #Send a SIP Request signalling the problem and its reason on the body<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>                                drop;<br>                                }<br>                        }<br></div><div><br></div><div><br></div><div>Thank you.</div><div><br></div><div><br></div></div>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div></div>