<p></p>
<p>Thanks!</p>
<p>Any reason not to use <code>src/core/utils/sruid.h</code> instead of <code>libuuid</code>? It is used to generate unique ids for register/location records and in other components. That will not add external dependency, making it easier to backport in stable branches.</p>
<p>The patch will stay pretty much the same with the exception of generating the uuid value.</p>
<p>In short, for mod_init(), should be:</p>
<pre><code>#include "../../core/utils/sruid.h"
...
sruid_t _puadi_sruid;
if(sruid_init(&_puadi_sruid, (char)'-', "padi", SRUID_INC)<0) {
   // error
   return -1;
}
</code></pre>
<p>Then for generation:</p>
<pre><code>extern sruid_t _puadi_sruid;
...
sruid_next_safe(&_puadi_sruid);

// uuid available in str _reginfo_sruid.uid;
</code></pre>
<p>I had in mind to extend the sruid in order to enable modules to register callbacks for generating uuid value, with the goal to do it from the exiting uuid module and make the libuuid-style-uuids available to the other modules without linking against libuuid.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/pull/2908#issuecomment-953891411">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZICQ75V4XUEC3P5HR3UJFSNJANCNFSM5G45DCSQ">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/ABO7UZMFMYJ7KJ67L5OTAY3UJFSNJA5CNFSM5G45DCS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHDNTUUY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/pull/2908#issuecomment-953891411",
"url": "https://github.com/kamailio/kamailio/pull/2908#issuecomment-953891411",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>