Parcourir la source

added support for redirection

Jiri Kuthan il y a 23 ans
Parent
commit
fcefd3f4d8
2 fichiers modifiés avec 46 ajouts et 0 suppressions
  1. 3 0
      config.h
  2. 43 0
      etc/redirect.cfg

+ 3 - 0
config.h

@@ -101,4 +101,7 @@
 #define FIFO_DIR "/tmp/"
 /* max length of the text of fifo 'print' command */
 #define MAX_PRINT_TEXT 256
+
+/* maximum length of Contact heder field in redirection replies */
+#define MAX_REDIRECTION_LEN 512
 #endif

+ 43 - 0
etc/redirect.cfg

@@ -0,0 +1,43 @@
+#
+# $Id$
+#
+# iptel.org real world configuration
+#
+
+# ----------- global configuration parameters ------------------------
+
+debug=3
+fork=no
+log_stderror=yes	# (cmd line: -E)
+check_via=no # (cmd. line: -v)
+dns=no # (cmd. line: -r)
+syn_branch=1
+reply_to_via=0
+
+# advertise IP address in Via (as opposed to advertising DNS name
+# which is annoying for downstream servers and some phones can
+# not handle DNS at all)
+listen=195.37.77.100
+
+# ------------------ module loading ----------------------------------
+
+loadmodule "../sip_router/modules/sl/sl.so"
+loadmodule "../sip_router/modules/print/print.so"
+
+
+# -------------------------  request routing logic -------------------
+
+# main routing logic
+
+route{
+	# for testing purposes, simply okay all REGISTERs
+	if (method=="REGISTER") {
+		log("REGISTER");
+		sl_send_reply("200", "ok");
+		break;
+	};
+	append_branch("sip:[email protected]:9");
+	append_branch("sip:[email protected]:9");
+	sl_send_reply("300", "Redirect");
+}
+