<p>I want to add a few columns to the <code>subscriber</code> table to simplify setting a few headers  I also use <code>is_subscriber</code> in <code>route[LOCATION]</code> to only save MESSAGEs (msilo) for subscribers</p>

<p>When using is_subscriber with <code>3</code> set for the flag, Kamailio should include the domain in the check and according to the auth_db documentation, "the credentials are not loaded in variables"</p>

<p>However, Kamailio still attempts to lookup and store the credentials configured with <code>modparam("auth_db", "load_credentials", "rpid")</code></p>

<pre><code>ERROR: *** cfgtrace:request_route=[LOCATION] c=[/etc/kamailio/kamailiocfg] l=1064 a=27 n=is_subscriber
DEBUG: auth_db [auth_db_modc:262]: w_is_subscriber(): uri [sip:86@examplecom] table [subscriber] flags [3]
DEBUG: db_postgres [km_valc:163]: db_postgres_val2str(): PQescapeStringConn: in: 2 chars, out: 2 chars
DEBUG: db_postgres [km_valc:163]: db_postgres_val2str(): PQescapeStringConn: in: 12 chars, out: 12 chars
DEBUG: db_postgres [km_dbasec:271]: db_postgres_submit_query(): sending query ok: 0x7fdf607ed268 (2) - [select rpid from subscriber where username='86' AND domain='examplecom']
DEBUG: <core> [db_resc:115]: db_new_result(): allocate 56 bytes for result set at 0x7fdf6089af20
DEBUG: db_postgres [km_dbasec:551]: db_postgres_store_result(): 0x7fdf607ed268 PQresultStatus(PGRES_TUPLES_OK) PQgetResult(0x2860ad0)
DEBUG: db_postgres [km_resc:108]: db_postgres_get_columns(): 1 columns returned from the query
DEBUG: <core> [db_resc:152]: db_allocate_columns(): allocate 8 bytes for result names at 0x7fdf60864270
DEBUG: <core> [db_resc:163]: db_allocate_columns(): allocate 4 bytes for result types at 0x7fdf6074ad38
DEBUG: db_postgres [km_resc:125]: db_postgres_get_columns(): allocate 16 bytes for RES_NAMES[0] at 0x7fdf60940270
DEBUG: db_postgres [km_resc:132]: db_postgres_get_columns(): RES_NAMES(0x7fdf60940270)[0]=[rpid]
DEBUG: db_postgres [km_resc:166]: db_postgres_get_columns(): use DB1_STRING result type
DEBUG: db_postgres [km_resc:211]: db_postgres_convert_rows(): no rows returned from the query
DEBUG: <core> [db_resc:79]: db_free_columns(): freeing 1 columns
DEBUG: <core> [db_resc:83]: db_free_columns(): freeing RES_NAMES[0] at 0x7fdf60940270
DEBUG: <core> [db_resc:92]: db_free_columns(): freeing result names at 0x7fdf60864270
DEBUG: <core> [db_resc:97]: db_free_columns(): freeing result types at 0x7fdf6074ad38
DEBUG: <core> [db_resc:134]: db_free_result(): freeing result set at 0x7fdf6089af20
DEBUG: db_postgres [km_dbasec:433]: db_postgres_free_query(): PQclear(0x2860ad0) result set
DEBUG: auth_db [authorizec:102]: fetch_credentials(): no result for user '86@examplecom' in [subscriber]
</code></pre>

<p>When adding additional parameters such as <code>modparam("auth_db", "load_credentials", "rpid;accountcode")</code> and executing <code>if(is_subscriber("$ru", "subscriber", "3"))</code>, Kamailio quits</p>

<pre><code>ERROR: *** cfgtrace:request_route=[LOCATION] c=[/etc/kamailio/kamailiocfg] l=1064 a=27 n=is_subscriber
: <core> [mem/q_mallocc:130]: qm_debug_frag(): BUG: qm_*: fragm 0x7f7126bafc70 (address 0x7f7126bafca0) end overwritten(7f7126ad32c0, abcdefed)!
CRITICAL: <core> [pass_fdc:275]: receive_fd(): EOF on 20
ALERT: <core> [mainc:727]: handle_sigs(): child process 21406 exited by a signal 6
</code></pre>

<p>I don't see why Kamailio should even lookup the additional values when the <code>is_subscriber</code> flag is <code>2</code> or <code>3</code></p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/kamailio/kamailio/issues/500">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36Zbi-HjNn917N9fr-6fBSdKu327b-ks5phovdgaJpZM4HU_Yr.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/500"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>