]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
automerge commit
authorAutomerge Script <automerge@asterisk.org>
Fri, 6 Jul 2007 16:27:34 +0000 (16:27 +0000)
committerAutomerge Script <automerge@asterisk.org>
Fri, 6 Jul 2007 16:27:34 +0000 (16:27 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@73725 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_agent.c
channels/chan_sip.c
res/res_config_odbc.c

index 9084cb09a3c16f05bf7c7af8b3cb7838006ba57e..8f35081e20526f5d91655e579e2aa3e9d022f79a 100644 (file)
@@ -1340,7 +1340,7 @@ static struct ast_channel *agent_request(const char *type, int format, void *dat
 #if 0
                                ast_log(LOG_NOTICE, "Time now: %ld, Time of lastdisc: %ld\n", tv.tv_sec, p->lastdisc.tv_sec);
 #endif
-                               if (!p->lastdisc.tv_sec || (tv.tv_sec > p->lastdisc.tv_sec)) {
+                               if (!p->lastdisc.tv_sec || (tv.tv_sec >= p->lastdisc.tv_sec)) {
                                        p->lastdisc = ast_tv(0, 0);
                                        /* Agent must be registered, but not have any active call, and not be in a waiting state */
                                        if (!p->owner && p->chan) {
index c39339c9143878946c38ecf915b32b8504fcbc2b..7e8fdaf01d0e5029b11dc86c70ac854b983e9ea2 100644 (file)
@@ -11782,8 +11782,12 @@ static void *do_monitor(void *data)
                        sip_do_reload();
 
                        /* Change the I/O fd of our UDP socket */
-                       if (sipsock > -1)
-                               sipsock_read_id = ast_io_change(io, sipsock_read_id, sipsock, NULL, 0, NULL);
+                       if (sipsock > -1) {
+                               if (sipsock_read_id)
+                                       sipsock_read_id = ast_io_change(io, sipsock_read_id, sipsock, NULL, 0, NULL);
+                               else
+                                       sipsock_read_id = ast_io_add(io, sipsock, sipsock_read, AST_IO_IN, NULL);
+                       }
                }
                /* Check for interfaces needing to be killed */
                ast_mutex_lock(&iflock);
index ec8e2be7bc4c018498cae1b7fbd0a1eeef9b2786..dbe37c289b0b75c2b1fca52b6b6e151e7c684575 100644 (file)
@@ -103,6 +103,8 @@ static struct ast_variable *realtime_odbc(const char *database, const char *tabl
                newval = va_arg(aq, const char *);
        }
        va_end(aq);
+       snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " ESCAPE '\\'");
+
        res = SQLPrepare(stmt, (unsigned char *)sql, SQL_NTS);
        if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
                ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
@@ -249,6 +251,8 @@ static struct ast_config *realtime_multi_odbc(const char *database, const char *
        if (initfield)
                snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " ORDER BY %s", initfield);
        va_end(aq);
+       snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " ESCAPE '\\'");
+
        res = SQLPrepare(stmt, (unsigned char *)sql, SQL_NTS);
        if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
                ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);