[Devel] openserctl probs

Daniel-Constantin Mierla daniel at voice-system.ro
Wed Jun 29 14:42:36 CEST 2005


Hello,

I reviewed a bit the script and, indeed, it was an extra check that 
forced error if sip uri was not user at domain. It is fixed on cvs. I 
attach a patch to use until the sourceforge pserver cvs gets 
synchronized (the patch also includes some ser=>openser name updates).

Cheers,
Daniel


On 06/29/05 15:19, Ingo Wolfsberger wrote:

>Hi
>
>  
>
>>On 06/29/05 02:06, Klaus Darilion wrote:
>>
>>    
>>
>>>Hi all!
>>>
>>>IMO the SIP_DOMAIN should be removed and a sip uri (user at domain) must 
>>>be used for provisioning.
>>>      
>>>
>>the sip uri can be given as user at domain and the domain part will be 
>>used. The script tests if there is a domain part and if not, takes the 
>>SIP_DOMAIN.
>>    
>>
>
>export SIP_DOMAIN=test
>openserctl add test test test at foo.com
> MySql password: 
>error: invalid AoR: test
>
>as far I have seen in the script, it does not honor the SIP_DOMAIN variable.
>
>bye, 
>    Ingo
>
>
>  
>
-------------- next part --------------
Index: scripts/sc
===================================================================
RCS file: /cvsroot/openser/sip-server/scripts/sc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- scripts/sc	26 Jun 2005 13:44:20 -0000	1.2
+++ scripts/sc	29 Jun 2005 10:33:08 -0000	1.3
@@ -1,8 +1,8 @@
 #!/bin/sh 
 #
-# $Id: sc,v 1.2 2005/06/26 13:44:20 miconda Exp $
+# $Id: sc,v 1.3 2005/06/29 10:33:08 miconda Exp $
 #
-# sc: ser control; tool for maintaining ser's databases
+# sc: openser control; tool for maintaining openser
 #
 # History:
 # --------
@@ -33,7 +33,7 @@
 fi
 
 ### version fo this script
-VERSION='1.1 - $Revision: 1.2 $'
+VERSION='1.1 - $Revision: 1.3 $'
 
 ##### ------------------------------------------------ #####
 ### configuration for starting/stopping ser
@@ -54,7 +54,7 @@
 fi
 
 ##### ----------------------------------------------- #####
-### ser's FIFO server
+### openser's FIFO server
 if [ -z "$SER_FIFO" ]; then
 	SER_FIFO=/tmp/openser_fifo
 fi
@@ -510,7 +510,7 @@
 	name=ser_receiver_$$
 	path=/tmp/$name
 	if [ ! -w $SER_FIFO ]; then
-		echo "Error opening ser's FIFO $SER_FIFO"
+		echo "Error opening openser's FIFO $SER_FIFO"
 		echo "Make sure you have line fifo=$SER_FIFO in your config"
 		exit 2
 	fi
@@ -668,7 +668,7 @@
 			fi
 
 			if [ "$CHECK_SUB" -ne 0 ] ; then
-				is_user 
+				is_user $1 
 				if [ $? -eq 0 ] ; then
 					echo overlap of alias with an existing subscriber name
 					exit 1;
@@ -749,7 +749,7 @@
 		show)
 			if [ $# -eq 2 ] ; then
 				set_user $2
-				is_user 
+				is_user $2 
 				if [ $? -ne 0 ] ; then
 					echo non-existent user
 					exit 1;
@@ -779,7 +779,7 @@
 
 			prompt_pw
 			set_user $2
-			is_user 
+			is_user $2 
 			if [ $? -ne 0 ] ; then
 				echo non-existent user
 				exit 1
@@ -860,7 +860,7 @@
 		show)
 			if [ $# -eq 2 ] ; then
 				set_user $2
-				is_user 
+				is_user $2 
 				if [ $? -ne 0 ] ; then
 					echo non-existent user
 					exit 1;
@@ -882,7 +882,7 @@
 			fi
 			prompt_pw
 			set_user $2
-			is_user 
+			is_user $2 
 			if [ $? -ne 0 ] ; then
 				echo non-existent user
 				exit 1
@@ -948,6 +948,8 @@
 # params: user
 # output: false if exists, true otherwise
 is_user() {
+	set_user $1
+	
 	QUERY="select count(*) from $SUB_TABLE \
 		where $SUBSCRIBER_COLUMN='$SERUSER' and $REALM_COLUMN='$SERDOMAIN';"
 	CNT=`sql_ro_query "$QUERY" | grep -v ERROR | $LAST_LINE`
@@ -962,12 +964,6 @@
 # output: false if exists, true otherwise
 is_alias_db()
 {
-	check_aor "$1"
-	if [ "$?" -ne "0" ] ; then
-		echo "is_alias_db: <$1> is not a valid AoR (user at domain)"
-		exit 1
-	fi
-				
 	set_user $1
 	
 	QUERY="select count(*) from $DA_TABLE \
@@ -1758,7 +1754,7 @@
 		name=ser_receiver_$$
 		path=/tmp/$name
 		if [ ! -w $SER_FIFO ]; then
-			echo "Error opening ser's FIFO $SER_FIFO"
+			echo "Error opening openser's FIFO $SER_FIFO"
 			echo "Make sure you have line fifo=$SER_FIFO in your config"
 			exit 1
 		fi
@@ -1847,8 +1843,7 @@
 	showdb|userdb)
 		shift
 		if [ $# -eq 1 ] ; then
-			set_user $1
-			is_user
+			is_user $1
 			if [ $? -ne 0 ] ; then
 				echo non-existent user
 				exit 1;
@@ -1881,8 +1876,7 @@
 		shift 
 		prompt_pw 
 
-		set_user $1
-		is_user 
+		is_user $1 
 		if [ $? -ne 0 ] ; then
 			echo non-existent user
 			exit 1


More information about the Devel mailing list