Not exactly an answer to your specific question, but it might help solve your problem in a different way...
If you using the registrar module with save()... you might be able to take advantage in some way of the flags 0x04: https://kamailio.org/docs/modules/5.3.x/modules/registrar.html#registrar.f.save *"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)."* 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. Sorry if this isn't very helpful, I'm guessing a little based on the info you provided :) Cheers, Joel. On Tue, Jun 2, 2020 at 4:46 PM Ahmed Marsou <[email protected]> wrote: > Hi; > I'm using the received parameter to send a MESSAGE to unregsiter the first > user that is registered to register the second one. > Using: > *modparam("usrloc", "received_column"* > > *modparam("registrar|nathelper", "received_avp",* > > and when I do a: > select received from location; > as you can see is null. > +----------+ > | received | > +----------+ > | NULL | > +----------+ > > In IPV4 is working fine, but in IPV6 is not. Can you tell me how can I get > this value? > Im going crazy with that. > > reg_fetch_contacts("location", "$fu", "existingContact"); > if( $(ulc(existingContact=>user_agent)[0]) =~ "SPI/v"){ > $var(oldDeviceId) = > $(ulc(existingContact=>callid)[0]{s.substr,9,0}); > $var(newDeviceId) = $(hdr(Call-ID){s.substr,9,0}); > if($var(oldDeviceId) != $var(newDeviceId) ){ > xlog("L_INFO","New device id is > different:warn previous user another user overide him"); > $var(address) = $(ulc(existingContact=> > *received*)[0]); > $var(ruri) = $(var(address){s.substr,4,0}); > #Send a SIP Request signalling the problem > and its reason on the body > $uac_req(method)="MESSAGE"; > $uac_req(ruri) = "sip:"+ $au + "@" + > $var(ruri); > $uac_req(furi) = "sip:kamailio@sip_domain > "; > $uac_req(turi) = $fu; > $uac_req(hdrs)="Max-Forwards: 70\r\nEvent: > reg\r\nContent-Type: > text/plain\r\nAccept-Contact:*;+g.ext.app.registration\r\n"; > $uac_req(body)="Already registered with > another device id"; > uac_req_send(); > drop; > } > } > > > Thank you. > > > _______________________________________________ > Kamailio (SER) - Users Mailing List > [email protected] > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users >
_______________________________________________ Kamailio (SER) - Users Mailing List [email protected] https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
