<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Sorted it.  I needed to loop through the contacts, then select the correct ruid based on $ci<div class=""><br class=""></div><div class="">For completeness, here is my solution:</div><div class=""><br class=""></div>reg_fetch_contacts("location", "$fu", "un_reg");<br class="">    $var(i) = 0;<br class="">    while ($var(i) < $(ulc(un_reg=>count))) {<br class="">        $var(ul_callid) = $(ulc(un_reg=>callid)[$var(i)]);<br class="">        $var(ul_ruid) = $(ulc(un_reg=>ruid)[$var(i)]);<br class="">        if ($var(ul_callid) == $ci) {<br class="">            xlog("L_INFO", "Unregistering contact $tu Ruid: $var(ul_ruid)\n");<br class="">            unregister("location", "$fu", "$var(ul_ruid)");<br class="">            $sht(regs=>$fU@$fd~$ci)=$null;<br class="">        }<br class="">        $var(i) = $var(i) + 1;<br class=""><div class="">    } <br class=""><div class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class="Apple-interchange-newline">- Charles </div><div class=""><br class=""></div></div><br class="Apple-interchange-newline" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class="Apple-interchange-newline">

</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On Feb 19, 2021, at 9:43 AM, Charles Phillips <<a href="mailto:charles@rustybike.com" class="">charles@rustybike.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Happy Friday!<br class=""><div class=""><br class=""></div><div class="">To clean up contacts that have sent requests to unregister (Expires: 0) I am executing the following after a 200 OK response from the upstream server:<div class=""><br class=""></div><div class="">    reg_fetch_contacts("location", "$fu", "un_reg");<br class="">    xlog("L_INFO", "Removing unregistered contact From: $si To: $tu Ruid: $ulc(un_reg=>ruid)\n");<br class="">    unregister("location", "$fu", "$ulc(un_reg=>ruid)”);</div><div class=""><br class=""></div><div class="">This produces the desired result when there is only one contact per AoR, but when multiple contacts are present, it seems to delete the first ruid (which makes sense as I am only providing the $fu).  </div><div class=""><br class=""></div><div class="">So, the question, can I select the contact by call-id or some other unique identifier specific to the desired contact that I can grab from the transaction?  Reading the reg_fetch_contact and unregister docs, they do not seem to provide for selection beyond uri.</div><div class=""><br class=""></div><div class=""><div class="">
<div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class="Apple-interchange-newline">- Charles</div><div class=""><br class=""></div></div><br class="Apple-interchange-newline" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class="Apple-interchange-newline">

</div>

<br class=""></div></div></div></div></blockquote></div><br class=""></div></body></html>