From: Automerge Script Date: Fri, 6 Jul 2007 16:27:34 +0000 (+0000) Subject: automerge commit X-Git-Tag: 1.2.21-netsec~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff0b4e97a180dd288e4e7ed60b38f80a18fe2e55;p=thirdparty%2Fasterisk.git automerge commit git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@73725 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_agent.c b/channels/chan_agent.c index 9084cb09a3..8f35081e20 100644 --- a/channels/chan_agent.c +++ b/channels/chan_agent.c @@ -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) { diff --git a/channels/chan_sip.c b/channels/chan_sip.c index c39339c914..7e8fdaf01d 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -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); diff --git a/res/res_config_odbc.c b/res/res_config_odbc.c index ec8e2be7bc..dbe37c289b 100644 --- a/res/res_config_odbc.c +++ b/res/res_config_odbc.c @@ -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);