if ((sub_state != nua_substate_terminated)) {
sql = switch_mprintf("select count(*) from sip_subscriptions where call_id='%q'", call_id);
sofia_glue_execute_sql2str(profile, profile->ireg_mutex, sql, buf, sizeof(buf));
- switch_safe_free(sql);
+
if (mod_sofia_globals.debug_presence > 0 || mod_sofia_globals.debug_sla > 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
"check subs sql: %s [%s]\n", sql, buf);
}
+ switch_safe_free(sql);
+
if ((subbed = atoi(buf)) > 0) {
sub_state = nua_substate_active;
}