]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
pdd and FSCORE-127
authorBrian West <brian@freeswitch.org>
Sat, 24 May 2008 02:03:16 +0000 (02:03 +0000)
committerBrian West <brian@freeswitch.org>
Sat, 24 May 2008 02:03:16 +0000 (02:03 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8571 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_channel.c
src/switch_odbc.c

index 32d3c2f0aa3a83f453ff9a80e2aee4ff7ffd19b2..3f48707d17c530f20506aa33c153534f53e1b64d 100644 (file)
@@ -1372,15 +1372,14 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_ring_ready(switch_ch
        if (!switch_channel_test_flag(channel, CF_RING_READY)) {
                switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_NOTICE, "Ring-Ready %s!\n", channel->name);
                switch_channel_set_flag(channel, CF_RING_READY);
+               if (channel->caller_profile && channel->caller_profile->times) {
+                       switch_mutex_lock(channel->profile_mutex);
+                       channel->caller_profile->times->progress = switch_timestamp_now();
+                       switch_mutex_unlock(channel->profile_mutex);
+               }
                return SWITCH_STATUS_SUCCESS;
        }
 
-       if (channel->caller_profile && channel->caller_profile->times) {
-               switch_mutex_lock(channel->profile_mutex);
-               channel->caller_profile->times->progress = switch_timestamp_now();
-               switch_mutex_unlock(channel->profile_mutex);
-       }
-
        return SWITCH_STATUS_FALSE;
 }
 
index d8fad0ae95761fffdaa5a7fe1bf3c730d3f2f7e8..e2343d81394ffe60908c233adaaa039c03e93d6e 100644 (file)
@@ -144,8 +144,14 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_connect(switch_odbc_hand
 
        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connecting %s\n", handle->dsn);
        
-       result = SQLConnect(handle->con, (SQLCHAR *) handle->dsn, SQL_NTS, (SQLCHAR *) handle->username, SQL_NTS, (SQLCHAR *) handle->password, SQL_NTS);
-       
+       if(!strstr(handle->dsn, "DRIVER")) { 
+               result = SQLConnect(handle->con, (SQLCHAR *) handle->dsn, SQL_NTS, (SQLCHAR *) handle->username, SQL_NTS, (SQLCHAR *) handle->password, SQL_NTS); 
+       } else { 
+               SQLCHAR outstr[1024] = {0}; 
+               SQLSMALLINT outstrlen = 0; 
+               result = SQLDriverConnect(handle->con, NULL, (SQLCHAR *) handle->dsn, strlen(handle->dsn), outstr, sizeof(outstr), &outstrlen, SQL_DRIVER_NOPROMPT); 
+       } 
+
        if ((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) {
                char *err_str;
                if ((err_str = switch_odbc_handle_get_error(handle, NULL))) {