diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-20 15:46:00 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-20 15:46:00 +0000 |
commit | 69a1a8ff24d519bce02d46ed06e9f11acf418b67 (patch) | |
tree | 32a9b9dea1526b15b83d880e9a790570edc01a72 /res/res_odbc.c | |
parent | 44f2800e29c0ddfe363063d3230f48d3dcf8ad59 (diff) |
Convert func_odbc to use the prepare_and_execute callback, which helps with a database reconnection issue (bug 7693)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40632 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_odbc.c')
-rw-r--r-- | res/res_odbc.c | 4 |
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); } } |