Module: sip-router
Branch: master
Commit: 1fd2b4ec865cbe738d92e72259fed27380d252ab
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1fd2b4e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Jan 23 00:45:17 2013 +0100
kamctl: added option to creat uid-related tables
- few more options to be able to create database only, grant or revoke
privileges from command line
- the extensions were added for mysql
---
utils/kamctl/kamdbctl | 46 +++++++++
utils/kamctl/kamdbctl.base | 33 +++++--
utils/kamctl/kamdbctl.mysql | 230 +++++++++++++++++++++++++++----------------
3 files changed, 215 insertions(+), 94 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=1fd…
Module: sip-router
Branch: master
Commit: 71d1f9b233559e12970019819323cdfb9427b836
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=71d1f9b…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue Jan 22 23:09:47 2013 +0100
kamctl: cleaned db creation
---
utils/kamctl/kamdbctl.mysql | 89 +++++++++++++++++++++++++++++-------------
1 files changed, 61 insertions(+), 28 deletions(-)
diff --git a/utils/kamctl/kamdbctl.mysql b/utils/kamctl/kamdbctl.mysql
index 5f66337..818f8ab 100644
--- a/utils/kamctl/kamdbctl.mysql
+++ b/utils/kamctl/kamdbctl.mysql
@@ -84,18 +84,18 @@ sql_query()
kamailio_drop() # pars: <database name>
{
-if [ $# -ne 1 ] ; then
- merr "kamailio_drop function takes two params"
- exit 1
-fi
+ if [ $# -ne 1 ] ; then
+ merr "kamailio_drop function takes two params"
+ exit 1
+ fi
-sql_query "" "drop database $1;"
+ sql_query "" "DROP DATABASE $1;"
-if [ $? -ne 0 ] ; then
- merr "Dropping database $1 failed!"
- exit 1
-fi
-minfo "Database $1 deleted"
+ if [ $? -ne 0 ] ; then
+ merr "Dropping database $1 failed!"
+ exit 1
+ fi
+ minfo "Database $1 deleted"
}
@@ -123,33 +123,66 @@ db_charset_test()
CHARSET=$CURRCHARSET
}
-
-kamailio_create () # pars: <database name>
+kamailio_db_create () # pars: <database name>
{
-if [ $# -ne 1 ] ; then
- merr "kamailio_create function takes one param"
- exit 1
-fi
+ if [ $# -ne 1 ] ; then
+ merr "kamailio_db_create function takes one param"
+ exit 1
+ fi
-minfo "test server charset"
+ minfo "test server charset"
-db_charset_test
+ db_charset_test
-minfo "creating database $1 ..."
+ minfo "creating database $1 ..."
-# Users: kamailio is the regular user, kamailioro only for reading
-sql_query "" "create database $1 character set $CHARSET;
- GRANT ALL PRIVILEGES ON $1.* TO '$DBRWUSER' IDENTIFIED BY '$DBRWPW';
- GRANT ALL PRIVILEGES ON $1.* TO '${DBRWUSER}'@'$DBHOST' IDENTIFIED BY '$DBRWPW';
- GRANT SELECT ON $1.* TO '$DBROUSER' IDENTIFIED BY '$DBROPW';
- GRANT SELECT ON $1.* TO '${DBROUSER}'@'$DBHOST' IDENTIFIED BY '$DBROPW';"
+ sql_query "" "CREATE DATACASE $1 CHARACTER SET $CHARSET;"
+ if [ $? -ne 0 ] ; then
+ merr "Creating database $1 failed!"
+ exit 1
+ fi
+}
-if [ $? -ne 0 ] ; then
- merr "Creating core database and grant privileges failed!"
+kamailio_db_grant () # pars: <database name>
+{
+ if [ $# -ne 1 ] ; then
+ merr "kamailio_db_grant function takes one param"
+ exit 1
+ fi
+
+ minfo "granting privileges to database $1 ..."
+
+ # Users: kamailio is the regular user, kamailioro only for reading
+ sql_query "" "GRANT ALL PRIVILEGES ON $1.* TO '${DBRWUSER}'@'$DBHOST' IDENTIFIED BY '$DBRWPW';
+ GRANT SELECT ON $1.* TO '${DBROUSER}'@'$DBHOST' IDENTIFIED BY '$DBROPW';"
+
+ if [ $? -ne 0 ] ; then
+ merr "granting privileges to database $1 failed!"
+ exit 1
+ fi
+
+ if [ "$DBHOST" != "localhost" ] ; then
+ sql_query "" "GRANT ALL PRIVILEGES ON $1.* TO '$DBRWUSER'@'localhost' IDENTIFIED BY '$DBRWPW';
+ GRANT SELECT ON $1.* TO '$DBROUSER'@'localhost' IDENTIFIED BY '$DBROPW';"
+ if [ $? -ne 0 ] ; then
+ merr "granting localhost privileges to database $1 failed!"
+ exit 1
+ fi
+ fi
+}
+
+kamailio_create () # pars: <database name>
+{
+if [ $# -ne 1 ] ; then
+ merr "kamailio_create function takes one param"
exit 1
fi
+kamailio_db_create $1
+
+kamailio_db_grant $1
+
for TABLE in $STANDARD_MODULES; do
mdbg "Creating core table: $TABLE"
sql_query $1 < $DB_SCHEMA/$TABLE-create.sql
@@ -224,7 +257,7 @@ for TABLE in $EXTRA_MODULES; do
mdbg "Creating extra table: $TABLE"
sql_query $1 < $DB_SCHEMA/$TABLE-create.sql
if [ $? -ne 0 ] ; then
- merr "Creating extra tables failed!"
+ merr "Creating extra tables failed at $TABLE!"
exit 1
fi
done
Hi,
I am using kamailio dev version and find some issue with websocket and it
is happening once in a day.
Jan 2 10:26:56 kamailio-registrar
/usr/local/kamailio/sbin/kamailio[1175]: ERROR: websocket
[ws_conn.c:321]: getting TCP/TLS connection
Jan 2 10:26:56 kamailio-registrar
/usr/local/kamailio/sbin/kamailio[1175]: WARNING: websocket
[ws_frame.c:785]: forcibly closing connection
logs are spammed with that until we restart, looks like an infinite
loop somewhere in the websocket code .
I checked with tcpdump and didnt see any traffic on TCP port 5065 or
5060 coming .
Could you please help me with this?
Thanks
Ram
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#265 - dlg.profile_list is unable to handle numeric values properly
User who did this - Marco Marzetti (evan)
----------
Ops!
I'm sorry. It's my fault!
It works like a charm
Thank You
----------
More information can be found at the following URL:
https://sip-router.org/tracker/index.php?do=details&task_id=265#comment769
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#265 - dlg.profile_list is unable to handle numeric values properly
User who did this - Daniel-Constantin Mierla (miconda)
----------
Found the answer in 'sercmd -h' -- I knew there was a way to tell that number parameters should be taken as string:
<code>
cmd:
method [arg1 [arg2...]]
arg:
string or number; to force a number to be interpreted as string
prefix it by "s:", e.g. s:1
</code>
So instead of quotes use s: prefix.
----------
More information can be found at the following URL:
https://sip-router.org/tracker/index.php?do=details&task_id=265#comment768
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.