[Freeswitch-svn] [commit] r8088 - freeswitch/trunk/src/mod/endpoints/mod_sofia
Freeswitch SVN
anthm at freeswitch.org
Fri Apr 11 13:07:07 EDT 2008
Author: anthm
Date: Fri Apr 11 13:07:06 2008
New Revision: 8088
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c
Log:
fix ODBC issue
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c Fri Apr 11 13:07:06 2008
@@ -469,12 +469,25 @@
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;
}
}
More information about the Freeswitch-svn
mailing list