<div dir="ltr">If you make a function call to auth_db, then you create an unnecessary dependency on that module.<div>Copying code is not good.</div><div>The right solution here would be to create a library that will hold common code for both auth_db and auth_jwt.  The library will be automatically loaded by both modules.</div><div><br></div><div>Take a look at the db_* modules that are using srdb1 and srdb2 libraries.</div><div><br></div><div>Regards,</div><div>Ovidiu Sas</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 22, 2015 at 11:11 AM, mading087 <span dir="ltr"><<a href="mailto:notifications@github.com" target="_blank">notifications@github.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p>Started creating a new module auth_jwt, which supports JSON Web Token for auth. Need to access the database to validate some claims in the token. Wonder if I should just make a function call to auth_db or copy the code from auth_db? Which approach is a better approach? Thanks.</p>

<p style="font-size:small;color:#666">—<br>Reply to this email directly or <a href="https://github.com/kamailio/kamailio/issues/50" target="_blank">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZW3mCXyLAO_Fy1pbQZpLr0xIxUJ4ks5nkRiVgaJpZM4DV3fr.gif" width="1"></p>
<div>
  <div>
    
    
  </div>
  
</div>
<br>_______________________________________________<br>
sr-dev mailing list<br>
<a href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">VoIP Embedded, Inc.<br><a href="http://www.voipembedded.com" target="_blank">http://www.voipembedded.com</a></div>
</div>