]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix ODBC issue
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 11 Apr 2008 17:07:06 +0000 (17:07 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 11 Apr 2008 17:07:06 +0000 (17:07 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8088 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia_presence.c

index aba7d5523668e347f8096fd93cbf0497a6bf5eaa..edd62b6e3187bad2b75c92ac15e742e777af754b 100644 (file)
@@ -469,12 +469,25 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
                                                                                        sofia_presence_sub_callback,
                                                                                        &helper);
                        
-                       if (switch_strlen_zero((char *)helper.stream.data)) {
-                               switch_safe_free(helper.stream.data);
-                       } else {
-                               char *ssql = (char *)helper.stream.data;
-                               sofia_glue_execute_sql(profile, &ssql, SWITCH_TRUE);
+                       if (!switch_strlen_zero((char *)helper.stream.data)) {
+                               char *this = (char *)helper.stream.data;
+                               char *next = NULL;
+                               
+                               do {
+                                       if ((next = strchr(this, ';'))) {
+                                               *next++ = '\0';
+                                               while(*next == '\n' || *next == ' ' || *next == '\r') {
+                                                       *next++ = '\0';
+                                               }
+                                       }
+
+                                       if (!switch_strlen_zero(this)) {
+                                               sofia_glue_execute_sql(profile, &this, SWITCH_FALSE);
+                                       }
+                                       this = next;
+                               } while (this);
                        }
+                       switch_safe_free(helper.stream.data);
                        helper.stream.data = NULL;
                }
        }