|
@@ -27,18 +27,15 @@ if ! (check_sipsak && check_kamailio && check_module "db_postgres" && check_post
|
|
|
exit 0
|
|
|
fi ;
|
|
|
|
|
|
-CFG=11.cfg
|
|
|
-
|
|
|
-cp $CFG $CFG.tmp
|
|
|
-echo "loadmodule \"$SRC_DIR/modules/db_postgres/db_postgres.so\"" >> $CFG
|
|
|
-echo "modparam(\"usrloc\", \"db_url\", \"postgres://kamailio:kamailiorw@localhost/kamailio\")" >> $CFG
|
|
|
+SIPDOMAIN=127.0.0.1
|
|
|
+CFG=22.cfg
|
|
|
|
|
|
$BIN -w . -f $CFG > /dev/null
|
|
|
ret=$?
|
|
|
|
|
|
sleep 1
|
|
|
# register a user
|
|
|
-sipsak -U -C sip:foobar@localhost -s sip:49721123456789@localhost -H localhost &> /dev/null
|
|
|
+sipsak -U -C sip:foobar@127.0.0.1 -s sip:49721123456789@$SIPDOMAIN -H $SIPDOMAIN &> /dev/null
|
|
|
ret=$?
|
|
|
|
|
|
if [ "$ret" -eq 0 ]; then
|
|
@@ -55,7 +52,7 @@ fi;
|
|
|
|
|
|
if [ "$ret" -eq 0 ]; then
|
|
|
# unregister the user
|
|
|
- sipsak -U -C "*" -s sip:49721123456789@127.0.0.1 -H localhost -x 0 &> /dev/null
|
|
|
+ sipsak -U -C "*" -s sip:49721123456789@$SIPDOMAIN -H $SIPDOMAIN -x 0 &> /dev/null
|
|
|
fi;
|
|
|
|
|
|
if [ "$ret" -eq 0 ]; then
|
|
@@ -76,7 +73,7 @@ $PSQL "delete from location where username like '49721123456789%';"
|
|
|
|
|
|
if [ "$ret" -eq 0 ]; then
|
|
|
# register again
|
|
|
- sipsak -U -C sip:foobar@localhost -s sip:49721123456789@localhost -H localhost &> /dev/null
|
|
|
+ sipsak -U -C sip:foobar@127.0.0.1 -s sip:49721123456789@$SIPDOMAIN -H $SIPDOMAIN &> /dev/null
|
|
|
ret=$?
|
|
|
fi;
|
|
|
|
|
@@ -90,7 +87,7 @@ sleep 1
|
|
|
|
|
|
if [ "$ret" -eq 0 ]; then
|
|
|
# check if the contact is still registered
|
|
|
- sipsak -U -C empty -s sip:49721123456789@127.0.0.1 -H localhost -q "Contact: <sip:foobar@localhost>" &> /dev/null
|
|
|
+ sipsak -U -C empty -s sip:49721123456789@$SIPDOMAIN -H $SIPDOMAIN -q "Contact: <sip:[email protected]>" &> /dev/null
|
|
|
ret=$?
|
|
|
fi;
|
|
|
|
|
@@ -104,6 +101,4 @@ $KILL
|
|
|
|
|
|
$PSQL "delete from location where username like '49721123456789%';"
|
|
|
|
|
|
-mv $CFG.tmp $CFG
|
|
|
-
|
|
|
exit $ret
|