summaryrefslogtreecommitdiff
path: root/res/res_odbc.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2006-08-20 15:46:00 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2006-08-20 15:46:00 +0000
commit6fec8117438f74575c6f65a001d74bbe9902d9dd (patch)
tree32a9b9dea1526b15b83d880e9a790570edc01a72 /res/res_odbc.c
parent2dc0692e86f062e86fd3a44a450a4d68d60ce5d4 (diff)
Convert func_odbc to use the prepare_and_execute callback, which helps with a database reconnection issue (bug 7693)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40632 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_odbc.c')
-rw-r--r--res/res_odbc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/res/res_odbc.c b/res/res_odbc.c
index c2df9b0e3..b597b2339 100644
--- a/res/res_odbc.c
+++ b/res/res_odbc.c
@@ -120,6 +120,10 @@ SQLHSTMT odbc_prepare_and_execute(struct odbc_obj *obj, SQLHSTMT (*prepare_cb)(s
continue;
}
break;
+ } else {
+ ast_log(LOG_WARNING, "SQL Prepare failed. Attempting a reconnect...\n");
+ odbc_obj_disconnect(obj);
+ odbc_obj_connect(obj);
}
}