[SR-Users] Kamctl cannot add user to pgsql

Pavlo Karbovnyk pavlo.16 at gmail.com
Sat Oct 17 02:32:18 CEST 2015


Good Day All.

I run into following problem:
(It may be helpful for other people how have similar problem)

kamctl add 1000 password
database engine 'PGSQL' loaded
Control engine 'FIFO' loaded
is_user: user counter=0                   <--- showing counter=0
check_db_alias: alias counter=            <--- showing counter= nothing
INFO: user '1000' already exists as alias

============================================================
how to fix it :

in kamctl locate a function

check_db_alias() {
.....
      CNT=`$DBROCMD "$QUERY" | $EGREP -v ERROR | $LAST_LINE`
.....
}

replace with CNT command with following:

check_db_alias() {
.....
      CNT=`$DBROCMD "$QUERY" "$DBRAWPARAMS" | $EGREP -v ERROR |
$LAST_LINE`
.....
}

============================================================
after this

kamctl add 1000 password
database engine 'PGSQL' loaded
Control engine 'FIFO' loaded
is_user: user counter=0
check_db_alias: alias counter=0
pgsql_query: /usr/bin/psql  -A -q -t -P fieldsep='	' -h
localhost -U kamailio kamailio -c 'insert into subscriber (username,	
			domain,ha1,ha1b,password) 			
	values
('1000','127.0.0.1','6fda0594de6ea94b03a12fdd998758ae','31e118ac5b09f07
1858740d6125d901d','');'
new user '1000' added

Regards Pavlo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20151016/fd064b6a/attachment.html>


More information about the sr-users mailing list