[Devel] dbtext script (dbtext related patches included)
Bogdan-Andrei Iancu
bogdan at voice-system.ro
Wed Feb 7 16:55:49 CET 2007
Hi Herman,
thanks for the patches - I will apply them into the devel tree.
regards,
bogdan
Herman Sheremetyev wrote:
> openserctl fifo already works fine with dbtext as long as you define
> fifo_db_url="dbtext:///path/to/db". It complains about not being able
> to use the DBENGINE because it's hardcoded to only work with mysql and
> pgsql but that doesn't affect its actual operation, and would be easy
> enough to fix.
>
> Speaking of dbtext, I had to patch permissions and domain modules to
> actually work properly with dbtext tables. dbtext column types return
> as DB_STR and those modules insist on DB_STRING. My patches aren't
> pretty but I'm attaching in case someone will find it useful or wants
> to include in the main branch.
>
> -Herman
>
>
> ---------- Forwarded message ----------
> From: Ovidiu Sas <sip.nslu at gmail.com>
> Date: Feb 1, 2007 11:40 AM
> Subject: dbtext script
> To: users at openser.org
>
>
> Hi,
>
>
> Since dbtext is part of the standard, my suggestion would be to
> ship/install the sc.dbtext script along with the openserctl script.
>
> We can install it as openser_dbtext_ctl and in openserctl we can make
> a reference to it if no DBENGINE is provided:
>
> see the following patch for openserct (openser-v1.1.1):
> diff -Naurp sip-server/scripts/openserctl openser/scripts/openserctl
> --- sip-server/scripts/openserctl 2006-09-15 08:41:42.000000000
> -0400
> +++ openser/scripts/openserctl 2007-01-17 09:39:09.000000000 -0500
> @@ -126,6 +126,8 @@ do
> $f
> done
> echo
> + echo "Note: Use openser_dbtext_ctl for DBTEXT operations!"
> + echo
>
> }
>
>
>
> Regards,
> Ovidiu Sas
> ------------------------------------------------------------------------
>
> --- openser-1.1.0-0/modules/domain/domain.c 2006-07-05 04:27:10.000000000 -0400
> +++ openser-1.1.0-0/modules/domain/domain2.c 2007-02-01 19:38:44.000000000 -0500
> @@ -289,8 +289,8 @@
>
> for (i = 0; i < RES_ROW_N(res); i++) {
> val = ROW_VALUES(row + i);
> - if ((ROW_N(row) == 1) && (VAL_TYPE(val) == DB_STRING)) {
> -
> + if ((ROW_N(row) == 1) &&
> + ((VAL_TYPE(val) == DB_STRING) || VAL_TYPE(val) == DB_STR)) {
> DBG("Value: %s inserted into domain hash table\n",VAL_STRING(val));
>
> if (hash_table_install(new_hash_table,(char*)VAL_STRING(val))==-1){
>
> ------------------------------------------------------------------------
>
> --- openser-1.1.0-0/modules/permissions/trusted.c 2007-02-01 19:11:00.000000000 -0500
> +++ openser-1.1.0-0/modules/permissions/trusted2.c 2007-02-01 19:10:53.000000000 -0500
> @@ -434,12 +434,16 @@
> for (i = 0; i < RES_ROW_N(res); i++) {
> val = ROW_VALUES(row + i);
> if ((ROW_N(row + i) == 4) &&
> - (VAL_TYPE(val) == DB_STRING) && !VAL_NULL(val) &&
> - (VAL_TYPE(val + 1) == DB_STRING) && !VAL_NULL(val + 1) &&
> + ((VAL_TYPE(val) == DB_STRING) || VAL_TYPE(val) == DB_STR) &&
> + !VAL_NULL(val) &&
> + ((VAL_TYPE(val + 1) == DB_STRING) ||
> + VAL_TYPE(val+1) == DB_STR) && !VAL_NULL(val + 1) &&
> (VAL_NULL(val + 2) ||
> - ((VAL_TYPE(val + 2) == DB_STRING) && !VAL_NULL(val + 2))) &&
> + ((VAL_TYPE(val + 2) == DB_STRING) ||
> + VAL_TYPE(val + 2) == DB_STR) && !VAL_NULL(val + 2)) &&
> (VAL_NULL(val + 3) ||
> - ((VAL_TYPE(val + 3) == DB_STRING) && !VAL_NULL(val + 3)))) {
> + ((VAL_TYPE(val + 3) == DB_STRING) ||
> + VAL_TYPE(val + 3) == DB_STR) && !VAL_NULL(val + 3))) {
> if (VAL_NULL(val + 2)) {
> pattern = 0;
> } else {
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Devel mailing list
> Devel at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/devel
>
More information about the Devel
mailing list