Browse Source

examples aligned to 8.11

Jiri Kuthan 22 years ago
parent
commit
c96013a1b4
9 changed files with 29 additions and 27 deletions
  1. 5 5
      examples/acc.cfg
  2. 3 2
      examples/ccdiversion.cfg
  3. 1 1
      examples/exec.cfg
  4. 2 1
      examples/exec_s5b.cfg
  5. 0 7
      examples/msilo.cfg
  6. 2 0
      examples/onr.cfg
  7. 14 10
      examples/pstn.cfg
  8. 1 0
      examples/replicate.cfg
  9. 1 1
      examples/uas.cfg

+ 5 - 5
examples/acc.cfg

@@ -19,7 +19,7 @@ loadmodule "modules/rr/rr.so"
 modparam("acc", "log_level", 1)
 # number of flag, which will be used for accounting; if a message is
 # labeled with this flag, its completion status will be reported
-modparam("acc", "acc_flag", 1 )
+modparam("acc", "log_flag", 1 )
 
 # -------------------------  request routing logic -------------------
 
@@ -40,15 +40,15 @@ route{
 		break;
 	};
 
-    # Do strict routing if pre-loaded route headers present due to
-	# previous use of record-routing
-    rewriteFromRoute();
+    #  Process record-routing
+    if (loose_route()) { t_relay(); break; };
+
 
 	# labeled all transaction for accounting
 	setflag(1);
 
 	# record-route INVITES to make sure BYEs will visit our server too
-	if (method=="INVITE") addRecordRoute();
+	if (method=="INVITE") record_route();
 
 	# forward the request statefuly now; (we need *stateful* forwarding,
 	# because the stateful mode correlates requests with replies and

+ 3 - 2
examples/ccdiversion.cfg

@@ -10,12 +10,12 @@ loadmodule "modules/tm/tm.so"
 
 route{
 	# if we do not get a positive reply, continue at reply_route[2]
-	t_on_negative("2");
+	t_on_failure("2");
 	# forward the request to all destinations in destination set now 
 	t_relay();
 }
 
-reply_route[2] {
+failure_route[2] {
 	# request failed (no reply, busy, whatever) ... forward it again
 	# to pbx's voicemail at phone number 6000 via Cisco gateway at
 	# 192.168.10.10; append proprietary CC-Diversion header field with
@@ -23,5 +23,6 @@ reply_route[2] {
 	# know, whom the request was originally intended for
 	append_branch("sip:[email protected]");
 	append_urihf("CC-Diversion: ", "\r\n");
+	t_relay();
 }
 

+ 1 - 1
examples/exec.cfg

@@ -26,7 +26,7 @@ route{
 	exec_msg("printenv SRCIP > /tmp/exectest.txt; cat >> /tmp/exectest.txt");
 	# and then rewrite URI using external utility
 	# note that the last echo command trashes input parameter
-	if (exec_dst("echo sip:[email protected];echo sip:[email protected];echo>/dev/null")) {
+	if (exec_dset("echo sip:[email protected];echo sip:[email protected];echo>/dev/null")) {
 		sl_send_reply("300", "Redirect");
 	} else {
 		sl_reply_error();

+ 2 - 1
examples/exec_s5b.cfg

@@ -69,11 +69,12 @@ route[1] {
 
 reply_route[1] {
 	# just call exec, that's it
-     	exec_msg('
+   	exec_msg('
 		QUERY="select email_address from subscriber 
 			where user=\"$SIP_OUSER\"";
 		EMAIL=`mysql  -Bsuser -pheslo -e "$QUERY" ser`;
 		if [ -z "$EMAIL" ] ; then exit 1; fi ;
 		echo "SIP request received from $SIP_HF_FROM for $SIP_OUSER" |
 		mail -s "request for you" $EMAIL ') ;
+	t_relay();
 }

+ 0 - 7
examples/msilo.cfg

@@ -5,18 +5,12 @@
 #
 
 
-debug=9          # debug level (cmd line: -dddddddddd)
-fork=no
-log_stderror=yes  # (cmd line: -E)
-
 
 children=2
 check_via=no      # (cmd. line: -v)
 dns=off           # (cmd. line: -r)
 rev_dns=off       # (cmd. line: -R)
-port=5060
 
-listen=10.0.0.2
 
 # ------------------ module loading ----------------------------------
 
@@ -62,7 +56,6 @@ route{
 
 
 	if (uri==myself) {
-	{
 		# for testing purposes, simply okay all REGISTERs
 		if (method=="REGISTER")
 		{

+ 2 - 0
examples/onr.cfg

@@ -50,6 +50,7 @@ failure_route[1] {
 	log(1,"first redirection\n");
 	# if this alternative destination fails too, proceed to reply_route[2] 
 	t_on_failure("2");
+	t_relay();
 }
 
 failure_route[2] {
@@ -58,4 +59,5 @@ failure_route[2] {
 	log(1, "second redirection\n");
 	# we no more call t_on_negative here; if this destination
 	# fails too, transaction will complete
+	t_relay();
 }

+ 14 - 10
examples/pstn.cfg

@@ -14,18 +14,21 @@ loadmodule "modules/rr/rr.so"
 loadmodule "modules/maxfwd/maxfwd.so"
 loadmodule "modules/mysql/mysql.so"
 loadmodule "modules/auth/auth.so"
+loadmodule "modules/auth_db/auth_db.so"
+loadmodule "modules/group/group.so"
+loadmodule "modules/uri/uri.so"
 
 # ----------------- setting module-specific parameters ---------------
 
-modparam("auth", "db_url","sql://ser:heslo@localhost/ser")
-modparam("auth", "calculate_ha1", yes)
-modparam("auth", "password_column", "password")
+modparam("auth_db", "db_url","sql://ser:heslo@localhost/ser")
+modparam("auth_db", "calculate_ha1", yes)
+modparam("auth_db", "password_column", "password")
 
 # -- acc params --
 modparam("acc", "log_level", 1)
 # that is the flag for which we will account -- don't forget to
 # set the same one :-)
-modparam("acc", "acc_flag", 1 )
+modparam("acc", "log_flag", 1 )
 
 # -------------------------  request routing logic -------------------
 
@@ -48,11 +51,12 @@ route{
 
 	/* ********* RR ********************************** */
 
-	/* Do strict routing if route headers present */
-	rewriteFromRoute();
+	/* grant Route routing if route headers present */
+	if (loose_route()) { t_relay(); break; };
+	
 	/* record-route INVITEs -- all subsequent requests must visit us */
 	if (method=="INVITE") {
-		addRecordRoute();
+		record_route();
 	};
 
 	# now check if it really is a PSTN destination which should be handled
@@ -102,19 +106,19 @@ route{
 			# calls (destinations beginning with a single zero)? 
 			# (i.e., is he in the "local" group?)
 			if (uri=~"sip:0[1-9][0-9]+@.*") {
-				if (!is_in_group("local")) {
+				if (!is_user_in("credentials", "local")) {
 					sl_send_reply("403", "No permission for local calls"); 
 					break;
 				};
 			# the same for long-distance (destinations begin with two zeros")
 			} else if (uri=~"sip:00[1-9][0-9]+@.*") {
-				if (!is_in_group("ld")) {
+				if (!is_user_in("credentials", "ld")) {
 					sl_send_reply("403", " no permission for LD ");
 					break;
 				};
 			# the same for international calls (three zeros)
 			} else if (uri=~"sip:000[1-9][0-9]+@.*") {
-				if (!is_in_group("int")) {
+				if (!is_user_in("credentials", "int")) {
 					sl_send_reply("403", "International permissions needed");
 					break;
 				};

+ 1 - 0
examples/replicate.cfg

@@ -19,6 +19,7 @@ loadmodule "modules/maxfwd/maxfwd.so"
 loadmodule "modules/usrloc/usrloc.so"
 loadmodule "modules/registrar/registrar.so"
 loadmodule "modules/auth/auth.so"
+loadmodule "modules/auth_db/auth_db.so"
 
 # ----------------- setting module-specific parameters ---------------
 

+ 1 - 1
examples/uas.cfg

@@ -44,6 +44,6 @@ route{
 		if (!t_reply("699", "I don't want to chat with you")) {
 			sl_reply_error();
 		};
-    	};
+   	};
 }