Bugs item #2901127, was opened at 2009-11-20 08:14
Message generated for change (Tracker Item Submitted) made by ttrask01
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=2901127&group_id=139143

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: ver 1.5.x
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Ted Trask (ttrask01)
Assigned to: Nobody/Anonymous (nobody)
Summary: Kamctl cannot add user to dbtext

Initial Comment:
Running kamailio 1.5.2 on alpine linux. Same problem applies to 1.5.3.

"kamctl add user password" fails with result:

email_address cannot be empty or null
\E[37;31mERROR: introducing the new user 'user' to the database failed

The kamctl script does not accept an email-address on the command line, showing 
usage (too many command-line parameters).

The problem is in the database definition. Here is the 'subscriber' definition 
for the various DB types:

scripts/db_berkeley/kamailio/subscriber:id(int) username(str) domain(str) 
password(str) email_address(str) ha1(str) ha1b(str) rpid(str)
scripts/postgres/auth_db-create.sql:    email_address VARCHAR(64) DEFAULT '' 
NOT NULL,
scripts/mysql/auth_db-create.sql:    email_address VARCHAR(64) DEFAULT '' NOT 
NULL,
scripts/oracle/auth_db-create.sql:    email_address VARCHAR2(64) DEFAULT '',
scripts/dbtext/kamailio/subscriber:id(int,auto) username(string) domain(string) 
password(string) email_address(string) ha1(string) ha1b(string) 
rpid(string,null)

Ok, all of the databases have the email_address column, most saying non-null 
and default to "". The problem comes because kamctl doesn't take a parameter 
for email_address and tries to set it to null. For postgres it works just fine, 
because there's a default defined. Not true for dbtext. It says non-null, but 
doesn't define a default.

Further, it appears the dbtext does not differentiate between "" and null. So, 
if we remove the non-null restriction, it will allow it to be set to null, 
which is actually "", which is what the default should be!

So, to make this as clear as mud, the one line in 
scripts/dbtext/kamailio/subscriber 
(/usr/share/kamailio/dbtext/kamailio/subscriber on my device) should be changed 
from:

id(int,auto) username(string) domain(string) password(string) 
email_address(string) ha1(string) ha1b(string) rpid(string,null)

to (adding the word 'null' in the email_address column definition):

id(int,auto) username(string) domain(string) password(string) 
email_address(string,null) ha1(string) ha1b(string) rpid(string,null)

And that should fix the problem.

Ted Trask

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=2901127&group_id=139143

_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to