<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Sorry, pls ingore my previous email. I just forgot to remove some echo command added by me before the if statement.<BR> <BR>
<HR id=stopSpelling>
From: kevin.jzh@hotmail.com<BR>To: klaus.mailinglists@pernau.at; sr-users@lists.sip-router.org<BR>Subject: RE: [SR-Users] Fail to add user account<BR>Date: Fri, 11 Jun 2010 07:57:47 +0800<BR><BR>
<STYLE>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Verdana;}
</STYLE>
Have changed the kamctl from <BR> if [ $? -eq 0 ] ; then<BR> minfo "user '$1' already exists"<BR> exit 1<BR> fi<BR> <BR> to <BR> if [ $? <FONT color=#ff0000>-ne 0 </FONT>] ; then<BR> minfo "user '$1' already exists"<BR> exit 1<BR> fi<BR> Now I can add user successfully.<BR> <BR> Seems it's a bug in the script in kamailio 3.0.2<BR> <BR>Thanks,<BR>Kevin<BR>> Date: Thu, 10 Jun 2010 16:48:13 +0200<BR>> From: klaus.mailinglists@pernau.at<BR>> To: kevin.jzh@hotmail.com<BR>> Subject: Re: [SR-Users] Fail to add user account<BR>> <BR>> I have no idea.<BR>> <BR>> Try supplying a domain too:<BR>> <BR>> kamctl add user@yourdomain.com passwd<BR>> <BR>> regards<BR>> klaus<BR>> <BR>> Am 10.06.2010 16:32, schrieb JinKevin:<BR>> > Thanks Klaus,<BR>> > <BR>> > After change the LAST_LINE in the kamctlrc, the tail error is going, but <BR>> > it still says user "xxxx" already exists.<BR>> > <BR>> > # tail tool<BR>> > LAST_LINE="tail -1"<BR>> > <BR>> > I find the script below returns "false" which makes the kamctl exit.<BR>> > <BR>> > # params: user<BR>> > # output: false if exists, true otherwise<BR>> > is_user() {<BR>> > set_user $1<BR>> > QUERY="select count(*) from $SUB_TABLE where \<BR>> > $SUBSCRIBER_COLUMN='$OSERUSER' and $REALM_COLUMN='$OSERDOMAIN';"<BR>> > CNT=`$DBROCMD "$QUERY" "$DBRAWPARAMS" | $EGREP -v ERROR | $LAST_LINE`<BR>> > mdbg "is_user: user counter=$CNT"<BR>> > if [ "$CNT" = "0" ] ; then<BR>> > false<BR>> > else<BR>> > true<BR>> > fi<BR>> > }<BR>> > <BR>> > <BR>> > What could be the cause?<BR>> > <BR>> > Thanks,<BR>> > Kevin<BR>> > <BR>> > <BR>> > > Date: Thu, 10 Jun 2010 10:11:18 +0200<BR>> > > From: klaus.mailinglists@pernau.at<BR>> > > To: kevin.jzh@hotmail.com<BR>> > > CC: sr-users@lists.sip-router.org<BR>> > > Subject: Re: [SR-Users] Fail to add user account<BR>> > ><BR>> > ><BR>> > ><BR>> > > Am 10.06.2010 03:12, schrieb JinKevin:<BR>> > > > AppSer01:root@/usr/local/kamailio-3.0/sbin$ kamctl add 2000 2000<BR>> > > > usage: tail [+/-[n][lbc][f]] [file]<BR>> > > > tail [+/-[n][l][r|f]] [file]<BR>> > > > INFO: user '2000' already exists<BR>> > ><BR>> > ><BR>> > > between your kamctl command and the error message (user '2000' already<BR>> > > exists) is an error produced by the tail command.<BR>> > ><BR>> > > Looks like kamctl uses tail in a way which is not supported on your OS.<BR>> > ><BR>> > > regards<BR>> > > klaus<BR>> > <BR>> > ------------------------------------------------------------------------<BR>> > 更多热辣资讯尽在新版MSN首页! 立刻访问! <http://cn.msn.com/><BR><BR>
<HR>
聊天+搜索+邮箱 想要轻松出游,手机MSN帮你搞定! <A href="http://3g.msn.cn/">立刻下载!</A>                                            <br /><hr />更多热辣资讯尽在新版MSN首页! <a href='http://cn.msn.com/' target='_new'>立刻访问!</a></body>
</html>